@lotte-innovate/ui-component-test 0.0.112 → 0.0.114
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/lib/_virtual/index.mjs +2 -0
- package/dist/lib/_virtual/index10.mjs +2 -0
- package/dist/lib/_virtual/index10.mjs.map +1 -0
- package/dist/lib/_virtual/index11.mjs +2 -0
- package/dist/lib/_virtual/index11.mjs.map +1 -0
- package/dist/lib/_virtual/index12.mjs +2 -0
- package/dist/lib/_virtual/index12.mjs.map +1 -0
- package/dist/lib/_virtual/index13.mjs +2 -0
- package/dist/lib/_virtual/index13.mjs.map +1 -0
- package/dist/lib/_virtual/index14.mjs +2 -0
- package/dist/lib/_virtual/index14.mjs.map +1 -0
- package/dist/lib/_virtual/index2.mjs +2 -0
- package/dist/lib/_virtual/index2.mjs.map +1 -0
- package/dist/lib/_virtual/index3.mjs +2 -0
- package/dist/lib/_virtual/index3.mjs.map +1 -0
- package/dist/lib/_virtual/index4.mjs +2 -0
- package/dist/lib/_virtual/index4.mjs.map +1 -0
- package/dist/lib/_virtual/index5.mjs +2 -0
- package/dist/lib/_virtual/index5.mjs.map +1 -0
- package/dist/lib/_virtual/index6.mjs +2 -0
- package/dist/lib/_virtual/index6.mjs.map +1 -0
- package/dist/lib/_virtual/index7.mjs +2 -0
- package/dist/lib/_virtual/index7.mjs.map +1 -0
- package/dist/lib/_virtual/index8.mjs +2 -0
- package/dist/lib/_virtual/index8.mjs.map +1 -0
- package/dist/lib/_virtual/index9.mjs +2 -0
- package/dist/lib/_virtual/index9.mjs.map +1 -0
- package/dist/lib/_virtual/model.mjs +2 -0
- package/dist/lib/_virtual/model.mjs.map +1 -0
- package/dist/lib/_virtual/plugin.mjs +2 -0
- package/dist/lib/_virtual/plugin.mjs.map +1 -0
- package/dist/lib/_virtual/plugin2.mjs +2 -0
- package/dist/lib/_virtual/plugin2.mjs.map +1 -0
- package/dist/lib/_virtual/plugin3.mjs +2 -0
- package/dist/lib/_virtual/plugin3.mjs.map +1 -0
- package/dist/lib/_virtual/plugin4.mjs +2 -0
- package/dist/lib/_virtual/plugin4.mjs.map +1 -0
- package/dist/lib/_virtual/plugin5.mjs +2 -0
- package/dist/lib/_virtual/plugin5.mjs.map +1 -0
- package/dist/lib/_virtual/theme.mjs +2 -0
- package/dist/lib/_virtual/theme.mjs.map +1 -0
- package/dist/lib/components/Editor/index.d.ts +11 -13
- package/dist/lib/components/Editor/index.js +11 -13
- package/dist/lib/lib/color/alpha.mjs.map +1 -0
- package/dist/lib/lib/color/constants.mjs.map +1 -0
- package/dist/lib/lib/color/light.mjs.map +1 -0
- package/dist/lib/lib/components/AlertDialog/index.mjs.map +1 -0
- package/dist/lib/lib/components/BarChart/index.mjs.map +1 -0
- package/dist/lib/lib/components/Breadcrumb/BreadcrumbEllipsis.mjs.map +1 -0
- package/dist/lib/lib/components/Breadcrumb/BreadcrumbItem.mjs.map +1 -0
- package/dist/lib/lib/components/Breadcrumb/BreadcrumbLink.mjs.map +1 -0
- package/dist/lib/lib/components/Breadcrumb/BreadcrumbList.mjs.map +1 -0
- package/dist/lib/lib/components/Breadcrumb/BreadcrumbPage.mjs.map +1 -0
- package/dist/lib/lib/components/Breadcrumb/BreadcrumbSeparator.mjs.map +1 -0
- package/dist/lib/lib/components/Breadcrumb/index.mjs.map +1 -0
- package/dist/lib/lib/components/BubbleChart/index.mjs.map +1 -0
- package/dist/lib/lib/components/Callout/index.mjs.map +1 -0
- package/dist/lib/lib/components/CheckboxGroup/index.mjs.map +1 -0
- package/dist/lib/lib/components/ContextMenu/ContextMenuGroup.mjs.map +1 -0
- package/dist/lib/lib/components/ContextMenu/ContextMenuSeparator.mjs.map +1 -0
- package/dist/lib/lib/components/ContextMenu/ContextMenuTrigger.mjs.map +1 -0
- package/dist/lib/lib/components/ContextMenu/index.mjs.map +1 -0
- package/dist/lib/lib/components/DataList/index.mjs.map +1 -0
- package/dist/lib/lib/components/Dialog/DialogTrigger.mjs.map +1 -0
- package/dist/lib/lib/components/Dialog/index.mjs.map +1 -0
- package/dist/lib/lib/components/DoughnutChart/index.mjs.map +1 -0
- package/dist/lib/lib/components/DropdownMenu/DropdonMenuRadioGroup.mjs.map +1 -0
- package/dist/lib/lib/components/DropdownMenu/DropdownMenuSeparator.mjs.map +1 -0
- package/dist/lib/lib/components/DropdownMenu/DropdownMenuSub.mjs.map +1 -0
- package/dist/lib/lib/components/DropdownMenu/index.mjs.map +1 -0
- package/dist/lib/lib/components/Editor/index.mjs +3 -0
- package/dist/lib/lib/components/Gnb/GnbLogo.mjs.map +1 -0
- package/dist/lib/lib/components/Gnb/index.mjs.map +1 -0
- package/dist/lib/lib/components/Grid/Pagination.mjs.map +1 -0
- package/dist/lib/lib/components/HoverCard/HoverCardTrigger.mjs.map +1 -0
- package/dist/lib/lib/components/HoverCard/index.mjs.map +1 -0
- package/dist/lib/lib/components/LineChart/index.mjs.map +1 -0
- package/dist/lib/lib/components/Menubar/MenubarMenu.mjs.map +1 -0
- package/dist/lib/lib/components/Menubar/MenubarSeparator.mjs.map +1 -0
- package/dist/lib/lib/components/Menubar/MenubarSub.mjs.map +1 -0
- package/dist/lib/lib/components/Menubar/index.mjs.map +1 -0
- package/dist/lib/lib/components/NavigationMenu/NavigationMenuIndicator.mjs.map +1 -0
- package/dist/lib/lib/components/NavigationMenu/NavigationMenuItem.mjs.map +1 -0
- package/dist/lib/lib/components/NavigationMenu/index.mjs.map +1 -0
- package/dist/lib/lib/components/PieChart/index.mjs.map +1 -0
- package/dist/lib/lib/components/Popover/PopoverTrigger.mjs.map +1 -0
- package/dist/lib/lib/components/Popover/index.mjs.map +1 -0
- package/dist/lib/lib/components/RadarChart/index.mjs.map +1 -0
- package/dist/lib/lib/components/RadioCards/index.mjs.map +1 -0
- package/dist/lib/lib/components/RadioGroup/index.mjs.map +1 -0
- package/dist/lib/lib/components/SegmentedControl/SegmentedControlItem.mjs.map +1 -0
- package/dist/lib/lib/components/SegmentedControl/index.mjs.map +1 -0
- package/dist/lib/lib/components/Toast/index.mjs.map +1 -0
- package/dist/lib/lib/components/ToggleGroup/index.mjs.map +1 -0
- package/dist/lib/lib/constants.mjs.map +1 -0
- package/dist/lib/lib/index.mjs.map +1 -0
- package/dist/lib/lib/utils/utils.mjs.map +1 -0
- package/{public/tinymce/icons/default/icons.min.js → dist/lib/public/tinymce/icons/default/icons.mjs} +3 -1
- package/dist/lib/public/tinymce/icons/default/icons.mjs.map +1 -0
- package/dist/lib/public/tinymce/models/dom/index.mjs +2 -0
- package/dist/lib/public/tinymce/models/dom/index.mjs.map +1 -0
- package/dist/lib/public/tinymce/models/dom/model.mjs +2 -0
- package/dist/lib/public/tinymce/models/dom/model.mjs.map +1 -0
- package/dist/lib/public/tinymce/plugins/advlist/index.mjs +2 -0
- package/dist/lib/public/tinymce/plugins/advlist/index.mjs.map +1 -0
- package/dist/lib/public/tinymce/plugins/advlist/plugin.mjs +2 -0
- package/dist/lib/public/tinymce/plugins/advlist/plugin.mjs.map +1 -0
- package/dist/lib/public/tinymce/plugins/code/index.mjs +2 -0
- package/dist/lib/public/tinymce/plugins/code/index.mjs.map +1 -0
- package/dist/lib/public/tinymce/plugins/code/plugin.mjs +2 -0
- package/dist/lib/public/tinymce/plugins/code/plugin.mjs.map +1 -0
- package/dist/lib/public/tinymce/plugins/link/index.mjs +2 -0
- package/dist/lib/public/tinymce/plugins/link/index.mjs.map +1 -0
- package/dist/lib/public/tinymce/plugins/link/plugin.mjs +2 -0
- package/dist/lib/public/tinymce/plugins/link/plugin.mjs.map +1 -0
- package/dist/lib/public/tinymce/plugins/lists/index.mjs +2 -0
- package/dist/lib/public/tinymce/plugins/lists/index.mjs.map +1 -0
- package/dist/lib/public/tinymce/plugins/lists/plugin.mjs +2 -0
- package/dist/lib/public/tinymce/plugins/lists/plugin.mjs.map +1 -0
- package/dist/lib/public/tinymce/plugins/table/index.mjs +2 -0
- package/dist/lib/public/tinymce/plugins/table/index.mjs.map +1 -0
- package/dist/lib/public/tinymce/plugins/table/plugin.mjs +2 -0
- package/dist/lib/public/tinymce/plugins/table/plugin.mjs.map +1 -0
- package/dist/lib/public/tinymce/skins/content/default/content.mjs +3 -0
- package/dist/lib/public/tinymce/skins/content/default/content.mjs.map +1 -0
- package/dist/lib/public/tinymce/skins/ui/oxide/content.mjs +3 -0
- package/dist/lib/public/tinymce/skins/ui/oxide/content.mjs.map +1 -0
- package/dist/lib/public/tinymce/skins/ui/oxide/skin.mjs +3 -0
- package/dist/lib/public/tinymce/skins/ui/oxide/skin.mjs.map +1 -0
- package/dist/lib/public/tinymce/themes/silver/index.mjs +2 -0
- package/dist/lib/public/tinymce/themes/silver/index.mjs.map +1 -0
- package/dist/lib/public/tinymce/themes/silver/theme.mjs +2 -0
- package/dist/lib/public/tinymce/themes/silver/theme.mjs.map +1 -0
- package/dist/lib/tsconfig.tsbuildinfo +1 -1
- package/dist/public/tinymce/icons/default/icons.d.ts +0 -0
- package/dist/public/tinymce/icons/default/icons.js +195 -0
- package/dist/public/tinymce/icons/default/index.d.ts +1 -0
- package/{public → dist/public}/tinymce/icons/default/index.js +1 -1
- package/dist/public/tinymce/models/dom/index.d.ts +1 -0
- package/{public → dist/public}/tinymce/models/dom/index.js +2 -1
- package/dist/public/tinymce/models/dom/model.d.ts +0 -0
- package/dist/public/tinymce/models/dom/model.js +7988 -0
- package/dist/public/tinymce/plugins/advlist/index.d.ts +1 -0
- package/{public → dist/public}/tinymce/plugins/advlist/index.js +2 -1
- package/dist/public/tinymce/plugins/advlist/plugin.d.ts +0 -0
- package/dist/public/tinymce/plugins/advlist/plugin.js +255 -0
- package/dist/public/tinymce/plugins/autolink/index.d.ts +1 -0
- package/{public → dist/public}/tinymce/plugins/autolink/index.js +2 -1
- package/dist/public/tinymce/plugins/autolink/plugin.d.ts +0 -0
- package/dist/public/tinymce/plugins/autolink/plugin.js +221 -0
- package/dist/public/tinymce/plugins/code/index.d.ts +1 -0
- package/{public → dist/public}/tinymce/plugins/code/index.js +2 -1
- package/dist/public/tinymce/plugins/code/plugin.d.ts +0 -0
- package/dist/public/tinymce/plugins/code/plugin.js +77 -0
- package/dist/public/tinymce/plugins/codesample/index.d.ts +1 -0
- package/{public → dist/public}/tinymce/plugins/codesample/index.js +2 -1
- package/dist/public/tinymce/plugins/codesample/plugin.d.ts +45 -0
- package/dist/public/tinymce/plugins/codesample/plugin.js +2462 -0
- package/dist/public/tinymce/plugins/image/index.d.ts +1 -0
- package/{public → dist/public}/tinymce/plugins/image/index.js +2 -1
- package/dist/public/tinymce/plugins/image/plugin.d.ts +0 -0
- package/dist/public/tinymce/plugins/image/plugin.js +1523 -0
- package/dist/public/tinymce/plugins/link/index.d.ts +1 -0
- package/{public → dist/public}/tinymce/plugins/link/index.js +2 -1
- package/dist/public/tinymce/plugins/link/plugin.d.ts +0 -0
- package/dist/public/tinymce/plugins/link/plugin.js +1246 -0
- package/dist/public/tinymce/plugins/lists/index.d.ts +1 -0
- package/{public → dist/public}/tinymce/plugins/lists/index.js +2 -1
- package/dist/public/tinymce/plugins/lists/plugin.d.ts +0 -0
- package/dist/public/tinymce/plugins/lists/plugin.js +2191 -0
- package/dist/public/tinymce/plugins/table/index.d.ts +1 -0
- package/{public → dist/public}/tinymce/plugins/table/index.js +2 -1
- package/dist/public/tinymce/plugins/table/plugin.d.ts +0 -0
- package/dist/public/tinymce/plugins/table/plugin.js +3399 -0
- package/dist/public/tinymce/skins/content/default/content.d.ts +0 -0
- package/{public → dist/public}/tinymce/skins/content/default/content.js +2 -1
- package/dist/public/tinymce/skins/ui/oxide/content.d.ts +0 -0
- package/dist/public/tinymce/skins/ui/oxide/content.inline.d.ts +0 -0
- package/{public → dist/public}/tinymce/skins/ui/oxide/content.inline.js +2 -1
- package/{public → dist/public}/tinymce/skins/ui/oxide/content.js +2 -1
- package/dist/public/tinymce/skins/ui/oxide/skin.d.ts +0 -0
- package/{public → dist/public}/tinymce/skins/ui/oxide/skin.js +2 -1
- package/dist/public/tinymce/skins/ui/oxide/skin.shadowdom.d.ts +0 -0
- package/{public → dist/public}/tinymce/skins/ui/oxide/skin.shadowdom.js +2 -1
- package/dist/public/tinymce/skins/ui/oxide-dark/content.d.ts +0 -0
- package/dist/public/tinymce/skins/ui/oxide-dark/content.inline.d.ts +0 -0
- package/{public → dist/public}/tinymce/skins/ui/oxide-dark/content.inline.js +2 -1
- package/{public → dist/public}/tinymce/skins/ui/oxide-dark/content.js +2 -1
- package/dist/public/tinymce/skins/ui/oxide-dark/skin.d.ts +0 -0
- package/{public → dist/public}/tinymce/skins/ui/oxide-dark/skin.js +2 -1
- package/dist/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.d.ts +0 -0
- package/{public → dist/public}/tinymce/skins/ui/oxide-dark/skin.shadowdom.js +2 -1
- package/dist/public/tinymce/themes/silver/index.d.ts +1 -0
- package/{public → dist/public}/tinymce/themes/silver/index.js +2 -1
- package/dist/public/tinymce/themes/silver/theme.d.ts +0 -0
- package/dist/public/tinymce/themes/silver/theme.js +29731 -0
- package/dist/public/tinymce/tinymce.d.ts +1 -0
- package/dist/public/tinymce/tinymce.js +31974 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -2
- package/dist/lib/color/alpha.mjs.map +0 -1
- package/dist/lib/color/constants.mjs.map +0 -1
- package/dist/lib/color/light.mjs.map +0 -1
- package/dist/lib/components/AlertDialog/index.mjs.map +0 -1
- package/dist/lib/components/BarChart/index.mjs.map +0 -1
- package/dist/lib/components/Breadcrumb/BreadcrumbEllipsis.mjs.map +0 -1
- package/dist/lib/components/Breadcrumb/BreadcrumbItem.mjs.map +0 -1
- package/dist/lib/components/Breadcrumb/BreadcrumbLink.mjs.map +0 -1
- package/dist/lib/components/Breadcrumb/BreadcrumbList.mjs.map +0 -1
- package/dist/lib/components/Breadcrumb/BreadcrumbPage.mjs.map +0 -1
- package/dist/lib/components/Breadcrumb/BreadcrumbSeparator.mjs.map +0 -1
- package/dist/lib/components/Breadcrumb/index.mjs.map +0 -1
- package/dist/lib/components/BubbleChart/index.mjs.map +0 -1
- package/dist/lib/components/Callout/index.mjs.map +0 -1
- package/dist/lib/components/CheckboxGroup/index.mjs.map +0 -1
- package/dist/lib/components/ContextMenu/ContextMenuGroup.mjs.map +0 -1
- package/dist/lib/components/ContextMenu/ContextMenuSeparator.mjs.map +0 -1
- package/dist/lib/components/ContextMenu/ContextMenuTrigger.mjs.map +0 -1
- package/dist/lib/components/ContextMenu/index.mjs.map +0 -1
- package/dist/lib/components/DataList/index.mjs.map +0 -1
- package/dist/lib/components/Dialog/DialogTrigger.mjs.map +0 -1
- package/dist/lib/components/Dialog/index.mjs.map +0 -1
- package/dist/lib/components/DoughnutChart/index.mjs.map +0 -1
- package/dist/lib/components/DropdownMenu/DropdonMenuRadioGroup.mjs.map +0 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuSeparator.mjs.map +0 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuSub.mjs.map +0 -1
- package/dist/lib/components/DropdownMenu/index.mjs.map +0 -1
- package/dist/lib/components/Editor/index.mjs +0 -3
- package/dist/lib/components/Gnb/GnbLogo.mjs.map +0 -1
- package/dist/lib/components/Gnb/index.mjs.map +0 -1
- package/dist/lib/components/Grid/Pagination.mjs.map +0 -1
- package/dist/lib/components/HoverCard/HoverCardTrigger.mjs.map +0 -1
- package/dist/lib/components/HoverCard/index.mjs.map +0 -1
- package/dist/lib/components/LineChart/index.mjs.map +0 -1
- package/dist/lib/components/Menubar/MenubarMenu.mjs.map +0 -1
- package/dist/lib/components/Menubar/MenubarSeparator.mjs.map +0 -1
- package/dist/lib/components/Menubar/MenubarSub.mjs.map +0 -1
- package/dist/lib/components/Menubar/index.mjs.map +0 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuIndicator.mjs.map +0 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuItem.mjs.map +0 -1
- package/dist/lib/components/NavigationMenu/index.mjs.map +0 -1
- package/dist/lib/components/PieChart/index.mjs.map +0 -1
- package/dist/lib/components/Popover/PopoverTrigger.mjs.map +0 -1
- package/dist/lib/components/Popover/index.mjs.map +0 -1
- package/dist/lib/components/RadarChart/index.mjs.map +0 -1
- package/dist/lib/components/RadioCards/index.mjs.map +0 -1
- package/dist/lib/components/RadioGroup/index.mjs.map +0 -1
- package/dist/lib/components/SegmentedControl/SegmentedControlItem.mjs.map +0 -1
- package/dist/lib/components/SegmentedControl/index.mjs.map +0 -1
- package/dist/lib/components/Toast/index.mjs.map +0 -1
- package/dist/lib/components/ToggleGroup/index.mjs.map +0 -1
- package/dist/lib/constants.mjs.map +0 -1
- package/dist/lib/utils/utils.mjs.map +0 -1
- package/public/tinymce/CHANGELOG.md +0 -3453
- package/public/tinymce/README.md +0 -73
- package/public/tinymce/bower.json +0 -27
- package/public/tinymce/composer.json +0 -52
- package/public/tinymce/icons/default/icons.js +0 -194
- package/public/tinymce/license.txt +0 -21
- package/public/tinymce/models/dom/model.js +0 -8040
- package/public/tinymce/models/dom/model.min.js +0 -4
- package/public/tinymce/package.json +0 -32
- package/public/tinymce/plugins/advlist/plugin.js +0 -259
- package/public/tinymce/plugins/advlist/plugin.min.js +0 -4
- package/public/tinymce/plugins/autolink/plugin.js +0 -228
- package/public/tinymce/plugins/autolink/plugin.min.js +0 -4
- package/public/tinymce/plugins/code/plugin.js +0 -85
- package/public/tinymce/plugins/code/plugin.min.js +0 -4
- package/public/tinymce/plugins/codesample/plugin.js +0 -2463
- package/public/tinymce/plugins/codesample/plugin.min.js +0 -4
- package/public/tinymce/plugins/image/plugin.js +0 -1505
- package/public/tinymce/plugins/image/plugin.min.js +0 -4
- package/public/tinymce/plugins/link/plugin.js +0 -1242
- package/public/tinymce/plugins/link/plugin.min.js +0 -4
- package/public/tinymce/plugins/lists/plugin.js +0 -2172
- package/public/tinymce/plugins/lists/plugin.min.js +0 -4
- package/public/tinymce/plugins/table/plugin.js +0 -3462
- package/public/tinymce/plugins/table/plugin.min.js +0 -4
- package/public/tinymce/skins/content/default/content.css +0 -61
- package/public/tinymce/skins/content/default/content.min.css +0 -1
- package/public/tinymce/skins/ui/oxide/content.css +0 -785
- package/public/tinymce/skins/ui/oxide/content.inline.css +0 -779
- package/public/tinymce/skins/ui/oxide/content.inline.min.css +0 -1
- package/public/tinymce/skins/ui/oxide/content.min.css +0 -1
- package/public/tinymce/skins/ui/oxide/skin.css +0 -3763
- package/public/tinymce/skins/ui/oxide/skin.min.css +0 -1
- package/public/tinymce/skins/ui/oxide/skin.shadowdom.css +0 -30
- package/public/tinymce/skins/ui/oxide/skin.shadowdom.min.css +0 -1
- package/public/tinymce/skins/ui/oxide-dark/content.css +0 -766
- package/public/tinymce/skins/ui/oxide-dark/content.inline.css +0 -779
- package/public/tinymce/skins/ui/oxide-dark/content.inline.min.css +0 -1
- package/public/tinymce/skins/ui/oxide-dark/content.min.css +0 -1
- package/public/tinymce/skins/ui/oxide-dark/skin.css +0 -3766
- package/public/tinymce/skins/ui/oxide-dark/skin.min.css +0 -1
- package/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +0 -30
- package/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +0 -1
- package/public/tinymce/themes/silver/theme.js +0 -30775
- package/public/tinymce/themes/silver/theme.min.js +0 -384
- package/public/tinymce/tinymce.d.ts +0 -3238
- package/public/tinymce/tinymce.js +0 -31779
- package/public/tinymce/tinymce.min.js +0 -384
- /package/dist/lib/{index.mjs.map → _virtual/index.mjs.map} +0 -0
- /package/dist/lib/{Typography → lib/Typography}/Header/index.mjs +0 -0
- /package/dist/lib/{Typography → lib/Typography}/Header/index.mjs.map +0 -0
- /package/dist/lib/{Typography → lib/Typography}/Text/index.mjs +0 -0
- /package/dist/lib/{Typography → lib/Typography}/Text/index.mjs.map +0 -0
- /package/dist/lib/{color → lib/color}/alpha.mjs +0 -0
- /package/dist/lib/{color → lib/color}/constants.mjs +0 -0
- /package/dist/lib/{color → lib/color}/light.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Accordion/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Accordion/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/AlertDialog/AlertDialogAction.mjs +0 -0
- /package/dist/lib/{components → lib/components}/AlertDialog/AlertDialogAction.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/AlertDialog/AlertDialogCancel.mjs +0 -0
- /package/dist/lib/{components → lib/components}/AlertDialog/AlertDialogCancel.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/AlertDialog/AlertDialogContent.mjs +0 -0
- /package/dist/lib/{components → lib/components}/AlertDialog/AlertDialogContent.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/AlertDialog/AlertDialogDescription.mjs +0 -0
- /package/dist/lib/{components → lib/components}/AlertDialog/AlertDialogDescription.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/AlertDialog/AlertDialogRoot.mjs +0 -0
- /package/dist/lib/{components → lib/components}/AlertDialog/AlertDialogRoot.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/AlertDialog/AlertDialogTitle.mjs +0 -0
- /package/dist/lib/{components → lib/components}/AlertDialog/AlertDialogTitle.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/AlertDialog/AlertDialogTrigger.mjs +0 -0
- /package/dist/lib/{components → lib/components}/AlertDialog/AlertDialogTrigger.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/AlertDialog/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/AspectRatio/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/AspectRatio/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Avatar/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Avatar/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Badge/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Badge/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/BarChart/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Breadcrumb/BreadcrumbEllipsis.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Breadcrumb/BreadcrumbItem.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Breadcrumb/BreadcrumbLink.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Breadcrumb/BreadcrumbList.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Breadcrumb/BreadcrumbPage.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Breadcrumb/BreadcrumbRoot.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Breadcrumb/BreadcrumbRoot.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Breadcrumb/BreadcrumbSeparator.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Breadcrumb/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/BubbleChart/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Button/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Button/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Callout/CalloutIcon.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Callout/CalloutIcon.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Callout/CalloutRoot.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Callout/CalloutRoot.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Callout/CalloutText.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Callout/CalloutText.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Callout/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Card/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Card/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Checkbox/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Checkbox/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/CheckboxCard/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/CheckboxCard/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/CheckboxGroup/CheckboxGroupItem.mjs +0 -0
- /package/dist/lib/{components → lib/components}/CheckboxGroup/CheckboxGroupItem.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/CheckboxGroup/CheckboxGroupRoot.mjs +0 -0
- /package/dist/lib/{components → lib/components}/CheckboxGroup/CheckboxGroupRoot.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/CheckboxGroup/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Collapsible/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Collapsible/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/ContextMenu/ContextMenuCheckboxItem.mjs +0 -0
- /package/dist/lib/{components → lib/components}/ContextMenu/ContextMenuCheckboxItem.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/ContextMenu/ContextMenuContent.mjs +0 -0
- /package/dist/lib/{components → lib/components}/ContextMenu/ContextMenuContent.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/ContextMenu/ContextMenuGroup.mjs +0 -0
- /package/dist/lib/{components → lib/components}/ContextMenu/ContextMenuItem.mjs +0 -0
- /package/dist/lib/{components → lib/components}/ContextMenu/ContextMenuItem.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/ContextMenu/ContextMenuItemIndicator.mjs +0 -0
- /package/dist/lib/{components → lib/components}/ContextMenu/ContextMenuItemIndicator.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/ContextMenu/ContextMenuLabel.mjs +0 -0
- /package/dist/lib/{components → lib/components}/ContextMenu/ContextMenuLabel.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/ContextMenu/ContextMenuRadioGroup.mjs +0 -0
- /package/dist/lib/{components → lib/components}/ContextMenu/ContextMenuRadioGroup.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/ContextMenu/ContextMenuRadioItem.mjs +0 -0
- /package/dist/lib/{components → lib/components}/ContextMenu/ContextMenuRadioItem.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/ContextMenu/ContextMenuRoot.mjs +0 -0
- /package/dist/lib/{components → lib/components}/ContextMenu/ContextMenuRoot.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/ContextMenu/ContextMenuSeparator.mjs +0 -0
- /package/dist/lib/{components → lib/components}/ContextMenu/ContextMenuSubContent.mjs +0 -0
- /package/dist/lib/{components → lib/components}/ContextMenu/ContextMenuSubContent.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/ContextMenu/ContextMenuSubTrigger.mjs +0 -0
- /package/dist/lib/{components → lib/components}/ContextMenu/ContextMenuSubTrigger.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/ContextMenu/ContextMenuTrigger.mjs +0 -0
- /package/dist/lib/{components → lib/components}/ContextMenu/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/DataList/DataListItem.mjs +0 -0
- /package/dist/lib/{components → lib/components}/DataList/DataListItem.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/DataList/DataListLabel.mjs +0 -0
- /package/dist/lib/{components → lib/components}/DataList/DataListLabel.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/DataList/DataListRoot.mjs +0 -0
- /package/dist/lib/{components → lib/components}/DataList/DataListRoot.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/DataList/DataListValue.mjs +0 -0
- /package/dist/lib/{components → lib/components}/DataList/DataListValue.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/DataList/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Dialog/DialogAction.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Dialog/DialogAction.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Dialog/DialogCancel.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Dialog/DialogCancel.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Dialog/DialogContent.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Dialog/DialogContent.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Dialog/DialogDescription.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Dialog/DialogDescription.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Dialog/DialogRoot.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Dialog/DialogRoot.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Dialog/DialogSlot.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Dialog/DialogSlot.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Dialog/DialogTitle.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Dialog/DialogTitle.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Dialog/DialogTrigger.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Dialog/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/DoughnutChart/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/DropdownMenu/DropdonMenuRadioGroup.mjs +0 -0
- /package/dist/lib/{components → lib/components}/DropdownMenu/DropdonMenuSubContent.mjs +0 -0
- /package/dist/lib/{components → lib/components}/DropdownMenu/DropdonMenuSubContent.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/DropdownMenu/DropdownMenuCheckboxItem.mjs +0 -0
- /package/dist/lib/{components → lib/components}/DropdownMenu/DropdownMenuCheckboxItem.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/DropdownMenu/DropdownMenuContent.mjs +0 -0
- /package/dist/lib/{components → lib/components}/DropdownMenu/DropdownMenuContent.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/DropdownMenu/DropdownMenuItem.mjs +0 -0
- /package/dist/lib/{components → lib/components}/DropdownMenu/DropdownMenuItem.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/DropdownMenu/DropdownMenuItemIndicator.mjs +0 -0
- /package/dist/lib/{components → lib/components}/DropdownMenu/DropdownMenuItemIndicator.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/DropdownMenu/DropdownMenuLable.mjs +0 -0
- /package/dist/lib/{components → lib/components}/DropdownMenu/DropdownMenuLable.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/DropdownMenu/DropdownMenuRadioItem.mjs +0 -0
- /package/dist/lib/{components → lib/components}/DropdownMenu/DropdownMenuRadioItem.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/DropdownMenu/DropdownMenuRoot.mjs +0 -0
- /package/dist/lib/{components → lib/components}/DropdownMenu/DropdownMenuRoot.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/DropdownMenu/DropdownMenuSeparator.mjs +0 -0
- /package/dist/lib/{components → lib/components}/DropdownMenu/DropdownMenuSub.mjs +0 -0
- /package/dist/lib/{components → lib/components}/DropdownMenu/DropdownMenuSubTrigger.mjs +0 -0
- /package/dist/lib/{components → lib/components}/DropdownMenu/DropdownMenuSubTrigger.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/DropdownMenu/DropdownMenuTrigger.mjs +0 -0
- /package/dist/lib/{components → lib/components}/DropdownMenu/DropdownMenuTrigger.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/DropdownMenu/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Editor/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Footer/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Footer/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Gnb/GnbInfo.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Gnb/GnbInfo.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Gnb/GnbLogo.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Gnb/GnbMenu.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Gnb/GnbMenu.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Gnb/GnbRoot.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Gnb/GnbRoot.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Gnb/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Grid/Pagination.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Grid/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Grid/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Grid/useGrid.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Grid/useGrid.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/HoverCard/HoverCardContent.mjs +0 -0
- /package/dist/lib/{components → lib/components}/HoverCard/HoverCardContent.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/HoverCard/HoverCardRoot.mjs +0 -0
- /package/dist/lib/{components → lib/components}/HoverCard/HoverCardRoot.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/HoverCard/HoverCardTrigger.mjs +0 -0
- /package/dist/lib/{components → lib/components}/HoverCard/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/IconButton/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/IconButton/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Inset/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Inset/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Label/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Label/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/LineChart/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Menubar/MenubarCheckboxItem.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Menubar/MenubarCheckboxItem.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Menubar/MenubarContent.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Menubar/MenubarContent.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Menubar/MenubarItem.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Menubar/MenubarItem.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Menubar/MenubarItemIndicator.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Menubar/MenubarItemIndicator.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Menubar/MenubarMenu.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Menubar/MenubarRadioGroup.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Menubar/MenubarRadioGroup.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Menubar/MenubarRadioItem.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Menubar/MenubarRadioItem.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Menubar/MenubarRoot.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Menubar/MenubarRoot.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Menubar/MenubarSeparator.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Menubar/MenubarSub.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Menubar/MenubarSubContent.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Menubar/MenubarSubContent.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Menubar/MenubarSubTrigger.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Menubar/MenubarSubTrigger.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Menubar/MenubarTrigger.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Menubar/MenubarTrigger.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Menubar/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/NavigationMenu/NavigationMenuContent.mjs +0 -0
- /package/dist/lib/{components → lib/components}/NavigationMenu/NavigationMenuContent.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/NavigationMenu/NavigationMenuIndicator.mjs +0 -0
- /package/dist/lib/{components → lib/components}/NavigationMenu/NavigationMenuItem.mjs +0 -0
- /package/dist/lib/{components → lib/components}/NavigationMenu/NavigationMenuLink.mjs +0 -0
- /package/dist/lib/{components → lib/components}/NavigationMenu/NavigationMenuLink.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/NavigationMenu/NavigationMenuList.mjs +0 -0
- /package/dist/lib/{components → lib/components}/NavigationMenu/NavigationMenuList.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/NavigationMenu/NavigationMenuRoot.mjs +0 -0
- /package/dist/lib/{components → lib/components}/NavigationMenu/NavigationMenuRoot.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/NavigationMenu/NavigationMenuTrigger.mjs +0 -0
- /package/dist/lib/{components → lib/components}/NavigationMenu/NavigationMenuTrigger.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/NavigationMenu/NavigationMenuViewport.mjs +0 -0
- /package/dist/lib/{components → lib/components}/NavigationMenu/NavigationMenuViewport.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/NavigationMenu/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/PieChart/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Popover/PopoverClose.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Popover/PopoverClose.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Popover/PopoverContent.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Popover/PopoverContent.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Popover/PopoverRoot.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Popover/PopoverRoot.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Popover/PopoverTrigger.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Popover/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Progress/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Progress/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/RadarChart/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Radio/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Radio/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/RadioCards/RadioCardsItem.mjs +0 -0
- /package/dist/lib/{components → lib/components}/RadioCards/RadioCardsItem.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/RadioCards/RadioCardsRoot.mjs +0 -0
- /package/dist/lib/{components → lib/components}/RadioCards/RadioCardsRoot.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/RadioCards/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/RadioGroup/RadioGroupItem.mjs +0 -0
- /package/dist/lib/{components → lib/components}/RadioGroup/RadioGroupItem.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/RadioGroup/RadioGroupRoot.mjs +0 -0
- /package/dist/lib/{components → lib/components}/RadioGroup/RadioGroupRoot.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/RadioGroup/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/ScrollArea/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/ScrollArea/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/SegmentedControl/SegmentedControlItem.mjs +0 -0
- /package/dist/lib/{components → lib/components}/SegmentedControl/SegmentedControlRoot.mjs +0 -0
- /package/dist/lib/{components → lib/components}/SegmentedControl/SegmentedControlRoot.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/SegmentedControl/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Select/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Select/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Separator/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Separator/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Skeleton/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Skeleton/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Slider/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Slider/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Spinner/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Spinner/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/TabNav/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/TabNav/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Table/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Table/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Tabs/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Tabs/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/TextArea/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/TextArea/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/TextField/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/TextField/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Toast/ToastActionButton.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Toast/ToastActionButton.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Toast/ToastDescription.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Toast/ToastDescription.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Toast/ToastRoot.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Toast/ToastRoot.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Toast/ToastTitle.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Toast/ToastTitle.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Toast/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Toggle/ToggleWithText.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Toggle/ToggleWithText.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Toggle/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Toggle/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/ToggleGroup/ToggleGroupItem.mjs +0 -0
- /package/dist/lib/{components → lib/components}/ToggleGroup/ToggleGroupItem.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/ToggleGroup/ToggleGroupRoot.mjs +0 -0
- /package/dist/lib/{components → lib/components}/ToggleGroup/ToggleGroupRoot.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/ToggleGroup/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/ToggleSwitch/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/ToggleSwitch/index.mjs.map +0 -0
- /package/dist/lib/{components → lib/components}/Tooltip/index.mjs +0 -0
- /package/dist/lib/{components → lib/components}/Tooltip/index.mjs.map +0 -0
- /package/dist/lib/{constants.mjs → lib/constants.mjs} +0 -0
- /package/dist/lib/{index.mjs → lib/index.mjs} +0 -0
- /package/dist/lib/{theme → lib/theme}/ThemeProvider.mjs +0 -0
- /package/dist/lib/{theme → lib/theme}/ThemeProvider.mjs.map +0 -0
- /package/dist/lib/{utils → lib/utils}/useDarkMode.mjs +0 -0
- /package/dist/lib/{utils → lib/utils}/useDarkMode.mjs.map +0 -0
- /package/dist/lib/{utils → lib/utils}/utils.mjs +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"model.mjs","sources":["../../../../../public/tinymce/models/dom/model.js"],"sourcesContent":["\"use strict\";\n/**\n * TinyMCE version 6.8.5 (TBD)\n */\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\n(function () {\n 'use strict';\n var global$1 = tinymce.util.Tools.resolve('tinymce.ModelManager');\n var hasProto = function (v, constructor, predicate) {\n var _a;\n if (predicate(v, constructor.prototype)) {\n return true;\n }\n else {\n return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;\n }\n };\n var typeOf = function (x) {\n var t = typeof x;\n if (x === null) {\n return 'null';\n }\n else if (t === 'object' && Array.isArray(x)) {\n return 'array';\n }\n else if (t === 'object' && hasProto(x, String, function (o, proto) { return proto.isPrototypeOf(o); })) {\n return 'string';\n }\n else {\n return t;\n }\n };\n var isType$1 = function (type) { return function (value) { return typeOf(value) === type; }; };\n var isSimpleType = function (type) { return function (value) { return typeof value === type; }; };\n var eq$2 = function (t) { return function (a) { return t === a; }; };\n var isString = isType$1('string');\n var isObject = isType$1('object');\n var isArray = isType$1('array');\n var isNull = eq$2(null);\n var isBoolean = isSimpleType('boolean');\n var isUndefined = eq$2(undefined);\n var isNullable = function (a) { return a === null || a === undefined; };\n var isNonNullable = function (a) { return !isNullable(a); };\n var isFunction = isSimpleType('function');\n var isNumber = isSimpleType('number');\n var noop = function () {\n };\n var compose = function (fa, fb) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return fa(fb.apply(null, args));\n };\n };\n var compose1 = function (fbc, fab) { return function (a) { return fbc(fab(a)); }; };\n var constant = function (value) {\n return function () {\n return value;\n };\n };\n var identity = function (x) {\n return x;\n };\n var tripleEquals = function (a, b) {\n return a === b;\n };\n function curry(fn) {\n var initialArgs = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n initialArgs[_i - 1] = arguments[_i];\n }\n return function () {\n var restArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n restArgs[_i] = arguments[_i];\n }\n var all = initialArgs.concat(restArgs);\n return fn.apply(null, all);\n };\n }\n var not = function (f) { return function (t) { return !f(t); }; };\n var die = function (msg) {\n return function () {\n throw new Error(msg);\n };\n };\n var apply = function (f) {\n return f();\n };\n var never = constant(false);\n var always = constant(true);\n var Optional = /** @class */ (function () {\n function Optional(tag, value) {\n this.tag = tag;\n this.value = value;\n }\n Optional.some = function (value) {\n return new Optional(true, value);\n };\n Optional.none = function () {\n return Optional.singletonNone;\n };\n Optional.prototype.fold = function (onNone, onSome) {\n if (this.tag) {\n return onSome(this.value);\n }\n else {\n return onNone();\n }\n };\n Optional.prototype.isSome = function () {\n return this.tag;\n };\n Optional.prototype.isNone = function () {\n return !this.tag;\n };\n Optional.prototype.map = function (mapper) {\n if (this.tag) {\n return Optional.some(mapper(this.value));\n }\n else {\n return Optional.none();\n }\n };\n Optional.prototype.bind = function (binder) {\n if (this.tag) {\n return binder(this.value);\n }\n else {\n return Optional.none();\n }\n };\n Optional.prototype.exists = function (predicate) {\n return this.tag && predicate(this.value);\n };\n Optional.prototype.forall = function (predicate) {\n return !this.tag || predicate(this.value);\n };\n Optional.prototype.filter = function (predicate) {\n if (!this.tag || predicate(this.value)) {\n return this;\n }\n else {\n return Optional.none();\n }\n };\n Optional.prototype.getOr = function (replacement) {\n return this.tag ? this.value : replacement;\n };\n Optional.prototype.or = function (replacement) {\n return this.tag ? this : replacement;\n };\n Optional.prototype.getOrThunk = function (thunk) {\n return this.tag ? this.value : thunk();\n };\n Optional.prototype.orThunk = function (thunk) {\n return this.tag ? this : thunk();\n };\n Optional.prototype.getOrDie = function (message) {\n if (!this.tag) {\n throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');\n }\n else {\n return this.value;\n }\n };\n Optional.from = function (value) {\n return isNonNullable(value) ? Optional.some(value) : Optional.none();\n };\n Optional.prototype.getOrNull = function () {\n return this.tag ? this.value : null;\n };\n Optional.prototype.getOrUndefined = function () {\n return this.value;\n };\n Optional.prototype.each = function (worker) {\n if (this.tag) {\n worker(this.value);\n }\n };\n Optional.prototype.toArray = function () {\n return this.tag ? [this.value] : [];\n };\n Optional.prototype.toString = function () {\n return this.tag ? \"some(\".concat(this.value, \")\") : 'none()';\n };\n return Optional;\n }());\n Optional.singletonNone = new Optional(false);\n var nativeSlice = Array.prototype.slice;\n var nativeIndexOf = Array.prototype.indexOf;\n var nativePush = Array.prototype.push;\n var rawIndexOf = function (ts, t) { return nativeIndexOf.call(ts, t); };\n var contains$2 = function (xs, x) { return rawIndexOf(xs, x) > -1; };\n var exists = function (xs, pred) {\n for (var i = 0, len = xs.length; i < len; i++) {\n var x = xs[i];\n if (pred(x, i)) {\n return true;\n }\n }\n return false;\n };\n var range$1 = function (num, f) {\n var r = [];\n for (var i = 0; i < num; i++) {\n r.push(f(i));\n }\n return r;\n };\n var map$1 = function (xs, f) {\n var len = xs.length;\n var r = new Array(len);\n for (var i = 0; i < len; i++) {\n var x = xs[i];\n r[i] = f(x, i);\n }\n return r;\n };\n var each$2 = function (xs, f) {\n for (var i = 0, len = xs.length; i < len; i++) {\n var x = xs[i];\n f(x, i);\n }\n };\n var eachr = function (xs, f) {\n for (var i = xs.length - 1; i >= 0; i--) {\n var x = xs[i];\n f(x, i);\n }\n };\n var partition = function (xs, pred) {\n var pass = [];\n var fail = [];\n for (var i = 0, len = xs.length; i < len; i++) {\n var x = xs[i];\n var arr = pred(x, i) ? pass : fail;\n arr.push(x);\n }\n return {\n pass: pass,\n fail: fail\n };\n };\n var filter$2 = function (xs, pred) {\n var r = [];\n for (var i = 0, len = xs.length; i < len; i++) {\n var x = xs[i];\n if (pred(x, i)) {\n r.push(x);\n }\n }\n return r;\n };\n var foldr = function (xs, f, acc) {\n eachr(xs, function (x, i) {\n acc = f(acc, x, i);\n });\n return acc;\n };\n var foldl = function (xs, f, acc) {\n each$2(xs, function (x, i) {\n acc = f(acc, x, i);\n });\n return acc;\n };\n var findUntil = function (xs, pred, until) {\n for (var i = 0, len = xs.length; i < len; i++) {\n var x = xs[i];\n if (pred(x, i)) {\n return Optional.some(x);\n }\n else if (until(x, i)) {\n break;\n }\n }\n return Optional.none();\n };\n var find$1 = function (xs, pred) {\n return findUntil(xs, pred, never);\n };\n var findIndex = function (xs, pred) {\n for (var i = 0, len = xs.length; i < len; i++) {\n var x = xs[i];\n if (pred(x, i)) {\n return Optional.some(i);\n }\n }\n return Optional.none();\n };\n var flatten = function (xs) {\n var r = [];\n for (var i = 0, len = xs.length; i < len; ++i) {\n if (!isArray(xs[i])) {\n throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);\n }\n nativePush.apply(r, xs[i]);\n }\n return r;\n };\n var bind$2 = function (xs, f) { return flatten(map$1(xs, f)); };\n var forall = function (xs, pred) {\n for (var i = 0, len = xs.length; i < len; ++i) {\n var x = xs[i];\n if (pred(x, i) !== true) {\n return false;\n }\n }\n return true;\n };\n var reverse = function (xs) {\n var r = nativeSlice.call(xs, 0);\n r.reverse();\n return r;\n };\n var mapToObject = function (xs, f) {\n var r = {};\n for (var i = 0, len = xs.length; i < len; i++) {\n var x = xs[i];\n r[String(x)] = f(x, i);\n }\n return r;\n };\n var sort$1 = function (xs, comparator) {\n var copy = nativeSlice.call(xs, 0);\n copy.sort(comparator);\n return copy;\n };\n var get$d = function (xs, i) { return i >= 0 && i < xs.length ? Optional.some(xs[i]) : Optional.none(); };\n var head = function (xs) { return get$d(xs, 0); };\n var last$2 = function (xs) { return get$d(xs, xs.length - 1); };\n var findMap = function (arr, f) {\n for (var i = 0; i < arr.length; i++) {\n var r_1 = f(arr[i], i);\n if (r_1.isSome()) {\n return r_1;\n }\n }\n return Optional.none();\n };\n var keys = Object.keys;\n var hasOwnProperty = Object.hasOwnProperty;\n var each$1 = function (obj, f) {\n var props = keys(obj);\n for (var k = 0, len = props.length; k < len; k++) {\n var i = props[k];\n var x = obj[i];\n f(x, i);\n }\n };\n var map = function (obj, f) {\n return tupleMap(obj, function (x, i) { return ({\n k: i,\n v: f(x, i)\n }); });\n };\n var tupleMap = function (obj, f) {\n var r = {};\n each$1(obj, function (x, i) {\n var tuple = f(x, i);\n r[tuple.k] = tuple.v;\n });\n return r;\n };\n var objAcc = function (r) { return function (x, i) {\n r[i] = x;\n }; };\n var internalFilter = function (obj, pred, onTrue, onFalse) {\n each$1(obj, function (x, i) {\n (pred(x, i) ? onTrue : onFalse)(x, i);\n });\n };\n var filter$1 = function (obj, pred) {\n var t = {};\n internalFilter(obj, pred, objAcc(t), noop);\n return t;\n };\n var mapToArray = function (obj, f) {\n var r = [];\n each$1(obj, function (value, name) {\n r.push(f(value, name));\n });\n return r;\n };\n var values = function (obj) {\n return mapToArray(obj, identity);\n };\n var get$c = function (obj, key) {\n return has$1(obj, key) ? Optional.from(obj[key]) : Optional.none();\n };\n var has$1 = function (obj, key) { return hasOwnProperty.call(obj, key); };\n var hasNonNullableKey = function (obj, key) { return has$1(obj, key) && obj[key] !== undefined && obj[key] !== null; };\n var isEmpty = function (r) {\n for (var x in r) {\n if (hasOwnProperty.call(r, x)) {\n return false;\n }\n }\n return true;\n };\n var Global = typeof window !== 'undefined' ? window : Function('return this;')();\n var path = function (parts, scope) {\n var o = scope !== undefined && scope !== null ? scope : Global;\n for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i) {\n o = o[parts[i]];\n }\n return o;\n };\n var resolve$2 = function (p, scope) {\n var parts = p.split('.');\n return path(parts, scope);\n };\n var unsafe = function (name, scope) {\n return resolve$2(name, scope);\n };\n var getOrDie = function (name, scope) {\n var actual = unsafe(name, scope);\n if (actual === undefined || actual === null) {\n throw new Error(name + ' not available on this browser');\n }\n return actual;\n };\n var getPrototypeOf = Object.getPrototypeOf;\n var sandHTMLElement = function (scope) {\n return getOrDie('HTMLElement', scope);\n };\n var isPrototypeOf = function (x) {\n var scope = resolve$2('ownerDocument.defaultView', x);\n return isObject(x) && (sandHTMLElement(scope).prototype.isPrototypeOf(x) || /^HTML\\w*Element$/.test(getPrototypeOf(x).constructor.name));\n };\n var COMMENT = 8;\n var DOCUMENT = 9;\n var DOCUMENT_FRAGMENT = 11;\n var ELEMENT = 1;\n var TEXT = 3;\n var name = function (element) {\n var r = element.dom.nodeName;\n return r.toLowerCase();\n };\n var type = function (element) { return element.dom.nodeType; };\n var isType = function (t) { return function (element) { return type(element) === t; }; };\n var isComment = function (element) { return type(element) === COMMENT || name(element) === '#comment'; };\n var isHTMLElement = function (element) { return isElement(element) && isPrototypeOf(element.dom); };\n var isElement = isType(ELEMENT);\n var isText = isType(TEXT);\n var isDocument = isType(DOCUMENT);\n var isDocumentFragment = isType(DOCUMENT_FRAGMENT);\n var isTag = function (tag) { return function (e) { return isElement(e) && name(e) === tag; }; };\n var rawSet = function (dom, key, value) {\n if (isString(value) || isBoolean(value) || isNumber(value)) {\n dom.setAttribute(key, value + '');\n }\n else {\n console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom);\n throw new Error('Attribute value was not simple');\n }\n };\n var set$2 = function (element, key, value) {\n rawSet(element.dom, key, value);\n };\n var setAll$1 = function (element, attrs) {\n var dom = element.dom;\n each$1(attrs, function (v, k) {\n rawSet(dom, k, v);\n });\n };\n var setOptions = function (element, attrs) {\n each$1(attrs, function (v, k) {\n v.fold(function () {\n remove$7(element, k);\n }, function (value) {\n rawSet(element.dom, k, value);\n });\n });\n };\n var get$b = function (element, key) {\n var v = element.dom.getAttribute(key);\n return v === null ? undefined : v;\n };\n var getOpt = function (element, key) { return Optional.from(get$b(element, key)); };\n var remove$7 = function (element, key) {\n element.dom.removeAttribute(key);\n };\n var clone$2 = function (element) { return foldl(element.dom.attributes, function (acc, attr) {\n acc[attr.name] = attr.value;\n return acc;\n }, {}); };\n var fromHtml$1 = function (html, scope) {\n var doc = scope || document;\n var div = doc.createElement('div');\n div.innerHTML = html;\n if (!div.hasChildNodes() || div.childNodes.length > 1) {\n var message = 'HTML does not have a single root node';\n console.error(message, html);\n throw new Error(message);\n }\n return fromDom$1(div.childNodes[0]);\n };\n var fromTag = function (tag, scope) {\n var doc = scope || document;\n var node = doc.createElement(tag);\n return fromDom$1(node);\n };\n var fromText = function (text, scope) {\n var doc = scope || document;\n var node = doc.createTextNode(text);\n return fromDom$1(node);\n };\n var fromDom$1 = function (node) {\n if (node === null || node === undefined) {\n throw new Error('Node cannot be null or undefined');\n }\n return { dom: node };\n };\n var fromPoint$1 = function (docElm, x, y) { return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom$1); };\n var SugarElement = {\n fromHtml: fromHtml$1,\n fromTag: fromTag,\n fromText: fromText,\n fromDom: fromDom$1,\n fromPoint: fromPoint$1\n };\n var is$2 = function (element, selector) {\n var dom = element.dom;\n if (dom.nodeType !== ELEMENT) {\n return false;\n }\n else {\n var elem = dom;\n if (elem.matches !== undefined) {\n return elem.matches(selector);\n }\n else if (elem.msMatchesSelector !== undefined) {\n return elem.msMatchesSelector(selector);\n }\n else if (elem.webkitMatchesSelector !== undefined) {\n return elem.webkitMatchesSelector(selector);\n }\n else if (elem.mozMatchesSelector !== undefined) {\n return elem.mozMatchesSelector(selector);\n }\n else {\n throw new Error('Browser lacks native selectors');\n }\n }\n };\n var bypassSelector = function (dom) { return dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT && dom.nodeType !== DOCUMENT_FRAGMENT || dom.childElementCount === 0; };\n var all$1 = function (selector, scope) {\n var base = scope === undefined ? document : scope.dom;\n return bypassSelector(base) ? [] : map$1(base.querySelectorAll(selector), SugarElement.fromDom);\n };\n var one = function (selector, scope) {\n var base = scope === undefined ? document : scope.dom;\n return bypassSelector(base) ? Optional.none() : Optional.from(base.querySelector(selector)).map(SugarElement.fromDom);\n };\n var eq$1 = function (e1, e2) { return e1.dom === e2.dom; };\n var contains$1 = function (e1, e2) {\n var d1 = e1.dom;\n var d2 = e2.dom;\n return d1 === d2 ? false : d1.contains(d2);\n };\n var is$1 = is$2;\n var owner = function (element) { return SugarElement.fromDom(element.dom.ownerDocument); };\n var documentOrOwner = function (dos) { return isDocument(dos) ? dos : owner(dos); };\n var documentElement = function (element) { return SugarElement.fromDom(documentOrOwner(element).dom.documentElement); };\n var defaultView = function (element) { return SugarElement.fromDom(documentOrOwner(element).dom.defaultView); };\n var parent = function (element) { return Optional.from(element.dom.parentNode).map(SugarElement.fromDom); };\n var parentElement = function (element) { return Optional.from(element.dom.parentElement).map(SugarElement.fromDom); };\n var parents = function (element, isRoot) {\n var stop = isFunction(isRoot) ? isRoot : never;\n var dom = element.dom;\n var ret = [];\n while (dom.parentNode !== null && dom.parentNode !== undefined) {\n var rawParent = dom.parentNode;\n var p = SugarElement.fromDom(rawParent);\n ret.push(p);\n if (stop(p) === true) {\n break;\n }\n else {\n dom = rawParent;\n }\n }\n return ret;\n };\n var prevSibling = function (element) { return Optional.from(element.dom.previousSibling).map(SugarElement.fromDom); };\n var nextSibling = function (element) { return Optional.from(element.dom.nextSibling).map(SugarElement.fromDom); };\n var children$2 = function (element) { return map$1(element.dom.childNodes, SugarElement.fromDom); };\n var child$2 = function (element, index) {\n var cs = element.dom.childNodes;\n return Optional.from(cs[index]).map(SugarElement.fromDom);\n };\n var firstChild = function (element) { return child$2(element, 0); };\n var before$3 = function (marker, element) {\n var parent$1 = parent(marker);\n parent$1.each(function (v) {\n v.dom.insertBefore(element.dom, marker.dom);\n });\n };\n var after$5 = function (marker, element) {\n var sibling = nextSibling(marker);\n sibling.fold(function () {\n var parent$1 = parent(marker);\n parent$1.each(function (v) {\n append$1(v, element);\n });\n }, function (v) {\n before$3(v, element);\n });\n };\n var prepend = function (parent, element) {\n var firstChild$1 = firstChild(parent);\n firstChild$1.fold(function () {\n append$1(parent, element);\n }, function (v) {\n parent.dom.insertBefore(element.dom, v.dom);\n });\n };\n var append$1 = function (parent, element) {\n parent.dom.appendChild(element.dom);\n };\n var appendAt = function (parent, element, index) {\n child$2(parent, index).fold(function () {\n append$1(parent, element);\n }, function (v) {\n before$3(v, element);\n });\n };\n var wrap = function (element, wrapper) {\n before$3(element, wrapper);\n append$1(wrapper, element);\n };\n var after$4 = function (marker, elements) {\n each$2(elements, function (x, i) {\n var e = i === 0 ? marker : elements[i - 1];\n after$5(e, x);\n });\n };\n var append = function (parent, elements) {\n each$2(elements, function (x) {\n append$1(parent, x);\n });\n };\n var empty = function (element) {\n element.dom.textContent = '';\n each$2(children$2(element), function (rogue) {\n remove$6(rogue);\n });\n };\n var remove$6 = function (element) {\n var dom = element.dom;\n if (dom.parentNode !== null) {\n dom.parentNode.removeChild(dom);\n }\n };\n var unwrap = function (wrapper) {\n var children = children$2(wrapper);\n if (children.length > 0) {\n after$4(wrapper, children);\n }\n remove$6(wrapper);\n };\n var clone$1 = function (original, isDeep) { return SugarElement.fromDom(original.dom.cloneNode(isDeep)); };\n var shallow = function (original) { return clone$1(original, false); };\n var deep = function (original) { return clone$1(original, true); };\n var shallowAs = function (original, tag) {\n var nu = SugarElement.fromTag(tag);\n var attributes = clone$2(original);\n setAll$1(nu, attributes);\n return nu;\n };\n var copy$2 = function (original, tag) {\n var nu = shallowAs(original, tag);\n var cloneChildren = children$2(deep(original));\n append(nu, cloneChildren);\n return nu;\n };\n var mutate$1 = function (original, tag) {\n var nu = shallowAs(original, tag);\n after$5(original, nu);\n var children = children$2(original);\n append(nu, children);\n remove$6(original);\n return nu;\n };\n var validSectionList = [\n 'tfoot',\n 'thead',\n 'tbody',\n 'colgroup'\n ];\n var isValidSection = function (parentName) { return contains$2(validSectionList, parentName); };\n var grid = function (rows, columns) { return ({\n rows: rows,\n columns: columns\n }); };\n var address = function (row, column) { return ({\n row: row,\n column: column\n }); };\n var detail = function (element, rowspan, colspan) { return ({\n element: element,\n rowspan: rowspan,\n colspan: colspan\n }); };\n var detailnew = function (element, rowspan, colspan, isNew) { return ({\n element: element,\n rowspan: rowspan,\n colspan: colspan,\n isNew: isNew\n }); };\n var extended = function (element, rowspan, colspan, row, column, isLocked) { return ({\n element: element,\n rowspan: rowspan,\n colspan: colspan,\n row: row,\n column: column,\n isLocked: isLocked\n }); };\n var rowdetail = function (element, cells, section) { return ({\n element: element,\n cells: cells,\n section: section\n }); };\n var rowdetailnew = function (element, cells, section, isNew) { return ({\n element: element,\n cells: cells,\n section: section,\n isNew: isNew\n }); };\n var elementnew = function (element, isNew, isLocked) { return ({\n element: element,\n isNew: isNew,\n isLocked: isLocked\n }); };\n var rowcells = function (element, cells, section, isNew) { return ({\n element: element,\n cells: cells,\n section: section,\n isNew: isNew\n }); };\n var bounds = function (startRow, startCol, finishRow, finishCol) { return ({\n startRow: startRow,\n startCol: startCol,\n finishRow: finishRow,\n finishCol: finishCol\n }); };\n var columnext = function (element, colspan, column) { return ({\n element: element,\n colspan: colspan,\n column: column\n }); };\n var colgroup = function (element, columns) { return ({\n element: element,\n columns: columns\n }); };\n var isShadowRoot = function (dos) { return isDocumentFragment(dos) && isNonNullable(dos.dom.host); };\n var supported = isFunction(Element.prototype.attachShadow) && isFunction(Node.prototype.getRootNode);\n var isSupported$1 = constant(supported);\n var getRootNode = supported ? function (e) { return SugarElement.fromDom(e.dom.getRootNode()); } : documentOrOwner;\n var getShadowRoot = function (e) {\n var r = getRootNode(e);\n return isShadowRoot(r) ? Optional.some(r) : Optional.none();\n };\n var getShadowHost = function (e) { return SugarElement.fromDom(e.dom.host); };\n var getOriginalEventTarget = function (event) {\n if (isSupported$1() && isNonNullable(event.target)) {\n var el = SugarElement.fromDom(event.target);\n if (isElement(el) && isOpenShadowHost(el)) {\n if (event.composed && event.composedPath) {\n var composedPath = event.composedPath();\n if (composedPath) {\n return head(composedPath);\n }\n }\n }\n }\n return Optional.from(event.target);\n };\n var isOpenShadowHost = function (element) { return isNonNullable(element.dom.shadowRoot); };\n var inBody = function (element) {\n var dom = isText(element) ? element.dom.parentNode : element.dom;\n if (dom === undefined || dom === null || dom.ownerDocument === null) {\n return false;\n }\n var doc = dom.ownerDocument;\n return getShadowRoot(SugarElement.fromDom(dom)).fold(function () { return doc.body.contains(dom); }, compose1(inBody, getShadowHost));\n };\n var body$1 = function () { return getBody$1(SugarElement.fromDom(document)); };\n var getBody$1 = function (doc) {\n var b = doc.dom.body;\n if (b === null || b === undefined) {\n throw new Error('Body is not available yet');\n }\n return SugarElement.fromDom(b);\n };\n var ancestors$4 = function (scope, predicate, isRoot) { return filter$2(parents(scope, isRoot), predicate); };\n var children$1 = function (scope, predicate) { return filter$2(children$2(scope), predicate); };\n var descendants$1 = function (scope, predicate) {\n var result = [];\n each$2(children$2(scope), function (x) {\n if (predicate(x)) {\n result = result.concat([x]);\n }\n result = result.concat(descendants$1(x, predicate));\n });\n return result;\n };\n var ancestors$3 = function (scope, selector, isRoot) { return ancestors$4(scope, function (e) { return is$2(e, selector); }, isRoot); };\n var children = function (scope, selector) { return children$1(scope, function (e) { return is$2(e, selector); }); };\n var descendants = function (scope, selector) { return all$1(selector, scope); };\n var ClosestOrAncestor = function (is, ancestor, scope, a, isRoot) {\n if (is(scope, a)) {\n return Optional.some(scope);\n }\n else if (isFunction(isRoot) && isRoot(scope)) {\n return Optional.none();\n }\n else {\n return ancestor(scope, a, isRoot);\n }\n };\n var ancestor$2 = function (scope, predicate, isRoot) {\n var element = scope.dom;\n var stop = isFunction(isRoot) ? isRoot : never;\n while (element.parentNode) {\n element = element.parentNode;\n var el = SugarElement.fromDom(element);\n if (predicate(el)) {\n return Optional.some(el);\n }\n else if (stop(el)) {\n break;\n }\n }\n return Optional.none();\n };\n var closest$2 = function (scope, predicate, isRoot) {\n var is = function (s, test) { return test(s); };\n return ClosestOrAncestor(is, ancestor$2, scope, predicate, isRoot);\n };\n var child$1 = function (scope, predicate) {\n var pred = function (node) { return predicate(SugarElement.fromDom(node)); };\n var result = find$1(scope.dom.childNodes, pred);\n return result.map(SugarElement.fromDom);\n };\n var descendant$1 = function (scope, predicate) {\n var descend = function (node) {\n for (var i = 0; i < node.childNodes.length; i++) {\n var child_1 = SugarElement.fromDom(node.childNodes[i]);\n if (predicate(child_1)) {\n return Optional.some(child_1);\n }\n var res = descend(node.childNodes[i]);\n if (res.isSome()) {\n return res;\n }\n }\n return Optional.none();\n };\n return descend(scope.dom);\n };\n var ancestor$1 = function (scope, selector, isRoot) { return ancestor$2(scope, function (e) { return is$2(e, selector); }, isRoot); };\n var child = function (scope, selector) { return child$1(scope, function (e) { return is$2(e, selector); }); };\n var descendant = function (scope, selector) { return one(selector, scope); };\n var closest$1 = function (scope, selector, isRoot) {\n var is = function (element, selector) { return is$2(element, selector); };\n return ClosestOrAncestor(is, ancestor$1, scope, selector, isRoot);\n };\n var is = function (lhs, rhs, comparator) {\n if (comparator === void 0) { comparator = tripleEquals; }\n return lhs.exists(function (left) { return comparator(left, rhs); });\n };\n var cat = function (arr) {\n var r = [];\n var push = function (x) {\n r.push(x);\n };\n for (var i = 0; i < arr.length; i++) {\n arr[i].each(push);\n }\n return r;\n };\n var bindFrom = function (a, f) { return a !== undefined && a !== null ? f(a) : Optional.none(); };\n var someIf = function (b, a) { return b ? Optional.some(a) : Optional.none(); };\n var checkRange = function (str, substr, start) { return substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr; };\n var contains = function (str, substr, start, end) {\n if (start === void 0) { start = 0; }\n var idx = str.indexOf(substr, start);\n if (idx !== -1) {\n return isUndefined(end) ? true : idx + substr.length <= end;\n }\n else {\n return false;\n }\n };\n var startsWith = function (str, prefix) {\n return checkRange(str, prefix, 0);\n };\n var endsWith = function (str, suffix) {\n return checkRange(str, suffix, str.length - suffix.length);\n };\n var blank = function (r) { return function (s) { return s.replace(r, ''); }; };\n var trim = blank(/^\\s+|\\s+$/g);\n var isNotEmpty = function (s) { return s.length > 0; };\n var toFloat = function (value) {\n var num = parseFloat(value);\n return isNaN(num) ? Optional.none() : Optional.some(num);\n };\n var isSupported = function (dom) { return dom.style !== undefined && isFunction(dom.style.getPropertyValue); };\n var internalSet = function (dom, property, value) {\n if (!isString(value)) {\n console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom);\n throw new Error('CSS value must be a string: ' + value);\n }\n if (isSupported(dom)) {\n dom.style.setProperty(property, value);\n }\n };\n var internalRemove = function (dom, property) {\n if (isSupported(dom)) {\n dom.style.removeProperty(property);\n }\n };\n var set$1 = function (element, property, value) {\n var dom = element.dom;\n internalSet(dom, property, value);\n };\n var setAll = function (element, css) {\n var dom = element.dom;\n each$1(css, function (v, k) {\n internalSet(dom, k, v);\n });\n };\n var get$a = function (element, property) {\n var dom = element.dom;\n var styles = window.getComputedStyle(dom);\n var r = styles.getPropertyValue(property);\n return r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r;\n };\n var getUnsafeProperty = function (dom, property) { return isSupported(dom) ? dom.style.getPropertyValue(property) : ''; };\n var getRaw$2 = function (element, property) {\n var dom = element.dom;\n var raw = getUnsafeProperty(dom, property);\n return Optional.from(raw).filter(function (r) { return r.length > 0; });\n };\n var remove$5 = function (element, property) {\n var dom = element.dom;\n internalRemove(dom, property);\n if (is(getOpt(element, 'style').map(trim), '')) {\n remove$7(element, 'style');\n }\n };\n var copy$1 = function (source, target) {\n var sourceDom = source.dom;\n var targetDom = target.dom;\n if (isSupported(sourceDom) && isSupported(targetDom)) {\n targetDom.style.cssText = sourceDom.style.cssText;\n }\n };\n var getAttrValue = function (cell, name, fallback) {\n if (fallback === void 0) { fallback = 0; }\n return getOpt(cell, name).map(function (value) { return parseInt(value, 10); }).getOr(fallback);\n };\n var getSpan = function (cell, type) { return getAttrValue(cell, type, 1); };\n var hasColspan = function (cellOrCol) {\n if (isTag('col')(cellOrCol)) {\n return getAttrValue(cellOrCol, 'span', 1) > 1;\n }\n else {\n return getSpan(cellOrCol, 'colspan') > 1;\n }\n };\n var hasRowspan = function (cell) { return getSpan(cell, 'rowspan') > 1; };\n var getCssValue = function (element, property) { return parseInt(get$a(element, property), 10); };\n var minWidth = constant(10);\n var minHeight = constant(10);\n var firstLayer = function (scope, selector) {\n return filterFirstLayer(scope, selector, always);\n };\n var filterFirstLayer = function (scope, selector, predicate) {\n return bind$2(children$2(scope), function (x) {\n if (is$2(x, selector)) {\n return predicate(x) ? [x] : [];\n }\n else {\n return filterFirstLayer(x, selector, predicate);\n }\n });\n };\n var lookup = function (tags, element, isRoot) {\n if (isRoot === void 0) { isRoot = never; }\n if (isRoot(element)) {\n return Optional.none();\n }\n if (contains$2(tags, name(element))) {\n return Optional.some(element);\n }\n var isRootOrUpperTable = function (elm) { return is$2(elm, 'table') || isRoot(elm); };\n return ancestor$1(element, tags.join(','), isRootOrUpperTable);\n };\n var cell = function (element, isRoot) { return lookup([\n 'td',\n 'th'\n ], element, isRoot); };\n var cells$1 = function (ancestor) { return firstLayer(ancestor, 'th,td'); };\n var columns$1 = function (ancestor) {\n if (is$2(ancestor, 'colgroup')) {\n return children(ancestor, 'col');\n }\n else {\n return bind$2(columnGroups(ancestor), function (columnGroup) { return children(columnGroup, 'col'); });\n }\n };\n var table = function (element, isRoot) { return closest$1(element, 'table', isRoot); };\n var rows$1 = function (ancestor) { return firstLayer(ancestor, 'tr'); };\n var columnGroups = function (ancestor) { return table(ancestor).fold(constant([]), function (table) { return children(table, 'colgroup'); }); };\n var fromRowsOrColGroups = function (elems, getSection) { return map$1(elems, function (row) {\n if (name(row) === 'colgroup') {\n var cells_1 = map$1(columns$1(row), function (column) {\n var colspan = getAttrValue(column, 'span', 1);\n return detail(column, 1, colspan);\n });\n return rowdetail(row, cells_1, 'colgroup');\n }\n else {\n var cells_2 = map$1(cells$1(row), function (cell) {\n var rowspan = getAttrValue(cell, 'rowspan', 1);\n var colspan = getAttrValue(cell, 'colspan', 1);\n return detail(cell, rowspan, colspan);\n });\n return rowdetail(row, cells_2, getSection(row));\n }\n }); };\n var getParentSection = function (group) { return parent(group).map(function (parent) {\n var parentName = name(parent);\n return isValidSection(parentName) ? parentName : 'tbody';\n }).getOr('tbody'); };\n var fromTable$1 = function (table) {\n var rows = rows$1(table);\n var columnGroups$1 = columnGroups(table);\n var elems = __spreadArray(__spreadArray([], columnGroups$1, true), rows, true);\n return fromRowsOrColGroups(elems, getParentSection);\n };\n var fromPastedRows = function (elems, section) { return fromRowsOrColGroups(elems, function () { return section; }); };\n var cached = function (f) {\n var called = false;\n var r;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (!called) {\n called = true;\n r = f.apply(null, args);\n }\n return r;\n };\n };\n var DeviceType = function (os, browser, userAgent, mediaMatch) {\n var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true;\n var isiPhone = os.isiOS() && !isiPad;\n var isMobile = os.isiOS() || os.isAndroid();\n var isTouch = isMobile || mediaMatch('(pointer:coarse)');\n var isTablet = isiPad || !isiPhone && isMobile && mediaMatch('(min-device-width:768px)');\n var isPhone = isiPhone || isMobile && !isTablet;\n var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false;\n var isDesktop = !isPhone && !isTablet && !iOSwebview;\n return {\n isiPad: constant(isiPad),\n isiPhone: constant(isiPhone),\n isTablet: constant(isTablet),\n isPhone: constant(isPhone),\n isTouch: constant(isTouch),\n isAndroid: os.isAndroid,\n isiOS: os.isiOS,\n isWebView: constant(iOSwebview),\n isDesktop: constant(isDesktop)\n };\n };\n var firstMatch = function (regexes, s) {\n for (var i = 0; i < regexes.length; i++) {\n var x = regexes[i];\n if (x.test(s)) {\n return x;\n }\n }\n return undefined;\n };\n var find = function (regexes, agent) {\n var r = firstMatch(regexes, agent);\n if (!r) {\n return {\n major: 0,\n minor: 0\n };\n }\n var group = function (i) {\n return Number(agent.replace(r, '$' + i));\n };\n return nu$2(group(1), group(2));\n };\n var detect$5 = function (versionRegexes, agent) {\n var cleanedAgent = String(agent).toLowerCase();\n if (versionRegexes.length === 0) {\n return unknown$2();\n }\n return find(versionRegexes, cleanedAgent);\n };\n var unknown$2 = function () {\n return nu$2(0, 0);\n };\n var nu$2 = function (major, minor) {\n return {\n major: major,\n minor: minor\n };\n };\n var Version = {\n nu: nu$2,\n detect: detect$5,\n unknown: unknown$2\n };\n var detectBrowser$1 = function (browsers, userAgentData) {\n return findMap(userAgentData.brands, function (uaBrand) {\n var lcBrand = uaBrand.brand.toLowerCase();\n return find$1(browsers, function (browser) {\n var _a;\n return lcBrand === ((_a = browser.brand) === null || _a === void 0 ? void 0 : _a.toLowerCase());\n }).map(function (info) { return ({\n current: info.name,\n version: Version.nu(parseInt(uaBrand.version, 10), 0)\n }); });\n });\n };\n var detect$4 = function (candidates, userAgent) {\n var agent = String(userAgent).toLowerCase();\n return find$1(candidates, function (candidate) {\n return candidate.search(agent);\n });\n };\n var detectBrowser = function (browsers, userAgent) {\n return detect$4(browsers, userAgent).map(function (browser) {\n var version = Version.detect(browser.versionRegexes, userAgent);\n return {\n current: browser.name,\n version: version\n };\n });\n };\n var detectOs = function (oses, userAgent) {\n return detect$4(oses, userAgent).map(function (os) {\n var version = Version.detect(os.versionRegexes, userAgent);\n return {\n current: os.name,\n version: version\n };\n });\n };\n var normalVersionRegex = /.*?version\\/\\ ?([0-9]+)\\.([0-9]+).*/;\n var checkContains = function (target) {\n return function (uastring) {\n return contains(uastring, target);\n };\n };\n var browsers = [\n {\n name: 'Edge',\n versionRegexes: [/.*?edge\\/ ?([0-9]+)\\.([0-9]+)$/],\n search: function (uastring) {\n return contains(uastring, 'edge/') && contains(uastring, 'chrome') && contains(uastring, 'safari') && contains(uastring, 'applewebkit');\n }\n },\n {\n name: 'Chromium',\n brand: 'Chromium',\n versionRegexes: [\n /.*?chrome\\/([0-9]+)\\.([0-9]+).*/,\n normalVersionRegex\n ],\n search: function (uastring) {\n return contains(uastring, 'chrome') && !contains(uastring, 'chromeframe');\n }\n },\n {\n name: 'IE',\n versionRegexes: [\n /.*?msie\\ ?([0-9]+)\\.([0-9]+).*/,\n /.*?rv:([0-9]+)\\.([0-9]+).*/\n ],\n search: function (uastring) {\n return contains(uastring, 'msie') || contains(uastring, 'trident');\n }\n },\n {\n name: 'Opera',\n versionRegexes: [\n normalVersionRegex,\n /.*?opera\\/([0-9]+)\\.([0-9]+).*/\n ],\n search: checkContains('opera')\n },\n {\n name: 'Firefox',\n versionRegexes: [/.*?firefox\\/\\ ?([0-9]+)\\.([0-9]+).*/],\n search: checkContains('firefox')\n },\n {\n name: 'Safari',\n versionRegexes: [\n normalVersionRegex,\n /.*?cpu os ([0-9]+)_([0-9]+).*/\n ],\n search: function (uastring) {\n return (contains(uastring, 'safari') || contains(uastring, 'mobile/')) && contains(uastring, 'applewebkit');\n }\n }\n ];\n var oses = [\n {\n name: 'Windows',\n search: checkContains('win'),\n versionRegexes: [/.*?windows\\ nt\\ ?([0-9]+)\\.([0-9]+).*/]\n },\n {\n name: 'iOS',\n search: function (uastring) {\n return contains(uastring, 'iphone') || contains(uastring, 'ipad');\n },\n versionRegexes: [\n /.*?version\\/\\ ?([0-9]+)\\.([0-9]+).*/,\n /.*cpu os ([0-9]+)_([0-9]+).*/,\n /.*cpu iphone os ([0-9]+)_([0-9]+).*/\n ]\n },\n {\n name: 'Android',\n search: checkContains('android'),\n versionRegexes: [/.*?android\\ ?([0-9]+)\\.([0-9]+).*/]\n },\n {\n name: 'macOS',\n search: checkContains('mac os x'),\n versionRegexes: [/.*?mac\\ os\\ x\\ ?([0-9]+)_([0-9]+).*/]\n },\n {\n name: 'Linux',\n search: checkContains('linux'),\n versionRegexes: []\n },\n {\n name: 'Solaris',\n search: checkContains('sunos'),\n versionRegexes: []\n },\n {\n name: 'FreeBSD',\n search: checkContains('freebsd'),\n versionRegexes: []\n },\n {\n name: 'ChromeOS',\n search: checkContains('cros'),\n versionRegexes: [/.*?chrome\\/([0-9]+)\\.([0-9]+).*/]\n }\n ];\n var PlatformInfo = {\n browsers: constant(browsers),\n oses: constant(oses)\n };\n var edge = 'Edge';\n var chromium = 'Chromium';\n var ie = 'IE';\n var opera = 'Opera';\n var firefox = 'Firefox';\n var safari = 'Safari';\n var unknown$1 = function () {\n return nu$1({\n current: undefined,\n version: Version.unknown()\n });\n };\n var nu$1 = function (info) {\n var current = info.current;\n var version = info.version;\n var isBrowser = function (name) { return function () { return current === name; }; };\n return {\n current: current,\n version: version,\n isEdge: isBrowser(edge),\n isChromium: isBrowser(chromium),\n isIE: isBrowser(ie),\n isOpera: isBrowser(opera),\n isFirefox: isBrowser(firefox),\n isSafari: isBrowser(safari)\n };\n };\n var Browser = {\n unknown: unknown$1,\n nu: nu$1,\n edge: constant(edge),\n chromium: constant(chromium),\n ie: constant(ie),\n opera: constant(opera),\n firefox: constant(firefox),\n safari: constant(safari)\n };\n var windows = 'Windows';\n var ios = 'iOS';\n var android = 'Android';\n var linux = 'Linux';\n var macos = 'macOS';\n var solaris = 'Solaris';\n var freebsd = 'FreeBSD';\n var chromeos = 'ChromeOS';\n var unknown = function () {\n return nu({\n current: undefined,\n version: Version.unknown()\n });\n };\n var nu = function (info) {\n var current = info.current;\n var version = info.version;\n var isOS = function (name) { return function () { return current === name; }; };\n return {\n current: current,\n version: version,\n isWindows: isOS(windows),\n isiOS: isOS(ios),\n isAndroid: isOS(android),\n isMacOS: isOS(macos),\n isLinux: isOS(linux),\n isSolaris: isOS(solaris),\n isFreeBSD: isOS(freebsd),\n isChromeOS: isOS(chromeos)\n };\n };\n var OperatingSystem = {\n unknown: unknown,\n nu: nu,\n windows: constant(windows),\n ios: constant(ios),\n android: constant(android),\n linux: constant(linux),\n macos: constant(macos),\n solaris: constant(solaris),\n freebsd: constant(freebsd),\n chromeos: constant(chromeos)\n };\n var detect$3 = function (userAgent, userAgentDataOpt, mediaMatch) {\n var browsers = PlatformInfo.browsers();\n var oses = PlatformInfo.oses();\n var browser = userAgentDataOpt.bind(function (userAgentData) { return detectBrowser$1(browsers, userAgentData); }).orThunk(function () { return detectBrowser(browsers, userAgent); }).fold(Browser.unknown, Browser.nu);\n var os = detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu);\n var deviceType = DeviceType(os, browser, userAgent, mediaMatch);\n return {\n browser: browser,\n os: os,\n deviceType: deviceType\n };\n };\n var PlatformDetection = { detect: detect$3 };\n var mediaMatch = function (query) { return window.matchMedia(query).matches; };\n var platform = cached(function () { return PlatformDetection.detect(navigator.userAgent, Optional.from(navigator.userAgentData), mediaMatch); });\n var detect$2 = function () { return platform(); };\n var Dimension = function (name, getOffset) {\n var set = function (element, h) {\n if (!isNumber(h) && !h.match(/^[0-9]+$/)) {\n throw new Error(name + '.set accepts only positive integer values. Value was ' + h);\n }\n var dom = element.dom;\n if (isSupported(dom)) {\n dom.style[name] = h + 'px';\n }\n };\n var get = function (element) {\n var r = getOffset(element);\n if (r <= 0 || r === null) {\n var css_1 = get$a(element, name);\n return parseFloat(css_1) || 0;\n }\n return r;\n };\n var getOuter = get;\n var aggregate = function (element, properties) { return foldl(properties, function (acc, property) {\n var val = get$a(element, property);\n var value = val === undefined ? 0 : parseInt(val, 10);\n return isNaN(value) ? acc : acc + value;\n }, 0); };\n var max = function (element, value, properties) {\n var cumulativeInclusions = aggregate(element, properties);\n var absoluteMax = value > cumulativeInclusions ? value - cumulativeInclusions : 0;\n return absoluteMax;\n };\n return {\n set: set,\n get: get,\n getOuter: getOuter,\n aggregate: aggregate,\n max: max\n };\n };\n var toNumber = function (px, fallback) { return toFloat(px).getOr(fallback); };\n var getProp = function (element, name, fallback) { return toNumber(get$a(element, name), fallback); };\n var calcContentBoxSize = function (element, size, upper, lower) {\n var paddingUpper = getProp(element, \"padding-\".concat(upper), 0);\n var paddingLower = getProp(element, \"padding-\".concat(lower), 0);\n var borderUpper = getProp(element, \"border-\".concat(upper, \"-width\"), 0);\n var borderLower = getProp(element, \"border-\".concat(lower, \"-width\"), 0);\n return size - paddingUpper - paddingLower - borderUpper - borderLower;\n };\n var getCalculatedWidth = function (element, boxSizing) {\n var dom = element.dom;\n var width = dom.getBoundingClientRect().width || dom.offsetWidth;\n return boxSizing === 'border-box' ? width : calcContentBoxSize(element, width, 'left', 'right');\n };\n var getHeight$1 = function (element) { return getProp(element, 'height', element.dom.offsetHeight); };\n var getWidth = function (element) { return getProp(element, 'width', element.dom.offsetWidth); };\n var getInnerWidth = function (element) { return getCalculatedWidth(element, 'content-box'); };\n var api$2 = Dimension('width', function (element) { return element.dom.offsetWidth; });\n var get$9 = function (element) { return api$2.get(element); };\n var getOuter$2 = function (element) { return api$2.getOuter(element); };\n var getInner = getInnerWidth;\n var getRuntime$1 = getWidth;\n var addCells = function (gridRow, index, cells) {\n var existingCells = gridRow.cells;\n var before = existingCells.slice(0, index);\n var after = existingCells.slice(index);\n var newCells = before.concat(cells).concat(after);\n return setCells(gridRow, newCells);\n };\n var addCell = function (gridRow, index, cell) { return addCells(gridRow, index, [cell]); };\n var mutateCell = function (gridRow, index, cell) {\n var cells = gridRow.cells;\n cells[index] = cell;\n };\n var setCells = function (gridRow, cells) { return rowcells(gridRow.element, cells, gridRow.section, gridRow.isNew); };\n var mapCells = function (gridRow, f) {\n var cells = gridRow.cells;\n var r = map$1(cells, f);\n return rowcells(gridRow.element, r, gridRow.section, gridRow.isNew);\n };\n var getCell = function (gridRow, index) { return gridRow.cells[index]; };\n var getCellElement = function (gridRow, index) { return getCell(gridRow, index).element; };\n var cellLength = function (gridRow) { return gridRow.cells.length; };\n var extractGridDetails = function (grid) {\n var result = partition(grid, function (row) { return row.section === 'colgroup'; });\n return {\n rows: result.fail,\n cols: result.pass\n };\n };\n var clone = function (gridRow, cloneRow, cloneCell) {\n var newCells = map$1(gridRow.cells, cloneCell);\n return rowcells(cloneRow(gridRow.element), newCells, gridRow.section, true);\n };\n var LOCKED_COL_ATTR = 'data-snooker-locked-cols';\n var getLockedColumnsFromTable = function (table) { return getOpt(table, LOCKED_COL_ATTR).bind(function (lockedColStr) { return Optional.from(lockedColStr.match(/\\d+/g)); }).map(function (lockedCols) { return mapToObject(lockedCols, always); }); };\n var getLockedColumnsFromGrid = function (grid) {\n var locked = foldl(extractGridDetails(grid).rows, function (acc, row) {\n each$2(row.cells, function (cell, idx) {\n if (cell.isLocked) {\n acc[idx] = true;\n }\n });\n return acc;\n }, {});\n var lockedArr = mapToArray(locked, function (_val, key) { return parseInt(key, 10); });\n return sort$1(lockedArr);\n };\n var key = function (row, column) {\n return row + ',' + column;\n };\n var getAt = function (warehouse, row, column) { return Optional.from(warehouse.access[key(row, column)]); };\n var findItem = function (warehouse, item, comparator) {\n var filtered = filterItems(warehouse, function (detail) {\n return comparator(item, detail.element);\n });\n return filtered.length > 0 ? Optional.some(filtered[0]) : Optional.none();\n };\n var filterItems = function (warehouse, predicate) {\n var all = bind$2(warehouse.all, function (r) {\n return r.cells;\n });\n return filter$2(all, predicate);\n };\n var generateColumns = function (rowData) {\n var columnsGroup = {};\n var index = 0;\n each$2(rowData.cells, function (column) {\n var colspan = column.colspan;\n range$1(colspan, function (columnIndex) {\n var colIndex = index + columnIndex;\n columnsGroup[colIndex] = columnext(column.element, colspan, colIndex);\n });\n index += colspan;\n });\n return columnsGroup;\n };\n var generate$1 = function (list) {\n var access = {};\n var cells = [];\n var tableOpt = head(list).map(function (rowData) { return rowData.element; }).bind(table);\n var lockedColumns = tableOpt.bind(getLockedColumnsFromTable).getOr({});\n var maxRows = 0;\n var maxColumns = 0;\n var rowCount = 0;\n var _c = partition(list, function (rowData) { return rowData.section === 'colgroup'; }), colgroupRows = _c.pass, rows = _c.fail;\n each$2(rows, function (rowData) {\n var currentRow = [];\n each$2(rowData.cells, function (rowCell) {\n var start = 0;\n while (access[key(rowCount, start)] !== undefined) {\n start++;\n }\n var isLocked = hasNonNullableKey(lockedColumns, start.toString());\n var current = extended(rowCell.element, rowCell.rowspan, rowCell.colspan, rowCount, start, isLocked);\n for (var occupiedColumnPosition = 0; occupiedColumnPosition < rowCell.colspan; occupiedColumnPosition++) {\n for (var occupiedRowPosition = 0; occupiedRowPosition < rowCell.rowspan; occupiedRowPosition++) {\n var rowPosition = rowCount + occupiedRowPosition;\n var columnPosition = start + occupiedColumnPosition;\n var newpos = key(rowPosition, columnPosition);\n access[newpos] = current;\n maxColumns = Math.max(maxColumns, columnPosition + 1);\n }\n }\n currentRow.push(current);\n });\n maxRows++;\n cells.push(rowdetail(rowData.element, currentRow, rowData.section));\n rowCount++;\n });\n var _d = last$2(colgroupRows).map(function (rowData) {\n var columns = generateColumns(rowData);\n var colgroup$1 = colgroup(rowData.element, values(columns));\n return {\n colgroups: [colgroup$1],\n columns: columns\n };\n }).getOrThunk(function () { return ({\n colgroups: [],\n columns: {}\n }); }), columns = _d.columns, colgroups = _d.colgroups;\n var grid$1 = grid(maxRows, maxColumns);\n return {\n grid: grid$1,\n access: access,\n all: cells,\n columns: columns,\n colgroups: colgroups\n };\n };\n var fromTable = function (table) {\n var list = fromTable$1(table);\n return generate$1(list);\n };\n var justCells = function (warehouse) { return bind$2(warehouse.all, function (w) { return w.cells; }); };\n var justColumns = function (warehouse) { return values(warehouse.columns); };\n var hasColumns = function (warehouse) { return keys(warehouse.columns).length > 0; };\n var getColumnAt = function (warehouse, columnIndex) { return Optional.from(warehouse.columns[columnIndex]); };\n var Warehouse = {\n fromTable: fromTable,\n generate: generate$1,\n getAt: getAt,\n findItem: findItem,\n filterItems: filterItems,\n justCells: justCells,\n justColumns: justColumns,\n hasColumns: hasColumns,\n getColumnAt: getColumnAt\n };\n var columns = function (warehouse, isValidCell) {\n if (isValidCell === void 0) { isValidCell = always; }\n var grid = warehouse.grid;\n var cols = range$1(grid.columns, identity);\n var rowsArr = range$1(grid.rows, identity);\n return map$1(cols, function (col) {\n var getBlock = function () { return bind$2(rowsArr, function (r) { return Warehouse.getAt(warehouse, r, col).filter(function (detail) { return detail.column === col; }).toArray(); }); };\n var isValid = function (detail) { return detail.colspan === 1 && isValidCell(detail.element); };\n var getFallback = function () { return Warehouse.getAt(warehouse, 0, col); };\n return decide(getBlock, isValid, getFallback);\n });\n };\n var decide = function (getBlock, isValid, getFallback) {\n var inBlock = getBlock();\n var validInBlock = find$1(inBlock, isValid);\n var detailOption = validInBlock.orThunk(function () { return Optional.from(inBlock[0]).orThunk(getFallback); });\n return detailOption.map(function (detail) { return detail.element; });\n };\n var rows = function (warehouse) {\n var grid = warehouse.grid;\n var rowsArr = range$1(grid.rows, identity);\n var cols = range$1(grid.columns, identity);\n return map$1(rowsArr, function (row) {\n var getBlock = function () { return bind$2(cols, function (c) { return Warehouse.getAt(warehouse, row, c).filter(function (detail) { return detail.row === row; }).fold(constant([]), function (detail) { return [detail]; }); }); };\n var isSingle = function (detail) { return detail.rowspan === 1; };\n var getFallback = function () { return Warehouse.getAt(warehouse, row, 0); };\n return decide(getBlock, isSingle, getFallback);\n });\n };\n var deduce = function (xs, index) {\n if (index < 0 || index >= xs.length - 1) {\n return Optional.none();\n }\n var current = xs[index].fold(function () {\n var rest = reverse(xs.slice(0, index));\n return findMap(rest, function (a, i) { return a.map(function (aa) { return ({\n value: aa,\n delta: i + 1\n }); }); });\n }, function (c) { return Optional.some({\n value: c,\n delta: 0\n }); });\n var next = xs[index + 1].fold(function () {\n var rest = xs.slice(index + 1);\n return findMap(rest, function (a, i) { return a.map(function (aa) { return ({\n value: aa,\n delta: i + 1\n }); }); });\n }, function (n) { return Optional.some({\n value: n,\n delta: 1\n }); });\n return current.bind(function (c) { return next.map(function (n) {\n var extras = n.delta + c.delta;\n return Math.abs(n.value - c.value) / extras;\n }); });\n };\n var onDirection = function (isLtr, isRtl) { return function (element) { return getDirection(element) === 'rtl' ? isRtl : isLtr; }; };\n var getDirection = function (element) { return get$a(element, 'direction') === 'rtl' ? 'rtl' : 'ltr'; };\n var api$1 = Dimension('height', function (element) {\n var dom = element.dom;\n return inBody(element) ? dom.getBoundingClientRect().height : dom.offsetHeight;\n });\n var get$8 = function (element) { return api$1.get(element); };\n var getOuter$1 = function (element) { return api$1.getOuter(element); };\n var getRuntime = getHeight$1;\n var r = function (left, top) {\n var translate = function (x, y) { return r(left + x, top + y); };\n return {\n left: left,\n top: top,\n translate: translate\n };\n };\n var SugarPosition = r;\n var boxPosition = function (dom) {\n var box = dom.getBoundingClientRect();\n return SugarPosition(box.left, box.top);\n };\n var firstDefinedOrZero = function (a, b) {\n if (a !== undefined) {\n return a;\n }\n else {\n return b !== undefined ? b : 0;\n }\n };\n var absolute = function (element) {\n var doc = element.dom.ownerDocument;\n var body = doc.body;\n var win = doc.defaultView;\n var html = doc.documentElement;\n if (body === element.dom) {\n return SugarPosition(body.offsetLeft, body.offsetTop);\n }\n var scrollTop = firstDefinedOrZero(win === null || win === void 0 ? void 0 : win.pageYOffset, html.scrollTop);\n var scrollLeft = firstDefinedOrZero(win === null || win === void 0 ? void 0 : win.pageXOffset, html.scrollLeft);\n var clientTop = firstDefinedOrZero(html.clientTop, body.clientTop);\n var clientLeft = firstDefinedOrZero(html.clientLeft, body.clientLeft);\n return viewport(element).translate(scrollLeft - clientLeft, scrollTop - clientTop);\n };\n var viewport = function (element) {\n var dom = element.dom;\n var doc = dom.ownerDocument;\n var body = doc.body;\n if (body === dom) {\n return SugarPosition(body.offsetLeft, body.offsetTop);\n }\n if (!inBody(element)) {\n return SugarPosition(0, 0);\n }\n return boxPosition(dom);\n };\n var rowInfo = function (row, y) { return ({\n row: row,\n y: y\n }); };\n var colInfo = function (col, x) { return ({\n col: col,\n x: x\n }); };\n var rtlEdge = function (cell) {\n var pos = absolute(cell);\n return pos.left + getOuter$2(cell);\n };\n var ltrEdge = function (cell) {\n return absolute(cell).left;\n };\n var getLeftEdge = function (index, cell) {\n return colInfo(index, ltrEdge(cell));\n };\n var getRightEdge = function (index, cell) {\n return colInfo(index, rtlEdge(cell));\n };\n var getTop$1 = function (cell) {\n return absolute(cell).top;\n };\n var getTopEdge = function (index, cell) {\n return rowInfo(index, getTop$1(cell));\n };\n var getBottomEdge = function (index, cell) {\n return rowInfo(index, getTop$1(cell) + getOuter$1(cell));\n };\n var findPositions = function (getInnerEdge, getOuterEdge, array) {\n if (array.length === 0) {\n return [];\n }\n var lines = map$1(array.slice(1), function (cellOption, index) {\n return cellOption.map(function (cell) {\n return getInnerEdge(index, cell);\n });\n });\n var lastLine = array[array.length - 1].map(function (cell) {\n return getOuterEdge(array.length - 1, cell);\n });\n return lines.concat([lastLine]);\n };\n var negate = function (step) {\n return -step;\n };\n var height = {\n delta: identity,\n positions: function (optElements) { return findPositions(getTopEdge, getBottomEdge, optElements); },\n edge: getTop$1\n };\n var ltr$1 = {\n delta: identity,\n edge: ltrEdge,\n positions: function (optElements) { return findPositions(getLeftEdge, getRightEdge, optElements); }\n };\n var rtl$1 = {\n delta: negate,\n edge: rtlEdge,\n positions: function (optElements) { return findPositions(getRightEdge, getLeftEdge, optElements); }\n };\n var detect$1 = onDirection(ltr$1, rtl$1);\n var width = {\n delta: function (amount, table) { return detect$1(table).delta(amount, table); },\n positions: function (cols, table) { return detect$1(table).positions(cols, table); },\n edge: function (cell) { return detect$1(cell).edge(cell); }\n };\n var units = {\n unsupportedLength: [\n 'em',\n 'ex',\n 'cap',\n 'ch',\n 'ic',\n 'rem',\n 'lh',\n 'rlh',\n 'vw',\n 'vh',\n 'vi',\n 'vb',\n 'vmin',\n 'vmax',\n 'cm',\n 'mm',\n 'Q',\n 'in',\n 'pc',\n 'pt',\n 'px'\n ],\n fixed: [\n 'px',\n 'pt'\n ],\n relative: ['%'],\n empty: ['']\n };\n var pattern = (function () {\n var decimalDigits = '[0-9]+';\n var signedInteger = '[+-]?' + decimalDigits;\n var exponentPart = '[eE]' + signedInteger;\n var dot = '\\\\.';\n var opt = function (input) { return \"(?:\".concat(input, \")?\"); };\n var unsignedDecimalLiteral = [\n 'Infinity',\n decimalDigits + dot + opt(decimalDigits) + opt(exponentPart),\n dot + decimalDigits + opt(exponentPart),\n decimalDigits + opt(exponentPart)\n ].join('|');\n var float = \"[+-]?(?:\".concat(unsignedDecimalLiteral, \")\");\n return new RegExp(\"^(\".concat(float, \")(.*)$\"));\n })();\n var isUnit = function (unit, accepted) { return exists(accepted, function (acc) { return exists(units[acc], function (check) { return unit === check; }); }); };\n var parse = function (input, accepted) {\n var match = Optional.from(pattern.exec(input));\n return match.bind(function (array) {\n var value = Number(array[1]);\n var unitRaw = array[2];\n if (isUnit(unitRaw, accepted)) {\n return Optional.some({\n value: value,\n unit: unitRaw\n });\n }\n else {\n return Optional.none();\n }\n });\n };\n var rPercentageBasedSizeRegex = /(\\d+(\\.\\d+)?)%/;\n var rPixelBasedSizeRegex = /(\\d+(\\.\\d+)?)px|em/;\n var isCol$2 = isTag('col');\n var getPercentSize = function (elm, outerGetter, innerGetter) {\n var relativeParent = parentElement(elm).getOrThunk(function () { return getBody$1(owner(elm)); });\n return outerGetter(elm) / innerGetter(relativeParent) * 100;\n };\n var setPixelWidth = function (cell, amount) {\n set$1(cell, 'width', amount + 'px');\n };\n var setPercentageWidth = function (cell, amount) {\n set$1(cell, 'width', amount + '%');\n };\n var setHeight = function (cell, amount) {\n set$1(cell, 'height', amount + 'px');\n };\n var getHeightValue = function (cell) { return getRuntime(cell) + 'px'; };\n var convert = function (cell, number, getter, setter) {\n var newSize = table(cell).map(function (table) {\n var total = getter(table);\n return Math.floor(number / 100 * total);\n }).getOr(number);\n setter(cell, newSize);\n return newSize;\n };\n var normalizePixelSize = function (value, cell, getter, setter) {\n var number = parseFloat(value);\n return endsWith(value, '%') && name(cell) !== 'table' ? convert(cell, number, getter, setter) : number;\n };\n var getTotalHeight = function (cell) {\n var value = getHeightValue(cell);\n if (!value) {\n return get$8(cell);\n }\n return normalizePixelSize(value, cell, get$8, setHeight);\n };\n var get$7 = function (cell, type, f) {\n var v = f(cell);\n var span = getSpan(cell, type);\n return v / span;\n };\n var getRaw$1 = function (element, prop) {\n return getRaw$2(element, prop).orThunk(function () {\n return getOpt(element, prop).map(function (val) { return val + 'px'; });\n });\n };\n var getRawWidth$1 = function (element) { return getRaw$1(element, 'width'); };\n var getRawHeight = function (element) { return getRaw$1(element, 'height'); };\n var getPercentageWidth = function (cell) { return getPercentSize(cell, get$9, getInner); };\n var getPixelWidth$1 = function (cell) { return isCol$2(cell) ? get$9(cell) : getRuntime$1(cell); };\n var getHeight = function (cell) {\n return get$7(cell, 'rowspan', getTotalHeight);\n };\n var getGenericWidth = function (cell) {\n var width = getRawWidth$1(cell);\n return width.bind(function (w) { return parse(w, [\n 'fixed',\n 'relative',\n 'empty'\n ]); });\n };\n var setGenericWidth = function (cell, amount, unit) {\n set$1(cell, 'width', amount + unit);\n };\n var getPixelTableWidth = function (table) { return get$9(table) + 'px'; };\n var getPercentTableWidth = function (table) { return getPercentSize(table, get$9, getInner) + '%'; };\n var isPercentSizing$1 = function (table) { return getRawWidth$1(table).exists(function (size) { return rPercentageBasedSizeRegex.test(size); }); };\n var isPixelSizing$1 = function (table) { return getRawWidth$1(table).exists(function (size) { return rPixelBasedSizeRegex.test(size); }); };\n var isNoneSizing$1 = function (table) { return getRawWidth$1(table).isNone(); };\n var percentageBasedSizeRegex = constant(rPercentageBasedSizeRegex);\n var isCol$1 = isTag('col');\n var getRawW = function (cell) {\n return getRawWidth$1(cell).getOrThunk(function () { return getPixelWidth$1(cell) + 'px'; });\n };\n var getRawH = function (cell) {\n return getRawHeight(cell).getOrThunk(function () { return getHeight(cell) + 'px'; });\n };\n var justCols = function (warehouse) { return map$1(Warehouse.justColumns(warehouse), function (column) { return Optional.from(column.element); }); };\n var isValidColumn = function (cell) {\n var browser = detect$2().browser;\n var supportsColWidths = browser.isChromium() || browser.isFirefox();\n return isCol$1(cell) ? supportsColWidths : true;\n };\n var getDimension = function (cellOpt, index, backups, filter, getter, fallback) { return cellOpt.filter(filter).fold(function () { return fallback(deduce(backups, index)); }, function (cell) { return getter(cell); }); };\n var getWidthFrom = function (warehouse, table, getWidth, fallback) {\n var columnCells = columns(warehouse);\n var columns$1 = Warehouse.hasColumns(warehouse) ? justCols(warehouse) : columnCells;\n var backups = [Optional.some(width.edge(table))].concat(map$1(width.positions(columnCells, table), function (pos) { return pos.map(function (p) { return p.x; }); }));\n var colFilter = not(hasColspan);\n return map$1(columns$1, function (cellOption, c) {\n return getDimension(cellOption, c, backups, colFilter, function (column) {\n if (isValidColumn(column)) {\n return getWidth(column);\n }\n else {\n var cell_1 = bindFrom(columnCells[c], identity);\n return getDimension(cell_1, c, backups, colFilter, function (cell) { return fallback(Optional.some(get$9(cell))); }, fallback);\n }\n }, fallback);\n });\n };\n var getDeduced = function (deduced) {\n return deduced.map(function (d) {\n return d + 'px';\n }).getOr('');\n };\n var getRawWidths = function (warehouse, table) {\n return getWidthFrom(warehouse, table, getRawW, getDeduced);\n };\n var getPercentageWidths = function (warehouse, table, tableSize) {\n return getWidthFrom(warehouse, table, getPercentageWidth, function (deduced) {\n return deduced.fold(function () {\n return tableSize.minCellWidth();\n }, function (cellWidth) {\n return cellWidth / tableSize.pixelWidth() * 100;\n });\n });\n };\n var getPixelWidths = function (warehouse, table, tableSize) {\n return getWidthFrom(warehouse, table, getPixelWidth$1, function (deduced) {\n return deduced.getOrThunk(tableSize.minCellWidth);\n });\n };\n var getHeightFrom = function (warehouse, table, direction, getHeight, fallback) {\n var rows$1 = rows(warehouse);\n var backups = [Optional.some(direction.edge(table))].concat(map$1(direction.positions(rows$1, table), function (pos) { return pos.map(function (p) { return p.y; }); }));\n return map$1(rows$1, function (cellOption, c) {\n return getDimension(cellOption, c, backups, not(hasRowspan), getHeight, fallback);\n });\n };\n var getPixelHeights = function (warehouse, table, direction) {\n return getHeightFrom(warehouse, table, direction, getHeight, function (deduced) {\n return deduced.getOrThunk(minHeight);\n });\n };\n var getRawHeights = function (warehouse, table, direction) {\n return getHeightFrom(warehouse, table, direction, getRawH, getDeduced);\n };\n var widthLookup = function (table, getter) { return function () {\n if (inBody(table)) {\n return getter(table);\n }\n else {\n return parseFloat(getRaw$2(table, 'width').getOr('0'));\n }\n }; };\n var noneSize = function (table) {\n var getWidth = widthLookup(table, get$9);\n var zero = constant(0);\n var getWidths = function (warehouse, tableSize) { return getPixelWidths(warehouse, table, tableSize); };\n return {\n width: getWidth,\n pixelWidth: getWidth,\n getWidths: getWidths,\n getCellDelta: zero,\n singleColumnWidth: constant([0]),\n minCellWidth: zero,\n setElementWidth: noop,\n adjustTableWidth: noop,\n isRelative: true,\n label: 'none'\n };\n };\n var percentageSize = function (table) {\n var getFloatWidth = widthLookup(table, function (elem) { return parseFloat(getPercentTableWidth(elem)); });\n var getWidth = widthLookup(table, get$9);\n var getCellDelta = function (delta) { return delta / getWidth() * 100; };\n var singleColumnWidth = function (w, _delta) { return [100 - w]; };\n var minCellWidth = function () { return minWidth() / getWidth() * 100; };\n var adjustTableWidth = function (delta) {\n var currentWidth = getFloatWidth();\n var change = delta / 100 * currentWidth;\n var newWidth = currentWidth + change;\n setPercentageWidth(table, newWidth);\n };\n var getWidths = function (warehouse, tableSize) { return getPercentageWidths(warehouse, table, tableSize); };\n return {\n width: getFloatWidth,\n pixelWidth: getWidth,\n getWidths: getWidths,\n getCellDelta: getCellDelta,\n singleColumnWidth: singleColumnWidth,\n minCellWidth: minCellWidth,\n setElementWidth: setPercentageWidth,\n adjustTableWidth: adjustTableWidth,\n isRelative: true,\n label: 'percent'\n };\n };\n var pixelSize = function (table) {\n var getWidth = widthLookup(table, get$9);\n var getCellDelta = identity;\n var singleColumnWidth = function (w, delta) {\n var newNext = Math.max(minWidth(), w + delta);\n return [newNext - w];\n };\n var adjustTableWidth = function (delta) {\n var newWidth = getWidth() + delta;\n setPixelWidth(table, newWidth);\n };\n var getWidths = function (warehouse, tableSize) { return getPixelWidths(warehouse, table, tableSize); };\n return {\n width: getWidth,\n pixelWidth: getWidth,\n getWidths: getWidths,\n getCellDelta: getCellDelta,\n singleColumnWidth: singleColumnWidth,\n minCellWidth: minWidth,\n setElementWidth: setPixelWidth,\n adjustTableWidth: adjustTableWidth,\n isRelative: false,\n label: 'pixel'\n };\n };\n var chooseSize = function (element, width) {\n var percentMatch = percentageBasedSizeRegex().exec(width);\n if (percentMatch !== null) {\n return percentageSize(element);\n }\n else {\n return pixelSize(element);\n }\n };\n var getTableSize = function (table) {\n var width = getRawWidth$1(table);\n return width.fold(function () { return noneSize(table); }, function (w) { return chooseSize(table, w); });\n };\n var TableSize = {\n getTableSize: getTableSize,\n pixelSize: pixelSize,\n percentageSize: percentageSize,\n noneSize: noneSize\n };\n var statsStruct = function (minRow, minCol, maxRow, maxCol, allCells, selectedCells) { return ({\n minRow: minRow,\n minCol: minCol,\n maxRow: maxRow,\n maxCol: maxCol,\n allCells: allCells,\n selectedCells: selectedCells\n }); };\n var findSelectedStats = function (house, isSelected) {\n var totalColumns = house.grid.columns;\n var totalRows = house.grid.rows;\n var minRow = totalRows;\n var minCol = totalColumns;\n var maxRow = 0;\n var maxCol = 0;\n var allCells = [];\n var selectedCells = [];\n each$1(house.access, function (detail) {\n allCells.push(detail);\n if (isSelected(detail)) {\n selectedCells.push(detail);\n var startRow = detail.row;\n var endRow = startRow + detail.rowspan - 1;\n var startCol = detail.column;\n var endCol = startCol + detail.colspan - 1;\n if (startRow < minRow) {\n minRow = startRow;\n }\n else if (endRow > maxRow) {\n maxRow = endRow;\n }\n if (startCol < minCol) {\n minCol = startCol;\n }\n else if (endCol > maxCol) {\n maxCol = endCol;\n }\n }\n });\n return statsStruct(minRow, minCol, maxRow, maxCol, allCells, selectedCells);\n };\n var makeCell = function (list, seenSelected, rowIndex) {\n var row = list[rowIndex].element;\n var td = SugarElement.fromTag('td');\n append$1(td, SugarElement.fromTag('br'));\n var f = seenSelected ? append$1 : prepend;\n f(row, td);\n };\n var fillInGaps = function (list, house, stats, isSelected) {\n var rows = filter$2(list, function (row) { return row.section !== 'colgroup'; });\n var totalColumns = house.grid.columns;\n var totalRows = house.grid.rows;\n for (var i = 0; i < totalRows; i++) {\n var seenSelected = false;\n for (var j = 0; j < totalColumns; j++) {\n if (!(i < stats.minRow || i > stats.maxRow || j < stats.minCol || j > stats.maxCol)) {\n var needCell = Warehouse.getAt(house, i, j).filter(isSelected).isNone();\n if (needCell) {\n makeCell(rows, seenSelected, i);\n }\n else {\n seenSelected = true;\n }\n }\n }\n }\n };\n var clean = function (replica, stats, house, widthDelta) {\n each$1(house.columns, function (col) {\n if (col.column < stats.minCol || col.column > stats.maxCol) {\n remove$6(col.element);\n }\n });\n var emptyRows = filter$2(firstLayer(replica, 'tr'), function (row) { return row.dom.childElementCount === 0; });\n each$2(emptyRows, remove$6);\n if (stats.minCol === stats.maxCol || stats.minRow === stats.maxRow) {\n each$2(firstLayer(replica, 'th,td'), function (cell) {\n remove$7(cell, 'rowspan');\n remove$7(cell, 'colspan');\n });\n }\n remove$7(replica, LOCKED_COL_ATTR);\n remove$7(replica, 'data-snooker-col-series');\n var tableSize = TableSize.getTableSize(replica);\n tableSize.adjustTableWidth(widthDelta);\n };\n var getTableWidthDelta = function (table, warehouse, tableSize, stats) {\n if (stats.minCol === 0 && warehouse.grid.columns === stats.maxCol + 1) {\n return 0;\n }\n var colWidths = getPixelWidths(warehouse, table, tableSize);\n var allColsWidth = foldl(colWidths, function (acc, width) { return acc + width; }, 0);\n var selectedColsWidth = foldl(colWidths.slice(stats.minCol, stats.maxCol + 1), function (acc, width) { return acc + width; }, 0);\n var newWidth = selectedColsWidth / allColsWidth * tableSize.pixelWidth();\n var delta = newWidth - tableSize.pixelWidth();\n return tableSize.getCellDelta(delta);\n };\n var extract$1 = function (table, selectedSelector) {\n var isSelected = function (detail) { return is$2(detail.element, selectedSelector); };\n var replica = deep(table);\n var list = fromTable$1(replica);\n var tableSize = TableSize.getTableSize(table);\n var replicaHouse = Warehouse.generate(list);\n var replicaStats = findSelectedStats(replicaHouse, isSelected);\n var selector = 'th:not(' + selectedSelector + ')' + ',td:not(' + selectedSelector + ')';\n var unselectedCells = filterFirstLayer(replica, 'th,td', function (cell) { return is$2(cell, selector); });\n each$2(unselectedCells, remove$6);\n fillInGaps(list, replicaHouse, replicaStats, isSelected);\n var house = Warehouse.fromTable(table);\n var widthDelta = getTableWidthDelta(table, house, tableSize, replicaStats);\n clean(replica, replicaStats, replicaHouse, widthDelta);\n return replica;\n };\n var nbsp = '\\xA0';\n var NodeValue = function (is, name) {\n var get = function (element) {\n if (!is(element)) {\n throw new Error('Can only get ' + name + ' value of a ' + name + ' node');\n }\n return getOption(element).getOr('');\n };\n var getOption = function (element) { return is(element) ? Optional.from(element.dom.nodeValue) : Optional.none(); };\n var set = function (element, value) {\n if (!is(element)) {\n throw new Error('Can only set raw ' + name + ' value of a ' + name + ' node');\n }\n element.dom.nodeValue = value;\n };\n return {\n get: get,\n getOption: getOption,\n set: set\n };\n };\n var api = NodeValue(isText, 'text');\n var get$6 = function (element) { return api.get(element); };\n var getOption = function (element) { return api.getOption(element); };\n var set = function (element, value) { return api.set(element, value); };\n var getEnd = function (element) { return name(element) === 'img' ? 1 : getOption(element).fold(function () { return children$2(element).length; }, function (v) { return v.length; }); };\n var isTextNodeWithCursorPosition = function (el) { return getOption(el).filter(function (text) { return text.trim().length !== 0 || text.indexOf(nbsp) > -1; }).isSome(); };\n var isContentEditableFalse = function (elem) { return isHTMLElement(elem) && get$b(elem, 'contenteditable') === 'false'; };\n var elementsWithCursorPosition = [\n 'img',\n 'br'\n ];\n var isCursorPosition = function (elem) {\n var hasCursorPosition = isTextNodeWithCursorPosition(elem);\n return hasCursorPosition || contains$2(elementsWithCursorPosition, name(elem)) || isContentEditableFalse(elem);\n };\n var first = function (element) { return descendant$1(element, isCursorPosition); };\n var last$1 = function (element) { return descendantRtl(element, isCursorPosition); };\n var descendantRtl = function (scope, predicate) {\n var descend = function (element) {\n var children = children$2(element);\n for (var i = children.length - 1; i >= 0; i--) {\n var child_2 = children[i];\n if (predicate(child_2)) {\n return Optional.some(child_2);\n }\n var res = descend(child_2);\n if (res.isSome()) {\n return res;\n }\n }\n return Optional.none();\n };\n return descend(scope);\n };\n var transferableAttributes = {\n scope: [\n 'row',\n 'col'\n ]\n };\n var createCell = function (doc) { return function () {\n var td = SugarElement.fromTag('td', doc.dom);\n append$1(td, SugarElement.fromTag('br', doc.dom));\n return td;\n }; };\n var createCol = function (doc) { return function () {\n return SugarElement.fromTag('col', doc.dom);\n }; };\n var createColgroup = function (doc) { return function () {\n return SugarElement.fromTag('colgroup', doc.dom);\n }; };\n var createRow$1 = function (doc) { return function () {\n return SugarElement.fromTag('tr', doc.dom);\n }; };\n var replace$1 = function (cell, tag, attrs) {\n var replica = copy$2(cell, tag);\n each$1(attrs, function (v, k) {\n if (v === null) {\n remove$7(replica, k);\n }\n else {\n set$2(replica, k, v);\n }\n });\n return replica;\n };\n var pasteReplace = function (cell) {\n return cell;\n };\n var cloneFormats = function (oldCell, newCell, formats) {\n var first$1 = first(oldCell);\n return first$1.map(function (firstText) {\n var formatSelector = formats.join(',');\n var parents = ancestors$3(firstText, formatSelector, function (element) {\n return eq$1(element, oldCell);\n });\n return foldr(parents, function (last, parent) {\n var clonedFormat = shallow(parent);\n append$1(last, clonedFormat);\n return clonedFormat;\n }, newCell);\n }).getOr(newCell);\n };\n var cloneAppropriateAttributes = function (original, clone) {\n each$1(transferableAttributes, function (validAttributes, attributeName) { return getOpt(original, attributeName).filter(function (attribute) { return contains$2(validAttributes, attribute); }).each(function (attribute) { return set$2(clone, attributeName, attribute); }); });\n };\n var cellOperations = function (mutate, doc, formatsToClone) {\n var cloneCss = function (prev, clone) {\n copy$1(prev.element, clone);\n remove$5(clone, 'height');\n if (prev.colspan !== 1) {\n remove$5(clone, 'width');\n }\n };\n var newCell = function (prev) {\n var td = SugarElement.fromTag(name(prev.element), doc.dom);\n var formats = formatsToClone.getOr([\n 'strong',\n 'em',\n 'b',\n 'i',\n 'span',\n 'font',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'p',\n 'div'\n ]);\n var lastNode = formats.length > 0 ? cloneFormats(prev.element, td, formats) : td;\n append$1(lastNode, SugarElement.fromTag('br'));\n cloneCss(prev, td);\n cloneAppropriateAttributes(prev.element, td);\n mutate(prev.element, td);\n return td;\n };\n var newCol = function (prev) {\n var col = SugarElement.fromTag(name(prev.element), doc.dom);\n cloneCss(prev, col);\n mutate(prev.element, col);\n return col;\n };\n return {\n col: newCol,\n colgroup: createColgroup(doc),\n row: createRow$1(doc),\n cell: newCell,\n replace: replace$1,\n colGap: createCol(doc),\n gap: createCell(doc)\n };\n };\n var paste$1 = function (doc) {\n return {\n col: createCol(doc),\n colgroup: createColgroup(doc),\n row: createRow$1(doc),\n cell: createCell(doc),\n replace: pasteReplace,\n colGap: createCol(doc),\n gap: createCell(doc)\n };\n };\n var fromHtml = function (html, scope) {\n var doc = scope || document;\n var div = doc.createElement('div');\n div.innerHTML = html;\n return children$2(SugarElement.fromDom(div));\n };\n var fromDom = function (nodes) { return map$1(nodes, SugarElement.fromDom); };\n var option = function (name) { return function (editor) { return editor.options.get(name); }; };\n var defaultWidth = '100%';\n var getPixelForcedWidth = function (editor) {\n var _a;\n var dom = editor.dom;\n var parentBlock = (_a = dom.getParent(editor.selection.getStart(), dom.isBlock)) !== null && _a !== void 0 ? _a : editor.getBody();\n return getInner(SugarElement.fromDom(parentBlock)) + 'px';\n };\n var determineDefaultTableStyles = function (editor, defaultStyles) {\n if (isTableResponsiveForced(editor) || !shouldStyleWithCss(editor)) {\n return defaultStyles;\n }\n else if (isTablePixelsForced(editor)) {\n return __assign(__assign({}, defaultStyles), { width: getPixelForcedWidth(editor) });\n }\n else {\n return __assign(__assign({}, defaultStyles), { width: defaultWidth });\n }\n };\n var determineDefaultTableAttributes = function (editor, defaultAttributes) {\n if (isTableResponsiveForced(editor) || shouldStyleWithCss(editor)) {\n return defaultAttributes;\n }\n else if (isTablePixelsForced(editor)) {\n return __assign(__assign({}, defaultAttributes), { width: getPixelForcedWidth(editor) });\n }\n else {\n return __assign(__assign({}, defaultAttributes), { width: defaultWidth });\n }\n };\n var register = function (editor) {\n var registerOption = editor.options.register;\n registerOption('table_clone_elements', { processor: 'string[]' });\n registerOption('table_use_colgroups', {\n processor: 'boolean',\n default: true\n });\n registerOption('table_header_type', {\n processor: function (value) {\n var valid = contains$2([\n 'section',\n 'cells',\n 'sectionCells',\n 'auto'\n ], value);\n return valid ? {\n value: value,\n valid: valid\n } : {\n valid: false,\n message: 'Must be one of: section, cells, sectionCells or auto.'\n };\n },\n default: 'section'\n });\n registerOption('table_sizing_mode', {\n processor: 'string',\n default: 'auto'\n });\n registerOption('table_default_attributes', {\n processor: 'object',\n default: { border: '1' }\n });\n registerOption('table_default_styles', {\n processor: 'object',\n default: { 'border-collapse': 'collapse' }\n });\n registerOption('table_column_resizing', {\n processor: function (value) {\n var valid = contains$2([\n 'preservetable',\n 'resizetable'\n ], value);\n return valid ? {\n value: value,\n valid: valid\n } : {\n valid: false,\n message: 'Must be preservetable, or resizetable.'\n };\n },\n default: 'preservetable'\n });\n registerOption('table_resize_bars', {\n processor: 'boolean',\n default: true\n });\n registerOption('table_style_by_css', {\n processor: 'boolean',\n default: true\n });\n registerOption('table_merge_content_on_paste', {\n processor: 'boolean',\n default: true\n });\n };\n var getTableCloneElements = function (editor) {\n return Optional.from(editor.options.get('table_clone_elements'));\n };\n var hasTableObjectResizing = function (editor) {\n var objectResizing = editor.options.get('object_resizing');\n return contains$2(objectResizing.split(','), 'table');\n };\n var getTableHeaderType = option('table_header_type');\n var getTableColumnResizingBehaviour = option('table_column_resizing');\n var isPreserveTableColumnResizing = function (editor) { return getTableColumnResizingBehaviour(editor) === 'preservetable'; };\n var isResizeTableColumnResizing = function (editor) { return getTableColumnResizingBehaviour(editor) === 'resizetable'; };\n var getTableSizingMode = option('table_sizing_mode');\n var isTablePercentagesForced = function (editor) { return getTableSizingMode(editor) === 'relative'; };\n var isTablePixelsForced = function (editor) { return getTableSizingMode(editor) === 'fixed'; };\n var isTableResponsiveForced = function (editor) { return getTableSizingMode(editor) === 'responsive'; };\n var hasTableResizeBars = option('table_resize_bars');\n var shouldStyleWithCss = option('table_style_by_css');\n var shouldMergeContentOnPaste = option('table_merge_content_on_paste');\n var getTableDefaultAttributes = function (editor) {\n var options = editor.options;\n var defaultAttributes = options.get('table_default_attributes');\n return options.isSet('table_default_attributes') ? defaultAttributes : determineDefaultTableAttributes(editor, defaultAttributes);\n };\n var getTableDefaultStyles = function (editor) {\n var options = editor.options;\n var defaultStyles = options.get('table_default_styles');\n return options.isSet('table_default_styles') ? defaultStyles : determineDefaultTableStyles(editor, defaultStyles);\n };\n var tableUseColumnGroup = option('table_use_colgroups');\n var closest = function (target) { return closest$1(target, '[contenteditable]'); };\n var isEditable$1 = function (element, assumeEditable) {\n if (assumeEditable === void 0) { assumeEditable = false; }\n if (inBody(element)) {\n return element.dom.isContentEditable;\n }\n else {\n return closest(element).fold(constant(assumeEditable), function (editable) { return getRaw(editable) === 'true'; });\n }\n };\n var getRaw = function (element) { return element.dom.contentEditable; };\n var getBody = function (editor) { return SugarElement.fromDom(editor.getBody()); };\n var getIsRoot = function (editor) { return function (element) { return eq$1(element, getBody(editor)); }; };\n var removeDataStyle = function (table) {\n remove$7(table, 'data-mce-style');\n var removeStyleAttribute = function (element) { return remove$7(element, 'data-mce-style'); };\n each$2(cells$1(table), removeStyleAttribute);\n each$2(columns$1(table), removeStyleAttribute);\n each$2(rows$1(table), removeStyleAttribute);\n };\n var getSelectionStart = function (editor) { return SugarElement.fromDom(editor.selection.getStart()); };\n var getPixelWidth = function (elm) { return elm.getBoundingClientRect().width; };\n var getPixelHeight = function (elm) { return elm.getBoundingClientRect().height; };\n var getRawWidth = function (editor, elm) {\n var raw = editor.dom.getStyle(elm, 'width') || editor.dom.getAttrib(elm, 'width');\n return Optional.from(raw).filter(isNotEmpty);\n };\n var isPercentage$1 = function (value) { return /^(\\d+(\\.\\d+)?)%$/.test(value); };\n var isPixel = function (value) { return /^(\\d+(\\.\\d+)?)px$/.test(value); };\n var isInEditableContext$1 = function (cell) { return closest$2(cell, isTag('table')).exists(isEditable$1); };\n var inSelection = function (bounds, detail) {\n var leftEdge = detail.column;\n var rightEdge = detail.column + detail.colspan - 1;\n var topEdge = detail.row;\n var bottomEdge = detail.row + detail.rowspan - 1;\n return leftEdge <= bounds.finishCol && rightEdge >= bounds.startCol && (topEdge <= bounds.finishRow && bottomEdge >= bounds.startRow);\n };\n var isWithin = function (bounds, detail) {\n return detail.column >= bounds.startCol && detail.column + detail.colspan - 1 <= bounds.finishCol && detail.row >= bounds.startRow && detail.row + detail.rowspan - 1 <= bounds.finishRow;\n };\n var isRectangular = function (warehouse, bounds) {\n var isRect = true;\n var detailIsWithin = curry(isWithin, bounds);\n for (var i = bounds.startRow; i <= bounds.finishRow; i++) {\n for (var j = bounds.startCol; j <= bounds.finishCol; j++) {\n isRect = isRect && Warehouse.getAt(warehouse, i, j).exists(detailIsWithin);\n }\n }\n return isRect ? Optional.some(bounds) : Optional.none();\n };\n var getBounds = function (detailA, detailB) {\n return bounds(Math.min(detailA.row, detailB.row), Math.min(detailA.column, detailB.column), Math.max(detailA.row + detailA.rowspan - 1, detailB.row + detailB.rowspan - 1), Math.max(detailA.column + detailA.colspan - 1, detailB.column + detailB.colspan - 1));\n };\n var getAnyBox = function (warehouse, startCell, finishCell) {\n var startCoords = Warehouse.findItem(warehouse, startCell, eq$1);\n var finishCoords = Warehouse.findItem(warehouse, finishCell, eq$1);\n return startCoords.bind(function (sc) {\n return finishCoords.map(function (fc) {\n return getBounds(sc, fc);\n });\n });\n };\n var getBox$1 = function (warehouse, startCell, finishCell) {\n return getAnyBox(warehouse, startCell, finishCell).bind(function (bounds) {\n return isRectangular(warehouse, bounds);\n });\n };\n var moveBy$1 = function (warehouse, cell, row, column) {\n return Warehouse.findItem(warehouse, cell, eq$1).bind(function (detail) {\n var startRow = row > 0 ? detail.row + detail.rowspan - 1 : detail.row;\n var startCol = column > 0 ? detail.column + detail.colspan - 1 : detail.column;\n var dest = Warehouse.getAt(warehouse, startRow + row, startCol + column);\n return dest.map(function (d) {\n return d.element;\n });\n });\n };\n var intercepts$1 = function (warehouse, start, finish) {\n return getAnyBox(warehouse, start, finish).map(function (bounds) {\n var inside = Warehouse.filterItems(warehouse, curry(inSelection, bounds));\n return map$1(inside, function (detail) {\n return detail.element;\n });\n });\n };\n var parentCell = function (warehouse, innerCell) {\n var isContainedBy = function (c1, c2) {\n return contains$1(c2, c1);\n };\n return Warehouse.findItem(warehouse, innerCell, isContainedBy).map(function (detail) {\n return detail.element;\n });\n };\n var moveBy = function (cell, deltaRow, deltaColumn) {\n return table(cell).bind(function (table) {\n var warehouse = getWarehouse(table);\n return moveBy$1(warehouse, cell, deltaRow, deltaColumn);\n });\n };\n var intercepts = function (table, first, last) {\n var warehouse = getWarehouse(table);\n return intercepts$1(warehouse, first, last);\n };\n var nestedIntercepts = function (table, first, firstTable, last, lastTable) {\n var warehouse = getWarehouse(table);\n var optStartCell = eq$1(table, firstTable) ? Optional.some(first) : parentCell(warehouse, first);\n var optLastCell = eq$1(table, lastTable) ? Optional.some(last) : parentCell(warehouse, last);\n return optStartCell.bind(function (startCell) { return optLastCell.bind(function (lastCell) { return intercepts$1(warehouse, startCell, lastCell); }); });\n };\n var getBox = function (table, first, last) {\n var warehouse = getWarehouse(table);\n return getBox$1(warehouse, first, last);\n };\n var getWarehouse = Warehouse.fromTable;\n var TagBoundaries = [\n 'body',\n 'p',\n 'div',\n 'article',\n 'aside',\n 'figcaption',\n 'figure',\n 'footer',\n 'header',\n 'nav',\n 'section',\n 'ol',\n 'ul',\n 'li',\n 'table',\n 'thead',\n 'tbody',\n 'tfoot',\n 'caption',\n 'tr',\n 'td',\n 'th',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'blockquote',\n 'pre',\n 'address'\n ];\n var DomUniverse = function () {\n var clone = function (element) {\n return SugarElement.fromDom(element.dom.cloneNode(false));\n };\n var document = function (element) { return documentOrOwner(element).dom; };\n var isBoundary = function (element) {\n if (!isElement(element)) {\n return false;\n }\n if (name(element) === 'body') {\n return true;\n }\n return contains$2(TagBoundaries, name(element));\n };\n var isEmptyTag = function (element) {\n if (!isElement(element)) {\n return false;\n }\n return contains$2([\n 'br',\n 'img',\n 'hr',\n 'input'\n ], name(element));\n };\n var isNonEditable = function (element) { return isElement(element) && get$b(element, 'contenteditable') === 'false'; };\n var comparePosition = function (element, other) {\n return element.dom.compareDocumentPosition(other.dom);\n };\n var copyAttributesTo = function (source, destination) {\n var as = clone$2(source);\n setAll$1(destination, as);\n };\n var isSpecial = function (element) {\n var tag = name(element);\n return contains$2([\n 'script',\n 'noscript',\n 'iframe',\n 'noframes',\n 'noembed',\n 'title',\n 'style',\n 'textarea',\n 'xmp'\n ], tag);\n };\n var getLanguage = function (element) { return isElement(element) ? getOpt(element, 'lang') : Optional.none(); };\n return {\n up: constant({\n selector: ancestor$1,\n closest: closest$1,\n predicate: ancestor$2,\n all: parents\n }),\n down: constant({\n selector: descendants,\n predicate: descendants$1\n }),\n styles: constant({\n get: get$a,\n getRaw: getRaw$2,\n set: set$1,\n remove: remove$5\n }),\n attrs: constant({\n get: get$b,\n set: set$2,\n remove: remove$7,\n copyTo: copyAttributesTo\n }),\n insert: constant({\n before: before$3,\n after: after$5,\n afterAll: after$4,\n append: append$1,\n appendAll: append,\n prepend: prepend,\n wrap: wrap\n }),\n remove: constant({\n unwrap: unwrap,\n remove: remove$6\n }),\n create: constant({\n nu: SugarElement.fromTag,\n clone: clone,\n text: SugarElement.fromText\n }),\n query: constant({\n comparePosition: comparePosition,\n prevSibling: prevSibling,\n nextSibling: nextSibling\n }),\n property: constant({\n children: children$2,\n name: name,\n parent: parent,\n document: document,\n isText: isText,\n isComment: isComment,\n isElement: isElement,\n isSpecial: isSpecial,\n getLanguage: getLanguage,\n getText: get$6,\n setText: set,\n isBoundary: isBoundary,\n isEmptyTag: isEmptyTag,\n isNonEditable: isNonEditable\n }),\n eq: eq$1,\n is: is$1\n };\n };\n var all = function (universe, look, elements, f) {\n var head = elements[0];\n var tail = elements.slice(1);\n return f(universe, look, head, tail);\n };\n var oneAll = function (universe, look, elements) {\n return elements.length > 0 ? all(universe, look, elements, unsafeOne) : Optional.none();\n };\n var unsafeOne = function (universe, look, head, tail) {\n var start = look(universe, head);\n return foldr(tail, function (b, a) {\n var current = look(universe, a);\n return commonElement(universe, b, current);\n }, start);\n };\n var commonElement = function (universe, start, end) {\n return start.bind(function (s) {\n return end.filter(curry(universe.eq, s));\n });\n };\n var eq = function (universe, item) {\n return curry(universe.eq, item);\n };\n var ancestors$2 = function (universe, start, end, isRoot) {\n if (isRoot === void 0) { isRoot = never; }\n var ps1 = [start].concat(universe.up().all(start));\n var ps2 = [end].concat(universe.up().all(end));\n var prune = function (path) {\n var index = findIndex(path, isRoot);\n return index.fold(function () {\n return path;\n }, function (ind) {\n return path.slice(0, ind + 1);\n });\n };\n var pruned1 = prune(ps1);\n var pruned2 = prune(ps2);\n var shared = find$1(pruned1, function (x) {\n return exists(pruned2, eq(universe, x));\n });\n return {\n firstpath: pruned1,\n secondpath: pruned2,\n shared: shared\n };\n };\n var sharedOne$1 = oneAll;\n var ancestors$1 = ancestors$2;\n var universe$3 = DomUniverse();\n var sharedOne = function (look, elements) {\n return sharedOne$1(universe$3, function (_universe, element) {\n return look(element);\n }, elements);\n };\n var ancestors = function (start, finish, isRoot) {\n return ancestors$1(universe$3, start, finish, isRoot);\n };\n var lookupTable = function (container) {\n return ancestor$1(container, 'table');\n };\n var identify = function (start, finish, isRoot) {\n var getIsRoot = function (rootTable) {\n return function (element) {\n return isRoot !== undefined && isRoot(element) || eq$1(element, rootTable);\n };\n };\n if (eq$1(start, finish)) {\n return Optional.some({\n boxes: Optional.some([start]),\n start: start,\n finish: finish\n });\n }\n else {\n return lookupTable(start).bind(function (startTable) {\n return lookupTable(finish).bind(function (finishTable) {\n if (eq$1(startTable, finishTable)) {\n return Optional.some({\n boxes: intercepts(startTable, start, finish),\n start: start,\n finish: finish\n });\n }\n else if (contains$1(startTable, finishTable)) {\n var ancestorCells = ancestors$3(finish, 'td,th', getIsRoot(startTable));\n var finishCell = ancestorCells.length > 0 ? ancestorCells[ancestorCells.length - 1] : finish;\n return Optional.some({\n boxes: nestedIntercepts(startTable, start, startTable, finish, finishTable),\n start: start,\n finish: finishCell\n });\n }\n else if (contains$1(finishTable, startTable)) {\n var ancestorCells = ancestors$3(start, 'td,th', getIsRoot(finishTable));\n var startCell = ancestorCells.length > 0 ? ancestorCells[ancestorCells.length - 1] : start;\n return Optional.some({\n boxes: nestedIntercepts(finishTable, start, startTable, finish, finishTable),\n start: start,\n finish: startCell\n });\n }\n else {\n return ancestors(start, finish).shared.bind(function (lca) {\n return closest$1(lca, 'table', isRoot).bind(function (lcaTable) {\n var finishAncestorCells = ancestors$3(finish, 'td,th', getIsRoot(lcaTable));\n var finishCell = finishAncestorCells.length > 0 ? finishAncestorCells[finishAncestorCells.length - 1] : finish;\n var startAncestorCells = ancestors$3(start, 'td,th', getIsRoot(lcaTable));\n var startCell = startAncestorCells.length > 0 ? startAncestorCells[startAncestorCells.length - 1] : start;\n return Optional.some({\n boxes: nestedIntercepts(lcaTable, start, startTable, finish, finishTable),\n start: startCell,\n finish: finishCell\n });\n });\n });\n }\n });\n });\n }\n };\n var retrieve$1 = function (container, selector) {\n var sels = descendants(container, selector);\n return sels.length > 0 ? Optional.some(sels) : Optional.none();\n };\n var getLast = function (boxes, lastSelectedSelector) {\n return find$1(boxes, function (box) {\n return is$2(box, lastSelectedSelector);\n });\n };\n var getEdges = function (container, firstSelectedSelector, lastSelectedSelector) {\n return descendant(container, firstSelectedSelector).bind(function (first) {\n return descendant(container, lastSelectedSelector).bind(function (last) {\n return sharedOne(lookupTable, [\n first,\n last\n ]).map(function (table) {\n return {\n first: first,\n last: last,\n table: table\n };\n });\n });\n });\n };\n var expandTo = function (finish, firstSelectedSelector) {\n return ancestor$1(finish, 'table').bind(function (table) {\n return descendant(table, firstSelectedSelector).bind(function (start) {\n return identify(start, finish).bind(function (identified) {\n return identified.boxes.map(function (boxes) {\n return {\n boxes: boxes,\n start: identified.start,\n finish: identified.finish\n };\n });\n });\n });\n });\n };\n var shiftSelection = function (boxes, deltaRow, deltaColumn, firstSelectedSelector, lastSelectedSelector) {\n return getLast(boxes, lastSelectedSelector).bind(function (last) {\n return moveBy(last, deltaRow, deltaColumn).bind(function (finish) {\n return expandTo(finish, firstSelectedSelector);\n });\n });\n };\n var retrieve = function (container, selector) {\n return retrieve$1(container, selector);\n };\n var retrieveBox = function (container, firstSelectedSelector, lastSelectedSelector) {\n return getEdges(container, firstSelectedSelector, lastSelectedSelector).bind(function (edges) {\n var isRoot = function (ancestor) {\n return eq$1(container, ancestor);\n };\n var sectionSelector = 'thead,tfoot,tbody,table';\n var firstAncestor = ancestor$1(edges.first, sectionSelector, isRoot);\n var lastAncestor = ancestor$1(edges.last, sectionSelector, isRoot);\n return firstAncestor.bind(function (fA) {\n return lastAncestor.bind(function (lA) {\n return eq$1(fA, lA) ? getBox(edges.table, edges.first, edges.last) : Optional.none();\n });\n });\n });\n };\n var selection = identity;\n var unmergable = function (selectedCells) {\n var hasSpan = function (elem, type) { return getOpt(elem, type).exists(function (span) { return parseInt(span, 10) > 1; }); };\n var hasRowOrColSpan = function (elem) { return hasSpan(elem, 'rowspan') || hasSpan(elem, 'colspan'); };\n return selectedCells.length > 0 && forall(selectedCells, hasRowOrColSpan) ? Optional.some(selectedCells) : Optional.none();\n };\n var mergable = function (table, selectedCells, ephemera) {\n if (selectedCells.length <= 1) {\n return Optional.none();\n }\n else {\n return retrieveBox(table, ephemera.firstSelectedSelector, ephemera.lastSelectedSelector).map(function (bounds) { return ({\n bounds: bounds,\n cells: selectedCells\n }); });\n }\n };\n var strSelected = 'data-mce-selected';\n var strSelectedSelector = 'td[' + strSelected + '],th[' + strSelected + ']';\n var strAttributeSelector = '[' + strSelected + ']';\n var strFirstSelected = 'data-mce-first-selected';\n var strFirstSelectedSelector = 'td[' + strFirstSelected + '],th[' + strFirstSelected + ']';\n var strLastSelected = 'data-mce-last-selected';\n var strLastSelectedSelector = 'td[' + strLastSelected + '],th[' + strLastSelected + ']';\n var attributeSelector = strAttributeSelector;\n var ephemera = {\n selected: strSelected,\n selectedSelector: strSelectedSelector,\n firstSelected: strFirstSelected,\n firstSelectedSelector: strFirstSelectedSelector,\n lastSelected: strLastSelected,\n lastSelectedSelector: strLastSelectedSelector\n };\n var forMenu = function (selectedCells, table, cell) { return ({\n element: cell,\n mergable: mergable(table, selectedCells, ephemera),\n unmergable: unmergable(selectedCells),\n selection: selection(selectedCells)\n }); };\n var paste = function (element, clipboard, generators) { return ({\n element: element,\n clipboard: clipboard,\n generators: generators\n }); };\n var pasteRows = function (selectedCells, _cell, clipboard, generators) { return ({\n selection: selection(selectedCells),\n clipboard: clipboard,\n generators: generators\n }); };\n var getSelectionCellFallback = function (element) { return table(element).bind(function (table) { return retrieve(table, ephemera.firstSelectedSelector); }).fold(constant(element), function (cells) { return cells[0]; }); };\n var getSelectionFromSelector = function (selector) { return function (initCell, isRoot) {\n var cellName = name(initCell);\n var cell = cellName === 'col' || cellName === 'colgroup' ? getSelectionCellFallback(initCell) : initCell;\n return closest$1(cell, selector, isRoot);\n }; };\n var getSelectionCellOrCaption = getSelectionFromSelector('th,td,caption');\n var getSelectionCell = getSelectionFromSelector('th,td');\n var getCellsFromSelection = function (editor) { return fromDom(editor.model.table.getSelectedCells()); };\n var getCellsFromFakeSelection = function (editor) { return filter$2(getCellsFromSelection(editor), function (cell) { return is$2(cell, ephemera.selectedSelector); }); };\n var extractSelected = function (cells) {\n return table(cells[0]).map(function (table) {\n var replica = extract$1(table, attributeSelector);\n removeDataStyle(replica);\n return [replica];\n });\n };\n var serializeElements = function (editor, elements) { return map$1(elements, function (elm) { return editor.selection.serializer.serialize(elm.dom, {}); }).join(''); };\n var getTextContent = function (elements) { return map$1(elements, function (element) { return element.dom.innerText; }).join(''); };\n var registerEvents = function (editor, actions) {\n editor.on('BeforeGetContent', function (e) {\n var multiCellContext = function (cells) {\n e.preventDefault();\n extractSelected(cells).each(function (elements) {\n e.content = e.format === 'text' ? getTextContent(elements) : serializeElements(editor, elements);\n });\n };\n if (e.selection === true) {\n var cells_3 = getCellsFromFakeSelection(editor);\n if (cells_3.length >= 1) {\n multiCellContext(cells_3);\n }\n }\n });\n editor.on('BeforeSetContent', function (e) {\n if (e.selection === true && e.paste === true) {\n var selectedCells = getCellsFromSelection(editor);\n head(selectedCells).each(function (cell) {\n table(cell).each(function (table) {\n var elements = filter$2(fromHtml(e.content), function (content) {\n return name(content) !== 'meta';\n });\n var isTable = isTag('table');\n if (shouldMergeContentOnPaste(editor) && elements.length === 1 && isTable(elements[0])) {\n e.preventDefault();\n var doc = SugarElement.fromDom(editor.getDoc());\n var generators = paste$1(doc);\n var targets = paste(cell, elements[0], generators);\n actions.pasteCells(table, targets).each(function () {\n editor.focus();\n });\n }\n });\n });\n }\n });\n };\n var point = function (element, offset) { return ({\n element: element,\n offset: offset\n }); };\n var scan$1 = function (universe, element, direction) {\n if (universe.property().isText(element) && universe.property().getText(element).trim().length === 0 || universe.property().isComment(element)) {\n return direction(element).bind(function (elem) {\n return scan$1(universe, elem, direction).orThunk(function () {\n return Optional.some(elem);\n });\n });\n }\n else {\n return Optional.none();\n }\n };\n var toEnd = function (universe, element) {\n if (universe.property().isText(element)) {\n return universe.property().getText(element).length;\n }\n var children = universe.property().children(element);\n return children.length;\n };\n var freefallRtl$2 = function (universe, element) {\n var candidate = scan$1(universe, element, universe.query().prevSibling).getOr(element);\n if (universe.property().isText(candidate)) {\n return point(candidate, toEnd(universe, candidate));\n }\n var children = universe.property().children(candidate);\n return children.length > 0 ? freefallRtl$2(universe, children[children.length - 1]) : point(candidate, toEnd(universe, candidate));\n };\n var freefallRtl$1 = freefallRtl$2;\n var universe$2 = DomUniverse();\n var freefallRtl = function (element) {\n return freefallRtl$1(universe$2, element);\n };\n var halve = function (main, other) {\n if (!hasColspan(main)) {\n var width_1 = getGenericWidth(main);\n width_1.each(function (w) {\n var newWidth = w.value / 2;\n setGenericWidth(main, newWidth, w.unit);\n setGenericWidth(other, newWidth, w.unit);\n });\n }\n };\n var zero = function (array) { return map$1(array, constant(0)); };\n var surround = function (sizes, startIndex, endIndex, results, f) { return f(sizes.slice(0, startIndex)).concat(results).concat(f(sizes.slice(endIndex))); };\n var clampDeltaHelper = function (predicate) { return function (sizes, index, delta, minCellSize) {\n if (!predicate(delta)) {\n return delta;\n }\n else {\n var newSize = Math.max(minCellSize, sizes[index] - Math.abs(delta));\n var diff = Math.abs(newSize - sizes[index]);\n return delta >= 0 ? diff : -diff;\n }\n }; };\n var clampNegativeDelta = clampDeltaHelper(function (delta) { return delta < 0; });\n var clampDelta = clampDeltaHelper(always);\n var resizeTable = function () {\n var calcFixedDeltas = function (sizes, index, next, delta, minCellSize) {\n var clampedDelta = clampNegativeDelta(sizes, index, delta, minCellSize);\n return surround(sizes, index, next + 1, [\n clampedDelta,\n 0\n ], zero);\n };\n var calcRelativeDeltas = function (sizes, index, delta, minCellSize) {\n var ratio = (100 + delta) / 100;\n var newThis = Math.max(minCellSize, (sizes[index] + delta) / ratio);\n return map$1(sizes, function (size, idx) {\n var newSize = idx === index ? newThis : size / ratio;\n return newSize - size;\n });\n };\n var calcLeftEdgeDeltas = function (sizes, index, next, delta, minCellSize, isRelative) {\n if (isRelative) {\n return calcRelativeDeltas(sizes, index, delta, minCellSize);\n }\n else {\n return calcFixedDeltas(sizes, index, next, delta, minCellSize);\n }\n };\n var calcMiddleDeltas = function (sizes, _prev, index, next, delta, minCellSize, isRelative) { return calcLeftEdgeDeltas(sizes, index, next, delta, minCellSize, isRelative); };\n var resizeTable = function (resizer, delta) { return resizer(delta); };\n var calcRightEdgeDeltas = function (sizes, _prev, index, delta, minCellSize, isRelative) {\n if (isRelative) {\n return calcRelativeDeltas(sizes, index, delta, minCellSize);\n }\n else {\n var clampedDelta = clampNegativeDelta(sizes, index, delta, minCellSize);\n return zero(sizes.slice(0, index)).concat([clampedDelta]);\n }\n };\n var calcRedestributedWidths = function (sizes, totalWidth, pixelDelta, isRelative) {\n if (isRelative) {\n var tableWidth = totalWidth + pixelDelta;\n var ratio_1 = tableWidth / totalWidth;\n var newSizes = map$1(sizes, function (size) { return size / ratio_1; });\n return {\n delta: ratio_1 * 100 - 100,\n newSizes: newSizes\n };\n }\n else {\n return {\n delta: pixelDelta,\n newSizes: sizes\n };\n }\n };\n return {\n resizeTable: resizeTable,\n clampTableDelta: clampNegativeDelta,\n calcLeftEdgeDeltas: calcLeftEdgeDeltas,\n calcMiddleDeltas: calcMiddleDeltas,\n calcRightEdgeDeltas: calcRightEdgeDeltas,\n calcRedestributedWidths: calcRedestributedWidths\n };\n };\n var preserveTable = function () {\n var calcLeftEdgeDeltas = function (sizes, index, next, delta, minCellSize) {\n var idx = delta >= 0 ? next : index;\n var clampedDelta = clampDelta(sizes, idx, delta, minCellSize);\n return surround(sizes, index, next + 1, [\n clampedDelta,\n -clampedDelta\n ], zero);\n };\n var calcMiddleDeltas = function (sizes, _prev, index, next, delta, minCellSize) { return calcLeftEdgeDeltas(sizes, index, next, delta, minCellSize); };\n var resizeTable = function (resizer, delta, isLastColumn) {\n if (isLastColumn) {\n resizer(delta);\n }\n };\n var calcRightEdgeDeltas = function (sizes, _prev, _index, delta, _minCellSize, isRelative) {\n if (isRelative) {\n return zero(sizes);\n }\n else {\n var diff = delta / sizes.length;\n return map$1(sizes, constant(diff));\n }\n };\n var clampTableDelta = function (sizes, index, delta, minCellSize, isLastColumn) {\n if (isLastColumn) {\n if (delta >= 0) {\n return delta;\n }\n else {\n var maxDelta = foldl(sizes, function (a, b) { return a + b - minCellSize; }, 0);\n return Math.max(-maxDelta, delta);\n }\n }\n else {\n return clampNegativeDelta(sizes, index, delta, minCellSize);\n }\n };\n var calcRedestributedWidths = function (sizes, _totalWidth, _pixelDelta, _isRelative) { return ({\n delta: 0,\n newSizes: sizes\n }); };\n return {\n resizeTable: resizeTable,\n clampTableDelta: clampTableDelta,\n calcLeftEdgeDeltas: calcLeftEdgeDeltas,\n calcMiddleDeltas: calcMiddleDeltas,\n calcRightEdgeDeltas: calcRightEdgeDeltas,\n calcRedestributedWidths: calcRedestributedWidths\n };\n };\n var getGridSize = function (table) {\n var warehouse = Warehouse.fromTable(table);\n return warehouse.grid;\n };\n var isHeaderCell = isTag('th');\n var isHeaderCells = function (cells) { return forall(cells, function (cell) { return isHeaderCell(cell.element); }); };\n var getRowHeaderType = function (isHeaderRow, isHeaderCells) {\n if (isHeaderRow && isHeaderCells) {\n return 'sectionCells';\n }\n else if (isHeaderRow) {\n return 'section';\n }\n else {\n return 'cells';\n }\n };\n var getRowType = function (row) {\n var isHeaderRow = row.section === 'thead';\n var isHeaderCells = is(findCommonCellType(row.cells), 'th');\n if (row.section === 'tfoot') {\n return { type: 'footer' };\n }\n else if (isHeaderRow || isHeaderCells) {\n return {\n type: 'header',\n subType: getRowHeaderType(isHeaderRow, isHeaderCells)\n };\n }\n else {\n return { type: 'body' };\n }\n };\n var findCommonCellType = function (cells) {\n var headerCells = filter$2(cells, function (cell) { return isHeaderCell(cell.element); });\n if (headerCells.length === 0) {\n return Optional.some('td');\n }\n else if (headerCells.length === cells.length) {\n return Optional.some('th');\n }\n else {\n return Optional.none();\n }\n };\n var findCommonRowType = function (rows) {\n var rowTypes = map$1(rows, function (row) { return getRowType(row).type; });\n var hasHeader = contains$2(rowTypes, 'header');\n var hasFooter = contains$2(rowTypes, 'footer');\n if (!hasHeader && !hasFooter) {\n return Optional.some('body');\n }\n else {\n var hasBody = contains$2(rowTypes, 'body');\n if (hasHeader && !hasBody && !hasFooter) {\n return Optional.some('header');\n }\n else if (!hasHeader && !hasBody && hasFooter) {\n return Optional.some('footer');\n }\n else {\n return Optional.none();\n }\n }\n };\n var findTableRowHeaderType = function (warehouse) { return findMap(warehouse.all, function (row) {\n var rowType = getRowType(row);\n return rowType.type === 'header' ? Optional.from(rowType.subType) : Optional.none();\n }); };\n var transformCell = function (cell, comparator, substitution) { return elementnew(substitution(cell.element, comparator), true, cell.isLocked); };\n var transformRow = function (row, section) { return row.section !== section ? rowcells(row.element, row.cells, section, row.isNew) : row; };\n var section = function () { return ({\n transformRow: transformRow,\n transformCell: function (cell, comparator, substitution) {\n var newCell = substitution(cell.element, comparator);\n var fixedCell = name(newCell) !== 'td' ? mutate$1(newCell, 'td') : newCell;\n return elementnew(fixedCell, cell.isNew, cell.isLocked);\n }\n }); };\n var sectionCells = function () { return ({\n transformRow: transformRow,\n transformCell: transformCell\n }); };\n var cells = function () { return ({\n transformRow: function (row, section) {\n var newSection = section === 'thead' ? 'tbody' : section;\n return transformRow(row, newSection);\n },\n transformCell: transformCell\n }); };\n var fallback = function () { return ({\n transformRow: identity,\n transformCell: transformCell\n }); };\n var getTableSectionType = function (table, fallback) {\n var warehouse = Warehouse.fromTable(table);\n var type = findTableRowHeaderType(warehouse).getOr(fallback);\n switch (type) {\n case 'section':\n return section();\n case 'sectionCells':\n return sectionCells();\n case 'cells':\n return cells();\n }\n };\n var TableSection = {\n getTableSectionType: getTableSectionType,\n section: section,\n sectionCells: sectionCells,\n cells: cells,\n fallback: fallback\n };\n var setIfNot = function (element, property, value, ignore) {\n if (value === ignore) {\n remove$7(element, property);\n }\n else {\n set$2(element, property, value);\n }\n };\n var insert$1 = function (table, selector, element) {\n last$2(children(table, selector)).fold(function () { return prepend(table, element); }, function (child) { return after$5(child, element); });\n };\n var generateSection = function (table, sectionName) {\n var section = child(table, sectionName).getOrThunk(function () {\n var newSection = SugarElement.fromTag(sectionName, owner(table).dom);\n if (sectionName === 'thead') {\n insert$1(table, 'caption,colgroup', newSection);\n }\n else if (sectionName === 'colgroup') {\n insert$1(table, 'caption', newSection);\n }\n else {\n append$1(table, newSection);\n }\n return newSection;\n });\n empty(section);\n return section;\n };\n var render$1 = function (table, grid) {\n var newRows = [];\n var newCells = [];\n var syncRows = function (gridSection) { return map$1(gridSection, function (row) {\n if (row.isNew) {\n newRows.push(row.element);\n }\n var tr = row.element;\n empty(tr);\n each$2(row.cells, function (cell) {\n if (cell.isNew) {\n newCells.push(cell.element);\n }\n setIfNot(cell.element, 'colspan', cell.colspan, 1);\n setIfNot(cell.element, 'rowspan', cell.rowspan, 1);\n append$1(tr, cell.element);\n });\n return tr;\n }); };\n var syncColGroup = function (gridSection) { return bind$2(gridSection, function (colGroup) { return map$1(colGroup.cells, function (col) {\n setIfNot(col.element, 'span', col.colspan, 1);\n return col.element;\n }); }); };\n var renderSection = function (gridSection, sectionName) {\n var section = generateSection(table, sectionName);\n var sync = sectionName === 'colgroup' ? syncColGroup : syncRows;\n var sectionElems = sync(gridSection);\n append(section, sectionElems);\n };\n var removeSection = function (sectionName) {\n child(table, sectionName).each(remove$6);\n };\n var renderOrRemoveSection = function (gridSection, sectionName) {\n if (gridSection.length > 0) {\n renderSection(gridSection, sectionName);\n }\n else {\n removeSection(sectionName);\n }\n };\n var headSection = [];\n var bodySection = [];\n var footSection = [];\n var columnGroupsSection = [];\n each$2(grid, function (row) {\n switch (row.section) {\n case 'thead':\n headSection.push(row);\n break;\n case 'tbody':\n bodySection.push(row);\n break;\n case 'tfoot':\n footSection.push(row);\n break;\n case 'colgroup':\n columnGroupsSection.push(row);\n break;\n }\n });\n renderOrRemoveSection(columnGroupsSection, 'colgroup');\n renderOrRemoveSection(headSection, 'thead');\n renderOrRemoveSection(bodySection, 'tbody');\n renderOrRemoveSection(footSection, 'tfoot');\n return {\n newRows: newRows,\n newCells: newCells\n };\n };\n var copy = function (grid) { return map$1(grid, function (row) {\n var tr = shallow(row.element);\n each$2(row.cells, function (cell) {\n var clonedCell = deep(cell.element);\n setIfNot(clonedCell, 'colspan', cell.colspan, 1);\n setIfNot(clonedCell, 'rowspan', cell.rowspan, 1);\n append$1(tr, clonedCell);\n });\n return tr;\n }); };\n var getColumn = function (grid, index) {\n return map$1(grid, function (row) {\n return getCell(row, index);\n });\n };\n var getRow = function (grid, index) {\n return grid[index];\n };\n var findDiff = function (xs, comp) {\n if (xs.length === 0) {\n return 0;\n }\n var first = xs[0];\n var index = findIndex(xs, function (x) {\n return !comp(first.element, x.element);\n });\n return index.getOr(xs.length);\n };\n var subgrid = function (grid, row, column, comparator) {\n var gridRow = getRow(grid, row);\n var isColRow = gridRow.section === 'colgroup';\n var colspan = findDiff(gridRow.cells.slice(column), comparator);\n var rowspan = isColRow ? 1 : findDiff(getColumn(grid.slice(row), column), comparator);\n return {\n colspan: colspan,\n rowspan: rowspan\n };\n };\n var toDetails = function (grid, comparator) {\n var seen = map$1(grid, function (row) { return map$1(row.cells, never); });\n var updateSeen = function (rowIndex, columnIndex, rowspan, colspan) {\n for (var row_1 = rowIndex; row_1 < rowIndex + rowspan; row_1++) {\n for (var column = columnIndex; column < columnIndex + colspan; column++) {\n seen[row_1][column] = true;\n }\n }\n };\n return map$1(grid, function (row, rowIndex) {\n var details = bind$2(row.cells, function (cell, columnIndex) {\n if (seen[rowIndex][columnIndex] === false) {\n var result = subgrid(grid, rowIndex, columnIndex, comparator);\n updateSeen(rowIndex, columnIndex, result.rowspan, result.colspan);\n return [detailnew(cell.element, result.rowspan, result.colspan, cell.isNew)];\n }\n else {\n return [];\n }\n });\n return rowdetailnew(row.element, details, row.section, row.isNew);\n });\n };\n var toGrid = function (warehouse, generators, isNew) {\n var grid = [];\n each$2(warehouse.colgroups, function (colgroup) {\n var colgroupCols = [];\n for (var columnIndex = 0; columnIndex < warehouse.grid.columns; columnIndex++) {\n var element = Warehouse.getColumnAt(warehouse, columnIndex).map(function (column) { return elementnew(column.element, isNew, false); }).getOrThunk(function () { return elementnew(generators.colGap(), true, false); });\n colgroupCols.push(element);\n }\n grid.push(rowcells(colgroup.element, colgroupCols, 'colgroup', isNew));\n });\n for (var rowIndex = 0; rowIndex < warehouse.grid.rows; rowIndex++) {\n var rowCells = [];\n for (var columnIndex = 0; columnIndex < warehouse.grid.columns; columnIndex++) {\n var element = Warehouse.getAt(warehouse, rowIndex, columnIndex).map(function (item) { return elementnew(item.element, isNew, item.isLocked); }).getOrThunk(function () { return elementnew(generators.gap(), true, false); });\n rowCells.push(element);\n }\n var rowDetail = warehouse.all[rowIndex];\n var row_2 = rowcells(rowDetail.element, rowCells, rowDetail.section, isNew);\n grid.push(row_2);\n }\n return grid;\n };\n var fromWarehouse = function (warehouse, generators) { return toGrid(warehouse, generators, false); };\n var toDetailList = function (grid) { return toDetails(grid, eq$1); };\n var findInWarehouse = function (warehouse, element) { return findMap(warehouse.all, function (r) { return find$1(r.cells, function (e) { return eq$1(element, e.element); }); }); };\n var extractCells = function (warehouse, target, predicate) {\n var details = map$1(target.selection, function (cell$1) {\n return cell(cell$1).bind(function (lc) { return findInWarehouse(warehouse, lc); }).filter(predicate);\n });\n var cells = cat(details);\n return someIf(cells.length > 0, cells);\n };\n var run = function (operation, extract, adjustment, postAction, genWrappers) { return function (table, target, generators, behaviours) {\n var warehouse = Warehouse.fromTable(table);\n var tableSection = Optional.from(behaviours === null || behaviours === void 0 ? void 0 : behaviours.section).getOrThunk(TableSection.fallback);\n var output = extract(warehouse, target).map(function (info) {\n var model = fromWarehouse(warehouse, generators);\n var result = operation(model, info, eq$1, genWrappers(generators), tableSection);\n var lockedColumns = getLockedColumnsFromGrid(result.grid);\n var grid = toDetailList(result.grid);\n return {\n info: info,\n grid: grid,\n cursor: result.cursor,\n lockedColumns: lockedColumns\n };\n });\n return output.bind(function (out) {\n var newElements = render$1(table, out.grid);\n var tableSizing = Optional.from(behaviours === null || behaviours === void 0 ? void 0 : behaviours.sizing).getOrThunk(function () { return TableSize.getTableSize(table); });\n var resizing = Optional.from(behaviours === null || behaviours === void 0 ? void 0 : behaviours.resize).getOrThunk(preserveTable);\n adjustment(table, out.grid, out.info, {\n sizing: tableSizing,\n resize: resizing,\n section: tableSection\n });\n postAction(table);\n remove$7(table, LOCKED_COL_ATTR);\n if (out.lockedColumns.length > 0) {\n set$2(table, LOCKED_COL_ATTR, out.lockedColumns.join(','));\n }\n return Optional.some({\n cursor: out.cursor,\n newRows: newElements.newRows,\n newCells: newElements.newCells\n });\n });\n }; };\n var onPaste = function (warehouse, target) { return cell(target.element).bind(function (cell) { return findInWarehouse(warehouse, cell).map(function (details) {\n var value = __assign(__assign({}, details), { generators: target.generators, clipboard: target.clipboard });\n return value;\n }); }); };\n var onPasteByEditor = function (warehouse, target) { return extractCells(warehouse, target, always).map(function (cells) { return ({\n cells: cells,\n generators: target.generators,\n clipboard: target.clipboard\n }); }); };\n var onMergable = function (_warehouse, target) { return target.mergable; };\n var onUnmergable = function (_warehouse, target) { return target.unmergable; };\n var onCells = function (warehouse, target) { return extractCells(warehouse, target, always); };\n var onUnlockedCells = function (warehouse, target) { return extractCells(warehouse, target, function (detail) { return !detail.isLocked; }); };\n var isUnlockedTableCell = function (warehouse, cell) { return findInWarehouse(warehouse, cell).exists(function (detail) { return !detail.isLocked; }); };\n var allUnlocked = function (warehouse, cells) { return forall(cells, function (cell) { return isUnlockedTableCell(warehouse, cell); }); };\n var onUnlockedMergable = function (warehouse, target) { return onMergable(warehouse, target).filter(function (mergeable) { return allUnlocked(warehouse, mergeable.cells); }); };\n var onUnlockedUnmergable = function (warehouse, target) { return onUnmergable(warehouse, target).filter(function (cells) { return allUnlocked(warehouse, cells); }); };\n var merge$2 = function (grid, bounds, comparator, substitution) {\n var rows = extractGridDetails(grid).rows;\n if (rows.length === 0) {\n return grid;\n }\n for (var i = bounds.startRow; i <= bounds.finishRow; i++) {\n for (var j = bounds.startCol; j <= bounds.finishCol; j++) {\n var row_3 = rows[i];\n var isLocked = getCell(row_3, j).isLocked;\n mutateCell(row_3, j, elementnew(substitution(), false, isLocked));\n }\n }\n return grid;\n };\n var unmerge = function (grid, target, comparator, substitution) {\n var rows = extractGridDetails(grid).rows;\n var first = true;\n for (var i = 0; i < rows.length; i++) {\n for (var j = 0; j < cellLength(rows[0]); j++) {\n var row_4 = rows[i];\n var currentCell = getCell(row_4, j);\n var currentCellElm = currentCell.element;\n var isToReplace = comparator(currentCellElm, target);\n if (isToReplace && !first) {\n mutateCell(row_4, j, elementnew(substitution(), true, currentCell.isLocked));\n }\n else if (isToReplace) {\n first = false;\n }\n }\n }\n return grid;\n };\n var uniqueCells = function (row, comparator) {\n return foldl(row, function (rest, cell) {\n return exists(rest, function (currentCell) {\n return comparator(currentCell.element, cell.element);\n }) ? rest : rest.concat([cell]);\n }, []);\n };\n var splitCols = function (grid, index, comparator, substitution) {\n if (index > 0 && index < grid[0].cells.length) {\n each$2(grid, function (row) {\n var prevCell = row.cells[index - 1];\n var offset = 0;\n var substitute = substitution();\n while (row.cells.length > index + offset && comparator(prevCell.element, row.cells[index + offset].element)) {\n mutateCell(row, index + offset, elementnew(substitute, true, row.cells[index + offset].isLocked));\n offset++;\n }\n });\n }\n return grid;\n };\n var splitRows = function (grid, index, comparator, substitution) {\n var rows = extractGridDetails(grid).rows;\n if (index > 0 && index < rows.length) {\n var rowPrevCells = rows[index - 1].cells;\n var cells_4 = uniqueCells(rowPrevCells, comparator);\n each$2(cells_4, function (cell) {\n var replacement = Optional.none();\n for (var i = index; i < rows.length; i++) {\n var _loop_1 = function (j) {\n var row_5 = rows[i];\n var current = getCell(row_5, j);\n var isToReplace = comparator(current.element, cell.element);\n if (isToReplace) {\n if (replacement.isNone()) {\n replacement = Optional.some(substitution());\n }\n replacement.each(function (sub) {\n mutateCell(row_5, j, elementnew(sub, true, current.isLocked));\n });\n }\n };\n for (var j = 0; j < cellLength(rows[0]); j++) {\n _loop_1(j);\n }\n }\n });\n }\n return grid;\n };\n var value$1 = function (value) {\n var applyHelper = function (fn) { return fn(value); };\n var constHelper = constant(value);\n var outputHelper = function () { return output; };\n var output = {\n tag: true,\n inner: value,\n fold: function (_onError, onValue) { return onValue(value); },\n isValue: always,\n isError: never,\n map: function (mapper) { return Result.value(mapper(value)); },\n mapError: outputHelper,\n bind: applyHelper,\n exists: applyHelper,\n forall: applyHelper,\n getOr: constHelper,\n or: outputHelper,\n getOrThunk: constHelper,\n orThunk: outputHelper,\n getOrDie: constHelper,\n each: function (fn) {\n fn(value);\n },\n toOptional: function () { return Optional.some(value); }\n };\n return output;\n };\n var error = function (error) {\n var outputHelper = function () { return output; };\n var output = {\n tag: false,\n inner: error,\n fold: function (onError, _onValue) { return onError(error); },\n isValue: never,\n isError: always,\n map: outputHelper,\n mapError: function (mapper) { return Result.error(mapper(error)); },\n bind: outputHelper,\n exists: never,\n forall: always,\n getOr: identity,\n or: identity,\n getOrThunk: apply,\n orThunk: apply,\n getOrDie: die(String(error)),\n each: noop,\n toOptional: Optional.none\n };\n return output;\n };\n var fromOption = function (optional, err) { return optional.fold(function () { return error(err); }, value$1); };\n var Result = {\n value: value$1,\n error: error,\n fromOption: fromOption\n };\n var measure = function (startAddress, gridA, gridB) {\n if (startAddress.row >= gridA.length || startAddress.column > cellLength(gridA[0])) {\n return Result.error('invalid start address out of table bounds, row: ' + startAddress.row + ', column: ' + startAddress.column);\n }\n var rowRemainder = gridA.slice(startAddress.row);\n var colRemainder = rowRemainder[0].cells.slice(startAddress.column);\n var colRequired = cellLength(gridB[0]);\n var rowRequired = gridB.length;\n return Result.value({\n rowDelta: rowRemainder.length - rowRequired,\n colDelta: colRemainder.length - colRequired\n });\n };\n var measureWidth = function (gridA, gridB) {\n var colLengthA = cellLength(gridA[0]);\n var colLengthB = cellLength(gridB[0]);\n return {\n rowDelta: 0,\n colDelta: colLengthA - colLengthB\n };\n };\n var measureHeight = function (gridA, gridB) {\n var rowLengthA = gridA.length;\n var rowLengthB = gridB.length;\n return {\n rowDelta: rowLengthA - rowLengthB,\n colDelta: 0\n };\n };\n var generateElements = function (amount, row, generators, isLocked) {\n var generator = row.section === 'colgroup' ? generators.col : generators.cell;\n return range$1(amount, function (idx) { return elementnew(generator(), true, isLocked(idx)); });\n };\n var rowFill = function (grid, amount, generators, lockedColumns) {\n var exampleRow = grid[grid.length - 1];\n return grid.concat(range$1(amount, function () {\n var generator = exampleRow.section === 'colgroup' ? generators.colgroup : generators.row;\n var row = clone(exampleRow, generator, identity);\n var elements = generateElements(row.cells.length, row, generators, function (idx) { return has$1(lockedColumns, idx.toString()); });\n return setCells(row, elements);\n }));\n };\n var colFill = function (grid, amount, generators, startIndex) { return map$1(grid, function (row) {\n var newChildren = generateElements(amount, row, generators, never);\n return addCells(row, startIndex, newChildren);\n }); };\n var lockedColFill = function (grid, generators, lockedColumns) { return map$1(grid, function (row) {\n return foldl(lockedColumns, function (acc, colNum) {\n var newChild = generateElements(1, row, generators, always)[0];\n return addCell(acc, colNum, newChild);\n }, row);\n }); };\n var tailor = function (gridA, delta, generators) {\n var fillCols = delta.colDelta < 0 ? colFill : identity;\n var fillRows = delta.rowDelta < 0 ? rowFill : identity;\n var lockedColumns = getLockedColumnsFromGrid(gridA);\n var gridWidth = cellLength(gridA[0]);\n var isLastColLocked = exists(lockedColumns, function (locked) { return locked === gridWidth - 1; });\n var modifiedCols = fillCols(gridA, Math.abs(delta.colDelta), generators, isLastColLocked ? gridWidth - 1 : gridWidth);\n var newLockedColumns = getLockedColumnsFromGrid(modifiedCols);\n return fillRows(modifiedCols, Math.abs(delta.rowDelta), generators, mapToObject(newLockedColumns, always));\n };\n var isSpanning = function (grid, row, col, comparator) {\n var candidate = getCell(grid[row], col);\n var matching = curry(comparator, candidate.element);\n var currentRow = grid[row];\n return grid.length > 1 && cellLength(currentRow) > 1 && (col > 0 && matching(getCellElement(currentRow, col - 1)) || col < currentRow.cells.length - 1 && matching(getCellElement(currentRow, col + 1)) || row > 0 && matching(getCellElement(grid[row - 1], col)) || row < grid.length - 1 && matching(getCellElement(grid[row + 1], col)));\n };\n var mergeTables = function (startAddress, gridA, gridBRows, generator, comparator, lockedColumns) {\n var startRow = startAddress.row;\n var startCol = startAddress.column;\n var mergeHeight = gridBRows.length;\n var mergeWidth = cellLength(gridBRows[0]);\n var endRow = startRow + mergeHeight;\n var endCol = startCol + mergeWidth + lockedColumns.length;\n var lockedColumnObj = mapToObject(lockedColumns, always);\n for (var r_2 = startRow; r_2 < endRow; r_2++) {\n var skippedCol = 0;\n for (var c = startCol; c < endCol; c++) {\n if (lockedColumnObj[c]) {\n skippedCol++;\n continue;\n }\n if (isSpanning(gridA, r_2, c, comparator)) {\n unmerge(gridA, getCellElement(gridA[r_2], c), comparator, generator.cell);\n }\n var gridBColIndex = c - startCol - skippedCol;\n var newCell = getCell(gridBRows[r_2 - startRow], gridBColIndex);\n var newCellElm = newCell.element;\n var replacement = generator.replace(newCellElm);\n mutateCell(gridA[r_2], c, elementnew(replacement, true, newCell.isLocked));\n }\n }\n return gridA;\n };\n var getValidStartAddress = function (currentStartAddress, grid, lockedColumns) {\n var gridColLength = cellLength(grid[0]);\n var adjustedRowAddress = extractGridDetails(grid).cols.length + currentStartAddress.row;\n var possibleColAddresses = range$1(gridColLength - currentStartAddress.column, function (num) { return num + currentStartAddress.column; });\n var validColAddress = find$1(possibleColAddresses, function (num) { return forall(lockedColumns, function (col) { return col !== num; }); }).getOr(gridColLength - 1);\n return {\n row: adjustedRowAddress,\n column: validColAddress\n };\n };\n var getLockedColumnsWithinBounds = function (startAddress, rows, lockedColumns) { return filter$2(lockedColumns, function (colNum) { return colNum >= startAddress.column && colNum <= cellLength(rows[0]) + startAddress.column; }); };\n var merge$1 = function (startAddress, gridA, gridB, generator, comparator) {\n var lockedColumns = getLockedColumnsFromGrid(gridA);\n var validStartAddress = getValidStartAddress(startAddress, gridA, lockedColumns);\n var gridBRows = extractGridDetails(gridB).rows;\n var lockedColumnsWithinBounds = getLockedColumnsWithinBounds(validStartAddress, gridBRows, lockedColumns);\n var result = measure(validStartAddress, gridA, gridBRows);\n return result.map(function (diff) {\n var delta = __assign(__assign({}, diff), { colDelta: diff.colDelta - lockedColumnsWithinBounds.length });\n var fittedGrid = tailor(gridA, delta, generator);\n var newLockedColumns = getLockedColumnsFromGrid(fittedGrid);\n var newLockedColumnsWithinBounds = getLockedColumnsWithinBounds(validStartAddress, gridBRows, newLockedColumns);\n return mergeTables(validStartAddress, fittedGrid, gridBRows, generator, comparator, newLockedColumnsWithinBounds);\n });\n };\n var insertCols = function (index, gridA, gridB, generator, comparator) {\n splitCols(gridA, index, comparator, generator.cell);\n var delta = measureHeight(gridB, gridA);\n var fittedNewGrid = tailor(gridB, delta, generator);\n var secondDelta = measureHeight(gridA, fittedNewGrid);\n var fittedOldGrid = tailor(gridA, secondDelta, generator);\n return map$1(fittedOldGrid, function (gridRow, i) {\n return addCells(gridRow, index, fittedNewGrid[i].cells);\n });\n };\n var insertRows = function (index, gridA, gridB, generator, comparator) {\n splitRows(gridA, index, comparator, generator.cell);\n var locked = getLockedColumnsFromGrid(gridA);\n var diff = measureWidth(gridA, gridB);\n var delta = __assign(__assign({}, diff), { colDelta: diff.colDelta - locked.length });\n var fittedOldGrid = tailor(gridA, delta, generator);\n var _c = extractGridDetails(fittedOldGrid), oldCols = _c.cols, oldRows = _c.rows;\n var newLocked = getLockedColumnsFromGrid(fittedOldGrid);\n var secondDiff = measureWidth(gridB, gridA);\n var secondDelta = __assign(__assign({}, secondDiff), { colDelta: secondDiff.colDelta + newLocked.length });\n var fittedGridB = lockedColFill(gridB, generator, newLocked);\n var fittedNewGrid = tailor(fittedGridB, secondDelta, generator);\n return __spreadArray(__spreadArray(__spreadArray(__spreadArray([], oldCols, true), oldRows.slice(0, index), true), fittedNewGrid, true), oldRows.slice(index, oldRows.length), true);\n };\n var cloneRow = function (row, cloneCell, comparator, substitution) { return clone(row, function (elem) { return substitution(elem, comparator); }, cloneCell); };\n var insertRowAt = function (grid, index, example, comparator, substitution) {\n var _c = extractGridDetails(grid), rows = _c.rows, cols = _c.cols;\n var before = rows.slice(0, index);\n var after = rows.slice(index);\n var newRow = cloneRow(rows[example], function (ex, c) {\n var withinSpan = index > 0 && index < rows.length && comparator(getCellElement(rows[index - 1], c), getCellElement(rows[index], c));\n var ret = withinSpan ? getCell(rows[index], c) : elementnew(substitution(ex.element, comparator), true, ex.isLocked);\n return ret;\n }, comparator, substitution);\n return __spreadArray(__spreadArray(__spreadArray(__spreadArray([], cols, true), before, true), [\n newRow\n ], false), after, true);\n };\n var getElementFor = function (row, column, section, withinSpan, example, comparator, substitution) {\n if (section === 'colgroup' || !withinSpan) {\n var cell_2 = getCell(row, example);\n return elementnew(substitution(cell_2.element, comparator), true, false);\n }\n else {\n return getCell(row, column);\n }\n };\n var insertColumnAt = function (grid, index, example, comparator, substitution) { return map$1(grid, function (row) {\n var withinSpan = index > 0 && index < cellLength(row) && comparator(getCellElement(row, index - 1), getCellElement(row, index));\n var sub = getElementFor(row, index, row.section, withinSpan, example, comparator, substitution);\n return addCell(row, index, sub);\n }); };\n var deleteColumnsAt = function (grid, columns) { return bind$2(grid, function (row) {\n var existingCells = row.cells;\n var cells = foldr(columns, function (acc, column) { return column >= 0 && column < acc.length ? acc.slice(0, column).concat(acc.slice(column + 1)) : acc; }, existingCells);\n return cells.length > 0 ? [rowcells(row.element, cells, row.section, row.isNew)] : [];\n }); };\n var deleteRowsAt = function (grid, start, finish) {\n var _c = extractGridDetails(grid), rows = _c.rows, cols = _c.cols;\n return __spreadArray(__spreadArray(__spreadArray([], cols, true), rows.slice(0, start), true), rows.slice(finish + 1), true);\n };\n var notInStartRow = function (grid, rowIndex, colIndex, comparator) { return getCellElement(grid[rowIndex], colIndex) !== undefined && (rowIndex > 0 && comparator(getCellElement(grid[rowIndex - 1], colIndex), getCellElement(grid[rowIndex], colIndex))); };\n var notInStartColumn = function (row, index, comparator) { return index > 0 && comparator(getCellElement(row, index - 1), getCellElement(row, index)); };\n var isDuplicatedCell = function (grid, rowIndex, colIndex, comparator) { return notInStartRow(grid, rowIndex, colIndex, comparator) || notInStartColumn(grid[rowIndex], colIndex, comparator); };\n var rowReplacerPredicate = function (targetRow, columnHeaders) {\n var entireTableIsHeader = forall(columnHeaders, identity) && isHeaderCells(targetRow.cells);\n return entireTableIsHeader ? always : function (cell, _rowIndex, colIndex) {\n var type = name(cell.element);\n return !(type === 'th' && columnHeaders[colIndex]);\n };\n };\n var columnReplacePredicate = function (targetColumn, rowHeaders) {\n var entireTableIsHeader = forall(rowHeaders, identity) && isHeaderCells(targetColumn);\n return entireTableIsHeader ? always : function (cell, rowIndex, _colIndex) {\n var type = name(cell.element);\n return !(type === 'th' && rowHeaders[rowIndex]);\n };\n };\n var determineScope = function (applyScope, cell, newScope, isInHeader) {\n var hasSpan = function (scope) { return scope === 'row' ? hasRowspan(cell) : hasColspan(cell); };\n var getScope = function (scope) { return hasSpan(scope) ? \"\".concat(scope, \"group\") : scope; };\n if (applyScope) {\n return isHeaderCell(cell) ? getScope(newScope) : null;\n }\n else if (isInHeader && isHeaderCell(cell)) {\n var oppositeScope = newScope === 'row' ? 'col' : 'row';\n return getScope(oppositeScope);\n }\n else {\n return null;\n }\n };\n var rowScopeGenerator = function (applyScope, columnHeaders) { return function (cell, rowIndex, columnIndex) { return Optional.some(determineScope(applyScope, cell.element, 'col', columnHeaders[columnIndex])); }; };\n var columnScopeGenerator = function (applyScope, rowHeaders) { return function (cell, rowIndex) { return Optional.some(determineScope(applyScope, cell.element, 'row', rowHeaders[rowIndex])); }; };\n var replace = function (cell, comparator, substitute) { return elementnew(substitute(cell.element, comparator), true, cell.isLocked); };\n var replaceIn = function (grid, targets, comparator, substitute, replacer, genScope, shouldReplace) {\n var isTarget = function (cell) {\n return exists(targets, function (target) {\n return comparator(cell.element, target.element);\n });\n };\n return map$1(grid, function (row, rowIndex) {\n return mapCells(row, function (cell, colIndex) {\n if (isTarget(cell)) {\n var newCell_1 = shouldReplace(cell, rowIndex, colIndex) ? replacer(cell, comparator, substitute) : cell;\n genScope(newCell_1, rowIndex, colIndex).each(function (scope) {\n setOptions(newCell_1.element, { scope: Optional.from(scope) });\n });\n return newCell_1;\n }\n else {\n return cell;\n }\n });\n });\n };\n var getColumnCells = function (rows, columnIndex, comparator) { return bind$2(rows, function (row, i) {\n return isDuplicatedCell(rows, i, columnIndex, comparator) ? [] : [getCell(row, columnIndex)];\n }); };\n var getRowCells = function (rows, rowIndex, comparator) {\n var targetRow = rows[rowIndex];\n return bind$2(targetRow.cells, function (item, i) {\n return isDuplicatedCell(rows, rowIndex, i, comparator) ? [] : [item];\n });\n };\n var replaceColumns = function (grid, indexes, applyScope, comparator, substitution) {\n var rows = extractGridDetails(grid).rows;\n var targets = bind$2(indexes, function (index) { return getColumnCells(rows, index, comparator); });\n var rowHeaders = map$1(rows, function (row) { return isHeaderCells(row.cells); });\n var shouldReplaceCell = columnReplacePredicate(targets, rowHeaders);\n var scopeGenerator = columnScopeGenerator(applyScope, rowHeaders);\n return replaceIn(grid, targets, comparator, substitution, replace, scopeGenerator, shouldReplaceCell);\n };\n var replaceRows = function (grid, indexes, section, applyScope, comparator, substitution, tableSection) {\n var _c = extractGridDetails(grid), cols = _c.cols, rows = _c.rows;\n var targetRow = rows[indexes[0]];\n var targets = bind$2(indexes, function (index) { return getRowCells(rows, index, comparator); });\n var columnHeaders = map$1(targetRow.cells, function (_cell, index) { return isHeaderCells(getColumnCells(rows, index, comparator)); });\n var newRows = __spreadArray([], rows, true);\n each$2(indexes, function (index) {\n newRows[index] = tableSection.transformRow(rows[index], section);\n });\n var newGrid = __spreadArray(__spreadArray([], cols, true), newRows, true);\n var shouldReplaceCell = rowReplacerPredicate(targetRow, columnHeaders);\n var scopeGenerator = rowScopeGenerator(applyScope, columnHeaders);\n return replaceIn(newGrid, targets, comparator, substitution, tableSection.transformCell, scopeGenerator, shouldReplaceCell);\n };\n var replaceCells = function (grid, details, comparator, substitution) {\n var rows = extractGridDetails(grid).rows;\n var targetCells = map$1(details, function (detail) { return getCell(rows[detail.row], detail.column); });\n return replaceIn(grid, targetCells, comparator, substitution, replace, Optional.none, always);\n };\n var generate = function (cases) {\n if (!isArray(cases)) {\n throw new Error('cases must be an array');\n }\n if (cases.length === 0) {\n throw new Error('there must be at least one case');\n }\n var constructors = [];\n var adt = {};\n each$2(cases, function (acase, count) {\n var keys$1 = keys(acase);\n if (keys$1.length !== 1) {\n throw new Error('one and only one name per case');\n }\n var key = keys$1[0];\n var value = acase[key];\n if (adt[key] !== undefined) {\n throw new Error('duplicate key detected:' + key);\n }\n else if (key === 'cata') {\n throw new Error('cannot have a case named cata (sorry)');\n }\n else if (!isArray(value)) {\n throw new Error('case arguments must be an array');\n }\n constructors.push(key);\n adt[key] = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var argLength = args.length;\n if (argLength !== value.length) {\n throw new Error('Wrong number of arguments to case ' + key + '. Expected ' + value.length + ' (' + value + '), got ' + argLength);\n }\n var match = function (branches) {\n var branchKeys = keys(branches);\n if (constructors.length !== branchKeys.length) {\n throw new Error('Wrong number of arguments to match. Expected: ' + constructors.join(',') + '\\nActual: ' + branchKeys.join(','));\n }\n var allReqd = forall(constructors, function (reqKey) {\n return contains$2(branchKeys, reqKey);\n });\n if (!allReqd) {\n throw new Error('Not all branches were specified when using match. Specified: ' + branchKeys.join(', ') + '\\nRequired: ' + constructors.join(', '));\n }\n return branches[key].apply(null, args);\n };\n return {\n fold: function () {\n var foldArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n foldArgs[_i] = arguments[_i];\n }\n if (foldArgs.length !== cases.length) {\n throw new Error('Wrong number of arguments to fold. Expected ' + cases.length + ', got ' + foldArgs.length);\n }\n var target = foldArgs[count];\n return target.apply(null, args);\n },\n match: match,\n log: function (label) {\n console.log(label, {\n constructors: constructors,\n constructor: key,\n params: args\n });\n }\n };\n };\n });\n return adt;\n };\n var Adt = { generate: generate };\n var adt$6 = Adt.generate([\n { none: [] },\n { only: ['index'] },\n {\n left: [\n 'index',\n 'next'\n ]\n },\n {\n middle: [\n 'prev',\n 'index',\n 'next'\n ]\n },\n {\n right: [\n 'prev',\n 'index'\n ]\n }\n ]);\n var ColumnContext = __assign({}, adt$6);\n var neighbours = function (input, index) {\n if (input.length === 0) {\n return ColumnContext.none();\n }\n if (input.length === 1) {\n return ColumnContext.only(0);\n }\n if (index === 0) {\n return ColumnContext.left(0, 1);\n }\n if (index === input.length - 1) {\n return ColumnContext.right(index - 1, index);\n }\n if (index > 0 && index < input.length - 1) {\n return ColumnContext.middle(index - 1, index, index + 1);\n }\n return ColumnContext.none();\n };\n var determine = function (input, column, step, tableSize, resize) {\n var result = input.slice(0);\n var context = neighbours(input, column);\n var onNone = constant(map$1(result, constant(0)));\n var onOnly = function (index) { return tableSize.singleColumnWidth(result[index], step); };\n var onLeft = function (index, next) { return resize.calcLeftEdgeDeltas(result, index, next, step, tableSize.minCellWidth(), tableSize.isRelative); };\n var onMiddle = function (prev, index, next) { return resize.calcMiddleDeltas(result, prev, index, next, step, tableSize.minCellWidth(), tableSize.isRelative); };\n var onRight = function (prev, index) { return resize.calcRightEdgeDeltas(result, prev, index, step, tableSize.minCellWidth(), tableSize.isRelative); };\n return context.fold(onNone, onOnly, onLeft, onMiddle, onRight);\n };\n var total = function (start, end, measures) {\n var r = 0;\n for (var i = start; i < end; i++) {\n r += measures[i] !== undefined ? measures[i] : 0;\n }\n return r;\n };\n var recalculateWidthForCells = function (warehouse, widths) {\n var all = Warehouse.justCells(warehouse);\n return map$1(all, function (cell) {\n var width = total(cell.column, cell.column + cell.colspan, widths);\n return {\n element: cell.element,\n width: width,\n colspan: cell.colspan\n };\n });\n };\n var recalculateWidthForColumns = function (warehouse, widths) {\n var groups = Warehouse.justColumns(warehouse);\n return map$1(groups, function (column, index) { return ({\n element: column.element,\n width: widths[index],\n colspan: column.colspan\n }); });\n };\n var recalculateHeightForCells = function (warehouse, heights) {\n var all = Warehouse.justCells(warehouse);\n return map$1(all, function (cell) {\n var height = total(cell.row, cell.row + cell.rowspan, heights);\n return {\n element: cell.element,\n height: height,\n rowspan: cell.rowspan\n };\n });\n };\n var matchRowHeight = function (warehouse, heights) {\n return map$1(warehouse.all, function (row, i) {\n return {\n element: row.element,\n height: heights[i]\n };\n });\n };\n var sumUp = function (newSize) { return foldr(newSize, function (b, a) { return b + a; }, 0); };\n var recalculate = function (warehouse, widths) {\n if (Warehouse.hasColumns(warehouse)) {\n return recalculateWidthForColumns(warehouse, widths);\n }\n else {\n return recalculateWidthForCells(warehouse, widths);\n }\n };\n var recalculateAndApply = function (warehouse, widths, tableSize) {\n var newSizes = recalculate(warehouse, widths);\n each$2(newSizes, function (cell) {\n tableSize.setElementWidth(cell.element, cell.width);\n });\n };\n var adjustWidth = function (table, delta, index, resizing, tableSize) {\n var warehouse = Warehouse.fromTable(table);\n var step = tableSize.getCellDelta(delta);\n var widths = tableSize.getWidths(warehouse, tableSize);\n var isLastColumn = index === warehouse.grid.columns - 1;\n var clampedStep = resizing.clampTableDelta(widths, index, step, tableSize.minCellWidth(), isLastColumn);\n var deltas = determine(widths, index, clampedStep, tableSize, resizing);\n var newWidths = map$1(deltas, function (dx, i) { return dx + widths[i]; });\n recalculateAndApply(warehouse, newWidths, tableSize);\n resizing.resizeTable(tableSize.adjustTableWidth, clampedStep, isLastColumn);\n };\n var adjustHeight = function (table, delta, index, direction) {\n var warehouse = Warehouse.fromTable(table);\n var heights = getPixelHeights(warehouse, table, direction);\n var newHeights = map$1(heights, function (dy, i) { return index === i ? Math.max(delta + dy, minHeight()) : dy; });\n var newCellSizes = recalculateHeightForCells(warehouse, newHeights);\n var newRowSizes = matchRowHeight(warehouse, newHeights);\n each$2(newRowSizes, function (row) {\n setHeight(row.element, row.height);\n });\n each$2(newCellSizes, function (cell) {\n setHeight(cell.element, cell.height);\n });\n var total = sumUp(newHeights);\n setHeight(table, total);\n };\n var adjustAndRedistributeWidths$1 = function (_table, list, details, tableSize, resizeBehaviour) {\n var warehouse = Warehouse.generate(list);\n var sizes = tableSize.getWidths(warehouse, tableSize);\n var tablePixelWidth = tableSize.pixelWidth();\n var _c = resizeBehaviour.calcRedestributedWidths(sizes, tablePixelWidth, details.pixelDelta, tableSize.isRelative), newSizes = _c.newSizes, delta = _c.delta;\n recalculateAndApply(warehouse, newSizes, tableSize);\n tableSize.adjustTableWidth(delta);\n };\n var adjustWidthTo = function (_table, list, _info, tableSize) {\n var warehouse = Warehouse.generate(list);\n var widths = tableSize.getWidths(warehouse, tableSize);\n recalculateAndApply(warehouse, widths, tableSize);\n };\n var uniqueColumns = function (details) {\n var uniqueCheck = function (rest, detail) {\n var columnExists = exists(rest, function (currentDetail) { return currentDetail.column === detail.column; });\n return columnExists ? rest : rest.concat([detail]);\n };\n return foldl(details, uniqueCheck, []).sort(function (detailA, detailB) { return detailA.column - detailB.column; });\n };\n var isCol = isTag('col');\n var isColgroup = isTag('colgroup');\n var isRow$1 = function (element) { return name(element) === 'tr' || isColgroup(element); };\n var elementToData = function (element) {\n var colspan = getAttrValue(element, 'colspan', 1);\n var rowspan = getAttrValue(element, 'rowspan', 1);\n return {\n element: element,\n colspan: colspan,\n rowspan: rowspan\n };\n };\n var modification = function (generators, toData) {\n if (toData === void 0) { toData = elementToData; }\n var nuCell = function (data) { return isCol(data.element) ? generators.col(data) : generators.cell(data); };\n var nuRow = function (data) { return isColgroup(data.element) ? generators.colgroup(data) : generators.row(data); };\n var add = function (element) {\n if (isRow$1(element)) {\n return nuRow({ element: element });\n }\n else {\n var cell_3 = element;\n var replacement = nuCell(toData(cell_3));\n recent = Optional.some({\n item: cell_3,\n replacement: replacement\n });\n return replacement;\n }\n };\n var recent = Optional.none();\n var getOrInit = function (element, comparator) {\n return recent.fold(function () {\n return add(element);\n }, function (p) {\n return comparator(element, p.item) ? p.replacement : add(element);\n });\n };\n return { getOrInit: getOrInit };\n };\n var transform$1 = function (tag) {\n return function (generators) {\n var list = [];\n var find = function (element, comparator) {\n return find$1(list, function (x) {\n return comparator(x.item, element);\n });\n };\n var makeNew = function (element) {\n var attrs = tag === 'td' ? { scope: null } : {};\n var cell = generators.replace(element, tag, attrs);\n list.push({\n item: element,\n sub: cell\n });\n return cell;\n };\n var replaceOrInit = function (element, comparator) {\n if (isRow$1(element) || isCol(element)) {\n return element;\n }\n else {\n var cell_4 = element;\n return find(cell_4, comparator).fold(function () {\n return makeNew(cell_4);\n }, function (p) {\n return comparator(element, p.item) ? p.sub : makeNew(cell_4);\n });\n }\n };\n return { replaceOrInit: replaceOrInit };\n };\n };\n var getScopeAttribute = function (cell) { return getOpt(cell, 'scope').map(function (attribute) { return attribute.substr(0, 3); }); };\n var merging = function (generators) {\n var unmerge = function (cell) {\n var scope = getScopeAttribute(cell);\n scope.each(function (attribute) { return set$2(cell, 'scope', attribute); });\n return function () {\n var raw = generators.cell({\n element: cell,\n colspan: 1,\n rowspan: 1\n });\n remove$5(raw, 'width');\n remove$5(cell, 'width');\n scope.each(function (attribute) { return set$2(raw, 'scope', attribute); });\n return raw;\n };\n };\n var merge = function (cells) {\n var getScopeProperty = function () {\n var stringAttributes = cat(map$1(cells, getScopeAttribute));\n if (stringAttributes.length === 0) {\n return Optional.none();\n }\n else {\n var baseScope_1 = stringAttributes[0];\n var scopes_1 = [\n 'row',\n 'col'\n ];\n var isMixed = exists(stringAttributes, function (attribute) {\n return attribute !== baseScope_1 && contains$2(scopes_1, attribute);\n });\n return isMixed ? Optional.none() : Optional.from(baseScope_1);\n }\n };\n remove$5(cells[0], 'width');\n getScopeProperty().fold(function () { return remove$7(cells[0], 'scope'); }, function (attribute) { return set$2(cells[0], 'scope', attribute + 'group'); });\n return constant(cells[0]);\n };\n return {\n unmerge: unmerge,\n merge: merge\n };\n };\n var Generators = {\n modification: modification,\n transform: transform$1,\n merging: merging\n };\n var blockList = [\n 'body',\n 'p',\n 'div',\n 'article',\n 'aside',\n 'figcaption',\n 'figure',\n 'footer',\n 'header',\n 'nav',\n 'section',\n 'ol',\n 'ul',\n 'table',\n 'thead',\n 'tfoot',\n 'tbody',\n 'caption',\n 'tr',\n 'td',\n 'th',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'blockquote',\n 'pre',\n 'address'\n ];\n var isList$1 = function (universe, item) {\n var tagName = universe.property().name(item);\n return contains$2([\n 'ol',\n 'ul'\n ], tagName);\n };\n var isBlock$1 = function (universe, item) {\n var tagName = universe.property().name(item);\n return contains$2(blockList, tagName);\n };\n var isEmptyTag$1 = function (universe, item) {\n return contains$2([\n 'br',\n 'img',\n 'hr',\n 'input'\n ], universe.property().name(item));\n };\n var universe$1 = DomUniverse();\n var isBlock = function (element) {\n return isBlock$1(universe$1, element);\n };\n var isList = function (element) {\n return isList$1(universe$1, element);\n };\n var isEmptyTag = function (element) {\n return isEmptyTag$1(universe$1, element);\n };\n var merge = function (cells) {\n var isBr = isTag('br');\n var advancedBr = function (children) {\n return forall(children, function (c) {\n return isBr(c) || isText(c) && get$6(c).trim().length === 0;\n });\n };\n var isListItem = function (el) {\n return name(el) === 'li' || ancestor$2(el, isList).isSome();\n };\n var siblingIsBlock = function (el) {\n return nextSibling(el).map(function (rightSibling) {\n if (isBlock(rightSibling)) {\n return true;\n }\n if (isEmptyTag(rightSibling)) {\n return name(rightSibling) === 'img' ? false : true;\n }\n return false;\n }).getOr(false);\n };\n var markCell = function (cell) {\n return last$1(cell).bind(function (rightEdge) {\n var rightSiblingIsBlock = siblingIsBlock(rightEdge);\n return parent(rightEdge).map(function (parent) {\n return rightSiblingIsBlock === true || isListItem(parent) || isBr(rightEdge) || isBlock(parent) && !eq$1(cell, parent) ? [] : [SugarElement.fromTag('br')];\n });\n }).getOr([]);\n };\n var markContent = function () {\n var content = bind$2(cells, function (cell) {\n var children = children$2(cell);\n return advancedBr(children) ? [] : children.concat(markCell(cell));\n });\n return content.length === 0 ? [SugarElement.fromTag('br')] : content;\n };\n var contents = markContent();\n empty(cells[0]);\n append(cells[0], contents);\n };\n var isEditable = function (elem) { return isEditable$1(elem, true); };\n var prune = function (table) {\n var cells = cells$1(table);\n if (cells.length === 0) {\n remove$6(table);\n }\n };\n var outcome = function (grid, cursor) { return ({\n grid: grid,\n cursor: cursor\n }); };\n var findEditableCursorPosition = function (rows) { return findMap(rows, function (row) { return findMap(row.cells, function (cell) {\n var elem = cell.element;\n return someIf(isEditable(elem), elem);\n }); }); };\n var elementFromGrid = function (grid, row, column) {\n var _a, _b;\n var rows = extractGridDetails(grid).rows;\n return Optional.from((_b = (_a = rows[row]) === null || _a === void 0 ? void 0 : _a.cells[column]) === null || _b === void 0 ? void 0 : _b.element).filter(isEditable).orThunk(function () { return findEditableCursorPosition(rows); });\n };\n var bundle = function (grid, row, column) {\n var cursorElement = elementFromGrid(grid, row, column);\n return outcome(grid, cursorElement);\n };\n var uniqueRows = function (details) {\n var rowCompilation = function (rest, detail) {\n var rowExists = exists(rest, function (currentDetail) { return currentDetail.row === detail.row; });\n return rowExists ? rest : rest.concat([detail]);\n };\n return foldl(details, rowCompilation, []).sort(function (detailA, detailB) { return detailA.row - detailB.row; });\n };\n var opInsertRowsBefore = function (grid, details, comparator, genWrappers) {\n var targetIndex = details[0].row;\n var rows = uniqueRows(details);\n var newGrid = foldr(rows, function (acc, row) {\n var newG = insertRowAt(acc.grid, targetIndex, row.row + acc.delta, comparator, genWrappers.getOrInit);\n return {\n grid: newG,\n delta: acc.delta + 1\n };\n }, {\n grid: grid,\n delta: 0\n }).grid;\n return bundle(newGrid, targetIndex, details[0].column);\n };\n var opInsertRowsAfter = function (grid, details, comparator, genWrappers) {\n var rows = uniqueRows(details);\n var target = rows[rows.length - 1];\n var targetIndex = target.row + target.rowspan;\n var newGrid = foldr(rows, function (newG, row) {\n return insertRowAt(newG, targetIndex, row.row, comparator, genWrappers.getOrInit);\n }, grid);\n return bundle(newGrid, targetIndex, details[0].column);\n };\n var opInsertColumnsBefore = function (grid, extractDetail, comparator, genWrappers) {\n var details = extractDetail.details;\n var columns = uniqueColumns(details);\n var targetIndex = columns[0].column;\n var newGrid = foldr(columns, function (acc, col) {\n var newG = insertColumnAt(acc.grid, targetIndex, col.column + acc.delta, comparator, genWrappers.getOrInit);\n return {\n grid: newG,\n delta: acc.delta + 1\n };\n }, {\n grid: grid,\n delta: 0\n }).grid;\n return bundle(newGrid, details[0].row, targetIndex);\n };\n var opInsertColumnsAfter = function (grid, extractDetail, comparator, genWrappers) {\n var details = extractDetail.details;\n var target = details[details.length - 1];\n var targetIndex = target.column + target.colspan;\n var columns = uniqueColumns(details);\n var newGrid = foldr(columns, function (newG, col) {\n return insertColumnAt(newG, targetIndex, col.column, comparator, genWrappers.getOrInit);\n }, grid);\n return bundle(newGrid, details[0].row, targetIndex);\n };\n var opMakeColumnsHeader = function (initialGrid, details, comparator, genWrappers) {\n var columns = uniqueColumns(details);\n var columnIndexes = map$1(columns, function (detail) { return detail.column; });\n var newGrid = replaceColumns(initialGrid, columnIndexes, true, comparator, genWrappers.replaceOrInit);\n return bundle(newGrid, details[0].row, details[0].column);\n };\n var opMakeCellsHeader = function (initialGrid, details, comparator, genWrappers) {\n var newGrid = replaceCells(initialGrid, details, comparator, genWrappers.replaceOrInit);\n return bundle(newGrid, details[0].row, details[0].column);\n };\n var opUnmakeColumnsHeader = function (initialGrid, details, comparator, genWrappers) {\n var columns = uniqueColumns(details);\n var columnIndexes = map$1(columns, function (detail) { return detail.column; });\n var newGrid = replaceColumns(initialGrid, columnIndexes, false, comparator, genWrappers.replaceOrInit);\n return bundle(newGrid, details[0].row, details[0].column);\n };\n var opUnmakeCellsHeader = function (initialGrid, details, comparator, genWrappers) {\n var newGrid = replaceCells(initialGrid, details, comparator, genWrappers.replaceOrInit);\n return bundle(newGrid, details[0].row, details[0].column);\n };\n var makeRowsSection = function (section, applyScope) { return function (initialGrid, details, comparator, genWrappers, tableSection) {\n var rows = uniqueRows(details);\n var rowIndexes = map$1(rows, function (detail) { return detail.row; });\n var newGrid = replaceRows(initialGrid, rowIndexes, section, applyScope, comparator, genWrappers.replaceOrInit, tableSection);\n return bundle(newGrid, details[0].row, details[0].column);\n }; };\n var opMakeRowsHeader = makeRowsSection('thead', true);\n var opMakeRowsBody = makeRowsSection('tbody', false);\n var opMakeRowsFooter = makeRowsSection('tfoot', false);\n var opEraseColumns = function (grid, extractDetail, _comparator, _genWrappers) {\n var columns = uniqueColumns(extractDetail.details);\n var newGrid = deleteColumnsAt(grid, map$1(columns, function (column) { return column.column; }));\n var maxColIndex = newGrid.length > 0 ? newGrid[0].cells.length - 1 : 0;\n return bundle(newGrid, columns[0].row, Math.min(columns[0].column, maxColIndex));\n };\n var opEraseRows = function (grid, details, _comparator, _genWrappers) {\n var rows = uniqueRows(details);\n var newGrid = deleteRowsAt(grid, rows[0].row, rows[rows.length - 1].row);\n var maxRowIndex = newGrid.length > 0 ? newGrid.length - 1 : 0;\n return bundle(newGrid, Math.min(details[0].row, maxRowIndex), details[0].column);\n };\n var opMergeCells = function (grid, mergable, comparator, genWrappers) {\n var cells = mergable.cells;\n merge(cells);\n var newGrid = merge$2(grid, mergable.bounds, comparator, genWrappers.merge(cells));\n return outcome(newGrid, Optional.from(cells[0]));\n };\n var opUnmergeCells = function (grid, unmergable, comparator, genWrappers) {\n var unmerge$1 = function (b, cell) { return unmerge(b, cell, comparator, genWrappers.unmerge(cell)); };\n var newGrid = foldr(unmergable, unmerge$1, grid);\n return outcome(newGrid, Optional.from(unmergable[0]));\n };\n var opPasteCells = function (grid, pasteDetails, comparator, _genWrappers) {\n var gridify = function (table, generators) {\n var wh = Warehouse.fromTable(table);\n return toGrid(wh, generators, true);\n };\n var gridB = gridify(pasteDetails.clipboard, pasteDetails.generators);\n var startAddress = address(pasteDetails.row, pasteDetails.column);\n var mergedGrid = merge$1(startAddress, grid, gridB, pasteDetails.generators, comparator);\n return mergedGrid.fold(function () { return outcome(grid, Optional.some(pasteDetails.element)); }, function (newGrid) {\n return bundle(newGrid, pasteDetails.row, pasteDetails.column);\n });\n };\n var gridifyRows = function (rows, generators, context) {\n var pasteDetails = fromPastedRows(rows, context.section);\n var wh = Warehouse.generate(pasteDetails);\n return toGrid(wh, generators, true);\n };\n var opPasteColsBefore = function (grid, pasteDetails, comparator, _genWrappers) {\n var rows = extractGridDetails(grid).rows;\n var index = pasteDetails.cells[0].column;\n var context = rows[pasteDetails.cells[0].row];\n var gridB = gridifyRows(pasteDetails.clipboard, pasteDetails.generators, context);\n var mergedGrid = insertCols(index, grid, gridB, pasteDetails.generators, comparator);\n return bundle(mergedGrid, pasteDetails.cells[0].row, pasteDetails.cells[0].column);\n };\n var opPasteColsAfter = function (grid, pasteDetails, comparator, _genWrappers) {\n var rows = extractGridDetails(grid).rows;\n var index = pasteDetails.cells[pasteDetails.cells.length - 1].column + pasteDetails.cells[pasteDetails.cells.length - 1].colspan;\n var context = rows[pasteDetails.cells[0].row];\n var gridB = gridifyRows(pasteDetails.clipboard, pasteDetails.generators, context);\n var mergedGrid = insertCols(index, grid, gridB, pasteDetails.generators, comparator);\n return bundle(mergedGrid, pasteDetails.cells[0].row, pasteDetails.cells[0].column);\n };\n var opPasteRowsBefore = function (grid, pasteDetails, comparator, _genWrappers) {\n var rows = extractGridDetails(grid).rows;\n var index = pasteDetails.cells[0].row;\n var context = rows[index];\n var gridB = gridifyRows(pasteDetails.clipboard, pasteDetails.generators, context);\n var mergedGrid = insertRows(index, grid, gridB, pasteDetails.generators, comparator);\n return bundle(mergedGrid, pasteDetails.cells[0].row, pasteDetails.cells[0].column);\n };\n var opPasteRowsAfter = function (grid, pasteDetails, comparator, _genWrappers) {\n var rows = extractGridDetails(grid).rows;\n var index = pasteDetails.cells[pasteDetails.cells.length - 1].row + pasteDetails.cells[pasteDetails.cells.length - 1].rowspan;\n var context = rows[pasteDetails.cells[0].row];\n var gridB = gridifyRows(pasteDetails.clipboard, pasteDetails.generators, context);\n var mergedGrid = insertRows(index, grid, gridB, pasteDetails.generators, comparator);\n return bundle(mergedGrid, pasteDetails.cells[0].row, pasteDetails.cells[0].column);\n };\n var opGetColumnsType = function (table, target) {\n var house = Warehouse.fromTable(table);\n var details = onCells(house, target);\n return details.bind(function (selectedCells) {\n var lastSelectedCell = selectedCells[selectedCells.length - 1];\n var minColRange = selectedCells[0].column;\n var maxColRange = lastSelectedCell.column + lastSelectedCell.colspan;\n var selectedColumnCells = flatten(map$1(house.all, function (row) { return filter$2(row.cells, function (cell) { return cell.column >= minColRange && cell.column < maxColRange; }); }));\n return findCommonCellType(selectedColumnCells);\n }).getOr('');\n };\n var opGetCellsType = function (table, target) {\n var house = Warehouse.fromTable(table);\n var details = onCells(house, target);\n return details.bind(findCommonCellType).getOr('');\n };\n var opGetRowsType = function (table, target) {\n var house = Warehouse.fromTable(table);\n var details = onCells(house, target);\n return details.bind(function (selectedCells) {\n var lastSelectedCell = selectedCells[selectedCells.length - 1];\n var minRowRange = selectedCells[0].row;\n var maxRowRange = lastSelectedCell.row + lastSelectedCell.rowspan;\n var selectedRows = house.all.slice(minRowRange, maxRowRange);\n return findCommonRowType(selectedRows);\n }).getOr('');\n };\n var resize = function (table, list, details, behaviours) { return adjustWidthTo(table, list, details, behaviours.sizing); };\n var adjustAndRedistributeWidths = function (table, list, details, behaviours) { return adjustAndRedistributeWidths$1(table, list, details, behaviours.sizing, behaviours.resize); };\n var firstColumnIsLocked = function (_warehouse, details) { return exists(details, function (detail) { return detail.column === 0 && detail.isLocked; }); };\n var lastColumnIsLocked = function (warehouse, details) { return exists(details, function (detail) { return detail.column + detail.colspan >= warehouse.grid.columns && detail.isLocked; }); };\n var getColumnsWidth = function (warehouse, details) {\n var columns$1 = columns(warehouse);\n var uniqueCols = uniqueColumns(details);\n return foldl(uniqueCols, function (acc, detail) {\n var column = columns$1[detail.column];\n var colWidth = column.map(getOuter$2).getOr(0);\n return acc + colWidth;\n }, 0);\n };\n var insertColumnsExtractor = function (before) { return function (warehouse, target) { return onCells(warehouse, target).filter(function (details) {\n var checkLocked = before ? firstColumnIsLocked : lastColumnIsLocked;\n return !checkLocked(warehouse, details);\n }).map(function (details) { return ({\n details: details,\n pixelDelta: getColumnsWidth(warehouse, details)\n }); }); }; };\n var eraseColumnsExtractor = function (warehouse, target) { return onUnlockedCells(warehouse, target).map(function (details) { return ({\n details: details,\n pixelDelta: -getColumnsWidth(warehouse, details)\n }); }); };\n var pasteColumnsExtractor = function (before) { return function (warehouse, target) { return onPasteByEditor(warehouse, target).filter(function (details) {\n var checkLocked = before ? firstColumnIsLocked : lastColumnIsLocked;\n return !checkLocked(warehouse, details.cells);\n }); }; };\n var headerCellGenerator = Generators.transform('th');\n var bodyCellGenerator = Generators.transform('td');\n var insertRowsBefore = run(opInsertRowsBefore, onCells, noop, noop, Generators.modification);\n var insertRowsAfter = run(opInsertRowsAfter, onCells, noop, noop, Generators.modification);\n var insertColumnsBefore = run(opInsertColumnsBefore, insertColumnsExtractor(true), adjustAndRedistributeWidths, noop, Generators.modification);\n var insertColumnsAfter = run(opInsertColumnsAfter, insertColumnsExtractor(false), adjustAndRedistributeWidths, noop, Generators.modification);\n var eraseColumns = run(opEraseColumns, eraseColumnsExtractor, adjustAndRedistributeWidths, prune, Generators.modification);\n var eraseRows = run(opEraseRows, onCells, noop, prune, Generators.modification);\n var makeColumnsHeader = run(opMakeColumnsHeader, onUnlockedCells, noop, noop, headerCellGenerator);\n var unmakeColumnsHeader = run(opUnmakeColumnsHeader, onUnlockedCells, noop, noop, bodyCellGenerator);\n var makeRowsHeader = run(opMakeRowsHeader, onUnlockedCells, noop, noop, headerCellGenerator);\n var makeRowsBody = run(opMakeRowsBody, onUnlockedCells, noop, noop, bodyCellGenerator);\n var makeRowsFooter = run(opMakeRowsFooter, onUnlockedCells, noop, noop, bodyCellGenerator);\n var makeCellsHeader = run(opMakeCellsHeader, onUnlockedCells, noop, noop, headerCellGenerator);\n var unmakeCellsHeader = run(opUnmakeCellsHeader, onUnlockedCells, noop, noop, bodyCellGenerator);\n var mergeCells = run(opMergeCells, onUnlockedMergable, resize, noop, Generators.merging);\n var unmergeCells = run(opUnmergeCells, onUnlockedUnmergable, resize, noop, Generators.merging);\n var pasteCells = run(opPasteCells, onPaste, resize, noop, Generators.modification);\n var pasteColsBefore = run(opPasteColsBefore, pasteColumnsExtractor(true), noop, noop, Generators.modification);\n var pasteColsAfter = run(opPasteColsAfter, pasteColumnsExtractor(false), noop, noop, Generators.modification);\n var pasteRowsBefore = run(opPasteRowsBefore, onPasteByEditor, noop, noop, Generators.modification);\n var pasteRowsAfter = run(opPasteRowsAfter, onPasteByEditor, noop, noop, Generators.modification);\n var getColumnsType = opGetColumnsType;\n var getCellsType = opGetCellsType;\n var getRowsType = opGetRowsType;\n var fireNewRow = function (editor, row) { return editor.dispatch('NewRow', { node: row }); };\n var fireNewCell = function (editor, cell) { return editor.dispatch('NewCell', { node: cell }); };\n var fireTableModified = function (editor, table, data) {\n editor.dispatch('TableModified', __assign(__assign({}, data), { table: table }));\n };\n var fireTableSelectionChange = function (editor, cells, start, finish, otherCells) {\n editor.dispatch('TableSelectionChange', {\n cells: cells,\n start: start,\n finish: finish,\n otherCells: otherCells\n });\n };\n var fireTableSelectionClear = function (editor) {\n editor.dispatch('TableSelectionClear');\n };\n var fireObjectResizeStart = function (editor, target, width, height, origin) {\n editor.dispatch('ObjectResizeStart', {\n target: target,\n width: width,\n height: height,\n origin: origin\n });\n };\n var fireObjectResized = function (editor, target, width, height, origin) {\n editor.dispatch('ObjectResized', {\n target: target,\n width: width,\n height: height,\n origin: origin\n });\n };\n var styleModified = {\n structure: false,\n style: true\n };\n var structureModified = {\n structure: true,\n style: false\n };\n var styleAndStructureModified = {\n structure: true,\n style: true\n };\n var get$5 = function (editor, table) {\n if (isTablePercentagesForced(editor)) {\n return TableSize.percentageSize(table);\n }\n else if (isTablePixelsForced(editor)) {\n return TableSize.pixelSize(table);\n }\n else {\n return TableSize.getTableSize(table);\n }\n };\n var TableActions = function (editor, resizeHandler, cellSelectionHandler) {\n var isTableBody = function (editor) { return name(getBody(editor)) === 'table'; };\n var lastRowGuard = function (table) { return !isTableBody(editor) || getGridSize(table).rows > 1; };\n var lastColumnGuard = function (table) { return !isTableBody(editor) || getGridSize(table).columns > 1; };\n var cloneFormats = getTableCloneElements(editor);\n var colMutationOp = isResizeTableColumnResizing(editor) ? noop : halve;\n var getTableSectionType = function (table) {\n switch (getTableHeaderType(editor)) {\n case 'section':\n return TableSection.section();\n case 'sectionCells':\n return TableSection.sectionCells();\n case 'cells':\n return TableSection.cells();\n default:\n return TableSection.getTableSectionType(table, 'section');\n }\n };\n var setSelectionFromAction = function (table, result) { return result.cursor.fold(function () {\n var cells = cells$1(table);\n return head(cells).filter(inBody).map(function (firstCell) {\n cellSelectionHandler.clearSelectedCells(table.dom);\n var rng = editor.dom.createRng();\n rng.selectNode(firstCell.dom);\n editor.selection.setRng(rng);\n set$2(firstCell, 'data-mce-selected', '1');\n return rng;\n });\n }, function (cell) {\n var des = freefallRtl(cell);\n var rng = editor.dom.createRng();\n rng.setStart(des.element.dom, des.offset);\n rng.setEnd(des.element.dom, des.offset);\n editor.selection.setRng(rng);\n cellSelectionHandler.clearSelectedCells(table.dom);\n return Optional.some(rng);\n }); };\n var execute = function (operation, guard, mutate, effect) { return function (table, target, noEvents) {\n if (noEvents === void 0) { noEvents = false; }\n removeDataStyle(table);\n var doc = SugarElement.fromDom(editor.getDoc());\n var generators = cellOperations(mutate, doc, cloneFormats);\n var behaviours = {\n sizing: get$5(editor, table),\n resize: isResizeTableColumnResizing(editor) ? resizeTable() : preserveTable(),\n section: getTableSectionType(table)\n };\n return guard(table) ? operation(table, target, generators, behaviours).bind(function (result) {\n resizeHandler.refresh(table.dom);\n each$2(result.newRows, function (row) {\n fireNewRow(editor, row.dom);\n });\n each$2(result.newCells, function (cell) {\n fireNewCell(editor, cell.dom);\n });\n var range = setSelectionFromAction(table, result);\n if (inBody(table)) {\n removeDataStyle(table);\n if (!noEvents) {\n fireTableModified(editor, table.dom, effect);\n }\n }\n return range.map(function (rng) { return ({\n rng: rng,\n effect: effect\n }); });\n }) : Optional.none();\n }; };\n var deleteRow = execute(eraseRows, lastRowGuard, noop, structureModified);\n var deleteColumn = execute(eraseColumns, lastColumnGuard, noop, structureModified);\n var insertRowsBefore$1 = execute(insertRowsBefore, always, noop, structureModified);\n var insertRowsAfter$1 = execute(insertRowsAfter, always, noop, structureModified);\n var insertColumnsBefore$1 = execute(insertColumnsBefore, always, colMutationOp, structureModified);\n var insertColumnsAfter$1 = execute(insertColumnsAfter, always, colMutationOp, structureModified);\n var mergeCells$1 = execute(mergeCells, always, noop, structureModified);\n var unmergeCells$1 = execute(unmergeCells, always, noop, structureModified);\n var pasteColsBefore$1 = execute(pasteColsBefore, always, noop, structureModified);\n var pasteColsAfter$1 = execute(pasteColsAfter, always, noop, structureModified);\n var pasteRowsBefore$1 = execute(pasteRowsBefore, always, noop, structureModified);\n var pasteRowsAfter$1 = execute(pasteRowsAfter, always, noop, structureModified);\n var pasteCells$1 = execute(pasteCells, always, noop, styleAndStructureModified);\n var makeCellsHeader$1 = execute(makeCellsHeader, always, noop, structureModified);\n var unmakeCellsHeader$1 = execute(unmakeCellsHeader, always, noop, structureModified);\n var makeColumnsHeader$1 = execute(makeColumnsHeader, always, noop, structureModified);\n var unmakeColumnsHeader$1 = execute(unmakeColumnsHeader, always, noop, structureModified);\n var makeRowsHeader$1 = execute(makeRowsHeader, always, noop, structureModified);\n var makeRowsBody$1 = execute(makeRowsBody, always, noop, structureModified);\n var makeRowsFooter$1 = execute(makeRowsFooter, always, noop, structureModified);\n var getTableCellType = getCellsType;\n var getTableColType = getColumnsType;\n var getTableRowType = getRowsType;\n return {\n deleteRow: deleteRow,\n deleteColumn: deleteColumn,\n insertRowsBefore: insertRowsBefore$1,\n insertRowsAfter: insertRowsAfter$1,\n insertColumnsBefore: insertColumnsBefore$1,\n insertColumnsAfter: insertColumnsAfter$1,\n mergeCells: mergeCells$1,\n unmergeCells: unmergeCells$1,\n pasteColsBefore: pasteColsBefore$1,\n pasteColsAfter: pasteColsAfter$1,\n pasteRowsBefore: pasteRowsBefore$1,\n pasteRowsAfter: pasteRowsAfter$1,\n pasteCells: pasteCells$1,\n makeCellsHeader: makeCellsHeader$1,\n unmakeCellsHeader: unmakeCellsHeader$1,\n makeColumnsHeader: makeColumnsHeader$1,\n unmakeColumnsHeader: unmakeColumnsHeader$1,\n makeRowsHeader: makeRowsHeader$1,\n makeRowsBody: makeRowsBody$1,\n makeRowsFooter: makeRowsFooter$1,\n getTableRowType: getTableRowType,\n getTableCellType: getTableCellType,\n getTableColType: getTableColType\n };\n };\n var constrainSpan = function (element, property, value) {\n var currentColspan = getAttrValue(element, property, 1);\n if (value === 1 || currentColspan <= 1) {\n remove$7(element, property);\n }\n else {\n set$2(element, property, Math.min(value, currentColspan));\n }\n };\n var isColInRange = function (minColRange, maxColRange) { return function (cell) {\n var endCol = cell.column + cell.colspan - 1;\n var startCol = cell.column;\n return endCol >= minColRange && startCol < maxColRange;\n }; };\n var generateColGroup = function (house, minColRange, maxColRange) {\n if (Warehouse.hasColumns(house)) {\n var colsToCopy = filter$2(Warehouse.justColumns(house), isColInRange(minColRange, maxColRange));\n var copiedCols = map$1(colsToCopy, function (c) {\n var clonedCol = deep(c.element);\n constrainSpan(clonedCol, 'span', maxColRange - minColRange);\n return clonedCol;\n });\n var fakeColgroup = SugarElement.fromTag('colgroup');\n append(fakeColgroup, copiedCols);\n return [fakeColgroup];\n }\n else {\n return [];\n }\n };\n var generateRows = function (house, minColRange, maxColRange) { return map$1(house.all, function (row) {\n var cellsToCopy = filter$2(row.cells, isColInRange(minColRange, maxColRange));\n var copiedCells = map$1(cellsToCopy, function (cell) {\n var clonedCell = deep(cell.element);\n constrainSpan(clonedCell, 'colspan', maxColRange - minColRange);\n return clonedCell;\n });\n var fakeTR = SugarElement.fromTag('tr');\n append(fakeTR, copiedCells);\n return fakeTR;\n }); };\n var copyCols = function (table, target) {\n var house = Warehouse.fromTable(table);\n var details = onUnlockedCells(house, target);\n return details.map(function (selectedCells) {\n var lastSelectedCell = selectedCells[selectedCells.length - 1];\n var minColRange = selectedCells[0].column;\n var maxColRange = lastSelectedCell.column + lastSelectedCell.colspan;\n var fakeColGroups = generateColGroup(house, minColRange, maxColRange);\n var fakeRows = generateRows(house, minColRange, maxColRange);\n return __spreadArray(__spreadArray([], fakeColGroups, true), fakeRows, true);\n });\n };\n var copyRows = function (table, target, generators) {\n var warehouse = Warehouse.fromTable(table);\n var details = onCells(warehouse, target);\n return details.bind(function (selectedCells) {\n var grid = toGrid(warehouse, generators, false);\n var rows = extractGridDetails(grid).rows;\n var slicedGrid = rows.slice(selectedCells[0].row, selectedCells[selectedCells.length - 1].row + selectedCells[selectedCells.length - 1].rowspan);\n var filteredGrid = bind$2(slicedGrid, function (row) {\n var newCells = filter$2(row.cells, function (cell) { return !cell.isLocked; });\n return newCells.length > 0 ? [__assign(__assign({}, row), { cells: newCells })] : [];\n });\n var slicedDetails = toDetailList(filteredGrid);\n return someIf(slicedDetails.length > 0, slicedDetails);\n }).map(function (slicedDetails) { return copy(slicedDetails); });\n };\n var adt$5 = Adt.generate([\n { invalid: ['raw'] },\n { pixels: ['value'] },\n { percent: ['value'] }\n ]);\n var validateFor = function (suffix, type, value) {\n var rawAmount = value.substring(0, value.length - suffix.length);\n var amount = parseFloat(rawAmount);\n return rawAmount === amount.toString() ? type(amount) : adt$5.invalid(value);\n };\n var from = function (value) {\n if (endsWith(value, '%')) {\n return validateFor('%', adt$5.percent, value);\n }\n if (endsWith(value, 'px')) {\n return validateFor('px', adt$5.pixels, value);\n }\n return adt$5.invalid(value);\n };\n var Size = __assign(__assign({}, adt$5), { from: from });\n var redistributeToPercent = function (widths, totalWidth) {\n return map$1(widths, function (w) {\n var colType = Size.from(w);\n return colType.fold(function () {\n return w;\n }, function (px) {\n var ratio = px / totalWidth * 100;\n return ratio + '%';\n }, function (pc) {\n return pc + '%';\n });\n });\n };\n var redistributeToPx = function (widths, totalWidth, newTotalWidth) {\n var scale = newTotalWidth / totalWidth;\n return map$1(widths, function (w) {\n var colType = Size.from(w);\n return colType.fold(function () {\n return w;\n }, function (px) {\n return px * scale + 'px';\n }, function (pc) {\n return pc / 100 * newTotalWidth + 'px';\n });\n });\n };\n var redistributeEmpty = function (newWidthType, columns) {\n var f = newWidthType.fold(function () { return constant(''); }, function (pixels) {\n var num = pixels / columns;\n return constant(num + 'px');\n }, function () {\n var num = 100 / columns;\n return constant(num + '%');\n });\n return range$1(columns, f);\n };\n var redistributeValues = function (newWidthType, widths, totalWidth) {\n return newWidthType.fold(function () {\n return widths;\n }, function (px) {\n return redistributeToPx(widths, totalWidth, px);\n }, function (_pc) {\n return redistributeToPercent(widths, totalWidth);\n });\n };\n var redistribute$1 = function (widths, totalWidth, newWidth) {\n var newType = Size.from(newWidth);\n var floats = forall(widths, function (s) {\n return s === '0px';\n }) ? redistributeEmpty(newType, widths.length) : redistributeValues(newType, widths, totalWidth);\n return normalize(floats);\n };\n var sum = function (values, fallback) {\n if (values.length === 0) {\n return fallback;\n }\n return foldr(values, function (rest, v) {\n return Size.from(v).fold(constant(0), identity, identity) + rest;\n }, 0);\n };\n var roundDown = function (num, unit) {\n var floored = Math.floor(num);\n return {\n value: floored + unit,\n remainder: num - floored\n };\n };\n var add$3 = function (value, amount) {\n return Size.from(value).fold(constant(value), function (px) {\n return px + amount + 'px';\n }, function (pc) {\n return pc + amount + '%';\n });\n };\n var normalize = function (values) {\n if (values.length === 0) {\n return values;\n }\n var scan = foldr(values, function (rest, value) {\n var info = Size.from(value).fold(function () { return ({\n value: value,\n remainder: 0\n }); }, function (num) { return roundDown(num, 'px'); }, function (num) { return ({\n value: num + '%',\n remainder: 0\n }); });\n return {\n output: [info.value].concat(rest.output),\n remainder: rest.remainder + info.remainder\n };\n }, {\n output: [],\n remainder: 0\n });\n var r = scan.output;\n return r.slice(0, r.length - 1).concat([add$3(r[r.length - 1], Math.round(scan.remainder))]);\n };\n var validate = Size.from;\n var redistributeToW = function (newWidths, cells, unit) {\n each$2(cells, function (cell) {\n var widths = newWidths.slice(cell.column, cell.colspan + cell.column);\n var w = sum(widths, minWidth());\n set$1(cell.element, 'width', w + unit);\n });\n };\n var redistributeToColumns = function (newWidths, columns, unit) {\n each$2(columns, function (column, index) {\n var width = sum([newWidths[index]], minWidth());\n set$1(column.element, 'width', width + unit);\n });\n };\n var redistributeToH = function (newHeights, rows, cells, unit) {\n each$2(cells, function (cell) {\n var heights = newHeights.slice(cell.row, cell.rowspan + cell.row);\n var h = sum(heights, minHeight());\n set$1(cell.element, 'height', h + unit);\n });\n each$2(rows, function (row, i) {\n set$1(row.element, 'height', newHeights[i]);\n });\n };\n var getUnit = function (newSize) {\n return validate(newSize).fold(constant('px'), constant('px'), constant('%'));\n };\n var redistribute = function (table, optWidth, optHeight) {\n var warehouse = Warehouse.fromTable(table);\n var rows = warehouse.all;\n var cells = Warehouse.justCells(warehouse);\n var columns = Warehouse.justColumns(warehouse);\n optWidth.each(function (newWidth) {\n var widthUnit = getUnit(newWidth);\n var totalWidth = get$9(table);\n var oldWidths = getRawWidths(warehouse, table);\n var nuWidths = redistribute$1(oldWidths, totalWidth, newWidth);\n if (Warehouse.hasColumns(warehouse)) {\n redistributeToColumns(nuWidths, columns, widthUnit);\n }\n else {\n redistributeToW(nuWidths, cells, widthUnit);\n }\n set$1(table, 'width', newWidth);\n });\n optHeight.each(function (newHeight) {\n var hUnit = getUnit(newHeight);\n var totalHeight = get$8(table);\n var oldHeights = getRawHeights(warehouse, table, height);\n var nuHeights = redistribute$1(oldHeights, totalHeight, newHeight);\n redistributeToH(nuHeights, rows, cells, hUnit);\n set$1(table, 'height', newHeight);\n });\n };\n var isPercentSizing = isPercentSizing$1;\n var isPixelSizing = isPixelSizing$1;\n var isNoneSizing = isNoneSizing$1;\n var cleanupLegacyAttributes = function (element) {\n remove$7(element, 'width');\n };\n var convertToPercentSize = function (table) {\n var newWidth = getPercentTableWidth(table);\n redistribute(table, Optional.some(newWidth), Optional.none());\n cleanupLegacyAttributes(table);\n };\n var convertToPixelSize = function (table) {\n var newWidth = getPixelTableWidth(table);\n redistribute(table, Optional.some(newWidth), Optional.none());\n cleanupLegacyAttributes(table);\n };\n var convertToNoneSize = function (table) {\n remove$5(table, 'width');\n var columns = columns$1(table);\n var rowElements = columns.length > 0 ? columns : cells$1(table);\n each$2(rowElements, function (cell) {\n remove$5(cell, 'width');\n cleanupLegacyAttributes(cell);\n });\n cleanupLegacyAttributes(table);\n };\n var DefaultRenderOptions = {\n styles: {\n 'border-collapse': 'collapse',\n 'width': '100%'\n },\n attributes: { border: '1' },\n colGroups: false\n };\n var tableHeaderCell = function () { return SugarElement.fromTag('th'); };\n var tableCell = function () { return SugarElement.fromTag('td'); };\n var tableColumn = function () { return SugarElement.fromTag('col'); };\n var createRow = function (columns, rowHeaders, columnHeaders, rowIndex) {\n var tr = SugarElement.fromTag('tr');\n for (var j = 0; j < columns; j++) {\n var td = rowIndex < rowHeaders || j < columnHeaders ? tableHeaderCell() : tableCell();\n if (j < columnHeaders) {\n set$2(td, 'scope', 'row');\n }\n if (rowIndex < rowHeaders) {\n set$2(td, 'scope', 'col');\n }\n append$1(td, SugarElement.fromTag('br'));\n append$1(tr, td);\n }\n return tr;\n };\n var createGroupRow = function (columns) {\n var columnGroup = SugarElement.fromTag('colgroup');\n range$1(columns, function () { return append$1(columnGroup, tableColumn()); });\n return columnGroup;\n };\n var createRows = function (rows, columns, rowHeaders, columnHeaders) { return range$1(rows, function (r) { return createRow(columns, rowHeaders, columnHeaders, r); }); };\n var render = function (rows, columns, rowHeaders, columnHeaders, headerType, renderOpts) {\n if (renderOpts === void 0) { renderOpts = DefaultRenderOptions; }\n var table = SugarElement.fromTag('table');\n var rowHeadersGoInThead = headerType !== 'cells';\n setAll(table, renderOpts.styles);\n setAll$1(table, renderOpts.attributes);\n if (renderOpts.colGroups) {\n append$1(table, createGroupRow(columns));\n }\n var actualRowHeaders = Math.min(rows, rowHeaders);\n if (rowHeadersGoInThead && rowHeaders > 0) {\n var thead = SugarElement.fromTag('thead');\n append$1(table, thead);\n var theadRowHeaders = headerType === 'sectionCells' ? actualRowHeaders : 0;\n var theadRows = createRows(rowHeaders, columns, theadRowHeaders, columnHeaders);\n append(thead, theadRows);\n }\n var tbody = SugarElement.fromTag('tbody');\n append$1(table, tbody);\n var numRows = rowHeadersGoInThead ? rows - actualRowHeaders : rows;\n var numRowHeaders = rowHeadersGoInThead ? 0 : rowHeaders;\n var tbodyRows = createRows(numRows, columns, numRowHeaders, columnHeaders);\n append(tbody, tbodyRows);\n return table;\n };\n var get$4 = function (element) { return element.dom.innerHTML; };\n var getOuter = function (element) {\n var container = SugarElement.fromTag('div');\n var clone = SugarElement.fromDom(element.dom.cloneNode(true));\n append$1(container, clone);\n return get$4(container);\n };\n var placeCaretInCell = function (editor, cell) {\n editor.selection.select(cell.dom, true);\n editor.selection.collapse(true);\n };\n var selectFirstCellInTable = function (editor, tableElm) {\n descendant(tableElm, 'td,th').each(curry(placeCaretInCell, editor));\n };\n var fireEvents = function (editor, table) {\n each$2(descendants(table, 'tr'), function (row) {\n fireNewRow(editor, row.dom);\n each$2(descendants(row, 'th,td'), function (cell) {\n fireNewCell(editor, cell.dom);\n });\n });\n };\n var isPercentage = function (width) { return isString(width) && width.indexOf('%') !== -1; };\n var insert = function (editor, columns, rows, colHeaders, rowHeaders) {\n var defaultStyles = getTableDefaultStyles(editor);\n var options = {\n styles: defaultStyles,\n attributes: getTableDefaultAttributes(editor),\n colGroups: tableUseColumnGroup(editor)\n };\n editor.undoManager.ignore(function () {\n var table = render(rows, columns, rowHeaders, colHeaders, getTableHeaderType(editor), options);\n set$2(table, 'data-mce-id', '__mce');\n var html = getOuter(table);\n editor.insertContent(html);\n editor.addVisual();\n });\n return descendant(getBody(editor), 'table[data-mce-id=\"__mce\"]').map(function (table) {\n if (isTablePixelsForced(editor)) {\n convertToPixelSize(table);\n }\n else if (isTableResponsiveForced(editor)) {\n convertToNoneSize(table);\n }\n else if (isTablePercentagesForced(editor) || isPercentage(defaultStyles.width)) {\n convertToPercentSize(table);\n }\n removeDataStyle(table);\n remove$7(table, 'data-mce-id');\n fireEvents(editor, table);\n selectFirstCellInTable(editor, table);\n return table.dom;\n }).getOrNull();\n };\n var insertTable = function (editor, rows, columns, options) {\n if (options === void 0) { options = {}; }\n var checkInput = function (val) { return isNumber(val) && val > 0; };\n if (checkInput(rows) && checkInput(columns)) {\n var headerRows = options.headerRows || 0;\n var headerColumns = options.headerColumns || 0;\n return insert(editor, columns, rows, headerColumns, headerRows);\n }\n else {\n console.error('Invalid values for mceInsertTable - rows and columns values are required to insert a table.');\n return null;\n }\n };\n var global = tinymce.util.Tools.resolve('tinymce.FakeClipboard');\n var tableTypeBase = 'x-tinymce/dom-table-';\n var tableTypeRow = tableTypeBase + 'rows';\n var tableTypeColumn = tableTypeBase + 'columns';\n var setData = function (items) {\n var fakeClipboardItem = global.FakeClipboardItem(items);\n global.write([fakeClipboardItem]);\n };\n var getData = function (type) {\n var _a;\n var items = (_a = global.read()) !== null && _a !== void 0 ? _a : [];\n return findMap(items, function (item) { return Optional.from(item.getType(type)); });\n };\n var clearData = function (type) {\n if (getData(type).isSome()) {\n global.clear();\n }\n };\n var setRows = function (rowsOpt) {\n rowsOpt.fold(clearRows, function (rows) {\n var _c;\n return setData((_c = {}, _c[tableTypeRow] = rows, _c));\n });\n };\n var getRows = function () { return getData(tableTypeRow); };\n var clearRows = function () { return clearData(tableTypeRow); };\n var setColumns = function (columnsOpt) {\n columnsOpt.fold(clearColumns, function (columns) {\n var _c;\n return setData((_c = {}, _c[tableTypeColumn] = columns, _c));\n });\n };\n var getColumns = function () { return getData(tableTypeColumn); };\n var clearColumns = function () { return clearData(tableTypeColumn); };\n var getSelectionStartCellOrCaption = function (editor) { return getSelectionCellOrCaption(getSelectionStart(editor), getIsRoot(editor)).filter(isInEditableContext$1); };\n var getSelectionStartCell = function (editor) { return getSelectionCell(getSelectionStart(editor), getIsRoot(editor)).filter(isInEditableContext$1); };\n var registerCommands = function (editor, actions) {\n var isRoot = getIsRoot(editor);\n var eraseTable = function () { return getSelectionStartCellOrCaption(editor).each(function (cellOrCaption) {\n table(cellOrCaption, isRoot).filter(not(isRoot)).each(function (table) {\n var cursor = SugarElement.fromText('');\n after$5(table, cursor);\n remove$6(table);\n if (editor.dom.isEmpty(editor.getBody())) {\n editor.setContent('');\n editor.selection.setCursorLocation();\n }\n else {\n var rng = editor.dom.createRng();\n rng.setStart(cursor.dom, 0);\n rng.setEnd(cursor.dom, 0);\n editor.selection.setRng(rng);\n editor.nodeChanged();\n }\n });\n }); };\n var setSizingMode = function (sizing) { return getSelectionStartCellOrCaption(editor).each(function (cellOrCaption) {\n var isForcedSizing = isTableResponsiveForced(editor) || isTablePixelsForced(editor) || isTablePercentagesForced(editor);\n if (!isForcedSizing) {\n table(cellOrCaption, isRoot).each(function (table) {\n if (sizing === 'relative' && !isPercentSizing(table)) {\n convertToPercentSize(table);\n }\n else if (sizing === 'fixed' && !isPixelSizing(table)) {\n convertToPixelSize(table);\n }\n else if (sizing === 'responsive' && !isNoneSizing(table)) {\n convertToNoneSize(table);\n }\n removeDataStyle(table);\n fireTableModified(editor, table.dom, structureModified);\n });\n }\n }); };\n var getTableFromCell = function (cell) { return table(cell, isRoot); };\n var performActionOnSelection = function (action) { return getSelectionStartCell(editor).bind(function (cell) { return getTableFromCell(cell).map(function (table) { return action(table, cell); }); }); };\n var toggleTableClass = function (_ui, clazz) {\n performActionOnSelection(function (table) {\n editor.formatter.toggle('tableclass', { value: clazz }, table.dom);\n fireTableModified(editor, table.dom, styleModified);\n });\n };\n var toggleTableCellClass = function (_ui, clazz) {\n performActionOnSelection(function (table) {\n var selectedCells = getCellsFromSelection(editor);\n var allHaveClass = forall(selectedCells, function (cell) { return editor.formatter.match('tablecellclass', { value: clazz }, cell.dom); });\n var formatterAction = allHaveClass ? editor.formatter.remove : editor.formatter.apply;\n each$2(selectedCells, function (cell) { return formatterAction('tablecellclass', { value: clazz }, cell.dom); });\n fireTableModified(editor, table.dom, styleModified);\n });\n };\n var toggleCaption = function () {\n getSelectionStartCellOrCaption(editor).each(function (cellOrCaption) {\n table(cellOrCaption, isRoot).each(function (table) {\n child(table, 'caption').fold(function () {\n var caption = SugarElement.fromTag('caption');\n append$1(caption, SugarElement.fromText('Caption'));\n appendAt(table, caption, 0);\n editor.selection.setCursorLocation(caption.dom, 0);\n }, function (caption) {\n if (isTag('caption')(cellOrCaption)) {\n one('td', table).each(function (td) { return editor.selection.setCursorLocation(td.dom, 0); });\n }\n remove$6(caption);\n });\n fireTableModified(editor, table.dom, structureModified);\n });\n });\n };\n var postExecute = function (_data) {\n editor.focus();\n };\n var actOnSelection = function (execute, noEvents) {\n if (noEvents === void 0) { noEvents = false; }\n return performActionOnSelection(function (table, startCell) {\n var targets = forMenu(getCellsFromSelection(editor), table, startCell);\n execute(table, targets, noEvents).each(postExecute);\n });\n };\n var copyRowSelection = function () { return performActionOnSelection(function (table, startCell) {\n var targets = forMenu(getCellsFromSelection(editor), table, startCell);\n var generators = cellOperations(noop, SugarElement.fromDom(editor.getDoc()), Optional.none());\n return copyRows(table, targets, generators);\n }); };\n var copyColSelection = function () { return performActionOnSelection(function (table, startCell) {\n var targets = forMenu(getCellsFromSelection(editor), table, startCell);\n return copyCols(table, targets);\n }); };\n var pasteOnSelection = function (execute, getRows) { return getRows().each(function (rows) {\n var clonedRows = map$1(rows, function (row) { return deep(row); });\n performActionOnSelection(function (table, startCell) {\n var generators = paste$1(SugarElement.fromDom(editor.getDoc()));\n var targets = pasteRows(getCellsFromSelection(editor), startCell, clonedRows, generators);\n execute(table, targets).each(postExecute);\n });\n }); };\n var actOnType = function (getAction) { return function (_ui, args) { return get$c(args, 'type').each(function (type) {\n actOnSelection(getAction(type), args.no_events);\n }); }; };\n each$1({\n mceTableSplitCells: function () { return actOnSelection(actions.unmergeCells); },\n mceTableMergeCells: function () { return actOnSelection(actions.mergeCells); },\n mceTableInsertRowBefore: function () { return actOnSelection(actions.insertRowsBefore); },\n mceTableInsertRowAfter: function () { return actOnSelection(actions.insertRowsAfter); },\n mceTableInsertColBefore: function () { return actOnSelection(actions.insertColumnsBefore); },\n mceTableInsertColAfter: function () { return actOnSelection(actions.insertColumnsAfter); },\n mceTableDeleteCol: function () { return actOnSelection(actions.deleteColumn); },\n mceTableDeleteRow: function () { return actOnSelection(actions.deleteRow); },\n mceTableCutCol: function () { return copyColSelection().each(function (selection) {\n setColumns(selection);\n actOnSelection(actions.deleteColumn);\n }); },\n mceTableCutRow: function () { return copyRowSelection().each(function (selection) {\n setRows(selection);\n actOnSelection(actions.deleteRow);\n }); },\n mceTableCopyCol: function () { return copyColSelection().each(function (selection) { return setColumns(selection); }); },\n mceTableCopyRow: function () { return copyRowSelection().each(function (selection) { return setRows(selection); }); },\n mceTablePasteColBefore: function () { return pasteOnSelection(actions.pasteColsBefore, getColumns); },\n mceTablePasteColAfter: function () { return pasteOnSelection(actions.pasteColsAfter, getColumns); },\n mceTablePasteRowBefore: function () { return pasteOnSelection(actions.pasteRowsBefore, getRows); },\n mceTablePasteRowAfter: function () { return pasteOnSelection(actions.pasteRowsAfter, getRows); },\n mceTableDelete: eraseTable,\n mceTableCellToggleClass: toggleTableCellClass,\n mceTableToggleClass: toggleTableClass,\n mceTableToggleCaption: toggleCaption,\n mceTableSizingMode: function (_ui, sizing) { return setSizingMode(sizing); },\n mceTableCellType: actOnType(function (type) { return type === 'th' ? actions.makeCellsHeader : actions.unmakeCellsHeader; }),\n mceTableColType: actOnType(function (type) { return type === 'th' ? actions.makeColumnsHeader : actions.unmakeColumnsHeader; }),\n mceTableRowType: actOnType(function (type) {\n switch (type) {\n case 'header':\n return actions.makeRowsHeader;\n case 'footer':\n return actions.makeRowsFooter;\n default:\n return actions.makeRowsBody;\n }\n })\n }, function (func, name) { return editor.addCommand(name, func); });\n editor.addCommand('mceInsertTable', function (_ui, args) {\n insertTable(editor, args.rows, args.columns, args.options);\n });\n editor.addCommand('mceTableApplyCellStyle', function (_ui, args) {\n var getFormatName = function (style) { return 'tablecell' + style.toLowerCase().replace('-', ''); };\n if (!isObject(args)) {\n return;\n }\n var cells = filter$2(getCellsFromSelection(editor), isInEditableContext$1);\n if (cells.length === 0) {\n return;\n }\n var validArgs = filter$1(args, function (value, style) { return editor.formatter.has(getFormatName(style)) && isString(value); });\n if (isEmpty(validArgs)) {\n return;\n }\n each$1(validArgs, function (value, style) {\n var formatName = getFormatName(style);\n each$2(cells, function (cell) {\n if (value === '') {\n editor.formatter.remove(formatName, { value: null }, cell.dom, true);\n }\n else {\n editor.formatter.apply(formatName, { value: value }, cell.dom);\n }\n });\n });\n getTableFromCell(cells[0]).each(function (table) { return fireTableModified(editor, table.dom, styleModified); });\n });\n };\n var registerQueryCommands = function (editor, actions) {\n var isRoot = getIsRoot(editor);\n var lookupOnSelection = function (action) { return getSelectionCell(getSelectionStart(editor)).bind(function (cell) { return table(cell, isRoot).map(function (table) {\n var targets = forMenu(getCellsFromSelection(editor), table, cell);\n return action(table, targets);\n }); }).getOr(''); };\n each$1({\n mceTableRowType: function () { return lookupOnSelection(actions.getTableRowType); },\n mceTableCellType: function () { return lookupOnSelection(actions.getTableCellType); },\n mceTableColType: function () { return lookupOnSelection(actions.getTableColType); }\n }, function (func, name) { return editor.addQueryValueHandler(name, func); });\n };\n var adt$4 = Adt.generate([\n { before: ['element'] },\n {\n on: [\n 'element',\n 'offset'\n ]\n },\n { after: ['element'] }\n ]);\n var cata$1 = function (subject, onBefore, onOn, onAfter) { return subject.fold(onBefore, onOn, onAfter); };\n var getStart$1 = function (situ) { return situ.fold(identity, identity, identity); };\n var before$2 = adt$4.before;\n var on = adt$4.on;\n var after$3 = adt$4.after;\n var Situ = {\n before: before$2,\n on: on,\n after: after$3,\n cata: cata$1,\n getStart: getStart$1\n };\n var create$4 = function (selection, kill) { return ({\n selection: selection,\n kill: kill\n }); };\n var Response = { create: create$4 };\n var selectNode = function (win, element) {\n var rng = win.document.createRange();\n rng.selectNode(element.dom);\n return rng;\n };\n var selectNodeContents = function (win, element) {\n var rng = win.document.createRange();\n selectNodeContentsUsing(rng, element);\n return rng;\n };\n var selectNodeContentsUsing = function (rng, element) { return rng.selectNodeContents(element.dom); };\n var setStart = function (rng, situ) {\n situ.fold(function (e) {\n rng.setStartBefore(e.dom);\n }, function (e, o) {\n rng.setStart(e.dom, o);\n }, function (e) {\n rng.setStartAfter(e.dom);\n });\n };\n var setFinish = function (rng, situ) {\n situ.fold(function (e) {\n rng.setEndBefore(e.dom);\n }, function (e, o) {\n rng.setEnd(e.dom, o);\n }, function (e) {\n rng.setEndAfter(e.dom);\n });\n };\n var relativeToNative = function (win, startSitu, finishSitu) {\n var range = win.document.createRange();\n setStart(range, startSitu);\n setFinish(range, finishSitu);\n return range;\n };\n var exactToNative = function (win, start, soffset, finish, foffset) {\n var rng = win.document.createRange();\n rng.setStart(start.dom, soffset);\n rng.setEnd(finish.dom, foffset);\n return rng;\n };\n var toRect = function (rect) { return ({\n left: rect.left,\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom,\n width: rect.width,\n height: rect.height\n }); };\n var getFirstRect$1 = function (rng) {\n var rects = rng.getClientRects();\n var rect = rects.length > 0 ? rects[0] : rng.getBoundingClientRect();\n return rect.width > 0 || rect.height > 0 ? Optional.some(rect).map(toRect) : Optional.none();\n };\n var adt$3 = Adt.generate([\n {\n ltr: [\n 'start',\n 'soffset',\n 'finish',\n 'foffset'\n ]\n },\n {\n rtl: [\n 'start',\n 'soffset',\n 'finish',\n 'foffset'\n ]\n }\n ]);\n var fromRange = function (win, type, range) { return type(SugarElement.fromDom(range.startContainer), range.startOffset, SugarElement.fromDom(range.endContainer), range.endOffset); };\n var getRanges = function (win, selection) { return selection.match({\n domRange: function (rng) {\n return {\n ltr: constant(rng),\n rtl: Optional.none\n };\n },\n relative: function (startSitu, finishSitu) {\n return {\n ltr: cached(function () { return relativeToNative(win, startSitu, finishSitu); }),\n rtl: cached(function () { return Optional.some(relativeToNative(win, finishSitu, startSitu)); })\n };\n },\n exact: function (start, soffset, finish, foffset) {\n return {\n ltr: cached(function () { return exactToNative(win, start, soffset, finish, foffset); }),\n rtl: cached(function () { return Optional.some(exactToNative(win, finish, foffset, start, soffset)); })\n };\n }\n }); };\n var doDiagnose = function (win, ranges) {\n var rng = ranges.ltr();\n if (rng.collapsed) {\n var reversed = ranges.rtl().filter(function (rev) { return rev.collapsed === false; });\n return reversed.map(function (rev) { return adt$3.rtl(SugarElement.fromDom(rev.endContainer), rev.endOffset, SugarElement.fromDom(rev.startContainer), rev.startOffset); }).getOrThunk(function () { return fromRange(win, adt$3.ltr, rng); });\n }\n else {\n return fromRange(win, adt$3.ltr, rng);\n }\n };\n var diagnose = function (win, selection) {\n var ranges = getRanges(win, selection);\n return doDiagnose(win, ranges);\n };\n var asLtrRange = function (win, selection) {\n var diagnosis = diagnose(win, selection);\n return diagnosis.match({\n ltr: function (start, soffset, finish, foffset) {\n var rng = win.document.createRange();\n rng.setStart(start.dom, soffset);\n rng.setEnd(finish.dom, foffset);\n return rng;\n },\n rtl: function (start, soffset, finish, foffset) {\n var rng = win.document.createRange();\n rng.setStart(finish.dom, foffset);\n rng.setEnd(start.dom, soffset);\n return rng;\n }\n });\n };\n adt$3.ltr;\n adt$3.rtl;\n var create$3 = function (start, soffset, finish, foffset) { return ({\n start: start,\n soffset: soffset,\n finish: finish,\n foffset: foffset\n }); };\n var SimRange = { create: create$3 };\n var create$2 = function (start, soffset, finish, foffset) {\n return {\n start: Situ.on(start, soffset),\n finish: Situ.on(finish, foffset)\n };\n };\n var Situs = { create: create$2 };\n var convertToRange = function (win, selection) {\n var rng = asLtrRange(win, selection);\n return SimRange.create(SugarElement.fromDom(rng.startContainer), rng.startOffset, SugarElement.fromDom(rng.endContainer), rng.endOffset);\n };\n var makeSitus = Situs.create;\n var sync = function (container, isRoot, start, soffset, finish, foffset, selectRange) {\n if (!(eq$1(start, finish) && soffset === foffset)) {\n return closest$1(start, 'td,th', isRoot).bind(function (s) {\n return closest$1(finish, 'td,th', isRoot).bind(function (f) {\n return detect(container, isRoot, s, f, selectRange);\n });\n });\n }\n else {\n return Optional.none();\n }\n };\n var detect = function (container, isRoot, start, finish, selectRange) {\n if (!eq$1(start, finish)) {\n return identify(start, finish, isRoot).bind(function (cellSel) {\n var boxes = cellSel.boxes.getOr([]);\n if (boxes.length > 1) {\n selectRange(container, boxes, cellSel.start, cellSel.finish);\n return Optional.some(Response.create(Optional.some(makeSitus(start, 0, start, getEnd(start))), true));\n }\n else {\n return Optional.none();\n }\n });\n }\n else {\n return Optional.none();\n }\n };\n var update = function (rows, columns, container, selected, annotations) {\n var updateSelection = function (newSels) {\n annotations.clearBeforeUpdate(container);\n annotations.selectRange(container, newSels.boxes, newSels.start, newSels.finish);\n return newSels.boxes;\n };\n return shiftSelection(selected, rows, columns, annotations.firstSelectedSelector, annotations.lastSelectedSelector).map(updateSelection);\n };\n var traverse = function (item, mode) { return ({\n item: item,\n mode: mode\n }); };\n var backtrack = function (universe, item, _direction, transition) {\n if (transition === void 0) { transition = sidestep; }\n return universe.property().parent(item).map(function (p) {\n return traverse(p, transition);\n });\n };\n var sidestep = function (universe, item, direction, transition) {\n if (transition === void 0) { transition = advance; }\n return direction.sibling(universe, item).map(function (p) {\n return traverse(p, transition);\n });\n };\n var advance = function (universe, item, direction, transition) {\n if (transition === void 0) { transition = advance; }\n var children = universe.property().children(item);\n var result = direction.first(children);\n return result.map(function (r) {\n return traverse(r, transition);\n });\n };\n var successors = [\n {\n current: backtrack,\n next: sidestep,\n fallback: Optional.none()\n },\n {\n current: sidestep,\n next: advance,\n fallback: Optional.some(backtrack)\n },\n {\n current: advance,\n next: advance,\n fallback: Optional.some(sidestep)\n }\n ];\n var go = function (universe, item, mode, direction, rules) {\n if (rules === void 0) { rules = successors; }\n var ruleOpt = find$1(rules, function (succ) {\n return succ.current === mode;\n });\n return ruleOpt.bind(function (rule) {\n return rule.current(universe, item, direction, rule.next).orThunk(function () {\n return rule.fallback.bind(function (fb) {\n return go(universe, item, fb, direction);\n });\n });\n });\n };\n var left$1 = function () {\n var sibling = function (universe, item) {\n return universe.query().prevSibling(item);\n };\n var first = function (children) {\n return children.length > 0 ? Optional.some(children[children.length - 1]) : Optional.none();\n };\n return {\n sibling: sibling,\n first: first\n };\n };\n var right$1 = function () {\n var sibling = function (universe, item) {\n return universe.query().nextSibling(item);\n };\n var first = function (children) {\n return children.length > 0 ? Optional.some(children[0]) : Optional.none();\n };\n return {\n sibling: sibling,\n first: first\n };\n };\n var Walkers = {\n left: left$1,\n right: right$1\n };\n var hone = function (universe, item, predicate, mode, direction, isRoot) {\n var next = go(universe, item, mode, direction);\n return next.bind(function (n) {\n if (isRoot(n.item)) {\n return Optional.none();\n }\n else {\n return predicate(n.item) ? Optional.some(n.item) : hone(universe, n.item, predicate, n.mode, direction, isRoot);\n }\n });\n };\n var left = function (universe, item, predicate, isRoot) {\n return hone(universe, item, predicate, sidestep, Walkers.left(), isRoot);\n };\n var right = function (universe, item, predicate, isRoot) {\n return hone(universe, item, predicate, sidestep, Walkers.right(), isRoot);\n };\n var isLeaf = function (universe) { return function (element) { return universe.property().children(element).length === 0; }; };\n var before$1 = function (universe, item, isRoot) {\n return seekLeft$1(universe, item, isLeaf(universe), isRoot);\n };\n var after$2 = function (universe, item, isRoot) {\n return seekRight$1(universe, item, isLeaf(universe), isRoot);\n };\n var seekLeft$1 = left;\n var seekRight$1 = right;\n var universe = DomUniverse();\n var before = function (element, isRoot) {\n return before$1(universe, element, isRoot);\n };\n var after$1 = function (element, isRoot) {\n return after$2(universe, element, isRoot);\n };\n var seekLeft = function (element, predicate, isRoot) {\n return seekLeft$1(universe, element, predicate, isRoot);\n };\n var seekRight = function (element, predicate, isRoot) {\n return seekRight$1(universe, element, predicate, isRoot);\n };\n var ancestor = function (scope, predicate, isRoot) { return ancestor$2(scope, predicate, isRoot).isSome(); };\n var adt$2 = Adt.generate([\n { none: ['message'] },\n { success: [] },\n { failedUp: ['cell'] },\n { failedDown: ['cell'] }\n ]);\n var isOverlapping = function (bridge, before, after) {\n var beforeBounds = bridge.getRect(before);\n var afterBounds = bridge.getRect(after);\n return afterBounds.right > beforeBounds.left && afterBounds.left < beforeBounds.right;\n };\n var isRow = function (elem) {\n return closest$1(elem, 'tr');\n };\n var verify = function (bridge, before, beforeOffset, after, afterOffset, failure, isRoot) {\n return closest$1(after, 'td,th', isRoot).bind(function (afterCell) {\n return closest$1(before, 'td,th', isRoot).map(function (beforeCell) {\n if (!eq$1(afterCell, beforeCell)) {\n return sharedOne(isRow, [\n afterCell,\n beforeCell\n ]).fold(function () {\n return isOverlapping(bridge, beforeCell, afterCell) ? adt$2.success() : failure(beforeCell);\n }, function (_sharedRow) {\n return failure(beforeCell);\n });\n }\n else {\n return eq$1(after, afterCell) && getEnd(afterCell) === afterOffset ? failure(beforeCell) : adt$2.none('in same cell');\n }\n });\n }).getOr(adt$2.none('default'));\n };\n var cata = function (subject, onNone, onSuccess, onFailedUp, onFailedDown) {\n return subject.fold(onNone, onSuccess, onFailedUp, onFailedDown);\n };\n var BeforeAfter = __assign(__assign({}, adt$2), { verify: verify, cata: cata });\n var inParent = function (parent, children, element, index) { return ({\n parent: parent,\n children: children,\n element: element,\n index: index\n }); };\n var indexInParent = function (element) { return parent(element).bind(function (parent) {\n var children = children$2(parent);\n return indexOf(children, element).map(function (index) { return inParent(parent, children, element, index); });\n }); };\n var indexOf = function (elements, element) { return findIndex(elements, curry(eq$1, element)); };\n var isBr = isTag('br');\n var gatherer = function (cand, gather, isRoot) {\n return gather(cand, isRoot).bind(function (target) {\n return isText(target) && get$6(target).trim().length === 0 ? gatherer(target, gather, isRoot) : Optional.some(target);\n });\n };\n var handleBr = function (isRoot, element, direction) {\n return direction.traverse(element).orThunk(function () {\n return gatherer(element, direction.gather, isRoot);\n }).map(direction.relative);\n };\n var findBr = function (element, offset) {\n return child$2(element, offset).filter(isBr).orThunk(function () {\n return child$2(element, offset - 1).filter(isBr);\n });\n };\n var handleParent = function (isRoot, element, offset, direction) {\n return findBr(element, offset).bind(function (br) {\n return direction.traverse(br).fold(function () {\n return gatherer(br, direction.gather, isRoot).map(direction.relative);\n }, function (adjacent) {\n return indexInParent(adjacent).map(function (info) {\n return Situ.on(info.parent, info.index);\n });\n });\n });\n };\n var tryBr = function (isRoot, element, offset, direction) {\n var target = isBr(element) ? handleBr(isRoot, element, direction) : handleParent(isRoot, element, offset, direction);\n return target.map(function (tgt) {\n return {\n start: tgt,\n finish: tgt\n };\n });\n };\n var process = function (analysis) {\n return BeforeAfter.cata(analysis, function (_message) {\n return Optional.none();\n }, function () {\n return Optional.none();\n }, function (cell) {\n return Optional.some(point(cell, 0));\n }, function (cell) {\n return Optional.some(point(cell, getEnd(cell)));\n });\n };\n var moveDown = function (caret, amount) {\n return {\n left: caret.left,\n top: caret.top + amount,\n right: caret.right,\n bottom: caret.bottom + amount\n };\n };\n var moveUp = function (caret, amount) {\n return {\n left: caret.left,\n top: caret.top - amount,\n right: caret.right,\n bottom: caret.bottom - amount\n };\n };\n var translate = function (caret, xDelta, yDelta) {\n return {\n left: caret.left + xDelta,\n top: caret.top + yDelta,\n right: caret.right + xDelta,\n bottom: caret.bottom + yDelta\n };\n };\n var getTop = function (caret) {\n return caret.top;\n };\n var getBottom = function (caret) {\n return caret.bottom;\n };\n var getPartialBox = function (bridge, element, offset) {\n if (offset >= 0 && offset < getEnd(element)) {\n return bridge.getRangedRect(element, offset, element, offset + 1);\n }\n else if (offset > 0) {\n return bridge.getRangedRect(element, offset - 1, element, offset);\n }\n return Optional.none();\n };\n var toCaret = function (rect) { return ({\n left: rect.left,\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom\n }); };\n var getElemBox = function (bridge, element) {\n return Optional.some(bridge.getRect(element));\n };\n var getBoxAt = function (bridge, element, offset) {\n if (isElement(element)) {\n return getElemBox(bridge, element).map(toCaret);\n }\n else if (isText(element)) {\n return getPartialBox(bridge, element, offset).map(toCaret);\n }\n else {\n return Optional.none();\n }\n };\n var getEntireBox = function (bridge, element) {\n if (isElement(element)) {\n return getElemBox(bridge, element).map(toCaret);\n }\n else if (isText(element)) {\n return bridge.getRangedRect(element, 0, element, getEnd(element)).map(toCaret);\n }\n else {\n return Optional.none();\n }\n };\n var JUMP_SIZE = 5;\n var NUM_RETRIES = 100;\n var adt$1 = Adt.generate([\n { none: [] },\n { retry: ['caret'] }\n ]);\n var isOutside = function (caret, box) {\n return caret.left < box.left || Math.abs(box.right - caret.left) < 1 || caret.left > box.right;\n };\n var inOutsideBlock = function (bridge, element, caret) {\n return closest$2(element, isBlock).fold(never, function (cell) {\n return getEntireBox(bridge, cell).exists(function (box) {\n return isOutside(caret, box);\n });\n });\n };\n var adjustDown = function (bridge, element, guessBox, original, caret) {\n var lowerCaret = moveDown(caret, JUMP_SIZE);\n if (Math.abs(guessBox.bottom - original.bottom) < 1) {\n return adt$1.retry(lowerCaret);\n }\n else if (guessBox.top > caret.bottom) {\n return adt$1.retry(lowerCaret);\n }\n else if (guessBox.top === caret.bottom) {\n return adt$1.retry(moveDown(caret, 1));\n }\n else {\n return inOutsideBlock(bridge, element, caret) ? adt$1.retry(translate(lowerCaret, JUMP_SIZE, 0)) : adt$1.none();\n }\n };\n var adjustUp = function (bridge, element, guessBox, original, caret) {\n var higherCaret = moveUp(caret, JUMP_SIZE);\n if (Math.abs(guessBox.top - original.top) < 1) {\n return adt$1.retry(higherCaret);\n }\n else if (guessBox.bottom < caret.top) {\n return adt$1.retry(higherCaret);\n }\n else if (guessBox.bottom === caret.top) {\n return adt$1.retry(moveUp(caret, 1));\n }\n else {\n return inOutsideBlock(bridge, element, caret) ? adt$1.retry(translate(higherCaret, JUMP_SIZE, 0)) : adt$1.none();\n }\n };\n var upMovement = {\n point: getTop,\n adjuster: adjustUp,\n move: moveUp,\n gather: before\n };\n var downMovement = {\n point: getBottom,\n adjuster: adjustDown,\n move: moveDown,\n gather: after$1\n };\n var isAtTable = function (bridge, x, y) {\n return bridge.elementFromPoint(x, y).filter(function (elm) {\n return name(elm) === 'table';\n }).isSome();\n };\n var adjustForTable = function (bridge, movement, original, caret, numRetries) {\n return adjustTil(bridge, movement, original, movement.move(caret, JUMP_SIZE), numRetries);\n };\n var adjustTil = function (bridge, movement, original, caret, numRetries) {\n if (numRetries === 0) {\n return Optional.some(caret);\n }\n if (isAtTable(bridge, caret.left, movement.point(caret))) {\n return adjustForTable(bridge, movement, original, caret, numRetries - 1);\n }\n return bridge.situsFromPoint(caret.left, movement.point(caret)).bind(function (guess) {\n return guess.start.fold(Optional.none, function (element) {\n return getEntireBox(bridge, element).bind(function (guessBox) {\n return movement.adjuster(bridge, element, guessBox, original, caret).fold(Optional.none, function (newCaret) {\n return adjustTil(bridge, movement, original, newCaret, numRetries - 1);\n });\n }).orThunk(function () {\n return Optional.some(caret);\n });\n }, Optional.none);\n });\n };\n var checkScroll = function (movement, adjusted, bridge) {\n if (movement.point(adjusted) > bridge.getInnerHeight()) {\n return Optional.some(movement.point(adjusted) - bridge.getInnerHeight());\n }\n else if (movement.point(adjusted) < 0) {\n return Optional.some(-movement.point(adjusted));\n }\n else {\n return Optional.none();\n }\n };\n var retry = function (movement, bridge, caret) {\n var moved = movement.move(caret, JUMP_SIZE);\n var adjusted = adjustTil(bridge, movement, caret, moved, NUM_RETRIES).getOr(moved);\n return checkScroll(movement, adjusted, bridge).fold(function () {\n return bridge.situsFromPoint(adjusted.left, movement.point(adjusted));\n }, function (delta) {\n bridge.scrollBy(0, delta);\n return bridge.situsFromPoint(adjusted.left, movement.point(adjusted) - delta);\n });\n };\n var Retries = {\n tryUp: curry(retry, upMovement),\n tryDown: curry(retry, downMovement),\n getJumpSize: constant(JUMP_SIZE)\n };\n var MAX_RETRIES = 20;\n var findSpot = function (bridge, isRoot, direction) {\n return bridge.getSelection().bind(function (sel) {\n return tryBr(isRoot, sel.finish, sel.foffset, direction).fold(function () {\n return Optional.some(point(sel.finish, sel.foffset));\n }, function (brNeighbour) {\n var range = bridge.fromSitus(brNeighbour);\n var analysis = BeforeAfter.verify(bridge, sel.finish, sel.foffset, range.finish, range.foffset, direction.failure, isRoot);\n return process(analysis);\n });\n });\n };\n var scan = function (bridge, isRoot, element, offset, direction, numRetries) {\n if (numRetries === 0) {\n return Optional.none();\n }\n return tryCursor(bridge, isRoot, element, offset, direction).bind(function (situs) {\n var range = bridge.fromSitus(situs);\n var analysis = BeforeAfter.verify(bridge, element, offset, range.finish, range.foffset, direction.failure, isRoot);\n return BeforeAfter.cata(analysis, function () {\n return Optional.none();\n }, function () {\n return Optional.some(situs);\n }, function (cell) {\n if (eq$1(element, cell) && offset === 0) {\n return tryAgain(bridge, element, offset, moveUp, direction);\n }\n else {\n return scan(bridge, isRoot, cell, 0, direction, numRetries - 1);\n }\n }, function (cell) {\n if (eq$1(element, cell) && offset === getEnd(cell)) {\n return tryAgain(bridge, element, offset, moveDown, direction);\n }\n else {\n return scan(bridge, isRoot, cell, getEnd(cell), direction, numRetries - 1);\n }\n });\n });\n };\n var tryAgain = function (bridge, element, offset, move, direction) {\n return getBoxAt(bridge, element, offset).bind(function (box) {\n return tryAt(bridge, direction, move(box, Retries.getJumpSize()));\n });\n };\n var tryAt = function (bridge, direction, box) {\n var browser = detect$2().browser;\n if (browser.isChromium() || browser.isSafari() || browser.isFirefox()) {\n return direction.retry(bridge, box);\n }\n else {\n return Optional.none();\n }\n };\n var tryCursor = function (bridge, isRoot, element, offset, direction) {\n return getBoxAt(bridge, element, offset).bind(function (box) {\n return tryAt(bridge, direction, box);\n });\n };\n var handle$1 = function (bridge, isRoot, direction) {\n return findSpot(bridge, isRoot, direction).bind(function (spot) {\n return scan(bridge, isRoot, spot.element, spot.offset, direction, MAX_RETRIES).map(bridge.fromSitus);\n });\n };\n var inSameTable = function (elem, table) {\n return ancestor(elem, function (e) {\n return parent(e).exists(function (p) {\n return eq$1(p, table);\n });\n });\n };\n var simulate = function (bridge, isRoot, direction, initial, anchor) {\n return closest$1(initial, 'td,th', isRoot).bind(function (start) {\n return closest$1(start, 'table', isRoot).bind(function (table) {\n if (!inSameTable(anchor, table)) {\n return Optional.none();\n }\n return handle$1(bridge, isRoot, direction).bind(function (range) {\n return closest$1(range.finish, 'td,th', isRoot).map(function (finish) {\n return {\n start: start,\n finish: finish,\n range: range\n };\n });\n });\n });\n });\n };\n var navigate = function (bridge, isRoot, direction, initial, anchor, precheck) {\n return precheck(initial, isRoot).orThunk(function () {\n return simulate(bridge, isRoot, direction, initial, anchor).map(function (info) {\n var range = info.range;\n return Response.create(Optional.some(makeSitus(range.start, range.soffset, range.finish, range.foffset)), true);\n });\n });\n };\n var firstUpCheck = function (initial, isRoot) {\n return closest$1(initial, 'tr', isRoot).bind(function (startRow) {\n return closest$1(startRow, 'table', isRoot).bind(function (table) {\n var rows = descendants(table, 'tr');\n if (eq$1(startRow, rows[0])) {\n return seekLeft(table, function (element) {\n return last$1(element).isSome();\n }, isRoot).map(function (last) {\n var lastOffset = getEnd(last);\n return Response.create(Optional.some(makeSitus(last, lastOffset, last, lastOffset)), true);\n });\n }\n else {\n return Optional.none();\n }\n });\n });\n };\n var lastDownCheck = function (initial, isRoot) {\n return closest$1(initial, 'tr', isRoot).bind(function (startRow) {\n return closest$1(startRow, 'table', isRoot).bind(function (table) {\n var rows = descendants(table, 'tr');\n if (eq$1(startRow, rows[rows.length - 1])) {\n return seekRight(table, function (element) {\n return first(element).isSome();\n }, isRoot).map(function (first) {\n return Response.create(Optional.some(makeSitus(first, 0, first, 0)), true);\n });\n }\n else {\n return Optional.none();\n }\n });\n });\n };\n var select = function (bridge, container, isRoot, direction, initial, anchor, selectRange) {\n return simulate(bridge, isRoot, direction, initial, anchor).bind(function (info) {\n return detect(container, isRoot, info.start, info.finish, selectRange);\n });\n };\n var Cell = function (initial) {\n var value = initial;\n var get = function () {\n return value;\n };\n var set = function (v) {\n value = v;\n };\n return {\n get: get,\n set: set\n };\n };\n var singleton = function (doRevoke) {\n var subject = Cell(Optional.none());\n var revoke = function () { return subject.get().each(doRevoke); };\n var clear = function () {\n revoke();\n subject.set(Optional.none());\n };\n var isSet = function () { return subject.get().isSome(); };\n var get = function () { return subject.get(); };\n var set = function (s) {\n revoke();\n subject.set(Optional.some(s));\n };\n return {\n clear: clear,\n isSet: isSet,\n get: get,\n set: set\n };\n };\n var value = function () {\n var subject = singleton(noop);\n var on = function (f) { return subject.get().each(f); };\n return __assign(__assign({}, subject), { on: on });\n };\n var findCell = function (target, isRoot) { return closest$1(target, 'td,th', isRoot); };\n var isInEditableContext = function (cell) { return parentElement(cell).exists(isEditable$1); };\n var MouseSelection = function (bridge, container, isRoot, annotations) {\n var cursor = value();\n var clearstate = cursor.clear;\n var applySelection = function (event) {\n cursor.on(function (start) {\n annotations.clearBeforeUpdate(container);\n findCell(event.target, isRoot).each(function (finish) {\n identify(start, finish, isRoot).each(function (cellSel) {\n var boxes = cellSel.boxes.getOr([]);\n if (boxes.length === 1) {\n var singleCell = boxes[0];\n var isNonEditableCell = getRaw(singleCell) === 'false';\n var isCellClosestContentEditable = is(closest(event.target), singleCell, eq$1);\n if (isNonEditableCell && isCellClosestContentEditable) {\n annotations.selectRange(container, boxes, singleCell, singleCell);\n bridge.selectContents(singleCell);\n }\n }\n else if (boxes.length > 1) {\n annotations.selectRange(container, boxes, cellSel.start, cellSel.finish);\n bridge.selectContents(finish);\n }\n });\n });\n });\n };\n var mousedown = function (event) {\n annotations.clear(container);\n findCell(event.target, isRoot).filter(isInEditableContext).each(cursor.set);\n };\n var mouseover = function (event) {\n applySelection(event);\n };\n var mouseup = function (event) {\n applySelection(event);\n clearstate();\n };\n return {\n clearstate: clearstate,\n mousedown: mousedown,\n mouseover: mouseover,\n mouseup: mouseup\n };\n };\n var down = {\n traverse: nextSibling,\n gather: after$1,\n relative: Situ.before,\n retry: Retries.tryDown,\n failure: BeforeAfter.failedDown\n };\n var up = {\n traverse: prevSibling,\n gather: before,\n relative: Situ.before,\n retry: Retries.tryUp,\n failure: BeforeAfter.failedUp\n };\n var isKey = function (key) {\n return function (keycode) {\n return keycode === key;\n };\n };\n var isUp = isKey(38);\n var isDown = isKey(40);\n var isNavigation = function (keycode) {\n return keycode >= 37 && keycode <= 40;\n };\n var ltr = {\n isBackward: isKey(37),\n isForward: isKey(39)\n };\n var rtl = {\n isBackward: isKey(39),\n isForward: isKey(37)\n };\n var get$3 = function (_DOC) {\n var doc = _DOC !== undefined ? _DOC.dom : document;\n var x = doc.body.scrollLeft || doc.documentElement.scrollLeft;\n var y = doc.body.scrollTop || doc.documentElement.scrollTop;\n return SugarPosition(x, y);\n };\n var by = function (x, y, _DOC) {\n var doc = _DOC !== undefined ? _DOC.dom : document;\n var win = doc.defaultView;\n if (win) {\n win.scrollBy(x, y);\n }\n };\n var adt = Adt.generate([\n { domRange: ['rng'] },\n {\n relative: [\n 'startSitu',\n 'finishSitu'\n ]\n },\n {\n exact: [\n 'start',\n 'soffset',\n 'finish',\n 'foffset'\n ]\n }\n ]);\n var exactFromRange = function (simRange) { return adt.exact(simRange.start, simRange.soffset, simRange.finish, simRange.foffset); };\n var getStart = function (selection) { return selection.match({\n domRange: function (rng) { return SugarElement.fromDom(rng.startContainer); },\n relative: function (startSitu, _finishSitu) { return Situ.getStart(startSitu); },\n exact: function (start, _soffset, _finish, _foffset) { return start; }\n }); };\n var domRange = adt.domRange;\n var relative = adt.relative;\n var exact = adt.exact;\n var getWin = function (selection) {\n var start = getStart(selection);\n return defaultView(start);\n };\n var range = SimRange.create;\n var SimSelection = {\n domRange: domRange,\n relative: relative,\n exact: exact,\n exactFromRange: exactFromRange,\n getWin: getWin,\n range: range\n };\n var caretPositionFromPoint = function (doc, x, y) {\n var _a, _b;\n return Optional.from((_b = (_a = doc.dom).caretPositionFromPoint) === null || _b === void 0 ? void 0 : _b.call(_a, x, y)).bind(function (pos) {\n if (pos.offsetNode === null) {\n return Optional.none();\n }\n var r = doc.dom.createRange();\n r.setStart(pos.offsetNode, pos.offset);\n r.collapse();\n return Optional.some(r);\n });\n };\n var caretRangeFromPoint = function (doc, x, y) {\n var _a, _b;\n return Optional.from((_b = (_a = doc.dom).caretRangeFromPoint) === null || _b === void 0 ? void 0 : _b.call(_a, x, y));\n };\n var availableSearch = (function () {\n if (document.caretPositionFromPoint) {\n return caretPositionFromPoint;\n }\n else if (document.caretRangeFromPoint) {\n return caretRangeFromPoint;\n }\n else {\n return Optional.none;\n }\n })();\n var fromPoint = function (win, x, y) {\n var doc = SugarElement.fromDom(win.document);\n return availableSearch(doc, x, y).map(function (rng) { return SimRange.create(SugarElement.fromDom(rng.startContainer), rng.startOffset, SugarElement.fromDom(rng.endContainer), rng.endOffset); });\n };\n var beforeSpecial = function (element, offset) {\n var name$1 = name(element);\n if ('input' === name$1) {\n return Situ.after(element);\n }\n else if (!contains$2([\n 'br',\n 'img'\n ], name$1)) {\n return Situ.on(element, offset);\n }\n else {\n return offset === 0 ? Situ.before(element) : Situ.after(element);\n }\n };\n var preprocessRelative = function (startSitu, finishSitu) {\n var start = startSitu.fold(Situ.before, beforeSpecial, Situ.after);\n var finish = finishSitu.fold(Situ.before, beforeSpecial, Situ.after);\n return SimSelection.relative(start, finish);\n };\n var preprocessExact = function (start, soffset, finish, foffset) {\n var startSitu = beforeSpecial(start, soffset);\n var finishSitu = beforeSpecial(finish, foffset);\n return SimSelection.relative(startSitu, finishSitu);\n };\n var makeRange = function (start, soffset, finish, foffset) {\n var doc = owner(start);\n var rng = doc.dom.createRange();\n rng.setStart(start.dom, soffset);\n rng.setEnd(finish.dom, foffset);\n return rng;\n };\n var after = function (start, soffset, finish, foffset) {\n var r = makeRange(start, soffset, finish, foffset);\n var same = eq$1(start, finish) && soffset === foffset;\n return r.collapsed && !same;\n };\n var getNativeSelection = function (win) { return Optional.from(win.getSelection()); };\n var doSetNativeRange = function (win, rng) {\n getNativeSelection(win).each(function (selection) {\n selection.removeAllRanges();\n selection.addRange(rng);\n });\n };\n var doSetRange = function (win, start, soffset, finish, foffset) {\n var rng = exactToNative(win, start, soffset, finish, foffset);\n doSetNativeRange(win, rng);\n };\n var setLegacyRtlRange = function (win, selection, start, soffset, finish, foffset) {\n selection.collapse(start.dom, soffset);\n selection.extend(finish.dom, foffset);\n };\n var setRangeFromRelative = function (win, relative) { return diagnose(win, relative).match({\n ltr: function (start, soffset, finish, foffset) {\n doSetRange(win, start, soffset, finish, foffset);\n },\n rtl: function (start, soffset, finish, foffset) {\n getNativeSelection(win).each(function (selection) {\n if (selection.setBaseAndExtent) {\n selection.setBaseAndExtent(start.dom, soffset, finish.dom, foffset);\n }\n else if (selection.extend) {\n try {\n setLegacyRtlRange(win, selection, start, soffset, finish, foffset);\n }\n catch (e) {\n doSetRange(win, finish, foffset, start, soffset);\n }\n }\n else {\n doSetRange(win, finish, foffset, start, soffset);\n }\n });\n }\n }); };\n var setExact = function (win, start, soffset, finish, foffset) {\n var relative = preprocessExact(start, soffset, finish, foffset);\n setRangeFromRelative(win, relative);\n };\n var setRelative = function (win, startSitu, finishSitu) {\n var relative = preprocessRelative(startSitu, finishSitu);\n setRangeFromRelative(win, relative);\n };\n var readRange = function (selection) {\n if (selection.rangeCount > 0) {\n var firstRng = selection.getRangeAt(0);\n var lastRng = selection.getRangeAt(selection.rangeCount - 1);\n return Optional.some(SimRange.create(SugarElement.fromDom(firstRng.startContainer), firstRng.startOffset, SugarElement.fromDom(lastRng.endContainer), lastRng.endOffset));\n }\n else {\n return Optional.none();\n }\n };\n var doGetExact = function (selection) {\n if (selection.anchorNode === null || selection.focusNode === null) {\n return readRange(selection);\n }\n else {\n var anchor = SugarElement.fromDom(selection.anchorNode);\n var focus_1 = SugarElement.fromDom(selection.focusNode);\n return after(anchor, selection.anchorOffset, focus_1, selection.focusOffset) ? Optional.some(SimRange.create(anchor, selection.anchorOffset, focus_1, selection.focusOffset)) : readRange(selection);\n }\n };\n var setToElement = function (win, element, selectNodeContents$1) {\n if (selectNodeContents$1 === void 0) { selectNodeContents$1 = true; }\n var rngGetter = selectNodeContents$1 ? selectNodeContents : selectNode;\n var rng = rngGetter(win, element);\n doSetNativeRange(win, rng);\n };\n var getExact = function (win) { return getNativeSelection(win).filter(function (sel) { return sel.rangeCount > 0; }).bind(doGetExact); };\n var get$2 = function (win) { return getExact(win).map(function (range) { return SimSelection.exact(range.start, range.soffset, range.finish, range.foffset); }); };\n var getFirstRect = function (win, selection) {\n var rng = asLtrRange(win, selection);\n return getFirstRect$1(rng);\n };\n var getAtPoint = function (win, x, y) { return fromPoint(win, x, y); };\n var clear = function (win) {\n getNativeSelection(win).each(function (selection) { return selection.removeAllRanges(); });\n };\n var WindowBridge = function (win) {\n var elementFromPoint = function (x, y) {\n return SugarElement.fromPoint(SugarElement.fromDom(win.document), x, y);\n };\n var getRect = function (element) {\n return element.dom.getBoundingClientRect();\n };\n var getRangedRect = function (start, soffset, finish, foffset) {\n var sel = SimSelection.exact(start, soffset, finish, foffset);\n return getFirstRect(win, sel);\n };\n var getSelection = function () {\n return get$2(win).map(function (exactAdt) {\n return convertToRange(win, exactAdt);\n });\n };\n var fromSitus = function (situs) {\n var relative = SimSelection.relative(situs.start, situs.finish);\n return convertToRange(win, relative);\n };\n var situsFromPoint = function (x, y) {\n return getAtPoint(win, x, y).map(function (exact) {\n return Situs.create(exact.start, exact.soffset, exact.finish, exact.foffset);\n });\n };\n var clearSelection = function () {\n clear(win);\n };\n var collapseSelection = function (toStart) {\n if (toStart === void 0) { toStart = false; }\n get$2(win).each(function (sel) { return sel.fold(function (rng) { return rng.collapse(toStart); }, function (startSitu, finishSitu) {\n var situ = toStart ? startSitu : finishSitu;\n setRelative(win, situ, situ);\n }, function (start, soffset, finish, foffset) {\n var node = toStart ? start : finish;\n var offset = toStart ? soffset : foffset;\n setExact(win, node, offset, node, offset);\n }); });\n };\n var selectNode = function (element) {\n setToElement(win, element, false);\n };\n var selectContents = function (element) {\n setToElement(win, element);\n };\n var setSelection = function (sel) {\n setExact(win, sel.start, sel.soffset, sel.finish, sel.foffset);\n };\n var setRelativeSelection = function (start, finish) {\n setRelative(win, start, finish);\n };\n var getInnerHeight = function () {\n return win.innerHeight;\n };\n var getScrollY = function () {\n var pos = get$3(SugarElement.fromDom(win.document));\n return pos.top;\n };\n var scrollBy = function (x, y) {\n by(x, y, SugarElement.fromDom(win.document));\n };\n return {\n elementFromPoint: elementFromPoint,\n getRect: getRect,\n getRangedRect: getRangedRect,\n getSelection: getSelection,\n fromSitus: fromSitus,\n situsFromPoint: situsFromPoint,\n clearSelection: clearSelection,\n collapseSelection: collapseSelection,\n setSelection: setSelection,\n setRelativeSelection: setRelativeSelection,\n selectNode: selectNode,\n selectContents: selectContents,\n getInnerHeight: getInnerHeight,\n getScrollY: getScrollY,\n scrollBy: scrollBy\n };\n };\n var rc = function (rows, cols) { return ({\n rows: rows,\n cols: cols\n }); };\n var mouse = function (win, container, isRoot, annotations) {\n var bridge = WindowBridge(win);\n var handlers = MouseSelection(bridge, container, isRoot, annotations);\n return {\n clearstate: handlers.clearstate,\n mousedown: handlers.mousedown,\n mouseover: handlers.mouseover,\n mouseup: handlers.mouseup\n };\n };\n var isEditableNode = function (node) { return closest$2(node, isHTMLElement).exists(isEditable$1); };\n var isEditableSelection = function (start, finish) { return isEditableNode(start) || isEditableNode(finish); };\n var keyboard = function (win, container, isRoot, annotations) {\n var bridge = WindowBridge(win);\n var clearToNavigate = function () {\n annotations.clear(container);\n return Optional.none();\n };\n var keydown = function (event, start, soffset, finish, foffset, direction) {\n var realEvent = event.raw;\n var keycode = realEvent.which;\n var shiftKey = realEvent.shiftKey === true;\n var handler = retrieve$1(container, annotations.selectedSelector).fold(function () {\n if (isNavigation(keycode) && !shiftKey) {\n annotations.clearBeforeUpdate(container);\n }\n if (isNavigation(keycode) && shiftKey && !isEditableSelection(start, finish)) {\n return Optional.none;\n }\n else if (isDown(keycode) && shiftKey) {\n return curry(select, bridge, container, isRoot, down, finish, start, annotations.selectRange);\n }\n else if (isUp(keycode) && shiftKey) {\n return curry(select, bridge, container, isRoot, up, finish, start, annotations.selectRange);\n }\n else if (isDown(keycode)) {\n return curry(navigate, bridge, isRoot, down, finish, start, lastDownCheck);\n }\n else if (isUp(keycode)) {\n return curry(navigate, bridge, isRoot, up, finish, start, firstUpCheck);\n }\n else {\n return Optional.none;\n }\n }, function (selected) {\n var update$1 = function (attempts) {\n return function () {\n var navigation = findMap(attempts, function (delta) {\n return update(delta.rows, delta.cols, container, selected, annotations);\n });\n return navigation.fold(function () {\n return getEdges(container, annotations.firstSelectedSelector, annotations.lastSelectedSelector).map(function (edges) {\n var relative = isDown(keycode) || direction.isForward(keycode) ? Situ.after : Situ.before;\n bridge.setRelativeSelection(Situ.on(edges.first, 0), relative(edges.table));\n annotations.clear(container);\n return Response.create(Optional.none(), true);\n });\n }, function (_) {\n return Optional.some(Response.create(Optional.none(), true));\n });\n };\n };\n if (isNavigation(keycode) && shiftKey && !isEditableSelection(start, finish)) {\n return Optional.none;\n }\n else if (isDown(keycode) && shiftKey) {\n return update$1([rc(+1, 0)]);\n }\n else if (isUp(keycode) && shiftKey) {\n return update$1([rc(-1, 0)]);\n }\n else if (direction.isBackward(keycode) && shiftKey) {\n return update$1([\n rc(0, -1),\n rc(-1, 0)\n ]);\n }\n else if (direction.isForward(keycode) && shiftKey) {\n return update$1([\n rc(0, +1),\n rc(+1, 0)\n ]);\n }\n else if (isNavigation(keycode) && !shiftKey) {\n return clearToNavigate;\n }\n else {\n return Optional.none;\n }\n });\n return handler();\n };\n var keyup = function (event, start, soffset, finish, foffset) {\n return retrieve$1(container, annotations.selectedSelector).fold(function () {\n var realEvent = event.raw;\n var keycode = realEvent.which;\n var shiftKey = realEvent.shiftKey === true;\n if (!shiftKey) {\n return Optional.none();\n }\n if (isNavigation(keycode) && isEditableSelection(start, finish)) {\n return sync(container, isRoot, start, soffset, finish, foffset, annotations.selectRange);\n }\n else {\n return Optional.none();\n }\n }, Optional.none);\n };\n return {\n keydown: keydown,\n keyup: keyup\n };\n };\n var external = function (win, container, isRoot, annotations) {\n var bridge = WindowBridge(win);\n return function (start, finish) {\n annotations.clearBeforeUpdate(container);\n identify(start, finish, isRoot).each(function (cellSel) {\n var boxes = cellSel.boxes.getOr([]);\n annotations.selectRange(container, boxes, cellSel.start, cellSel.finish);\n bridge.selectContents(finish);\n bridge.collapseSelection();\n });\n };\n };\n var read = function (element, attr) {\n var value = get$b(element, attr);\n return value === undefined || value === '' ? [] : value.split(' ');\n };\n var add$2 = function (element, attr, id) {\n var old = read(element, attr);\n var nu = old.concat([id]);\n set$2(element, attr, nu.join(' '));\n return true;\n };\n var remove$4 = function (element, attr, id) {\n var nu = filter$2(read(element, attr), function (v) { return v !== id; });\n if (nu.length > 0) {\n set$2(element, attr, nu.join(' '));\n }\n else {\n remove$7(element, attr);\n }\n return false;\n };\n var supports = function (element) { return element.dom.classList !== undefined; };\n var get$1 = function (element) { return read(element, 'class'); };\n var add$1 = function (element, clazz) { return add$2(element, 'class', clazz); };\n var remove$3 = function (element, clazz) { return remove$4(element, 'class', clazz); };\n var add = function (element, clazz) {\n if (supports(element)) {\n element.dom.classList.add(clazz);\n }\n else {\n add$1(element, clazz);\n }\n };\n var cleanClass = function (element) {\n var classList = supports(element) ? element.dom.classList : get$1(element);\n if (classList.length === 0) {\n remove$7(element, 'class');\n }\n };\n var remove$2 = function (element, clazz) {\n if (supports(element)) {\n var classList = element.dom.classList;\n classList.remove(clazz);\n }\n else {\n remove$3(element, clazz);\n }\n cleanClass(element);\n };\n var has = function (element, clazz) { return supports(element) && element.dom.classList.contains(clazz); };\n var remove$1 = function (element, classes) {\n each$2(classes, function (x) {\n remove$2(element, x);\n });\n };\n var addClass = function (clazz) { return function (element) {\n add(element, clazz);\n }; };\n var removeClasses = function (classes) { return function (element) {\n remove$1(element, classes);\n }; };\n var byClass = function (ephemera) {\n var addSelectionClass = addClass(ephemera.selected);\n var removeSelectionClasses = removeClasses([\n ephemera.selected,\n ephemera.lastSelected,\n ephemera.firstSelected\n ]);\n var clear = function (container) {\n var sels = descendants(container, ephemera.selectedSelector);\n each$2(sels, removeSelectionClasses);\n };\n var selectRange = function (container, cells, start, finish) {\n clear(container);\n each$2(cells, addSelectionClass);\n add(start, ephemera.firstSelected);\n add(finish, ephemera.lastSelected);\n };\n return {\n clearBeforeUpdate: clear,\n clear: clear,\n selectRange: selectRange,\n selectedSelector: ephemera.selectedSelector,\n firstSelectedSelector: ephemera.firstSelectedSelector,\n lastSelectedSelector: ephemera.lastSelectedSelector\n };\n };\n var byAttr = function (ephemera, onSelection, onClear) {\n var removeSelectionAttributes = function (element) {\n remove$7(element, ephemera.selected);\n remove$7(element, ephemera.firstSelected);\n remove$7(element, ephemera.lastSelected);\n };\n var addSelectionAttribute = function (element) {\n set$2(element, ephemera.selected, '1');\n };\n var clear = function (container) {\n clearBeforeUpdate(container);\n onClear();\n };\n var clearBeforeUpdate = function (container) {\n var sels = descendants(container, \"\".concat(ephemera.selectedSelector, \",\").concat(ephemera.firstSelectedSelector, \",\").concat(ephemera.lastSelectedSelector));\n each$2(sels, removeSelectionAttributes);\n };\n var selectRange = function (container, cells, start, finish) {\n clear(container);\n each$2(cells, addSelectionAttribute);\n set$2(start, ephemera.firstSelected, '1');\n set$2(finish, ephemera.lastSelected, '1');\n onSelection(cells, start, finish);\n };\n return {\n clearBeforeUpdate: clearBeforeUpdate,\n clear: clear,\n selectRange: selectRange,\n selectedSelector: ephemera.selectedSelector,\n firstSelectedSelector: ephemera.firstSelectedSelector,\n lastSelectedSelector: ephemera.lastSelectedSelector\n };\n };\n var SelectionAnnotation = {\n byClass: byClass,\n byAttr: byAttr\n };\n var fold = function (subject, onNone, onMultiple, onSingle) {\n switch (subject.tag) {\n case 'none':\n return onNone();\n case 'single':\n return onSingle(subject.element);\n case 'multiple':\n return onMultiple(subject.elements);\n }\n };\n var none = function () { return ({ tag: 'none' }); };\n var multiple = function (elements) { return ({\n tag: 'multiple',\n elements: elements\n }); };\n var single = function (element) { return ({\n tag: 'single',\n element: element\n }); };\n var Selections = function (lazyRoot, getStart, selectedSelector) {\n var get = function () { return retrieve(lazyRoot(), selectedSelector).fold(function () { return getStart().fold(none, single); }, multiple); };\n return { get: get };\n };\n var getUpOrLeftCells = function (grid, selectedCells) {\n var upGrid = grid.slice(0, selectedCells[selectedCells.length - 1].row + 1);\n var upDetails = toDetailList(upGrid);\n return bind$2(upDetails, function (detail) {\n var slicedCells = detail.cells.slice(0, selectedCells[selectedCells.length - 1].column + 1);\n return map$1(slicedCells, function (cell) { return cell.element; });\n });\n };\n var getDownOrRightCells = function (grid, selectedCells) {\n var downGrid = grid.slice(selectedCells[0].row + selectedCells[0].rowspan - 1, grid.length);\n var downDetails = toDetailList(downGrid);\n return bind$2(downDetails, function (detail) {\n var slicedCells = detail.cells.slice(selectedCells[0].column + selectedCells[0].colspan - 1, detail.cells.length);\n return map$1(slicedCells, function (cell) { return cell.element; });\n });\n };\n var getOtherCells = function (table, target, generators) {\n var warehouse = Warehouse.fromTable(table);\n var details = onCells(warehouse, target);\n return details.map(function (selectedCells) {\n var grid = toGrid(warehouse, generators, false);\n var rows = extractGridDetails(grid).rows;\n var upOrLeftCells = getUpOrLeftCells(rows, selectedCells);\n var downOrRightCells = getDownOrRightCells(rows, selectedCells);\n return {\n upOrLeftCells: upOrLeftCells,\n downOrRightCells: downOrRightCells\n };\n });\n };\n var mkEvent = function (target, x, y, stop, prevent, kill, raw) { return ({\n target: target,\n x: x,\n y: y,\n stop: stop,\n prevent: prevent,\n kill: kill,\n raw: raw\n }); };\n var fromRawEvent$1 = function (rawEvent) {\n var target = SugarElement.fromDom(getOriginalEventTarget(rawEvent).getOr(rawEvent.target));\n var stop = function () { return rawEvent.stopPropagation(); };\n var prevent = function () { return rawEvent.preventDefault(); };\n var kill = compose(prevent, stop);\n return mkEvent(target, rawEvent.clientX, rawEvent.clientY, stop, prevent, kill, rawEvent);\n };\n var handle = function (filter, handler) { return function (rawEvent) {\n if (filter(rawEvent)) {\n handler(fromRawEvent$1(rawEvent));\n }\n }; };\n var binder = function (element, event, filter, handler, useCapture) {\n var wrapped = handle(filter, handler);\n element.dom.addEventListener(event, wrapped, useCapture);\n return { unbind: curry(unbind, element, event, wrapped, useCapture) };\n };\n var bind$1 = function (element, event, filter, handler) { return binder(element, event, filter, handler, false); };\n var unbind = function (element, event, handler, useCapture) {\n element.dom.removeEventListener(event, handler, useCapture);\n };\n var filter = always;\n var bind = function (element, event, handler) { return bind$1(element, event, filter, handler); };\n var fromRawEvent = fromRawEvent$1;\n var hasInternalTarget = function (e) { return !has(SugarElement.fromDom(e.target), 'ephox-snooker-resizer-bar'); };\n var TableCellSelectionHandler = function (editor, resizeHandler) {\n var cellSelection = Selections(function () { return SugarElement.fromDom(editor.getBody()); }, function () { return getSelectionCell(getSelectionStart(editor), getIsRoot(editor)); }, ephemera.selectedSelector);\n var onSelection = function (cells, start, finish) {\n var tableOpt = table(start);\n tableOpt.each(function (table) {\n var cloneFormats = getTableCloneElements(editor);\n var generators = cellOperations(noop, SugarElement.fromDom(editor.getDoc()), cloneFormats);\n var selectedCells = getCellsFromSelection(editor);\n var otherCells = getOtherCells(table, { selection: selectedCells }, generators);\n fireTableSelectionChange(editor, cells, start, finish, otherCells);\n });\n };\n var onClear = function () { return fireTableSelectionClear(editor); };\n var annotations = SelectionAnnotation.byAttr(ephemera, onSelection, onClear);\n editor.on('init', function (_e) {\n var win = editor.getWin();\n var body = getBody(editor);\n var isRoot = getIsRoot(editor);\n var syncSelection = function () {\n var sel = editor.selection;\n var start = SugarElement.fromDom(sel.getStart());\n var end = SugarElement.fromDom(sel.getEnd());\n var shared = sharedOne(table, [\n start,\n end\n ]);\n shared.fold(function () { return annotations.clear(body); }, noop);\n };\n var mouseHandlers = mouse(win, body, isRoot, annotations);\n var keyHandlers = keyboard(win, body, isRoot, annotations);\n var external$1 = external(win, body, isRoot, annotations);\n var hasShiftKey = function (event) { return event.raw.shiftKey === true; };\n editor.on('TableSelectorChange', function (e) { return external$1(e.start, e.finish); });\n var handleResponse = function (event, response) {\n if (!hasShiftKey(event)) {\n return;\n }\n if (response.kill) {\n event.kill();\n }\n response.selection.each(function (ns) {\n var relative = SimSelection.relative(ns.start, ns.finish);\n var rng = asLtrRange(win, relative);\n editor.selection.setRng(rng);\n });\n };\n var keyup = function (event) {\n var wrappedEvent = fromRawEvent(event);\n if (wrappedEvent.raw.shiftKey && isNavigation(wrappedEvent.raw.which)) {\n var rng = editor.selection.getRng();\n var start = SugarElement.fromDom(rng.startContainer);\n var end = SugarElement.fromDom(rng.endContainer);\n keyHandlers.keyup(wrappedEvent, start, rng.startOffset, end, rng.endOffset).each(function (response) {\n handleResponse(wrappedEvent, response);\n });\n }\n };\n var keydown = function (event) {\n var wrappedEvent = fromRawEvent(event);\n resizeHandler.hide();\n var rng = editor.selection.getRng();\n var start = SugarElement.fromDom(rng.startContainer);\n var end = SugarElement.fromDom(rng.endContainer);\n var direction = onDirection(ltr, rtl)(SugarElement.fromDom(editor.selection.getStart()));\n keyHandlers.keydown(wrappedEvent, start, rng.startOffset, end, rng.endOffset, direction).each(function (response) {\n handleResponse(wrappedEvent, response);\n });\n resizeHandler.show();\n };\n var isLeftMouse = function (raw) { return raw.button === 0; };\n var isLeftButtonPressed = function (raw) {\n if (raw.buttons === undefined) {\n return true;\n }\n return (raw.buttons & 1) !== 0;\n };\n var dragStart = function (_e) {\n mouseHandlers.clearstate();\n };\n var mouseDown = function (e) {\n if (isLeftMouse(e) && hasInternalTarget(e)) {\n mouseHandlers.mousedown(fromRawEvent(e));\n }\n };\n var mouseOver = function (e) {\n if (isLeftButtonPressed(e) && hasInternalTarget(e)) {\n mouseHandlers.mouseover(fromRawEvent(e));\n }\n };\n var mouseUp = function (e) {\n if (isLeftMouse(e) && hasInternalTarget(e)) {\n mouseHandlers.mouseup(fromRawEvent(e));\n }\n };\n var getDoubleTap = function () {\n var lastTarget = Cell(SugarElement.fromDom(body));\n var lastTimeStamp = Cell(0);\n var touchEnd = function (t) {\n var target = SugarElement.fromDom(t.target);\n if (isTag('td')(target) || isTag('th')(target)) {\n var lT = lastTarget.get();\n var lTS = lastTimeStamp.get();\n if (eq$1(lT, target) && t.timeStamp - lTS < 300) {\n t.preventDefault();\n external$1(target, target);\n }\n }\n lastTarget.set(target);\n lastTimeStamp.set(t.timeStamp);\n };\n return { touchEnd: touchEnd };\n };\n var doubleTap = getDoubleTap();\n editor.on('dragstart', dragStart);\n editor.on('mousedown', mouseDown);\n editor.on('mouseover', mouseOver);\n editor.on('mouseup', mouseUp);\n editor.on('touchend', doubleTap.touchEnd);\n editor.on('keyup', keyup);\n editor.on('keydown', keydown);\n editor.on('NodeChange', syncSelection);\n });\n editor.on('PreInit', function () {\n editor.serializer.addTempAttr(ephemera.firstSelected);\n editor.serializer.addTempAttr(ephemera.lastSelected);\n });\n var clearSelectedCells = function (container) { return annotations.clear(SugarElement.fromDom(container)); };\n var getSelectedCells = function () { return fold(cellSelection.get(), constant([]), function (cells) {\n return map$1(cells, function (cell) { return cell.dom; });\n }, function (cell) { return [cell.dom]; }); };\n return {\n getSelectedCells: getSelectedCells,\n clearSelectedCells: clearSelectedCells\n };\n };\n var Event = function (fields) {\n var handlers = [];\n var bind = function (handler) {\n if (handler === undefined) {\n throw new Error('Event bind error: undefined handler');\n }\n handlers.push(handler);\n };\n var unbind = function (handler) {\n handlers = filter$2(handlers, function (h) {\n return h !== handler;\n });\n };\n var trigger = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var event = {};\n each$2(fields, function (name, i) {\n event[name] = args[i];\n });\n each$2(handlers, function (handler) {\n handler(event);\n });\n };\n return {\n bind: bind,\n unbind: unbind,\n trigger: trigger\n };\n };\n var create$1 = function (typeDefs) {\n var registry = map(typeDefs, function (event) {\n return {\n bind: event.bind,\n unbind: event.unbind\n };\n });\n var trigger = map(typeDefs, function (event) {\n return event.trigger;\n });\n return {\n registry: registry,\n trigger: trigger\n };\n };\n var last = function (fn, rate) {\n var timer = null;\n var cancel = function () {\n if (!isNull(timer)) {\n clearTimeout(timer);\n timer = null;\n }\n };\n var throttle = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n cancel();\n timer = setTimeout(function () {\n timer = null;\n fn.apply(null, args);\n }, rate);\n };\n return {\n cancel: cancel,\n throttle: throttle\n };\n };\n var sort = function (arr) {\n return arr.slice(0).sort();\n };\n var reqMessage = function (required, keys) {\n throw new Error('All required keys (' + sort(required).join(', ') + ') were not specified. Specified keys were: ' + sort(keys).join(', ') + '.');\n };\n var unsuppMessage = function (unsupported) {\n throw new Error('Unsupported keys for object: ' + sort(unsupported).join(', '));\n };\n var validateStrArr = function (label, array) {\n if (!isArray(array)) {\n throw new Error('The ' + label + ' fields must be an array. Was: ' + array + '.');\n }\n each$2(array, function (a) {\n if (!isString(a)) {\n throw new Error('The value ' + a + ' in the ' + label + ' fields was not a string.');\n }\n });\n };\n var invalidTypeMessage = function (incorrect, type) {\n throw new Error('All values need to be of type: ' + type + '. Keys (' + sort(incorrect).join(', ') + ') were not.');\n };\n var checkDupes = function (everything) {\n var sorted = sort(everything);\n var dupe = find$1(sorted, function (s, i) {\n return i < sorted.length - 1 && s === sorted[i + 1];\n });\n dupe.each(function (d) {\n throw new Error('The field: ' + d + ' occurs more than once in the combined fields: [' + sorted.join(', ') + '].');\n });\n };\n var base = function (handleUnsupported, required) {\n return baseWith(handleUnsupported, required, {\n validate: isFunction,\n label: 'function'\n });\n };\n var baseWith = function (handleUnsupported, required, pred) {\n if (required.length === 0) {\n throw new Error('You must specify at least one required field.');\n }\n validateStrArr('required', required);\n checkDupes(required);\n return function (obj) {\n var keys$1 = keys(obj);\n var allReqd = forall(required, function (req) {\n return contains$2(keys$1, req);\n });\n if (!allReqd) {\n reqMessage(required, keys$1);\n }\n handleUnsupported(required, keys$1);\n var invalidKeys = filter$2(required, function (key) {\n return !pred.validate(obj[key], key);\n });\n if (invalidKeys.length > 0) {\n invalidTypeMessage(invalidKeys, pred.label);\n }\n return obj;\n };\n };\n var handleExact = function (required, keys) {\n var unsupported = filter$2(keys, function (key) {\n return !contains$2(required, key);\n });\n if (unsupported.length > 0) {\n unsuppMessage(unsupported);\n }\n };\n var exactly = function (required) { return base(handleExact, required); };\n var DragMode = exactly([\n 'compare',\n 'extract',\n 'mutate',\n 'sink'\n ]);\n var DragSink = exactly([\n 'element',\n 'start',\n 'stop',\n 'destroy'\n ]);\n var DragApi = exactly([\n 'forceDrop',\n 'drop',\n 'move',\n 'delayDrop'\n ]);\n var InDrag = function () {\n var previous = Optional.none();\n var reset = function () {\n previous = Optional.none();\n };\n var update = function (mode, nu) {\n var result = previous.map(function (old) {\n return mode.compare(old, nu);\n });\n previous = Optional.some(nu);\n return result;\n };\n var onEvent = function (event, mode) {\n var dataOption = mode.extract(event);\n dataOption.each(function (data) {\n var offset = update(mode, data);\n offset.each(function (d) {\n events.trigger.move(d);\n });\n });\n };\n var events = create$1({ move: Event(['info']) });\n return {\n onEvent: onEvent,\n reset: reset,\n events: events.registry\n };\n };\n var NoDrag = function () {\n var events = create$1({ move: Event(['info']) });\n return {\n onEvent: noop,\n reset: noop,\n events: events.registry\n };\n };\n var Movement = function () {\n var noDragState = NoDrag();\n var inDragState = InDrag();\n var dragState = noDragState;\n var on = function () {\n dragState.reset();\n dragState = inDragState;\n };\n var off = function () {\n dragState.reset();\n dragState = noDragState;\n };\n var onEvent = function (event, mode) {\n dragState.onEvent(event, mode);\n };\n var isOn = function () {\n return dragState === inDragState;\n };\n return {\n on: on,\n off: off,\n isOn: isOn,\n onEvent: onEvent,\n events: inDragState.events\n };\n };\n var setup = function (mutation, mode, settings) {\n var active = false;\n var events = create$1({\n start: Event([]),\n stop: Event([])\n });\n var movement = Movement();\n var drop = function () {\n sink.stop();\n if (movement.isOn()) {\n movement.off();\n events.trigger.stop();\n }\n };\n var throttledDrop = last(drop, 200);\n var go = function (parent) {\n sink.start(parent);\n movement.on();\n events.trigger.start();\n };\n var mousemove = function (event) {\n throttledDrop.cancel();\n movement.onEvent(event, mode);\n };\n movement.events.move.bind(function (event) {\n mode.mutate(mutation, event.info);\n });\n var on = function () {\n active = true;\n };\n var off = function () {\n active = false;\n };\n var isActive = function () { return active; };\n var runIfActive = function (f) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (active) {\n f.apply(null, args);\n }\n };\n };\n var sink = mode.sink(DragApi({\n forceDrop: drop,\n drop: runIfActive(drop),\n move: runIfActive(mousemove),\n delayDrop: runIfActive(throttledDrop.throttle)\n }), settings);\n var destroy = function () {\n sink.destroy();\n };\n return {\n element: sink.element,\n go: go,\n on: on,\n off: off,\n isActive: isActive,\n destroy: destroy,\n events: events.registry\n };\n };\n var css = function (namespace) {\n var dashNamespace = namespace.replace(/\\./g, '-');\n var resolve = function (str) {\n return dashNamespace + '-' + str;\n };\n return { resolve: resolve };\n };\n var styles$1 = css('ephox-dragster');\n var resolve$1 = styles$1.resolve;\n var Blocker = function (options) {\n var settings = __assign({ layerClass: resolve$1('blocker') }, options);\n var div = SugarElement.fromTag('div');\n set$2(div, 'role', 'presentation');\n setAll(div, {\n position: 'fixed',\n left: '0px',\n top: '0px',\n width: '100%',\n height: '100%'\n });\n add(div, resolve$1('blocker'));\n add(div, settings.layerClass);\n var element = constant(div);\n var destroy = function () {\n remove$6(div);\n };\n return {\n element: element,\n destroy: destroy\n };\n };\n var compare = function (old, nu) {\n return SugarPosition(nu.left - old.left, nu.top - old.top);\n };\n var extract = function (event) {\n return Optional.some(SugarPosition(event.x, event.y));\n };\n var mutate = function (mutation, info) {\n mutation.mutate(info.left, info.top);\n };\n var sink = function (dragApi, settings) {\n var blocker = Blocker(settings);\n var mdown = bind(blocker.element(), 'mousedown', dragApi.forceDrop);\n var mup = bind(blocker.element(), 'mouseup', dragApi.drop);\n var mmove = bind(blocker.element(), 'mousemove', dragApi.move);\n var mout = bind(blocker.element(), 'mouseout', dragApi.delayDrop);\n var destroy = function () {\n blocker.destroy();\n mup.unbind();\n mmove.unbind();\n mout.unbind();\n mdown.unbind();\n };\n var start = function (parent) {\n append$1(parent, blocker.element());\n };\n var stop = function () {\n remove$6(blocker.element());\n };\n return DragSink({\n element: blocker.element,\n start: start,\n stop: stop,\n destroy: destroy\n });\n };\n var MouseDrag = DragMode({\n compare: compare,\n extract: extract,\n sink: sink,\n mutate: mutate\n });\n var transform = function (mutation, settings) {\n if (settings === void 0) { settings = {}; }\n var _a;\n var mode = (_a = settings.mode) !== null && _a !== void 0 ? _a : MouseDrag;\n return setup(mutation, mode, settings);\n };\n var styles = css('ephox-snooker');\n var resolve = styles.resolve;\n var Mutation = function () {\n var events = create$1({\n drag: Event([\n 'xDelta',\n 'yDelta'\n ])\n });\n var mutate = function (x, y) {\n events.trigger.drag(x, y);\n };\n return {\n mutate: mutate,\n events: events.registry\n };\n };\n var BarMutation = function () {\n var events = create$1({\n drag: Event([\n 'xDelta',\n 'yDelta',\n 'target'\n ])\n });\n var target = Optional.none();\n var delegate = Mutation();\n delegate.events.drag.bind(function (event) {\n target.each(function (t) {\n events.trigger.drag(event.xDelta, event.yDelta, t);\n });\n });\n var assign = function (t) {\n target = Optional.some(t);\n };\n var get = function () {\n return target;\n };\n return {\n assign: assign,\n get: get,\n mutate: delegate.mutate,\n events: events.registry\n };\n };\n var col = function (column, x, y, w, h) {\n var bar = SugarElement.fromTag('div');\n setAll(bar, {\n position: 'absolute',\n left: x - w / 2 + 'px',\n top: y + 'px',\n height: h + 'px',\n width: w + 'px'\n });\n setAll$1(bar, {\n 'data-column': column,\n 'role': 'presentation'\n });\n return bar;\n };\n var row = function (r, x, y, w, h) {\n var bar = SugarElement.fromTag('div');\n setAll(bar, {\n position: 'absolute',\n left: x + 'px',\n top: y - h / 2 + 'px',\n height: h + 'px',\n width: w + 'px'\n });\n setAll$1(bar, {\n 'data-row': r,\n 'role': 'presentation'\n });\n return bar;\n };\n var resizeBar = resolve('resizer-bar');\n var resizeRowBar = resolve('resizer-rows');\n var resizeColBar = resolve('resizer-cols');\n var BAR_THICKNESS = 7;\n var resizableRows = function (warehouse, isResizable) { return bind$2(warehouse.all, function (row, i) { return isResizable(row.element) ? [i] : []; }); };\n var resizableColumns = function (warehouse, isResizable) {\n var resizableCols = [];\n range$1(warehouse.grid.columns, function (index) {\n var colElmOpt = Warehouse.getColumnAt(warehouse, index).map(function (col) { return col.element; });\n if (colElmOpt.forall(isResizable)) {\n resizableCols.push(index);\n }\n });\n return filter$2(resizableCols, function (colIndex) {\n var columnCells = Warehouse.filterItems(warehouse, function (cell) { return cell.column === colIndex; });\n return forall(columnCells, function (cell) { return isResizable(cell.element); });\n });\n };\n var destroy = function (wire) {\n var previous = descendants(wire.parent(), '.' + resizeBar);\n each$2(previous, remove$6);\n };\n var drawBar = function (wire, positions, create) {\n var origin = wire.origin();\n each$2(positions, function (cpOption) {\n cpOption.each(function (cp) {\n var bar = create(origin, cp);\n add(bar, resizeBar);\n append$1(wire.parent(), bar);\n });\n });\n };\n var refreshCol = function (wire, colPositions, position, tableHeight) {\n drawBar(wire, colPositions, function (origin, cp) {\n var colBar = col(cp.col, cp.x - origin.left, position.top - origin.top, BAR_THICKNESS, tableHeight);\n add(colBar, resizeColBar);\n return colBar;\n });\n };\n var refreshRow = function (wire, rowPositions, position, tableWidth) {\n drawBar(wire, rowPositions, function (origin, cp) {\n var rowBar = row(cp.row, position.left - origin.left, cp.y - origin.top, tableWidth, BAR_THICKNESS);\n add(rowBar, resizeRowBar);\n return rowBar;\n });\n };\n var refreshGrid = function (warhouse, wire, table, rows, cols) {\n var position = absolute(table);\n var isResizable = wire.isResizable;\n var rowPositions = rows.length > 0 ? height.positions(rows, table) : [];\n var resizableRowBars = rowPositions.length > 0 ? resizableRows(warhouse, isResizable) : [];\n var resizableRowPositions = filter$2(rowPositions, function (_pos, i) { return exists(resizableRowBars, function (barIndex) { return i === barIndex; }); });\n refreshRow(wire, resizableRowPositions, position, getOuter$2(table));\n var colPositions = cols.length > 0 ? width.positions(cols, table) : [];\n var resizableColBars = colPositions.length > 0 ? resizableColumns(warhouse, isResizable) : [];\n var resizableColPositions = filter$2(colPositions, function (_pos, i) { return exists(resizableColBars, function (barIndex) { return i === barIndex; }); });\n refreshCol(wire, resizableColPositions, position, getOuter$1(table));\n };\n var refresh = function (wire, table) {\n destroy(wire);\n if (wire.isResizable(table)) {\n var warehouse = Warehouse.fromTable(table);\n var rows$1_1 = rows(warehouse);\n var cols = columns(warehouse);\n refreshGrid(warehouse, wire, table, rows$1_1, cols);\n }\n };\n var each = function (wire, f) {\n var bars = descendants(wire.parent(), '.' + resizeBar);\n each$2(bars, f);\n };\n var hide = function (wire) {\n each(wire, function (bar) {\n set$1(bar, 'display', 'none');\n });\n };\n var show = function (wire) {\n each(wire, function (bar) {\n set$1(bar, 'display', 'block');\n });\n };\n var isRowBar = function (element) {\n return has(element, resizeRowBar);\n };\n var isColBar = function (element) {\n return has(element, resizeColBar);\n };\n var resizeBarDragging = resolve('resizer-bar-dragging');\n var BarManager = function (wire) {\n var mutation = BarMutation();\n var resizing = transform(mutation, {});\n var hoverTable = Optional.none();\n var getResizer = function (element, type) {\n return Optional.from(get$b(element, type));\n };\n mutation.events.drag.bind(function (event) {\n getResizer(event.target, 'data-row').each(function (_dataRow) {\n var currentRow = getCssValue(event.target, 'top');\n set$1(event.target, 'top', currentRow + event.yDelta + 'px');\n });\n getResizer(event.target, 'data-column').each(function (_dataCol) {\n var currentCol = getCssValue(event.target, 'left');\n set$1(event.target, 'left', currentCol + event.xDelta + 'px');\n });\n });\n var getDelta = function (target, dir) {\n var newX = getCssValue(target, dir);\n var oldX = getAttrValue(target, 'data-initial-' + dir, 0);\n return newX - oldX;\n };\n resizing.events.stop.bind(function () {\n mutation.get().each(function (target) {\n hoverTable.each(function (table) {\n getResizer(target, 'data-row').each(function (row) {\n var delta = getDelta(target, 'top');\n remove$7(target, 'data-initial-top');\n events.trigger.adjustHeight(table, delta, parseInt(row, 10));\n });\n getResizer(target, 'data-column').each(function (column) {\n var delta = getDelta(target, 'left');\n remove$7(target, 'data-initial-left');\n events.trigger.adjustWidth(table, delta, parseInt(column, 10));\n });\n refresh(wire, table);\n });\n });\n });\n var handler = function (target, dir) {\n events.trigger.startAdjust();\n mutation.assign(target);\n set$2(target, 'data-initial-' + dir, getCssValue(target, dir));\n add(target, resizeBarDragging);\n set$1(target, 'opacity', '0.2');\n resizing.go(wire.parent());\n };\n var mousedown = bind(wire.parent(), 'mousedown', function (event) {\n if (isRowBar(event.target)) {\n handler(event.target, 'top');\n }\n if (isColBar(event.target)) {\n handler(event.target, 'left');\n }\n });\n var isRoot = function (e) {\n return eq$1(e, wire.view());\n };\n var findClosestEditableTable = function (target) { return closest$1(target, 'table', isRoot).filter(isEditable$1); };\n var mouseover = bind(wire.view(), 'mouseover', function (event) {\n findClosestEditableTable(event.target).fold(function () {\n if (inBody(event.target)) {\n destroy(wire);\n }\n }, function (table) {\n if (resizing.isActive()) {\n hoverTable = Optional.some(table);\n refresh(wire, table);\n }\n });\n });\n var destroy$1 = function () {\n mousedown.unbind();\n mouseover.unbind();\n resizing.destroy();\n destroy(wire);\n };\n var refresh$1 = function (tbl) {\n refresh(wire, tbl);\n };\n var events = create$1({\n adjustHeight: Event([\n 'table',\n 'delta',\n 'row'\n ]),\n adjustWidth: Event([\n 'table',\n 'delta',\n 'column'\n ]),\n startAdjust: Event([])\n });\n return {\n destroy: destroy$1,\n refresh: refresh$1,\n on: resizing.on,\n off: resizing.off,\n hideBars: curry(hide, wire),\n showBars: curry(show, wire),\n events: events.registry\n };\n };\n var create = function (wire, resizing, lazySizing) {\n var hdirection = height;\n var vdirection = width;\n var manager = BarManager(wire);\n var events = create$1({\n beforeResize: Event([\n 'table',\n 'type'\n ]),\n afterResize: Event([\n 'table',\n 'type'\n ]),\n startDrag: Event([])\n });\n manager.events.adjustHeight.bind(function (event) {\n var table = event.table;\n events.trigger.beforeResize(table, 'row');\n var delta = hdirection.delta(event.delta, table);\n adjustHeight(table, delta, event.row, hdirection);\n events.trigger.afterResize(table, 'row');\n });\n manager.events.startAdjust.bind(function (_event) {\n events.trigger.startDrag();\n });\n manager.events.adjustWidth.bind(function (event) {\n var table = event.table;\n events.trigger.beforeResize(table, 'col');\n var delta = vdirection.delta(event.delta, table);\n var tableSize = lazySizing(table);\n adjustWidth(table, delta, event.column, resizing, tableSize);\n events.trigger.afterResize(table, 'col');\n });\n return {\n on: manager.on,\n off: manager.off,\n refreshBars: manager.refresh,\n hideBars: manager.hideBars,\n showBars: manager.showBars,\n destroy: manager.destroy,\n events: events.registry\n };\n };\n var TableResize = { create: create };\n var only = function (element, isResizable) {\n var parent = isDocument(element) ? documentElement(element) : element;\n return {\n parent: constant(parent),\n view: constant(element),\n origin: constant(SugarPosition(0, 0)),\n isResizable: isResizable\n };\n };\n var detached = function (editable, chrome, isResizable) {\n var origin = function () { return absolute(chrome); };\n return {\n parent: constant(chrome),\n view: constant(editable),\n origin: origin,\n isResizable: isResizable\n };\n };\n var body = function (editable, chrome, isResizable) {\n return {\n parent: constant(chrome),\n view: constant(editable),\n origin: constant(SugarPosition(0, 0)),\n isResizable: isResizable\n };\n };\n var ResizeWire = {\n only: only,\n detached: detached,\n body: body\n };\n var createContainer = function () {\n var container = SugarElement.fromTag('div');\n setAll(container, {\n position: 'static',\n height: '0',\n width: '0',\n padding: '0',\n margin: '0',\n border: '0'\n });\n append$1(body$1(), container);\n return container;\n };\n var get = function (editor, isResizable) {\n return editor.inline ? ResizeWire.body(SugarElement.fromDom(editor.getBody()), createContainer(), isResizable) : ResizeWire.only(SugarElement.fromDom(editor.getDoc()), isResizable);\n };\n var remove = function (editor, wire) {\n if (editor.inline) {\n remove$6(wire.parent());\n }\n };\n var isTable = function (node) { return isNonNullable(node) && node.nodeName === 'TABLE'; };\n var barResizerPrefix = 'bar-';\n var isResizable = function (elm) { return get$b(elm, 'data-mce-resize') !== 'false'; };\n var syncPixels = function (table) {\n var warehouse = Warehouse.fromTable(table);\n if (!Warehouse.hasColumns(warehouse)) {\n each$2(cells$1(table), function (cell) {\n var computedWidth = get$a(cell, 'width');\n set$1(cell, 'width', computedWidth);\n remove$7(cell, 'width');\n });\n }\n };\n var TableResizeHandler = function (editor) {\n var selectionRng = value();\n var tableResize = value();\n var resizeWire = value();\n var startW;\n var startRawW;\n var lazySizing = function (table) { return get$5(editor, table); };\n var lazyResizingBehaviour = function () { return isPreserveTableColumnResizing(editor) ? preserveTable() : resizeTable(); };\n var getNumColumns = function (table) { return getGridSize(table).columns; };\n var afterCornerResize = function (table, origin, width) {\n var isRightEdgeResize = endsWith(origin, 'e');\n if (startRawW === '') {\n convertToPercentSize(table);\n }\n if (width !== startW && startRawW !== '') {\n set$1(table, 'width', startRawW);\n var resizing = lazyResizingBehaviour();\n var tableSize = lazySizing(table);\n var col_1 = isPreserveTableColumnResizing(editor) || isRightEdgeResize ? getNumColumns(table) - 1 : 0;\n adjustWidth(table, width - startW, col_1, resizing, tableSize);\n }\n else if (isPercentage$1(startRawW)) {\n var percentW = parseFloat(startRawW.replace('%', ''));\n var targetPercentW = width * percentW / startW;\n set$1(table, 'width', targetPercentW + '%');\n }\n if (isPixel(startRawW)) {\n syncPixels(table);\n }\n };\n var destroy = function () {\n tableResize.on(function (sz) {\n sz.destroy();\n });\n resizeWire.on(function (w) {\n remove(editor, w);\n });\n };\n editor.on('init', function () {\n var rawWire = get(editor, isResizable);\n resizeWire.set(rawWire);\n if (hasTableObjectResizing(editor) && hasTableResizeBars(editor)) {\n var resizing = lazyResizingBehaviour();\n var sz = TableResize.create(rawWire, resizing, lazySizing);\n sz.on();\n sz.events.startDrag.bind(function (_event) {\n selectionRng.set(editor.selection.getRng());\n });\n sz.events.beforeResize.bind(function (event) {\n var rawTable = event.table.dom;\n fireObjectResizeStart(editor, rawTable, getPixelWidth(rawTable), getPixelHeight(rawTable), barResizerPrefix + event.type);\n });\n sz.events.afterResize.bind(function (event) {\n var table = event.table;\n var rawTable = table.dom;\n removeDataStyle(table);\n selectionRng.on(function (rng) {\n editor.selection.setRng(rng);\n editor.focus();\n });\n fireObjectResized(editor, rawTable, getPixelWidth(rawTable), getPixelHeight(rawTable), barResizerPrefix + event.type);\n editor.undoManager.add();\n });\n tableResize.set(sz);\n }\n });\n editor.on('ObjectResizeStart', function (e) {\n var targetElm = e.target;\n if (isTable(targetElm)) {\n var table_1 = SugarElement.fromDom(targetElm);\n each$2(editor.dom.select('.mce-clonedresizable'), function (clone) {\n editor.dom.addClass(clone, 'mce-' + getTableColumnResizingBehaviour(editor) + '-columns');\n });\n if (!isPixelSizing(table_1) && isTablePixelsForced(editor)) {\n convertToPixelSize(table_1);\n }\n else if (!isPercentSizing(table_1) && isTablePercentagesForced(editor)) {\n convertToPercentSize(table_1);\n }\n if (isNoneSizing(table_1) && startsWith(e.origin, barResizerPrefix)) {\n convertToPercentSize(table_1);\n }\n startW = e.width;\n startRawW = isTableResponsiveForced(editor) ? '' : getRawWidth(editor, targetElm).getOr('');\n }\n });\n editor.on('ObjectResized', function (e) {\n var targetElm = e.target;\n if (isTable(targetElm)) {\n var table_2 = SugarElement.fromDom(targetElm);\n var origin_1 = e.origin;\n if (startsWith(origin_1, 'corner-')) {\n afterCornerResize(table_2, origin_1, e.width);\n }\n removeDataStyle(table_2);\n fireTableModified(editor, table_2.dom, styleModified);\n }\n });\n editor.on('SwitchMode', function () {\n tableResize.on(function (resize) {\n if (editor.mode.isReadOnly()) {\n resize.hideBars();\n }\n else {\n resize.showBars();\n }\n });\n });\n editor.on('dragstart dragend', function (e) {\n tableResize.on(function (resize) {\n if (e.type === 'dragstart') {\n resize.hideBars();\n resize.off();\n }\n else {\n resize.on();\n resize.showBars();\n }\n });\n });\n editor.on('remove', function () {\n destroy();\n });\n var refresh = function (table) {\n tableResize.on(function (resize) { return resize.refreshBars(SugarElement.fromDom(table)); });\n };\n var hide = function () {\n tableResize.on(function (resize) { return resize.hideBars(); });\n };\n var show = function () {\n tableResize.on(function (resize) { return resize.showBars(); });\n };\n return {\n refresh: refresh,\n hide: hide,\n show: show\n };\n };\n var setupTable = function (editor) {\n register(editor);\n var resizeHandler = TableResizeHandler(editor);\n var cellSelectionHandler = TableCellSelectionHandler(editor, resizeHandler);\n var actions = TableActions(editor, resizeHandler, cellSelectionHandler);\n registerCommands(editor, actions);\n registerQueryCommands(editor, actions);\n registerEvents(editor, actions);\n return {\n getSelectedCells: cellSelectionHandler.getSelectedCells,\n clearSelectedCells: cellSelectionHandler.clearSelectedCells\n };\n };\n var DomModel = function (editor) {\n var table = setupTable(editor);\n return { table: table };\n };\n var Model = function () {\n global$1.add('dom', DomModel);\n };\n Model();\n})();\n"],"names":["__assign","this","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","__spreadArray","to","from","pack","ar","l","Array","slice","concat","global$1","tinymce","util","Tools","resolve","isType$1","type","value","x","isArray","o","v","constructor","String","isPrototypeOf","_a","name","isSimpleType","eq$2","a","isString","isObject","isNull","isBoolean","isUndefined","undefined","isNonNullable","isNullable","isFunction","isNumber","noop","constant","identity","tripleEquals","b","curry","fn","initialArgs","_i","restArgs","all","not","f","never","always","Optional","tag","some","none","singletonNone","fold","onNone","onSome","isSome","isNone","map","mapper","bind","binder","exists","predicate","forall","filter","getOr","replacement","or","getOrThunk","thunk","orThunk","getOrDie","message","Error","getOrNull","getOrUndefined","each","worker","toArray","toString","decimalDigits","exponentPart","opt","unsignedDecimalLiteral","float","nativeSlice","nativeIndexOf","indexOf","nativePush","push","contains$2","xs","ts","pred","len","range$1","num","r","map$1","each$2","partition","pass","fail","filter$2","foldr","acc","eachr","foldl","find$1","until","findUntil","findIndex","flatten","bind$2","mapToObject","get$d","head","last$2","findMap","arr","r_1","keys","each$1","obj","props","k","tupleMap","tuple","filter$1","onTrue","onFalse","internalFilter","objAcc","mapToArray","values","has$1","key","Global","window","Function","resolve$2","scope","parts","path","split","actual","unsafe","getPrototypeOf","sandHTMLElement","test","element","dom","nodeName","toLowerCase","nodeType","isType","isComment","isHTMLElement","isElement","isText","isDocument","isDocumentFragment","isTag","e","rawSet","console","error","setAttribute","set$2","setAll$1","attrs","get$b","getAttribute","getOpt","remove$7","removeAttribute","clone$2","attributes","attr","fromDom$1","node","SugarElement","fromHtml","html","div","document","createElement","innerHTML","hasChildNodes","childNodes","fromTag","fromText","text","createTextNode","fromDom","fromPoint","docElm","y","elementFromPoint","is$2","selector","elem","matches","msMatchesSelector","webkitMatchesSelector","mozMatchesSelector","bypassSelector","childElementCount","one","base","querySelector","eq$1","e1","e2","contains$1","d1","d2","contains","is$1","owner","ownerDocument","documentOrOwner","dos","parent","parentNode","parentElement","parents","isRoot","stop","ret","rawParent","prevSibling","previousSibling","nextSibling","children$2","child$2","index","cs","before$3","marker","insertBefore","after$5","append$1","prepend","firstChild$1","firstChild","appendChild","wrap","wrapper","after$4","elements","append","empty","textContent","rogue","remove$6","removeChild","unwrap","children","clone$1","original","isDeep","cloneNode","shallow","deep","shallowAs","nu","validSectionList","detail","rowspan","colspan","rowdetail","cells","section","elementnew","isNew","isLocked","rowcells","supported","Element","attachShadow","Node","getRootNode","isSupported$1","getShadowRoot","host","getShadowHost","isOpenShadowHost","shadowRoot","inBody","fbc","fab","doc","body","getBody$1","descendants$1","result","ancestors$3","ancestors$4","children$1","descendants","querySelectorAll","all$1","ClosestOrAncestor","is","ancestor","ancestor$2","el","closest$2","ancestor$1","child","child$1","descendant","closest$1","lhs","rhs","comparator","left","cat","someIf","checkRange","str","substr","start","end","idx","startsWith","prefix","endsWith","suffix","trim","replace","blank","isNotEmpty","isSupported","style","getPropertyValue","internalSet","property","setProperty","set$1","setAll","css","get$a","getComputedStyle","getUnsafeProperty","getRaw$2","raw","remove$5","removeProperty","internalRemove","getAttrValue","cell","fallback","parseInt","getSpan","hasColspan","cellOrCol","hasRowspan","getCssValue","minWidth","minHeight","firstLayer","filterFirstLayer","tags","join","elm","lookup","cells$1","columns$1","columnGroups","columnGroup","table","rows$1","fromRowsOrColGroups","elems","getSection","row","cells_1","column","cells_2","getParentSection","group","parentName","isValidSection","fromTable$1","rows","columnGroups$1","cached","called","args","unknown$2","nu$2","major","minor","Version","detect","versionRegexes","agent","cleanedAgent","regexes","firstMatch","Number","find","unknown","detect$4","candidates","userAgent","candidate","search","normalVersionRegex","checkContains","target","uastring","browsers","brand","oses","PlatformInfo","edge","chromium","opera","firefox","safari","nu$1","info","current","version","isBrowser","isEdge","isChromium","isIE","isOpera","isFirefox","isSafari","Browser","ie","windows","android","linux","macos","solaris","freebsd","chromeos","isOS","isWindows","isiOS","isAndroid","isMacOS","isLinux","isSolaris","isFreeBSD","isChromeOS","OperatingSystem","ios","PlatformDetection","userAgentDataOpt","mediaMatch","browser","userAgentData","brands","uaBrand","lcBrand","detectBrowser$1","detectBrowser","os","detectOs","deviceType","isiPad","isiPhone","isMobile","isTouch","isTablet","isPhone","iOSwebview","isDesktop","isWebView","DeviceType","query","matchMedia","platform","navigator","detect$2","Dimension","getOffset","get","css_1","parseFloat","aggregate","properties","val","isNaN","set","h","match","getOuter","max","cumulativeInclusions","toNumber","px","toFloat","getProp","getCalculatedWidth","boxSizing","width","getBoundingClientRect","offsetWidth","size","upper","lower","calcContentBoxSize","api$2","get$9","getOuter$2","getInner","getRuntime$1","addCells","gridRow","existingCells","before","after","newCells","setCells","addCell","mutateCell","getCell","getCellElement","cellLength","extractGridDetails","grid","cols","clone","cloneRow","cloneCell","LOCKED_COL_ATTR","getLockedColumnsFromTable","lockedColStr","lockedCols","getLockedColumnsFromGrid","locked","lockedArr","_val","copy","sort","sort$1","filterItems","warehouse","generate$1","list","access","lockedColumns","rowData","maxRows","maxColumns","rowCount","_c","colgroupRows","currentRow","rowCell","hasNonNullableKey","extended","occupiedColumnPosition","occupiedRowPosition","columnPosition","newpos","Math","_d","columns","columnsGroup","columnIndex","colIndex","columnext","generateColumns","colgroup$1","colgroup","colgroups","grid$1","Warehouse","fromTable","generate","getAt","findItem","item","filtered","justCells","w","justColumns","hasColumns","getColumnAt","isValidCell","rowsArr","col","decide","getBlock","isValid","getFallback","inBlock","c","deduce","rest","reverse","aa","delta","next","extras","abs","onDirection","isLtr","isRtl","getDirection","api$1","height","offsetHeight","get$8","getOuter$1","getRuntime","top","translate","SugarPosition","firstDefinedOrZero","absolute","win","defaultView","documentElement","offsetLeft","offsetTop","scrollTop","pageYOffset","scrollLeft","pageXOffset","clientTop","clientLeft","viewport","box","boxPosition","rowInfo","colInfo","rtlEdge","ltrEdge","getLeftEdge","getRightEdge","getTop$1","getTopEdge","getBottomEdge","findPositions","getInnerEdge","getOuterEdge","array","lines","cellOption","lastLine","positions","optElements","ltr$1","rtl$1","step","detect$1","amount","units","unsupportedLength","fixed","relative","pattern","input","RegExp","parse","accepted","exec","unitRaw","unit","check","isUnit","rPercentageBasedSizeRegex","rPixelBasedSizeRegex","isCol$2","getPercentSize","outerGetter","innerGetter","relativeParent","setPixelWidth","setPercentageWidth","setHeight","normalizePixelSize","getter","setter","number","newSize","total","floor","convert","getTotalHeight","getHeightValue","getRaw$1","prop","getRawWidth$1","getPercentageWidth","getPixelWidth$1","getHeight","get$7","setGenericWidth","getPercentTableWidth","percentageBasedSizeRegex","isCol$1","getRawW","getRawH","getDimension","cellOpt","backups","getWidthFrom","getWidth","columnCells","justCols","pos","colFilter","supportsColWidths","isValidColumn","cell_1","getDeduced","deduced","d","getPixelWidths","tableSize","minCellWidth","getHeightFrom","direction","widthLookup","noneSize","zero","pixelWidth","getWidths","getCellDelta","singleColumnWidth","setElementWidth","adjustTableWidth","isRelative","label","percentageSize","getFloatWidth","cellWidth","getPercentageWidths","_delta","currentWidth","pixelSize","newWidth","TableSize","chooseSize","makeCell","seenSelected","rowIndex","td","extract$1","selectedSelector","isSelected","replica","replicaHouse","replicaStats","house","totalColumns","minRow","minCol","maxRow","maxCol","allCells","selectedCells","startRow","endRow","startCol","endCol","statsStruct","findSelectedStats","unselectedCells","stats","totalRows","j","fillInGaps","widthDelta","colWidths","allColsWidth","selectedColsWidth","getTableWidthDelta","emptyRows","clean","api","getOption","nodeValue","NodeValue","get$6","getEnd","elementsWithCursorPosition","isCursorPosition","isContentEditableFalse","first","descend","child_1","res","last$1","descendantRtl","child_2","transferableAttributes","createCell","createCol","createColgroup","createRow$1","replace$1","cloneChildren","copy$2","pasteReplace","cellOperations","mutate","formatsToClone","cloneCss","prev","source","sourceDom","targetDom","cssText","formats","lastNode","oldCell","newCell","firstText","formatSelector","last","clonedFormat","cloneFormats","validAttributes","attributeName","attribute","cloneAppropriateAttributes","colGap","gap","paste$1","option","editor","options","defaultWidth","getPixelForcedWidth","parentBlock","getParent","selection","getStart","isBlock","getBody","getTableCloneElements","getTableHeaderType","getTableColumnResizingBehaviour","isPreserveTableColumnResizing","isResizeTableColumnResizing","getTableSizingMode","isTablePercentagesForced","isTablePixelsForced","isTableResponsiveForced","hasTableResizeBars","shouldStyleWithCss","shouldMergeContentOnPaste","getTableDefaultAttributes","defaultAttributes","isSet","determineDefaultTableAttributes","getTableDefaultStyles","defaultStyles","determineDefaultTableStyles","tableUseColumnGroup","closest","isEditable$1","assumeEditable","isContentEditable","editable","getRaw","contentEditable","getIsRoot","removeDataStyle","removeStyleAttribute","getSelectionStart","getPixelWidth","getPixelHeight","isInEditableContext$1","inSelection","bounds","leftEdge","rightEdge","topEdge","bottomEdge","finishCol","finishRow","isWithin","getAnyBox","startCell","finishCell","startCoords","finishCoords","sc","fc","detailA","detailB","min","getBox$1","isRect","detailIsWithin","isRectangular","intercepts$1","finish","inside","parentCell","innerCell","c1","c2","moveBy","deltaRow","deltaColumn","moveBy$1","getWarehouse","intercepts","nestedIntercepts","firstTable","lastTable","optStartCell","optLastCell","lastCell","TagBoundaries","DomUniverse","up","down","styles","remove","copyTo","destination","as","insert","afterAll","appendAll","create","comparePosition","other","compareDocumentPosition","isSpecial","getLanguage","getText","setText","isBoundary","isEmptyTag","isNonEditable","eq","unsafeOne","universe","look","tail","commonElement","sharedOne$1","ancestors$1","ps1","ps2","prune","ind","pruned1","pruned2","shared","firstpath","secondpath","universe$3","sharedOne","_universe","lookupTable","container","identify","rootTable","boxes","startTable","finishTable","ancestorCells","ancestors","lca","lcaTable","finishAncestorCells","startAncestorCells","retrieve$1","sels","getEdges","firstSelectedSelector","lastSelectedSelector","shiftSelection","getLast","identified","expandTo","retrieve","retrieveBox","edges","sectionSelector","firstAncestor","lastAncestor","fA","lA","getBox","unmergable","hasSpan","span","mergable","ephemera","strSelected","strSelectedSelector","strAttributeSelector","strFirstSelected","strFirstSelectedSelector","strLastSelected","strLastSelectedSelector","attributeSelector","selected","firstSelected","lastSelected","forMenu","getSelectionFromSelector","initCell","cellName","getSelectionCellOrCaption","getSelectionCell","getCellsFromSelection","nodes","model","getSelectedCells","registerEvents","actions","on","cells_3","getCellsFromFakeSelection","preventDefault","extractSelected","content","format","innerText","getTextContent","serializer","serialize","serializeElements","multiCellContext","paste","isTable","getDoc","generators","targets","clipboard","pasteCells","focus","point","offset","scan$1","toEnd","freefallRtl$2","freefallRtl$1","universe$2","halve","main","width_1","getGenericWidth","surround","sizes","startIndex","endIndex","results","clampDeltaHelper","minCellSize","diff","clampNegativeDelta","clampDelta","resizeTable","calcRelativeDeltas","ratio","newThis","calcLeftEdgeDeltas","clampedDelta","calcFixedDeltas","resizer","clampTableDelta","calcMiddleDeltas","_prev","calcRightEdgeDeltas","calcRedestributedWidths","totalWidth","pixelDelta","ratio_1","newSizes","preserveTable","isLastColumn","maxDelta","_index","_minCellSize","_totalWidth","_pixelDelta","_isRelative","getGridSize","isHeaderCell","isHeaderCells","getRowHeaderType","isHeaderRow","getRowType","findCommonCellType","subType","headerCells","transformCell","substitution","transformRow","fixedCell","mutate$1","sectionCells","TableSection","rowType","findTableRowHeaderType","setIfNot","ignore","insert$1","render$1","newRows","syncRows","gridSection","tr","syncColGroup","colGroup","renderSection","sectionName","newSection","generateSection","sectionElems","renderOrRemoveSection","removeSection","headSection","bodySection","footSection","columnGroupsSection","findDiff","comp","subgrid","getRow","isColRow","getColumn","toDetails","seen","details","row_1","updateSeen","rowdetailnew","toGrid","colgroupCols","rowCells","rowDetail","row_2","toDetailList","findInWarehouse","extractCells","cell$1","lc","run","operation","extract","adjustment","postAction","genWrappers","behaviours","tableSection","output","fromWarehouse","cursor","out","newElements","tableSizing","sizing","resizing","resize","onPasteByEditor","onCells","onUnlockedCells","allUnlocked","isUnlockedTableCell","unmerge","row_4","currentCell","isToReplace","splitRows","cells_4","uniqueCells","_loop_1","row_5","sub","value$1","applyHelper","constHelper","outputHelper","inner","_onError","onValue","isValue","isError","Result","mapError","toOptional","msg","onError","_onValue","fromOption","optional","err","measureWidth","gridA","gridB","rowDelta","colDelta","measureHeight","generateElements","generator","rowFill","exampleRow","colFill","newChildren","tailor","fillCols","fillRows","gridWidth","isLastColLocked","modifiedCols","newLockedColumns","isSpanning","matching","getLockedColumnsWithinBounds","startAddress","colNum","merge$1","validStartAddress","currentStartAddress","gridColLength","adjustedRowAddress","possibleColAddresses","validColAddress","getValidStartAddress","gridBRows","lockedColumnsWithinBounds","rowRemainder","colRemainder","colRequired","rowRequired","measure","fittedGrid","newLockedColumnsWithinBounds","lockedColumnObj","r_2","skippedCol","gridBColIndex","newCellElm","mergeTables","insertCols","prevCell","substitute","splitCols","fittedNewGrid","secondDelta","fittedOldGrid","insertRows","oldCols","oldRows","newLocked","secondDiff","fittedGridB","newChild","lockedColFill","insertRowAt","example","newRow","ex","insertColumnAt","withinSpan","cell_2","getElementFor","isDuplicatedCell","notInStartRow","notInStartColumn","determineScope","applyScope","newScope","isInHeader","getScope","replaceIn","replacer","genScope","shouldReplace","mapCells","isTarget","newCell_1","getColumnCells","replaceColumns","indexes","rowHeaders","shouldReplaceCell","targetColumn","_colIndex","columnReplacePredicate","scopeGenerator","columnScopeGenerator","replaceRows","targetRow","getRowCells","columnHeaders","_cell","newGrid","_rowIndex","rowReplacerPredicate","rowScopeGenerator","replaceCells","targetCells","Adt","cases","constructors","adt","acase","count","keys$1","argLength","foldArgs","branches","branchKeys","reqKey","log","params","adt$6","only","middle","right","ColumnContext","determine","context","neighbours","measures","recalculateHeightForCells","heights","recalculate","widths","groups","recalculateWidthForColumns","recalculateWidthForCells","recalculateAndApply","adjustWidth","clampedStep","deltas","newWidths","dx","adjustHeight","getPixelHeights","newHeights","dy","newCellSizes","newRowSizes","matchRowHeight","uniqueColumns","currentDetail","isCol","isColgroup","isRow$1","elementToData","getScopeAttribute","Generators","toData","add","data","cell_3","nuCell","recent","getOrInit","makeNew","replaceOrInit","cell_4","merge","stringAttributes","baseScope_1","scopes_1","getScopeProperty","blockList","universe$1","tagName","isBlock$1","isList","isList$1","isEmptyTag$1","isBr","markCell","rightSiblingIsBlock","rightSibling","isListItem","contents","advancedBr","isEditable","outcome","elementFromGrid","_b","findEditableCursorPosition","bundle","cursorElement","uniqueRows","makeRowsSection","initialGrid","rowIndexes","opMakeRowsHeader","opMakeRowsBody","opMakeRowsFooter","gridifyRows","pasteDetails","fromPastedRows","wh","_table","_info","adjustWidthTo","adjustAndRedistributeWidths","resizeBehaviour","tablePixelWidth","adjustAndRedistributeWidths$1","firstColumnIsLocked","_warehouse","lastColumnIsLocked","getColumnsWidth","uniqueCols","insertColumnsExtractor","pasteColumnsExtractor","headerCellGenerator","bodyCellGenerator","insertRowsBefore","targetIndex","insertRowsAfter","newG","insertColumnsBefore","extractDetail","insertColumnsAfter","eraseColumns","_comparator","_genWrappers","deleteColumnsAt","maxColIndex","eraseRows","deleteRowsAt","maxRowIndex","makeColumnsHeader","columnIndexes","unmakeColumnsHeader","makeRowsHeader","makeRowsBody","makeRowsFooter","makeCellsHeader","unmakeCellsHeader","mergeCells","row_3","merge$2","onMergable","mergeable","unmergeCells","onUnmergable","gridify","address","pasteColsBefore","mergedGrid","pasteColsAfter","pasteRowsBefore","pasteRowsAfter","getColumnsType","lastSelectedCell","minColRange","maxColRange","selectedColumnCells","getCellsType","getRowsType","minRowRange","maxRowRange","rowTypes","hasHeader","hasFooter","hasBody","findCommonRowType","fireNewRow","dispatch","fireNewCell","fireTableModified","styleModified","structure","structureModified","styleAndStructureModified","get$5","TableActions","resizeHandler","cellSelectionHandler","isTableBody","colMutationOp","getTableSectionType","setSelectionFromAction","firstCell","clearSelectedCells","rng","createRng","selectNode","setRng","des","setStart","setEnd","execute","guard","effect","noEvents","refresh","range","deleteRow","deleteColumn","getTableRowType","getTableCellType","getTableColType","constrainSpan","currentColspan","isColInRange","copyCols","fakeColGroups","colsToCopy","copiedCols","clonedCol","fakeColgroup","generateColGroup","fakeRows","cellsToCopy","copiedCells","clonedCell","fakeTR","generateRows","copyRows","slicedGrid","filteredGrid","slicedDetails","adt$5","invalid","pixels","percent","validateFor","rawAmount","substring","Size","redistributeValues","newWidthType","newTotalWidth","scale","pc","redistributeToPx","_pc","redistributeToPercent","redistribute$1","newType","floats","redistributeEmpty","normalize","sum","add$3","scan","remainder","floored","roundDown","round","validate","getUnit","redistribute","optWidth","optHeight","widthUnit","oldWidths","getRawWidths","nuWidths","redistributeToColumns","redistributeToW","newHeight","hUnit","totalHeight","oldHeights","getRawHeights","redistributeToH","isPercentSizing","isPixelSizing","isNoneSizing","cleanupLegacyAttributes","convertToPercentSize","convertToPixelSize","getPixelTableWidth","convertToNoneSize","rowElements","DefaultRenderOptions","border","colGroups","createGroupRow","createRows","createRow","placeCaretInCell","select","collapse","colHeaders","undoManager","headerType","renderOpts","rowHeadersGoInThead","actualRowHeaders","thead","theadRows","tbody","tbodyRows","render","get$4","insertContent","addVisual","isPercentage","fireEvents","tableElm","selectFirstCellInTable","global","tableTypeBase","tableTypeRow","tableTypeColumn","setData","items","fakeClipboardItem","FakeClipboardItem","write","getData","read","getType","clearData","clear","setRows","rowsOpt","clearRows","getRows","setColumns","columnsOpt","clearColumns","getColumns","getSelectionStartCellOrCaption","registerCommands","getTableFromCell","performActionOnSelection","action","getSelectionStartCell","postExecute","_data","actOnSelection","copyRowSelection","copyColSelection","pasteOnSelection","clonedRows","pasteRows","actOnType","getAction","_ui","get$c","no_events","mceTableSplitCells","mceTableMergeCells","mceTableInsertRowBefore","mceTableInsertRowAfter","mceTableInsertColBefore","mceTableInsertColAfter","mceTableDeleteCol","mceTableDeleteRow","mceTableCutCol","mceTableCutRow","mceTableCopyCol","mceTableCopyRow","mceTablePasteColBefore","mceTablePasteColAfter","mceTablePasteRowBefore","mceTablePasteRowAfter","mceTableDelete","cellOrCaption","isEmpty","setContent","setCursorLocation","nodeChanged","mceTableCellToggleClass","clazz","allHaveClass","formatter","formatterAction","mceTableToggleClass","toggle","mceTableToggleCaption","caption","appendAt","mceTableSizingMode","setSizingMode","mceTableCellType","mceTableColType","mceTableRowType","func","addCommand","checkInput","headerRows","headerColumns","insertTable","getFormatName","validArgs","has","formatName","adt$4","Situ","cata","subject","onBefore","onOn","onAfter","situ","Response","kill","createRange","selectNodeContents","selectNodeContentsUsing","relativeToNative","startSitu","finishSitu","setStartBefore","setStartAfter","setEndBefore","setEndAfter","setFinish","exactToNative","soffset","foffset","toRect","rect","bottom","adt$3","ltr","rtl","fromRange","startContainer","startOffset","endContainer","endOffset","diagnose","ranges","domRange","exact","getRanges","collapsed","rev","doDiagnose","asLtrRange","SimRange","Situs","convertToRange","makeSitus","selectRange","cellSel","traverse","mode","backtrack","_direction","transition","sidestep","advance","sibling","successors","go","rules","succ","rule","fb","Walkers","hone","isLeaf","seekLeft$1","seekRight$1","before$1","after$1","after$2","adt$2","success","failedUp","failedDown","isRow","BeforeAfter","verify","bridge","beforeOffset","afterOffset","failure","afterCell","beforeCell","beforeBounds","getRect","afterBounds","isOverlapping","_sharedRow","onSuccess","onFailedUp","onFailedDown","gatherer","cand","gather","handleParent","findBr","br","adjacent","inParent","indexInParent","tryBr","handleBr","tgt","moveDown","caret","moveUp","xDelta","yDelta","toCaret","getElemBox","getBoxAt","getRangedRect","getPartialBox","getEntireBox","adt$1","retry","inOutsideBlock","isOutside","downMovement","adjuster","guessBox","lowerCaret","move","adjustTil","movement","numRetries","isAtTable","adjustForTable","situsFromPoint","guess","newCaret","moved","adjusted","getInnerHeight","checkScroll","scrollBy","Retries","tryUp","higherCaret","tryDown","getJumpSize","findSpot","getSelection","sel","brNeighbour","fromSitus","analysis","_message","process","tryCursor","situs","tryAgain","tryAt","inSameTable","simulate","initial","anchor","spot","handle$1","navigate","precheck","firstUpCheck","seekLeft","lastOffset","lastDownCheck","seekRight","Cell","doRevoke","revoke","singleton","findCell","isInEditableContext","isKey","keycode","isUp","isDown","isNavigation","isBackward","isForward","SimSelection","exactFromRange","simRange","getWin","_finishSitu","_soffset","_finish","_foffset","caretPositionFromPoint","offsetNode","caretRangeFromPoint","availableSearch","beforeSpecial","name$1","makeRange","same","getNativeSelection","doSetNativeRange","removeAllRanges","addRange","doSetRange","setRangeFromRelative","setBaseAndExtent","extend","setLegacyRtlRange","setExact","preprocessExact","setRelative","preprocessRelative","readRange","rangeCount","firstRng","getRangeAt","lastRng","doGetExact","anchorNode","focusNode","focus_1","anchorOffset","focusOffset","setToElement","selectNodeContents$1","get$2","getExact","getFirstRect","rects","getClientRects","getFirstRect$1","getAtPoint","WindowBridge","exactAdt","clearSelection","collapseSelection","toStart","setSelection","setRelativeSelection","selectContents","innerHeight","getScrollY","_DOC","by","rc","mouse","annotations","handlers","clearstate","applySelection","event","clearBeforeUpdate","singleCell","isNonEditableCell","isCellClosestContentEditable","mousedown","mouseover","mouseup","MouseSelection","isEditableNode","isEditableSelection","keyboard","clearToNavigate","keydown","realEvent","which","shiftKey","handler","update$1","attempts","navigation","newSels","update","_","keyup","sync","supports","classList","add$1","id","add$2","SelectionAnnotation","onSelection","onClear","removeSelectionAttributes","addSelectionAttribute","multiple","single","getOtherCells","upOrLeftCells","upGrid","upDetails","slicedCells","getUpOrLeftCells","downOrRightCells","downGrid","downDetails","getDownOrRightCells","fromRawEvent$1","rawEvent","fa","composed","composedPath","getOriginalEventTarget","stopPropagation","prevent","mkEvent","clientX","clientY","useCapture","wrapped","handle","addEventListener","unbind","removeEventListener","bind$1","fromRawEvent","hasInternalTarget","TableCellSelectionHandler","cellSelection","lazyRoot","Selections","otherCells","fireTableSelectionChange","fireTableSelectionClear","_e","mouseHandlers","keyHandlers","external$1","external","lastTarget","lastTimeStamp","handleResponse","response","hasShiftKey","ns","isLeftMouse","button","doubleTap","touchEnd","lT","lTS","timeStamp","buttons","wrappedEvent","getRng","hide","show","addTempAttr","onMultiple","onSingle","Event","fields","trigger","create$1","typeDefs","registry","baseWith","handleUnsupported","required","sorted","validateStrArr","req","reqMessage","invalidKeys","incorrect","invalidTypeMessage","handleExact","unsupported","unsuppMessage","exactly","DragMode","DragSink","DragApi","InDrag","previous","events","onEvent","old","compare","reset","Movement","noDragState","inDragState","dragState","off","isOn","setup","mutation","settings","rate","timer","cancel","active","drop","sink","throttledDrop","clearTimeout","throttle","setTimeout","runIfActive","forceDrop","delayDrop","isActive","destroy","namespace","dashNamespace","resolve$1","MouseDrag","dragApi","blocker","layerClass","position","Blocker","mdown","mup","mmove","mout","BarMutation","drag","delegate","Mutation","resizeBar","resizeRowBar","resizeColBar","wire","drawBar","origin","cpOption","cp","bar","refreshCol","colPositions","tableHeight","colBar","role","refreshRow","rowPositions","tableWidth","rowBar","refreshGrid","warhouse","isResizable","resizableRowBars","resizableRows","resizableRowPositions","_pos","barIndex","resizableColBars","resizableCols","colElmOpt","resizableColumns","resizableColPositions","rows$1_1","bars","resizeBarDragging","BarManager","transform","hoverTable","getResizer","_dataRow","_dataCol","currentCol","getDelta","dir","startAdjust","isColBar","view","tbl","hideBars","showBars","TableResize","lazySizing","hdirection","vdirection","manager","beforeResize","afterResize","startDrag","_event","refreshBars","ResizeWire","chrome","createContainer","padding","margin","barResizerPrefix","TableResizeHandler","startW","startRawW","selectionRng","tableResize","resizeWire","lazyResizingBehaviour","afterCornerResize","isRightEdgeResize","col_1","getNumColumns","isPercentage$1","percentW","isPixel","computedWidth","syncPixels","sz","inline","rawWire","objectResizing","hasTableObjectResizing","rawTable","fireObjectResizeStart","fireObjectResized","targetElm","table_1","addClass","getStyle","getAttrib","getRawWidth","table_2","origin_1","isReadOnly","setupTable","registerOption","register","processor","default","valid","lookupOnSelection","addQueryValueHandler","registerQueryCommands","DomModel"],"mappings":"gGAIA,IAAIA,EAAYC,GAAQA,EAAKD,UAAa,WAStC,OARAA,EAAWE,OAAOC,QAAU,SAASC,GACjC,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KACzDN,EAAEM,GAAKL,EAAEK,IAEjB,OAAON,GAEJJ,EAASc,MAAMb,KAAMO,YAE5BO,EAAiBd,GAAQA,EAAKc,eAAkB,SAAUC,EAAIC,EAAMC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