useblocks 1.1.85-dev.10 → 1.1.85-dev.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (503) hide show
  1. package/README.md +70 -40
  2. package/compat-globals.js +1 -1
  3. package/iframe/.vite/manifest.json +4 -4
  4. package/iframe/js/discussHandlers.sDXLf5I7.js +88 -0
  5. package/iframe/js/{iframe-eblock.body.js → iframe-eblock.body.714faf8a.js} +1 -1
  6. package/iframe/js/iframe-eblock.js +2 -2
  7. package/iframe/js/{iframe.body.js → iframe.body.714faf8a.js} +35 -35
  8. package/iframe/js/iframe.js +2 -2
  9. package/package.json +4 -1
  10. package/runtime/THIRD_PARTY_LICENSES.txt +49 -42
  11. package/runtime/package.json +4 -1
  12. package/runtime/react/index.js +1 -1
  13. package/runtime/uuid/index.js +21 -0
  14. package/static/core/11bc33e0.js +1 -0
  15. package/static/core/1ed86ed3.js +1 -0
  16. package/static/core/248de796.js +1 -0
  17. package/static/core/{e50b6f57.js → 274b5d7a.js} +1 -1
  18. package/static/core/4067c5be.js +1 -0
  19. package/static/core/453596ac.js +27 -0
  20. package/static/core/4b12ae50.js +1 -0
  21. package/static/core/{db82c42b.js → 50d547f6.js} +1 -1
  22. package/static/core/549c0ef1.js +1 -0
  23. package/static/core/{b29146b3.js → 563a690f.js} +5 -5
  24. package/static/core/{c1bf6439.js → 5c62f38b.js} +1 -1
  25. package/static/core/5f949f39.js +1 -0
  26. package/static/core/{e0d71533.js → 60aa31a3.js} +6 -6
  27. package/static/core/{79749848.js → 66619f08.js} +7 -7
  28. package/static/core/7052d050.js +28 -0
  29. package/static/core/{984e936f.js → 7555e955.js} +1 -1
  30. package/static/core/{55a38638.js → 7c89682e.js} +7 -7
  31. package/static/core/83c17079.js +2 -0
  32. package/static/core/{4c83d06a.js → 8c5284f6.js} +1 -1
  33. package/static/core/{e0e5c9b9.js → 958fe93e.js} +2 -2
  34. package/static/core/{6fcb3c31.js → a3f7b4c9.js} +1 -1
  35. package/static/core/{9560f31a.js → a494cc9f.js} +1 -1
  36. package/static/core/{a5996860.js → a6303cb2.js} +1 -1
  37. package/static/core/b8a0f663.js +1 -0
  38. package/static/core/bb65f553.js +1 -0
  39. package/static/core/{4c3f5897.js → c2f990cf.js} +2 -2
  40. package/static/core/{72d350ea.js → c8d6258e.js} +1 -1
  41. package/static/core/{3ece766f.js → d58ae4ac.js} +2 -2
  42. package/static/core/d61988e0.js +7 -0
  43. package/static/core/d887672a.js +1 -0
  44. package/static/core/dcc37768.js +1 -0
  45. package/static/core/{30841c46.js → e50f64f6.js} +1 -1
  46. package/static/core/{175b5b0f.js → ff7d14e8.js} +1 -1
  47. package/static/esm/2490dab8.js +1 -0
  48. package/static/esm/971f1b2c.js +1 -0
  49. package/static/esm/ad8c16a9.js +1 -0
  50. package/static/esm/f76c9d9d.js +1 -0
  51. package/static/umd/6639d610.js +1 -0
  52. package/static/umd-runtime/B7h7P1Np.js +1 -0
  53. package/static/umd-runtime/{DHIkHsbq.js → BAqQTgiL.js} +1 -1
  54. package/static/umd-runtime/{DiNHpyis.js → BB6AXfHj.js} +1 -1
  55. package/static/umd-runtime/{CnUGCoaH.js → BauvM4c_.js} +1 -1
  56. package/static/umd-runtime/{cL_ha9ef.js → CgVJ4rE0.js} +1 -1
  57. package/static/umd-runtime/Cvm7BS4_.js +341 -0
  58. package/static/umd-runtime/{BnE05QKl.js → D7DggGzi.js} +1 -1
  59. package/static/umd-runtime/{2iAslXEF.js → DBbch1O-.js} +1 -1
  60. package/static/umd-runtime/{Bcqtk2f7.js → Dqoi-pC_.js} +2 -2
  61. package/static/umd-runtime/{CDTBLHGd.js → G2k8ELiO.js} +3 -3
  62. package/static/umd-runtime/{CVtPwspX.js → SFp4nbvq.js} +1 -1
  63. package/static/umd-runtime/{DVB_-O4B.js → UsRzAWs2.js} +1 -1
  64. package/static/umd-runtime/runtime.js +1 -1
  65. package/static/umd-runtime/ui-kit-icons.js +1 -1
  66. package/static/umd-runtime/ui-kit.js +2 -2
  67. package/static/umd-runtime/{DP3QTW77.js → uk9LyZos.js} +1 -1
  68. package/useblocks-core.714faf8a.js +859 -0
  69. package/useblocks-esm.js +11 -11
  70. package/{useblocks-po.8098d114.js → useblocks-po.714faf8a.js} +1 -1
  71. package/useblocks.d.ts +109 -25
  72. package/useblocks.js +39 -15
  73. package/vendor/@rc-component/cascader/package.json +1 -1
  74. package/vendor/@rc-component/dialog/es/Dialog/Content/Panel.js +3 -2
  75. package/vendor/@rc-component/dialog/package.json +1 -1
  76. package/vendor/@rc-component/image/es/Preview/index.js +3 -3
  77. package/vendor/@rc-component/image/package.json +1 -1
  78. package/vendor/@rc-component/input/es/BaseInput.js +3 -3
  79. package/vendor/@rc-component/input/es/Input.js +20 -27
  80. package/vendor/@rc-component/{textarea → input}/es/ResizableTextArea.js +5 -4
  81. package/vendor/@rc-component/{textarea → input}/es/TextArea.js +30 -40
  82. package/vendor/@rc-component/{textarea → input}/es/calculateNodeHeight.js +4 -4
  83. package/vendor/@rc-component/input/es/hooks/useCountDisplay.js +25 -0
  84. package/vendor/@rc-component/input/es/hooks/useCountExceed.js +25 -0
  85. package/vendor/@rc-component/input/es/hooks/useMergedValue.js +13 -0
  86. package/vendor/@rc-component/input/es/index.js +3 -1
  87. package/vendor/@rc-component/input/package.json +1 -1
  88. package/vendor/@rc-component/mentions/es/DropdownMenu.js +1 -1
  89. package/vendor/@rc-component/mentions/es/Mentions.js +35 -8
  90. package/vendor/@rc-component/mentions/package.json +1 -1
  91. package/vendor/@rc-component/menu/es/Menu.js +1 -0
  92. package/vendor/@rc-component/menu/es/MenuItem.js +1 -0
  93. package/vendor/@rc-component/menu/es/MenuItemGroup.js +1 -0
  94. package/vendor/@rc-component/menu/es/SubMenu/PopupTrigger.js +1 -0
  95. package/vendor/@rc-component/menu/es/SubMenu/index.js +1 -0
  96. package/vendor/@rc-component/menu/es/context/MenuContext.js +1 -0
  97. package/vendor/@rc-component/menu/es/hooks/useAccessibility.js +1 -0
  98. package/vendor/@rc-component/menu/es/hooks/useKeyRecords.js +1 -0
  99. package/vendor/@rc-component/menu/es/utils/commonUtil.js +1 -0
  100. package/vendor/@rc-component/menu/es/utils/nodeUtil.js +2 -1
  101. package/vendor/@rc-component/menu/es/utils/warnUtil.js +1 -0
  102. package/vendor/@rc-component/menu/package.json +1 -1
  103. package/vendor/@rc-component/notification/LICENSE +21 -0
  104. package/vendor/@rc-component/notification/_/@rc-component/util/LICENSE +22 -0
  105. package/vendor/@rc-component/notification/_/@rc-component/util/es/Children/toArray.js +15 -0
  106. package/vendor/@rc-component/notification/_/@rc-component/util/es/Dom/canUseDom.js +6 -0
  107. package/vendor/@rc-component/notification/_/@rc-component/util/es/Dom/contains.js +13 -0
  108. package/vendor/@rc-component/notification/_/@rc-component/util/es/Dom/dynamicCSS.js +94 -0
  109. package/vendor/@rc-component/notification/_/@rc-component/util/es/Dom/findDOMNode.js +14 -0
  110. package/vendor/@rc-component/notification/_/@rc-component/util/es/Dom/focus.js +99 -0
  111. package/vendor/@rc-component/notification/_/@rc-component/util/es/Dom/isVisible.js +18 -0
  112. package/vendor/@rc-component/notification/_/@rc-component/util/es/Dom/shadow.js +12 -0
  113. package/vendor/@rc-component/notification/_/@rc-component/util/es/Dom/styleChecker.js +2 -0
  114. package/vendor/@rc-component/notification/_/@rc-component/util/es/KeyCode.js +499 -0
  115. package/vendor/@rc-component/notification/_/@rc-component/util/es/Portal.js +28 -0
  116. package/vendor/@rc-component/notification/_/@rc-component/util/es/React/isFragment.js +12 -0
  117. package/vendor/@rc-component/notification/_/@rc-component/util/es/React/render.js +2 -0
  118. package/vendor/@rc-component/notification/_/@rc-component/util/es/getScrollBarSize.js +2 -0
  119. package/vendor/@rc-component/notification/_/@rc-component/util/es/hooks/useControlledState.js +3 -0
  120. package/vendor/@rc-component/notification/_/@rc-component/util/es/hooks/useDelayState.js +4 -0
  121. package/vendor/@rc-component/notification/_/@rc-component/util/es/hooks/useEvent.js +9 -0
  122. package/vendor/@rc-component/notification/_/@rc-component/util/es/hooks/useId.js +23 -0
  123. package/vendor/@rc-component/notification/_/@rc-component/util/es/hooks/useLayoutEffect.js +26 -0
  124. package/vendor/@rc-component/notification/_/@rc-component/util/es/hooks/useMemo.js +12 -0
  125. package/vendor/@rc-component/notification/_/@rc-component/util/es/hooks/useMergedState.js +4 -0
  126. package/vendor/@rc-component/notification/_/@rc-component/util/es/hooks/useState.js +24 -0
  127. package/vendor/@rc-component/notification/_/@rc-component/util/es/hooks/useSyncState.js +20 -0
  128. package/vendor/@rc-component/notification/_/@rc-component/util/es/index.js +36 -0
  129. package/vendor/@rc-component/notification/_/@rc-component/util/es/is.js +21 -0
  130. package/vendor/@rc-component/notification/_/@rc-component/util/es/isEqual.js +35 -0
  131. package/vendor/@rc-component/notification/_/@rc-component/util/es/isMobile.js +11 -0
  132. package/vendor/@rc-component/notification/_/@rc-component/util/es/mergeProps.js +14 -0
  133. package/vendor/@rc-component/notification/_/@rc-component/util/es/omit.js +1 -0
  134. package/vendor/@rc-component/notification/_/@rc-component/util/es/pickAttrs.js +50 -0
  135. package/vendor/@rc-component/notification/_/@rc-component/util/es/proxyObject.js +1 -0
  136. package/vendor/@rc-component/notification/_/@rc-component/util/es/raf.js +36 -0
  137. package/vendor/@rc-component/notification/_/@rc-component/util/es/ref.js +38 -0
  138. package/vendor/@rc-component/notification/_/@rc-component/util/es/test/domHook.js +36 -0
  139. package/vendor/@rc-component/notification/_/@rc-component/util/es/utils/get.js +11 -0
  140. package/vendor/@rc-component/notification/_/@rc-component/util/es/utils/set.js +58 -0
  141. package/vendor/@rc-component/notification/_/@rc-component/util/es/warning.js +46 -0
  142. package/vendor/@rc-component/notification/_/@rc-component/util/package.json +6 -0
  143. package/vendor/@rc-component/notification/es/Notification.js +129 -0
  144. package/vendor/@rc-component/notification/es/NotificationList/Content.js +33 -0
  145. package/vendor/@rc-component/notification/es/NotificationList/index.js +174 -0
  146. package/vendor/@rc-component/notification/es/NotificationProvider.js +4 -3
  147. package/vendor/@rc-component/notification/es/Notifications.js +28 -31
  148. package/vendor/@rc-component/notification/es/Progress.js +10 -0
  149. package/vendor/@rc-component/notification/es/hooks/useClosable.js +30 -0
  150. package/vendor/@rc-component/notification/es/hooks/useListPosition/index.js +50 -0
  151. package/vendor/@rc-component/notification/es/hooks/useListPosition/useSizes.js +33 -0
  152. package/vendor/@rc-component/notification/es/hooks/useNoticeTimer.js +58 -0
  153. package/vendor/@rc-component/notification/es/hooks/useNotification.js +27 -18
  154. package/vendor/@rc-component/notification/es/hooks/useStack.js +4 -4
  155. package/vendor/@rc-component/notification/es/index.js +4 -2
  156. package/vendor/@rc-component/notification/package.json +1 -1
  157. package/vendor/@rc-component/picker/es/PickerInput/Selector/SingleSelector/MultipleDates.js +13 -3
  158. package/vendor/@rc-component/picker/es/PickerInput/Selector/SingleSelector/index.js +3 -1
  159. package/vendor/@rc-component/picker/es/PickerInput/SinglePicker.js +2 -1
  160. package/vendor/@rc-component/picker/package.json +1 -1
  161. package/vendor/@rc-component/table/LICENSE +21 -0
  162. package/vendor/@rc-component/table/es/Body/MeasureCell.js +1 -0
  163. package/vendor/@rc-component/table/es/Body/MeasureRow.js +1 -0
  164. package/vendor/@rc-component/table/es/Cell/useCellRender.js +1 -0
  165. package/vendor/@rc-component/table/es/FixedHolder/index.js +1 -0
  166. package/vendor/@rc-component/table/es/Table.js +17 -9
  167. package/vendor/@rc-component/table/es/VirtualTable/BodyGrid.js +10 -4
  168. package/vendor/@rc-component/table/es/VirtualTable/BodyLine.js +13 -5
  169. package/vendor/@rc-component/table/es/hooks/useColumns/index.js +1 -0
  170. package/vendor/@rc-component/table/es/hooks/useExpand.js +1 -0
  171. package/vendor/@rc-component/table/es/hooks/useFixedInfo.js +1 -0
  172. package/vendor/@rc-component/table/es/hooks/useSticky.js +1 -0
  173. package/vendor/@rc-component/table/es/index.js +2 -1
  174. package/vendor/@rc-component/table/es/stickyScrollBar.js +1 -0
  175. package/vendor/@rc-component/table/es/utils/legacyUtil.js +1 -0
  176. package/vendor/@rc-component/table/es/utils/offsetUtil.js +1 -0
  177. package/vendor/@rc-component/table/package.json +1 -1
  178. package/vendor/@rc-component/tabs/es/TabNavList/OperationNode.js +4 -2
  179. package/vendor/@rc-component/tabs/es/TabNavList/TabNode.js +5 -4
  180. package/vendor/@rc-component/tabs/es/TabNavList/index.js +11 -4
  181. package/vendor/@rc-component/tabs/es/Tabs.js +1 -0
  182. package/vendor/@rc-component/tabs/es/hooks/useAnimateConfig.js +1 -0
  183. package/vendor/@rc-component/tabs/es/hooks/useIndicator.js +1 -0
  184. package/vendor/@rc-component/tabs/es/hooks/useUpdate.js +1 -0
  185. package/vendor/@rc-component/tabs/package.json +1 -1
  186. package/vendor/@rc-component/tour/es/TourStep/DefaultPanel.js +4 -1
  187. package/vendor/@rc-component/tour/package.json +1 -1
  188. package/vendor/@rc-component/tree/es/MotionTreeNode.js +1 -0
  189. package/vendor/@rc-component/tree/es/NodeList.js +2 -2
  190. package/vendor/@rc-component/tree/es/Tree.js +4 -5
  191. package/vendor/@rc-component/tree/es/TreeNode.js +7 -2
  192. package/vendor/@rc-component/tree/es/index.js +3 -0
  193. package/vendor/@rc-component/tree/es/useUnmount.js +1 -0
  194. package/vendor/@rc-component/tree/es/util.js +1 -0
  195. package/vendor/@rc-component/tree/es/utils/conductUtil.js +1 -0
  196. package/vendor/@rc-component/tree/es/utils/treeUtil.js +1 -0
  197. package/vendor/@rc-component/tree/package.json +1 -1
  198. package/vendor/@rc-component/tree-select/package.json +1 -1
  199. package/vendor/@rc-component/util/es/index.js +10 -10
  200. package/vendor/antd/es/_util/ActionButton.js +2 -3
  201. package/vendor/antd/es/_util/ContextIsolator.js +1 -1
  202. package/vendor/antd/es/_util/PurePanel.js +7 -4
  203. package/vendor/antd/es/_util/convertToTooltipProps.js +2 -2
  204. package/vendor/antd/es/_util/fallbackProp.js +15 -0
  205. package/vendor/antd/es/_util/gapSize.js +2 -1
  206. package/vendor/antd/es/_util/getRenderPropValue.js +2 -1
  207. package/vendor/antd/es/_util/getScroll.js +4 -4
  208. package/vendor/antd/es/_util/hooks/index.js +2 -2
  209. package/vendor/antd/es/_util/hooks/useAllowClear.js +25 -0
  210. package/vendor/antd/es/_util/hooks/useClosable.js +6 -5
  211. package/vendor/antd/es/_util/hooks/{useMergeSemantic.js → useMergeSemantic/index.js} +14 -24
  212. package/vendor/antd/es/_util/hooks/useMergeSemantic/utils.js +14 -0
  213. package/vendor/antd/es/_util/hooks/useMergedMask.js +2 -1
  214. package/vendor/antd/es/_util/is.js +27 -0
  215. package/vendor/antd/es/_util/motion.js +8 -8
  216. package/vendor/antd/es/_util/normalizeIcon.js +9 -0
  217. package/vendor/antd/es/_util/placements.js +2 -1
  218. package/vendor/antd/es/_util/reactNode.js +2 -1
  219. package/vendor/antd/es/_util/responsiveObserver.js +3 -2
  220. package/vendor/antd/es/_util/scrollTo.js +3 -1
  221. package/vendor/antd/es/_util/styleChecker.js +1 -0
  222. package/vendor/antd/es/_util/throttleByAnimationFrame.js +1 -0
  223. package/vendor/antd/es/_util/toList.js +1 -1
  224. package/vendor/antd/es/_util/wave/WaveEffect.js +3 -1
  225. package/vendor/antd/es/_util/wave/index.js +14 -4
  226. package/vendor/antd/es/_util/wave/util.js +5 -3
  227. package/vendor/antd/es/alert/Alert.js +12 -10
  228. package/vendor/antd/es/alert/ErrorBoundary.js +1 -1
  229. package/vendor/antd/es/alert/style/index.js +16 -10
  230. package/vendor/antd/es/anchor/Anchor.js +23 -16
  231. package/vendor/antd/es/anchor/AnchorLink.js +4 -4
  232. package/vendor/antd/es/app/App.js +7 -3
  233. package/vendor/antd/es/auto-complete/AutoComplete.js +7 -8
  234. package/vendor/antd/es/avatar/Avatar.js +5 -3
  235. package/vendor/antd/es/back-top/index.js +1 -0
  236. package/vendor/antd/es/badge/Badge.js +5 -6
  237. package/vendor/antd/es/badge/Ribbon.js +1 -2
  238. package/vendor/antd/es/badge/style/index.js +4 -3
  239. package/vendor/antd/es/border-beam/BorderBeam.js +42 -0
  240. package/vendor/antd/es/border-beam/BorderBeamEffect.js +24 -0
  241. package/vendor/antd/es/border-beam/hooks/useBorderSize.js +37 -0
  242. package/vendor/antd/es/border-beam/hooks/useChildDom.js +24 -0
  243. package/vendor/antd/es/border-beam/index.js +7 -0
  244. package/vendor/antd/es/border-beam/style/index.js +60 -0
  245. package/vendor/antd/es/border-beam/util.js +26 -0
  246. package/vendor/antd/es/breadcrumb/Breadcrumb.js +1 -2
  247. package/vendor/antd/es/breadcrumb/BreadcrumbItem.js +1 -1
  248. package/vendor/antd/es/breadcrumb/useItemRender.js +3 -2
  249. package/vendor/antd/es/button/Button.js +7 -6
  250. package/vendor/antd/es/button/buttonHelpers.js +4 -8
  251. package/vendor/antd/es/button/index.js +2 -2
  252. package/vendor/antd/es/button/style/index.js +5 -0
  253. package/vendor/antd/es/calendar/generateCalendar.js +20 -8
  254. package/vendor/antd/es/card/Card.js +5 -7
  255. package/vendor/antd/es/card/CardMeta.js +1 -2
  256. package/vendor/antd/es/carousel/index.js +2 -1
  257. package/vendor/antd/es/cascader/Panel.js +1 -1
  258. package/vendor/antd/es/cascader/index.js +23 -16
  259. package/vendor/antd/es/cascader/style/columns.js +6 -2
  260. package/vendor/antd/es/checkbox/Checkbox.js +2 -3
  261. package/vendor/antd/es/checkbox/Group.js +2 -1
  262. package/vendor/antd/es/checkbox/style/index.js +1 -5
  263. package/vendor/antd/es/checkbox/useBubbleLock.js +1 -0
  264. package/vendor/antd/es/collapse/Collapse.js +3 -3
  265. package/vendor/antd/es/collapse/style/index.js +1 -4
  266. package/vendor/antd/es/color-picker/ColorPicker.js +1 -2
  267. package/vendor/antd/es/color-picker/ColorPickerPanel.js +2 -1
  268. package/vendor/antd/es/color-picker/components/ColorTrigger.js +3 -1
  269. package/vendor/antd/es/color-picker/components/PanelPicker/index.js +1 -0
  270. package/vendor/antd/es/config-provider/hooks/useSize.js +3 -2
  271. package/vendor/antd/es/config-provider/hooks/useTheme.js +2 -0
  272. package/vendor/antd/es/config-provider/index.js +11 -3
  273. package/vendor/antd/es/date-picker/generatePicker/generateRangePicker.js +20 -10
  274. package/vendor/antd/es/date-picker/generatePicker/generateSinglePicker.js +17 -8
  275. package/vendor/antd/es/date-picker/generatePicker/useSuffixIcon.js +1 -1
  276. package/vendor/antd/es/date-picker/hooks/useMergedPickerSemantic.js +1 -2
  277. package/vendor/antd/es/date-picker/style/index.js +13 -3
  278. package/vendor/antd/es/date-picker/style/multiple.js +3 -4
  279. package/vendor/antd/es/date-picker/style/panel.js +5 -20
  280. package/vendor/antd/es/date-picker/util.js +14 -13
  281. package/vendor/antd/es/descriptions/Cell.js +2 -3
  282. package/vendor/antd/es/descriptions/hooks/useItems.js +2 -1
  283. package/vendor/antd/es/descriptions/index.js +3 -3
  284. package/vendor/antd/es/divider/index.js +3 -2
  285. package/vendor/antd/es/drawer/Drawer.js +10 -5
  286. package/vendor/antd/es/drawer/DrawerPanel.js +3 -2
  287. package/vendor/antd/es/dropdown/dropdown.js +11 -8
  288. package/vendor/antd/es/dropdown/style/index.js +2 -6
  289. package/vendor/antd/es/empty/index.js +1 -2
  290. package/vendor/antd/es/flex/index.js +2 -2
  291. package/vendor/antd/es/float-button/BackTop.js +1 -0
  292. package/vendor/antd/es/float-button/FloatButton.js +3 -3
  293. package/vendor/antd/es/float-button/FloatButtonGroup.js +2 -2
  294. package/vendor/antd/es/form/ErrorList.js +13 -6
  295. package/vendor/antd/es/form/Form.js +7 -6
  296. package/vendor/antd/es/form/FormItem/ItemHolder.js +1 -1
  297. package/vendor/antd/es/form/FormItem/index.js +6 -6
  298. package/vendor/antd/es/form/FormItemInput.js +5 -3
  299. package/vendor/antd/es/form/FormItemLabel.js +2 -1
  300. package/vendor/antd/es/form/FormList.js +1 -0
  301. package/vendor/antd/es/form/hooks/useChildren.js +4 -3
  302. package/vendor/antd/es/form/hooks/useForm.js +3 -1
  303. package/vendor/antd/es/form/hooks/useFrameState.js +1 -0
  304. package/vendor/antd/es/form/hooks/useItemRef.js +7 -5
  305. package/vendor/antd/es/form/style/index.js +1 -3
  306. package/vendor/antd/es/grid/col.js +5 -7
  307. package/vendor/antd/es/grid/hooks/useBreakpoint.js +1 -0
  308. package/vendor/antd/es/grid/hooks/useGutter.js +2 -1
  309. package/vendor/antd/es/grid/row.js +7 -6
  310. package/vendor/antd/es/image/PreviewGroup.js +1 -2
  311. package/vendor/antd/es/image/Progress.js +58 -0
  312. package/vendor/antd/es/image/hooks/useMergedPreviewConfig.js +3 -1
  313. package/vendor/antd/es/image/hooks/usePlaceholderConfig.js +15 -0
  314. package/vendor/antd/es/image/hooks/usePreviewConfig.js +3 -2
  315. package/vendor/antd/es/image/index.js +36 -5
  316. package/vendor/antd/es/image/style/index.js +114 -4
  317. package/vendor/antd/es/image/style/progressAnimation.js +26 -0
  318. package/vendor/antd/es/index.js +2 -1
  319. package/vendor/antd/es/input/Input.js +9 -4
  320. package/vendor/antd/es/input/OTP/OTPInput.js +1 -0
  321. package/vendor/antd/es/input/OTP/index.js +3 -3
  322. package/vendor/antd/es/input/Password.js +45 -26
  323. package/vendor/antd/es/input/Search.js +6 -5
  324. package/vendor/antd/es/input/TextArea.js +13 -7
  325. package/vendor/antd/es/input/style/index.js +17 -11
  326. package/vendor/antd/es/input/style/otp.js +2 -1
  327. package/vendor/antd/es/input/style/variants.js +16 -10
  328. package/vendor/antd/es/input-number/index.js +3 -3
  329. package/vendor/antd/es/input-number/style/index.js +9 -9
  330. package/vendor/antd/es/layout/Sider.js +3 -2
  331. package/vendor/antd/es/list/index.js +5 -3
  332. package/vendor/antd/es/locale/en_US.js +3 -1
  333. package/vendor/antd/es/locale/ru_RU.js +3 -1
  334. package/vendor/antd/es/locale/useLocale.js +2 -1
  335. package/vendor/antd/es/masonry/Masonry.js +4 -3
  336. package/vendor/antd/es/mentions/index.js +28 -14
  337. package/vendor/antd/es/menu/MenuItem.js +2 -1
  338. package/vendor/antd/es/menu/OverrideContext.js +1 -0
  339. package/vendor/antd/es/menu/SubMenu.js +1 -1
  340. package/vendor/antd/es/menu/menu.js +5 -5
  341. package/vendor/antd/es/menu/style/index.js +21 -36
  342. package/vendor/antd/es/menu/style/vertical.js +2 -1
  343. package/vendor/antd/es/message/PureList.js +49 -0
  344. package/vendor/antd/es/message/PurePanel.js +28 -36
  345. package/vendor/antd/es/message/index.js +6 -3
  346. package/vendor/antd/es/message/style/index.js +102 -99
  347. package/vendor/antd/es/message/useMessage.js +29 -33
  348. package/vendor/antd/es/message/util.js +1 -1
  349. package/vendor/antd/es/modal/ConfirmDialog.js +11 -9
  350. package/vendor/antd/es/modal/Modal.js +12 -7
  351. package/vendor/antd/es/modal/PurePanel.js +1 -2
  352. package/vendor/antd/es/modal/confirm.js +4 -3
  353. package/vendor/antd/es/modal/shared.js +3 -2
  354. package/vendor/antd/es/modal/useModal/HookModal.js +2 -1
  355. package/vendor/antd/es/notification/PureList.js +46 -0
  356. package/vendor/antd/es/notification/PurePanel.js +37 -56
  357. package/vendor/antd/es/notification/hooks/useStackConfig.js +13 -0
  358. package/vendor/antd/es/notification/index.js +3 -1
  359. package/vendor/antd/es/notification/style/index.js +103 -170
  360. package/vendor/antd/es/notification/style/notification.js +191 -0
  361. package/vendor/antd/es/notification/style/placement.js +117 -60
  362. package/vendor/antd/es/notification/useNotification.js +37 -40
  363. package/vendor/antd/es/notification/util.js +9 -50
  364. package/vendor/antd/es/pagination/Pagination.js +1 -2
  365. package/vendor/antd/es/pagination/useShowSizeChanger.js +2 -1
  366. package/vendor/antd/es/popconfirm/PurePanel.js +4 -1
  367. package/vendor/antd/es/popconfirm/index.js +1 -2
  368. package/vendor/antd/es/popover/PurePanel.js +1 -2
  369. package/vendor/antd/es/popover/index.js +1 -2
  370. package/vendor/antd/es/progress/Circle.js +2 -1
  371. package/vendor/antd/es/progress/progress.js +3 -3
  372. package/vendor/antd/es/progress/utils.js +4 -3
  373. package/vendor/antd/es/qr-code/index.js +4 -4
  374. package/vendor/antd/es/radio/group.js +4 -3
  375. package/vendor/antd/es/radio/radio.js +2 -2
  376. package/vendor/antd/es/radio/style/index.js +1 -1
  377. package/vendor/antd/es/rate/index.js +2 -4
  378. package/vendor/antd/es/result/index.js +6 -5
  379. package/vendor/antd/es/result/style/index.js +10 -6
  380. package/vendor/antd/es/segmented/index.js +5 -3
  381. package/vendor/antd/es/select/index.js +23 -12
  382. package/vendor/antd/es/select/style/dropdown.js +1 -1
  383. package/vendor/antd/es/select/style/select-input.js +23 -15
  384. package/vendor/antd/es/select/useIcons.js +43 -26
  385. package/vendor/antd/es/skeleton/Element.js +2 -1
  386. package/vendor/antd/es/skeleton/Skeleton.js +3 -3
  387. package/vendor/antd/es/slider/SliderTooltip.js +1 -0
  388. package/vendor/antd/es/slider/index.js +5 -3
  389. package/vendor/antd/es/slider/useRafLock.js +1 -0
  390. package/vendor/antd/es/space/Compact.js +1 -1
  391. package/vendor/antd/es/space/Item.js +1 -1
  392. package/vendor/antd/es/space/index.js +2 -2
  393. package/vendor/antd/es/space/style/addon.js +5 -2
  394. package/vendor/antd/es/spin/Indicator/Progress.js +2 -1
  395. package/vendor/antd/es/spin/index.js +1 -2
  396. package/vendor/antd/es/splitter/Panel.js +7 -3
  397. package/vendor/antd/es/splitter/SplitBar.js +5 -4
  398. package/vendor/antd/es/splitter/Splitter.js +9 -6
  399. package/vendor/antd/es/splitter/hooks/useItems.js +2 -1
  400. package/vendor/antd/es/splitter/hooks/useSizes.js +1 -1
  401. package/vendor/antd/es/splitter/style/index.js +8 -6
  402. package/vendor/antd/es/statistic/Number.js +8 -4
  403. package/vendor/antd/es/statistic/Statistic.js +14 -10
  404. package/vendor/antd/es/steps/index.js +4 -4
  405. package/vendor/antd/es/style/compact-item-vertical.js +2 -1
  406. package/vendor/antd/es/style/compact-item.js +6 -6
  407. package/vendor/antd/es/switch/index.js +1 -2
  408. package/vendor/antd/es/table/InternalTable.js +23 -14
  409. package/vendor/antd/es/table/hooks/useFilledColumns.js +23 -0
  410. package/vendor/antd/es/table/hooks/useFilter/FilterDropdown.js +22 -16
  411. package/vendor/antd/es/table/hooks/useFilter/FilterWrapper.js +1 -0
  412. package/vendor/antd/es/table/hooks/useFilter/index.js +34 -18
  413. package/vendor/antd/es/table/hooks/useLazyKVMap.js +2 -1
  414. package/vendor/antd/es/table/hooks/usePagination.js +7 -4
  415. package/vendor/antd/es/table/hooks/useSelection.js +32 -21
  416. package/vendor/antd/es/table/hooks/useSorter.js +10 -5
  417. package/vendor/antd/es/table/style/bordered.js +5 -27
  418. package/vendor/antd/es/table/style/empty.js +1 -4
  419. package/vendor/antd/es/table/style/index.js +1 -4
  420. package/vendor/antd/es/table/util.js +6 -6
  421. package/vendor/antd/es/tabs/hooks/useAnimateConfig.js +2 -1
  422. package/vendor/antd/es/tabs/index.js +1 -2
  423. package/vendor/antd/es/tag/CheckableTagGroup.js +8 -5
  424. package/vendor/antd/es/tag/hooks/useColor.js +4 -3
  425. package/vendor/antd/es/tag/index.js +13 -7
  426. package/vendor/antd/es/theme/themes/dark/colors.js +2 -1
  427. package/vendor/antd/es/theme/themes/default/colors.js +2 -1
  428. package/vendor/antd/es/theme/useToken.js +2 -2
  429. package/vendor/antd/es/theme/util/alias.js +34 -29
  430. package/vendor/antd/es/timeline/Timeline.js +3 -4
  431. package/vendor/antd/es/tooltip/PurePanel.js +1 -2
  432. package/vendor/antd/es/tooltip/UniqueProvider/index.js +2 -1
  433. package/vendor/antd/es/tooltip/index.js +9 -7
  434. package/vendor/antd/es/tour/PurePanel.js +2 -2
  435. package/vendor/antd/es/tour/index.js +1 -1
  436. package/vendor/antd/es/tour/panelRender.js +4 -2
  437. package/vendor/antd/es/transfer/ListBody.js +3 -1
  438. package/vendor/antd/es/transfer/ListItem.js +2 -1
  439. package/vendor/antd/es/transfer/Section.js +17 -8
  440. package/vendor/antd/es/transfer/index.js +51 -16
  441. package/vendor/antd/es/transfer/style/index.js +5 -1
  442. package/vendor/antd/es/tree/Tree.js +1 -2
  443. package/vendor/antd/es/tree/style/index.js +5 -1
  444. package/vendor/antd/es/tree/utils/iconUtil.js +5 -4
  445. package/vendor/antd/es/tree-select/index.js +3 -3
  446. package/vendor/antd/es/typography/Base/CopyBtn.js +3 -2
  447. package/vendor/antd/es/typography/Base/Ellipsis.js +3 -3
  448. package/vendor/antd/es/typography/Base/index.js +38 -31
  449. package/vendor/antd/es/typography/Editable.js +10 -4
  450. package/vendor/antd/es/typography/Link.js +1 -0
  451. package/vendor/antd/es/typography/Text.js +2 -1
  452. package/vendor/antd/es/typography/Typography.js +20 -10
  453. package/vendor/antd/es/typography/hooks/useCopyClick.js +2 -1
  454. package/vendor/antd/es/typography/hooks/useMergedConfig.js +13 -7
  455. package/vendor/antd/es/typography/hooks/useTooltipProps.js +2 -1
  456. package/vendor/antd/es/typography/hooks/useTypographySemantic.js +33 -0
  457. package/vendor/antd/es/typography/style/index.js +12 -27
  458. package/vendor/antd/es/typography/style/mixins.js +46 -13
  459. package/vendor/antd/es/upload/Upload.js +13 -7
  460. package/vendor/antd/es/upload/UploadList/ListItem.js +6 -5
  461. package/vendor/antd/es/upload/UploadList/index.js +4 -3
  462. package/vendor/antd/es/upload/utils.js +18 -1
  463. package/vendor/antd/es/version/version.js +1 -1
  464. package/vendor/antd/es/watermark/index.js +6 -4
  465. package/vendor/antd/es/watermark/useSingletonCache.js +1 -0
  466. package/vendor/antd/es/watermark/useWatermark.js +3 -3
  467. package/vendor/antd/package.json +1 -1
  468. package/vendor/useblocks-ui-kit/es/components/DataEntry/Input/index.js +1 -1
  469. package/vendor/useblocks-ui-kit/package.json +1 -1
  470. package/iframe/js/discussHandlers.CCCXIEaO.js +0 -88
  471. package/static/core/1f101241.js +0 -1
  472. package/static/core/1fa93ad8.js +0 -28
  473. package/static/core/2007bc93.js +0 -1
  474. package/static/core/30ab7b1d.js +0 -1
  475. package/static/core/440a91be.js +0 -1
  476. package/static/core/44e96a78.js +0 -1
  477. package/static/core/823aedee.js +0 -1
  478. package/static/core/828583e1.js +0 -2
  479. package/static/core/8cc6e392.js +0 -1
  480. package/static/core/9aefcefb.js +0 -1
  481. package/static/core/a4f90443.js +0 -27
  482. package/static/core/a7ac37cd.js +0 -1
  483. package/static/core/df41de18.js +0 -7
  484. package/static/esm/349f9e2c.js +0 -1
  485. package/static/esm/50fbfdf6.js +0 -1
  486. package/static/media/icon-sets/lucide.json +0 -6275
  487. package/static/media/icon-sets/tabler.json +0 -19336
  488. package/static/umd-runtime/Cl8heeC3.js +0 -1
  489. package/static/umd-runtime/D0xo8o9c.js +0 -335
  490. package/useblocks-core.8098d114.js +0 -859
  491. package/vendor/@rc-component/notification/es/Notice.js +0 -106
  492. package/vendor/@rc-component/notification/es/NoticeList.js +0 -98
  493. package/vendor/@rc-component/textarea/LICENSE.md +0 -9
  494. package/vendor/@rc-component/textarea/es/index.js +0 -6
  495. package/vendor/@rc-component/textarea/package.json +0 -6
  496. package/vendor/antd/es/_util/extendsObject.js +0 -12
  497. package/vendor/antd/es/_util/getAllowClear.js +0 -12
  498. package/vendor/antd/es/_util/isNonNullable.js +0 -6
  499. package/vendor/antd/es/_util/isPrimitive.js +0 -4
  500. package/vendor/antd/es/notification/style/pure-panel.js +0 -18
  501. package/vendor/antd/es/notification/style/stack.js +0 -85
  502. /package/iframe/{iframe-eblock.8098d114.html → iframe-eblock.714faf8a.html} +0 -0
  503. /package/iframe/{iframe.8098d114.html → iframe.714faf8a.html} +0 -0
@@ -1,9 +1,9 @@
1
- __useblocks__.define("js/iframe.js",["require","exports","module","js/rolldown-runtime.BRlIiq3h.js","js/discussHandlers.CCCXIEaO.js"],function(Lo,Ng,Bg){const qi=Lo("./rolldown-runtime.BRlIiq3h.js"),a=Lo("./discussHandlers.CCCXIEaO.js");var At=null;function wo(e){const o=window.getSelection();if(o&&o.rangeCount>0){const t=o.getRangeAt(0);if(e.contains(t.startContainer))return{container:t.startContainer,offset:t.startOffset}}return At&&At.container.isConnected&&e.contains(At.container)?At:null}function Wi(e){const o=[],t=Array.from(e.childNodes);let n=[],r=0;return t.forEach((i,l)=>{i.nodeType===Node.ELEMENT_NODE&&i.tagName==="BR"?(n.length>0&&o.push({html:Yt(n),nodes:[...n],startIndex:r,endIndex:l-1}),n=[],r=l+1):n.push(i)}),n.length>0&&o.push({html:Yt(n),nodes:[...n],startIndex:r,endIndex:t.length-1}),o}function $i(e){const o=[],t=Array.from(e.childNodes);let n=[],r=0;const i=s=>{n.length>0&&(o.push({html:Yt(n),nodes:[...n],startIndex:r,endIndex:s-1}),n=[])},l=s=>s.nodeType===Node.ELEMENT_NODE&&(s.tagName==="UL"||s.tagName==="OL");return t.forEach((s,c)=>{s.nodeType===Node.ELEMENT_NODE&&s.tagName==="BR"?(i(c),r=c+1):l(s)?(i(c),o.push({html:Yt([s]),nodes:[s],startIndex:c,endIndex:c}),r=c+1):n.push(s)}),i(t.length),o}function Yt(e){const o=document.createElement("div");return e.forEach(t=>o.appendChild(t.cloneNode(!0))),o.innerHTML}function ko(e,o){const t=wo(o);if(!t)return 0;const n=t.container;if(!o.contains(n))return 0;for(let r=0;r<e.length;r++)for(const i of e[r].nodes)if(i===n||i.contains(n))return r;if(n===o){const r=t.offset;for(let i=0;i<e.length;i++)if(r>=e[i].startIndex&&r<=e[i].endIndex)return i;for(let i=0;i<e.length;i++)if(r===e[i].startIndex)return i;for(let i=0;i<e.length;i++)if(e[i].startIndex>=r)return i;if(e.length>0)return e.length-1}return 0}function An(e,o,t,n){if(!t.contains(o))return n;for(let r=0;r<e.length;r++)for(const i of e[r].nodes)if(i===o||i.contains(o))return r;return n}function zi(e,o){const t=window.getSelection();if(!t||t.rangeCount===0){const s=ko(e,o);return{start:s,end:s}}const n=t.getRangeAt(0);if(n.collapsed){const s=ko(e,o);return{start:s,end:s}}const r=ko(e,o),i=An(e,n.startContainer,o,r),l=An(e,n.endContainer,o,r);return{start:Math.min(i,l),end:Math.max(i,l)}}function Vi(e){return e.querySelector("br")!==null}function Ui(e){const o=wo(e);if(!o)return null;const t=o.container.nodeType===Node.ELEMENT_NODE?o.container:o.container.parentElement;if(!t)return null;const n=t.closest("ol, ul");return n&&e.contains(n)?n:null}function ji(e){const o=wo(e);if(!o)return;const{container:t,offset:n}=o;if(t!==e)return;const r=Array.from(e.childNodes),i=n>0?r[n-1]:null,l=n<r.length?r[n]:null,s=b=>b!==null&&b.nodeType===Node.ELEMENT_NODE&&b.tagName==="BR",c=b=>b!==null&&b.nodeType===Node.TEXT_NODE&&b.data.trim()==="",d=s(i),u=s(l),g=c(l),m=n>=r.length;if(!(d&&u||d&&m||n===0&&u||d&&g))return;let f;g?(f=l,f.data=" "):(f=document.createTextNode(" "),l?e.insertBefore(f,l):e.appendChild(f));const p=window.getSelection();if(p){const b=document.createRange();b.setStart(f,0),b.collapse(!0),p.removeAllRanges(),p.addRange(b)}At={container:f,offset:0}}function Gi(e,o){const t=o?"ol":"ul";if(e.querySelector("ol, ul")){const n=Ui(e);if(n){if(n.tagName.toLowerCase()===t)return;const l=document.createElement(t);for(Array.from(n.attributes).forEach(s=>{s.name!=="style"&&l.setAttribute(s.name,s.value)}),l.setAttribute("style",a.STANDARD_LIST_STYLES.LIST);n.firstChild;)l.appendChild(n.firstChild);n.parentNode?.replaceChild(l,n);return}const r=e.querySelector(":scope > ol, :scope > ul"),i=Array.from(e.childNodes).some(l=>l.nodeType===Node.ELEMENT_NODE&&l.tagName==="BR");if(r&&!i){if(r.tagName.toLowerCase()===t)return;const l=document.createElement(t);for(Array.from(r.attributes).forEach(s=>{s.name!=="style"&&l.setAttribute(s.name,s.value)}),l.setAttribute("style",a.STANDARD_LIST_STYLES.LIST);r.firstChild;)l.appendChild(r.firstChild);r.parentNode?.replaceChild(l,r);return}}Vi(e)||e.querySelector(":scope > ol, :scope > ul")?(ji(e),Yi(e,t)):Tn(e,t)}function Tn(e,o){const t=document.createElement(o);t.setAttribute("style",a.STANDARD_LIST_STYLES.LIST);const n=document.createElement("li");n.setAttribute("style",a.STANDARD_LIST_STYLES.LIST_ITEM);const r=e.innerHTML.trim();r?n.innerHTML=r:n.innerHTML="&nbsp;",t.appendChild(n),e.innerHTML="",e.appendChild(t),Ln(n)}function Yi(e,o){const t=$i(e);if(t.length===0){Tn(e,o);return}const{start:n,end:r}=zi(t,e),i=document.createElement(o);i.setAttribute("style",a.STANDARD_LIST_STYLES.LIST);let l=null;for(let d=n;d<=r;d++){const u=document.createElement("li");u.setAttribute("style",a.STANDARD_LIST_STYLES.LIST_ITEM),u.innerHTML=t[d].html.trim()||"&nbsp;",i.appendChild(u),l=u}const s=t.slice(0,n).map(d=>d.html).join("<br>"),c=t.slice(r+1).map(d=>d.html).join("<br>");if(e.innerHTML="",s.trim()){const d=document.createElement("span");for(d.innerHTML=s;d.firstChild;)e.appendChild(d.firstChild);e.appendChild(document.createElement("br"))}if(e.appendChild(i),c.trim()){e.appendChild(document.createElement("br"));const d=document.createElement("span");for(d.innerHTML=c;d.firstChild;)e.appendChild(d.firstChild)}l&&Ln(l)}function Ln(e){try{const o=window.getSelection();if(o){const t=document.createRange();t.selectNodeContents(e),t.collapse(!0),o.removeAllRanges(),o.addRange(t)}}catch{}}function Ki(e,o){let t=0;const n=Array.from(e.childNodes);for(const r of n){if(r===o)return t;r.nodeType===Node.ELEMENT_NODE&&r.tagName==="BR"&&t++}return t}function Xi(e,o){const t=Wi(e);if(o<0||o>=t.length)return;const n=t[o];if(n.nodes.length!==0)try{const r=window.getSelection();if(!r)return;const i=n.nodes[0],l=document.createRange();if(i.nodeType===Node.TEXT_NODE)l.setStart(i,0),l.collapse(!0);else if(i.nodeType===Node.ELEMENT_NODE)l.selectNodeContents(i),l.collapse(!0);else return;r.removeAllRanges(),r.addRange(l)}catch{}}function Zi(e){const o=e.querySelector("ol, ul");if(!o)return;const t=Ki(e,o),n=o.querySelectorAll("li"),r=[];n.forEach(l=>{const s=l.innerHTML.trim();s&&s!=="&nbsp;"&&r.push(s)});const i=r.join("<br>");i?o.outerHTML=i:o.outerHTML="&nbsp;",Xi(e,t)}function Kt(e){if(!e)return!1;const o=e.closest("ul, ol");return o?!o.closest(a.TABLE_LIST_SELECTOR):!1}function wn(e){return e.getAttribute("src")}function Xt(e,o){const t=a.resolveActiveElement(e.elem),n=wn(t),r=a.getElementMobileProps({elem:t}),i=t.closest("td"),l=i?a.getElementMobileProps({elem:i}):null;let s="img",c=o.PICTURE;e.elem.classList.contains("em-countdown")?(s="countdown",c=o.COUNTDOWN):e.elem.classList.contains("em-video")&&(s="video",c=o.VIDEO);const d=g=>g===null||g==="auto"?null:typeof g=="number"?g:null,u={type:s,caption:c,src:n??"",width:kn(t,"width"),height:kn(t,"height"),alt:t.getAttribute("alt")??"",title:t.getAttribute("title")??"",align:i?.getAttribute("align")??"undefined",valign:t.style?.verticalAlign??"undefined",border:a.getElementBorder(t),borderRadius:a.getElementBorderRadius(t),boxShadow:a.getElementBoxShadow(t),mobileWidth:{value:d(r.mobileWidth),dim:r.mobileWidthDim??"px"},mobileHeight:{value:d(r.mobileHeight),dim:r.mobileHeightDim??"px"},mobileBorder:r.mobileBorder,mobileBorderRadius:r.mobileBorderRadius,mobileBoxShadow:r.mobileBoxShadow,mobileAlign:l?.mobileAlign,mobileVerticalAlign:r.mobileVerticalAlign,show:r.show,link:t.closest("a")?.getAttribute("href")??null,renderedWidth:Math.round(e.elem.getBoundingClientRect().width),renderedHeight:Math.round(e.elem.getBoundingClientRect().height),imgReplacer:t.closest("em-replace")?.getAttribute("src")??""};if(s==="countdown"&&(u.countdown=e.elem.getAttribute("em-cd-settings")??void 0),s==="video"){const g=e.elem.getAttribute("em-video-settings");if(g)try{u.video=JSON.parse(g.replaceAll("'",'"'))}catch{u.video={}}}return a.isShowOnMobile(e.elem)&&(u.showOnMobile=!0),i&&(u.maxWidth=Math.round(i.getBoundingClientRect().width)),u}function kn(e,o){const t=e.getAttribute(o);return!t||t==="auto"?{value:null,dim:"px"}:{value:parseFloat(t),dim:t.includes("%")?"%":"px"}}function _n(e){return e.tagName==="IMG"||e.tagName==="AMP-IMG"}var Nn="em-mob-text_align-",Ji=":scope > tr > td, :scope > tbody > tr > td",Qi='div[style*="font-family"][style*="font-size"]';function _o(e){return e.querySelector(Ji)}function No(e){return e.querySelector(Qi)}function el(e,o){for(let t=e;t&&t!==o;t=t.parentElement)if(t.tagName.includes("-"))return!0;return!1}function Bn(e){const o=e.closest('table[em="atom"]');if(!o||el(e,o))return null;const t=_o(o);return t?{atomTd:t,textDiv:No(t)}:null}function Tt(e){const o=e.closest("div, p, td");if(!o)return null;if(o.style.textAlign)return o;const t=Bn(e);return t?t.textDiv?.hasAttribute("align")?t.textDiv:t.atomTd:o}function Mn(e){const o=Tt(e);return o&&(o.style.textAlign||o.getAttribute("align"))||"left"}function tl(e){const o=Tt(e);if(!o)return"";for(const t of o.classList)if(t.startsWith("em-mob-text_align-"))return t.slice(18);return""}function Bo(e){return{value:tl(e)}}function ol(e,o,t=Nn){const n=Bn(e);if(n)for(const r of[n.atomTd,n.textDiv])r&&r!==o&&a.removeClassesByPrefix(r,t)}function nl(e){const o=_o(e);if(!o)return null;const t=No(o);return t?.hasAttribute("align")?t:o}function rl(e,o){e.querySelectorAll('[em="atom"]').forEach(t=>{const n=nl(t);n&&o(n,t)})}function il(e,o,t=Nn){const n=_o(e),r=n?No(n):null;for(const i of[n,r])i&&i!==o&&a.removeClassesByPrefix(i,t)}function Zt(e,o,t){const n=a.getParentElementOfSelection()||e.elem,r=n.tagName==="EDITOR"&&n.firstChild?.nodeType===1?n.firstChild:n,i=e.elem.closest('[style*="font-family"], [style*="font-size"], [style*="line-height"]')||e.elem,l=r.style.fontFamily||r.style.fontSize||r.style.lineHeight||r.closest('[style*="font-family"], [style*="font-size"], [style*="line-height"]')?r:i,s=e.elem.closest('[style*="line-height"]')||l.querySelector('[style*="line-height"]')||l,c=n.closest('[class*="em-mob-font_size"]')||n.closest('[style*="font-size"]')||n,d=n.closest('[class*="em-mob-line_height"]')||n.closest('[style*="line-height"]')||n,u=a.getElementMobileProps({elem:c}),g=a.getElementMobileProps({elem:d}),m=Rn(e.elem,t),f=a.textHasStyle$1(r,"strong","b"),p=l!==r?a.textHasStyle$1(l,"strong","b"):!1,b=e.elem&&r&&e.elem.isConnected&&(r===e.elem||r.contains(e.elem))?a.textHasStyle$1(e.elem,"strong","b"):!1,h=f||p||b,y=a.isElementHasBold(l),E=h||y,S={type:"text",caption:o.TEXT,fontFamily:a.getFontFamilyFromElement$1(l.closest('[style*="font-family"]')||e.elem),fontSize:parseFloat(e.elem.closest('[style*="font-size"]')?.style.fontSize)||parseFloat(getComputedStyle(e.elem).fontSize),fontSizeDim:"px",lineHeight:a.getLineHeightInPixels$1(s),lineHeightDim:"px",textAlign:Mn(e.elem),textStrong:E,textItalic:a.textHasStyle$1(e.elem,"i","em")||!l.closest('[style*="font-style: normal"]')&&l.style?.fontStyle==="italic",textStrikethrough:a.textHasStyle$1(e.elem,"s","strike")||(l.style?.textDecoration?.includes("line-through")??!1),textUnderline:a.textHasStyle$1(e.elem,"u")||(l.style?.textDecoration?.includes("underline")??!1)||!l.style?.textDecoration&&(e.elem.tagName==="A"&&e.elem.hasAttribute("href")||a.hasLinkInSelection()),textColor:a.rgbToHex(e.elem.closest('[style*="color"]')?.style.color)||a.rgbToHex(getComputedStyle(e.elem).color)||"",textBackgroundColor:cl(e.elem),mobileFontSize:{value:u.mobileFontSize,dim:u.mobileFontSizeDim||"px"},mobileLineHeight:{value:g.mobileLineHeight,dim:"px"},mobileTextAlign:Bo(e.elem),linkHref:(()=>{const v=l.closest("a");if(!v)return;const C=v.getAttribute("href");if(C!==null)return C})(),textAnchor:(()=>{const v=l.closest("a");if(v&&!v.hasAttribute("href"))return v.getAttribute("name")?.trim()||void 0})(),textLink:(()=>{const v=l.closest("a");return v?!!v.hasAttribute("href"):a.textHasStyle$1(e.elem,"a")||a.hasLinkInSelection()})(),textReplacer:t.variableElement(e.elem),list:m,standardList:Pn(e.elem),textSuperscript:a.textHasStyle$1(e.elem,"sup"),textSubscript:a.textHasStyle$1(e.elem,"sub")};return a.isShowOnMobile(n)&&(S.showOnMobile=!0),S}function Rn(e,o){const{isElementList:t,isElementListOL:n,isElementListUL:r,requestElemBullet:i}=o;if(!t)return{isList:!1,listType:"UL"};const l=e.closest("td");return{isList:!0,listType:n?"OL":"UL",bulletsColor:t&&i?a.rgbToHex(i.closest('[style*="color"]')?.style.color):"",betweenParagraphs:t&&parseInt(l?.style?.paddingBottom,10)||0,betweenRowCell:t&&parseInt(l?.style?.paddingLeft,10)||0,bulletFontSize:t&&i&&parseInt(i.style.fontSize,10)||0,bulletFontBold:t?i?.style.fontWeight==="bold":!1,bulletFontItalic:t?i?.style.fontStyle==="italic":!1,bulletFontFamily:n&&i?a.getFontFamilyFromElement$1(i):"",bulletFontUnderline:t?i?.style.textDecoration?.includes("underline")??!1:!1,bulletFontStrikethrough:t?i?.style.textDecoration?.includes("line-through")??!1:!1,bulletType:r&&i?i.innerHTML.replace(/\s|&nbsp;/g,""):""}}function Pn(e){return Kt(e)?{listTypeOL:!!e.querySelector("ol")||!!e.closest("ol"),listTypeUL:!!e.querySelector("ul")||!!e.closest("ul")}:{listTypeOL:!1,listTypeUL:!1}}function Mo(e){if(!e)return!1;const o=e.trim().toLowerCase();return o!=="transparent"&&o!=="inherit"}var ll=new Set(["A","B","EM","I","MARK","S","SMALL","SPAN","STRIKE","STRONG","SUB","SUP","U"]);function al(e){let o=e;for(;o&&ll.has(o.tagName);){const t=o.style.backgroundColor;if(Mo(t))return t;o=o.parentElement}return""}function sl(e,o,t){let n=e;for(;n;){const r=n.style.getPropertyValue(o);if(Mo(r))return r;if(t&&n===t)break;n=n.parentElement}return""}function cl(e){const o=al(e);if(Mo(o))return a.rgbToHex(o)||"";if(e.closest(".em-element-custom-table"))return a.rgbToHex(a.findParentWithExplicitStyle(e,"background-color"))||"";const t=e.closest("div");return a.rgbToHex(sl(e,"background-color",t))||""}function dl(e){return e.tagName==="DIV"?!!(e.style.fontFamily&&e.style.fontSize&&e.style.lineHeight):e.tagName==="TD"?e.firstChild?.tagName==="EDITOR"||e.firstElementChild?.tagName==="EDITOR":!1}function ml(e,o,t){const{findElementWithSelectedText:n,selectedText:r,variableElement:i,requestElemBullet:l,isElementList:s,isElementListOL:c,isElementListUL:d}=t,u=n(r,e.elem)||e.elem,g=e.elem.closest('[class*="em-mob-font_size"]')||e.elem.closest('[style*="font-size"]')||e.elem,m=e.elem.closest('[class*="em-mob-line_height"]')||e.elem.closest('[style*="line-height"]')||e.elem,f=a.getElementMobileProps({elem:g}),p=a.getElementMobileProps({elem:m}),b=Rn(e.elem,t),h={type:"text",caption:o.TEXT,linkHref:(()=>{const y=e.elem.getAttribute("href");if(y!==null)return y})(),textAnchor:(()=>{if(!e.elem.hasAttribute("href"))return e.elem.getAttribute("name")?.trim()||void 0})(),textLink:!!e.elem.hasAttribute("href"),target:e.elem.getAttribute("target")??"",fontFamily:a.getFontFamilyFromElement$1(e.elem),fontSize:parseFloat(e.elem.closest('[style*="font-size"]')?.style.fontSize)||0,fontSizeDim:"px",lineHeight:a.getLineHeightInPixels$1(e.elem),lineHeightDim:"px",textAlign:Mn(e.elem),textStrong:a.textHasStyle$1(u,"strong","b")||a.isElementHasBold(u),textItalic:a.textHasStyle$1(u,"i","em")||!e.elem.closest('[style*="font-style: normal"]')&&e.elem.style?.fontStyle==="italic",textStrikethrough:a.textHasStyle$1(u,"s","strike")||(e.elem.style?.textDecoration?.includes("line-through")??!1),textUnderline:a.textHasStyle$1(u,"u")||(e.elem.style?.textDecoration?.includes("underline")??!1)||!(e.elem.style?.textDecoration?.length>0)&&e.elem.tagName==="A"&&e.elem.hasAttribute("href"),textColor:a.rgbToHex(e.elem.tagName==="A"?a.findParentWithExplicitStyle(e.elem.querySelector('[style*="color"]'),"color"):a.findParentWithExplicitStyle(e.elem,"color"))||a.rgbToHex(getComputedStyle(e.elem).color)||"",textBackgroundColor:a.rgbToHex(e.elem.tagName==="A"?a.findParentWithExplicitStyle(e.elem.querySelector('[style*="background-color"]'),"background-color"):a.findParentWithExplicitStyle(e.elem,"background-color"))||"",mobileFontSize:{value:f.mobileFontSize,dim:f.mobileFontSizeDim||"px"},mobileLineHeight:{value:p.mobileLineHeight,dim:"px"},mobileTextAlign:Bo(e.elem),textReplacer:i(e.elem),list:b,standardList:Pn(e.elem),textSuperscript:a.textHasStyle$1(e.elem,"sup"),textSubscript:a.textHasStyle$1(e.elem,"sub")};return a.isShowOnMobile(e.elem)&&(h.showOnMobile=!0),h}function Ro(e){let o="";if(e.nodeType===Node.COMMENT_NODE&&e.nodeValue?.includes("[if mso]")){const t=e.nodeValue.replace(/^\[if mso\]>/i,"").replace(/<!\[endif\]$/i,"").trim();o+=t}return e.childNodes.forEach(t=>{o+=Ro(t)}),o}function Po(e,o,t={value:0}){e.nodeType===Node.COMMENT_NODE&&e.nodeValue?.includes("[if mso]")&&(t.value===0?e.nodeValue=`[if mso]>${o}<![endif]`:e.nodeValue="",t.value++),e.childNodes.forEach(n=>Po(n,o,t))}function ul(e,o){const t=e.getAttribute(o);return!t||t==="auto"?{value:null,dim:"px"}:{value:parseFloat(t),dim:t.includes("%")?"%":"px"}}function Hn(e,o){const t=e.style[o];return t?{value:parseFloat(t),dim:t.includes("%")?"%":"px"}:{value:null,dim:"px"}}function fl(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function pl(e){if(e.style.backgroundImage){const o=e.style.backgroundImage;return[{type:"url",value:o.substring(5,o.length-2)}]}return e.getAttribute("background")?[{type:"url",value:e.getAttribute("background")||""}]:[{type:"url",value:""}]}function gl(e,o){const t=e.elem;if(t.innerHTML==="")return{type:"emptyTable",caption:o.TABLE};t.setAttribute("em-edit","active");const n=a.getElementMobileProps({elem:t}),r={type:"table",caption:o.TABLE,backgroundColor:t.style.backgroundColor?a.rgbToHex(t.style.backgroundColor):"",backgroundImage:pl(t),backgroundPositionX:t.style.backgroundPositionX!=="initial"?t.style.backgroundPositionX:"",backgroundPositionY:t.style.backgroundPositionY!=="initial"?t.style.backgroundPositionY:"",backgroundRepeat:t.style.backgroundRepeat||"repeat",backgroundSize:t.style.backgroundSize||"auto",width:ul(t,"width"),maxWidth:Hn(t,"maxWidth"),minWidth:Hn(t,"minWidth"),align:t.getAttribute("align")??"",border:a.getElementBorder(t),boxShadow:a.getElementBoxShadow(t),borderRadius:a.getElementBorderRadius(t),mobileWidth:{value:fl(n.mobileWidth),dim:n.mobileWidthDim??"px"},mobileBorder:n.mobileBorder,mobileBorderRadius:n.mobileBorderRadius,mobileBoxShadow:n.mobileBoxShadow,show:n.show,mobileAlign:n.mobileAlign,mobileBackgroundColor:n.mobileBackgroundColor,mobileBackgroundImage:n.mobileBackgroundImage,mobileBackgroundPositionX:n.mobileBackgroundPositionX,mobileBackgroundPositionY:n.mobileBackgroundPositionY,mobileBackgroundRepeat:n.mobileBackgroundRepeat,mobileBackgroundSize:n.mobileBackgroundSize,exportAsPicture:t.getAttribute("em-operation")==="exportAsPicture",outlookBackground:a.hasElementVMLBackground(t,"around")};return a.isShowOnMobile(t)&&(r.showOnMobile=!0),r}function bl(e){return e.tagName==="TABLE"&&e.getAttribute("em")!=="atom"}function hl(e){return e.closest("em-replace")?.getAttribute("text")||null}var yl=()=>a.isInitialized()?a.getHtmlDocument():null,El=()=>a.state.get("isProgrammaticSelection");function Sl(e){if(!a.isElementLocked())try{a.incrementLock(),a.removeAllAttributes("em-edit");let o={};if(!e.elem)return;const t=Cl(e.elem);if(!t)return;e.elem=t;const n=vl(e.elem);document.body.classList.contains("mceNonEditable")||Al(e.elem),o=wl(e,n),o.type&&(o.operation="application_element_settings_set",a.messageService.send(o))}finally{a.decrementLock()}}function Cl(e){const o=yl();return!o||!o.getMappedParent(e)?e:o.getVisibleNode(e)}function vl(e){const o=a.hasClosestTrWithClass(e,a.CLASS_NAME_OL),t=a.hasClosestTrWithClass(e,a.CLASS_NAME_UL),n=o||t,r=n?e.closest("tr")?.querySelector("td:first-child div:first-child"):null,i=document.querySelectorAll(`.${a.CLASS_NAME_OL}, .${a.CLASS_NAME_UL}`);return{isElementListOL:o,isElementListUL:t,isElementList:n,isCellCustomTable:!!e.closest(".em-element-custom-table"),bulletElem:r,totalListCount:i.length}}function Ho(e){return{variableElement:hl,requestElemBullet:e.bulletElem,isElementListOL:e.isElementListOL,isElementListUL:e.isElementListUL,isElementList:e.isElementList}}function Al(e){const o=window.getSelection();(o?.isCollapsed||!o?.isCollapsed&&!e.querySelector("editor"))&&(a.removeAllAttributes("em-edit"),e.tagName!=="TABLE"&&(a.resolveActiveElement(e).setAttribute("em-edit","active"),Tl(e)),Ll(e))}function Tl(e){const o=e.closest("table");if(!o)return;for(const n of o.querySelectorAll('[contenteditable="true"]'))n.tagName!=="EDITOR"&&n.removeAttribute("contenteditable");const t=o.querySelector("editor");if(t){const n=t.firstChild;t.childNodes.length===1&&n?.nodeType===1&&n.tagName==="A"&&n.childNodes.length===1&&n.firstChild?.nodeType===3?n.setAttribute("contenteditable","true"):t.setAttribute("contenteditable","true")}}function Ll(e){const o=e.parentElement;o&&(o.querySelectorAll("strike, s").forEach(t=>{t.style.textDecoration="line-through"}),o.querySelectorAll("u").forEach(t=>{t.style.textDecoration="underline"}))}function wl(e,o){const t=e.elem;if(!(window.getSelection()?.isCollapsed??!0)&&!t.closest("a")&&!El()&&!o.isCellCustomTable){const n=Ho(o);return{type:"text",caption:Locale.TEXT,settings:Zt(e,Locale,n)}}if(t.closest("amp-carousel"))return kl(e);if(t.tagName==="AMP-ACCORDION")return _l(e);if(_n(t))return{type:Xt(e,Locale).type,caption:Xt(e,Locale).caption,settings:Xt(e,Locale)};if(!o.isCellCustomTable&&(t.tagName==="A"||t.tagName==="EM-REPLACE"&&t.closest("a")))return Nl(e,o);if(t.tagName==="TABLE"&&t.getAttribute("em")!=="atom")return Bl(e);if(t.tagName==="LI"&&Kt(t)){const n=Ho(o);return{type:"text",caption:Locale.TEXT,settings:Zt(e,Locale,n)}}return o.isCellCustomTable?Ml(e):t.tagName==="TD"?Rl(e):t.closest(".em-vindent")?Pl(e):t.classList.contains("em-floatblock")||t.closest(".em-floatblock")?Hl(e):t.tagName==="DIV"?Il(e,o):t.getAttribute("em")==="block"?Ol(e):{}}function kl(e){return{type:"carousel",caption:Locale.CAROUSEL,settings:{}}}function _l(e){return{type:"accordion",caption:Locale.ACCORDION,settings:{}}}function Nl(e,o){const t=e.elem;if(t.style?.display==="block"||t.style?.display==="inline-block")return{type:"button",caption:Locale.BUTTON,settings:{}};const n=Ho(o);return{type:"text",caption:Locale.TEXT,settings:Zt(e,Locale,n)}}function Bl(e){return e.elem.innerHTML===""?{type:"emptyTable",settings:{}}:{type:"table",caption:Locale.TABLE,settings:{}}}function Ml(e){return{type:"customTable",caption:Locale.TABLE,settings:{}}}function Rl(e){return{type:"td",caption:Locale.TABLE_COLUMN,settings:{}}}function Pl(e){return{type:"vindent",caption:Locale.VERTICAL_INDENT,settings:{}}}function Hl(e){return{type:"floatBlock",caption:Locale.FLOAT_BLOCK,settings:{}}}function Il(e,o){return{type:"div",caption:Locale.CONTAINER,settings:{}}}function Ol(e){return{type:"structure",caption:Locale.STRUCTURE,settings:{}}}var Mg=Promise.resolve();function Lt(e){return!(!e.startsWith("#")||e.indexOf("#",1)!==-1)}var xl=["em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"],Dl=["em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top"],Fl=["em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"];function In(){document.querySelectorAll(".em-block-insert").forEach(e=>{e.classList.remove(...xl)})}function ql(){document.querySelectorAll(".em-atom-insert").forEach(e=>{e.classList.remove(...Dl)})}function Jt(){document.querySelectorAll(".em-blockatom-insert").forEach(e=>{e.classList.remove(...Fl)})}function Io(e,o){const t=e.getBoundingClientRect();return o>t.top+t.height/2?"bottom":"top"}function On(e,o){const t=e.getBoundingClientRect(),n=document.body.getBoundingClientRect();return o==="bottom"?t.bottom>n.height-21:t.top<2}function Oo(e,o,t){const n=t==="atom"?"em-atom-insert":"em-block-insert",r=t==="blockatom"?"em-blockatom-insert":n;if(e.classList.add(r),o==="bottom"){e.classList.remove(`${n}_top`,`${n}_top-document`);const i=On(e,"bottom")?`${n}_bottom-document`:`${n}_bottom`;e.classList.add(i)}else{e.classList.remove(`${n}_bottom`,`${n}_bottom-document`);const i=On(e,"top")?`${n}_top-document`:`${n}_top`;e.classList.add(i)}}function xo(e){return e.tagName==="TABLE"&&!e.innerHTML}function Qt(e){return e.tagName==="TABLE"||e.tagName==="TR"?e.querySelector("[data-template-content]")??e.querySelector("td"):e}function xn(e){if(!e?.length)return null;for(let o=0;o<e.length;o++){const t=e.item(o);if(t?.type.startsWith("image/"))return t}return null}function Wl(e){if(!e?.items?.length)return null;for(let o=0;o<e.items.length;o++){const t=e.items[o];if(t.kind!=="file")continue;const n=t.getAsFile();if(n&&n.type.startsWith("image/"))return n}return null}function $l(e){const o=xn(e.dataTransfer?.files??null);return o||Wl(e.dataTransfer??null)}function Do(e){const o=document.body?.parentElement??document.body;if(!o)return null;const t=document.elementFromPoint(e.clientX,e.clientY);if(!t)return null;const n=t.closest(".em-element-resize-img-container");if(n){const i=n.querySelector("img");if(i&&o.contains(i))return i}const r=t.closest("img");return!r||!o.contains(r)?null:r}function wt(e){const o=e.dataTransfer?.types;return!!o&&Array.from(o).includes("Files")}function Fo(e){if(!wt(e))return!1;const o=e.dataTransfer;if(!o)return!1;if(o.files?.length)return!!xn(o.files);const t=o.items;if(!t?.length)return!0;for(let n=0;n<t.length;n++){const r=t[n];if(r.kind!=="file")continue;const i=r.type||"";if(i.startsWith("image/")||i==="")return!0}return!1}var Dn="em-native-img-drop-target",qo="em-native-img-uploading",zl="em-native-img-drop-loading",eo="em-native-file-drag",kt=null,et=null;function Fn(){et&&(window.removeEventListener("scroll",et.reposition,!0),window.removeEventListener("resize",et.reposition),et.resizeObserver?.disconnect(),et.overlay.remove(),et=null)}function Vl(e){Fn();const o=document.createElement("div");o.className="em-native-img-upload-spin-overlay",o.setAttribute("aria-hidden","true");const t=document.createElement("div");t.className="em-native-img-upload-spin",o.appendChild(t),document.body.appendChild(o);const n=()=>{const i=e.getBoundingClientRect();o.style.left=`${Math.round(i.left)}px`,o.style.top=`${Math.round(i.top)}px`,o.style.width=`${Math.max(Math.round(i.width),1)}px`,o.style.height=`${Math.max(Math.round(i.height),1)}px`};n(),window.addEventListener("scroll",n,!0),window.addEventListener("resize",n);let r=null;typeof ResizeObserver<"u"&&(r=new ResizeObserver(()=>n()),r.observe(e)),et={overlay:o,reposition:n,resizeObserver:r}}function Wo(){kt&&(kt.classList.remove(Dn),kt=null)}function tt(){document.body.classList.remove(eo),Wo()}function Ul(e){if(!wt(e)){tt();return}if(!Fo(e)){tt();return}document.body.classList.add(eo);const o=Do(e);if(!o){Wo();return}kt!==o&&(Wo(),kt=o,o.classList.add(Dn))}function qn(){Fn(),document.body.classList.remove(zl),document.body.classList.remove(eo),document.querySelectorAll(`.${qo}`).forEach(e=>{e.classList.remove(qo)})}function jl(e,o){if(o.lockEditor||!wt(e))return!1;const t=$l(e);if(!t)return!1;const n=Do(e);return n?(o.applicationElementSettingsSet({elem:n}),tt(),n.classList.add(qo),Vl(n),o.messageService.send({operation:a.EVENT_TYPES.APPLICATION_NATIVE_IMAGE_DROP,file:t}),!0):!1}function Gl(e,o){if(o.lockEditor)return;document.body.classList.contains("em-block-insert-body")||o.messageService.send({operation:"application_scroll-block-show"});const t=e.target;t.getAttribute("em")==="atom"&&(document.body.classList.add("em-atom-insert-body-inside"),o.commit(!1),o.mutableState.atomReplaced=t)}function Yl(e,o){o.lockEditor||(tt(),e.preventDefault(),o.messageService.send({operation:"application_scroll-block-hide"}))}function Kl(e,o){if(e.preventDefault(),o.lockEditor){tt();return}wt(e)?(Fo(e)&&Do(e)&&(e.dataTransfer.dropEffect="copy"),Ul(e)):tt();const t=e.target;if(document.body.classList.contains("em-block-insert-body")){const n=xo(t)?null:t.closest('[em="block"]');if(n){o.mutableState.targetBlock=n;const r=Qt(n);r&&Oo(r,Io(r,e.pageY),"block")}else In()}else if(document.body.classList.contains("em-atom-insert-body")){const n=t.closest('[em="atom"]');if(n&&n.innerHTML.trim())o.mutableState.targetBlock=n,Oo(n,Io(n,e.pageY),"atom"),Jt();else if(t.closest('[em="block"]')&&t.tagName==="TD"&&!t.innerHTML&&!t.hasAttribute("height")||t.tagName==="DIV"&&t.closest("amp-accordion")&&!t.innerHTML)Jt();else{const r=t.closest('[em="block"]');if(r){o.mutableState.targetBlock=r;const i=Qt(r);i&&(Oo(i,Io(i,e.pageY),"blockatom"),ql())}}}}function Xl(e,o){if(o.lockEditor)return;wt(e)&&Fo(e)&&document.body.classList.add(eo);const t=e.target;if(document.body.classList.contains("em-block-insert-body")){document.querySelectorAll(".em-block-insert-empty").forEach(r=>{r.classList.remove("em-block-insert-empty")});const n=t.closest('[em="block"]');xo(t)?(t.classList.add("em-block-insert-empty"),In()):n&&(o.mutableState.targetBlock=n)}else if(document.body.classList.contains("em-atom-insert-body")||document.body.classList.contains("em-atom-insert-body-inside")){document.querySelectorAll(".em-atom-insert-empty").forEach(i=>{i.classList.remove("em-atom-insert-empty")});const n=t.closest('[em="atom"]');n&&n.innerHTML.trim()?(o.mutableState.targetBlock=n,document.querySelectorAll(".em-atom-insert, .em-blockatom-insert").forEach(i=>{i.classList.remove("em-atom-insert","em-blockatom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")})):t.closest('[em="block"]')&&t.tagName==="TD"&&!t.innerHTML&&!t.hasAttribute("height")&&t.parentElement&&[...t.parentElement.children].indexOf(t)%2===0||t.tagName==="DIV"&&t.closest("amp-accordion")&&!t.innerHTML?(t.classList.add("em-atom-insert-empty"),document.querySelectorAll(".em-atom-insert, .em-blockatom-insert").forEach(i=>{i.classList.remove("em-atom-insert","em-blockatom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")})):document.querySelectorAll(".em-atom-insert").forEach(i=>{i.classList.remove("em-atom-insert","em-blockatom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")}),document.querySelectorAll(".em-block-insert-empty").forEach(i=>{i.classList.remove("em-block-insert-empty")});const r=t.closest('[em="block"]');xo(t)?(t.classList.add("em-block-insert-empty"),Jt()):r?o.mutableState.targetBlock=r:Jt()}}function Zl(e,o){if(o.lockEditor)return;const t=e.target;if(document.body.classList.contains("em-block-insert-body")){const n=e.relatedTarget,r=t.closest('[em="block"]');if(n&&r&&r.contains(n))return;o.mutableState.newTargetblock=t.closest('[em="block"]'),o.mutableState.newTargetblock&&(t.closest('[em="block"]')&&(o.mutableState.newTargetblock!==o.mutableState.targetBlock||o.mutableState.newTargetblock.closest('[em="group"]')!==o.mutableState.targetBlock?.closest('[em="group"]'))?o.mutableState.newTargetblock.tagName==="DIV"?o.mutableState.newTargetblock.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"):o.mutableState.newTargetblock.querySelectorAll(".em-block-insert").forEach(i=>{i.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}):document.querySelectorAll(".em-block-insert-empty").forEach(i=>{i.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}))}else if(document.body.classList.contains("em-atom-insert-body")){const n=e.relatedTarget,r=t.closest('[em="atom"]');if(n&&r&&r.contains(n))return;const i=t.closest('[em="block"]');if(n&&i&&i.contains(n))return;o.mutableState.newTargetblock=t.closest('[em="atom"]'),o.mutableState.newTargetblock&&(t.getAttribute("em")==="atom"&&o.mutableState.newTargetblock!==o.mutableState.targetBlock?o.mutableState.newTargetblock.classList.remove("em-atom-insert","em-blockatom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top"):document.querySelectorAll(".em-atom-insert-empty").forEach(s=>{s.classList.remove("em-atom-insert","em-blockatom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")}));const l=t.closest('[em="block"]');l&&(t.closest('[em="block"]')&&(l!==o.mutableState.targetBlock||l.closest('[em="group"]')!==o.mutableState.targetBlock?.closest('[em="group"]'))?l.tagName==="DIV"?l.classList.remove("em-atom-insert","em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"):l.querySelectorAll(".em-blockatom-insert").forEach(s=>{s.classList.remove("em-atom-insert","em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}):document.querySelectorAll(".em-block-insert-empty").forEach(s=>{s.classList.remove("em-atom-insert","em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}))}}function Jl(e,o,t){if(!e)return;let n=document.head.querySelector('style[em="styles"]'),r="";n?r=t.HTMLDocument.getInnerHtml(n):(n=document.createElement("style"),n.setAttribute("em","styles"),n=document.head.insertAdjacentElement("beforeend",n));const i=document.createElement("div");o&&(e=e.replace(/(max-device-width:|max-width:)\d+px/g,s=>s.replace(/\d+/,String(o)))),i.insertAdjacentHTML("afterbegin",e);let l=t.minify(r+`
1
+ __useblocks__.define("js/iframe.js",["require","exports","module","js/rolldown-runtime.BRlIiq3h.js","js/discussHandlers.sDXLf5I7.js"],function(Lo,Rg,Pg){const $i=Lo("./rolldown-runtime.BRlIiq3h.js"),a=Lo("./discussHandlers.sDXLf5I7.js");var At=null;function wo(e){const o=window.getSelection();if(o&&o.rangeCount>0){const t=o.getRangeAt(0);if(e.contains(t.startContainer))return{container:t.startContainer,offset:t.startOffset}}return At&&At.container.isConnected&&e.contains(At.container)?At:null}function zi(e){const o=[],t=Array.from(e.childNodes);let n=[],r=0;return t.forEach((i,l)=>{i.nodeType===Node.ELEMENT_NODE&&i.tagName==="BR"?(n.length>0&&o.push({html:Yt(n),nodes:[...n],startIndex:r,endIndex:l-1}),n=[],r=l+1):n.push(i)}),n.length>0&&o.push({html:Yt(n),nodes:[...n],startIndex:r,endIndex:t.length-1}),o}function Vi(e){const o=[],t=Array.from(e.childNodes);let n=[],r=0;const i=s=>{n.length>0&&(o.push({html:Yt(n),nodes:[...n],startIndex:r,endIndex:s-1}),n=[])},l=s=>s.nodeType===Node.ELEMENT_NODE&&(s.tagName==="UL"||s.tagName==="OL");return t.forEach((s,c)=>{s.nodeType===Node.ELEMENT_NODE&&s.tagName==="BR"?(i(c),r=c+1):l(s)?(i(c),o.push({html:Yt([s]),nodes:[s],startIndex:c,endIndex:c}),r=c+1):n.push(s)}),i(t.length),o}function Yt(e){const o=document.createElement("div");return e.forEach(t=>o.appendChild(t.cloneNode(!0))),o.innerHTML}function ko(e,o){const t=wo(o);if(!t)return 0;const n=t.container;if(!o.contains(n))return 0;for(let r=0;r<e.length;r++)for(const i of e[r].nodes)if(i===n||i.contains(n))return r;if(n===o){const r=t.offset;for(let i=0;i<e.length;i++)if(r>=e[i].startIndex&&r<=e[i].endIndex)return i;for(let i=0;i<e.length;i++)if(r===e[i].startIndex)return i;for(let i=0;i<e.length;i++)if(e[i].startIndex>=r)return i;if(e.length>0)return e.length-1}return 0}function An(e,o,t,n){if(!t.contains(o))return n;for(let r=0;r<e.length;r++)for(const i of e[r].nodes)if(i===o||i.contains(o))return r;return n}function Ui(e,o){const t=window.getSelection();if(!t||t.rangeCount===0){const s=ko(e,o);return{start:s,end:s}}const n=t.getRangeAt(0);if(n.collapsed){const s=ko(e,o);return{start:s,end:s}}const r=ko(e,o),i=An(e,n.startContainer,o,r),l=An(e,n.endContainer,o,r);return{start:Math.min(i,l),end:Math.max(i,l)}}function ji(e){return e.querySelector("br")!==null}function Gi(e){const o=wo(e);if(!o)return null;const t=o.container.nodeType===Node.ELEMENT_NODE?o.container:o.container.parentElement;if(!t)return null;const n=t.closest("ol, ul");return n&&e.contains(n)?n:null}function Yi(e){const o=wo(e);if(!o)return;const{container:t,offset:n}=o;if(t!==e)return;const r=Array.from(e.childNodes),i=n>0?r[n-1]:null,l=n<r.length?r[n]:null,s=b=>b!==null&&b.nodeType===Node.ELEMENT_NODE&&b.tagName==="BR",c=b=>b!==null&&b.nodeType===Node.TEXT_NODE&&b.data.trim()==="",d=s(i),u=s(l),g=c(l),m=n>=r.length;if(!(d&&u||d&&m||n===0&&u||d&&g))return;let f;g?(f=l,f.data=" "):(f=document.createTextNode(" "),l?e.insertBefore(f,l):e.appendChild(f));const p=window.getSelection();if(p){const b=document.createRange();b.setStart(f,0),b.collapse(!0),p.removeAllRanges(),p.addRange(b)}At={container:f,offset:0}}function Ki(e,o){const t=o?"ol":"ul";if(e.querySelector("ol, ul")){const n=Gi(e);if(n){if(n.tagName.toLowerCase()===t)return;const l=document.createElement(t);for(Array.from(n.attributes).forEach(s=>{s.name!=="style"&&l.setAttribute(s.name,s.value)}),l.setAttribute("style",a.STANDARD_LIST_STYLES.LIST);n.firstChild;)l.appendChild(n.firstChild);n.parentNode?.replaceChild(l,n);return}const r=e.querySelector(":scope > ol, :scope > ul"),i=Array.from(e.childNodes).some(l=>l.nodeType===Node.ELEMENT_NODE&&l.tagName==="BR");if(r&&!i){if(r.tagName.toLowerCase()===t)return;const l=document.createElement(t);for(Array.from(r.attributes).forEach(s=>{s.name!=="style"&&l.setAttribute(s.name,s.value)}),l.setAttribute("style",a.STANDARD_LIST_STYLES.LIST);r.firstChild;)l.appendChild(r.firstChild);r.parentNode?.replaceChild(l,r);return}}ji(e)||e.querySelector(":scope > ol, :scope > ul")?(Yi(e),Xi(e,t)):Tn(e,t)}function Tn(e,o){const t=document.createElement(o);t.setAttribute("style",a.STANDARD_LIST_STYLES.LIST);const n=document.createElement("li");n.setAttribute("style",a.STANDARD_LIST_STYLES.LIST_ITEM);const r=e.innerHTML.trim();r?n.innerHTML=r:n.innerHTML="&nbsp;",t.appendChild(n),e.innerHTML="",e.appendChild(t),Ln(n)}function Xi(e,o){const t=Vi(e);if(t.length===0){Tn(e,o);return}const{start:n,end:r}=Ui(t,e),i=document.createElement(o);i.setAttribute("style",a.STANDARD_LIST_STYLES.LIST);let l=null;for(let d=n;d<=r;d++){const u=document.createElement("li");u.setAttribute("style",a.STANDARD_LIST_STYLES.LIST_ITEM),u.innerHTML=t[d].html.trim()||"&nbsp;",i.appendChild(u),l=u}const s=t.slice(0,n).map(d=>d.html).join("<br>"),c=t.slice(r+1).map(d=>d.html).join("<br>");if(e.innerHTML="",s.trim()){const d=document.createElement("span");for(d.innerHTML=s;d.firstChild;)e.appendChild(d.firstChild);e.appendChild(document.createElement("br"))}if(e.appendChild(i),c.trim()){e.appendChild(document.createElement("br"));const d=document.createElement("span");for(d.innerHTML=c;d.firstChild;)e.appendChild(d.firstChild)}l&&Ln(l)}function Ln(e){try{const o=window.getSelection();if(o){const t=document.createRange();t.selectNodeContents(e),t.collapse(!0),o.removeAllRanges(),o.addRange(t)}}catch{}}function Zi(e,o){let t=0;const n=Array.from(e.childNodes);for(const r of n){if(r===o)return t;r.nodeType===Node.ELEMENT_NODE&&r.tagName==="BR"&&t++}return t}function Ji(e,o){const t=zi(e);if(o<0||o>=t.length)return;const n=t[o];if(n.nodes.length!==0)try{const r=window.getSelection();if(!r)return;const i=n.nodes[0],l=document.createRange();if(i.nodeType===Node.TEXT_NODE)l.setStart(i,0),l.collapse(!0);else if(i.nodeType===Node.ELEMENT_NODE)l.selectNodeContents(i),l.collapse(!0);else return;r.removeAllRanges(),r.addRange(l)}catch{}}function Qi(e){const o=e.querySelector("ol, ul");if(!o)return;const t=Zi(e,o),n=o.querySelectorAll("li"),r=[];n.forEach(l=>{const s=l.innerHTML.trim();s&&s!=="&nbsp;"&&r.push(s)});const i=r.join("<br>");i?o.outerHTML=i:o.outerHTML="&nbsp;",Ji(e,t)}function Kt(e){if(!e)return!1;const o=e.closest("ul, ol");return o?!o.closest(a.TABLE_LIST_SELECTOR):!1}function wn(e){return e.getAttribute("src")}function Xt(e,o){const t=a.resolveActiveElement(e.elem),n=wn(t),r=a.getElementMobileProps({elem:t}),i=t.closest("td"),l=i?a.getElementMobileProps({elem:i}):null;let s="img",c=o.PICTURE;e.elem.classList.contains("em-countdown")?(s="countdown",c=o.COUNTDOWN):e.elem.classList.contains("em-video")&&(s="video",c=o.VIDEO);const d=g=>g===null||g==="auto"?null:typeof g=="number"?g:null,u={type:s,caption:c,src:n??"",width:kn(t,"width"),height:kn(t,"height"),alt:t.getAttribute("alt")??"",title:t.getAttribute("title")??"",align:i?.getAttribute("align")??"undefined",valign:t.style?.verticalAlign??"undefined",border:a.getElementBorder(t),borderRadius:a.getElementBorderRadius(t),boxShadow:a.getElementBoxShadow(t),mobileWidth:{value:d(r.mobileWidth),dim:r.mobileWidthDim??"px"},mobileHeight:{value:d(r.mobileHeight),dim:r.mobileHeightDim??"px"},mobileBorder:r.mobileBorder,mobileBorderRadius:r.mobileBorderRadius,mobileBoxShadow:r.mobileBoxShadow,mobileAlign:l?.mobileAlign,mobileVerticalAlign:r.mobileVerticalAlign,show:r.show,link:t.closest("a")?.getAttribute("href")??null,renderedWidth:Math.round(e.elem.getBoundingClientRect().width),renderedHeight:Math.round(e.elem.getBoundingClientRect().height),imgReplacer:t.closest("em-replace")?.getAttribute("src")??""};if(s==="countdown"&&(u.countdown=e.elem.getAttribute("em-cd-settings")??void 0),s==="video"){const g=e.elem.getAttribute("em-video-settings");if(g)try{u.video=JSON.parse(g.replaceAll("'",'"'))}catch{u.video={}}}return a.isShowOnMobile(e.elem)&&(u.showOnMobile=!0),i&&(u.maxWidth=Math.round(i.getBoundingClientRect().width)),u}function kn(e,o){const t=e.getAttribute(o);return!t||t==="auto"?{value:null,dim:"px"}:{value:parseFloat(t),dim:t.includes("%")?"%":"px"}}function _n(e){return e.tagName==="IMG"||e.tagName==="AMP-IMG"}var Nn="em-mob-text_align-",el=":scope > tr > td, :scope > tbody > tr > td",tl='div[style*="font-family"][style*="font-size"]';function _o(e){return e.querySelector(el)}function No(e){return e.querySelector(tl)}function ol(e,o){for(let t=e;t&&t!==o;t=t.parentElement)if(t.tagName.includes("-"))return!0;return!1}function Bn(e){const o=e.closest('table[em="atom"]');if(!o||ol(e,o))return null;const t=_o(o);return t?{atomTd:t,textDiv:No(t)}:null}function Tt(e){const o=e.closest("div, p, td");if(!o)return null;if(o.style.textAlign)return o;const t=Bn(e);return t?t.textDiv?.hasAttribute("align")?t.textDiv:t.atomTd:o}function Mn(e){const o=Tt(e);return o&&(o.style.textAlign||o.getAttribute("align"))||"left"}function nl(e){const o=Tt(e);if(!o)return"";for(const t of o.classList)if(t.startsWith("em-mob-text_align-"))return t.slice(18);return""}function Bo(e){return{value:nl(e)}}function rl(e,o,t=Nn){const n=Bn(e);if(n)for(const r of[n.atomTd,n.textDiv])r&&r!==o&&a.removeClassesByPrefix(r,t)}function il(e){const o=_o(e);if(!o)return null;const t=No(o);return t?.hasAttribute("align")?t:o}function ll(e,o){e.querySelectorAll('[em="atom"]').forEach(t=>{const n=il(t);n&&o(n,t)})}function al(e,o,t=Nn){const n=_o(e),r=n?No(n):null;for(const i of[n,r])i&&i!==o&&a.removeClassesByPrefix(i,t)}function Zt(e,o,t){const n=a.getParentElementOfSelection()||e.elem,r=n.tagName==="EDITOR"&&n.firstChild?.nodeType===1?n.firstChild:n,i=e.elem.closest('[style*="font-family"], [style*="font-size"], [style*="line-height"]')||e.elem,l=r.style.fontFamily||r.style.fontSize||r.style.lineHeight||r.closest('[style*="font-family"], [style*="font-size"], [style*="line-height"]')?r:i,s=e.elem.closest('[style*="line-height"]')||l.querySelector('[style*="line-height"]')||l,c=n.closest('[class*="em-mob-font_size"]')||n.closest('[style*="font-size"]')||n,d=n.closest('[class*="em-mob-line_height"]')||n.closest('[style*="line-height"]')||n,u=a.getElementMobileProps({elem:c}),g=a.getElementMobileProps({elem:d}),m=Rn(e.elem,t),f=a.textHasStyle$1(r,"strong","b"),p=l!==r?a.textHasStyle$1(l,"strong","b"):!1,b=e.elem&&r&&e.elem.isConnected&&(r===e.elem||r.contains(e.elem))?a.textHasStyle$1(e.elem,"strong","b"):!1,h=f||p||b,y=a.isElementHasBold(l),E=h||y,S={type:"text",caption:o.TEXT,fontFamily:a.getFontFamilyFromElement$1(l.closest('[style*="font-family"]')||e.elem),fontSize:parseFloat(e.elem.closest('[style*="font-size"]')?.style.fontSize)||parseFloat(getComputedStyle(e.elem).fontSize),fontSizeDim:"px",lineHeight:a.getLineHeightInPixels$1(s),lineHeightDim:"px",textAlign:Mn(e.elem),textStrong:E,textItalic:a.textHasStyle$1(e.elem,"i","em")||!l.closest('[style*="font-style: normal"]')&&l.style?.fontStyle==="italic",textStrikethrough:a.textHasStyle$1(e.elem,"s","strike")||(l.style?.textDecoration?.includes("line-through")??!1),textUnderline:a.textHasStyle$1(e.elem,"u")||(l.style?.textDecoration?.includes("underline")??!1)||!l.style?.textDecoration&&(e.elem.tagName==="A"&&e.elem.hasAttribute("href")||a.hasLinkInSelection()),textColor:a.rgbToHex(e.elem.closest('[style*="color"]')?.style.color)||a.rgbToHex(getComputedStyle(e.elem).color)||"",textBackgroundColor:ml(e.elem),mobileFontSize:{value:u.mobileFontSize,dim:u.mobileFontSizeDim||"px"},mobileLineHeight:{value:g.mobileLineHeight,dim:"px"},mobileTextAlign:Bo(e.elem),linkHref:(()=>{const v=l.closest("a");if(!v)return;const C=v.getAttribute("href");if(C!==null)return C})(),textAnchor:(()=>{const v=l.closest("a");if(v&&!v.hasAttribute("href"))return v.getAttribute("name")?.trim()||void 0})(),textLink:(()=>{const v=l.closest("a");return v?!!v.hasAttribute("href"):a.textHasStyle$1(e.elem,"a")||a.hasLinkInSelection()})(),textReplacer:t.variableElement(e.elem),list:m,standardList:Pn(e.elem),textSuperscript:a.textHasStyle$1(e.elem,"sup"),textSubscript:a.textHasStyle$1(e.elem,"sub")};return a.isShowOnMobile(n)&&(S.showOnMobile=!0),S}function Rn(e,o){const{isElementList:t,isElementListOL:n,isElementListUL:r,requestElemBullet:i}=o;if(!t)return{isList:!1,listType:"UL"};const l=e.closest("td");return{isList:!0,listType:n?"OL":"UL",bulletsColor:t&&i?a.rgbToHex(i.closest('[style*="color"]')?.style.color):"",betweenParagraphs:t&&parseInt(l?.style?.paddingBottom,10)||0,betweenRowCell:t&&parseInt(l?.style?.paddingLeft,10)||0,bulletFontSize:t&&i&&parseInt(i.style.fontSize,10)||0,bulletFontBold:t?i?.style.fontWeight==="bold":!1,bulletFontItalic:t?i?.style.fontStyle==="italic":!1,bulletFontFamily:n&&i?a.getFontFamilyFromElement$1(i):"",bulletFontUnderline:t?i?.style.textDecoration?.includes("underline")??!1:!1,bulletFontStrikethrough:t?i?.style.textDecoration?.includes("line-through")??!1:!1,bulletType:r&&i?i.innerHTML.replace(/\s|&nbsp;/g,""):""}}function Pn(e){return Kt(e)?{listTypeOL:!!e.querySelector("ol")||!!e.closest("ol"),listTypeUL:!!e.querySelector("ul")||!!e.closest("ul")}:{listTypeOL:!1,listTypeUL:!1}}function Mo(e){if(!e)return!1;const o=e.trim().toLowerCase();return o!=="transparent"&&o!=="inherit"}var sl=new Set(["A","B","EM","I","MARK","S","SMALL","SPAN","STRIKE","STRONG","SUB","SUP","U"]);function cl(e){let o=e;for(;o&&sl.has(o.tagName);){const t=o.style.backgroundColor;if(Mo(t))return t;o=o.parentElement}return""}function dl(e,o,t){let n=e;for(;n;){const r=n.style.getPropertyValue(o);if(Mo(r))return r;if(t&&n===t)break;n=n.parentElement}return""}function ml(e){const o=cl(e);if(Mo(o))return a.rgbToHex(o)||"";if(e.closest(".em-element-custom-table"))return a.rgbToHex(a.findParentWithExplicitStyle(e,"background-color"))||"";const t=e.closest("div");return a.rgbToHex(dl(e,"background-color",t))||""}function ul(e){return e.tagName==="DIV"?!!(e.style.fontFamily&&e.style.fontSize&&e.style.lineHeight):e.tagName==="TD"?e.firstChild?.tagName==="EDITOR"||e.firstElementChild?.tagName==="EDITOR":!1}function fl(e,o,t){const{findElementWithSelectedText:n,selectedText:r,variableElement:i,requestElemBullet:l,isElementList:s,isElementListOL:c,isElementListUL:d}=t,u=n(r,e.elem)||e.elem,g=e.elem.closest('[class*="em-mob-font_size"]')||e.elem.closest('[style*="font-size"]')||e.elem,m=e.elem.closest('[class*="em-mob-line_height"]')||e.elem.closest('[style*="line-height"]')||e.elem,f=a.getElementMobileProps({elem:g}),p=a.getElementMobileProps({elem:m}),b=Rn(e.elem,t),h={type:"text",caption:o.TEXT,linkHref:(()=>{const y=e.elem.getAttribute("href");if(y!==null)return y})(),textAnchor:(()=>{if(!e.elem.hasAttribute("href"))return e.elem.getAttribute("name")?.trim()||void 0})(),textLink:!!e.elem.hasAttribute("href"),target:e.elem.getAttribute("target")??"",fontFamily:a.getFontFamilyFromElement$1(e.elem),fontSize:parseFloat(e.elem.closest('[style*="font-size"]')?.style.fontSize)||0,fontSizeDim:"px",lineHeight:a.getLineHeightInPixels$1(e.elem),lineHeightDim:"px",textAlign:Mn(e.elem),textStrong:a.textHasStyle$1(u,"strong","b")||a.isElementHasBold(u),textItalic:a.textHasStyle$1(u,"i","em")||!e.elem.closest('[style*="font-style: normal"]')&&e.elem.style?.fontStyle==="italic",textStrikethrough:a.textHasStyle$1(u,"s","strike")||(e.elem.style?.textDecoration?.includes("line-through")??!1),textUnderline:a.textHasStyle$1(u,"u")||(e.elem.style?.textDecoration?.includes("underline")??!1)||!(e.elem.style?.textDecoration?.length>0)&&e.elem.tagName==="A"&&e.elem.hasAttribute("href"),textColor:a.rgbToHex(e.elem.tagName==="A"?a.findParentWithExplicitStyle(e.elem.querySelector('[style*="color"]'),"color"):a.findParentWithExplicitStyle(e.elem,"color"))||a.rgbToHex(getComputedStyle(e.elem).color)||"",textBackgroundColor:a.rgbToHex(e.elem.tagName==="A"?a.findParentWithExplicitStyle(e.elem.querySelector('[style*="background-color"]'),"background-color"):a.findParentWithExplicitStyle(e.elem,"background-color"))||"",mobileFontSize:{value:f.mobileFontSize,dim:f.mobileFontSizeDim||"px"},mobileLineHeight:{value:p.mobileLineHeight,dim:"px"},mobileTextAlign:Bo(e.elem),textReplacer:i(e.elem),list:b,standardList:Pn(e.elem),textSuperscript:a.textHasStyle$1(e.elem,"sup"),textSubscript:a.textHasStyle$1(e.elem,"sub")};return a.isShowOnMobile(e.elem)&&(h.showOnMobile=!0),h}function Ro(e){let o="";if(e.nodeType===Node.COMMENT_NODE&&e.nodeValue?.includes("[if mso]")){const t=e.nodeValue.replace(/^\[if mso\]>/i,"").replace(/<!\[endif\]$/i,"").trim();o+=t}return e.childNodes.forEach(t=>{o+=Ro(t)}),o}function Po(e,o,t={value:0}){e.nodeType===Node.COMMENT_NODE&&e.nodeValue?.includes("[if mso]")&&(t.value===0?e.nodeValue=`[if mso]>${o}<![endif]`:e.nodeValue="",t.value++),e.childNodes.forEach(n=>Po(n,o,t))}function pl(e,o){const t=e.getAttribute(o);return!t||t==="auto"?{value:null,dim:"px"}:{value:parseFloat(t),dim:t.includes("%")?"%":"px"}}function Hn(e,o){const t=e.style[o];return t?{value:parseFloat(t),dim:t.includes("%")?"%":"px"}:{value:null,dim:"px"}}function gl(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function bl(e){if(e.style.backgroundImage){const o=e.style.backgroundImage;return[{type:"url",value:o.substring(5,o.length-2)}]}return e.getAttribute("background")?[{type:"url",value:e.getAttribute("background")||""}]:[{type:"url",value:""}]}function hl(e,o){const t=e.elem;if(t.innerHTML==="")return{type:"emptyTable",caption:o.TABLE};t.setAttribute("em-edit","active");const n=a.getElementMobileProps({elem:t}),r={type:"table",caption:o.TABLE,backgroundColor:t.style.backgroundColor?a.rgbToHex(t.style.backgroundColor):"",backgroundImage:bl(t),backgroundPositionX:t.style.backgroundPositionX!=="initial"?t.style.backgroundPositionX:"",backgroundPositionY:t.style.backgroundPositionY!=="initial"?t.style.backgroundPositionY:"",backgroundRepeat:t.style.backgroundRepeat||"repeat",backgroundSize:t.style.backgroundSize||"auto",width:pl(t,"width"),maxWidth:Hn(t,"maxWidth"),minWidth:Hn(t,"minWidth"),align:t.getAttribute("align")??"",border:a.getElementBorder(t),boxShadow:a.getElementBoxShadow(t),borderRadius:a.getElementBorderRadius(t),mobileWidth:{value:gl(n.mobileWidth),dim:n.mobileWidthDim??"px"},mobileBorder:n.mobileBorder,mobileBorderRadius:n.mobileBorderRadius,mobileBoxShadow:n.mobileBoxShadow,show:n.show,mobileAlign:n.mobileAlign,mobileBackgroundColor:n.mobileBackgroundColor,mobileBackgroundImage:n.mobileBackgroundImage,mobileBackgroundPositionX:n.mobileBackgroundPositionX,mobileBackgroundPositionY:n.mobileBackgroundPositionY,mobileBackgroundRepeat:n.mobileBackgroundRepeat,mobileBackgroundSize:n.mobileBackgroundSize,exportAsPicture:t.getAttribute("em-operation")==="exportAsPicture",outlookBackground:a.hasElementVMLBackground(t,"around")};return a.isShowOnMobile(t)&&(r.showOnMobile=!0),r}function yl(e){return e.tagName==="TABLE"&&e.getAttribute("em")!=="atom"}function El(e){return e.closest("em-replace")?.getAttribute("text")||null}var Sl=()=>a.isInitialized()?a.getHtmlDocument():null,Cl=()=>a.state.get("isProgrammaticSelection");function vl(e){if(!a.isElementLocked())try{a.incrementLock(),a.removeAllAttributes("em-edit");let o={};if(!e.elem)return;const t=Al(e.elem);if(!t)return;e.elem=t;const n=Tl(e.elem);document.body.classList.contains("mceNonEditable")||Ll(e.elem),o=_l(e,n),o.type&&(o.operation="application_element_settings_set",a.messageService.send(o))}finally{a.decrementLock()}}function Al(e){const o=Sl();return!o||!o.getMappedParent(e)?e:o.getVisibleNode(e)}function Tl(e){const o=a.hasClosestTrWithClass(e,a.CLASS_NAME_OL),t=a.hasClosestTrWithClass(e,a.CLASS_NAME_UL),n=o||t,r=n?e.closest("tr")?.querySelector("td:first-child div:first-child"):null,i=document.querySelectorAll(`.${a.CLASS_NAME_OL}, .${a.CLASS_NAME_UL}`);return{isElementListOL:o,isElementListUL:t,isElementList:n,isCellCustomTable:!!e.closest(".em-element-custom-table"),bulletElem:r,totalListCount:i.length}}function Ho(e){return{variableElement:El,requestElemBullet:e.bulletElem,isElementListOL:e.isElementListOL,isElementListUL:e.isElementListUL,isElementList:e.isElementList}}function Ll(e){const o=window.getSelection();(o?.isCollapsed||!o?.isCollapsed&&!e.querySelector("editor"))&&(a.removeAllAttributes("em-edit"),e.tagName!=="TABLE"&&(a.resolveActiveElement(e).setAttribute("em-edit","active"),wl(e)),kl(e))}function wl(e){const o=e.closest("table");if(!o)return;for(const n of o.querySelectorAll('[contenteditable="true"]'))n.tagName!=="EDITOR"&&n.removeAttribute("contenteditable");const t=o.querySelector("editor");if(t){const n=t.firstChild;t.childNodes.length===1&&n?.nodeType===1&&n.tagName==="A"&&n.childNodes.length===1&&n.firstChild?.nodeType===3?n.setAttribute("contenteditable","true"):t.setAttribute("contenteditable","true")}}function kl(e){const o=e.parentElement;o&&(o.querySelectorAll("strike, s").forEach(t=>{t.style.textDecoration="line-through"}),o.querySelectorAll("u").forEach(t=>{t.style.textDecoration="underline"}))}function _l(e,o){const t=e.elem;if(!(window.getSelection()?.isCollapsed??!0)&&!t.closest("a")&&!Cl()&&!o.isCellCustomTable){const n=Ho(o);return{type:"text",caption:Locale.TEXT,settings:Zt(e,Locale,n)}}if(t.closest("amp-carousel"))return Nl(e);if(t.tagName==="AMP-ACCORDION")return Bl(e);if(_n(t))return{type:Xt(e,Locale).type,caption:Xt(e,Locale).caption,settings:Xt(e,Locale)};if(!o.isCellCustomTable&&(t.tagName==="A"||t.tagName==="EM-REPLACE"&&t.closest("a")))return Ml(e,o);if(t.tagName==="TABLE"&&t.getAttribute("em")!=="atom")return Rl(e);if(t.tagName==="LI"&&Kt(t)){const n=Ho(o);return{type:"text",caption:Locale.TEXT,settings:Zt(e,Locale,n)}}return o.isCellCustomTable?Pl(e):t.tagName==="TD"?Hl(e):t.closest(".em-vindent")?Il(e):t.classList.contains("em-floatblock")||t.closest(".em-floatblock")?Ol(e):t.tagName==="DIV"?xl(e,o):t.getAttribute("em")==="block"?Dl(e):{}}function Nl(e){return{type:"carousel",caption:Locale.CAROUSEL,settings:{}}}function Bl(e){return{type:"accordion",caption:Locale.ACCORDION,settings:{}}}function Ml(e,o){const t=e.elem;if(t.style?.display==="block"||t.style?.display==="inline-block")return{type:"button",caption:Locale.BUTTON,settings:{}};const n=Ho(o);return{type:"text",caption:Locale.TEXT,settings:Zt(e,Locale,n)}}function Rl(e){return e.elem.innerHTML===""?{type:"emptyTable",settings:{}}:{type:"table",caption:Locale.TABLE,settings:{}}}function Pl(e){return{type:"customTable",caption:Locale.TABLE,settings:{}}}function Hl(e){return{type:"td",caption:Locale.TABLE_COLUMN,settings:{}}}function Il(e){return{type:"vindent",caption:Locale.VERTICAL_INDENT,settings:{}}}function Ol(e){return{type:"floatBlock",caption:Locale.FLOAT_BLOCK,settings:{}}}function xl(e,o){return{type:"div",caption:Locale.CONTAINER,settings:{}}}function Dl(e){return{type:"structure",caption:Locale.STRUCTURE,settings:{}}}var Hg=Promise.resolve();function Lt(e){return!(!e.startsWith("#")||e.indexOf("#",1)!==-1)}var Fl=["em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"],ql=["em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top"],Wl=["em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"];function In(){document.querySelectorAll(".em-block-insert").forEach(e=>{e.classList.remove(...Fl)})}function $l(){document.querySelectorAll(".em-atom-insert").forEach(e=>{e.classList.remove(...ql)})}function Jt(){document.querySelectorAll(".em-blockatom-insert").forEach(e=>{e.classList.remove(...Wl)})}function Io(e,o){const t=e.getBoundingClientRect();return o>t.top+t.height/2?"bottom":"top"}function On(e,o){const t=e.getBoundingClientRect(),n=document.body.getBoundingClientRect();return o==="bottom"?t.bottom>n.height-21:t.top<2}function Oo(e,o,t){const n=t==="atom"?"em-atom-insert":"em-block-insert",r=t==="blockatom"?"em-blockatom-insert":n;if(e.classList.add(r),o==="bottom"){e.classList.remove(`${n}_top`,`${n}_top-document`);const i=On(e,"bottom")?`${n}_bottom-document`:`${n}_bottom`;e.classList.add(i)}else{e.classList.remove(`${n}_bottom`,`${n}_bottom-document`);const i=On(e,"top")?`${n}_top-document`:`${n}_top`;e.classList.add(i)}}function xo(e){return e.tagName==="TABLE"&&!e.innerHTML}function Qt(e){return e.tagName==="TABLE"||e.tagName==="TR"?e.querySelector("[data-template-content]")??e.querySelector("td"):e}function xn(e){if(!e?.length)return null;for(let o=0;o<e.length;o++){const t=e.item(o);if(t?.type.startsWith("image/"))return t}return null}function zl(e){if(!e?.items?.length)return null;for(let o=0;o<e.items.length;o++){const t=e.items[o];if(t.kind!=="file")continue;const n=t.getAsFile();if(n&&n.type.startsWith("image/"))return n}return null}function Vl(e){const o=xn(e.dataTransfer?.files??null);return o||zl(e.dataTransfer??null)}function Do(e){const o=document.body?.parentElement??document.body;if(!o)return null;const t=document.elementFromPoint(e.clientX,e.clientY);if(!t)return null;const n=t.closest(".em-element-resize-img-container");if(n){const i=n.querySelector("img");if(i&&o.contains(i))return i}const r=t.closest("img");return!r||!o.contains(r)?null:r}function wt(e){const o=e.dataTransfer?.types;return!!o&&Array.from(o).includes("Files")}function Fo(e){if(!wt(e))return!1;const o=e.dataTransfer;if(!o)return!1;if(o.files?.length)return!!xn(o.files);const t=o.items;if(!t?.length)return!0;for(let n=0;n<t.length;n++){const r=t[n];if(r.kind!=="file")continue;const i=r.type||"";if(i.startsWith("image/")||i==="")return!0}return!1}var Dn="em-native-img-drop-target",qo="em-native-img-uploading",Ul="em-native-img-drop-loading",eo="em-native-file-drag",kt=null,et=null;function Fn(){et&&(window.removeEventListener("scroll",et.reposition,!0),window.removeEventListener("resize",et.reposition),et.resizeObserver?.disconnect(),et.overlay.remove(),et=null)}function jl(e){Fn();const o=document.createElement("div");o.className="em-native-img-upload-spin-overlay",o.setAttribute("aria-hidden","true");const t=document.createElement("div");t.className="em-native-img-upload-spin",o.appendChild(t),document.body.appendChild(o);const n=()=>{const i=e.getBoundingClientRect();o.style.left=`${Math.round(i.left)}px`,o.style.top=`${Math.round(i.top)}px`,o.style.width=`${Math.max(Math.round(i.width),1)}px`,o.style.height=`${Math.max(Math.round(i.height),1)}px`};n(),window.addEventListener("scroll",n,!0),window.addEventListener("resize",n);let r=null;typeof ResizeObserver<"u"&&(r=new ResizeObserver(()=>n()),r.observe(e)),et={overlay:o,reposition:n,resizeObserver:r}}function Wo(){kt&&(kt.classList.remove(Dn),kt=null)}function tt(){document.body.classList.remove(eo),Wo()}function Gl(e){if(!wt(e)){tt();return}if(!Fo(e)){tt();return}document.body.classList.add(eo);const o=Do(e);if(!o){Wo();return}kt!==o&&(Wo(),kt=o,o.classList.add(Dn))}function qn(){Fn(),document.body.classList.remove(Ul),document.body.classList.remove(eo),document.querySelectorAll(`.${qo}`).forEach(e=>{e.classList.remove(qo)})}function Yl(e,o){if(o.lockEditor||!wt(e))return!1;const t=Vl(e);if(!t)return!1;const n=Do(e);return n?(o.applicationElementSettingsSet({elem:n}),tt(),n.classList.add(qo),jl(n),o.messageService.send({operation:a.EVENT_TYPES.APPLICATION_NATIVE_IMAGE_DROP,file:t}),!0):!1}function Kl(e,o){if(o.lockEditor)return;document.body.classList.contains("em-block-insert-body")||o.messageService.send({operation:"application_scroll-block-show"});const t=e.target;t.getAttribute("em")==="atom"&&(document.body.classList.add("em-atom-insert-body-inside"),o.commit(!1),o.mutableState.atomReplaced=t)}function Xl(e,o){o.lockEditor||(tt(),e.preventDefault(),o.messageService.send({operation:"application_scroll-block-hide"}))}function Zl(e,o){if(e.preventDefault(),o.lockEditor){tt();return}wt(e)?(Fo(e)&&Do(e)&&(e.dataTransfer.dropEffect="copy"),Gl(e)):tt();const t=e.target;if(document.body.classList.contains("em-block-insert-body")){const n=xo(t)?null:t.closest('[em="block"]');if(n){o.mutableState.targetBlock=n;const r=Qt(n);r&&Oo(r,Io(r,e.pageY),"block")}else In()}else if(document.body.classList.contains("em-atom-insert-body")){const n=t.closest('[em="atom"]');if(n&&n.innerHTML.trim())o.mutableState.targetBlock=n,Oo(n,Io(n,e.pageY),"atom"),Jt();else if(t.closest('[em="block"]')&&t.tagName==="TD"&&!t.innerHTML&&!t.hasAttribute("height")||t.tagName==="DIV"&&t.closest("amp-accordion")&&!t.innerHTML)Jt();else{const r=t.closest('[em="block"]');if(r){o.mutableState.targetBlock=r;const i=Qt(r);i&&(Oo(i,Io(i,e.pageY),"blockatom"),$l())}}}}function Jl(e,o){if(o.lockEditor)return;wt(e)&&Fo(e)&&document.body.classList.add(eo);const t=e.target;if(document.body.classList.contains("em-block-insert-body")){document.querySelectorAll(".em-block-insert-empty").forEach(r=>{r.classList.remove("em-block-insert-empty")});const n=t.closest('[em="block"]');xo(t)?(t.classList.add("em-block-insert-empty"),In()):n&&(o.mutableState.targetBlock=n)}else if(document.body.classList.contains("em-atom-insert-body")||document.body.classList.contains("em-atom-insert-body-inside")){document.querySelectorAll(".em-atom-insert-empty").forEach(i=>{i.classList.remove("em-atom-insert-empty")});const n=t.closest('[em="atom"]');n&&n.innerHTML.trim()?(o.mutableState.targetBlock=n,document.querySelectorAll(".em-atom-insert, .em-blockatom-insert").forEach(i=>{i.classList.remove("em-atom-insert","em-blockatom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")})):t.closest('[em="block"]')&&t.tagName==="TD"&&!t.innerHTML&&!t.hasAttribute("height")&&t.parentElement&&[...t.parentElement.children].indexOf(t)%2===0||t.tagName==="DIV"&&t.closest("amp-accordion")&&!t.innerHTML?(t.classList.add("em-atom-insert-empty"),document.querySelectorAll(".em-atom-insert, .em-blockatom-insert").forEach(i=>{i.classList.remove("em-atom-insert","em-blockatom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")})):document.querySelectorAll(".em-atom-insert").forEach(i=>{i.classList.remove("em-atom-insert","em-blockatom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")}),document.querySelectorAll(".em-block-insert-empty").forEach(i=>{i.classList.remove("em-block-insert-empty")});const r=t.closest('[em="block"]');xo(t)?(t.classList.add("em-block-insert-empty"),Jt()):r?o.mutableState.targetBlock=r:Jt()}}function Ql(e,o){if(o.lockEditor)return;const t=e.target;if(document.body.classList.contains("em-block-insert-body")){const n=e.relatedTarget,r=t.closest('[em="block"]');if(n&&r&&r.contains(n))return;o.mutableState.newTargetblock=t.closest('[em="block"]'),o.mutableState.newTargetblock&&(t.closest('[em="block"]')&&(o.mutableState.newTargetblock!==o.mutableState.targetBlock||o.mutableState.newTargetblock.closest('[em="group"]')!==o.mutableState.targetBlock?.closest('[em="group"]'))?o.mutableState.newTargetblock.tagName==="DIV"?o.mutableState.newTargetblock.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"):o.mutableState.newTargetblock.querySelectorAll(".em-block-insert").forEach(i=>{i.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}):document.querySelectorAll(".em-block-insert-empty").forEach(i=>{i.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}))}else if(document.body.classList.contains("em-atom-insert-body")){const n=e.relatedTarget,r=t.closest('[em="atom"]');if(n&&r&&r.contains(n))return;const i=t.closest('[em="block"]');if(n&&i&&i.contains(n))return;o.mutableState.newTargetblock=t.closest('[em="atom"]'),o.mutableState.newTargetblock&&(t.getAttribute("em")==="atom"&&o.mutableState.newTargetblock!==o.mutableState.targetBlock?o.mutableState.newTargetblock.classList.remove("em-atom-insert","em-blockatom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top"):document.querySelectorAll(".em-atom-insert-empty").forEach(s=>{s.classList.remove("em-atom-insert","em-blockatom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")}));const l=t.closest('[em="block"]');l&&(t.closest('[em="block"]')&&(l!==o.mutableState.targetBlock||l.closest('[em="group"]')!==o.mutableState.targetBlock?.closest('[em="group"]'))?l.tagName==="DIV"?l.classList.remove("em-atom-insert","em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"):l.querySelectorAll(".em-blockatom-insert").forEach(s=>{s.classList.remove("em-atom-insert","em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}):document.querySelectorAll(".em-block-insert-empty").forEach(s=>{s.classList.remove("em-atom-insert","em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}))}}function ea(e,o,t){if(!e)return;let n=document.head.querySelector('style[em="styles"]'),r="";n?r=t.HTMLDocument.getInnerHtml(n):(n=document.createElement("style"),n.setAttribute("em","styles"),n=document.head.insertAdjacentElement("beforeend",n));const i=document.createElement("div");o&&(e=e.replace(/(max-device-width:|max-width:)\d+px/g,s=>s.replace(/\d+/,String(o)))),i.insertAdjacentHTML("afterbegin",e);let l=t.minify(r+`
2
2
  `+[...i.querySelectorAll("style")].map(s=>s.innerHTML).join(`
3
3
  `),{restructure:!0,forceMediaMerge:!0}).css;l=t.cssbeautify(l,{indent:" ",autosemicolon:!0}),n&&(n.textContent=`
4
4
  `+l+`
5
- `)}function Ql(e){for(const o of e.reverse())document.head?.prepend(o),document.head?.insertAdjacentHTML("afterbegin",`
6
- `)}function ea(e){return e.classList.contains("em-block-insert_bottom-document")||e.classList.contains("em-block-insert_bottom")?"afterend":e.classList.contains("em-block-insert_top-document")||e.classList.contains("em-block-insert_top")?"beforebegin":"afterend"}function to(){a.clearPendingPaletteInsert(),tt(),document.body.classList.remove("em-block-insert-body"),document.querySelectorAll(".em-block-insert-empty").forEach(e=>{e.classList.remove("em-block-insert-empty")}),document.body.classList.remove("em-atom-insert-body","em-atom-insert-body-inside"),document.querySelectorAll(".em-atom-insert-empty").forEach(e=>{e.classList.remove("em-atom-insert-empty")}),document.querySelectorAll(".sortable-chosen.sortable-ghost").forEach(e=>{e.classList.remove("sortable-chosen","sortable-ghost")})}function Wn(e,o,t){const n=e.target,r=t.parseFromString(o.settings.blockHTML||"");let i=r.filter(c=>c.tagName&&c.tagName!=="LINK"&&c.tagName!=="STYLE").map(c=>t.getOuterHtml(c)).join("");const l=r.filter(c=>c.tagName==="STYLE").map(c=>t.getOuterHtml(c)).join(""),s=r.filter(c=>c.tagName==="LINK"&&c.getAttribute("em-class")).filter(c=>!document.head?.querySelector(`link[em-class="${c.getAttribute("em-class")}"]`));if(Jl(l,t.emailWidth,{minify:t.minify,cssbeautify:t.cssbeautify,HTMLDocument:t.HTMLDocument}),Ql(s),o.settings.type!=="project"&&(i=t.commonStylesApplyToBlock({html:i})),i.match(/class="em-countdown"/gi)&&(i=t.uptimeCountdown({blockHTML:i})),t.isTableElement(n)&&!n.innerHTML)n.getAttribute("em")==="block"&&n.removeAttribute("em"),(i.indexOf("empty-structure")>-1||i.indexOf("em-structure")>-1)&&(i=t.setBlockMaxWidth({blockHTML:i,targetBlock:n}),i=t.setFloatBlocksWidth({blockHTML:i,targetBlock:n,project:o.settings.project})),i=t.checkBlockAdaptivity({blockHTML:i,blockIsTr:i.substring(0,3)==="<tr"}),i.substring(0,3)==="<tr"?t.insertAdjacentHTML(n,"beforeend",`
5
+ `)}function ta(e){for(const o of e.reverse())document.head?.prepend(o),document.head?.insertAdjacentHTML("afterbegin",`
6
+ `)}function oa(e){return e.classList.contains("em-block-insert_bottom-document")||e.classList.contains("em-block-insert_bottom")?"afterend":e.classList.contains("em-block-insert_top-document")||e.classList.contains("em-block-insert_top")?"beforebegin":"afterend"}function to(){a.clearPendingPaletteInsert(),tt(),document.body.classList.remove("em-block-insert-body"),document.querySelectorAll(".em-block-insert-empty").forEach(e=>{e.classList.remove("em-block-insert-empty")}),document.body.classList.remove("em-atom-insert-body","em-atom-insert-body-inside"),document.querySelectorAll(".em-atom-insert-empty").forEach(e=>{e.classList.remove("em-atom-insert-empty")}),document.querySelectorAll(".sortable-chosen.sortable-ghost").forEach(e=>{e.classList.remove("sortable-chosen","sortable-ghost")})}function Wn(e,o,t){const n=e.target,r=t.parseFromString(o.settings.blockHTML||"");let i=r.filter(c=>c.tagName&&c.tagName!=="LINK"&&c.tagName!=="STYLE").map(c=>t.getOuterHtml(c)).join("");const l=r.filter(c=>c.tagName==="STYLE").map(c=>t.getOuterHtml(c)).join(""),s=r.filter(c=>c.tagName==="LINK"&&c.getAttribute("em-class")).filter(c=>!document.head?.querySelector(`link[em-class="${c.getAttribute("em-class")}"]`));if(ea(l,t.emailWidth,{minify:t.minify,cssbeautify:t.cssbeautify,HTMLDocument:t.HTMLDocument}),ta(s),o.settings.type!=="project"&&(i=t.commonStylesApplyToBlock({html:i})),i.match(/class="em-countdown"/gi)&&(i=t.uptimeCountdown({blockHTML:i})),t.isTableElement(n)&&!n.innerHTML)n.getAttribute("em")==="block"&&n.removeAttribute("em"),(i.indexOf("empty-structure")>-1||i.indexOf("em-structure")>-1)&&(i=t.setBlockMaxWidth({blockHTML:i,targetBlock:n}),i=t.setFloatBlocksWidth({blockHTML:i,targetBlock:n,project:o.settings.project})),i=t.checkBlockAdaptivity({blockHTML:i,blockIsTr:i.substring(0,3)==="<tr"}),i.substring(0,3)==="<tr"?t.insertAdjacentHTML(n,"beforeend",`
7
7
  `+i+`
8
8
  `):t.insertAdjacentHTML(n,"beforeend",`
9
9
  <tr><td align="center">
@@ -11,7 +11,7 @@ __useblocks__.define("js/iframe.js",["require","exports","module","js/rolldown-r
11
11
  </td></tr>
12
12
  `),o.settings&&(t.messageService.send("application_block_inserted",{type:o.settings.type,name:o.settings.name,blockId:o.settings.blockId,project:o.settings.project}),a.clearPendingPaletteInsert());else if(n.tagName==="BODY"){const c=document.querySelector('[em="block"]:last-child'),d="afterend";(i.indexOf("empty-structure")>-1||i.indexOf("em-structure")>-1)&&(i=t.setBlockMaxWidth({blockHTML:i,targetBlock:c}),i=t.setFloatBlocksWidth({blockHTML:i,targetBlock:c,project:o.settings.project})),i=t.checkBlockAdaptivity({blockHTML:i,blockIsTr:i.substring(0,3)==="<tr"});const u=document.createElement("table");u.replaceChildren(...t.parseFromString(`
13
13
  `+i+`
14
- `)),[...u.querySelectorAll(":scope> tr")].reverse().forEach(g=>c.insertAdjacentElement(d,g)),o.settings&&(t.messageService.send("application_block_inserted",{type:o.settings.type,name:o.settings.name,blockId:o.settings.blockId,project:o.settings.project}),a.clearPendingPaletteInsert())}else{const c=n.closest('[em="block"]');if(c){const d=Qt(c),u=d?ea(d):"afterend";if((i.indexOf("empty-structure")>-1||i.indexOf("em-structure")>-1)&&(i=t.setBlockMaxWidth({blockHTML:i,targetBlock:c}),i=t.setFloatBlocksWidth({blockHTML:i,targetBlock:c,project:o.settings.project})),i=t.checkBlockAdaptivity({blockHTML:i,blockIsTr:i.substring(0,3)==="<tr"}),c.tagName==="TR")if(i.substring(0,3)==="<tr"){const g=document.createElement("table");g.replaceChildren(...t.parseFromString(`
14
+ `)),[...u.querySelectorAll(":scope> tr")].reverse().forEach(g=>c.insertAdjacentElement(d,g)),o.settings&&(t.messageService.send("application_block_inserted",{type:o.settings.type,name:o.settings.name,blockId:o.settings.blockId,project:o.settings.project}),a.clearPendingPaletteInsert())}else{const c=n.closest('[em="block"]');if(c){const d=Qt(c),u=d?oa(d):"afterend";if((i.indexOf("empty-structure")>-1||i.indexOf("em-structure")>-1)&&(i=t.setBlockMaxWidth({blockHTML:i,targetBlock:c}),i=t.setFloatBlocksWidth({blockHTML:i,targetBlock:c,project:o.settings.project})),i=t.checkBlockAdaptivity({blockHTML:i,blockIsTr:i.substring(0,3)==="<tr"}),c.tagName==="TR")if(i.substring(0,3)==="<tr"){const g=document.createElement("table");g.replaceChildren(...t.parseFromString(`
15
15
  `+i+`
16
16
  `)),[...g.querySelectorAll(":scope > tr")].reverse().forEach(m=>c.insertAdjacentElement(u,m))}else{const g=document.createElement("table");g.replaceChildren(...t.parseFromString(`
17
17
  <tr em="block"><td align="center">
@@ -55,9 +55,9 @@ __useblocks__.define("js/iframe.js",["require","exports","module","js/rolldown-r
55
55
  </tr>
56
56
  </table>
57
57
  </td>
58
- </tr>`}function ta(e,o,t,n,r){o.match(/em="atom"><tr><td>\s*<img/gi)&&!o.match(/class="em-countdown"/gi)&&(o=r.setImageWidth({atomHTML:o,targetAtom:e})),o.match(/class="em-countdown"/gi)?r.insertCountdown({targetElem:e,targetPlace:"beforeend",atomHTML:o}):e.insertAdjacentHTML("beforeend",`
58
+ </tr>`}function na(e,o,t,n,r){o.match(/em="atom"><tr><td>\s*<img/gi)&&!o.match(/class="em-countdown"/gi)&&(o=r.setImageWidth({atomHTML:o,targetAtom:e})),o.match(/class="em-countdown"/gi)?r.insertCountdown({targetElem:e,targetPlace:"beforeend",atomHTML:o}):e.insertAdjacentHTML("beforeend",`
59
59
  `+o+`
60
- `),t!=null&&(e.closest(".empty-structure")||e.closest(".em-structure"))&&t.remove(),n.settings?.name&&(r.messageService.send("application_atom_inserted",n.settings.name),a.clearPendingPaletteInsert())}function oa(e,o,t,n,r){const i=e.target,l=!!document.querySelector(".em-blockatom-insert"),s=l?i.closest('[em="block"]'):i,c=l?document.querySelector(".em-blockatom-insert"):document.querySelector(".em-block-insert-empty");o.match(/em="atom"><tr><td>\s*<img/gi)&&(o=n.setImageWidth({atomHTML:o,targetAtom:c}));let d=$n(o);o!=='<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="20"></td></tr></table>'&&r(d.match(/<style((.|\n|\r)*?)<\/style>/g)),t.settings?.type!=="project"&&(d=n.commonStylesApplyToBlock({html:d}));let u=null;s.tagName==="TABLE"||s.tagName==="TR"?u=s.querySelector("[data-template-content]")??s.querySelector("td"):u=s,(d.indexOf("empty-structure")>-1||d.indexOf("em-structure")>-1)&&(d=n.setFloatBlocksWidth({blockHTML:d,targetBlock:s,project:t.settings?.project}));let g="beforeend";l&&u&&(u.classList.contains("em-block-insert_bottom-document")||u.classList.contains("em-block-insert_bottom")?g="afterend":(u.classList.contains("em-block-insert_top-document")||u.classList.contains("em-block-insert_top"))&&(g="beforebegin"));const m=!!o.match(/class="em-countdown"/gi),f=d.substring(0,3)==="<tr";if(s.tagName==="TR")if(f)if(m)n.insertCountdown({targetElem:s,targetPlace:g,atomHTML:d});else{const p=document.createElement("tr");p.setAttribute("em","block"),p.classList.add("em-structure"),p.innerHTML=`
60
+ `),t!=null&&(e.closest(".empty-structure")||e.closest(".em-structure"))&&t.remove(),n.settings?.name&&(r.messageService.send("application_atom_inserted",n.settings.name),a.clearPendingPaletteInsert())}function ra(e,o,t,n,r){const i=e.target,l=!!document.querySelector(".em-blockatom-insert"),s=l?i.closest('[em="block"]'):i,c=l?document.querySelector(".em-blockatom-insert"):document.querySelector(".em-block-insert-empty");o.match(/em="atom"><tr><td>\s*<img/gi)&&(o=n.setImageWidth({atomHTML:o,targetAtom:c}));let d=$n(o);o!=='<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="20"></td></tr></table>'&&r(d.match(/<style((.|\n|\r)*?)<\/style>/g)),t.settings?.type!=="project"&&(d=n.commonStylesApplyToBlock({html:d}));let u=null;s.tagName==="TABLE"||s.tagName==="TR"?u=s.querySelector("[data-template-content]")??s.querySelector("td"):u=s,(d.indexOf("empty-structure")>-1||d.indexOf("em-structure")>-1)&&(d=n.setFloatBlocksWidth({blockHTML:d,targetBlock:s,project:t.settings?.project}),d=n.fitImagesToColumns(d));let g="beforeend";l&&u&&(u.classList.contains("em-block-insert_bottom-document")||u.classList.contains("em-block-insert_bottom")?g="afterend":(u.classList.contains("em-block-insert_top-document")||u.classList.contains("em-block-insert_top"))&&(g="beforebegin"));const m=!!o.match(/class="em-countdown"/gi),f=d.substring(0,3)==="<tr";if(s.tagName==="TR")if(f)if(m)n.insertCountdown({targetElem:s,targetPlace:g,atomHTML:d});else{const p=document.createElement("tr");p.setAttribute("em","block"),p.classList.add("em-structure"),p.innerHTML=`
61
61
  `+d+`
62
62
  `,s.insertAdjacentElement(g,p)}else if(m)n.insertCountdown({targetElem:s,targetPlace:g,atomHTML:`<tr em="block"><td align="center">
63
63
  `+d+`
@@ -75,7 +75,7 @@ __useblocks__.define("js/iframe.js",["require","exports","module","js/rolldown-r
75
75
  </table></div>
76
76
  `);else m?n.insertCountdown({targetElem:s,targetPlace:g,atomHTML:d}):s.insertAdjacentHTML(g,`
77
77
  `+d+`
78
- `);document.querySelectorAll(".em-blockatom-insert").forEach(p=>{p.classList.remove("em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}),t.settings?.name&&(n.messageService.send("application_atom_inserted",t.settings.name),a.clearPendingPaletteInsert())}function na(e,o,t){const n=document.querySelector(".em-atom-insert");if(e.match(/em="atom"><tr><td>\s*<img/gi)&&n&&(e=t.setImageWidth({atomHTML:e,targetAtom:n})),!n)return;let r="afterend";n.classList.contains("em-atom-insert_bottom-document")||n.classList.contains("em-atom-insert_bottom")?r="afterend":(n.classList.contains("em-atom-insert_top-document")||n.classList.contains("em-atom-insert_top"))&&(r="beforebegin");const i=!!e.match(/class="em-countdown"/gi);if(n.tagName==="TR"){const l=document.createElement("div");l.innerHTML=e;const s=l.querySelector('[em="atom"]');s&&s.removeAttribute("em");let c=0;const d=n.querySelector("[colspan]");d?c=d.getAttribute("colspan")||0:c=n.childElementCount,i?t.insertCountdown({targetElem:n,targetPlace:r,atomHTML:`
78
+ `);document.querySelectorAll(".em-blockatom-insert").forEach(p=>{p.classList.remove("em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}),t.settings?.name&&(n.messageService.send("application_atom_inserted",t.settings.name),a.clearPendingPaletteInsert())}function ia(e,o,t){const n=document.querySelector(".em-atom-insert");if(e.match(/em="atom"><tr><td>\s*<img/gi)&&n&&(e=t.setImageWidth({atomHTML:e,targetAtom:n})),!n)return;let r="afterend";n.classList.contains("em-atom-insert_bottom-document")||n.classList.contains("em-atom-insert_bottom")?r="afterend":(n.classList.contains("em-atom-insert_top-document")||n.classList.contains("em-atom-insert_top"))&&(r="beforebegin");const i=!!e.match(/class="em-countdown"/gi);if(n.tagName==="TR"){const l=document.createElement("div");l.innerHTML=e;const s=l.querySelector('[em="atom"]');s&&s.removeAttribute("em");let c=0;const d=n.querySelector("[colspan]");d?c=d.getAttribute("colspan")||0:c=n.childElementCount,i?t.insertCountdown({targetElem:n,targetPlace:r,atomHTML:`
79
79
  <tr em="atom"><td colspan="`+c+`">
80
80
  `+l.innerHTML+`
81
81
  </td></tr>
@@ -85,7 +85,7 @@ __useblocks__.define("js/iframe.js",["require","exports","module","js/rolldown-r
85
85
  </td></tr>
86
86
  `)}else i?t.insertCountdown({targetElem:n,targetPlace:r,atomHTML:e}):n.insertAdjacentHTML(r,`
87
87
  `+e+`
88
- `);n.classList.remove("em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top"),o.settings?.name&&(t.messageService.send("application_atom_inserted",o.settings.name),a.clearPendingPaletteInsert())}function zn(e,o){const t=o.mutableState.atomReplaced;let n={settings:{}};const r=e.target,i=m=>o._setDocumentStyles(m,{minify:o.minify,cssbeautify:o.cssbeautify,HTMLDocument:o.HTMLDocument}),l=e.dataTransfer?.getData("Text")||"";if(l&&o.isJsonString(l)?n=JSON.parse(l):t&&(n={settings:{atomHTML:a.serializeOuterHtml(t)}}),!n.settings?.atomHTML)return;let s=n.settings.atomHTML.replaceAll(/<style((.|\n|\r)*?)<\/style>/gi,"").trim();i(n.settings.atomHTML.match(/<style((.|\n|\r)*?)<\/style>/g)),s=o.commonStylesApply({html:s});const c=r.closest('[em="block"]')&&r.tagName==="TD"&&!r.innerHTML&&!r.hasAttribute("height")&&(r.classList.contains("em-atom-insert-empty")||a.hasPendingPaletteAtom()),d=r.tagName==="DIV"&&r.closest("amp-accordion")&&!r.innerHTML;if(c||d){ta(r,s,t,n,o);return}const u=!!document.querySelector(".em-blockatom-insert"),g=r.tagName==="TABLE"&&!r.innerHTML;if(u||g){oa(e,s,n,o,i);return}r.closest('[em="atom"]')&&na(s,n,o)}var{START_POSITION:dt,NEW_EDITOR:Vn,ACTIVE_ELEMENT:Un}=a.LIST_TEMP_CLASSES,{TRIM_SPACES:ot,LT:_t,GT:Nt,EMPTY_TEXT:ra}=a.LIST_REGEX;function ia(e,o){const{activeElem:t,listContext:n,cursorPositionType:r,isTargetCell:i,commit:l,wrapEditor:s,removeTemporaryListClasses:c}=o,{classNameOl:d,classNameUl:u,isList:g}=n;if(!((e.key==="Enter"||e.keyCode===13)&&g&&i&&!e.shiftKey))return!1;if(e.preventDefault(),e.stopImmediatePropagation(),!t)return!0;const m=t.closest(`table.${d}`)||t.closest(`table.${u}`),f=t.closest(`table.${d}`)?d:u;if(!m)return!0;const p=a.extractTableRowData(t,f);if(!p)return!0;const{firstCellText:b,firstCellHtmlNoText:h,wrappedSecondCellHtml:y}=p;return r==="start"||r==="end"?la(t,m,f,d,u,r,b,h,y,s):r==="inside"&&aa(t,m,f,d,b,h,y,s),c(),l(),!0}function la(e,o,t,n,r,i,l,s,c,d){const u=e.querySelector("div");u&&u.classList.add(dt);const g=a.injectTextIntoFirstDiv(s,l),m=a.injectTextIntoFirstDiv(c," "),f=i==="end"?a.updateDivWithClassAndNbsp(m):m,p=o.outerHTML,b="<tr>"+g+f+"</tr>",h=a.removeEditorTags(p),y=a.insertRowRelativeToDivClass(h,b,dt,i==="start"),E=a.removeEditorTags(y);if(t===n){o.innerHTML=E;const v=a.parseTableToArray(o),C=a.renumberCellOneText(v),L=a.replaceEmptyWithNbsp(C),w=a.formatCellOneText(L),A=o.outerHTML;o.innerHTML=a.updateTableNumbering(A,w).replace(_t,"<").replace(Nt,">")}else o.innerHTML=E;a.processTableText(o,n,r,ot);const S=i==="start"?o.querySelector(".remove-start-element-position"):o.querySelector(".remove-new-editor-element");return S&&jn(S,o,d),S}function aa(e,o,t,n,r,i,l,s){const c=e.querySelector("div");c&&(c.classList.add(Un),c.classList.add(dt));const d=o.outerHTML,u=a.getTextPartsAtCursor(e),g=a.getHtmlPartsAtCursor(e);if(!u||!g)return null;const{beforeCursorPosition:m,afterCursorPosition:f}=u,{beforeHTML:p,afterHTML:b}=g,h=a.injectTextIntoFirstDiv(i,r),y=a.injectTextIntoFirstDiv(l,m===""?" ":p.replace(ot,"")),E=a.injectTextIntoFirstDiv(i,r),S=a.injectTextIntoFirstDiv(l,f===""?" ":b.replace(ot,"")),v=a.updateDivWithClassAndNbsp(S),C=("<tr>"+h+y+"</tr>"+("<tr>"+E+v+"</tr>")).replace(_t,"<").replace(Nt,">"),L=a.insertRowRelativeToDivClass(d,C,dt,!0),w=a.removeEditorTags(L),A=a.removeTrContainingDivWithClass(w,Un);if(t===n){o.innerHTML=A;const R=a.parseTableToArray(o),$=a.renumberCellOneText(R),J=a.replaceEmptyWithNbsp($),_=a.formatCellOneText(J),G=o.outerHTML;o.innerHTML=a.updateTableNumbering(G,_).replace(_t,"<").replace(Nt,">")}else o.innerHTML=A;const M=o.querySelector(".remove-new-editor-element");return M&&jn(M,o,s,!0),M}function jn(e,o,t,n=!1){e.textContent&&e.textContent.length>0&&(e.innerHTML=e.innerHTML.replace(ot,"")),ra.test(e.textContent||"")&&(e.textContent=" "),t(e,!0);const r=o.querySelector("editor"),i=r?.querySelector("div");if(i){const l=window.getSelection();if(l&&l.rangeCount>0){const s=l.getRangeAt(0);s.selectNodeContents(i),s.collapse(!0),l.removeAllRanges(),l.addRange(s)}}n&&r&&r.focus()}function sa(e,o){const{activeElem:t,listContext:n,cursorPositionType:r,isTargetCell:i,isEmptyText:l,commit:s,wrapEditor:c,removeTemporaryListClasses:d}=o,{classNameOl:u,classNameUl:g,isList:m}=n,f=(e.keyCode===38||e.key==="ArrowUp")&&r==="start",p=(e.keyCode===40||e.key==="ArrowDown")&&(!l&&r==="end"||l&&r==="start");if(!(f||p)||!m||!i||!t)return!1;e.preventDefault(),e.stopImmediatePropagation();const b=e.key==="ArrowUp"?"ArrowUp":"ArrowDown",h=t.closest(`table.${u}`)||t.closest(`table.${g}`);if(!h)return!0;const y=t.querySelector("div");y&&y.classList.add(dt);const E=h.outerHTML,S=a.removeEditorTags(E);h.innerHTML=a.modifyHtml(S,dt,Vn,b);const v=h.querySelector(".remove-new-editor-element");if(v){c(v,!0);const C=h.querySelector("editor"),L=C?.querySelector("div")?.childNodes[0],w=window.getSelection();if(w&&w.rangeCount>0){const A=w.getRangeAt(0);if(L&&L.nodeType===Node.TEXT_NODE){const M=L.textContent||"";A.setStart(L,M.replace(ot,"").length)}else C&&A.selectNodeContents(C);A.collapse(!0),w.removeAllRanges(),w.addRange(A)}}return d(),s(),!0}function ca(e,o,t){return(e.keyCode===39||e.key==="ArrowRight")&&(o==="end"||t)?(e.preventDefault(),e.stopImmediatePropagation(),!0):!1}function da(e,o){const t=window.navigator.platform.match("Mac"),{activeElem:n,listContext:r,cursorPositionType:i,isTargetCell:l,isEmptyText:s,parentElement:c,commit:d,wrapEditor:u,removeTemporaryListClasses:g,findNodeAtPosition:m,setCursorSafely:f}=o,{classNameOl:p,classNameUl:b,isList:h}=r;if(!((t?e.code==="Backspace":e.keyCode===46||e.keyCode===8)&&h)||!(!l||l&&(i==="start"||s&&i==="inside"||s&&i==="end"))||!n||!c)return!1;e.preventDefault(),e.stopImmediatePropagation();const y=n.closest(`table.${p}`)?p:b,E=c.closest("tr");if(!E)return!0;const S=E.previousElementSibling;if(!S&&!l)return!0;const v=l?n.querySelector("div"):E.querySelector("tr td:nth-child(2)")?.querySelector("div"),C=v?v.innerHTML:"",L=C?C.split(" ")[0]:"";L.replace(ot,"");const w=S?.querySelector("tr td:nth-of-type(2)");if(!w)return!0;const A=w.querySelector("div");if(!A)return!0;A.classList.add(Vn);const M=A.innerHTML,R=`${M}${C}`.replace(_t,"<").replace(Nt,">");E.remove();const $=A.closest(`table.${p}`)||A.closest(`table.${b}`);if(!$)return!0;const J=$.innerHTML,_=a.removeEditorTags(J);if(y===p){$.innerHTML=_;const x=a.parseTableToArray($),k=a.renumberCellOneText(x),se=a.replaceEmptyWithNbsp(k),z=a.formatCellOneText(se),ee=$.outerHTML;$.innerHTML=a.updateTableNumbering(ee,z).replace(_t,"<").replace(Nt,">")}else $.innerHTML=_;const G=$.querySelector(".remove-new-editor-element");if(!G)return g(),d(),!0;G.innerHTML=`${R.replace(ot,"")}&nbsp;`||"&nbsp;",u(G,!0);const H=G.closest("editor");if(!H)return g(),d(),!0;const P=window.getSelection(),q=document.createRange(),O=H.querySelector("div");if(!O||!P)return g(),d(),!0;const Q=H.textContent||"",re=L?Q.indexOf(L):-1;if(re!==-1&&L){const x=m(O,re);if(x)f(q,P,x.node,x.offset);else{const k=O.childNodes[0];k&&f(q,P,k,0)}}else{const x=document.createElement("div");x.innerHTML=M;const k=(x.textContent||"").length,se=m(O,k);if(se)f(q,P,se.node,se.offset);else{const z=document.createTreeWalker(O,NodeFilter.SHOW_TEXT,null);let ee=null;for(;z.nextNode();)ee=z.currentNode;ee&&f(q,P,ee,(ee.textContent||"").length)}}return H.focus(),g(),d(),!0}function ma(e,o,t){return(window.navigator.platform.match("Mac")?e.code==="Backspace":e.keyCode===46||e.keyCode===8)?!1:o&&!t?(e.preventDefault(),e.stopPropagation(),!0):!1}function ua(e){if(!e)return!1;const o=e.closest("li");return Kt(o)}function fa(e){const o=window.getSelection(),t=e.textContent||"",n=t.trim();if(!n||n===" ")return{position:"empty",offset:0,textContent:""};if(!o||o.rangeCount===0)return{position:"middle",offset:0,textContent:t};const r=o.getRangeAt(0);if(!e.contains(r.startContainer))return{position:"middle",offset:0,textContent:t};const i=document.createRange();i.selectNodeContents(e),i.setEnd(r.startContainer,r.startOffset);const l=i.toString().length;return l===0?{position:"start",offset:0,textContent:t}:l>=n.length?{position:"end",offset:l,textContent:t}:{position:"middle",offset:l,textContent:t}}function pa(e,o){const t=Array.from(o.querySelectorAll(":scope > li")),n=t.indexOf(e);return n===0?"first":n===t.length-1?"last":"middle"}function ga(e){const o=window.getSelection();if(!o||o.rangeCount===0)return e.innerHTML;const t=o.getRangeAt(0),n=document.createRange();n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset);const r=n.cloneContents(),i=document.createElement("div");return i.appendChild(r),i.innerHTML}function ba(e){const o=window.getSelection();if(!o||o.rangeCount===0)return"";const t=o.getRangeAt(0),n=document.createRange();n.selectNodeContents(e),n.setStart(t.endContainer,t.endOffset);const r=n.cloneContents(),i=document.createElement("div");return i.appendChild(r),i.innerHTML}function mt(e){const o=window.getSelection();if(!o)return;const t=document.createRange();t.selectNodeContents(e),t.collapse(!0),o.removeAllRanges(),o.addRange(t)}function Bt(e,o){e.hasAttribute("em-edit")&&(e.removeAttribute("em-edit"),o.setAttribute("em-edit","active"))}function ha(e,o){const t=document.createElement("br"),n=document.createElement("span");return n.innerHTML="&nbsp;",Bt(e,n),o.parentNode?.insertBefore(n,o),o.parentNode?.insertBefore(t,n),e.remove(),o.querySelectorAll("li").length===0&&o.remove(),mt(n),n}function ya(e,o){const t=Array.from(o.querySelectorAll(":scope > li")),n=t.indexOf(e),r=t.slice(n+1),i=document.createElement(o.tagName.toLowerCase());o.getAttribute("style")&&i.setAttribute("style",o.getAttribute("style")),r.forEach(c=>{i.appendChild(c)});const l=document.createElement("br"),s=document.createElement("span");return s.innerHTML="&nbsp;",Bt(e,s),i.children.length>0&&o.parentNode?.insertBefore(i,o.nextSibling),o.parentNode?.insertBefore(s,o.nextSibling),o.parentNode?.insertBefore(l,s),e.remove(),o.querySelectorAll("li").length===0&&o.remove(),mt(s),s}function Ea(e,o){if(!((e.key==="Enter"||e.keyCode===13)&&!e.shiftKey))return!1;const t=window.getSelection();if(!t||t.rangeCount===0)return!1;const n=t.getRangeAt(0).startContainer,r=n.nodeType===Node.TEXT_NODE?n.parentElement:n;if(!ua(r))return!1;const i=r?.closest("li");if(!i)return!1;const l=i.closest("ul, ol");if(!l)return!1;e.preventDefault(),e.stopImmediatePropagation();const s=fa(i),c=pa(i,l);switch(s.position){case"empty":Sa(i,l,c,o);break;case"start":Ca(i,l,o);break;case"end":va(i,l,o);break;case"middle":Aa(i,l,o)}return o.commit(),!0}function Sa(e,o,t,n){switch(t){case"last":const r=document.createElement("li");r.setAttribute("style",a.STANDARD_LIST_STYLES.LIST_ITEM),r.innerHTML="&nbsp;",e.after(r),Bt(e,r),mt(r);break;case"first":ha(e,o);break;case"middle":ya(e,o)}}function Ca(e,o,t){const n=document.createElement("li");n.setAttribute("style",a.STANDARD_LIST_STYLES.LIST_ITEM),n.innerHTML="&nbsp;",e.before(n),mt(e)}function va(e,o,t){const n=document.createElement("li");n.setAttribute("style",a.STANDARD_LIST_STYLES.LIST_ITEM),n.innerHTML="&nbsp;",e.after(n),Bt(e,n),mt(n)}function Aa(e,o,t){const n=ga(e),r=ba(e);e.innerHTML=n||"&nbsp;";const i=document.createElement("li");i.setAttribute("style",a.STANDARD_LIST_STYLES.LIST_ITEM),i.innerHTML=r||"&nbsp;",e.after(i),Bt(e,i),mt(i)}var Ta=['[contenteditable="false"]',".em-element-editor",'[class^="em-element-editor"]',".em-vindent"],$o=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">&nbsp;</div>`;function La(e){return!!e.closest("editor.em-text")}function Gn(e){e.querySelectorAll(Ta.join(",")).forEach(o=>{La(o)||o.remove()})}function wa(e){const o=e.cloneNode(!0),t=o.querySelector("editor.em-text");if(t){Gn(o);const r=t.querySelector("div");if(r)return r.outerHTML;const i=t.getAttribute("innerclass")??"",l=t.getAttribute("innerstyle")??"";return`<div${i?` class="${xe(i)}"`:""}${l?` style="${xe(l)}"`:""}>${t.innerHTML}</div>`}Gn(o);const n=o.querySelector("div");return n?n.outerHTML:o.innerHTML}function xe(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Me(e){if(!e)return;const o=e.trim().match(/^(-?\d+(?:\.\d+)?)px$/i);return o?Number(o[1]):void 0}function Mt(e){if(!e)return;const o=e.trim().split(/\s+/);if(o.length<3)return;const t=Me(o[0]),n=o[1],r=o.slice(2).join(" ");if(t!==void 0&&["none","solid","dashed","dotted","double"].includes(n))return{width:t,style:n,color:r}}function ka(e){const o=e.get("padding"),t=e.get("padding-top"),n=e.get("padding-right"),r=e.get("padding-bottom"),i=e.get("padding-left"),l={};if(o){const g=o.trim().split(/\s+/),m=Me(g[0]),f=Me(g[1]??g[0]),p=Me(g[2]??g[0]),b=Me(g[3]??g[1]??g[0]);m!==void 0&&(l.top=m),f!==void 0&&(l.right=f),p!==void 0&&(l.bottom=p),b!==void 0&&(l.left=b)}const s=Me(t??""),c=Me(n??""),d=Me(r??""),u=Me(i??"");return s!==void 0&&(l.top=s),c!==void 0&&(l.right=c),d!==void 0&&(l.bottom=d),u!==void 0&&(l.left=u),Object.keys(l).length?l:void 0}function Yn(e){if(e)return e.trim()}function _a(e){if(!e)return;const o=e.trim().toLowerCase();return["left","center","right","justify"].includes(o)?o:void 0}function Na(e){if(!e)return;const o=e.trim().toLowerCase();if(o==="top"||o==="text-top")return"top";if(o==="bottom"||o==="text-bottom")return"bottom";if(o==="middle")return"middle"}function Ba(e){const o=new Map;return e&&e.split(";").forEach(t=>{const[n,...r]=t.split(":");if(!n||r.length===0)return;const i=n.trim().toLowerCase(),l=r.join(":").trim();i&&o.set(i,l)}),o}function Ma(e){if(!e)return;const o=e.trim().replace(/\s+/g," ");if(o&&/^(\d+(\.\d+)?\s*(px|em|rem|%|pt)\s*){1,4}$/i.test(o))return o}function Ra(e){const o=Ba(e.getAttribute("style")),t=o.get("font-family")??void 0,n=Me(o.get("font-size")??""),r=Me(o.get("line-height")??""),i=Yn(o.get("color")??void 0),l=Yn(o.get("background-color")??void 0),s=_a(o.get("text-align")??void 0),c=Na(o.get("vertical-align")??void 0),d={top:Mt(o.get("border-top")),right:Mt(o.get("border-right")),bottom:Mt(o.get("border-bottom")),left:Mt(o.get("border-left"))},u=Mt(o.get("border"));u&&(d.top=d.top??u,d.right=d.right??u,d.bottom=d.bottom??u,d.left=d.left??u);const g=ka(o),m=Ma(o.get("border-radius")??void 0),f={};return t&&(f.fontFamily=t),n!==void 0&&(f.fontSize=n),r!==void 0&&(f.lineHeight=r),i&&(f.color=i),l&&(f.backgroundColor=l),s&&(f.textAlign=s),c&&(f.verticalAlign=c),g&&(f.padding=g),m&&(f.borderRadius=m),(d.top||d.right||d.bottom||d.left)&&(f.borders=d),Object.keys(f).length?f:void 0}function Pa(e){const o=e.getAttribute("align")?.toLowerCase();if(o==="left"||o==="center"||o==="right")return o}function Ha(e){const o=e.getAttribute("valign")?.toLowerCase();if(o==="top"||o==="middle"||o==="bottom")return o}function zo(e){if(e==null)return;const o=Number(e);return Number.isFinite(o)?o:void 0}function Rt(e){const o=Array.from(e.classList),t={};Array.from(e.attributes).forEach(d=>{const u=d.name.toLowerCase();u!=="class"&&(t[u]=d.value)});const n={width:e.getAttribute("width")??void 0,cellpadding:zo(e.getAttribute("cellpadding")),cellspacing:zo(e.getAttribute("cellspacing")),border:zo(e.getAttribute("border")),classList:o.length?o:void 0,attrs:Object.keys(t).length?t:void 0},r=[],i=[];let l=0;const s=Array.from(e.querySelectorAll(":scope > tr, :scope > tbody > tr, :scope > thead > tr, :scope > tfoot > tr")).filter(d=>d.querySelectorAll("td, th").length!==0);s.forEach(d=>{let u=0;Array.from(d.querySelectorAll("td, th")).forEach(g=>{const m=Math.max(1,g.colSpan||1);u+=m}),u>l&&(l=u)});let c=0;for(const d of s){i[c]||(i[c]=Array(l).fill(null));let u=0;const g=Array.from(d.querySelectorAll("td, th"));for(const m of g){for(;u<l&&i[c][u]!==null&&i[c][u]!==void 0;)u++;if(u>=l)continue;const f=Math.max(1,m.colSpan||1),p=Math.max(1,m.rowSpan||1),b=Math.min(p,s.length-c),h=`cell-${r.length}`,y=Array.from(m.classList),E=wa(m),S=Pa(m),v=Ha(m),C=Ra(m),L={id:h,row:c,col:u,rowspan:b,colspan:f,contentHtml:E,classList:y,align:S,valign:v,style:C};r.push(L);for(let w=0;w<b;w++){const A=c+w;i[A]||(i[A]=Array(l).fill(null));for(let M=0;M<f;M++){const R=u+M;R>=l||i[A][R]!==null&&i[A][R]!==void 0||(i[A][R]=h)}}u+=f}c++}for(let d=0;d<i.length;d++)for(let u=0;u<l;u++)(i[d][u]===null||i[d][u]===void 0)&&(i[d][u]=null);new Set(i.flat().filter(d=>d!==null)),new Set(r.map(d=>d.id));for(const d of r)for(let u=d.row;u<d.row+d.rowspan;u++)for(let g=d.col;g<d.col+d.colspan;g++)i[u]&&(i[u][g],d.id);return{rows:i.length,cols:l,cells:r,grid:i,meta:n}}function Kn(e,o,t){const n=JSON.parse(JSON.stringify(e));let r=-1;const i=typeof o=="string"?o.trim():"";if(i){for(const f of n.cells)if(Array.isArray(f.classList)&&f.classList.includes(i)){r=f.row;break}}r===-1&&(n.rows===0?(r=0,t=!0):(r=n.rows-1,t=!1));const l=n.cells.filter(f=>f.row===r).sort((f,p)=>f.col-p.col),s=n.cells.length===0;if(l.length===0)if(s)l.push({id:"cell-0",row:0,col:0,rowspan:1,colspan:1,contentHtml:$o,classList:[""],align:"center",valign:"top",style:{}}),n.cols=1;else for(let f=0;f<n.cols;f++)l.push({id:`template-${f}`,row:r,col:f,rowspan:1,colspan:1,contentHtml:$o,classList:[""],align:"center",valign:"top",style:{}});let c=1;for(const f of l)f.rowspan>c&&(c=f.rowspan);let d=t?r:r+c;const u=new Array(n.cols).fill(!1);for(const f of n.cells)if(f.row<d&&f.row+f.rowspan>d)for(let p=f.col;p<f.col+f.colspan;p++)u[p]=!0;for(const f of n.cells)f.row>=d&&(f.row+=1);const g=[];let m=n.cells.length;for(let f=0;f<n.cols;f++){if(u[f])continue;const p=l.find(h=>h.col<=f&&f<h.col+h.colspan)||l[0]||{contentHtml:$o,classList:[""],align:"center",valign:"top",style:{}},b=JSON.parse(JSON.stringify(p));b.id=`cell-${m++}`,b.contentHtml=oo(p.contentHtml," "),b.classList=b.classList.filter(h=>h!==i),b.row=d,b.col=f,b.rowspan=1,b.colspan=1,g.push(b)}n.cells.push(...g),n.rows+=1,n.grid.splice(d,0,new Array(n.cols).fill(null));for(let f=0;f<n.rows;f++)for(let p=0;p<n.cols;p++){const b=n.cells.find(h=>h.row<=f&&h.row+h.rowspan>f&&h.col<=p&&h.col+h.colspan>p);n.grid[f][p]=b?b.id:null}for(let f=0;f<n.cols;f++)n.grid[d][f]===null&&u[f];return n}function Ia(e){if(!e)return"";const o=[];if(e.fontFamily&&o.push(`font-family: ${e.fontFamily}`),e.fontSize!==void 0&&o.push(`font-size: ${e.fontSize}px`),e.lineHeight!==void 0&&o.push(`line-height: ${e.lineHeight}px`),e.color&&o.push(`color: ${e.color}`),e.backgroundColor&&o.push(`background-color: ${e.backgroundColor}`),e.textAlign&&o.push(`text-align: ${e.textAlign}`),e.verticalAlign&&o.push(`vertical-align: ${e.verticalAlign}`),e.borderRadius&&o.push(`border-radius: ${e.borderRadius}`),e.padding){const t=e.padding;t.top!==void 0&&t.right!==void 0&&t.bottom!==void 0&&t.left!==void 0&&t.top===t.right&&t.right===t.bottom&&t.bottom===t.left?o.push(`padding: ${t.top}px`):(t.top!==void 0&&o.push(`padding-top: ${t.top}px`),t.right!==void 0&&o.push(`padding-right: ${t.right}px`),t.bottom!==void 0&&o.push(`padding-bottom: ${t.bottom}px`),t.left!==void 0&&o.push(`padding-left: ${t.left}px`))}if(e.borders){const t=e.borders;t.border?o.push(`border: ${t.border.width}px ${t.border.style} ${t.border.color}`):(t.top&&o.push(`border-top: ${t.top.width}px ${t.top.style} ${t.top.color}`),t.right&&o.push(`border-right: ${t.right.width}px ${t.right.style} ${t.right.color}`),t.bottom&&o.push(`border-bottom: ${t.bottom.width}px ${t.bottom.style} ${t.bottom.color}`),t.left&&o.push(`border-left: ${t.left.width}px ${t.left.style} ${t.left.color}`))}return o.length?o.join("; "):""}function Se(e){if(e.rows===0||e.cols===0||!e.cells.length)return"<table></table>";const o=[];if(e.meta&&(e.meta.width&&o.push(`width="${xe(e.meta.width)}"`),e.meta.cellpadding!==void 0&&o.push(`cellpadding="${e.meta.cellpadding}"`),e.meta.cellspacing!==void 0&&o.push(`cellspacing="${e.meta.cellspacing}"`),e.meta.border!==void 0&&o.push(`border="${e.meta.border}"`),e.meta.classList?.length&&o.push(`class="${xe(e.meta.classList.join(" "))}"`),e.meta.attrs))for(const[r,i]of Object.entries(e.meta.attrs))o.push(`${xe(r)}="${xe(i)}"`);const t=new Map;for(const r of e.cells)t.set(r.id,r);const n=[];for(let r=0;r<e.rows;r++){const i=[];for(let l=0;l<e.cols;l++){const s=e.grid[r][l];if(!s)continue;const c=t.get(s);if(!c||c.row!==r||c.col!==l)continue;const d=[];c.rowspan>1&&d.push(`rowspan="${c.rowspan}"`),c.colspan>1&&d.push(`colspan="${c.colspan}"`),c.align&&d.push(`align="${xe(c.align)}"`),c.valign&&d.push(`valign="${xe(c.valign)}"`),c.classList?.length&&d.push(`class="${xe(c.classList.join(" "))}"`);const u=Ia(c.style);u&&d.push(`style="${xe(u)}"`),i.push(`<td${d.length?" "+d.join(" "):""}>${c.contentHtml}</td>`)}i.length&&n.push(`<tr>${i.join("")}</tr>`)}return`<table${o.length?" "+o.join(" "):""}>${n.join("")}</table>`}function Oa(e,o){const t=JSON.parse(JSON.stringify(e));let n=-1;const r=typeof o=="string"?o.trim():"";if(r){for(const i of t.cells)if(Array.isArray(i.classList)&&i.classList.includes(r)){n=i.row;break}}if(n===-1||t.rows<=1||t.cells.filter(i=>i.row===n).some(i=>i.rowspan>1))return t;t.cells=t.cells.filter(i=>i.row!==n);for(const i of t.cells)i.row>n&&(i.row-=1);return t.grid.splice(n,1),t.rows-=1,t}function oo(e,o){if(typeof e!="string"||typeof o!="string")return e;const t=new DOMParser().parseFromString(e,"text/html").body.firstChild;if(!t)return e;let n=!1;function r(s){if(s.nodeType===Node.TEXT_NODE&&s.textContent?.trim()){n?s.textContent="":(s.textContent=o,n=!0);return}for(const c of Array.from(s.childNodes))r(c)}function i(s){if(s.nodeType===Node.TEXT_NODE){const c=s.textContent||"";return!c||/^\s*$/.test(c.replace(/\u00A0/g,"X"))}return s.nodeType!==Node.ELEMENT_NODE?!0:Array.from(s.childNodes).every(c=>i(c))}function l(s,c=!1){if(s.nodeType!==Node.ELEMENT_NODE)return;const d=Array.from(s.childNodes);for(const u of d)l(u);!c&&i(s)&&s.parentNode?.removeChild(s)}return r(t),l(t,!0),t.outerHTML||e}function Xn(e,o,t){const n=JSON.parse(JSON.stringify(e));let r;const i=typeof o=="string"?o.trim():"";if(i){for(const u of n.cells)if(Array.isArray(u.classList)&&u.classList.includes(i)){r=u;break}}if(!r)return n;const l=r.col;let s=t?l:l+r.colspan;const c=[];let d=n.cells.length;for(let u=0;u<n.rows;u++){const g=JSON.parse(JSON.stringify(r));g.id=`cell-${d++}`,g.contentHtml=oo(r.contentHtml," "),g.row=u,g.col=s,g.rowspan=1,g.colspan=1,g.classList=r.classList.filter(m=>m!==i),c.push(g)}for(const u of n.cells)u.col>=s&&(u.col+=1);n.cells.push(...c),n.cols+=1;for(let u=0;u<n.rows;u++)n.grid[u].splice(s,0,null),n.grid[u][s]=c[u].id;return n}function xa(e,o){const t=JSON.parse(JSON.stringify(e));let n;const r=typeof o=="string"?o.trim():"";if(r){for(const l of t.cells)if(Array.isArray(l.classList)&&l.classList.includes(r)){n=l;break}}if(!n)return t;const i=n.col;if(t.cols<=1||t.cells.filter(l=>l.col===i).some(l=>l.colspan>1))return t;t.cells=t.cells.filter(l=>l.col!==i);for(const l of t.cells)l.col>i&&(l.col-=1);for(let l=0;l<t.rows;l++)t.grid[l].splice(i,1);return t.cols-=1,t}function Zn(e,o,t,n=1){const r=JSON.parse(JSON.stringify(e));if(n<=0)return r;let i;const l=typeof o=="string"?o.trim():"";if(l){for(const E of r.cells)if(Array.isArray(E.classList)&&E.classList.includes(l)){i=E;break}}if(!i)return r;const s=i.row,c=i.col,d=i.colspan,u=i.rowspan,g=[];if(t)for(let E=1;E<=n;E++)g.push(c-E);else for(let E=0;E<n;E++)g.push(c+d+E);for(const E of g)if(E<0||E>=r.cols)return r;const m=[];for(const E of g){const S=r.cells.find(v=>v.row===s&&v.col<=E&&E<v.col+v.colspan);if(!S)return r;m.push(S)}const f=Array.from(new Set(m));for(const E of f)if(E.rowspan!==u)return r;const p=d+f.reduce((E,S)=>E+S.colspan,0);let b=(t?[...f.reverse(),i]:[i,...f]).map(E=>{const S=new DOMParser().parseFromString(E.contentHtml,"text/html").body.firstChild,v=S?S.innerHTML:"";return v===""||/^\s*(&nbsp;)*\s*$/.test(v)?"":v}).filter(E=>E!=="").join("<br>");(b===""||/^\s*(&nbsp;|<br>)*\s*$/.test(b))&&(b="&nbsp;");const h=new DOMParser().parseFromString(i.contentHtml,"text/html").body.firstChild;h?(h.innerHTML=b,i.contentHtml=h.outerHTML):i.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">${b}</div>`,i.colspan=p,t&&g.length>0&&(i.col=Math.min(...g)),r.cells=r.cells.filter(E=>!f.includes(E));const y=t&&g.length>0?Math.min(...g):c;for(let E=y;E<y+p;E++)r.grid[s][E]=i.id;return r}function Jn(e,o,t,n=1){const r=JSON.parse(JSON.stringify(e));if(n<=0)return r;let i;const l=typeof o=="string"?o.trim():"";if(l){for(const E of r.cells)if(Array.isArray(E.classList)&&E.classList.includes(l)){i=E;break}}if(!i)return r;const s=i.row,c=i.col,d=i.rowspan,u=i.colspan,g=[];if(t)for(let E=1;E<=n;E++)g.push(s-E);else for(let E=0;E<n;E++)g.push(s+d+E);for(const E of g)if(E<0||E>=r.rows)return r;const m=[];for(const E of g){const S=r.cells.find(v=>v.col===c&&v.row<=E&&E<v.row+v.rowspan);if(!S)return r;m.push(S)}const f=Array.from(new Set(m));for(const E of f)if(E.colspan!==u)return r;const p=d+f.reduce((E,S)=>E+S.rowspan,0);let b=(t?[...f.reverse(),i]:[i,...f]).map(E=>{const S=new DOMParser().parseFromString(E.contentHtml,"text/html").body.firstChild,v=S?S.innerHTML:"";return v===""||/^\s*(&nbsp;)*\s*$/.test(v)?"":v}).filter(E=>E!=="").join("<br>");b=b.replace(/&nbsp;$/g,""),(b===""||/^\s*(&nbsp;|<br>)*\s*$/.test(b))&&(b="&nbsp;");const h=new DOMParser().parseFromString(i.contentHtml,"text/html").body.firstChild;h?(h.innerHTML=b,i.contentHtml=h.outerHTML):i.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">${b}</div>`,i.rowspan=p,t&&g.length>0&&(i.row=Math.min(...g)),r.cells=r.cells.filter(E=>!f.includes(E));const y=t&&g.length>0?Math.min(...g):s;for(let E=y;E<y+p&&E<r.rows;E++)r.grid[E][c]=i.id;return r}function Da(e,o,t=1){const n=JSON.parse(JSON.stringify(e)),r=typeof o=="string"?o.trim():"";if(!r)return n;const i=n.cells.find(s=>Array.isArray(s.classList)&&s.classList.includes(r));if(!i||i.colspan<=1||t>=i.colspan)return n;i.colspan-=t;const l={id:`cell-${n.cells.length}`,row:i.row,col:i.col+i.colspan,colspan:t,rowspan:i.rowspan,contentHtml:oo(i.contentHtml," "),classList:[...i.classList],align:i.align,valign:i.valign,style:i.style?JSON.parse(JSON.stringify(i.style)):{}};n.cells.push(l);for(let s=0;s<n.rows;s++)for(let c=0;c<n.cols;c++){const d=n.cells.find(u=>u.row<=s&&u.row+u.rowspan>s&&u.col<=c&&u.col+u.colspan>c);n.grid[s][c]=d?d.id:null}return n}function Fa(e,o,t=1){const n=JSON.parse(JSON.stringify(e)),r=typeof o=="string"?o.trim():"";if(!r)return n;const i=n.cells.find(s=>Array.isArray(s.classList)&&s.classList.includes(r));if(!i||i.rowspan<=1||t>=i.rowspan)return n;i.rowspan-=t;const l={id:`cell-${n.cells.length}`,row:i.row+i.rowspan,col:i.col,rowspan:t,colspan:i.colspan,contentHtml:oo(i.contentHtml," "),classList:[...i.classList],align:i.align,valign:i.valign,style:i.style?JSON.parse(JSON.stringify(i.style)):{}};n.cells.push(l);for(let s=0;s<n.rows;s++)for(let c=0;c<n.cols;c++){const d=n.cells.find(u=>u.row<=s&&u.row+u.rowspan>s&&u.col<=c&&u.col+u.colspan>c);n.grid[s][c]=d?d.id:null}for(let s=l.row;s<l.row+l.rowspan;s++)for(let c=l.col;c<l.col+l.colspan;c++)n.grid[s][c];return n}function Vo(e,o){const t=typeof o=="string"?o.trim():"";if(!t)return null;const n=e.cells.find(r=>Array.isArray(r.classList)&&r.classList.includes(t));return n?{row:n.row,col:n.col}:null}function Qn(e,o){const t=typeof o=="string"?o.trim():"";if(!t)return{row:null,col:null,isOverlapped:!1};const n=e.cells.find(i=>Array.isArray(i.classList)&&i.classList.includes(t));if(!n)return{row:null,col:null,isOverlapped:!1};const r=n.row;if(r<0||r>=e.rows)return{row:null,col:null,isOverlapped:!1};for(const i of e.cells)if(i.rowspan>1&&!(Array.isArray(i.classList)&&i.classList.includes(t))&&i.row<=r&&r<i.row+i.rowspan)return{row:i.row,col:i.col,isOverlapped:!0};return{row:null,col:null,isOverlapped:!1}}function er(e,o){const t=typeof o=="string"?o.trim():"";if(!t)return{row:null,col:null,isOverlapped:!1};const n=e.cells.find(i=>Array.isArray(i.classList)&&i.classList.includes(t));if(!n)return{row:null,col:null,isOverlapped:!1};const r=n.col;if(r<0||r>=e.cols)return{row:null,col:null,isOverlapped:!1};for(const i of e.cells)if(i.colspan>1&&!(Array.isArray(i.classList)&&i.classList.includes(t))&&i.col<=r&&r<i.col+i.colspan)return{row:i.row,col:i.col,isOverlapped:!0};return{row:null,col:null,isOverlapped:!1}}function tr(e,o,t){const n=JSON.parse(JSON.stringify(e)),r=n.cells.find(d=>d.classList?.includes(o));if(!r)return n;const i=n.cells.filter(d=>d.classList?.includes(t)&&d.id!==r.id);let l=r.colspan||1;i.forEach(d=>{const u=d.colspan||1;l+=u,d.colspan=1}),r.colspan=l;const s=d=>{const u=d.match(/<div[^>]*>(.*?)<\/div>/);return u?u[1].replace(/&nbsp;/g,"").trim():""};r.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a; padding: 8px;">${[s(r.contentHtml),...i.sort((d,u)=>d.col-u.col).map(d=>s(d.contentHtml)).filter(d=>d.length>0)].filter(d=>d.length>0).join("<br>")}</div>`;const c=new Set(i.map(d=>d.id));return n.cells.forEach(d=>{if(d.row===r.row&&d.col>r.col&&!c.has(d.id)){let u=0;i.forEach(g=>{g.row===d.row&&g.col<d.col&&(u+=(g.colspan||1)-1)}),d.col-=u}}),n.grid=n.grid.map((d,u)=>{const g=new Array(n.cols).fill(null);return n.cells.filter(m=>{const f=m.row,p=m.row+(m.rowspan||1)-1;return f<=u&&u<=p&&!c.has(m.id)}).sort((m,f)=>m.col-f.col).forEach(m=>{const f=m.id,p=m.colspan||1,b=m.col;for(let h=0;h<p&&b+h<n.cols;h++)g[b+h]=f}),g}),n}function or(e,o,t){const n=JSON.parse(JSON.stringify(e)),r=n.cells.find(u=>u.classList?.includes(o));if(!r)return n;const i=n.cells.filter(u=>u.classList?.includes(t)&&u.id!==r.id&&u.col===r.col);let l=r.rowspan||1;i.forEach(u=>{const g=u.rowspan||1;l+=g,u.rowspan=1}),r.rowspan=l;const s=u=>{const g=u.match(/<div[^>]*>(.*?)<\/div>/);return g?g[1].replace(/&nbsp;/g,"").trim():""};r.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a; padding: 8px;">${[s(r.contentHtml),...i.sort((u,g)=>u.row-g.row).map(u=>s(u.contentHtml)).filter(u=>u.length>0)].filter(u=>u.length>0).join("<br>")}</div>`;const c=i.length>0?Math.min(...i.map(u=>u.row)):r.row;c<r.row&&(r.row=c);const d=new Set(i.map(u=>u.id));return n.cells.forEach(u=>{if(u.col===r.col&&u.id!==r.id&&!d.has(u.id)){let g=0;i.forEach(m=>{m.col===u.col&&m.row<=u.row&&(g+=(m.rowspan||1)-1)}),g>0&&(u.row-=g)}}),n.grid=n.grid.map((u,g)=>{const m=new Array(n.cols).fill(null);return n.cells.filter(f=>{const p=f.row,b=f.row+(f.rowspan||1)-1;return p<=g&&g<=b&&!d.has(f.id)}).sort((f,p)=>f.col-p.col).forEach(f=>{const p=f.col,b=f.colspan||1;for(let h=0;h<b&&p+h<n.cols;h++)m[p+h]=f.id}),m}),n}function no(e,o,t,n,r,i=!0){const{cells:l,grid:s}=e;function c(f,p){if(!s[f]||!s[f][p])return null;const b=s[f][p];return l.find(h=>h.id===b)}function d(f,p){const b=c(f,p);return b?{row:b.row,col:b.col,cell:b}:null}const u=d(o,t),g=d(n,r);if(!u||!g||u.cell.id===g.cell.id)return 0;function m(f,p,b,h){let y=0;const E=f<p?1:-1,S=new Set;for(let C=f;C!==p;C+=E){const L=c(h?b:C,h?C:b);L&&!S.has(L.id)&&(S.add(L.id),y++)}const v=c(h?b:p,h?p:b);return v&&!S.has(v.id)&&y++,y}return i?u.row===g.row?m(t,r,o,!0)-1:0:u.col===g.col?m(o,n,t,!1)-1:0}function qa(e,o){if(!o.settings)return e;const t=Object.keys(o.settings);if(t.length===0)return e;const n=["paddingLeftRight","paddingTopBottom","paddingLeft","paddingTop","paddingRight","paddingBottom"],r=t[0];if(!n.includes(r))return e;const i=o.settings[r];return typeof i!="number"||isNaN(i)||!e.cells||!Array.isArray(e.cells)||e.cells.forEach((l,s)=>{switch(l.id,l.style||(l.style={}),l.style.padding||(l.style.padding={top:0,right:0,bottom:0,left:0}),r){case"paddingLeftRight":l.style.padding.left=i,l.style.padding.right=i;break;case"paddingTopBottom":l.style.padding.top=i,l.style.padding.bottom=i;break;case"paddingLeft":l.style.padding.left=i;break;case"paddingTop":l.style.padding.top=i;break;case"paddingRight":l.style.padding.right=i;break;case"paddingBottom":l.style.padding.bottom=i}l.style.padding.top===0&&l.style.padding.right===0&&l.style.padding.bottom===0&&l.style.padding.left===0&&delete l.style.padding,Object.keys(l.style).length===0&&delete l.style}),e}function Wa(e,o){const{backgroundPositionX:t,backgroundPositionY:n}=o.settings;if(t===void 0&&n===void 0)return e;const r=e.replace(/\s*;\s*/g,";").replace(/([^;])$/,"$1;").trim().split(";").filter(s=>s.trim());let i=!1;const l=r.map(s=>{const[c,d]=s.split(":").map(u=>u.trim());if(c==="background-position"){i=!0;const u=d.split(/\s+/).filter(f=>f.trim());let g=u[0],m=u[1]||u[0];return t!==void 0&&(g=`${t}px`),n!==void 0&&(m=`${n}px`),`background-position: ${g} ${m}`}return c==="background-position-x"&&t!==void 0?`background-position-x: ${t}px`:c==="background-position-y"&&n!==void 0?`background-position-y: ${n}px`:s});if(!i&&(t!==void 0||n!==void 0)){const s=t!==void 0?`${t}px`:"center",c=n!==void 0?`${n}px`:"center";l.push(`background-position: ${s} ${c}`)}return l.join("; ")}function $a(e){const o={};if(!e)return o;const t=e.split(";").map(n=>n.trim()).filter(n=>n.length>0);for(const n of t){const r=n.indexOf(":");if(r===-1)continue;const i=n.slice(0,r).trim(),l=n.slice(r+1).trim();if(!(!i||!l))switch(i.toLowerCase()){case"background-image":const s=l.match(/url\(['"]?(.+?)['"]?\)/i);s&&s[1]&&(o.backgroundImage=s[1]);break;case"background-size":o.backgroundSize=l;break;case"background-repeat":o.backgroundRepeat=l;break;case"background-position":const c=l.split(/\s+/).filter(d=>d.length>0);c.length>=1&&(o.backgroundPositionX=c[0]),c.length>=2&&(o.backgroundPositionY=c[1])}}return o}function za(e,o){const t=[];for(const n of e.cells)o.some(r=>n.classList.includes(r))&&t.push(n.id);return t}function Va(e,o,t){const n={...e,cells:e.cells.map(r=>({...r,style:r.style?{...r.style}:void 0}))};for(const r of n.cells)o.includes(r.id)&&(r.style||(r.style={}),r.style.backgroundColor=t);return n}function Ua(e,o,t){const n={...e,cells:e.cells.map(r=>({...r,classList:[...r.classList]}))};for(const r of n.cells)o.includes(r.id)&&(r.classList.includes(t)||r.classList.push(t));return n}function ja(e,o,t,n){const r={width:1,style:"solid",color:"#b9b1b1"},i={...e,cells:e.cells.map(l=>{const s={...l};return s.style&&(s.style={...s.style},s.style.borders&&(s.style.borders={...s.style.borders})),s})};for(const l of i.cells)if(o.includes(l.id)){l.style||(l.style={}),l.style.borders||(l.style.borders={});for(const s of t){const c=l.style.borders[s];c?l.style.borders[s]={...c,...n}:l.style.borders[s]={...r,...n}}}return i}function Ga(e,o){const t=new Map(e.cells.map(u=>[u.id,u])),n=new Set,r=[];for(const u of o){const g=t.get(u);if(g)for(let m=0;m<g.rowspan;m++)for(let f=0;f<g.colspan;f++){const p=g.row+m,b=g.col+f,h=`${p}-${b}`;n.has(h)||(n.add(h),r.push({row:p,col:b,id:u}))}}const i=new Set(r.map(u=>u.row)),l=new Set(r.map(u=>u.col));let s=!1;if(i.size===1&&l.size===r.length)s=!0;else if(!(l.size===1&&i.size===r.length))return{};s?r.sort((u,g)=>u.col-g.col):r.sort((u,g)=>u.row-g.row);const c=new Map;for(const u of r)c.has(u.id)||c.set(u.id,[]),c.get(u.id).push({row:u.row,col:u.col});c.forEach((u,g)=>{const m=t.get(g);if(m.rowspan>1||m.colspan>1){const f=s?(p,b)=>p.col-b.col:(p,b)=>p.row-b.row;u.sort(f)}});const d={};for(let u=0;u<r.length;u++){const g=r[u],m=g.id,f=t.get(m);let p=m;if(f.rowspan>1||f.colspan>1){const h=c.get(m).findIndex(y=>y.row===g.row&&y.col===g.col);h>0&&(p=`${m}-uni-${h+1}`)}const b=[];s?(b.push("top","bottom"),(u===0||r[u-1].col!==g.col-1)&&b.push("left"),(u===r.length-1||r[u+1].col!==g.col+1)&&b.push("right")):(b.push("left","right"),(u===0||r[u-1].row!==g.row-1)&&b.push("top"),(u===r.length-1||r[u+1].row!==g.row+1)&&b.push("bottom")),d[p]=b}return d}function Ya(e,o,t,n){const r={topLeft:0,topRight:1,bottomRight:2,bottomLeft:3},i={...e,cells:e.cells.map(l=>{const s={...l};return s.style&&(s.style={...s.style}),s})};for(const l of i.cells)if(o.includes(l.id)){l.style||(l.style={});let s=(l.style.borderRadius||"0px 0px 0px 0px").split(" ").map(c=>parseInt(c.replace("px",""),10));for(const c of t){const d=r[c];d!==void 0&&(s[d]=n)}s.every(c=>c===0)?delete l.style.borderRadius:l.style.borderRadius=s.map(c=>`${c}px`).join(" ")}return i}function Ka(e,o){const t=new Map(e.cells.map(u=>[u.id,u])),n=new Set,r=[];for(const u of o){const g=t.get(u);if(g)for(let m=0;m<g.rowspan;m++)for(let f=0;f<g.colspan;f++){const p=g.row+m,b=g.col+f,h=`${p}-${b}`;n.has(h)||(n.add(h),r.push({row:p,col:b,id:u}))}}const i=new Set(r.map(u=>u.row)),l=new Set(r.map(u=>u.col));let s=!1;if(i.size===1&&l.size===r.length)s=!0;else if(!(l.size===1&&i.size===r.length))return{};s?r.sort((u,g)=>u.col-g.col):r.sort((u,g)=>u.row-g.row);const c=new Map;for(const u of r)c.has(u.id)||c.set(u.id,[]),c.get(u.id).push({row:u.row,col:u.col});c.forEach((u,g)=>{const m=t.get(g);if(m.rowspan>1||m.colspan>1){const f=s?(p,b)=>p.col-b.col:(p,b)=>p.row-b.row;u.sort(f)}});const d={};for(let u=0;u<r.length;u++){const g=r[u],m=g.id,f=t.get(m);let p=m;if(f.rowspan>1||f.colspan>1){const y=c.get(m).findIndex(E=>E.row===g.row&&E.col===g.col);y>0&&(p=`${m}-uni-${y+1}`)}const b=new Set;s?(b.add("top"),b.add("bottom"),(u===0||r[u-1].col!==g.col-1)&&b.add("left"),(u===r.length-1||r[u+1].col!==g.col+1)&&b.add("right")):(b.add("left"),b.add("right"),(u===0||r[u-1].row!==g.row-1)&&b.add("top"),(u===r.length-1||r[u+1].row!==g.row+1)&&b.add("bottom"));const h=[];b.has("top")&&b.has("left")&&h.push("topLeft"),b.has("top")&&b.has("right")&&h.push("topRight"),b.has("bottom")&&b.has("left")&&h.push("bottomLeft"),b.has("bottom")&&b.has("right")&&h.push("bottomRight"),h.length>0&&(d[p]=h)}return d}function Xa(e,o,t,n){const r={...e,cells:e.cells.map(i=>{const l={...i};return l.style&&(l.style={...l.style},l.style.padding&&(l.style.padding={...l.style.padding})),l})};for(const i of r.cells)if(o.includes(i.id)){i.style||(i.style={}),i.style.padding||(i.style.padding={top:0,right:0,bottom:0,left:0});for(const l of t){const s=l;i.style.padding[s]=n}["top","right","bottom","left"].forEach(l=>{i.style?.padding&&i.style.padding[l]===0&&delete i.style.padding[l]}),i.style.padding&&Object.keys(i.style.padding).length===0&&delete i.style.padding}return r}function Za(e,o){const t=new RegExp(`\\b${o}\\s*:[^;]*(;\\s*)?`,"gi");return e.replace(t,"").trim().replace(/\s*;\s*(?=;|$)/g,"").trim()}function Ja(e){const o=e.match(/border-radius:\s*([^;]+)/);if(!o)return{full:null,first:null,firstNumber:null};const t=o[1].trim(),n=t.split(/\s+/)[0],r=parseInt(n),i=t.split(/\s+/)[1],l=parseInt(i),s=t.split(/\s+/)[2],c=parseInt(s),d=t.split(/\s+/)[3];return{full:t,first:n,firstNumber:r,second:i,secondNumber:l,third:s,thirdNumber:c,fourth:d,fourthNumber:parseInt(d)}}function Qa(e,o,t){const n=/border-radius:\s*([^;]+)/,r=e.match(n);if(!r)return e+` border-radius: ${nr("0 0 0 0",o,t)};`;const i=nr(r[1].trim(),o,t);return e.replace(n,`border-radius: ${i}`)}function nr(e,o,t){const n=typeof t=="number"&&!isNaN(t)?Math.max(0,t):0;let r=e.split(/\s+/).filter(s=>s.trim()!=="").map(s=>{const c=parseFloat(s);return isNaN(c)?0:Math.max(0,c)}),i;if(r.length===0)i=[0,0,0,0];else if(r.length===1)i=[r[0],r[0],r[0],r[0]];else if(r.length===2)i=[r[0],r[1],r[0],r[1]];else if(r.length===3)i=[r[0],r[1],r[2],r[1]];else{const s=r.slice(0,4);i=[s[0]??0,s[1]??0,s[2]??0,s[3]??0]}const l={topLeft:0,topRight:1,bottomRight:2,bottomLeft:3}[o];return l!==void 0&&(i[l]=n),i.map(s=>s===0?"0":`${s}px`).join(" ")}function es(e){const o=JSON.parse(JSON.stringify(e)),t=o.rows,n=o.cols;return o.cells.forEach(r=>{const i=r.row===0,l=r.row+r.rowspan===t,s=r.col===0,c=r.col+r.colspan===n;i&&delete r.style.borders.top,l&&delete r.style.borders.bottom,s&&delete r.style.borders.left,c&&delete r.style.borders.right}),o}function ts(e){const o=JSON.parse(JSON.stringify(e));return o.cells.forEach(t=>{if(t.style?.borders?.top&&t.style?.borders?.bottom&&t.style?.borders?.left&&t.style?.borders?.right){const n=t.style.borders.top,r=t.style.borders.bottom,i=t.style.borders.left,l=t.style.borders.right;n?.width===r?.width&&n?.width===i?.width&&n?.width===l?.width&&n?.style===r?.style&&n?.style===i?.style&&n?.style===l?.style&&n?.color===r?.color&&n?.color===i?.color&&n?.color===l?.color&&(t.style.borders={border:{width:n.width,style:n.style,color:n.color}})}}),o}function os(e,o){return typeof e!="string"&&(e=String(e||"")),typeof o!="string"&&(o=String(o||"")),e.split(" ").filter(t=>t&&!t.startsWith(o)).join(" ").trim()}function ns(e){const o={},t={};return Object.keys(e).forEach(n=>{const r=n.indexOf("-uni-");if(r===-1){const i=n;o[i]=[...e[n]],t[i]=new Set(e[n])}else{const i=n.substring(0,r);t[i]||(t[i]=new Set),e[n].forEach(l=>{t[i].add(l)}),e.hasOwnProperty(i)&&!o.hasOwnProperty(i)&&(o[i]=[...e[i]],e[i].forEach(l=>t[i].add(l)))}}),Object.keys(t).forEach(n=>{const r=n;o[r]||(o[r]=[]),o[r]=Array.from(t[r])}),o}function rr(e,o,t,n=!0){const r=document.querySelector(e);if(!r)return;const i=r.closest("td");if(!i)return;const l=i.parentElement;if(!l)return;const s=Array.from(l.cells),c=s.indexOf(i);let d=0,u=1;for(;d<o;){let g;if(n?g=c+u:g=c-u,g<0||g>=s.length)break;s[g].classList.add(t),d++,u++}}function ir(e,o,t,n=!0){const r=document.querySelector(e);if(!r)return;const i=r.closest("td");if(!i)return;const l=i.parentElement;if(!l||l.tagName!=="TR")return;const s=l.closest("table");if(!s)return;const c=Array.from(s.rows),d=c.indexOf(l);if(d===-1)return;const u=[],g=Math.max(...c.map(y=>Array.from(y.cells).reduce((E,S)=>E+(S.colSpan||1),0))),m=new Map;for(let y=0;y<c.length;y++){u[y]=[];let E=0;const S=Array.from(c[y].cells);for(const v of S){for(;m.has(`${y}:${E}`);){const w=m.get(`${y}:${E}`);u[y][E]=w.cell,E++}const C=v.colSpan||1,L=v.rowSpan||1;for(let w=0;w<C&&E<g;w++){u[y][E+w]=v;for(let A=0;A<L;A++)if(y+A<c.length){const M=`${y+A}:${E+w}`;m.set(M,{cell:v,rowSpan:L,colSpan:C,startRow:y})}}E+=C}for(;E<g;){if(m.has(`${y}:${E}`)){const v=m.get(`${y}:${E}`);u[y][E]=v.cell}else u[y][E]=null;E++}}let f=-1;for(let y=0;y<u[d].length;y++)if(u[d][y]===i){f=y;break}if(f===-1)return;let p=0,b=1;const h=new Set;for(;p<o;){const y=n?d+b:d-b;if(y<0||y>=c.length)break;const E=u[y][f];if(!E){b++;continue}const S=`${y}:${f}`,v=m.get(S);if(E.tagName!=="TD"){b++;continue}if(h.has(E)){b++;continue}if(v&&v.startRow!==y){b++;continue}E.classList.add(t),h.add(E),p++,b++}}var lr=`
88
+ `);n.classList.remove("em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top"),o.settings?.name&&(t.messageService.send("application_atom_inserted",o.settings.name),a.clearPendingPaletteInsert())}function zn(e,o){const t=o.mutableState.atomReplaced;let n={settings:{}};const r=e.target,i=m=>o._setDocumentStyles(m,{minify:o.minify,cssbeautify:o.cssbeautify,HTMLDocument:o.HTMLDocument}),l=e.dataTransfer?.getData("Text")||"";if(l&&o.isJsonString(l)?n=JSON.parse(l):t&&(n={settings:{atomHTML:a.serializeOuterHtml(t)}}),!n.settings?.atomHTML)return;let s=n.settings.atomHTML.replaceAll(/<style((.|\n|\r)*?)<\/style>/gi,"").trim();i(n.settings.atomHTML.match(/<style((.|\n|\r)*?)<\/style>/g)),s=o.commonStylesApply({html:s});const c=r.closest('[em="block"]')&&r.tagName==="TD"&&!r.innerHTML&&!r.hasAttribute("height")&&(r.classList.contains("em-atom-insert-empty")||a.hasPendingPaletteAtom()),d=r.tagName==="DIV"&&r.closest("amp-accordion")&&!r.innerHTML;if(c||d){na(r,s,t,n,o);return}const u=!!document.querySelector(".em-blockatom-insert"),g=r.tagName==="TABLE"&&!r.innerHTML;if(u||g){ra(e,s,n,o,i);return}r.closest('[em="atom"]')&&ia(s,n,o)}var{START_POSITION:dt,NEW_EDITOR:Vn,ACTIVE_ELEMENT:Un}=a.LIST_TEMP_CLASSES,{TRIM_SPACES:ot,LT:_t,GT:Nt,EMPTY_TEXT:la}=a.LIST_REGEX;function aa(e,o){const{activeElem:t,listContext:n,cursorPositionType:r,isTargetCell:i,commit:l,wrapEditor:s,removeTemporaryListClasses:c}=o,{classNameOl:d,classNameUl:u,isList:g}=n;if(!((e.key==="Enter"||e.keyCode===13)&&g&&i&&!e.shiftKey))return!1;if(e.preventDefault(),e.stopImmediatePropagation(),!t)return!0;const m=t.closest(`table.${d}`)||t.closest(`table.${u}`),f=t.closest(`table.${d}`)?d:u;if(!m)return!0;const p=a.extractTableRowData(t,f);if(!p)return!0;const{firstCellText:b,firstCellHtmlNoText:h,wrappedSecondCellHtml:y}=p;return r==="start"||r==="end"?sa(t,m,f,d,u,r,b,h,y,s):r==="inside"&&ca(t,m,f,d,b,h,y,s),c(),l(),!0}function sa(e,o,t,n,r,i,l,s,c,d){const u=e.querySelector("div");u&&u.classList.add(dt);const g=a.injectTextIntoFirstDiv(s,l),m=a.injectTextIntoFirstDiv(c," "),f=i==="end"?a.updateDivWithClassAndNbsp(m):m,p=o.outerHTML,b="<tr>"+g+f+"</tr>",h=a.removeEditorTags(p),y=a.insertRowRelativeToDivClass(h,b,dt,i==="start"),E=a.removeEditorTags(y);if(t===n){o.innerHTML=E;const v=a.parseTableToArray(o),C=a.renumberCellOneText(v),L=a.replaceEmptyWithNbsp(C),w=a.formatCellOneText(L),A=o.outerHTML;o.innerHTML=a.updateTableNumbering(A,w).replace(_t,"<").replace(Nt,">")}else o.innerHTML=E;a.processTableText(o,n,r,ot);const S=i==="start"?o.querySelector(".remove-start-element-position"):o.querySelector(".remove-new-editor-element");return S&&jn(S,o,d),S}function ca(e,o,t,n,r,i,l,s){const c=e.querySelector("div");c&&(c.classList.add(Un),c.classList.add(dt));const d=o.outerHTML,u=a.getTextPartsAtCursor(e),g=a.getHtmlPartsAtCursor(e);if(!u||!g)return null;const{beforeCursorPosition:m,afterCursorPosition:f}=u,{beforeHTML:p,afterHTML:b}=g,h=a.injectTextIntoFirstDiv(i,r),y=a.injectTextIntoFirstDiv(l,m===""?" ":p.replace(ot,"")),E=a.injectTextIntoFirstDiv(i,r),S=a.injectTextIntoFirstDiv(l,f===""?" ":b.replace(ot,"")),v=a.updateDivWithClassAndNbsp(S),C=("<tr>"+h+y+"</tr>"+("<tr>"+E+v+"</tr>")).replace(_t,"<").replace(Nt,">"),L=a.insertRowRelativeToDivClass(d,C,dt,!0),w=a.removeEditorTags(L),A=a.removeTrContainingDivWithClass(w,Un);if(t===n){o.innerHTML=A;const R=a.parseTableToArray(o),$=a.renumberCellOneText(R),J=a.replaceEmptyWithNbsp($),_=a.formatCellOneText(J),G=o.outerHTML;o.innerHTML=a.updateTableNumbering(G,_).replace(_t,"<").replace(Nt,">")}else o.innerHTML=A;const M=o.querySelector(".remove-new-editor-element");return M&&jn(M,o,s,!0),M}function jn(e,o,t,n=!1){e.textContent&&e.textContent.length>0&&(e.innerHTML=e.innerHTML.replace(ot,"")),la.test(e.textContent||"")&&(e.textContent=" "),t(e,!0);const r=o.querySelector("editor"),i=r?.querySelector("div");if(i){const l=window.getSelection();if(l&&l.rangeCount>0){const s=l.getRangeAt(0);s.selectNodeContents(i),s.collapse(!0),l.removeAllRanges(),l.addRange(s)}}n&&r&&r.focus()}function da(e,o){const{activeElem:t,listContext:n,cursorPositionType:r,isTargetCell:i,isEmptyText:l,commit:s,wrapEditor:c,removeTemporaryListClasses:d}=o,{classNameOl:u,classNameUl:g,isList:m}=n,f=(e.keyCode===38||e.key==="ArrowUp")&&r==="start",p=(e.keyCode===40||e.key==="ArrowDown")&&(!l&&r==="end"||l&&r==="start");if(!(f||p)||!m||!i||!t)return!1;e.preventDefault(),e.stopImmediatePropagation();const b=e.key==="ArrowUp"?"ArrowUp":"ArrowDown",h=t.closest(`table.${u}`)||t.closest(`table.${g}`);if(!h)return!0;const y=t.querySelector("div");y&&y.classList.add(dt);const E=h.outerHTML,S=a.removeEditorTags(E);h.innerHTML=a.modifyHtml(S,dt,Vn,b);const v=h.querySelector(".remove-new-editor-element");if(v){c(v,!0);const C=h.querySelector("editor"),L=C?.querySelector("div")?.childNodes[0],w=window.getSelection();if(w&&w.rangeCount>0){const A=w.getRangeAt(0);if(L&&L.nodeType===Node.TEXT_NODE){const M=L.textContent||"";A.setStart(L,M.replace(ot,"").length)}else C&&A.selectNodeContents(C);A.collapse(!0),w.removeAllRanges(),w.addRange(A)}}return d(),s(),!0}function ma(e,o,t){return(e.keyCode===39||e.key==="ArrowRight")&&(o==="end"||t)?(e.preventDefault(),e.stopImmediatePropagation(),!0):!1}function ua(e,o){const t=window.navigator.platform.match("Mac"),{activeElem:n,listContext:r,cursorPositionType:i,isTargetCell:l,isEmptyText:s,parentElement:c,commit:d,wrapEditor:u,removeTemporaryListClasses:g,findNodeAtPosition:m,setCursorSafely:f}=o,{classNameOl:p,classNameUl:b,isList:h}=r;if(!((t?e.code==="Backspace":e.keyCode===46||e.keyCode===8)&&h)||!(!l||l&&(i==="start"||s&&i==="inside"||s&&i==="end"))||!n||!c)return!1;e.preventDefault(),e.stopImmediatePropagation();const y=n.closest(`table.${p}`)?p:b,E=c.closest("tr");if(!E)return!0;const S=E.previousElementSibling;if(!S&&!l)return!0;const v=l?n.querySelector("div"):E.querySelector("tr td:nth-child(2)")?.querySelector("div"),C=v?v.innerHTML:"",L=C?C.split(" ")[0]:"";L.replace(ot,"");const w=S?.querySelector("tr td:nth-of-type(2)");if(!w)return!0;const A=w.querySelector("div");if(!A)return!0;A.classList.add(Vn);const M=A.innerHTML,R=`${M}${C}`.replace(_t,"<").replace(Nt,">");E.remove();const $=A.closest(`table.${p}`)||A.closest(`table.${b}`);if(!$)return!0;const J=$.innerHTML,_=a.removeEditorTags(J);if(y===p){$.innerHTML=_;const x=a.parseTableToArray($),k=a.renumberCellOneText(x),se=a.replaceEmptyWithNbsp(k),z=a.formatCellOneText(se),ee=$.outerHTML;$.innerHTML=a.updateTableNumbering(ee,z).replace(_t,"<").replace(Nt,">")}else $.innerHTML=_;const G=$.querySelector(".remove-new-editor-element");if(!G)return g(),d(),!0;G.innerHTML=`${R.replace(ot,"")}&nbsp;`||"&nbsp;",u(G,!0);const H=G.closest("editor");if(!H)return g(),d(),!0;const P=window.getSelection(),q=document.createRange(),O=H.querySelector("div");if(!O||!P)return g(),d(),!0;const Q=H.textContent||"",re=L?Q.indexOf(L):-1;if(re!==-1&&L){const x=m(O,re);if(x)f(q,P,x.node,x.offset);else{const k=O.childNodes[0];k&&f(q,P,k,0)}}else{const x=document.createElement("div");x.innerHTML=M;const k=(x.textContent||"").length,se=m(O,k);if(se)f(q,P,se.node,se.offset);else{const z=document.createTreeWalker(O,NodeFilter.SHOW_TEXT,null);let ee=null;for(;z.nextNode();)ee=z.currentNode;ee&&f(q,P,ee,(ee.textContent||"").length)}}return H.focus(),g(),d(),!0}function fa(e,o,t){return(window.navigator.platform.match("Mac")?e.code==="Backspace":e.keyCode===46||e.keyCode===8)?!1:o&&!t?(e.preventDefault(),e.stopPropagation(),!0):!1}function pa(e){if(!e)return!1;const o=e.closest("li");return Kt(o)}function ga(e){const o=window.getSelection(),t=e.textContent||"",n=t.trim();if(!n||n===" ")return{position:"empty",offset:0,textContent:""};if(!o||o.rangeCount===0)return{position:"middle",offset:0,textContent:t};const r=o.getRangeAt(0);if(!e.contains(r.startContainer))return{position:"middle",offset:0,textContent:t};const i=document.createRange();i.selectNodeContents(e),i.setEnd(r.startContainer,r.startOffset);const l=i.toString().length;return l===0?{position:"start",offset:0,textContent:t}:l>=n.length?{position:"end",offset:l,textContent:t}:{position:"middle",offset:l,textContent:t}}function ba(e,o){const t=Array.from(o.querySelectorAll(":scope > li")),n=t.indexOf(e);return n===0?"first":n===t.length-1?"last":"middle"}function ha(e){const o=window.getSelection();if(!o||o.rangeCount===0)return e.innerHTML;const t=o.getRangeAt(0),n=document.createRange();n.selectNodeContents(e),n.setEnd(t.startContainer,t.startOffset);const r=n.cloneContents(),i=document.createElement("div");return i.appendChild(r),i.innerHTML}function ya(e){const o=window.getSelection();if(!o||o.rangeCount===0)return"";const t=o.getRangeAt(0),n=document.createRange();n.selectNodeContents(e),n.setStart(t.endContainer,t.endOffset);const r=n.cloneContents(),i=document.createElement("div");return i.appendChild(r),i.innerHTML}function mt(e){const o=window.getSelection();if(!o)return;const t=document.createRange();t.selectNodeContents(e),t.collapse(!0),o.removeAllRanges(),o.addRange(t)}function Bt(e,o){e.hasAttribute("em-edit")&&(e.removeAttribute("em-edit"),o.setAttribute("em-edit","active"))}function Ea(e,o){const t=document.createElement("br"),n=document.createElement("span");return n.innerHTML="&nbsp;",Bt(e,n),o.parentNode?.insertBefore(n,o),o.parentNode?.insertBefore(t,n),e.remove(),o.querySelectorAll("li").length===0&&o.remove(),mt(n),n}function Sa(e,o){const t=Array.from(o.querySelectorAll(":scope > li")),n=t.indexOf(e),r=t.slice(n+1),i=document.createElement(o.tagName.toLowerCase());o.getAttribute("style")&&i.setAttribute("style",o.getAttribute("style")),r.forEach(c=>{i.appendChild(c)});const l=document.createElement("br"),s=document.createElement("span");return s.innerHTML="&nbsp;",Bt(e,s),i.children.length>0&&o.parentNode?.insertBefore(i,o.nextSibling),o.parentNode?.insertBefore(s,o.nextSibling),o.parentNode?.insertBefore(l,s),e.remove(),o.querySelectorAll("li").length===0&&o.remove(),mt(s),s}function Ca(e,o){if(!((e.key==="Enter"||e.keyCode===13)&&!e.shiftKey))return!1;const t=window.getSelection();if(!t||t.rangeCount===0)return!1;const n=t.getRangeAt(0).startContainer,r=n.nodeType===Node.TEXT_NODE?n.parentElement:n;if(!pa(r))return!1;const i=r?.closest("li");if(!i)return!1;const l=i.closest("ul, ol");if(!l)return!1;e.preventDefault(),e.stopImmediatePropagation();const s=ga(i),c=ba(i,l);switch(s.position){case"empty":va(i,l,c,o);break;case"start":Aa(i,l,o);break;case"end":Ta(i,l,o);break;case"middle":La(i,l,o)}return o.commit(),!0}function va(e,o,t,n){switch(t){case"last":const r=document.createElement("li");r.setAttribute("style",a.STANDARD_LIST_STYLES.LIST_ITEM),r.innerHTML="&nbsp;",e.after(r),Bt(e,r),mt(r);break;case"first":Ea(e,o);break;case"middle":Sa(e,o)}}function Aa(e,o,t){const n=document.createElement("li");n.setAttribute("style",a.STANDARD_LIST_STYLES.LIST_ITEM),n.innerHTML="&nbsp;",e.before(n),mt(e)}function Ta(e,o,t){const n=document.createElement("li");n.setAttribute("style",a.STANDARD_LIST_STYLES.LIST_ITEM),n.innerHTML="&nbsp;",e.after(n),Bt(e,n),mt(n)}function La(e,o,t){const n=ha(e),r=ya(e);e.innerHTML=n||"&nbsp;";const i=document.createElement("li");i.setAttribute("style",a.STANDARD_LIST_STYLES.LIST_ITEM),i.innerHTML=r||"&nbsp;",e.after(i),Bt(e,i),mt(i)}var wa=['[contenteditable="false"]',".em-element-editor",'[class^="em-element-editor"]',".em-vindent"],$o=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">&nbsp;</div>`;function ka(e){return!!e.closest("editor.em-text")}function Gn(e){e.querySelectorAll(wa.join(",")).forEach(o=>{ka(o)||o.remove()})}function _a(e){const o=e.cloneNode(!0),t=o.querySelector("editor.em-text");if(t){Gn(o);const r=t.querySelector("div");if(r)return r.outerHTML;const i=t.getAttribute("innerclass")??"",l=t.getAttribute("innerstyle")??"";return`<div${i?` class="${xe(i)}"`:""}${l?` style="${xe(l)}"`:""}>${t.innerHTML}</div>`}Gn(o);const n=o.querySelector("div");return n?n.outerHTML:o.innerHTML}function xe(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Me(e){if(!e)return;const o=e.trim().match(/^(-?\d+(?:\.\d+)?)px$/i);return o?Number(o[1]):void 0}function Mt(e){if(!e)return;const o=e.trim().split(/\s+/);if(o.length<3)return;const t=Me(o[0]),n=o[1],r=o.slice(2).join(" ");if(t!==void 0&&["none","solid","dashed","dotted","double"].includes(n))return{width:t,style:n,color:r}}function Na(e){const o=e.get("padding"),t=e.get("padding-top"),n=e.get("padding-right"),r=e.get("padding-bottom"),i=e.get("padding-left"),l={};if(o){const g=o.trim().split(/\s+/),m=Me(g[0]),f=Me(g[1]??g[0]),p=Me(g[2]??g[0]),b=Me(g[3]??g[1]??g[0]);m!==void 0&&(l.top=m),f!==void 0&&(l.right=f),p!==void 0&&(l.bottom=p),b!==void 0&&(l.left=b)}const s=Me(t??""),c=Me(n??""),d=Me(r??""),u=Me(i??"");return s!==void 0&&(l.top=s),c!==void 0&&(l.right=c),d!==void 0&&(l.bottom=d),u!==void 0&&(l.left=u),Object.keys(l).length?l:void 0}function Yn(e){if(e)return e.trim()}function Ba(e){if(!e)return;const o=e.trim().toLowerCase();return["left","center","right","justify"].includes(o)?o:void 0}function Ma(e){if(!e)return;const o=e.trim().toLowerCase();if(o==="top"||o==="text-top")return"top";if(o==="bottom"||o==="text-bottom")return"bottom";if(o==="middle")return"middle"}function Ra(e){const o=new Map;return e&&e.split(";").forEach(t=>{const[n,...r]=t.split(":");if(!n||r.length===0)return;const i=n.trim().toLowerCase(),l=r.join(":").trim();i&&o.set(i,l)}),o}function Pa(e){if(!e)return;const o=e.trim().replace(/\s+/g," ");if(o&&/^(\d+(\.\d+)?\s*(px|em|rem|%|pt)\s*){1,4}$/i.test(o))return o}function Ha(e){const o=Ra(e.getAttribute("style")),t=o.get("font-family")??void 0,n=Me(o.get("font-size")??""),r=Me(o.get("line-height")??""),i=Yn(o.get("color")??void 0),l=Yn(o.get("background-color")??void 0),s=Ba(o.get("text-align")??void 0),c=Ma(o.get("vertical-align")??void 0),d={top:Mt(o.get("border-top")),right:Mt(o.get("border-right")),bottom:Mt(o.get("border-bottom")),left:Mt(o.get("border-left"))},u=Mt(o.get("border"));u&&(d.top=d.top??u,d.right=d.right??u,d.bottom=d.bottom??u,d.left=d.left??u);const g=Na(o),m=Pa(o.get("border-radius")??void 0),f={};return t&&(f.fontFamily=t),n!==void 0&&(f.fontSize=n),r!==void 0&&(f.lineHeight=r),i&&(f.color=i),l&&(f.backgroundColor=l),s&&(f.textAlign=s),c&&(f.verticalAlign=c),g&&(f.padding=g),m&&(f.borderRadius=m),(d.top||d.right||d.bottom||d.left)&&(f.borders=d),Object.keys(f).length?f:void 0}function Ia(e){const o=e.getAttribute("align")?.toLowerCase();if(o==="left"||o==="center"||o==="right")return o}function Oa(e){const o=e.getAttribute("valign")?.toLowerCase();if(o==="top"||o==="middle"||o==="bottom")return o}function zo(e){if(e==null)return;const o=Number(e);return Number.isFinite(o)?o:void 0}function Rt(e){const o=Array.from(e.classList),t={};Array.from(e.attributes).forEach(d=>{const u=d.name.toLowerCase();u!=="class"&&(t[u]=d.value)});const n={width:e.getAttribute("width")??void 0,cellpadding:zo(e.getAttribute("cellpadding")),cellspacing:zo(e.getAttribute("cellspacing")),border:zo(e.getAttribute("border")),classList:o.length?o:void 0,attrs:Object.keys(t).length?t:void 0},r=[],i=[];let l=0;const s=Array.from(e.querySelectorAll(":scope > tr, :scope > tbody > tr, :scope > thead > tr, :scope > tfoot > tr")).filter(d=>d.querySelectorAll("td, th").length!==0);s.forEach(d=>{let u=0;Array.from(d.querySelectorAll("td, th")).forEach(g=>{const m=Math.max(1,g.colSpan||1);u+=m}),u>l&&(l=u)});let c=0;for(const d of s){i[c]||(i[c]=Array(l).fill(null));let u=0;const g=Array.from(d.querySelectorAll("td, th"));for(const m of g){for(;u<l&&i[c][u]!==null&&i[c][u]!==void 0;)u++;if(u>=l)continue;const f=Math.max(1,m.colSpan||1),p=Math.max(1,m.rowSpan||1),b=Math.min(p,s.length-c),h=`cell-${r.length}`,y=Array.from(m.classList),E=_a(m),S=Ia(m),v=Oa(m),C=Ha(m),L={id:h,row:c,col:u,rowspan:b,colspan:f,contentHtml:E,classList:y,align:S,valign:v,style:C};r.push(L);for(let w=0;w<b;w++){const A=c+w;i[A]||(i[A]=Array(l).fill(null));for(let M=0;M<f;M++){const R=u+M;R>=l||i[A][R]!==null&&i[A][R]!==void 0||(i[A][R]=h)}}u+=f}c++}for(let d=0;d<i.length;d++)for(let u=0;u<l;u++)(i[d][u]===null||i[d][u]===void 0)&&(i[d][u]=null);new Set(i.flat().filter(d=>d!==null)),new Set(r.map(d=>d.id));for(const d of r)for(let u=d.row;u<d.row+d.rowspan;u++)for(let g=d.col;g<d.col+d.colspan;g++)i[u]&&(i[u][g],d.id);return{rows:i.length,cols:l,cells:r,grid:i,meta:n}}function Kn(e,o,t){const n=JSON.parse(JSON.stringify(e));let r=-1;const i=typeof o=="string"?o.trim():"";if(i){for(const f of n.cells)if(Array.isArray(f.classList)&&f.classList.includes(i)){r=f.row;break}}r===-1&&(n.rows===0?(r=0,t=!0):(r=n.rows-1,t=!1));const l=n.cells.filter(f=>f.row===r).sort((f,p)=>f.col-p.col),s=n.cells.length===0;if(l.length===0)if(s)l.push({id:"cell-0",row:0,col:0,rowspan:1,colspan:1,contentHtml:$o,classList:[""],align:"center",valign:"top",style:{}}),n.cols=1;else for(let f=0;f<n.cols;f++)l.push({id:`template-${f}`,row:r,col:f,rowspan:1,colspan:1,contentHtml:$o,classList:[""],align:"center",valign:"top",style:{}});let c=1;for(const f of l)f.rowspan>c&&(c=f.rowspan);let d=t?r:r+c;const u=new Array(n.cols).fill(!1);for(const f of n.cells)if(f.row<d&&f.row+f.rowspan>d)for(let p=f.col;p<f.col+f.colspan;p++)u[p]=!0;for(const f of n.cells)f.row>=d&&(f.row+=1);const g=[];let m=n.cells.length;for(let f=0;f<n.cols;f++){if(u[f])continue;const p=l.find(h=>h.col<=f&&f<h.col+h.colspan)||l[0]||{contentHtml:$o,classList:[""],align:"center",valign:"top",style:{}},b=JSON.parse(JSON.stringify(p));b.id=`cell-${m++}`,b.contentHtml=oo(p.contentHtml," "),b.classList=b.classList.filter(h=>h!==i),b.row=d,b.col=f,b.rowspan=1,b.colspan=1,g.push(b)}n.cells.push(...g),n.rows+=1,n.grid.splice(d,0,new Array(n.cols).fill(null));for(let f=0;f<n.rows;f++)for(let p=0;p<n.cols;p++){const b=n.cells.find(h=>h.row<=f&&h.row+h.rowspan>f&&h.col<=p&&h.col+h.colspan>p);n.grid[f][p]=b?b.id:null}for(let f=0;f<n.cols;f++)n.grid[d][f]===null&&u[f];return n}function xa(e){if(!e)return"";const o=[];if(e.fontFamily&&o.push(`font-family: ${e.fontFamily}`),e.fontSize!==void 0&&o.push(`font-size: ${e.fontSize}px`),e.lineHeight!==void 0&&o.push(`line-height: ${e.lineHeight}px`),e.color&&o.push(`color: ${e.color}`),e.backgroundColor&&o.push(`background-color: ${e.backgroundColor}`),e.textAlign&&o.push(`text-align: ${e.textAlign}`),e.verticalAlign&&o.push(`vertical-align: ${e.verticalAlign}`),e.borderRadius&&o.push(`border-radius: ${e.borderRadius}`),e.padding){const t=e.padding;t.top!==void 0&&t.right!==void 0&&t.bottom!==void 0&&t.left!==void 0&&t.top===t.right&&t.right===t.bottom&&t.bottom===t.left?o.push(`padding: ${t.top}px`):(t.top!==void 0&&o.push(`padding-top: ${t.top}px`),t.right!==void 0&&o.push(`padding-right: ${t.right}px`),t.bottom!==void 0&&o.push(`padding-bottom: ${t.bottom}px`),t.left!==void 0&&o.push(`padding-left: ${t.left}px`))}if(e.borders){const t=e.borders;t.border?o.push(`border: ${t.border.width}px ${t.border.style} ${t.border.color}`):(t.top&&o.push(`border-top: ${t.top.width}px ${t.top.style} ${t.top.color}`),t.right&&o.push(`border-right: ${t.right.width}px ${t.right.style} ${t.right.color}`),t.bottom&&o.push(`border-bottom: ${t.bottom.width}px ${t.bottom.style} ${t.bottom.color}`),t.left&&o.push(`border-left: ${t.left.width}px ${t.left.style} ${t.left.color}`))}return o.length?o.join("; "):""}function Se(e){if(e.rows===0||e.cols===0||!e.cells.length)return"<table></table>";const o=[];if(e.meta&&(e.meta.width&&o.push(`width="${xe(e.meta.width)}"`),e.meta.cellpadding!==void 0&&o.push(`cellpadding="${e.meta.cellpadding}"`),e.meta.cellspacing!==void 0&&o.push(`cellspacing="${e.meta.cellspacing}"`),e.meta.border!==void 0&&o.push(`border="${e.meta.border}"`),e.meta.classList?.length&&o.push(`class="${xe(e.meta.classList.join(" "))}"`),e.meta.attrs))for(const[r,i]of Object.entries(e.meta.attrs))o.push(`${xe(r)}="${xe(i)}"`);const t=new Map;for(const r of e.cells)t.set(r.id,r);const n=[];for(let r=0;r<e.rows;r++){const i=[];for(let l=0;l<e.cols;l++){const s=e.grid[r][l];if(!s)continue;const c=t.get(s);if(!c||c.row!==r||c.col!==l)continue;const d=[];c.rowspan>1&&d.push(`rowspan="${c.rowspan}"`),c.colspan>1&&d.push(`colspan="${c.colspan}"`),c.align&&d.push(`align="${xe(c.align)}"`),c.valign&&d.push(`valign="${xe(c.valign)}"`),c.classList?.length&&d.push(`class="${xe(c.classList.join(" "))}"`);const u=xa(c.style);u&&d.push(`style="${xe(u)}"`),i.push(`<td${d.length?" "+d.join(" "):""}>${c.contentHtml}</td>`)}i.length&&n.push(`<tr>${i.join("")}</tr>`)}return`<table${o.length?" "+o.join(" "):""}>${n.join("")}</table>`}function Da(e,o){const t=JSON.parse(JSON.stringify(e));let n=-1;const r=typeof o=="string"?o.trim():"";if(r){for(const i of t.cells)if(Array.isArray(i.classList)&&i.classList.includes(r)){n=i.row;break}}if(n===-1||t.rows<=1||t.cells.filter(i=>i.row===n).some(i=>i.rowspan>1))return t;t.cells=t.cells.filter(i=>i.row!==n);for(const i of t.cells)i.row>n&&(i.row-=1);return t.grid.splice(n,1),t.rows-=1,t}function oo(e,o){if(typeof e!="string"||typeof o!="string")return e;const t=new DOMParser().parseFromString(e,"text/html").body.firstChild;if(!t)return e;let n=!1;function r(s){if(s.nodeType===Node.TEXT_NODE&&s.textContent?.trim()){n?s.textContent="":(s.textContent=o,n=!0);return}for(const c of Array.from(s.childNodes))r(c)}function i(s){if(s.nodeType===Node.TEXT_NODE){const c=s.textContent||"";return!c||/^\s*$/.test(c.replace(/\u00A0/g,"X"))}return s.nodeType!==Node.ELEMENT_NODE?!0:Array.from(s.childNodes).every(c=>i(c))}function l(s,c=!1){if(s.nodeType!==Node.ELEMENT_NODE)return;const d=Array.from(s.childNodes);for(const u of d)l(u);!c&&i(s)&&s.parentNode?.removeChild(s)}return r(t),l(t,!0),t.outerHTML||e}function Xn(e,o,t){const n=JSON.parse(JSON.stringify(e));let r;const i=typeof o=="string"?o.trim():"";if(i){for(const u of n.cells)if(Array.isArray(u.classList)&&u.classList.includes(i)){r=u;break}}if(!r)return n;const l=r.col;let s=t?l:l+r.colspan;const c=[];let d=n.cells.length;for(let u=0;u<n.rows;u++){const g=JSON.parse(JSON.stringify(r));g.id=`cell-${d++}`,g.contentHtml=oo(r.contentHtml," "),g.row=u,g.col=s,g.rowspan=1,g.colspan=1,g.classList=r.classList.filter(m=>m!==i),c.push(g)}for(const u of n.cells)u.col>=s&&(u.col+=1);n.cells.push(...c),n.cols+=1;for(let u=0;u<n.rows;u++)n.grid[u].splice(s,0,null),n.grid[u][s]=c[u].id;return n}function Fa(e,o){const t=JSON.parse(JSON.stringify(e));let n;const r=typeof o=="string"?o.trim():"";if(r){for(const l of t.cells)if(Array.isArray(l.classList)&&l.classList.includes(r)){n=l;break}}if(!n)return t;const i=n.col;if(t.cols<=1||t.cells.filter(l=>l.col===i).some(l=>l.colspan>1))return t;t.cells=t.cells.filter(l=>l.col!==i);for(const l of t.cells)l.col>i&&(l.col-=1);for(let l=0;l<t.rows;l++)t.grid[l].splice(i,1);return t.cols-=1,t}function Zn(e,o,t,n=1){const r=JSON.parse(JSON.stringify(e));if(n<=0)return r;let i;const l=typeof o=="string"?o.trim():"";if(l){for(const E of r.cells)if(Array.isArray(E.classList)&&E.classList.includes(l)){i=E;break}}if(!i)return r;const s=i.row,c=i.col,d=i.colspan,u=i.rowspan,g=[];if(t)for(let E=1;E<=n;E++)g.push(c-E);else for(let E=0;E<n;E++)g.push(c+d+E);for(const E of g)if(E<0||E>=r.cols)return r;const m=[];for(const E of g){const S=r.cells.find(v=>v.row===s&&v.col<=E&&E<v.col+v.colspan);if(!S)return r;m.push(S)}const f=Array.from(new Set(m));for(const E of f)if(E.rowspan!==u)return r;const p=d+f.reduce((E,S)=>E+S.colspan,0);let b=(t?[...f.reverse(),i]:[i,...f]).map(E=>{const S=new DOMParser().parseFromString(E.contentHtml,"text/html").body.firstChild,v=S?S.innerHTML:"";return v===""||/^\s*(&nbsp;)*\s*$/.test(v)?"":v}).filter(E=>E!=="").join("<br>");(b===""||/^\s*(&nbsp;|<br>)*\s*$/.test(b))&&(b="&nbsp;");const h=new DOMParser().parseFromString(i.contentHtml,"text/html").body.firstChild;h?(h.innerHTML=b,i.contentHtml=h.outerHTML):i.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">${b}</div>`,i.colspan=p,t&&g.length>0&&(i.col=Math.min(...g)),r.cells=r.cells.filter(E=>!f.includes(E));const y=t&&g.length>0?Math.min(...g):c;for(let E=y;E<y+p;E++)r.grid[s][E]=i.id;return r}function Jn(e,o,t,n=1){const r=JSON.parse(JSON.stringify(e));if(n<=0)return r;let i;const l=typeof o=="string"?o.trim():"";if(l){for(const E of r.cells)if(Array.isArray(E.classList)&&E.classList.includes(l)){i=E;break}}if(!i)return r;const s=i.row,c=i.col,d=i.rowspan,u=i.colspan,g=[];if(t)for(let E=1;E<=n;E++)g.push(s-E);else for(let E=0;E<n;E++)g.push(s+d+E);for(const E of g)if(E<0||E>=r.rows)return r;const m=[];for(const E of g){const S=r.cells.find(v=>v.col===c&&v.row<=E&&E<v.row+v.rowspan);if(!S)return r;m.push(S)}const f=Array.from(new Set(m));for(const E of f)if(E.colspan!==u)return r;const p=d+f.reduce((E,S)=>E+S.rowspan,0);let b=(t?[...f.reverse(),i]:[i,...f]).map(E=>{const S=new DOMParser().parseFromString(E.contentHtml,"text/html").body.firstChild,v=S?S.innerHTML:"";return v===""||/^\s*(&nbsp;)*\s*$/.test(v)?"":v}).filter(E=>E!=="").join("<br>");b=b.replace(/&nbsp;$/g,""),(b===""||/^\s*(&nbsp;|<br>)*\s*$/.test(b))&&(b="&nbsp;");const h=new DOMParser().parseFromString(i.contentHtml,"text/html").body.firstChild;h?(h.innerHTML=b,i.contentHtml=h.outerHTML):i.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">${b}</div>`,i.rowspan=p,t&&g.length>0&&(i.row=Math.min(...g)),r.cells=r.cells.filter(E=>!f.includes(E));const y=t&&g.length>0?Math.min(...g):s;for(let E=y;E<y+p&&E<r.rows;E++)r.grid[E][c]=i.id;return r}function qa(e,o,t=1){const n=JSON.parse(JSON.stringify(e)),r=typeof o=="string"?o.trim():"";if(!r)return n;const i=n.cells.find(s=>Array.isArray(s.classList)&&s.classList.includes(r));if(!i||i.colspan<=1||t>=i.colspan)return n;i.colspan-=t;const l={id:`cell-${n.cells.length}`,row:i.row,col:i.col+i.colspan,colspan:t,rowspan:i.rowspan,contentHtml:oo(i.contentHtml," "),classList:[...i.classList],align:i.align,valign:i.valign,style:i.style?JSON.parse(JSON.stringify(i.style)):{}};n.cells.push(l);for(let s=0;s<n.rows;s++)for(let c=0;c<n.cols;c++){const d=n.cells.find(u=>u.row<=s&&u.row+u.rowspan>s&&u.col<=c&&u.col+u.colspan>c);n.grid[s][c]=d?d.id:null}return n}function Wa(e,o,t=1){const n=JSON.parse(JSON.stringify(e)),r=typeof o=="string"?o.trim():"";if(!r)return n;const i=n.cells.find(s=>Array.isArray(s.classList)&&s.classList.includes(r));if(!i||i.rowspan<=1||t>=i.rowspan)return n;i.rowspan-=t;const l={id:`cell-${n.cells.length}`,row:i.row+i.rowspan,col:i.col,rowspan:t,colspan:i.colspan,contentHtml:oo(i.contentHtml," "),classList:[...i.classList],align:i.align,valign:i.valign,style:i.style?JSON.parse(JSON.stringify(i.style)):{}};n.cells.push(l);for(let s=0;s<n.rows;s++)for(let c=0;c<n.cols;c++){const d=n.cells.find(u=>u.row<=s&&u.row+u.rowspan>s&&u.col<=c&&u.col+u.colspan>c);n.grid[s][c]=d?d.id:null}for(let s=l.row;s<l.row+l.rowspan;s++)for(let c=l.col;c<l.col+l.colspan;c++)n.grid[s][c];return n}function Vo(e,o){const t=typeof o=="string"?o.trim():"";if(!t)return null;const n=e.cells.find(r=>Array.isArray(r.classList)&&r.classList.includes(t));return n?{row:n.row,col:n.col}:null}function Qn(e,o){const t=typeof o=="string"?o.trim():"";if(!t)return{row:null,col:null,isOverlapped:!1};const n=e.cells.find(i=>Array.isArray(i.classList)&&i.classList.includes(t));if(!n)return{row:null,col:null,isOverlapped:!1};const r=n.row;if(r<0||r>=e.rows)return{row:null,col:null,isOverlapped:!1};for(const i of e.cells)if(i.rowspan>1&&!(Array.isArray(i.classList)&&i.classList.includes(t))&&i.row<=r&&r<i.row+i.rowspan)return{row:i.row,col:i.col,isOverlapped:!0};return{row:null,col:null,isOverlapped:!1}}function er(e,o){const t=typeof o=="string"?o.trim():"";if(!t)return{row:null,col:null,isOverlapped:!1};const n=e.cells.find(i=>Array.isArray(i.classList)&&i.classList.includes(t));if(!n)return{row:null,col:null,isOverlapped:!1};const r=n.col;if(r<0||r>=e.cols)return{row:null,col:null,isOverlapped:!1};for(const i of e.cells)if(i.colspan>1&&!(Array.isArray(i.classList)&&i.classList.includes(t))&&i.col<=r&&r<i.col+i.colspan)return{row:i.row,col:i.col,isOverlapped:!0};return{row:null,col:null,isOverlapped:!1}}function tr(e,o,t){const n=JSON.parse(JSON.stringify(e)),r=n.cells.find(d=>d.classList?.includes(o));if(!r)return n;const i=n.cells.filter(d=>d.classList?.includes(t)&&d.id!==r.id);let l=r.colspan||1;i.forEach(d=>{const u=d.colspan||1;l+=u,d.colspan=1}),r.colspan=l;const s=d=>{const u=d.match(/<div[^>]*>(.*?)<\/div>/);return u?u[1].replace(/&nbsp;/g,"").trim():""};r.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a; padding: 8px;">${[s(r.contentHtml),...i.sort((d,u)=>d.col-u.col).map(d=>s(d.contentHtml)).filter(d=>d.length>0)].filter(d=>d.length>0).join("<br>")}</div>`;const c=new Set(i.map(d=>d.id));return n.cells.forEach(d=>{if(d.row===r.row&&d.col>r.col&&!c.has(d.id)){let u=0;i.forEach(g=>{g.row===d.row&&g.col<d.col&&(u+=(g.colspan||1)-1)}),d.col-=u}}),n.grid=n.grid.map((d,u)=>{const g=new Array(n.cols).fill(null);return n.cells.filter(m=>{const f=m.row,p=m.row+(m.rowspan||1)-1;return f<=u&&u<=p&&!c.has(m.id)}).sort((m,f)=>m.col-f.col).forEach(m=>{const f=m.id,p=m.colspan||1,b=m.col;for(let h=0;h<p&&b+h<n.cols;h++)g[b+h]=f}),g}),n}function or(e,o,t){const n=JSON.parse(JSON.stringify(e)),r=n.cells.find(u=>u.classList?.includes(o));if(!r)return n;const i=n.cells.filter(u=>u.classList?.includes(t)&&u.id!==r.id&&u.col===r.col);let l=r.rowspan||1;i.forEach(u=>{const g=u.rowspan||1;l+=g,u.rowspan=1}),r.rowspan=l;const s=u=>{const g=u.match(/<div[^>]*>(.*?)<\/div>/);return g?g[1].replace(/&nbsp;/g,"").trim():""};r.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a; padding: 8px;">${[s(r.contentHtml),...i.sort((u,g)=>u.row-g.row).map(u=>s(u.contentHtml)).filter(u=>u.length>0)].filter(u=>u.length>0).join("<br>")}</div>`;const c=i.length>0?Math.min(...i.map(u=>u.row)):r.row;c<r.row&&(r.row=c);const d=new Set(i.map(u=>u.id));return n.cells.forEach(u=>{if(u.col===r.col&&u.id!==r.id&&!d.has(u.id)){let g=0;i.forEach(m=>{m.col===u.col&&m.row<=u.row&&(g+=(m.rowspan||1)-1)}),g>0&&(u.row-=g)}}),n.grid=n.grid.map((u,g)=>{const m=new Array(n.cols).fill(null);return n.cells.filter(f=>{const p=f.row,b=f.row+(f.rowspan||1)-1;return p<=g&&g<=b&&!d.has(f.id)}).sort((f,p)=>f.col-p.col).forEach(f=>{const p=f.col,b=f.colspan||1;for(let h=0;h<b&&p+h<n.cols;h++)m[p+h]=f.id}),m}),n}function no(e,o,t,n,r,i=!0){const{cells:l,grid:s}=e;function c(f,p){if(!s[f]||!s[f][p])return null;const b=s[f][p];return l.find(h=>h.id===b)}function d(f,p){const b=c(f,p);return b?{row:b.row,col:b.col,cell:b}:null}const u=d(o,t),g=d(n,r);if(!u||!g||u.cell.id===g.cell.id)return 0;function m(f,p,b,h){let y=0;const E=f<p?1:-1,S=new Set;for(let C=f;C!==p;C+=E){const L=c(h?b:C,h?C:b);L&&!S.has(L.id)&&(S.add(L.id),y++)}const v=c(h?b:p,h?p:b);return v&&!S.has(v.id)&&y++,y}return i?u.row===g.row?m(t,r,o,!0)-1:0:u.col===g.col?m(o,n,t,!1)-1:0}function $a(e,o){if(!o.settings)return e;const t=Object.keys(o.settings);if(t.length===0)return e;const n=["paddingLeftRight","paddingTopBottom","paddingLeft","paddingTop","paddingRight","paddingBottom"],r=t[0];if(!n.includes(r))return e;const i=o.settings[r];return typeof i!="number"||isNaN(i)||!e.cells||!Array.isArray(e.cells)||e.cells.forEach((l,s)=>{switch(l.id,l.style||(l.style={}),l.style.padding||(l.style.padding={top:0,right:0,bottom:0,left:0}),r){case"paddingLeftRight":l.style.padding.left=i,l.style.padding.right=i;break;case"paddingTopBottom":l.style.padding.top=i,l.style.padding.bottom=i;break;case"paddingLeft":l.style.padding.left=i;break;case"paddingTop":l.style.padding.top=i;break;case"paddingRight":l.style.padding.right=i;break;case"paddingBottom":l.style.padding.bottom=i}l.style.padding.top===0&&l.style.padding.right===0&&l.style.padding.bottom===0&&l.style.padding.left===0&&delete l.style.padding,Object.keys(l.style).length===0&&delete l.style}),e}function za(e,o){const{backgroundPositionX:t,backgroundPositionY:n}=o.settings;if(t===void 0&&n===void 0)return e;const r=e.replace(/\s*;\s*/g,";").replace(/([^;])$/,"$1;").trim().split(";").filter(s=>s.trim());let i=!1;const l=r.map(s=>{const[c,d]=s.split(":").map(u=>u.trim());if(c==="background-position"){i=!0;const u=d.split(/\s+/).filter(f=>f.trim());let g=u[0],m=u[1]||u[0];return t!==void 0&&(g=`${t}px`),n!==void 0&&(m=`${n}px`),`background-position: ${g} ${m}`}return c==="background-position-x"&&t!==void 0?`background-position-x: ${t}px`:c==="background-position-y"&&n!==void 0?`background-position-y: ${n}px`:s});if(!i&&(t!==void 0||n!==void 0)){const s=t!==void 0?`${t}px`:"center",c=n!==void 0?`${n}px`:"center";l.push(`background-position: ${s} ${c}`)}return l.join("; ")}function Va(e){const o={};if(!e)return o;const t=e.split(";").map(n=>n.trim()).filter(n=>n.length>0);for(const n of t){const r=n.indexOf(":");if(r===-1)continue;const i=n.slice(0,r).trim(),l=n.slice(r+1).trim();if(!(!i||!l))switch(i.toLowerCase()){case"background-image":const s=l.match(/url\(['"]?(.+?)['"]?\)/i);s&&s[1]&&(o.backgroundImage=s[1]);break;case"background-size":o.backgroundSize=l;break;case"background-repeat":o.backgroundRepeat=l;break;case"background-position":const c=l.split(/\s+/).filter(d=>d.length>0);c.length>=1&&(o.backgroundPositionX=c[0]),c.length>=2&&(o.backgroundPositionY=c[1])}}return o}function Ua(e,o){const t=[];for(const n of e.cells)o.some(r=>n.classList.includes(r))&&t.push(n.id);return t}function ja(e,o,t){const n={...e,cells:e.cells.map(r=>({...r,style:r.style?{...r.style}:void 0}))};for(const r of n.cells)o.includes(r.id)&&(r.style||(r.style={}),r.style.backgroundColor=t);return n}function Ga(e,o,t){const n={...e,cells:e.cells.map(r=>({...r,classList:[...r.classList]}))};for(const r of n.cells)o.includes(r.id)&&(r.classList.includes(t)||r.classList.push(t));return n}function Ya(e,o,t,n){const r={width:1,style:"solid",color:"#b9b1b1"},i={...e,cells:e.cells.map(l=>{const s={...l};return s.style&&(s.style={...s.style},s.style.borders&&(s.style.borders={...s.style.borders})),s})};for(const l of i.cells)if(o.includes(l.id)){l.style||(l.style={}),l.style.borders||(l.style.borders={});for(const s of t){const c=l.style.borders[s];c?l.style.borders[s]={...c,...n}:l.style.borders[s]={...r,...n}}}return i}function Ka(e,o){const t=new Map(e.cells.map(u=>[u.id,u])),n=new Set,r=[];for(const u of o){const g=t.get(u);if(g)for(let m=0;m<g.rowspan;m++)for(let f=0;f<g.colspan;f++){const p=g.row+m,b=g.col+f,h=`${p}-${b}`;n.has(h)||(n.add(h),r.push({row:p,col:b,id:u}))}}const i=new Set(r.map(u=>u.row)),l=new Set(r.map(u=>u.col));let s=!1;if(i.size===1&&l.size===r.length)s=!0;else if(!(l.size===1&&i.size===r.length))return{};s?r.sort((u,g)=>u.col-g.col):r.sort((u,g)=>u.row-g.row);const c=new Map;for(const u of r)c.has(u.id)||c.set(u.id,[]),c.get(u.id).push({row:u.row,col:u.col});c.forEach((u,g)=>{const m=t.get(g);if(m.rowspan>1||m.colspan>1){const f=s?(p,b)=>p.col-b.col:(p,b)=>p.row-b.row;u.sort(f)}});const d={};for(let u=0;u<r.length;u++){const g=r[u],m=g.id,f=t.get(m);let p=m;if(f.rowspan>1||f.colspan>1){const h=c.get(m).findIndex(y=>y.row===g.row&&y.col===g.col);h>0&&(p=`${m}-uni-${h+1}`)}const b=[];s?(b.push("top","bottom"),(u===0||r[u-1].col!==g.col-1)&&b.push("left"),(u===r.length-1||r[u+1].col!==g.col+1)&&b.push("right")):(b.push("left","right"),(u===0||r[u-1].row!==g.row-1)&&b.push("top"),(u===r.length-1||r[u+1].row!==g.row+1)&&b.push("bottom")),d[p]=b}return d}function Xa(e,o,t,n){const r={topLeft:0,topRight:1,bottomRight:2,bottomLeft:3},i={...e,cells:e.cells.map(l=>{const s={...l};return s.style&&(s.style={...s.style}),s})};for(const l of i.cells)if(o.includes(l.id)){l.style||(l.style={});let s=(l.style.borderRadius||"0px 0px 0px 0px").split(" ").map(c=>parseInt(c.replace("px",""),10));for(const c of t){const d=r[c];d!==void 0&&(s[d]=n)}s.every(c=>c===0)?delete l.style.borderRadius:l.style.borderRadius=s.map(c=>`${c}px`).join(" ")}return i}function Za(e,o){const t=new Map(e.cells.map(u=>[u.id,u])),n=new Set,r=[];for(const u of o){const g=t.get(u);if(g)for(let m=0;m<g.rowspan;m++)for(let f=0;f<g.colspan;f++){const p=g.row+m,b=g.col+f,h=`${p}-${b}`;n.has(h)||(n.add(h),r.push({row:p,col:b,id:u}))}}const i=new Set(r.map(u=>u.row)),l=new Set(r.map(u=>u.col));let s=!1;if(i.size===1&&l.size===r.length)s=!0;else if(!(l.size===1&&i.size===r.length))return{};s?r.sort((u,g)=>u.col-g.col):r.sort((u,g)=>u.row-g.row);const c=new Map;for(const u of r)c.has(u.id)||c.set(u.id,[]),c.get(u.id).push({row:u.row,col:u.col});c.forEach((u,g)=>{const m=t.get(g);if(m.rowspan>1||m.colspan>1){const f=s?(p,b)=>p.col-b.col:(p,b)=>p.row-b.row;u.sort(f)}});const d={};for(let u=0;u<r.length;u++){const g=r[u],m=g.id,f=t.get(m);let p=m;if(f.rowspan>1||f.colspan>1){const y=c.get(m).findIndex(E=>E.row===g.row&&E.col===g.col);y>0&&(p=`${m}-uni-${y+1}`)}const b=new Set;s?(b.add("top"),b.add("bottom"),(u===0||r[u-1].col!==g.col-1)&&b.add("left"),(u===r.length-1||r[u+1].col!==g.col+1)&&b.add("right")):(b.add("left"),b.add("right"),(u===0||r[u-1].row!==g.row-1)&&b.add("top"),(u===r.length-1||r[u+1].row!==g.row+1)&&b.add("bottom"));const h=[];b.has("top")&&b.has("left")&&h.push("topLeft"),b.has("top")&&b.has("right")&&h.push("topRight"),b.has("bottom")&&b.has("left")&&h.push("bottomLeft"),b.has("bottom")&&b.has("right")&&h.push("bottomRight"),h.length>0&&(d[p]=h)}return d}function Ja(e,o,t,n){const r={...e,cells:e.cells.map(i=>{const l={...i};return l.style&&(l.style={...l.style},l.style.padding&&(l.style.padding={...l.style.padding})),l})};for(const i of r.cells)if(o.includes(i.id)){i.style||(i.style={}),i.style.padding||(i.style.padding={top:0,right:0,bottom:0,left:0});for(const l of t){const s=l;i.style.padding[s]=n}["top","right","bottom","left"].forEach(l=>{i.style?.padding&&i.style.padding[l]===0&&delete i.style.padding[l]}),i.style.padding&&Object.keys(i.style.padding).length===0&&delete i.style.padding}return r}function Qa(e,o){const t=new RegExp(`\\b${o}\\s*:[^;]*(;\\s*)?`,"gi");return e.replace(t,"").trim().replace(/\s*;\s*(?=;|$)/g,"").trim()}function es(e){const o=e.match(/border-radius:\s*([^;]+)/);if(!o)return{full:null,first:null,firstNumber:null};const t=o[1].trim(),n=t.split(/\s+/)[0],r=parseInt(n),i=t.split(/\s+/)[1],l=parseInt(i),s=t.split(/\s+/)[2],c=parseInt(s),d=t.split(/\s+/)[3];return{full:t,first:n,firstNumber:r,second:i,secondNumber:l,third:s,thirdNumber:c,fourth:d,fourthNumber:parseInt(d)}}function ts(e,o,t){const n=/border-radius:\s*([^;]+)/,r=e.match(n);if(!r)return e+` border-radius: ${nr("0 0 0 0",o,t)};`;const i=nr(r[1].trim(),o,t);return e.replace(n,`border-radius: ${i}`)}function nr(e,o,t){const n=typeof t=="number"&&!isNaN(t)?Math.max(0,t):0;let r=e.split(/\s+/).filter(s=>s.trim()!=="").map(s=>{const c=parseFloat(s);return isNaN(c)?0:Math.max(0,c)}),i;if(r.length===0)i=[0,0,0,0];else if(r.length===1)i=[r[0],r[0],r[0],r[0]];else if(r.length===2)i=[r[0],r[1],r[0],r[1]];else if(r.length===3)i=[r[0],r[1],r[2],r[1]];else{const s=r.slice(0,4);i=[s[0]??0,s[1]??0,s[2]??0,s[3]??0]}const l={topLeft:0,topRight:1,bottomRight:2,bottomLeft:3}[o];return l!==void 0&&(i[l]=n),i.map(s=>s===0?"0":`${s}px`).join(" ")}function os(e){const o=JSON.parse(JSON.stringify(e)),t=o.rows,n=o.cols;return o.cells.forEach(r=>{const i=r.row===0,l=r.row+r.rowspan===t,s=r.col===0,c=r.col+r.colspan===n;i&&delete r.style.borders.top,l&&delete r.style.borders.bottom,s&&delete r.style.borders.left,c&&delete r.style.borders.right}),o}function ns(e){const o=JSON.parse(JSON.stringify(e));return o.cells.forEach(t=>{if(t.style?.borders?.top&&t.style?.borders?.bottom&&t.style?.borders?.left&&t.style?.borders?.right){const n=t.style.borders.top,r=t.style.borders.bottom,i=t.style.borders.left,l=t.style.borders.right;n?.width===r?.width&&n?.width===i?.width&&n?.width===l?.width&&n?.style===r?.style&&n?.style===i?.style&&n?.style===l?.style&&n?.color===r?.color&&n?.color===i?.color&&n?.color===l?.color&&(t.style.borders={border:{width:n.width,style:n.style,color:n.color}})}}),o}function rs(e,o){return typeof e!="string"&&(e=String(e||"")),typeof o!="string"&&(o=String(o||"")),e.split(" ").filter(t=>t&&!t.startsWith(o)).join(" ").trim()}function is(e){const o={},t={};return Object.keys(e).forEach(n=>{const r=n.indexOf("-uni-");if(r===-1){const i=n;o[i]=[...e[n]],t[i]=new Set(e[n])}else{const i=n.substring(0,r);t[i]||(t[i]=new Set),e[n].forEach(l=>{t[i].add(l)}),e.hasOwnProperty(i)&&!o.hasOwnProperty(i)&&(o[i]=[...e[i]],e[i].forEach(l=>t[i].add(l)))}}),Object.keys(t).forEach(n=>{const r=n;o[r]||(o[r]=[]),o[r]=Array.from(t[r])}),o}function rr(e,o,t,n=!0){const r=document.querySelector(e);if(!r)return;const i=r.closest("td");if(!i)return;const l=i.parentElement;if(!l)return;const s=Array.from(l.cells),c=s.indexOf(i);let d=0,u=1;for(;d<o;){let g;if(n?g=c+u:g=c-u,g<0||g>=s.length)break;s[g].classList.add(t),d++,u++}}function ir(e,o,t,n=!0){const r=document.querySelector(e);if(!r)return;const i=r.closest("td");if(!i)return;const l=i.parentElement;if(!l||l.tagName!=="TR")return;const s=l.closest("table");if(!s)return;const c=Array.from(s.rows),d=c.indexOf(l);if(d===-1)return;const u=[],g=Math.max(...c.map(y=>Array.from(y.cells).reduce((E,S)=>E+(S.colSpan||1),0))),m=new Map;for(let y=0;y<c.length;y++){u[y]=[];let E=0;const S=Array.from(c[y].cells);for(const v of S){for(;m.has(`${y}:${E}`);){const w=m.get(`${y}:${E}`);u[y][E]=w.cell,E++}const C=v.colSpan||1,L=v.rowSpan||1;for(let w=0;w<C&&E<g;w++){u[y][E+w]=v;for(let A=0;A<L;A++)if(y+A<c.length){const M=`${y+A}:${E+w}`;m.set(M,{cell:v,rowSpan:L,colSpan:C,startRow:y})}}E+=C}for(;E<g;){if(m.has(`${y}:${E}`)){const v=m.get(`${y}:${E}`);u[y][E]=v.cell}else u[y][E]=null;E++}}let f=-1;for(let y=0;y<u[d].length;y++)if(u[d][y]===i){f=y;break}if(f===-1)return;let p=0,b=1;const h=new Set;for(;p<o;){const y=n?d+b:d-b;if(y<0||y>=c.length)break;const E=u[y][f];if(!E){b++;continue}const S=`${y}:${f}`,v=m.get(S);if(E.tagName!=="TD"){b++;continue}if(h.has(E)){b++;continue}if(v&&v.startRow!==y){b++;continue}E.classList.add(t),h.add(E),p++,b++}}var lr=`
89
89
  <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none">
90
90
  <path d="M2.21128 13.375C1.83241 13.375 1.51172 13.2438 1.24922 12.9813C0.986719 12.7188 0.855469 12.3981 0.855469 12.0192V1.98081C0.855469 1.60194 0.986719 1.28125 1.24922 1.01875C1.51172 0.75625 1.83241 0.625 2.21128 0.625H4.74966C5.12853 0.625 5.44922 0.75625 5.71172 1.01875C5.97422 1.28125 6.10547 1.60194 6.10547 1.98081V12.0192C6.10547 12.3981 5.97422 12.7188 5.71172 12.9813C5.44922 13.2438 5.12853 13.375 4.74966 13.375H2.21128ZM9.24966 13.375C8.87078 13.375 8.55009 13.2438 8.28759 12.9813C8.02509 12.7188 7.89384 12.3981 7.89384 12.0192V1.98081C7.89384 1.60194 8.02509 1.28125 8.28759 1.01875C8.55009 0.75625 8.87078 0.625 9.24966 0.625H11.788C12.1669 0.625 12.4876 0.75625 12.7501 1.01875C13.0126 1.28125 13.1438 1.60194 13.1438 1.98081V12.0192C13.1438 12.3981 13.0126 12.7188 12.7501 12.9813C12.4876 13.2438 12.1669 13.375 11.788 13.375H9.24966ZM12.0188 1.98081C12.0188 1.92306 11.9948 1.87019 11.9467 1.82219C11.8987 1.77406 11.8458 1.75 11.788 1.75H9.24966C9.19191 1.75 9.13903 1.77406 9.09103 1.82219C9.04291 1.87019 9.01884 1.92306 9.01884 1.98081V12.0192C9.01884 12.0769 9.04291 12.1298 9.09103 12.1778C9.13903 12.2259 9.19191 12.25 9.24966 12.25H11.788C11.8458 12.25 11.8987 12.2259 11.9467 12.1778C11.9948 12.1298 12.0188 12.0769 12.0188 12.0192V1.98081Z" fill="#344966"/>
91
91
  </svg>
@@ -93,51 +93,51 @@ __useblocks__.define("js/iframe.js",["require","exports","module","js/rolldown-r
93
93
  <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none">
94
94
  <path d="M1.98081 13.1442C1.60194 13.1442 1.28125 13.013 1.01875 12.7505C0.75625 12.488 0.625 12.1673 0.625 11.7884V9.25002C0.625 8.87115 0.75625 8.55046 1.01875 8.28796C1.28125 8.02546 1.60194 7.89421 1.98081 7.89421H12.0192C12.3981 7.89421 12.7188 8.02546 12.9813 8.28796C13.2438 8.55046 13.375 8.87115 13.375 9.25002V11.7884C13.375 12.1673 13.2438 12.488 12.9813 12.7505C12.7188 13.013 12.3981 13.1442 12.0192 13.1442H1.98081ZM1.98081 6.10583C1.60194 6.10583 1.28125 5.97459 1.01875 5.71209C0.75625 5.44958 0.625 5.1289 0.625 4.75002V2.21165C0.625 1.83277 0.75625 1.51208 1.01875 1.24958C1.28125 0.987085 1.60194 0.855835 1.98081 0.855835H12.0192C12.3981 0.855835 12.7188 0.987085 12.9813 1.24958C13.2438 1.51208 13.375 1.83277 13.375 2.21165V4.75002C13.375 5.1289 13.2438 5.44958 12.9813 5.71209C12.7188 5.97459 12.3981 6.10583 12.0192 6.10583H1.98081ZM12.0192 1.98083H1.98081C1.92306 1.98083 1.87019 2.0049 1.82219 2.05302C1.77406 2.10102 1.75 2.1539 1.75 2.21165V4.75002C1.75 4.80777 1.77406 4.86065 1.82219 4.90865C1.87019 4.95677 1.92306 4.98083 1.98081 4.98083H12.0192C12.0769 4.98083 12.1298 4.95677 12.1778 4.90865C12.2259 4.86065 12.25 4.80777 12.25 4.75002V2.21165C12.25 2.1539 12.2259 2.10102 12.1778 2.05302C12.1298 2.0049 12.0769 1.98083 12.0192 1.98083Z" fill="#344966"/>
95
95
  </svg>
96
- `,rs=`
96
+ `,ls=`
97
97
  <svg xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none" style="transform: rotate(-90deg); display: inline-block;">
98
98
  <path d="M1.75 10.2909L1.75 14.7692C1.75 14.8366 1.77163 14.8919 1.81488 14.9351C1.85813 14.9784 1.91344 15 1.98081 15L12.0192 15C12.0866 15 12.1419 14.9784 12.1851 14.9351C12.2284 14.8919 12.25 14.8366 12.25 14.7692L12.25 10.2909L1.75 10.2909ZM0.625 4.73081C0.625 3.93713 1.75 3.93713 1.75 4.73081L1.75 9.16594L12.25 9.16594L12.25 4.73081C12.25 3.93713 13.375 3.93713 13.375 4.73081L13.375 14.7692C13.375 15.1421 13.2422 15.4613 12.9767 15.7268C12.7112 15.9923 12.3921 16.125 12.0192 16.125L1.98081 16.125C1.60794 16.125 1.28875 15.9923 1.02325 15.7268C0.75775 15.4613 0.624999 15.1421 0.624999 14.7692L0.625 4.73081ZM3.8125 3.93731C3.8125 3.77781 3.86644 3.64425 3.97431 3.53662C4.08206 3.42887 4.21563 3.375 4.375 3.375L6.4375 3.375L6.4375 1.3125C6.4375 1.15312 6.49144 1.01956 6.59931 0.911812C6.70719 0.803937 6.84081 0.75 7.00019 0.75C7.15969 0.75 7.29325 0.803937 7.40088 0.911812C7.50863 1.01956 7.5625 1.15312 7.5625 1.3125L7.5625 3.375L9.625 3.375C9.78438 3.375 9.91794 3.42894 10.0257 3.53681C10.1336 3.64469 10.1875 3.77831 10.1875 3.93769C10.1875 4.09719 10.1336 4.23075 10.0257 4.33837C9.91794 4.44612 9.78438 4.5 9.625 4.5L7.5625 4.5L7.5625 6.5625C7.5625 6.72187 7.50856 6.8555 7.40069 6.96337C7.29281 7.07113 7.15919 7.125 6.99981 7.125C6.84031 7.125 6.70675 7.07113 6.59913 6.96337C6.49138 6.8555 6.4375 6.72187 6.4375 6.5625L6.4375 4.5L4.375 4.5C4.21563 4.5 4.08206 4.44606 3.97431 4.33819C3.86644 4.23031 3.8125 4.09669 3.8125 3.93731Z" fill="#777582"/>
99
99
  </svg>
100
- `,is=`
100
+ `,as=`
101
101
  <svg xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none" style="transform: rotate(90deg); display: inline-block;">
102
102
  <path d="M1.75 10.2909L1.75 14.7692C1.75 14.8366 1.77163 14.8919 1.81488 14.9351C1.85813 14.9784 1.91344 15 1.98081 15L12.0192 15C12.0866 15 12.1419 14.9784 12.1851 14.9351C12.2284 14.8919 12.25 14.8366 12.25 14.7692L12.25 10.2909L1.75 10.2909ZM0.625 4.73081C0.625 3.93713 1.75 3.93713 1.75 4.73081L1.75 9.16594L12.25 9.16594L12.25 4.73081C12.25 3.93713 13.375 3.93713 13.375 4.73081L13.375 14.7692C13.375 15.1421 13.2422 15.4613 12.9767 15.7268C12.7112 15.9923 12.3921 16.125 12.0192 16.125L1.98081 16.125C1.60794 16.125 1.28875 15.9923 1.02325 15.7268C0.75775 15.4613 0.624999 15.1421 0.624999 14.7692L0.625 4.73081ZM3.8125 3.93731C3.8125 3.77781 3.86644 3.64425 3.97431 3.53662C4.08206 3.42887 4.21563 3.375 4.375 3.375L6.4375 3.375L6.4375 1.3125C6.4375 1.15312 6.49144 1.01956 6.59931 0.911812C6.70719 0.803937 6.84081 0.75 7.00019 0.75C7.15969 0.75 7.29325 0.803937 7.40088 0.911812C7.50863 1.01956 7.5625 1.15312 7.5625 1.3125L7.5625 3.375L9.625 3.375C9.78438 3.375 9.91794 3.42894 10.0257 3.53681C10.1336 3.64469 10.1875 3.77831 10.1875 3.93769C10.1875 4.09719 10.1336 4.23075 10.0257 4.33837C9.91794 4.44612 9.78438 4.5 9.625 4.5L7.5625 4.5L7.5625 6.5625C7.5625 6.72187 7.50856 6.8555 7.40069 6.96337C7.29281 7.07113 7.15919 7.125 6.99981 7.125C6.84031 7.125 6.70675 7.07113 6.59913 6.96337C6.49138 6.8555 6.4375 6.72187 6.4375 6.5625L6.4375 4.5L4.375 4.5C4.21563 4.5 4.08206 4.44606 3.97431 4.33819C3.86644 4.23031 3.8125 4.09669 3.8125 3.93731Z" fill="#777582"/>
103
103
  </svg>
104
- `,ls=`
104
+ `,ss=`
105
105
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none" style="transform: rotate(-90deg); display: inline-block;">
106
106
  <path d="M15.375 6.74998C15.375 7.12885 15.2438 7.44954 14.9813 7.71204C14.7188 7.97454 14.3981 8.10579 14.0192 8.10579L3.98081 8.10579C3.60194 8.10579 3.28125 7.97454 3.01875 7.71204C2.75625 7.44954 2.625 7.12885 2.625 6.74998L2.625 4.2116C2.625 3.83273 2.75625 3.51204 3.01875 3.24954C3.28125 2.98704 3.60194 2.85579 3.98081 2.85579L14.0192 2.85579C14.3981 2.85579 14.7188 2.98704 14.9813 3.24954C15.2438 3.51204 15.375 3.83273 15.375 4.2116L15.375 6.74998ZM15.375 13.7884C15.375 14.1672 15.2438 14.4879 14.9813 14.7504C14.7188 15.0129 14.3981 15.1442 14.0192 15.1442L3.98081 15.1442C3.60194 15.1442 3.28125 15.0129 3.01875 14.7504C2.75625 14.4879 2.625 14.1672 2.625 13.7884L2.625 11.25C2.625 10.8711 2.75625 10.5504 3.01875 10.2879C3.28125 10.0254 3.60194 9.89416 3.98081 9.89416L14.0192 9.89416C14.3981 9.89416 14.7188 10.0254 14.9813 10.2879C15.2438 10.5504 15.375 10.8711 15.375 11.25L15.375 13.7884ZM3.98081 14.0192L14.0192 14.0192C14.0769 14.0192 14.1298 13.9951 14.1778 13.947C14.2259 13.899 14.25 13.8461 14.25 13.7884L14.25 11.25C14.25 11.1922 14.2259 11.1394 14.1778 11.0914C14.1298 11.0432 14.0769 11.0192 14.0192 11.0192L3.98081 11.0192C3.92306 11.0192 3.87019 11.0432 3.82219 11.0914C3.77406 11.1394 3.75 11.1922 3.75 11.25L3.75 13.7884C3.75 13.8461 3.77406 13.899 3.82219 13.947C3.87019 13.9951 3.92306 14.0192 3.98081 14.0192Z" fill="#777582"/>
107
107
  <circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
108
108
  <path d="M9.55102 9.55102L9.55102 11.449C9.55102 11.6051 9.49818 11.7359 9.39251 11.8415C9.28684 11.9472 9.15594 12 8.99982 12C8.84357 12 8.71273 11.9472 8.60731 11.8415C8.50175 11.7359 8.44898 11.6051 8.44898 11.449L8.44898 9.55102L6.55102 9.55102C6.3949 9.55102 6.26406 9.49818 6.15851 9.39251C6.05284 9.28684 6 9.15594 6 8.99982C6 8.84357 6.05284 8.71273 6.15851 8.60731C6.26406 8.50175 6.3949 8.44898 6.55102 8.44898L8.44898 8.44898L8.44898 6.55102C8.44898 6.3949 8.50182 6.26406 8.60749 6.15851C8.71316 6.05284 8.84406 6 9.00018 6C9.15643 6 9.28727 6.05284 9.39269 6.15851C9.49825 6.26406 9.55102 6.3949 9.55102 6.55102L9.55102 8.44898L11.449 8.44898C11.6051 8.44898 11.7359 8.50182 11.8415 8.60749C11.9472 8.71316 12 8.84406 12 9.00018C12 9.15643 11.9472 9.28727 11.8415 9.39269C11.7359 9.49824 11.6051 9.55102 11.449 9.55102L9.55102 9.55102Z" fill="#777582"/>
109
109
  </svg>
110
- `,as=`
110
+ `,cs=`
111
111
  <svg xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none">
112
112
  <path d="M1.75 10.2909L1.75 14.7692C1.75 14.8366 1.77163 14.8919 1.81488 14.9351C1.85813 14.9784 1.91344 15 1.98081 15L12.0192 15C12.0866 15 12.1419 14.9784 12.1851 14.9351C12.2284 14.8919 12.25 14.8366 12.25 14.7692L12.25 10.2909L1.75 10.2909ZM0.625 4.73081C0.625 3.93713 1.75 3.93713 1.75 4.73081L1.75 9.16594L12.25 9.16594L12.25 4.73081C12.25 3.93713 13.375 3.93713 13.375 4.73081L13.375 14.7692C13.375 15.1421 13.2422 15.4613 12.9767 15.7268C12.7112 15.9923 12.3921 16.125 12.0192 16.125L1.98081 16.125C1.60794 16.125 1.28875 15.9923 1.02325 15.7268C0.75775 15.4613 0.624999 15.1421 0.624999 14.7692L0.625 4.73081ZM3.8125 3.93731C3.8125 3.77781 3.86644 3.64425 3.97431 3.53662C4.08206 3.42887 4.21563 3.375 4.375 3.375L6.4375 3.375L6.4375 1.3125C6.4375 1.15312 6.49144 1.01956 6.59931 0.911812C6.70719 0.803937 6.84081 0.75 7.00019 0.75C7.15969 0.75 7.29325 0.803937 7.40088 0.911812C7.50863 1.01956 7.5625 1.15312 7.5625 1.3125L7.5625 3.375L9.625 3.375C9.78438 3.375 9.91794 3.42894 10.0257 3.53681C10.1336 3.64469 10.1875 3.77831 10.1875 3.93769C10.1875 4.09719 10.1336 4.23075 10.0257 4.33837C9.91794 4.44612 9.78438 4.5 9.625 4.5L7.5625 4.5L7.5625 6.5625C7.5625 6.72187 7.50856 6.8555 7.40069 6.96337C7.29281 7.07113 7.15919 7.125 6.99981 7.125C6.84031 7.125 6.70675 7.07113 6.59913 6.96337C6.49138 6.8555 6.4375 6.72187 6.4375 6.5625L6.4375 4.5L4.375 4.5C4.21563 4.5 4.08206 4.44606 3.97431 4.33819C3.86644 4.23031 3.8125 4.09669 3.8125 3.93731Z" fill="#777582"/>
113
113
  </svg>
114
- `,ss=`
114
+ `,ds=`
115
115
  <svg xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none" style="transform: rotate(180deg); display: inline-block;">
116
116
  <path d="M1.75 10.2909L1.75 14.7692C1.75 14.8366 1.77163 14.8919 1.81488 14.9351C1.85813 14.9784 1.91344 15 1.98081 15L12.0192 15C12.0866 15 12.1419 14.9784 12.1851 14.9351C12.2284 14.8919 12.25 14.8366 12.25 14.7692L12.25 10.2909L1.75 10.2909ZM0.625 4.73081C0.625 3.93713 1.75 3.93713 1.75 4.73081L1.75 9.16594L12.25 9.16594L12.25 4.73081C12.25 3.93713 13.375 3.93713 13.375 4.73081L13.375 14.7692C13.375 15.1421 13.2422 15.4613 12.9767 15.7268C12.7112 15.9923 12.3921 16.125 12.0192 16.125L1.98081 16.125C1.60794 16.125 1.28875 15.9923 1.02325 15.7268C0.75775 15.4613 0.624999 15.1421 0.624999 14.7692L0.625 4.73081ZM3.8125 3.93731C3.8125 3.77781 3.86644 3.64425 3.97431 3.53662C4.08206 3.42887 4.21563 3.375 4.375 3.375L6.4375 3.375L6.4375 1.3125C6.4375 1.15312 6.49144 1.01956 6.59931 0.911812C6.70719 0.803937 6.84081 0.75 7.00019 0.75C7.15969 0.75 7.29325 0.803937 7.40088 0.911812C7.50863 1.01956 7.5625 1.15312 7.5625 1.3125L7.5625 3.375L9.625 3.375C9.78438 3.375 9.91794 3.42894 10.0257 3.53681C10.1336 3.64469 10.1875 3.77831 10.1875 3.93769C10.1875 4.09719 10.1336 4.23075 10.0257 4.33837C9.91794 4.44612 9.78438 4.5 9.625 4.5L7.5625 4.5L7.5625 6.5625C7.5625 6.72187 7.50856 6.8555 7.40069 6.96337C7.29281 7.07113 7.15919 7.125 6.99981 7.125C6.84031 7.125 6.70675 7.07113 6.59913 6.96337C6.49138 6.8555 6.4375 6.72187 6.4375 6.5625L6.4375 4.5L4.375 4.5C4.21563 4.5 4.08206 4.44606 3.97431 4.33819C3.86644 4.23031 3.8125 4.09669 3.8125 3.93731Z" fill="#777582"/>
117
117
  </svg>
118
- `,cs=`
118
+ `,ms=`
119
119
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none" style="transform: rotate(90deg); display: inline-block;">
120
120
  <path d="M15.375 6.74998C15.375 7.12885 15.2438 7.44954 14.9813 7.71204C14.7188 7.97454 14.3981 8.10579 14.0192 8.10579L3.98081 8.10579C3.60194 8.10579 3.28125 7.97454 3.01875 7.71204C2.75625 7.44954 2.625 7.12885 2.625 6.74998L2.625 4.2116C2.625 3.83273 2.75625 3.51204 3.01875 3.24954C3.28125 2.98704 3.60194 2.85579 3.98081 2.85579L14.0192 2.85579C14.3981 2.85579 14.7188 2.98704 14.9813 3.24954C15.2438 3.51204 15.375 3.83273 15.375 4.2116L15.375 6.74998ZM15.375 13.7884C15.375 14.1672 15.2438 14.4879 14.9813 14.7504C14.7188 15.0129 14.3981 15.1442 14.0192 15.1442L3.98081 15.1442C3.60194 15.1442 3.28125 15.0129 3.01875 14.7504C2.75625 14.4879 2.625 14.1672 2.625 13.7884L2.625 11.25C2.625 10.8711 2.75625 10.5504 3.01875 10.2879C3.28125 10.0254 3.60194 9.89416 3.98081 9.89416L14.0192 9.89416C14.3981 9.89416 14.7188 10.0254 14.9813 10.2879C15.2438 10.5504 15.375 10.8711 15.375 11.25L15.375 13.7884ZM3.98081 14.0192L14.0192 14.0192C14.0769 14.0192 14.1298 13.9951 14.1778 13.947C14.2259 13.899 14.25 13.8461 14.25 13.7884L14.25 11.25C14.25 11.1922 14.2259 11.1394 14.1778 11.0914C14.1298 11.0432 14.0769 11.0192 14.0192 11.0192L3.98081 11.0192C3.92306 11.0192 3.87019 11.0432 3.82219 11.0914C3.77406 11.1394 3.75 11.1922 3.75 11.25L3.75 13.7884C3.75 13.8461 3.77406 13.899 3.82219 13.947C3.87019 13.9951 3.92306 14.0192 3.98081 14.0192Z" fill="#777582"/>
121
121
  <circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
122
122
  <path d="M9.55102 9.55102L9.55102 11.449C9.55102 11.6051 9.49818 11.7359 9.39251 11.8415C9.28684 11.9472 9.15594 12 8.99982 12C8.84357 12 8.71273 11.9472 8.60731 11.8415C8.50175 11.7359 8.44898 11.6051 8.44898 11.449L8.44898 9.55102L6.55102 9.55102C6.3949 9.55102 6.26406 9.49818 6.15851 9.39251C6.05284 9.28684 6 9.15594 6 8.99982C6 8.84357 6.05284 8.71273 6.15851 8.60731C6.26406 8.50175 6.3949 8.44898 6.55102 8.44898L8.44898 8.44898L8.44898 6.55102C8.44898 6.3949 8.50182 6.26406 8.60749 6.15851C8.71316 6.05284 8.84406 6 9.00018 6C9.15643 6 9.28727 6.05284 9.39269 6.15851C9.49825 6.26406 9.55102 6.3949 9.55102 6.55102L9.55102 8.44898L11.449 8.44898C11.6051 8.44898 11.7359 8.50182 11.8415 8.60749C11.9472 8.71316 12 8.84406 12 9.00018C12 9.15643 11.9472 9.28727 11.8415 9.39269C11.7359 9.49824 11.6051 9.55102 11.449 9.55102L9.55102 9.55102Z" fill="#777582"/>
123
123
  </svg>
124
- `,ds=`
124
+ `,us=`
125
125
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
126
126
  <path d="M15.375 6.74998C15.375 7.12885 15.2438 7.44954 14.9813 7.71204C14.7188 7.97454 14.3981 8.10579 14.0192 8.10579L3.98081 8.10579C3.60194 8.10579 3.28125 7.97454 3.01875 7.71204C2.75625 7.44954 2.625 7.12885 2.625 6.74998L2.625 4.2116C2.625 3.83273 2.75625 3.51204 3.01875 3.24954C3.28125 2.98704 3.60194 2.85579 3.98081 2.85579L14.0192 2.85579C14.3981 2.85579 14.7188 2.98704 14.9813 3.24954C15.2438 3.51204 15.375 3.83273 15.375 4.2116L15.375 6.74998ZM15.375 13.7884C15.375 14.1672 15.2438 14.4879 14.9813 14.7504C14.7188 15.0129 14.3981 15.1442 14.0192 15.1442L3.98081 15.1442C3.60194 15.1442 3.28125 15.0129 3.01875 14.7504C2.75625 14.4879 2.625 14.1672 2.625 13.7884L2.625 11.25C2.625 10.8711 2.75625 10.5504 3.01875 10.2879C3.28125 10.0254 3.60194 9.89416 3.98081 9.89416L14.0192 9.89416C14.3981 9.89416 14.7188 10.0254 14.9813 10.2879C15.2438 10.5504 15.375 10.8711 15.375 11.25L15.375 13.7884ZM3.98081 14.0192L14.0192 14.0192C14.0769 14.0192 14.1298 13.9951 14.1778 13.947C14.2259 13.899 14.25 13.8461 14.25 13.7884L14.25 11.25C14.25 11.1922 14.2259 11.1394 14.1778 11.0914C14.1298 11.0432 14.0769 11.0192 14.0192 11.0192L3.98081 11.0192C3.92306 11.0192 3.87019 11.0432 3.82219 11.0914C3.77406 11.1394 3.75 11.1922 3.75 11.25L3.75 13.7884C3.75 13.8461 3.77406 13.899 3.82219 13.947C3.87019 13.9951 3.92306 14.0192 3.98081 14.0192Z" fill="#777582"/>
127
127
  <circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
128
128
  <path d="M9.55102 9.55102L9.55102 11.449C9.55102 11.6051 9.49818 11.7359 9.39251 11.8415C9.28684 11.9472 9.15594 12 8.99982 12C8.84357 12 8.71273 11.9472 8.60731 11.8415C8.50175 11.7359 8.44898 11.6051 8.44898 11.449L8.44898 9.55102L6.55102 9.55102C6.3949 9.55102 6.26406 9.49818 6.15851 9.39251C6.05284 9.28684 6 9.15594 6 8.99982C6 8.84357 6.05284 8.71273 6.15851 8.60731C6.26406 8.50175 6.3949 8.44898 6.55102 8.44898L8.44898 8.44898L8.44898 6.55102C8.44898 6.3949 8.50182 6.26406 8.60749 6.15851C8.71316 6.05284 8.84406 6 9.00018 6C9.15643 6 9.28727 6.05284 9.39269 6.15851C9.49825 6.26406 9.55102 6.3949 9.55102 6.55102L9.55102 8.44898L11.449 8.44898C11.6051 8.44898 11.7359 8.50182 11.8415 8.60749C11.9472 8.71316 12 8.84406 12 9.00018C12 9.15643 11.9472 9.28727 11.8415 9.39269C11.7359 9.49824 11.6051 9.55102 11.449 9.55102L9.55102 9.55102Z" fill="#777582"/>
129
129
  </svg>
130
- `,ms=`
130
+ `,fs=`
131
131
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none" style="transform: rotate(180deg); display: inline-block;">
132
132
  <path d="M15.375 6.74998C15.375 7.12885 15.2438 7.44954 14.9813 7.71204C14.7188 7.97454 14.3981 8.10579 14.0192 8.10579L3.98081 8.10579C3.60194 8.10579 3.28125 7.97454 3.01875 7.71204C2.75625 7.44954 2.625 7.12885 2.625 6.74998L2.625 4.2116C2.625 3.83273 2.75625 3.51204 3.01875 3.24954C3.28125 2.98704 3.60194 2.85579 3.98081 2.85579L14.0192 2.85579C14.3981 2.85579 14.7188 2.98704 14.9813 3.24954C15.2438 3.51204 15.375 3.83273 15.375 4.2116L15.375 6.74998ZM15.375 13.7884C15.375 14.1672 15.2438 14.4879 14.9813 14.7504C14.7188 15.0129 14.3981 15.1442 14.0192 15.1442L3.98081 15.1442C3.60194 15.1442 3.28125 15.0129 3.01875 14.7504C2.75625 14.4879 2.625 14.1672 2.625 13.7884L2.625 11.25C2.625 10.8711 2.75625 10.5504 3.01875 10.2879C3.28125 10.0254 3.60194 9.89416 3.98081 9.89416L14.0192 9.89416C14.3981 9.89416 14.7188 10.0254 14.9813 10.2879C15.2438 10.5504 15.375 10.8711 15.375 11.25L15.375 13.7884ZM3.98081 14.0192L14.0192 14.0192C14.0769 14.0192 14.1298 13.9951 14.1778 13.947C14.2259 13.899 14.25 13.8461 14.25 13.7884L14.25 11.25C14.25 11.1922 14.2259 11.1394 14.1778 11.0914C14.1298 11.0432 14.0769 11.0192 14.0192 11.0192L3.98081 11.0192C3.92306 11.0192 3.87019 11.0432 3.82219 11.0914C3.77406 11.1394 3.75 11.1922 3.75 11.25L3.75 13.7884C3.75 13.8461 3.77406 13.899 3.82219 13.947C3.87019 13.9951 3.92306 14.0192 3.98081 14.0192Z" fill="#777582"/>
133
133
  <circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
134
134
  <path d="M9.55102 9.55102L9.55102 11.449C9.55102 11.6051 9.49818 11.7359 9.39251 11.8415C9.28684 11.9472 9.15594 12 8.99982 12C8.84357 12 8.71273 11.9472 8.60731 11.8415C8.50175 11.7359 8.44898 11.6051 8.44898 11.449L8.44898 9.55102L6.55102 9.55102C6.3949 9.55102 6.26406 9.49818 6.15851 9.39251C6.05284 9.28684 6 9.15594 6 8.99982C6 8.84357 6.05284 8.71273 6.15851 8.60731C6.26406 8.50175 6.3949 8.44898 6.55102 8.44898L8.44898 8.44898L8.44898 6.55102C8.44898 6.3949 8.50182 6.26406 8.60749 6.15851C8.71316 6.05284 8.84406 6 9.00018 6C9.15643 6 9.28727 6.05284 9.39269 6.15851C9.49825 6.26406 9.55102 6.3949 9.55102 6.55102L9.55102 8.44898L11.449 8.44898C11.6051 8.44898 11.7359 8.50182 11.8415 8.60749C11.9472 8.71316 12 8.84406 12 9.00018C12 9.15643 11.9472 9.28727 11.8415 9.39269C11.7359 9.49824 11.6051 9.55102 11.449 9.55102L9.55102 9.55102Z" fill="#777582"/>
135
135
  </svg>
136
- `,us=`
136
+ `,ps=`
137
137
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
138
138
  <path d="M3 9H3.00666M5.99833 9H6.005M11.995 9H12.0017M8.99667 9H9.00333M14.9933 9H15M14.9933 15V14.4667C14.9933 13.7199 14.9933 13.3465 14.8481 13.0613C14.7204 12.8105 14.5165 12.6065 14.2657 12.4787C13.9807 12.3333 13.6075 12.3333 12.8612 12.3333H5.13215C4.38583 12.3333 4.01266 12.3333 3.72761 12.4787C3.47687 12.6065 3.273 12.8105 3.14525 13.0613C3 13.3465 3 13.7199 3 14.4667V15M14.9933 3V3.53333C14.9933 4.28007 14.9933 4.65344 14.8481 4.93865C14.7204 5.18954 14.5165 5.39351 14.2657 5.52134C13.9807 5.66667 13.6075 5.66667 12.8612 5.66667H5.13215C4.38583 5.66667 4.01266 5.66667 3.72761 5.52134C3.47686 5.39351 3.273 5.18954 3.14525 4.93865C3 4.65344 3 4.28007 3 3.53333V3" stroke="#777582" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
139
139
  </svg>
140
- `,fs=`
140
+ `,gs=`
141
141
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none" style="transform: rotate(90deg); display: inline-block;">
142
142
  <path d="M3 9H3.00666M5.99833 9H6.005M11.995 9H12.0017M8.99667 9H9.00333M14.9933 9H15M14.9933 15V14.4667C14.9933 13.7199 14.9933 13.3465 14.8481 13.0613C14.7204 12.8105 14.5165 12.6065 14.2657 12.4787C13.9807 12.3333 13.6075 12.3333 12.8612 12.3333H5.13215C4.38583 12.3333 4.01266 12.3333 3.72761 12.4787C3.47687 12.6065 3.273 12.8105 3.14525 13.0613C3 13.3465 3 13.7199 3 14.4667V15M14.9933 3V3.53333C14.9933 4.28007 14.9933 4.65344 14.8481 4.93865C14.7204 5.18954 14.5165 5.39351 14.2657 5.52134C13.9807 5.66667 13.6075 5.66667 12.8612 5.66667H5.13215C4.38583 5.66667 4.01266 5.66667 3.72761 5.52134C3.47686 5.39351 3.273 5.18954 3.14525 4.93865C3 4.65344 3 4.28007 3 3.53333V3" stroke="#777582" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
143
143
  </svg>
@@ -145,7 +145,7 @@ __useblocks__.define("js/iframe.js",["require","exports","module","js/rolldown-r
145
145
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
146
146
  <path d="M7 3H11M3 5H15M13.6667 5L13.1991 12.0129C13.129 13.065 13.0939 13.5911 12.8667 13.99C12.6666 14.3412 12.3648 14.6235 12.0011 14.7998C11.588 15 11.0607 15 10.0062 15H7.9938C6.93927 15 6.41202 15 5.99889 14.7998C5.63517 14.6235 5.33339 14.3412 5.13332 13.99C4.90607 13.5911 4.871 13.065 4.80086 12.0129L4.33333 5" stroke="#777582" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
147
147
  </svg>
148
- `;function ps(e,o,t,n){const r=document.querySelector(".table-menu"),i=r?.closest("table");if(!i)return;const l=i?.querySelector(`.${a.CLASS_FOR_BASIC_CELL}`),s=Rt(i),{row:c}=Vo(s,a.CLASS_FOR_BASIC_CELL),{row:d,isOverlapped:u}=Qn(s,a.CLASS_FOR_BASIC_CELL),{isOverlapped:g}=er(s,a.CLASS_FOR_BASIC_CELL);if(!i||!l)return;const m={addBottomRow:r.querySelector('[data-id="add-bottom-row"]'),addTopRow:r.querySelector('[data-id="add-top-row"]'),removeRow:r.querySelector('[data-id="remove-row"]'),mergeTopCell:r.querySelector('[data-id="merge-top-cell"]'),mergeBottomCell:r.querySelector('[data-id="merge-bottom-cell"]'),splitHorizontalCell:r.querySelector('[data-id="split-horizontal-cell"]'),addLeftColumn:r.querySelector('[data-id="add-left-column"]'),addRightColumn:r.querySelector('[data-id="add-right-column"]'),mergeRightCell:r.querySelector('[data-id="merge-right-cell"]'),mergeLeftCell:r.querySelector('[data-id="merge-left-cell"]'),splitVerticalCell:r.querySelector('[data-id="split-vertical-cell"]'),removeColumn:r.querySelector('[data-id="remove-column"]')};m.addBottomRow&&(m.addBottomRow.style.display="block"),m.addTopRow&&(m.addTopRow.style.display="block"),m.removeRow&&(m.removeRow.style.display="block"),m.mergeTopCell&&(m.mergeTopCell.style.display="block"),m.mergeBottomCell&&(m.mergeBottomCell.style.display="block"),m.splitHorizontalCell&&(m.splitHorizontalCell.style.display="none"),m.addLeftColumn&&(m.addLeftColumn.style.display="block"),m.addRightColumn&&(m.addRightColumn.style.display="block"),m.mergeRightCell&&(m.mergeRightCell.style.display="block"),m.mergeLeftCell&&(m.mergeLeftCell.style.display="block"),m.splitVerticalCell&&(m.splitVerticalCell.style.display="none"),m.removeColumn&&(m.removeColumn.style.display="block"),l.getAttribute("rowspan")&&m.splitHorizontalCell&&(m.splitHorizontalCell.style.display="block"),l.getAttribute("colspan")&&m.splitVerticalCell&&(m.splitVerticalCell.style.display="block"),e&&(m.mergeBottomCell&&(m.mergeBottomCell.style.display="none"),m.mergeRightCell&&(m.mergeRightCell.style.display="none"),m.mergeLeftCell&&(m.mergeLeftCell.style.display="none"),m.addTopRow&&(m.addTopRow.style.display="none"),m.addBottomRow&&(m.addBottomRow.style.display="none"),m.removeRow&&(m.removeRow.style.display="none")),o&&(m.mergeTopCell&&(m.mergeTopCell.style.display="none"),m.mergeRightCell&&(m.mergeRightCell.style.display="none"),m.mergeLeftCell&&(m.mergeLeftCell.style.display="none"),m.addTopRow&&(m.addTopRow.style.display="none"),m.addBottomRow&&(m.addBottomRow.style.display="none"),m.removeRow&&(m.removeRow.style.display="none")),t&&(m.mergeTopCell&&(m.mergeTopCell.style.display="none"),m.mergeBottomCell&&(m.mergeBottomCell.style.display="none"),m.mergeRightCell&&(m.mergeRightCell.style.display="none"),m.addLeftColumn&&(m.addLeftColumn.style.display="none"),m.addRightColumn&&(m.addRightColumn.style.display="none"),m.removeColumn&&(m.removeColumn.style.display="none")),n&&(m.mergeTopCell&&(m.mergeTopCell.style.display="none"),m.mergeBottomCell&&(m.mergeBottomCell.style.display="none"),m.mergeLeftCell&&(m.mergeLeftCell.style.display="none"),m.addLeftColumn&&(m.addLeftColumn.style.display="none"),m.addRightColumn&&(m.addRightColumn.style.display="none"),m.removeColumn&&(m.removeColumn.style.display="none")),g&&m.removeColumn&&(m.removeColumn.style.display="none"),u&&d===c&&m.removeRow&&(m.removeRow.style.display="none"),l.getAttribute("colspan")&&(m.mergeTopCell&&(m.mergeTopCell.style.display="none"),m.mergeBottomCell&&(m.mergeBottomCell.style.display="none")),l.getAttribute("rowspan")&&(m.mergeLeftCell&&(m.mergeLeftCell.style.display="none"),m.mergeRightCell&&(m.mergeRightCell.style.display="none"))}var gs={INSERT_COLUMN_BEFORE_TABLE:"Insert column before",INSERT_COLUMN_AFTER_TABLE:"Insert column after",MERGE_RIGHT_CELL_TABLE:"Merge right",MERGE_LEFT_CELL_TABLE:"Merge left",SPLIT_CELL_TABLE:"Split cell",REMOVE_COLUMN_TABLE:"Remove column",INSERT_ROW_BEFORE_TABLE:"Insert row before",INSERT_ROW_AFTER_TABLE:"Insert row after",MERGE_TOP_CELL_TABLE:"Merge top",MERGE_BOTTOM_CELL_TABLE:"Merge bottom",REMOVE_ROW_TABLE:"Remove row",EDIT_ATOM:"Edit"},Ce=()=>window.Locale||gs;function bs(e,o){e.forEach(t=>{o.querySelectorAll(`.${t}`).forEach(n=>n.classList.remove(t))})}function hs(e,o){const t=e?.tagName==="TD"?e?.querySelector("div"):e?.closest("div")?e?.closest("div"):e;if(!e.closest(".em-element-custom-table")||t?.tagName!=="DIV")return!1;document.querySelectorAll(`.${a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR}`).forEach(y=>{y.classList.remove(a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR)});const n=[a.CLASS_FOR_BASIC_ROW,a.CLASS_FOR_BASIC_CELL];let r=!1,i=!1;const l=t,s=document.querySelector(`.${a.CLASS_FOR_BASIC_CELL}`),c=document.querySelector(".table-menu");s&&s.classList.remove(a.CLASS_FOR_BASIC_CELL),c&&c.remove();const d=l.closest(".em-element-custom-table"),u=d.closest('[em="block"]'),g=a.addElement({targetElement:d,insertType:"append",className:"of-atom table-menu",style:"width: 48px; height: 28px; display: flex; position: absolute; right: 0; top: -30px; background: #FFDCC7; border-radius: 6px; box-shadow: 0 2px 5px rgba(0,0,0,0.2); pointer-events: auto; z-index: 1001;"});let m=!1,f=1;const p=()=>({isDirectionUP:a.state.get("isDirectionUP"),isDirectionDOWN:a.state.get("isDirectionDOWN"),isDirectionLEFT:a.state.get("isDirectionLEFT"),isDirectionRIGHT:a.state.get("isDirectionRIGHT"),actualTargetCount:a.state.get("actualTargetCount")});d.addEventListener("mousedown",y=>{const E=y.target.tagName.toUpperCase();if(y.button===0&&E!=="UL"&&E!=="LI"&&E!=="SVG"&&E!=="PATH"&&E!=="CIRCLE"){m=!0;const S=d.querySelector(`.${a.CLASS_FOR_BASIC_CELL}`);document.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`)?.forEach(v=>{v.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL),S?.classList.remove(a.CLASS_FOR_BASIC_CELL)})}}),d.addEventListener("mouseup",y=>{m=!1,y.target.closest("td")?.classList.contains("remove-basic-cell")&&a.state.update({isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1})}),d.addEventListener("mouseover",y=>{const E=d.querySelector(`.${a.CLASS_FOR_BASIC_CELL}`);f=d.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).length,f=f===0?1:f;const S=y.target;if(m&&S.closest("TD")&&E){const v=S.closest("TD");d.querySelectorAll(`.${a.TEMPORARY_CLASS}`).forEach(z=>z.classList.remove(a.TEMPORARY_CLASS)),f===1&&d.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).forEach(z=>z.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL)),v.classList.add(a.TEMPORARY_CLASS);const C=v.closest(".em-element-custom-table");if(!C)return;let L=Rt(C);const w=Vo(L,a.CLASS_FOR_BASIC_CELL);if(!w)return;const{row:A,col:M}=w,{row:R,col:$,isOverlapped:J}=Qn(L,a.CLASS_FOR_BASIC_CELL),{row:_,col:G,isOverlapped:H}=er(L,a.CLASS_FOR_BASIC_CELL);!r&&!i&&f===1&&!(J||H)&&(C.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).forEach(z=>z.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL)),v.classList.add(a.CLASS_BACKGROUND_ACTIVE_CELL));const P=Vo(L,a.TEMPORARY_CLASS);if(!P)return;const{row:q,col:O}=P;if(C.querySelectorAll(`.${a.TEMPORARY_CLASS}`).forEach(z=>z.classList.remove(a.TEMPORARY_CLASS)),A!==q&&M!==O){C.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).forEach(z=>z.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL)),r=!1,i=!1;return}const{isDirectionUP:Q,isDirectionDOWN:re,isDirectionLEFT:x,isDirectionRIGHT:k}=p();if(!r&&!i&&!v.classList.contains("remove-basic-cell")&&(a.state.update({isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1}),A===q?(r=!0,i=!1,M>O&&a.state.set("isDirectionLEFT",!0),M<O&&a.state.set("isDirectionRIGHT",!0)):M===O&&(i=!0,r=!1,A>q&&a.state.set("isDirectionUP",!0),A<q&&a.state.set("isDirectionDOWN",!0))),A===q&&(re||Q)||M===O&&(k||x)||M===O&&A===q){a.state.update({isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1}),r=!1,i=!1;return}if(J&&$!==null){const{isDirectionRIGHT:z,isDirectionLEFT:ee}=p();if(z&&$-O<=0&&$>M){C.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).forEach(Y=>Y.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL));return}if(ee&&O-$<=0&&$<M){C.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).forEach(Y=>Y.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL));return}}if(H&&_!==null){const{isDirectionDOWN:z,isDirectionUP:ee}=p();if(z&&_-q<=0&&_>A){C.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).forEach(Y=>Y.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL));return}if(ee&&q-_<=0&&_<A){C.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).forEach(Y=>Y.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL));return}}if(A===q&&r){i=!1;const{isDirectionRIGHT:z,isDirectionLEFT:ee}=p();if(z){const Y=O-M;if(a.state.set("actualTargetCount",no(L,q,O,A,M,!0)),Y<0){a.state.set("isDirectionRIGHT",!1),r=!1,i=!1;return}C.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).forEach(ie=>ie.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL)),rr(`.${a.CLASS_FOR_BASIC_CELL}`,a.state.get("actualTargetCount"),a.CLASS_BACKGROUND_ACTIVE_CELL,!0)}if(ee){const Y=M-O;if(a.state.set("actualTargetCount",no(L,A,M,q,O,!0)),Y<0){a.state.set("isDirectionLEFT",!1),r=!1,i=!1;return}C.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).forEach(ie=>ie.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL)),rr(`.${a.CLASS_FOR_BASIC_CELL}`,a.state.get("actualTargetCount"),a.CLASS_BACKGROUND_ACTIVE_CELL,!1)}C.querySelectorAll(`.${a.TEMPORARY_CLASS}`).forEach(Y=>Y.classList.remove(a.TEMPORARY_CLASS))}if(M===O&&i){r=!1;const{isDirectionDOWN:z,isDirectionUP:ee}=p();if(z){const Y=q-A;if(a.state.set("actualTargetCount",no(L,q,O,A,M,!1)),Y<0){a.state.set("isDirectionDOWN",!1),r=!1,i=!1;return}C.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).forEach(ie=>ie.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL)),ir(`.${a.CLASS_FOR_BASIC_CELL}`,a.state.get("actualTargetCount"),a.CLASS_BACKGROUND_ACTIVE_CELL,!0)}if(ee){const Y=A-q;a.state.set("actualTargetCount",no(L,A,M,q,O,!1)),Y<0&&(a.state.set("isDirectionUP",!1),r=!1,i=!1),C.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).forEach(ie=>ie.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL)),ir(`.${a.CLASS_FOR_BASIC_CELL}`,a.state.get("actualTargetCount"),a.CLASS_BACKGROUND_ACTIVE_CELL,!1)}C.querySelectorAll(`.${a.TEMPORARY_CLASS}`).forEach(Y=>Y.classList.remove(a.TEMPORARY_CLASS))}const se=C.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`);v.classList.contains("remove-basic-cell")&&se?.length>1&&(se?.forEach(z=>{z.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL)}),r=!1,i=!1)}}),ys(g,d,u,o,n);const b=l.closest("td");b.classList.add(a.CLASS_FOR_BASIC_CELL);function h(y){const E=y.target;!u.contains(E)&&!g.contains(E)&&(g.remove(),b&&(document.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`)?.forEach(S=>{S.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL)}),document.querySelectorAll(`.${a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR}`).forEach(S=>{S.classList.remove(a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR)}),b.classList.remove(a.CLASS_FOR_BASIC_CELL)),document.removeEventListener("click",h))}return document.addEventListener("click",h),!0}function ys(e,o,t,n,r){const i=ps;function l(y){const E=y.querySelector("ul"),S=y.getAttribute("data-open")==="true",v=n.target.closest("td")?.classList.contains(a.CLASS_FOR_BASIC_CELL),C=o.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`);v&&C?.length===0&&a.state.update({isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1});const{isDirectionUP:L,isDirectionDOWN:w,isDirectionLEFT:A,isDirectionRIGHT:M}={isDirectionUP:a.state.get("isDirectionUP"),isDirectionDOWN:a.state.get("isDirectionDOWN"),isDirectionLEFT:a.state.get("isDirectionLEFT"),isDirectionRIGHT:a.state.get("isDirectionRIGHT")};i(L,w,A,M),e.querySelectorAll("[data-open]").forEach(R=>{R!==y&&R.getAttribute("data-open")==="true"&&(R.setAttribute("data-open","false"),R.querySelector("ul").style.display="none")}),S||(y.setAttribute("data-open","true"),E.style.display="block")}function s(y){const E=y.querySelector("ul");y.getAttribute("data-open")==="true"&&(y.setAttribute("data-open","false"),E.style.display="none")}function c(y){y.stopPropagation(),y.preventDefault();const E=y.target,S=E.closest("li"),v=S?.getAttribute("data-id"),C=S?.closest("tr"),L=S?.closest("td");C?.classList.add(a.CLASS_FOR_BASIC_ROW),L?.classList.add(a.CLASS_FOR_BASIC_CELL);const w=E.closest("table");if(!S||!w)return;const A=Rt(w),M=w.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).length;switch(v){case"add-bottom-row":{const _=Kn(A,a.CLASS_FOR_BASIC_CELL,!1);w.innerHTML=Se(_);break}case"add-top-row":{const _=Kn(A,a.CLASS_FOR_BASIC_CELL,!0);w.innerHTML=Se(_);break}case"remove-row":{const _=Oa(A,a.CLASS_FOR_BASIC_CELL);w.innerHTML=Se(_);break}case"merge-top-cell":{const _=M===0?Jn(A,a.CLASS_FOR_BASIC_CELL,!0,M+1):or(A,a.CLASS_FOR_BASIC_CELL,a.CLASS_BACKGROUND_ACTIVE_CELL);w.innerHTML=Se(_);break}case"merge-bottom-cell":{const _=M===0?Jn(A,a.CLASS_FOR_BASIC_CELL,!1,M+1):or(A,a.CLASS_FOR_BASIC_CELL,a.CLASS_BACKGROUND_ACTIVE_CELL);w.innerHTML=Se(_);break}case"split-horizontal-cell":{const _=Fa(A,a.CLASS_FOR_BASIC_CELL);w.innerHTML=Se(_);break}case"add-left-column":{const _=Xn(A,a.CLASS_FOR_BASIC_CELL,!0);w.innerHTML=Se(_);break}case"add-right-column":{const _=Xn(A,a.CLASS_FOR_BASIC_CELL,!1);w.innerHTML=Se(_);break}case"merge-right-cell":{const _=M===0?Zn(A,a.CLASS_FOR_BASIC_CELL,!1,M+1):tr(A,a.CLASS_FOR_BASIC_CELL,a.CLASS_BACKGROUND_ACTIVE_CELL);w.innerHTML=Se(_);break}case"merge-left-cell":{const _=M===0?Zn(A,a.CLASS_FOR_BASIC_CELL,!0,M+1):tr(A,a.CLASS_FOR_BASIC_CELL,a.CLASS_BACKGROUND_ACTIVE_CELL);w.innerHTML=Se(_);break}case"split-vertical-cell":{const _=Da(A,a.CLASS_FOR_BASIC_CELL);w.innerHTML=Se(_);break}case"remove-column":{const _=xa(A,a.CLASS_FOR_BASIC_CELL);w.innerHTML=Se(_);break}}const R=S.closest("ul");R.parentElement.setAttribute("data-open","false"),R.style.display="none",e.querySelectorAll('[data-open="true"]').forEach(_=>{_.setAttribute("data-open","false"),_.querySelector("ul").style.display="none"});const $=document.querySelector(`.${a.CLASS_FOR_BASIC_CELL}`),J=document.querySelector(".table-menu");$?.classList.remove(a.CLASS_FOR_BASIC_CELL),J?.remove(),document.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).forEach(_=>{_.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL)}),bs(r,w),a.commit()}function d(y){l(y.currentTarget)}function u(y){s(y.currentTarget)}const g=a.addElement({targetElement:e,insertType:"append",style:"cursor: pointer; flex: 1; margin: auto; padding-top: 2px;",className:"em-element-editor-widget-edit",HTMLcontent:lr,title:"Колонки"});g.setAttribute("data-open","false");const m=a.addElement({targetElement:g,insertType:"append",tag:"ul",style:a.styleMenuElement}),f={targetElement:m,insertType:"append",tag:"li",className:"em-element-editor-widget-group",style:a.styleMenuElementList};a.addElement({...f,HTMLcontent:lr,title:"",style:"padding: 3px; cursor: pointer; font-size: 14px; background-color: #E2DEDD; border-radius: 5px; margin: 1px; margin-top: -4px","data-id":"menu-item"}),a.addElement({...f,HTMLcontent:rs,title:Ce().INSERT_COLUMN_BEFORE_TABLE,"data-id":"add-left-column"}),a.addElement({...f,HTMLcontent:is,title:Ce().INSERT_COLUMN_AFTER_TABLE,"data-id":"add-right-column"}),a.addElement({...f,HTMLcontent:cs,title:Ce().MERGE_RIGHT_CELL_TABLE,"data-id":"merge-right-cell"}),a.addElement({...f,HTMLcontent:ls,title:Ce().MERGE_LEFT_CELL_TABLE,"data-id":"merge-left-cell"}),a.addElement({...f,HTMLcontent:fs,title:Ce().SPLIT_CELL_TABLE,"data-id":"split-vertical-cell"}),a.addElement({...f,HTMLcontent:sr,title:Ce().REMOVE_COLUMN_TABLE,"data-id":"remove-column"}),m.addEventListener("click",c),g.addEventListener("mouseenter",d),g.addEventListener("mouseleave",u);const p=a.addElement({targetElement:e,insertType:"append",style:"cursor: pointer; flex: 1; margin: auto; padding-top: 2px;",className:"em-element-editor-widget-clone",HTMLcontent:ar,title:"Строки"});p.setAttribute("data-open","false");const b=a.addElement({targetElement:p,insertType:"append",tag:"ul",style:a.styleMenuElement}),h={targetElement:b,insertType:"append",tag:"li",className:"em-element-editor-widget-group",style:a.styleMenuElementList};a.addElement({...h,HTMLcontent:ar,title:Ce().EDIT_ATOM||"Edit",style:"padding: 3px; cursor: pointer; font-size: 14px; background-color: #E2DEDD; border-radius: 5px; margin: 1px; margin-top: -4px"}),a.addElement({...h,HTMLcontent:as,title:Ce().INSERT_ROW_BEFORE_TABLE,"data-id":"add-top-row"}),a.addElement({...h,HTMLcontent:ss,title:Ce().INSERT_ROW_AFTER_TABLE,"data-id":"add-bottom-row"}),a.addElement({...h,HTMLcontent:ds,title:Ce().MERGE_TOP_CELL_TABLE,"data-id":"merge-top-cell"}),a.addElement({...h,HTMLcontent:ms,title:Ce().MERGE_BOTTOM_CELL_TABLE,"data-id":"merge-bottom-cell"}),a.addElement({...h,HTMLcontent:us,title:Ce().SPLIT_CELL_TABLE,"data-id":"split-horizontal-cell"}),a.addElement({...h,HTMLcontent:sr,title:Ce().REMOVE_ROW_TABLE,"data-id":"remove-row"}),b.addEventListener("click",c),p.addEventListener("mouseenter",d),p.addEventListener("mouseleave",u)}function Es(e,o,t){const n=e.closest("div"),r=e.closest("em-replace");if(!r||!n||!t.isClickAtEndOfEmReplace(o,r))return!1;const i=`em-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r.setAttribute("data-em-id",i);const l=t.getOrCreateAfterSpan(r),s=`temp-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;l.setAttribute("data-cursor-target",s),n.innerHTML=n.innerHTML;const c=n.querySelector(`[data-em-id="${i}"]`);if(c){c.removeAttribute("data-em-id");let d=c.nextElementSibling;(!d||!d.hasAttribute("data-cursor-target"))&&(d=n.querySelector(`[data-cursor-target="${s}"]`)),d&&(d.removeAttribute("data-cursor-target"),d.removeAttribute("style"),n.getAttribute("contenteditable")==="true"&&n.focus(),setTimeout(()=>{t.setCursorInsideSpan(d),t._wrapEditor(d,!0),t.commit()},10))}return t.commit(),!0}function Ss(e,o){document.querySelectorAll("[em-optimise-error]").forEach(t=>{t.removeAttribute("em-optimise-error")}),document.querySelectorAll("img").forEach((t,n)=>{t.setAttribute("em-optimise",`image_${n}`)}),o.commit()}function Cs(e,o){document.querySelectorAll("[em-optimise-error]").forEach(t=>{t.removeAttribute("em-optimise-error")}),document.querySelectorAll("a[href]").forEach((t,n)=>{t.setAttribute("em-optimise",`link_${n}`)}),o.commit()}function vs(e,o){const t=e.data.settings?.elementId;if(!t)return;const n=document.querySelector(`[em-optimise="${t}"]`);n&&(e.data.settings?.isError&&(n.setAttribute("em-optimise-error","true"),o.commit()),o.messageService.send({operation:"application_scroll-to",settings:{value:n.getBoundingClientRect().top+o.iframeOffsetTop-o.previewHeight/2}}),o.setCursorPosition(n),o.applicationElementSettingsSet({elem:n}))}function As(e,o){const t=e.data.settings?.elementId;if(!t)return;const n=document.querySelector(`[em-optimise="${t}"]`);n&&(o.messageService.send({operation:"application_scroll-to",settings:{value:n.getBoundingClientRect().top+o.iframeOffsetTop-o.previewHeight/2}}),o.setCursorPosition(n),o.applicationElementSettingsSet({elem:n}),e.data.settings?.isError&&n.setAttribute("em-optimise-error","true"),o.commit())}var Ts={sandbox_set_attr_to_images:Ss,sandbox_set_attr_to_links:Cs,sandbox_set_position_to_img:vs,sandbox_set_position_to_link:As},Ls="https://emcdn.ru/141965/231106_18_hwUXhU0.png";function ro(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.remove():e.elem.previousSibling&&ro({elem:e.elem.previousSibling})}function io(e){if(!e.elem)return!1;if(e.elem.parentElement?.tagName==="SECTION"||e.elem.classList.contains("em-narrow-table")&&Array.from(e.elem.childNodes).every(t=>t.nodeType===Node.TEXT_NODE))return e.elem.innerHTML="",!1;e.elem.querySelector(".em-element-editor")&&e.elem.querySelector(".em-element-editor")?.remove(),e.elem.querySelector(".em-element-path")&&e.elem.querySelectorAll(".em-element-path").forEach(t=>t.remove()),e.elem.querySelector(".em-element-block-add")&&e.elem.querySelectorAll(".em-element-block-add").forEach(t=>t.remove()),e.elem.querySelector(".em-vindent-paddingTop, .em-vindent-paddingRight, .em-vindent-paddingBottom, .em-vindent-paddingLeft")&&e.elem.querySelectorAll(".em-vindent-paddingTop, .em-vindent-paddingRight, .em-vindent-paddingBottom, .em-vindent-paddingLeft").forEach(t=>t.remove());const o=e.elem.parentElement;if(e.elem.classList.contains("em-mob-wrap")||e.elem.classList.contains("noresp-em-mob-wrap"))e.elem.innerHTML.trim()===""&&(e.elem.parentElement?.querySelectorAll(":scope > .em-mob-wrap, :scope > .noresp-em-mob-wrap").length>1?e.elem.innerHTML="":(e.elem.remove(),io({elem:o})));else if(e.elem.innerHTML.trim()==="")ro({elem:e.elem}),e.elem.remove(),io({elem:o});else if(o&&!o.querySelector('div[style*="display"]')){for(const t of e.elem.childNodes)t.nodeName==="#text"&&t.textContent?.trim()===""?(ro({elem:t}),t.textContent=""):t.nodeName==="#comment"&&t.textContent?.indexOf("mso")!==-1&&(ro({elem:t}),t.remove());e.elem.innerHTML.trim()===""&&io({elem:e.elem})}return!0}function ws(e){const o=document.querySelector("[em-edit]");if(!o)return;const t=e.getElementParent(o);let n=o.parentNode;const r=o.closest("editor");if(e.setCursorPosition(t),o.classList.contains("em-code")){const i=e.getVariableByIcon?.(o);i&&(i.parentNode?.removeChild(i),o.remove())}else if(o.tagName==="TD"&&o.innerHTML===""&&o.hasAttribute("height")){const i=o.closest("table");if(i){const l=i.previousSibling;l&&l?.textContent?.trim()===""&&l.remove(),i.remove()}}else if(o.closest(".em-element-resize-img-container"))n=o.closest(".em-element-resize-img-container").parentNode,o.closest("td")?.querySelector("editor")?.innerHTML===""&&o.closest("td")?.querySelector("editor")?.remove(),o.closest(".em-element-resize-img-container")?.remove();else if(o.closest('[em="atom"]')){const i=o.closest(".em-mob-wrap, .noresp-em-mob-wrap"),l=o.closest('[em="atom"]');o.tagName==="TD"&&o.previousElementSibling===null&&o.nextElementSibling===null?(n=l.parentNode,l?.remove()):(n=o.closest("td"),o.remove());const s=!!i&&Array.from(i.querySelectorAll('[em="atom"]')).some(c=>c!==l);o.tagName!=="TD"&&i&&!s&&i.textContent?.trim()===""&&(i.textContent="")}else{o.remove();const i=o.previousSibling;i&&i?.textContent?.trim()===""&&i.remove(),o.remove()}r&&r.remove(),io({elem:n}),e.commit(),e.messageService.send({operation:"application_element_settings_close"})}function ks(e,o){const t=document.querySelector("[em-edit]");if(t)if(e.action==="add_p"){let n=null;if(["DIV","P","TD","EDITOR","B","STRONG","SPAN","I","EM","A"].includes(t.tagName)){if(t.closest("div")?.style.fontFamily?n=t.closest("div"):t.closest("p")?.style.fontFamily?n=t.closest("p"):n=t,n&&o.HTMLDocument){const r=o.HTMLDocument.getOuterHtml(n);n.closest("table")?.getAttribute("em")==="atom"?n.closest("table")?.insertAdjacentHTML("afterend",`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom"><tr><td style="padding-bottom: 10px;">${r}</td></tr></table>`):n.insertAdjacentHTML("afterend",`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom"><tr><td style="padding-bottom: 10px;">${r}</td></tr></table>`)}o.commit()}o.setCursorPosition(t)}else if(e.action==="add_img"){if(window.getSelection){const n=document.createElement("img");n.setAttribute("src",Ls),n.setAttribute("width","28"),n.setAttribute("border","0"),n.setAttribute("alt",""),n.style.display="inline-block",n.style.verticalAlign="text-bottom";const r=window.getSelection();if(r?.getRangeAt&&r.rangeCount){const i=r.getRangeAt(0);i.deleteContents(),i.insertNode(n)}else document.querySelector("[em-edit]")?.prepend(n);o.commit()}}else(e.action==="typograf"||e.action==="typograf_all")&&_s(e,o).catch(n=>{})}async function _s(e,o){const{default:t}=await a.__vitePreload(async()=>{const{default:c}=await Promise.resolve().then(()=>Lo("./typograf.all.BbXdyfMT.js")).then(d=>d.typograf_all_exports);return{default:c}},void 0,{}.url);let n=document.querySelector("[em-edit]")?.closest("div")||document.querySelector("[em-edit]")?.closest("editor")||null;const r=e.action==="typograf"?n?.innerText:document.body.innerText,i=o.hasRussianText?.(r||"")??!1,l=new t({locale:[e.locale==="ru_RU"||i?"ru":"en-US"],htmlEntity:{type:"name",onlyInvisible:!0,list:["nbsp","shy","mdash","ndash","laquo","raquo"]}});l.disableRule("ru/punctuation/*"),l.disableRule("common/punctuation/*"),l.enableRule("common/punctuation/quote"),l.setSetting("common/punctuation/quote","ru",{left:"«",right:"»",removeDuplicateQuotes:!0}),l.setSetting("common/punctuation/quote","en-US",{left:'"',right:'"',removeDuplicateQuotes:!0}),l.disableRule("ru/dash/kakto"),l.disableRule("ru/dash/taki"),l.disableRule("ru/dash/izpod"),l.disableRule("ru/dash/izza"),l.disableRule("ru/dash/ka"),l.disableRule("ru/dash/to"),l.disableRule("ru/dash/koe"),l.disableRule("common/nbsp/nowrap"),l.disableRule("common/nbsp/dpi"),l.disableRule("common/nbsp/afterParagraphMark"),l.enableRule("common/nbsp/afterNumber"),l.disableRule("common/html/quot"),l.disableRule("ru/date/*"),l.disableRule("common/number/mathSigns"),l.disableRule("ru/number/ordinals"),l.disableRule("ru/number/comma"),l.disableRule("ru/symbols/NN"),l.disableRule("common/symbols/cf"),l.disableRule("ru/other/phone-number"),l.addSafeTag('<[^>]+class="preheader"[^>]*>',"</[^>]+>"),l.addSafeTag("<!--","-->");function s(c){let d=l.execute(c);return d=d.replace(/\b(\d{1,3}(?:[ \u00A0]\d{3})*(?:[.,]\d+)?)\b/g,function(u){return u.replace(/[ \u00A0]/g,"").replace(/\B(?=(\d{3})+(?!\d))/g,"&nbsp;")}),d=d.replace(/(\d[\d&nbsp;]*[.,]?\d+)(?:\s|&nbsp;)?(?=(?:руб(?:\.|лей)?|р\.|долл(?:\.|аров)?|\$|₽|€|£|¥|USD|EUR|RUB))/gi,"$1&nbsp;"),d=d.replace(/(\d[\d&nbsp;]*[.,]?\d+)&nbsp;(руб(?:\.|лей)?|р\.|долл(?:\.|аров)?|\$|₽|€|£|¥|USD|EUR|RUB)/gi,"$1&nbsp;$2"),d}if(e.action==="typograf_all"){const c=document.body;c&&(c.innerHTML=s(c.innerHTML))}else n?.parentElement&&(n=n.parentElement,n?.parentElement&&(n.parentElement.innerHTML=s(n.parentElement.innerHTML)));document.querySelectorAll(".em-element-resize-img-container").forEach(c=>c.replaceWith(...c.childNodes)),document.querySelectorAll(".em-element-img-change-group").forEach(c=>c.remove()),document.querySelectorAll("editor").forEach(c=>c.replaceWith(...c.childNodes)),o.commit()}function cr(e){return e?e.nodeType===Node.ELEMENT_NODE?e:e.parentElement:null}function Uo(e){if(!e||e.tagName!=="A")return!1;const o=e.getAttribute("style");if(!o||!o.includes("display"))return!1;const t=e.style.display;return!(t!=="block"&&t!=="inline-block"||o.includes("mso-style-priority"))}function Ns(e,o){const t=e.closest("a");if(Uo(t))return t;if(!o)return null;const n=cr(o.anchorNode)?.closest("a")??null;if(Uo(n))return n;const r=cr(o.focusNode)?.closest("a")??null;return Uo(r)?r:null}function dr(e){return e.tagName==="IMG"?e.closest('div[em="atom"]')||e.closest(".em-element-resize-img-container")||e:e.closest("editor")?e.closest('[style*="font-family"][style*="font-size"]')||e:e.tagName==="TD"&&e.classList.contains("em-vindent")?e.closest(".em-vindent-table")||e:e.tagName==="TD"&&e.parentElement?.getAttribute("em")==="block"?e.parentElement:e}function mr(e){return e?e.classList.contains("em-vindent-table")?e.querySelector("td"):e.classList.contains("em-element-resize-img-container")?e.querySelector("img"):e.tagName==="TR"&&e.getAttribute("em")==="block"?e.firstElementChild:e:null}function Bs(e){const o=document.querySelector("[em-edit]");if(!o)return;const t=window.getSelection();if(Ns(o,t)&&t&&!t.isCollapsed)try{t.collapseToEnd()}catch{}const n=e.getElementParent(o);n instanceof Element&&(e.setCursorPosition(n),e.applicationElementSettingsSet({elem:n}))}function Ms(e){const o=document.querySelector("[em-edit]");if(!o)return;const t=mr(dr(o).previousElementSibling);t&&(e.setCursorPosition(t),e.applicationElementSettingsSet({elem:t}))}function Rs(e){const o=document.querySelector("[em-edit]");if(!o)return;const t=mr(dr(o).nextElementSibling);t&&(e.setCursorPosition(t),e.applicationElementSettingsSet({elem:t}))}function Ps(e,o){o.removeAllAttributes("em-edit");const t=document.querySelector(".em-editor-wrapper");t&&(t.style.display="none"),document.querySelectorAll("editor").forEach(n=>{n.blur()})}function Hs(e,o){const t=o.elementPath[e.data.index??0];if(t?.elem){const n=t.elem;o.applicationElementSettingsSet({elem:n}),o.setCursorPosition(n)}}function Is(e,o){o.removeAllAttributes("em-state");const t=o.elementPath[e.data.index??0];t?.elem&&t.elem.setAttribute("em-state","active")}function Os(e,o){if(!o.getElementParent)return;const t={setCursorPosition:o.setCursorPosition,getElementParent:o.getElementParent,applicationElementSettingsSet:o.applicationElementSettingsSet};Bs(t)}function xs(e,o){if(!o.getElementParent)return;const t={setCursorPosition:o.setCursorPosition,getElementParent:o.getElementParent,applicationElementSettingsSet:o.applicationElementSettingsSet};Ms(t)}function Ds(e,o){if(!o.getElementParent)return;const t={setCursorPosition:o.setCursorPosition,getElementParent:o.getElementParent,applicationElementSettingsSet:o.applicationElementSettingsSet};Rs(t)}function Fs(e,o){if(!o.getElementParent||!o.state)return;const t={state:o.state,commit:o.commit,setCursorPosition:o.setCursorPosition,getElementParent:o.getElementParent,messageService:o.messageService,getVariableByIcon:o.getVariableByIcon};ws(t)}function qs(e,o){if(!o.getElementParent||!o.state)return;const t={action:e.data.action,locale:e.data.locale},n={state:o.state,commit:o.commit,setCursorPosition:o.setCursorPosition,getElementParent:o.getElementParent,messageService:o.messageService,HTMLDocument:o.HTMLDocument,hasRussianText:o.hasRussianText};ks(t,n)}var Ws={sandbox_element_active_reset:Ps,sandbox_element_active_set:Hs,sandbox_element_hover_set:Is,sandbox_element_parent_get:Os,sandbox_element_prev_get:xs,sandbox_element_next_get:Ds,sandbox_element_remove:Fs,sandbox_element_text:qs};function $s(e,o){e.data.data?(a.state.set("lockEdit",!0),document.body.classList.add("mceNonEditable"),document.querySelectorAll("editor").forEach(t=>{t.setAttribute("contenteditable","false")})):(a.state.set("lockEdit",!1),document.body.classList.remove("mceNonEditable"),document.querySelectorAll("editor").forEach(t=>{t.setAttribute("contenteditable","true")}))}function zs(e,o){o.setEditorFocus(e.data.data)}var Vs={sandbox_lock_edit:$s,editor_change_focus:zs};function Us(e,o){document.querySelectorAll("[em-optimise-error]").forEach(t=>{t.removeAttribute("em-optimise-error")}),document.querySelectorAll("img").forEach((t,n)=>{t.setAttribute("em-optimise",`image_${n}`)}),o.commit()}function js(e,o){document.querySelectorAll("[em-optimise-error]").forEach(t=>{t.removeAttribute("em-optimise-error")}),document.querySelectorAll("a[href]").forEach((t,n)=>{t.setAttribute("em-optimise",`link_${n}`)}),o.commit()}function Gs(e,o){const t=document.querySelector(`[em-optimise="${e.data.settings.elementId}"]`);t&&(e.data.settings.isError&&(t.setAttribute("em-optimise-error","true"),o.commit()),o.messageService.send({operation:"application_scroll-to",settings:{value:t.getBoundingClientRect().top+o.iframeOffsetTop-o.previewHeight/2}}),o.setCursorPosition(t),o.applicationElementSettingsSet({elem:t}))}function Ys(e,o){const t=document.querySelector(`[em-optimise="${e.data.settings.elementId}"]`);t&&(o.messageService.send({operation:"application_scroll-to",settings:{value:t.getBoundingClientRect().top+o.iframeOffsetTop-o.previewHeight/2}}),o.setCursorPosition(t),o.applicationElementSettingsSet({elem:t}),e.data.settings.isError&&t.setAttribute("em-optimise-error","true"),o.commit())}var Ks={sandbox_set_attr_to_images:Us,sandbox_set_attr_to_links:js,sandbox_set_position_to_img:Gs,sandbox_set_position_to_link:Ys};function Xs(e){const o="8098d114";let t=document.getElementsByTagName("head")[0];!t&&document.documentElement&&(t=document.createElement("head"),document.documentElement.insertBefore(t,document.documentElement.firstChild));const n=`css/sandbox-${e}.css?${o}`,r=`css/sandbox-${e==="light"?"dark":"light"}.css?${o}`,i=document.querySelectorAll(`[href="${r}"]`);if(!document.querySelector(`[href="${n}"]`)){const l=document.createElement("link");l.setAttribute("rel","stylesheet"),l.setAttribute("type","text/css"),l.setAttribute("em","css"),l.setAttribute("href",n),t?.appendChild(l)}for(const l of i)l.remove()}function Zs(e,o){o.initPreview(!0)}function Js(e,o){const t=e.data;t.theme&&(a.state.set("applicationTheme",t.theme),Xs(t.theme),a.commit(!1)),t.commonStyles&&o.setCommonStyles(t.commonStyles),typeof t.copyPasteEnabled<"u"&&a.state.set("copyPasteEnabled",t.copyPasteEnabled),typeof t.saveBlockEnabled<"u"&&a.state.set("saveBlockEnabled",t.saveBlockEnabled),typeof t.editImageControlEnabled<"u"&&a.state.set("editImageControlEnabled",t.editImageControlEnabled),typeof t.elementAIimageEnabled<"u"&&a.state.set("elementAIimageEnabled",t.elementAIimageEnabled),typeof t.imageCenterStockEnabled<"u"&&a.state.set("imageCenterStockEnabled",t.imageCenterStockEnabled),typeof t.imageCenterGifEnabled<"u"&&a.state.set("imageCenterGifEnabled",t.imageCenterGifEnabled),typeof t.imageCenterEditorEnabled<"u"&&a.state.set("imageCenterEditorEnabled",t.imageCenterEditorEnabled),typeof t.blocksAddPanelEnabled<"u"&&a.state.set("blocksAddPanelEnabled",t.blocksAddPanelEnabled),typeof t.lockEditor<"u"&&a.state.set("lockEditor",t.lockEditor),typeof t.codeMode<"u"&&a.state.set("codeMode",t.codeMode),typeof t.appName<"u"&&a.state.set("appName",t.appName),typeof t.previewPage<"u"&&(a.state.set("previewPage",t.previewPage),document.body?.classList.toggle("em-sandbox-preview",t.previewPage))}function Qs(e){const o=e.data?.data?.theme;(o==="light"||o==="dark")&&a.darkMode.set(o)}var ec={init_preview:Zs,update_preview:Js,sandbox_switch_theme:Qs},Re=".em-mob-wrap, .noresp-em-mob-wrap",ue=".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)",le='div[style*="inline-block"]';function nt(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.textContent=e.elem.textContent.replaceAll(/width=".*?"/gi,'width="'+e.width+'"'):e.elem.previousSibling&&nt({elem:e.elem.previousSibling,width:e.width})}function ur(e){const o=e.removedBlockIndex===0?"nextSibling":"previousSibling";e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.remove():e.elem[o]&&ur({elem:e.elem[o],removedBlockIndex:e.removedBlockIndex})}function lo(e){return!!e.querySelector(Re)||!!e.closest(Re)}function Pt(e){return e.querySelector(Re)?document.querySelector('[em-edit="active"]'):e.closest(Re).parentElement}function ao(e){return e.querySelector(le)?document.querySelector('[em-edit="active"]'):e.closest(le).parentElement}function tc(e,o){const t=document.querySelector("[em-edit]");if(t)try{if(o.state.increment("activeElementLocked"),lo(t)){const n=Pt(t),r=e.minWidth,i=n.querySelectorAll(ue).length,l=i>1?parseFloat(String(e.gap)):20,s=i>1?parseFloat(String(e.gapMobile||e.gap)):20;let c="";n.querySelector(".em-mob-wrap")?c=`<td width="${l}" class="em-mob-wrap em-mob-height-${s}px"></td>
148
+ `;function bs(e,o,t,n){const r=document.querySelector(".table-menu"),i=r?.closest("table");if(!i)return;const l=i?.querySelector(`.${a.CLASS_FOR_BASIC_CELL}`),s=Rt(i),{row:c}=Vo(s,a.CLASS_FOR_BASIC_CELL),{row:d,isOverlapped:u}=Qn(s,a.CLASS_FOR_BASIC_CELL),{isOverlapped:g}=er(s,a.CLASS_FOR_BASIC_CELL);if(!i||!l)return;const m={addBottomRow:r.querySelector('[data-id="add-bottom-row"]'),addTopRow:r.querySelector('[data-id="add-top-row"]'),removeRow:r.querySelector('[data-id="remove-row"]'),mergeTopCell:r.querySelector('[data-id="merge-top-cell"]'),mergeBottomCell:r.querySelector('[data-id="merge-bottom-cell"]'),splitHorizontalCell:r.querySelector('[data-id="split-horizontal-cell"]'),addLeftColumn:r.querySelector('[data-id="add-left-column"]'),addRightColumn:r.querySelector('[data-id="add-right-column"]'),mergeRightCell:r.querySelector('[data-id="merge-right-cell"]'),mergeLeftCell:r.querySelector('[data-id="merge-left-cell"]'),splitVerticalCell:r.querySelector('[data-id="split-vertical-cell"]'),removeColumn:r.querySelector('[data-id="remove-column"]')};m.addBottomRow&&(m.addBottomRow.style.display="block"),m.addTopRow&&(m.addTopRow.style.display="block"),m.removeRow&&(m.removeRow.style.display="block"),m.mergeTopCell&&(m.mergeTopCell.style.display="block"),m.mergeBottomCell&&(m.mergeBottomCell.style.display="block"),m.splitHorizontalCell&&(m.splitHorizontalCell.style.display="none"),m.addLeftColumn&&(m.addLeftColumn.style.display="block"),m.addRightColumn&&(m.addRightColumn.style.display="block"),m.mergeRightCell&&(m.mergeRightCell.style.display="block"),m.mergeLeftCell&&(m.mergeLeftCell.style.display="block"),m.splitVerticalCell&&(m.splitVerticalCell.style.display="none"),m.removeColumn&&(m.removeColumn.style.display="block"),l.getAttribute("rowspan")&&m.splitHorizontalCell&&(m.splitHorizontalCell.style.display="block"),l.getAttribute("colspan")&&m.splitVerticalCell&&(m.splitVerticalCell.style.display="block"),e&&(m.mergeBottomCell&&(m.mergeBottomCell.style.display="none"),m.mergeRightCell&&(m.mergeRightCell.style.display="none"),m.mergeLeftCell&&(m.mergeLeftCell.style.display="none"),m.addTopRow&&(m.addTopRow.style.display="none"),m.addBottomRow&&(m.addBottomRow.style.display="none"),m.removeRow&&(m.removeRow.style.display="none")),o&&(m.mergeTopCell&&(m.mergeTopCell.style.display="none"),m.mergeRightCell&&(m.mergeRightCell.style.display="none"),m.mergeLeftCell&&(m.mergeLeftCell.style.display="none"),m.addTopRow&&(m.addTopRow.style.display="none"),m.addBottomRow&&(m.addBottomRow.style.display="none"),m.removeRow&&(m.removeRow.style.display="none")),t&&(m.mergeTopCell&&(m.mergeTopCell.style.display="none"),m.mergeBottomCell&&(m.mergeBottomCell.style.display="none"),m.mergeRightCell&&(m.mergeRightCell.style.display="none"),m.addLeftColumn&&(m.addLeftColumn.style.display="none"),m.addRightColumn&&(m.addRightColumn.style.display="none"),m.removeColumn&&(m.removeColumn.style.display="none")),n&&(m.mergeTopCell&&(m.mergeTopCell.style.display="none"),m.mergeBottomCell&&(m.mergeBottomCell.style.display="none"),m.mergeLeftCell&&(m.mergeLeftCell.style.display="none"),m.addLeftColumn&&(m.addLeftColumn.style.display="none"),m.addRightColumn&&(m.addRightColumn.style.display="none"),m.removeColumn&&(m.removeColumn.style.display="none")),g&&m.removeColumn&&(m.removeColumn.style.display="none"),u&&d===c&&m.removeRow&&(m.removeRow.style.display="none"),l.getAttribute("colspan")&&(m.mergeTopCell&&(m.mergeTopCell.style.display="none"),m.mergeBottomCell&&(m.mergeBottomCell.style.display="none")),l.getAttribute("rowspan")&&(m.mergeLeftCell&&(m.mergeLeftCell.style.display="none"),m.mergeRightCell&&(m.mergeRightCell.style.display="none"))}var hs={INSERT_COLUMN_BEFORE_TABLE:"Insert column before",INSERT_COLUMN_AFTER_TABLE:"Insert column after",MERGE_RIGHT_CELL_TABLE:"Merge right",MERGE_LEFT_CELL_TABLE:"Merge left",SPLIT_CELL_TABLE:"Split cell",REMOVE_COLUMN_TABLE:"Remove column",INSERT_ROW_BEFORE_TABLE:"Insert row before",INSERT_ROW_AFTER_TABLE:"Insert row after",MERGE_TOP_CELL_TABLE:"Merge top",MERGE_BOTTOM_CELL_TABLE:"Merge bottom",REMOVE_ROW_TABLE:"Remove row",EDIT_ATOM:"Edit"},Ce=()=>window.Locale||hs;function ys(e,o){e.forEach(t=>{o.querySelectorAll(`.${t}`).forEach(n=>n.classList.remove(t))})}function Es(e,o){const t=e?.tagName==="TD"?e?.querySelector("div"):e?.closest("div")?e?.closest("div"):e;if(!e.closest(".em-element-custom-table")||t?.tagName!=="DIV")return!1;document.querySelectorAll(`.${a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR}`).forEach(y=>{y.classList.remove(a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR)});const n=[a.CLASS_FOR_BASIC_ROW,a.CLASS_FOR_BASIC_CELL];let r=!1,i=!1;const l=t,s=document.querySelector(`.${a.CLASS_FOR_BASIC_CELL}`),c=document.querySelector(".table-menu");s&&s.classList.remove(a.CLASS_FOR_BASIC_CELL),c&&c.remove();const d=l.closest(".em-element-custom-table"),u=d.closest('[em="block"]'),g=a.addElement({targetElement:d,insertType:"append",className:"of-atom table-menu",style:"width: 48px; height: 28px; display: flex; position: absolute; right: 0; top: -30px; background: #FFDCC7; border-radius: 6px; box-shadow: 0 2px 5px rgba(0,0,0,0.2); pointer-events: auto; z-index: 1001;"});let m=!1,f=1;const p=()=>({isDirectionUP:a.state.get("isDirectionUP"),isDirectionDOWN:a.state.get("isDirectionDOWN"),isDirectionLEFT:a.state.get("isDirectionLEFT"),isDirectionRIGHT:a.state.get("isDirectionRIGHT"),actualTargetCount:a.state.get("actualTargetCount")});d.addEventListener("mousedown",y=>{const E=y.target.tagName.toUpperCase();if(y.button===0&&E!=="UL"&&E!=="LI"&&E!=="SVG"&&E!=="PATH"&&E!=="CIRCLE"){m=!0;const S=d.querySelector(`.${a.CLASS_FOR_BASIC_CELL}`);document.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`)?.forEach(v=>{v.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL),S?.classList.remove(a.CLASS_FOR_BASIC_CELL)})}}),d.addEventListener("mouseup",y=>{m=!1,y.target.closest("td")?.classList.contains("remove-basic-cell")&&a.state.update({isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1})}),d.addEventListener("mouseover",y=>{const E=d.querySelector(`.${a.CLASS_FOR_BASIC_CELL}`);f=d.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).length,f=f===0?1:f;const S=y.target;if(m&&S.closest("TD")&&E){const v=S.closest("TD");d.querySelectorAll(`.${a.TEMPORARY_CLASS}`).forEach(z=>z.classList.remove(a.TEMPORARY_CLASS)),f===1&&d.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).forEach(z=>z.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL)),v.classList.add(a.TEMPORARY_CLASS);const C=v.closest(".em-element-custom-table");if(!C)return;let L=Rt(C);const w=Vo(L,a.CLASS_FOR_BASIC_CELL);if(!w)return;const{row:A,col:M}=w,{row:R,col:$,isOverlapped:J}=Qn(L,a.CLASS_FOR_BASIC_CELL),{row:_,col:G,isOverlapped:H}=er(L,a.CLASS_FOR_BASIC_CELL);!r&&!i&&f===1&&!(J||H)&&(C.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).forEach(z=>z.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL)),v.classList.add(a.CLASS_BACKGROUND_ACTIVE_CELL));const P=Vo(L,a.TEMPORARY_CLASS);if(!P)return;const{row:q,col:O}=P;if(C.querySelectorAll(`.${a.TEMPORARY_CLASS}`).forEach(z=>z.classList.remove(a.TEMPORARY_CLASS)),A!==q&&M!==O){C.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).forEach(z=>z.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL)),r=!1,i=!1;return}const{isDirectionUP:Q,isDirectionDOWN:re,isDirectionLEFT:x,isDirectionRIGHT:k}=p();if(!r&&!i&&!v.classList.contains("remove-basic-cell")&&(a.state.update({isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1}),A===q?(r=!0,i=!1,M>O&&a.state.set("isDirectionLEFT",!0),M<O&&a.state.set("isDirectionRIGHT",!0)):M===O&&(i=!0,r=!1,A>q&&a.state.set("isDirectionUP",!0),A<q&&a.state.set("isDirectionDOWN",!0))),A===q&&(re||Q)||M===O&&(k||x)||M===O&&A===q){a.state.update({isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1}),r=!1,i=!1;return}if(J&&$!==null){const{isDirectionRIGHT:z,isDirectionLEFT:ee}=p();if(z&&$-O<=0&&$>M){C.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).forEach(Y=>Y.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL));return}if(ee&&O-$<=0&&$<M){C.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).forEach(Y=>Y.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL));return}}if(H&&_!==null){const{isDirectionDOWN:z,isDirectionUP:ee}=p();if(z&&_-q<=0&&_>A){C.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).forEach(Y=>Y.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL));return}if(ee&&q-_<=0&&_<A){C.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).forEach(Y=>Y.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL));return}}if(A===q&&r){i=!1;const{isDirectionRIGHT:z,isDirectionLEFT:ee}=p();if(z){const Y=O-M;if(a.state.set("actualTargetCount",no(L,q,O,A,M,!0)),Y<0){a.state.set("isDirectionRIGHT",!1),r=!1,i=!1;return}C.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).forEach(ie=>ie.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL)),rr(`.${a.CLASS_FOR_BASIC_CELL}`,a.state.get("actualTargetCount"),a.CLASS_BACKGROUND_ACTIVE_CELL,!0)}if(ee){const Y=M-O;if(a.state.set("actualTargetCount",no(L,A,M,q,O,!0)),Y<0){a.state.set("isDirectionLEFT",!1),r=!1,i=!1;return}C.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).forEach(ie=>ie.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL)),rr(`.${a.CLASS_FOR_BASIC_CELL}`,a.state.get("actualTargetCount"),a.CLASS_BACKGROUND_ACTIVE_CELL,!1)}C.querySelectorAll(`.${a.TEMPORARY_CLASS}`).forEach(Y=>Y.classList.remove(a.TEMPORARY_CLASS))}if(M===O&&i){r=!1;const{isDirectionDOWN:z,isDirectionUP:ee}=p();if(z){const Y=q-A;if(a.state.set("actualTargetCount",no(L,q,O,A,M,!1)),Y<0){a.state.set("isDirectionDOWN",!1),r=!1,i=!1;return}C.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).forEach(ie=>ie.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL)),ir(`.${a.CLASS_FOR_BASIC_CELL}`,a.state.get("actualTargetCount"),a.CLASS_BACKGROUND_ACTIVE_CELL,!0)}if(ee){const Y=A-q;a.state.set("actualTargetCount",no(L,A,M,q,O,!1)),Y<0&&(a.state.set("isDirectionUP",!1),r=!1,i=!1),C.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).forEach(ie=>ie.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL)),ir(`.${a.CLASS_FOR_BASIC_CELL}`,a.state.get("actualTargetCount"),a.CLASS_BACKGROUND_ACTIVE_CELL,!1)}C.querySelectorAll(`.${a.TEMPORARY_CLASS}`).forEach(Y=>Y.classList.remove(a.TEMPORARY_CLASS))}const se=C.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`);v.classList.contains("remove-basic-cell")&&se?.length>1&&(se?.forEach(z=>{z.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL)}),r=!1,i=!1)}}),Ss(g,d,u,o,n);const b=l.closest("td");b.classList.add(a.CLASS_FOR_BASIC_CELL);function h(y){const E=y.target;!u.contains(E)&&!g.contains(E)&&(g.remove(),b&&(document.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`)?.forEach(S=>{S.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL)}),document.querySelectorAll(`.${a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR}`).forEach(S=>{S.classList.remove(a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR)}),b.classList.remove(a.CLASS_FOR_BASIC_CELL)),document.removeEventListener("click",h))}return document.addEventListener("click",h),!0}function Ss(e,o,t,n,r){const i=bs;function l(y){const E=y.querySelector("ul"),S=y.getAttribute("data-open")==="true",v=n.target.closest("td")?.classList.contains(a.CLASS_FOR_BASIC_CELL),C=o.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`);v&&C?.length===0&&a.state.update({isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1});const{isDirectionUP:L,isDirectionDOWN:w,isDirectionLEFT:A,isDirectionRIGHT:M}={isDirectionUP:a.state.get("isDirectionUP"),isDirectionDOWN:a.state.get("isDirectionDOWN"),isDirectionLEFT:a.state.get("isDirectionLEFT"),isDirectionRIGHT:a.state.get("isDirectionRIGHT")};i(L,w,A,M),e.querySelectorAll("[data-open]").forEach(R=>{R!==y&&R.getAttribute("data-open")==="true"&&(R.setAttribute("data-open","false"),R.querySelector("ul").style.display="none")}),S||(y.setAttribute("data-open","true"),E.style.display="block")}function s(y){const E=y.querySelector("ul");y.getAttribute("data-open")==="true"&&(y.setAttribute("data-open","false"),E.style.display="none")}function c(y){y.stopPropagation(),y.preventDefault();const E=y.target,S=E.closest("li"),v=S?.getAttribute("data-id"),C=S?.closest("tr"),L=S?.closest("td");C?.classList.add(a.CLASS_FOR_BASIC_ROW),L?.classList.add(a.CLASS_FOR_BASIC_CELL);const w=E.closest("table");if(!S||!w)return;const A=Rt(w),M=w.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).length;switch(v){case"add-bottom-row":{const _=Kn(A,a.CLASS_FOR_BASIC_CELL,!1);w.innerHTML=Se(_);break}case"add-top-row":{const _=Kn(A,a.CLASS_FOR_BASIC_CELL,!0);w.innerHTML=Se(_);break}case"remove-row":{const _=Da(A,a.CLASS_FOR_BASIC_CELL);w.innerHTML=Se(_);break}case"merge-top-cell":{const _=M===0?Jn(A,a.CLASS_FOR_BASIC_CELL,!0,M+1):or(A,a.CLASS_FOR_BASIC_CELL,a.CLASS_BACKGROUND_ACTIVE_CELL);w.innerHTML=Se(_);break}case"merge-bottom-cell":{const _=M===0?Jn(A,a.CLASS_FOR_BASIC_CELL,!1,M+1):or(A,a.CLASS_FOR_BASIC_CELL,a.CLASS_BACKGROUND_ACTIVE_CELL);w.innerHTML=Se(_);break}case"split-horizontal-cell":{const _=Wa(A,a.CLASS_FOR_BASIC_CELL);w.innerHTML=Se(_);break}case"add-left-column":{const _=Xn(A,a.CLASS_FOR_BASIC_CELL,!0);w.innerHTML=Se(_);break}case"add-right-column":{const _=Xn(A,a.CLASS_FOR_BASIC_CELL,!1);w.innerHTML=Se(_);break}case"merge-right-cell":{const _=M===0?Zn(A,a.CLASS_FOR_BASIC_CELL,!1,M+1):tr(A,a.CLASS_FOR_BASIC_CELL,a.CLASS_BACKGROUND_ACTIVE_CELL);w.innerHTML=Se(_);break}case"merge-left-cell":{const _=M===0?Zn(A,a.CLASS_FOR_BASIC_CELL,!0,M+1):tr(A,a.CLASS_FOR_BASIC_CELL,a.CLASS_BACKGROUND_ACTIVE_CELL);w.innerHTML=Se(_);break}case"split-vertical-cell":{const _=qa(A,a.CLASS_FOR_BASIC_CELL);w.innerHTML=Se(_);break}case"remove-column":{const _=Fa(A,a.CLASS_FOR_BASIC_CELL);w.innerHTML=Se(_);break}}const R=S.closest("ul");R.parentElement.setAttribute("data-open","false"),R.style.display="none",e.querySelectorAll('[data-open="true"]').forEach(_=>{_.setAttribute("data-open","false"),_.querySelector("ul").style.display="none"});const $=document.querySelector(`.${a.CLASS_FOR_BASIC_CELL}`),J=document.querySelector(".table-menu");$?.classList.remove(a.CLASS_FOR_BASIC_CELL),J?.remove(),document.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).forEach(_=>{_.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL)}),ys(r,w),a.commit()}function d(y){l(y.currentTarget)}function u(y){s(y.currentTarget)}const g=a.addElement({targetElement:e,insertType:"append",style:"cursor: pointer; flex: 1; margin: auto; padding-top: 2px;",className:"em-element-editor-widget-edit",HTMLcontent:lr,title:"Колонки"});g.setAttribute("data-open","false");const m=a.addElement({targetElement:g,insertType:"append",tag:"ul",style:a.styleMenuElement}),f={targetElement:m,insertType:"append",tag:"li",className:"em-element-editor-widget-group",style:a.styleMenuElementList};a.addElement({...f,HTMLcontent:lr,title:"",style:"padding: 3px; cursor: pointer; font-size: 14px; background-color: #E2DEDD; border-radius: 5px; margin: 1px; margin-top: -4px","data-id":"menu-item"}),a.addElement({...f,HTMLcontent:ls,title:Ce().INSERT_COLUMN_BEFORE_TABLE,"data-id":"add-left-column"}),a.addElement({...f,HTMLcontent:as,title:Ce().INSERT_COLUMN_AFTER_TABLE,"data-id":"add-right-column"}),a.addElement({...f,HTMLcontent:ms,title:Ce().MERGE_RIGHT_CELL_TABLE,"data-id":"merge-right-cell"}),a.addElement({...f,HTMLcontent:ss,title:Ce().MERGE_LEFT_CELL_TABLE,"data-id":"merge-left-cell"}),a.addElement({...f,HTMLcontent:gs,title:Ce().SPLIT_CELL_TABLE,"data-id":"split-vertical-cell"}),a.addElement({...f,HTMLcontent:sr,title:Ce().REMOVE_COLUMN_TABLE,"data-id":"remove-column"}),m.addEventListener("click",c),g.addEventListener("mouseenter",d),g.addEventListener("mouseleave",u);const p=a.addElement({targetElement:e,insertType:"append",style:"cursor: pointer; flex: 1; margin: auto; padding-top: 2px;",className:"em-element-editor-widget-clone",HTMLcontent:ar,title:"Строки"});p.setAttribute("data-open","false");const b=a.addElement({targetElement:p,insertType:"append",tag:"ul",style:a.styleMenuElement}),h={targetElement:b,insertType:"append",tag:"li",className:"em-element-editor-widget-group",style:a.styleMenuElementList};a.addElement({...h,HTMLcontent:ar,title:Ce().EDIT_ATOM||"Edit",style:"padding: 3px; cursor: pointer; font-size: 14px; background-color: #E2DEDD; border-radius: 5px; margin: 1px; margin-top: -4px"}),a.addElement({...h,HTMLcontent:cs,title:Ce().INSERT_ROW_BEFORE_TABLE,"data-id":"add-top-row"}),a.addElement({...h,HTMLcontent:ds,title:Ce().INSERT_ROW_AFTER_TABLE,"data-id":"add-bottom-row"}),a.addElement({...h,HTMLcontent:us,title:Ce().MERGE_TOP_CELL_TABLE,"data-id":"merge-top-cell"}),a.addElement({...h,HTMLcontent:fs,title:Ce().MERGE_BOTTOM_CELL_TABLE,"data-id":"merge-bottom-cell"}),a.addElement({...h,HTMLcontent:ps,title:Ce().SPLIT_CELL_TABLE,"data-id":"split-horizontal-cell"}),a.addElement({...h,HTMLcontent:sr,title:Ce().REMOVE_ROW_TABLE,"data-id":"remove-row"}),b.addEventListener("click",c),p.addEventListener("mouseenter",d),p.addEventListener("mouseleave",u)}function Cs(e,o,t){const n=e.closest("div"),r=e.closest("em-replace");if(!r||!n||!t.isClickAtEndOfEmReplace(o,r))return!1;const i=`em-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r.setAttribute("data-em-id",i);const l=t.getOrCreateAfterSpan(r),s=`temp-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;l.setAttribute("data-cursor-target",s),n.innerHTML=n.innerHTML;const c=n.querySelector(`[data-em-id="${i}"]`);if(c){c.removeAttribute("data-em-id");let d=c.nextElementSibling;(!d||!d.hasAttribute("data-cursor-target"))&&(d=n.querySelector(`[data-cursor-target="${s}"]`)),d&&(d.removeAttribute("data-cursor-target"),d.removeAttribute("style"),n.getAttribute("contenteditable")==="true"&&n.focus(),setTimeout(()=>{t.setCursorInsideSpan(d),t._wrapEditor(d,!0),t.commit()},10))}return t.commit(),!0}function vs(e,o){document.querySelectorAll("[em-optimise-error]").forEach(t=>{t.removeAttribute("em-optimise-error")}),document.querySelectorAll("img").forEach((t,n)=>{t.setAttribute("em-optimise",`image_${n}`)}),o.commit()}function As(e,o){document.querySelectorAll("[em-optimise-error]").forEach(t=>{t.removeAttribute("em-optimise-error")}),document.querySelectorAll("a[href]").forEach((t,n)=>{t.setAttribute("em-optimise",`link_${n}`)}),o.commit()}function Ts(e,o){const t=e.data.settings?.elementId;if(!t)return;const n=document.querySelector(`[em-optimise="${t}"]`);n&&(e.data.settings?.isError&&(n.setAttribute("em-optimise-error","true"),o.commit()),o.messageService.send({operation:"application_scroll-to",settings:{value:n.getBoundingClientRect().top+o.iframeOffsetTop-o.previewHeight/2}}),o.setCursorPosition(n),o.applicationElementSettingsSet({elem:n}))}function Ls(e,o){const t=e.data.settings?.elementId;if(!t)return;const n=document.querySelector(`[em-optimise="${t}"]`);n&&(o.messageService.send({operation:"application_scroll-to",settings:{value:n.getBoundingClientRect().top+o.iframeOffsetTop-o.previewHeight/2}}),o.setCursorPosition(n),o.applicationElementSettingsSet({elem:n}),e.data.settings?.isError&&n.setAttribute("em-optimise-error","true"),o.commit())}var ws={sandbox_set_attr_to_images:vs,sandbox_set_attr_to_links:As,sandbox_set_position_to_img:Ts,sandbox_set_position_to_link:Ls},ks=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"><rect width="28" height="28" rx="3" fill="#e5e7eb"/><circle cx="18.5" cy="9.5" r="2.5" fill="#9ca3af"/><path d="M5 21l6-7 4 4.5 3-3 5 5.5z" fill="#9ca3af"/></svg>')}`;function ro(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.remove():e.elem.previousSibling&&ro({elem:e.elem.previousSibling})}function io(e){if(!e.elem)return!1;if(e.elem.parentElement?.tagName==="SECTION"||e.elem.classList.contains("em-narrow-table")&&Array.from(e.elem.childNodes).every(t=>t.nodeType===Node.TEXT_NODE))return e.elem.innerHTML="",!1;e.elem.querySelector(".em-element-editor")&&e.elem.querySelector(".em-element-editor")?.remove(),e.elem.querySelector(".em-element-path")&&e.elem.querySelectorAll(".em-element-path").forEach(t=>t.remove()),e.elem.querySelector(".em-element-block-add")&&e.elem.querySelectorAll(".em-element-block-add").forEach(t=>t.remove()),e.elem.querySelector(".em-vindent-paddingTop, .em-vindent-paddingRight, .em-vindent-paddingBottom, .em-vindent-paddingLeft")&&e.elem.querySelectorAll(".em-vindent-paddingTop, .em-vindent-paddingRight, .em-vindent-paddingBottom, .em-vindent-paddingLeft").forEach(t=>t.remove());const o=e.elem.parentElement;if(e.elem.classList.contains("em-mob-wrap")||e.elem.classList.contains("noresp-em-mob-wrap"))e.elem.innerHTML.trim()===""&&(e.elem.parentElement?.querySelectorAll(":scope > .em-mob-wrap, :scope > .noresp-em-mob-wrap").length>1?e.elem.innerHTML="":(e.elem.remove(),io({elem:o})));else if(e.elem.innerHTML.trim()==="")ro({elem:e.elem}),e.elem.remove(),io({elem:o});else if(o&&!o.querySelector('div[style*="display"]')){for(const t of e.elem.childNodes)t.nodeName==="#text"&&t.textContent?.trim()===""?(ro({elem:t}),t.textContent=""):t.nodeName==="#comment"&&t.textContent?.indexOf("mso")!==-1&&(ro({elem:t}),t.remove());e.elem.innerHTML.trim()===""&&io({elem:e.elem})}return!0}function _s(e){const o=document.querySelector("[em-edit]");if(!o)return;const t=e.getElementParent(o);let n=o.parentNode;const r=o.closest("editor");if(e.setCursorPosition(t),o.classList.contains("em-code")){const i=e.getVariableByIcon?.(o);i&&(i.parentNode?.removeChild(i),o.remove())}else if(o.tagName==="TD"&&o.innerHTML===""&&o.hasAttribute("height")){const i=o.closest("table");if(i){const l=i.previousSibling;l&&l?.textContent?.trim()===""&&l.remove(),i.remove()}}else if(o.closest(".em-element-resize-img-container"))n=o.closest(".em-element-resize-img-container").parentNode,o.closest("td")?.querySelector("editor")?.innerHTML===""&&o.closest("td")?.querySelector("editor")?.remove(),o.closest(".em-element-resize-img-container")?.remove();else if(o.closest('[em="atom"]')){const i=o.closest(".em-mob-wrap, .noresp-em-mob-wrap"),l=o.closest('[em="atom"]');o.tagName==="TD"&&o.previousElementSibling===null&&o.nextElementSibling===null?(n=l.parentNode,l?.remove()):(n=o.closest("td"),o.remove());const s=!!i&&Array.from(i.querySelectorAll('[em="atom"]')).some(c=>c!==l);o.tagName!=="TD"&&i&&!s&&i.textContent?.trim()===""&&(i.textContent="")}else{o.remove();const i=o.previousSibling;i&&i?.textContent?.trim()===""&&i.remove(),o.remove()}r&&r.remove(),io({elem:n}),e.commit(),e.messageService.send({operation:"application_element_settings_close"})}function Ns(e,o){const t=document.querySelector("[em-edit]");if(t)if(e.action==="add_p"){let n=null;if(["DIV","P","TD","EDITOR","B","STRONG","SPAN","I","EM","A"].includes(t.tagName)){if(t.closest("div")?.style.fontFamily?n=t.closest("div"):t.closest("p")?.style.fontFamily?n=t.closest("p"):n=t,n&&o.HTMLDocument){const r=o.HTMLDocument.getOuterHtml(n);n.closest("table")?.getAttribute("em")==="atom"?n.closest("table")?.insertAdjacentHTML("afterend",`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom"><tr><td style="padding-bottom: 10px;">${r}</td></tr></table>`):n.insertAdjacentHTML("afterend",`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom"><tr><td style="padding-bottom: 10px;">${r}</td></tr></table>`)}o.commit()}o.setCursorPosition(t)}else if(e.action==="add_img"){if(window.getSelection){const n=document.createElement("img");n.setAttribute("src",ks),n.setAttribute("width","28"),n.setAttribute("border","0"),n.setAttribute("alt",""),n.style.display="inline-block",n.style.verticalAlign="text-bottom";const r=window.getSelection();if(r?.getRangeAt&&r.rangeCount){const i=r.getRangeAt(0);i.deleteContents(),i.insertNode(n)}else document.querySelector("[em-edit]")?.prepend(n);o.commit()}}else(e.action==="typograf"||e.action==="typograf_all")&&Bs(e,o).catch(n=>{})}async function Bs(e,o){const{default:t}=await a.__vitePreload(async()=>{const{default:c}=await Promise.resolve().then(()=>Lo("./typograf.all.BbXdyfMT.js")).then(d=>d.typograf_all_exports);return{default:c}},void 0,{}.url);let n=document.querySelector("[em-edit]")?.closest("div")||document.querySelector("[em-edit]")?.closest("editor")||null;const r=e.action==="typograf"?n?.innerText:document.body.innerText,i=o.hasRussianText?.(r||"")??!1,l=new t({locale:[e.locale==="ru_RU"||i?"ru":"en-US"],htmlEntity:{type:"name",onlyInvisible:!0,list:["nbsp","shy","mdash","ndash","laquo","raquo"]}});l.disableRule("ru/punctuation/*"),l.disableRule("common/punctuation/*"),l.enableRule("common/punctuation/quote"),l.setSetting("common/punctuation/quote","ru",{left:"«",right:"»",removeDuplicateQuotes:!0}),l.setSetting("common/punctuation/quote","en-US",{left:'"',right:'"',removeDuplicateQuotes:!0}),l.disableRule("ru/dash/kakto"),l.disableRule("ru/dash/taki"),l.disableRule("ru/dash/izpod"),l.disableRule("ru/dash/izza"),l.disableRule("ru/dash/ka"),l.disableRule("ru/dash/to"),l.disableRule("ru/dash/koe"),l.disableRule("common/nbsp/nowrap"),l.disableRule("common/nbsp/dpi"),l.disableRule("common/nbsp/afterParagraphMark"),l.enableRule("common/nbsp/afterNumber"),l.disableRule("common/html/quot"),l.disableRule("ru/date/*"),l.disableRule("common/number/mathSigns"),l.disableRule("ru/number/ordinals"),l.disableRule("ru/number/comma"),l.disableRule("ru/symbols/NN"),l.disableRule("common/symbols/cf"),l.disableRule("ru/other/phone-number"),l.addSafeTag('<[^>]+class="preheader"[^>]*>',"</[^>]+>"),l.addSafeTag("<!--","-->");function s(c){let d=l.execute(c);return d=d.replace(/\b(\d{1,3}(?:[ \u00A0]\d{3})*(?:[.,]\d+)?)\b/g,function(u){return u.replace(/[ \u00A0]/g,"").replace(/\B(?=(\d{3})+(?!\d))/g,"&nbsp;")}),d=d.replace(/(\d[\d&nbsp;]*[.,]?\d+)(?:\s|&nbsp;)?(?=(?:руб(?:\.|лей)?|р\.|долл(?:\.|аров)?|\$|₽|€|£|¥|USD|EUR|RUB))/gi,"$1&nbsp;"),d=d.replace(/(\d[\d&nbsp;]*[.,]?\d+)&nbsp;(руб(?:\.|лей)?|р\.|долл(?:\.|аров)?|\$|₽|€|£|¥|USD|EUR|RUB)/gi,"$1&nbsp;$2"),d}if(e.action==="typograf_all"){const c=document.body;c&&(c.innerHTML=s(c.innerHTML))}else n?.parentElement&&(n=n.parentElement,n?.parentElement&&(n.parentElement.innerHTML=s(n.parentElement.innerHTML)));document.querySelectorAll(".em-element-resize-img-container").forEach(c=>c.replaceWith(...c.childNodes)),document.querySelectorAll(".em-element-img-change-group").forEach(c=>c.remove()),document.querySelectorAll("editor").forEach(c=>c.replaceWith(...c.childNodes)),o.commit()}function cr(e){return e?e.nodeType===Node.ELEMENT_NODE?e:e.parentElement:null}function Uo(e){if(!e||e.tagName!=="A")return!1;const o=e.getAttribute("style");if(!o||!o.includes("display"))return!1;const t=e.style.display;return!(t!=="block"&&t!=="inline-block"||o.includes("mso-style-priority"))}function Ms(e,o){const t=e.closest("a");if(Uo(t))return t;if(!o)return null;const n=cr(o.anchorNode)?.closest("a")??null;if(Uo(n))return n;const r=cr(o.focusNode)?.closest("a")??null;return Uo(r)?r:null}function dr(e){return e.tagName==="IMG"?e.closest('div[em="atom"]')||e.closest(".em-element-resize-img-container")||e:e.closest("editor")?e.closest('[style*="font-family"][style*="font-size"]')||e:e.tagName==="TD"&&e.classList.contains("em-vindent")?e.closest(".em-vindent-table")||e:e.tagName==="TD"&&e.parentElement?.getAttribute("em")==="block"?e.parentElement:e}function mr(e){return e?e.classList.contains("em-vindent-table")?e.querySelector("td"):e.classList.contains("em-element-resize-img-container")?e.querySelector("img"):e.tagName==="TR"&&e.getAttribute("em")==="block"?e.firstElementChild:e:null}function Rs(e){const o=document.querySelector("[em-edit]");if(!o)return;const t=window.getSelection();if(Ms(o,t)&&t&&!t.isCollapsed)try{t.collapseToEnd()}catch{}const n=e.getElementParent(o);n instanceof Element&&(e.setCursorPosition(n),e.applicationElementSettingsSet({elem:n}))}function Ps(e){const o=document.querySelector("[em-edit]");if(!o)return;const t=mr(dr(o).previousElementSibling);t&&(e.setCursorPosition(t),e.applicationElementSettingsSet({elem:t}))}function Hs(e){const o=document.querySelector("[em-edit]");if(!o)return;const t=mr(dr(o).nextElementSibling);t&&(e.setCursorPosition(t),e.applicationElementSettingsSet({elem:t}))}function Is(e,o){o.removeAllAttributes("em-edit");const t=document.querySelector(".em-editor-wrapper");t&&(t.style.display="none"),document.querySelectorAll("editor").forEach(n=>{n.blur()})}function Os(e,o){const t=o.elementPath[e.data.index??0];if(t?.elem){const n=t.elem;o.applicationElementSettingsSet({elem:n}),o.setCursorPosition(n)}}function xs(e,o){o.removeAllAttributes("em-state");const t=o.elementPath[e.data.index??0];t?.elem&&t.elem.setAttribute("em-state","active")}function Ds(e,o){if(!o.getElementParent)return;const t={setCursorPosition:o.setCursorPosition,getElementParent:o.getElementParent,applicationElementSettingsSet:o.applicationElementSettingsSet};Rs(t)}function Fs(e,o){if(!o.getElementParent)return;const t={setCursorPosition:o.setCursorPosition,getElementParent:o.getElementParent,applicationElementSettingsSet:o.applicationElementSettingsSet};Ps(t)}function qs(e,o){if(!o.getElementParent)return;const t={setCursorPosition:o.setCursorPosition,getElementParent:o.getElementParent,applicationElementSettingsSet:o.applicationElementSettingsSet};Hs(t)}function Ws(e,o){if(!o.getElementParent||!o.state)return;const t={state:o.state,commit:o.commit,setCursorPosition:o.setCursorPosition,getElementParent:o.getElementParent,messageService:o.messageService,getVariableByIcon:o.getVariableByIcon};_s(t)}function $s(e,o){if(!o.getElementParent||!o.state)return;const t={action:e.data.action,locale:e.data.locale},n={state:o.state,commit:o.commit,setCursorPosition:o.setCursorPosition,getElementParent:o.getElementParent,messageService:o.messageService,HTMLDocument:o.HTMLDocument,hasRussianText:o.hasRussianText};Ns(t,n)}var zs={sandbox_element_active_reset:Is,sandbox_element_active_set:Os,sandbox_element_hover_set:xs,sandbox_element_parent_get:Ds,sandbox_element_prev_get:Fs,sandbox_element_next_get:qs,sandbox_element_remove:Ws,sandbox_element_text:$s};function Vs(e,o){a.state.set("lockEdit",!!e.data.data),a.applyEditLock(a.editLocked())}function Us(e,o){o.setEditorFocus(e.data.data)}var js={sandbox_lock_edit:Vs,editor_change_focus:Us};function Gs(e,o){document.querySelectorAll("[em-optimise-error]").forEach(t=>{t.removeAttribute("em-optimise-error")}),document.querySelectorAll("img").forEach((t,n)=>{t.setAttribute("em-optimise",`image_${n}`)}),o.commit()}function Ys(e,o){document.querySelectorAll("[em-optimise-error]").forEach(t=>{t.removeAttribute("em-optimise-error")}),document.querySelectorAll("a[href]").forEach((t,n)=>{t.setAttribute("em-optimise",`link_${n}`)}),o.commit()}function Ks(e,o){const t=document.querySelector(`[em-optimise="${e.data.settings.elementId}"]`);t&&(e.data.settings.isError&&(t.setAttribute("em-optimise-error","true"),o.commit()),o.messageService.send({operation:"application_scroll-to",settings:{value:t.getBoundingClientRect().top+o.iframeOffsetTop-o.previewHeight/2}}),o.setCursorPosition(t),o.applicationElementSettingsSet({elem:t}))}function Xs(e,o){const t=document.querySelector(`[em-optimise="${e.data.settings.elementId}"]`);t&&(o.messageService.send({operation:"application_scroll-to",settings:{value:t.getBoundingClientRect().top+o.iframeOffsetTop-o.previewHeight/2}}),o.setCursorPosition(t),o.applicationElementSettingsSet({elem:t}),e.data.settings.isError&&t.setAttribute("em-optimise-error","true"),o.commit())}var Zs={sandbox_set_attr_to_images:Gs,sandbox_set_attr_to_links:Ys,sandbox_set_position_to_img:Ks,sandbox_set_position_to_link:Xs};function Js(e){const o="714faf8a";let t=document.getElementsByTagName("head")[0];!t&&document.documentElement&&(t=document.createElement("head"),document.documentElement.insertBefore(t,document.documentElement.firstChild));const n=`css/sandbox-${e}.css?${o}`,r=`css/sandbox-${e==="light"?"dark":"light"}.css?${o}`,i=document.querySelectorAll(`[href="${r}"]`);if(!document.querySelector(`[href="${n}"]`)){const l=document.createElement("link");l.setAttribute("rel","stylesheet"),l.setAttribute("type","text/css"),l.setAttribute("em","css"),l.setAttribute("href",n),t?.appendChild(l)}for(const l of i)l.remove()}function Qs(e,o){o.initPreview(!0)}function ec(e,o){const t=e.data;t.theme&&(a.state.set("applicationTheme",t.theme),Js(t.theme),a.commit(!1)),t.commonStyles&&o.setCommonStyles(t.commonStyles),typeof t.copyPasteEnabled<"u"&&a.state.set("copyPasteEnabled",t.copyPasteEnabled),typeof t.saveBlockEnabled<"u"&&a.state.set("saveBlockEnabled",t.saveBlockEnabled),typeof t.editImageControlEnabled<"u"&&a.state.set("editImageControlEnabled",t.editImageControlEnabled),typeof t.elementAIimageEnabled<"u"&&a.state.set("elementAIimageEnabled",t.elementAIimageEnabled),typeof t.imageCenterStockEnabled<"u"&&a.state.set("imageCenterStockEnabled",t.imageCenterStockEnabled),typeof t.imageCenterGifEnabled<"u"&&a.state.set("imageCenterGifEnabled",t.imageCenterGifEnabled),typeof t.imageCenterEditorEnabled<"u"&&a.state.set("imageCenterEditorEnabled",t.imageCenterEditorEnabled),typeof t.blocksAddPanelEnabled<"u"&&a.state.set("blocksAddPanelEnabled",t.blocksAddPanelEnabled),typeof t.lockEditor<"u"&&a.state.set("lockEditor",t.lockEditor),typeof t.codeMode<"u"&&a.state.set("codeMode",t.codeMode),typeof t.appName<"u"&&a.state.set("appName",t.appName),typeof t.previewPage<"u"&&(a.state.set("previewPage",t.previewPage),document.body?.classList.toggle("em-sandbox-preview",t.previewPage))}function tc(e){const o=e.data?.data?.theme;(o==="light"||o==="dark")&&a.darkMode.set(o)}var oc={init_preview:Qs,update_preview:ec,sandbox_switch_theme:tc},Re=".em-mob-wrap, .noresp-em-mob-wrap",ue=".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)",le='div[style*="inline-block"]';function nt(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.textContent=e.elem.textContent.replaceAll(/width=".*?"/gi,'width="'+e.width+'"'):e.elem.previousSibling&&nt({elem:e.elem.previousSibling,width:e.width})}function ur(e){const o=e.removedBlockIndex===0?"nextSibling":"previousSibling";e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.remove():e.elem[o]&&ur({elem:e.elem[o],removedBlockIndex:e.removedBlockIndex})}function lo(e){return!!e.querySelector(Re)||!!e.closest(Re)}function Pt(e){return e.querySelector(Re)?document.querySelector('[em-edit="active"]'):e.closest(Re).parentElement}function ao(e){return e.querySelector(le)?document.querySelector('[em-edit="active"]'):e.closest(le).parentElement}function nc(e,o){const t=document.querySelector("[em-edit]");if(t)try{if(o.state.increment("activeElementLocked"),lo(t)){const n=Pt(t),r=e.minWidth,i=n.querySelectorAll(ue).length,l=i>1?parseFloat(String(e.gap)):20,s=i>1?parseFloat(String(e.gapMobile||e.gap)):20;let c="";n.querySelector(".em-mob-wrap")?c=`<td width="${l}" class="em-mob-wrap em-mob-height-${s}px"></td>
149
149
  <td width="${r}" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>`:n.querySelector(".noresp-em-mob-wrap")&&(c=`<td width="${l}" class="noresp-em-mob-wrap noresp-em-mob-height-${s}px"></td>
150
150
  <td width="${r}" valign="top" class="noresp-em-mob-wrap em-mob-width-100perc"></td>`);let d=0,u=0,g=0;n.querySelectorAll(ue).forEach(f=>{parseFloat(f.getAttribute("width")||"0")>r&&g++,d+=parseFloat(f.getAttribute("width")||"0")});const m=(r+l)/g;if(n.querySelectorAll(ue).forEach(f=>{if(parseFloat(f.getAttribute("width")||"0")>r){const p=Math.round(parseFloat(f.getAttribute("width")||"0")-m);f.setAttribute("width",String(p))}}),n.querySelectorAll(ue)[i-1].insertAdjacentHTML("afterend",c),n.querySelectorAll(ue).forEach(f=>{u+=parseFloat(f.getAttribute("width")||"0")}),d-u-l!==0){const f=n.querySelector(Re),p=parseFloat(f.getAttribute("width")||"0")+(d-u-l);f.setAttribute("width",String(p))}o.setPercentsForColumns(n.querySelectorAll(ue)),o.commit()}else{const n=ao(t),r=e.minWidth,i=n.querySelectorAll(le).length,l=i>1?parseFloat(String(e.gap)):20,s='<!--[if (gte mso 9)|(IE)]></td><td width="'+(r+l)+`" valign="top"><![endif]-->
151
151
  <div style="display: inline-block; width: `+(r+l)+`px; vertical-align: top;" class="em-mob-width-100perc">
@@ -155,18 +155,18 @@ __useblocks__.define("js/iframe.js",["require","exports","module","js/rolldown-r
155
155
  </tr>
156
156
  </table>
157
157
  <table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
158
- </div>`;let c=0,d=0,u=0;if(i===1){const m=t.querySelector(le)?n.querySelector(le):t.closest(le);m.style.removeProperty("max-width"),m.firstElementChild?.style.removeProperty("max-width"),m.firstElementChild?.style.removeProperty("width")}n.querySelectorAll(le).forEach(m=>{const f=parseFloat(m.firstElementChild?.getAttribute("width")||"0");f>r&&u++,c+=f});const g=(r+l)/u;if(n.querySelectorAll(le).forEach(m=>{const f=m;if(parseFloat(f.firstElementChild?.getAttribute("width")||"0")>r){const p=Math.round(parseFloat(f.style.width)-g),b=p-l;f.style.width=p+"px",nt({elem:f,width:p}),f.firstElementChild?.tagName==="TABLE"&&f.firstElementChild.setAttribute("width",String(b))}}),n.querySelectorAll(le)[i-1].insertAdjacentHTML("afterend",s),n.querySelectorAll(le).forEach(m=>{d+=parseFloat(m.firstElementChild?.getAttribute("width")||"0")}),c-d-l!==0){const m=n.querySelector(le),f=parseFloat(m.style.width)+(c-d-l);m.style.width=f+"px",nt({elem:m,width:f}),m.firstElementChild?.tagName==="TABLE"&&m.firstElementChild.setAttribute("width",String(f-l))}o.commit()}}catch{}finally{Promise.resolve().then(()=>o.state.decrement("activeElementLocked"))}}function oc(e,o){const t=document.querySelector("[em-edit]");if(!t)return;let n=null;try{if(o.state.increment("activeElementLocked"),lo(t)){const r=Pt(t);let i=0;const l=parseFloat(String(e.gap));r.querySelectorAll(ue).forEach((d,u)=>{u===e.removedBlockIndex&&(i=parseFloat(d.getAttribute("width")||"0"),d===t.closest(Re)&&(t.closest(".em-structure > td")?.setAttribute("em-edit","active"),n=t.closest(".em-structure > td")),d.nextElementSibling&&d.previousElementSibling?d.previousElementSibling.remove():d.nextElementSibling&&!d.previousElementSibling?d.nextElementSibling.remove():!d.nextElementSibling&&d.previousElementSibling&&d.previousElementSibling.remove(),d.remove())});const s=r.querySelectorAll(ue).length,c=Math.floor((i+l)/s);if(r.querySelectorAll(ue).forEach(d=>{const u=Math.round(parseFloat(d.getAttribute("width")||"0")+c);d.setAttribute("width",String(u))}),s===1){const d=r.querySelector(Re),u=d.closest("table").parentElement;d.setAttribute("width",String(u.getBoundingClientRect().width-parseFloat(u.style.paddingLeft||"0")-parseFloat(u.style.paddingRight||"0")))}o.setPercentsForColumns(r.querySelectorAll(ue))}else{const r=ao(t);let i=0;const l=parseFloat(String(e.gap));r.querySelectorAll(le).forEach((d,u)=>{u===e.removedBlockIndex&&(i=parseFloat(d.style.width),d===t.closest(le)&&t.closest(".em-structure > td")?.setAttribute("em-edit","active"),ur({elem:d,removedBlockIndex:e.removedBlockIndex}),d.remove())});const s=r.querySelectorAll(le).length,c=Math.round(i/s);if(r.querySelectorAll(le).forEach(d=>{const u=d,g=Math.round(parseFloat(u.style.width)+c),m=g-l;u.style.width=g+"px",nt({elem:u,width:g}),u.firstElementChild?.tagName==="TABLE"&&u.firstElementChild.setAttribute("width",String(m))}),s===1){const d=r.querySelector(le);d.style.width="100%",d.style.maxWidth=r.closest("table")?.style.maxWidth||"",nt({elem:d,width:r.closest("table")?.style.maxWidth||""}),d.firstElementChild.style.width="91%",d.firstElementChild.style.maxWidth=parseFloat(d.firstElementChild?.getAttribute("width")||"0")+"px"}}}finally{o.commit(),Promise.resolve().then(()=>{o.state.decrement("activeElementLocked"),n&&o.applicationElementSettingsSet&&o.applicationElementSettingsSet({elem:n})})}}function fr(e,o){const t=document.createComment("em-swap");e.replaceWith(t),o.replaceWith(e),t.replaceWith(o)}function pr(e){const o=e.cloneNode(!0);return o.querySelectorAll("editor").forEach(t=>{t.replaceWith(...Array.from(t.childNodes))}),o.querySelectorAll("[em-edit]").forEach(t=>t.removeAttribute("em-edit")),o.hasAttribute("em-edit")&&o.removeAttribute("em-edit"),o.querySelectorAll("[em-temp]").forEach(t=>t.remove()),a.serializeOuterHtml(o)}function nc(e,o){const t=document.querySelector("[em-edit]");if(!t)return;const{copiedBlockIndex:n,widths:r}=e,i=parseFloat(String(e.gap))||0;try{if(o.state.increment("activeElementLocked"),lo(t)){const l=Pt(t),s=l.querySelectorAll(ue)[n];if(!s)return;const c=s.nextElementSibling||s.previousElementSibling,d=c?a.serializeOuterHtml(c):l.querySelector(".noresp-em-mob-wrap")?`<td width="${i}" class="noresp-em-mob-wrap noresp-em-mob-height-${i}px"></td>`:`<td width="${i}" class="em-mob-wrap em-mob-height-${i}px"></td>`;s.insertAdjacentHTML("afterend",d+pr(s));const u=l.querySelectorAll(ue);u.forEach((g,m)=>{r[m]!=null&&g.setAttribute("width",String(r[m]))}),o.setPercentsForColumns(u),o.commit()}else{const l=ao(t),s=l.querySelectorAll(le)[n];if(!s)return;const c='<!--[if (gte mso 9)|(IE)]></td><td width="'+((r[n+1]??r[n]??0)+i)+`" valign="top"><![endif]-->
159
- `;s.insertAdjacentHTML("afterend",c+pr(s)),l.querySelectorAll(le).forEach((d,u)=>{const g=d,m=r[u];if(m==null)return;const f=m+i;g.style.width=f+"px",nt({elem:g,width:f}),g.firstElementChild?.tagName==="TABLE"&&g.firstElementChild.setAttribute("width",String(m))}),o.commit()}}catch{}finally{Promise.resolve().then(()=>o.state.decrement("activeElementLocked"))}}function rc(e,o){const t=document.querySelector("[em-edit]");if(!t)return;const{indexA:n,indexB:r}=e;if(n!==r)try{if(o.state.increment("activeElementLocked"),lo(t)){const i=Pt(t),l=i.querySelectorAll(ue),s=l[n],c=l[r];if(!s||!c)return;fr(s,c),o.setPercentsForColumns(i.querySelectorAll(ue)),o.commit()}else{const i=ao(t).querySelectorAll(le),l=i[n],s=i[r];if(!l||!s)return;fr(l,s),[l,s].forEach(c=>{nt({elem:c,width:parseFloat(c.style.width)})}),o.commit()}}finally{Promise.resolve().then(()=>o.state.decrement("activeElementLocked"))}}function ic(e,o){try{o.state.increment("activeElementLocked");const t=document.querySelector("[em-edit]");if(!t)return;const n=Pt(t);if(e.wrap)n.querySelectorAll(Re).forEach((r,i)=>{r.classList.remove("em-mob-wrap-cancel"),i%2===0&&(r.classList.forEach(l=>l.startsWith("em-mob-width-")&&r.classList.remove(l)),r.classList.add("em-mob-width-100perc"))});else{const r=n.querySelectorAll(ue).length,i=Math.round(100/r)-2;n.querySelectorAll(Re).forEach((s,c)=>{s.classList.add("em-mob-wrap-cancel"),s.classList.remove("em-mob-width-100perc"),c%2===0&&s.classList.add("em-mob-width-"+i+"perc")});const l=o.emailWidth||660;document.querySelector('style[em="styles"]')?.insertAdjacentHTML("beforeend",`
158
+ </div>`;let c=0,d=0,u=0;if(i===1){const m=t.querySelector(le)?n.querySelector(le):t.closest(le);m.style.removeProperty("max-width"),m.firstElementChild?.style.removeProperty("max-width"),m.firstElementChild?.style.removeProperty("width")}n.querySelectorAll(le).forEach(m=>{const f=parseFloat(m.firstElementChild?.getAttribute("width")||"0");f>r&&u++,c+=f});const g=(r+l)/u;if(n.querySelectorAll(le).forEach(m=>{const f=m;if(parseFloat(f.firstElementChild?.getAttribute("width")||"0")>r){const p=Math.round(parseFloat(f.style.width)-g),b=p-l;f.style.width=p+"px",nt({elem:f,width:p}),f.firstElementChild?.tagName==="TABLE"&&f.firstElementChild.setAttribute("width",String(b))}}),n.querySelectorAll(le)[i-1].insertAdjacentHTML("afterend",s),n.querySelectorAll(le).forEach(m=>{d+=parseFloat(m.firstElementChild?.getAttribute("width")||"0")}),c-d-l!==0){const m=n.querySelector(le),f=parseFloat(m.style.width)+(c-d-l);m.style.width=f+"px",nt({elem:m,width:f}),m.firstElementChild?.tagName==="TABLE"&&m.firstElementChild.setAttribute("width",String(f-l))}o.commit()}}catch{}finally{Promise.resolve().then(()=>o.state.decrement("activeElementLocked"))}}function rc(e,o){const t=document.querySelector("[em-edit]");if(!t)return;let n=null;try{if(o.state.increment("activeElementLocked"),lo(t)){const r=Pt(t);let i=0;const l=parseFloat(String(e.gap));r.querySelectorAll(ue).forEach((d,u)=>{u===e.removedBlockIndex&&(i=parseFloat(d.getAttribute("width")||"0"),d===t.closest(Re)&&(t.closest(".em-structure > td")?.setAttribute("em-edit","active"),n=t.closest(".em-structure > td")),d.nextElementSibling&&d.previousElementSibling?d.previousElementSibling.remove():d.nextElementSibling&&!d.previousElementSibling?d.nextElementSibling.remove():!d.nextElementSibling&&d.previousElementSibling&&d.previousElementSibling.remove(),d.remove())});const s=r.querySelectorAll(ue).length,c=Math.floor((i+l)/s);if(r.querySelectorAll(ue).forEach(d=>{const u=Math.round(parseFloat(d.getAttribute("width")||"0")+c);d.setAttribute("width",String(u))}),s===1){const d=r.querySelector(Re),u=d.closest("table").parentElement;d.setAttribute("width",String(u.getBoundingClientRect().width-parseFloat(u.style.paddingLeft||"0")-parseFloat(u.style.paddingRight||"0")))}o.setPercentsForColumns(r.querySelectorAll(ue))}else{const r=ao(t);let i=0;const l=parseFloat(String(e.gap));r.querySelectorAll(le).forEach((d,u)=>{u===e.removedBlockIndex&&(i=parseFloat(d.style.width),d===t.closest(le)&&t.closest(".em-structure > td")?.setAttribute("em-edit","active"),ur({elem:d,removedBlockIndex:e.removedBlockIndex}),d.remove())});const s=r.querySelectorAll(le).length,c=Math.round(i/s);if(r.querySelectorAll(le).forEach(d=>{const u=d,g=Math.round(parseFloat(u.style.width)+c),m=g-l;u.style.width=g+"px",nt({elem:u,width:g}),u.firstElementChild?.tagName==="TABLE"&&u.firstElementChild.setAttribute("width",String(m))}),s===1){const d=r.querySelector(le);d.style.width="100%",d.style.maxWidth=r.closest("table")?.style.maxWidth||"",nt({elem:d,width:r.closest("table")?.style.maxWidth||""}),d.firstElementChild.style.width="91%",d.firstElementChild.style.maxWidth=parseFloat(d.firstElementChild?.getAttribute("width")||"0")+"px"}}}finally{o.commit(),Promise.resolve().then(()=>{o.state.decrement("activeElementLocked"),n&&o.applicationElementSettingsSet&&o.applicationElementSettingsSet({elem:n})})}}function fr(e,o){const t=document.createComment("em-swap");e.replaceWith(t),o.replaceWith(e),t.replaceWith(o)}function pr(e){const o=e.cloneNode(!0);return o.querySelectorAll("editor").forEach(t=>{t.replaceWith(...Array.from(t.childNodes))}),o.querySelectorAll("[em-edit]").forEach(t=>t.removeAttribute("em-edit")),o.hasAttribute("em-edit")&&o.removeAttribute("em-edit"),o.querySelectorAll("[em-temp]").forEach(t=>t.remove()),a.serializeOuterHtml(o)}function ic(e,o){const t=document.querySelector("[em-edit]");if(!t)return;const{copiedBlockIndex:n,widths:r}=e,i=parseFloat(String(e.gap))||0;try{if(o.state.increment("activeElementLocked"),lo(t)){const l=Pt(t),s=l.querySelectorAll(ue)[n];if(!s)return;const c=s.nextElementSibling||s.previousElementSibling,d=c?a.serializeOuterHtml(c):l.querySelector(".noresp-em-mob-wrap")?`<td width="${i}" class="noresp-em-mob-wrap noresp-em-mob-height-${i}px"></td>`:`<td width="${i}" class="em-mob-wrap em-mob-height-${i}px"></td>`;s.insertAdjacentHTML("afterend",d+pr(s));const u=l.querySelectorAll(ue);u.forEach((g,m)=>{r[m]!=null&&g.setAttribute("width",String(r[m]))}),o.setPercentsForColumns(u),o.commit()}else{const l=ao(t),s=l.querySelectorAll(le)[n];if(!s)return;const c='<!--[if (gte mso 9)|(IE)]></td><td width="'+((r[n+1]??r[n]??0)+i)+`" valign="top"><![endif]-->
159
+ `;s.insertAdjacentHTML("afterend",c+pr(s)),l.querySelectorAll(le).forEach((d,u)=>{const g=d,m=r[u];if(m==null)return;const f=m+i;g.style.width=f+"px",nt({elem:g,width:f}),g.firstElementChild?.tagName==="TABLE"&&g.firstElementChild.setAttribute("width",String(m))}),o.commit()}}catch{}finally{Promise.resolve().then(()=>o.state.decrement("activeElementLocked"))}}function lc(e,o){const t=document.querySelector("[em-edit]");if(!t)return;const{indexA:n,indexB:r}=e;if(n!==r)try{if(o.state.increment("activeElementLocked"),lo(t)){const i=Pt(t),l=i.querySelectorAll(ue),s=l[n],c=l[r];if(!s||!c)return;fr(s,c),o.setPercentsForColumns(i.querySelectorAll(ue)),o.commit()}else{const i=ao(t).querySelectorAll(le),l=i[n],s=i[r];if(!l||!s)return;fr(l,s),[l,s].forEach(c=>{nt({elem:c,width:parseFloat(c.style.width)})}),o.commit()}}finally{Promise.resolve().then(()=>o.state.decrement("activeElementLocked"))}}function ac(e,o){try{o.state.increment("activeElementLocked");const t=document.querySelector("[em-edit]");if(!t)return;const n=Pt(t);if(e.wrap)n.querySelectorAll(Re).forEach((r,i)=>{r.classList.remove("em-mob-wrap-cancel"),i%2===0&&(r.classList.forEach(l=>l.startsWith("em-mob-width-")&&r.classList.remove(l)),r.classList.add("em-mob-width-100perc"))});else{const r=n.querySelectorAll(ue).length,i=Math.round(100/r)-2;n.querySelectorAll(Re).forEach((s,c)=>{s.classList.add("em-mob-wrap-cancel"),s.classList.remove("em-mob-width-100perc"),c%2===0&&s.classList.add("em-mob-width-"+i+"perc")});const l=o.emailWidth||660;document.querySelector('style[em="styles"]')?.insertAdjacentHTML("beforeend",`
160
160
  @media only screen and (max-device-width:${l}px),only screen and (max-width:${l}px) {
161
161
  .em-mob-wrap.em-mob-wrap-cancel, .noresp-em-mob-wrap.em-mob-wrap-cancel { display: table-cell !important; }
162
162
  .em-mob-width-${i}perc { width: ${i}% !important; }
163
163
  }
164
- `)}o.commit()}catch{}finally{Promise.resolve().then(()=>o.state.decrement("activeElementLocked"))}}function lc(e,o){try{o.state.increment("activeElementLocked");const t=document.querySelector("[em-edit]");if(!t)return;const n=t.querySelector(Re)?document.querySelector('[em-edit="active"]'):t.closest(Re)?.parentElement?.closest("td");if(!n)return;e.dirRevert?(n.setAttribute("dir","rtl"),n.querySelectorAll("td").forEach(r=>{for(let i=r.firstChild;i;i=i.nextSibling)if(i.nodeType===3){i.parentNode?.setAttribute("dir","ltr");break}})):(n.removeAttribute("dir"),n.querySelectorAll("[dir]").forEach(r=>r.removeAttribute("dir"))),o.commit()}catch{}finally{Promise.resolve().then(()=>o.state.decrement("activeElementLocked"))}}function ut(e){return{state:e.state,commit:e.commit,setPercentsForColumns:e.setPercentsForColumns,emailWidth:e.emailWidth,applicationElementSettingsSet:e.applicationElementSettingsSet}}function ac(e,o){!o.state||!o.setPercentsForColumns||tc(e.data.settings,ut(o))}function sc(e,o){!o.state||!o.setPercentsForColumns||oc(e.data.settings,ut(o))}function cc(e,o){!o.state||!o.setPercentsForColumns||nc(e.data.settings,ut(o))}function dc(e,o){!o.state||!o.setPercentsForColumns||rc(e.data.settings,ut(o))}function mc(e,o){!o.state||!o.setPercentsForColumns||ic(e.data.settings,ut(o))}function uc(e,o){!o.state||!o.setPercentsForColumns||lc(e.data.settings,ut(o))}var fc={sandbox_floatBlock_add:ac,sandbox_floatBlock_remove:sc,sandbox_floatBlock_copy:cc,sandbox_floatBlock_swap:dc,sandbox_floatblock_wrap:mc,sandbox_floatblock_dir:uc};function pc(e,o){try{o.state.increment("activeElementLocked");const t=o.getActiveEditElement();if(!t)return;const n=t.closest("amp-accordion");if(!n)return;const r=o.HTMLDocument.getOuterHtml(n),i=o.parseFromString(r)[0];if(!i)return;const l=i.querySelector("section");if(!l)return;const s=l.cloneNode(!0),c=s.querySelector(":scope > header td div");if(c){const u=Array.from(c.childNodes).find(g=>g.nodeType===Node.TEXT_NODE);u&&(u.nodeValue=e.section)}const d=s.querySelector(":scope > div");d&&(d.innerHTML=`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom">
164
+ `)}o.commit()}catch{}finally{Promise.resolve().then(()=>o.state.decrement("activeElementLocked"))}}function sc(e,o){try{o.state.increment("activeElementLocked");const t=document.querySelector("[em-edit]");if(!t)return;const n=t.querySelector(Re)?document.querySelector('[em-edit="active"]'):t.closest(Re)?.parentElement?.closest("td");if(!n)return;e.dirRevert?(n.setAttribute("dir","rtl"),n.querySelectorAll("td").forEach(r=>{for(let i=r.firstChild;i;i=i.nextSibling)if(i.nodeType===3){i.parentNode?.setAttribute("dir","ltr");break}})):(n.removeAttribute("dir"),n.querySelectorAll("[dir]").forEach(r=>r.removeAttribute("dir"))),o.commit()}catch{}finally{Promise.resolve().then(()=>o.state.decrement("activeElementLocked"))}}function ut(e){return{state:e.state,commit:e.commit,setPercentsForColumns:e.setPercentsForColumns,emailWidth:e.emailWidth,applicationElementSettingsSet:e.applicationElementSettingsSet}}function cc(e,o){!o.state||!o.setPercentsForColumns||nc(e.data.settings,ut(o))}function dc(e,o){!o.state||!o.setPercentsForColumns||rc(e.data.settings,ut(o))}function mc(e,o){!o.state||!o.setPercentsForColumns||ic(e.data.settings,ut(o))}function uc(e,o){!o.state||!o.setPercentsForColumns||lc(e.data.settings,ut(o))}function fc(e,o){!o.state||!o.setPercentsForColumns||ac(e.data.settings,ut(o))}function pc(e,o){!o.state||!o.setPercentsForColumns||sc(e.data.settings,ut(o))}var gc={sandbox_floatBlock_add:cc,sandbox_floatBlock_remove:dc,sandbox_floatBlock_copy:mc,sandbox_floatBlock_swap:uc,sandbox_floatblock_wrap:fc,sandbox_floatblock_dir:pc};function bc(e,o){try{o.state.increment("activeElementLocked");const t=o.getActiveEditElement();if(!t)return;const n=t.closest("amp-accordion");if(!n)return;const r=o.HTMLDocument.getOuterHtml(n),i=o.parseFromString(r)[0];if(!i)return;const l=i.querySelector("section");if(!l)return;const s=l.cloneNode(!0),c=s.querySelector(":scope > header td div");if(c){const u=Array.from(c.childNodes).find(g=>g.nodeType===Node.TEXT_NODE);u&&(u.nodeValue=e.section)}const d=s.querySelector(":scope > div");d&&(d.innerHTML=`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom">
165
165
  <tr>
166
166
  <td style="padding: 10px 0;">
167
167
  <div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">${e.text}</div>
168
168
  </td>
169
- </tr></table>`),i.append(s),i.setAttribute("em-edit","active"),n.replaceWith(i),o.commit(!0)}catch{}finally{Promise.resolve().then(()=>o.state.decrement("activeElementLocked"))}}function gc(e,o){try{o.state.increment("activeElementLocked");const t=o.getActiveEditElement();if(!t)return;const n=t.closest("amp-accordion");if(!n)return;const r=o.HTMLDocument.getOuterHtml(n),i=o.parseFromString(r)[0];if(!i)return;const l=i.querySelectorAll("section");l[e.index]&&l[e.index].remove(),i.setAttribute("em-edit","active"),n.replaceWith(i),o.commit(!0)}catch{}finally{Promise.resolve().then(()=>o.state.decrement("activeElementLocked"))}}function gr(e){return{state:e.state,commit:e.commit,getActiveEditElement:e.getActiveEditElement,HTMLDocument:e.HTMLDocument,parseFromString:e.parseFromString}}function bc(e,o){!o.state||!o.HTMLDocument||!o.getActiveEditElement||!o.parseFromString||pc(e.data.settings,gr(o))}function hc(e,o){!o.state||!o.HTMLDocument||!o.getActiveEditElement||!o.parseFromString||gc(e.data.settings,gr(o))}var yc={sandbox_accordion_add_section:bc,sandbox_accordion_remove_section:hc};function Ec(e,o){const t=e.data.settings?.emBlockId;if(t==null||t==="")return;const n=e.data.settings?.emBlockVersion;let r=a.takeEblockRootSavedToProject()??null;r||(r=(document.querySelector('[em-edit="active"]')||document.querySelector(".em-element-editor"))?.closest?.('[em="block"]')??document.querySelector('[em="block"]')),r&&(r.setAttribute("em-block-id",String(t)),n!=null&&n!==""&&r.setAttribute("em-block-version",String(n)),o.commit())}var Sc={sandbox_eblock_set_em_block_id:Ec},br={...Ts,...Ws,...a.discuss_default,...Vs,...a.display_default,...Ks,...ec,...fc,...yc,...Sc};function Cc(e){return e in br}function vc(e){return br[e]}var hr=0,yr=0,Er=600,Sr=[],Cr=!1,vr=null,Ar=null,Tr=null,Lr=null,wr=null,kr=null,_r=null,Nr=null,Br=null;function Ac(e){vr=e}function Tc(e){Ar=e}function Lc(e){Tr=e}function wc(e){Lr=e}function kc(e){wr=e}function _c(e){kr=e}function Nc(e){_r=e}function Bc(e){Nr=e}var Mr=null;function Mc(e){Mr=e}var Rr=null,Pr=null;function Rc(e){Rr=e}function Pc(e){Pr=e}function Hc(e){Br=e}function Ic(){return{commit:a.commit,commitLockedAsync:a.commitLockedAsync,removeAllAttributes:a.removeAllAttributes,applicationElementSettingsSet:e=>{(Br??Sl)(e)},setCursorPosition:vr||(()=>{}),setEditorFocus:a.setEditorFocus,messageService:a.messageService,iframeOffsetTop:hr,previewHeight:yr,emailWidth:Er,elementPath:Sr,lockEdit:Cr,initPreview:Ar||(()=>{}),setCommonStyles:Tr||(()=>{}),getElementParent:Lr||void 0,getVariableByIcon:wr||void 0,hasRussianText:kr||void 0,HTMLDocument:_r||void 0,state:Nr||void 0,setPercentsForColumns:Mr||void 0,getActiveEditElement:Rr||void 0,parseFromString:Pr||void 0}}function Oc(e){e.iframeOffsetTop!==void 0&&(hr=e.iframeOffsetTop),e.previewHeight!==void 0&&(yr=e.previewHeight),e.emailWidth!==void 0&&(Er=e.emailWidth),e.elementPath!==void 0&&(Sr=e.elementPath),e.lockEdit!==void 0&&(Cr=e.lockEdit)}function xc(e){const o=e.data?.operation;if(o&&Cc(o)){const t=vc(o);if(t)try{t(e,Ic())}catch{}}}function Dc(){a.messageService.addListener(xc)}var Fc=qi.__commonJSMin(((e,o)=>{(function(t){if(typeof window<"u"){var n=!0,r=10,i="",l=0,s="",c=null,d="",u=!1,g={resize:1,click:1},m=128,f=!0,p=1,b="bodyOffset",h=b,y=!0,E="",S={},v=32,C=null,L=!1,w=!1,A="[iFrameSizer]",M=A.length,R="",$={max:1,min:1,bodyScroll:1,documentElementScroll:1},J="child",_=!0,G=window.parent,H="*",P=0,q=!1,O=null,Q=16,re=1,x="scroll",k=x,se=window,z=function(){pe("onMessage function not defined")},ee=function(){},Y=function(){},ie={height:function(){return pe("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return pe("Custom width calculation function not defined"),document.body.scrollWidth}},we={},ke=!1;try{var Co=Object.create({},{passive:{get:function(){ke=!0}}});window.addEventListener("test",jt,Co),window.removeEventListener("test",jt,Co)}catch{}var Pe,fe,Ae,ce,He,Ye,_e={bodyOffset:function(){return document.body.offsetHeight+Ne("marginTop")+Ne("marginBottom")},offset:function(){return _e.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return ie.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,vt(_e))},min:function(){return Math.min.apply(null,vt(_e))},grow:function(){return _e.max()},lowestElement:function(){return Math.max(_e.bodyOffset()||_e.documentElementOffset(),me("bottom",Qe()))},taggedElement:function(){return To("bottom","data-iframe-height")}},be={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return ie.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(be.bodyScroll(),be.documentElementScroll())},max:function(){return Math.max.apply(null,vt(be))},min:function(){return Math.min.apply(null,vt(be))},rightMostElement:function(){return me("right",Qe())},taggedElement:function(){return To("right","data-iframe-width")}},vo=(Pe=Oe,He=null,Ye=0,function(){var T=Date.now(),N=Q-(T-(Ye=Ye||T));return fe=this,Ae=arguments,N<=0||Q<N?(He&&(clearTimeout(He),He=null),Ye=T,ce=Pe.apply(fe,Ae),He||(fe=Ae=null)):He=He||setTimeout(_g,N),ce});Ke(window,"message",function(T){var N={init:function(){E=T.data,G=T.source,vn(),f=!1,setTimeout(function(){y=!1},m)},reset:function(){y?W("Page reset ignored by init"):(W("Page size reset by host page"),Oi("resetPage"))},resize:function(){ct("resizeParent","Parent window requested size check")},moveToAnchor:function(){S.findTarget(Z())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var te=Z();W("PageInfoFromParent called from parent: "+te),Y(JSON.parse(te)),W(" --")},message:function(){var te=Z();W("onMessage called from parent: "+te),z(JSON.parse(te)),W(" --")}};function U(){return T.data.split("]")[1].split(":")[0]}function Z(){return T.data.substr(T.data.indexOf(":")+1)}function I(){return T.data.split(":")[2]in{true:1,false:1}}function D(){var te=U();te in N?N[te]():(typeof o>"u"||!o.exports)&&"iFrameResize"in window||"jQuery"in window&&"iFrameResize"in window.jQuery.prototype||I()||pe("Unexpected message ("+T.data+")")}A===(""+T.data).substr(0,M)&&(f===!1?D():I()?N.init():W('Ignored message of type "'+U()+'". Received before initialization.'))}),Ke(window,"readystatechange",Di),Di()}function jt(){}function Ke(T,N,U,Z){T.addEventListener(N,U,!!ke&&(Z||{}))}function Ct(T){return T.charAt(0).toUpperCase()+T.slice(1)}function Cn(T){return A+"["+R+"] "+T}function W(T){L&&window.console}function pe(T){window.console}function vn(){function T(I){return I==="true"}var N;function U(I){Be(0,0,I.type,I.screenY+":"+I.screenX)}function Z(I,D){W("Add event listener: "+D),Ke(window.document,I,U)}N=E.substr(M).split(":"),R=N[0],l=t!==N[1]?Number(N[1]):l,u=t!==N[2]?T(N[2]):u,L=t!==N[3]?T(N[3]):L,v=t!==N[4]?Number(N[4]):v,n=t!==N[6]?T(N[6]):n,s=N[7],h=t!==N[8]?N[8]:h,i=N[9],d=N[10],P=t!==N[11]?Number(N[11]):P,S.enable=t!==N[12]&&T(N[12]),J=t!==N[13]?N[13]:J,k=t!==N[14]?N[14]:k,w=t!==N[15]?!!N[15]:w,W("Initialising iFrame ("+window.location.href+")"),(function(){function I(D,te){return typeof D=="function"&&(W("Setup custom "+te+"CalcMethod"),ie[te]=D,D="custom"),D}"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&((function(){var D=window.iFrameResizer;W("Reading data from page: "+JSON.stringify(D)),Object.keys(D).forEach(Ao,D),z="onMessage"in D?D.onMessage:z,ee="onReady"in D?D.onReady:ee,H="targetOrigin"in D?D.targetOrigin:H,h="heightCalculationMethod"in D?D.heightCalculationMethod:h,k="widthCalculationMethod"in D?D.widthCalculationMethod:k})(),h=I(h,"height"),k=I(k,"width")),W("TargetOrigin for parent set to: "+H)})(),(function(){t===s&&(s=l+"px"),B("margin",(function(I,D){return D.indexOf("-")!==-1&&(pe("Negative CSS value ignored for "+I),D=""),D})("margin",s))})(),B("background",i),B("padding",d),(N=document.createElement("div")).style.clear="both",N.classList.add("iframe-resizer-inner"),N.style.display="block",N.style.height="0",document.body.appendChild(N),X(),he(),document.documentElement.style.height="",document.body.style.height="",W('HTML & body height set to "auto"'),W("Enable public methods"),se.parentIFrame={autoResize:function(I){return I===!0&&n===!1?(n=!0,Ve()):I===!1&&n===!0&&(n=!1,Ie("remove"),c!==null&&c.disconnect(),clearInterval(C)),Be(0,0,"autoResize",JSON.stringify(n)),n},close:function(){Be(0,0,"close")},getId:function(){return R},getPageInfo:function(I){typeof I=="function"?(Y=I,Be(0,0,"pageInfo")):(Y=function(){},Be(0,0,"pageInfoStop"))},moveToAnchor:function(I){S.findTarget(I)},reset:function(){xi("parentIFrame.reset")},scrollTo:function(I,D){Be(D,I,"scrollTo")},scrollToOffset:function(I,D){Be(D,I,"scrollToOffset")},sendMessage:function(I,D){Be(0,0,"message",JSON.stringify(I),D)},setHeightCalculationMethod:function(I){h=I,X()},setWidthCalculationMethod:function(I){k=I,he()},setTargetOrigin:function(I){W("Set targetOrigin: "+I),H=I},size:function(I,D){ct("size","parentIFrame.size("+((I||"")+(D?","+D:""))+")",I,D)}},w===!0&&(Z("mouseenter","Mouse Enter"),Z("mouseleave","Mouse Leave")),Ve(),S=(function(){function I(Ee){var V=Ee.getBoundingClientRect(),Ee={x:window.pageXOffset!==t?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==t?window.pageYOffset:document.documentElement.scrollTop};return{x:parseInt(V.left,10)+parseInt(Ee.x,10),y:parseInt(V.top,10)+parseInt(Ee.y,10)}}function D(Le){var V,Ee=Le.split("#")[1]||Le,Le=decodeURIComponent(Ee),Fi=document.getElementById(Le)||document.getElementsByName(Le)[0];t!==Fi?(V=I(V=Fi),W("Moving to in page link (#"+Ee+") at x: "+V.x+" y: "+V.y),Be(V.y,V.x,"scrollToOffset")):(W("In page link (#"+Ee+") not found in iFrame, so sending to parent"),Be(0,0,"inPageLink","#"+Ee))}function te(){var Te=window.location.hash,V=window.location.href;Te!==""&&Te!=="#"&&D(V)}function ye(){Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),function(Te){Te.getAttribute("href")!=="#"&&Ke(Te,"click",function(V){V.preventDefault(),D(this.getAttribute("href"))})})}function Gt(){Array.prototype.forEach&&document.querySelectorAll?(W("Setting up location.hash handlers"),ye(),Ke(window,"hashchange",te),setTimeout(te,m)):pe("In page linking not fully supported in this browser! (See README.md for IE8 workaround)")}return S.enable?Gt():W("In page linking not enabled"),{findTarget:D}})(),ct("init","Init message from host page"),ee()}function Ao(T){var N=T.split("Callback");N.length===2&&(this[N="on"+N[0].charAt(0).toUpperCase()+N[0].slice(1)]=this[T],delete this[T],pe("Deprecated: '"+T+"' has been renamed '"+N+"'. The old method will be removed in the next major version."))}function B(T,N){t!==N&&N!==""&&N!=="null"&&W("Body "+T+' set to "'+(document.body.style[T]=N)+'"')}function K(T){var N={add:function(U){function Z(){ct(T.eventName,T.eventType)}we[U]=Z,Ke(window,U,Z,{passive:!0})},remove:function(U){var Z,I=we[U];delete we[U],Z=window,U=U,I=I,Z.removeEventListener(U,I,!1)}};T.eventNames&&Array.prototype.map?(T.eventName=T.eventNames[0],T.eventNames.map(N[T.method])):N[T.method](T.eventName),W(Ct(T.method)+" event listener: "+T.eventType)}function Ie(T){K({method:T,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]}),K({method:T,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]}),K({method:T,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]}),K({method:T,eventType:"Input",eventName:"input"}),K({method:T,eventType:"Mouse Up",eventName:"mouseup"}),K({method:T,eventType:"Mouse Down",eventName:"mousedown"}),K({method:T,eventType:"Orientation Change",eventName:"orientationchange"}),K({method:T,eventType:"Print",eventNames:["afterprint","beforeprint"]}),K({method:T,eventType:"Ready State Change",eventName:"readystatechange"}),K({method:T,eventType:"Touch Start",eventName:"touchstart"}),K({method:T,eventType:"Touch End",eventName:"touchend"}),K({method:T,eventType:"Touch Cancel",eventName:"touchcancel"}),K({method:T,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]}),K({method:T,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]}),K({method:T,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]}),J==="child"&&K({method:T,eventType:"IFrame Resized",eventName:"resize"})}function ze(T,N,U,Z){return N!==T&&(T in U||(pe(T+" is not a valid option for "+Z+"CalculationMethod."),T=N),W(Z+' calculation method set to "'+T+'"')),T}function X(){h=ze(h,b,_e,"height")}function he(){k=ze(k,x,be,"width")}function Ve(){var T;n===!0?(Ie("add"),T=v<0,window.MutationObserver||window.WebKitMutationObserver?T?de():c=(function(){function N(V){function Ee(Le){Le.complete===!1&&(W("Attach listeners to "+Le.src),Le.addEventListener("load",I,!1),Le.addEventListener("error",D,!1),ye.push(Le))}V.type==="attributes"&&V.attributeName==="src"?Ee(V.target):V.type==="childList"&&Array.prototype.forEach.call(V.target.querySelectorAll("img"),Ee)}function U(V){W("Remove listeners from "+V.src),V.removeEventListener("load",I,!1),V.removeEventListener("error",D,!1),V=V,ye.splice(ye.indexOf(V),1)}function Z(V,Ee,Le){U(V.target),ct(Ee,Le+": "+V.target.src)}function I(V){Z(V,"imageLoad","Image loaded")}function D(V){Z(V,"imageLoadFailed","Image load failed")}function te(V){ct("mutationObserver","mutationObserver: "+V[0].target+" "+V[0].type),V.forEach(N)}var ye=[],Gt=window.MutationObserver||window.WebKitMutationObserver,Te=(function(){var V=document.querySelector("body");return Te=new Gt(te),W("Create body MutationObserver"),Te.observe(V,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),Te})();return{disconnect:function(){"disconnect"in Te&&(W("Disconnect body MutationObserver"),Te.disconnect(),ye.forEach(U))}}})():(W("MutationObserver not supported in this browser!"),de())):W("Auto Resize disabled")}function de(){v!==0&&(W("setInterval: "+v+"ms"),C=setInterval(function(){ct("interval","setInterval: "+v)},Math.abs(v)))}function Ne(T,N){var U=0;return N=N||document.body,U=(U=document.defaultView.getComputedStyle(N,null))!==null?U[T]:0,parseInt(U,r)}function me(T,N){for(var U,Z=N.length,I=0,D=Ct(T),te=Date.now(),ye=0;ye<Z;ye++)I<(U=N[ye].getBoundingClientRect()[T]+Ne("margin"+D,N[ye]))&&(I=U);return te=Date.now()-te,W("Parsed "+Z+" HTML elements"),W("Element position calculated in "+te+"ms"),Q/2<(te=te)&&W("Event throttle increased to "+(Q=2*te)+"ms"),I}function vt(T){return[T.bodyOffset(),T.bodyScroll(),T.documentElementOffset(),T.documentElementScroll()]}function To(T,N){var U=document.querySelectorAll("["+N+"]");return U.length===0&&(pe("No tagged elements ("+N+") found on page"),document.querySelectorAll("body *")),me(T,U)}function Qe(){return document.querySelectorAll("body *")}function Oe(T,N,U,Z){function I(){T in{init:1,interval:1,size:1}||!(h in $||u&&k in $)?T in{interval:1}||W("No change in size detected"):xi(N)}var D,te;function ye(Gt,Te){return!(Math.abs(Gt-Te)<=P)}D=t!==U?U:_e[h](),te=t!==Z?Z:be[k](),ye(p,D)||u&&ye(re,te)||T==="init"?(Ii(),Be(p=D,re=te,T)):I()}function _g(){Ye=Date.now(),He=null,ce=Pe.apply(fe,Ae),He||(fe=Ae=null)}function ct(T,N,U,Z){q&&T in g?W("Trigger event cancelled: "+T):(T in{reset:1,resetPage:1,init:1}||W("Trigger event: "+N),(T==="init"?Oe:vo)(T,N,U,Z))}function Ii(){q||(q=!0,W("Trigger event lock on")),clearTimeout(O),O=setTimeout(function(){q=!1,W("Trigger event lock off"),W("--")},m)}function Oi(T){p=_e[h](),re=be[k](),Be(p,re,T)}function xi(T){var N=h;h=b,W("Reset trigger event: "+T),Ii(),Oi("reset"),h=N}function Be(T,N,U,Z,I){var D;_===!0&&(t===I?I=H:W("Message targetOrigin: "+I),W("Sending message to host page ("+(D=R+":"+(T+":"+N)+":"+U+(t!==Z?":"+Z:""))+")"),G.postMessage(A+D,I))}function Di(){document.readyState!=="loading"&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}})()})),Rg=Fc();function qc(e){const o=e.find(l=>l instanceof DocumentType),t=document.documentElement;let n=e.find(l=>l instanceof HTMLHtmlElement);if(!n){n=t||document.createElement("html");let l=e.find(c=>c instanceof HTMLHeadElement);if(l&&l.parentNode!==n){const c=document.head;if(c){n.replaceChild(l,c);for(const d of c.childNodes)l.appendChild(d)}else n.insertBefore(l,n.firstChild)}let s=e.find(c=>c instanceof HTMLBodyElement);if(!s){s=document.body||document.createElement("body");const c=e.filter(d=>d!==l&&d!==o).reverse();if(c.length){let d=null;for(const u of c)(u.parentNode!==s||u.nextSibling!==d)&&s.insertBefore(u,d),d=u}}if(s.parentNode!==n){const c=document.body;if(c){n.replaceChild(s,c);for(const d of c.childNodes)s.appendChild(d)}else n.appendChild(s)}}const r=[...n.childNodes];if(!r.find(l=>l instanceof HTMLHeadElement)){const l=e.find(s=>s instanceof HTMLHeadElement)||document.createElement("head");n.insertBefore(l,n.firstChild)}if(!r.find(l=>l instanceof HTMLBodyElement)){const l=e.find(s=>s instanceof HTMLBodyElement)||document.createElement("body");n.appendChild(l)}const i=document.doctype;return i!==o&&(i?o?document.replaceChild(o,i):document.removeChild(i):o&&document.insertBefore(o,document.firstChild)),t!==n&&(t?n?document.replaceChild(n,t):document.removeChild(t):n&&document.appendChild(n)),e}var Wc='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',$c={name:"email",mapHTMLRoots:qc,createRoot:(e,o)=>{const n=o.length;let r=e.find(d=>d.tag==="html"),i=e.find(d=>d.type===a.NodeType.DOCTYPE);if(!r){e=e.filter(d=>d!==i),r=new a.Node(0,n,e),r.createdBy="createRoot",r.tag="html",r.children=e;for(const d of e)d.parent=r;r.startTagEnd=0,r.endTagStart=n,e=[r]}let l=r.children.find(d=>d.tag==="body"),s=r.children.find(d=>d.tag==="head");if(!l){const d=r.children.filter(u=>u!==s);l=new a.Node(s?s.end:r.startTagEnd||r.start,r.endTagStart||r.end,d,r),l.createdBy="createRoot",l.startTagEnd=l.start,l.endTagStart=l.end;for(const u of d)u.parent=l;l.tag="body",r.children=s?[s,l]:[l]}s||(s=new a.Node(r.startTagEnd||r.start,r.startTagEnd||r.start,[],r),s.createdBy="createRoot",s.startTagEnd=s.start,s.endTagStart=s.start,s.tag="head",r.children.unshift(s)),i||(i=new a.Node(0,0,[]),i.createdBy="createRoot",i.startTagEnd=0,i.endTagStart=0,i.type=a.NodeType.DOCTYPE,i.content=Wc,e.unshift(i));const c=new a.Node(0,n,e);c.type=a.NodeType.ROOT;for(const d of e)d.parent=c,d.type===a.NodeType.ELEMENT&&d.tag!=="html"?(d.type=a.NodeType.COMMENT,d.content=o.substring(d.start,d.end),d.children=[]):d.type===a.NodeType.HTML&&(d.type=a.NodeType.COMMENT,d.content=d.content||"");return c}};function zc(){return a.messageService.addListenerAsync(a.EVENT_TYPES.SANDBOX_IS_EMAIL_EMPTY,e=>{const o=document.querySelector(".em-narrow-table");return o?!(o.querySelectorAll("tr").length>0):!0})}function jo(){let e=null;if(document.querySelector(".preheader"))document.querySelectorAll(".preheader").length>1?document.querySelectorAll(".preheader").forEach(o=>{o.innerHTML.match(/[a-zA-Zа-яА-Я0-9]/gi)&&(e=o)}):e=document.querySelector(".preheader");else if(document.querySelector(".mcnPreviewText"))e=document.querySelector(".mcnPreviewText");else if(document.querySelector(".mail_preheader"))e=document.querySelector(".mail_preheader");else if(document.querySelector(".dvPreheader"))e=document.querySelector(".dvPreheader");else if(document.querySelector('[class*="letteros"]')||document.querySelector("[letteros-link]"))e=document.querySelector("body > div");else for(let o of document.querySelectorAll('[style*="display:none"], [style*="display: none"]'))if(o instanceof HTMLElement&&(parseInt(o.style.opacity)==0||o.style["mso-hide"]=="all"||o.style.overflow=="hidden"||parseInt(o.style.maxHeight)==0||parseInt(o.style.width)==0)&&o.tagName!="IMG"&&o.tagName!="TABLE"&&[...o.childNodes].filter(t=>t.nodeType==Node.TEXT_NODE).length>0){e=o;break}return e&&e.querySelector("div")?e=e.querySelector("div"):e&&e.querySelector("span")&&!e.querySelector("span")?.classList.contains("em-code")&&(e=e.querySelector("span")),e??void 0}function Hr(e){return!!e&&!document.querySelector("title")}function Go(){const e=document.querySelector("title")?.textContent?.replaceAll("&nbsp;"," ").replaceAll("&zwnj;","").replace(/\u200C/g,"").replaceAll("<!--","").replaceAll("-->","")||"";return a.stripSubjectTags(e).replace(/\s+/g," ").trim()}function so(e=jo()){const o=document.createElement("div");return o.innerHTML=e?.innerHTML||"",o.querySelectorAll(".em-code").forEach(t=>t.remove()),a.getElementInnerHTML(o).trim().replaceAll(/<vk-snippet-end\/>/g,"").replaceAll(/[\u034F\u200C\u2007\uFEFF]+/g,"").replaceAll("&amp;","&").replaceAll("&nbsp;","").replaceAll("&#847;","").replaceAll("&#65279;","").replaceAll("&#8199;","").replaceAll("&zwnj;","").replace(/\u200C/g,"").replaceAll("<!--","").replaceAll("-->","").trim()}function Yo(e){e.nodeName=="#comment"&&e.textContent&&e.textContent.indexOf("mso")>=0?e.remove():e.previousSibling&&Yo(e.previousSibling)}function Ko(e){e.nodeName=="#comment"&&e.textContent&&e.textContent.indexOf("endif")>=0?e.remove():e.nextSibling&&Ko(e.nextSibling)}var Vc="&#847;&zwnj; &#8199;&#65279;",Ir="#f0f1f3",Or='<span style="display:none !important;font-size:0;height:0;line-height:0;max-height:0;max-width:0;opacity:0;overflow:hidden;visibility:hidden;width:0">⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'+new Array(200).fill("&nbsp;&zwnj;").join("")+"</span>";function co(e){return!!e&&e instanceof HTMLElement&&e.tagName==="SPAN"&&e.style&&e.style.display==="none"&&e.style.fontSize==="0px"&&e.style.visibility==="hidden"}function xr(e){const o=e.nextSibling;return o&&a.isComment(o)&&o.data==="<![endif]"?o:null}function Uc(e){const o=xr(e);o&&o.nextSibling&&co(o.nextSibling)?o.nextSibling.remove():!o&&e.nextSibling&&co(e.nextSibling)&&e.nextSibling.remove();const t=a.parseFromString(Or);t.length&&(o&&o.parentNode?o.parentNode.insertBefore(t[0],o.nextSibling):e.parentNode&&e.parentNode.insertBefore(t[0],e.nextSibling))}var Dr=e=>{Yo(e),Ko(e);const o=e.nextElementSibling;o instanceof HTMLElement&&o.style&&o.style.color==="transparent"&&(Yo(o),Ko(o),o.remove());const t=e instanceof HTMLElement?xr(e):null;for(t&&t.nextSibling&&co(t.nextSibling)?t.nextSibling.remove():e.nextSibling&&co(e.nextSibling)&&e.nextSibling.remove();e.previousSibling&&a.isTextNode(e.previousSibling)&&e.previousSibling.data.trim()==="";)e.previousSibling.remove();for(;e.nextSibling&&a.isTextNode(e.nextSibling)&&e.nextSibling.data.trim()==="";)e.nextSibling.remove();e.remove()};function jc(e){return!(e.tagName!=="DIV"||a.rgbToHex(e.style.color)!==Ir||e.style.lineHeight!=="0px"||e.style.fontSize!=="0px"||!e.previousSibling||!a.isComment(e.previousSibling)||e.previousSibling.data!=="[if !mso]><!"||!e.nextSibling||!a.isComment(e.nextSibling)||e.nextSibling.data!=="<![endif]")}function Gc(e,o){let t=jo(),n="";(e.length||o)&&(e=e.endsWith(" ")?e:e+" ",e=e+"<vk-snippet-end>͏‌</vk-snippet-end>͏",n=e.padEnd(e.length+5460,Vc));const r=a.parseFromString(n);if(t&&!jc(t)&&(Dr(t),t=null),t)r.length?(t.replaceChildren(...r),Uc(t)):Dr(t);else if(r.length){const i=document.createElement("div");i.classList.add("preheader"),i.style.color=Ir,i.style.lineHeight=i.style.fontSize="0px",i.replaceChildren(...r),document.body?.prepend(i),i.insertAdjacentHTML("afterend",Or)}}function Yc(e,o){return!!o&&(so()||"")!==e}function Kc(e,o){return!!o&&(document.querySelector("title")?.textContent??"")!==e}function Xc(e,o){let t;const n=new a.Disposable;let r=!1,i="";const l=d=>{r=!1,t=void 0,i=d.guid},s=d=>(r=!0,t=so()||"",a.messageService.sendAsync(a.EVENT_TYPES.APPLICATION_PREHEADER_UPDATE,{guid:i,value:t})),c=async({guid:d,value:u,force:g,fromAI:m,echo:f,undoStep:p})=>{g||await o.whenEditorLostFocusAsync("preheader"),typeof u=="string"&&d===i&&(t!==u||Yc(u,g))&&(t=u,Gc(u),await e.commit(!!m||!!p,!0),(m||f)&&(await e.whenSent(),a.messageService.send(a.EVENT_TYPES.APPLICATION_PREHEADER_UPDATE,{guid:i,value:t,forced:!!f&&!m})))};return n.addDisposable(a.messageService.addListenerAsync(a.EVENT_TYPES.SANDBOX_PREHEADER_UPDATE,c)),n.addDisposable(a.messageService.addListenerAsync(a.EVENT_TYPES.SANDBOX_INIT_START,l)),n.addDisposable(a.messageService.addListenerAsync(a.EVENT_TYPES.SANDBOX_INITED,s)),n.addDisposable(e.onChange(()=>{if(r){const d=so()||"";d!==t&&(t=d,a.messageService.send(a.EVENT_TYPES.APPLICATION_PREHEADER_UPDATE,{guid:i,value:t}))}})),n}function Zc(e,o){let t;const n=new a.Disposable;let r="",i=!1;const l=d=>{i=!1,t=void 0,r=d.guid},s=d=>{if(!(d?.guid&&r&&d.guid!==r))return i=!0,Hr(t)||(t=Go()||""),a.messageService.sendAsync(a.EVENT_TYPES.APPLICATION_SUBJECT_UPDATE,{guid:r,value:t})},c=async({guid:d,value:u,force:g,fromAI:m,echo:f,undoStep:p})=>{g||await o.whenEditorLostFocusAsync("subject"),typeof u=="string"&&d===r&&(t!==u||Kc(u,g))&&(t=u,document.title=u,await e.commit(!!m||!!p,!0),(m||f)&&(await e.whenSent(),a.messageService.send(a.EVENT_TYPES.APPLICATION_SUBJECT_UPDATE,{value:u,guid:r,forced:!!f&&!m})))};return n.addDisposable(a.messageService.addListenerAsync(a.EVENT_TYPES.SANDBOX_SUBJECT_UPDATE,c)),n.addDisposable(a.messageService.addListenerAsync(a.EVENT_TYPES.SANDBOX_INIT_START,l)),n.addDisposable(a.messageService.addListenerAsync(a.EVENT_TYPES.SANDBOX_INITED,s)),n.addDisposable(e.onChange(()=>{if(i){if(Hr(t))return;const d=Go()||"";d!==t&&(t=d,a.messageService.send(a.EVENT_TYPES.APPLICATION_SUBJECT_UPDATE,{value:d,guid:r}))}})),n}var Jc=[{type:"in-line-style",name:"color"},{type:"in-line-style",name:"border-color"},{type:"in-line-style",name:"background-color"},{type:"attribute",name:"bgcolor"}],Qc={"in-line-style":e=>({selector:`[style~="${e}:"]`,toColor:o=>window.getComputedStyle(o).getPropertyValue(e)}),attribute:e=>({selector:`[${e}]`,toColor:o=>o.getAttribute(e)})},ed=/^#[\da-f]{6}$/i,Fr=()=>[...new Set(Jc.flatMap(td).map(a.rgbToHex).filter(e=>ed.test(e)).map(e=>e.toUpperCase()))];function td({type:e,name:o}){const t=Qc[e],{selector:n,toColor:r}=t(o);return Array.from(document.querySelectorAll(n)).map(r)}function od(e,o,t){const n=new a.Disposable,r=i=>{if(window.getSelection){let s=window.getSelection();if(s?.getRangeAt&&s.rangeCount){let c=s.getRangeAt(0);c.deleteContents();const d=document.createElement("div");d.innerHTML=o.escape(i);const u=document.createDocumentFragment();let g;for(;g=d.firstChild;)u.appendChild(g);c.insertNode(u)}e.commit(!1)}let l=document.querySelector("[em-edit]");l&&t(l)};return n.addDisposable(a.messageService.addListener(a.EVENT_TYPES.SANDBOX_ADD_MERGETAG,r)),n}var nd=e=>{for(const o of Object.keys(a.fontValues))if(a.toEmFontClassToken(o)===e)return o;return e};function rd(e){const o=document.querySelector('style[em="styles"]'),t=o?.textContent??"",n=new Set(a.getProjectFontFaces(e).filter(i=>i.stylesheet).map(i=>i.source_url)),r=a.readFontFaceBlocks(t).filter(i=>i.family.toLowerCase()===e.toLowerCase()&&n.has(i.src));o&&r.length&&(o.textContent=a.removeFontFaceBlocks(t,r),a.logProjectFonts("iframe: dropped stylesheet @font-face",{family:e,count:r.length}))}function id(e){if(!a.hasProjectFonts())return;const o=document.head.innerHTML,t=new Set;for(const n of a.getProjectFontEntries()){rd(n.family);const r=`em-font-${a.toEmFontClassToken(n.family)}-`;document.querySelectorAll(`[class*="${r}"]`).forEach(i=>{[...i.classList].forEach(l=>{if(!l.startsWith(r)||t.has(l))return;t.add(l);const s=l.slice(r.length),c=nd(s);a.addFontFamilyClass({fontFamilyArray:["Google Fonts","Project Fonts",n.family,c]})})})}t.size>0&&a.logProjectFonts("iframe: hydrated project @font-face from DOM classes",{classes:[...t],families:a.getProjectFontEntries().map(n=>n.family)}),a.clearProjectFontFaces(),e&&document.head.innerHTML!==o&&e(!1)}function ld(e,o){const t=new a.Disposable,n=()=>{requestAnimationFrame(()=>{id(o)})};return t.addDisposable(a.messageService.addListener(a.EVENT_TYPES.SANDBOX_SET_PROJECT_FONTS,n)),t.addDisposable(e.onReady(n)),t}function ad(e,o,t){const n=new a.Disposable;let r=[];return n.addDisposable(e.beforeChange(({treeMutations:i})=>{o.isEditorInFocus&&r.push(...i)})),n.addDisposable(o.editorLostFocus(()=>{if(r.length){const i=[];for(const l of r){const s=l.type;let c=null;s==="Add"?c=l.node:s==="Update"&&(c=l.next),c?.closed===!1&&i.push(c)}i.length&&(e.correctNodes(i),t.saveChanges(!1)),r=[]}})),n}function sd(e){const{container:o}=e;a.AppImpl.registerAll({MessageService:()=>a.messageService,FocusState:()=>e.focusController,SyncService:()=>o.getInstance(a.HTML_DOCUMENT_ID),SyncServiceInternals:()=>o.getInstance(a.REMOTE_DOCUMENT_ID),TextDocument:()=>o.getInstance(a.TEXT_DOCUMENT_ID),Mapping:()=>o.getInstance(a.DOCUMENT_MAPPING_ID)}),e.features&&e.features.length>0&&a.AppImpl.initFeatures(e.features)}var cd="confetti:open-settings",dd="confetti:start",md="confetti:stop",ud="confetti:complete",fd=class{constructor(e){a._defineProperty(this,"_app",void 0),a._defineProperty(this,"_state","idle"),a._defineProperty(this,"_activeEffects",new Map),a._defineProperty(this,"_onDocumentClick",o=>{const t=o.target;if(!t)return;const n=t.closest(".confetti-placeholder");if(!n)return;const r=n.getAttribute("data-confetti-preset")||void 0;this._app.use("MessageService").send(cd,{preset:r})}),this._app=e}init(){const e=this._app.use("MessageService");e.addListener(dd,o=>this._handleStart(o.id,o.options)),e.addListener(md,o=>this._handleStop(o.id)),document.addEventListener("click",this._onDocumentClick,!0)}_handleStart(e,o){const t={id:e,options:o,startTime:Date.now()};this._activeEffects.set(e,t),this._state="running",this.onEffectStart(e,o),this.renderConfetti(e,o);const n=o.duration||3e3;setTimeout(()=>{this._completeEffect(e)},n)}_handleStop(e){if(this._state="stopping",e==="all")for(const o of this._activeEffects.keys())this._completeEffect(o,!0);else this._completeEffect(e,!0)}_completeEffect(e,o=!1){this._activeEffects.get(e)&&(this._activeEffects.delete(e),this.clearConfetti(e,o),this.onEffectComplete(e),this._activeEffects.size===0&&(this._state="idle"),this._app.use("MessageService").send(ud,{id:e}))}onEffectStart(e,o){}onEffectComplete(e){}getState(){return this._state}isRunning(){return this._state==="running"}dispose(){document.removeEventListener("click",this._onDocumentClick,!0),this._handleStop("all"),this._activeEffects.clear()}},pd=class extends fd{constructor(e){super(e),a._defineProperty(this,"_containers",new Map)}renderConfetti(e,o){const t=this._getRenderBounds(),n=document.createElement("div");n.id=`confetti-${e}`,n.setAttribute("data-confetti-overlay","true"),n.style.cssText=`
169
+ </tr></table>`),i.append(s),i.setAttribute("em-edit","active"),n.replaceWith(i),o.commit(!0)}catch{}finally{Promise.resolve().then(()=>o.state.decrement("activeElementLocked"))}}function hc(e,o){try{o.state.increment("activeElementLocked");const t=o.getActiveEditElement();if(!t)return;const n=t.closest("amp-accordion");if(!n)return;const r=o.HTMLDocument.getOuterHtml(n),i=o.parseFromString(r)[0];if(!i)return;const l=i.querySelectorAll("section");l[e.index]&&l[e.index].remove(),i.setAttribute("em-edit","active"),n.replaceWith(i),o.commit(!0)}catch{}finally{Promise.resolve().then(()=>o.state.decrement("activeElementLocked"))}}function gr(e){return{state:e.state,commit:e.commit,getActiveEditElement:e.getActiveEditElement,HTMLDocument:e.HTMLDocument,parseFromString:e.parseFromString}}function yc(e,o){!o.state||!o.HTMLDocument||!o.getActiveEditElement||!o.parseFromString||bc(e.data.settings,gr(o))}function Ec(e,o){!o.state||!o.HTMLDocument||!o.getActiveEditElement||!o.parseFromString||hc(e.data.settings,gr(o))}var Sc={sandbox_accordion_add_section:yc,sandbox_accordion_remove_section:Ec};function Cc(e,o){const t=e.data.settings?.emBlockId;if(t==null||t==="")return;const n=e.data.settings?.emBlockVersion;let r=a.takeEblockRootSavedToProject()??null;r||(r=(document.querySelector('[em-edit="active"]')||document.querySelector(".em-element-editor"))?.closest?.('[em="block"]')??document.querySelector('[em="block"]')),r&&(r.setAttribute("em-block-id",String(t)),n!=null&&n!==""&&r.setAttribute("em-block-version",String(n)),o.commit())}var vc={sandbox_eblock_set_em_block_id:Cc},br={...ws,...zs,...a.discuss_default,...js,...a.display_default,...Zs,...oc,...gc,...Sc,...vc};function Ac(e){return e in br}function Tc(e){return br[e]}var hr=0,yr=0,Er=600,Sr=[],Cr=!1,vr=null,Ar=null,Tr=null,Lr=null,wr=null,kr=null,_r=null,Nr=null,Br=null;function Lc(e){vr=e}function wc(e){Ar=e}function kc(e){Tr=e}function _c(e){Lr=e}function Nc(e){wr=e}function Bc(e){kr=e}function Mc(e){_r=e}function Rc(e){Nr=e}var Mr=null;function Pc(e){Mr=e}var Rr=null,Pr=null;function Hc(e){Rr=e}function Ic(e){Pr=e}function Oc(e){Br=e}function xc(){return{commit:a.commit,commitLockedAsync:a.commitLockedAsync,removeAllAttributes:a.removeAllAttributes,applicationElementSettingsSet:e=>{(Br??vl)(e)},setCursorPosition:vr||(()=>{}),setEditorFocus:a.setEditorFocus,messageService:a.messageService,iframeOffsetTop:hr,previewHeight:yr,emailWidth:Er,elementPath:Sr,lockEdit:Cr,initPreview:Ar||(()=>{}),setCommonStyles:Tr||(()=>{}),getElementParent:Lr||void 0,getVariableByIcon:wr||void 0,hasRussianText:kr||void 0,HTMLDocument:_r||void 0,state:Nr||void 0,setPercentsForColumns:Mr||void 0,getActiveEditElement:Rr||void 0,parseFromString:Pr||void 0}}function Dc(e){e.iframeOffsetTop!==void 0&&(hr=e.iframeOffsetTop),e.previewHeight!==void 0&&(yr=e.previewHeight),e.emailWidth!==void 0&&(Er=e.emailWidth),e.elementPath!==void 0&&(Sr=e.elementPath),e.lockEdit!==void 0&&(Cr=e.lockEdit)}function Fc(e){const o=e.data?.operation;if(o&&Ac(o)){const t=Tc(o);if(t)try{t(e,xc())}catch{}}}function qc(){a.messageService.addListener(Fc)}var Wc=$i.__commonJSMin(((e,o)=>{(function(t){if(typeof window<"u"){var n=!0,r=10,i="",l=0,s="",c=null,d="",u=!1,g={resize:1,click:1},m=128,f=!0,p=1,b="bodyOffset",h=b,y=!0,E="",S={},v=32,C=null,L=!1,w=!1,A="[iFrameSizer]",M=A.length,R="",$={max:1,min:1,bodyScroll:1,documentElementScroll:1},J="child",_=!0,G=window.parent,H="*",P=0,q=!1,O=null,Q=16,re=1,x="scroll",k=x,se=window,z=function(){pe("onMessage function not defined")},ee=function(){},Y=function(){},ie={height:function(){return pe("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return pe("Custom width calculation function not defined"),document.body.scrollWidth}},we={},ke=!1;try{var Co=Object.create({},{passive:{get:function(){ke=!0}}});window.addEventListener("test",jt,Co),window.removeEventListener("test",jt,Co)}catch{}var Pe,fe,Ae,ce,He,Ye,_e={bodyOffset:function(){return document.body.offsetHeight+Ne("marginTop")+Ne("marginBottom")},offset:function(){return _e.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return ie.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,vt(_e))},min:function(){return Math.min.apply(null,vt(_e))},grow:function(){return _e.max()},lowestElement:function(){return Math.max(_e.bodyOffset()||_e.documentElementOffset(),me("bottom",Qe()))},taggedElement:function(){return To("bottom","data-iframe-height")}},be={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return ie.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(be.bodyScroll(),be.documentElementScroll())},max:function(){return Math.max.apply(null,vt(be))},min:function(){return Math.min.apply(null,vt(be))},rightMostElement:function(){return me("right",Qe())},taggedElement:function(){return To("right","data-iframe-width")}},vo=(Pe=Oe,He=null,Ye=0,function(){var T=Date.now(),N=Q-(T-(Ye=Ye||T));return fe=this,Ae=arguments,N<=0||Q<N?(He&&(clearTimeout(He),He=null),Ye=T,ce=Pe.apply(fe,Ae),He||(fe=Ae=null)):He=He||setTimeout(Mg,N),ce});Ke(window,"message",function(T){var N={init:function(){E=T.data,G=T.source,vn(),f=!1,setTimeout(function(){y=!1},m)},reset:function(){y?W("Page reset ignored by init"):(W("Page size reset by host page"),Di("resetPage"))},resize:function(){ct("resizeParent","Parent window requested size check")},moveToAnchor:function(){S.findTarget(Z())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var te=Z();W("PageInfoFromParent called from parent: "+te),Y(JSON.parse(te)),W(" --")},message:function(){var te=Z();W("onMessage called from parent: "+te),z(JSON.parse(te)),W(" --")}};function U(){return T.data.split("]")[1].split(":")[0]}function Z(){return T.data.substr(T.data.indexOf(":")+1)}function I(){return T.data.split(":")[2]in{true:1,false:1}}function D(){var te=U();te in N?N[te]():(typeof o>"u"||!o.exports)&&"iFrameResize"in window||"jQuery"in window&&"iFrameResize"in window.jQuery.prototype||I()||pe("Unexpected message ("+T.data+")")}A===(""+T.data).substr(0,M)&&(f===!1?D():I()?N.init():W('Ignored message of type "'+U()+'". Received before initialization.'))}),Ke(window,"readystatechange",qi),qi()}function jt(){}function Ke(T,N,U,Z){T.addEventListener(N,U,!!ke&&(Z||{}))}function Ct(T){return T.charAt(0).toUpperCase()+T.slice(1)}function Cn(T){return A+"["+R+"] "+T}function W(T){L&&window.console}function pe(T){window.console}function vn(){function T(I){return I==="true"}var N;function U(I){Be(0,0,I.type,I.screenY+":"+I.screenX)}function Z(I,D){W("Add event listener: "+D),Ke(window.document,I,U)}N=E.substr(M).split(":"),R=N[0],l=t!==N[1]?Number(N[1]):l,u=t!==N[2]?T(N[2]):u,L=t!==N[3]?T(N[3]):L,v=t!==N[4]?Number(N[4]):v,n=t!==N[6]?T(N[6]):n,s=N[7],h=t!==N[8]?N[8]:h,i=N[9],d=N[10],P=t!==N[11]?Number(N[11]):P,S.enable=t!==N[12]&&T(N[12]),J=t!==N[13]?N[13]:J,k=t!==N[14]?N[14]:k,w=t!==N[15]?!!N[15]:w,W("Initialising iFrame ("+window.location.href+")"),(function(){function I(D,te){return typeof D=="function"&&(W("Setup custom "+te+"CalcMethod"),ie[te]=D,D="custom"),D}"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&((function(){var D=window.iFrameResizer;W("Reading data from page: "+JSON.stringify(D)),Object.keys(D).forEach(Ao,D),z="onMessage"in D?D.onMessage:z,ee="onReady"in D?D.onReady:ee,H="targetOrigin"in D?D.targetOrigin:H,h="heightCalculationMethod"in D?D.heightCalculationMethod:h,k="widthCalculationMethod"in D?D.widthCalculationMethod:k})(),h=I(h,"height"),k=I(k,"width")),W("TargetOrigin for parent set to: "+H)})(),(function(){t===s&&(s=l+"px"),B("margin",(function(I,D){return D.indexOf("-")!==-1&&(pe("Negative CSS value ignored for "+I),D=""),D})("margin",s))})(),B("background",i),B("padding",d),(N=document.createElement("div")).style.clear="both",N.classList.add("iframe-resizer-inner"),N.style.display="block",N.style.height="0",document.body.appendChild(N),X(),he(),document.documentElement.style.height="",document.body.style.height="",W('HTML & body height set to "auto"'),W("Enable public methods"),se.parentIFrame={autoResize:function(I){return I===!0&&n===!1?(n=!0,Ve()):I===!1&&n===!0&&(n=!1,Ie("remove"),c!==null&&c.disconnect(),clearInterval(C)),Be(0,0,"autoResize",JSON.stringify(n)),n},close:function(){Be(0,0,"close")},getId:function(){return R},getPageInfo:function(I){typeof I=="function"?(Y=I,Be(0,0,"pageInfo")):(Y=function(){},Be(0,0,"pageInfoStop"))},moveToAnchor:function(I){S.findTarget(I)},reset:function(){Fi("parentIFrame.reset")},scrollTo:function(I,D){Be(D,I,"scrollTo")},scrollToOffset:function(I,D){Be(D,I,"scrollToOffset")},sendMessage:function(I,D){Be(0,0,"message",JSON.stringify(I),D)},setHeightCalculationMethod:function(I){h=I,X()},setWidthCalculationMethod:function(I){k=I,he()},setTargetOrigin:function(I){W("Set targetOrigin: "+I),H=I},size:function(I,D){ct("size","parentIFrame.size("+((I||"")+(D?","+D:""))+")",I,D)}},w===!0&&(Z("mouseenter","Mouse Enter"),Z("mouseleave","Mouse Leave")),Ve(),S=(function(){function I(Ee){var V=Ee.getBoundingClientRect(),Ee={x:window.pageXOffset!==t?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==t?window.pageYOffset:document.documentElement.scrollTop};return{x:parseInt(V.left,10)+parseInt(Ee.x,10),y:parseInt(V.top,10)+parseInt(Ee.y,10)}}function D(Le){var V,Ee=Le.split("#")[1]||Le,Le=decodeURIComponent(Ee),Wi=document.getElementById(Le)||document.getElementsByName(Le)[0];t!==Wi?(V=I(V=Wi),W("Moving to in page link (#"+Ee+") at x: "+V.x+" y: "+V.y),Be(V.y,V.x,"scrollToOffset")):(W("In page link (#"+Ee+") not found in iFrame, so sending to parent"),Be(0,0,"inPageLink","#"+Ee))}function te(){var Te=window.location.hash,V=window.location.href;Te!==""&&Te!=="#"&&D(V)}function ye(){Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),function(Te){Te.getAttribute("href")!=="#"&&Ke(Te,"click",function(V){V.preventDefault(),D(this.getAttribute("href"))})})}function Gt(){Array.prototype.forEach&&document.querySelectorAll?(W("Setting up location.hash handlers"),ye(),Ke(window,"hashchange",te),setTimeout(te,m)):pe("In page linking not fully supported in this browser! (See README.md for IE8 workaround)")}return S.enable?Gt():W("In page linking not enabled"),{findTarget:D}})(),ct("init","Init message from host page"),ee()}function Ao(T){var N=T.split("Callback");N.length===2&&(this[N="on"+N[0].charAt(0).toUpperCase()+N[0].slice(1)]=this[T],delete this[T],pe("Deprecated: '"+T+"' has been renamed '"+N+"'. The old method will be removed in the next major version."))}function B(T,N){t!==N&&N!==""&&N!=="null"&&W("Body "+T+' set to "'+(document.body.style[T]=N)+'"')}function K(T){var N={add:function(U){function Z(){ct(T.eventName,T.eventType)}we[U]=Z,Ke(window,U,Z,{passive:!0})},remove:function(U){var Z,I=we[U];delete we[U],Z=window,U=U,I=I,Z.removeEventListener(U,I,!1)}};T.eventNames&&Array.prototype.map?(T.eventName=T.eventNames[0],T.eventNames.map(N[T.method])):N[T.method](T.eventName),W(Ct(T.method)+" event listener: "+T.eventType)}function Ie(T){K({method:T,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]}),K({method:T,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]}),K({method:T,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]}),K({method:T,eventType:"Input",eventName:"input"}),K({method:T,eventType:"Mouse Up",eventName:"mouseup"}),K({method:T,eventType:"Mouse Down",eventName:"mousedown"}),K({method:T,eventType:"Orientation Change",eventName:"orientationchange"}),K({method:T,eventType:"Print",eventNames:["afterprint","beforeprint"]}),K({method:T,eventType:"Ready State Change",eventName:"readystatechange"}),K({method:T,eventType:"Touch Start",eventName:"touchstart"}),K({method:T,eventType:"Touch End",eventName:"touchend"}),K({method:T,eventType:"Touch Cancel",eventName:"touchcancel"}),K({method:T,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]}),K({method:T,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]}),K({method:T,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]}),J==="child"&&K({method:T,eventType:"IFrame Resized",eventName:"resize"})}function ze(T,N,U,Z){return N!==T&&(T in U||(pe(T+" is not a valid option for "+Z+"CalculationMethod."),T=N),W(Z+' calculation method set to "'+T+'"')),T}function X(){h=ze(h,b,_e,"height")}function he(){k=ze(k,x,be,"width")}function Ve(){var T;n===!0?(Ie("add"),T=v<0,window.MutationObserver||window.WebKitMutationObserver?T?de():c=(function(){function N(V){function Ee(Le){Le.complete===!1&&(W("Attach listeners to "+Le.src),Le.addEventListener("load",I,!1),Le.addEventListener("error",D,!1),ye.push(Le))}V.type==="attributes"&&V.attributeName==="src"?Ee(V.target):V.type==="childList"&&Array.prototype.forEach.call(V.target.querySelectorAll("img"),Ee)}function U(V){W("Remove listeners from "+V.src),V.removeEventListener("load",I,!1),V.removeEventListener("error",D,!1),V=V,ye.splice(ye.indexOf(V),1)}function Z(V,Ee,Le){U(V.target),ct(Ee,Le+": "+V.target.src)}function I(V){Z(V,"imageLoad","Image loaded")}function D(V){Z(V,"imageLoadFailed","Image load failed")}function te(V){ct("mutationObserver","mutationObserver: "+V[0].target+" "+V[0].type),V.forEach(N)}var ye=[],Gt=window.MutationObserver||window.WebKitMutationObserver,Te=(function(){var V=document.querySelector("body");return Te=new Gt(te),W("Create body MutationObserver"),Te.observe(V,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),Te})();return{disconnect:function(){"disconnect"in Te&&(W("Disconnect body MutationObserver"),Te.disconnect(),ye.forEach(U))}}})():(W("MutationObserver not supported in this browser!"),de())):W("Auto Resize disabled")}function de(){v!==0&&(W("setInterval: "+v+"ms"),C=setInterval(function(){ct("interval","setInterval: "+v)},Math.abs(v)))}function Ne(T,N){var U=0;return N=N||document.body,U=(U=document.defaultView.getComputedStyle(N,null))!==null?U[T]:0,parseInt(U,r)}function me(T,N){for(var U,Z=N.length,I=0,D=Ct(T),te=Date.now(),ye=0;ye<Z;ye++)I<(U=N[ye].getBoundingClientRect()[T]+Ne("margin"+D,N[ye]))&&(I=U);return te=Date.now()-te,W("Parsed "+Z+" HTML elements"),W("Element position calculated in "+te+"ms"),Q/2<(te=te)&&W("Event throttle increased to "+(Q=2*te)+"ms"),I}function vt(T){return[T.bodyOffset(),T.bodyScroll(),T.documentElementOffset(),T.documentElementScroll()]}function To(T,N){var U=document.querySelectorAll("["+N+"]");return U.length===0&&(pe("No tagged elements ("+N+") found on page"),document.querySelectorAll("body *")),me(T,U)}function Qe(){return document.querySelectorAll("body *")}function Oe(T,N,U,Z){function I(){T in{init:1,interval:1,size:1}||!(h in $||u&&k in $)?T in{interval:1}||W("No change in size detected"):Fi(N)}var D,te;function ye(Gt,Te){return!(Math.abs(Gt-Te)<=P)}D=t!==U?U:_e[h](),te=t!==Z?Z:be[k](),ye(p,D)||u&&ye(re,te)||T==="init"?(xi(),Be(p=D,re=te,T)):I()}function Mg(){Ye=Date.now(),He=null,ce=Pe.apply(fe,Ae),He||(fe=Ae=null)}function ct(T,N,U,Z){q&&T in g?W("Trigger event cancelled: "+T):(T in{reset:1,resetPage:1,init:1}||W("Trigger event: "+N),(T==="init"?Oe:vo)(T,N,U,Z))}function xi(){q||(q=!0,W("Trigger event lock on")),clearTimeout(O),O=setTimeout(function(){q=!1,W("Trigger event lock off"),W("--")},m)}function Di(T){p=_e[h](),re=be[k](),Be(p,re,T)}function Fi(T){var N=h;h=b,W("Reset trigger event: "+T),xi(),Di("reset"),h=N}function Be(T,N,U,Z,I){var D;_===!0&&(t===I?I=H:W("Message targetOrigin: "+I),W("Sending message to host page ("+(D=R+":"+(T+":"+N)+":"+U+(t!==Z?":"+Z:""))+")"),G.postMessage(A+D,I))}function qi(){document.readyState!=="loading"&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}})()})),Ig=Wc();function $c(e=document,o=window){let t=e.body;const n=new MutationObserver(()=>{if(r(),e.body===t)return;t=e.body;const i=o.parentIFrame;i?.autoResize&&(i.autoResize(!1),i.autoResize(!0),i.size?.())});function r(){n.disconnect(),n.observe(e,{childList:!0}),e.documentElement&&n.observe(e.documentElement,{childList:!0})}return r(),{dispose:()=>n.disconnect()}}function zc(e){const o=e.find(l=>l instanceof DocumentType),t=document.documentElement;let n=e.find(l=>l instanceof HTMLHtmlElement);if(!n){n=t||document.createElement("html");let l=e.find(c=>c instanceof HTMLHeadElement);if(l&&l.parentNode!==n){const c=document.head;if(c){n.replaceChild(l,c);for(const d of c.childNodes)l.appendChild(d)}else n.insertBefore(l,n.firstChild)}let s=e.find(c=>c instanceof HTMLBodyElement);if(!s){s=document.body||document.createElement("body");const c=e.filter(d=>d!==l&&d!==o).reverse();if(c.length){let d=null;for(const u of c)(u.parentNode!==s||u.nextSibling!==d)&&s.insertBefore(u,d),d=u}}if(s.parentNode!==n){const c=document.body;if(c){n.replaceChild(s,c);for(const d of c.childNodes)s.appendChild(d)}else n.appendChild(s)}}const r=[...n.childNodes];if(!r.find(l=>l instanceof HTMLHeadElement)){const l=e.find(s=>s instanceof HTMLHeadElement)||document.createElement("head");n.insertBefore(l,n.firstChild)}if(!r.find(l=>l instanceof HTMLBodyElement)){const l=e.find(s=>s instanceof HTMLBodyElement)||document.createElement("body");n.appendChild(l)}const i=document.doctype;return i!==o&&(i?o?document.replaceChild(o,i):document.removeChild(i):o&&document.insertBefore(o,document.firstChild)),t!==n&&(t?n?document.replaceChild(n,t):document.removeChild(t):n&&document.appendChild(n)),e}var Vc='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',Uc={name:"email",mapHTMLRoots:zc,createRoot:(e,o)=>{const n=o.length;let r=e.find(d=>d.tag==="html"),i=e.find(d=>d.type===a.NodeType.DOCTYPE);if(!r){e=e.filter(d=>d!==i),r=new a.Node(0,n,e),r.createdBy="createRoot",r.tag="html",r.children=e;for(const d of e)d.parent=r;r.startTagEnd=0,r.endTagStart=n,e=[r]}let l=r.children.find(d=>d.tag==="body"),s=r.children.find(d=>d.tag==="head");if(!l){const d=r.children.filter(u=>u!==s);l=new a.Node(s?s.end:r.startTagEnd||r.start,r.endTagStart||r.end,d,r),l.createdBy="createRoot",l.startTagEnd=l.start,l.endTagStart=l.end;for(const u of d)u.parent=l;l.tag="body",r.children=s?[s,l]:[l]}s||(s=new a.Node(r.startTagEnd||r.start,r.startTagEnd||r.start,[],r),s.createdBy="createRoot",s.startTagEnd=s.start,s.endTagStart=s.start,s.tag="head",r.children.unshift(s)),i||(i=new a.Node(0,0,[]),i.createdBy="createRoot",i.startTagEnd=0,i.endTagStart=0,i.type=a.NodeType.DOCTYPE,i.content=Vc,e.unshift(i));const c=new a.Node(0,n,e);c.type=a.NodeType.ROOT;for(const d of e)d.parent=c,d.type===a.NodeType.ELEMENT&&d.tag!=="html"?(d.type=a.NodeType.COMMENT,d.content=o.substring(d.start,d.end),d.children=[]):d.type===a.NodeType.HTML&&(d.type=a.NodeType.COMMENT,d.content=d.content||"");return c}};function jc(){return a.messageService.addListenerAsync(a.EVENT_TYPES.SANDBOX_IS_EMAIL_EMPTY,e=>{const o=document.querySelector(".em-narrow-table");return o?!(o.querySelectorAll("tr").length>0):!0})}function jo(){let e=null;if(document.querySelector(".preheader"))document.querySelectorAll(".preheader").length>1?document.querySelectorAll(".preheader").forEach(o=>{o.innerHTML.match(/[a-zA-Zа-яА-Я0-9]/gi)&&(e=o)}):e=document.querySelector(".preheader");else if(document.querySelector(".mcnPreviewText"))e=document.querySelector(".mcnPreviewText");else if(document.querySelector(".mail_preheader"))e=document.querySelector(".mail_preheader");else if(document.querySelector(".dvPreheader"))e=document.querySelector(".dvPreheader");else if(document.querySelector('[class*="letteros"]')||document.querySelector("[letteros-link]"))e=document.querySelector("body > div");else for(let o of document.querySelectorAll('[style*="display:none"], [style*="display: none"]'))if(o instanceof HTMLElement&&(parseInt(o.style.opacity)==0||o.style["mso-hide"]=="all"||o.style.overflow=="hidden"||parseInt(o.style.maxHeight)==0||parseInt(o.style.width)==0)&&o.tagName!="IMG"&&o.tagName!="TABLE"&&[...o.childNodes].filter(t=>t.nodeType==Node.TEXT_NODE).length>0){e=o;break}return e&&e.querySelector("div")?e=e.querySelector("div"):e&&e.querySelector("span")&&!e.querySelector("span")?.classList.contains("em-code")&&(e=e.querySelector("span")),e??void 0}function Hr(e){return!!e&&!document.querySelector("title")}function Go(){const e=document.querySelector("title")?.textContent?.replaceAll("&nbsp;"," ").replaceAll("&zwnj;","").replace(/\u200C/g,"").replaceAll("<!--","").replaceAll("-->","")||"";return a.stripSubjectTags(e).replace(/\s+/g," ").trim()}function so(e=jo()){const o=document.createElement("div");return o.innerHTML=e?.innerHTML||"",o.querySelectorAll(".em-code").forEach(t=>t.remove()),a.getElementInnerHTML(o).trim().replaceAll(/<vk-snippet-end\/>/g,"").replaceAll(/[\u034F\u200C\u2007\uFEFF]+/g,"").replaceAll("&amp;","&").replaceAll("&#847;","").replaceAll("&#65279;","").replaceAll("&#8199;","").replaceAll("&zwnj;","").replace(/\u200C/g,"").replaceAll("<!--","").replaceAll("-->","").replace(/(?:&nbsp;|\s)+$/,"").trim()}function Yo(e){e.nodeName=="#comment"&&e.textContent&&e.textContent.indexOf("mso")>=0?e.remove():e.previousSibling&&Yo(e.previousSibling)}function Ko(e){e.nodeName=="#comment"&&e.textContent&&e.textContent.indexOf("endif")>=0?e.remove():e.nextSibling&&Ko(e.nextSibling)}var Gc="&#847;&zwnj; &#8199;&#65279;",Ir="#f0f1f3",Or='<span style="display:none !important;font-size:0;height:0;line-height:0;max-height:0;max-width:0;opacity:0;overflow:hidden;visibility:hidden;width:0">⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'+new Array(200).fill("&nbsp;&zwnj;").join("")+"</span>";function co(e){return!!e&&e instanceof HTMLElement&&e.tagName==="SPAN"&&e.style&&e.style.display==="none"&&e.style.fontSize==="0px"&&e.style.visibility==="hidden"}function xr(e){const o=e.nextSibling;return o&&a.isComment(o)&&o.data==="<![endif]"?o:null}function Yc(e){const o=xr(e);o&&o.nextSibling&&co(o.nextSibling)?o.nextSibling.remove():!o&&e.nextSibling&&co(e.nextSibling)&&e.nextSibling.remove();const t=a.parseFromString(Or);t.length&&(o&&o.parentNode?o.parentNode.insertBefore(t[0],o.nextSibling):e.parentNode&&e.parentNode.insertBefore(t[0],e.nextSibling))}var Dr=e=>{Yo(e),Ko(e);const o=e.nextElementSibling;o instanceof HTMLElement&&o.style&&o.style.color==="transparent"&&(Yo(o),Ko(o),o.remove());const t=e instanceof HTMLElement?xr(e):null;for(t&&t.nextSibling&&co(t.nextSibling)?t.nextSibling.remove():e.nextSibling&&co(e.nextSibling)&&e.nextSibling.remove();e.previousSibling&&a.isTextNode(e.previousSibling)&&e.previousSibling.data.trim()==="";)e.previousSibling.remove();for(;e.nextSibling&&a.isTextNode(e.nextSibling)&&e.nextSibling.data.trim()==="";)e.nextSibling.remove();e.remove()};function Kc(e){return!(e.tagName!=="DIV"||a.rgbToHex(e.style.color)!==Ir||e.style.lineHeight!=="0px"||e.style.fontSize!=="0px"||!e.previousSibling||!a.isComment(e.previousSibling)||e.previousSibling.data!=="[if !mso]><!"||!e.nextSibling||!a.isComment(e.nextSibling)||e.nextSibling.data!=="<![endif]")}function Xc(e,o){let t=jo(),n="";(e.length||o)&&(e=e.endsWith(" ")?e:e+" ",e=e+"<vk-snippet-end>͏‌</vk-snippet-end>͏",n=e.padEnd(e.length+5460,Gc));const r=a.parseFromString(n);if(t&&!Kc(t)&&(Dr(t),t=null),t)r.length?(t.replaceChildren(...r),Yc(t)):Dr(t);else if(r.length){const i=document.createElement("div");i.classList.add("preheader"),i.style.color=Ir,i.style.lineHeight=i.style.fontSize="0px",i.replaceChildren(...r),document.body?.prepend(i),i.insertAdjacentHTML("afterend",Or)}}function Zc(e,o){return!!o&&(so()||"")!==e}function Jc(e,o){return!!o&&(document.querySelector("title")?.textContent??"")!==e}function Qc(e,o){let t;const n=new a.Disposable;let r=!1,i="";const l=d=>{r=!1,t=void 0,i=d.guid},s=d=>(r=!0,t=so()||"",a.messageService.sendAsync(a.EVENT_TYPES.APPLICATION_PREHEADER_UPDATE,{guid:i,value:t})),c=async({guid:d,value:u,force:g,fromAI:m,echo:f,undoStep:p})=>{g||await o.whenEditorLostFocusAsync("preheader"),typeof u=="string"&&d===i&&(t!==u||Zc(u,g))&&(t=u,Xc(u),await e.commit(!!m||!!p,!0),(m||f)&&(await e.whenSent(),a.messageService.send(a.EVENT_TYPES.APPLICATION_PREHEADER_UPDATE,{guid:i,value:t,forced:!!f&&!m})))};return n.addDisposable(a.messageService.addListenerAsync(a.EVENT_TYPES.SANDBOX_PREHEADER_UPDATE,c)),n.addDisposable(a.messageService.addListenerAsync(a.EVENT_TYPES.SANDBOX_INIT_START,l)),n.addDisposable(a.messageService.addListenerAsync(a.EVENT_TYPES.SANDBOX_INITED,s)),n.addDisposable(e.onChange(()=>{if(r){const d=so()||"";d!==t&&(t=d,a.messageService.send(a.EVENT_TYPES.APPLICATION_PREHEADER_UPDATE,{guid:i,value:t}))}})),n}function ed(e,o){let t;const n=new a.Disposable;let r="",i=!1;const l=d=>{i=!1,t=void 0,r=d.guid},s=d=>{if(!(d?.guid&&r&&d.guid!==r))return i=!0,Hr(t)||(t=Go()||""),a.messageService.sendAsync(a.EVENT_TYPES.APPLICATION_SUBJECT_UPDATE,{guid:r,value:t})},c=async({guid:d,value:u,force:g,fromAI:m,echo:f,undoStep:p})=>{g||await o.whenEditorLostFocusAsync("subject"),typeof u=="string"&&d===r&&(t!==u||Jc(u,g))&&(t=u,document.title=u,await e.commit(!!m||!!p,!0),(m||f)&&(await e.whenSent(),a.messageService.send(a.EVENT_TYPES.APPLICATION_SUBJECT_UPDATE,{value:u,guid:r,forced:!!f&&!m})))};return n.addDisposable(a.messageService.addListenerAsync(a.EVENT_TYPES.SANDBOX_SUBJECT_UPDATE,c)),n.addDisposable(a.messageService.addListenerAsync(a.EVENT_TYPES.SANDBOX_INIT_START,l)),n.addDisposable(a.messageService.addListenerAsync(a.EVENT_TYPES.SANDBOX_INITED,s)),n.addDisposable(e.onChange(()=>{if(i){if(Hr(t))return;const d=Go()||"";d!==t&&(t=d,a.messageService.send(a.EVENT_TYPES.APPLICATION_SUBJECT_UPDATE,{value:d,guid:r}))}})),n}var td=[{type:"in-line-style",name:"color"},{type:"in-line-style",name:"border-color"},{type:"in-line-style",name:"background-color"},{type:"attribute",name:"bgcolor"}],od={"in-line-style":e=>({selector:`[style~="${e}:"]`,toColor:o=>window.getComputedStyle(o).getPropertyValue(e)}),attribute:e=>({selector:`[${e}]`,toColor:o=>o.getAttribute(e)})},nd=/^#[\da-f]{6}$/i,Fr=()=>[...new Set(td.flatMap(rd).map(a.rgbToHex).filter(e=>nd.test(e)).map(e=>e.toUpperCase()))];function rd({type:e,name:o}){const t=od[e],{selector:n,toColor:r}=t(o);return Array.from(document.querySelectorAll(n)).map(r)}function id(e,o,t){const n=new a.Disposable,r=i=>{if(window.getSelection){let s=window.getSelection();if(s?.getRangeAt&&s.rangeCount){let c=s.getRangeAt(0);c.deleteContents();const d=document.createElement("div");d.innerHTML=o.escape(i);const u=document.createDocumentFragment();let g;for(;g=d.firstChild;)u.appendChild(g);c.insertNode(u)}e.commit(!1)}let l=document.querySelector("[em-edit]");l&&t(l)};return n.addDisposable(a.messageService.addListener(a.EVENT_TYPES.SANDBOX_ADD_MERGETAG,r)),n}var ld=e=>{for(const o of Object.keys(a.fontValues))if(a.toEmFontClassToken(o)===e)return o;return e};function ad(e){const o=document.querySelector('style[em="styles"]'),t=o?.textContent??"",n=new Set(a.getProjectFontFaces(e).filter(i=>i.stylesheet).map(i=>i.source_url)),r=a.readFontFaceBlocks(t).filter(i=>i.family.toLowerCase()===e.toLowerCase()&&n.has(i.src));o&&r.length&&(o.textContent=a.removeFontFaceBlocks(t,r),a.logProjectFonts("iframe: dropped stylesheet @font-face",{family:e,count:r.length}))}function sd(e){if(!a.hasProjectFonts())return;const o=document.head.innerHTML,t=new Set;for(const n of a.getProjectFontEntries()){ad(n.family);const r=`em-font-${a.toEmFontClassToken(n.family)}-`;document.querySelectorAll(`[class*="${r}"]`).forEach(i=>{[...i.classList].forEach(l=>{if(!l.startsWith(r)||t.has(l))return;t.add(l);const s=l.slice(r.length),c=ld(s);a.addFontFamilyClass({fontFamilyArray:["Google Fonts","Project Fonts",n.family,c]})})})}t.size>0&&a.logProjectFonts("iframe: hydrated project @font-face from DOM classes",{classes:[...t],families:a.getProjectFontEntries().map(n=>n.family)}),a.clearProjectFontFaces(),e&&document.head.innerHTML!==o&&e(!1)}function cd(e,o){const t=new a.Disposable,n=()=>{requestAnimationFrame(()=>{sd(o)})};return t.addDisposable(a.messageService.addListener(a.EVENT_TYPES.SANDBOX_SET_PROJECT_FONTS,n)),t.addDisposable(e.onReady(n)),t}function dd(e,o,t){const n=new a.Disposable;let r=[];return n.addDisposable(e.beforeChange(({treeMutations:i})=>{o.isEditorInFocus&&r.push(...i)})),n.addDisposable(o.editorLostFocus(()=>{if(r.length){const i=[];for(const l of r){const s=l.type;let c=null;s==="Add"?c=l.node:s==="Update"&&(c=l.next),c?.closed===!1&&i.push(c)}i.length&&(e.correctNodes(i),t.saveChanges(!1)),r=[]}})),n}function md(e){const{container:o}=e;a.AppImpl.registerAll({MessageService:()=>a.messageService,FocusState:()=>e.focusController,SyncService:()=>o.getInstance(a.HTML_DOCUMENT_ID),SyncServiceInternals:()=>o.getInstance(a.REMOTE_DOCUMENT_ID),TextDocument:()=>o.getInstance(a.TEXT_DOCUMENT_ID),Mapping:()=>o.getInstance(a.DOCUMENT_MAPPING_ID)}),e.features&&e.features.length>0&&a.AppImpl.initFeatures(e.features)}var ud="confetti:open-settings",fd="confetti:start",pd="confetti:stop",gd="confetti:complete",bd=class{constructor(e){a._defineProperty(this,"_app",void 0),a._defineProperty(this,"_state","idle"),a._defineProperty(this,"_activeEffects",new Map),a._defineProperty(this,"_onDocumentClick",o=>{const t=o.target;if(!t)return;const n=t.closest(".confetti-placeholder");if(!n)return;const r=n.getAttribute("data-confetti-preset")||void 0;this._app.use("MessageService").send(ud,{preset:r})}),this._app=e}init(){const e=this._app.use("MessageService");e.addListener(fd,o=>this._handleStart(o.id,o.options)),e.addListener(pd,o=>this._handleStop(o.id)),document.addEventListener("click",this._onDocumentClick,!0)}_handleStart(e,o){const t={id:e,options:o,startTime:Date.now()};this._activeEffects.set(e,t),this._state="running",this.onEffectStart(e,o),this.renderConfetti(e,o);const n=o.duration||3e3;setTimeout(()=>{this._completeEffect(e)},n)}_handleStop(e){if(this._state="stopping",e==="all")for(const o of this._activeEffects.keys())this._completeEffect(o,!0);else this._completeEffect(e,!0)}_completeEffect(e,o=!1){this._activeEffects.get(e)&&(this._activeEffects.delete(e),this.clearConfetti(e,o),this.onEffectComplete(e),this._activeEffects.size===0&&(this._state="idle"),this._app.use("MessageService").send(gd,{id:e}))}onEffectStart(e,o){}onEffectComplete(e){}getState(){return this._state}isRunning(){return this._state==="running"}dispose(){document.removeEventListener("click",this._onDocumentClick,!0),this._handleStop("all"),this._activeEffects.clear()}},hd=class extends bd{constructor(e){super(e),a._defineProperty(this,"_containers",new Map)}renderConfetti(e,o){const t=this._getRenderBounds(),n=document.createElement("div");n.id=`confetti-${e}`,n.setAttribute("data-confetti-overlay","true"),n.style.cssText=`
170
170
  position: absolute;
171
171
  top: ${t.top}px;
172
172
  left: ${t.left}px;
@@ -250,34 +250,34 @@ __useblocks__.define("js/iframe.js",["require","exports","module","js/rolldown-r
250
250
  ${E.join("")}
251
251
  ${y.join("")}
252
252
  </svg>
253
- `}_getRenderBounds(){const e=this._getPlaceholderElement();if(e){const n=e.getBoundingClientRect(),r=320,i=220,l=Math.max(document.documentElement.clientWidth,window.innerWidth||0),s=Math.max(document.documentElement.clientHeight,window.innerHeight||0),c=n.right+12,d=n.left-r-12,u=c+r<=l?c:Math.max(8,d);return{top:Math.min(Math.max(8,n.top+n.height/2-i/2),Math.max(8,s-i-8))+window.scrollY,left:u+window.scrollX,width:r,height:i}}const o=this._getRenderRoot();if(!o)return{top:window.scrollY,left:window.scrollX,width:Math.max(window.innerWidth,800),height:Math.max(window.innerHeight,600)};const t=o.getBoundingClientRect();return{top:t.top+window.scrollY,left:t.left+window.scrollX,width:Math.max(Math.ceil(o.scrollWidth||t.width),Math.ceil(t.width),320),height:Math.max(Math.ceil(o.scrollHeight||t.height),Math.ceil(t.height),240)}}_getRenderRoot(){for(const e of['[em="block-contaner"]',".es-wrapper-color",".es-content-body",".es-content","body > table","body > div"]){const o=document.querySelector(e);if(o instanceof HTMLElement)return o}return document.body}_getPlaceholderElement(){const e=document.querySelector(".confetti-placeholder");return e instanceof HTMLElement?e:null}onEffectStart(e,o){}onEffectComplete(e){}dispose(){for(const e of this._containers.values())e.remove();this._containers.clear(),super.dispose()}},gd=[pd];function bd(e,o){const t=o==="sup"?"sub":"sup";e.querySelectorAll(`${o}, ${t}`).forEach(n=>{const r=n.parentNode;if(r){for(;n.firstChild;)r.insertBefore(n.firstChild,n);n.remove()}})}function hd(e,o,t){const n=document.createElement(t);try{if(typeof o=="string")n.textContent=o||e.toString();else if(o instanceof DocumentFragment)n.appendChild(o);else if(o instanceof HTMLElement)for(;o.firstChild;)n.appendChild(o.firstChild);else n.textContent=e.toString();e.deleteContents(),e.insertNode(n)}catch{return null}return n}function yd(e){const o=e.parentNode;if(!o)return document.createTextNode("");if(Array.from(e.childNodes).some(t=>t.nodeType===1)){const t=document.createDocumentFragment(),n=Array.from(e.childNodes);for(;e.firstChild;)t.appendChild(e.firstChild);return o.replaceChild(t,e),n[0]||document.createTextNode("")}else{const t=e.textContent||"",n=document.createTextNode(t);return o.replaceChild(n,e),n}}function Ed(e,o,t){if(!e)return!1;const n=e.textContent?.trim()||"";let r="";if(t){const i=o.cloneRange(),l=i;try{l.expand&&l.expand("word"),r=i.toString().trim()}catch{return!1}}else r=o.toString().trim();return n===r}function Sd(e,o){const t=e.textContent||"",n=o.toString(),r=o.startOffset,i=o.endOffset,l=document.createTextNode(t.slice(0,r)),s=document.createTextNode(n),c=document.createTextNode(t.slice(i)),d=e.parentNode;return d&&(d.insertBefore(l,e),d.insertBefore(s,e),c.textContent&&d.insertBefore(c,e),e.remove()),o.setStart(s,0),o.setEnd(s,s.length),s}function Cd(e,o=[]){const t=[...new Set(["strong","em","b","i","u","sub","sup","strike",...o])].join(", ");e.querySelectorAll(t).forEach(n=>{!n.textContent?.trim()&&(!n.hasChildNodes()||Array.from(n.childNodes).every(r=>r.nodeType===Node.TEXT_NODE&&!r.textContent?.trim()))&&n.remove()})}function vd(e,o=10){const t=e.length;return t===0?!1:(e.match(/[а-яА-ЯёЁ]/g)||[]).length/t*100>o}var Ad={bold:"strong|s|b",italic:"em|i",strike:"strike",underline:"u",strikeUnderline:"strike|u"};function Ht(e,o){const t=Ad[o]||o,n=new RegExp(`<\\/?(${t})>`,"gi");return e.replaceAll(n,"")}var Td=["strong","em","strike","sub","sup","b","i","s","u"];function Ld(e,o){if(o)for(const t of Td)o.closest(t)&&e.querySelectorAll(t).forEach(n=>{const r=n.parentNode;if(r){for(;n.firstChild;)r.insertBefore(n.firstChild,n);n.remove()}})}function wd(e,o){o&&o.closest("a")&&e.querySelectorAll("a").forEach(t=>{const n=t.parentNode;if(n){for(;t.firstChild;)n.insertBefore(t.firstChild,t);t.remove()}})}var kd="./js/sanitize-html/sanitize-html.js",qr="data-sanitize-html-loader",mo=null,It=null;function _d(){return new URL(kd,document.baseURI||window.location.href).href}function Xo(){const e=globalThis.sanitizeHtml;return typeof e!="function"||!("defaults"in e)?null:e}function Nd(){if(Xo())return Promise.resolve();const e=_d();return document.querySelector(`script[${qr}]`)?It??Promise.resolve():(It||(It=new Promise((o,t)=>{const n=document.createElement("script");n.src=e,n.async=!0,n.setAttribute(qr,"true"),n.onload=()=>o(),n.onerror=()=>{n.remove(),It=null,t(new Error(`Failed to load sanitize-html script: ${e}`))},document.head.appendChild(n)})),It)}async function Bd(){const e=Xo();return e||(mo||(mo=(async()=>{await Nd();const o=Xo();if(o)return o;throw new Error("sanitizeHtml not available after script load")})().catch(o=>{throw mo=null,o})),mo)}async function Wr(e,o=!1,t,n,r){e.preventDefault(),e.stopPropagation();try{const i=e.clipboardData||window.clipboardData;if(!i)return;let l=i.getData("text/html");if(!l||o)l=i.getData("text/plain"),l=l.replace(/\n/g,"<br>");else{const c=t?.text?.fontSize||16;let d=(await Bd())(l,{allowedTags:["strong","em","i","a","br","span","ul","ol","li","strike","sub","sup","s"],allowedAttributes:{a:["href"],span:["data-font-size","data-bold","data-italic"],strong:["data-italic"],ul:["data-list-type"],ol:["data-list-type","data-list-start"],li:["data-list-item"]},allowedStyles:{},transformTags:{span:function(h,y){let E="",S=!1,v=!1;if(y.style){const C=y.style.toLowerCase();(C.includes("font-weight: bold")||C.includes("font-weight:bold")||C.includes("font-weight: 700")||C.includes("font-weight:700"))&&(S=!0),(C.includes("font-style: italic")||C.includes("font-style:italic"))&&(v=!0),C.includes("text-decoration: underline")||C.includes("text-decoration:underline"),S&&v?(E="strong",y["data-italic"]="true"):S?E="strong":v&&(E="em")}return{tagName:E||"",attribs:y}},h1:function(h,y){return y["data-font-size"]=Math.round(1.5*c).toString(),y.style&&(y.style.toLowerCase().includes("font-style: italic")||y.style.toLowerCase().includes("font-style:italic"))&&(y["data-italic"]="true"),{tagName:"span",attribs:y}},h2:function(h,y){return y["data-font-size"]=Math.round(1.25*c).toString(),y.style&&(y.style.toLowerCase().includes("font-style: italic")||y.style.toLowerCase().includes("font-style:italic"))&&(y["data-italic"]="true"),{tagName:"span",attribs:y}},h3:function(h,y){return y["data-font-size"]=Math.round(1.125*c).toString(),y.style&&(y.style.toLowerCase().includes("font-style: italic")||y.style.toLowerCase().includes("font-style:italic"))&&(y["data-italic"]="true"),{tagName:"span",attribs:y}},h4:function(h,y){return y["data-font-size"]=c.toString(),y["data-bold"]="true",y.style&&(y.style.toLowerCase().includes("font-style: italic")||y.style.toLowerCase().includes("font-style:italic"))&&(y["data-italic"]="true"),{tagName:"span",attribs:y}},h5:function(h,y){return y["data-font-size"]=Math.round(.875*c).toString(),y.style&&(y.style.toLowerCase().includes("font-style: italic")||y.style.toLowerCase().includes("font-style:italic"))&&(y["data-italic"]="true"),{tagName:"span",attribs:y}},ul:function(h,y){return y["data-list-type"]="unordered",delete y.style,delete y["margin-top"],delete y["margin-bottom"],delete y["padding-inline-start"],{tagName:"ul",attribs:y}},ol:function(h,y){return y["data-list-type"]="ordered",y.start&&(y["data-list-start"]=y.start),delete y.style,delete y.start,{tagName:"ol",attribs:y}},li:function(h,y){return y["data-list-item"]="true",delete y.style,delete y.dir,delete y["aria-level"],delete y["list-style-type"],{tagName:"li",attribs:y}},p:function(h,y){return{tagName:"br",attribs:{}}},div:"br",b:function(h,y){if(y.style){const E=y.style.toLowerCase();return E.includes("font-weight: bold")||E.includes("font-weight:bold")||E.includes("font-weight: 700")||E.includes("font-weight:700")?{tagName:"strong"}:!1}return{tagName:"strong"}},i:function(h,y){if(y.style){const E=y.style.toLowerCase();return E.includes("font-style: italic")||E.includes("font-style:italic")?{tagName:"em"}:!1}return{tagName:"em"}},s:function(h,y){return{tagName:"strike",attribs:y}}},textFilter:function(h){return h.replace(/\s+/g," ")}});d=d.replace(/<[^\/>][^>]*>\s*<\/[^>]+>/g,"").replace(/(<br\s*\/?>){2,}/g,"<br>").trim();const u=document.createElement("div");u.innerHTML=d,(h=>{h.querySelectorAll("ul[data-list-type], ol[data-list-type]").forEach((y,E)=>{const S=y.getAttribute("data-list-type")==="ordered",v=y.querySelectorAll("li[data-list-item]");let C=1;S&&y.getAttribute("data-list-start")&&(C=parseInt(y.getAttribute("data-list-start"),10)||1);const L=document.createDocumentFragment(),w=y.previousSibling;w&&(w.nodeType===Node.TEXT_NODE&&w.textContent.trim()!==""||w.nodeType===Node.ELEMENT_NODE&&w.tagName!=="BR")&&L.appendChild(document.createElement("br")),v.forEach((A,M)=>{const R=document.createElement("span");R.innerHTML=S?`${C}. `:"• ",L.appendChild(R),(J=>{const _=document.createElement("div");_.innerHTML=J.innerHTML;let G=_.firstChild;for(;G&&G.nodeType===1&&G.tagName==="BR";)_.removeChild(G),G=_.firstChild;if(!_.hasChildNodes()){const H=document.createTextNode("");_.appendChild(H)}for(;_.firstChild;)L.appendChild(_.firstChild)})(A),M<v.length-1&&L.appendChild(document.createElement("br")),C++}),y.parentNode.replaceChild(L,y)}),h.querySelectorAll("[data-list-type], [data-list-item], [data-list-start]").forEach(y=>{y.removeAttribute("data-list-type"),y.removeAttribute("data-list-item"),y.removeAttribute("data-list-start")})})(u),u.firstChild&&u.firstChild.nodeType===Node.ELEMENT_NODE&&u.firstChild.tagName==="BR"&&u.removeChild(u.firstChild),u.querySelectorAll("[data-font-size]").forEach(h=>{let y=`font-size: ${h.getAttribute("data-font-size")}px;`;h.getAttribute("data-bold")==="true"&&(y+=" font-weight: bold;"),h.getAttribute("data-italic")==="true"&&(y+=" font-style: italic;"),h.setAttribute("style",y),h.removeAttribute("data-font-size"),h.removeAttribute("data-bold"),h.removeAttribute("data-italic")}),u.querySelectorAll("[data-italic]").forEach(h=>{const y=document.createElement("em");y.innerHTML=h.innerHTML,h.innerHTML="",h.appendChild(y),h.removeAttribute("data-italic")}),u.querySelectorAll("a").forEach(h=>{const y=h.getAttribute("href");if(!y||y.trim()==="")h.replaceWith(...h.childNodes);else{h.setAttribute("target","_blank");const E=t?.links?.color??"#1C52DC",S=t?.links?.underline??!0?"underline":"none";h.setAttribute("style",`color: ${E}; text-decoration: ${S};`)}});const m=u.querySelectorAll("*");let f=0;m.forEach(h=>{h.tagName!=="BR"&&h.tagName!=="SPAN"&&h.textContent.replace(/[\u200B-\u200F\uFEFF\u2000-\u200A\u2028\u2029\u2060\u00A0\u1680\u180E]/g,"").trim()===""&&(h.parentNode.removeChild(h),f++)}),u.querySelectorAll("span").forEach(h=>{h.innerHTML==="• "||/^\d+\.&nbsp;$/.test(h.innerHTML)||h.textContent.replace(/[\u200B-\u200F\uFEFF\u2000-\u200A\u2028\u2029\u2060\u00A0\u1680\u180E]/g,"").trim()===""&&h.children.length===0&&(h.parentNode.removeChild(h),f++)});const p=window.getSelection(),b=p?.anchorNode?.nodeType===Node.ELEMENT_NODE?p.anchorNode:p?.anchorNode?.parentElement||null;Ld(u,b),wd(u,b),l=u.innerHTML}const s=window.getSelection();if(s&&s.rangeCount>0){const c=s.getRangeAt(0);c.deleteContents();const d=document.createRange().createContextualFragment(l);c.insertNode(d),c.collapse(!1)}}catch{const l=(e.clipboardData||window.clipboardData).getData("text/plain");document.execCommand("insertText",!1,l)}n(e),r()}var $r=Promise.resolve(),zr=null;function Md(e,o){const{HTMLDocument:t,documentMapping:n,remoteDocument:r,messageService:i}=o;let l=t.getRangeByElement(e,!0);if(l){const s=n.getMappedReplacementRangeAtPosition(l.start)||n.getMappedReplacementRangeAtPosition(Math.max(l.end-1,l.start));s&&(l=s),l=n.correctRange(l),l=r.correctRange(l);const c={operation:"update_position_from_iframe",data:l};i.send(c)}}function Rd(e,o){zr=e,$r=$r.finally(()=>{zr===e&&Md(e,o)})}var Vr="application/x-emailmaker-social-reorder";function Zo(e){return e.closest('table[em-type="social"]')}function Ur(e){return(e.querySelector('table[role="presentation"]')||e.querySelector("table"))?.querySelector("tr")}function jr(e){return Array.from(e.querySelectorAll(":scope > td[em-platform], :scope > td[data-em-platform]"))}function Pd(e){return Array.from(e.querySelectorAll(":scope > td:not([em-platform]):not([data-em-platform])")).find(o=>{const t=o;return t.getAttribute("width")!=null||t.innerHTML==="&nbsp;"||t.textContent===" "})}function Hd(e,o){const t=Pd(e);e.replaceChildren(),o.forEach((n,r)=>{r>0&&t&&e.appendChild(t.cloneNode(!0)),n.removeAttribute("em-index"),n.removeAttribute("data-em-index"),e.appendChild(n)})}function Id(e,o){if(o.lockEditor)return;const t=e.target?.closest?.("td[em-platform], td[data-em-platform]");if(!t||t.getAttribute("draggable")!=="true")return;const n=Zo(t);if(!n)return;const r=Ur(n);if(!r)return;const i=jr(r);if(i.length<2)return;const l=i.indexOf(t);if(l<0)return;const s=e.dataTransfer;if(!s)return;const c=String(l);s.setData("text/plain",c),s.setData(Vr,c),s.effectAllowed="move"}function Od(e,o){const t=e.dataTransfer;if(!t||!Array.from(t.types||[]).includes("application/x-emailmaker-social-reorder"))return!1;let n=t.getData(Vr);n||(n=t.getData("text/plain"));const r=parseInt(n,10);if(Number.isNaN(r))return!1;const i=e.target.closest?.("td[em-platform], td[data-em-platform]");if(!i)return!1;const l=Zo(i);if(!l)return!1;const s=Ur(l);if(!s)return!1;const c=jr(s);if(c.length<2)return!1;const d=c.indexOf(i);if(d<0)return!1;const u=c[r];if(!u||Zo(u)!==l)return!1;if(r===d)return!0;const g=[...c];return g.splice(r,1),g.splice(d,0,u),Hd(s,g),l.setAttribute("em-edit","active"),o.applicationElementSettingsSet({elem:l}),!0}function xd(e){if(!e)return{backgroundColor:void 0,backgroundImage:void 0,backgroundPositionX:void 0,backgroundPositionY:void 0,backgroundRepeat:void 0,backgroundSize:void 0};const o={};if(e.style.backgroundColor?o.backgroundColor=e.style.backgroundColor:e.getAttribute("bgcolor")&&(o.backgroundColor=e.getAttribute("bgcolor")||void 0),e.style.backgroundImage){const t=e.style.backgroundImage;o.backgroundImage=[{type:"url",value:t?t.substring(5,t.length-2):""}]}else e.getAttribute("background")&&(o.backgroundImage=[{type:"url",value:e.getAttribute("background")||""}]);return o.backgroundPositionX=e.style.backgroundPositionX||void 0,o.backgroundPositionY=e.style.backgroundPositionY||void 0,o.backgroundRepeat=e.style.backgroundRepeat||void 0,o.backgroundSize=e.style.backgroundSize||void 0,o}function Dd(e){if(e){if(document.querySelector(".es-header")||document.querySelector(".es-content")||document.querySelector(".es-footer")){const o=e.querySelector(".es-content"),t=e.querySelector(".es-content-body");return parseFloat(o?.style.width||"")||parseFloat(t?.style.width||"")||void 0}if(document.querySelector(".nl-container")&&document.querySelector(".row")){const o=document.querySelector(".row-content");return parseFloat(o?.style.width||"")||parseFloat(o?.getAttribute("width")||"")||void 0}if(document.querySelector(".nl-container")&&!document.querySelector(".row")){const o=e.querySelector('[style*="max-width"]');return parseFloat(o?.style.maxWidth||"")||void 0}if(document.querySelector('[class*="letteros"]')||document.querySelector("[letteros-link]")){const o=e.querySelector("table:first-child");if(o?.style.maxWidth)return parseFloat(o.style.maxWidth)||void 0}if(document.querySelector(".container-div")){const o=e.querySelector("div:first-child");if(o?.style.maxWidth)return parseFloat(o.style.maxWidth)||void 0}if(document.querySelector(".email-container")){const o=document.querySelector(".email-container");return parseFloat(o?.getAttribute("width")||"")||void 0}return Fd(e)}}function Fd(e){const o=e.querySelector("table:first-child");if(!o)return;const t=parseFloat(o.getAttribute("width")||""),n=parseFloat(o.style.maxWidth||"");if(t>700||n>700){const i=e.querySelector('table:first-child [em="block"] > td > table');if(i){const l=i.getAttribute("width");return l&&l.indexOf("%")===-1?parseFloat(l):i.style.maxWidth?parseFloat(i.style.maxWidth):e.querySelector('table:first-child [em="block"]')?.clientWidth||660}return 660}const r=o.getAttribute("width");if(r&&r.indexOf("%")===-1)return parseFloat(r);if(o.style.maxWidth)return parseFloat(o.style.maxWidth)}function qd(e,o){const t={shutdown:void 0,styles:!0};if(!e||!o)return t;const n=e.querySelector("table:first-child");if(!n)return t;const r=n.getAttribute("width"),i=parseFloat(n.style.minWidth||"");return r&&r.indexOf("%")===-1&&i===parseFloat(r)||e.querySelector(".noresp-em-narrow-table")?{shutdown:!1,styles:!1}:{shutdown:!0,styles:!0}}function Wd(e,o){!e||!o||document.querySelector(".noresp-em-narrow-table, .em-narrow-table")&&(e.getBoundingClientRect().width<=o||document.querySelectorAll("img").forEach(t=>{const n=t.closest("td")?.getBoundingClientRect().width;n&&parseFloat(t.getAttribute("width")||"")>n&&n>10&&t.style.display!=="none"&&(t.setAttribute("width",String(Math.ceil(n))),t.style.maxWidth=Math.ceil(n)+"px")}))}function $d(e){const o=e.findGlobalHolder();e.setGlobalHolder(o);const t={operation:"application_email_settings_set",settings:{subject:e.getSubject(),preheader:e.getPreheader(),responsive:{shutdown:void 0,styles:!0},structuresMedia:!(document.querySelector('[em="block"] div[style*="display: inline-block"]')&&!document.querySelector('[em="block"] .em-mob-wrap, [em="block"] .noresp-em-mob-wrap')),usedColors:e.getUsedColors(),noBlocks:!1,width:{value:void 0,dim:"px"},backgroundColor:void 0,backgroundImage:void 0,backgroundPositionX:void 0,backgroundPositionY:void 0,backgroundRepeat:void 0,backgroundSize:void 0,backgroundColorContent:void 0}};if(o){const s=xd(o);s.backgroundColor&&s.backgroundColor.startsWith("rgb")&&(s.backgroundColor=e.rgbToHex(s.backgroundColor)),Object.assign(t.settings,s)}e.elMarkupHelper(),document.querySelector('[em="block"]')||(t.settings.noBlocks=!0);const n=Dd(o),r=e.state.get("emailWidth"),i=e.getEmailWidth(),l=typeof r=="number"&&r>=320?r:typeof i=="number"&&i>=320?i:n;t.settings.width.value=l,o&&(t.settings.responsive=qd(o,l),typeof l=="number"&&e.state.set("emailWidth",l)),e.messageService.send(t),Wd(o,e.getEmailWidth())}function zd(e,o=!1){e.state.set("lockEditorInit",!0),document.body&&(e.removeHiddenClasses(document),$d(e),e.commit(!1))}function Vd(e,o){const t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);let n=0,r=null;for(;t.nextNode();){r=t.currentNode;const i=(r.textContent||"").length;if(n+i>=o){const l=o-n;return{node:r,offset:l}}n+=i}if(r){const i=r.textContent?.length||0;return{node:r,offset:i}}return null}function Ud(e,o,t,n){try{if(!t||t.nodeType!==Node.TEXT_NODE)return!1;const r=t.textContent?t.textContent.length:0,i=Math.min(Math.max(0,n),r);return e.setStart(t,i),e.collapse(!0),o.removeAllRanges(),o.addRange(e),!0}catch{return!1}}var jd=["style","class","align","href"],Gd=32;function Yd(e){return!!(e.tagName==="BODY"||e.getAttribute("em")==="atom"||e.tagName==="TABLE"&&e.hasAttribute("em"))}function Kd(e){const o=[e.tagName];for(const t of jd){const n=e.getAttribute(t);n!==null&&n!==""&&o.push(`${t}=${n}`)}return o.join("|")}function Ot(e){if(!e||!e.isConnected)return"";const o=[];let t=e,n=0;for(;t&&n<Gd&&(o.push(Kd(t)),!Yd(t));)t=t.parentElement,n++;return o.join("||")}var Xd=[{name:"Stripo (es-header/content/footer)",detect:()=>!!(document.querySelector(".es-header")||document.querySelector(".es-content")||document.querySelector(".es-footer")),apply:()=>{document.querySelectorAll(".es-header, .es-content, .es-footer").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll(".es-header-body > tr").forEach(e=>{e.setAttribute("em","block")}),document.querySelectorAll(".es-content-body > tr").forEach(e=>{e.setAttribute("em","block")}),document.querySelectorAll(".es-footer-body > tr").forEach(e=>{e.setAttribute("em","block")})}},{name:"Stripo (es-wrapper)",detect:()=>!!document.querySelector(".es-wrapper"),apply:()=>{document.querySelectorAll(".es-wrapper > tr > td > table > tr").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll(".es-wrapper > tr > td > table > tr > td > table > tr").forEach(e=>{e.setAttribute("em","block")})}},{name:"Sandsay",detect:()=>!!(document.querySelector("[data-template-wrapper]")&&document.querySelector("[data-template-content]")),apply:()=>{document.querySelectorAll("[data-template-wrapper] > table[data-block-id]").forEach(e=>{e.setAttribute("em","block")})}},{name:"Beefree",detect:()=>!!(document.querySelector(".nl-container")&&document.querySelector(".row")),apply:()=>{document.querySelectorAll('.row[em="block"]').forEach(e=>{e.removeAttribute("em")}),document.querySelectorAll(".row").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll(".row-content").forEach(e=>{e.setAttribute("em","block")})}},{name:"Chamaileon",detect:()=>!!document.querySelector(".main-container"),apply:()=>{document.querySelectorAll(".main-container > tr > td > table").forEach(e=>{e.setAttribute("em","block")})}},{name:"Chamaileon (email-container)",detect:()=>!!document.querySelector(".email-container"),apply:()=>{document.querySelectorAll(".email-container > tr > td > table > tr > td > table > tr").forEach(e=>{e.setAttribute("em","block")})}},{name:"Mindbox",detect:()=>!!(document.querySelector(".nl-container")&&!document.querySelector(".row")),apply:()=>{document.querySelectorAll(".nl-container > tr > td > div").forEach(e=>{e.setAttribute("em","block")})}},{name:"Unlayer",detect:()=>!!(document.querySelector(".clean-body.u_body")&&!document.querySelector(".row")),apply:()=>{document.querySelectorAll(".u-row-container").forEach(e=>{e.setAttribute("em","block")})}},{name:"Postcards",detect:()=>!!(document.querySelector(".pc-email-body")&&!document.querySelector(".row")),apply:()=>{document.querySelectorAll('.pc-email-container > tr > td > table[role="presentation"]').forEach(e=>{e.setAttribute("em","block")})}},{name:"Topol",detect:()=>!!(document.querySelector(".hide_section_on_mobile")||document.querySelector(".mj-column-per-100")||document.querySelector(".outlook-group-fix")),apply:()=>{document.querySelectorAll("body > div > div").forEach(e=>{e.setAttribute("em","block")})}},{name:"Sender",detect:()=>!!document.querySelector(".e-c.sect"),apply:()=>{document.querySelectorAll(".e-c.sect").forEach(e=>{e.setAttribute("em","block")})}},{name:"Letteros",detect:()=>!!(!document.querySelector("[mailfit-module]")&&(document.querySelector('[class*="letteros"]')||document.querySelector("[letteros-link]"))),apply:()=>{document.querySelectorAll("body > div > table > tr").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll("body > div > table > tr > td > table > tr").forEach(e=>{e.setAttribute("em","block")}),document.querySelectorAll('[style*="overflow"]').forEach(e=>{e.style.removeProperty("overflow")})}},{name:"Letteros (letteros-element)",detect:()=>!!document.querySelector("[letteros-element]"),apply:()=>{document.querySelectorAll("[letteros-body]").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll("[letteros-element]").forEach(e=>{e.setAttribute("em","block")})}},{name:"Ascona",detect:()=>!!(document.querySelector(".mail_preheader")&&document.body.classList.contains("body")),apply:()=>{document.querySelectorAll("#mailsub > table > tr").forEach(e=>{e.setAttribute("em","group"),e.querySelectorAll(":scope > td > div > table > tr").forEach(o=>{o.setAttribute("em","block")})})}},{name:"Mailfit",detect:()=>!!document.querySelector("[mailfit-module]"),apply:()=>{document.querySelectorAll("body > div > table > tr").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll("[mailfit-module]").forEach(e=>{e.setAttribute("em","block")})}},{name:"CashCowAgency",detect:()=>!!document.querySelector(".container-div"),apply:()=>{document.querySelectorAll("body > center").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll(".container-td > table").forEach(e=>{e.setAttribute("em","block")})}},{name:"MakeMail",detect:()=>!!(document.querySelector(".mail")&&document.querySelector(".container")),apply:()=>{document.querySelectorAll(".container").forEach(e=>{e.setAttribute("em","block")})}},{name:"data-axle.com",detect:()=>!!document.querySelector(".full-width-container-inner"),apply:()=>{document.querySelectorAll(".full-width-container-inner > table").forEach(e=>{e.setAttribute("em","block")})}},{name:"Miro",detect:()=>!!document.querySelector(".content__tablet_fullWidth"),apply:()=>{document.querySelectorAll(".content__tablet_fullWidth").forEach(e=>{for(const o of Array.from(e.children))if(o.children.length>1)for(const t of Array.from(o.children))t.setAttribute("em","block");else for(const t of Array.from(o.children))for(const n of Array.from(t.children))for(const r of Array.from(n.children))r.setAttribute("em","block")})}},{name:"WIM (full-wrap)",detect:()=>!!(document.body.classList.contains("body")&&document.querySelector("[alink]")&&document.querySelector(".full-wrap")),apply:()=>{document.querySelectorAll(".full-wrap > tr > td > div > table > tr").forEach(e=>{e.setAttribute("em","group"),e.querySelectorAll(":scope > td > div > table > tr, :scope > td > table > tr").forEach(o=>{o.setAttribute("em","block")})})}},{name:"WIM",detect:()=>!!(document.body.classList.contains("body")&&document.querySelector("[alink]")&&!document.querySelector(".full-wrap")),apply:()=>{document.querySelectorAll('body > table > tr > td > table > tr, body > div[style*="-webkit-text-size-adjust"] > table > tr > td > table > tr, body > table > tbody > tr > td > table > tbody > tr, body > div[style*="-webkit-text-size-adjust"] > table > tbody > tr > td > table > tbody > tr').forEach(e=>{e.setAttribute("em","group"),e.querySelectorAll(":scope > td > table > tr > td > table > tr").forEach(o=>{o.setAttribute("em","block")})})}},{name:"Emailify",detect:()=>document.body.classList.contains("emailify"),apply:()=>{document.querySelectorAll("body > div > div > table > tr").forEach(e=>{e.setAttribute("em","block")})}}];function Zd(){document.querySelectorAll('body > table > tr, body > div[style*="-webkit-text-size-adjust"] > table > tr').forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll('body > table > tr > td > table > tr, body > div[style*="-webkit-text-size-adjust"] > table > tr > td > table > tr, body > table > tbody > tr > td > table > tbody > tr, body > div[style*="-webkit-text-size-adjust"] > table > tbody > tr > td > table > tbody > tr').forEach(e=>{e.setAttribute("em","block")})}function Jd(e){const o=document.querySelector("[em=blocks]");if(o){for(const n of Array.from(o.children))n.setAttribute("em","block");o.removeAttribute("em"),a.commit();return}if(e){let n=!1;for(const r of Xd)if(r.detect()){r.apply(),n=!0;break}n||Zd()}const t=document.querySelector("[em=atoms]");if(t){for(const n of Array.from(t.children))n.setAttribute("em","atom");t.removeAttribute("em")}document.documentElement?.style.height&&document.documentElement.style.removeProperty("height"),document.body?.style.height&&document.body.style.removeProperty("height"),document.querySelector(".em-narrow-table, .noresp-em-narrow-table")||a.messageService.send({operation:"application_template_not_em_alert_show"}),a.commit()}function Qd(e,o){const{target:t}=e;setTimeout(()=>{const n=t?.querySelector("a");if(!n)return;const r=n.closest("div, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub");r&&(r.childNodes.forEach(i=>{if(i.nodeType===Node.COMMENT_NODE&&i.nodeValue?.includes("[if mso]")){const l=n.innerHTML.length*11+40;i.nodeValue=i.nodeValue.replace(/(<center[^>]*>)(.*?)(<\/center>)/s,(s,c,d,u)=>c+n.innerHTML+u).replace(/(width:)(\d+)(px)/,(s,c,d,u)=>`${c}${l}${u}`)}}),o(!1))},0)}function em(e,o){if(!e||!e.length)return;let t=document.head.querySelector('style[em="styles"]'),n="";t?n=o.getInnerHtml(t):(t=document.createElement("style"),t.setAttribute("em","styles"),t=document.head.insertAdjacentElement("beforeend",t));const r=document.createElement("div");r.insertAdjacentHTML("afterbegin",e.join(`
253
+ `}_getRenderBounds(){const e=this._getPlaceholderElement();if(e){const n=e.getBoundingClientRect(),r=320,i=220,l=Math.max(document.documentElement.clientWidth,window.innerWidth||0),s=Math.max(document.documentElement.clientHeight,window.innerHeight||0),c=n.right+12,d=n.left-r-12,u=c+r<=l?c:Math.max(8,d);return{top:Math.min(Math.max(8,n.top+n.height/2-i/2),Math.max(8,s-i-8))+window.scrollY,left:u+window.scrollX,width:r,height:i}}const o=this._getRenderRoot();if(!o)return{top:window.scrollY,left:window.scrollX,width:Math.max(window.innerWidth,800),height:Math.max(window.innerHeight,600)};const t=o.getBoundingClientRect();return{top:t.top+window.scrollY,left:t.left+window.scrollX,width:Math.max(Math.ceil(o.scrollWidth||t.width),Math.ceil(t.width),320),height:Math.max(Math.ceil(o.scrollHeight||t.height),Math.ceil(t.height),240)}}_getRenderRoot(){for(const e of['[em="block-contaner"]',".es-wrapper-color",".es-content-body",".es-content","body > table","body > div"]){const o=document.querySelector(e);if(o instanceof HTMLElement)return o}return document.body}_getPlaceholderElement(){const e=document.querySelector(".confetti-placeholder");return e instanceof HTMLElement?e:null}onEffectStart(e,o){}onEffectComplete(e){}dispose(){for(const e of this._containers.values())e.remove();this._containers.clear(),super.dispose()}},yd=[hd];function Ed(e,o){const t=o==="sup"?"sub":"sup";e.querySelectorAll(`${o}, ${t}`).forEach(n=>{const r=n.parentNode;if(r){for(;n.firstChild;)r.insertBefore(n.firstChild,n);n.remove()}})}function Sd(e,o,t){const n=document.createElement(t);try{if(typeof o=="string")n.textContent=o||e.toString();else if(o instanceof DocumentFragment)n.appendChild(o);else if(o instanceof HTMLElement)for(;o.firstChild;)n.appendChild(o.firstChild);else n.textContent=e.toString();e.deleteContents(),e.insertNode(n)}catch{return null}return n}function Cd(e){const o=e.parentNode;if(!o)return document.createTextNode("");if(Array.from(e.childNodes).some(t=>t.nodeType===1)){const t=document.createDocumentFragment(),n=Array.from(e.childNodes);for(;e.firstChild;)t.appendChild(e.firstChild);return o.replaceChild(t,e),n[0]||document.createTextNode("")}else{const t=e.textContent||"",n=document.createTextNode(t);return o.replaceChild(n,e),n}}function vd(e,o,t){if(!e)return!1;const n=e.textContent?.trim()||"";let r="";if(t){const i=o.cloneRange(),l=i;try{l.expand&&l.expand("word"),r=i.toString().trim()}catch{return!1}}else r=o.toString().trim();return n===r}function Ad(e,o){const t=e.textContent||"",n=o.toString(),r=o.startOffset,i=o.endOffset,l=document.createTextNode(t.slice(0,r)),s=document.createTextNode(n),c=document.createTextNode(t.slice(i)),d=e.parentNode;return d&&(d.insertBefore(l,e),d.insertBefore(s,e),c.textContent&&d.insertBefore(c,e),e.remove()),o.setStart(s,0),o.setEnd(s,s.length),s}function Td(e,o=[]){const t=[...new Set(["strong","em","b","i","u","sub","sup","strike",...o])].join(", ");e.querySelectorAll(t).forEach(n=>{!n.textContent?.trim()&&(!n.hasChildNodes()||Array.from(n.childNodes).every(r=>r.nodeType===Node.TEXT_NODE&&!r.textContent?.trim()))&&n.remove()})}function Ld(e,o=10){const t=e.length;return t===0?!1:(e.match(/[а-яА-ЯёЁ]/g)||[]).length/t*100>o}var wd={bold:"strong|s|b",italic:"em|i",strike:"strike",underline:"u",strikeUnderline:"strike|u"};function Ht(e,o){const t=wd[o]||o,n=new RegExp(`<\\/?(${t})>`,"gi");return e.replaceAll(n,"")}var kd=["strong","em","strike","sub","sup","b","i","s","u"];function _d(e,o){if(o)for(const t of kd)o.closest(t)&&e.querySelectorAll(t).forEach(n=>{const r=n.parentNode;if(r){for(;n.firstChild;)r.insertBefore(n.firstChild,n);n.remove()}})}function Nd(e,o){o&&o.closest("a")&&e.querySelectorAll("a").forEach(t=>{const n=t.parentNode;if(n){for(;t.firstChild;)n.insertBefore(t.firstChild,t);t.remove()}})}var Bd="./js/sanitize-html/sanitize-html.js",qr="data-sanitize-html-loader",mo=null,It=null;function Md(){return new URL(Bd,document.baseURI||window.location.href).href}function Xo(){const e=globalThis.sanitizeHtml;return typeof e!="function"||!("defaults"in e)?null:e}function Rd(){if(Xo())return Promise.resolve();const e=Md();return document.querySelector(`script[${qr}]`)?It??Promise.resolve():(It||(It=new Promise((o,t)=>{const n=document.createElement("script");n.src=e,n.async=!0,n.setAttribute(qr,"true"),n.onload=()=>o(),n.onerror=()=>{n.remove(),It=null,t(new Error(`Failed to load sanitize-html script: ${e}`))},document.head.appendChild(n)})),It)}async function Pd(){const e=Xo();return e||(mo||(mo=(async()=>{await Rd();const o=Xo();if(o)return o;throw new Error("sanitizeHtml not available after script load")})().catch(o=>{throw mo=null,o})),mo)}async function Wr(e,o=!1,t,n,r){e.preventDefault(),e.stopPropagation();try{const i=e.clipboardData||window.clipboardData;if(!i)return;let l=i.getData("text/html");if(!l||o)l=i.getData("text/plain"),l=l.replace(/\n/g,"<br>");else{const c=t?.text?.fontSize||16;let d=(await Pd())(l,{allowedTags:["strong","em","i","a","br","span","ul","ol","li","strike","sub","sup","s"],allowedAttributes:{a:["href"],span:["data-font-size","data-bold","data-italic"],strong:["data-italic"],ul:["data-list-type"],ol:["data-list-type","data-list-start"],li:["data-list-item"]},allowedStyles:{},transformTags:{span:function(h,y){let E="",S=!1,v=!1;if(y.style){const C=y.style.toLowerCase();(C.includes("font-weight: bold")||C.includes("font-weight:bold")||C.includes("font-weight: 700")||C.includes("font-weight:700"))&&(S=!0),(C.includes("font-style: italic")||C.includes("font-style:italic"))&&(v=!0),C.includes("text-decoration: underline")||C.includes("text-decoration:underline"),S&&v?(E="strong",y["data-italic"]="true"):S?E="strong":v&&(E="em")}return{tagName:E||"",attribs:y}},h1:function(h,y){return y["data-font-size"]=Math.round(1.5*c).toString(),y.style&&(y.style.toLowerCase().includes("font-style: italic")||y.style.toLowerCase().includes("font-style:italic"))&&(y["data-italic"]="true"),{tagName:"span",attribs:y}},h2:function(h,y){return y["data-font-size"]=Math.round(1.25*c).toString(),y.style&&(y.style.toLowerCase().includes("font-style: italic")||y.style.toLowerCase().includes("font-style:italic"))&&(y["data-italic"]="true"),{tagName:"span",attribs:y}},h3:function(h,y){return y["data-font-size"]=Math.round(1.125*c).toString(),y.style&&(y.style.toLowerCase().includes("font-style: italic")||y.style.toLowerCase().includes("font-style:italic"))&&(y["data-italic"]="true"),{tagName:"span",attribs:y}},h4:function(h,y){return y["data-font-size"]=c.toString(),y["data-bold"]="true",y.style&&(y.style.toLowerCase().includes("font-style: italic")||y.style.toLowerCase().includes("font-style:italic"))&&(y["data-italic"]="true"),{tagName:"span",attribs:y}},h5:function(h,y){return y["data-font-size"]=Math.round(.875*c).toString(),y.style&&(y.style.toLowerCase().includes("font-style: italic")||y.style.toLowerCase().includes("font-style:italic"))&&(y["data-italic"]="true"),{tagName:"span",attribs:y}},ul:function(h,y){return y["data-list-type"]="unordered",delete y.style,delete y["margin-top"],delete y["margin-bottom"],delete y["padding-inline-start"],{tagName:"ul",attribs:y}},ol:function(h,y){return y["data-list-type"]="ordered",y.start&&(y["data-list-start"]=y.start),delete y.style,delete y.start,{tagName:"ol",attribs:y}},li:function(h,y){return y["data-list-item"]="true",delete y.style,delete y.dir,delete y["aria-level"],delete y["list-style-type"],{tagName:"li",attribs:y}},p:function(h,y){return{tagName:"br",attribs:{}}},div:"br",b:function(h,y){if(y.style){const E=y.style.toLowerCase();return E.includes("font-weight: bold")||E.includes("font-weight:bold")||E.includes("font-weight: 700")||E.includes("font-weight:700")?{tagName:"strong"}:!1}return{tagName:"strong"}},i:function(h,y){if(y.style){const E=y.style.toLowerCase();return E.includes("font-style: italic")||E.includes("font-style:italic")?{tagName:"em"}:!1}return{tagName:"em"}},s:function(h,y){return{tagName:"strike",attribs:y}}},textFilter:function(h){return h.replace(/\s+/g," ")}});d=d.replace(/<[^\/>][^>]*>\s*<\/[^>]+>/g,"").replace(/(<br\s*\/?>){2,}/g,"<br>").trim();const u=document.createElement("div");u.innerHTML=d,(h=>{h.querySelectorAll("ul[data-list-type], ol[data-list-type]").forEach((y,E)=>{const S=y.getAttribute("data-list-type")==="ordered",v=y.querySelectorAll("li[data-list-item]");let C=1;S&&y.getAttribute("data-list-start")&&(C=parseInt(y.getAttribute("data-list-start"),10)||1);const L=document.createDocumentFragment(),w=y.previousSibling;w&&(w.nodeType===Node.TEXT_NODE&&w.textContent.trim()!==""||w.nodeType===Node.ELEMENT_NODE&&w.tagName!=="BR")&&L.appendChild(document.createElement("br")),v.forEach((A,M)=>{const R=document.createElement("span");R.innerHTML=S?`${C}. `:"• ",L.appendChild(R),(J=>{const _=document.createElement("div");_.innerHTML=J.innerHTML;let G=_.firstChild;for(;G&&G.nodeType===1&&G.tagName==="BR";)_.removeChild(G),G=_.firstChild;if(!_.hasChildNodes()){const H=document.createTextNode("");_.appendChild(H)}for(;_.firstChild;)L.appendChild(_.firstChild)})(A),M<v.length-1&&L.appendChild(document.createElement("br")),C++}),y.parentNode.replaceChild(L,y)}),h.querySelectorAll("[data-list-type], [data-list-item], [data-list-start]").forEach(y=>{y.removeAttribute("data-list-type"),y.removeAttribute("data-list-item"),y.removeAttribute("data-list-start")})})(u),u.firstChild&&u.firstChild.nodeType===Node.ELEMENT_NODE&&u.firstChild.tagName==="BR"&&u.removeChild(u.firstChild),u.querySelectorAll("[data-font-size]").forEach(h=>{let y=`font-size: ${h.getAttribute("data-font-size")}px;`;h.getAttribute("data-bold")==="true"&&(y+=" font-weight: bold;"),h.getAttribute("data-italic")==="true"&&(y+=" font-style: italic;"),h.setAttribute("style",y),h.removeAttribute("data-font-size"),h.removeAttribute("data-bold"),h.removeAttribute("data-italic")}),u.querySelectorAll("[data-italic]").forEach(h=>{const y=document.createElement("em");y.innerHTML=h.innerHTML,h.innerHTML="",h.appendChild(y),h.removeAttribute("data-italic")}),u.querySelectorAll("a").forEach(h=>{const y=h.getAttribute("href");if(!y||y.trim()==="")h.replaceWith(...h.childNodes);else{h.setAttribute("target","_blank");const E=t?.links?.color??"#1C52DC",S=t?.links?.underline??!0?"underline":"none";h.setAttribute("style",`color: ${E}; text-decoration: ${S};`)}});const m=u.querySelectorAll("*");let f=0;m.forEach(h=>{h.tagName!=="BR"&&h.tagName!=="SPAN"&&h.textContent.replace(/[\u200B-\u200F\uFEFF\u2000-\u200A\u2028\u2029\u2060\u00A0\u1680\u180E]/g,"").trim()===""&&(h.parentNode.removeChild(h),f++)}),u.querySelectorAll("span").forEach(h=>{h.innerHTML==="• "||/^\d+\.&nbsp;$/.test(h.innerHTML)||h.textContent.replace(/[\u200B-\u200F\uFEFF\u2000-\u200A\u2028\u2029\u2060\u00A0\u1680\u180E]/g,"").trim()===""&&h.children.length===0&&(h.parentNode.removeChild(h),f++)});const p=window.getSelection(),b=p?.anchorNode?.nodeType===Node.ELEMENT_NODE?p.anchorNode:p?.anchorNode?.parentElement||null;_d(u,b),Nd(u,b),l=u.innerHTML}const s=window.getSelection();if(s&&s.rangeCount>0){const c=s.getRangeAt(0);c.deleteContents();const d=document.createRange().createContextualFragment(l);c.insertNode(d),c.collapse(!1)}}catch{const l=(e.clipboardData||window.clipboardData).getData("text/plain");document.execCommand("insertText",!1,l)}n(e),r()}var $r=Promise.resolve(),zr=null;function Hd(e,o){const{HTMLDocument:t,documentMapping:n,remoteDocument:r,messageService:i}=o;let l=t.getRangeByElement(e,!0);if(l){const s=n.getMappedReplacementRangeAtPosition(l.start)||n.getMappedReplacementRangeAtPosition(Math.max(l.end-1,l.start));s&&(l=s),l=n.correctRange(l),l=r.correctRange(l);const c={operation:"update_position_from_iframe",data:l};i.send(c)}}function Id(e,o){zr=e,$r=$r.finally(()=>{zr===e&&Hd(e,o)})}var Vr="application/x-emailmaker-social-reorder";function Zo(e){return e.closest('table[em-type="social"]')}function Ur(e){return(e.querySelector('table[role="presentation"]')||e.querySelector("table"))?.querySelector("tr")}function jr(e){return Array.from(e.querySelectorAll(":scope > td[em-platform], :scope > td[data-em-platform]"))}function Od(e){return Array.from(e.querySelectorAll(":scope > td:not([em-platform]):not([data-em-platform])")).find(o=>{const t=o;return t.getAttribute("width")!=null||t.innerHTML==="&nbsp;"||t.textContent===" "})}function xd(e,o){const t=Od(e);e.replaceChildren(),o.forEach((n,r)=>{r>0&&t&&e.appendChild(t.cloneNode(!0)),n.removeAttribute("em-index"),n.removeAttribute("data-em-index"),e.appendChild(n)})}function Dd(e,o){if(o.lockEditor)return;const t=e.target?.closest?.("td[em-platform], td[data-em-platform]");if(!t||t.getAttribute("draggable")!=="true")return;const n=Zo(t);if(!n)return;const r=Ur(n);if(!r)return;const i=jr(r);if(i.length<2)return;const l=i.indexOf(t);if(l<0)return;const s=e.dataTransfer;if(!s)return;const c=String(l);s.setData("text/plain",c),s.setData(Vr,c),s.effectAllowed="move"}function Fd(e,o){const t=e.dataTransfer;if(!t||!Array.from(t.types||[]).includes("application/x-emailmaker-social-reorder"))return!1;let n=t.getData(Vr);n||(n=t.getData("text/plain"));const r=parseInt(n,10);if(Number.isNaN(r))return!1;const i=e.target.closest?.("td[em-platform], td[data-em-platform]");if(!i)return!1;const l=Zo(i);if(!l)return!1;const s=Ur(l);if(!s)return!1;const c=jr(s);if(c.length<2)return!1;const d=c.indexOf(i);if(d<0)return!1;const u=c[r];if(!u||Zo(u)!==l)return!1;if(r===d)return!0;const g=[...c];return g.splice(r,1),g.splice(d,0,u),xd(s,g),l.setAttribute("em-edit","active"),o.applicationElementSettingsSet({elem:l}),!0}function qd(e){if(!e)return{backgroundColor:void 0,backgroundImage:void 0,backgroundPositionX:void 0,backgroundPositionY:void 0,backgroundRepeat:void 0,backgroundSize:void 0};const o={};if(e.style.backgroundColor?o.backgroundColor=e.style.backgroundColor:e.getAttribute("bgcolor")&&(o.backgroundColor=e.getAttribute("bgcolor")||void 0),e.style.backgroundImage){const t=e.style.backgroundImage;o.backgroundImage=[{type:"url",value:t?t.substring(5,t.length-2):""}]}else e.getAttribute("background")&&(o.backgroundImage=[{type:"url",value:e.getAttribute("background")||""}]);return o.backgroundPositionX=e.style.backgroundPositionX||void 0,o.backgroundPositionY=e.style.backgroundPositionY||void 0,o.backgroundRepeat=e.style.backgroundRepeat||void 0,o.backgroundSize=e.style.backgroundSize||void 0,o}function Wd(e){if(e){if(document.querySelector(".es-header")||document.querySelector(".es-content")||document.querySelector(".es-footer")){const o=e.querySelector(".es-content"),t=e.querySelector(".es-content-body");return parseFloat(o?.style.width||"")||parseFloat(t?.style.width||"")||void 0}if(document.querySelector(".nl-container")&&document.querySelector(".row")){const o=document.querySelector(".row-content");return parseFloat(o?.style.width||"")||parseFloat(o?.getAttribute("width")||"")||void 0}if(document.querySelector(".nl-container")&&!document.querySelector(".row")){const o=e.querySelector('[style*="max-width"]');return parseFloat(o?.style.maxWidth||"")||void 0}if(document.querySelector('[class*="letteros"]')||document.querySelector("[letteros-link]")){const o=e.querySelector("table:first-child");if(o?.style.maxWidth)return parseFloat(o.style.maxWidth)||void 0}if(document.querySelector(".container-div")){const o=e.querySelector("div:first-child");if(o?.style.maxWidth)return parseFloat(o.style.maxWidth)||void 0}if(document.querySelector(".email-container")){const o=document.querySelector(".email-container");return parseFloat(o?.getAttribute("width")||"")||void 0}return $d(e)}}function $d(e){const o=e.querySelector("table:first-child");if(!o)return;const t=parseFloat(o.getAttribute("width")||""),n=parseFloat(o.style.maxWidth||"");if(t>700||n>700){const i=e.querySelector('table:first-child [em="block"] > td > table');if(i){const l=i.getAttribute("width");return l&&l.indexOf("%")===-1?parseFloat(l):i.style.maxWidth?parseFloat(i.style.maxWidth):e.querySelector('table:first-child [em="block"]')?.clientWidth||660}return 660}const r=o.getAttribute("width");if(r&&r.indexOf("%")===-1)return parseFloat(r);if(o.style.maxWidth)return parseFloat(o.style.maxWidth)}function zd(e,o){const t={shutdown:void 0,styles:!0};if(!e||!o)return t;const n=e.querySelector("table:first-child");if(!n)return t;const r=n.getAttribute("width"),i=parseFloat(n.style.minWidth||"");return r&&r.indexOf("%")===-1&&i===parseFloat(r)||e.querySelector(".noresp-em-narrow-table")?{shutdown:!1,styles:!1}:{shutdown:!0,styles:!0}}function Vd(e,o){!e||!o||document.querySelector(".noresp-em-narrow-table, .em-narrow-table")&&(e.getBoundingClientRect().width<=o||document.querySelectorAll("img").forEach(t=>{const n=t.closest("td")?.getBoundingClientRect().width;n&&parseFloat(t.getAttribute("width")||"")>n&&n>10&&t.style.display!=="none"&&(t.setAttribute("width",String(Math.ceil(n))),t.style.maxWidth=Math.ceil(n)+"px")}))}function Ud(e){const o=e.findGlobalHolder();e.setGlobalHolder(o);const t={operation:"application_email_settings_set",settings:{subject:e.getSubject(),preheader:e.getPreheader(),responsive:{shutdown:void 0,styles:!0},structuresMedia:!(document.querySelector('[em="block"] div[style*="display: inline-block"]')&&!document.querySelector('[em="block"] .em-mob-wrap, [em="block"] .noresp-em-mob-wrap')),usedColors:e.getUsedColors(),noBlocks:!1,width:{value:void 0,dim:"px"},backgroundColor:void 0,backgroundImage:void 0,backgroundPositionX:void 0,backgroundPositionY:void 0,backgroundRepeat:void 0,backgroundSize:void 0,backgroundColorContent:void 0}};if(o){const s=qd(o);s.backgroundColor&&s.backgroundColor.startsWith("rgb")&&(s.backgroundColor=e.rgbToHex(s.backgroundColor)),Object.assign(t.settings,s)}e.elMarkupHelper(),document.querySelector('[em="block"]')||(t.settings.noBlocks=!0);const n=Wd(o),r=e.state.get("emailWidth"),i=e.getEmailWidth(),l=typeof r=="number"&&r>=320?r:typeof i=="number"&&i>=320?i:n;t.settings.width.value=l,o&&(t.settings.responsive=zd(o,l),typeof l=="number"&&e.state.set("emailWidth",l)),e.messageService.send(t),Vd(o,e.getEmailWidth())}function jd(e,o=!1){e.state.set("lockEditorInit",!0),document.body&&(e.removeHiddenClasses(document),Ud(e),e.commit(!1))}function Gd(e,o){const t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);let n=0,r=null;for(;t.nextNode();){r=t.currentNode;const i=(r.textContent||"").length;if(n+i>=o){const l=o-n;return{node:r,offset:l}}n+=i}if(r){const i=r.textContent?.length||0;return{node:r,offset:i}}return null}function Yd(e,o,t,n){try{if(!t||t.nodeType!==Node.TEXT_NODE)return!1;const r=t.textContent?t.textContent.length:0,i=Math.min(Math.max(0,n),r);return e.setStart(t,i),e.collapse(!0),o.removeAllRanges(),o.addRange(e),!0}catch{return!1}}var Kd=["style","class","align","href"],Xd=32;function Zd(e){return!!(e.tagName==="BODY"||e.getAttribute("em")==="atom"||e.tagName==="TABLE"&&e.hasAttribute("em"))}function Jd(e){const o=[e.tagName];for(const t of Kd){const n=e.getAttribute(t);n!==null&&n!==""&&o.push(`${t}=${n}`)}return o.join("|")}function Ot(e){if(!e||!e.isConnected)return"";const o=[];let t=e,n=0;for(;t&&n<Xd&&(o.push(Jd(t)),!Zd(t));)t=t.parentElement,n++;return o.join("||")}var Qd=[{name:"Stripo (es-header/content/footer)",detect:()=>!!(document.querySelector(".es-header")||document.querySelector(".es-content")||document.querySelector(".es-footer")),apply:()=>{document.querySelectorAll(".es-header, .es-content, .es-footer").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll(".es-header-body > tr").forEach(e=>{e.setAttribute("em","block")}),document.querySelectorAll(".es-content-body > tr").forEach(e=>{e.setAttribute("em","block")}),document.querySelectorAll(".es-footer-body > tr").forEach(e=>{e.setAttribute("em","block")})}},{name:"Stripo (es-wrapper)",detect:()=>!!document.querySelector(".es-wrapper"),apply:()=>{document.querySelectorAll(".es-wrapper > tr > td > table > tr").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll(".es-wrapper > tr > td > table > tr > td > table > tr").forEach(e=>{e.setAttribute("em","block")})}},{name:"Sandsay",detect:()=>!!(document.querySelector("[data-template-wrapper]")&&document.querySelector("[data-template-content]")),apply:()=>{document.querySelectorAll("[data-template-wrapper] > table[data-block-id]").forEach(e=>{e.setAttribute("em","block")})}},{name:"Beefree",detect:()=>!!(document.querySelector(".nl-container")&&document.querySelector(".row")),apply:()=>{document.querySelectorAll('.row[em="block"]').forEach(e=>{e.removeAttribute("em")}),document.querySelectorAll(".row").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll(".row-content").forEach(e=>{e.setAttribute("em","block")})}},{name:"Chamaileon",detect:()=>!!document.querySelector(".main-container"),apply:()=>{document.querySelectorAll(".main-container > tr > td > table").forEach(e=>{e.setAttribute("em","block")})}},{name:"Chamaileon (email-container)",detect:()=>!!document.querySelector(".email-container"),apply:()=>{document.querySelectorAll(".email-container > tr > td > table > tr > td > table > tr").forEach(e=>{e.setAttribute("em","block")})}},{name:"Mindbox",detect:()=>!!(document.querySelector(".nl-container")&&!document.querySelector(".row")),apply:()=>{document.querySelectorAll(".nl-container > tr > td > div").forEach(e=>{e.setAttribute("em","block")})}},{name:"Unlayer",detect:()=>!!(document.querySelector(".clean-body.u_body")&&!document.querySelector(".row")),apply:()=>{document.querySelectorAll(".u-row-container").forEach(e=>{e.setAttribute("em","block")})}},{name:"Postcards",detect:()=>!!(document.querySelector(".pc-email-body")&&!document.querySelector(".row")),apply:()=>{document.querySelectorAll('.pc-email-container > tr > td > table[role="presentation"]').forEach(e=>{e.setAttribute("em","block")})}},{name:"Topol",detect:()=>!!(document.querySelector(".hide_section_on_mobile")||document.querySelector(".mj-column-per-100")||document.querySelector(".outlook-group-fix")),apply:()=>{document.querySelectorAll("body > div > div").forEach(e=>{e.setAttribute("em","block")})}},{name:"Sender",detect:()=>!!document.querySelector(".e-c.sect"),apply:()=>{document.querySelectorAll(".e-c.sect").forEach(e=>{e.setAttribute("em","block")})}},{name:"Letteros",detect:()=>!!(!document.querySelector("[mailfit-module]")&&(document.querySelector('[class*="letteros"]')||document.querySelector("[letteros-link]"))),apply:()=>{document.querySelectorAll("body > div > table > tr").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll("body > div > table > tr > td > table > tr").forEach(e=>{e.setAttribute("em","block")}),document.querySelectorAll('[style*="overflow"]').forEach(e=>{e.style.removeProperty("overflow")})}},{name:"Letteros (letteros-element)",detect:()=>!!document.querySelector("[letteros-element]"),apply:()=>{document.querySelectorAll("[letteros-body]").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll("[letteros-element]").forEach(e=>{e.setAttribute("em","block")})}},{name:"Ascona",detect:()=>!!(document.querySelector(".mail_preheader")&&document.body.classList.contains("body")),apply:()=>{document.querySelectorAll("#mailsub > table > tr").forEach(e=>{e.setAttribute("em","group"),e.querySelectorAll(":scope > td > div > table > tr").forEach(o=>{o.setAttribute("em","block")})})}},{name:"Mailfit",detect:()=>!!document.querySelector("[mailfit-module]"),apply:()=>{document.querySelectorAll("body > div > table > tr").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll("[mailfit-module]").forEach(e=>{e.setAttribute("em","block")})}},{name:"CashCowAgency",detect:()=>!!document.querySelector(".container-div"),apply:()=>{document.querySelectorAll("body > center").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll(".container-td > table").forEach(e=>{e.setAttribute("em","block")})}},{name:"MakeMail",detect:()=>!!(document.querySelector(".mail")&&document.querySelector(".container")),apply:()=>{document.querySelectorAll(".container").forEach(e=>{e.setAttribute("em","block")})}},{name:"data-axle.com",detect:()=>!!document.querySelector(".full-width-container-inner"),apply:()=>{document.querySelectorAll(".full-width-container-inner > table").forEach(e=>{e.setAttribute("em","block")})}},{name:"Miro",detect:()=>!!document.querySelector(".content__tablet_fullWidth"),apply:()=>{document.querySelectorAll(".content__tablet_fullWidth").forEach(e=>{for(const o of Array.from(e.children))if(o.children.length>1)for(const t of Array.from(o.children))t.setAttribute("em","block");else for(const t of Array.from(o.children))for(const n of Array.from(t.children))for(const r of Array.from(n.children))r.setAttribute("em","block")})}},{name:"WIM (full-wrap)",detect:()=>!!(document.body.classList.contains("body")&&document.querySelector("[alink]")&&document.querySelector(".full-wrap")),apply:()=>{document.querySelectorAll(".full-wrap > tr > td > div > table > tr").forEach(e=>{e.setAttribute("em","group"),e.querySelectorAll(":scope > td > div > table > tr, :scope > td > table > tr").forEach(o=>{o.setAttribute("em","block")})})}},{name:"WIM",detect:()=>!!(document.body.classList.contains("body")&&document.querySelector("[alink]")&&!document.querySelector(".full-wrap")),apply:()=>{document.querySelectorAll('body > table > tr > td > table > tr, body > div[style*="-webkit-text-size-adjust"] > table > tr > td > table > tr, body > table > tbody > tr > td > table > tbody > tr, body > div[style*="-webkit-text-size-adjust"] > table > tbody > tr > td > table > tbody > tr').forEach(e=>{e.setAttribute("em","group"),e.querySelectorAll(":scope > td > table > tr > td > table > tr").forEach(o=>{o.setAttribute("em","block")})})}},{name:"Emailify",detect:()=>document.body.classList.contains("emailify"),apply:()=>{document.querySelectorAll("body > div > div > table > tr").forEach(e=>{e.setAttribute("em","block")})}}];function em(){document.querySelectorAll('body > table > tr, body > div[style*="-webkit-text-size-adjust"] > table > tr').forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll('body > table > tr > td > table > tr, body > div[style*="-webkit-text-size-adjust"] > table > tr > td > table > tr, body > table > tbody > tr > td > table > tbody > tr, body > div[style*="-webkit-text-size-adjust"] > table > tbody > tr > td > table > tbody > tr').forEach(e=>{e.setAttribute("em","block")})}function tm(e){const o=document.querySelector("[em=blocks]");if(o){for(const n of Array.from(o.children))n.setAttribute("em","block");o.removeAttribute("em"),a.commit();return}if(e){let n=!1;for(const r of Qd)if(r.detect()){r.apply(),n=!0;break}n||em()}const t=document.querySelector("[em=atoms]");if(t){for(const n of Array.from(t.children))n.setAttribute("em","atom");t.removeAttribute("em")}document.documentElement?.style.height&&document.documentElement.style.removeProperty("height"),document.body?.style.height&&document.body.style.removeProperty("height"),document.querySelector(".em-narrow-table, .noresp-em-narrow-table")||a.messageService.send({operation:"application_template_not_em_alert_show"}),a.commit()}function om(e,o){const{target:t}=e;setTimeout(()=>{const n=t?.querySelector("a");if(!n)return;const r=n.closest("div, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub");r&&(r.childNodes.forEach(i=>{if(i.nodeType===Node.COMMENT_NODE&&i.nodeValue?.includes("[if mso]")){const l=n.innerHTML.length*11+40;i.nodeValue=i.nodeValue.replace(/(<center[^>]*>)(.*?)(<\/center>)/s,(s,c,d,u)=>c+n.innerHTML+u).replace(/(width:)(\d+)(px)/,(s,c,d,u)=>`${c}${l}${u}`)}}),o(!1))},0)}function nm(e,o){if(!e||!e.length)return;let t=document.head.querySelector('style[em="styles"]'),n="";t?n=o.getInnerHtml(t):(t=document.createElement("style"),t.setAttribute("em","styles"),t=document.head.insertAdjacentElement("beforeend",t));const r=document.createElement("div");r.insertAdjacentHTML("afterbegin",e.join(`
254
254
  `));let i=a.minifyStylesheet(n+`
255
255
  `+[...r.querySelectorAll("style")].map(l=>l.innerHTML).join(`
256
256
  `),{restructure:!0,forceMediaMerge:!0}).css;i=cssbeautify(i,{indent:" ",autosemicolon:!0}),t&&(t.textContent=`
257
257
  `+i+`
258
- `)}var Jo={},tm=new Set,om=null;function nm(e){om=e,Jo=e.localized,e.onChangeLocale(({data:o})=>{Jo=o,tm.forEach(t=>t(o))})}function Gr(){return Jo}var Yr=[];function rm(){return Yr}function Kr(e){const o=Gr();let t="",n="";switch(e.tagName){case"A":e.style.display==="block"?(t=o.ELEMENT_PATH_BUTTON,n="em-element-path-item-button"):(t=o.ELEMENT_PATH_LINK,n="em-element-path-item-link");break;case"IMG":e.closest('table[em-type="social"]')?t=o.ELEMENT_PATH_SOCIAL:t=o.ELEMENT_PATH_IMG,n="em-element-path-item-image";break;case"TD":e.parentElement?.getAttribute("em")==="block"?(t=o.ELEMENT_PATH_BLOCK,n="em-element-path-item-block"):e.parentElement?.getAttribute("em")==="atom"||e.closest("table")?.getAttribute("em")==="atom"?(t=o.ELEMENT_PATH_ATOM,n="em-element-path-item-atom"):e.parentElement?.getAttribute("em")==="group"?(t=o.ELEMENT_PATH_GROUP,n="em-element-path-item-group"):e.classList.contains("em-vindent")?(t=o.ELEMENT_PATH_VINDENT,n="em-element-path-item-vindent"):e.classList.contains("em-mob-wrap")||e.classList.contains("noresp-em-mob-wrap")?(t=o.ELEMENT_PATH_FLOATBLOCK,n="em-element-path-item-column"):(t=o.ELEMENT_PATH_TD,n="em-element-path-item-block");break;case"TABLE":e.getAttribute("em")==="block"?(t=o.ELEMENT_PATH_BLOCK,n="em-element-path-item-block"):e.getAttribute("em")==="atom"&&e.getAttribute("em-type")==="social"?(t=o.ELEMENT_PATH_SOCIAL,n="em-element-path-item-atom"):e.getAttribute("em")==="atom"?(t=o.ELEMENT_PATH_ATOM,n="em-element-path-item-atom"):e.getAttribute("em")==="group"?(t=o.ELEMENT_PATH_GROUP,n="em-element-path-item-group"):e.parentElement?.tagName==="BODY"?(t=o.ELEMENT_PATH_EMAIL,n="em-element-path-item-email"):(t=o.ELEMENT_PATH_TABLE,n="em-element-path-item-table");break;case"SPAN":case"B":case"I":case"EM":case"STRONG":case"P":case"H1":case"H2":case"H3":case"H4":case"H5":case"DIV":case"STRIKE":case"S":case"U":e.style.display==="inline-block"?(t=o.ELEMENT_PATH_FLOATBLOCK,n="em-element-path-item-column"):e.style.fontFamily&&e.style.fontSize&&e.style.lineHeight&&e.style.color?(t=o.ELEMENT_PATH_TEXT,n="em-element-path-item-text"):e.getAttribute("em")==="block"?(t=o.ELEMENT_PATH_BLOCK,n="em-element-path-item-block"):e.getAttribute("em")==="atom"?(t=o.ELEMENT_PATH_ATOM,n="em-element-path-item-atom"):e.getAttribute("em")==="group"?(t=o.ELEMENT_PATH_GROUP,n="em-element-path-item-group"):e.classList.contains("em-vindent")?(t=o.ELEMENT_PATH_VINDENT,n="em-element-path-item-vindent"):(t=o.ELEMENT_PATH_DIV,n="em-element-path-item-block")}const r=a.captionByRules(e,o);return r?.title&&(t=r.title),r?.className&&(n=r.className),e.className&&e.className.indexOf&&e.className.indexOf("em-mob-")>-1&&(n+=" em-element-path-item-mob"),{elem:e,title:t,className:n}}var im=new Set(["TABLE","TBODY","THEAD","TFOOT","TR","TD","TH"]);function lm(e){return Array.from(e.classList).some(o=>o.startsWith("em-element-"))}function am(e){if(e.tagName!=="TD")return!1;const o=Array.from(e.getElementsByTagName("a")),t=o[0];if(o.length!==1||t.style.display!=="block")return!1;for(let n=t.parentElement;n&&n!==e;n=n.parentElement)if(im.has(n.tagName))return!1;return Array.from(e.children).every(n=>n===t||n.contains(t)||lm(n))}function sm(e){const o=e.style;return am(e)?!1:!!(e.tagName==="A"&&!e.closest(".em-element-resize-img-container")&&!e.closest('table[em-type="social"]')||e.tagName==="TD"&&!e.closest(".em-narrow-table")||e.tagName==="TABLE"&&e.parentElement?.style?.display!=="inline-block"&&!e.classList.contains("em-vindent-table")&&!e.closest(".em-narrow-table")&&e.getAttribute("em")!=="atom"&&e.parentElement?.tagName!=="BODY"||e.tagName==="DIV"&&(o.display==="inline-block"||o.display==="table-cell")&&o.verticalAlign||(e.tagName==="DIV"||e.tagName==="TABLE"||e.tagName==="TD")&&!e.classList.contains("em-narrow-table")&&!e.classList.contains("noresp-em-narrow-table")&&(o.width||o.minWidth||o.maxWidth||o.background||o.backgroundColor||o.backgroundPositionX||o.backgroundPositionY||o.backgroundImage||o.backgroundRepeat||o.backgroundSize||o.height||o.padding||o.paddingTop||o.paddingRight||o.paddingBottom||o.paddingLeft||o.border||o.borderBottom||o.borderBottomWidth||o.borderBottomStyle||o.borderBottomColor||o.borderLeft||o.borderLeftWidth||o.borderLeftStyle||o.borderLeftColor||o.borderTop||o.borderTopWidth||o.borderTopStyle||o.borderTopColor||o.borderRight||o.borderRightWidth||o.borderRightStyle||o.borderRightColor||o.borderRadius||o.borderTopLeftRadius||o.borderTopRightRadius||o.borderBottomLeftRadius||o.borderBottomRightRadius||o.boxShadow||o.textAlign||o.align||o.verticalAlign)||e.tagName!=="EDITOR"&&o.fontFamily&&o.fontSize&&o.lineHeight&&o.color||e.tagName==="TD"&&e.closest("table")?.getAttribute("em")==="atom"||e.tagName==="TD"&&e.closest("tr")?.getAttribute("em")==="block"||e.tagName==="TD"&&(e.classList.contains("em-mob-wrap")||e.classList.contains("noresp-em-mob-wrap"))||a.isPathElementByRules(e))}function cm(e){let o=[];const t=e.style;(e.tagName==="IMG"||e.tagName==="TD"||e.tagName==="TABLE"||e.tagName!=="EDITOR"&&t.fontFamily&&t.fontSize&&t.lineHeight&&t.color||e.tagName==="DIV"&&t.height&&t.lineHeight||a.isPathElementByRules(e))&&o.push(Kr(e));let n=e;for(;n?.parentElement&&n.parentElement.tagName!=="BODY";)n=n.parentElement,sm(n)&&o.push(Kr(n));return o=o.filter(r=>!(r.elem?.tagName==="TABLE"&&r.elem.parentElement?.tagName==="BODY")),o=o.reverse(),Yr=o.map(r=>({...r})),o.map(r=>({title:r.title,className:r.className}))}function Xr(e){const o=Gr(),t=e.parentNode;if(t){if(t.tagName==="A")return o.LINK;if(t.tagName==="TD")return o.TABLE_COLUMN;if(t.tagName==="TABLE"&&!t.parentNode?.style?.display||t.parentNode?.style?.display!=="inline-block")return o.TABLE;if(t.tagName==="DIV"&&(t.style.display==="inline-block"||t.style.display==="table-cell")&&t.style.verticalAlign)return o.FLOAT_BLOCK;if(t.tagName==="DIV"){const n=t.style;if(n.width||n.minWidth||n.maxWidth||n.background||n.backgroundColor||n.backgroundPositionX||n.backgroundPositionY||n.backgroundImage||n.backgroundRepeat||n.backgroundSize||n.height||n.padding||n.paddingTop||n.paddingRight||n.paddingBottom||n.paddingLeft||n.border||n.borderBottom||n.borderBottomWidth||n.borderBottomStyle||n.borderBottomColor||n.borderLeft||n.borderLeftWidth||n.borderLeftStyle||n.borderLeftColor||n.borderTop||n.borderTopWidth||n.borderTopStyle||n.borderTopColor||n.borderRight||n.borderRightWidth||n.borderRightStyle||n.borderRightColor||n.borderRadius||n.borderTopLeftRadius||n.borderTopRightRadius||n.borderBottomLeftRadius||n.borderBottomRightRadius||n.boxShadow||n.textAlign||n.align||n.verticalAlign)return o.CONTAINER}return Xr(t)}}function Zr(e,o){const t=e.getAttribute(o);return!t||t==="auto"?{value:null,dim:"px"}:{value:parseFloat(t),dim:t.includes("%")?"%":"px"}}function Jr(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function dm(e,o,t){t.clearActiveEditElements();const n=e.elem.closest("amp-carousel");n.setAttribute("em-edit","active");const r=n.querySelectorAll("amp-img"),i=mm(r),l=Array.from(r).map(u=>{const g=a.getElementMobileProps({elem:u});return{src:u.getAttribute("src")??"",width:Zr(u,"width"),height:Zr(u,"height"),alt:u.getAttribute("alt")??"",title:u.getAttribute("title")??"",link:u.closest("a")?.getAttribute("href")??null,renderedWidth:Math.round(e.elem.getBoundingClientRect().width),renderedHeight:Math.round(e.elem.getBoundingClientRect().height),imgReplacer:u.closest("em-replace")?.getAttribute("src")??"",mobileWidth:{value:Jr(g.mobileWidth),dim:g.mobileWidthDim??"px"},mobileHeight:{value:Jr(g.mobileHeight),dim:g.mobileHeightDim??"px"},mobileBorderRadius:g.mobileBorderRadius}}),s=a.getElementMobileProps({elem:n}),c={type:"carousel",caption:o.CAROUSEL,carouselImages:l,borderRadius:a.getElementBorderRadius(n),mobileBorderRadius:s.mobileBorderRadius,loop:n.hasAttribute("loop"),autoplay:n.hasAttribute("autoplay"),link:i},d=n.closest("td");return d&&(c.maxWidth=Math.round(d.getBoundingClientRect().width)),c}function mm(e){const o=Array.from(e,t=>t.closest("a")?.getAttribute("href"));return o.length>0&&o.every(t=>t&&t===o[0])?o[0]??null:null}function um(e){return!!e.closest("amp-carousel")}function fm(e,o,t){t.clearActiveEditElements();const n=e.elem.closest("amp-accordion");n.setAttribute("em-edit","active");const r=t.HTMLDocument.getOuterHtml(n),i=t.parseFromString(r)[0].querySelectorAll("section"),l=Array.from(i).map(s=>({expanded:s.hasAttribute("expanded")}));return{type:"accordion",caption:o.ACCORDION,animate:n.hasAttribute("animate"),expandSingleSection:n.hasAttribute("expand-single-section"),sections:l}}function pm(e){return e.tagName==="AMP-ACCORDION"}function xt(e){const o=String(e??"").trim();return o?a.rgbToHex(o)??o:""}var Qo={align:"center",iconSize:40,borderRadius:0,gap:8,bgEnabled:!1,bgColor:"",borderWidth:0,borderColor:"",buttonBorderColor:"",buttonBorderWidth:0,showLabel:!1};function gm(e){if(!e)return null;const o=e.getAttribute("width")?.trim();if(o){const i=parseInt(o,10);if(!Number.isNaN(i)&&i>0)return i}const t=e.getAttribute("style")??"",n=/(?:^|;)\s*width:\s*(\d+)px/i.exec(t);if(n){const i=parseInt(n[1],10);if(!Number.isNaN(i)&&i>0)return i}const r=e.style?.width?.trim()??"";if(r){const i=parseInt(r,10);if(!Number.isNaN(i)&&i>0)return i}return e.offsetWidth>0?Math.round(e.offsetWidth):null}function bm(e,o){if(e.length===0)return o;let t=null;for(const n of e){const r=n.iconWidth;if(r==null||Number.isNaN(r)||r<=0)return o;if(t===null)t=r;else if(r!==t)return o}return t??o}function en(e){return e.closest('table[em-type="social"]')}function hm(e){const o=e.ownerDocument;return o?Array.from(o.querySelectorAll('table[em-type="social"]')).indexOf(e):-1}function Qr(e){const o=e.querySelector(":scope > tr");if(o){const n=o.querySelector(":scope > td");if(n instanceof HTMLElement)return n}const t=e.querySelector("tbody > tr");if(t){const n=t.querySelector(":scope > td");if(n instanceof HTMLElement)return n}return null}function ft(e){if(!e||!(e instanceof HTMLElement))return"";const o=e.style?.backgroundColor?.trim()??"";return!o||o==="transparent"||o==="rgba(0, 0, 0, 0)"?"":o}function De(e,o){return e.hasAttribute(o)||e.hasAttribute(`data-${o}`)}function tn(e,o){return e?e.getAttribute(o)??e.getAttribute(`data-${o}`):null}function ym(e){if(!(e instanceof HTMLElement))return null;const o=e.getAttribute("width")?.trim(),t=e.style.width?.trim(),n=o||t;if(!n)return null;const r=/^(\d+)/.exec(n);if(!r)return null;const i=parseInt(r[1],10);return Number.isNaN(i)||i<0?null:i}function Em(e,o){for(let t=1;t<e.length-1;t+=1){const n=e[t-1],r=e[t],i=e[t+1];if(n instanceof HTMLElement&&i instanceof HTMLElement&&De(n,"em-platform")&&De(i,"em-platform")&&r instanceof HTMLElement&&!De(r,"em-platform")){const l=ym(r);if(l!=null){o.gap=l;return}}}}function ei(e){const o=String(e??""),t=/(?:^|;)\s*border-radius:\s*(\d+)px/i.exec(o);if(!t)return null;const n=parseInt(t[1],10);return Number.isNaN(n)||n<0?null:n}function Sm(e,o){const t=Qr(e)?.getAttribute("align")?.trim().toLowerCase();(t==="left"||t==="right"||t==="center")&&(o.align=t)}function Cm(e,o){for(const t of e){if(!(t instanceof HTMLElement)||!De(t,"em-platform"))continue;const n=ei(t.getAttribute("style"));if(n!=null){o.borderRadius=n;return}const r=ei(t.querySelector("img")?.getAttribute("style")??null);if(r!=null){o.borderRadius=r;return}}}function vm(e,o){for(const t of e){if(!(t instanceof HTMLElement))continue;const n=t.querySelector("br"),r=n?.nextElementSibling?.tagName==="SPAN"?n.nextElementSibling:null;if(r&&r.textContent?.trim()){o.showLabel=!0;return}}o.showLabel=!1}function Am(e,o,t){const n=e.querySelector("[em-social-tray-shell], [data-em-social-tray-shell]"),r=e.querySelector("td[em-tray-cell-bg], td[data-em-tray-cell-bg]"),i=ft(n),l=ft(r instanceof HTMLElement?r:null),s=ft(e.querySelector("[em-social-tray], [data-em-social-tray]")),c=ft(o),d=ft(e),u=i||l||s||c||d;u&&(t.bgEnabled=!0,t.bgColor=u)}function Tm(e){const o=Qr(e);if(!(o instanceof HTMLElement))return"";const t=ft(o);return t||(o.getAttribute("bgcolor")?.trim()??"")}function on(e){if(!e)return null;const o=e.style.border?.trim()??"",t=/^(\d+)px\s+solid\s+(.+)$/i.exec(o);if(!t)return null;const n=parseInt(t[1],10),r=t[2].trim();return Number.isNaN(n)||n<=0||!r?null:{w:n,color:r}}function Lm(e,o){const t=on(e);t&&(o.borderWidth=t.w,o.borderColor=t.color)}function wm(e){const o=e.closest("td[em-platform], td[data-em-platform]");if(o)return!!en(o);const t=e.closest("td"),n=t?.previousElementSibling,r=t?.nextElementSibling;return!!(t&&!De(t,"em-platform")&&n instanceof HTMLElement&&r instanceof HTMLElement&&De(n,"em-platform")&&De(r,"em-platform")&&en(t))}function km(e,o){const t=en(e.elem);if(!t)return{type:"social",caption:o.SOCIAL??"Social media",...Qo,hostCellBgForIconLuminance:"",blockIndex:-1,items:[]};const n={...Qo};Sm(t,n),Lm(t,n);const r=t.querySelector('table[role="presentation"]')||t.querySelector("table");Am(t,r,n);const i=r?.querySelector("tr"),l=i?Array.from(i.querySelectorAll(":scope > td")):[],s=l.filter(p=>p instanceof HTMLElement&&De(p,"em-platform")),c=s.length>0?s:l.filter(p=>p.querySelector("img"));Em(l,n),Cm(c,n),vm(c,n);let d=typeof n.buttonBorderWidth=="number"&&!Number.isNaN(n.buttonBorderWidth)?n.buttonBorderWidth:0;const u=t.querySelector("[em-social-tray-shell], [data-em-social-tray-shell]"),g=u instanceof HTMLElement?on(u):null;if(g)d=g.w;else for(const p of c){if(!(p instanceof HTMLElement))continue;const b=on(p);if(b){d=b.w;break}}let m=c.map(p=>{if(!(p instanceof HTMLElement))return{platform:"unknown",customIcon:!1,href:"",alt:"",title:"",iconSrc:"",iconWidth:null,iconHeight:null,buttonBgColor:"",itemBorderColor:""};const b=p,h=tn(b,"em-platform")||"unknown",y=De(b,"em-custom-icon"),E=b.querySelector("a"),S=b.querySelector("img"),v=E?.getAttribute("href")??"",C=E?.getAttribute("title")??S?.getAttribute("title")??"",L=S?.getAttribute("alt")??"",w=S?.getAttribute("src")??"",A=gm(S instanceof HTMLImageElement?S:null),M=S?.getAttribute("height")?.trim(),R=M?parseInt(M,10):NaN,$=!Number.isNaN(R)&&R>0,J=tn(b,"em-button-bg")?.trim()??"",_=!y&&De(b,"em-tray-cell-bg");let G="",H="";if(!y&&(G=J,!G&&!_&&b.style?.backgroundColor&&(G=b.style.backgroundColor.trim()),H=tn(b,"em-item-border-color")?.trim()??"",!H)){const P=b.style.border?.trim()??"",q=/^(\d+)px\s+solid\s+(.+)$/i.exec(P);q?.[2]&&(H=q[2].trim())}return{platform:h,customIcon:y,href:v,alt:L,title:C,iconSrc:w,iconWidth:A,iconHeight:$?R:A,buttonBgColor:G,itemBorderColor:H}});if(g&&m.length>0&&m.every(p=>p.customIcon||!String(p.itemBorderColor??"").trim())){const p=g.color;m=m.map(b=>b.customIcon?b:{...b,itemBorderColor:p})}const f=bm(m,Qo.iconSize);return{type:"social",caption:o.SOCIAL??"Social media",align:n.align,iconSize:f,borderRadius:n.borderRadius,gap:n.gap,bgEnabled:n.bgEnabled,bgColor:xt(n.bgColor),borderWidth:n.borderWidth,borderColor:xt(n.borderColor),buttonBorderColor:"",buttonBorderWidth:d,showLabel:n.showLabel,hostCellBgForIconLuminance:xt(Tm(t)),blockIndex:hm(t),items:m.map(p=>({...p,buttonBgColor:xt(p.buttonBgColor),itemBorderColor:xt(p.itemBorderColor)}))}}function nn(e){if(!e)return!1;for(const o of Array.from(e.childNodes))if(o.nodeType===Node.COMMENT_NODE&&o.nodeValue?.includes("[if mso]")&&o.nodeValue.includes("v:roundrect")||o.nodeType===Node.ELEMENT_NODE&&nn(o))return!0;return!1}function ti(e,o){if(!e)return{value:null,dim:"px"};const t=e.getAttribute(o);return!t||t==="auto"?{value:null,dim:"px"}:{value:parseFloat(t),dim:t.includes("%")?"%":"px"}}function oi(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function _m(e){const o={all:null,top:null,right:null,bottom:null,left:null};return!e.style.padding&&!e.style.paddingTop&&!e.style.paddingRight&&!e.style.paddingBottom&&!e.style.paddingLeft||(!e.style.padding||e.style.padding.includes(" ")?o.all=null:!e.style.padding&&e.style.paddingTop&&e.style.paddingRight&&e.style.paddingBottom&&e.style.paddingLeft&&e.style.paddingTop===e.style.paddingRight&&e.style.paddingRight===e.style.paddingBottom&&e.style.paddingBottom===e.style.paddingLeft?o.all=parseFloat(e.style.paddingTop):o.all=parseFloat(e.style.padding)||null,o.top=e.style.paddingTop?parseFloat(e.style.paddingTop):null,o.right=e.style.paddingRight?parseFloat(e.style.paddingRight):null,o.bottom=e.style.paddingBottom?parseFloat(e.style.paddingBottom):null,o.left=e.style.paddingLeft?parseFloat(e.style.paddingLeft):null),o}function Nm(e){const o={all:null,top:null,right:null,bottom:null,left:null};if(!e.all&&!e.top&&!e.right&&!e.bottom&&!e.left)return o;e.all?!e.all&&e.top&&e.right&&e.bottom&&e.left&&e.top===e.right&&e.right===e.bottom&&e.bottom===e.left?o.all=parseFloat(e.top):o.all=parseFloat(e.all)||null:o.all=null;const t=e.all||null;return o.top=e.top!=null?parseFloat(e.top):t,o.right=e.right!=null?parseFloat(e.right):t,o.bottom=e.bottom!=null?parseFloat(e.bottom):t,o.left=e.left!=null?parseFloat(e.left):t,o}function Bm(e){if(e.style.backgroundImage){const o=e.style.backgroundImage;return[{type:"url",value:o.substring(5,o.length-2)}]}return e.getAttribute("background")?[{type:"url",value:e.getAttribute("background")||""}]:[{type:"url",value:""}]}function Mm(e,o){const t=e.elem.closest("a")||e.elem,n=e.elem.closest("td"),r=a.findForeignButtonSpan(t),i=nn(n)&&!nn(t)||!!r,l=r??(i?t:n),s=e.elem.closest("table"),c=s?.closest("td")?.closest("table")?.closest("td"),d=s?.closest("div, p, td"),u=d?.style.textAlign||d?.getAttribute("align")||"left",g=a.getElementMobileProps({elem:e.elem}),m=a.getElementMobileProps({elem:n}),f=c?a.getElementMobileProps({elem:c}):null,p=a.getElementMobileProps({elem:s}),b=e.elem.closest("a"),h={type:"button",caption:o.BUTTON,fontFamily:a.getFontFamilyFromElement$1(e.elem),fontSize:parseFloat(e.elem.closest('[style*="font-size"]')?.style.fontSize)||0,fontSizeDim:"px",lineHeight:a.getLineHeightInPixels$1(e.elem),lineHeightDim:"px",textStrong:a.textHasStyle$1(e.elem,"strong","b")||a.isElementHasBold(e.elem),textItalic:a.textHasStyle$1(e.elem,"i","em")||!e.elem.closest('[style*="font-style: normal"]')&&(b?.style?.fontStyle==="italic"||e.elem.style?.fontStyle==="italic"),textStrikethrough:a.textHasStyle$1(e.elem,"s","strike")||(e.elem.style?.textDecoration?.includes("line-through")??!1)||!!e.elem.closest('[style*=" text-decoration"]')?.style.textDecoration?.includes("line-through"),textUnderline:a.textHasStyle$1(e.elem,"u")||(e.elem.style?.textDecoration?.includes("underline")??!1)||!(e.elem.style?.textDecoration?.length>0)&&e.elem.tagName==="A"||!!e.elem.closest('[style*=" text-decoration"]')?.style.textDecoration?.includes("underline"),textColor:a.rgbToHex(a.findParentWithExplicitStyle(e.elem,"color"))||a.rgbToHex(getComputedStyle(e.elem).color)||"",textBackgroundColor:a.rgbToHex(a.findParentWithExplicitStyle(e.elem,"background-color"))||"",padding:_m(r??t),borderRadius:a.getElementBorderRadius(l),backgroundColor:l.style.backgroundColor?a.rgbToHex(l.style.backgroundColor):l.getAttribute("bgcolor")||"",backgroundImage:Bm(n),backgroundPositionX:n.style.backgroundPositionX!=="initial"?n.style.backgroundPositionX:"",backgroundPositionY:n.style.backgroundPositionY!=="initial"?n.style.backgroundPositionY:"",backgroundRepeat:n.style.backgroundRepeat||"repeat",backgroundSize:n.style.backgroundSize||"auto",width:ti(s,"width"),height:ti(n,"height"),align:u,valign:n.getAttribute("valign")??"",textAlign:n.getAttribute("align")??"",border:a.getElementBorder(l),boxShadow:a.getElementBoxShadow(l),href:t.getAttribute("href")??"",outlookRounding:i,outlookBackground:a.hasElementVMLBackground(n,"inside"),mobileWidth:{value:oi(p.mobileWidth),dim:p.mobileWidthDim??"px"},mobileHeight:{value:oi(m.mobileHeight),dim:m.mobileHeightDim??"px"},mobileBorder:m.mobileBorder,mobileBorderRadius:m.mobileBorderRadius,mobileBoxShadow:m.mobileBoxShadow,mobileAlign:p.mobileAlign,mobileFontSize:{value:g.mobileFontSize,dim:g.mobileFontSizeDim||"px"},mobileTextAlign:Bo(e.elem),mobileVerticalAlign:f?.mobileVerticalAlign,mobileBackgroundColor:m.mobileBackgroundColor,mobileBackgroundImage:m.mobileBackgroundImage,mobileBackgroundPositionX:m.mobileBackgroundPositionX,mobileBackgroundPositionY:m.mobileBackgroundPositionY,mobileBackgroundRepeat:m.mobileBackgroundRepeat,mobileBackgroundSize:m.mobileBackgroundSize,mobilePadding:Nm(g.mobilePadding),mobileLineHeight:{value:g.mobileLineHeight,dim:"px"},show:p.show,exportAsPicture:s?.getAttribute("em-operation")==="exportAsPicture"};return a.isShowOnMobile(e.elem)&&(h.showOnMobile=!0),h}function Rm(e){if(a.hasForeignButtonStructure(e.closest("a")))return!0;const o=e.getAttribute("style");if(!o||!o.includes("display"))return!1;const t=e.style.display;return!(t!=="block"&&t!=="inline-block"||o.includes("mso-style-priority"))}function Pm(e,o){return o?!1:e.tagName==="A"||e.tagName==="EM-REPLACE"&&!!e.closest("a")}function Hm(e){const o=e.closest("a"),t=e.closest('a[style*="display"]');if(a.hasForeignButtonStructure(o))return!0;if(o&&t){const n=t.style.display;if(n==="block"||n==="inline-block")return!0}if(e.tagName==="A"){const n=e.getAttribute("style");if(n&&n.includes("display")&&e.closest("td[height]"))return!0}return!1}function ni(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function Im(e,o){const t=e.elem,n=a.getElementMobileProps({elem:t}),r=ni(n.mobileHeight);return{type:"vindent",caption:o.VERTICAL_INDENT,height:{value:parseFloat(t.getAttribute("height")||"0"),dim:"px"},mobileHeight:{value:r,dim:n.mobileHeightDim??"px"}}}function Om(e,o){const t=e.elem,n=a.getElementMobileProps({elem:t}),r=ni(n.mobileHeight);return{type:"vindent",caption:o.VERTICAL_INDENT,height:{value:parseFloat(t.style.height||"0"),dim:"px"},mobileHeight:{value:r,dim:n.mobileHeightDim??"px"}}}function xm(e){if(e.tagName!=="TD")return!1;if(e.classList.contains("em-vindent"))return!0;const o=e.closest("table");return e.innerHTML===""&&o?.getAttribute("width")==="100%"}function Dm(e){return e.tagName!=="DIV"?!1:!e.style.fontFamily&&!!e.style.height&&!!e.style.lineHeight&&!!e.style.fontSize}function Fm(e,o){return e.elem.tagName==="TD"?Im(e,o):Om(e,o)}function ri(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function qm(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function ii(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function Wm(e){const o=e.firstElementChild;if(!o)return 0;const t=o.getAttribute("width");return e.style.maxWidth?parseFloat(e.style.maxWidth)-parseFloat(t||"0"):e.style.width?t&&t.includes("0%")?0:parseFloat(e.style.width)-parseFloat(t||"0"):0}function $m(e,o){const t=e.elem,n=a.getElementMobileProps({elem:t}),r=t.firstElementChild,i=r?a.getElementMobileProps({elem:r}):null,l=ri(n.mobileWidth),s=i?ri(i.mobileWidth):null;return{type:"floatBlock",caption:o.FLOAT_BLOCK,width:qm(r?.getAttribute("width")),gap:{value:Wm(t),dim:"px"},maxWidth:ii(t.style.maxWidth),minWidth:ii(t.style.minWidth),valign:t.style.verticalAlign??"",mobileWidth:{value:l,dim:n.mobileWidthDim??"px"},mobileContentWidth:{value:s,dim:i?.mobileWidthDim??"px"},mobileVerticalAlign:n.mobileVerticalAlign,show:n.show}}function zm(e){if(e.tagName!=="DIV")return!1;const o=e.style.display,t=o==="inline-block"||o==="table-cell",n=!!e.style.verticalAlign;return t&&n}function Vm(e){if(e.tagName!=="TD")return e.closest("table")?.parentElement?.tagName==="BODY";if(e.classList.contains("em-vindent")||e.innerHTML===""||e.closest("table")?.getAttribute("em")==="atom"||e.firstChild?.tagName==="EDITOR")return!1;const o=!!e.querySelector('div[style*="inline-block"]'),t=!!e.querySelector(":scope > table > tr > .em-mob-wrap, :scope > table > tbody > tr > .em-mob-wrap, :scope > table > tr > td > table > tr > .em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > .em-mob-wrap, :scope > table > tr > td > table > tr > td > table > tr > .em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > .em-mob-wrap, :scope > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > .noresp-em-mob-wrap, :scope > table > tr > td > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > .noresp-em-mob-wrap, :scope > table > tr > td > table > tr > td > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > .noresp-em-mob-wrap");return!!(!o&&!t||o&&e.parentElement?.getAttribute("em")!=="block"&&!e.querySelector(".em-mob-wrap, .noresp-em-mob-wrap"))}function Um(e){if(e.tagName!=="TD"||e.classList.contains("em-vindent")||e.innerHTML===""||e.firstChild?.tagName==="EDITOR"||!(e.parentElement?.getAttribute("em")==="block"||e.parentElement?.parentElement?.getAttribute("em")==="block"||e.parentElement?.parentElement?.parentElement?.getAttribute("em")==="block"))return!1;const o=!!e.querySelector('div[style*="inline-block"]'),t=!!e.querySelector(":scope > table > tr > .em-mob-wrap, :scope > table > tbody > tr > .em-mob-wrap, :scope > table > tr > td > table > tr > .em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > .em-mob-wrap, :scope > table > tr > td > table > tr > td > table > tr > .em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > .em-mob-wrap, :scope > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > .noresp-em-mob-wrap, :scope > table > tr > td > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > .noresp-em-mob-wrap, :scope > table > tr > td > table > tr > td > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > .noresp-em-mob-wrap");return o||t}function jm(e){if(e.tagName==="TD"){if(e.innerHTML!==""||e.getAttribute("height"))return!1;const o=!e.getAttribute("width")||e.classList.contains("em-mob-wrap")||e.classList.contains("noresp-em-mob-wrap"),t=!!e.closest('[em="block"].empty-structure')||!!e.closest(".em-structure");return o&&t}return e.tagName==="DIV"?!!e.closest("amp-accordion")&&!e.innerHTML:!1}function Gm(e){if(e.tagName!=="TD")return!1;const o=!!e.firstChild&&e.firstChild.tagName==="EDITOR";return o&&e.closest("table")?.getAttribute("em")==="atom"?!0:!(o||e.classList.contains("em-vindent"))}function Ym(e){const o={items:[],gap:null,gapMobile:null,valign:"",wrap:void 0,dirRevers:!1},t=".em-mob-wrap, .noresp-em-mob-wrap",n=e.querySelector(t),r=e.querySelectorAll(t).length;if(n&&e.querySelectorAll(".em-mob-wrap:first-child, .noresp-em-mob-wrap:first-child").length===1)o.wrap=!0,e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(i=>{if(o.items.push({width:parseFloat(i.getAttribute("width")||"0"),current:!1}),r>1){const l=n.nextElementSibling;o.gap=parseFloat(l?.getAttribute("width")||"0");const s=a.getElementMobileProps({elem:l});o.gapMobile=s.mobileHeight||0}else o.gap=0;(i.classList.contains("em-mob-wrap-cancel")||i.classList.contains("noresp-em-mob-wrap-cancel"))&&(o.wrap=!1)}),o.valign=n.getAttribute("valign")||"",(n?document.querySelector('[em-edit="active"]'):e.closest(t)?.parentElement?.closest("td"))?.getAttribute("dir")==="rtl"&&(o.dirRevers=!0);else if(e.querySelector('div[style*="inline-block"]')){const i=e.querySelectorAll('div[style*="inline-block"]');if(i.length>1)i.forEach(s=>{const c=s,d=c.firstElementChild;o.items.push({width:parseFloat(d?.getAttribute("width")||"0"),current:!1});const u=d?.getAttribute("width"),g=parseFloat(c.style.width);!u||u.includes("%")?o.gap=g-g:o.gap=g-parseFloat(u)});else{const s=e.querySelector('div[style*="inline-block"]');o.items=[{width:parseFloat(s.firstElementChild?.getAttribute("width")||"0"),current:!0}],o.gap=0}const l=e.querySelector('div[style*="inline-block"]');o.valign=l?.style.verticalAlign||"",(l?document.querySelector('[em-edit="active"]'):e.closest('div[style*="inline-block"]')?.parentElement)?.getAttribute("dir")==="rtl"&&(o.dirRevers=!0)}return o}function Km(e,o,t){const n=e.elem,r={...t.getElementTdDiv(n),direction:n.getAttribute("dir")??"none"};let i="td",l=o.TABLE_COLUMN;return(n.classList.contains("em-mob-wrap")||n.classList.contains("noresp-em-mob-wrap"))&&(i="column"),n.parentElement?.getAttribute("em")==="group"?(l=o.ELEMENT_PATH_GROUP??o.GROUP,i="group"):n.closest("table")?.parentElement?.tagName==="BODY"?(l=o.GROUP,i="group"):n.classList.contains("em-mob-wrap")?l=o.FLOAT_BLOCK:n.parentElement?.getAttribute("em")==="block"&&(l=o.STRUCTURE),{type:i,caption:l,settings:r}}function Xm(e,o,t){const n=e.elem,r={...t.getElementTdDiv(n),direction:n.getAttribute("dir")??"none"};return r.floatBlocks=Ym(n),r.isContrastBlock=!!n.closest(".em-contrast-block"),{type:"structure",caption:o.STRUCTURE,settings:r}}function Zm(e,o,t){const n=e.elem,r={...t.getElementTdDiv(n),direction:n.getAttribute("dir")??"none"};let i=o.TABLE_COLUMN,l="td";return n.parentElement?.getAttribute("em")==="group"?(i=o.ELEMENT_PATH_GROUP??o.GROUP,l="group"):n.closest("table")?.getAttribute("em")==="atom"?i=o.ELEMENT:n.parentElement?.getAttribute("em")==="block"&&(i=o.STRUCTURE),{type:l,caption:i,settings:r}}function uo(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function Jm(e,o,t){const n=e.elem;return{type:"div",caption:o.CONTAINER,...t.getElementTdDiv(n),width:uo(n.style.width),maxWidth:uo(n.style.maxWidth),minWidth:uo(n.style.minWidth),height:uo(n.style.height),valign:n.style.verticalAlign??"",align:n.style.textAlign??"",direction:n.getAttribute("dir")??"none"}}function Dt(e,o,t){const n=t==="All"?"border":`border-${t.toLowerCase()}`,r=e?.includes(`${n}:`);if(t==="All")return{color:o.getAttribute("bordercolor")?a.rgbToHex(o.getAttribute("bordercolor")):o.style?.border?a.rgbToHex(o.style.borderColor):"",width:o.getAttribute("border")||(o.style?.border?o.style.borderWidth:""),style:e?.includes("border:")?o.style.borderStyle:o.getAttribute("border")?"solid":""};const i=`border${t}Color`,l=`border${t}Width`,s=`border${t}Style`;return{color:r?a.rgbToHex(o.style[i]):"",width:r?o.style[l]:"",style:r?o.style[s]:""}}function Ft(e,o,t){const n=t==="All"?"border":`border-${t.toLowerCase()}`,r=!!e?.includes(`${n}:`);if(t==="All")return{color:r?a.rgbToHex(o.style.borderColor):"",width:r?o.style.borderTopWidth:0,style:r?o.style.borderStyle:""};const i=`border${t}Color`,l=`border${t}Width`,s=`border${t}Style`;return{color:r?a.rgbToHex(o.style[i]):"",width:r?o.style[l]:0,style:r?o.style[s]:""}}function Qm(e){return!!e.closest(".em-element-custom-table")}function eu(e,o,t){const n=e.elem,r=n.tagName==="DIV"||n.querySelector(`.${t.CLASS_FOR_BASIC_CELL}`)||n.querySelector("EDITOR")?n.closest("TD"):n,i=r.closest("TABLE"),l=i.getAttribute("style"),s=r.getAttribute("style"),c=t.parseTableElementToModel(i);if(t.activeCell.length>1){const b=c.cells.find(h=>h.id===t.activeCell[0]);c.cells.find(h=>h.id===t.activeCell[t.activeCell.length-1])?.style,b?.style}const d=i?.style?.borderRadius?t.extractBorderRadius(l||""):null,u=d?d.firstNumber===d.secondNumber&&d.secondNumber===d.thirdNumber&&d.thirdNumber===d.fourthNumber:!1,g=t.parseBackgroundStyles(l||""),m=a.getElementBoxShadow(i),f=a.getElementMobileProps({elem:i}),p={...t.getElementTdDiv(n),direction:n.getAttribute("dir")??"none",show:f.show,outlookBackground:a.hasElementVMLBackground(n.closest(".em-element-custom-table")??n,"around"),customTable:{paddingLeftRight:r.style.paddingLeft===r.style.paddingRight?r.style.paddingLeft:"",paddingTopBottom:r.style.paddingTop===r.style.paddingBottom?r.style.paddingTop:"",paddingLeft:r.style.paddingLeft,paddingRight:r.style.paddingRight,paddingTop:r.style.paddingTop,paddingBottom:r.style.paddingBottom,backgroundColor:i.getAttribute("bgcolor")?a.rgbToHex(i.getAttribute("bgcolor")):"",backgroundImage:[{type:"url",value:g?.backgroundImage??""}],backgroundPositionX:g?.backgroundPositionX??"center",backgroundPositionY:g?.backgroundPositionY??"center",backgroundRepeat:g?.backgroundRepeat??"repeat",backgroundSize:g?.backgroundSize??"cover",borderAll:Dt(l,i,"All"),borderBottom:Dt(l,i,"Bottom"),borderTop:Dt(l,i,"Top"),borderRight:Dt(l,i,"Right"),borderLeft:Dt(l,i,"Left"),borderRadius:{all:l?.includes("border-radius:")&&u?+d.firstNumber:null,topLeft:l?.includes("border-radius:")&&!u?+d.firstNumber:null,topRight:l?.includes("border-radius:")&&!u?+d.secondNumber:null,bottomRight:l?.includes("border-radius:")&&!u?+d.thirdNumber:null,bottomLeft:l?.includes("border-radius:")&&!u?+d.fourthNumber:null},boxShadow:{color:m?.color??null,hOffset:m?.hOffset??null,vOffset:m?.vOffset??null,blurRadius:m?.blurRadius??null,spreadRadius:m?.spreadRadius??null,inset:m?.inset??null},mobileBoxShadow:f.mobileBoxShadow,mobileBackgroundColor:f.mobileBackgroundColor,mobileBackgroundImage:f.mobileBackgroundImage,mobileBackgroundPositionX:f.mobileBackgroundPositionX,mobileBackgroundPositionY:f.mobileBackgroundPositionY,mobileBackgroundRepeat:f.mobileBackgroundRepeat,mobileBackgroundSize:f.mobileBackgroundSize,mobileWidth:{value:f.mobileWidth!=null?f.mobileWidth:null,dim:f.mobileWidthDim},mobileHeight:{value:f.mobileHeight!=null?f.mobileHeight:null,dim:"px"},mobileBorderRadius:f.mobileBorderRadius,mobileBorder:f.mobileBorder,borderPosition:a.getSimpleBorderType(i),cell_borderPosition:a.getSimpleBorderType(r),cellBackgroundColor:s?.includes("background-color:")?a.rgbToHex(r.style.backgroundColor):"",cell_borderAll:Ft(s,r,"All"),cell_borderBottom:Ft(s,r,"Bottom"),cell_borderTop:Ft(s,r,"Top"),cell_borderRight:Ft(s,r,"Right"),cell_borderLeft:Ft(s,r,"Left"),cell_paddingLeftRight:r.style.paddingLeft===r.style.paddingRight?r.style.paddingLeft:"",cell_paddingTopBottom:r.style.paddingTop===r.style.paddingBottom?r.style.paddingTop:"",cell_paddingLeft:r.style.paddingLeft,cell_paddingRight:r.style.paddingRight,cell_paddingTop:r.style.paddingTop,cell_paddingBottom:r.style.paddingBottom,linkHref:n.getAttribute("href")?.trim()??"",textLink:!!n.closest("a"),target:n.getAttribute("target")??"",fontFamily:t.getFontFamilyFromElement(t.requestElemWithStyle?.closest('[style*="font-family"]')||n),fontSize:t.requestElemWithStyle?.style?.fontSize?parseInt(t.requestElemWithStyle.style.fontSize,10):t.requestElemWithStyle?.closest('div[style*="font-size"]')?.style?.fontSize?parseInt(t.requestElemWithStyle.closest('div[style*="font-size"]').style.fontSize,10):null,textStrikethrough:t.textHasStyle(n,"s","strike")||t.requestElemWithStyle?.style.textDecoration.includes("line-through"),textUnderline:t.textHasStyle(n,"u")||t.requestElemWithStyle.style.textDecoration.includes("underline")||!t.requestElemWithStyle.style.textDecoration&&n.tagName==="A",lineHeight:t.getLineHeghtInPixels(t.requestElemWithStyle),textStrong:t.textHasStyle(n,"strong","b")||t.isElementHasBold(t.requestElemWithStyle),textItalic:t.textHasStyle(n,"i","em")||!t.requestElemWithStyle.closest('[style*="font-style: normal"]')&&t.requestElemWithStyle?.style?.fontStyle==="italic",textAlign:n.style?.textAlign||n.getAttribute("align")||n.closest("[align]")?.getAttribute("align")||"",textColor:a.rgbToHex(n.closest('[style*="color"]')?.style.color)||a.rgbToHex(getComputedStyle(n).color),textBackgroundColor:a.rgbToHex(n.closest('[style*="background-color"]')?.style.backgroundColor)||a.rgbToHex(getComputedStyle(n).backgroundColor),textValign:n.style?.verticalAlign||n.getAttribute("valign")||n.closest("[valign]")?.getAttribute("valign")||""}};return n.getAttribute("new")&&(n.removeAttribute("new"),p.customTable.isNewLink=!0,n.setAttribute("em-edit","active")),{type:"customTable",caption:o.ELEMENT,settings:p}}function li(e,o){const t=e==null?null:typeof e=="number"?e:Number(e);return{value:t==null||Number.isNaN(t)?null:t,dim:o==="%"?"%":"px"}}function tu(e){return e.tagName==="TABLE"&&e.getAttribute("em")==="atom"}function ai(e,o,t){return e?{fontFamily:a.getFontFamilyFromElement$1(e.closest('[style*="font-family"]')||e),textStrong:a.textHasStyle$1(e,"strong","b")||a.isElementHasBold(e)||!!o?.querySelector("strong")||!!o?.querySelector("bold")||e.querySelector("span")?.style?.fontWeight?.includes("bold"),textItalic:!e.closest('[style*="font-style: normal"]')&&e.style?.fontStyle==="italic"||!!e.querySelector("em")||!!e.querySelector("i")||e.querySelector("span")?.style?.fontStyle?.includes("italic"),fontSize:parseFloat(e.closest('[style*="font-size"]')?.style.fontSize)||0,lineHeight:t.getLineHeghtInPixels(e),textColor:a.rgbToHex(e.closest('[style*="color"]')?.style.color)||"",textBackgroundColor:a.rgbToHex(e.closest('[style*="background-color"]')?.style.backgroundColor)||"",textStrikethrough:ou(e),textUnderline:nu(e)}:{}}function ou(e){return e.style?.textDecorationLine?.includes("line-through")||e.querySelector("em")?.style?.textDecorationLine?.includes("line-through")||e.querySelector("span")?.style?.textDecorationLine?.includes("line-through")||e.style?.textDecoration?.includes("line-through")||e.querySelector("em")?.style?.textDecoration?.includes("line-through")||e.querySelector("span")?.style?.textDecoration?.includes("line-through")||!!e.querySelector("strike")}function nu(e){return e.style?.textDecorationLine?.includes("underline")||e.querySelector("em")?.style?.textDecorationLine?.includes("underline")||e.querySelector("span")?.style?.textDecorationLine?.includes("underline")||e.style?.textDecoration?.includes("underline")||e.querySelector("em")?.style?.textDecoration?.includes("underline")||e.querySelector("span")?.style?.textDecoration?.includes("underline")||!!e.querySelector("underline")||!!e.querySelector("u")}function ru(e,o,t){const n=e.elem.querySelector(".em-element-list-ul")||e.elem.querySelector(".em-element-list-ol")||null,r=n?e.elem.querySelector('table[class^="em-element-list"] tr td:nth-child(2) div'):null,i=a.getElementMobileProps({elem:e.elem}),l=e.elem.querySelector("td"),s=t.getElementTdDiv(l),c=n?ai(r,n,t):{};return{type:"td",caption:o.ELEMENT,...s,mobileWidth:li(i.mobileWidth,i.mobileWidthDim),direction:l?.getAttribute("dir")??"none",elementName:n?"List":"",...c}}function iu(e,o,t){const n=e.elem.closest("table")?.closest("td"),r=e.elem.closest("table");if(!n&&!r)return{settings:null,editTargetTd:null,shouldResetProgrammaticSelection:!0};const i=n?.querySelector('table[class^="em-element-list"] tr td:nth-child(2) div'),l=!!(n?.querySelector(".em-element-list-ul")||n?.querySelector(".em-element-list-ol")),s=a.getElementMobileProps({elem:n}),c=n?.querySelector("td"),d=t.getElementTdDiv(c),u=i?ai(i,r,t):{};return{settings:{type:"td",caption:o.ELEMENT,...d,mobileWidth:li(s.mobileWidth,s.mobileWidthDim),direction:c?.getAttribute("dir")??"none",elementName:l?"List":"",...u},editTargetTd:c,shouldResetProgrammaticSelection:!0}}var lu='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 15 3 C 13.742188 3 12.847656 3.890625 12.40625 5 L 5 5 L 5 28 L 13 28 L 13 30 L 27 30 L 27 14 L 25 14 L 25 5 L 17.59375 5 C 17.152344 3.890625 16.257813 3 15 3 Z M 15 5 C 15.554688 5 16 5.445313 16 6 L 16 7 L 19 7 L 19 9 L 11 9 L 11 7 L 14 7 L 14 6 C 14 5.445313 14.445313 5 15 5 Z M 7 7 L 9 7 L 9 11 L 21 11 L 21 7 L 23 7 L 23 14 L 13 14 L 13 26 L 7 26 Z M 15 16 L 25 16 L 25 28 L 15 28 Z"/></svg>',au='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 16 2 C 14.742188 2 13.847656 2.890625 13.40625 4 L 5 4 L 5 29 L 27 29 L 27 4 L 18.59375 4 C 18.152344 2.890625 17.257813 2 16 2 Z M 16 4 C 16.554688 4 17 4.445313 17 5 L 17 6 L 20 6 L 20 8 L 12 8 L 12 6 L 15 6 L 15 5 C 15 4.445313 15.445313 4 16 4 Z M 7 6 L 10 6 L 10 10 L 22 10 L 22 6 L 25 6 L 25 27 L 7 27 Z M 21.28125 13.28125 L 15 19.5625 L 11.71875 16.28125 L 10.28125 17.71875 L 14.28125 21.71875 L 15 22.40625 L 15.71875 21.71875 L 22.71875 14.71875 Z"/></svg>',su='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 5 5 L 5 9 L 6 9 L 6 19 L 5 19 L 5 23 L 9 23 L 9 22 L 11 22 L 11 24 L 10 24 L 10 28 L 14 28 L 14 27 L 24 27 L 24 28 L 28 28 L 28 24 L 27 24 L 27 14 L 28 14 L 28 10 L 24 10 L 24 11 L 22 11 L 22 9 L 23 9 L 23 5 L 19 5 L 19 6 L 9 6 L 9 5 Z M 9 8 L 19 8 L 19 9 L 20 9 L 20 19 L 19 19 L 19 20 L 9 20 L 9 19 L 8 19 L 8 9 L 9 9 Z M 22 13 L 24 13 L 24 14 L 25 14 L 25 24 L 24 24 L 24 25 L 14 25 L 14 24 L 13 24 L 13 22 L 19 22 L 19 23 L 23 23 L 23 19 L 22 19 Z"/></svg>',pt=null,cu=".em-prevent-action";function du(e){pt=e}function mu(){return a.state.get("emailWidth")||475}function uu(){return a.state.get("copyPasteEnabled")||!1}function fu(){return a.state.get("saveBlockEnabled")||!1}function pu(){return a.state.get("blocksAddPanelEnabled")||!1}function gu(){return a.state.get("codeMode")||!1}function qt(e,o){if(!pt)return;const t=pt.getLocale(),n=mu(),r=uu(),i=fu(),l=pu(),s=gu();if(o==="atom"){e.setAttribute("em-state","active"),e.getBoundingClientRect().left<50&&e.setAttribute("em-state","active-inside");const c=a.addElement({targetElement:e,insertType:"append",className:"em-element-editor",width:82,height:26});c.classList.add("of-atom"),document.body.getBoundingClientRect().height>70&&e.getBoundingClientRect().top+70>document.body.getBoundingClientRect().height&&c.classList.add("out-of-iframe"),e.getBoundingClientRect().top<25&&c.classList.add("em-top-crossed");const d=a.addElement({targetElement:c,insertType:"append",className:"em-element-editor-widget"});a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:a.icon(a.braille_solid_default,`${a.ICON_SIZE} ${a.ICON_ROLE.drag}`,'style="transform: rotate(90deg)"'),title:t.REORDER_ATOM}),a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:a.icon(a.pen_solid_default,`${a.ICON_SIZE} em-analytics__atoms-panel-edit`),title:t.EDIT_ATOM}),a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:a.icon(a.copy_solid_default,`${a.ICON_SIZE} em-analytics__atoms-panel-clone`),title:t.CLONE_ATOM}),a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:a.icon(a.trash_alt_solid_default,`${a.ICON_SIZE} em-analytics__atoms-panel-remove`),title:t.REMOVE_ATOM}),a.stickyCheck(pt.commit)}if(o==="block"){e.setAttribute("em-state","active");const c=a.addElement({targetElement:e,insertType:"append",className:"em-element-editor"});c.classList.add("of-block"),e.getBoundingClientRect().left<35&&e.setAttribute("em-state","active-inside"),(document.body.getBoundingClientRect().height>130&&e.getBoundingClientRect().top+130>document.body.getBoundingClientRect().height||document.documentElement.clientWidth<n&&e.getBoundingClientRect().top-34<0)&&c.classList.add("out-of-iframe");const d=a.addElement({targetElement:c,insertType:"append",className:"em-element-editor-widget"}),u=a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-group"});if(a.addElement({targetElement:u,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:a.icon(a.braille_solid_default,`${a.ICON_SIZE} ${a.ICON_ROLE.drag}`),title:t.REORDER_BLOCK}),a.addElement({targetElement:u,insertType:"append",className:"em-element-editor-widget-up"+(e.closest('[em="block"]')?.previousElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:a.icon(a.arrow_up_solid_default,`${a.ICON_SIZE} ${a.ICON_ROLE.moveUp}`),title:t.REORDER_BLOCK_UP}),a.addElement({targetElement:u,insertType:"append",className:"em-element-editor-widget-down"+(e.closest('[em="block"]')?.nextElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:a.icon(a.arrow_down_solid_default,`${a.ICON_SIZE} ${a.ICON_ROLE.moveDown}`),title:t.REORDER_BLOCK_DOWN}),a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:a.icon(a.pen_solid_default,`${a.ICON_SIZE} em-analytics__blocks-panel-edit`),title:t.EDIT_BLOCK}),r){const m=a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-group"});a.addElement({targetElement:m,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:a.icon(a.copy_solid_default,`${a.ICON_SIZE} em-analytics__blocks-panel-clone`),title:t.CLONE_BLOCK}),a.addElement({targetElement:m,insertType:"append",className:"em-element-editor-widget-copy",HTMLcontent:a.icon(au,`${a.ICON_SIZE} em-analytics__blocks-panel-copy`),title:t.COPY_BLOCK_TO_CLIPBOARD}),a.addElement({targetElement:m,insertType:"append",className:"em-element-editor-widget-paste",HTMLcontent:a.icon(lu,`${a.ICON_SIZE} em-analytics__blocks-panel-paste`),title:t.PASTE_BLOCK_FROM_CLIPBOARD})}else a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:a.icon(a.copy_solid_default,`${a.ICON_SIZE} em-analytics__blocks-panel-clone`),title:t.CLONE_BLOCK});if(e.closest(cu))return;if((document.querySelector('[em="block"][em-edit="active"] .em-mob-wrap, [em="block"][em-edit="active"] .noresp-em-mob-wrap')&&document.querySelector('[em="block"][em-state="active"] .em-mob-wrap, [em="block"][em-state="active"] .noresp-em-mob-wrap')||document.querySelector('[em="block"] > [em-edit="active"] .em-mob-wrap, [em="block"] > [em-edit="active"] .noresp-em-mob-wrap')&&document.querySelector('[em="block"] > [em-state="active"] .em-mob-wrap, [em="block"] > [em-state="active"] .noresp-em-mob-wrap')||document.querySelector('[em="block"] > [em-edit="active"]')?.closest(".em-structure")&&document.querySelector('[em="block"] > [em-state="active"]')?.closest(".em-structure"))&&(document.querySelector('[em="block"][em-edit="active"]')&&document.querySelector('[em="block"][em-edit="active"]')!==d.closest('[em-edit="active"]')||document.querySelector('[em="block"] > [em-edit="active"]')&&document.querySelector('[em="block"] > [em-edit="active"]')!==d.closest('[em-edit="active"]'))&&a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-merge",HTMLcontent:a.icon(a.object_group_solid_default,`${a.ICON_SIZE} ${a.ICON_ROLE.merge} em-analytics__blocks-panel-merge`),title:t.MERGE_BLOCK}),d.closest('[em="block"]')?.querySelectorAll(":scope > td > table").length>1&&d.closest('[em="block"]')?.querySelectorAll(".em-mob-wrap")&&a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-unmerge",HTMLcontent:a.icon(su,`${a.ICON_SIZE} ${a.ICON_ROLE.unmerge} em-analytics__blocks-panel-unmerge`),title:t.UNMERGE_BLOCK}),i&&a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-add-block",HTMLcontent:a.icon(a.save_solid_default,`${a.ICON_SIZE} em-analytics__blocks-panel-save`),title:t.SAVE_TO_BLOCKS}),a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:a.icon(a.trash_alt_solid_default,`${a.ICON_SIZE} em-analytics__blocks-panel-remove`),title:t.REMOVE_BLOCK}),l&&!e.querySelector(".em-element-block-add")&&!s){const m=a.addElement({targetElement:e,insertType:"append",className:"em-element-block-add"});e.getBoundingClientRect().bottom+1>document.body.getBoundingClientRect().height&&m.classList.add("out-of-iframe"),a.addElement({targetElement:m,insertType:"append",className:"em-element-block-add-plus",HTMLcontent:`${a.icon(a.plus_solid_default,`${a.ICON_SIZE} ${a.ICON_ROLE.add}`)} ${t.ADD_BLOCK}`,title:t.ADD_BLOCK}),a.addElement({targetElement:m,insertType:"append",className:"add-empty-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="border-outer" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656zM484 366h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM302 548h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm364 0h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-182 0h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm0 182h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8z"></path></svg>',title:t.ADD_EMPTY_BLOCK}),a.addElement({targetElement:m,insertType:"append",className:"add-saved-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="appstore-add" width="1em" height="1em" fill="currentColor" aria-hidden="true"><defs><style></style></defs><path d="M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zm52 132H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200zM424 712H296V584c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v128H104c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h128v128c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V776h128c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"></path></svg>',title:t.ADD_SAVED_BLOCK}),a.addElement({targetElement:m,insertType:"append",className:"add-common-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="appstore" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"></path></svg>',title:t.ADD_COMMON_BLOCK}),a.addElement({targetElement:m,insertType:"append",className:"add-template-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="build" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M916 210H376c-17.7 0-32 14.3-32 32v236H108c-17.7 0-32 14.3-32 32v272c0 17.7 14.3 32 32 32h540c17.7 0 32-14.3 32-32V546h236c17.7 0 32-14.3 32-32V242c0-17.7-14.3-32-32-32zm-504 68h200v200H412V278zm-68 468H144V546h200v200zm268 0H412V546h200v200zm268-268H680V278h200v200z"></path></svg>',title:t.ADD_TEMPLATE_BLOCK}),a.addElement({targetElement:m,insertType:"append",className:"add-search-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg>',title:t.ADD_SEARCH_BLOCK})}a.stickyCheck(pt.commit);const g=e.closest('[em="block"]');g&&(g.onmouseleave=function(){Wt(void 0)})}if(o==="group"){e.tagName==="TR"?e.querySelector("td")?.setAttribute("em-state","active"):e.setAttribute("em-state","active");const c=a.addElement({targetElement:e,insertType:"append",className:"em-element-editor"});c.classList.add("of-group"),document.body.getBoundingClientRect().height>130&&e.getBoundingClientRect().top+130>document.body.getBoundingClientRect().height&&c.classList.add("out-of-iframe");const d=a.addElement({targetElement:c,insertType:"append",className:"em-element-editor-widget"}),u=a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-group"});a.addElement({targetElement:u,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:a.icon(a.braille_solid_default,`${a.ICON_SIZE} ${a.ICON_ROLE.drag}`),title:t.REORDER_BLOCK}),a.addElement({targetElement:u,insertType:"append",className:"em-element-editor-widget-up"+(e.closest('[em="group"]')?.previousElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:a.icon(a.arrow_up_solid_default,`${a.ICON_SIZE} ${a.ICON_ROLE.moveUp}`),title:t.REORDER_BLOCK_UP}),a.addElement({targetElement:u,insertType:"append",className:"em-element-editor-widget-down"+(e.closest('[em="group"]')?.nextElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:a.icon(a.arrow_down_solid_default,`${a.ICON_SIZE} ${a.ICON_ROLE.moveDown}`),title:t.REORDER_BLOCK_DOWN}),a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-add",HTMLcontent:a.icon(a.plus_solid_default,`${a.ICON_SIZE} ${a.ICON_ROLE.add} em-analytics__groups-panel-add`),title:t.ADD_GROUP}),a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:a.icon(a.pen_solid_default,`${a.ICON_SIZE} em-analytics__groups-panel-edit`),title:t.EDIT_GROUP}),a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:a.icon(a.copy_solid_default,`${a.ICON_SIZE} em-analytics__groups-panel-clone`),title:t.CLONE_GROUP}),document.querySelectorAll('[em="group"]').length>1&&a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:a.icon(a.trash_alt_solid_default,`${a.ICON_SIZE} em-analytics__groups-panel-remove`),title:t.REMOVE_GROUP}),a.stickyCheck(pt.commit)}}function Wt(e){if(document.documentElement.classList.contains("em-resize-start"))return;const o=a.state.get("isLeftButtonDown")||!1;e&&e.closest("[em]")?.getAttribute("em")==="atom"?(document.querySelectorAll('[em="atom"] .em-element-editor, [em="atom"] .em-vindent-paddingTop, [em="atom"] .em-vindent-paddingRight, [em="atom"] .em-vindent-paddingBottom, [em="atom"] .em-vindent-paddingLeft, td.em-vindent .em-element-vindent-value, div[style*="height"][style*="line-height"].em-vindent .em-element-vindent-value').forEach(t=>{t.closest('[em="atom"]')!==e&&!o&&t.remove()}),document.querySelectorAll('[em="group"] .em-element-editor.of-group').forEach(t=>{t.remove()}),document.querySelectorAll('[em="atom"][em-state], [em="atom"] [em-state]').forEach(t=>{t.closest('[em="atom"]')!==e&&t.removeAttribute("em-state")})):e&&e.closest("[em]")?.getAttribute("em")==="block"?(document.querySelectorAll('[em="block"] .em-element-editor, .em-element-block-add, [em="block"] .em-vindent-paddingTop, [em="block"] .em-vindent-paddingRight, [em="block"] .em-vindent-paddingBottom, [em="block"] .em-vindent-paddingLeft, td.em-vindent .em-element-vindent-value, div[style*="height"][style*="line-height"].em-vindent .em-element-vindent-value, .em-gap').forEach(t=>{t.closest('[em="block"]')!==e&&!o&&t.remove()}),document.querySelectorAll('[em="group"] .em-element-editor.of-group, [em="atom"] .em-element-editor').forEach(t=>{t.remove()}),document.querySelectorAll("[em-state]").forEach(t=>{(t.closest('[em="block"]')!==e||t.closest('[em="atom"]'))&&t.removeAttribute("em-state")})):(e&&e.closest("[em]")?.getAttribute("em")==="group"||e===void 0)&&(document.querySelectorAll('[em="block"] .em-element-editor, .em-element-block-add, [em="block"] .em-vindent-paddingTop, [em="block"] .em-vindent-paddingRight, [em="block"] .em-vindent-paddingBottom, [em="block"] .em-vindent-paddingLeft, td.em-vindent .em-element-vindent-value, div[style*="height"][style*="line-height"].em-vindent .em-element-vindent-value, .em-gap').forEach(t=>{o||t.remove()}),document.querySelectorAll('[em="atom"] .em-element-editor, [em="atom"] .em-vindent-paddingTop, [em="atom"] .em-vindent-paddingRight, [em="atom"] .em-vindent-paddingBottom, [em="atom"] .em-vindent-paddingLeft, td.em-vindent .em-element-vindent-value, div[style*="height"][style*="line-height"].em-vindent .em-element-vindent-value').forEach(t=>{o||t.remove()}),document.querySelectorAll('[em="group"] .em-element-editor, [em="group"] .em-vindent-paddingTop, [em="group"] .em-vindent-paddingRight, [em="group"] .em-vindent-paddingBottom, [em="group"] .em-vindent-paddingLeft, td.em-vindent .em-element-vindent-value, div[style*="height"][style*="line-height"].em-vindent .em-element-vindent-value').forEach(t=>{t.closest('[em="group"]')!==e&&!o&&t.remove()}),document.querySelectorAll("[em-state]").forEach(t=>{(t.closest('[em="group"]')!==e||t.closest('[em="block"]')||t.closest('[em="atom"]'))&&t.removeAttribute("em-state")})),document.querySelectorAll(".em-block-insert").forEach(t=>t.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")),document.querySelectorAll(".em-block-insert-empty").forEach(t=>t.classList.remove("em-block-insert-empty")),document.querySelectorAll('[em-hover="true"]').forEach(t=>t.removeAttribute("em-hover"))}function bu(e,o){if(!e?.isConnected)return;let t;if(t=e.closest('[em="atom"]')){if(Wt(t),t.querySelector(".em-element-editor.of-atom")||qt(t.tagName==="TR"?t.querySelector("td"):t,"atom"),!t.closest('[em="block"]')?.querySelector(".em-element-editor.of-block")){document.querySelectorAll('[em="block"] > td > .em-element-editor, [em="block"] > td > .em-element-block-add').forEach(r=>{r.remove()}),document.querySelectorAll("[em-state]").forEach(r=>{r.removeAttribute("em-state")});const n=t.closest('[em="block"]');n&&qt(n.tagName==="TR"?n.querySelector("td"):n,"block"),o.setBlockGroupControlsPosition()}}else(t=e.closest('[em="block"]'))?(Wt(t),t.querySelector(".em-element-editor.of-block")||(qt(t.tagName==="TR"?t.querySelector("td"):t,"block"),o.setBlockGroupControlsPosition())):(t=e.closest('[em="group"]'))&&(Wt(t),t.querySelector(".em-element-editor.of-group")||(qt(t.tagName==="TR"?t.querySelector("td"):t,"group"),o.setBlockGroupControlsPosition()));e.closest(".em-element-path")||document.querySelectorAll('[em-hover="true"]').forEach(function(n){n.removeAttribute("em-hover")}),!e.closest(".em-editor-wrapper")&&!e.closest(".em-element-editor")&&!e.closest(".em-vindent")&&!e.closest(".em-gap")&&!e.closest(".em-element-resize-img")&&!e.closest(".em-element-img-change-group")&&!e.closest(".em-element-block-add")&&!e.closest(".em-element-path")&&e.tagName!=="IMG"?e.setAttribute("em-hover","true"):e.tagName==="IMG"&&e.parentElement?.setAttribute("em-hover","true"),o.commit(!1)}var hu='<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="20"></td></tr></table>',yu=['[em="block"].empty-structure td[em-edit="active"]:not([height]):not([width]):empty','[em="block"].empty-structure td[em-edit="active"]:not([height]):not([width])','.em-structure td[em-edit="active"]:not([height]):not([width]):empty','.em-structure td[em-edit="active"]:not([height]):not([width])','.em-structure td.em-mob-wrap[em-edit="active"]','.em-structure td.noresp-em-mob-wrap[em-edit="active"]'];function si(){a.clearPendingPaletteInsert(),document.body.classList.remove("em-block-insert-body","em-atom-insert-body","em-atom-insert-body-inside"),document.querySelectorAll(".em-block-insert-empty").forEach(e=>e.classList.remove("em-block-insert-empty")),document.querySelectorAll(".em-atom-insert-empty").forEach(e=>e.classList.remove("em-atom-insert-empty"))}function Eu(){const e=document.querySelectorAll('[em="block"]');return e.length?e[e.length-1]:null}function Su(){for(const e of yu){const o=document.querySelector(e);if(o)return o}return null}function Cu(e){const o=e.querySelectorAll('[em="atom"]');return o.length?o[o.length-1]:e}function vu(e){const o=e.querySelectorAll('[em="atom"]');if(o.length)return o[o.length-1];const t=e.querySelector("td.em-mob-wrap")??e.querySelector("td.noresp-em-mob-wrap")??e.querySelector('td[em-edit="active"]:not([height]):not([width])');return t||(e instanceof HTMLElement?Qt(e):null)}function Au(e,o,t){const n=e.getAttribute("em")==="atom",r=n?"afterend":"beforeend",i=n?e.parentElement:e;return o.match(/class="em-countdown"/gi)?t.insertCountdown({targetElem:e,targetPlace:r,atomHTML:o}):e.insertAdjacentHTML(r,o),Tu(i,e,n)}function Tu(e,o,t){if(t){const n=o.nextElementSibling;if(n?.getAttribute("em")==="atom")return n}if(e){const n=e.querySelectorAll('[em="atom"]');if(n.length)return n[n.length-1]}return null}function ci(e,o,t){return o.match(/em="atom"><tr><td>\s*<img/gi)&&(o=t.setImageWidth({atomHTML:o,targetAtom:e})),o=t.commonStylesApply({html:o}),Au(e,o,t)}function Lu(e,o){if(!e||document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]')||document.documentElement.scrollHeight+(o.iframeOffsetTop||0)<=(o.previewHeight||0))return;const t=e.getBoundingClientRect();o.messageService.send({operation:"application_scroll-to",settings:{value:t.top+t.height}})}function wu(){const e=document.querySelector("table:empty");return e instanceof HTMLTableElement?e:null}function ku(e,o){const t=wu();if(!t)return null;e.match(/em="atom"><tr><td>\s*<img/gi)&&(e=o.setImageWidth({atomHTML:e,targetAtom:t})),e=o.commonStylesApply({html:e});let n=$n(e);if(e!==hu){const i=n.match(/<style((.|\n|\r)*?)<\/style>/g);o.setDocumentStyles(i)}n=o.commonStylesApplyToBlock({html:n}),(n.indexOf("empty-structure")>-1||n.indexOf("em-structure")>-1)&&(n=o.setFloatBlocksWidth({blockHTML:n,targetBlock:t}));const r=!!e.match(/class="em-countdown"/gi);return n.substring(0,3)!=="<tr"||t.innerHTML.trim()?null:(r?o.insertCountdown({targetElem:t,targetPlace:"beforeend",atomHTML:n}):t.insertAdjacentHTML("beforeend",n),t.querySelector('[em="block"]:last-child')??t.lastElementChild)}function di(e){return typeof e=="string"?e:e&&typeof e=="object"&&typeof e.html=="string"?e.html:""}function _u(e,o){e&&o.messageService.send(a.EVENT_TYPES.APPLICATION_ATOM_INSERTED,e),si()}function Nu(e,o){o.messageService.send("application_block_inserted",{type:e.type,name:e.name,blockId:e.blockId,project:e.project}),si()}function Bu(e,o){const t=di(e.atomHTML),n=t.match(/<style((.|\n|\r)*?)<\/style>/g);return o.setDocumentStyles(n),t.replaceAll(/<style((.|\n|\r)*?)<\/style>/gi,"").trim()}function Mu(e,o){let t=Bu(e,o);if(!t)return!1;let n=null;const r=Su();if(r)n=ci(Cu(r),t,o);else{const i=Eu();if(i){const l=vu(i);l&&(n=ci(l,t,o))}else n=ku(t,o)}return n?(Lu(n,o),!0):!1}function Ru(e,o,t){if(e.tagName==="TR"){o.substring(0,3)==="<tr"?t.insertAdjacentHTML(e,"afterend",o):t.insertAdjacentHTML(e,"afterend",'<tr em="block"><td align="center">'+o+"</td></tr>");return}if(o.substring(0,3)==="<tr"){const n=document.createElement("table");n.setAttribute("cellspacing","0"),n.setAttribute("cellpadding","0"),n.setAttribute("align","center"),n.setAttribute("border","0"),n.setAttribute("em","block"),n.setAttribute("width",e.hasAttribute("width")?e.getAttribute("width"):String(e.getBoundingClientRect().width)),n.classList.add("em-mob-width-100perc"),n.innerHTML=`
258
+ `)}var Jo={},rm=new Set,im=null;function lm(e){im=e,Jo=e.localized,e.onChangeLocale(({data:o})=>{Jo=o,rm.forEach(t=>t(o))})}function Gr(){return Jo}var Yr=[];function am(){return Yr}function Kr(e){const o=Gr();let t="",n="";switch(e.tagName){case"A":e.style.display==="block"?(t=o.ELEMENT_PATH_BUTTON,n="em-element-path-item-button"):(t=o.ELEMENT_PATH_LINK,n="em-element-path-item-link");break;case"IMG":e.closest('table[em-type="social"]')?t=o.ELEMENT_PATH_SOCIAL:t=o.ELEMENT_PATH_IMG,n="em-element-path-item-image";break;case"TD":e.parentElement?.getAttribute("em")==="block"?(t=o.ELEMENT_PATH_BLOCK,n="em-element-path-item-block"):e.parentElement?.getAttribute("em")==="atom"||e.closest("table")?.getAttribute("em")==="atom"?(t=o.ELEMENT_PATH_ATOM,n="em-element-path-item-atom"):e.parentElement?.getAttribute("em")==="group"?(t=o.ELEMENT_PATH_GROUP,n="em-element-path-item-group"):e.classList.contains("em-vindent")?(t=o.ELEMENT_PATH_VINDENT,n="em-element-path-item-vindent"):e.classList.contains("em-mob-wrap")||e.classList.contains("noresp-em-mob-wrap")?(t=o.ELEMENT_PATH_FLOATBLOCK,n="em-element-path-item-column"):(t=o.ELEMENT_PATH_TD,n="em-element-path-item-block");break;case"TABLE":e.getAttribute("em")==="block"?(t=o.ELEMENT_PATH_BLOCK,n="em-element-path-item-block"):e.getAttribute("em")==="atom"&&e.getAttribute("em-type")==="social"?(t=o.ELEMENT_PATH_SOCIAL,n="em-element-path-item-atom"):e.getAttribute("em")==="atom"?(t=o.ELEMENT_PATH_ATOM,n="em-element-path-item-atom"):e.getAttribute("em")==="group"?(t=o.ELEMENT_PATH_GROUP,n="em-element-path-item-group"):e.parentElement?.tagName==="BODY"?(t=o.ELEMENT_PATH_EMAIL,n="em-element-path-item-email"):(t=o.ELEMENT_PATH_TABLE,n="em-element-path-item-table");break;case"SPAN":case"B":case"I":case"EM":case"STRONG":case"P":case"H1":case"H2":case"H3":case"H4":case"H5":case"DIV":case"STRIKE":case"S":case"U":e.style.display==="inline-block"?(t=o.ELEMENT_PATH_FLOATBLOCK,n="em-element-path-item-column"):e.style.fontFamily&&e.style.fontSize&&e.style.lineHeight&&e.style.color?(t=o.ELEMENT_PATH_TEXT,n="em-element-path-item-text"):e.getAttribute("em")==="block"?(t=o.ELEMENT_PATH_BLOCK,n="em-element-path-item-block"):e.getAttribute("em")==="atom"?(t=o.ELEMENT_PATH_ATOM,n="em-element-path-item-atom"):e.getAttribute("em")==="group"?(t=o.ELEMENT_PATH_GROUP,n="em-element-path-item-group"):e.classList.contains("em-vindent")?(t=o.ELEMENT_PATH_VINDENT,n="em-element-path-item-vindent"):(t=o.ELEMENT_PATH_DIV,n="em-element-path-item-block")}const r=a.captionByRules(e,o);return r?.title&&(t=r.title),r?.className&&(n=r.className),e.className&&e.className.indexOf&&e.className.indexOf("em-mob-")>-1&&(n+=" em-element-path-item-mob"),{elem:e,title:t,className:n}}var sm=new Set(["TABLE","TBODY","THEAD","TFOOT","TR","TD","TH"]);function cm(e){return Array.from(e.classList).some(o=>o.startsWith("em-element-"))}function dm(e){if(e.tagName!=="TD")return!1;const o=Array.from(e.getElementsByTagName("a")),t=o[0];if(o.length!==1||t.style.display!=="block")return!1;for(let n=t.parentElement;n&&n!==e;n=n.parentElement)if(sm.has(n.tagName))return!1;return Array.from(e.children).every(n=>n===t||n.contains(t)||cm(n))}function mm(e){const o=e.style;return dm(e)?!1:!!(e.tagName==="A"&&!e.closest(".em-element-resize-img-container")&&!e.closest('table[em-type="social"]')||e.tagName==="TD"&&!e.closest(".em-narrow-table")||e.tagName==="TABLE"&&e.parentElement?.style?.display!=="inline-block"&&!e.classList.contains("em-vindent-table")&&!e.closest(".em-narrow-table")&&e.getAttribute("em")!=="atom"&&e.parentElement?.tagName!=="BODY"||e.tagName==="DIV"&&(o.display==="inline-block"||o.display==="table-cell")&&o.verticalAlign||(e.tagName==="DIV"||e.tagName==="TABLE"||e.tagName==="TD")&&!e.classList.contains("em-narrow-table")&&!e.classList.contains("noresp-em-narrow-table")&&(o.width||o.minWidth||o.maxWidth||o.background||o.backgroundColor||o.backgroundPositionX||o.backgroundPositionY||o.backgroundImage||o.backgroundRepeat||o.backgroundSize||o.height||o.padding||o.paddingTop||o.paddingRight||o.paddingBottom||o.paddingLeft||o.border||o.borderBottom||o.borderBottomWidth||o.borderBottomStyle||o.borderBottomColor||o.borderLeft||o.borderLeftWidth||o.borderLeftStyle||o.borderLeftColor||o.borderTop||o.borderTopWidth||o.borderTopStyle||o.borderTopColor||o.borderRight||o.borderRightWidth||o.borderRightStyle||o.borderRightColor||o.borderRadius||o.borderTopLeftRadius||o.borderTopRightRadius||o.borderBottomLeftRadius||o.borderBottomRightRadius||o.boxShadow||o.textAlign||o.align||o.verticalAlign)||e.tagName!=="EDITOR"&&o.fontFamily&&o.fontSize&&o.lineHeight&&o.color||e.tagName==="TD"&&e.closest("table")?.getAttribute("em")==="atom"||e.tagName==="TD"&&e.closest("tr")?.getAttribute("em")==="block"||e.tagName==="TD"&&(e.classList.contains("em-mob-wrap")||e.classList.contains("noresp-em-mob-wrap"))||a.isPathElementByRules(e))}function um(e){let o=[];const t=e.style;(e.tagName==="IMG"||e.tagName==="TD"||e.tagName==="TABLE"||e.tagName!=="EDITOR"&&t.fontFamily&&t.fontSize&&t.lineHeight&&t.color||e.tagName==="DIV"&&t.height&&t.lineHeight||a.isPathElementByRules(e))&&o.push(Kr(e));let n=e;for(;n?.parentElement&&n.parentElement.tagName!=="BODY";)n=n.parentElement,mm(n)&&o.push(Kr(n));return o=o.filter(r=>!(r.elem?.tagName==="TABLE"&&r.elem.parentElement?.tagName==="BODY")),o=o.reverse(),Yr=o.map(r=>({...r})),o.map(r=>({title:r.title,className:r.className}))}function Xr(e){const o=Gr(),t=e.parentNode;if(t){if(t.tagName==="A")return o.LINK;if(t.tagName==="TD")return o.TABLE_COLUMN;if(t.tagName==="TABLE"&&!t.parentNode?.style?.display||t.parentNode?.style?.display!=="inline-block")return o.TABLE;if(t.tagName==="DIV"&&(t.style.display==="inline-block"||t.style.display==="table-cell")&&t.style.verticalAlign)return o.FLOAT_BLOCK;if(t.tagName==="DIV"){const n=t.style;if(n.width||n.minWidth||n.maxWidth||n.background||n.backgroundColor||n.backgroundPositionX||n.backgroundPositionY||n.backgroundImage||n.backgroundRepeat||n.backgroundSize||n.height||n.padding||n.paddingTop||n.paddingRight||n.paddingBottom||n.paddingLeft||n.border||n.borderBottom||n.borderBottomWidth||n.borderBottomStyle||n.borderBottomColor||n.borderLeft||n.borderLeftWidth||n.borderLeftStyle||n.borderLeftColor||n.borderTop||n.borderTopWidth||n.borderTopStyle||n.borderTopColor||n.borderRight||n.borderRightWidth||n.borderRightStyle||n.borderRightColor||n.borderRadius||n.borderTopLeftRadius||n.borderTopRightRadius||n.borderBottomLeftRadius||n.borderBottomRightRadius||n.boxShadow||n.textAlign||n.align||n.verticalAlign)return o.CONTAINER}return Xr(t)}}function Zr(e,o){const t=e.getAttribute(o);return!t||t==="auto"?{value:null,dim:"px"}:{value:parseFloat(t),dim:t.includes("%")?"%":"px"}}function Jr(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function fm(e,o,t){t.clearActiveEditElements();const n=e.elem.closest("amp-carousel");n.setAttribute("em-edit","active");const r=n.querySelectorAll("amp-img"),i=pm(r),l=Array.from(r).map(u=>{const g=a.getElementMobileProps({elem:u});return{src:u.getAttribute("src")??"",width:Zr(u,"width"),height:Zr(u,"height"),alt:u.getAttribute("alt")??"",title:u.getAttribute("title")??"",link:u.closest("a")?.getAttribute("href")??null,renderedWidth:Math.round(e.elem.getBoundingClientRect().width),renderedHeight:Math.round(e.elem.getBoundingClientRect().height),imgReplacer:u.closest("em-replace")?.getAttribute("src")??"",mobileWidth:{value:Jr(g.mobileWidth),dim:g.mobileWidthDim??"px"},mobileHeight:{value:Jr(g.mobileHeight),dim:g.mobileHeightDim??"px"},mobileBorderRadius:g.mobileBorderRadius}}),s=a.getElementMobileProps({elem:n}),c={type:"carousel",caption:o.CAROUSEL,carouselImages:l,borderRadius:a.getElementBorderRadius(n),mobileBorderRadius:s.mobileBorderRadius,loop:n.hasAttribute("loop"),autoplay:n.hasAttribute("autoplay"),link:i},d=n.closest("td");return d&&(c.maxWidth=Math.round(d.getBoundingClientRect().width)),c}function pm(e){const o=Array.from(e,t=>t.closest("a")?.getAttribute("href"));return o.length>0&&o.every(t=>t&&t===o[0])?o[0]??null:null}function gm(e){return!!e.closest("amp-carousel")}function bm(e,o,t){t.clearActiveEditElements();const n=e.elem.closest("amp-accordion");n.setAttribute("em-edit","active");const r=t.HTMLDocument.getOuterHtml(n),i=t.parseFromString(r)[0].querySelectorAll("section"),l=Array.from(i).map(s=>({expanded:s.hasAttribute("expanded")}));return{type:"accordion",caption:o.ACCORDION,animate:n.hasAttribute("animate"),expandSingleSection:n.hasAttribute("expand-single-section"),sections:l}}function hm(e){return e.tagName==="AMP-ACCORDION"}function xt(e){const o=String(e??"").trim();return o?a.rgbToHex(o)??o:""}var Qo={align:"center",iconSize:40,borderRadius:0,gap:8,bgEnabled:!1,bgColor:"",borderWidth:0,borderColor:"",buttonBorderColor:"",buttonBorderWidth:0,showLabel:!1};function ym(e){if(!e)return null;const o=e.getAttribute("width")?.trim();if(o){const i=parseInt(o,10);if(!Number.isNaN(i)&&i>0)return i}const t=e.getAttribute("style")??"",n=/(?:^|;)\s*width:\s*(\d+)px/i.exec(t);if(n){const i=parseInt(n[1],10);if(!Number.isNaN(i)&&i>0)return i}const r=e.style?.width?.trim()??"";if(r){const i=parseInt(r,10);if(!Number.isNaN(i)&&i>0)return i}return e.offsetWidth>0?Math.round(e.offsetWidth):null}function Em(e,o){if(e.length===0)return o;let t=null;for(const n of e){const r=n.iconWidth;if(r==null||Number.isNaN(r)||r<=0)return o;if(t===null)t=r;else if(r!==t)return o}return t??o}function en(e){return e.closest('table[em-type="social"]')}function Sm(e){const o=e.ownerDocument;return o?Array.from(o.querySelectorAll('table[em-type="social"]')).indexOf(e):-1}function Qr(e){const o=e.querySelector(":scope > tr");if(o){const n=o.querySelector(":scope > td");if(n instanceof HTMLElement)return n}const t=e.querySelector("tbody > tr");if(t){const n=t.querySelector(":scope > td");if(n instanceof HTMLElement)return n}return null}function ft(e){if(!e||!(e instanceof HTMLElement))return"";const o=e.style?.backgroundColor?.trim()??"";return!o||o==="transparent"||o==="rgba(0, 0, 0, 0)"?"":o}function De(e,o){return e.hasAttribute(o)||e.hasAttribute(`data-${o}`)}function tn(e,o){return e?e.getAttribute(o)??e.getAttribute(`data-${o}`):null}function Cm(e){if(!(e instanceof HTMLElement))return null;const o=e.getAttribute("width")?.trim(),t=e.style.width?.trim(),n=o||t;if(!n)return null;const r=/^(\d+)/.exec(n);if(!r)return null;const i=parseInt(r[1],10);return Number.isNaN(i)||i<0?null:i}function vm(e,o){for(let t=1;t<e.length-1;t+=1){const n=e[t-1],r=e[t],i=e[t+1];if(n instanceof HTMLElement&&i instanceof HTMLElement&&De(n,"em-platform")&&De(i,"em-platform")&&r instanceof HTMLElement&&!De(r,"em-platform")){const l=Cm(r);if(l!=null){o.gap=l;return}}}}function ei(e){const o=String(e??""),t=/(?:^|;)\s*border-radius:\s*(\d+)px/i.exec(o);if(!t)return null;const n=parseInt(t[1],10);return Number.isNaN(n)||n<0?null:n}function Am(e,o){const t=Qr(e)?.getAttribute("align")?.trim().toLowerCase();(t==="left"||t==="right"||t==="center")&&(o.align=t)}function Tm(e,o){for(const t of e){if(!(t instanceof HTMLElement)||!De(t,"em-platform"))continue;const n=ei(t.getAttribute("style"));if(n!=null){o.borderRadius=n;return}const r=ei(t.querySelector("img")?.getAttribute("style")??null);if(r!=null){o.borderRadius=r;return}}}function Lm(e,o){for(const t of e){if(!(t instanceof HTMLElement))continue;const n=t.querySelector("br"),r=n?.nextElementSibling?.tagName==="SPAN"?n.nextElementSibling:null;if(r&&r.textContent?.trim()){o.showLabel=!0;return}}o.showLabel=!1}function wm(e,o,t){const n=e.querySelector("[em-social-tray-shell], [data-em-social-tray-shell]"),r=e.querySelector("td[em-tray-cell-bg], td[data-em-tray-cell-bg]"),i=ft(n),l=ft(r instanceof HTMLElement?r:null),s=ft(e.querySelector("[em-social-tray], [data-em-social-tray]")),c=ft(o),d=ft(e),u=i||l||s||c||d;u&&(t.bgEnabled=!0,t.bgColor=u)}function km(e){const o=Qr(e);if(!(o instanceof HTMLElement))return"";const t=ft(o);return t||(o.getAttribute("bgcolor")?.trim()??"")}function on(e){if(!e)return null;const o=e.style.border?.trim()??"",t=/^(\d+)px\s+solid\s+(.+)$/i.exec(o);if(!t)return null;const n=parseInt(t[1],10),r=t[2].trim();return Number.isNaN(n)||n<=0||!r?null:{w:n,color:r}}function _m(e,o){const t=on(e);t&&(o.borderWidth=t.w,o.borderColor=t.color)}function Nm(e){const o=e.closest("td[em-platform], td[data-em-platform]");if(o)return!!en(o);const t=e.closest("td"),n=t?.previousElementSibling,r=t?.nextElementSibling;return!!(t&&!De(t,"em-platform")&&n instanceof HTMLElement&&r instanceof HTMLElement&&De(n,"em-platform")&&De(r,"em-platform")&&en(t))}function Bm(e,o){const t=en(e.elem);if(!t)return{type:"social",caption:o.SOCIAL??"Social media",...Qo,hostCellBgForIconLuminance:"",blockIndex:-1,items:[]};const n={...Qo};Am(t,n),_m(t,n);const r=t.querySelector('table[role="presentation"]')||t.querySelector("table");wm(t,r,n);const i=r?.querySelector("tr"),l=i?Array.from(i.querySelectorAll(":scope > td")):[],s=l.filter(p=>p instanceof HTMLElement&&De(p,"em-platform")),c=s.length>0?s:l.filter(p=>p.querySelector("img"));vm(l,n),Tm(c,n),Lm(c,n);let d=typeof n.buttonBorderWidth=="number"&&!Number.isNaN(n.buttonBorderWidth)?n.buttonBorderWidth:0;const u=t.querySelector("[em-social-tray-shell], [data-em-social-tray-shell]"),g=u instanceof HTMLElement?on(u):null;if(g)d=g.w;else for(const p of c){if(!(p instanceof HTMLElement))continue;const b=on(p);if(b){d=b.w;break}}let m=c.map(p=>{if(!(p instanceof HTMLElement))return{platform:"unknown",customIcon:!1,href:"",alt:"",title:"",iconSrc:"",iconWidth:null,iconHeight:null,buttonBgColor:"",itemBorderColor:""};const b=p,h=tn(b,"em-platform")||"unknown",y=De(b,"em-custom-icon"),E=b.querySelector("a"),S=b.querySelector("img"),v=E?.getAttribute("href")??"",C=E?.getAttribute("title")??S?.getAttribute("title")??"",L=S?.getAttribute("alt")??"",w=S?.getAttribute("src")??"",A=ym(S instanceof HTMLImageElement?S:null),M=S?.getAttribute("height")?.trim(),R=M?parseInt(M,10):NaN,$=!Number.isNaN(R)&&R>0,J=tn(b,"em-button-bg")?.trim()??"",_=!y&&De(b,"em-tray-cell-bg");let G="",H="";if(!y&&(G=J,!G&&!_&&b.style?.backgroundColor&&(G=b.style.backgroundColor.trim()),H=tn(b,"em-item-border-color")?.trim()??"",!H)){const P=b.style.border?.trim()??"",q=/^(\d+)px\s+solid\s+(.+)$/i.exec(P);q?.[2]&&(H=q[2].trim())}return{platform:h,customIcon:y,href:v,alt:L,title:C,iconSrc:w,iconWidth:A,iconHeight:$?R:A,buttonBgColor:G,itemBorderColor:H}});if(g&&m.length>0&&m.every(p=>p.customIcon||!String(p.itemBorderColor??"").trim())){const p=g.color;m=m.map(b=>b.customIcon?b:{...b,itemBorderColor:p})}const f=Em(m,Qo.iconSize);return{type:"social",caption:o.SOCIAL??"Social media",align:n.align,iconSize:f,borderRadius:n.borderRadius,gap:n.gap,bgEnabled:n.bgEnabled,bgColor:xt(n.bgColor),borderWidth:n.borderWidth,borderColor:xt(n.borderColor),buttonBorderColor:"",buttonBorderWidth:d,showLabel:n.showLabel,hostCellBgForIconLuminance:xt(km(t)),blockIndex:Sm(t),items:m.map(p=>({...p,buttonBgColor:xt(p.buttonBgColor),itemBorderColor:xt(p.itemBorderColor)}))}}function nn(e){if(!e)return!1;for(const o of Array.from(e.childNodes))if(o.nodeType===Node.COMMENT_NODE&&o.nodeValue?.includes("[if mso]")&&o.nodeValue.includes("v:roundrect")||o.nodeType===Node.ELEMENT_NODE&&nn(o))return!0;return!1}function ti(e,o){if(!e)return{value:null,dim:"px"};const t=e.getAttribute(o);return!t||t==="auto"?{value:null,dim:"px"}:{value:parseFloat(t),dim:t.includes("%")?"%":"px"}}function oi(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function Mm(e){const o={all:null,top:null,right:null,bottom:null,left:null};return!e.style.padding&&!e.style.paddingTop&&!e.style.paddingRight&&!e.style.paddingBottom&&!e.style.paddingLeft||(!e.style.padding||e.style.padding.includes(" ")?o.all=null:!e.style.padding&&e.style.paddingTop&&e.style.paddingRight&&e.style.paddingBottom&&e.style.paddingLeft&&e.style.paddingTop===e.style.paddingRight&&e.style.paddingRight===e.style.paddingBottom&&e.style.paddingBottom===e.style.paddingLeft?o.all=parseFloat(e.style.paddingTop):o.all=parseFloat(e.style.padding)||null,o.top=e.style.paddingTop?parseFloat(e.style.paddingTop):null,o.right=e.style.paddingRight?parseFloat(e.style.paddingRight):null,o.bottom=e.style.paddingBottom?parseFloat(e.style.paddingBottom):null,o.left=e.style.paddingLeft?parseFloat(e.style.paddingLeft):null),o}function Rm(e){const o={all:null,top:null,right:null,bottom:null,left:null};if(!e.all&&!e.top&&!e.right&&!e.bottom&&!e.left)return o;e.all?!e.all&&e.top&&e.right&&e.bottom&&e.left&&e.top===e.right&&e.right===e.bottom&&e.bottom===e.left?o.all=parseFloat(e.top):o.all=parseFloat(e.all)||null:o.all=null;const t=e.all||null;return o.top=e.top!=null?parseFloat(e.top):t,o.right=e.right!=null?parseFloat(e.right):t,o.bottom=e.bottom!=null?parseFloat(e.bottom):t,o.left=e.left!=null?parseFloat(e.left):t,o}function Pm(e){if(e.style.backgroundImage){const o=e.style.backgroundImage;return[{type:"url",value:o.substring(5,o.length-2)}]}return e.getAttribute("background")?[{type:"url",value:e.getAttribute("background")||""}]:[{type:"url",value:""}]}function Hm(e,o){const t=e.elem.closest("a")||e.elem,n=e.elem.closest("td"),r=a.findForeignButtonSpan(t),i=nn(n)&&!nn(t)||!!r,l=r??(i?t:n),s=e.elem.closest("table"),c=s?.closest("td")?.closest("table")?.closest("td"),d=s?.closest("div, p, td"),u=d?.style.textAlign||d?.getAttribute("align")||"left",g=a.getElementMobileProps({elem:e.elem}),m=a.getElementMobileProps({elem:n}),f=c?a.getElementMobileProps({elem:c}):null,p=a.getElementMobileProps({elem:s}),b=e.elem.closest("a"),h={type:"button",caption:o.BUTTON,fontFamily:a.getFontFamilyFromElement$1(e.elem),fontSize:parseFloat(e.elem.closest('[style*="font-size"]')?.style.fontSize)||0,fontSizeDim:"px",lineHeight:a.getLineHeightInPixels$1(e.elem),lineHeightDim:"px",textStrong:a.textHasStyle$1(e.elem,"strong","b")||a.isElementHasBold(e.elem),textItalic:a.textHasStyle$1(e.elem,"i","em")||!e.elem.closest('[style*="font-style: normal"]')&&(b?.style?.fontStyle==="italic"||e.elem.style?.fontStyle==="italic"),textStrikethrough:a.textHasStyle$1(e.elem,"s","strike")||(e.elem.style?.textDecoration?.includes("line-through")??!1)||!!e.elem.closest('[style*=" text-decoration"]')?.style.textDecoration?.includes("line-through"),textUnderline:a.textHasStyle$1(e.elem,"u")||(e.elem.style?.textDecoration?.includes("underline")??!1)||!(e.elem.style?.textDecoration?.length>0)&&e.elem.tagName==="A"||!!e.elem.closest('[style*=" text-decoration"]')?.style.textDecoration?.includes("underline"),textColor:a.rgbToHex(a.findParentWithExplicitStyle(e.elem,"color"))||a.rgbToHex(getComputedStyle(e.elem).color)||"",textBackgroundColor:a.rgbToHex(a.findParentWithExplicitStyle(e.elem,"background-color"))||"",padding:Mm(r??t),borderRadius:a.getElementBorderRadius(l),backgroundColor:l.style.backgroundColor?a.rgbToHex(l.style.backgroundColor):l.getAttribute("bgcolor")||"",backgroundImage:Pm(n),backgroundPositionX:n.style.backgroundPositionX!=="initial"?n.style.backgroundPositionX:"",backgroundPositionY:n.style.backgroundPositionY!=="initial"?n.style.backgroundPositionY:"",backgroundRepeat:n.style.backgroundRepeat||"repeat",backgroundSize:n.style.backgroundSize||"auto",width:ti(s,"width"),height:ti(n,"height"),align:u,valign:n.getAttribute("valign")??"",textAlign:n.getAttribute("align")??"",border:a.getElementBorder(l),boxShadow:a.getElementBoxShadow(l),href:t.getAttribute("href")??"",outlookRounding:i,outlookBackground:a.hasElementVMLBackground(n,"inside"),mobileWidth:{value:oi(p.mobileWidth),dim:p.mobileWidthDim??"px"},mobileHeight:{value:oi(m.mobileHeight),dim:m.mobileHeightDim??"px"},mobileBorder:m.mobileBorder,mobileBorderRadius:m.mobileBorderRadius,mobileBoxShadow:m.mobileBoxShadow,mobileAlign:p.mobileAlign,mobileFontSize:{value:g.mobileFontSize,dim:g.mobileFontSizeDim||"px"},mobileTextAlign:Bo(e.elem),mobileVerticalAlign:f?.mobileVerticalAlign,mobileBackgroundColor:m.mobileBackgroundColor,mobileBackgroundImage:m.mobileBackgroundImage,mobileBackgroundPositionX:m.mobileBackgroundPositionX,mobileBackgroundPositionY:m.mobileBackgroundPositionY,mobileBackgroundRepeat:m.mobileBackgroundRepeat,mobileBackgroundSize:m.mobileBackgroundSize,mobilePadding:Rm(g.mobilePadding),mobileLineHeight:{value:g.mobileLineHeight,dim:"px"},show:p.show,exportAsPicture:s?.getAttribute("em-operation")==="exportAsPicture"};return a.isShowOnMobile(e.elem)&&(h.showOnMobile=!0),h}function Im(e){if(a.hasForeignButtonStructure(e.closest("a")))return!0;const o=e.getAttribute("style");if(!o||!o.includes("display"))return!1;const t=e.style.display;return!(t!=="block"&&t!=="inline-block"||o.includes("mso-style-priority"))}function Om(e,o){return o?!1:e.tagName==="A"||e.tagName==="EM-REPLACE"&&!!e.closest("a")}function xm(e){const o=e.closest("a"),t=e.closest('a[style*="display"]');if(a.hasForeignButtonStructure(o))return!0;if(o&&t){const n=t.style.display;if(n==="block"||n==="inline-block")return!0}if(e.tagName==="A"){const n=e.getAttribute("style");if(n&&n.includes("display")&&e.closest("td[height]"))return!0}return!1}function ni(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function Dm(e,o){const t=e.elem,n=a.getElementMobileProps({elem:t}),r=ni(n.mobileHeight);return{type:"vindent",caption:o.VERTICAL_INDENT,height:{value:parseFloat(t.getAttribute("height")||"0"),dim:"px"},mobileHeight:{value:r,dim:n.mobileHeightDim??"px"}}}function Fm(e,o){const t=e.elem,n=a.getElementMobileProps({elem:t}),r=ni(n.mobileHeight);return{type:"vindent",caption:o.VERTICAL_INDENT,height:{value:parseFloat(t.style.height||"0"),dim:"px"},mobileHeight:{value:r,dim:n.mobileHeightDim??"px"}}}function qm(e){if(e.tagName!=="TD")return!1;if(e.classList.contains("em-vindent"))return!0;const o=e.closest("table");return e.innerHTML===""&&o?.getAttribute("width")==="100%"}function Wm(e){return e.tagName!=="DIV"?!1:!e.style.fontFamily&&!!e.style.height&&!!e.style.lineHeight&&!!e.style.fontSize}function $m(e,o){return e.elem.tagName==="TD"?Dm(e,o):Fm(e,o)}function ri(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function zm(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function ii(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function Vm(e){const o=e.firstElementChild;if(!o)return 0;const t=o.getAttribute("width");return e.style.maxWidth?parseFloat(e.style.maxWidth)-parseFloat(t||"0"):e.style.width?t&&t.includes("0%")?0:parseFloat(e.style.width)-parseFloat(t||"0"):0}function Um(e,o){const t=e.elem,n=a.getElementMobileProps({elem:t}),r=t.firstElementChild,i=r?a.getElementMobileProps({elem:r}):null,l=ri(n.mobileWidth),s=i?ri(i.mobileWidth):null;return{type:"floatBlock",caption:o.FLOAT_BLOCK,width:zm(r?.getAttribute("width")),gap:{value:Vm(t),dim:"px"},maxWidth:ii(t.style.maxWidth),minWidth:ii(t.style.minWidth),valign:t.style.verticalAlign??"",mobileWidth:{value:l,dim:n.mobileWidthDim??"px"},mobileContentWidth:{value:s,dim:i?.mobileWidthDim??"px"},mobileVerticalAlign:n.mobileVerticalAlign,show:n.show}}function jm(e){if(e.tagName!=="DIV")return!1;const o=e.style.display,t=o==="inline-block"||o==="table-cell",n=!!e.style.verticalAlign;return t&&n}function Gm(e){if(e.tagName!=="TD")return e.closest("table")?.parentElement?.tagName==="BODY";if(e.classList.contains("em-vindent")||e.innerHTML===""||e.closest("table")?.getAttribute("em")==="atom"||e.firstChild?.tagName==="EDITOR")return!1;const o=!!e.querySelector('div[style*="inline-block"]'),t=!!e.querySelector(":scope > table > tr > .em-mob-wrap, :scope > table > tbody > tr > .em-mob-wrap, :scope > table > tr > td > table > tr > .em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > .em-mob-wrap, :scope > table > tr > td > table > tr > td > table > tr > .em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > .em-mob-wrap, :scope > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > .noresp-em-mob-wrap, :scope > table > tr > td > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > .noresp-em-mob-wrap, :scope > table > tr > td > table > tr > td > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > .noresp-em-mob-wrap");return!!(!o&&!t||o&&e.parentElement?.getAttribute("em")!=="block"&&!e.querySelector(".em-mob-wrap, .noresp-em-mob-wrap"))}function Ym(e){if(e.tagName!=="TD"||e.classList.contains("em-vindent")||e.innerHTML===""||e.firstChild?.tagName==="EDITOR"||!(e.parentElement?.getAttribute("em")==="block"||e.parentElement?.parentElement?.getAttribute("em")==="block"||e.parentElement?.parentElement?.parentElement?.getAttribute("em")==="block"))return!1;const o=!!e.querySelector('div[style*="inline-block"]'),t=!!e.querySelector(":scope > table > tr > .em-mob-wrap, :scope > table > tbody > tr > .em-mob-wrap, :scope > table > tr > td > table > tr > .em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > .em-mob-wrap, :scope > table > tr > td > table > tr > td > table > tr > .em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > .em-mob-wrap, :scope > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > .noresp-em-mob-wrap, :scope > table > tr > td > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > .noresp-em-mob-wrap, :scope > table > tr > td > table > tr > td > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > .noresp-em-mob-wrap");return o||t}function Km(e){if(e.tagName==="TD"){if(e.innerHTML!==""||e.getAttribute("height"))return!1;const o=!e.getAttribute("width")||e.classList.contains("em-mob-wrap")||e.classList.contains("noresp-em-mob-wrap"),t=!!e.closest('[em="block"].empty-structure')||!!e.closest(".em-structure");return o&&t}return e.tagName==="DIV"?!!e.closest("amp-accordion")&&!e.innerHTML:!1}function Xm(e){if(e.tagName!=="TD")return!1;const o=!!e.firstChild&&e.firstChild.tagName==="EDITOR";return o&&e.closest("table")?.getAttribute("em")==="atom"?!0:!(o||e.classList.contains("em-vindent"))}function Zm(e){const o={items:[],gap:null,gapMobile:null,valign:"",wrap:void 0,dirRevers:!1},t=".em-mob-wrap, .noresp-em-mob-wrap",n=e.querySelector(t),r=e.querySelectorAll(t).length;if(n&&e.querySelectorAll(".em-mob-wrap:first-child, .noresp-em-mob-wrap:first-child").length===1)o.wrap=!0,e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(i=>{if(o.items.push({width:parseFloat(i.getAttribute("width")||"0"),current:!1}),r>1){const l=n.nextElementSibling;o.gap=parseFloat(l?.getAttribute("width")||"0");const s=a.getElementMobileProps({elem:l});o.gapMobile=s.mobileHeight||0}else o.gap=0;(i.classList.contains("em-mob-wrap-cancel")||i.classList.contains("noresp-em-mob-wrap-cancel"))&&(o.wrap=!1)}),o.valign=n.getAttribute("valign")||"",(n?document.querySelector('[em-edit="active"]'):e.closest(t)?.parentElement?.closest("td"))?.getAttribute("dir")==="rtl"&&(o.dirRevers=!0);else if(e.querySelector('div[style*="inline-block"]')){const i=e.querySelectorAll('div[style*="inline-block"]');if(i.length>1)i.forEach(s=>{const c=s,d=c.firstElementChild;o.items.push({width:parseFloat(d?.getAttribute("width")||"0"),current:!1});const u=d?.getAttribute("width"),g=parseFloat(c.style.width);!u||u.includes("%")?o.gap=g-g:o.gap=g-parseFloat(u)});else{const s=e.querySelector('div[style*="inline-block"]');o.items=[{width:parseFloat(s.firstElementChild?.getAttribute("width")||"0"),current:!0}],o.gap=0}const l=e.querySelector('div[style*="inline-block"]');o.valign=l?.style.verticalAlign||"",(l?document.querySelector('[em-edit="active"]'):e.closest('div[style*="inline-block"]')?.parentElement)?.getAttribute("dir")==="rtl"&&(o.dirRevers=!0)}return o}function Jm(e,o,t){const n=e.elem,r={...t.getElementTdDiv(n),direction:n.getAttribute("dir")??"none"};let i="td",l=o.TABLE_COLUMN;return(n.classList.contains("em-mob-wrap")||n.classList.contains("noresp-em-mob-wrap"))&&(i="column"),n.parentElement?.getAttribute("em")==="group"?(l=o.ELEMENT_PATH_GROUP??o.GROUP,i="group"):n.closest("table")?.parentElement?.tagName==="BODY"?(l=o.GROUP,i="group"):n.classList.contains("em-mob-wrap")?l=o.FLOAT_BLOCK:n.parentElement?.getAttribute("em")==="block"&&(l=o.STRUCTURE),{type:i,caption:l,settings:r}}function Qm(e,o,t){const n=e.elem,r={...t.getElementTdDiv(n),direction:n.getAttribute("dir")??"none"};return r.floatBlocks=Zm(n),r.isContrastBlock=!!n.closest(".em-contrast-block"),{type:"structure",caption:o.STRUCTURE,settings:r}}function eu(e,o,t){const n=e.elem,r={...t.getElementTdDiv(n),direction:n.getAttribute("dir")??"none"};let i=o.TABLE_COLUMN,l="td";return n.parentElement?.getAttribute("em")==="group"?(i=o.ELEMENT_PATH_GROUP??o.GROUP,l="group"):n.closest("table")?.getAttribute("em")==="atom"?i=o.ELEMENT:n.parentElement?.getAttribute("em")==="block"&&(i=o.STRUCTURE),{type:l,caption:i,settings:r}}function uo(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function tu(e,o,t){const n=e.elem;return{type:"div",caption:o.CONTAINER,...t.getElementTdDiv(n),width:uo(n.style.width),maxWidth:uo(n.style.maxWidth),minWidth:uo(n.style.minWidth),height:uo(n.style.height),valign:n.style.verticalAlign??"",align:n.style.textAlign??"",direction:n.getAttribute("dir")??"none"}}function Dt(e,o,t){const n=t==="All"?"border":`border-${t.toLowerCase()}`,r=e?.includes(`${n}:`);if(t==="All")return{color:o.getAttribute("bordercolor")?a.rgbToHex(o.getAttribute("bordercolor")):o.style?.border?a.rgbToHex(o.style.borderColor):"",width:o.getAttribute("border")||(o.style?.border?o.style.borderWidth:""),style:e?.includes("border:")?o.style.borderStyle:o.getAttribute("border")?"solid":""};const i=`border${t}Color`,l=`border${t}Width`,s=`border${t}Style`;return{color:r?a.rgbToHex(o.style[i]):"",width:r?o.style[l]:"",style:r?o.style[s]:""}}function Ft(e,o,t){const n=t==="All"?"border":`border-${t.toLowerCase()}`,r=!!e?.includes(`${n}:`);if(t==="All")return{color:r?a.rgbToHex(o.style.borderColor):"",width:r?o.style.borderTopWidth:0,style:r?o.style.borderStyle:""};const i=`border${t}Color`,l=`border${t}Width`,s=`border${t}Style`;return{color:r?a.rgbToHex(o.style[i]):"",width:r?o.style[l]:0,style:r?o.style[s]:""}}function ou(e){return!!e.closest(".em-element-custom-table")}function nu(e,o,t){const n=e.elem,r=n.tagName==="DIV"||n.querySelector(`.${t.CLASS_FOR_BASIC_CELL}`)||n.querySelector("EDITOR")?n.closest("TD"):n,i=r.closest("TABLE"),l=i.getAttribute("style"),s=r.getAttribute("style"),c=t.parseTableElementToModel(i);if(t.activeCell.length>1){const b=c.cells.find(h=>h.id===t.activeCell[0]);c.cells.find(h=>h.id===t.activeCell[t.activeCell.length-1])?.style,b?.style}const d=i?.style?.borderRadius?t.extractBorderRadius(l||""):null,u=d?d.firstNumber===d.secondNumber&&d.secondNumber===d.thirdNumber&&d.thirdNumber===d.fourthNumber:!1,g=t.parseBackgroundStyles(l||""),m=a.getElementBoxShadow(i),f=a.getElementMobileProps({elem:i}),p={...t.getElementTdDiv(n),direction:n.getAttribute("dir")??"none",show:f.show,outlookBackground:a.hasElementVMLBackground(n.closest(".em-element-custom-table")??n,"around"),customTable:{paddingLeftRight:r.style.paddingLeft===r.style.paddingRight?r.style.paddingLeft:"",paddingTopBottom:r.style.paddingTop===r.style.paddingBottom?r.style.paddingTop:"",paddingLeft:r.style.paddingLeft,paddingRight:r.style.paddingRight,paddingTop:r.style.paddingTop,paddingBottom:r.style.paddingBottom,backgroundColor:i.getAttribute("bgcolor")?a.rgbToHex(i.getAttribute("bgcolor")):"",backgroundImage:[{type:"url",value:g?.backgroundImage??""}],backgroundPositionX:g?.backgroundPositionX??"center",backgroundPositionY:g?.backgroundPositionY??"center",backgroundRepeat:g?.backgroundRepeat??"repeat",backgroundSize:g?.backgroundSize??"cover",borderAll:Dt(l,i,"All"),borderBottom:Dt(l,i,"Bottom"),borderTop:Dt(l,i,"Top"),borderRight:Dt(l,i,"Right"),borderLeft:Dt(l,i,"Left"),borderRadius:{all:l?.includes("border-radius:")&&u?+d.firstNumber:null,topLeft:l?.includes("border-radius:")&&!u?+d.firstNumber:null,topRight:l?.includes("border-radius:")&&!u?+d.secondNumber:null,bottomRight:l?.includes("border-radius:")&&!u?+d.thirdNumber:null,bottomLeft:l?.includes("border-radius:")&&!u?+d.fourthNumber:null},boxShadow:{color:m?.color??null,hOffset:m?.hOffset??null,vOffset:m?.vOffset??null,blurRadius:m?.blurRadius??null,spreadRadius:m?.spreadRadius??null,inset:m?.inset??null},mobileBoxShadow:f.mobileBoxShadow,mobileBackgroundColor:f.mobileBackgroundColor,mobileBackgroundImage:f.mobileBackgroundImage,mobileBackgroundPositionX:f.mobileBackgroundPositionX,mobileBackgroundPositionY:f.mobileBackgroundPositionY,mobileBackgroundRepeat:f.mobileBackgroundRepeat,mobileBackgroundSize:f.mobileBackgroundSize,mobileWidth:{value:f.mobileWidth!=null?f.mobileWidth:null,dim:f.mobileWidthDim},mobileHeight:{value:f.mobileHeight!=null?f.mobileHeight:null,dim:"px"},mobileBorderRadius:f.mobileBorderRadius,mobileBorder:f.mobileBorder,borderPosition:a.getSimpleBorderType(i),cell_borderPosition:a.getSimpleBorderType(r),cellBackgroundColor:s?.includes("background-color:")?a.rgbToHex(r.style.backgroundColor):"",cell_borderAll:Ft(s,r,"All"),cell_borderBottom:Ft(s,r,"Bottom"),cell_borderTop:Ft(s,r,"Top"),cell_borderRight:Ft(s,r,"Right"),cell_borderLeft:Ft(s,r,"Left"),cell_paddingLeftRight:r.style.paddingLeft===r.style.paddingRight?r.style.paddingLeft:"",cell_paddingTopBottom:r.style.paddingTop===r.style.paddingBottom?r.style.paddingTop:"",cell_paddingLeft:r.style.paddingLeft,cell_paddingRight:r.style.paddingRight,cell_paddingTop:r.style.paddingTop,cell_paddingBottom:r.style.paddingBottom,linkHref:n.getAttribute("href")?.trim()??"",textLink:!!n.closest("a"),target:n.getAttribute("target")??"",fontFamily:t.getFontFamilyFromElement(t.requestElemWithStyle?.closest('[style*="font-family"]')||n),fontSize:t.requestElemWithStyle?.style?.fontSize?parseInt(t.requestElemWithStyle.style.fontSize,10):t.requestElemWithStyle?.closest('div[style*="font-size"]')?.style?.fontSize?parseInt(t.requestElemWithStyle.closest('div[style*="font-size"]').style.fontSize,10):null,textStrikethrough:t.textHasStyle(n,"s","strike")||t.requestElemWithStyle?.style.textDecoration.includes("line-through"),textUnderline:t.textHasStyle(n,"u")||t.requestElemWithStyle.style.textDecoration.includes("underline")||!t.requestElemWithStyle.style.textDecoration&&n.tagName==="A",lineHeight:t.getLineHeghtInPixels(t.requestElemWithStyle),textStrong:t.textHasStyle(n,"strong","b")||t.isElementHasBold(t.requestElemWithStyle),textItalic:t.textHasStyle(n,"i","em")||!t.requestElemWithStyle.closest('[style*="font-style: normal"]')&&t.requestElemWithStyle?.style?.fontStyle==="italic",textAlign:n.style?.textAlign||n.getAttribute("align")||n.closest("[align]")?.getAttribute("align")||"",textColor:a.rgbToHex(n.closest('[style*="color"]')?.style.color)||a.rgbToHex(getComputedStyle(n).color),textBackgroundColor:a.rgbToHex(n.closest('[style*="background-color"]')?.style.backgroundColor)||a.rgbToHex(getComputedStyle(n).backgroundColor),textValign:n.style?.verticalAlign||n.getAttribute("valign")||n.closest("[valign]")?.getAttribute("valign")||""}};return n.getAttribute("new")&&(n.removeAttribute("new"),p.customTable.isNewLink=!0,n.setAttribute("em-edit","active")),{type:"customTable",caption:o.ELEMENT,settings:p}}function li(e,o){const t=e==null?null:typeof e=="number"?e:Number(e);return{value:t==null||Number.isNaN(t)?null:t,dim:o==="%"?"%":"px"}}function ru(e){return e.tagName==="TABLE"&&e.getAttribute("em")==="atom"}function ai(e,o,t){return e?{fontFamily:a.getFontFamilyFromElement$1(e.closest('[style*="font-family"]')||e),textStrong:a.textHasStyle$1(e,"strong","b")||a.isElementHasBold(e)||!!o?.querySelector("strong")||!!o?.querySelector("bold")||e.querySelector("span")?.style?.fontWeight?.includes("bold"),textItalic:!e.closest('[style*="font-style: normal"]')&&e.style?.fontStyle==="italic"||!!e.querySelector("em")||!!e.querySelector("i")||e.querySelector("span")?.style?.fontStyle?.includes("italic"),fontSize:parseFloat(e.closest('[style*="font-size"]')?.style.fontSize)||0,lineHeight:t.getLineHeghtInPixels(e),textColor:a.rgbToHex(e.closest('[style*="color"]')?.style.color)||"",textBackgroundColor:a.rgbToHex(e.closest('[style*="background-color"]')?.style.backgroundColor)||"",textStrikethrough:iu(e),textUnderline:lu(e)}:{}}function iu(e){return e.style?.textDecorationLine?.includes("line-through")||e.querySelector("em")?.style?.textDecorationLine?.includes("line-through")||e.querySelector("span")?.style?.textDecorationLine?.includes("line-through")||e.style?.textDecoration?.includes("line-through")||e.querySelector("em")?.style?.textDecoration?.includes("line-through")||e.querySelector("span")?.style?.textDecoration?.includes("line-through")||!!e.querySelector("strike")}function lu(e){return e.style?.textDecorationLine?.includes("underline")||e.querySelector("em")?.style?.textDecorationLine?.includes("underline")||e.querySelector("span")?.style?.textDecorationLine?.includes("underline")||e.style?.textDecoration?.includes("underline")||e.querySelector("em")?.style?.textDecoration?.includes("underline")||e.querySelector("span")?.style?.textDecoration?.includes("underline")||!!e.querySelector("underline")||!!e.querySelector("u")}function au(e,o,t){const n=e.elem.querySelector(".em-element-list-ul")||e.elem.querySelector(".em-element-list-ol")||null,r=n?e.elem.querySelector('table[class^="em-element-list"] tr td:nth-child(2) div'):null,i=a.getElementMobileProps({elem:e.elem}),l=e.elem.querySelector("td"),s=t.getElementTdDiv(l),c=n?ai(r,n,t):{};return{type:"td",caption:o.ELEMENT,...s,mobileWidth:li(i.mobileWidth,i.mobileWidthDim),direction:l?.getAttribute("dir")??"none",elementName:n?"List":"",...c}}function su(e,o,t){const n=e.elem.closest("table")?.closest("td"),r=e.elem.closest("table");if(!n&&!r)return{settings:null,editTargetTd:null,shouldResetProgrammaticSelection:!0};const i=n?.querySelector('table[class^="em-element-list"] tr td:nth-child(2) div'),l=!!(n?.querySelector(".em-element-list-ul")||n?.querySelector(".em-element-list-ol")),s=a.getElementMobileProps({elem:n}),c=n?.querySelector("td"),d=t.getElementTdDiv(c),u=i?ai(i,r,t):{};return{settings:{type:"td",caption:o.ELEMENT,...d,mobileWidth:li(s.mobileWidth,s.mobileWidthDim),direction:c?.getAttribute("dir")??"none",elementName:l?"List":"",...u},editTargetTd:c,shouldResetProgrammaticSelection:!0}}var cu='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 15 3 C 13.742188 3 12.847656 3.890625 12.40625 5 L 5 5 L 5 28 L 13 28 L 13 30 L 27 30 L 27 14 L 25 14 L 25 5 L 17.59375 5 C 17.152344 3.890625 16.257813 3 15 3 Z M 15 5 C 15.554688 5 16 5.445313 16 6 L 16 7 L 19 7 L 19 9 L 11 9 L 11 7 L 14 7 L 14 6 C 14 5.445313 14.445313 5 15 5 Z M 7 7 L 9 7 L 9 11 L 21 11 L 21 7 L 23 7 L 23 14 L 13 14 L 13 26 L 7 26 Z M 15 16 L 25 16 L 25 28 L 15 28 Z"/></svg>',du='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 16 2 C 14.742188 2 13.847656 2.890625 13.40625 4 L 5 4 L 5 29 L 27 29 L 27 4 L 18.59375 4 C 18.152344 2.890625 17.257813 2 16 2 Z M 16 4 C 16.554688 4 17 4.445313 17 5 L 17 6 L 20 6 L 20 8 L 12 8 L 12 6 L 15 6 L 15 5 C 15 4.445313 15.445313 4 16 4 Z M 7 6 L 10 6 L 10 10 L 22 10 L 22 6 L 25 6 L 25 27 L 7 27 Z M 21.28125 13.28125 L 15 19.5625 L 11.71875 16.28125 L 10.28125 17.71875 L 14.28125 21.71875 L 15 22.40625 L 15.71875 21.71875 L 22.71875 14.71875 Z"/></svg>',mu='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 5 5 L 5 9 L 6 9 L 6 19 L 5 19 L 5 23 L 9 23 L 9 22 L 11 22 L 11 24 L 10 24 L 10 28 L 14 28 L 14 27 L 24 27 L 24 28 L 28 28 L 28 24 L 27 24 L 27 14 L 28 14 L 28 10 L 24 10 L 24 11 L 22 11 L 22 9 L 23 9 L 23 5 L 19 5 L 19 6 L 9 6 L 9 5 Z M 9 8 L 19 8 L 19 9 L 20 9 L 20 19 L 19 19 L 19 20 L 9 20 L 9 19 L 8 19 L 8 9 L 9 9 Z M 22 13 L 24 13 L 24 14 L 25 14 L 25 24 L 24 24 L 24 25 L 14 25 L 14 24 L 13 24 L 13 22 L 19 22 L 19 23 L 23 23 L 23 19 L 22 19 Z"/></svg>',pt=null,uu=".em-prevent-action";function fu(e){pt=e}function pu(){return a.state.get("emailWidth")||475}function gu(){return a.state.get("copyPasteEnabled")||!1}function bu(){return a.state.get("saveBlockEnabled")||!1}function hu(){return a.state.get("blocksAddPanelEnabled")||!1}function yu(){return a.state.get("codeMode")||!1}function qt(e,o){if(!pt)return;const t=pt.getLocale(),n=pu(),r=gu(),i=bu(),l=hu(),s=yu();if(o==="atom"){e.setAttribute("em-state","active"),e.getBoundingClientRect().left<50&&e.setAttribute("em-state","active-inside");const c=a.addElement({targetElement:e,insertType:"append",className:"em-element-editor",width:82,height:26});c.classList.add("of-atom"),document.body.getBoundingClientRect().height>70&&e.getBoundingClientRect().top+70>document.body.getBoundingClientRect().height&&c.classList.add("out-of-iframe"),e.getBoundingClientRect().top<25&&c.classList.add("em-top-crossed");const d=a.addElement({targetElement:c,insertType:"append",className:"em-element-editor-widget"});a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:a.icon(a.braille_solid_default,`${a.ICON_SIZE} ${a.ICON_ROLE.drag}`,'style="transform: rotate(90deg)"'),title:t.REORDER_ATOM}),a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:a.icon(a.pen_solid_default,`${a.ICON_SIZE} em-analytics__atoms-panel-edit`),title:t.EDIT_ATOM}),a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:a.icon(a.copy_solid_default,`${a.ICON_SIZE} em-analytics__atoms-panel-clone`),title:t.CLONE_ATOM}),a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:a.icon(a.trash_alt_solid_default,`${a.ICON_SIZE} em-analytics__atoms-panel-remove`),title:t.REMOVE_ATOM}),a.stickyCheck(pt.commit)}if(o==="block"){e.setAttribute("em-state","active");const c=a.addElement({targetElement:e,insertType:"append",className:"em-element-editor"});c.classList.add("of-block"),e.getBoundingClientRect().left<35&&e.setAttribute("em-state","active-inside"),(document.body.getBoundingClientRect().height>130&&e.getBoundingClientRect().top+130>document.body.getBoundingClientRect().height||document.documentElement.clientWidth<n&&e.getBoundingClientRect().top-34<0)&&c.classList.add("out-of-iframe");const d=a.addElement({targetElement:c,insertType:"append",className:"em-element-editor-widget"}),u=a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-group"});if(a.addElement({targetElement:u,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:a.icon(a.braille_solid_default,`${a.ICON_SIZE} ${a.ICON_ROLE.drag}`),title:t.REORDER_BLOCK}),a.addElement({targetElement:u,insertType:"append",className:"em-element-editor-widget-up"+(e.closest('[em="block"]')?.previousElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:a.icon(a.arrow_up_solid_default,`${a.ICON_SIZE} ${a.ICON_ROLE.moveUp}`),title:t.REORDER_BLOCK_UP}),a.addElement({targetElement:u,insertType:"append",className:"em-element-editor-widget-down"+(e.closest('[em="block"]')?.nextElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:a.icon(a.arrow_down_solid_default,`${a.ICON_SIZE} ${a.ICON_ROLE.moveDown}`),title:t.REORDER_BLOCK_DOWN}),a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:a.icon(a.pen_solid_default,`${a.ICON_SIZE} em-analytics__blocks-panel-edit`),title:t.EDIT_BLOCK}),r){const m=a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-group"});a.addElement({targetElement:m,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:a.icon(a.copy_solid_default,`${a.ICON_SIZE} em-analytics__blocks-panel-clone`),title:t.CLONE_BLOCK}),a.addElement({targetElement:m,insertType:"append",className:"em-element-editor-widget-copy",HTMLcontent:a.icon(du,`${a.ICON_SIZE} em-analytics__blocks-panel-copy`),title:t.COPY_BLOCK_TO_CLIPBOARD}),a.addElement({targetElement:m,insertType:"append",className:"em-element-editor-widget-paste",HTMLcontent:a.icon(cu,`${a.ICON_SIZE} em-analytics__blocks-panel-paste`),title:t.PASTE_BLOCK_FROM_CLIPBOARD})}else a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:a.icon(a.copy_solid_default,`${a.ICON_SIZE} em-analytics__blocks-panel-clone`),title:t.CLONE_BLOCK});if(e.closest(uu))return;if((document.querySelector('[em="block"][em-edit="active"] .em-mob-wrap, [em="block"][em-edit="active"] .noresp-em-mob-wrap')&&document.querySelector('[em="block"][em-state="active"] .em-mob-wrap, [em="block"][em-state="active"] .noresp-em-mob-wrap')||document.querySelector('[em="block"] > [em-edit="active"] .em-mob-wrap, [em="block"] > [em-edit="active"] .noresp-em-mob-wrap')&&document.querySelector('[em="block"] > [em-state="active"] .em-mob-wrap, [em="block"] > [em-state="active"] .noresp-em-mob-wrap')||document.querySelector('[em="block"] > [em-edit="active"]')?.closest(".em-structure")&&document.querySelector('[em="block"] > [em-state="active"]')?.closest(".em-structure"))&&(document.querySelector('[em="block"][em-edit="active"]')&&document.querySelector('[em="block"][em-edit="active"]')!==d.closest('[em-edit="active"]')||document.querySelector('[em="block"] > [em-edit="active"]')&&document.querySelector('[em="block"] > [em-edit="active"]')!==d.closest('[em-edit="active"]'))&&a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-merge",HTMLcontent:a.icon(a.object_group_solid_default,`${a.ICON_SIZE} ${a.ICON_ROLE.merge} em-analytics__blocks-panel-merge`),title:t.MERGE_BLOCK}),d.closest('[em="block"]')?.querySelectorAll(":scope > td > table").length>1&&d.closest('[em="block"]')?.querySelectorAll(".em-mob-wrap")&&a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-unmerge",HTMLcontent:a.icon(mu,`${a.ICON_SIZE} ${a.ICON_ROLE.unmerge} em-analytics__blocks-panel-unmerge`),title:t.UNMERGE_BLOCK}),i&&a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-add-block",HTMLcontent:a.icon(a.save_solid_default,`${a.ICON_SIZE} em-analytics__blocks-panel-save`),title:t.SAVE_TO_BLOCKS}),a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:a.icon(a.trash_alt_solid_default,`${a.ICON_SIZE} em-analytics__blocks-panel-remove`),title:t.REMOVE_BLOCK}),l&&!e.querySelector(".em-element-block-add")&&!s){const m=a.addElement({targetElement:e,insertType:"append",className:"em-element-block-add"});e.getBoundingClientRect().bottom+1>document.body.getBoundingClientRect().height&&m.classList.add("out-of-iframe"),a.addElement({targetElement:m,insertType:"append",className:"em-element-block-add-plus",HTMLcontent:`${a.icon(a.plus_solid_default,`${a.ICON_SIZE} ${a.ICON_ROLE.add}`)} ${t.ADD_BLOCK}`,title:t.ADD_BLOCK}),a.addElement({targetElement:m,insertType:"append",className:"add-empty-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="border-outer" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656zM484 366h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM302 548h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm364 0h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-182 0h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm0 182h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8z"></path></svg>',title:t.ADD_EMPTY_BLOCK}),a.addElement({targetElement:m,insertType:"append",className:"add-saved-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="appstore-add" width="1em" height="1em" fill="currentColor" aria-hidden="true"><defs><style></style></defs><path d="M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zm52 132H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200zM424 712H296V584c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v128H104c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h128v128c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V776h128c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"></path></svg>',title:t.ADD_SAVED_BLOCK}),a.addElement({targetElement:m,insertType:"append",className:"add-common-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="appstore" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"></path></svg>',title:t.ADD_COMMON_BLOCK}),a.addElement({targetElement:m,insertType:"append",className:"add-template-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="build" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M916 210H376c-17.7 0-32 14.3-32 32v236H108c-17.7 0-32 14.3-32 32v272c0 17.7 14.3 32 32 32h540c17.7 0 32-14.3 32-32V546h236c17.7 0 32-14.3 32-32V242c0-17.7-14.3-32-32-32zm-504 68h200v200H412V278zm-68 468H144V546h200v200zm268 0H412V546h200v200zm268-268H680V278h200v200z"></path></svg>',title:t.ADD_TEMPLATE_BLOCK}),a.addElement({targetElement:m,insertType:"append",className:"add-search-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg>',title:t.ADD_SEARCH_BLOCK})}a.stickyCheck(pt.commit);const g=e.closest('[em="block"]');g&&(g.onmouseleave=function(){Wt(void 0)})}if(o==="group"){e.tagName==="TR"?e.querySelector("td")?.setAttribute("em-state","active"):e.setAttribute("em-state","active");const c=a.addElement({targetElement:e,insertType:"append",className:"em-element-editor"});c.classList.add("of-group"),document.body.getBoundingClientRect().height>130&&e.getBoundingClientRect().top+130>document.body.getBoundingClientRect().height&&c.classList.add("out-of-iframe");const d=a.addElement({targetElement:c,insertType:"append",className:"em-element-editor-widget"}),u=a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-group"});a.addElement({targetElement:u,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:a.icon(a.braille_solid_default,`${a.ICON_SIZE} ${a.ICON_ROLE.drag}`),title:t.REORDER_BLOCK}),a.addElement({targetElement:u,insertType:"append",className:"em-element-editor-widget-up"+(e.closest('[em="group"]')?.previousElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:a.icon(a.arrow_up_solid_default,`${a.ICON_SIZE} ${a.ICON_ROLE.moveUp}`),title:t.REORDER_BLOCK_UP}),a.addElement({targetElement:u,insertType:"append",className:"em-element-editor-widget-down"+(e.closest('[em="group"]')?.nextElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:a.icon(a.arrow_down_solid_default,`${a.ICON_SIZE} ${a.ICON_ROLE.moveDown}`),title:t.REORDER_BLOCK_DOWN}),a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-add",HTMLcontent:a.icon(a.plus_solid_default,`${a.ICON_SIZE} ${a.ICON_ROLE.add} em-analytics__groups-panel-add`),title:t.ADD_GROUP}),a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:a.icon(a.pen_solid_default,`${a.ICON_SIZE} em-analytics__groups-panel-edit`),title:t.EDIT_GROUP}),a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:a.icon(a.copy_solid_default,`${a.ICON_SIZE} em-analytics__groups-panel-clone`),title:t.CLONE_GROUP}),document.querySelectorAll('[em="group"]').length>1&&a.addElement({targetElement:d,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:a.icon(a.trash_alt_solid_default,`${a.ICON_SIZE} em-analytics__groups-panel-remove`),title:t.REMOVE_GROUP}),a.stickyCheck(pt.commit)}}function Wt(e){if(document.documentElement.classList.contains("em-resize-start"))return;const o=a.state.get("isLeftButtonDown")||!1;e&&e.closest("[em]")?.getAttribute("em")==="atom"?(document.querySelectorAll('[em="atom"] .em-element-editor, [em="atom"] .em-vindent-paddingTop, [em="atom"] .em-vindent-paddingRight, [em="atom"] .em-vindent-paddingBottom, [em="atom"] .em-vindent-paddingLeft, td.em-vindent .em-element-vindent-value, div[style*="height"][style*="line-height"].em-vindent .em-element-vindent-value').forEach(t=>{t.closest('[em="atom"]')!==e&&!o&&t.remove()}),document.querySelectorAll('[em="group"] .em-element-editor.of-group').forEach(t=>{t.remove()}),document.querySelectorAll('[em="atom"][em-state], [em="atom"] [em-state]').forEach(t=>{t.closest('[em="atom"]')!==e&&t.removeAttribute("em-state")})):e&&e.closest("[em]")?.getAttribute("em")==="block"?(document.querySelectorAll('[em="block"] .em-element-editor, .em-element-block-add, [em="block"] .em-vindent-paddingTop, [em="block"] .em-vindent-paddingRight, [em="block"] .em-vindent-paddingBottom, [em="block"] .em-vindent-paddingLeft, td.em-vindent .em-element-vindent-value, div[style*="height"][style*="line-height"].em-vindent .em-element-vindent-value, .em-gap').forEach(t=>{t.closest('[em="block"]')!==e&&!o&&t.remove()}),document.querySelectorAll('[em="group"] .em-element-editor.of-group, [em="atom"] .em-element-editor').forEach(t=>{t.remove()}),document.querySelectorAll("[em-state]").forEach(t=>{(t.closest('[em="block"]')!==e||t.closest('[em="atom"]'))&&t.removeAttribute("em-state")})):(e&&e.closest("[em]")?.getAttribute("em")==="group"||e===void 0)&&(document.querySelectorAll('[em="block"] .em-element-editor, .em-element-block-add, [em="block"] .em-vindent-paddingTop, [em="block"] .em-vindent-paddingRight, [em="block"] .em-vindent-paddingBottom, [em="block"] .em-vindent-paddingLeft, td.em-vindent .em-element-vindent-value, div[style*="height"][style*="line-height"].em-vindent .em-element-vindent-value, .em-gap').forEach(t=>{o||t.remove()}),document.querySelectorAll('[em="atom"] .em-element-editor, [em="atom"] .em-vindent-paddingTop, [em="atom"] .em-vindent-paddingRight, [em="atom"] .em-vindent-paddingBottom, [em="atom"] .em-vindent-paddingLeft, td.em-vindent .em-element-vindent-value, div[style*="height"][style*="line-height"].em-vindent .em-element-vindent-value').forEach(t=>{o||t.remove()}),document.querySelectorAll('[em="group"] .em-element-editor, [em="group"] .em-vindent-paddingTop, [em="group"] .em-vindent-paddingRight, [em="group"] .em-vindent-paddingBottom, [em="group"] .em-vindent-paddingLeft, td.em-vindent .em-element-vindent-value, div[style*="height"][style*="line-height"].em-vindent .em-element-vindent-value').forEach(t=>{t.closest('[em="group"]')!==e&&!o&&t.remove()}),document.querySelectorAll("[em-state]").forEach(t=>{(t.closest('[em="group"]')!==e||t.closest('[em="block"]')||t.closest('[em="atom"]'))&&t.removeAttribute("em-state")})),document.querySelectorAll(".em-block-insert").forEach(t=>t.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")),document.querySelectorAll(".em-block-insert-empty").forEach(t=>t.classList.remove("em-block-insert-empty")),document.querySelectorAll('[em-hover="true"]').forEach(t=>t.removeAttribute("em-hover"))}function Eu(e,o){if(!e?.isConnected)return;let t;if(t=e.closest('[em="atom"]')){if(Wt(t),t.querySelector(".em-element-editor.of-atom")||qt(t.tagName==="TR"?t.querySelector("td"):t,"atom"),!t.closest('[em="block"]')?.querySelector(".em-element-editor.of-block")){document.querySelectorAll('[em="block"] > td > .em-element-editor, [em="block"] > td > .em-element-block-add').forEach(r=>{r.remove()}),document.querySelectorAll("[em-state]").forEach(r=>{r.removeAttribute("em-state")});const n=t.closest('[em="block"]');n&&qt(n.tagName==="TR"?n.querySelector("td"):n,"block"),o.setBlockGroupControlsPosition()}}else(t=e.closest('[em="block"]'))?(Wt(t),t.querySelector(".em-element-editor.of-block")||(qt(t.tagName==="TR"?t.querySelector("td"):t,"block"),o.setBlockGroupControlsPosition())):(t=e.closest('[em="group"]'))&&(Wt(t),t.querySelector(".em-element-editor.of-group")||(qt(t.tagName==="TR"?t.querySelector("td"):t,"group"),o.setBlockGroupControlsPosition()));e.closest(".em-element-path")||document.querySelectorAll('[em-hover="true"]').forEach(function(n){n.removeAttribute("em-hover")}),!e.closest(".em-editor-wrapper")&&!e.closest(".em-element-editor")&&!e.closest(".em-vindent")&&!e.closest(".em-gap")&&!e.closest(".em-element-resize-img")&&!e.closest(".em-element-img-change-group")&&!e.closest(".em-element-block-add")&&!e.closest(".em-element-path")&&e.tagName!=="IMG"?e.setAttribute("em-hover","true"):e.tagName==="IMG"&&e.parentElement?.setAttribute("em-hover","true"),o.commit(!1)}var Su='<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="20"></td></tr></table>',Cu=['[em="block"].empty-structure td[em-edit="active"]:not([height]):not([width]):empty','[em="block"].empty-structure td[em-edit="active"]:not([height]):not([width])','.em-structure td[em-edit="active"]:not([height]):not([width]):empty','.em-structure td[em-edit="active"]:not([height]):not([width])','.em-structure td.em-mob-wrap[em-edit="active"]','.em-structure td.noresp-em-mob-wrap[em-edit="active"]'];function si(){a.clearPendingPaletteInsert(),document.body.classList.remove("em-block-insert-body","em-atom-insert-body","em-atom-insert-body-inside"),document.querySelectorAll(".em-block-insert-empty").forEach(e=>e.classList.remove("em-block-insert-empty")),document.querySelectorAll(".em-atom-insert-empty").forEach(e=>e.classList.remove("em-atom-insert-empty"))}function vu(){const e=document.querySelectorAll('[em="block"]');return e.length?e[e.length-1]:null}function Au(){for(const e of Cu){const o=document.querySelector(e);if(o)return o}return null}function Tu(e){const o=e.querySelectorAll('[em="atom"]');return o.length?o[o.length-1]:e}function Lu(e){const o=e.querySelectorAll('[em="atom"]');if(o.length)return o[o.length-1];const t=e.querySelector("td.em-mob-wrap")??e.querySelector("td.noresp-em-mob-wrap")??e.querySelector('td[em-edit="active"]:not([height]):not([width])');return t||(e instanceof HTMLElement?Qt(e):null)}function wu(e,o,t){const n=e.getAttribute("em")==="atom",r=n?"afterend":"beforeend",i=n?e.parentElement:e;return o.match(/class="em-countdown"/gi)?t.insertCountdown({targetElem:e,targetPlace:r,atomHTML:o}):e.insertAdjacentHTML(r,o),ku(i,e,n)}function ku(e,o,t){if(t){const n=o.nextElementSibling;if(n?.getAttribute("em")==="atom")return n}if(e){const n=e.querySelectorAll('[em="atom"]');if(n.length)return n[n.length-1]}return null}function ci(e,o,t){return o.match(/em="atom"><tr><td>\s*<img/gi)&&(o=t.setImageWidth({atomHTML:o,targetAtom:e})),o=t.commonStylesApply({html:o}),wu(e,o,t)}function _u(e,o){if(!e||document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]')||document.documentElement.scrollHeight+(o.iframeOffsetTop||0)<=(o.previewHeight||0))return;const t=e.getBoundingClientRect();o.messageService.send({operation:"application_scroll-to",settings:{value:t.top+t.height}})}function Nu(){const e=document.querySelector("table:empty");return e instanceof HTMLTableElement?e:null}function Bu(e,o){const t=Nu();if(!t)return null;e.match(/em="atom"><tr><td>\s*<img/gi)&&(e=o.setImageWidth({atomHTML:e,targetAtom:t})),e=o.commonStylesApply({html:e});let n=$n(e);if(e!==Su){const i=n.match(/<style((.|\n|\r)*?)<\/style>/g);o.setDocumentStyles(i)}n=o.commonStylesApplyToBlock({html:n}),(n.indexOf("empty-structure")>-1||n.indexOf("em-structure")>-1)&&(n=o.setFloatBlocksWidth({blockHTML:n,targetBlock:t}),n=o.fitImagesToColumns(n));const r=!!e.match(/class="em-countdown"/gi);return n.substring(0,3)!=="<tr"||t.innerHTML.trim()?null:(r?o.insertCountdown({targetElem:t,targetPlace:"beforeend",atomHTML:n}):t.insertAdjacentHTML("beforeend",n),t.querySelector('[em="block"]:last-child')??t.lastElementChild)}function di(e){return typeof e=="string"?e:e&&typeof e=="object"&&typeof e.html=="string"?e.html:""}function Mu(e,o){e&&o.messageService.send(a.EVENT_TYPES.APPLICATION_ATOM_INSERTED,e),si()}function Ru(e,o){o.messageService.send("application_block_inserted",{type:e.type,name:e.name,blockId:e.blockId,project:e.project}),si()}function Pu(e,o){const t=di(e.atomHTML),n=t.match(/<style((.|\n|\r)*?)<\/style>/g);return o.setDocumentStyles(n),t.replaceAll(/<style((.|\n|\r)*?)<\/style>/gi,"").trim()}function Hu(e,o){let t=Pu(e,o);if(!t)return!1;let n=null;const r=Au();if(r)n=ci(Tu(r),t,o);else{const i=vu();if(i){const l=Lu(i);l&&(n=ci(l,t,o))}else n=Bu(t,o)}return n?(_u(n,o),!0):!1}function Iu(e,o,t){if(e.tagName==="TR"){o.substring(0,3)==="<tr"?t.insertAdjacentHTML(e,"afterend",o):t.insertAdjacentHTML(e,"afterend",'<tr em="block"><td align="center">'+o+"</td></tr>");return}if(o.substring(0,3)==="<tr"){const n=document.createElement("table");n.setAttribute("cellspacing","0"),n.setAttribute("cellpadding","0"),n.setAttribute("align","center"),n.setAttribute("border","0"),n.setAttribute("em","block"),n.setAttribute("width",e.hasAttribute("width")?e.getAttribute("width"):String(e.getBoundingClientRect().width)),n.classList.add("em-mob-width-100perc"),n.innerHTML=`
259
259
  `+o+`
260
260
  `,n.querySelectorAll('tr[em="block"]').forEach(r=>r.removeAttribute("em")),e.insertAdjacentElement("afterend",n)}else t.insertAdjacentHTML(e,"afterend",o)}function mi(e,o,t){if(!e.blockHTML?.trim())return!1;const n=o.parseFromString(e.blockHTML);let r=n.filter(u=>u.tagName&&u.tagName!=="LINK"&&u.tagName!=="STYLE").map(u=>o.getOuterHtml(u)).join(""),i=n.filter(u=>u.tagName==="STYLE").map(u=>o.getOuterHtml(u)).join("");const l=n.filter(u=>u.tagName==="LINK"&&u.getAttribute("em-class")).filter(u=>!document.head?.querySelector(`link[em-class="${u.getAttribute("em-class")}"]`));if(i){let u=document.head?.querySelector('style[em="styles"]'),g="";u?g=o.HTMLDocument.getInnerHtml(u):(u=document.createElement("style"),u.setAttribute("em","styles"),u=document.head?.insertAdjacentElement("beforeend",u));const m=document.createElement("div");o.emailWidth&&(i=i.replace(/(max-device-width:|max-width:)\d+px/g,p=>p.replace(/\d+/,String(o.emailWidth)))),m.insertAdjacentHTML("afterbegin",i);let f=o.minify(g+`
261
261
  `+[...m.querySelectorAll("style")].map(p=>p.innerHTML).join(`
262
262
  `),{restructure:!0,forceMediaMerge:!0}).css;f=o.cssbeautify(f,{indent:" ",autosemicolon:!0}),u.textContent=`
263
263
  `+f+`
264
264
  `}for(const u of l.reverse())document.head?.prepend(u),document.head?.insertAdjacentHTML("afterbegin",`
265
- `);if(e.type!=="project"&&(r=o.commonStylesApplyToBlock({html:r})),r.match(/class="em-countdown"/gi)&&(r=o.uptimeCountdown({blockHTML:r})),t)return(r.indexOf("empty-structure")>-1||r.indexOf("em-structure")>-1)&&(r=o.setBlockMaxWidth({blockHTML:r,targetBlock:t}),r=o.setFloatBlocksWidth({blockHTML:r,targetBlock:t,project:e.project})),r=o.checkBlockAdaptivity({blockHTML:r,blockIsTr:r.substring(0,3)==="<tr"}),Ru(t,r,o),!0;let s=null,c=null,d=!1;if(document.querySelector("table:empty"))s=document.querySelector("table:empty"),c=s,(r.indexOf("empty-structure")>-1||r.indexOf("em-structure")>-1)&&(r=o.setBlockMaxWidth({blockHTML:r,targetBlock:s}),r=o.setFloatBlocksWidth({blockHTML:r,targetBlock:s,project:e.project})),r=o.checkBlockAdaptivity({blockHTML:r,blockIsTr:r.substring(0,3)==="<tr"}),r.substring(0,3)==="<tr"?o.insertAdjacentHTML(s,"beforeend",r):o.insertAdjacentHTML(s,"beforeend",'<tr><td align="center">'+r+"</td></tr>"),d=!0;else if(document.querySelector('[em="group"]:last-child [em="block"]')||document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]')){const u=document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]');if(s=u?u.closest('[em="block"]'):document.querySelector('[em="group"]:last-child [em="block"]:last-child'),(r.indexOf("empty-structure")>-1||r.indexOf("em-structure")>-1)&&(r=o.setBlockMaxWidth({blockHTML:r,targetBlock:s}),r=o.setFloatBlocksWidth({blockHTML:r,targetBlock:s,project:e.project})),r=o.checkBlockAdaptivity({blockHTML:r,blockIsTr:r.substring(0,3)==="<tr"}),s?.tagName==="TR")r.substring(0,3)==="<tr"?o.insertAdjacentHTML(s,"afterend",r):o.insertAdjacentHTML(s,"afterend",'<tr em="block"><td align="center">'+r+"</td></tr>"),d=!0;else if(s){if(r.substring(0,3)==="<tr"){const g=document.createElement("table");g.setAttribute("cellspacing","0"),g.setAttribute("cellpadding","0"),g.setAttribute("align","center"),g.setAttribute("border","0"),g.setAttribute("em","block"),g.setAttribute("width",s.hasAttribute("width")?s.getAttribute("width"):String(s.getBoundingClientRect().width)),g.classList.add("em-mob-width-100perc"),g.innerHTML=`
265
+ `);if(e.type!=="project"&&(r=o.commonStylesApplyToBlock({html:r})),r.match(/class="em-countdown"/gi)&&(r=o.uptimeCountdown({blockHTML:r})),t)return(r.indexOf("empty-structure")>-1||r.indexOf("em-structure")>-1)&&(r=o.setBlockMaxWidth({blockHTML:r,targetBlock:t}),r=o.setFloatBlocksWidth({blockHTML:r,targetBlock:t,project:e.project})),r=o.checkBlockAdaptivity({blockHTML:r,blockIsTr:r.substring(0,3)==="<tr"}),Iu(t,r,o),!0;let s=null,c=null,d=!1;if(document.querySelector("table:empty"))s=document.querySelector("table:empty"),c=s,(r.indexOf("empty-structure")>-1||r.indexOf("em-structure")>-1)&&(r=o.setBlockMaxWidth({blockHTML:r,targetBlock:s}),r=o.setFloatBlocksWidth({blockHTML:r,targetBlock:s,project:e.project})),r=o.checkBlockAdaptivity({blockHTML:r,blockIsTr:r.substring(0,3)==="<tr"}),r.substring(0,3)==="<tr"?o.insertAdjacentHTML(s,"beforeend",r):o.insertAdjacentHTML(s,"beforeend",'<tr><td align="center">'+r+"</td></tr>"),d=!0;else if(document.querySelector('[em="group"]:last-child [em="block"]')||document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]')){const u=document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]');if(s=u?u.closest('[em="block"]'):document.querySelector('[em="group"]:last-child [em="block"]:last-child'),(r.indexOf("empty-structure")>-1||r.indexOf("em-structure")>-1)&&(r=o.setBlockMaxWidth({blockHTML:r,targetBlock:s}),r=o.setFloatBlocksWidth({blockHTML:r,targetBlock:s,project:e.project})),r=o.checkBlockAdaptivity({blockHTML:r,blockIsTr:r.substring(0,3)==="<tr"}),s?.tagName==="TR")r.substring(0,3)==="<tr"?o.insertAdjacentHTML(s,"afterend",r):o.insertAdjacentHTML(s,"afterend",'<tr em="block"><td align="center">'+r+"</td></tr>"),d=!0;else if(s){if(r.substring(0,3)==="<tr"){const g=document.createElement("table");g.setAttribute("cellspacing","0"),g.setAttribute("cellpadding","0"),g.setAttribute("align","center"),g.setAttribute("border","0"),g.setAttribute("em","block"),g.setAttribute("width",s.hasAttribute("width")?s.getAttribute("width"):String(s.getBoundingClientRect().width)),g.classList.add("em-mob-width-100perc"),g.innerHTML=`
266
266
  `+r+`
267
- `,g.querySelectorAll('tr[em="block"]').forEach(m=>m.removeAttribute("em")),s.insertAdjacentElement("afterend",g)}else o.insertAdjacentHTML(s,"afterend",r);d=!0}c=s?.nextSibling}return d&&!document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]')&&document.documentElement.scrollHeight+(o.iframeOffsetTop||0)>(o.previewHeight||0)&&c&&o.messageService.send({operation:"application_scroll-to",settings:{value:c.getBoundingClientRect().top+c.getBoundingClientRect().height}}),d}function Pu(e,o){if(!o.lockEditor&&di(e.atomHTML).trim())try{o.state.increment("activeElementLocked"),o.setAtomReplaced?.(null),a.setPendingPaletteInsert({kind:"atom",settings:e}),e.action!=="insert"&&document.body.classList.add("em-atom-insert-body"),e.action==="insert"&&Mu(e,o)&&_u(e.name,o),o.commit()}catch{}finally{Promise.resolve().then(()=>o.state.decrement("activeElementLocked"))}}function Hu(e){return e.replace(/["\\]/g,"\\$&")}function Iu(e,o){if(o.lockEditor)return 0;const t=e.emBlockId;if(!t||!e.blockHTML?.trim())return 0;const n=`[em="block"][em-block-id="${Hu(String(t))}"]`,r=Array.from(document.querySelectorAll(n));if(!r.length)return 0;let i=0;try{o.state.increment("activeElementLocked");for(const l of r)mi({action:"insert",blockHTML:e.blockHTML,type:e.type,project:e.project,name:e.name},o,l)&&(l.remove(),i+=1);o.commit()}finally{Promise.resolve().then(()=>o.state.decrement("activeElementLocked"))}return i}function Ou(e,o){if(!o.lockEditor&&e.blockHTML?.trim())try{o.state.increment("activeElementLocked"),a.setPendingPaletteInsert({kind:"block",settings:e}),document.body.classList.add("em-block-insert-body"),e.action==="insert"&&mi(e,o)&&Nu(e,o),o.commit()}finally{Promise.resolve().then(()=>o.state.decrement("activeElementLocked"))}}function ui(e,o){const t=JSON.stringify({settings:o});return{target:e,dataTransfer:{getData:n=>n==="Text"?t:""},preventDefault:()=>{},stopPropagation:()=>{}}}function xu(e){return!e.closest(".em-element-editor-widget")}function Du(e,o){if(o.lockEditor)return!1;const t=a.getPendingPaletteInsert();if(!t)return!1;const n=e.target;if(!(n instanceof HTMLElement)||!xu(n))return!1;try{if(t.kind==="atom"){const r={settings:{atomHTML:typeof t.settings.atomHTML=="string"?t.settings.atomHTML:t.settings.atomHTML?.html,name:t.settings.name}};if(!r.settings.atomHTML)return!1;zn(ui(n,r.settings),o.atomDropCtx)}else if(t.kind==="block"&&document.body.classList.contains("em-block-insert-body")){const r={settings:{blockHTML:t.settings.blockHTML,type:t.settings.type,name:t.settings.name,project:t.settings.project,blockId:t.settings.blockId}};if(!r.settings.blockHTML)return!1;Wn(ui(n,r.settings),r,o.blockDropCtx)}else return!1;if(!a.getPendingPaletteInsert())return e.preventDefault(),e.stopPropagation(),to(),o.commit(),!0}catch{return!1}return!1}function Fu(e,o,t){t.state.update({iframeOffsetTop:e.iframeOffsetTop,scrollTop:e.scrollTop,previewHeight:e.previewHeight,applicationMode:e.mode}),typeof o<"u"&&t.state.set("codeMode",e.mode==="code");const n=document.querySelector(".em-element-path");n&&(n.style.top=t.previewHeight-t.iframeOffsetTop-65+t.scrollTop+"px");const r=document.querySelector(".em-editor-wrapper");r&&r.style.display==="none"?t.setBlockGroupControlsPosition():setTimeout(()=>{t.setBlockGroupControlsPosition()},400)}function qu(e,o){document.documentElement.removeAttribute("style");const t=o.globalHolder?.querySelector("table:first-child");if(t&&t.offsetWidth>=e.iframeWidth-2&&o.globalHolder){document.documentElement.style.overflowX="visible",document.documentElement.style.height="100%",document.documentElement.style.transformOrigin="left top";const n=e.iframeWidth/o.globalHolder.offsetWidth;document.documentElement.style.transform="scale("+(n<1?n:1)+")",document.querySelector(".em-narrow-table")&&e.iframeWidth>370&&o.messageService.send({operation:"application_preview_alert_show",settings:{show:n<.9}})}setTimeout(()=>{o.messageService.send({operation:"application_iframe_set_height",settings:{height:document.body.getBoundingClientRect().height}})},300)}function Wu(e,o){const{activeElement:t}=o;let n=!1;if(!e)return n;const r=t.closest("a"),i=t.closest("td"),l=i?a.findRoundrectComment(i):null,s=r?a.findRoundrectComment(r):null,c=!!l&&!s,d=a.hasForeignButtonStructure(r),u=e.outlookRounding===!0||e.outlookRounding!==!1&&(c||d)?r:i;if(e.exportAsPicture?t.closest("table")?.setAttribute("em-operation","exportAsPicture"):t?.closest("table")?.getAttribute("em-operation")==="exportAsPicture"&&t.closest("table")?.removeAttribute("em-operation"),e.href!==void 0&&t.closest("a")?.setAttribute("href",e.href),e.align){const p=t.closest("td")?.closest("table")?.closest("div, p, td");p&&(p.style.textAlign?p.style.textAlign=e.align:p.setAttribute("align",e.align))}else if(e.align===""){const p=t.closest("td")?.closest("table")?.closest("div, p, td");p&&(p.style.textAlign?p.style.removeProperty("text-align"):p.removeAttribute("align"))}if(e.textAlign){const p=t.closest("td");p&&(p.style.textAlign?p.style.textAlign=e.textAlign:p.setAttribute("align",e.textAlign))}else if(e.textAlign===""){const p=t.closest("td");p&&(p.style.textAlign?p.style.removeProperty("text-align"):p.removeAttribute("align"))}if(e.valign?t.closest("td")?.closest("table")?.closest("td")?.setAttribute("valign",e.valign):e.valign===""&&t.closest("td")?.closest("table")?.closest("td")?.removeAttribute("valign"),e.width){const p=t.closest("table");p&&(e.width.value?(p.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")),p.style.width=e.width.value+e.width.dim):(p.removeAttribute("width"),p.style.removeProperty("width")))}if(e.height){const p=t.closest("td"),b=t.closest("a");if(e.height.value){if(p&&(p.setAttribute("height",e.height.value+(e.height.dim==="px"?"":"%")),p.style.height=e.height.value+e.height.dim),b){const h=e.height.value+e.height.dim;b.style.height=h,b.style.lineHeight=h,b.firstElementChild&&(b.firstElementChild.style.lineHeight=h);const y=b.closest("editor")||b.querySelector("editor");y&&(y.style.height=h,y.style.lineHeight=h)}}else if(p&&(p.removeAttribute("height"),p.style.removeProperty("height")),b){b.style.removeProperty("height"),b.style.removeProperty("line-height");const h=b.closest("editor")||b.querySelector("editor");h&&(h.style.removeProperty("height"),h.style.removeProperty("line-height"))}}if(e.border&&u&&o.setElementBorder({settings:e,elem:u}),e.boxShadow&&u&&o.setElementBoxShadow({settings:e,elem:u}),e.backgroundColor!==void 0&&u&&(e.backgroundColor===""?(u.removeAttribute("bgcolor"),u.style.removeProperty("background-color")):(u.tagName==="TD"&&u.setAttribute("bgcolor",e.backgroundColor),u.style.backgroundColor=e.backgroundColor)),e.backgroundImage){const p=t.closest("td");p&&(e.backgroundImage[0].value===""?(p.style.removeProperty("background-image"),p.removeAttribute("background")):(p.style.removeProperty("background-image"),a.setRenderedAttribute(p,"background",zu(e))))}if(e.backgroundPositionX!==void 0){const p=t.closest("td");p&&(e.backgroundPositionX===""?p.style.removeProperty("background-position-x"):p.style.backgroundPositionX=e.backgroundPositionX)}if(e.backgroundPositionY!==void 0){const p=t.closest("td");p&&(e.backgroundPositionY===""?p.style.removeProperty("background-position-y"):p.style.backgroundPositionY=e.backgroundPositionY)}if(e.backgroundRepeat){const p=t.closest("td");p&&(e.backgroundRepeat==="none"?p.style.removeProperty("background-repeat"):p.style.backgroundRepeat=e.backgroundRepeat)}if(e.backgroundSize!==void 0){const p=t.closest("td");p&&(e.backgroundSize===""?p.style.removeProperty("background-size"):p.style.backgroundSize=e.backgroundSize)}if(e.padding){const p=t.closest("a");p&&(e.padding.all!==void 0?(p.style.paddingTop=e.padding.all+"px",p.style.paddingRight=e.padding.all+"px",p.style.paddingBottom=e.padding.all+"px",p.style.paddingLeft=e.padding.all+"px"):(e.padding.top!==void 0&&(p.style.paddingTop=e.padding.top+"px"),e.padding.right!==void 0&&(p.style.paddingRight=e.padding.right+"px"),e.padding.bottom!==void 0&&(p.style.paddingBottom=e.padding.bottom+"px"),e.padding.left!==void 0&&(p.style.paddingLeft=e.padding.left+"px")))}if(e.borderRadius&&u&&o.setElementBorderRadius({settings:e,elem:u}),e.mobileWidth){const p=t.closest("table");p&&o.setElementMobileWidth({settings:e,elem:p}),n=!0}if(e.mobileHeight){const p=t.closest("td");p&&o.setElementMobileHeight({settings:e,elem:p}),o.setElementMobileLineHeight({settings:e,elem:t}),n=!0}if(e.mobileBorder){const p=t.closest("td");p&&o.setElementMobileBorder({settings:e,elem:p}),n=!0}if(e.mobileBorderRadius){const p=t.closest("td");p&&o.setElementMobileBorderRadius({settings:e,elem:p}),n=!0}if(e.mobileBoxShadow){const p=t.closest("td");p&&o.setElementMobileBoxShadow({settings:e,elem:p}),n=!0}if(e.mobileTextAlign){const p=Tt(t);p&&o.setElementMobileAlign({settings:e,elem:p,fieldName:"mobileTextAlign"}),n=!0}if(e.mobileAlign){const p=t.closest("td")?.closest("table");p&&o.setElementMobileTableAlign({settings:e,elem:p}),n=!0}if(e.mobileVerticalAlign){const p=t.closest("td");p&&o.setElementMobileVerticalAlign({settings:e,elem:p}),n=!0}if(e.mobileBackgroundColor){const p=t.closest("td");p&&o.setElementMobileBackgroundColor({settings:e,elem:p}),n=!0}if(e.mobileBackgroundImage){const p=t.closest("td");p&&o.setElementMobileBackgroundImage({settings:e,elem:p}),n=!0}if(e.mobileBackgroundPositionX){const p=t.closest("td");p&&o.setElementMobileBackgroundPositionX({settings:e,elem:p}),n=!0}if(e.mobileBackgroundPositionY){const p=t.closest("td");p&&o.setElementMobileBackgroundPositionY({settings:e,elem:p}),n=!0}if(e.mobileBackgroundRepeat){const p=t.closest("td");p&&o.setElementMobileBackgroundRepeat({settings:e,elem:p}),n=!0}const g=e;if(g.mobileBackgroundSize){const p=t.closest("td");p&&o.setElementMobileBackgroundSize?.({settings:g,elem:p}),n=!0}if(e.mobilePadding&&(o.setElementMobilePadding({settings:e,elem:t}),n=!0),e.show){const p=t.closest("table");p&&o.setElementShow({settings:e,elem:p}),n=!0}const m=t.closest("a");if(m&&e.textColor!==void 0){const p=String(e.textColor||"");m.style.color=p,m.querySelectorAll('span[style*="color"], font[color]').forEach(b=>{b.style.removeProperty("color"),b.removeAttribute("color")})}if(m&&e.textBackgroundColor!==void 0){const p=String(e.textBackgroundColor||"");m.style.backgroundColor=p,m.querySelectorAll('span[style*="background-color"]').forEach(b=>{b.style.removeProperty("background-color")})}const f=["textColor","textBackgroundColor"];if(o.textStyleProperties.filter(p=>!f.includes(p)&&e.hasOwnProperty(p)).length>0)try{o.toggleTextStyle(t,{settings:e})}catch{}return e.mobileFontSize&&(o.setElementMobileFontSize({settings:e,elem:t}),n=!0),e.textReplacer!==void 0&&$u(e.textReplacer,t,o.compareStrings),e.outlookRounding===!0?a.syncButtonVML(t,e):e.outlookRounding===!1?a.stripButtonVML(t):(l||d)&&a.syncButtonVML(t,e),i&&a.applyVMLBackgroundToggle(i,e,"inside"),n}function $u(e,o,t){if(e){const n=window.getSelection();if(!n||n.rangeCount===0)return;const r=n.getRangeAt(0),i=e.replace(/~~.*$/,""),l=r?.commonAncestorContainer,s=l?.nodeType===1?l:l.parentElement;let c=s?.closest("em-replace");const d=!!(/~~/.test(e)&&c);if(d&&s){const u=e.replace(/~~.*$/,"");s.setAttribute("text",u),s.innerHTML=u}if(!c&&n.rangeCount>0&&!r.collapsed){const u=document.querySelectorAll("em-replace");if(c=Array.prototype.find.call(u,g=>g.textContent?.trim()===n.toString().trim()&&n.toString().trim()!==""),!c){const g=document.querySelector('[em-edit="active"]');g?.textContent===r.toString()&&r.selectNodeContents(g);const m=e.replace(/~~.*$/,""),f=document.createElement("em-replace");f.setAttribute("text",m),r.surroundContents(f)}}if(!c&&n.rangeCount>0&&r.collapsed){let u=document.querySelector("em-replace");if(u){const g=document.querySelectorAll("em-replace"),m=/~$/;c=Array.prototype.find.call(g,f=>{const p=e,b=f.textContent||"";return p.length===1&&m.test(b)?!0:t(b,p)}),c&&(c.setAttribute("text",e),c.textContent=e),c||(u=document.createElement("em-replace"),u.setAttribute("text",i),r.insertNode(u),u.innerHTML=i,r.collapse())}else u=document.createElement("em-replace"),u.setAttribute("text",i),r.insertNode(u),u.innerHTML=i,r.collapse()}c&&!d&&(c.getAttribute("text")===c.innerHTML&&(c.innerHTML=e),c.setAttribute("text",e))}else if(e===""){const n=o?.closest("em-replace")||o?.querySelector("em-replace");if(n){const r=n.parentNode,i=n.firstChild,l=n.lastChild;if(n.getAttribute("text")!==n.innerHTML&&r)for(;n.firstChild;)r.insertBefore(n.firstChild,n);const s=document.createRange(),c=window.getSelection();i&&l&&c&&(s.setStartBefore(i),s.setEndAfter(l),c.removeAllRanges(),c.addRange(s)),n.remove()}}}function zu(e){return e.backgroundImage?.[0]?.value??""}function Vu(e,o){const t=o.activeElement;let n=!1;if(!e)return n;e.exportAsPicture?t.setAttribute("em-operation","exportAsPicture"):t.getAttribute("em-operation")==="exportAsPicture"&&t.removeAttribute("em-operation"),e.align?t.style.textAlign?t.style.textAlign=e.align:t.setAttribute("align",e.align):e.align===""&&(t.style.textAlign?t.style.removeProperty("text-align"):t.removeAttribute("align")),e.valign?t.style.verticalAlign=e.valign:e.valign===""&&t.style.removeProperty("vertical-align"),e.width&&(e.width.value?t.style.width=e.width.value+e.width.dim:t.style.removeProperty("width")),e.minWidth&&(e.minWidth.value?t.style.minWidth=e.minWidth.value+e.minWidth.dim:t.style.removeProperty("min-width")),e.maxWidth&&(e.maxWidth.value?t.style.maxWidth=e.maxWidth.value+e.maxWidth.dim:t.style.removeProperty("max-width")),e.height&&(e.height.value?t.style.height=e.height.value+e.height.dim:t.style.removeProperty("height")),e.border&&o.setElementBorder({settings:e,elem:t}),e.boxShadow&&o.setElementBoxShadow({settings:e,elem:t}),e.backgroundColor!==void 0&&(e.backgroundColor===""?t.style.removeProperty("background-color"):t.style.backgroundColor=e.backgroundColor),e.backgroundImage&&(e.backgroundImage[0].value===""?t.style.removeProperty("background-image"):t.style.backgroundImage=e.backgroundImage[0].type+"("+e.backgroundImage[0].value+")"),e.backgroundPositionX!==void 0&&(e.backgroundPositionX===""?t.style.removeProperty("background-position-x"):t.style.backgroundPositionX=e.backgroundPositionX),e.backgroundPositionY!==void 0&&(e.backgroundPositionY===""?t.style.removeProperty("background-position-y"):t.style.backgroundPositionY=e.backgroundPositionY),e.backgroundRepeat&&(e.backgroundRepeat==="none"?t.style.removeProperty("background-repeat"):t.style.backgroundRepeat=e.backgroundRepeat),e.backgroundSize!==void 0&&(e.backgroundSize===""?t.style.removeProperty("background-size"):t.style.backgroundSize=e.backgroundSize),e.padding&&(e.padding.all!==void 0?(t.style.paddingTop=e.padding.all+"px",t.style.paddingRight=e.padding.all+"px",t.style.paddingBottom=e.padding.all+"px",t.style.paddingLeft=e.padding.all+"px"):(e.padding.top&&(t.style.paddingTop=e.padding.top+"px"),e.padding.right&&(t.style.paddingRight=e.padding.right+"px"),e.padding.bottom&&(t.style.paddingBottom=e.padding.bottom+"px"),e.padding.left&&(t.style.paddingLeft=e.padding.left+"px"))),e.borderRadius&&o.setElementBorderRadius({settings:e,elem:t}),e.mobileWidth&&(o.setElementMobileWidth({settings:e,elem:t}),n=!0),e.mobileHeight&&(o.setElementMobileHeight({settings:e,elem:t}),n=!0),e.mobileBorder&&(o.setElementMobileBorder({settings:e,elem:t}),n=!0),e.mobileBorderRadius&&(o.setElementMobileBorderRadius({settings:e,elem:t}),n=!0),e.mobileBoxShadow&&(o.setElementMobileBoxShadow({settings:e,elem:t}),n=!0),e.mobileAlign&&(o.setElementMobileAlign({settings:e,elem:t}),n=!0),e.mobileVerticalAlign&&(o.setElementMobileVerticalAlign({settings:e,elem:t}),n=!0),e.mobileDirection&&(o.setElementMobileDirection({settings:e,elem:t}),n=!0),e.mobileBackgroundColor&&(o.setElementMobileBackgroundColor({settings:e,elem:t}),n=!0),e.mobileBackgroundImage&&(o.setElementMobileBackgroundImage({settings:e,elem:t}),n=!0),e.mobileBackgroundPositionX&&(o.setElementMobileBackgroundPositionX({settings:e,elem:t}),n=!0),e.mobileBackgroundPositionY&&(o.setElementMobileBackgroundPositionY({settings:e,elem:t}),n=!0),e.mobileBackgroundRepeat&&(o.setElementMobileBackgroundRepeat({settings:e,elem:t}),n=!0);const r=e;return r.mobileBackgroundSize&&(o.setElementMobileBackgroundSize?.({settings:r,elem:t}),n=!0),e.mobilePadding&&(o.setElementMobilePadding({settings:e,elem:t}),n=!0),e.show&&(o.setElementShow({settings:e,elem:t}),n=!0),a.applyVMLBackgroundToggle(t,e,"inside"),n}function rn(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.textContent=e.elem.textContent.replaceAll(/width=".*"/gi,'width="'+e.width+'"'):e.elem.previousSibling&&rn({elem:e.elem.previousSibling,width:e.width})}function Uu(e,o){const t=o.activeElement;let n=!1;if(!e)return n;e.exportAsPicture?t.setAttribute("em-operation","exportAsPicture"):t.getAttribute("em-operation")==="exportAsPicture"&&t.removeAttribute("em-operation"),e.align?t.setAttribute("align",e.align):e.align===""&&t.removeAttribute("align"),e.width&&(e.width.value?(t.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")),t.style.width=e.width.value+e.width.dim,e.width.dim==="px"&&rn({elem:t,width:e.width.value})):(t.removeAttribute("width"),t.style.removeProperty("width"))),e.maxWidth&&(e.maxWidth.value?(t.style.maxWidth=e.maxWidth.value+e.maxWidth.dim,rn({elem:t,width:e.maxWidth.value})):t.style.removeProperty("max-width")),e.minWidth&&(e.minWidth.value?t.style.minWidth=e.minWidth.value+e.minWidth.dim:t.style.removeProperty("min-width")),e.border&&o.setElementBorder({settings:e,elem:t}),e.boxShadow&&o.setElementBoxShadow({settings:e,elem:t}),e.backgroundColor!==void 0&&(e.backgroundColor===""?(t.removeAttribute("bgcolor"),t.style.removeProperty("background-color")):(t.setAttribute("bgcolor",e.backgroundColor),t.style.backgroundColor=e.backgroundColor)),e.backgroundImage&&(e.backgroundImage[0].value===""?(t.style.removeProperty("background-image"),t.removeAttribute("background")):(t.style.removeProperty("background-image"),t.style.backgroundImage=e.backgroundImage[0].type+"("+e.backgroundImage[0].value+")",a.setRenderedAttribute(t,"background",ju(e)))),e.backgroundPositionX!==void 0&&(e.backgroundPositionX===""?t.style.removeProperty("background-position-x"):t.style.backgroundPositionX=e.backgroundPositionX),e.backgroundPositionY!==void 0&&(e.backgroundPositionY===""?t.style.removeProperty("background-position-y"):t.style.backgroundPositionY=e.backgroundPositionY),e.backgroundRepeat&&(e.backgroundRepeat==="none"?t.style.removeProperty("background-repeat"):t.style.backgroundRepeat=e.backgroundRepeat),e.backgroundSize!==void 0&&(e.backgroundSize===""?t.style.removeProperty("background-size"):t.style.backgroundSize=e.backgroundSize),e.borderRadius&&o.setElementBorderRadius({settings:e,elem:t}),e.mobileAlign&&(o.setElementMobileTableAlign({settings:e,elem:t}),n=!0),e.mobileWidth&&(o.setElementMobileWidth({settings:e,elem:t}),n=!0),e.mobileBorder&&(o.setElementMobileBorder({settings:e,elem:t}),n=!0),e.mobileBorderRadius&&(o.setElementMobileBorderRadius({settings:e,elem:t}),n=!0),e.mobileBoxShadow&&(o.setElementMobileBoxShadow({settings:e,elem:t}),n=!0),e.mobileBackgroundColor&&(o.setElementMobileBackgroundColor({settings:e,elem:t}),n=!0),e.mobileBackgroundImage&&(o.setElementMobileBackgroundImage({settings:e,elem:t}),n=!0),e.mobileBackgroundPositionX&&(o.setElementMobileBackgroundPositionX({settings:e,elem:t}),n=!0),e.mobileBackgroundPositionY&&(o.setElementMobileBackgroundPositionY({settings:e,elem:t}),n=!0),e.mobileBackgroundRepeat&&(o.setElementMobileBackgroundRepeat({settings:e,elem:t}),n=!0);const r=e;return r.mobileBackgroundSize&&(o.setElementMobileBackgroundSize?.({settings:r,elem:t}),n=!0),e.show&&(o.setElementShow({settings:e,elem:t}),n=!0),a.applyVMLBackgroundToggle(t,e,"around"),n}function ju(e){return e.backgroundImage?.[0]?.value??""}function Gu(e,o){const t=o.activeElement;let n=!1;if(!e)return n;if(typeof e.linkHref=="string"){const i=document.querySelector("[em-edit]"),l=i?.tagName==="A"?i:i?.closest("a")??t.querySelector("a");l&&(l.setAttribute("href",e.linkHref),Lt(e.linkHref)&&l.removeAttribute("target"))}if(e.exportAsPicture?t.setAttribute("em-operation","exportAsPicture"):t.getAttribute("em-operation")==="exportAsPicture"&&t.removeAttribute("em-operation"),e.align){t.style.textAlign?t.style.textAlign=e.align:t.setAttribute("align",e.align);const i=t.querySelectorAll('[em="atom"]');i.length>0&&i.forEach(l=>{l.querySelector(":scope > tr > td")?.setAttribute("align",e.align);const s=l.querySelector('div[style*="font-family"][style*="font-size"]');s?.hasAttribute("align")&&s.setAttribute("align",e.align)})}else if(e.align===""){t.style.textAlign?t.style.removeProperty("text-align"):t.removeAttribute("align");const i=t.querySelectorAll('[em="atom"]');i.length>0&&i.forEach(s=>{s.querySelector(":scope > tr > td")?.removeAttribute("align")});const l=t.closest("table");if(l?.getAttribute("em")==="atom"){const s=l.querySelector('div[style*="font-family"][style*="font-size"]');s?.hasAttribute("align")&&s.removeAttribute("align")}}if(e.valign?(t.setAttribute("valign",e.valign),t.querySelectorAll('div[style*="display"]').forEach(i=>i.style.verticalAlign=e.valign)):e.valign===""&&t.removeAttribute("valign"),e.width){const i=t.closest("table");i?.getAttribute("em")==="atom"?e.width.value?i.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")):i.removeAttribute("width"):e.width.value?t.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")):t.removeAttribute("width")}if(e.height)if(e.height.value){t.setAttribute("height",e.height.value+(e.height.dim==="px"?"":"%")),t.style.height=e.height.value+e.height.dim;const i=t.firstElementChild;i?.tagName==="A"&&i.style.display==="block"&&(i.style.height=e.height.value+e.height.dim,i.style.lineHeight=e.height.value+e.height.dim)}else t.removeAttribute("height"),t.style.removeProperty("height");if(e.border&&o.setElementBorder({settings:e,elem:t}),e.boxShadow&&o.setElementBoxShadow({settings:e,elem:t}),e.backgroundColor!==void 0&&(e.backgroundColor===""?(t.removeAttribute("bgcolor"),t.style.removeProperty("background-color")):(t.setAttribute("bgcolor",e.backgroundColor),t.style.backgroundColor=e.backgroundColor)),e.backgroundImage&&(e.backgroundImage[0].value===""?(t.style.removeProperty("background-image"),t.removeAttribute("background")):(t.style.removeProperty("background-image"),t.style.backgroundImage=e.backgroundImage[0].type+"("+e.backgroundImage[0].value+")",a.setRenderedAttribute(t,"background",Xu(e)))),e.backgroundPositionX!==void 0&&(e.backgroundPositionX===""?t.style.removeProperty("background-position-x"):t.style.backgroundPositionX=e.backgroundPositionX),e.backgroundPositionY!==void 0&&(e.backgroundPositionY===""?t.style.removeProperty("background-position-y"):t.style.backgroundPositionY=e.backgroundPositionY),e.backgroundRepeat&&(e.backgroundRepeat==="none"?t.style.removeProperty("background-repeat"):t.style.backgroundRepeat=e.backgroundRepeat),e.backgroundSize!==void 0&&(e.backgroundSize===""?t.style.removeProperty("background-size"):t.style.backgroundSize=e.backgroundSize),e.direction&&e.direction!=="none"?(t.setAttribute("dir",e.direction),e.direction==="rtl"&&t.querySelectorAll("td").forEach(i=>{for(let l=i.firstChild;l;l=l.nextSibling)if(l.nodeType===3){l.parentNode?.setAttribute("dir","ltr");break}})):(e.direction===""||e.direction==="none")&&(t.removeAttribute("dir"),t.querySelectorAll("[dir]").forEach(i=>i.removeAttribute("dir"))),e.padding){if(e.padding.all!==void 0)t.style.paddingTop=e.padding.all+"px",t.style.paddingRight=e.padding.all+"px",t.style.paddingBottom=e.padding.all+"px",t.style.paddingLeft=e.padding.all+"px",t.querySelectorAll(".em-vindent").forEach(c=>c.remove());else{if(e.padding.top!==void 0){t.style.paddingTop=e.padding.top+"px";for(const c of t.children)c.classList.contains("em-vindent-paddingTop")&&c.remove()}if(e.padding.right!==void 0){t.style.paddingRight=e.padding.right+"px";for(const c of t.children)c.classList.contains("em-vindent-paddingRight")&&c.remove()}if(e.padding.bottom!==void 0){t.style.paddingBottom=e.padding.bottom+"px";for(const c of t.children)c.classList.contains("em-vindent-paddingBottom")&&c.remove()}if(e.padding.left!==void 0){t.style.paddingLeft=e.padding.left+"px";for(const c of t.children)c.classList.contains("em-vindent-paddingLeft")&&c.remove()}}const i=t.querySelector(".em-mob-wrap"),l=t.parentElement?.getAttribute("em")==="block",s=e.padding.left!==void 0||e.padding.right!==void 0;i&&l&&s&&t.querySelectorAll(":scope > table").forEach(c=>o.setStructureBlocksWidth(c))}if(e.borderRadius&&o.setElementBorderRadius({settings:e,elem:t}),o.textStyleProperties.some(i=>e.hasOwnProperty(i))&&!o.isElementListContainer)try{o.toggleTextStyle(t,{settings:e})}catch{}if(o.isElementListContainer&&o.requestType!=="structure"&&o.requestType!=="column"&&o.textStyleProperties.some(i=>e.hasOwnProperty(i))&&Ku(e,o),e.mobileWidth){const i=t.closest("table"),l=i?.getAttribute("em")==="atom";o.setElementMobileWidth({settings:e,elem:l?i:t}),n=!0}e.mobileHeight&&(o.setElementMobileHeight({settings:e,elem:t}),n=!0),e.mobileBorder&&(o.setElementMobileBorder({settings:e,elem:t}),n=!0),e.mobileBorderRadius&&(o.setElementMobileBorderRadius({settings:e,elem:t}),n=!0),e.mobileBoxShadow&&(o.setElementMobileBoxShadow({settings:e,elem:t}),n=!0),e.mobileAlign&&(Yu(e,t,o),n=!0),e.mobileVerticalAlign&&(o.setElementMobileVerticalAlign({settings:e,elem:t}),n=!0),e.mobileDirection&&(o.setElementMobileDirection({settings:e,elem:t}),n=!0),e.mobileBackgroundColor&&(o.setElementMobileBackgroundColor({settings:e,elem:t}),n=!0),e.mobileBackgroundImage&&(o.setElementMobileBackgroundImage({settings:e,elem:t}),n=!0),e.mobileBackgroundPositionX&&(o.setElementMobileBackgroundPositionX({settings:e,elem:t}),n=!0),e.mobileBackgroundPositionY&&(o.setElementMobileBackgroundPositionY({settings:e,elem:t}),n=!0),e.mobileBackgroundRepeat&&(o.setElementMobileBackgroundRepeat({settings:e,elem:t}),n=!0);const r=e;return r.mobileBackgroundSize&&(o.setElementMobileBackgroundSize?.({settings:r,elem:t}),n=!0),e.mobilePadding&&(o.setElementMobilePadding({settings:e,elem:t}),n=!0),e.show&&(o.setElementShow({settings:e,elem:t}),n=!0),"isContrastBlock"in e&&o.setContrastBlock({settings:e,elem:t}),a.applyVMLBackgroundToggle(t,e,"inside"),n}function Yu(e,o,t){t.setElementMobileAlign({settings:e,elem:o});const n=e.mobileAlign?.classNamePrefix||"em-mob-text_align-";rl(o,(l,s)=>{il(s,l,n),t.setElementMobileAlign({settings:e,elem:l})});function r(l){const s=l.querySelectorAll("table"),c=l.querySelector("table");s.length===1&&(c?.hasAttribute("width")&&c?.getAttribute("width")!=="100%"||!c?.hasAttribute("width"))&&t.setElementMobileTableAlign({elem:c,settings:{mobileAlign:{classNamePrefix:"em-mob-table_align-",value:e.mobileAlign.value}}})}const i=o.closest("table");i?.getAttribute("em")==="atom"?r(i):o.querySelectorAll('[em="atom"]').forEach(l=>r(l))}function Ku(e,o){const t=o.activeElement,n=o.removeEditorTags(o.isElementListContainer.outerHTML);t.innerHTML=`<td em-edit="active">${o.addClassToSecondCell(n,"em-list-temp-class")}</td>`;const r=window.getSelection();if(!r||r.rangeCount===0)return;let i=r.getRangeAt(0);const l=t.querySelectorAll(".em-list-temp-class");if(l.length>0){o.isProgrammaticSelection.value=!0;for(let s=0;s<l.length;s++){const c=l[s].querySelector("div");if(!c)continue;o.wrapEditor(c,!0),i=r.getRangeAt(0),i.selectNode(c),o.addNewRange(i);const d=c.innerHTML!=="&nbsp;"||c.innerHTML==="&nbsp;"&&(e.fontSize||e.textColor||e.lineHeight);if(o.textStyleProperties.some(u=>e.hasOwnProperty(u))&&d)try{o.toggleTextStyle(c,{settings:e})}catch{}}t.querySelectorAll(".em-list-temp-class").forEach(s=>s.classList.remove("em-list-temp-class")),t.removeAttribute("em-edit"),t.setAttribute("em-edit","active"),setTimeout(()=>{o.isProgrammaticSelection.value=!1},100),i=r.getRangeAt(0),i.selectNode(t),o.addNewRange(i)}}function Xu(e){return e.backgroundImage?.[0]?.value??""}function ln(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.textContent=e.elem.textContent.replace(/width=".*?"/gi,'width="'+e.width+'"'):e.elem.previousSibling&&ln({elem:e.elem.previousSibling,width:e.width})}function fi(e,o){let t=e.previousSibling;for(;t&&!(t.nodeName==="#comment"&&t.textContent?.includes("mso"));)t=t.previousSibling;const n=t?.textContent??"",r=n.lastIndexOf("<td");if(!t||r===-1)return;const i=n.slice(r),l=/\svalign="[^"]*"/i.test(i)?i.replace(/valign="[^"]*"/i,`valign="${o}"`):i.replace("<td",`<td valign="${o}"`);t.textContent=n.slice(0,r)+l}function Zu(e,o){const t=o.activeElement;let n=!1;if(!e)return n;if(e.width){const r=e.gap?.value??0;if(e.width.value!==void 0&&e.width.value!==null)if(t.style.maxWidth)if(e.width.dim==="px"){const i=parseFloat(e.width.value+r),l=Math.round(parseFloat(e.width.value)/i*100);t.style.maxWidth=i+e.width.dim,ln({elem:t,width:i}),t.firstElementChild?.tagName==="TABLE"&&(t.firstElementChild.setAttribute("width",e.width.value),t.firstElementChild.style.width=l+"%",t.firstElementChild.style.maxWidth=e.width.value+"px")}else t.style.width=parseFloat(e.width.value)+e.width.dim;else e.width.dim==="px"?(t.style.width=parseFloat(e.width.value+r)+e.width.dim,ln({elem:t,width:parseFloat(e.width.value+r)}),t.firstElementChild?.tagName==="TABLE"&&t.firstElementChild.setAttribute("width",e.width.value)):t.style.width=parseFloat(e.width.value)+e.width.dim;else t.style.removeProperty("width")}if(e.gap&&!e.width){const r=parseFloat(e.gap.value??0);t.style.maxWidth?t.parentElement?.querySelectorAll('div[style*="inline-block"]').forEach(i=>{const l=i,s=parseFloat(l.style.maxWidth),c=Math.round((s-r)/s*100);l.firstElementChild?.tagName==="TABLE"&&(l.firstElementChild.setAttribute("width",String(s-r)),l.firstElementChild.style.width=c+"%",l.firstElementChild.style.maxWidth=s-r+"px")}):t.parentElement?.querySelectorAll('div[style*="inline-block"]').forEach(i=>{const l=i;l.firstElementChild?.tagName==="TABLE"&&l.firstElementChild.setAttribute("width",String(parseFloat(l.style.width)-r))})}return e.valign&&(t.style.verticalAlign=e.valign,fi(t,t.style.verticalAlign)),e.mobileWidth&&(o.setElementMobileWidth({settings:e,elem:t}),n=!0),e.mobileContentWidth&&(o.setElementMobileContentWidth({settings:e,elem:t.firstElementChild}),n=!0),e.mobileVerticalAlign&&(o.setElementMobileVerticalAlign({settings:e,elem:t}),n=!0),e.show&&(o.setElementShow({settings:e,elem:t}),n=!0),n}function an(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.textContent=e.elem.textContent.replace(/width=".*?"/gi,'width="'+e.width+'"'):e.elem.previousSibling&&an({elem:e.elem.previousSibling,width:e.width})}function fo(e){return!!(e.querySelector(".em-mob-wrap")||e.closest(".em-mob-wrap")||e.querySelector(".noresp-em-mob-wrap")||e.closest(".noresp-em-mob-wrap"))}function po(e){return e.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?document.querySelector('[em-edit="active"]'):e.closest(".em-mob-wrap, .noresp-em-mob-wrap")?.parentElement||null}function sn(e){return e.querySelector('div[style*="inline-block"]')?document.querySelector('[em-edit="active"]'):e.closest('div[style*="inline-block"]')?.parentElement||null}function Ju(e,o){const t=o.activeElement;if(fo(t)){const n=po(t);if(!n)return;n.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach((r,i)=>{r.setAttribute("width",e.items[i])}),o.setPercentsForColumns(n.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)"))}else{const n=sn(t);if(!n)return;n.querySelectorAll('div[style*="inline-block"]').forEach((r,i)=>{const l=r;l.style.width=e.items[i]+e.gap+"px",an({elem:l.closest('div[style*="inline-block"]'),width:e.items[i]+e.gap}),l.firstElementChild?.tagName==="TABLE"&&l.firstElementChild.setAttribute("width",e.items[i])})}}function Qu(e,o){const t=o.activeElement;if(!fo(t))return;const n=t.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?t.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?.parentElement:t.closest(".em-mob-wrap, .noresp-em-mob-wrap")?.parentElement;if(!n)return;const r=n.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)"),i=r.length,l=e.items.length,s=e.gap;i>=l?r.forEach((c,d)=>{if(d<l)c.setAttribute("width",e.items[d]);else{const u=c.previousElementSibling;(u?.classList.contains("em-mob-wrap")||u?.classList.contains("noresp-em-mob-wrap"))&&u?.remove(),c.remove()}}):(r.forEach((c,d)=>{c.setAttribute("width",e.items[d])}),e.items.forEach((c,d)=>{let u="";n.querySelector(".em-mob-wrap")?u=`<td width="${s}" class="em-mob-wrap"></td>
267
+ `,g.querySelectorAll('tr[em="block"]').forEach(m=>m.removeAttribute("em")),s.insertAdjacentElement("afterend",g)}else o.insertAdjacentHTML(s,"afterend",r);d=!0}c=s?.nextSibling}return d&&!document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]')&&document.documentElement.scrollHeight+(o.iframeOffsetTop||0)>(o.previewHeight||0)&&c&&o.messageService.send({operation:"application_scroll-to",settings:{value:c.getBoundingClientRect().top+c.getBoundingClientRect().height}}),d}function Ou(e,o){if(!o.lockEditor&&di(e.atomHTML).trim())try{o.state.increment("activeElementLocked"),o.setAtomReplaced?.(null),a.setPendingPaletteInsert({kind:"atom",settings:e}),e.action!=="insert"&&document.body.classList.add("em-atom-insert-body"),e.action==="insert"&&Hu(e,o)&&Mu(e.name,o),o.commit()}catch{}finally{Promise.resolve().then(()=>o.state.decrement("activeElementLocked"))}}function xu(e){return e.replace(/["\\]/g,"\\$&")}function Du(e,o){if(o.lockEditor)return 0;const t=e.emBlockId;if(!t||!e.blockHTML?.trim())return 0;const n=`[em="block"][em-block-id="${xu(String(t))}"]`,r=Array.from(document.querySelectorAll(n));if(!r.length)return 0;let i=0;try{o.state.increment("activeElementLocked");for(const l of r)mi({action:"insert",blockHTML:e.blockHTML,type:e.type,project:e.project,name:e.name},o,l)&&(l.remove(),i+=1);o.commit()}finally{Promise.resolve().then(()=>o.state.decrement("activeElementLocked"))}return i}function Fu(e,o){if(!o.lockEditor&&e.blockHTML?.trim())try{o.state.increment("activeElementLocked"),a.setPendingPaletteInsert({kind:"block",settings:e}),document.body.classList.add("em-block-insert-body"),e.action==="insert"&&mi(e,o)&&Ru(e,o),o.commit()}finally{Promise.resolve().then(()=>o.state.decrement("activeElementLocked"))}}function ui(e,o){const t=JSON.stringify({settings:o});return{target:e,dataTransfer:{getData:n=>n==="Text"?t:""},preventDefault:()=>{},stopPropagation:()=>{}}}function qu(e){return!e.closest(".em-element-editor-widget")}function Wu(e,o){if(o.lockEditor)return!1;const t=a.getPendingPaletteInsert();if(!t)return!1;const n=e.target;if(!(n instanceof HTMLElement)||!qu(n))return!1;try{if(t.kind==="atom"){const r={settings:{atomHTML:typeof t.settings.atomHTML=="string"?t.settings.atomHTML:t.settings.atomHTML?.html,name:t.settings.name}};if(!r.settings.atomHTML)return!1;zn(ui(n,r.settings),o.atomDropCtx)}else if(t.kind==="block"&&document.body.classList.contains("em-block-insert-body")){const r={settings:{blockHTML:t.settings.blockHTML,type:t.settings.type,name:t.settings.name,project:t.settings.project,blockId:t.settings.blockId}};if(!r.settings.blockHTML)return!1;Wn(ui(n,r.settings),r,o.blockDropCtx)}else return!1;if(!a.getPendingPaletteInsert())return e.preventDefault(),e.stopPropagation(),to(),o.commit(),!0}catch{return!1}return!1}function $u(e,o,t){t.state.update({iframeOffsetTop:e.iframeOffsetTop,scrollTop:e.scrollTop,previewHeight:e.previewHeight,applicationMode:e.mode}),typeof o<"u"&&t.state.set("codeMode",e.mode==="code");const n=document.querySelector(".em-element-path");n&&(n.style.top=t.previewHeight-t.iframeOffsetTop-65+t.scrollTop+"px");const r=document.querySelector(".em-editor-wrapper");r&&r.style.display==="none"?t.setBlockGroupControlsPosition():setTimeout(()=>{t.setBlockGroupControlsPosition()},400)}function zu(e,o){document.documentElement.removeAttribute("style");const t=o.globalHolder?.querySelector("table:first-child");if(t&&t.offsetWidth>=e.iframeWidth-2&&o.globalHolder){document.documentElement.style.overflowX="visible",document.documentElement.style.height="100%",document.documentElement.style.transformOrigin="left top";const n=e.iframeWidth/o.globalHolder.offsetWidth;document.documentElement.style.transform="scale("+(n<1?n:1)+")",document.querySelector(".em-narrow-table")&&e.iframeWidth>370&&o.messageService.send({operation:"application_preview_alert_show",settings:{show:n<.9}})}setTimeout(()=>{o.messageService.send({operation:"application_iframe_set_height",settings:{height:document.body.getBoundingClientRect().height}})},300)}function Vu(e,o){const{activeElement:t}=o;let n=!1;if(!e)return n;const r=t.closest("a"),i=t.closest("td"),l=i?a.findRoundrectComment(i):null,s=r?a.findRoundrectComment(r):null,c=!!l&&!s,d=a.hasForeignButtonStructure(r),u=e.outlookRounding===!0||e.outlookRounding!==!1&&(c||d)?r:i;if(e.exportAsPicture?t.closest("table")?.setAttribute("em-operation","exportAsPicture"):t?.closest("table")?.getAttribute("em-operation")==="exportAsPicture"&&t.closest("table")?.removeAttribute("em-operation"),e.href!==void 0&&t.closest("a")?.setAttribute("href",e.href),e.align){const p=t.closest("td")?.closest("table")?.closest("div, p, td");p&&(p.style.textAlign?p.style.textAlign=e.align:p.setAttribute("align",e.align))}else if(e.align===""){const p=t.closest("td")?.closest("table")?.closest("div, p, td");p&&(p.style.textAlign?p.style.removeProperty("text-align"):p.removeAttribute("align"))}if(e.textAlign){const p=t.closest("td");p&&(p.style.textAlign?p.style.textAlign=e.textAlign:p.setAttribute("align",e.textAlign))}else if(e.textAlign===""){const p=t.closest("td");p&&(p.style.textAlign?p.style.removeProperty("text-align"):p.removeAttribute("align"))}if(e.valign?t.closest("td")?.closest("table")?.closest("td")?.setAttribute("valign",e.valign):e.valign===""&&t.closest("td")?.closest("table")?.closest("td")?.removeAttribute("valign"),e.width){const p=t.closest("table");p&&(e.width.value?(p.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")),p.style.width=e.width.value+e.width.dim):(p.removeAttribute("width"),p.style.removeProperty("width")))}if(e.height){const p=t.closest("td"),b=t.closest("a");if(e.height.value){if(p&&(p.setAttribute("height",e.height.value+(e.height.dim==="px"?"":"%")),p.style.height=e.height.value+e.height.dim),b){const h=e.height.value+e.height.dim;b.style.height=h,b.style.lineHeight=h,b.firstElementChild&&(b.firstElementChild.style.lineHeight=h);const y=b.closest("editor")||b.querySelector("editor");y&&(y.style.height=h,y.style.lineHeight=h)}}else if(p&&(p.removeAttribute("height"),p.style.removeProperty("height")),b){b.style.removeProperty("height"),b.style.removeProperty("line-height");const h=b.closest("editor")||b.querySelector("editor");h&&(h.style.removeProperty("height"),h.style.removeProperty("line-height"))}}if(e.border&&u&&o.setElementBorder({settings:e,elem:u}),e.boxShadow&&u&&o.setElementBoxShadow({settings:e,elem:u}),e.backgroundColor!==void 0&&u&&(e.backgroundColor===""?(u.removeAttribute("bgcolor"),u.style.removeProperty("background-color")):(u.tagName==="TD"&&u.setAttribute("bgcolor",e.backgroundColor),u.style.backgroundColor=e.backgroundColor)),e.backgroundImage){const p=t.closest("td");p&&(e.backgroundImage[0].value===""?(p.style.removeProperty("background-image"),p.removeAttribute("background")):(p.style.removeProperty("background-image"),a.setRenderedAttribute(p,"background",ju(e))))}if(e.backgroundPositionX!==void 0){const p=t.closest("td");p&&(e.backgroundPositionX===""?p.style.removeProperty("background-position-x"):p.style.backgroundPositionX=e.backgroundPositionX)}if(e.backgroundPositionY!==void 0){const p=t.closest("td");p&&(e.backgroundPositionY===""?p.style.removeProperty("background-position-y"):p.style.backgroundPositionY=e.backgroundPositionY)}if(e.backgroundRepeat){const p=t.closest("td");p&&(e.backgroundRepeat==="none"?p.style.removeProperty("background-repeat"):p.style.backgroundRepeat=e.backgroundRepeat)}if(e.backgroundSize!==void 0){const p=t.closest("td");p&&(e.backgroundSize===""?p.style.removeProperty("background-size"):p.style.backgroundSize=e.backgroundSize)}if(e.padding){const p=t.closest("a");p&&(e.padding.all!==void 0?(p.style.paddingTop=e.padding.all+"px",p.style.paddingRight=e.padding.all+"px",p.style.paddingBottom=e.padding.all+"px",p.style.paddingLeft=e.padding.all+"px"):(e.padding.top!==void 0&&(p.style.paddingTop=e.padding.top+"px"),e.padding.right!==void 0&&(p.style.paddingRight=e.padding.right+"px"),e.padding.bottom!==void 0&&(p.style.paddingBottom=e.padding.bottom+"px"),e.padding.left!==void 0&&(p.style.paddingLeft=e.padding.left+"px")))}if(e.borderRadius&&u&&o.setElementBorderRadius({settings:e,elem:u}),e.mobileWidth){const p=t.closest("table");p&&o.setElementMobileWidth({settings:e,elem:p}),n=!0}if(e.mobileHeight){const p=t.closest("td");p&&o.setElementMobileHeight({settings:e,elem:p}),o.setElementMobileLineHeight({settings:e,elem:t}),n=!0}if(e.mobileBorder){const p=t.closest("td");p&&o.setElementMobileBorder({settings:e,elem:p}),n=!0}if(e.mobileBorderRadius){const p=t.closest("td");p&&o.setElementMobileBorderRadius({settings:e,elem:p}),n=!0}if(e.mobileBoxShadow){const p=t.closest("td");p&&o.setElementMobileBoxShadow({settings:e,elem:p}),n=!0}if(e.mobileTextAlign){const p=Tt(t);p&&o.setElementMobileAlign({settings:e,elem:p,fieldName:"mobileTextAlign"}),n=!0}if(e.mobileAlign){const p=t.closest("td")?.closest("table");p&&o.setElementMobileTableAlign({settings:e,elem:p}),n=!0}if(e.mobileVerticalAlign){const p=t.closest("td");p&&o.setElementMobileVerticalAlign({settings:e,elem:p}),n=!0}if(e.mobileBackgroundColor){const p=t.closest("td");p&&o.setElementMobileBackgroundColor({settings:e,elem:p}),n=!0}if(e.mobileBackgroundImage){const p=t.closest("td");p&&o.setElementMobileBackgroundImage({settings:e,elem:p}),n=!0}if(e.mobileBackgroundPositionX){const p=t.closest("td");p&&o.setElementMobileBackgroundPositionX({settings:e,elem:p}),n=!0}if(e.mobileBackgroundPositionY){const p=t.closest("td");p&&o.setElementMobileBackgroundPositionY({settings:e,elem:p}),n=!0}if(e.mobileBackgroundRepeat){const p=t.closest("td");p&&o.setElementMobileBackgroundRepeat({settings:e,elem:p}),n=!0}const g=e;if(g.mobileBackgroundSize){const p=t.closest("td");p&&o.setElementMobileBackgroundSize?.({settings:g,elem:p}),n=!0}if(e.mobilePadding&&(o.setElementMobilePadding({settings:e,elem:t}),n=!0),e.show){const p=t.closest("table");p&&o.setElementShow({settings:e,elem:p}),n=!0}const m=t.closest("a");if(m&&e.textColor!==void 0){const p=String(e.textColor||"");m.style.color=p,m.querySelectorAll('span[style*="color"], font[color]').forEach(b=>{b.style.removeProperty("color"),b.removeAttribute("color")})}if(m&&e.textBackgroundColor!==void 0){const p=String(e.textBackgroundColor||"");m.style.backgroundColor=p,m.querySelectorAll('span[style*="background-color"]').forEach(b=>{b.style.removeProperty("background-color")})}const f=["textColor","textBackgroundColor"];if(o.textStyleProperties.filter(p=>!f.includes(p)&&e.hasOwnProperty(p)).length>0)try{o.toggleTextStyle(t,{settings:e})}catch{}return e.mobileFontSize&&(o.setElementMobileFontSize({settings:e,elem:t}),n=!0),e.textReplacer!==void 0&&Uu(e.textReplacer,t,o.compareStrings),e.outlookRounding===!0?a.syncButtonVML(t,e):e.outlookRounding===!1?a.stripButtonVML(t):(l||d)&&a.syncButtonVML(t,e),i&&a.applyVMLBackgroundToggle(i,e,"inside"),n}function Uu(e,o,t){if(e){const n=window.getSelection();if(!n||n.rangeCount===0)return;const r=n.getRangeAt(0),i=e.replace(/~~.*$/,""),l=r?.commonAncestorContainer,s=l?.nodeType===1?l:l.parentElement;let c=s?.closest("em-replace");const d=!!(/~~/.test(e)&&c);if(d&&s){const u=e.replace(/~~.*$/,"");s.setAttribute("text",u),s.innerHTML=u}if(!c&&n.rangeCount>0&&!r.collapsed){const u=document.querySelectorAll("em-replace");if(c=Array.prototype.find.call(u,g=>g.textContent?.trim()===n.toString().trim()&&n.toString().trim()!==""),!c){const g=document.querySelector('[em-edit="active"]');g?.textContent===r.toString()&&r.selectNodeContents(g);const m=e.replace(/~~.*$/,""),f=document.createElement("em-replace");f.setAttribute("text",m),r.surroundContents(f)}}if(!c&&n.rangeCount>0&&r.collapsed){let u=document.querySelector("em-replace");if(u){const g=document.querySelectorAll("em-replace"),m=/~$/;c=Array.prototype.find.call(g,f=>{const p=e,b=f.textContent||"";return p.length===1&&m.test(b)?!0:t(b,p)}),c&&(c.setAttribute("text",e),c.textContent=e),c||(u=document.createElement("em-replace"),u.setAttribute("text",i),r.insertNode(u),u.innerHTML=i,r.collapse())}else u=document.createElement("em-replace"),u.setAttribute("text",i),r.insertNode(u),u.innerHTML=i,r.collapse()}c&&!d&&(c.getAttribute("text")===c.innerHTML&&(c.innerHTML=e),c.setAttribute("text",e))}else if(e===""){const n=o?.closest("em-replace")||o?.querySelector("em-replace");if(n){const r=n.parentNode,i=n.firstChild,l=n.lastChild;if(n.getAttribute("text")!==n.innerHTML&&r)for(;n.firstChild;)r.insertBefore(n.firstChild,n);const s=document.createRange(),c=window.getSelection();i&&l&&c&&(s.setStartBefore(i),s.setEndAfter(l),c.removeAllRanges(),c.addRange(s)),n.remove()}}}function ju(e){return e.backgroundImage?.[0]?.value??""}function Gu(e,o){const t=o.activeElement;let n=!1;if(!e)return n;e.exportAsPicture?t.setAttribute("em-operation","exportAsPicture"):t.getAttribute("em-operation")==="exportAsPicture"&&t.removeAttribute("em-operation"),e.align?t.style.textAlign?t.style.textAlign=e.align:t.setAttribute("align",e.align):e.align===""&&(t.style.textAlign?t.style.removeProperty("text-align"):t.removeAttribute("align")),e.valign?t.style.verticalAlign=e.valign:e.valign===""&&t.style.removeProperty("vertical-align"),e.width&&(e.width.value?t.style.width=e.width.value+e.width.dim:t.style.removeProperty("width")),e.minWidth&&(e.minWidth.value?t.style.minWidth=e.minWidth.value+e.minWidth.dim:t.style.removeProperty("min-width")),e.maxWidth&&(e.maxWidth.value?t.style.maxWidth=e.maxWidth.value+e.maxWidth.dim:t.style.removeProperty("max-width")),e.height&&(e.height.value?t.style.height=e.height.value+e.height.dim:t.style.removeProperty("height")),e.border&&o.setElementBorder({settings:e,elem:t}),e.boxShadow&&o.setElementBoxShadow({settings:e,elem:t}),e.backgroundColor!==void 0&&(e.backgroundColor===""?t.style.removeProperty("background-color"):t.style.backgroundColor=e.backgroundColor),e.backgroundImage&&(e.backgroundImage[0].value===""?t.style.removeProperty("background-image"):t.style.backgroundImage=e.backgroundImage[0].type+"("+e.backgroundImage[0].value+")"),e.backgroundPositionX!==void 0&&(e.backgroundPositionX===""?t.style.removeProperty("background-position-x"):t.style.backgroundPositionX=e.backgroundPositionX),e.backgroundPositionY!==void 0&&(e.backgroundPositionY===""?t.style.removeProperty("background-position-y"):t.style.backgroundPositionY=e.backgroundPositionY),e.backgroundRepeat&&(e.backgroundRepeat==="none"?t.style.removeProperty("background-repeat"):t.style.backgroundRepeat=e.backgroundRepeat),e.backgroundSize!==void 0&&(e.backgroundSize===""?t.style.removeProperty("background-size"):t.style.backgroundSize=e.backgroundSize),e.padding&&(e.padding.all!==void 0?(t.style.paddingTop=e.padding.all+"px",t.style.paddingRight=e.padding.all+"px",t.style.paddingBottom=e.padding.all+"px",t.style.paddingLeft=e.padding.all+"px"):(e.padding.top&&(t.style.paddingTop=e.padding.top+"px"),e.padding.right&&(t.style.paddingRight=e.padding.right+"px"),e.padding.bottom&&(t.style.paddingBottom=e.padding.bottom+"px"),e.padding.left&&(t.style.paddingLeft=e.padding.left+"px"))),e.borderRadius&&o.setElementBorderRadius({settings:e,elem:t}),e.mobileWidth&&(o.setElementMobileWidth({settings:e,elem:t}),n=!0),e.mobileHeight&&(o.setElementMobileHeight({settings:e,elem:t}),n=!0),e.mobileBorder&&(o.setElementMobileBorder({settings:e,elem:t}),n=!0),e.mobileBorderRadius&&(o.setElementMobileBorderRadius({settings:e,elem:t}),n=!0),e.mobileBoxShadow&&(o.setElementMobileBoxShadow({settings:e,elem:t}),n=!0),e.mobileAlign&&(o.setElementMobileAlign({settings:e,elem:t}),n=!0),e.mobileVerticalAlign&&(o.setElementMobileVerticalAlign({settings:e,elem:t}),n=!0),e.mobileDirection&&(o.setElementMobileDirection({settings:e,elem:t}),n=!0),e.mobileBackgroundColor&&(o.setElementMobileBackgroundColor({settings:e,elem:t}),n=!0),e.mobileBackgroundImage&&(o.setElementMobileBackgroundImage({settings:e,elem:t}),n=!0),e.mobileBackgroundPositionX&&(o.setElementMobileBackgroundPositionX({settings:e,elem:t}),n=!0),e.mobileBackgroundPositionY&&(o.setElementMobileBackgroundPositionY({settings:e,elem:t}),n=!0),e.mobileBackgroundRepeat&&(o.setElementMobileBackgroundRepeat({settings:e,elem:t}),n=!0);const r=e;return r.mobileBackgroundSize&&(o.setElementMobileBackgroundSize?.({settings:r,elem:t}),n=!0),e.mobilePadding&&(o.setElementMobilePadding({settings:e,elem:t}),n=!0),e.show&&(o.setElementShow({settings:e,elem:t}),n=!0),a.applyVMLBackgroundToggle(t,e,"inside"),n}function rn(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.textContent=e.elem.textContent.replaceAll(/width=".*"/gi,'width="'+e.width+'"'):e.elem.previousSibling&&rn({elem:e.elem.previousSibling,width:e.width})}function Yu(e,o){const t=o.activeElement;let n=!1;if(!e)return n;e.exportAsPicture?t.setAttribute("em-operation","exportAsPicture"):t.getAttribute("em-operation")==="exportAsPicture"&&t.removeAttribute("em-operation"),e.align?t.setAttribute("align",e.align):e.align===""&&t.removeAttribute("align"),e.width&&(e.width.value?(t.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")),t.style.width=e.width.value+e.width.dim,e.width.dim==="px"&&rn({elem:t,width:e.width.value})):(t.removeAttribute("width"),t.style.removeProperty("width"))),e.maxWidth&&(e.maxWidth.value?(t.style.maxWidth=e.maxWidth.value+e.maxWidth.dim,rn({elem:t,width:e.maxWidth.value})):t.style.removeProperty("max-width")),e.minWidth&&(e.minWidth.value?t.style.minWidth=e.minWidth.value+e.minWidth.dim:t.style.removeProperty("min-width")),e.border&&o.setElementBorder({settings:e,elem:t}),e.boxShadow&&o.setElementBoxShadow({settings:e,elem:t}),e.backgroundColor!==void 0&&(e.backgroundColor===""?(t.removeAttribute("bgcolor"),t.style.removeProperty("background-color")):(t.setAttribute("bgcolor",e.backgroundColor),t.style.backgroundColor=e.backgroundColor)),e.backgroundImage&&(e.backgroundImage[0].value===""?(t.style.removeProperty("background-image"),t.removeAttribute("background")):(t.style.removeProperty("background-image"),t.style.backgroundImage=e.backgroundImage[0].type+"("+e.backgroundImage[0].value+")",a.setRenderedAttribute(t,"background",Ku(e)))),e.backgroundPositionX!==void 0&&(e.backgroundPositionX===""?t.style.removeProperty("background-position-x"):t.style.backgroundPositionX=e.backgroundPositionX),e.backgroundPositionY!==void 0&&(e.backgroundPositionY===""?t.style.removeProperty("background-position-y"):t.style.backgroundPositionY=e.backgroundPositionY),e.backgroundRepeat&&(e.backgroundRepeat==="none"?t.style.removeProperty("background-repeat"):t.style.backgroundRepeat=e.backgroundRepeat),e.backgroundSize!==void 0&&(e.backgroundSize===""?t.style.removeProperty("background-size"):t.style.backgroundSize=e.backgroundSize),e.borderRadius&&o.setElementBorderRadius({settings:e,elem:t}),e.mobileAlign&&(o.setElementMobileTableAlign({settings:e,elem:t}),n=!0),e.mobileWidth&&(o.setElementMobileWidth({settings:e,elem:t}),n=!0),e.mobileBorder&&(o.setElementMobileBorder({settings:e,elem:t}),n=!0),e.mobileBorderRadius&&(o.setElementMobileBorderRadius({settings:e,elem:t}),n=!0),e.mobileBoxShadow&&(o.setElementMobileBoxShadow({settings:e,elem:t}),n=!0),e.mobileBackgroundColor&&(o.setElementMobileBackgroundColor({settings:e,elem:t}),n=!0),e.mobileBackgroundImage&&(o.setElementMobileBackgroundImage({settings:e,elem:t}),n=!0),e.mobileBackgroundPositionX&&(o.setElementMobileBackgroundPositionX({settings:e,elem:t}),n=!0),e.mobileBackgroundPositionY&&(o.setElementMobileBackgroundPositionY({settings:e,elem:t}),n=!0),e.mobileBackgroundRepeat&&(o.setElementMobileBackgroundRepeat({settings:e,elem:t}),n=!0);const r=e;return r.mobileBackgroundSize&&(o.setElementMobileBackgroundSize?.({settings:r,elem:t}),n=!0),e.show&&(o.setElementShow({settings:e,elem:t}),n=!0),a.applyVMLBackgroundToggle(t,e,"around"),n}function Ku(e){return e.backgroundImage?.[0]?.value??""}function Xu(e,o){const t=o.activeElement;let n=!1;if(!e)return n;if(typeof e.linkHref=="string"){const i=document.querySelector("[em-edit]"),l=i?.tagName==="A"?i:i?.closest("a")??t.querySelector("a");l&&(l.setAttribute("href",e.linkHref),Lt(e.linkHref)&&l.removeAttribute("target"))}if(e.exportAsPicture?t.setAttribute("em-operation","exportAsPicture"):t.getAttribute("em-operation")==="exportAsPicture"&&t.removeAttribute("em-operation"),e.align){t.style.textAlign?t.style.textAlign=e.align:t.setAttribute("align",e.align);const i=t.querySelectorAll('[em="atom"]');i.length>0&&i.forEach(l=>{l.querySelector(":scope > tr > td")?.setAttribute("align",e.align);const s=l.querySelector('div[style*="font-family"][style*="font-size"]');s?.hasAttribute("align")&&s.setAttribute("align",e.align)})}else if(e.align===""){t.style.textAlign?t.style.removeProperty("text-align"):t.removeAttribute("align");const i=t.querySelectorAll('[em="atom"]');i.length>0&&i.forEach(s=>{s.querySelector(":scope > tr > td")?.removeAttribute("align")});const l=t.closest("table");if(l?.getAttribute("em")==="atom"){const s=l.querySelector('div[style*="font-family"][style*="font-size"]');s?.hasAttribute("align")&&s.removeAttribute("align")}}if(e.valign?(t.setAttribute("valign",e.valign),t.querySelectorAll('div[style*="display"]').forEach(i=>i.style.verticalAlign=e.valign)):e.valign===""&&t.removeAttribute("valign"),e.width){const i=t.closest("table");i?.getAttribute("em")==="atom"?e.width.value?i.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")):i.removeAttribute("width"):e.width.value?t.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")):t.removeAttribute("width")}if(e.height)if(e.height.value){t.setAttribute("height",e.height.value+(e.height.dim==="px"?"":"%")),t.style.height=e.height.value+e.height.dim;const i=t.firstElementChild;i?.tagName==="A"&&i.style.display==="block"&&(i.style.height=e.height.value+e.height.dim,i.style.lineHeight=e.height.value+e.height.dim)}else t.removeAttribute("height"),t.style.removeProperty("height");if(e.border&&o.setElementBorder({settings:e,elem:t}),e.boxShadow&&o.setElementBoxShadow({settings:e,elem:t}),e.backgroundColor!==void 0&&(e.backgroundColor===""?(t.removeAttribute("bgcolor"),t.style.removeProperty("background-color")):(t.setAttribute("bgcolor",e.backgroundColor),t.style.backgroundColor=e.backgroundColor)),e.backgroundImage&&(e.backgroundImage[0].value===""?(t.style.removeProperty("background-image"),t.removeAttribute("background")):(t.style.removeProperty("background-image"),t.style.backgroundImage=e.backgroundImage[0].type+"("+e.backgroundImage[0].value+")",a.setRenderedAttribute(t,"background",Qu(e)))),e.backgroundPositionX!==void 0&&(e.backgroundPositionX===""?t.style.removeProperty("background-position-x"):t.style.backgroundPositionX=e.backgroundPositionX),e.backgroundPositionY!==void 0&&(e.backgroundPositionY===""?t.style.removeProperty("background-position-y"):t.style.backgroundPositionY=e.backgroundPositionY),e.backgroundRepeat&&(e.backgroundRepeat==="none"?t.style.removeProperty("background-repeat"):t.style.backgroundRepeat=e.backgroundRepeat),e.backgroundSize!==void 0&&(e.backgroundSize===""?t.style.removeProperty("background-size"):t.style.backgroundSize=e.backgroundSize),e.direction&&e.direction!=="none"?(t.setAttribute("dir",e.direction),e.direction==="rtl"&&t.querySelectorAll("td").forEach(i=>{for(let l=i.firstChild;l;l=l.nextSibling)if(l.nodeType===3){l.parentNode?.setAttribute("dir","ltr");break}})):(e.direction===""||e.direction==="none")&&(t.removeAttribute("dir"),t.querySelectorAll("[dir]").forEach(i=>i.removeAttribute("dir"))),e.padding){if(e.padding.all!==void 0)t.style.paddingTop=e.padding.all+"px",t.style.paddingRight=e.padding.all+"px",t.style.paddingBottom=e.padding.all+"px",t.style.paddingLeft=e.padding.all+"px",t.querySelectorAll(".em-vindent").forEach(c=>c.remove());else{if(e.padding.top!==void 0){t.style.paddingTop=e.padding.top+"px";for(const c of t.children)c.classList.contains("em-vindent-paddingTop")&&c.remove()}if(e.padding.right!==void 0){t.style.paddingRight=e.padding.right+"px";for(const c of t.children)c.classList.contains("em-vindent-paddingRight")&&c.remove()}if(e.padding.bottom!==void 0){t.style.paddingBottom=e.padding.bottom+"px";for(const c of t.children)c.classList.contains("em-vindent-paddingBottom")&&c.remove()}if(e.padding.left!==void 0){t.style.paddingLeft=e.padding.left+"px";for(const c of t.children)c.classList.contains("em-vindent-paddingLeft")&&c.remove()}}const i=t.querySelector(".em-mob-wrap"),l=t.parentElement?.getAttribute("em")==="block",s=e.padding.left!==void 0||e.padding.right!==void 0;i&&l&&s&&t.querySelectorAll(":scope > table").forEach(c=>o.setStructureBlocksWidth(c))}if(e.borderRadius&&o.setElementBorderRadius({settings:e,elem:t}),o.textStyleProperties.some(i=>e.hasOwnProperty(i))&&!o.isElementListContainer)try{o.toggleTextStyle(t,{settings:e})}catch{}if(o.isElementListContainer&&o.requestType!=="structure"&&o.requestType!=="column"&&o.textStyleProperties.some(i=>e.hasOwnProperty(i))&&Ju(e,o),e.mobileWidth){const i=t.closest("table"),l=i?.getAttribute("em")==="atom";o.setElementMobileWidth({settings:e,elem:l?i:t}),n=!0}e.mobileHeight&&(o.setElementMobileHeight({settings:e,elem:t}),n=!0),e.mobileBorder&&(o.setElementMobileBorder({settings:e,elem:t}),n=!0),e.mobileBorderRadius&&(o.setElementMobileBorderRadius({settings:e,elem:t}),n=!0),e.mobileBoxShadow&&(o.setElementMobileBoxShadow({settings:e,elem:t}),n=!0),e.mobileAlign&&(Zu(e,t,o),n=!0),e.mobileVerticalAlign&&(o.setElementMobileVerticalAlign({settings:e,elem:t}),n=!0),e.mobileDirection&&(o.setElementMobileDirection({settings:e,elem:t}),n=!0),e.mobileBackgroundColor&&(o.setElementMobileBackgroundColor({settings:e,elem:t}),n=!0),e.mobileBackgroundImage&&(o.setElementMobileBackgroundImage({settings:e,elem:t}),n=!0),e.mobileBackgroundPositionX&&(o.setElementMobileBackgroundPositionX({settings:e,elem:t}),n=!0),e.mobileBackgroundPositionY&&(o.setElementMobileBackgroundPositionY({settings:e,elem:t}),n=!0),e.mobileBackgroundRepeat&&(o.setElementMobileBackgroundRepeat({settings:e,elem:t}),n=!0);const r=e;return r.mobileBackgroundSize&&(o.setElementMobileBackgroundSize?.({settings:r,elem:t}),n=!0),e.mobilePadding&&(o.setElementMobilePadding({settings:e,elem:t}),n=!0),e.show&&(o.setElementShow({settings:e,elem:t}),n=!0),"isContrastBlock"in e&&o.setContrastBlock({settings:e,elem:t}),a.applyVMLBackgroundToggle(t,e,"inside"),n}function Zu(e,o,t){t.setElementMobileAlign({settings:e,elem:o});const n=e.mobileAlign?.classNamePrefix||"em-mob-text_align-";ll(o,(l,s)=>{al(s,l,n),t.setElementMobileAlign({settings:e,elem:l})});function r(l){const s=l.querySelectorAll("table"),c=l.querySelector("table");s.length===1&&(c?.hasAttribute("width")&&c?.getAttribute("width")!=="100%"||!c?.hasAttribute("width"))&&t.setElementMobileTableAlign({elem:c,settings:{mobileAlign:{classNamePrefix:"em-mob-table_align-",value:e.mobileAlign.value}}})}const i=o.closest("table");i?.getAttribute("em")==="atom"?r(i):o.querySelectorAll('[em="atom"]').forEach(l=>r(l))}function Ju(e,o){const t=o.activeElement,n=o.removeEditorTags(o.isElementListContainer.outerHTML);t.innerHTML=`<td em-edit="active">${o.addClassToSecondCell(n,"em-list-temp-class")}</td>`;const r=window.getSelection();if(!r||r.rangeCount===0)return;let i=r.getRangeAt(0);const l=t.querySelectorAll(".em-list-temp-class");if(l.length>0){o.isProgrammaticSelection.value=!0;for(let s=0;s<l.length;s++){const c=l[s].querySelector("div");if(!c)continue;o.wrapEditor(c,!0),i=r.getRangeAt(0),i.selectNode(c),o.addNewRange(i);const d=c.innerHTML!=="&nbsp;"||c.innerHTML==="&nbsp;"&&(e.fontSize||e.textColor||e.lineHeight);if(o.textStyleProperties.some(u=>e.hasOwnProperty(u))&&d)try{o.toggleTextStyle(c,{settings:e})}catch{}}t.querySelectorAll(".em-list-temp-class").forEach(s=>s.classList.remove("em-list-temp-class")),t.removeAttribute("em-edit"),t.setAttribute("em-edit","active"),setTimeout(()=>{o.isProgrammaticSelection.value=!1},100),i=r.getRangeAt(0),i.selectNode(t),o.addNewRange(i)}}function Qu(e){return e.backgroundImage?.[0]?.value??""}function ln(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.textContent=e.elem.textContent.replace(/width=".*?"/gi,'width="'+e.width+'"'):e.elem.previousSibling&&ln({elem:e.elem.previousSibling,width:e.width})}function fi(e,o){let t=e.previousSibling;for(;t&&!(t.nodeName==="#comment"&&t.textContent?.includes("mso"));)t=t.previousSibling;const n=t?.textContent??"",r=n.lastIndexOf("<td");if(!t||r===-1)return;const i=n.slice(r),l=/\svalign="[^"]*"/i.test(i)?i.replace(/valign="[^"]*"/i,`valign="${o}"`):i.replace("<td",`<td valign="${o}"`);t.textContent=n.slice(0,r)+l}function ef(e,o){const t=o.activeElement;let n=!1;if(!e)return n;if(e.width){const r=e.gap?.value??0;if(e.width.value!==void 0&&e.width.value!==null)if(t.style.maxWidth)if(e.width.dim==="px"){const i=parseFloat(e.width.value+r),l=Math.round(parseFloat(e.width.value)/i*100);t.style.maxWidth=i+e.width.dim,ln({elem:t,width:i}),t.firstElementChild?.tagName==="TABLE"&&(t.firstElementChild.setAttribute("width",e.width.value),t.firstElementChild.style.width=l+"%",t.firstElementChild.style.maxWidth=e.width.value+"px")}else t.style.width=parseFloat(e.width.value)+e.width.dim;else e.width.dim==="px"?(t.style.width=parseFloat(e.width.value+r)+e.width.dim,ln({elem:t,width:parseFloat(e.width.value+r)}),t.firstElementChild?.tagName==="TABLE"&&t.firstElementChild.setAttribute("width",e.width.value)):t.style.width=parseFloat(e.width.value)+e.width.dim;else t.style.removeProperty("width")}if(e.gap&&!e.width){const r=parseFloat(e.gap.value??0);t.style.maxWidth?t.parentElement?.querySelectorAll('div[style*="inline-block"]').forEach(i=>{const l=i,s=parseFloat(l.style.maxWidth),c=Math.round((s-r)/s*100);l.firstElementChild?.tagName==="TABLE"&&(l.firstElementChild.setAttribute("width",String(s-r)),l.firstElementChild.style.width=c+"%",l.firstElementChild.style.maxWidth=s-r+"px")}):t.parentElement?.querySelectorAll('div[style*="inline-block"]').forEach(i=>{const l=i;l.firstElementChild?.tagName==="TABLE"&&l.firstElementChild.setAttribute("width",String(parseFloat(l.style.width)-r))})}return e.valign&&(t.style.verticalAlign=e.valign,fi(t,t.style.verticalAlign)),e.mobileWidth&&(o.setElementMobileWidth({settings:e,elem:t}),n=!0),e.mobileContentWidth&&(o.setElementMobileContentWidth({settings:e,elem:t.firstElementChild}),n=!0),e.mobileVerticalAlign&&(o.setElementMobileVerticalAlign({settings:e,elem:t}),n=!0),e.show&&(o.setElementShow({settings:e,elem:t}),n=!0),n}function an(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.textContent=e.elem.textContent.replace(/width=".*?"/gi,'width="'+e.width+'"'):e.elem.previousSibling&&an({elem:e.elem.previousSibling,width:e.width})}function fo(e){return!!(e.querySelector(".em-mob-wrap")||e.closest(".em-mob-wrap")||e.querySelector(".noresp-em-mob-wrap")||e.closest(".noresp-em-mob-wrap"))}function po(e){return e.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?document.querySelector('[em-edit="active"]'):e.closest(".em-mob-wrap, .noresp-em-mob-wrap")?.parentElement||null}function sn(e){return e.querySelector('div[style*="inline-block"]')?document.querySelector('[em-edit="active"]'):e.closest('div[style*="inline-block"]')?.parentElement||null}function tf(e,o){const t=o.activeElement;if(fo(t)){const n=po(t);if(!n)return;n.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach((r,i)=>{r.setAttribute("width",e.items[i])}),o.setPercentsForColumns(n.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)"))}else{const n=sn(t);if(!n)return;n.querySelectorAll('div[style*="inline-block"]').forEach((r,i)=>{const l=r;l.style.width=e.items[i]+e.gap+"px",an({elem:l.closest('div[style*="inline-block"]'),width:e.items[i]+e.gap}),l.firstElementChild?.tagName==="TABLE"&&l.firstElementChild.setAttribute("width",e.items[i])})}}function of(e,o){const t=o.activeElement;if(!fo(t))return;const n=t.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?t.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?.parentElement:t.closest(".em-mob-wrap, .noresp-em-mob-wrap")?.parentElement;if(!n)return;const r=n.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)"),i=r.length,l=e.items.length,s=e.gap;i>=l?r.forEach((c,d)=>{if(d<l)c.setAttribute("width",e.items[d]);else{const u=c.previousElementSibling;(u?.classList.contains("em-mob-wrap")||u?.classList.contains("noresp-em-mob-wrap"))&&u?.remove(),c.remove()}}):(r.forEach((c,d)=>{c.setAttribute("width",e.items[d])}),e.items.forEach((c,d)=>{let u="";n.querySelector(".em-mob-wrap")?u=`<td width="${s}" class="em-mob-wrap"></td>
268
268
  <td width="${c}" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>`:n.querySelector(".noresp-em-mob-wrap")&&(u=`<td width="${s}" class="noresp-em-mob-wrap"></td>
269
- <td width="${c}" valign="top" class="noresp-em-mob-wrap em-mob-width-100perc"></td>`),d>=i&&u&&n.insertAdjacentHTML("beforeend",u)}))}function ef(e,o){const t=o.activeElement;if(fo(t)){const n=po(t);if(!n)return;n.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(r=>{r.setAttribute("valign",e.valign)})}else{const n=sn(t);if(!n)return;n.querySelectorAll('div[style*="inline-block"]').forEach(r=>{r.style.verticalAlign=e.valign,fi(r,r.style.verticalAlign)})}}function tf(e,o){const t=o.activeElement;if(fo(t)){const n=po(t);if(!n)return;n.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach((r,i)=>{r.setAttribute("width",e.items[i])}),o.setPercentsForColumns(n.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)")),n.querySelectorAll(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)").forEach(r=>{r.setAttribute("width",e.gap)})}else{const n=sn(t);if(!n)return;n.querySelectorAll('div[style*="inline-block"]').forEach((r,i)=>{const l=r;l.style.width=e.items[i]+e.gap+"px",an({elem:l.closest('div[style*="inline-block"]'),width:e.items[i]+e.gap}),l.firstElementChild?.tagName==="TABLE"&&l.firstElementChild.setAttribute("width",e.items[i])})}}function of(e,o){const t=o.activeElement;let n=!1;const r=po(t);return r&&r.querySelectorAll(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)").forEach(i=>{o.setElementMobileHeight({settings:e,elem:i}),n=!0}),n}function nf(e,o){const t=e,n=o.activeElement.closest("amp-carousel");if(!n)return;const r=o.HTMLDocument.getOuterHtml(n),i=o.parseFromString(r)[0];t.loop?i.setAttribute("loop",""):i.removeAttribute("loop"),t.autoplay?i.setAttribute("autoplay",""):i.removeAttribute("autoplay"),i.innerHTML="",t.carouselImages.forEach(l=>{const s=document.createElement("amp-img");a.setRenderedAttribute(s,"src",l.src),s.setAttribute("alt",l.alt),s.setAttribute("title",l.title),s.setAttribute("width",String(l.width.value)),s.setAttribute("height",String(l.height.value)),s.setAttribute("layout","responsive");let c=s;if(l.imgReplacer){const d=document.createElement("em-replace");a.setRenderedAttribute(d,"src",l.imgReplacer),d.appendChild(s),c=d}if(l.link){const d=document.createElement("a");d.href=l.link,d.appendChild(c),i.appendChild(d)}else i.appendChild(c)}),o.setElementBorderRadius({settings:{borderRadius:t.borderRadius},elem:i}),i.setAttribute("em-edit","active"),n.replaceWith(i),o.commit(!0)}function rf(e,o){const t=e,n=o.activeElement.closest("amp-accordion");if(!n)return;const r=o.HTMLDocument.getOuterHtml(n),i=o.parseFromString(r)[0];t.animate?i.setAttribute("animate",""):i.removeAttribute("animate"),t.expandSingleSection?i.setAttribute("expand-single-section",""):i.removeAttribute("expand-single-section"),i.querySelectorAll("section").forEach((l,s)=>{t.sections[s]?.expanded?l.setAttribute("expanded",""):l.removeAttribute("expanded")}),i.setAttribute("em-edit","active"),n.replaceWith(i),o.commit(!0)}var Fe={align:"center",iconSize:40,borderRadius:0,gap:8,bgEnabled:!1,bgColor:"",borderWidth:0,borderColor:"",buttonBorderColor:"",buttonBorderWidth:0,showLabel:!1};function lf(e){return e.closest('table[em-type="social"]')}function pi(e){const o=e.querySelector(":scope > tr");if(o){const n=o.querySelector(":scope > td");if(n instanceof HTMLElement)return n}const t=e.querySelector("tbody > tr");if(t){const n=t.querySelector(":scope > td");if(n instanceof HTMLElement)return n}return null}function af(e,o,t){const n=pi(e),r=pi(o);if(!(!n||!r)){for(const{name:i,value:l}of Array.from(n.attributes))i.toLowerCase()!=="align"&&r.setAttribute(i,l);r.setAttribute("align",t)}}function qe(e){return String(e??"").replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}function sf(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function cf(){const e=[typeof document<"u"?document.baseURI:"",typeof window<"u"?window.location?.href:""];for(const o of e)if(o)try{const t=new URL(o);if(t.protocol==="http:"||t.protocol==="https:")return t.href}catch{}return""}function df(e){const o=String(e??"").trim();if(!o)return"";if(/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i.test(o))return o;const t=cf();if(!t)return o;try{return new URL(o,t).href}catch{return o}}function mf(e){return e>0?`<td width="${e}">&nbsp;</td>`:""}function uf(e,o){const t=lf(o.activeElement);if(!t)return null;const n=Array.isArray(e.items)?e.items:[],r=e.align==="left"||e.align==="right"||e.align==="center"?e.align:Fe.align,i=typeof e.iconSize=="number"?e.iconSize:Fe.iconSize,l=typeof e.borderRadius=="number"?e.borderRadius:Fe.borderRadius,s=typeof e.gap=="number"?e.gap:Fe.gap,c=typeof e.bgEnabled=="boolean"?e.bgEnabled:Fe.bgEnabled,d=typeof e.bgColor=="string"?e.bgColor:Fe.bgColor,u=typeof e.borderWidth=="number"?e.borderWidth:Fe.borderWidth,g=typeof e.borderColor=="string"?e.borderColor:Fe.borderColor;let m=typeof e.buttonBorderWidth=="number"&&!Number.isNaN(e.buttonBorderWidth)?e.buttonBorderWidth:Fe.buttonBorderWidth;m=Math.max(0,Math.min(24,Math.round(m)));const f=typeof e.showLabel=="boolean"?e.showLabel:Fe.showLabel,p=[];u>0&&g&&p.push(`border:${u}px solid ${qe(g)}`);const b=p.length?` style="${p.join(";")}"`:"",h=!!(c&&String(d).trim()),y=Math.max(0,Math.round(Number(s)||0)),E=n.length>1,S=`<table border="0" cellspacing="0" cellpadding="0">
270
- <tr>${n.map(L=>{const w=qe(L.platform||"unknown"),A=!!L.customIcon,M=qe(L.href||""),R=String(L.title??"").trim(),$=R?` title="${qe(R)}"`:"",J=qe(L.alt||""),_=qe(df(L.iconSrc||"")),G=L.iconWidth!=null&&!Number.isNaN(Number(L.iconWidth))?Number(L.iconWidth):i,H=L.iconHeight!=null&&!Number.isNaN(Number(L.iconHeight))?Number(L.iconHeight):i,P=A?"":typeof L.buttonBgColor=="string"?L.buttonBgColor.trim():"",q=!A&&h&&!P?String(d).trim():"",O=A?"":P||q,Q=!A&&!!q,re=A?"":typeof L.itemBorderColor=="string"?L.itemBorderColor.trim():"",x=!A&&!!(P||re&&m>0||Q);let k=`<a href="${M}" target="_blank"${$} draggable="false"><img src="${_}" width="${G}" height="${H}" border="0" alt="${J}" draggable="false" style="display:block;${!A&&!x&&l>0?`border-radius:${l}px;`:""}" /></a>`;if(f&&(L.title||L.alt)){const we=sf(String(L.title||L.alt||""));k+=`<br/><span style="display:block;font-size:11px;line-height:1.2;margin-top:4px;max-width:96px;word-break:break-word;">${we}</span>`}const se=[];O&&se.push(`background-color:${qe(O)}`),re&&m>0&&se.push(`border:${m}px solid ${qe(re)}`),x&&l>0&&se.push(`border-radius:${l}px`);const z=Q?' em-tray-cell-bg="1"':"",ee=A?' em-custom-icon="1"':"",Y=O&&/^#[0-9A-Fa-f]{3,8}$/.test(O)?` bgcolor="${qe(O)}"`:"",ie=E?' draggable="true"':"";return`<td em-platform="${w}"${ee}${z}${Y}${se.length?` style="${se.join(";")}"`:""}${ie}>${k}</td>`}).filter(Boolean).reduce((L,w,A)=>(A>0&&L.push(mf(y)),L.push(w),L),[]).join("")}
269
+ <td width="${c}" valign="top" class="noresp-em-mob-wrap em-mob-width-100perc"></td>`),d>=i&&u&&n.insertAdjacentHTML("beforeend",u)}))}function nf(e,o){const t=o.activeElement;if(fo(t)){const n=po(t);if(!n)return;n.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(r=>{r.setAttribute("valign",e.valign)})}else{const n=sn(t);if(!n)return;n.querySelectorAll('div[style*="inline-block"]').forEach(r=>{r.style.verticalAlign=e.valign,fi(r,r.style.verticalAlign)})}}function rf(e,o){const t=o.activeElement;if(fo(t)){const n=po(t);if(!n)return;n.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach((r,i)=>{r.setAttribute("width",e.items[i])}),o.setPercentsForColumns(n.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)")),n.querySelectorAll(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)").forEach(r=>{r.setAttribute("width",e.gap)})}else{const n=sn(t);if(!n)return;n.querySelectorAll('div[style*="inline-block"]').forEach((r,i)=>{const l=r;l.style.width=e.items[i]+e.gap+"px",an({elem:l.closest('div[style*="inline-block"]'),width:e.items[i]+e.gap}),l.firstElementChild?.tagName==="TABLE"&&l.firstElementChild.setAttribute("width",e.items[i])})}}function lf(e,o){const t=o.activeElement;let n=!1;const r=po(t);return r&&r.querySelectorAll(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)").forEach(i=>{o.setElementMobileHeight({settings:e,elem:i}),n=!0}),n}function af(e,o){const t=e,n=o.activeElement.closest("amp-carousel");if(!n)return;const r=o.HTMLDocument.getOuterHtml(n),i=o.parseFromString(r)[0];t.loop?i.setAttribute("loop",""):i.removeAttribute("loop"),t.autoplay?i.setAttribute("autoplay",""):i.removeAttribute("autoplay"),i.innerHTML="",t.carouselImages.forEach(l=>{const s=document.createElement("amp-img");a.setRenderedAttribute(s,"src",l.src),s.setAttribute("alt",l.alt),s.setAttribute("title",l.title),s.setAttribute("width",String(l.width.value)),s.setAttribute("height",String(l.height.value)),s.setAttribute("layout","responsive");let c=s;if(l.imgReplacer){const d=document.createElement("em-replace");a.setRenderedAttribute(d,"src",l.imgReplacer),d.appendChild(s),c=d}if(l.link){const d=document.createElement("a");d.href=l.link,d.appendChild(c),i.appendChild(d)}else i.appendChild(c)}),o.setElementBorderRadius({settings:{borderRadius:t.borderRadius},elem:i}),i.setAttribute("em-edit","active"),n.replaceWith(i),o.commit(!0)}function sf(e,o){const t=e,n=o.activeElement.closest("amp-accordion");if(!n)return;const r=o.HTMLDocument.getOuterHtml(n),i=o.parseFromString(r)[0];t.animate?i.setAttribute("animate",""):i.removeAttribute("animate"),t.expandSingleSection?i.setAttribute("expand-single-section",""):i.removeAttribute("expand-single-section"),i.querySelectorAll("section").forEach((l,s)=>{t.sections[s]?.expanded?l.setAttribute("expanded",""):l.removeAttribute("expanded")}),i.setAttribute("em-edit","active"),n.replaceWith(i),o.commit(!0)}var Fe={align:"center",iconSize:40,borderRadius:0,gap:8,bgEnabled:!1,bgColor:"",borderWidth:0,borderColor:"",buttonBorderColor:"",buttonBorderWidth:0,showLabel:!1};function cf(e){return e.closest('table[em-type="social"]')}function pi(e){const o=e.querySelector(":scope > tr");if(o){const n=o.querySelector(":scope > td");if(n instanceof HTMLElement)return n}const t=e.querySelector("tbody > tr");if(t){const n=t.querySelector(":scope > td");if(n instanceof HTMLElement)return n}return null}function df(e,o,t){const n=pi(e),r=pi(o);if(!(!n||!r)){for(const{name:i,value:l}of Array.from(n.attributes))i.toLowerCase()!=="align"&&r.setAttribute(i,l);r.setAttribute("align",t)}}function qe(e){return String(e??"").replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}function mf(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function uf(){const e=[typeof document<"u"?document.baseURI:"",typeof window<"u"?window.location?.href:""];for(const o of e)if(o)try{const t=new URL(o);if(t.protocol==="http:"||t.protocol==="https:")return t.href}catch{}return""}function ff(e){const o=String(e??"").trim();if(!o)return"";if(/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i.test(o))return o;const t=uf();if(!t)return o;try{return new URL(o,t).href}catch{return o}}function pf(e){return e>0?`<td width="${e}">&nbsp;</td>`:""}function gf(e,o){const t=cf(o.activeElement);if(!t)return null;const n=Array.isArray(e.items)?e.items:[],r=e.align==="left"||e.align==="right"||e.align==="center"?e.align:Fe.align,i=typeof e.iconSize=="number"?e.iconSize:Fe.iconSize,l=typeof e.borderRadius=="number"?e.borderRadius:Fe.borderRadius,s=typeof e.gap=="number"?e.gap:Fe.gap,c=typeof e.bgEnabled=="boolean"?e.bgEnabled:Fe.bgEnabled,d=typeof e.bgColor=="string"?e.bgColor:Fe.bgColor,u=typeof e.borderWidth=="number"?e.borderWidth:Fe.borderWidth,g=typeof e.borderColor=="string"?e.borderColor:Fe.borderColor;let m=typeof e.buttonBorderWidth=="number"&&!Number.isNaN(e.buttonBorderWidth)?e.buttonBorderWidth:Fe.buttonBorderWidth;m=Math.max(0,Math.min(24,Math.round(m)));const f=typeof e.showLabel=="boolean"?e.showLabel:Fe.showLabel,p=[];u>0&&g&&p.push(`border:${u}px solid ${qe(g)}`);const b=p.length?` style="${p.join(";")}"`:"",h=!!(c&&String(d).trim()),y=Math.max(0,Math.round(Number(s)||0)),E=n.length>1,S=`<table border="0" cellspacing="0" cellpadding="0">
270
+ <tr>${n.map(L=>{const w=qe(L.platform||"unknown"),A=!!L.customIcon,M=qe(L.href||""),R=String(L.title??"").trim(),$=R?` title="${qe(R)}"`:"",J=qe(L.alt||""),_=qe(ff(L.iconSrc||"")),G=L.iconWidth!=null&&!Number.isNaN(Number(L.iconWidth))?Number(L.iconWidth):i,H=L.iconHeight!=null&&!Number.isNaN(Number(L.iconHeight))?Number(L.iconHeight):i,P=A?"":typeof L.buttonBgColor=="string"?L.buttonBgColor.trim():"",q=!A&&h&&!P?String(d).trim():"",O=A?"":P||q,Q=!A&&!!q,re=A?"":typeof L.itemBorderColor=="string"?L.itemBorderColor.trim():"",x=!A&&!!(P||re&&m>0||Q);let k=`<a href="${M}" target="_blank"${$} draggable="false"><img src="${_}" width="${G}" height="${H}" border="0" alt="${J}" draggable="false" style="display:block;${!A&&!x&&l>0?`border-radius:${l}px;`:""}" /></a>`;if(f&&(L.title||L.alt)){const we=mf(String(L.title||L.alt||""));k+=`<br/><span style="display:block;font-size:11px;line-height:1.2;margin-top:4px;max-width:96px;word-break:break-word;">${we}</span>`}const se=[];O&&se.push(`background-color:${qe(O)}`),re&&m>0&&se.push(`border:${m}px solid ${qe(re)}`),x&&l>0&&se.push(`border-radius:${l}px`);const z=Q?' em-tray-cell-bg="1"':"",ee=A?' em-custom-icon="1"':"",Y=O&&/^#[0-9A-Fa-f]{3,8}$/.test(O)?` bgcolor="${qe(O)}"`:"",ie=E?' draggable="true"':"";return`<td em-platform="${w}"${ee}${z}${Y}${se.length?` style="${se.join(";")}"`:""}${ie}>${k}</td>`}).filter(Boolean).reduce((L,w,A)=>(A>0&&L.push(pf(y)),L.push(w),L),[]).join("")}
271
271
  </tr>
272
272
  </table>`,v=`<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom" em-type="social"${b}><tr><td align="${qe(r)}">
273
273
  ${S}
274
- </td></tr></table>`,C=o.parseFromString(v)[0];return C?(C instanceof HTMLTableElement&&af(t,C,r),C.setAttribute("em-edit","active"),t.replaceWith(C),o.commit(!0),C):null}function ff(e,o){if(typeof e.textSuperscript!="boolean"&&typeof e.textSubscript!="boolean")return;const t=window.getSelection();if(!t||t.rangeCount===0)return;const n=t.getRangeAt(0),r=n.commonAncestorContainer;if(r?.tagName==="TABLE")return;const i=r.nodeType===1?r:r.parentElement;if(!i)return;function l(s,c){const d=i.closest(s),u=s==="sup"?"sub":"sup",g=i.closest(u);if(c){let m=!0;if(d&&o.isRangeMatching(d,n,n.collapsed))m=!1;else if(g)if(o.isRangeMatching(g,n,n.collapsed)){const f=o.unwrapTag(g);n.selectNodeContents(f)}else{const f=o.splitWrapper(g,n);n.selectNodeContents(f),setTimeout(()=>t.removeAllRanges(),100)}else if(d){const f=o.splitWrapper(d,n);n.selectNodeContents(f)}if(m)if(n.collapsed){const f=n.cloneRange();try{n.expand("word");const p=n.toString().trim();if(p){const b=o.wrapInTag(n,p,s),h=document.createRange();h.selectNodeContents(b),t.removeAllRanges(),t.addRange(h),o.cleanEmptyTags(b.parentNode)}else n.setStart(f.startContainer,f.startOffset),n.setEnd(f.endContainer,f.endOffset)}catch{n.setStart(f.startContainer,f.startOffset),n.setEnd(f.endContainer,f.endOffset)}}else{const f=n.cloneContents(),p=document.createElement("div");p.appendChild(f),o.unwrapNestedTags(p,s);const b=o.wrapInTag(n,p,s),h=document.createRange();h.selectNodeContents(b),t.removeAllRanges(),t.addRange(h),o.cleanEmptyTags(b.parentNode)}}else if(n.collapsed)if(d){const m=d.parentNode,f=o.unwrapTag(d),p=document.createRange();p.selectNodeContents(f),t.removeAllRanges(),t.addRange(p),o.cleanEmptyTags(m),d.parentNode||setTimeout(()=>t.removeAllRanges(),0)}else{const m=n.startContainer.parentElement?.closest(s);if(m){const f=o.unwrapTag(m),p=document.createRange();p.selectNodeContents(f),t.removeAllRanges(),t.addRange(p),o.cleanEmptyTags(m.parentNode)}}else{let m=[];const f=n.cloneContents(),p=document.createElement("div");if(p.appendChild(f),m=Array.from(p.querySelectorAll(s)),d){const h=Array.from(d.childNodes).some(S=>S.nodeType===1),y=o.unwrapTag(d),E=document.createRange();if(y.isConnected)E.selectNodeContents(y),t.removeAllRanges(),t.addRange(E);else{const S=d.parentNode;S&&(E.selectNodeContents(S),t.removeAllRanges(),t.addRange(E))}h&&o.applicationElementSettingsSet({elem:document.querySelector("[em-edit]")}),o.commit();return}else{const h=n.commonAncestorContainer.parentElement?.closest(s)||n.startContainer.parentElement?.closest(s);h&&m.push(h)}m.length>0&&m.forEach(h=>{h.parentNode&&o.unwrapTag(h)});const b=p.cloneNode(!0).querySelector('[em-edit="active"]');if(b){n.deleteContents(),n.insertNode(b);const h=document.createRange();h.selectNodeContents(b),t.removeAllRanges(),t.addRange(h),o.cleanEmptyTags(b.parentNode)}}o.commit()}typeof e.textSuperscript=="boolean"&&l("sup",e.textSuperscript),typeof e.textSubscript=="boolean"&&l("sub",e.textSubscript)}function pf(e,o){if(e!==void 0){if(e===""){gf(o.activeElement);return}bf(e,o)}}function gf(e){const o=e?.closest("em-replace")||e?.querySelector("em-replace");if(!o)return;const t=o.parentNode,n=o.firstChild,r=o.lastChild;if(o.getAttribute("text")!==o.innerHTML)for(;o.firstChild;)t?.insertBefore(o.firstChild,o);const i=document.createRange(),l=window.getSelection();n&&r&&l&&(i.setStartBefore(n),i.setEndAfter(r),l.removeAllRanges(),l.addRange(i)),o.remove()}function bf(e,o){const t=window.getSelection();if(!t||t.rangeCount===0)return;const n=t.getRangeAt(0),r=e.replace(/~~.*$/,""),i=n.commonAncestorContainer,l=i.nodeType===1?i:i.parentElement;let s=l?.closest("em-replace");const c=/~~/.test(e)&&s;if(c){const d=e.replace(/~~.*$/,"");l?.setAttribute("text",d),l&&(l.innerHTML=d)}if(!s&&t.rangeCount>0&&!n.collapsed){const d=document.querySelectorAll("em-replace");if(s=Array.prototype.find.call(d,u=>u.textContent?.trim()===t.toString().trim()&&t.toString().trim()!==""),!s){const u=document.querySelector('[em-edit="active"]');u?.textContent===n.toString()&&n.selectNodeContents(u);const g=e.replace(/~~.*$/,""),m=document.createElement("em-replace");m.setAttribute("text",g),n.surroundContents(m)}}if(!s&&t.rangeCount>0&&n.collapsed){let d=document.querySelector("em-replace");if(d){const u=document.querySelectorAll("em-replace"),g=/~$/;s=Array.prototype.find.call(u,m=>{const f=e,p=m.textContent||"";return f.length===1&&g.test(p)?!0:o.compareStrings(p,f)}),s&&(s.setAttribute("text",e),s.textContent=e),s||(d=document.createElement("em-replace"),d.setAttribute("text",r),n.insertNode(d),d.innerHTML=r,n.collapse(!1))}else d=document.createElement("em-replace"),d.setAttribute("text",r),n.insertNode(d),d.innerHTML=r,n.collapse(!1)}s&&!c&&(s.getAttribute("text")===s.innerHTML&&(s.innerHTML=e),s.setAttribute("text",e))}function hf(e){return e.trim().replace(/\s+/g,"_").replace(/[^\p{L}\p{N}\-_:.]/gu,"")}function gi(e){const o=e.commonAncestorContainer,t=(o.nodeType===Node.ELEMENT_NODE?o:o.parentElement)?.closest?.("a[name]");if(!t)return null;try{const n=document.createRange();return n.selectNodeContents(t),e.compareBoundaryPoints(Range.START_TO_START,n)>=0&&e.compareBoundaryPoints(Range.END_TO_END,n)<=0?t:null}catch{return null}}function yf(e,o){if(!e||!o)return;const t=document.createRange(),n=window.getSelection();if(n)try{if(!e.isConnected||!o.isConnected)return;t.setStartBefore(e),t.setEndAfter(o),n.removeAllRanges(),n.addRange(t)}catch{}}function Ef(e){const o=e.parentNode;if(o){for(;e.firstChild;)o.insertBefore(e.firstChild,e);o.removeChild(e)}}function Sf(e,o){const t=window.getSelection(),n=t?.rangeCount?t.getRangeAt(0):null;if(e===void 0||!e.trim()){let i=null;if(n&&!n.collapsed&&(i=gi(n)),i||(i=o.activeElement?.closest?.("a[name]")),i){const l=i.firstChild,s=i.lastChild;Ef(i),o.commit(),yf(l,s)}return}const r=hf(e);if(r&&!(!t||!n||n.collapsed))try{const i=gi(n);if(i){i.setAttribute("name",r),o.commit();return}const l=document.createElement("a");l.setAttribute("name",r);const s=n.extractContents();l.appendChild(s),n.insertNode(l);const c=document.createRange();c.selectNodeContents(l),t.removeAllRanges(),t.addRange(c),o.commit()}catch{}}function Cf(e,o){let t=!1,{activeElement:n,activeCell:r}=o;if(n||(n=document.querySelector(".remove-basic-cell")||document.querySelector(".em-temporary-active-cell-background-color")||document.querySelector(".em-active-table-cell")),!n)return t;const i=Object.keys(e)[0],l=n.closest(".em-element-custom-table");if(!l)return t;let s=o.parseTableElementToModel(l);if(n.tagName==="TD"&&(n=n.querySelector("div"),n?.setAttribute("em-edit","active")),n?.tagName==="TR"&&(n=n.querySelector("EDITOR")?.querySelector("div"),n?.setAttribute("em-edit","active")),i.includes("padding")&&!i.includes("cell_")&&vf(e,l,s,o),e.backgroundColor&&Af(e.backgroundColor,l),i.includes("backgroundImage")&&Tf(e,l),i.includes("backgroundPosition")){const c=o.updateBackgroundPosition(l.getAttribute("style"),{settings:e});l.setAttribute("style",c)}return i.includes("backgroundSize")&&(l.style.backgroundSize=e.backgroundSize),i.includes("backgroundRepeat")&&(l.style.backgroundRepeat=e.backgroundRepeat),(e.borderAll||e.borderTop||e.borderRight||e.borderBottom||e.borderLeft)&&Lf(e,i,l,o),i.includes("borderRadius")&&wf(e,l,o),i.includes("boxShadow")&&kf(e,l,o),t=_f(e,l,o)||t,i.includes("cell")&&Nf(e,i,l,s,r,o),new Set(["fontFamily","fontSize","lineHeight","textStrong","textItalic","textStrikethrough","textUnderline","textLink","textColor","textBackgroundColor","linkHref","textAlign","valign"]).has(i)&&Hf(e,i,l,s,r,n,o),If(l,o),a.applyVMLBackgroundToggle(l,e,"around"),t}function vf(e,o,t,n){const r=n.updateTablePadding(t,{settings:e});o.innerHTML=n.tableModelToHtml(r)}function Af(e,o){o.getAttribute("data-bg-image")&&(o.removeAttribute("data-bg-image"),o.style.backgroundImage="",o.style.backgroundSize="",o.style.backgroundRepeat="",o.style.backgroundPosition=""),o.setAttribute("bgcolor",e)}function Tf(e,o){if(o.getAttribute("bgcolor")&&o.removeAttribute("bgcolor"),e.backgroundImage?.[0]?.type==="url"){const t=e.backgroundImage[0].value;o.setAttribute("data-bg-image",t),o.style.backgroundImage=`url('${t}')`,o.style.backgroundSize="cover",o.style.backgroundRepeat="no-repeat",o.style.backgroundPosition="center"}}function Lf(e,o,t,n){const r=o,i=e[r];let l="",s="";switch(r){case"borderAll":l="border",s=t.style.border;break;case"borderTop":l="border-top",s=t.style.borderTop;break;case"borderRight":l="border-right",s=t.style.borderRight;break;case"borderBottom":l="border-bottom",s=t.style.borderBottom;break;case"borderLeft":l="border-left",s=t.style.borderLeft;break;default:l="border",s=t.style.border}const c=t.getAttribute("border")||"",d=t.getAttribute("bordercolor")||"";let u=t.getAttribute("style")||"";const g=t.style.borderCollapse?`border-collapse: ${t.style.borderCollapse};`:"border-collapse: collapse;";if(["borderTop","borderRight","borderBottom","borderLeft"].includes(r)&&(t.style.border||c)){u=n.removeStyleProperty(u,"border");const f=t.style.border?t.style.border:`${c||"1"}px solid ${d||"#b9b1b1"}`;u=`border-top: ${f}; border-right: ${f}; border-bottom: ${f}; border-left: ${f}; ${u};`}let m=s?`${l}: ${s};`:`${l}: ${c||"1"}px solid ${d||"#b9b1b1"};`;t.removeAttribute("border"),t.removeAttribute("bordercolor"),t.removeAttribute("border-collapse"),u=n.removeStyleProperty(u,l),u=n.removeStyleProperty(u,"border-collapse"),l==="border"&&["border-top","border-right","border-bottom","border-left"].forEach(f=>{u=n.removeStyleProperty(u,f)}),["borderTop","borderRight","borderBottom","borderLeft"].includes(r)&&(u=n.removeStyleProperty(u,"border")),i?.style===""&&(m=""),i?.color&&m&&(m=m.replace(/(#([0-9A-Fa-f]{3}){1,2}\b)|(rgba?\([^)]*\))/g,i.color)),i?.width&&m&&(m=m.replace(/\b\d+(\.\d+)?px\b/g,`${i.width}px`)),i?.style&&m&&(m=m.replace(/solid|dashed|dotted/g,i.style)),m=`${m}${u?` ${u}`:""}`,t.setAttribute("style",m?`${g} ${m}`:"")}function wf(e,o,t){const n=e.borderRadius,r=o.getAttribute("border")||"",i=o.getAttribute("bordercolor")||"";let l=o.getAttribute("style")||"";if(n?.all){const c=`border-radius: ${n.all}px ${n.all}px ${n.all}px ${n.all}px;`;if(l)l=t.removeStyleProperty(l,"border-radius"),l=t.removeStyleProperty(l,"border-collapse"),o.setAttribute("style",`${l}; border-collapse: separate; ${c}`);else{const d=`border-collapse: separate; border: ${r||"1"}px solid ${i||"#b9b1b1"}; ${c}`;o.setAttribute("style",d),o.removeAttribute("border"),o.removeAttribute("bordercolor")}}const s=["topLeft","topRight","bottomRight","bottomLeft"];s.forEach(c=>{if(n?.[c])if(l){const d=t.updateBorderRadius(o.getAttribute("style"),c,n[c]);o.setAttribute("style",d)}else{const d={topLeft:"0",topRight:"1",bottomRight:"2",bottomLeft:"3"},u=["0","0","0","0"];u[parseInt(d[c])]=`${n[c]}px`;const g=`border-radius: ${u.join(" ")};`,m=`border-collapse: separate; border: ${r||"1"}px solid ${i||"#b9b1b1"}; ${g}`;o.setAttribute("style",m)}}),(n?.all||s.some(c=>n?.[c]))&&(o.removeAttribute("border"),o.removeAttribute("bordercolor"))}function kf(e,o,t){const n=e.boxShadow;if(!n)return;const r=o.getAttribute("border")||"",i=o.getAttribute("bordercolor")||"";let l=o.getAttribute("style")||"";const s=`box-shadow: ${n.color} ${n.hOffset}px ${n.vOffset}px ${n.blurRadius}px ${n.spreadRadius}px${n.inset?" inset":""};`;if(l)l=t.removeStyleProperty(l,"box-shadow"),l=t.removeStyleProperty(l,"border-collapse"),o.setAttribute("style",`${l}; border-collapse: separate;${n.color?` ${s}`:""}`);else{const c=`border-collapse: separate; border: ${r||"1"}px solid ${i||"#b9b1b1"}; ${s}`;o.setAttribute("style",c),o.removeAttribute("border"),o.removeAttribute("bordercolor")}}function _f(e,o,t){let n=!1;e.mobileWidth&&(t.setElementMobileWidth({settings:e,elem:o}),o.removeAttribute("width"),n=!0),e.mobileHeight&&(t.setElementMobileHeight({settings:e,elem:o}),n=!0),e.show&&(t.setElementShow({settings:e,elem:o}),n=!0),e.mobileBackgroundColor&&(t.setElementMobileBackgroundColor({settings:e,elem:o}),n=!0);const r=e;if(r.mobileBackgroundImage&&(t.setElementMobileBackgroundImage?.({settings:r,elem:o}),n=!0),r.mobileBackgroundPositionX&&(t.setElementMobileBackgroundPositionX?.({settings:r,elem:o}),n=!0),r.mobileBackgroundPositionY&&(t.setElementMobileBackgroundPositionY?.({settings:r,elem:o}),n=!0),r.mobileBackgroundRepeat&&(t.setElementMobileBackgroundRepeat?.({settings:r,elem:o}),n=!0),r.mobileBackgroundSize&&(t.setElementMobileBackgroundSize?.({settings:r,elem:o}),n=!0),e.mobileBoxShadow){if(e.mobileBoxShadow.color!==""&&t.setElementMobileBoxShadow({settings:e,elem:o}),e.mobileBoxShadow.color===""){const i=o.getAttribute("class")||"",l=t.removeClassByPrefix(i,e.mobileBoxShadow.classNamePrefix);o.setAttribute("class",l)}n=!0}if(e.mobileBorder&&(o.removeAttribute("border"),o.removeAttribute("bordercolor"),t.setElementMobileBorder({settings:e,elem:o}),n=!0),e.mobileBorderRadius){if(o.getAttribute("border")&&o.getAttribute("bordercolor")){const l={mobileBorder:{all:{collor:o.getAttribute("bordercolor"),width:o.getAttribute("border"),style:"solid",classNamePrefix:"em-mob-border_all-"}}};t.setElementMobileBorder({settings:l,elem:o}),o.removeAttribute("border"),o.removeAttribute("bordercolor")}t.setElementMobileBorderRadius({settings:e,elem:o});const i=Object.keys(e.mobileBorderRadius).find(l=>l!=="classNamePrefix");if(i&&e.mobileBorderRadius[i]===0){const l=o.getAttribute("class")||"";o.setAttribute("class",t.removeClassByPrefix(l,e.mobileBorderRadius.classNamePrefix))}n=!0}return n}function Nf(e,o,t,n,r,i){const l=[a.CLASS_FOR_BASIC_CELL,a.CLASS_BACKGROUND_ACTIVE_CELL];if(o.includes("cellBackgroundColor")){t.querySelector(".remove-basic-cell")&&(r=i.getCellsWithClasses(n,l),i.state.set("activeCell",r));const s=i.updateTableCellBackgroundByIds(n,r,e.cellBackgroundColor),c=i.addClassToCellsByIds(s,r,a.TEMPORARY_CELL_CLASS);t.innerHTML=i.tableModelToHtml(c)}if(e.cell_borderPosition){t.querySelector(".remove-basic-cell")&&(r=i.getCellsWithClasses(n,l),i.state.set("activeCell",r),document.querySelectorAll(`.${a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR}`).forEach(c=>{c.classList.remove(a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR)})),n=i.parseTableElementToModel(t);const s=i.addClassToCellsByIds(n,r,a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR);t.innerHTML=i.tableModelToHtml(s)}(e.cell_borderAll||e.cell_borderTop||e.cell_borderRight||e.cell_borderBottom||e.cell_borderLeft)&&Bf(e,t,n,r,i,l),o.includes("cell_borderRadiusAll")&&Mf(e,t,n,r,i,l),o.includes("cell_padding")&&Rf(e,t,n,r,i,l)}function Bf(e,o,t,n,r,i){o.querySelector(".remove-basic-cell")&&(n=r.getCellsWithClasses(t,i),r.state.set("activeCell",n),document.querySelectorAll(`.${a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR}`).forEach(c=>{c.classList.remove(a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR)}));const l=r.getExternalBorders(t,n),s=r.mergeUniCells(l);if(e.cell_borderAll){for(const c of Object.keys(s)){if(c.includes("-uni-"))continue;t=r.parseTableElementToModel(o);const d=[c],u=r.updateCellBordersByIds(t,d,s[c],e.cell_borderAll);let g=r.addClassToCellsByIds(u,d,a.TEMPORARY_CELL_CLASS);g=r.addClassToCellsByIds(g,d,a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR),o.innerHTML=r.tableModelToHtml(g)}(e.cell_borderAll.style===""||e.cell_borderAll.width===0||e.cell_borderAll.color==="")&&o.querySelectorAll(`.${a.TEMPORARY_CELL_CLASS}`).forEach(c=>{const d=c;d.style.removeProperty("border-top"),d.style.removeProperty("border-right"),d.style.removeProperty("border-bottom"),d.style.removeProperty("border-left")})}[{setting:"cell_borderTop",value:"top"},{setting:"cell_borderRight",value:"right"},{setting:"cell_borderBottom",value:"bottom"},{setting:"cell_borderLeft",value:"left"}].forEach(({setting:c,value:d})=>{if(e[c]){t=r.parseTableElementToModel(o);const u=Object.keys(s).filter(f=>s[f].includes(d)),g=r.updateCellBordersByIds(t,u,[d],e[c]),m=r.addClassToCellsByIds(g,n,a.TEMPORARY_CELL_CLASS);o.innerHTML=r.tableModelToHtml(m)}})}function Mf(e,o,t,n,r,i){o.querySelector(".remove-basic-cell")&&(n=r.getCellsWithClasses(t,i),r.state.set("activeCell",n),document.querySelectorAll(`.${a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR}`).forEach(s=>{s.classList.remove(a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR)}));const l=r.getExternalCorners(t,n);for(const s of Object.keys(l)){if(s.includes("-uni-"))continue;t=r.parseTableElementToModel(o);const c=r.updateCellBorderRadiusByIds(t,s,l[s],e.cell_borderRadiusAll),d=r.addClassToCellsByIds(c,s,a.TEMPORARY_CELL_CLASS);o.innerHTML=r.tableModelToHtml(d)}}function Rf(e,o,t,n,r,i){o.querySelector(".remove-basic-cell")&&(n=r.getCellsWithClasses(t,i),r.state.set("activeCell",n),document.querySelectorAll(`.${a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR}`).forEach(c=>{c.classList.remove(a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR)})),t=r.parseTableElementToModel(o);let l=r.addClassToCellsByIds(t,n,a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR);o.innerHTML=r.tableModelToHtml(l),[{key:"cell_paddingTop",sides:["top"]},{key:"cell_paddingBottom",sides:["bottom"]},{key:"cell_paddingLeft",sides:["left"]},{key:"cell_paddingRight",sides:["right"]},{key:"cell_paddingLeftRight",sides:["left","right"]},{key:"cell_paddingTopBottom",sides:["top","bottom"]}].forEach(({key:c,sides:d})=>{e[c]!==void 0&&(t=r.parseTableElementToModel(o),l=r.updateCellPaddingByIds(t,n,d,e[c]))}),e.cell_padding&&(t=r.parseTableElementToModel(o),l=r.updateCellPaddingByIds(t,n,["top"],e.cell_padding.top),l=r.updateCellPaddingByIds(l,n,["bottom"],e.cell_padding.bottom),l=r.updateCellPaddingByIds(l,n,["left"],e.cell_padding.left),l=r.updateCellPaddingByIds(l,n,["right"],e.cell_padding.right));const s=r.addClassToCellsByIds(l,n,a.TEMPORARY_CELL_CLASS);o.innerHTML=r.tableModelToHtml(s)}function Pf(e,o){if(e.collapsed)return!1;const{startContainer:t,endContainer:n}=e;return!t.isConnected||!n.isConnected?!1:o.contains(t)&&o.contains(n)}function Hf(e,o,t,n,r,i,l){const s=[a.CLASS_FOR_BASIC_CELL,a.CLASS_BACKGROUND_ACTIVE_CELL],c=window.getSelection();if(!c||c.rangeCount===0)return;const d=c.getRangeAt(0).cloneRange();if(t.querySelector(".remove-basic-cell")&&(r=l.getCellsWithClasses(n,s),l.state.set("activeCell",r),document.querySelectorAll(`.${a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR}`).forEach(g=>{g.classList.remove(a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR)})),!r.length)return;if(r.length===1){const g=t.querySelector(`td.${a.CLASS_BACKGROUND_ACTIVE_CELL}, td.${a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR}, td.${a.CLASS_FOR_BASIC_CELL}`),m=g?.querySelector(":scope > div")??g?.querySelector(":scope > editor > div");if(m){if(l.wrapEditor(m,!0),l.textStyleProperties.some(f=>Object.prototype.hasOwnProperty.call(e,f))){if(Pf(d,m))l.addNewRange(d);else{const f=document.createRange();f.selectNodeContents(m),l.addNewRange(f)}try{l.toggleTextStyle(m,{settings:e})}catch{}}if(o==="linkHref"&&typeof e.linkHref=="string"){const f=m.tagName==="A"?m:m.querySelector("a");f&&f.setAttribute("href",e.linkHref)}o==="textAlign"&&(e.textAlign?m.setAttribute("align",e.textAlign):i?.style?.textAlign?i.style.removeProperty("text-align"):m.removeAttribute("align")),e.valign?m.closest("td")?.setAttribute("valign",e.valign):e.valign===""&&m.closest("td")?.removeAttribute("valign");return}}n=l.parseTableElementToModel(t);const u=l.addClassToCellsByIds(n,r,a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR);t.innerHTML=l.tableModelToHtml(u),t.querySelectorAll(`td.${a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR} > div`).forEach(g=>{l.wrapEditor(g,!0);const m=c.getRangeAt(0);if(m.selectNode(g),l.addNewRange(m),l.textStyleProperties.some(f=>Object.prototype.hasOwnProperty.call(e,f)))try{l.toggleTextStyle(g,{settings:e})}catch{}if(o==="linkHref"&&typeof e.linkHref=="string"){const f=g.tagName==="A"?g:g.querySelector("a");f&&f.setAttribute("href",e.linkHref)}o==="textAlign"&&(e.textAlign?g.setAttribute("align",e.textAlign):i?.style?.textAlign?i.style.removeProperty("text-align"):g.removeAttribute("align")),e.valign?g.closest("td")?.setAttribute("valign",e.valign):e.valign===""&&g.closest("td")?.removeAttribute("valign")})}function If(e,o){document.querySelectorAll(`.${a.CLASS_FOR_BASIC_CELL}`).forEach(r=>{r.classList.remove(a.CLASS_FOR_BASIC_CELL)}),document.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).forEach(r=>{r.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL)});let t=o.parseTableElementToModel(e);e.getAttribute("style")?.includes("border-collapse:")&&(t=o.removeOuterBorders(t)),e.getAttribute("class")?.includes("em-mob-border_")&&(t=o.removeOuterBorders(t)),t=o.simplifyBorders(t),e.innerHTML=o.tableModelToHtml(t);const n=e.querySelectorAll(`.${a.TEMPORARY_CELL_CLASS}`);n.length>0&&(n[0].setAttribute("em-edit",""),n.forEach(r=>{r.classList.remove(a.TEMPORARY_CELL_CLASS)})),o.commit()}function Of(e,o){let t=!1;const{activeElement:n}=o;if(typeof e.linkHref=="string"&&Df(e.linkHref,o),o.textStyleProperties.some(r=>e.hasOwnProperty(r)))try{o.toggleTextStyle(n,{settings:e})}catch{}if(e.mobileFontSize){const r=n.closest('[class*="em-mob-font_size"]')||n.closest('[style*="font-size"]');o.setElementMobileFontSize({settings:e,elem:r}),t=!0}if(e.mobileLineHeight){const r=n.closest('[class*="em-mob-line_height"]')||n.closest('[style*="line-height"]');o.setElementMobileLineHeight({settings:e,elem:r}),t=!0}return e.textAlign!==void 0&&Ff(e.textAlign,n),e.mobileTextAlign&&(qf(e,n,o),t=!0),(typeof e.textSuperscript=="boolean"||typeof e.textSubscript=="boolean")&&o.handleTextScriptSettings(e,{unwrapNestedTags:o.unwrapNestedTags,wrapInTag:o.wrapInTag,unwrapTag:o.unwrapTag,isRangeMatching:o.isRangeMatching,splitWrapper:o.splitWrapper,cleanEmptyTags:o.cleanEmptyTags,applicationElementSettingsSet:o.applicationElementSettingsSet,commit:o.commit}),e.textAnchor!==void 0&&o.handleTextAnchor(e.textAnchor,{activeElement:n,commit:o.commit}),e.textReplacer!==void 0&&o.handleTextReplacer(e.textReplacer,{activeElement:n,compareStrings:o.compareStrings}),(e.hasOwnProperty("listUL")||e.hasOwnProperty("listOL"))&&xf(e,n),o.isElementList&&Wf(e,o),t}function xf(e,o){const t=a.STANDARD_LIST_CONTAINER_TAGS.includes(o.tagName)?o:o.closest(a.STANDARD_LIST_CONTAINER_SELECTOR);if(!t)return;const n=e.listOL!==void 0;(n?e.listOL:e.listUL)?Gi(t,n):Zi(t)}function Df(e,o){let t=document.querySelector("[em-edit]");if(!t)return;let n=t.tagName==="A"?t:t.closest("a"),r=t.closest(".alignment")||t.closest(".button_block")||t.closest("td");if(r||(r=t.closest("div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, a, sup, sub"),r||(r=document.querySelector("td")?.closest("div, p, td")||null)),!n&&r&&(n=r.querySelector("a")),n&&(n.setAttribute("href",e),Lt(e)&&n.removeAttribute("target")),r){const i=o.collectVMLContent(r);if(i){const l=document.createElement("div");l.innerHTML=i;const s=l.querySelector("v\\:roundrect"),c=l.querySelector("a");(s||c)&&(s&&s.setAttribute("href",e),c&&c.setAttribute("href",e),o.updateVMLComments(r,l.innerHTML))}}}function Ff(e,o){const t=Tt(o);t&&(e?t.style.textAlign?t.style.textAlign=e:t.setAttribute("align",e):t.style.textAlign?t.style.removeProperty("text-align"):t.removeAttribute("align"))}function qf(e,o,t){const n=Tt(o);if(!n)return;const r=e.mobileTextAlign?.classNamePrefix||"em-mob-text_align-";ol(o,n,r),t.setElementMobileAlign({settings:e,elem:n,fieldName:"mobileTextAlign"})}function Wf(e,o){const{activeElement:t,classNameOl:n,classNameUl:r}=o,i=t.closest(`table.${n}`)||t.closest(`table.${r}`);if(!i)return;const l=i.outerHTML,s=o.removeEditorTags(l);e.SpacingBetweenParagraphs&&(i.innerHTML=o.updateTableStyle(s,"padding-bottom",e.SpacingBetweenParagraphs)),e.SpacingBetweenBulletsAndText&&(i.innerHTML=o.updateTableStyle(s,"padding-left",e.SpacingBetweenBulletsAndText)),e.BulletType&&(i.innerHTML=o.changeBullets(s,e.BulletType)),e.ColorBullets&&(i.innerHTML=o.changeBulletsColor(s,e.ColorBullets)),e.BulletsSize&&(i.innerHTML=o.changeBulletsSize(s,e.BulletsSize)),e.hasOwnProperty("BulletTextItalic")&&(i.innerHTML=o.changeBulletsItalic(s,e.BulletTextItalic)),e.hasOwnProperty("BulletTextStrong")&&(i.innerHTML=o.changeBulletsWeight(s,e.BulletTextStrong)),e.hasOwnProperty("BulletTextStrikethrough")&&(i.innerHTML=o.changeBulletsStrikethrough(s,e.BulletTextStrikethrough)),e.hasOwnProperty("BulletTextUnderline")&&(i.innerHTML=o.changeBulletsUnderline(s,e.BulletTextUnderline)),e.hasOwnProperty("BulletsFontFamily")&&o.isElementListOL&&(i.innerHTML=$f(e.BulletsFontFamily,s,o));let c=o.findElementWithSelectedText(t.textContent||"",i);c===null&&(c=i),c.hasAttribute("em-edit")||c.setAttribute("em-edit","active"),o.commit()}function $f(e,o,t){const n=document.createElement("div");n.innerHTML=o;const r=n.querySelector("table.em-element-list-ol");return r?(r.querySelectorAll("tr").forEach(i=>{const l=i.querySelector("td:first-child > div");l&&(e?e[0]==="Safe Fonts"?(l.style.fontFamily=e[1],t.removeClassesByPrefix(l,"em-font"),t.clearLinkTags({elem:document.head})):e[0]==="Google Fonts"&&(e[1]==="Sans Serif"?l.style.fontFamily="Helvetica, Arial, sans-serif":e[1]==="Serif"?l.style.fontFamily='"Times New Roman", Times, serif':e[1]==="Project Fonts"&&a.applyProjectFontInlineFallback(l,e[2]),t.removeClassesByPrefix(l,"em-font"),l.classList.add(t.createFontClassName(e)),a.markProjectFontClass(l,e),t.addFontFamilyClass({fontFamilyArray:e})):l.style.removeProperty("font-family"))}),n.innerHTML):o}function zf(e,o){let t=!1;const{activeElement:n}=o;if(e.link!==void 0){const r=o.getActiveEditElement();if(!r)return t;if(e.link!==""){const i=r.closest("a");if(i)i.setAttribute("href",e.link);else{const l=document.createElement("a");l.setAttribute("href",e.link),l.setAttribute("target","_blank"),r.parentNode?.insertBefore(l,r),l.appendChild(r),o.setCursorPosition(l)}}else{const i=r.closest("a");i&&(i.replaceWith(...i.childNodes),o.setCursorPosition(r))}}if(e.src!==void 0&&a.isSrcElement(n)&&a.setRenderedAttribute(n,"src",e.src??""),e.src!==void 0&&qn(),e.alt!==void 0&&n.setAttribute("alt",e.alt),e.title?n.setAttribute("title",e.title):e.title===""&&n.removeAttribute("title"),e.border&&o.setElementBorder({settings:e,elem:n}),e.boxShadow&&o.setElementBoxShadow({settings:e,elem:n}),e.align&&e.align!=="undefined"?n.closest("div, p, td")?.setAttribute("align",e.align):e.align===""&&n.closest("div, p, td")?.removeAttribute("align"),e.valign?n.style.verticalAlign=e.valign:e.valign===""&&n.style.removeProperty("vertical-align"),e.width&&(e.width.value!==void 0&&e.width.value!==null?(n.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")),n.style.width="100%",n.style.maxWidth=e.width.value+e.width.dim):(n.setAttribute("width","0"),n.style.width="100%",n.style.maxWidth="0")),e.height&&(e.height.value!==void 0&&e.height.value!==null?(n.setAttribute("height",e.height.value+(e.height.dim==="px"?"":"%")),n.style.height=e.height.value+e.height.dim):(n.removeAttribute("height"),n.style.removeProperty("height"))),e.borderRadius&&o.setElementBorderRadius({settings:e,elem:n}),e.mobileWidth&&(o.setElementMobileWidth({settings:e,elem:n}),t=!0),e.mobileHeight&&(o.setElementMobileHeight({settings:e,elem:n}),t=!0),e.mobileBorder&&(o.setElementMobileBorder({settings:e,elem:n}),t=!0),e.mobileBorderRadius&&(o.setElementMobileBorderRadius({settings:e,elem:n}),t=!0),e.mobileBoxShadow&&(o.setElementMobileBoxShadow({settings:e,elem:n}),t=!0),e.mobileAlign){const r=n.closest("div, p, td");r&&o.setElementMobileAlign({settings:e,elem:r}),t=!0,e.mobileAlign.value?n.style.display="inline-block":n.style.display="block"}if(e.mobileVerticalAlign&&(o.setElementMobileVerticalAlign({settings:e,elem:n}),t=!0),e.show&&(o.setElementShow({settings:e,elem:n}),t=!0),e.countdown){const r=new Image;r.onload=function(){n.setAttribute("width",String(Math.round(this.width/2))),n.style.maxWidth=Math.round(this.width/2)+"px"};const i=e.countdown?.link??"";r.src=i,a.setRenderedAttribute(n,"src",i),n.setAttribute("em-cd-settings",e.countdown.params)}if(e.video&&n.setAttribute("em-video-settings",JSON.stringify(e.video)),e.imgReplacer){const r=e.imgReplacer??"",i=n.closest("em-replace");if(i)a.setRenderedAttribute(i,"src",r);else{const l=document.createElement("em-replace");a.setRenderedAttribute(l,"src",r),n.parentNode?.insertBefore(l,n),l.appendChild(n)}}else if(e.imgReplacer===""){const r=n.closest("em-replace");r&&(r.parentNode?.insertBefore(n,r),r.remove())}return t}function Vf(e,o){const{activeElement:t,textStyleProperties:n,toggleTextStyle:r}=o;if(e.href!==void 0&&(t.setAttribute("href",e.href),Lt(e.href)&&t.removeAttribute("target")),e.target&&!(e.href&&Lt(e.href))&&t.setAttribute("target",e.target),n.some(i=>e.hasOwnProperty(i)))try{r(t,{settings:e})}catch{}}function Uf(e,o){const{activeElement:t,setElementMobileHeight:n}=o;let r=!1;if(e.height)if(t.tagName==="DIV"){const i=e.height.value+e.height.dim;t.style.height=i,t.style.lineHeight=i,t.style.fontSize=e.height.value>10?parseInt(e.height.value)-2+e.height.dim:"8px"}else t.tagName==="TD"&&t.setAttribute("height",String(e.height.value));return e.mobileHeight&&(n({settings:e,elem:t}),r=!0),r}function jf(e,o){const{activeElement:t,isVariableText:n}=o,r=t.nextSibling?.nodeType===8?t.nextSibling:null;if(!r||!e.value)return;let i=e.value;i.startsWith("<!--")&&(i=i.substring(4)),i.endsWith("-->")&&(i=i.substring(0,i.length-3)),n(`<!--${i}-->`)?r.nodeValue=i:r.replaceWith(i)}function Gf(e,o){const{elem:t,message:n,activateSection:r}=e;if(t.closest("table")?.parentElement?.tagName!=="BODY"){n.settings.parent=o.getElementParentCaption(t);let s=t;if(t.tagName==="IMG"){const c=t.closest('div[em="atom"]'),d=t.closest(".em-element-resize-img-container");s=c||d}else t.closest("editor")?s=t.parentElement:t.tagName==="TD"&&t.classList.contains("em-vindent")?s=t.closest(".em-vindent-table"):t.tagName==="TD"&&t.parentElement?.getAttribute("em")==="block"&&(s=t.parentElement);n.settings.nextElem=!!s?.nextElementSibling&&(!s.nextElementSibling.getAttribute("contenteditable")||s.nextElementSibling.getAttribute("contenteditable")!=="false"),n.settings.prevElem=!!s?.previousElementSibling&&(!s.previousElementSibling.getAttribute("contenteditable")||s.previousElementSibling.getAttribute("contenteditable")!=="false")}else n.settings.parent=void 0;(t.closest('div[style*="inline-block"]')||t.closest(".em-mob-wrap, .noresp-em-mob-wrap"))&&(n.settings.floatBlocks=o.getStructureColumns({elem:t})),r&&(n.settings.activateSection=r),t.classList.contains("em-mob-wrap")||t.classList.contains("noresp-em-mob-wrap")||t.parentElement?.hasAttribute("em")&&t.parentElement.getAttribute("em")==="group"&&document.querySelectorAll('[em="group"]').length===1?n.settings.deletable=!1:n.settings.deletable=!0,n.settings.usedColors=o.getUsedColors(),n.settings.path=o.getElementPath(t);const i=o.getCurrentElementPath();n.type==="button"&&(n.settings.commonStyles=o.commonStyles);const l=t?.classList;return o.ampService.hasAmp&&l&&(l.contains("em-amp-show-only")?n.settings.ampShow="amp":l.contains("em-amp-show-disabled")?n.settings.ampShow="html":n.settings.ampShow="all"),n.settings=o.mapObj.unescape(n.settings),{message:n,elementPath:i}}function Yf(e,o,t,n){let r=!1,i=!1;if(o.shouldResetProgrammaticSelection&&(i=!0,!o.settings||Object.keys(o.settings).length===0))return r=!0,{shouldReturn:r,isProgrammaticSelectionReset:i};if(o.removeEmEdit){if(n.removeAllAttributes("em-edit"),o.setEmEditOnTd){for(const l of e.querySelectorAll("[contenteditable]"))l.removeAttribute("contenteditable");e.querySelector("td")?.setAttribute("em-edit","active")}if(o.editTargetTd){const l=e.closest("table")?.closest("td");if(l)for(const s of l.querySelectorAll("[contenteditable]"))s.removeAttribute("contenteditable");o.editTargetTd.setAttribute("em-edit","active")}}return o.isNewLink&&(e.removeAttribute("new"),t.settings.isNewLink=!0,e.setAttribute("em-edit","active")),{shouldReturn:r,isProgrammaticSelectionReset:i}}function Kf(e,o,t,n){if(!document.body.classList.contains("mceNonEditable")&&!(!o&&t)){if(n.removeAllAttributes("em-edit"),e.tagName!=="TABLE"){a.resolveActiveElement(e).setAttribute("em-edit","active");const r=e.closest("table");if(r){for(const s of r.querySelectorAll('[contenteditable="true"]'))s.tagName!=="EDITOR"&&s.removeAttribute("contenteditable");const i=r.querySelector("editor"),l=i?.firstChild;i?.childNodes.length===1&&l?.nodeType===1&&l?.tagName==="A"&&l?.childNodes.length===1&&l?.firstChild?.nodeType===3?l.setAttribute("contenteditable","true"):i?.setAttribute("contenteditable","true")}}[...e.parentElement?.querySelectorAll("strike, s")||[]].forEach(r=>r.style.textDecoration="line-through"),[...e.parentElement?.getElementsByTagName("u")||[]].forEach(r=>r.style.textDecoration="underline")}}function Xf(e,o){const t=o.getSelectedText(),n=window.getSelection(),r=o.getRangeFromSelection(n);let i=null,l=null,s=null;function c(d){let u=d;u.nodeType===Node.TEXT_NODE&&(u=u.parentNode);const g=u?.closest("em-replace");return e?g?.textContent||null:g?.getAttribute("text")||null}return r&&(t?(l=c(r.startContainer),s=c(r.endContainer),l?.length&&s?.length&&l!==s&&(l=s=null)):i=c(r.commonAncestorContainer)),t?l||s:i}function Zf(e,o){let t=o.getVariableByIcon(e)||!o.htmlDocument.getMappedParent(e)?e:o.htmlDocument.getVisibleNode(e);if(t.closest("a")&&o.findOutermostParentWithText(t,"a")&&t.tagName!=="IMG"&&t.tagName!=="AMP-IMG"&&(t=o.findOutermostParentWithText(t,"a")),t?.closest(".em-vindent")){const n=t.closest('div[style*="height"][style*="line-height"]');n?t=n:t=t.closest("td")}return t.tagName==="DIV"&&t.closest("amp-accordion")&&setTimeout(()=>{o.sendResizeEvent()},350),(t?.closest(".em-element-resize-img")||t?.closest(".em-element-img-change-group")||t?.closest(".em-element-resize-img-container"))&&(t=t.closest(".em-element-resize-img-container").querySelector("img")),(t.tagName==="TD"&&t.classList.contains("em-mob-wrap")&&(t.cellIndex+1)%2===0||t.closest(".em-gap"))&&(t=t.closest('[em="block"] > td')),t}function Jf(e,o){const{elem:t,isCellCustomTable:n,listContext:r,requestElemBullet:i,variableElement:l}=e,{isListOL:s,isListUL:c,isList:d}=r;return{Locale:o.Locale,isProgrammaticSelection:o.isProgrammaticSelection,isCellCustomTable:n,extractorContext:{variableElement:l,requestElemBullet:i,isElementListOL:s,isElementListUL:c,isElementList:d},customTableContext:{getElementTdDiv:o.getElementTdDiv,parseTableElementToModel:o.parseTableElementToModel,extractBorderRadius:o.extractBorderRadius,parseBackgroundStyles:o.parseBackgroundStyles,getFontFamilyFromElement:o.getFontFamilyFromElement,textHasStyle:o.textHasStyle,isElementHasBold:o.isElementHasBold,getLineHeghtInPixels:o.getLineHeghtInPixels,activeCell:o.activeCell,CLASS_FOR_BASIC_CELL:o.CLASS_FOR_BASIC_CELL,requestElemWithStyle:o.requestElemWithStyle},elementContext:{getElementTdDiv:o.getElementTdDiv,getLineHeghtInPixels:o.getLineHeghtInPixels},linkTextContext:{variableElement:l,requestElemBullet:i,isElementListOL:s,isElementListUL:c,isElementList:d,findElementWithSelectedText:o.findElementWithSelectedText,selectedText:o.getSelectedText()},_isCarouselElement:o._isCarouselElement,_isAccordionElement:o._isAccordionElement,_isSocialBlockElement:o._isSocialBlockElement,_isImageElement:o._isImageElement,_isLinkElement:o._isLinkElement,_isButtonElement:o._isButtonElement,_isTableElement:o._isTableElement,_isCustomTableElement:o._isCustomTableElement,_isAtomElement:o._isAtomElement,_isTdColumnGroup:o._isTdColumnGroup,_isTdStructure:o._isTdStructure,_isEmptyTd:o._isEmptyTd,_isTdCell:o._isTdCell,_isVindentTd:o._isVindentTd,_isVindentDiv:o._isVindentDiv,_isFloatBlockElement:o._isFloatBlockElement,_isDivTextElement:o._isDivTextElement,_isInlineButtonElement:o._isInlineButtonElement,_extractTextSettings:o._extractTextSettings,_extractCarouselSettings:o._extractCarouselSettings,_extractAccordionSettings:o._extractAccordionSettings,_extractSocialSettings:o._extractSocialSettings,_extractImgSettings:o._extractImgSettings,_extractButtonSettings:o._extractButtonSettings,_extractLinkTextSettings:o._extractLinkTextSettings,_extractTableSettings:o._extractTableSettings,_extractCustomTableSettings:o._extractCustomTableSettings,_extractAtomElementSettings:o._extractAtomElementSettings,_extractProgrammaticElementSettings:o._extractProgrammaticElementSettings,_extractTdColumnGroupSettings:o._extractTdColumnGroupSettings,_extractTdStructureSettings:o._extractTdStructureSettings,_extractTdCellSettings:o._extractTdCellSettings,_extractVindentSettings:o._extractVindentSettings,_extractFloatBlockSettings:o._extractFloatBlockSettings,_extractDivContainerSettings:o._extractDivContainerSettings,_clearActiveEditElements:o._clearActiveEditElements,HTMLDocument:o.HTMLDocument,parseFromString:o.parseFromString,getParentElementOfSelection:o.getParentElementOfSelection}}function Qf(e){return["EM-REPLACE","EDITOR","B","STRONG","U","S","STRIKE","SPAN","FONT","I","EM","P","A","H1","H2","H3","H4","H5","H6","SUP","SUB"].includes(e)}function ep(e,o,t){const{Locale:n,isProgrammaticSelection:r,isCellCustomTable:i}=t;if(!o&&!e.closest("a")&&!r&&!i){let l=e;e.querySelector("editor")&&(l=t.getParentElementOfSelection());const s=t._extractTextSettings({elem:l},n,t.extractorContext);return{type:s.type,caption:s.caption,settings:s}}if(t._isCarouselElement(e)){const l=t._extractCarouselSettings({elem:e},n,{clearActiveEditElements:t._clearActiveEditElements});return{type:l.type,caption:l.caption,settings:l}}if(t._isAccordionElement(e)){const l=t._extractAccordionSettings({elem:e},n,{clearActiveEditElements:t._clearActiveEditElements,HTMLDocument:t.HTMLDocument,parseFromString:t.parseFromString});return{type:l.type,caption:l.caption,settings:l}}if(t._isSocialBlockElement(e)){const l=t._extractSocialSettings({elem:e},n);return{type:l.type,caption:l.caption,settings:l}}if(t._isImageElement(e)){const l=t._extractImgSettings({elem:e},n);return{type:l.type,caption:l.caption,settings:l}}if(t._isLinkElement(e,i)){if(t._isButtonElement(e)){const c=t._extractButtonSettings({elem:e},n),d={type:c.type,caption:c.caption,settings:c};return e.getAttribute("new")&&(d.isNewLink=!0),d}const l=t._extractLinkTextSettings({elem:e},n,t.linkTextContext),s={type:l.type,caption:l.caption,settings:l};return e.getAttribute("new")&&(s.isNewLink=!0),s}if(t._isTableElement(e)){const l=t._extractTableSettings({elem:e},n);return{type:l.type,caption:l.caption,settings:l.type!=="emptyTable"?l:{}}}if(e.tagName==="LI"&&Kt(e)){const l=t._extractTextSettings({elem:e},n,t.extractorContext);return{type:l.type,caption:l.caption,settings:l}}if(t._isCustomTableElement(e)){const l=t._extractCustomTableSettings({elem:e},n,t.customTableContext);return{type:l.type,caption:l.caption,settings:l.settings}}if(t._isAtomElement(e)){const l=t._extractAtomElementSettings({elem:e},n,t.elementContext);return{type:l.type,caption:l.caption,settings:l,removeEmEdit:!0,setEmEditOnTd:!0}}if(r){const l=t._extractProgrammaticElementSettings({elem:e},n,t.elementContext);return l.settings?{type:l.settings.type,caption:l.settings.caption,settings:l.settings,removeEmEdit:!0,editTargetTd:l.editTargetTd,shouldResetProgrammaticSelection:l.shouldResetProgrammaticSelection}:{type:null,settings:{},shouldResetProgrammaticSelection:!0}}if(t._isTdColumnGroup(e)){const l=t._extractTdColumnGroupSettings({elem:e},n,{getElementTdDiv:t.elementContext.getElementTdDiv});return{type:l.type,caption:l.caption,settings:l.settings}}if(t._isTdStructure(e)){const l=t._extractTdStructureSettings({elem:e},n,{getElementTdDiv:t.elementContext.getElementTdDiv});return{type:l.type,caption:l.caption,settings:l.settings}}if(t._isEmptyTd(e))return{type:"emptyTd",settings:{}};if(t._isTdCell(e)){const l=t._extractTdCellSettings({elem:e},n,{getElementTdDiv:t.elementContext.getElementTdDiv});return{type:l.type,caption:l.caption,settings:l.settings}}if(t._isVindentTd(e)){const l=t._extractVindentSettings({elem:e},n);return{type:l.type,caption:l.caption,settings:l}}if(t._isVindentDiv(e)){const l=t._extractVindentSettings({elem:e},n);return{type:l.type,caption:l.caption,settings:l}}if(t._isFloatBlockElement(e)){const l=t._extractFloatBlockSettings({elem:e},n);return{type:l.type,caption:l.caption,settings:l}}if(t._isDivTextElement(e)){const l=t._extractTextSettings({elem:e},n,t.extractorContext);return{type:l.type,caption:l.caption,settings:l}}if(e.tagName==="DIV"||e.tagName==="TD"&&e.firstChild?.tagName==="EDITOR"){const l=t._extractDivContainerSettings({elem:e},n,{getElementTdDiv:t.elementContext.getElementTdDiv});return{type:l.type,caption:l.caption,settings:l}}if(Qf(e.tagName)&&(e.tagName!=="EM-REPLACE"||!e.closest("a"))){if(t._isInlineButtonElement(e)){const l=t._extractButtonSettings({elem:e},n);return{type:l.type,caption:l.caption,settings:l}}if(!r){const l=t._extractTextSettings({elem:e},n,t.extractorContext);return{type:l.type,caption:l.caption,settings:l}}}return{type:null,settings:{}}}function cn(e,o){o[1]==="Sans Serif"?e.style.fontFamily="Helvetica, Arial, sans-serif":o[1]==="Serif"?e.style.fontFamily='"Times New Roman", Times, serif':o[1]==="Project Fonts"&&a.applyProjectFontInlineFallback(e,o[2])}function tp(e,o){const t=e?.toLowerCase();return t==="#ffffff"&&t!==o?.toLowerCase()}function op(e,o){const{lockEditor:t,commonStyles:n,globalHolder:r}=o;if(t)return;const i=document.querySelectorAll('div[style*="font-family"]');np(e,i,o),rp(e,i,o),lp(e,o),ap(e,o),mp(e,o),up(e,o);const l={operation:"application_commonStyles_update",settings:{commonStyles:n}};o.messageService.send(l)}function np(e,o,t){const{commonStyles:n,rgbToHex:r}=t;if(e.textFontFamily!==void 0){let i=[];o.forEach(l=>{const s=l;let c;!s.style.display&&parseFloat(s.style.fontSize)<=20&&(i=e.textFontFamily,i[0]==="Safe Fonts"?(s.style.fontFamily=i[1],(c=[...s.classList].filter(d=>d.startsWith("em-font-"))[0])&&(s.classList.remove(c),n.text.fontFamily?.[2]&&t.clearLinkTags({elem:document.head,fontFamilyClassName:a.buildEmFontClassName(n.text.fontFamily[2],n.text.fontFamily[3])}),t.clearProjectFontFaces())):i[0]==="Google Fonts"&&(cn(s,i),t.removeClassesByPrefix(s,"em-font"),s.classList.add(t.createFontClassName(i)),a.markProjectFontClass(s,i)))}),i.length>0&&i[0]==="Google Fonts"&&t.addFontFamilyClass({fontFamilyArray:i}),t.clearProjectFontFaces(),n.text.fontFamily=e.textFontFamily}e.textFontSize!==void 0&&(o.forEach(i=>{const l=i;!l.style.display&&parseFloat(l.style.fontSize)<=20&&parseFloat(l.style.fontSize)>14&&(l.style.fontSize=e.textFontSize+"px")}),n.text.fontSize=e.textFontSize),e.textLineHeight!==void 0&&(o.forEach(i=>{const l=i;!l.style.display&&parseFloat(l.style.fontSize)<=20&&parseFloat(l.style.fontSize)>14&&(l.style.lineHeight=e.textLineHeight+"px")}),n.text.lineHeight=e.textLineHeight),e.textColor!==void 0&&(o.forEach(i=>{const l=i;!l.closest(".em-contrast-block")&&!l.style.display&&parseFloat(l.style.fontSize)<=20&&!tp(r(l.style.color),r(n.text.color))&&(l.style.color=e.textColor)}),n.text.color=e.textColor),e.textContrastColor!==void 0&&(o.forEach(i=>{const l=i;l.closest(".em-contrast-block")&&!l.style.display&&parseFloat(l.style.fontSize)<=20&&(l.style.color=e.textContrastColor)}),n.text.contrastColor=e.textContrastColor),e.textPaddingBottom!==void 0&&(o.forEach(i=>{const l=i;if(l.closest('[em="atom"]')){if(!l.style.display&&parseFloat(l.style.fontSize)<=20&&l.closest("table")?.getAttribute("em")=="atom"){const s=l.closest('[em="atom"]')?.querySelector(":scope > tr > td, :scope > tbody > tr > td");s&&(s.style.paddingBottom=e.textPaddingBottom+"px",s.querySelector(":scope > .em-vindent-paddingBottom")?.remove())}}else if(l.nextElementSibling){const s=l.nextElementSibling;if(!l.style.display&&parseFloat(l.style.fontSize)<=20&&l.parentElement?.getAttribute("em")=="atom"&&s&&s.tagName=="TABLE"&&(s.classList.contains("em-vindent-table")||s.querySelector("td")?.innerHTML=="")){s.querySelector("td")?.setAttribute("height",e.textPaddingBottom);const c=s.querySelector(".em-element-vindent-value");c&&(c.innerHTML=e.textPaddingBottom+"px",e.textPaddingBottom<30?s.querySelector(".em-vindent")?.classList.add("em-vindent_low"):s.querySelector(".em-vindent")?.classList.remove("em-vindent_low"))}}}),n.text.paddingBottom=e.textPaddingBottom)}function rp(e,o,t){const{commonStyles:n,rgbToHex:r}=t;if(e.headingFontFamily!==void 0){let i=[];o.forEach(l=>{const s=l;let c;!s.style.display&&parseFloat(s.style.fontSize)>20&&r(s.style.color).toLowerCase()!=="#eb3737"&&(i=e.headingFontFamily,i[0]==="Safe Fonts"?(s.style.fontFamily=i[1],(c=[...s.classList].filter(d=>d.startsWith("em-font-"))[0])&&(s.classList.remove(c),n.headings.fontFamily?.[2]&&t.clearLinkTags({elem:document.head,fontFamilyClassName:a.buildEmFontClassName(n.headings.fontFamily[2],n.headings.fontFamily[3])}),t.clearProjectFontFaces())):i[0]==="Google Fonts"&&(cn(s,i),t.removeClassesByPrefix(s,"em-font"),s.classList.add(t.createFontClassName(i)),a.markProjectFontClass(s,i)))}),i.length>0&&i[0]==="Google Fonts"&&t.addFontFamilyClass({fontFamilyArray:i}),t.clearProjectFontFaces(),n.headings.fontFamily=e.headingFontFamily}e.headingFontSize!==void 0&&(o.forEach(i=>{const l=i;!l.style.display&&parseFloat(l.style.fontSize)>=20&&r(l.style.color).toLowerCase()!=="#eb3737"&&parseFloat(l.style.fontSize)<=40&&(l.style.fontSize=e.headingFontSize+"px")}),n.headings.fontSize=e.headingFontSize),e.headingLineHeight!==void 0&&(o.forEach(i=>{const l=i;!l.style.display&&parseFloat(l.style.fontSize)>20&&r(l.style.color).toLowerCase()!=="#eb3737"&&parseFloat(l.style.fontSize)<=40&&(l.style.lineHeight=e.headingLineHeight+"px")}),n.headings.lineHeight=e.headingLineHeight),e.headingLetterSpacing!==void 0&&(o.forEach(i=>{const l=i;!l.style.display&&parseFloat(l.style.fontSize)>20&&r(l.style.color).toLowerCase()!=="#eb3737"&&(e.headingLetterSpacing>0?l.style.letterSpacing=e.headingLetterSpacing+"px":l.style.removeProperty("letter-spacing"))}),n.headings.letterSpacing=e.headingLetterSpacing),e.headingBold!==void 0&&(o.forEach(i=>{const l=i;!l.style.display&&parseFloat(l.style.fontSize)>20&&r(l.style.color).toLowerCase()!=="#eb3737"&&(e.headingBold?l.querySelector("b")?l.querySelector("b").replaceWith(...l.querySelector("b").childNodes):l.querySelector("strong")||(l.innerHTML="<strong>"+l.innerHTML+"</strong>"):l.querySelector("strong")?l.querySelector("strong").replaceWith(...l.querySelector("strong").childNodes):l.querySelector("b")&&l.querySelector("b").replaceWith(...l.querySelector("b").childNodes),l.style.fontWeight&&l.style.removeProperty("font-weight"))}),n.headings.bold=e.headingBold),e.headingItalic!==void 0&&(o.forEach(i=>{const l=i;!l.style.display&&parseFloat(l.style.fontSize)>20&&r(l.style.color).toLowerCase()!=="#eb3737"&&(e.headingItalic?l.querySelector("i")?l.querySelector("i").replaceWith(...l.querySelector("i").childNodes):l.querySelector("em")||(l.innerHTML="<em>"+l.innerHTML+"</em>"):l.querySelector("em")?l.querySelector("em").replaceWith(...l.querySelector("em").childNodes):l.querySelector("i")&&l.querySelector("i").replaceWith(...l.querySelector("i").childNodes),l.style.fontStyle&&l.style.removeProperty("font-style"))}),n.headings.italic=e.headingItalic),e.headingColor!==void 0&&(o.forEach(i=>{const l=i;!l.closest(".em-contrast-block")&&!l.style.display&&parseFloat(l.style.fontSize)>20&&r(l.style.color).toLowerCase()!=="#eb3737"&&(l.style.color=e.headingColor)}),n.headings.color=e.headingColor),e.headingContrastColor!==void 0&&(o.forEach(i=>{const l=i;l.closest(".em-contrast-block")&&!l.style.display&&parseFloat(l.style.fontSize)>20&&(l.style.color=e.headingContrastColor)}),n.headings.contrastColor=e.headingContrastColor),ip(e,o,t),e.blockDarkBackgroundColor!==void 0&&(n.block.darkBackgroundColor=e.blockDarkBackgroundColor)}function ip(e,o,t){const{commonStyles:n,rgbToHex:r}=t;e.headingPaddingTop!==void 0&&(o.forEach(i=>{const l=i;if(l.closest('[em="atom"]')){if(!l.style.display&&parseFloat(l.style.fontSize)>20&&r(l.style.color).toLowerCase()!=="#eb3737"&&l.closest("table")?.getAttribute("em")=="atom"){const s=l.closest('[em="atom"]')?.querySelector(":scope > tr > td, :scope > tbody > tr > td");s&&(s.style.paddingTop=e.headingPaddingTop+"px",s.querySelector(":scope > .em-vindent-paddingTop")?.remove())}}else if(l.previousElementSibling){const s=l.previousElementSibling;if(!l.style.display&&parseFloat(l.style.fontSize)>20&&r(l.style.color).toLowerCase()!=="#eb3737"&&l.parentElement?.getAttribute("em")=="atom"&&s&&s.tagName=="TABLE"&&(s.classList.contains("em-vindent-table")||s.querySelector("td")?.innerHTML=="")){s.querySelector("td")?.setAttribute("height",e.headingPaddingTop);const c=s.querySelector(".em-element-vindent-value");c&&(c.innerHTML=e.headingPaddingTop+"px",e.headingPaddingTop<30?s.querySelector(".em-vindent")?.classList.add("em-vindent_low"):s.querySelector(".em-vindent")?.classList.remove("em-vindent_low"))}}}),n.headings.paddingTop=e.headingPaddingTop),e.headingPaddingBottom!==void 0&&(document.querySelectorAll('div[style*="font-family"]').forEach(i=>{const l=i,s=l.closest('[em="atom"]');if(s){const c=s.querySelector(":scope > tr > td, :scope > tbody > tr > td");c?.style.paddingBottom&&!l.style.display&&parseFloat(l.style.fontSize)>20&&r(l.style.color).toLowerCase()!=="#eb3737"&&l.closest("table")?.getAttribute("em")=="atom"&&(c.style.paddingBottom=e.headingPaddingBottom+"px",c.querySelector(":scope > .em-vindent-paddingBottom")?.remove())}else if(l.nextElementSibling){const c=l.nextElementSibling;if(!l.style.display&&parseFloat(l.style.fontSize)>20&&r(l.style.color).toLowerCase()!=="#eb3737"&&l.parentElement?.getAttribute("em")=="atom"&&c&&c.tagName=="TABLE"&&(c.classList.contains("em-vindent-table")||c.querySelector("td")?.innerHTML=="")){c.querySelector("td")?.setAttribute("height",e.headingPaddingBottom);const d=c.querySelector(".em-element-vindent-value");d&&(d.innerHTML=e.headingPaddingBottom+"px",e.headingPaddingBottom<30?c.querySelector(".em-vindent")?.classList.add("em-vindent_low"):c.querySelector(".em-vindent")?.classList.remove("em-vindent_low"))}}}),n.headings.paddingBottom=e.headingPaddingBottom)}function lp(e,o){const{commonStyles:t}=o,n=document.querySelectorAll('a[style*="color"]');e.linkColor!==void 0&&(n.forEach(r=>{const i=r;!i.closest(".em-contrast-block")&&!i.style.display&&(i.style.color=e.linkColor)}),t.links.color=e.linkColor),e.linkContrastColor!==void 0&&(n.forEach(r=>{const i=r;i.closest(".em-contrast-block")&&!i.style.display&&(i.style.color=e.linkContrastColor)}),t.links.contrastColor=e.linkContrastColor),e.linkUnderline!==void 0&&(n.forEach(r=>{const i=r;if(!i.style.display){i.style.textDecoration=e.linkUnderline?"underline":"none";const l=i.parentElement;l&&l.tagName=="SPAN"&&l.style.textDecoration=="underline"&&l.replaceWith(...l.childNodes)}}),t.links.underline=e.linkUnderline)}function ap(e,o){const{commonStyles:t}=o,n=document.querySelectorAll('a[style*="font-family"]');if(e.buttonsFontFamily!==void 0){let r=[];n.forEach(i=>{const l=i;let s;l.style.display&&l.style.display=="block"&&(r=e.buttonsFontFamily,r[0]==="Safe Fonts"?(l.style.fontFamily=r[1],(s=[...l.classList].filter(c=>c.startsWith("em-font-"))[0])&&(l.classList.remove(s),t.buttons.fontFamily?.[2]&&o.clearLinkTags({elem:document.head,fontFamilyClassName:a.buildEmFontClassName(t.buttons.fontFamily[2],t.buttons.fontFamily[3])}),o.clearProjectFontFaces())):r[0]==="Google Fonts"&&(cn(l,r),o.removeClassesByPrefix(l,"em-font"),l.classList.add(o.createFontClassName(r)),a.markProjectFontClass(l,r)))}),r.length>0&&r[0]==="Google Fonts"&&o.addFontFamilyClass({fontFamilyArray:r}),o.clearProjectFontFaces(),t.buttons.fontFamily=e.buttonsFontFamily}e.buttonsFontSize!==void 0&&(n.forEach(r=>{const i=r;i.style.display&&i.style.display=="block"&&(i.style.fontSize=e.buttonsFontSize+"px")}),t.buttons.fontSize=e.buttonsFontSize),e.buttonsLetterSpacing!==void 0&&(n.forEach(r=>{const i=r;i.style.display&&i.style.display=="block"&&(e.buttonsLetterSpacing>0?i.style.letterSpacing=e.buttonsLetterSpacing+"px":i.style.removeProperty("letter-spacing"))}),t.buttons.letterSpacing=e.buttonsLetterSpacing),sp(e,n,o),cp(e,n,o),dp(e,n,o)}function sp(e,o,t){const{commonStyles:n}=t;e.buttonsColor!==void 0&&(o.forEach(r=>{const i=r;!i.closest(".em-contrast-block")&&i.style.display&&i.style.display=="block"&&(i.style.color=e.buttonsColor)}),n.buttons.color=e.buttonsColor),e.buttonsContrastColor!==void 0&&(o.forEach(r=>{const i=r;i.closest(".em-contrast-block")&&i.style.display&&i.style.display=="block"&&(i.style.color=e.buttonsContrastColor)}),n.buttons.contrastColor=e.buttonsContrastColor),e.buttonsBold!==void 0&&(o.forEach(r=>{const i=r;i.style.display&&i.style.display=="block"&&(e.buttonsBold?i.querySelector("b")?i.querySelector("b").replaceWith(...i.querySelector("b").childNodes):i.querySelector("strong")||(i.innerHTML="<strong>"+i.innerHTML+"</strong>"):i.querySelector("strong")?i.querySelector("strong").replaceWith(...i.querySelector("strong").childNodes):i.querySelector("b")&&i.querySelector("b").replaceWith(...i.querySelector("b").childNodes),i.style.fontWeight&&i.style.removeProperty("font-weight"))}),n.buttons.bold=e.buttonsBold),e.buttonsItalic!==void 0&&(o.forEach(r=>{const i=r;i.style.display&&i.style.display=="block"&&(e.buttonsItalic?i.querySelector("i")?i.querySelector("i").replaceWith(...i.querySelector("i").childNodes):i.querySelector("em")||(i.innerHTML="<em>"+i.innerHTML+"</em>"):i.querySelector("em")?i.querySelector("em").replaceWith(...i.querySelector("em").childNodes):i.querySelector("i")&&i.querySelector("i").replaceWith(...i.querySelector("i").childNodes),i.style.fontStyle&&i.style.removeProperty("font-style"))}),n.buttons.italic=e.buttonsItalic),e.buttonsBackgroundColor!==void 0&&(o.forEach(r=>{const i=r;if(!i.closest(".em-contrast-block")&&i.style.display&&i.style.display=="block"){const l=i.closest("td");l&&(l.getAttribute("bgcolor")&&(e.buttonsBackgroundColor?l.setAttribute("bgcolor",e.buttonsBackgroundColor):l.removeAttribute("bgcolor")),e.buttonsBackgroundColor?l.style.backgroundColor=e.buttonsBackgroundColor:l.style.removeProperty("background-color"))}}),n.buttons.backgroundColor=e.buttonsBackgroundColor),e.buttonsContrastBackgroundColor!==void 0&&(o.forEach(r=>{const i=r;if(i.closest(".em-contrast-block")&&i.style.display&&i.style.display=="block"){const l=i.closest("td");l&&(l.getAttribute("bgcolor")&&(e.buttonsContrastBackgroundColor?l.setAttribute("bgcolor",e.buttonsContrastBackgroundColor):l.removeAttribute("bgcolor")),e.buttonsContrastBackgroundColor?l.style.backgroundColor=e.buttonsContrastBackgroundColor:l.style.removeProperty("background-color"))}}),n.buttons.contrastBackgroundColor=e.buttonsContrastBackgroundColor),e.buttonsAlign!==void 0&&(o.forEach(r=>{const i=r;i.style.display&&i.style.display=="block"&&i.closest("td")?.setAttribute("align",e.buttonsAlign)}),n.buttons.textAlign=e.buttonsAlign)}function cp(e,o,t){const{commonStyles:n}=t;e.buttonsMarginTop!==void 0&&(o.forEach(r=>{const i=r,l=i.closest('[em="atom"]');if(l){const s=l.querySelector(":scope > tr > td, :scope > tbody > tr > td");s?.style.paddingTop&&i.style.display&&i.style.display=="block"&&(s.style.paddingTop=e.buttonsMarginTop+"px",s.querySelector(":scope > .em-vindent-paddingTop")?.remove())}else{const s=i.closest("table");if(s?.previousElementSibling){const c=s.previousElementSibling,d=i.closest("div");if(i.style.display&&i.style.display=="block"&&d&&d.getAttribute("em")=="atom"&&c&&c.tagName=="TABLE"&&(c.classList.contains("em-vindent-table")||c.querySelector("td")?.innerHTML=="")){c.querySelector("td")?.setAttribute("height",e.buttonsMarginTop);const u=c.querySelector(".em-element-vindent-value");u&&(u.innerHTML=e.buttonsMarginTop+"px",e.buttonsMarginTop<30?c.querySelector(".em-vindent")?.classList.add("em-vindent_low"):c.querySelector(".em-vindent")?.classList.remove("em-vindent_low"))}}}}),n.buttons.marginTop=e.buttonsMarginTop),e.buttonsMarginBottom!==void 0&&(o.forEach(r=>{const i=r,l=i.closest('[em="atom"]');if(l){const s=l.querySelector(":scope > tr > td, :scope > tbody > tr > td");s?.style.paddingBottom&&i.style.display&&i.style.display=="block"&&(s.style.paddingBottom=e.buttonsMarginBottom+"px",s.querySelector(":scope > .em-vindent-paddingBottom")?.remove())}else{const s=i.closest("table");if(s?.previousElementSibling){const c=s.nextElementSibling,d=i.closest("div");if(i.style.display&&i.style.display=="block"&&d&&d.getAttribute("em")=="atom"&&c&&c.tagName=="TABLE"&&(c.classList.contains("em-vindent-table")||c.querySelector("td")?.innerHTML=="")){c.querySelector("td")?.setAttribute("height",e.buttonsMarginBottom);const u=c.querySelector(".em-element-vindent-value");u&&(u.innerHTML=e.buttonsMarginBottom+"px",e.buttonsMarginBottom<30?c.querySelector(".em-vindent")?.classList.add("em-vindent_low"):c.querySelector(".em-vindent")?.classList.remove("em-vindent_low"))}}}}),n.buttons.marginBottom=e.buttonsMarginBottom)}function dp(e,o,t){const{commonStyles:n,setElementBorder:r,setElementBorderRadius:i}=t;e.buttonsBorder!==void 0&&(o.forEach(l=>{const s=l;if(s.style.display&&s.style.display=="block"){const c=s.closest("td");c&&r({settings:{border:e.buttonsBorder},elem:c})}}),e.buttonsBorder.all!==void 0&&(n.buttons.border.all=e.buttonsBorder.all),e.buttonsBorder.top!==void 0&&(n.buttons.border.top=e.buttonsBorder.top),e.buttonsBorder.right!==void 0&&(n.buttons.border.right=e.buttonsBorder.right),e.buttonsBorder.bottom!==void 0&&(n.buttons.border.bottom=e.buttonsBorder.bottom),e.buttonsBorder.left!==void 0&&(n.buttons.border.left=e.buttonsBorder.left)),e.buttonsBorderRadius!==void 0&&(o.forEach(l=>{const s=l;if(s.style.display&&s.style.display=="block"){const c=s.closest("td");c&&i({settings:{borderRadius:e.buttonsBorderRadius},elem:c})}}),e.buttonsBorderRadius.all!==void 0&&(n.buttons.borderRadius.all=e.buttonsBorderRadius.all),e.buttonsBorderRadius.topLeft!==void 0&&(n.buttons.borderRadius.topLeft=e.buttonsBorderRadius.topLeft),e.buttonsBorderRadius.topRight!==void 0&&(n.buttons.borderRadius.topRight=e.buttonsBorderRadius.topRight),e.buttonsBorderRadius.bottomRight!==void 0&&(n.buttons.borderRadius.bottomRight=e.buttonsBorderRadius.bottomRight),e.buttonsBorderRadius.bottomLeft!==void 0&&(n.buttons.borderRadius.bottomLeft=e.buttonsBorderRadius.bottomLeft)),e.buttonsPadding!==void 0&&(o.forEach(l=>{const s=l;s.style.display&&s.style.display=="block"&&(e.buttonsPadding.all!==void 0?(s.style.paddingTop=e.buttonsPadding.all+"px",s.style.paddingRight=e.buttonsPadding.all+"px",s.style.paddingBottom=e.buttonsPadding.all+"px",s.style.paddingLeft=e.buttonsPadding.all+"px"):((e.buttonsPadding.top!==void 0||e.buttonsPadding.top==0)&&(s.style.paddingTop=e.buttonsPadding.top+"px"),(e.buttonsPadding.right!==void 0||e.buttonsPadding.right==0)&&(s.style.paddingRight=e.buttonsPadding.right+"px"),(e.buttonsPadding.bottom!==void 0||e.buttonsPadding.bottom==0)&&(s.style.paddingBottom=e.buttonsPadding.bottom+"px"),(e.buttonsPadding.left!==void 0||e.buttonsPadding.left==0)&&(s.style.paddingLeft=e.buttonsPadding.left+"px")))}),e.buttonsPadding.all!==void 0&&(n.buttons.padding={all:e.buttonsPadding.all}),e.buttonsPadding.top!==void 0&&(n.buttons.padding={top:e.buttonsPadding.top}),e.buttonsPadding.right!==void 0&&(n.buttons.padding={right:e.buttonsPadding.right}),e.buttonsPadding.bottom!==void 0&&(n.buttons.padding={bottom:e.buttonsPadding.bottom}),e.buttonsPadding.left!==void 0&&(n.buttons.padding={left:e.buttonsPadding.left}))}function mp(e,o){const{commonStyles:t,setElementBorder:n,setElementBorderRadius:r}=o;t.cards||(t.cards={});const i=document.querySelectorAll(".em-contrast-card");e.cardsContrastBackgroundColor!==void 0&&(i.forEach(c=>{const d=c;d.getAttribute("bgcolor")&&(e.cardsContrastBackgroundColor?d.setAttribute("bgcolor",e.cardsContrastBackgroundColor):d.removeAttribute("bgcolor")),e.cardsContrastBackgroundColor?d.style.backgroundColor=e.cardsContrastBackgroundColor:d.style.removeProperty("background-color")}),t.cards.contrastBackgroundColor=e.cardsContrastBackgroundColor),e.cardsContrastTextColor!==void 0&&(i.forEach(c=>{c.querySelectorAll('div[style*="font-family"], span[style*="font-family"]').forEach(d=>{d.style.color=e.cardsContrastTextColor})}),t.cards.contrastTextColor=e.cardsContrastTextColor);const l=document.querySelectorAll(".em-card");e.cardsBaseBackgroundColor!==void 0&&(l.forEach(c=>{const d=c;d.getAttribute("bgcolor")&&(e.cardsBaseBackgroundColor?d.setAttribute("bgcolor",e.cardsBaseBackgroundColor):d.removeAttribute("bgcolor")),e.cardsBaseBackgroundColor?d.style.backgroundColor=e.cardsBaseBackgroundColor:d.style.removeProperty("background-color")}),t.cards.baseBackgroundColor=e.cardsBaseBackgroundColor),e.cardsBaseTextColor!==void 0&&(l.forEach(c=>{c.querySelectorAll('div[style*="font-family"], span[style*="font-family"]').forEach(d=>{d.style.color=e.cardsBaseTextColor})}),t.cards.baseTextColor=e.cardsBaseTextColor);const s=document.querySelectorAll(".em-card, .em-contrast-card");e.cardsBorderRadius!==void 0&&(t.cards.borderRadius||(t.cards.borderRadius={}),s.forEach(c=>{r({settings:{borderRadius:e.cardsBorderRadius},elem:c})}),e.cardsBorderRadius.all!==void 0&&(t.cards.borderRadius.all=e.cardsBorderRadius.all),e.cardsBorderRadius.topLeft!==void 0&&(t.cards.borderRadius.topLeft=e.cardsBorderRadius.topLeft),e.cardsBorderRadius.topRight!==void 0&&(t.cards.borderRadius.topRight=e.cardsBorderRadius.topRight),e.cardsBorderRadius.bottomRight!==void 0&&(t.cards.borderRadius.bottomRight=e.cardsBorderRadius.bottomRight),e.cardsBorderRadius.bottomLeft!==void 0&&(t.cards.borderRadius.bottomLeft=e.cardsBorderRadius.bottomLeft)),e.cardsBorder!==void 0&&(t.cards.border||(t.cards.border={}),s.forEach(c=>{n({settings:{border:e.cardsBorder},elem:c})}),e.cardsBorder.all&&(t.cards.border.all=e.cardsBorder.all),e.cardsBorder.top&&(t.cards.border.top=e.cardsBorder.top),e.cardsBorder.right&&(t.cards.border.right=e.cardsBorder.right),e.cardsBorder.bottom&&(t.cards.border.bottom=e.cardsBorder.bottom),e.cardsBorder.left&&(t.cards.border.left=e.cardsBorder.left))}function up(e,o){const{commonStyles:t,globalHolder:n}=o;if(!n)return;const r=n.classList.contains("full-wrap")?n.querySelector("td"):n;if(!r)return;(e.blockBackgroundColor!==void 0||e.blockBackgroundColor==="")&&bi(e.blockBackgroundColor,r,!1,t),(e.blockContrastBackgroundColor!==void 0||e.blockContrastBackgroundColor==="")&&bi(e.blockContrastBackgroundColor,r,!0,t);const i=document.querySelectorAll('[em="block"] > td');if(e.blockPadding!==void 0){const l=e.blockPadding;t.block||(t.block={}),t.block.padding||(t.block.padding={});const s=l.left!==void 0||l.right!==void 0;i.forEach(c=>{const d=c;l.top!==void 0&&(d.style.paddingTop=`${l.top}px`),l.right!==void 0&&(d.style.paddingRight=`${l.right}px`),l.bottom!==void 0&&(d.style.paddingBottom=`${l.bottom}px`),l.left!==void 0&&(d.style.paddingLeft=`${l.left}px`)}),["top","right","bottom","left"].forEach(c=>{l[c]!==void 0&&(t.block.padding[c]=l[c])}),s&&i.forEach(c=>{const d=c,u=d.querySelector(".em-mob-wrap"),g=d.parentElement?.getAttribute("em")==="block";u&&g&&d.querySelectorAll(":scope > table").forEach(m=>{o.setStructureBlocksWidth(m)})})}}function bi(e,o,t,n){const r=o.querySelector(".em-narrow-table"),i=t?'[em="block"].em-contrast-block > td':'[em="block"]:not(.em-contrast-block) > td',l=t?'[em="block"] > td > table > tr > [bgcolor]':'[em="block"]:not(.em-contrast-block) > td > table > tr > [bgcolor]',s=t?'[em="block"] > td > table > tr > [style*="background-color"]':'[em="block"]:not(.em-contrast-block) > td > table > tr > [style*="background-color"]';r?e===""?o.querySelectorAll(i).forEach(c=>{const d=c;d.removeAttribute("bgcolor"),d.style.removeProperty("background-color")}):o.querySelectorAll(i).forEach(c=>{const d=c;d.setAttribute("bgcolor",e),d.style.backgroundColor=e}):e===""?o.querySelector(l)?o.querySelectorAll(l).forEach(c=>{const d=c;d.removeAttribute("bgcolor"),d.style.removeProperty("background-color")}):o.querySelector(s)&&o.querySelectorAll(s).forEach(c=>{const d=c;d.removeAttribute("bgcolor"),d.style.removeProperty("background-color")}):o.querySelector(l)?o.querySelectorAll(l).forEach(c=>{const d=c;d.style.backgroundColor=e,d.setAttribute("bgcolor",e)}):o.querySelector(s)&&o.querySelectorAll(s).forEach(c=>{const d=c;d.style.backgroundColor=e,d.setAttribute("bgcolor",e)}),t?n.block.contrastBackgroundColor=e:n.block.backgroundColor=e}var fp=320;function hi(e){if(e==null||e==="")return null;if(typeof e=="number"&&!Number.isNaN(e))return e;if(typeof e=="object"&&e!==null&&"value"in e){const o=Number(e.value);return Number.isNaN(o)?null:o}return null}function yi(){for(const e of document.body.children)if(e.tagName==="DIV"||e.tagName==="CENTER"){const o=e;if(o.style.background||o.style.backgroundColor)return e;for(const t of e.children)if(t.tagName==="DIV"){if(o.style.background||o.style.backgroundColor)return e;for(const n of t.children){const r=n;if(r.getAttribute("width")==="100%"||r.style.width==="100%")return n}}else{const n=t;if(n.getAttribute("width")==="100%"||n.style.width==="100%")return t}}else{const o=e;if(o.getAttribute("width")==="100%"||o.style.width==="100%")return e}return null}function pp(e,o){const{globalHolder:t,emailWidth:n,state:r,findParentTr:i}=o,l=hi(e.width);if(l==null||l<fp||!t)return!1;function s(c){if(c.elem.nodeName==="#comment"&&c.elem.textContent?.indexOf("mso")!==-1)c.elem.textContent=c.elem.textContent.replace(/width=".*"/gi,`width="${c.width}"`);else{const d=c.elem.previousSibling;d&&s({elem:d,width:c.width})}}return t.querySelector(".em-narrow-table")||t.querySelector(".noresp-em-narrow-table")?(gp(t,l,n,s),bp(t,e,n,i,s)):Ep(t,l,n,s),n>500&&t.querySelectorAll(`[width="${n}"]`).forEach(c=>{c.setAttribute("width",String(l))}),Sp(l),r.set("emailWidth",l),!0}function gp(e,o,t,n){e.querySelectorAll('[style*="width"]').forEach(r=>{const i=r;i.style.verticalAlign||(i.style.width&&parseFloat(i.style.width)===t&&(i.style.width=o+"px"),i.style.maxWidth&&parseFloat(i.style.maxWidth)===t&&(i.style.maxWidth=o+"px"),i.style.minWidth&&parseFloat(i.style.minWidth)===t&&(i.style.minWidth=o+"px"),n({elem:i,width:o}))})}function bp(e,o,t,n,r){const i=[];e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(s=>{const c=n(s);c&&!i.includes(c)&&i.push(c)});const l=o.project==="useblocks"?640:660;i.forEach(s=>{const c=s.querySelector(".em-mob-wrap, .noresp-em-mob-wrap");if(!c)return;const d=c.parentElement?.closest("td"),u=parseFloat(d?.style.paddingLeft||"0")||0,g=parseFloat(d?.style.paddingRight||"0")||0,m=c.closest("table")?.parentElement?.getBoundingClientRect().width||0,f=s.querySelector(".em-mob-wrap:empty, .noresp-em-mob-wrap:empty")?660:l;if(s.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").length>1)hp(s)&&yp(s,m,u,g,f);else if(c.getAttribute("width")&&!c.classList.contains("em-insert-ignore")){const p=Math.round(m-u-g);c.setAttribute("width",String(p))}})}function hp(e){const o=e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)");for(let t=0;t<o.length;t++){const n=o[t];if(n.classList.contains("em-insert-ignore"))continue;const r=n.getAttribute("width");if(r!=null&&r!=="")return!0}return!1}function yp(e,o,t,n,r){const i=e.querySelector(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)"),l=i?parseFloat(i.getAttribute("width")||"0"):0,s=e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)"),c=s.length;let d=0,u=0;s.forEach(f=>{const p=f;if(p.getAttribute("width")&&!p.classList.contains("em-insert-ignore")){const b=parseFloat(p.getAttribute("width")||"0")/r,h=Math.round(o*b-l/(c*2));p.setAttribute("width",String(h)),d+=h}});const g=o-(t+n+l*(c-1)+d);s.forEach(f=>{const p=f;if(p.getAttribute("width")&&!p.classList.contains("em-insert-ignore")){const b=parseFloat(p.getAttribute("width")||"0")+Math.round(g/c);u+=b,p.setAttribute("width",String(b)),p.querySelectorAll("img").forEach(h=>{parseFloat(h.getAttribute("width")||"0")>b&&(h.setAttribute("width",String(b)),h.style.maxWidth=b+"px")})}}),u=u+l*(c-1)+t+n;const m=o-u;if(m!==0&&d>0){const f=e.querySelector(".em-mob-wrap:last-child, .noresp-em-mob-wrap:last-child");if(f&&!f.classList.contains("em-insert-ignore")){const p=parseFloat(f.getAttribute("width")||"0");f.setAttribute("width",String(p+m))}else{const p=e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)");for(let b=p.length-1;b>=0;b--){const h=p[b];if(h.classList.contains("em-insert-ignore"))continue;const y=parseFloat(h.getAttribute("width")||"0");h.setAttribute("width",String(y+m));break}}}}function Ep(e,o,t,n){e.querySelectorAll('div[style*="inline-block"]').forEach(r=>{const i=r;if(!i.getAttribute("em-floatblock-width")){const l=i.parentElement?.getBoundingClientRect().width||1;i.setAttribute("em-floatblock-width",String(i.getBoundingClientRect().width/l))}}),e.querySelectorAll('[style*="width"]').forEach(r=>{const i=r;i.style.verticalAlign||(i.style.width&&parseFloat(i.style.width)===t&&(i.style.width=o+"px"),i.style.maxWidth&&parseFloat(i.style.maxWidth)===t&&(i.style.maxWidth=o+"px"),i.style.minWidth&&parseFloat(i.style.minWidth)===t&&(i.style.minWidth=o+"px"),n({elem:i,width:o}))}),e.querySelectorAll('div[style*="inline-block"]').forEach(r=>{const i=r,l=i.parentElement?.getBoundingClientRect().width||0,s=parseFloat(i.getAttribute("em-floatblock-width")||"0"),c=i.getBoundingClientRect().width-(i.firstElementChild?.getBoundingClientRect().width||0),d=i.getBoundingClientRect().width-c;let u=0;i.style.maxWidth?(i.style.maxWidth=Math.floor(l*s)+"px",u=i.getBoundingClientRect().width-c,i.firstElementChild&&(i.firstElementChild.setAttribute("width",String(Math.round(u))),i.firstElementChild.style.maxWidth=Math.round(u)+"px")):i.style.width&&(i.style.width=Math.floor(l*s)+"px",u=i.getBoundingClientRect().width-c,i.firstElementChild?.setAttribute("width",String(u))),n({elem:i,width:Math.floor(l*s)}),i.removeAttribute("em-floatblock-width"),i.querySelectorAll("img").forEach(g=>{const m=parseFloat(g.getAttribute("width")||"0");(m>=u||m===d)&&(g.setAttribute("width",String(u)),g.style.maxWidth=u+"px")})})}function Sp(e){for(const o of document.head.querySelectorAll("style"))if(o.innerHTML.match(/@media.*?max((.|\n|\r)*?){/)){o.innerHTML=o.innerHTML.replace(/max-device-width:\d+px/gi,`max-device-width:${e}px`),o.innerHTML=o.innerHTML.replace(/max-width:\d+px/gi,`max-width:${e}px`);break}}function Cp(e,o){e.querySelectorAll("img, amp-img").forEach(t=>{const n=t;if(o){const r=n.getAttribute("width");if(r)if(n.style.width="100%",r.includes("%"))n.style.maxWidth=r;else{const i=parseFloat(r);Number.isNaN(i)||(n.style.maxWidth=`${i}px`)}}else n.style.removeProperty("width"),n.style.removeProperty("max-width")})}function vp(e,o){if(e.responsive===void 0||!o)return;const t=hi(e.width);if(e.responsive.shutdown){const n=o.querySelector(".noresp-em-narrow-table");if(n)n.className=n.className.replace(/noresp-em-narrow/gi,"em-narrow");else{const r=o.querySelector("table:first-child");r&&(r.setAttribute("width","100%"),r.style.width="100%",t!=null&&(r.style.maxWidth=t+"px"),r.style.minWidth="320px")}document.querySelectorAll('[class*="noresp-em-mob"]').forEach(r=>{r.className=r.className.replace(/noresp-em-mob/gi,"em-mob")}),document.documentElement.removeAttribute("style")}else{const n=o.querySelector(".em-narrow-table");if(n)n.className=n.className.replace(/em-narrow/gi,"noresp-em-narrow");else{const r=o.querySelector("table:first-child");r&&t!=null&&(r.setAttribute("width",String(t)),r.style.width=t+"px",r.style.maxWidth=t+"px",r.style.minWidth=t+"px")}document.querySelectorAll('[class*="em-mob"]:not([class*="noresp-em-mob"])').forEach(r=>{r.className=r.className.replace(/em-mob/gi,"noresp-em-mob")})}Cp(o,!!e.responsive.shutdown)}function Ap(e,o,t){const n=o.parentNode;n&&(n.style.backgroundColor="rgba(0,255,0,0.3)");let r="";document.head.querySelectorAll("style").forEach(s=>{r+=t.HTMLDocument.getInnerHtml(s)});const i=document.createElement("style");i.setAttribute("em","styles"),i.innerHTML=r;const l=a.serializeOuterHtml(i)+`
275
- `+t.HTMLDocument.getOuterHtml(e);navigator.clipboard.writeText(l),setTimeout(()=>{n&&n.style.removeProperty("background-color")},2e3)}function Tp(e,o,t){navigator.clipboard.readText().then(n=>{const r=t.parseFromString(n);let i=r.filter(d=>d.tagName&&d.tagName!=="LINK"&&d.tagName!=="STYLE").map(d=>t.getOuterHtml(d)).join(""),l=r.filter(d=>d.tagName==="STYLE").map(d=>t.getOuterHtml(d)).join("");const s=r.filter(d=>d.tagName==="LINK"&&d.getAttribute("em-class")).filter(d=>!document.head?.querySelector(`link[em-class="${d.getAttribute("em-class")}"]`));if(l){let d=document.head.querySelector('style[em="styles"]'),u="";d?u=t.HTMLDocument.getInnerHtml(d):(d=document.createElement("style"),d.setAttribute("em","styles"),d=document.head.insertAdjacentElement("beforeend",d));const g=document.createElement("div");t.emailWidth&&(l=l.replace(/(max-device-width:|max-width:)\d+px/g,f=>f.replace(/\d+/,String(t.emailWidth)))),t.insertAdjacentHTML(g,"afterbegin",l);let m=t.minify(u+`
274
+ </td></tr></table>`,C=o.parseFromString(v)[0];return C?(C instanceof HTMLTableElement&&df(t,C,r),C.setAttribute("em-edit","active"),t.replaceWith(C),o.commit(!0),C):null}function bf(e,o){if(typeof e.textSuperscript!="boolean"&&typeof e.textSubscript!="boolean")return;const t=window.getSelection();if(!t||t.rangeCount===0)return;const n=t.getRangeAt(0),r=n.commonAncestorContainer;if(r?.tagName==="TABLE")return;const i=r.nodeType===1?r:r.parentElement;if(!i)return;function l(s,c){const d=i.closest(s),u=s==="sup"?"sub":"sup",g=i.closest(u);if(c){let m=!0;if(d&&o.isRangeMatching(d,n,n.collapsed))m=!1;else if(g)if(o.isRangeMatching(g,n,n.collapsed)){const f=o.unwrapTag(g);n.selectNodeContents(f)}else{const f=o.splitWrapper(g,n);n.selectNodeContents(f),setTimeout(()=>t.removeAllRanges(),100)}else if(d){const f=o.splitWrapper(d,n);n.selectNodeContents(f)}if(m)if(n.collapsed){const f=n.cloneRange();try{n.expand("word");const p=n.toString().trim();if(p){const b=o.wrapInTag(n,p,s),h=document.createRange();h.selectNodeContents(b),t.removeAllRanges(),t.addRange(h),o.cleanEmptyTags(b.parentNode)}else n.setStart(f.startContainer,f.startOffset),n.setEnd(f.endContainer,f.endOffset)}catch{n.setStart(f.startContainer,f.startOffset),n.setEnd(f.endContainer,f.endOffset)}}else{const f=n.cloneContents(),p=document.createElement("div");p.appendChild(f),o.unwrapNestedTags(p,s);const b=o.wrapInTag(n,p,s),h=document.createRange();h.selectNodeContents(b),t.removeAllRanges(),t.addRange(h),o.cleanEmptyTags(b.parentNode)}}else if(n.collapsed)if(d){const m=d.parentNode,f=o.unwrapTag(d),p=document.createRange();p.selectNodeContents(f),t.removeAllRanges(),t.addRange(p),o.cleanEmptyTags(m),d.parentNode||setTimeout(()=>t.removeAllRanges(),0)}else{const m=n.startContainer.parentElement?.closest(s);if(m){const f=o.unwrapTag(m),p=document.createRange();p.selectNodeContents(f),t.removeAllRanges(),t.addRange(p),o.cleanEmptyTags(m.parentNode)}}else{let m=[];const f=n.cloneContents(),p=document.createElement("div");if(p.appendChild(f),m=Array.from(p.querySelectorAll(s)),d){const h=Array.from(d.childNodes).some(S=>S.nodeType===1),y=o.unwrapTag(d),E=document.createRange();if(y.isConnected)E.selectNodeContents(y),t.removeAllRanges(),t.addRange(E);else{const S=d.parentNode;S&&(E.selectNodeContents(S),t.removeAllRanges(),t.addRange(E))}h&&o.applicationElementSettingsSet({elem:document.querySelector("[em-edit]")}),o.commit();return}else{const h=n.commonAncestorContainer.parentElement?.closest(s)||n.startContainer.parentElement?.closest(s);h&&m.push(h)}m.length>0&&m.forEach(h=>{h.parentNode&&o.unwrapTag(h)});const b=p.cloneNode(!0).querySelector('[em-edit="active"]');if(b){n.deleteContents(),n.insertNode(b);const h=document.createRange();h.selectNodeContents(b),t.removeAllRanges(),t.addRange(h),o.cleanEmptyTags(b.parentNode)}}o.commit()}typeof e.textSuperscript=="boolean"&&l("sup",e.textSuperscript),typeof e.textSubscript=="boolean"&&l("sub",e.textSubscript)}function hf(e,o){if(e!==void 0){if(e===""){yf(o.activeElement);return}Ef(e,o)}}function yf(e){const o=e?.closest("em-replace")||e?.querySelector("em-replace");if(!o)return;const t=o.parentNode,n=o.firstChild,r=o.lastChild;if(o.getAttribute("text")!==o.innerHTML)for(;o.firstChild;)t?.insertBefore(o.firstChild,o);const i=document.createRange(),l=window.getSelection();n&&r&&l&&(i.setStartBefore(n),i.setEndAfter(r),l.removeAllRanges(),l.addRange(i)),o.remove()}function Ef(e,o){const t=window.getSelection();if(!t||t.rangeCount===0)return;const n=t.getRangeAt(0),r=e.replace(/~~.*$/,""),i=n.commonAncestorContainer,l=i.nodeType===1?i:i.parentElement;let s=l?.closest("em-replace");const c=/~~/.test(e)&&s;if(c){const d=e.replace(/~~.*$/,"");l?.setAttribute("text",d),l&&(l.innerHTML=d)}if(!s&&t.rangeCount>0&&!n.collapsed){const d=document.querySelectorAll("em-replace");if(s=Array.prototype.find.call(d,u=>u.textContent?.trim()===t.toString().trim()&&t.toString().trim()!==""),!s){const u=document.querySelector('[em-edit="active"]');u?.textContent===n.toString()&&n.selectNodeContents(u);const g=e.replace(/~~.*$/,""),m=document.createElement("em-replace");m.setAttribute("text",g),n.surroundContents(m)}}if(!s&&t.rangeCount>0&&n.collapsed){let d=document.querySelector("em-replace");if(d){const u=document.querySelectorAll("em-replace"),g=/~$/;s=Array.prototype.find.call(u,m=>{const f=e,p=m.textContent||"";return f.length===1&&g.test(p)?!0:o.compareStrings(p,f)}),s&&(s.setAttribute("text",e),s.textContent=e),s||(d=document.createElement("em-replace"),d.setAttribute("text",r),n.insertNode(d),d.innerHTML=r,n.collapse(!1))}else d=document.createElement("em-replace"),d.setAttribute("text",r),n.insertNode(d),d.innerHTML=r,n.collapse(!1)}s&&!c&&(s.getAttribute("text")===s.innerHTML&&(s.innerHTML=e),s.setAttribute("text",e))}function Sf(e){return e.trim().replace(/\s+/g,"_").replace(/[^\p{L}\p{N}\-_:.]/gu,"")}function gi(e){const o=e.commonAncestorContainer,t=(o.nodeType===Node.ELEMENT_NODE?o:o.parentElement)?.closest?.("a[name]");if(!t)return null;try{const n=document.createRange();return n.selectNodeContents(t),e.compareBoundaryPoints(Range.START_TO_START,n)>=0&&e.compareBoundaryPoints(Range.END_TO_END,n)<=0?t:null}catch{return null}}function Cf(e,o){if(!e||!o)return;const t=document.createRange(),n=window.getSelection();if(n)try{if(!e.isConnected||!o.isConnected)return;t.setStartBefore(e),t.setEndAfter(o),n.removeAllRanges(),n.addRange(t)}catch{}}function vf(e){const o=e.parentNode;if(o){for(;e.firstChild;)o.insertBefore(e.firstChild,e);o.removeChild(e)}}function Af(e,o){const t=window.getSelection(),n=t?.rangeCount?t.getRangeAt(0):null;if(e===void 0||!e.trim()){let i=null;if(n&&!n.collapsed&&(i=gi(n)),i||(i=o.activeElement?.closest?.("a[name]")),i){const l=i.firstChild,s=i.lastChild;vf(i),o.commit(),Cf(l,s)}return}const r=Sf(e);if(r&&!(!t||!n||n.collapsed))try{const i=gi(n);if(i){i.setAttribute("name",r),o.commit();return}const l=document.createElement("a");l.setAttribute("name",r);const s=n.extractContents();l.appendChild(s),n.insertNode(l);const c=document.createRange();c.selectNodeContents(l),t.removeAllRanges(),t.addRange(c),o.commit()}catch{}}function Tf(e,o){let t=!1,{activeElement:n,activeCell:r}=o;if(n||(n=document.querySelector(".remove-basic-cell")||document.querySelector(".em-temporary-active-cell-background-color")||document.querySelector(".em-active-table-cell")),!n)return t;const i=Object.keys(e)[0],l=n.closest(".em-element-custom-table");if(!l)return t;let s=o.parseTableElementToModel(l);if(n.tagName==="TD"&&(n=n.querySelector("div"),n?.setAttribute("em-edit","active")),n?.tagName==="TR"&&(n=n.querySelector("EDITOR")?.querySelector("div"),n?.setAttribute("em-edit","active")),i.includes("padding")&&!i.includes("cell_")&&Lf(e,l,s,o),e.backgroundColor&&wf(e.backgroundColor,l),i.includes("backgroundImage")&&kf(e,l),i.includes("backgroundPosition")){const c=o.updateBackgroundPosition(l.getAttribute("style"),{settings:e});l.setAttribute("style",c)}return i.includes("backgroundSize")&&(l.style.backgroundSize=e.backgroundSize),i.includes("backgroundRepeat")&&(l.style.backgroundRepeat=e.backgroundRepeat),(e.borderAll||e.borderTop||e.borderRight||e.borderBottom||e.borderLeft)&&_f(e,i,l,o),i.includes("borderRadius")&&Nf(e,l,o),i.includes("boxShadow")&&Bf(e,l,o),t=Mf(e,l,o)||t,i.includes("cell")&&Rf(e,i,l,s,r,o),new Set(["fontFamily","fontSize","lineHeight","textStrong","textItalic","textStrikethrough","textUnderline","textLink","textColor","textBackgroundColor","linkHref","textAlign","valign"]).has(i)&&xf(e,i,l,s,r,n,o),Df(l,o),a.applyVMLBackgroundToggle(l,e,"around"),t}function Lf(e,o,t,n){const r=n.updateTablePadding(t,{settings:e});o.innerHTML=n.tableModelToHtml(r)}function wf(e,o){o.getAttribute("data-bg-image")&&(o.removeAttribute("data-bg-image"),o.style.backgroundImage="",o.style.backgroundSize="",o.style.backgroundRepeat="",o.style.backgroundPosition=""),o.setAttribute("bgcolor",e)}function kf(e,o){if(o.getAttribute("bgcolor")&&o.removeAttribute("bgcolor"),e.backgroundImage?.[0]?.type==="url"){const t=e.backgroundImage[0].value;o.setAttribute("data-bg-image",t),o.style.backgroundImage=`url('${t}')`,o.style.backgroundSize="cover",o.style.backgroundRepeat="no-repeat",o.style.backgroundPosition="center"}}function _f(e,o,t,n){const r=o,i=e[r];let l="",s="";switch(r){case"borderAll":l="border",s=t.style.border;break;case"borderTop":l="border-top",s=t.style.borderTop;break;case"borderRight":l="border-right",s=t.style.borderRight;break;case"borderBottom":l="border-bottom",s=t.style.borderBottom;break;case"borderLeft":l="border-left",s=t.style.borderLeft;break;default:l="border",s=t.style.border}const c=t.getAttribute("border")||"",d=t.getAttribute("bordercolor")||"";let u=t.getAttribute("style")||"";const g=t.style.borderCollapse?`border-collapse: ${t.style.borderCollapse};`:"border-collapse: collapse;";if(["borderTop","borderRight","borderBottom","borderLeft"].includes(r)&&(t.style.border||c)){u=n.removeStyleProperty(u,"border");const f=t.style.border?t.style.border:`${c||"1"}px solid ${d||"#b9b1b1"}`;u=`border-top: ${f}; border-right: ${f}; border-bottom: ${f}; border-left: ${f}; ${u};`}let m=s?`${l}: ${s};`:`${l}: ${c||"1"}px solid ${d||"#b9b1b1"};`;t.removeAttribute("border"),t.removeAttribute("bordercolor"),t.removeAttribute("border-collapse"),u=n.removeStyleProperty(u,l),u=n.removeStyleProperty(u,"border-collapse"),l==="border"&&["border-top","border-right","border-bottom","border-left"].forEach(f=>{u=n.removeStyleProperty(u,f)}),["borderTop","borderRight","borderBottom","borderLeft"].includes(r)&&(u=n.removeStyleProperty(u,"border")),i?.style===""&&(m=""),i?.color&&m&&(m=m.replace(/(#([0-9A-Fa-f]{3}){1,2}\b)|(rgba?\([^)]*\))/g,i.color)),i?.width&&m&&(m=m.replace(/\b\d+(\.\d+)?px\b/g,`${i.width}px`)),i?.style&&m&&(m=m.replace(/solid|dashed|dotted/g,i.style)),m=`${m}${u?` ${u}`:""}`,t.setAttribute("style",m?`${g} ${m}`:"")}function Nf(e,o,t){const n=e.borderRadius,r=o.getAttribute("border")||"",i=o.getAttribute("bordercolor")||"";let l=o.getAttribute("style")||"";if(n?.all){const c=`border-radius: ${n.all}px ${n.all}px ${n.all}px ${n.all}px;`;if(l)l=t.removeStyleProperty(l,"border-radius"),l=t.removeStyleProperty(l,"border-collapse"),o.setAttribute("style",`${l}; border-collapse: separate; ${c}`);else{const d=`border-collapse: separate; border: ${r||"1"}px solid ${i||"#b9b1b1"}; ${c}`;o.setAttribute("style",d),o.removeAttribute("border"),o.removeAttribute("bordercolor")}}const s=["topLeft","topRight","bottomRight","bottomLeft"];s.forEach(c=>{if(n?.[c])if(l){const d=t.updateBorderRadius(o.getAttribute("style"),c,n[c]);o.setAttribute("style",d)}else{const d={topLeft:"0",topRight:"1",bottomRight:"2",bottomLeft:"3"},u=["0","0","0","0"];u[parseInt(d[c])]=`${n[c]}px`;const g=`border-radius: ${u.join(" ")};`,m=`border-collapse: separate; border: ${r||"1"}px solid ${i||"#b9b1b1"}; ${g}`;o.setAttribute("style",m)}}),(n?.all||s.some(c=>n?.[c]))&&(o.removeAttribute("border"),o.removeAttribute("bordercolor"))}function Bf(e,o,t){const n=e.boxShadow;if(!n)return;const r=o.getAttribute("border")||"",i=o.getAttribute("bordercolor")||"";let l=o.getAttribute("style")||"";const s=`box-shadow: ${n.color} ${n.hOffset}px ${n.vOffset}px ${n.blurRadius}px ${n.spreadRadius}px${n.inset?" inset":""};`;if(l)l=t.removeStyleProperty(l,"box-shadow"),l=t.removeStyleProperty(l,"border-collapse"),o.setAttribute("style",`${l}; border-collapse: separate;${n.color?` ${s}`:""}`);else{const c=`border-collapse: separate; border: ${r||"1"}px solid ${i||"#b9b1b1"}; ${s}`;o.setAttribute("style",c),o.removeAttribute("border"),o.removeAttribute("bordercolor")}}function Mf(e,o,t){let n=!1;e.mobileWidth&&(t.setElementMobileWidth({settings:e,elem:o}),o.removeAttribute("width"),n=!0),e.mobileHeight&&(t.setElementMobileHeight({settings:e,elem:o}),n=!0),e.show&&(t.setElementShow({settings:e,elem:o}),n=!0),e.mobileBackgroundColor&&(t.setElementMobileBackgroundColor({settings:e,elem:o}),n=!0);const r=e;if(r.mobileBackgroundImage&&(t.setElementMobileBackgroundImage?.({settings:r,elem:o}),n=!0),r.mobileBackgroundPositionX&&(t.setElementMobileBackgroundPositionX?.({settings:r,elem:o}),n=!0),r.mobileBackgroundPositionY&&(t.setElementMobileBackgroundPositionY?.({settings:r,elem:o}),n=!0),r.mobileBackgroundRepeat&&(t.setElementMobileBackgroundRepeat?.({settings:r,elem:o}),n=!0),r.mobileBackgroundSize&&(t.setElementMobileBackgroundSize?.({settings:r,elem:o}),n=!0),e.mobileBoxShadow){if(e.mobileBoxShadow.color!==""&&t.setElementMobileBoxShadow({settings:e,elem:o}),e.mobileBoxShadow.color===""){const i=o.getAttribute("class")||"",l=t.removeClassByPrefix(i,e.mobileBoxShadow.classNamePrefix);o.setAttribute("class",l)}n=!0}if(e.mobileBorder&&(o.removeAttribute("border"),o.removeAttribute("bordercolor"),t.setElementMobileBorder({settings:e,elem:o}),n=!0),e.mobileBorderRadius){if(o.getAttribute("border")&&o.getAttribute("bordercolor")){const l={mobileBorder:{all:{collor:o.getAttribute("bordercolor"),width:o.getAttribute("border"),style:"solid",classNamePrefix:"em-mob-border_all-"}}};t.setElementMobileBorder({settings:l,elem:o}),o.removeAttribute("border"),o.removeAttribute("bordercolor")}t.setElementMobileBorderRadius({settings:e,elem:o});const i=Object.keys(e.mobileBorderRadius).find(l=>l!=="classNamePrefix");if(i&&e.mobileBorderRadius[i]===0){const l=o.getAttribute("class")||"";o.setAttribute("class",t.removeClassByPrefix(l,e.mobileBorderRadius.classNamePrefix))}n=!0}return n}function Rf(e,o,t,n,r,i){const l=[a.CLASS_FOR_BASIC_CELL,a.CLASS_BACKGROUND_ACTIVE_CELL];if(o.includes("cellBackgroundColor")){t.querySelector(".remove-basic-cell")&&(r=i.getCellsWithClasses(n,l),i.state.set("activeCell",r));const s=i.updateTableCellBackgroundByIds(n,r,e.cellBackgroundColor),c=i.addClassToCellsByIds(s,r,a.TEMPORARY_CELL_CLASS);t.innerHTML=i.tableModelToHtml(c)}if(e.cell_borderPosition){t.querySelector(".remove-basic-cell")&&(r=i.getCellsWithClasses(n,l),i.state.set("activeCell",r),document.querySelectorAll(`.${a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR}`).forEach(c=>{c.classList.remove(a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR)})),n=i.parseTableElementToModel(t);const s=i.addClassToCellsByIds(n,r,a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR);t.innerHTML=i.tableModelToHtml(s)}(e.cell_borderAll||e.cell_borderTop||e.cell_borderRight||e.cell_borderBottom||e.cell_borderLeft)&&Pf(e,t,n,r,i,l),o.includes("cell_borderRadiusAll")&&Hf(e,t,n,r,i,l),o.includes("cell_padding")&&If(e,t,n,r,i,l)}function Pf(e,o,t,n,r,i){o.querySelector(".remove-basic-cell")&&(n=r.getCellsWithClasses(t,i),r.state.set("activeCell",n),document.querySelectorAll(`.${a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR}`).forEach(c=>{c.classList.remove(a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR)}));const l=r.getExternalBorders(t,n),s=r.mergeUniCells(l);if(e.cell_borderAll){for(const c of Object.keys(s)){if(c.includes("-uni-"))continue;t=r.parseTableElementToModel(o);const d=[c],u=r.updateCellBordersByIds(t,d,s[c],e.cell_borderAll);let g=r.addClassToCellsByIds(u,d,a.TEMPORARY_CELL_CLASS);g=r.addClassToCellsByIds(g,d,a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR),o.innerHTML=r.tableModelToHtml(g)}(e.cell_borderAll.style===""||e.cell_borderAll.width===0||e.cell_borderAll.color==="")&&o.querySelectorAll(`.${a.TEMPORARY_CELL_CLASS}`).forEach(c=>{const d=c;d.style.removeProperty("border-top"),d.style.removeProperty("border-right"),d.style.removeProperty("border-bottom"),d.style.removeProperty("border-left")})}[{setting:"cell_borderTop",value:"top"},{setting:"cell_borderRight",value:"right"},{setting:"cell_borderBottom",value:"bottom"},{setting:"cell_borderLeft",value:"left"}].forEach(({setting:c,value:d})=>{if(e[c]){t=r.parseTableElementToModel(o);const u=Object.keys(s).filter(f=>s[f].includes(d)),g=r.updateCellBordersByIds(t,u,[d],e[c]),m=r.addClassToCellsByIds(g,n,a.TEMPORARY_CELL_CLASS);o.innerHTML=r.tableModelToHtml(m)}})}function Hf(e,o,t,n,r,i){o.querySelector(".remove-basic-cell")&&(n=r.getCellsWithClasses(t,i),r.state.set("activeCell",n),document.querySelectorAll(`.${a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR}`).forEach(s=>{s.classList.remove(a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR)}));const l=r.getExternalCorners(t,n);for(const s of Object.keys(l)){if(s.includes("-uni-"))continue;t=r.parseTableElementToModel(o);const c=r.updateCellBorderRadiusByIds(t,s,l[s],e.cell_borderRadiusAll),d=r.addClassToCellsByIds(c,s,a.TEMPORARY_CELL_CLASS);o.innerHTML=r.tableModelToHtml(d)}}function If(e,o,t,n,r,i){o.querySelector(".remove-basic-cell")&&(n=r.getCellsWithClasses(t,i),r.state.set("activeCell",n),document.querySelectorAll(`.${a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR}`).forEach(c=>{c.classList.remove(a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR)})),t=r.parseTableElementToModel(o);let l=r.addClassToCellsByIds(t,n,a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR);o.innerHTML=r.tableModelToHtml(l),[{key:"cell_paddingTop",sides:["top"]},{key:"cell_paddingBottom",sides:["bottom"]},{key:"cell_paddingLeft",sides:["left"]},{key:"cell_paddingRight",sides:["right"]},{key:"cell_paddingLeftRight",sides:["left","right"]},{key:"cell_paddingTopBottom",sides:["top","bottom"]}].forEach(({key:c,sides:d})=>{e[c]!==void 0&&(t=r.parseTableElementToModel(o),l=r.updateCellPaddingByIds(t,n,d,e[c]))}),e.cell_padding&&(t=r.parseTableElementToModel(o),l=r.updateCellPaddingByIds(t,n,["top"],e.cell_padding.top),l=r.updateCellPaddingByIds(l,n,["bottom"],e.cell_padding.bottom),l=r.updateCellPaddingByIds(l,n,["left"],e.cell_padding.left),l=r.updateCellPaddingByIds(l,n,["right"],e.cell_padding.right));const s=r.addClassToCellsByIds(l,n,a.TEMPORARY_CELL_CLASS);o.innerHTML=r.tableModelToHtml(s)}function Of(e,o){if(e.collapsed)return!1;const{startContainer:t,endContainer:n}=e;return!t.isConnected||!n.isConnected?!1:o.contains(t)&&o.contains(n)}function xf(e,o,t,n,r,i,l){const s=[a.CLASS_FOR_BASIC_CELL,a.CLASS_BACKGROUND_ACTIVE_CELL],c=window.getSelection();if(!c||c.rangeCount===0)return;const d=c.getRangeAt(0).cloneRange();if(t.querySelector(".remove-basic-cell")&&(r=l.getCellsWithClasses(n,s),l.state.set("activeCell",r),document.querySelectorAll(`.${a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR}`).forEach(g=>{g.classList.remove(a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR)})),!r.length)return;if(r.length===1){const g=t.querySelector(`td.${a.CLASS_BACKGROUND_ACTIVE_CELL}, td.${a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR}, td.${a.CLASS_FOR_BASIC_CELL}`),m=g?.querySelector(":scope > div")??g?.querySelector(":scope > editor > div");if(m){if(l.wrapEditor(m,!0),l.textStyleProperties.some(f=>Object.prototype.hasOwnProperty.call(e,f))){if(Of(d,m))l.addNewRange(d);else{const f=document.createRange();f.selectNodeContents(m),l.addNewRange(f)}try{l.toggleTextStyle(m,{settings:e})}catch{}}if(o==="linkHref"&&typeof e.linkHref=="string"){const f=m.tagName==="A"?m:m.querySelector("a");f&&f.setAttribute("href",e.linkHref)}o==="textAlign"&&(e.textAlign?m.setAttribute("align",e.textAlign):i?.style?.textAlign?i.style.removeProperty("text-align"):m.removeAttribute("align")),e.valign?m.closest("td")?.setAttribute("valign",e.valign):e.valign===""&&m.closest("td")?.removeAttribute("valign");return}}n=l.parseTableElementToModel(t);const u=l.addClassToCellsByIds(n,r,a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR);t.innerHTML=l.tableModelToHtml(u),t.querySelectorAll(`td.${a.TEMPORARY_ACTIVE_CELL_BACKGROUND_COLOR} > div`).forEach(g=>{l.wrapEditor(g,!0);const m=c.getRangeAt(0);if(m.selectNode(g),l.addNewRange(m),l.textStyleProperties.some(f=>Object.prototype.hasOwnProperty.call(e,f)))try{l.toggleTextStyle(g,{settings:e})}catch{}if(o==="linkHref"&&typeof e.linkHref=="string"){const f=g.tagName==="A"?g:g.querySelector("a");f&&f.setAttribute("href",e.linkHref)}o==="textAlign"&&(e.textAlign?g.setAttribute("align",e.textAlign):i?.style?.textAlign?i.style.removeProperty("text-align"):g.removeAttribute("align")),e.valign?g.closest("td")?.setAttribute("valign",e.valign):e.valign===""&&g.closest("td")?.removeAttribute("valign")})}function Df(e,o){document.querySelectorAll(`.${a.CLASS_FOR_BASIC_CELL}`).forEach(r=>{r.classList.remove(a.CLASS_FOR_BASIC_CELL)}),document.querySelectorAll(`.${a.CLASS_BACKGROUND_ACTIVE_CELL}`).forEach(r=>{r.classList.remove(a.CLASS_BACKGROUND_ACTIVE_CELL)});let t=o.parseTableElementToModel(e);e.getAttribute("style")?.includes("border-collapse:")&&(t=o.removeOuterBorders(t)),e.getAttribute("class")?.includes("em-mob-border_")&&(t=o.removeOuterBorders(t)),t=o.simplifyBorders(t),e.innerHTML=o.tableModelToHtml(t);const n=e.querySelectorAll(`.${a.TEMPORARY_CELL_CLASS}`);n.length>0&&(n[0].setAttribute("em-edit",""),n.forEach(r=>{r.classList.remove(a.TEMPORARY_CELL_CLASS)})),o.commit()}function Ff(e,o){let t=!1;const{activeElement:n}=o;if(typeof e.linkHref=="string"&&Wf(e.linkHref,o),o.textStyleProperties.some(r=>e.hasOwnProperty(r)))try{o.toggleTextStyle(n,{settings:e})}catch{}if(e.mobileFontSize){const r=n.closest('[class*="em-mob-font_size"]')||n.closest('[style*="font-size"]');o.setElementMobileFontSize({settings:e,elem:r}),t=!0}if(e.mobileLineHeight){const r=n.closest('[class*="em-mob-line_height"]')||n.closest('[style*="line-height"]');o.setElementMobileLineHeight({settings:e,elem:r}),t=!0}return e.textAlign!==void 0&&$f(e.textAlign,n),e.mobileTextAlign&&(zf(e,n,o),t=!0),(typeof e.textSuperscript=="boolean"||typeof e.textSubscript=="boolean")&&o.handleTextScriptSettings(e,{unwrapNestedTags:o.unwrapNestedTags,wrapInTag:o.wrapInTag,unwrapTag:o.unwrapTag,isRangeMatching:o.isRangeMatching,splitWrapper:o.splitWrapper,cleanEmptyTags:o.cleanEmptyTags,applicationElementSettingsSet:o.applicationElementSettingsSet,commit:o.commit}),e.textAnchor!==void 0&&o.handleTextAnchor(e.textAnchor,{activeElement:n,commit:o.commit}),e.textReplacer!==void 0&&o.handleTextReplacer(e.textReplacer,{activeElement:n,compareStrings:o.compareStrings}),(e.hasOwnProperty("listUL")||e.hasOwnProperty("listOL"))&&qf(e,n),o.isElementList&&Vf(e,o),t}function qf(e,o){const t=a.STANDARD_LIST_CONTAINER_TAGS.includes(o.tagName)?o:o.closest(a.STANDARD_LIST_CONTAINER_SELECTOR);if(!t)return;const n=e.listOL!==void 0;(n?e.listOL:e.listUL)?Ki(t,n):Qi(t)}function Wf(e,o){let t=document.querySelector("[em-edit]");if(!t)return;let n=t.tagName==="A"?t:t.closest("a"),r=t.closest(".alignment")||t.closest(".button_block")||t.closest("td");if(r||(r=t.closest("div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, a, sup, sub"),r||(r=document.querySelector("td")?.closest("div, p, td")||null)),!n&&r&&(n=r.querySelector("a")),n&&(n.setAttribute("href",e),Lt(e)&&n.removeAttribute("target")),r){const i=o.collectVMLContent(r);if(i){const l=document.createElement("div");l.innerHTML=i;const s=l.querySelector("v\\:roundrect"),c=l.querySelector("a");(s||c)&&(s&&s.setAttribute("href",e),c&&c.setAttribute("href",e),o.updateVMLComments(r,l.innerHTML))}}}function $f(e,o){const t=Tt(o);t&&(e?t.style.textAlign?t.style.textAlign=e:t.setAttribute("align",e):t.style.textAlign?t.style.removeProperty("text-align"):t.removeAttribute("align"))}function zf(e,o,t){const n=Tt(o);if(!n)return;const r=e.mobileTextAlign?.classNamePrefix||"em-mob-text_align-";rl(o,n,r),t.setElementMobileAlign({settings:e,elem:n,fieldName:"mobileTextAlign"})}function Vf(e,o){const{activeElement:t,classNameOl:n,classNameUl:r}=o,i=t.closest(`table.${n}`)||t.closest(`table.${r}`);if(!i)return;const l=i.outerHTML,s=o.removeEditorTags(l);e.SpacingBetweenParagraphs&&(i.innerHTML=o.updateTableStyle(s,"padding-bottom",e.SpacingBetweenParagraphs)),e.SpacingBetweenBulletsAndText&&(i.innerHTML=o.updateTableStyle(s,"padding-left",e.SpacingBetweenBulletsAndText)),e.BulletType&&(i.innerHTML=o.changeBullets(s,e.BulletType)),e.ColorBullets&&(i.innerHTML=o.changeBulletsColor(s,e.ColorBullets)),e.BulletsSize&&(i.innerHTML=o.changeBulletsSize(s,e.BulletsSize)),e.hasOwnProperty("BulletTextItalic")&&(i.innerHTML=o.changeBulletsItalic(s,e.BulletTextItalic)),e.hasOwnProperty("BulletTextStrong")&&(i.innerHTML=o.changeBulletsWeight(s,e.BulletTextStrong)),e.hasOwnProperty("BulletTextStrikethrough")&&(i.innerHTML=o.changeBulletsStrikethrough(s,e.BulletTextStrikethrough)),e.hasOwnProperty("BulletTextUnderline")&&(i.innerHTML=o.changeBulletsUnderline(s,e.BulletTextUnderline)),e.hasOwnProperty("BulletsFontFamily")&&o.isElementListOL&&(i.innerHTML=Uf(e.BulletsFontFamily,s,o));let c=o.findElementWithSelectedText(t.textContent||"",i);c===null&&(c=i),c.hasAttribute("em-edit")||c.setAttribute("em-edit","active"),o.commit()}function Uf(e,o,t){const n=document.createElement("div");n.innerHTML=o;const r=n.querySelector("table.em-element-list-ol");return r?(r.querySelectorAll("tr").forEach(i=>{const l=i.querySelector("td:first-child > div");l&&(e?e[0]==="Safe Fonts"?(l.style.fontFamily=e[1],t.removeClassesByPrefix(l,"em-font"),t.clearLinkTags({elem:document.head})):e[0]==="Google Fonts"&&(e[1]==="Sans Serif"?l.style.fontFamily="Helvetica, Arial, sans-serif":e[1]==="Serif"?l.style.fontFamily='"Times New Roman", Times, serif':e[1]==="Project Fonts"&&a.applyProjectFontInlineFallback(l,e[2]),t.removeClassesByPrefix(l,"em-font"),l.classList.add(t.createFontClassName(e)),a.markProjectFontClass(l,e),t.addFontFamilyClass({fontFamilyArray:e})):l.style.removeProperty("font-family"))}),n.innerHTML):o}function jf(e,o){let t=!1;const{activeElement:n}=o;if(e.link!==void 0){const r=o.getActiveEditElement();if(!r)return t;if(e.link!==""){const i=r.closest("a");if(i)i.setAttribute("href",e.link);else{const l=document.createElement("a");l.setAttribute("href",e.link),l.setAttribute("target","_blank"),r.parentNode?.insertBefore(l,r),l.appendChild(r),o.setCursorPosition(l)}}else{const i=r.closest("a");i&&(i.replaceWith(...i.childNodes),o.setCursorPosition(r))}}if(e.src!==void 0&&a.isSrcElement(n)&&a.setRenderedAttribute(n,"src",e.src??""),e.src!==void 0&&qn(),e.alt!==void 0&&n.setAttribute("alt",e.alt),e.title?n.setAttribute("title",e.title):e.title===""&&n.removeAttribute("title"),e.border&&o.setElementBorder({settings:e,elem:n}),e.boxShadow&&o.setElementBoxShadow({settings:e,elem:n}),e.align&&e.align!=="undefined"?n.closest("div, p, td")?.setAttribute("align",e.align):e.align===""&&n.closest("div, p, td")?.removeAttribute("align"),e.valign?n.style.verticalAlign=e.valign:e.valign===""&&n.style.removeProperty("vertical-align"),e.width&&(e.width.value!==void 0&&e.width.value!==null?(n.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")),n.style.width="100%",n.style.maxWidth=e.width.value+e.width.dim):(n.setAttribute("width","0"),n.style.width="100%",n.style.maxWidth="0")),e.height&&(e.height.value!==void 0&&e.height.value!==null?(n.setAttribute("height",e.height.value+(e.height.dim==="px"?"":"%")),n.style.height=e.height.value+e.height.dim):(n.removeAttribute("height"),n.style.removeProperty("height"))),e.borderRadius&&o.setElementBorderRadius({settings:e,elem:n}),e.mobileWidth&&(o.setElementMobileWidth({settings:e,elem:n}),t=!0),e.mobileHeight&&(o.setElementMobileHeight({settings:e,elem:n}),t=!0),e.mobileBorder&&(o.setElementMobileBorder({settings:e,elem:n}),t=!0),e.mobileBorderRadius&&(o.setElementMobileBorderRadius({settings:e,elem:n}),t=!0),e.mobileBoxShadow&&(o.setElementMobileBoxShadow({settings:e,elem:n}),t=!0),e.mobileAlign){const r=n.closest("div, p, td");r&&o.setElementMobileAlign({settings:e,elem:r}),t=!0,e.mobileAlign.value?n.style.display="inline-block":n.style.display="block"}if(e.mobileVerticalAlign&&(o.setElementMobileVerticalAlign({settings:e,elem:n}),t=!0),e.show&&(o.setElementShow({settings:e,elem:n}),t=!0),e.countdown){const r=new Image;r.onload=function(){n.setAttribute("width",String(Math.round(this.width/2))),n.style.maxWidth=Math.round(this.width/2)+"px"};const i=e.countdown?.link??"";r.src=i,a.setRenderedAttribute(n,"src",i),n.setAttribute("em-cd-settings",e.countdown.params)}if(e.video&&n.setAttribute("em-video-settings",JSON.stringify(e.video)),e.imgReplacer){const r=e.imgReplacer??"",i=n.closest("em-replace");if(i)a.setRenderedAttribute(i,"src",r);else{const l=document.createElement("em-replace");a.setRenderedAttribute(l,"src",r),n.parentNode?.insertBefore(l,n),l.appendChild(n)}}else if(e.imgReplacer===""){const r=n.closest("em-replace");r&&(r.parentNode?.insertBefore(n,r),r.remove())}return t}function Gf(e,o){const{activeElement:t,textStyleProperties:n,toggleTextStyle:r}=o;if(e.href!==void 0&&(t.setAttribute("href",e.href),Lt(e.href)&&t.removeAttribute("target")),e.target&&!(e.href&&Lt(e.href))&&t.setAttribute("target",e.target),n.some(i=>e.hasOwnProperty(i)))try{r(t,{settings:e})}catch{}}function Yf(e,o){const{activeElement:t,setElementMobileHeight:n}=o;let r=!1;if(e.height)if(t.tagName==="DIV"){const i=e.height.value+e.height.dim;t.style.height=i,t.style.lineHeight=i,t.style.fontSize=e.height.value>10?parseInt(e.height.value)-2+e.height.dim:"8px"}else t.tagName==="TD"&&t.setAttribute("height",String(e.height.value));return e.mobileHeight&&(n({settings:e,elem:t}),r=!0),r}function Kf(e,o){const{activeElement:t,isVariableText:n}=o,r=t.nextSibling?.nodeType===8?t.nextSibling:null;if(!r||!e.value)return;let i=e.value;i.startsWith("<!--")&&(i=i.substring(4)),i.endsWith("-->")&&(i=i.substring(0,i.length-3)),n(`<!--${i}-->`)?r.nodeValue=i:r.replaceWith(i)}function Xf(e,o){const{elem:t,message:n,activateSection:r}=e;if(t.closest("table")?.parentElement?.tagName!=="BODY"){n.settings.parent=o.getElementParentCaption(t);let s=t;if(t.tagName==="IMG"){const c=t.closest('div[em="atom"]'),d=t.closest(".em-element-resize-img-container");s=c||d}else t.closest("editor")?s=t.parentElement:t.tagName==="TD"&&t.classList.contains("em-vindent")?s=t.closest(".em-vindent-table"):t.tagName==="TD"&&t.parentElement?.getAttribute("em")==="block"&&(s=t.parentElement);n.settings.nextElem=!!s?.nextElementSibling&&(!s.nextElementSibling.getAttribute("contenteditable")||s.nextElementSibling.getAttribute("contenteditable")!=="false"),n.settings.prevElem=!!s?.previousElementSibling&&(!s.previousElementSibling.getAttribute("contenteditable")||s.previousElementSibling.getAttribute("contenteditable")!=="false")}else n.settings.parent=void 0;(t.closest('div[style*="inline-block"]')||t.closest(".em-mob-wrap, .noresp-em-mob-wrap"))&&(n.settings.floatBlocks=o.getStructureColumns({elem:t})),r&&(n.settings.activateSection=r),t.classList.contains("em-mob-wrap")||t.classList.contains("noresp-em-mob-wrap")||t.parentElement?.hasAttribute("em")&&t.parentElement.getAttribute("em")==="group"&&document.querySelectorAll('[em="group"]').length===1?n.settings.deletable=!1:n.settings.deletable=!0,n.settings.usedColors=o.getUsedColors(),n.settings.path=o.getElementPath(t);const i=o.getCurrentElementPath();n.type==="button"&&(n.settings.commonStyles=o.commonStyles);const l=t?.classList;return o.ampService.hasAmp&&l&&(l.contains("em-amp-show-only")?n.settings.ampShow="amp":l.contains("em-amp-show-disabled")?n.settings.ampShow="html":n.settings.ampShow="all"),n.settings=o.mapObj.unescape(n.settings),{message:n,elementPath:i}}function Zf(e,o,t,n){let r=!1,i=!1;if(o.shouldResetProgrammaticSelection&&(i=!0,!o.settings||Object.keys(o.settings).length===0))return r=!0,{shouldReturn:r,isProgrammaticSelectionReset:i};if(o.removeEmEdit){if(n.removeAllAttributes("em-edit"),o.setEmEditOnTd){for(const l of e.querySelectorAll("[contenteditable]"))l.removeAttribute("contenteditable");e.querySelector("td")?.setAttribute("em-edit","active")}if(o.editTargetTd){const l=e.closest("table")?.closest("td");if(l)for(const s of l.querySelectorAll("[contenteditable]"))s.removeAttribute("contenteditable");o.editTargetTd.setAttribute("em-edit","active")}}return o.isNewLink&&(e.removeAttribute("new"),t.settings.isNewLink=!0,e.setAttribute("em-edit","active")),{shouldReturn:r,isProgrammaticSelectionReset:i}}function Jf(e,o,t,n){if(!document.body.classList.contains("mceNonEditable")&&!(!o&&t)){if(n.removeAllAttributes("em-edit"),e.tagName!=="TABLE"){a.resolveActiveElement(e).setAttribute("em-edit","active");const r=e.closest("table");if(r){for(const s of r.querySelectorAll('[contenteditable="true"]'))s.tagName!=="EDITOR"&&s.removeAttribute("contenteditable");const i=r.querySelector("editor"),l=i?.firstChild;i?.childNodes.length===1&&l?.nodeType===1&&l?.tagName==="A"&&l?.childNodes.length===1&&l?.firstChild?.nodeType===3?l.setAttribute("contenteditable","true"):i?.setAttribute("contenteditable","true")}}[...e.parentElement?.querySelectorAll("strike, s")||[]].forEach(r=>r.style.textDecoration="line-through"),[...e.parentElement?.getElementsByTagName("u")||[]].forEach(r=>r.style.textDecoration="underline")}}function Qf(e,o){const t=o.getSelectedText(),n=window.getSelection(),r=o.getRangeFromSelection(n);let i=null,l=null,s=null;function c(d){let u=d;u.nodeType===Node.TEXT_NODE&&(u=u.parentNode);const g=u?.closest("em-replace");return e?g?.textContent||null:g?.getAttribute("text")||null}return r&&(t?(l=c(r.startContainer),s=c(r.endContainer),l?.length&&s?.length&&l!==s&&(l=s=null)):i=c(r.commonAncestorContainer)),t?l||s:i}function ep(e,o){let t=o.getVariableByIcon(e)||!o.htmlDocument.getMappedParent(e)?e:o.htmlDocument.getVisibleNode(e);if(t.closest("a")&&o.findOutermostParentWithText(t,"a")&&t.tagName!=="IMG"&&t.tagName!=="AMP-IMG"&&(t=o.findOutermostParentWithText(t,"a")),t?.closest(".em-vindent")){const n=t.closest('div[style*="height"][style*="line-height"]');n?t=n:t=t.closest("td")}return t.tagName==="DIV"&&t.closest("amp-accordion")&&setTimeout(()=>{o.sendResizeEvent()},350),(t?.closest(".em-element-resize-img")||t?.closest(".em-element-img-change-group")||t?.closest(".em-element-resize-img-container"))&&(t=t.closest(".em-element-resize-img-container").querySelector("img")),(t.tagName==="TD"&&t.classList.contains("em-mob-wrap")&&(t.cellIndex+1)%2===0||t.closest(".em-gap"))&&(t=t.closest('[em="block"] > td')),t}function tp(e,o){const{elem:t,isCellCustomTable:n,listContext:r,requestElemBullet:i,variableElement:l}=e,{isListOL:s,isListUL:c,isList:d}=r;return{Locale:o.Locale,isProgrammaticSelection:o.isProgrammaticSelection,isCellCustomTable:n,extractorContext:{variableElement:l,requestElemBullet:i,isElementListOL:s,isElementListUL:c,isElementList:d},customTableContext:{getElementTdDiv:o.getElementTdDiv,parseTableElementToModel:o.parseTableElementToModel,extractBorderRadius:o.extractBorderRadius,parseBackgroundStyles:o.parseBackgroundStyles,getFontFamilyFromElement:o.getFontFamilyFromElement,textHasStyle:o.textHasStyle,isElementHasBold:o.isElementHasBold,getLineHeghtInPixels:o.getLineHeghtInPixels,activeCell:o.activeCell,CLASS_FOR_BASIC_CELL:o.CLASS_FOR_BASIC_CELL,requestElemWithStyle:o.requestElemWithStyle},elementContext:{getElementTdDiv:o.getElementTdDiv,getLineHeghtInPixels:o.getLineHeghtInPixels},linkTextContext:{variableElement:l,requestElemBullet:i,isElementListOL:s,isElementListUL:c,isElementList:d,findElementWithSelectedText:o.findElementWithSelectedText,selectedText:o.getSelectedText()},_isCarouselElement:o._isCarouselElement,_isAccordionElement:o._isAccordionElement,_isSocialBlockElement:o._isSocialBlockElement,_isImageElement:o._isImageElement,_isLinkElement:o._isLinkElement,_isButtonElement:o._isButtonElement,_isTableElement:o._isTableElement,_isCustomTableElement:o._isCustomTableElement,_isAtomElement:o._isAtomElement,_isTdColumnGroup:o._isTdColumnGroup,_isTdStructure:o._isTdStructure,_isEmptyTd:o._isEmptyTd,_isTdCell:o._isTdCell,_isVindentTd:o._isVindentTd,_isVindentDiv:o._isVindentDiv,_isFloatBlockElement:o._isFloatBlockElement,_isDivTextElement:o._isDivTextElement,_isInlineButtonElement:o._isInlineButtonElement,_extractTextSettings:o._extractTextSettings,_extractCarouselSettings:o._extractCarouselSettings,_extractAccordionSettings:o._extractAccordionSettings,_extractSocialSettings:o._extractSocialSettings,_extractImgSettings:o._extractImgSettings,_extractButtonSettings:o._extractButtonSettings,_extractLinkTextSettings:o._extractLinkTextSettings,_extractTableSettings:o._extractTableSettings,_extractCustomTableSettings:o._extractCustomTableSettings,_extractAtomElementSettings:o._extractAtomElementSettings,_extractProgrammaticElementSettings:o._extractProgrammaticElementSettings,_extractTdColumnGroupSettings:o._extractTdColumnGroupSettings,_extractTdStructureSettings:o._extractTdStructureSettings,_extractTdCellSettings:o._extractTdCellSettings,_extractVindentSettings:o._extractVindentSettings,_extractFloatBlockSettings:o._extractFloatBlockSettings,_extractDivContainerSettings:o._extractDivContainerSettings,_clearActiveEditElements:o._clearActiveEditElements,HTMLDocument:o.HTMLDocument,parseFromString:o.parseFromString,getParentElementOfSelection:o.getParentElementOfSelection}}function op(e){return["EM-REPLACE","EDITOR","B","STRONG","U","S","STRIKE","SPAN","FONT","I","EM","P","A","H1","H2","H3","H4","H5","H6","SUP","SUB"].includes(e)}function np(e,o,t){const{Locale:n,isProgrammaticSelection:r,isCellCustomTable:i}=t;if(!o&&!e.closest("a")&&!r&&!i){let l=e;e.querySelector("editor")&&(l=t.getParentElementOfSelection());const s=t._extractTextSettings({elem:l},n,t.extractorContext);return{type:s.type,caption:s.caption,settings:s}}if(t._isCarouselElement(e)){const l=t._extractCarouselSettings({elem:e},n,{clearActiveEditElements:t._clearActiveEditElements});return{type:l.type,caption:l.caption,settings:l}}if(t._isAccordionElement(e)){const l=t._extractAccordionSettings({elem:e},n,{clearActiveEditElements:t._clearActiveEditElements,HTMLDocument:t.HTMLDocument,parseFromString:t.parseFromString});return{type:l.type,caption:l.caption,settings:l}}if(t._isSocialBlockElement(e)){const l=t._extractSocialSettings({elem:e},n);return{type:l.type,caption:l.caption,settings:l}}if(t._isImageElement(e)){const l=t._extractImgSettings({elem:e},n);return{type:l.type,caption:l.caption,settings:l}}if(t._isLinkElement(e,i)){if(t._isButtonElement(e)){const c=t._extractButtonSettings({elem:e},n),d={type:c.type,caption:c.caption,settings:c};return e.getAttribute("new")&&(d.isNewLink=!0),d}const l=t._extractLinkTextSettings({elem:e},n,t.linkTextContext),s={type:l.type,caption:l.caption,settings:l};return e.getAttribute("new")&&(s.isNewLink=!0),s}if(t._isTableElement(e)){const l=t._extractTableSettings({elem:e},n);return{type:l.type,caption:l.caption,settings:l.type!=="emptyTable"?l:{}}}if(e.tagName==="LI"&&Kt(e)){const l=t._extractTextSettings({elem:e},n,t.extractorContext);return{type:l.type,caption:l.caption,settings:l}}if(t._isCustomTableElement(e)){const l=t._extractCustomTableSettings({elem:e},n,t.customTableContext);return{type:l.type,caption:l.caption,settings:l.settings}}if(t._isAtomElement(e)){const l=t._extractAtomElementSettings({elem:e},n,t.elementContext);return{type:l.type,caption:l.caption,settings:l,removeEmEdit:!0,setEmEditOnTd:!0}}if(r){const l=t._extractProgrammaticElementSettings({elem:e},n,t.elementContext);return l.settings?{type:l.settings.type,caption:l.settings.caption,settings:l.settings,removeEmEdit:!0,editTargetTd:l.editTargetTd,shouldResetProgrammaticSelection:l.shouldResetProgrammaticSelection}:{type:null,settings:{},shouldResetProgrammaticSelection:!0}}if(t._isTdColumnGroup(e)){const l=t._extractTdColumnGroupSettings({elem:e},n,{getElementTdDiv:t.elementContext.getElementTdDiv});return{type:l.type,caption:l.caption,settings:l.settings}}if(t._isTdStructure(e)){const l=t._extractTdStructureSettings({elem:e},n,{getElementTdDiv:t.elementContext.getElementTdDiv});return{type:l.type,caption:l.caption,settings:l.settings}}if(t._isEmptyTd(e))return{type:"emptyTd",settings:{}};if(t._isTdCell(e)){const l=t._extractTdCellSettings({elem:e},n,{getElementTdDiv:t.elementContext.getElementTdDiv});return{type:l.type,caption:l.caption,settings:l.settings}}if(t._isVindentTd(e)){const l=t._extractVindentSettings({elem:e},n);return{type:l.type,caption:l.caption,settings:l}}if(t._isVindentDiv(e)){const l=t._extractVindentSettings({elem:e},n);return{type:l.type,caption:l.caption,settings:l}}if(t._isFloatBlockElement(e)){const l=t._extractFloatBlockSettings({elem:e},n);return{type:l.type,caption:l.caption,settings:l}}if(t._isDivTextElement(e)){const l=t._extractTextSettings({elem:e},n,t.extractorContext);return{type:l.type,caption:l.caption,settings:l}}if(e.tagName==="DIV"||e.tagName==="TD"&&e.firstChild?.tagName==="EDITOR"){const l=t._extractDivContainerSettings({elem:e},n,{getElementTdDiv:t.elementContext.getElementTdDiv});return{type:l.type,caption:l.caption,settings:l}}if(op(e.tagName)&&(e.tagName!=="EM-REPLACE"||!e.closest("a"))){if(t._isInlineButtonElement(e)){const l=t._extractButtonSettings({elem:e},n);return{type:l.type,caption:l.caption,settings:l}}if(!r){const l=t._extractTextSettings({elem:e},n,t.extractorContext);return{type:l.type,caption:l.caption,settings:l}}}return{type:null,settings:{}}}function cn(e,o){o[1]==="Sans Serif"?e.style.fontFamily="Helvetica, Arial, sans-serif":o[1]==="Serif"?e.style.fontFamily='"Times New Roman", Times, serif':o[1]==="Project Fonts"&&a.applyProjectFontInlineFallback(e,o[2])}function rp(e,o){const t=e?.toLowerCase();return t==="#ffffff"&&t!==o?.toLowerCase()}function ip(e,o){const{lockEditor:t,commonStyles:n,globalHolder:r}=o;if(t)return;const i=document.querySelectorAll('div[style*="font-family"]');lp(e,i,o),ap(e,i,o),cp(e,o),dp(e,o),pp(e,o),gp(e,o);const l={operation:"application_commonStyles_update",settings:{commonStyles:n}};o.messageService.send(l)}function lp(e,o,t){const{commonStyles:n,rgbToHex:r}=t;if(e.textFontFamily!==void 0){let i=[];o.forEach(l=>{const s=l;let c;!s.style.display&&parseFloat(s.style.fontSize)<=20&&(i=e.textFontFamily,i[0]==="Safe Fonts"?(s.style.fontFamily=i[1],(c=[...s.classList].filter(d=>d.startsWith("em-font-"))[0])&&(s.classList.remove(c),n.text.fontFamily?.[2]&&t.clearLinkTags({elem:document.head,fontFamilyClassName:a.buildEmFontClassName(n.text.fontFamily[2],n.text.fontFamily[3])}),t.clearProjectFontFaces())):i[0]==="Google Fonts"&&(cn(s,i),t.removeClassesByPrefix(s,"em-font"),s.classList.add(t.createFontClassName(i)),a.markProjectFontClass(s,i)))}),i.length>0&&i[0]==="Google Fonts"&&t.addFontFamilyClass({fontFamilyArray:i}),t.clearProjectFontFaces(),n.text.fontFamily=e.textFontFamily}e.textFontSize!==void 0&&(o.forEach(i=>{const l=i;!l.style.display&&parseFloat(l.style.fontSize)<=20&&parseFloat(l.style.fontSize)>14&&(l.style.fontSize=e.textFontSize+"px")}),n.text.fontSize=e.textFontSize),e.textLineHeight!==void 0&&(o.forEach(i=>{const l=i;!l.style.display&&parseFloat(l.style.fontSize)<=20&&parseFloat(l.style.fontSize)>14&&(l.style.lineHeight=e.textLineHeight+"px")}),n.text.lineHeight=e.textLineHeight),e.textColor!==void 0&&(o.forEach(i=>{const l=i;!l.closest(".em-contrast-block")&&!l.style.display&&parseFloat(l.style.fontSize)<=20&&!rp(r(l.style.color),r(n.text.color))&&(l.style.color=e.textColor)}),n.text.color=e.textColor),e.textContrastColor!==void 0&&(o.forEach(i=>{const l=i;l.closest(".em-contrast-block")&&!l.style.display&&parseFloat(l.style.fontSize)<=20&&(l.style.color=e.textContrastColor)}),n.text.contrastColor=e.textContrastColor),e.textPaddingBottom!==void 0&&(o.forEach(i=>{const l=i;if(l.closest('[em="atom"]')){if(!l.style.display&&parseFloat(l.style.fontSize)<=20&&l.closest("table")?.getAttribute("em")=="atom"){const s=l.closest('[em="atom"]')?.querySelector(":scope > tr > td, :scope > tbody > tr > td");s&&(s.style.paddingBottom=e.textPaddingBottom+"px",s.querySelector(":scope > .em-vindent-paddingBottom")?.remove())}}else if(l.nextElementSibling){const s=l.nextElementSibling;if(!l.style.display&&parseFloat(l.style.fontSize)<=20&&l.parentElement?.getAttribute("em")=="atom"&&s&&s.tagName=="TABLE"&&(s.classList.contains("em-vindent-table")||s.querySelector("td")?.innerHTML=="")){s.querySelector("td")?.setAttribute("height",e.textPaddingBottom);const c=s.querySelector(".em-element-vindent-value");c&&(c.innerHTML=e.textPaddingBottom+"px",e.textPaddingBottom<30?s.querySelector(".em-vindent")?.classList.add("em-vindent_low"):s.querySelector(".em-vindent")?.classList.remove("em-vindent_low"))}}}),n.text.paddingBottom=e.textPaddingBottom)}function ap(e,o,t){const{commonStyles:n,rgbToHex:r}=t;if(e.headingFontFamily!==void 0){let i=[];o.forEach(l=>{const s=l;let c;!s.style.display&&parseFloat(s.style.fontSize)>20&&r(s.style.color).toLowerCase()!=="#eb3737"&&(i=e.headingFontFamily,i[0]==="Safe Fonts"?(s.style.fontFamily=i[1],(c=[...s.classList].filter(d=>d.startsWith("em-font-"))[0])&&(s.classList.remove(c),n.headings.fontFamily?.[2]&&t.clearLinkTags({elem:document.head,fontFamilyClassName:a.buildEmFontClassName(n.headings.fontFamily[2],n.headings.fontFamily[3])}),t.clearProjectFontFaces())):i[0]==="Google Fonts"&&(cn(s,i),t.removeClassesByPrefix(s,"em-font"),s.classList.add(t.createFontClassName(i)),a.markProjectFontClass(s,i)))}),i.length>0&&i[0]==="Google Fonts"&&t.addFontFamilyClass({fontFamilyArray:i}),t.clearProjectFontFaces(),n.headings.fontFamily=e.headingFontFamily}e.headingFontSize!==void 0&&(o.forEach(i=>{const l=i;!l.style.display&&parseFloat(l.style.fontSize)>=20&&r(l.style.color).toLowerCase()!=="#eb3737"&&parseFloat(l.style.fontSize)<=40&&(l.style.fontSize=e.headingFontSize+"px")}),n.headings.fontSize=e.headingFontSize),e.headingLineHeight!==void 0&&(o.forEach(i=>{const l=i;!l.style.display&&parseFloat(l.style.fontSize)>20&&r(l.style.color).toLowerCase()!=="#eb3737"&&parseFloat(l.style.fontSize)<=40&&(l.style.lineHeight=e.headingLineHeight+"px")}),n.headings.lineHeight=e.headingLineHeight),e.headingLetterSpacing!==void 0&&(o.forEach(i=>{const l=i;!l.style.display&&parseFloat(l.style.fontSize)>20&&r(l.style.color).toLowerCase()!=="#eb3737"&&(e.headingLetterSpacing>0?l.style.letterSpacing=e.headingLetterSpacing+"px":l.style.removeProperty("letter-spacing"))}),n.headings.letterSpacing=e.headingLetterSpacing),e.headingBold!==void 0&&(o.forEach(i=>{const l=i;!l.style.display&&parseFloat(l.style.fontSize)>20&&r(l.style.color).toLowerCase()!=="#eb3737"&&(e.headingBold?l.querySelector("b")?l.querySelector("b").replaceWith(...l.querySelector("b").childNodes):l.querySelector("strong")||(l.innerHTML="<strong>"+l.innerHTML+"</strong>"):l.querySelector("strong")?l.querySelector("strong").replaceWith(...l.querySelector("strong").childNodes):l.querySelector("b")&&l.querySelector("b").replaceWith(...l.querySelector("b").childNodes),l.style.fontWeight&&l.style.removeProperty("font-weight"))}),n.headings.bold=e.headingBold),e.headingItalic!==void 0&&(o.forEach(i=>{const l=i;!l.style.display&&parseFloat(l.style.fontSize)>20&&r(l.style.color).toLowerCase()!=="#eb3737"&&(e.headingItalic?l.querySelector("i")?l.querySelector("i").replaceWith(...l.querySelector("i").childNodes):l.querySelector("em")||(l.innerHTML="<em>"+l.innerHTML+"</em>"):l.querySelector("em")?l.querySelector("em").replaceWith(...l.querySelector("em").childNodes):l.querySelector("i")&&l.querySelector("i").replaceWith(...l.querySelector("i").childNodes),l.style.fontStyle&&l.style.removeProperty("font-style"))}),n.headings.italic=e.headingItalic),e.headingColor!==void 0&&(o.forEach(i=>{const l=i;!l.closest(".em-contrast-block")&&!l.style.display&&parseFloat(l.style.fontSize)>20&&r(l.style.color).toLowerCase()!=="#eb3737"&&(l.style.color=e.headingColor)}),n.headings.color=e.headingColor),e.headingContrastColor!==void 0&&(o.forEach(i=>{const l=i;l.closest(".em-contrast-block")&&!l.style.display&&parseFloat(l.style.fontSize)>20&&(l.style.color=e.headingContrastColor)}),n.headings.contrastColor=e.headingContrastColor),sp(e,o,t),e.blockDarkBackgroundColor!==void 0&&(n.block.darkBackgroundColor=e.blockDarkBackgroundColor)}function sp(e,o,t){const{commonStyles:n,rgbToHex:r}=t;e.headingPaddingTop!==void 0&&(o.forEach(i=>{const l=i;if(l.closest('[em="atom"]')){if(!l.style.display&&parseFloat(l.style.fontSize)>20&&r(l.style.color).toLowerCase()!=="#eb3737"&&l.closest("table")?.getAttribute("em")=="atom"){const s=l.closest('[em="atom"]')?.querySelector(":scope > tr > td, :scope > tbody > tr > td");s&&(s.style.paddingTop=e.headingPaddingTop+"px",s.querySelector(":scope > .em-vindent-paddingTop")?.remove())}}else if(l.previousElementSibling){const s=l.previousElementSibling;if(!l.style.display&&parseFloat(l.style.fontSize)>20&&r(l.style.color).toLowerCase()!=="#eb3737"&&l.parentElement?.getAttribute("em")=="atom"&&s&&s.tagName=="TABLE"&&(s.classList.contains("em-vindent-table")||s.querySelector("td")?.innerHTML=="")){s.querySelector("td")?.setAttribute("height",e.headingPaddingTop);const c=s.querySelector(".em-element-vindent-value");c&&(c.innerHTML=e.headingPaddingTop+"px",e.headingPaddingTop<30?s.querySelector(".em-vindent")?.classList.add("em-vindent_low"):s.querySelector(".em-vindent")?.classList.remove("em-vindent_low"))}}}),n.headings.paddingTop=e.headingPaddingTop),e.headingPaddingBottom!==void 0&&(document.querySelectorAll('div[style*="font-family"]').forEach(i=>{const l=i,s=l.closest('[em="atom"]');if(s){const c=s.querySelector(":scope > tr > td, :scope > tbody > tr > td");c?.style.paddingBottom&&!l.style.display&&parseFloat(l.style.fontSize)>20&&r(l.style.color).toLowerCase()!=="#eb3737"&&l.closest("table")?.getAttribute("em")=="atom"&&(c.style.paddingBottom=e.headingPaddingBottom+"px",c.querySelector(":scope > .em-vindent-paddingBottom")?.remove())}else if(l.nextElementSibling){const c=l.nextElementSibling;if(!l.style.display&&parseFloat(l.style.fontSize)>20&&r(l.style.color).toLowerCase()!=="#eb3737"&&l.parentElement?.getAttribute("em")=="atom"&&c&&c.tagName=="TABLE"&&(c.classList.contains("em-vindent-table")||c.querySelector("td")?.innerHTML=="")){c.querySelector("td")?.setAttribute("height",e.headingPaddingBottom);const d=c.querySelector(".em-element-vindent-value");d&&(d.innerHTML=e.headingPaddingBottom+"px",e.headingPaddingBottom<30?c.querySelector(".em-vindent")?.classList.add("em-vindent_low"):c.querySelector(".em-vindent")?.classList.remove("em-vindent_low"))}}}),n.headings.paddingBottom=e.headingPaddingBottom)}function cp(e,o){const{commonStyles:t}=o,n=document.querySelectorAll('a[style*="color"]');e.linkColor!==void 0&&(n.forEach(r=>{const i=r;!i.closest(".em-contrast-block")&&!i.style.display&&(i.style.color=e.linkColor)}),t.links.color=e.linkColor),e.linkContrastColor!==void 0&&(n.forEach(r=>{const i=r;i.closest(".em-contrast-block")&&!i.style.display&&(i.style.color=e.linkContrastColor)}),t.links.contrastColor=e.linkContrastColor),e.linkUnderline!==void 0&&(n.forEach(r=>{const i=r;if(!i.style.display){i.style.textDecoration=e.linkUnderline?"underline":"none";const l=i.parentElement;l&&l.tagName=="SPAN"&&l.style.textDecoration=="underline"&&l.replaceWith(...l.childNodes)}}),t.links.underline=e.linkUnderline)}function dp(e,o){const{commonStyles:t}=o,n=document.querySelectorAll('a[style*="font-family"]');if(e.buttonsFontFamily!==void 0){let r=[];n.forEach(i=>{const l=i;let s;l.style.display&&l.style.display=="block"&&(r=e.buttonsFontFamily,r[0]==="Safe Fonts"?(l.style.fontFamily=r[1],(s=[...l.classList].filter(c=>c.startsWith("em-font-"))[0])&&(l.classList.remove(s),t.buttons.fontFamily?.[2]&&o.clearLinkTags({elem:document.head,fontFamilyClassName:a.buildEmFontClassName(t.buttons.fontFamily[2],t.buttons.fontFamily[3])}),o.clearProjectFontFaces())):r[0]==="Google Fonts"&&(cn(l,r),o.removeClassesByPrefix(l,"em-font"),l.classList.add(o.createFontClassName(r)),a.markProjectFontClass(l,r)))}),r.length>0&&r[0]==="Google Fonts"&&o.addFontFamilyClass({fontFamilyArray:r}),o.clearProjectFontFaces(),t.buttons.fontFamily=e.buttonsFontFamily}e.buttonsFontSize!==void 0&&(n.forEach(r=>{const i=r;i.style.display&&i.style.display=="block"&&(i.style.fontSize=e.buttonsFontSize+"px")}),t.buttons.fontSize=e.buttonsFontSize),e.buttonsLetterSpacing!==void 0&&(n.forEach(r=>{const i=r;i.style.display&&i.style.display=="block"&&(e.buttonsLetterSpacing>0?i.style.letterSpacing=e.buttonsLetterSpacing+"px":i.style.removeProperty("letter-spacing"))}),t.buttons.letterSpacing=e.buttonsLetterSpacing),mp(e,n,o),up(e,n,o),fp(e,n,o)}function mp(e,o,t){const{commonStyles:n}=t;e.buttonsColor!==void 0&&(o.forEach(r=>{const i=r;!i.closest(".em-contrast-block")&&i.style.display&&i.style.display=="block"&&(i.style.color=e.buttonsColor)}),n.buttons.color=e.buttonsColor),e.buttonsContrastColor!==void 0&&(o.forEach(r=>{const i=r;i.closest(".em-contrast-block")&&i.style.display&&i.style.display=="block"&&(i.style.color=e.buttonsContrastColor)}),n.buttons.contrastColor=e.buttonsContrastColor),e.buttonsBold!==void 0&&(o.forEach(r=>{const i=r;i.style.display&&i.style.display=="block"&&(e.buttonsBold?i.querySelector("b")?i.querySelector("b").replaceWith(...i.querySelector("b").childNodes):i.querySelector("strong")||(i.innerHTML="<strong>"+i.innerHTML+"</strong>"):i.querySelector("strong")?i.querySelector("strong").replaceWith(...i.querySelector("strong").childNodes):i.querySelector("b")&&i.querySelector("b").replaceWith(...i.querySelector("b").childNodes),i.style.fontWeight&&i.style.removeProperty("font-weight"))}),n.buttons.bold=e.buttonsBold),e.buttonsItalic!==void 0&&(o.forEach(r=>{const i=r;i.style.display&&i.style.display=="block"&&(e.buttonsItalic?i.querySelector("i")?i.querySelector("i").replaceWith(...i.querySelector("i").childNodes):i.querySelector("em")||(i.innerHTML="<em>"+i.innerHTML+"</em>"):i.querySelector("em")?i.querySelector("em").replaceWith(...i.querySelector("em").childNodes):i.querySelector("i")&&i.querySelector("i").replaceWith(...i.querySelector("i").childNodes),i.style.fontStyle&&i.style.removeProperty("font-style"))}),n.buttons.italic=e.buttonsItalic),e.buttonsBackgroundColor!==void 0&&(o.forEach(r=>{const i=r;if(!i.closest(".em-contrast-block")&&i.style.display&&i.style.display=="block"){const l=i.closest("td");l&&(l.getAttribute("bgcolor")&&(e.buttonsBackgroundColor?l.setAttribute("bgcolor",e.buttonsBackgroundColor):l.removeAttribute("bgcolor")),e.buttonsBackgroundColor?l.style.backgroundColor=e.buttonsBackgroundColor:l.style.removeProperty("background-color"))}}),n.buttons.backgroundColor=e.buttonsBackgroundColor),e.buttonsContrastBackgroundColor!==void 0&&(o.forEach(r=>{const i=r;if(i.closest(".em-contrast-block")&&i.style.display&&i.style.display=="block"){const l=i.closest("td");l&&(l.getAttribute("bgcolor")&&(e.buttonsContrastBackgroundColor?l.setAttribute("bgcolor",e.buttonsContrastBackgroundColor):l.removeAttribute("bgcolor")),e.buttonsContrastBackgroundColor?l.style.backgroundColor=e.buttonsContrastBackgroundColor:l.style.removeProperty("background-color"))}}),n.buttons.contrastBackgroundColor=e.buttonsContrastBackgroundColor),e.buttonsAlign!==void 0&&(o.forEach(r=>{const i=r;i.style.display&&i.style.display=="block"&&i.closest("td")?.setAttribute("align",e.buttonsAlign)}),n.buttons.textAlign=e.buttonsAlign)}function up(e,o,t){const{commonStyles:n}=t;e.buttonsMarginTop!==void 0&&(o.forEach(r=>{const i=r,l=i.closest('[em="atom"]');if(l){const s=l.querySelector(":scope > tr > td, :scope > tbody > tr > td");s?.style.paddingTop&&i.style.display&&i.style.display=="block"&&(s.style.paddingTop=e.buttonsMarginTop+"px",s.querySelector(":scope > .em-vindent-paddingTop")?.remove())}else{const s=i.closest("table");if(s?.previousElementSibling){const c=s.previousElementSibling,d=i.closest("div");if(i.style.display&&i.style.display=="block"&&d&&d.getAttribute("em")=="atom"&&c&&c.tagName=="TABLE"&&(c.classList.contains("em-vindent-table")||c.querySelector("td")?.innerHTML=="")){c.querySelector("td")?.setAttribute("height",e.buttonsMarginTop);const u=c.querySelector(".em-element-vindent-value");u&&(u.innerHTML=e.buttonsMarginTop+"px",e.buttonsMarginTop<30?c.querySelector(".em-vindent")?.classList.add("em-vindent_low"):c.querySelector(".em-vindent")?.classList.remove("em-vindent_low"))}}}}),n.buttons.marginTop=e.buttonsMarginTop),e.buttonsMarginBottom!==void 0&&(o.forEach(r=>{const i=r,l=i.closest('[em="atom"]');if(l){const s=l.querySelector(":scope > tr > td, :scope > tbody > tr > td");s?.style.paddingBottom&&i.style.display&&i.style.display=="block"&&(s.style.paddingBottom=e.buttonsMarginBottom+"px",s.querySelector(":scope > .em-vindent-paddingBottom")?.remove())}else{const s=i.closest("table");if(s?.previousElementSibling){const c=s.nextElementSibling,d=i.closest("div");if(i.style.display&&i.style.display=="block"&&d&&d.getAttribute("em")=="atom"&&c&&c.tagName=="TABLE"&&(c.classList.contains("em-vindent-table")||c.querySelector("td")?.innerHTML=="")){c.querySelector("td")?.setAttribute("height",e.buttonsMarginBottom);const u=c.querySelector(".em-element-vindent-value");u&&(u.innerHTML=e.buttonsMarginBottom+"px",e.buttonsMarginBottom<30?c.querySelector(".em-vindent")?.classList.add("em-vindent_low"):c.querySelector(".em-vindent")?.classList.remove("em-vindent_low"))}}}}),n.buttons.marginBottom=e.buttonsMarginBottom)}function fp(e,o,t){const{commonStyles:n,setElementBorder:r,setElementBorderRadius:i}=t;e.buttonsBorder!==void 0&&(o.forEach(l=>{const s=l;if(s.style.display&&s.style.display=="block"){const c=s.closest("td");c&&r({settings:{border:e.buttonsBorder},elem:c})}}),e.buttonsBorder.all!==void 0&&(n.buttons.border.all=e.buttonsBorder.all),e.buttonsBorder.top!==void 0&&(n.buttons.border.top=e.buttonsBorder.top),e.buttonsBorder.right!==void 0&&(n.buttons.border.right=e.buttonsBorder.right),e.buttonsBorder.bottom!==void 0&&(n.buttons.border.bottom=e.buttonsBorder.bottom),e.buttonsBorder.left!==void 0&&(n.buttons.border.left=e.buttonsBorder.left)),e.buttonsBorderRadius!==void 0&&(o.forEach(l=>{const s=l;if(s.style.display&&s.style.display=="block"){const c=s.closest("td");c&&i({settings:{borderRadius:e.buttonsBorderRadius},elem:c})}}),e.buttonsBorderRadius.all!==void 0&&(n.buttons.borderRadius.all=e.buttonsBorderRadius.all),e.buttonsBorderRadius.topLeft!==void 0&&(n.buttons.borderRadius.topLeft=e.buttonsBorderRadius.topLeft),e.buttonsBorderRadius.topRight!==void 0&&(n.buttons.borderRadius.topRight=e.buttonsBorderRadius.topRight),e.buttonsBorderRadius.bottomRight!==void 0&&(n.buttons.borderRadius.bottomRight=e.buttonsBorderRadius.bottomRight),e.buttonsBorderRadius.bottomLeft!==void 0&&(n.buttons.borderRadius.bottomLeft=e.buttonsBorderRadius.bottomLeft)),e.buttonsPadding!==void 0&&(o.forEach(l=>{const s=l;s.style.display&&s.style.display=="block"&&(e.buttonsPadding.all!==void 0?(s.style.paddingTop=e.buttonsPadding.all+"px",s.style.paddingRight=e.buttonsPadding.all+"px",s.style.paddingBottom=e.buttonsPadding.all+"px",s.style.paddingLeft=e.buttonsPadding.all+"px"):((e.buttonsPadding.top!==void 0||e.buttonsPadding.top==0)&&(s.style.paddingTop=e.buttonsPadding.top+"px"),(e.buttonsPadding.right!==void 0||e.buttonsPadding.right==0)&&(s.style.paddingRight=e.buttonsPadding.right+"px"),(e.buttonsPadding.bottom!==void 0||e.buttonsPadding.bottom==0)&&(s.style.paddingBottom=e.buttonsPadding.bottom+"px"),(e.buttonsPadding.left!==void 0||e.buttonsPadding.left==0)&&(s.style.paddingLeft=e.buttonsPadding.left+"px")))}),e.buttonsPadding.all!==void 0&&(n.buttons.padding={all:e.buttonsPadding.all}),e.buttonsPadding.top!==void 0&&(n.buttons.padding={top:e.buttonsPadding.top}),e.buttonsPadding.right!==void 0&&(n.buttons.padding={right:e.buttonsPadding.right}),e.buttonsPadding.bottom!==void 0&&(n.buttons.padding={bottom:e.buttonsPadding.bottom}),e.buttonsPadding.left!==void 0&&(n.buttons.padding={left:e.buttonsPadding.left}))}function pp(e,o){const{commonStyles:t,setElementBorder:n,setElementBorderRadius:r}=o;t.cards||(t.cards={});const i=document.querySelectorAll(".em-contrast-card");e.cardsContrastBackgroundColor!==void 0&&(i.forEach(c=>{const d=c;d.getAttribute("bgcolor")&&(e.cardsContrastBackgroundColor?d.setAttribute("bgcolor",e.cardsContrastBackgroundColor):d.removeAttribute("bgcolor")),e.cardsContrastBackgroundColor?d.style.backgroundColor=e.cardsContrastBackgroundColor:d.style.removeProperty("background-color")}),t.cards.contrastBackgroundColor=e.cardsContrastBackgroundColor),e.cardsContrastTextColor!==void 0&&(i.forEach(c=>{c.querySelectorAll('div[style*="font-family"], span[style*="font-family"]').forEach(d=>{d.style.color=e.cardsContrastTextColor})}),t.cards.contrastTextColor=e.cardsContrastTextColor);const l=document.querySelectorAll(".em-card");e.cardsBaseBackgroundColor!==void 0&&(l.forEach(c=>{const d=c;d.getAttribute("bgcolor")&&(e.cardsBaseBackgroundColor?d.setAttribute("bgcolor",e.cardsBaseBackgroundColor):d.removeAttribute("bgcolor")),e.cardsBaseBackgroundColor?d.style.backgroundColor=e.cardsBaseBackgroundColor:d.style.removeProperty("background-color")}),t.cards.baseBackgroundColor=e.cardsBaseBackgroundColor),e.cardsBaseTextColor!==void 0&&(l.forEach(c=>{c.querySelectorAll('div[style*="font-family"], span[style*="font-family"]').forEach(d=>{d.style.color=e.cardsBaseTextColor})}),t.cards.baseTextColor=e.cardsBaseTextColor);const s=document.querySelectorAll(".em-card, .em-contrast-card");e.cardsBorderRadius!==void 0&&(t.cards.borderRadius||(t.cards.borderRadius={}),s.forEach(c=>{r({settings:{borderRadius:e.cardsBorderRadius},elem:c})}),e.cardsBorderRadius.all!==void 0&&(t.cards.borderRadius.all=e.cardsBorderRadius.all),e.cardsBorderRadius.topLeft!==void 0&&(t.cards.borderRadius.topLeft=e.cardsBorderRadius.topLeft),e.cardsBorderRadius.topRight!==void 0&&(t.cards.borderRadius.topRight=e.cardsBorderRadius.topRight),e.cardsBorderRadius.bottomRight!==void 0&&(t.cards.borderRadius.bottomRight=e.cardsBorderRadius.bottomRight),e.cardsBorderRadius.bottomLeft!==void 0&&(t.cards.borderRadius.bottomLeft=e.cardsBorderRadius.bottomLeft)),e.cardsBorder!==void 0&&(t.cards.border||(t.cards.border={}),s.forEach(c=>{n({settings:{border:e.cardsBorder},elem:c})}),e.cardsBorder.all&&(t.cards.border.all=e.cardsBorder.all),e.cardsBorder.top&&(t.cards.border.top=e.cardsBorder.top),e.cardsBorder.right&&(t.cards.border.right=e.cardsBorder.right),e.cardsBorder.bottom&&(t.cards.border.bottom=e.cardsBorder.bottom),e.cardsBorder.left&&(t.cards.border.left=e.cardsBorder.left))}function gp(e,o){const{commonStyles:t,globalHolder:n}=o;if(!n)return;const r=n.classList.contains("full-wrap")?n.querySelector("td"):n;if(!r)return;(e.blockBackgroundColor!==void 0||e.blockBackgroundColor==="")&&bi(e.blockBackgroundColor,r,!1,t),(e.blockContrastBackgroundColor!==void 0||e.blockContrastBackgroundColor==="")&&bi(e.blockContrastBackgroundColor,r,!0,t);const i=document.querySelectorAll('[em="block"] > td');if(e.blockPadding!==void 0){const l=e.blockPadding;t.block||(t.block={}),t.block.padding||(t.block.padding={});const s=l.left!==void 0||l.right!==void 0;i.forEach(c=>{const d=c;l.top!==void 0&&(d.style.paddingTop=`${l.top}px`),l.right!==void 0&&(d.style.paddingRight=`${l.right}px`),l.bottom!==void 0&&(d.style.paddingBottom=`${l.bottom}px`),l.left!==void 0&&(d.style.paddingLeft=`${l.left}px`)}),["top","right","bottom","left"].forEach(c=>{l[c]!==void 0&&(t.block.padding[c]=l[c])}),s&&i.forEach(c=>{const d=c,u=d.querySelector(".em-mob-wrap"),g=d.parentElement?.getAttribute("em")==="block";u&&g&&d.querySelectorAll(":scope > table").forEach(m=>{o.setStructureBlocksWidth(m)})})}}function bi(e,o,t,n){const r=o.querySelector(".em-narrow-table"),i=t?'[em="block"].em-contrast-block > td':'[em="block"]:not(.em-contrast-block) > td',l=t?'[em="block"] > td > table > tr > [bgcolor]':'[em="block"]:not(.em-contrast-block) > td > table > tr > [bgcolor]',s=t?'[em="block"] > td > table > tr > [style*="background-color"]':'[em="block"]:not(.em-contrast-block) > td > table > tr > [style*="background-color"]';r?e===""?o.querySelectorAll(i).forEach(c=>{const d=c;d.removeAttribute("bgcolor"),d.style.removeProperty("background-color")}):o.querySelectorAll(i).forEach(c=>{const d=c;d.setAttribute("bgcolor",e),d.style.backgroundColor=e}):e===""?o.querySelector(l)?o.querySelectorAll(l).forEach(c=>{const d=c;d.removeAttribute("bgcolor"),d.style.removeProperty("background-color")}):o.querySelector(s)&&o.querySelectorAll(s).forEach(c=>{const d=c;d.removeAttribute("bgcolor"),d.style.removeProperty("background-color")}):o.querySelector(l)?o.querySelectorAll(l).forEach(c=>{const d=c;d.style.backgroundColor=e,d.setAttribute("bgcolor",e)}):o.querySelector(s)&&o.querySelectorAll(s).forEach(c=>{const d=c;d.style.backgroundColor=e,d.setAttribute("bgcolor",e)}),t?n.block.contrastBackgroundColor=e:n.block.backgroundColor=e}var bp=320;function hi(e){if(e==null||e==="")return null;if(typeof e=="number"&&!Number.isNaN(e))return e;if(typeof e=="object"&&e!==null&&"value"in e){const o=Number(e.value);return Number.isNaN(o)?null:o}return null}function yi(){for(const e of document.body.children)if(e.tagName==="DIV"||e.tagName==="CENTER"){const o=e;if(o.style.background||o.style.backgroundColor)return e;for(const t of e.children)if(t.tagName==="DIV"){if(o.style.background||o.style.backgroundColor)return e;for(const n of t.children){const r=n;if(r.getAttribute("width")==="100%"||r.style.width==="100%")return n}}else{const n=t;if(n.getAttribute("width")==="100%"||n.style.width==="100%")return t}}else{const o=e;if(o.getAttribute("width")==="100%"||o.style.width==="100%")return e}return null}function hp(e,o){const{globalHolder:t,emailWidth:n,state:r,findParentTr:i}=o,l=hi(e.width);if(l==null||l<bp||!t)return!1;function s(c){if(c.elem.nodeName==="#comment"&&c.elem.textContent?.indexOf("mso")!==-1)c.elem.textContent=c.elem.textContent.replace(/width=".*"/gi,`width="${c.width}"`);else{const d=c.elem.previousSibling;d&&s({elem:d,width:c.width})}}return t.querySelector(".em-narrow-table")||t.querySelector(".noresp-em-narrow-table")?(yp(t,l,n,s),Ep(t,e,n,i,s)):vp(t,l,n,s),n>500&&t.querySelectorAll(`[width="${n}"]`).forEach(c=>{c.setAttribute("width",String(l))}),Ap(l),r.set("emailWidth",l),!0}function yp(e,o,t,n){e.querySelectorAll('[style*="width"]').forEach(r=>{const i=r;i.style.verticalAlign||(i.style.width&&parseFloat(i.style.width)===t&&(i.style.width=o+"px"),i.style.maxWidth&&parseFloat(i.style.maxWidth)===t&&(i.style.maxWidth=o+"px"),i.style.minWidth&&parseFloat(i.style.minWidth)===t&&(i.style.minWidth=o+"px"),n({elem:i,width:o}))})}function Ep(e,o,t,n,r){const i=[];e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(s=>{const c=n(s);c&&!i.includes(c)&&i.push(c)});const l=o.project==="useblocks"?640:660;i.forEach(s=>{const c=s.querySelector(".em-mob-wrap, .noresp-em-mob-wrap");if(!c)return;const d=c.parentElement?.closest("td"),u=parseFloat(d?.style.paddingLeft||"0")||0,g=parseFloat(d?.style.paddingRight||"0")||0,m=c.closest("table")?.parentElement?.getBoundingClientRect().width||0,f=s.querySelector(".em-mob-wrap:empty, .noresp-em-mob-wrap:empty")?660:l;if(s.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").length>1)Sp(s)&&Cp(s,m,u,g,f);else if(c.getAttribute("width")&&!c.classList.contains("em-insert-ignore")){const p=Math.round(m-u-g);c.setAttribute("width",String(p))}})}function Sp(e){const o=e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)");for(let t=0;t<o.length;t++){const n=o[t];if(n.classList.contains("em-insert-ignore"))continue;const r=n.getAttribute("width");if(r!=null&&r!=="")return!0}return!1}function Cp(e,o,t,n,r){const i=e.querySelector(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)"),l=i?parseFloat(i.getAttribute("width")||"0"):0,s=e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)"),c=s.length;let d=0,u=0;s.forEach(f=>{const p=f;if(p.getAttribute("width")&&!p.classList.contains("em-insert-ignore")){const b=parseFloat(p.getAttribute("width")||"0")/r,h=Math.round(o*b-l/(c*2));p.setAttribute("width",String(h)),d+=h}});const g=o-(t+n+l*(c-1)+d);s.forEach(f=>{const p=f;if(p.getAttribute("width")&&!p.classList.contains("em-insert-ignore")){const b=parseFloat(p.getAttribute("width")||"0")+Math.round(g/c);u+=b,p.setAttribute("width",String(b)),p.querySelectorAll("img").forEach(h=>{parseFloat(h.getAttribute("width")||"0")>b&&(h.setAttribute("width",String(b)),h.style.maxWidth=b+"px")})}}),u=u+l*(c-1)+t+n;const m=o-u;if(m!==0&&d>0){const f=e.querySelector(".em-mob-wrap:last-child, .noresp-em-mob-wrap:last-child");if(f&&!f.classList.contains("em-insert-ignore")){const p=parseFloat(f.getAttribute("width")||"0");f.setAttribute("width",String(p+m))}else{const p=e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)");for(let b=p.length-1;b>=0;b--){const h=p[b];if(h.classList.contains("em-insert-ignore"))continue;const y=parseFloat(h.getAttribute("width")||"0");h.setAttribute("width",String(y+m));break}}}}function vp(e,o,t,n){e.querySelectorAll('div[style*="inline-block"]').forEach(r=>{const i=r;if(!i.getAttribute("em-floatblock-width")){const l=i.parentElement?.getBoundingClientRect().width||1;i.setAttribute("em-floatblock-width",String(i.getBoundingClientRect().width/l))}}),e.querySelectorAll('[style*="width"]').forEach(r=>{const i=r;i.style.verticalAlign||(i.style.width&&parseFloat(i.style.width)===t&&(i.style.width=o+"px"),i.style.maxWidth&&parseFloat(i.style.maxWidth)===t&&(i.style.maxWidth=o+"px"),i.style.minWidth&&parseFloat(i.style.minWidth)===t&&(i.style.minWidth=o+"px"),n({elem:i,width:o}))}),e.querySelectorAll('div[style*="inline-block"]').forEach(r=>{const i=r,l=i.parentElement?.getBoundingClientRect().width||0,s=parseFloat(i.getAttribute("em-floatblock-width")||"0"),c=i.getBoundingClientRect().width-(i.firstElementChild?.getBoundingClientRect().width||0),d=i.getBoundingClientRect().width-c;let u=0;i.style.maxWidth?(i.style.maxWidth=Math.floor(l*s)+"px",u=i.getBoundingClientRect().width-c,i.firstElementChild&&(i.firstElementChild.setAttribute("width",String(Math.round(u))),i.firstElementChild.style.maxWidth=Math.round(u)+"px")):i.style.width&&(i.style.width=Math.floor(l*s)+"px",u=i.getBoundingClientRect().width-c,i.firstElementChild?.setAttribute("width",String(u))),n({elem:i,width:Math.floor(l*s)}),i.removeAttribute("em-floatblock-width"),i.querySelectorAll("img").forEach(g=>{const m=parseFloat(g.getAttribute("width")||"0");(m>=u||m===d)&&(g.setAttribute("width",String(u)),g.style.maxWidth=u+"px")})})}function Ap(e){for(const o of document.head.querySelectorAll("style"))if(o.innerHTML.match(/@media.*?max((.|\n|\r)*?){/)){o.innerHTML=o.innerHTML.replace(/max-device-width:\d+px/gi,`max-device-width:${e}px`),o.innerHTML=o.innerHTML.replace(/max-width:\d+px/gi,`max-width:${e}px`);break}}function Tp(e,o){e.querySelectorAll("img, amp-img").forEach(t=>{const n=t;if(o){const r=n.getAttribute("width");if(r)if(n.style.width="100%",r.includes("%"))n.style.maxWidth=r;else{const i=parseFloat(r);Number.isNaN(i)||(n.style.maxWidth=`${i}px`)}}else n.style.removeProperty("width"),n.style.removeProperty("max-width")})}function Lp(e,o){if(e.responsive===void 0||!o)return;const t=hi(e.width);if(e.responsive.shutdown){const n=o.querySelector(".noresp-em-narrow-table");if(n)n.className=n.className.replace(/noresp-em-narrow/gi,"em-narrow");else{const r=o.querySelector("table:first-child");r&&(r.setAttribute("width","100%"),r.style.width="100%",t!=null&&(r.style.maxWidth=t+"px"),r.style.minWidth="320px")}document.querySelectorAll('[class*="noresp-em-mob"]').forEach(r=>{r.className=r.className.replace(/noresp-em-mob/gi,"em-mob")}),document.documentElement.removeAttribute("style")}else{const n=o.querySelector(".em-narrow-table");if(n)n.className=n.className.replace(/em-narrow/gi,"noresp-em-narrow");else{const r=o.querySelector("table:first-child");r&&t!=null&&(r.setAttribute("width",String(t)),r.style.width=t+"px",r.style.maxWidth=t+"px",r.style.minWidth=t+"px")}document.querySelectorAll('[class*="em-mob"]:not([class*="noresp-em-mob"])').forEach(r=>{r.className=r.className.replace(/em-mob/gi,"noresp-em-mob")})}Tp(o,!!e.responsive.shutdown)}function wp(e,o,t){const n=o.parentNode;n&&(n.style.backgroundColor="rgba(0,255,0,0.3)");let r="";document.head.querySelectorAll("style").forEach(s=>{r+=t.HTMLDocument.getInnerHtml(s)});const i=document.createElement("style");i.setAttribute("em","styles"),i.innerHTML=r;const l=a.serializeOuterHtml(i)+`
275
+ `+t.HTMLDocument.getOuterHtml(e);navigator.clipboard.writeText(l),setTimeout(()=>{n&&n.style.removeProperty("background-color")},2e3)}function kp(e,o,t){navigator.clipboard.readText().then(n=>{const r=t.parseFromString(n);let i=r.filter(d=>d.tagName&&d.tagName!=="LINK"&&d.tagName!=="STYLE").map(d=>t.getOuterHtml(d)).join(""),l=r.filter(d=>d.tagName==="STYLE").map(d=>t.getOuterHtml(d)).join("");const s=r.filter(d=>d.tagName==="LINK"&&d.getAttribute("em-class")).filter(d=>!document.head?.querySelector(`link[em-class="${d.getAttribute("em-class")}"]`));if(l){let d=document.head.querySelector('style[em="styles"]'),u="";d?u=t.HTMLDocument.getInnerHtml(d):(d=document.createElement("style"),d.setAttribute("em","styles"),d=document.head.insertAdjacentElement("beforeend",d));const g=document.createElement("div");t.emailWidth&&(l=l.replace(/(max-device-width:|max-width:)\d+px/g,f=>f.replace(/\d+/,String(t.emailWidth)))),t.insertAdjacentHTML(g,"afterbegin",l);let m=t.minify(u+`
276
276
  `+[...g.querySelectorAll("style")].map(f=>f.innerHTML).join(`
277
277
  `),{restructure:!0,forceMediaMerge:!0}).css;m=t.cssbeautify(m,{indent:" ",autosemicolon:!0}),d.textContent=`
278
278
  `+m+`
279
279
  `}for(const d of s.reverse())document.head?.prepend(d),document.head?.insertAdjacentHTML("afterbegin",`
280
- `);(i.indexOf("empty-structure")>-1||i.indexOf("em-structure")>-1)&&(i=t.setBlockMaxWidth({blockHTML:i,targetBlock:e}),i=t.setFloatBlocksWidth({blockHTML:i,targetBlock:e,project:t.appName})),i=t.checkBlockAdaptivity({blockHTML:i,blockIsTr:i.substring(0,3)==="<tr"});const c=o.parentNode;if(e.tagName==="TR"){const d=document.createElement("table");t.insertAdjacentHTML(d,"afterbegin",i),d.querySelector('[em="block"]')?(d.querySelector(".em-element-editor")?.remove(),e.removeAttribute("em-state"),e.after(d.querySelector("tr")),t.commit(),t.setCursorPosition(e)):Ei(c)}else{const d=document.createElement("div");d.insertAdjacentHTML("afterbegin",i),d.querySelector('[em="block"]')?(d.querySelector(".em-element-editor")?.remove(),e.removeAttribute("em-state"),e.after(d.querySelector('[em="block"]')),t.commit(),t.setCursorPosition(e)):Ei(c)}}).catch(()=>{})}function Ei(e){e&&(e.style.backgroundColor="rgba(255,0,0,0.3)",setTimeout(()=>{e.style.removeProperty("background-color")},2e3))}function Lp(e){return function(t){document.body&&!document.body.classList.contains("mceNonEditable")&&(t.stopPropagation(),t.preventDefault()),e.setEditorFocus(!1);const n=t.target;if(document.documentElement.classList.contains("em-resize-start")||n.classList.contains("em-element-editor-widget")||n.classList.contains("em-element-block-add"))return;let r=n;if(!e.getLockEditor()){const b=r.closest(".em-narrow-table");if(b&&!b.innerHTML.trim()&&e.insertTextAtomIntoEmptyNarrowTable(b))return}const i=r.closest("a");if(i instanceof HTMLAnchorElement){const b=i.getAttribute("href")||i.href||"";if(Lt(b)){const h=b.slice(1),y=document.querySelector(`a[name="${h}"]`);y&&(t.preventDefault(),y.scrollIntoView({behavior:"smooth",block:"start"}))}else i.href&&document.referrer.includes("raw")&&window.open(i.href);t.stopPropagation(),t.preventDefault()}if(r.tagName==="HTML"||r.classList.contains(a.ICON_ROLE.drag)||r.classList.contains("em-element-editor"))return;const l=document.body,s=l?.classList.contains("mceNonEditable"),c=l?.classList.contains("em-sandbox-discuss"),d=document.referrer.includes("raw"),u=r.tagName==="A"||r.closest("a")||r.tagName==="IMG";if(s&&!c&&(!d||!u)){e.setCursorPosition(r);return}if(e.isDiscussViewMode()){e.handleDiscussViewClick(r);return}if(e.isDiscussSetTargetMode()){r=e.handleDiscussSetTargetClick(r).newClickedElement;return}r instanceof Element&&r.tagName==="EDITOR"&&(r=r.parentElement);const g=r.closest('[em="atom"]');if(g&&r.closest(".em-element-editor-widget-remove")){e.handleRemoveAtom(g);return}if(g&&r.closest(".em-element-editor-widget-edit")){e.applicationElementSettingsSet({elem:g}),e.setCursorPosition(g);return}if(g&&r.closest(".em-element-editor-widget-clone")){e.handleCloneAtom(g);return}const m=r.closest('[em="block"]');if(m&&r.classList.contains(a.ICON_ROLE.moveUp)){e.handleMoveBlockUp(m);return}if(m&&r.classList.contains(a.ICON_ROLE.moveDown)){e.handleMoveBlockDown(m);return}if(m&&r.closest(".em-element-editor-widget-edit")){const b=m.querySelector("td");b&&e.applicationElementSettingsSet({elem:b}),e.setCursorPosition(m);return}if(m&&r.closest(".em-element-editor-widget-remove")){e.handleRemoveBlock(m);return}if(m&&r.closest(".em-element-editor-widget-add-block")){e.addBlockToProject(r);return}if(m&&r.closest(".em-element-editor-widget-clone")){e.handleCloneBlock(m);return}if(m&&e.isAddBlockMenuClick(r)){e.handleAddBlockMenu(m,r);return}if(m&&r.closest(".em-element-editor-widget-copy")){e.handleCopyBlock(m,r);return}if(m&&r.closest(".em-element-editor-widget-paste")){e.handlePasteBlock(m,r);return}if(m&&r.classList.contains(a.ICON_ROLE.merge)){e.handleMergeBlocks(m);return}if(m&&r.classList.contains(a.ICON_ROLE.unmerge)){e.handleUnmergeBlocks(m);return}const f=r.closest('[em="group"]');if(f&&r.classList.contains(a.ICON_ROLE.moveUp)){e.handleMoveGroupUp(f);return}if(f&&r.classList.contains(a.ICON_ROLE.moveDown)){e.handleMoveGroupDown(f);return}if(f&&r.classList.contains(a.ICON_ROLE.add)){e.handleAddGroup(f);return}if(f&&r.closest(".em-element-editor-widget-edit")){e.setCursorPosition(f);const b=f.tagName!=="TR"?f:f.querySelector("td");b&&e.applicationElementSettingsSet({elem:b});return}if(f&&r.closest(".em-element-editor-widget-clone")){e.handleCloneGroup(f);return}if(f&&r.closest(".em-element-editor-widget-remove")&&r.closest(".of-group")){e.handleRemoveGroup(f);return}if(!r.closest(".em-editor-wrapper")&&!r.closest(".em-element-path")&&!r.closest(".em-element-vindent-remove")){const b=window.getSelection();if(b?.isCollapsed)e.setCursorPosition(r);else if(b&&b.rangeCount>0){const y=b.getRangeAt(0).commonAncestorContainer,E=e.findOutermostParentWithText(y);E&&e.setCursorPosition(E);const S=e.getParentElementOfSelection();S&&(r=S)}e.applicationElementSettingsSet({elem:r});const h=document.querySelector(".em-editor-wrapper");h&&(h.style.display="none"),e.setBlockGroupControlsPosition()}r.closest("em-replace")&&e.handleEmReplaceClick(r,t);const p=r?.tagName==="TD"?r?.querySelector("div"):r?.closest("div")||r;r.closest(".em-element-custom-table")&&p?.tagName==="DIV"&&e.handleCustomTableClick(r,t)}}var Si=`<style em="styles">
280
+ `);(i.indexOf("empty-structure")>-1||i.indexOf("em-structure")>-1)&&(i=t.setBlockMaxWidth({blockHTML:i,targetBlock:e}),i=t.setFloatBlocksWidth({blockHTML:i,targetBlock:e,project:t.appName})),i=t.checkBlockAdaptivity({blockHTML:i,blockIsTr:i.substring(0,3)==="<tr"});const c=o.parentNode;if(e.tagName==="TR"){const d=document.createElement("table");t.insertAdjacentHTML(d,"afterbegin",i),d.querySelector('[em="block"]')?(d.querySelector(".em-element-editor")?.remove(),e.removeAttribute("em-state"),e.after(d.querySelector("tr")),t.commit(),t.setCursorPosition(e)):Ei(c)}else{const d=document.createElement("div");d.insertAdjacentHTML("afterbegin",i),d.querySelector('[em="block"]')?(d.querySelector(".em-element-editor")?.remove(),e.removeAttribute("em-state"),e.after(d.querySelector('[em="block"]')),t.commit(),t.setCursorPosition(e)):Ei(c)}}).catch(()=>{})}function Ei(e){e&&(e.style.backgroundColor="rgba(255,0,0,0.3)",setTimeout(()=>{e.style.removeProperty("background-color")},2e3))}function _p(e){return function(t){document.body&&!document.body.classList.contains("mceNonEditable")&&(t.stopPropagation(),t.preventDefault()),e.setEditorFocus(!1);const n=t.target;if(document.documentElement.classList.contains("em-resize-start")||n.classList.contains("em-element-editor-widget")||n.classList.contains("em-element-block-add"))return;let r=n;if(!e.getLockEditor()){const b=r.closest(".em-narrow-table");if(b&&!b.innerHTML.trim()&&e.insertTextAtomIntoEmptyNarrowTable(b))return}const i=r.closest("a");if(i instanceof HTMLAnchorElement){const b=i.getAttribute("href")||i.href||"";if(Lt(b)){const h=b.slice(1),y=document.querySelector(`a[name="${h}"]`);y&&(t.preventDefault(),y.scrollIntoView({behavior:"smooth",block:"start"}))}else i.href&&document.referrer.includes("raw")&&window.open(i.href);t.stopPropagation(),t.preventDefault()}if(r.tagName==="HTML"||r.classList.contains(a.ICON_ROLE.drag)||r.classList.contains("em-element-editor"))return;const l=document.body,s=l?.classList.contains("mceNonEditable"),c=l?.classList.contains("em-sandbox-discuss"),d=document.referrer.includes("raw"),u=r.tagName==="A"||r.closest("a")||r.tagName==="IMG";if(s&&!c&&(!d||!u)){e.setCursorPosition(r);return}if(e.isDiscussViewMode()){e.handleDiscussViewClick(r);return}if(e.isDiscussSetTargetMode()){r=e.handleDiscussSetTargetClick(r).newClickedElement;return}r instanceof Element&&r.tagName==="EDITOR"&&(r=r.parentElement);const g=r.closest('[em="atom"]');if(g&&r.closest(".em-element-editor-widget-remove")){e.handleRemoveAtom(g);return}if(g&&r.closest(".em-element-editor-widget-edit")){e.applicationElementSettingsSet({elem:g}),e.setCursorPosition(g);return}if(g&&r.closest(".em-element-editor-widget-clone")){e.handleCloneAtom(g);return}const m=r.closest('[em="block"]');if(m&&r.classList.contains(a.ICON_ROLE.moveUp)){e.handleMoveBlockUp(m);return}if(m&&r.classList.contains(a.ICON_ROLE.moveDown)){e.handleMoveBlockDown(m);return}if(m&&r.closest(".em-element-editor-widget-edit")){const b=m.querySelector("td");b&&e.applicationElementSettingsSet({elem:b}),e.setCursorPosition(m);return}if(m&&r.closest(".em-element-editor-widget-remove")){e.handleRemoveBlock(m);return}if(m&&r.closest(".em-element-editor-widget-add-block")){e.addBlockToProject(r);return}if(m&&r.closest(".em-element-editor-widget-clone")){e.handleCloneBlock(m);return}if(m&&e.isAddBlockMenuClick(r)){e.handleAddBlockMenu(m,r);return}if(m&&r.closest(".em-element-editor-widget-copy")){e.handleCopyBlock(m,r);return}if(m&&r.closest(".em-element-editor-widget-paste")){e.handlePasteBlock(m,r);return}if(m&&r.classList.contains(a.ICON_ROLE.merge)){e.handleMergeBlocks(m);return}if(m&&r.classList.contains(a.ICON_ROLE.unmerge)){e.handleUnmergeBlocks(m);return}const f=r.closest('[em="group"]');if(f&&r.classList.contains(a.ICON_ROLE.moveUp)){e.handleMoveGroupUp(f);return}if(f&&r.classList.contains(a.ICON_ROLE.moveDown)){e.handleMoveGroupDown(f);return}if(f&&r.classList.contains(a.ICON_ROLE.add)){e.handleAddGroup(f);return}if(f&&r.closest(".em-element-editor-widget-edit")){e.setCursorPosition(f);const b=f.tagName!=="TR"?f:f.querySelector("td");b&&e.applicationElementSettingsSet({elem:b});return}if(f&&r.closest(".em-element-editor-widget-clone")){e.handleCloneGroup(f);return}if(f&&r.closest(".em-element-editor-widget-remove")&&r.closest(".of-group")){e.handleRemoveGroup(f);return}if(!r.closest(".em-editor-wrapper")&&!r.closest(".em-element-path")&&!r.closest(".em-element-vindent-remove")){const b=window.getSelection();if(b?.isCollapsed)e.setCursorPosition(r);else if(b&&b.rangeCount>0){const y=b.getRangeAt(0).commonAncestorContainer,E=e.findOutermostParentWithText(y);E&&e.setCursorPosition(E);const S=e.getParentElementOfSelection();S&&(r=S)}e.applicationElementSettingsSet({elem:r});const h=document.querySelector(".em-editor-wrapper");h&&(h.style.display="none"),e.setBlockGroupControlsPosition()}r.closest("em-replace")&&e.handleEmReplaceClick(r,t);const p=r?.tagName==="TD"?r?.querySelector("div"):r?.closest("div")||r;r.closest(".em-element-custom-table")&&p?.tagName==="DIV"&&e.handleCustomTableClick(r,t)}}var Si=`<style em="styles">
281
281
  @media only screen and (max-device-width:660px),only screen and (max-width:660px) {
282
282
  .em-mob-width-100perc {
283
283
  width: 100%!important;
@@ -287,7 +287,7 @@ __useblocks__.define("js/iframe.js",["require","exports","module","js/rolldown-r
287
287
  </style>
288
288
  <table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td style="padding-bottom: 10px;">
289
289
  <div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</div>
290
- </td></tr></table>`,wp=`<style>
290
+ </td></tr></table>`,Np=`<style>
291
291
  @media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
292
292
  .em-mob-wrap {
293
293
  display: block!important;
@@ -314,6 +314,6 @@ __useblocks__.define("js/iframe.js",["require","exports","module","js/rolldown-r
314
314
  </tr>
315
315
  </table>
316
316
  </td>
317
- </tr>`;function kp(e,o){if(!e||e.innerHTML.trim()||o.getLockEditor())return!1;const t=Si.match(/<style((.|\n|\r)*?)<\/style>/g);o.applyStylesToDocument(t||[]);let n=Si.replaceAll(/<style((.|\n|\r)*?)<\/style>/gi,"").trim();n=o.commonStylesApply({html:n});let r=wp.replace("{{ATOM_HTML}}",n);const i=r.match(/<style((.|\n|\r)*?)<\/style>/g);o.applyStylesToDocument(i||[]),r=o.commonStylesApplyToBlock({html:r}),(r.indexOf("empty-structure")>-1||r.indexOf("em-structure")>-1)&&(r=o.setFloatBlocksWidth({blockHTML:r,targetBlock:e,project:o.appName})),e.insertAdjacentHTML("beforeend",`
317
+ </tr>`;function Bp(e,o){if(!e||e.innerHTML.trim()||o.getLockEditor())return!1;const t=Si.match(/<style((.|\n|\r)*?)<\/style>/g);o.applyStylesToDocument(t||[]);let n=Si.replaceAll(/<style((.|\n|\r)*?)<\/style>/gi,"").trim();n=o.commonStylesApply({html:n});let r=Np.replace("{{ATOM_HTML}}",n);const i=r.match(/<style((.|\n|\r)*?)<\/style>/g);o.applyStylesToDocument(i||[]),r=o.commonStylesApplyToBlock({html:r}),(r.indexOf("empty-structure")>-1||r.indexOf("em-structure")>-1)&&(r=o.setFloatBlocksWidth({blockHTML:r,targetBlock:e,project:o.appName})),e.insertAdjacentHTML("beforeend",`
318
318
  `+r+`
319
- `);const l=e.querySelector('[em="block"]:last-child [em="atom"]');if(l){const s=l.querySelector("div");let c=null;s&&(s.innerHTML="",s.appendChild(document.createTextNode("​")),o.wrapEditor(s,!0),s.classList.add("em-just-inserted"),setTimeout(()=>{const d=s.closest("editor")||s,u=d?.querySelector("div")||s,g=u||d||s,m=g.getBoundingClientRect();["mouseover","mousedown","mouseup","click"].forEach(b=>{g.dispatchEvent(new MouseEvent(b,{bubbles:!0,cancelable:!0,view:window,clientX:m.left+Math.min(1,Math.max(0,m.width/2)),clientY:m.top+Math.min(1,Math.max(0,m.height/2)),button:0}))});let f=u.firstChild;f||(f=document.createTextNode("​"),u.appendChild(f)),d?.focus?.();const p=window.getSelection();if(p&&f){const b=document.createRange();b.setStart(f,0),b.collapse(!0),p.removeAllRanges(),p.addRange(b)}o.setCursorPosition(d||s)},0),c=s.closest("editor")||s),s&&o.setCursorPosition(c||s)}return o.messageService.send("application_atom_inserted","text"),o.commit(),!0}function _p(e){return function(t){let n=t.target;try{n=e.getVisibleNode(n);const r=e.isInExternal(n);e.incrementActiveElementLocked();const i=document.body;if(i?.classList.contains("mceNonEditable")&&!i.classList.contains("em-sandbox-discuss")||i?.classList.contains("em-sandbox-discuss")&&!i.classList.contains("em-sandbox-discuss_set-target"))return;if(i?.classList.contains("em-sandbox-discuss_set-target")){document.querySelectorAll('[em-hover="true"]').forEach(u=>{u.removeAttribute("em-hover"),u.removeAttribute("contenteditable")}),n.closest(".em-element-vindent")||(n.setAttribute("em-hover","true"),n.setAttribute("contenteditable","true"));return}if(n.tagName!=="BODY"){const u=n.parentElement;a.unwrapForeignEditors(n)&&!n.isConnected&&u&&(n=u)}if(n&&(n?.closest('[em="atom"]')||!r)&&n.getAttribute("contenteditable")!=="false"&&n.parentElement?.getAttribute("contenteditable")!=="false"&&n.tagName!=="BODY"&&n.parentElement?.tagName!=="SECTION"){const u=!n.closest("editor"),g=!e.getLockEditorInit(),m=n.tagName!=="IMG",f=!(n.childElementCount===1&&n.firstElementChild?.tagName==="IMG"&&(n.textContent?.trim()??"")==="");if(u&&g&&m&&f){let p=n;do if(p=p.closest("div, p, h1, h2, h3, h4, h5")||p.closest("span, b, strong, i, em, s, a, sup, sub"),p)if(!e.isVisible(p))p=p.parentElement;else break;while(p);if(n.tagName==="LI"&&n.style.fontFamily&&n.style.fontSize){const b=n.closest("ul, ol");b&&e.wrapEditor(b,!0)}else if(n.tagName==="TD"&&n.style.fontFamily&&n.style.fontSize&&!n.querySelector("editor"))e.wrapEditor(n);else if(p&&p.style.fontFamily&&p.style.fontSize&&(n.tagName==="LI"||!n.querySelector("img")))if(n.tagName==="LI"){const b=n.closest("ul, ol");b&&e.wrapEditor(b,!0)}else n.querySelector("img")||e.wrapEditor(n,!0);else if(p&&p.closest('[style*="font-family"][style*="font-size"]')){const b=p.closest('[style*="font-family"][style*="font-size"]');b&&b.tagName!=="BODY"&&b.tagName!=="TD"&&b.tagName!=="TABLE"?e.wrapEditor(b,!1):b?.tagName==="TD"&&!b.querySelector("editor")&&!b.closest(".em-element-custom-table")&&e.wrapEditor(b)}else if(p&&p?.tagName==="DIV"&&!p.querySelector("table")){const b=!!p.style.height?.length,h=p.className.includes("em-element-img-change-group"),y=p.querySelector("img")?.parentNode,E=!!p.querySelector("img")&&y&&!e.hasTextNodeInElement(y);!b&&!h&&!E&&e.wrapEditor(p,!0)}else for(let b=0;b<n.childNodes.length;b++){const h=n.childNodes[b];if(h.nodeName==="#text"&&(h.textContent?.trim().length??0)>0&&!n.querySelector("table")){const y=n.tagName==="P"?n.parentElement:n;y&&e.wrapEditor(y);break}}}}(n?.closest('[em="atom"]')||!r)&&!e.getIsLeftButtonDown()&&e.implementElementsEditors(n),n?.classList.contains("em-element-vindent-bg")&&(n=n.closest(".em-vindent")),n?.closest(".em-gap")?n.closest("tr")?.querySelectorAll(".em-mob-wrap:nth-child(even) .em-gap").forEach(u=>u.classList.add("em-hover")):e.getIsLeftButtonDown()||document.querySelectorAll(".em-gap").forEach(u=>u.classList.remove("em-hover"));const l=e.getLoadStylesTimer(),s=!!n.style.padding||!!n.style.paddingTop||!!n.style.paddingBottom||!!n.style.paddingLeft||!!n.style.paddingRight,c=n.closest('[em="block"]'),d=!!c?.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")&&(c?.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").length??0)>2;l&&(n.tagName==="TD"&&(n.innerHTML===""||n.querySelector(".em-element-vindent"))&&n.getAttribute("height")||n.tagName==="DIV"&&n.style.height&&n.style.fontSize||n.tagName==="IMG"||s||d)&&e.implementResizableElems(n)}catch{}finally{Promise.resolve().then(()=>e.decrementActiveElementLocked())}}}function Np(e){return function(t){const n=window.getSelection(),r=(n?.rangeCount?n.getRangeAt(0):null)?.commonAncestorContainer,i=r?.nodeType===1?r:r?.parentElement,l=i?.closest("editor"),s=window.navigator.platform.match("Mac"),c=l?e.getCursorPositionType(l):null,d=l?.closest("tr")?.querySelector("tr td:nth-of-type(2) div"),u=t.target,g=e.getListContext(u),{isList:m}=g,f=d?.textContent===l?.textContent,p=l?e.LIST_REGEX.EMPTY_TEXT.test(l.textContent||""):!1,b=s?t.metaKey:t.ctrlKey;if(b&&t.keyCode===83){t.preventDefault(),e.messageService.send({operation:"application_action",action:"save_email"});return}if(b&&t.keyCode===90){t.preventDefault(),e.messageService.send({operation:"application_action",action:t.shiftKey?"redo":"undo"});return}if(t.altKey&&t.keyCode===88){t.preventDefault(),e.messageService.send({operation:"application_action",action:"toggle_editor"});return}const h={getElementParent:e.getElementParent,setCursorPosition:e.setCursorPosition,removeElementEditors:e.removeElementEditors,getVariableByIcon:e.getVariableByIcon,removeEmptyParents:e.removeEmptyParents,getAllComments:e.getAllComments,isVariableComment:e.isVariableComment,getVariableIcon:e.getVariableIcon,commit:e.commit,messageService:e.messageService};if(e.handleDeleteKey(t,m,c,h))return;if(t.keyCode===27){const C=document.querySelector(".em-editor-wrapper");C?.style&&(C.style.display="none"),e.removeAllAttributes("em-edit"),document.querySelectorAll("editor").forEach(L=>L.blur()),n?.removeAllRanges(),e.applicationElementSettingsSet({elem:null}),e.messageService.send({operation:"application_close-image-edit-popup"});return}b&&t.keyCode===66&&(t.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_strong"}));const y=s?t.keyCode===88:t.keyCode===53;if((s?t.metaKey:t.altKey)&&t.shiftKey&&y&&(t.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_strikethrough"})),b&&t.shiftKey&&t.keyCode===76&&(t.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"textAlign_left"})),b&&t.shiftKey&&t.keyCode===82&&(t.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"textAlign_right"})),b&&t.shiftKey&&t.keyCode===69&&(t.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"textAlign_center"})),b&&t.keyCode===73&&(t.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_italic"})),b&&t.keyCode===85&&(t.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_underline"})),Ea(t,{commit:e.commit})||e.handleEnterForBr(t,l,m,f,{commit:e.commit}))return;if(b&&t.keyCode===86){e.setIsPasteFromContextMenu(!1);const C=L=>{e.handlePasteTextFragment(L,!1,e.getCommonStyles(),e.changeMsoValue,e.commit),document.removeEventListener("paste",C)};document.addEventListener("paste",C)}else e.changeMsoValue(t);const E={activeElem:l,listContext:g,cursorPositionType:c,isTargetCell:f,isEmptyText:p,commit:e.commit,wrapEditor:e.wrapEditor,removeTemporaryListClasses:e.removeTemporaryListClasses};if(e.handleEnterInList(t,E)||(e.handleArrowRightInList(t,c,p),e.handleArrowUpDownInList(t,E)))return;const S={...E,parentElement:i,findNodeAtPosition:e.findNodeAtPosition,setCursorSafely:e.setCursorSafely};if(e.handleDeleteInList(t,S)||e.handlePreventBulletCellEdit(t,m,f))return;const v={isCaretAtEndOfEmReplace:e.isCaretAtEndOfEmReplace,getOrCreateAfterSpan:e.getOrCreateAfterSpan,setCursorInsideSpan:e.setCursorInsideSpan,isCaretAtEndOfStandardElement:e.isCaretAtEndOfStandardElement,setCursorPositionSimple:e.setCursorPositionSimple,wrapEditor:e.wrapEditor,commit:e.commit};e.handleArrowRight(t,v)&&e.commit()}}var ne=e=>a.normalizeSpaces(e?.innerText);function Bp(e,o){return e.hasOwnProperty("textStrong")?{name:"textStrong",tags:["b","strong","a","[style*=font-weight]"],value:e.textStrong,command:"bold"}:e.hasOwnProperty("textItalic")?{name:"textItalic",tags:["em","i","[style*=font-style]","a"],value:e.textItalic,command:"italic"}:e.hasOwnProperty("textStrikethrough")?{name:"textStrikethrough",tags:["s","strike","u","[style*=text-decoration]","a"],value:e.textStrikethrough,command:"strikethrough"}:e.hasOwnProperty("textUnderline")?{name:"textUnderline",tags:["u","strike","[style*=text-decoration]","span","a"],value:e.textUnderline,command:"underline"}:e.hasOwnProperty("textColor")?{name:"textColor",tags:["a","[style*='color']","span"],value:o(e.textColor)||"",command:"foreColor"}:e.hasOwnProperty("textBackgroundColor")?{name:"textBackgroundColor",tags:["a","[style*='background-color']","[style*='color']","span"],value:o(e.textBackgroundColor)||"",command:"hilitecolor"}:e.hasOwnProperty("fontFamily")?{name:"fontFamily",tags:["[style*='font-family']","span","a"],value:e.fontFamily?.[e.fontFamily.length-1],command:"fontName"}:e.hasOwnProperty("textLink")?{name:"textLink",tags:["a","[href]","div","p","td"],value:e.textLink||"",command:"createLink"}:e.hasOwnProperty("fontSize")?{name:"fontSize",tags:["a","[style*='font-size']","span","div"],value:parseFloat(e.fontSize),command:"fontSize"}:e.hasOwnProperty("lineHeight")?{name:"lineHeight",tags:["div","[style*='line-height']","p","td"],value:parseFloat(e.lineHeight),command:null}:{}}var Mp=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,Rp=/^rgba?\s*\(\s*(?<r>\d+)\s*,\s*(?<g>\d+)\s*,\s*(?<b>\d+)\s*(?:,\s*(?<a>(?:0?\.)?\d+)\s*)?\)$/i,dn=e=>e.toString(16).padStart(2,"0");function Pp(e){const o=Rp.exec(e)?.groups;if(!o)return;const t=Number.parseInt(o.r,10),n=Number.parseInt(o.g,10),r=Number.parseInt(o.b,10);if(![t,n,r].some(i=>!Number.isFinite(i)||i<0||i>255))return`#${dn(t)}${dn(n)}${dn(r)}`}function Ci(e){return e.split("").map(o=>`${o}${o}`).join("")}function We(e,o){if(!e)return;const t=e.trim();if(!t)return;if(Mp.test(t)){const r=t.slice(1);return r.length===3?`#${Ci(r).toLowerCase()}`:r.length===4?`#${Ci(r.slice(0,3)).toLowerCase()}`:r.length===8?`#${r.slice(0,6).toLowerCase()}`:`#${r.toLowerCase()}`}const n=Pp(t);if(n)return n;if(o){const r=o(t);if(r&&r!==t)return We(r)}}function Hp(e){const o=e.parentNode;if(o){for(;e.firstChild;)o.insertBefore(e.firstChild,e);o.removeChild(e)}}function mn(e,o,t){const n=o.parentElement;let r=e.parentElement;for(;r&&r!==n;){const i=We(r.style.color,t);if(i)return i;r=r.parentElement}}function Ip(e,o){Array.from(e.querySelectorAll("span")).reverse().forEach(t=>{if(!t.style.color)return;const n=We(t.style.color,o);if(!n)return;const r=mn(t,e,o);!r||r!==n||(t.style.removeProperty("color"),t.getAttribute("style")||t.removeAttribute("style"),t.attributes.length===0&&Hp(t))})}function Op(e){const o=e.commonAncestorContainer.nodeType===Node.ELEMENT_NODE?e.commonAncestorContainer:e.commonAncestorContainer.parentElement;if(!o)return[];if(e.commonAncestorContainer.nodeType===Node.TEXT_NODE){const r=e.commonAncestorContainer;return r.data.trim()?[r]:[]}const t=document.createTreeWalker(o,NodeFilter.SHOW_TEXT,null),n=[];for(;t.nextNode();){const r=t.currentNode;!r.data.trim()||!e.intersectsNode(r)||n.push(r)}return n}function xp(e,o,t){const n=We(o,t);if(!n)return!1;const r=window.getSelection();if(!r||r.rangeCount===0)return!1;const i=r.getRangeAt(0);if(i.collapsed||!i.toString().trim())return!1;const l=Op(i);if(!l.length||l.every(d=>{const u=d.parentElement;return u?We(u.style.color,t)===n?!0:mn(u,e,t)===n:!1}))return!1;const s=document.createElement("span");s.style.color=o;try{i.surroundContents(s)}catch{s.appendChild(i.extractContents()),i.insertNode(s)}const c=document.createRange();return c.selectNodeContents(s),r.removeAllRanges(),r.addRange(c),!0}function Dp(e,o,t){const n=Array.from(e.querySelectorAll('a[style*="color"]'));e.tagName==="A"&&e.style.color&&n.unshift(e),n.forEach(r=>{const i=We(r.style.color,o);if(!i)return;const l=mn(r,e,o)||(t?We(t,o):void 0);l&&Array.from(r.querySelectorAll("span")).forEach(s=>{if(!s.style.color)return;const c=We(s.style.color,o);c&&c!==i&&c===l&&(s.style.color=r.style.color)})})}function Fp(e){if(e.currentSettings.name!=="lineHeight")return!1;const o=e.parentElement.closest('[style*="line-height"]')||e.parentElement.closest("div, p, td");if(e.parentElement?.querySelector('[em-edit="active"]')){const t=[];e.checkForTextNodes(e.parentNode,t),t.forEach(n=>{const r=n.closest('[style*="line-height"]')||n.closest("div, p, td");r&&(r.style.lineHeight=e.currentSettings.value+"px")})}else if(e.isElementList){const t=!!e.parentElement.querySelector("div"),n=t?e.parentElement.closest("tr")?.querySelector(`.${e.classNameBullet}`):null;if(n&&(n.style.lineHeight=e.currentSettings.value+"px"),t){const r=e.parentElement.querySelector("div");r&&(r.style.lineHeight=e.currentSettings.value+"px")}else e.parentElement.style.lineHeight=e.currentSettings.value+"px"}else o&&(o.style.lineHeight=e.currentSettings.value+"px");return e.commit(),!0}function qp(e){if(e.currentSettings.name!=="fontFamily")return!1;let o=(e.findElementWithSelectedText(e.selectedText)||e.getParentElementOfSelection())?.closest('[style*="font-family"]')||e.parentWrapper;const t=!!e.parentElement?.querySelector('[em-edit="active"]');if(!t&&(!e.range?.collapsed||e.getSelectedText()))if(e.getInnerText(e.parentWrapper)===e.selectedText)o=e.parentWrapper;else if(e.getInnerText(e.parentElement)===e.selectedText)o=e.parentElement;else{const r=document.createElement("span");e.range.commonAncestorContainer.nodeType===3?e.range.surroundContents(r):(r.appendChild(e.range.extractContents()),e.range.insertNode(r)),o=r,e.range.deleteContents(),e.range.insertNode(o),e.range.selectNode(o),e.addNewRange(e.range)}e.fontFamilyArray?e.fontFamilyArray[0]==="Safe Fonts"?(o.style.fontFamily=e.fontFamilyArray[1],e.removeClassesByPrefix(o,"em-font"),e.clearLinkTags({elem:document.head})):e.fontFamilyArray[0]==="Google Fonts"&&(e.fontFamilyArray[1]==="Sans Serif"?o.style.fontFamily="Helvetica, Arial, sans-serif":e.fontFamilyArray[1]==="Serif"?o.style.fontFamily='"Times New Roman", Times, serif':e.fontFamilyArray[1]==="Project Fonts"&&a.applyProjectFontInlineFallback(o,e.fontFamilyArray[2]),e.removeClassesByPrefix(o,"em-font"),o.classList.add(e.createFontClassName(e.fontFamilyArray)),a.markProjectFontClass(o,e.fontFamilyArray),e.addFontFamilyClass({fontFamilyArray:e.fontFamilyArray})):o.style.removeProperty("font-family");let n;return t?(n=e.parentElement.querySelectorAll('[style*="font-family"]'),n.forEach(r=>r.style.fontFamily=o.style.fontFamily)):(n=o.querySelectorAll('[style*="font-family"]'),n.forEach(r=>r.style.fontFamily="")),e.cleanEmptySpans(e.selectedText),e.refreshElementSettings(o,e.selectedText),e.range.selectNode(o),e.addNewRange(e.range),e.commit(),!0}function Wp(e){if(e.currentSettings.command==="bold"){if(e.hasItalicClass&&e.tempStyleClass&&e.parentWrapper&&e.parentWrapper.classList.add(e.tempStyleClass),!e.isEditorTagOutside){const o=[];e.checkForTextNodes(e.parentNode,o),o.filter(t=>e.checkForWorkClass(t)).forEach(t=>{t.innerHTML=e.removeFormattingTags(t.innerHTML,"bold"),t.tagName!=="STRONG"?e.currentSettings.value&&(t.innerHTML="<strong>"+t.innerHTML+"</strong>"):e.currentSettings.value||(t.outerHTML=t.innerHTML)})}if(e.currentSettings.value===!0)Array.from(e.parentNode?.getElementsByTagName("b")||[]).reverse().forEach(o=>{const t=document.createElement("strong");if(t.innerHTML=o.innerHTML,o.parentNode?.replaceChild(t,o),e.getInnerText(t)===e.selectedText){const n=t.closest("span");n?.textContent===t.innerText&&!n.getAttribute("style")&&n.childNodes[0]?.nodeType===3&&n.parentNode?.replaceChild(t,n),e.refreshElementSettings(t,e.selectedText),e.range.selectNode(t),e.addNewRange(e.range)}});else if(Array.from(e.parentWrapper?.getElementsByTagName("b")||[]).reverse().forEach(o=>{const t=document.createElement("strong");t.innerHTML=o.innerHTML,o.parentNode?.replaceChild(t,o)}),e.getInnerText(e.parentWrapper)===e.selectedText){const o=e.parentWrapper||e.findElementWithSelectedText(e.selectedText,e.activeElement);o&&(e.range.selectNode(o),e.addNewRange(e.range))}e.cleanEmptySpans(e.selectedText)}}function $p(e){if(e.currentSettings.command==="italic"){if(e.hasItalicClass&&e.tempStyleClass&&e.parentWrapper&&e.parentWrapper.classList.add(e.tempStyleClass),!e.isEditorTagOutside){const o=[];e.checkForTextNodes(e.parentNode,o),o.filter(t=>e.checkForWorkClass(t)).forEach(t=>{t.innerHTML=e.removeFormattingTags(t.innerHTML,"italic"),t.tagName!=="EM"?e.currentSettings.value&&(t.innerHTML="<em>"+t.innerHTML+"</em>"):e.currentSettings.value||(t.outerHTML=t.innerHTML)})}if(e.currentSettings.value)Array.from(e.parentNode?.getElementsByTagName("i")||[]).reverse().forEach(o=>{const t=document.createElement("em");if(t.innerHTML=o.innerHTML,o.parentNode?.replaceChild(t,o),e.getInnerText(t)===e.selectedText){const n=t.closest("span");n?.textContent===t.innerText&&!n.getAttribute("style")&&n.childNodes[0]?.nodeType===3&&n.parentNode?.replaceChild(t,n),e.refreshElementSettings(t,e.selectedText),e.range.selectNode(t),e.addNewRange(e.range)}});else if(Array.from(e.parentElement?.getElementsByTagName("i")||[]).reverse().forEach(o=>{const t=document.createElement("em");t.innerHTML=o.innerHTML,o.parentNode?.replaceChild(t,o)}),e.getInnerText(e.parentWrapper)===e.selectedText){const o=e.parentWrapper||e.findElementWithSelectedText(e.selectedText,e.activeElement);o&&(e.range.selectNode(o),e.addNewRange(e.range))}e.cleanEmptySpans(e.selectedText)}}function zp(e){if(e.currentSettings.name!=="fontSize")return;const{mutableState:o}=e;if(e.getInnerText(o.parentWrapper)!==e.selectedText){let i=!1;const l=e.findParentWithFontSizeAndTag(e.activeElement||o.parentNode)||o.parentWrapper;l&&l.style.fontSize.length&&(i=l.style.fontSize,l.style.fontSize=""),document.execCommand("fontSize",!1,"1"),i&&l&&(l.style.fontSize=i);const s=window.getSelection()?.getRangeAt(0).commonAncestorContainer;o.parentElement=o.parentNode.querySelector('[size="1"]')||(s?.nodeType===1?s:s?.parentElement),o.parentElement&&(o.parentElement.style.fontSize=e.currentSettings.value+"px")}let t=null;if(o.parentElement?.tagName==="FONT"){const i=document.createElement("span");i.innerHTML=o.parentElement.innerHTML,o.parentElement.getAttribute("size")?(i.style.fontSize=e.currentSettings.value+"px",i.removeAttribute("size")):Array.from(o.parentElement.attributes).forEach(l=>i.setAttribute(l.name,l.value)),o.parentElement.parentNode?.replaceChild(i,o.parentElement),e.refreshElementSettings(i,e.selectedText),o.range.selectNode(i),e.addNewRange(o.range)}if((e.activeElement.tagName==="A"||e.activeElement.closest("a"))&&(o.parentWrapper=e.activeElement.closest("a")),e.getInnerText(o.parentWrapper)===e.selectedText){if(Array.from(o.parentWrapper?.getElementsByTagName("span")||[]).forEach(l=>l.style.fontSize=""),!o.parentWrapper?.hasAttribute("em-edit")&&e.isElementList&&o.parentWrapper&&e.isProgrammaticSelection){const l=o.parentWrapper.closest("tr")?.querySelector(`.${e.classNameBullet}`);l&&(l.style.fontSize=e.currentSettings.value+"px")}o.parentWrapper&&(o.parentWrapper.style.fontSize=e.currentSettings.value+"px");const i=o.parentWrapper?.firstChild;i?.nodeType===1&&i.tagName==="SPAN"&&i.innerText===e.selectedText&&(i.style.fontSize="")}else o.parentWrapper?.style.hasOwnProperty("font-size")&&(t=o.parentWrapper.style.fontSize,t&&o.parentWrapper.style.removeProperty("font-size"));t&&o.parentWrapper&&(o.parentWrapper.style.fontSize=t);const n=Array.from(o.parentNode?.querySelectorAll("font")||[]).reverse(),r=[];e.isEditorTagOutside?e.currentSettings.value||(o.selection=window.getSelection(),o.range=o.selection.getRangeAt(0),o.parentNode=o.selection.anchorNode?.nodeType===1?o.selection.anchorNode:o.selection.anchorNode?.parentElement,o.parentNode&&o.parentNode.style.removeProperty(e.currentStyle),e.cleanEmptySpans(e.selectedText)):(e.checkForTextNodes(o.parentNode,r),r.filter(i=>e.checkForWorkClass(i)).forEach(i=>{i.style.fontSize=e.currentSettings.value+"px",i.querySelectorAll('[style*="font-size"]').forEach(l=>{l.tagName!=="A"?l.style.removeProperty("font-size"):l.style.fontSize=e.currentSettings.value+"px"})})),e.isEditorTagOutside&&n.forEach(i=>{const l=document.createElement("span");l.innerHTML=i.innerHTML;const s=e.currentSettings.value+"px",c=i.children?.length===1&&i.firstChild?.nodeType===1?i.firstChild:null,d=[];if(e.checkForTextNodes(i,d),d.forEach(u=>{if(u.tagName==="FONT"){const g=document.createElement("span");g.innerHTML=u.innerHTML,u.getAttribute("size")?g.style.fontSize=e.getInnerText(u)===e.selectedText?s:"":Array.from(u.attributes).forEach(m=>g.setAttribute(m.name,m.value)),u.parentNode?.replaceChild(g,u)}}),c)i.parentNode?.replaceChild(c,i);else if(i.getAttribute("size")&&i.parentNode){const u=document.createElement("span");u.innerHTML=i.innerHTML,u.style.fontSize=s,i.parentNode.replaceChild(u,i)}if(!d.length&&i.tagName==="FONT"){const u=document.createElement("span");u.innerHTML=i.innerHTML,i.parentNode?.replaceChild(u,i)}}),Array.from(document.getElementsByTagName("span")).reverse().forEach(i=>{e.getInnerText(i)===e.selectedText&&i.closest('[em-edit="active"]')&&(e.refreshElementSettings(i,e.selectedText),o.range.selectNode(i),e.addNewRange(o.range))}),e.cleanEmptySpans(e.selectedText)}function Vp(e){if(e.currentSettings.command!=="strikethrough")return;const{mutableState:o}=e;let t=e.getSelectedText(),n=null;if(!e.isEditorTagOutside){const r=[];e.checkForTextNodes(e.parentNode,r),r.filter(i=>e.checkForWorkClass(i)).forEach(i=>{i.innerHTML=e.removeFormattingTags(i.innerHTML,"strike"),i.tagName!=="STRIKE"?e.currentSettings.value&&(i.innerHTML="<strike>"+i.innerHTML+"</strike>"):e.currentSettings.value||(i.outerHTML=i.innerHTML)})}if(e.currentSettings.value===!0){let r=t;Array.from(document?.getElementsByTagName("strike")||[]).reverse().forEach(i=>{if(e.getInnerText(i)===r&&(e.getInnerText(i.parentNode)===r&&i.parentNode.tagName==="U"&&(i.parentNode.outerHTML=i.parentNode.innerHTML),n=e.findElementWithSelectedText(r),n)){const l=e.findOutermostParentWithText(n,"A");l&&(l.style.textDecoration="none"),e.refreshElementSettings(n,r),o.range.selectNode(n),e.addNewRange(o.range)}})}else{let r=t;if(e.cleanEmptySpans(r),e.getInnerText(o.parentWrapper)===r){const i=window.getSelection();if(n=e.findElementWithSelectedText(r,e.activeElement),n&&(o.range.selectNode(n),e.addNewRange(o.range),o.range.cloneContents())){const l=o.range.firstElementChild?o.range.firstElementChild:o.range.parentElement||o.range.commonAncestorContainer;l&&e.refreshElementSettings(l,r)}if(i&&i.rangeCount>0&&e.isElementList&&!n){const l=i.getRangeAt(0);let s=l.commonAncestorContainer;s.nodeType!==Node.ELEMENT_NODE&&(s=s.parentNode),s.querySelectorAll("strike").forEach(c=>{c.outerHTML=c.innerHTML}),s.style.textDecoration="none",s.querySelectorAll('span[style*="text-decoration"]').forEach(c=>{c.style.textDecoration=""}),e.refreshElementSettings(s,r),l.selectNodeContents(s),i.removeAllRanges(),i.addRange(l),e.addNewRange(l)}}}if(e.request.type==="button"||e.activeElement.tagName==="A"){e.request.type!=="button"&&e.activeElement.tagName==="A"&&(o.parentWrapper=e.activeElement);let r=t;if(e.getInnerText(o.parentWrapper)===r&&o.parentWrapper)o.parentWrapper.style.textDecoration=e.currentSettings.value?"line-through":"none",Array.from(o.parentWrapper.querySelectorAll('span[style*="text-decoration"]')).forEach(i=>i.style.textDecoration=""),o.parentWrapper.innerHTML=e.removeFormattingTags(o.parentWrapper.innerHTML,"strikeUnderline"),e.refreshElementSettings(o.parentWrapper,r),o.range.selectNode(o.parentWrapper),e.addNewRange(o.range);else{const i=o.selection.getRangeAt(0),l=document.createElement("span");l.style.textDecoration=e.currentSettings.value?"line-through":"none",e.activeElement.nodeType===1&&e.activeElement.tagName==="SPAN"?(e.activeElement.style.textDecoration=e.activeElement.style.textDecoration==="line-through"?"none":"line-through",Array.from(e.activeElement.querySelectorAll('span[style*="text-decoration"]')).forEach(s=>s.style.textDecoration=""),e.refreshElementSettings(e.activeElement,r)):(l.appendChild(i.extractContents()),Array.from(l.querySelectorAll('span[style*="text-decoration"]')).forEach(s=>s.style.textDecoration=""),i.insertNode(l),n=l,e.refreshElementSettings(l,r),e.addNewRange(i))}}if(o.range.cloneContents()){if(o.range=o.selection.getRangeAt(0),n&&e.getInnerText(n)===t)o.range.selectNode(n),e.addNewRange(o.range);else{const r=o.range.commonAncestorContainer,i=r.nodeType===1?r:r.parentElement,l=o.range.firstElementChild?o.range.firstElementChild:o.range.parentElement||i;l&&e.getInnerText(l)===t&&(o.range.selectNode(l),e.addNewRange(o.range))}n&&e.refreshElementSettings(n,t)}}function Up(e){if(e.currentSettings.command!=="underline")return;const{mutableState:o}=e,t=r=>{const i=r.parentNode;if(i){for(;r.firstChild;)i.insertBefore(r.firstChild,r);i.removeChild(r)}},n=r=>{r.querySelectorAll("u").forEach(i=>{t(i)}),r.querySelectorAll('span[style*="text-decoration"], span[style*="text-decoration-line"]').forEach(i=>{i.style.removeProperty("text-decoration"),i.style.removeProperty("text-decoration-line"),i.getAttribute("style")||i.removeAttribute("style"),i.attributes.length===0&&t(i)})};if(!e.isEditorTagOutside){const r=[];e.checkForTextNodes(e.parentNode,r),r.filter(i=>e.checkForWorkClass(i)).forEach(i=>{i.innerHTML=e.removeFormattingTags(i.innerHTML,"underline"),i.tagName!=="U"?e.currentSettings.value&&(i.innerHTML="<u>"+i.innerHTML+"</u>"):e.currentSettings.value||(i.outerHTML=i.innerHTML)})}if(e.currentSettings.value){const r=Array.from(e.findOutermostParentWithText(e.parentElement)?.getElementsByTagName("u")||[]).reverse();r.push(...Array.from(e.findOutermostParentWithText(e.parentElement)?.querySelectorAll("a,span[style*=text-decoration]")||[]).reverse()),r.filter(i=>e.getInnerText(i)===e.selectedText).forEach(i=>{if(e.selectedText&&e.getInnerText(i)===e.selectedText){i.style.textDecoration="underline";const l=i.firstChild;l?.tagName==="STRIKE"&&e.getInnerText(l)===e.selectedText&&[...l.attributes].forEach(s=>{i.setAttribute(s.name,s.value),l.removeAttribute(s.name)}),e.cleanStrikesInElement(i,e.getParentElementOfSelection())}}),e.cleanEmptySpans(e.selectedText),e.getInnerText(e.parentElement)===e.selectedText&&e.cleanStrikesInElement(e.parentElement,e.getParentElementOfSelection())}else{const r=e.findElementWithSelectedText(e.selectedText,e.activeElement);if(!r&&e.isElementList){let i=null;const l=window.getSelection();if(l&&l.rangeCount>0){let c=l.getRangeAt(0).commonAncestorContainer;for(c.nodeType!==Node.ELEMENT_NODE&&(c=c.parentNode);c&&c!==e.activeElement&&!["DIV"].includes(c.tagName);)c=c.parentNode;c&&c.contains(e.activeElement)&&(i=c)}const s=i?e.findOutermostParentWithText(i,"A"):null;s&&(s.style.textDecoration="none"),e.getInnerText(o.parentWrapper)===e.selectedText&&i&&(e.refreshElementSettings(i,e.selectedText),o.range.selectNode(i),e.addNewRange(o.range))}else{const i=e.findOutermostParentWithText(r,"A");i&&(i.style.textDecoration="none"),e.getInnerText(o.parentWrapper)===e.selectedText&&r&&(e.refreshElementSettings(r,e.selectedText),o.range.selectNode(r),e.addNewRange(o.range))}}if(e.request.type==="button"||e.activeElement.tagName==="A")if(e.request.type!=="button"&&e.activeElement.tagName==="A"&&(o.parentWrapper=e.activeElement),e.getInnerText(o.parentWrapper)===e.selectedText&&o.parentWrapper)o.parentWrapper.style.textDecoration=e.currentSettings.value?"underline solid":"none",Array.from(o.parentWrapper.querySelectorAll('span[style*="text-decoration"]')).forEach(r=>r.style.textDecoration=""),e.cleanStrikesInElement(o.parentWrapper,e.getParentElementOfSelection());else{const r=o.selection.getRangeAt(0);if(e.activeElement.nodeType===1&&e.activeElement.tagName==="SPAN")e.currentSettings.value?e.activeElement.style.textDecoration="underline":(e.activeElement.style.removeProperty("text-decoration"),e.activeElement.style.removeProperty("text-decoration-line")),Array.from(e.activeElement.querySelectorAll('span[style*="text-decoration"]')).forEach(i=>i.style.textDecoration=""),e.activeElement.getAttribute("style")||e.activeElement.removeAttribute("style"),e.refreshElementSettings(e.activeElement,e.selectedText);else if(e.activeElement.tagName!=="A")if(e.currentSettings.value){const i=document.createElement("span");i.style.textDecoration="underline",i.appendChild(r.extractContents()),Array.from(i.querySelectorAll('span[style*="text-decoration"]')).forEach(l=>l.style.textDecoration=""),e.refreshElementSettings(i,e.selectedText),r.insertNode(i),e.addNewRange(r)}else{const i=r.extractContents(),l=document.createElement("span");l.appendChild(i),n(l);const s=document.createDocumentFragment();for(;l.firstChild;)s.appendChild(l.firstChild);r.insertNode(s),e.addNewRange(r)}}}function jp(e){if(!e.isColorChange)return;const{mutableState:o}=e;let t=[];if(e.tempColor&&e.isEditorTagOutside&&o.parentWrapper&&(o.parentWrapper.style[e.stylePropretyName]=e.tempColor,!o.parentWrapper?.hasAttribute("em-edit")&&e.isElementList&&o.parentWrapper&&e.isProgrammaticSelection)){const l=o.parentWrapper.closest("tr")?.querySelector(`.${e.classNameBullet}`);l&&(l.style[e.stylePropretyName]=e.tempColor)}if(e.outerContextColor&&e.outerContextElement&&(e.outerContextElement.style.color=e.outerContextColor),e.getInnerText(o.parentWrapper)===e.selectedText&&o.parentWrapper){const l=e.rgbToHex(e.currentSettings.value?.toString())||"";if(e.currentStyle==="color"){const s=(e.parentElement||o.parentNode).closest("a");if(e.request.type==="button"||s)s&&(s.style.color=l,s.querySelectorAll('span[style*="color"]').forEach(c=>c.style.color=""));else{o.parentWrapper.style.color=l,e.canselExecCommand&&(e.setCustomColor(o.parentWrapper,e.stylePropretyName,e.currentSettings.value),o.range.selectNode(o.parentWrapper),e.addNewRange(o.range));const c=o.parentWrapper.firstChild;c?.nodeType===1&&c.tagName==="SPAN"&&e.getInnerText(c)===e.selectedText&&(c.style[e.stylePropretyName]="")}}else if(!e.canselExecCommand){const s=document.createElement("span");s.style[e.stylePropretyName]=l;const c=o.parentWrapper.firstChild;if(c?.nodeType===1&&c.tagName==="SPAN"&&e.getInnerText(c)===e.selectedText)c.style[e.stylePropretyName]=l;else{for(;o.parentWrapper.firstChild;)s.appendChild(o.parentWrapper.firstChild);o.parentWrapper.appendChild(s)}}o.parentWrapper.querySelectorAll(`span[style*="${e.stylePropretyName}"]`).forEach(s=>{s.innerText!==o.parentWrapper.innerText&&s.style.removeProperty(e.stylePropretyName)})}e.isEditorTagOutside?!e.currentSettings.value&&o.selection.isCollapsed&&(o.parentNode=o.selection.anchorNode?.nodeType===1?o.selection.anchorNode:o.selection.anchorNode?.parentElement,o.parentNode&&o.parentNode.style.removeProperty(e.stylePropretyName),e.cleanEmptySpans(e.selectedText)):(e.checkForTextNodes(o.parentNode,t),t.forEach(l=>{l.classList&&l.classList.contains(e.classNameBullet)||e.checkForWorkClass(l)&&(l.style[e.stylePropretyName]=e.currentSettings.value,l.querySelectorAll(`[style*="${e.stylePropretyName}"]`).forEach(s=>{s.tagName!=="A"?s.style.removeProperty(e.currentStyle):s.style[e.stylePropretyName]=e.currentSettings.value}))}));const n=Array.from(o.parentNode?.querySelectorAll("font")||[]).reverse();e.isEditorTagOutside&&n.forEach(l=>{const s=document.createElement("span");s.innerHTML=l.innerHTML;const c=l.getAttribute(e.currentStyle),d=e.rgbToHex(c||"").toString(),u=l.children.length===1&&l.firstChild?.nodeType===1?l.firstChild:null;let g=[];if(e.checkForTextNodes(l,g),g.forEach(m=>{if(m.tagName==="FONT"){const f=document.createElement("span");f.innerHTML=m.innerHTML,f.style[e.stylePropretyName]=d,m.parentNode?.replaceChild(f,m),e.refreshElementSettings(f,e.selectedText),o.range.selectNode(f),e.addNewRange(o.range)}else m.style[e.stylePropretyName]=d}),u)l.parentNode?.replaceChild(u,l);else if(l.getAttribute(e.currentStyle)&&l.parentNode){const m=document.createElement("span");m.innerHTML=l.innerHTML,m.style[e.stylePropretyName]=d;const f=l.closest("a");f&&f.innerText===l.innerHTML&&(f.style[e.stylePropretyName]=d),l.parentNode.replaceChild(m,l)}});const r=Array.from(o.parentWrapper?.getElementsByTagName("span")||[]).reverse();e.isEditorTagOutside&&r.forEach(l=>{l.style[e.stylePropretyName]=e.rgbToHex(l.style[e.stylePropretyName]),e.getInnerText(l)===e.selectedText&&e.canselExecCommand&&(e.setCustomColor(l,e.stylePropretyName,e.currentSettings.value),o.range.selectNode(l),e.addNewRange(o.range))});const i=o.parentWrapper||o.parentNode;e.currentStyle==="color"&&i&&(Dp(i,e.rgbToHex,e.outerContextColor||e.tempColor),Ip(i,e.rgbToHex)),i&&e.cleanEmptySpans(e.selectedText,i)}function Gp(e){const o=e.parentElement;if(!o)return!1;let t=e,n=o;for(;n;){const r=n.tagName;if(r==="TD"||r==="TH")return n.childElementCount!==1||n.firstElementChild!==t?!1:!Array.from(n.childNodes).some(i=>i.nodeType===Node.TEXT_NODE&&i.textContent?.trim()!=="");if(r==="SPAN"||r==="EDITOR"){if(n.childElementCount!==1||n.firstElementChild!==t||Array.from(n.childNodes).some(i=>i.nodeType===Node.TEXT_NODE&&i.textContent?.trim()!==""))return!1;t=n,n=n.parentElement;continue}return!1}return!1}function vi(e,o){const t=e.style.color?.trim();if(!t)return null;const n=We(t),r=We(o??"");return!n||n===r?null:t}function Yp(e){if(e.currentSettings.name!=="textLink")return;const{mutableState:o}=e;let t=o.parentNode.querySelector('a[href=" "]');if(e.isEditorTagOutside||(t=e.findOutermostParentWithText(e.activeElement,"a")),e.currentSettings.value){const n=e.findOutermostParentWithText(e.activeElement,"a")||e.findOutermostParentWithText(o.parentNode,"a")||e.findOutermostParentWithText(o.parentWrapper,"a");if(!(t||n))return;const r=e.commonStyles?.links?.underline===void 0||e.commonStyles?.links?.underline?"underline":"none";t||(t=n);const i=e.findOutermostParentWithText(t);if(i&&i!==t&&i!==o.parentWrapper&&["b","strong","a","em","i","s","strike","u","br","span"].includes(i?.tagName.toLowerCase())){const l=t.cloneNode(!1),s=t.innerHTML;t.parentNode&&(t.parentNode.innerHTML=s),l.appendChild(i.cloneNode(!0)),i.parentNode&&i.parentNode.replaceChild(l,i),t=l,o.range.selectNode(t),e.addNewRange(o.range)}if(t){t.setAttribute("target","_blank"),t.setAttribute("href","");const l=e.commonStyles?.links?.color||t.closest('[style*="color"]')?.style?.color||"";t.setAttribute("style",`color: ${l}; text-decoration: ${r};`),t.setAttribute("new","true"),e.refreshElementSettings(t,e.selectedText)}}else if(t=o.parentNode.closest("a")||o.parentNode.querySelector('a[em-edit="active"]')||e.findOutermostParentWithText(e.activeElement,"a"),t)if(t.style.fontFamily||t.style.fontSize){const n=Gp(t)?"div":"span",r=document.createElement(n);if(r.innerHTML=t.innerHTML,Array.from(t.attributes).forEach(l=>{l.name!=="href"&&l.name!=="target"&&l.name!=="color"&&r.setAttribute(l.name,l.value)}),!r.style.lineHeight){const l=t.closest('[style*="line-height"]');l?.style.lineHeight&&(r.style.lineHeight=l.style.lineHeight)}r.style.textDecoration="";const i=vi(t,e.commonStyles?.links?.color);if(i?r.style.color=i:r.style.color="",t.parentNode?.replaceChild(r,t),n==="div"){let l=r.parentElement;for(;l&&l.tagName!=="TD"&&l.tagName!=="TH";){const s=l.parentElement;if(!s)break;s.replaceChild(r,l),l=r.parentElement}}e.cleanEmptySpansWithParent(e.selectedText,r),e.refreshElementSettings(r,e.selectedText),o.range.selectNodeContents(r),e.addNewRange(o.range)}else{const n=vi(t,e.commonStyles?.links?.color);if(n){const r=document.createElement("span");for(r.style.color=n;t.firstChild;)r.appendChild(t.firstChild);t.parentNode?.replaceChild(r,t),o.range=document.createRange(),o.range.selectNodeContents(r)}else{const r=Array.from(t.childNodes);r.forEach(i=>{t.parentNode?.insertBefore(i,t)}),t.parentNode?.removeChild(t),o.range=document.createRange(),o.range.setStartBefore(r[0]),o.range.setEndAfter(r[r.length-1])}if(e.addNewRange(o.range),o.range.cloneContents()){o.range=o.selection.getRangeAt(0);const r=o.range.commonAncestorContainer,i=r.nodeType===1?r:r.parentElement,l=o.range.firstElementChild?o.range.firstElementChild:o.range.parentElement||i;l&&e.refreshElementSettings(l,e.selectedText)}}}var Kp=new Set(["textStrong","textItalic","textStrikethrough","textUnderline","textLink","textColor","textBackgroundColor"]);function Xp(e){const{commit:o,addNewRange:t,refreshElementSettings:n,findElementWithSelectedText:r,getParentElementOfSelection:i,findOutermostParentWithText:l,clearLinkTags:s,addFontFamilyClass:c,getIsProgrammaticSelection:d,getCommonStyles:u}=e;function g(E,S,v){const C=!!E&&!!S&&S.tagName==="DIV"&&E.tagName==="EDITOR"&&E.parentElement===S&&S.childElementCount===1&&S.firstElementChild===E&&!Array.from(S.childNodes).some(R=>R!==E&&R.nodeType===Node.TEXT_NODE&&!!R.textContent?.trim()),L=!!E&&E.childElementCount===0&&Array.from(E.childNodes).some(R=>R.nodeType===Node.TEXT_NODE&&!!R.textContent?.trim()),w=!!E&&ne(E).trim()===v.trim();if(!C||!L||!w||!E.hasAttribute("em-edit")||!S.parentNode)return;const A=S.parentNode,M=E.getAttribute("em-edit")||"active";for(;E.firstChild;)S.appendChild(E.firstChild);E.remove(),E.removeAttribute("em-edit"),S.setAttribute("em-edit",M),A.replaceChild(E,S),E.appendChild(S)}function m(E,S){try{return S.intersectsNode(E)}catch{const v=document.createRange();return v.selectNodeContents(E),S.compareBoundaryPoints(Range.END_TO_START,v)<0&&S.compareBoundaryPoints(Range.START_TO_END,v)>0}}function f(E){const S=E?.links||{},v=S.underline,C=S.color,L=typeof v=="boolean"?v?"underline":"none":"underline";return{color:typeof C=="string"&&C.trim()?C.trim():"inherit",textDecoration:L}}function p(E,S){if(!E||!S)return null;const v=S,C=Array.from(v.querySelectorAll("a"));v.tagName==="A"&&C.unshift(v);const L=typeof window<"u"&&window.Range?window.Range.START_TO_START:0,w=typeof window<"u"&&window.Range?window.Range.END_TO_END:2;for(const A of C){const M=document.createRange();M.selectNodeContents(A);const R=M.compareBoundaryPoints(L,E)<=0,$=M.compareBoundaryPoints(w,E)>=0;if(R&&$)return A}return null}function b(E,S,v){const C=Array.from(S?.getElementsByTagName("span")||[]).reverse();let L=!1;ne(S)===E&&C.length&&(L=!0),C.forEach(w=>{const A=w.getAttribute("style"),M=!!A&&A.trim().length>0;let R=Array.from(w.attributes).filter(J=>J.name!=="style");if(!M&&R.length===1&&R[0].name==="em-edit"&&w.parentElement&&!w.parentElement.hasAttribute("em-edit")){const J=w.getAttribute("em-edit")||"active";w.parentElement.setAttribute("em-edit",J),w.removeAttribute("em-edit"),R=Array.from(w.attributes).filter(_=>_.name!=="style")}const $=R.length>0;if(!M&&!$){const J=ne(w);if(w.childNodes.length===1&&w.childNodes[0].nodeType===3){const _=w.childNodes[0];w.parentNode?.replaceChild(_,w),v.isEditorTagOutside&&ne(S)!==E&&_.parentNode&&(v.range?.selectNode(_),t(v.range))}else{const _=Array.from(w.childNodes);_.forEach(G=>{w.parentNode?.insertBefore(G,w)}),E===J&&(v.range=document.createRange(),v.range.setStartBefore(_[0]),v.range.setEndAfter(_[_.length-1]),t(v.range)),w.parentNode?.removeChild(w)}}}),L&&(n(S,E),v.range.selectNode(S),t(v.range))}function h(E,S){if(E?.rangeCount>0){const v=E.getRangeAt(0),C=v.commonAncestorContainer;let L=v.startOffset,w=v.endOffset;for(;C.data&&L>0&&!/\s/.test(C.data[L-1]);)L--;for(;C.data&&w<C.length&&!/\s/.test(C.data[w]);)w++;S.setStart(C,L),S.setEnd(C,w),t(S)}}function y(E,S,v){E.innerHTML=E.innerHTML.replaceAll(/<\/?strike[^>]*>/gi,""),E.parentNode&&(v.selectNode(E),t(v),n(E,S))}return function(S,v){const C=Bp(v.settings,a.rgbToHex),L=v.settings.textColor??v.settings.textBackgroundColor;if(typeof L=="string"&&L.trim()!==""&&!a.rgbToHex(L))return!1;const w=a.getListContext(S),{classNameOl:A,classNameUl:M,classNameBullet:R,isListOL:$,isListUL:J,isList:_}=w;_&&w.tableElement?.querySelectorAll("tbody > tr > td:first-child")?.forEach(B=>{const K=B.querySelector(":scope > div")||B.querySelector(":scope > editor div");K&&K.classList.add(`${R}`)}),S?.querySelectorAll(".em-element-path").forEach(B=>B.remove());const G=Object.keys(v.settings)[0];let H=window.getSelection();if(!H||H.rangeCount===0){if(!S||!S.isConnected)return;const B=document.createRange();if(B.selectNodeContents(S),H=window.getSelection(),!H)return;H.removeAllRanges(),H.addRange(B)}let P=H.getRangeAt(0);const q=P.commonAncestorContainer;let O=q.nodeType===1?q:q.parentElement,Q=H.anchorNode?.nodeType===1?H.anchorNode:H.anchorNode?.parentElement,re=!1,x=a.getSelectedText();if(S||(S=H.anchorNode?.childNodes.length===1&&H.anchorNode.firstChild?.nodeType===1?H.anchorNode.firstChild:O,S.tagName==="EDITOR"&&(S=S.parentElement)),C.name==="textLink"&&C.value===""){const B=O?.closest?.("a, [href]")||null;B&&(P.selectNode(B),t(P),S=B)}if(C.name==="textUnderline"&&!C.value){let B=O.closest(["u","strike","[style*=text-decoration]","span","a"].find(K=>O?.closest(K))||"u");!B&&S?.tagName==="A"&&(B=S),B?.tagName==="A"&&(B.style.textDecoration="none",n(B,x),P.selectNode(B),t(P),S=B,re=!0)}let k=v.type==="button"?(S||Q)?.closest("a"):(S||Q)?.closest("a, div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub");const se=v.settings.fontFamily;let z=null;const ee=Array.from(k?.classList||[]).some(B=>(B.startsWith("em-font-")&&(z=B),B.startsWith("em-font-")&&B.includes(C.name==="textItalic"?"Italic":"Bold")));ee&&(C.name==="textItalic"||C.name==="textStrong")&&z&&k?.classList.remove(z);const Y={range:P,isEditorTagOutside:!1},ie=(B=a.getSelectedText(),K=k)=>{b(B,K,Y)},we=a.checkForWorkClass,ke=a.checkForTextNodes,Co=(B,K)=>{y(B,x,Y.range)};let Pe,fe;G==="textColor"?Pe=fe="color":G==="textBackgroundColor"&&(Pe="backgroundColor",fe="background-color");const Ae=v.settings.hasOwnProperty("textColor")||v.settings.hasOwnProperty("textBackgroundColor"),ce=!!O?.closest("editor")||ne(O)===x||ne(O.querySelector("editor"))===x;Y.isEditorTagOutside=ce,v.settings.hasOwnProperty("textColor")&&C.value&&document.execCommand("styleWithCSS",!1,"true");const He=a.setCustomColor,Ye=d(),_e=u();if(Fp({parentElement:O,parentNode:Q,parentWrapper:k,currentSettings:C,isElementList:_,classNameBullet:R,isEditorTagOutside:ce,selectedText:x,range:P,selection:H,checkForTextNodes:ke,commit:o,getInnerText:ne,getSelectedText:a.getSelectedText,addNewRange:t,refreshElementSettings:n,findElementWithSelectedText:r,getParentElementOfSelection:i,rgbToHex:a.rgbToHex})||qp({parentElement:O,parentNode:Q,parentWrapper:k,currentSettings:C,isElementList:_,classNameBullet:R,isEditorTagOutside:ce,selectedText:x,range:P,selection:H,checkForTextNodes:ke,commit:o,getInnerText:ne,getSelectedText:a.getSelectedText,addNewRange:t,refreshElementSettings:n,findElementWithSelectedText:r,getParentElementOfSelection:i,rgbToHex:a.rgbToHex,fontFamilyArray:se,removeClassesByPrefix:a.removeClassesByPrefix$1,createFontClassName:a.createFontClassName,clearLinkTags:s,addFontFamilyClass:c,cleanEmptySpans:ie}))return!1;const be=O.closest(C.tags.find(B=>O?.closest(B))||"span");(P?.collapsed||!a.getSelectedText())&&(C.value?C.value&&ce&&(v.type==="button"||S.tagName==="A"&&be?P.selectNodeContents(be):h(H,P)):be&&P.selectNodeContents(be)),(v.type==="button"||S.tagName==="A"||S?.closest("a"))&&a.getSelectedText()&&a.getSelectedText()!==ne(S)&&be&&(v.settings.hasOwnProperty("textLink")||v.settings.hasOwnProperty("textUnderline"))&&(P.selectNode(be),t(P),v.settings.hasOwnProperty("textUnderline")&&S.tagName==="A"&&(S.style.textDecoration=C.value?"underline":"none",re=!0)),H=window.getSelection(),P=H.getRangeAt(0),Y.range=P,x=a.getSelectedText(),Array.from(k?.querySelectorAll("span,div")||[]).reverse().forEach(B=>{B.getAttribute("style")===""&&B.removeAttribute("style"),B.hasAttribute("contenteditable")&&B.removeAttribute("contenteditable"),B.hasAttribute("em-edit")&&B.removeAttribute("em-edit"),B.hasAttribute("em-relative")&&B.removeAttribute("em-relative"),B.hasAttribute("class")&&(B.classList.remove("em-relative"),B.classList.length===0&&B.removeAttribute("class"))});let vo=null;Ae&&fe&&k?.style?.getPropertyValue?.(fe)?.trim()&&(ne(k)===x&&(k.style[Pe]=a.rgbToHex(C.value?.toString())||"",re=!0),Pe==="color"&&(O===k||S?.closest('[style*="color"]')===k)&&(vo=a.rgbToHex(k.style[fe]),k.style.removeProperty(fe),!k?.hasAttribute("em-edit")&&_&&k&&Ye&&k.closest("tr")?.querySelector(`.${R}`)?.style.removeProperty(fe)));let jt=null,Ke=null;if(Ae&&Pe==="color"&&k?.tagName==="A"){let B=k.parentElement;for(;B&&!["BODY","HTML","TD","TH"].includes(B.tagName);){const K=B.style.getPropertyValue("color")?.trim();if(K){jt=a.rgbToHex(K)||K,Ke=B,B.style.removeProperty("color");break}B=B.parentElement}}fe&&!(C.value.length===7||C.value.length===4)&&(re=!0),ce&&(!C.value&&C.name!=="fontSize"&&C.name!=="textLink"||C.value)&&(!(C.name==="textUnderline"||C.name==="textStrikethrough")||v.type!=="button")&&!re&&(C.name!=="fontSize"&&!Ae&&ne(k)===x?document.execCommand(C.command,!1,Ae?C.value:C.name==="textLink"?" ":void 0):ne(k)!==x&&(v.settings.hasOwnProperty("textColor")&&document.execCommand("styleWithCSS",!1,"true"),document.execCommand(C.command,!1,Ae?String(C.value):C.name==="textLink"?" ":void 0),v.settings.hasOwnProperty("textColor")&&C.value&&xp(k||O,String(C.value),a.rgbToHex))),x=a.getSelectedText();{const B={parentElement:O,parentNode:Q,parentWrapper:k,selection:H,range:P};zp({parentElement:O,parentNode:Q,parentWrapper:k,currentSettings:C,isElementList:_,classNameBullet:R,isEditorTagOutside:ce,selectedText:x,range:P,selection:H,checkForTextNodes:ke,commit:o,getInnerText:ne,getSelectedText:a.getSelectedText,addNewRange:t,refreshElementSettings:n,findElementWithSelectedText:r,getParentElementOfSelection:i,rgbToHex:a.rgbToHex,activeElement:S,hasItalicClass:ee,tempStyleClass:z,checkForWorkClass:we,removeFormattingTags:Ht,cleanEmptySpans:ie,mutableState:B,currentStyle:Pe,isProgrammaticSelection:Ye,findParentWithFontSizeAndTag:a.findParentWithFontSizeAndTag}),O=B.parentElement,Q=B.parentNode,k=B.parentWrapper,H=B.selection,P=B.range,Y.range=P}Wp({parentElement:O,parentNode:Q,parentWrapper:k,currentSettings:C,isElementList:_,classNameBullet:R,isEditorTagOutside:ce,selectedText:x,range:P,selection:H,checkForTextNodes:ke,commit:o,getInnerText:ne,getSelectedText:a.getSelectedText,addNewRange:t,refreshElementSettings:n,findElementWithSelectedText:r,getParentElementOfSelection:i,rgbToHex:a.rgbToHex,activeElement:S,hasItalicClass:ee,tempStyleClass:z,checkForWorkClass:we,removeFormattingTags:Ht,cleanEmptySpans:ie}),$p({parentElement:O,parentNode:Q,parentWrapper:k,currentSettings:C,isElementList:_,classNameBullet:R,isEditorTagOutside:ce,selectedText:x,range:P,selection:H,checkForTextNodes:ke,commit:o,getInnerText:ne,getSelectedText:a.getSelectedText,addNewRange:t,refreshElementSettings:n,findElementWithSelectedText:r,getParentElementOfSelection:i,rgbToHex:a.rgbToHex,activeElement:S,hasItalicClass:ee,tempStyleClass:z,checkForWorkClass:we,removeFormattingTags:Ht,cleanEmptySpans:ie});const Ct={parentWrapper:k,range:P,selection:H};Vp({parentElement:O,parentNode:Q,parentWrapper:k,currentSettings:C,isElementList:_,classNameBullet:R,isEditorTagOutside:ce,selectedText:x,range:P,selection:H,checkForTextNodes:ke,commit:o,getInnerText:ne,getSelectedText:a.getSelectedText,addNewRange:t,refreshElementSettings:n,findElementWithSelectedText:r,getParentElementOfSelection:i,rgbToHex:a.rgbToHex,activeElement:S,hasItalicClass:ee,tempStyleClass:z,checkForWorkClass:we,removeFormattingTags:Ht,cleanEmptySpans:ie,request:v,findOutermostParentWithText:l,mutableState:Ct}),k=Ct.parentWrapper,P=Ct.range,Y.range=P;const Cn={parentWrapper:k,range:P,selection:H};if(Up({parentElement:O,parentNode:Q,parentWrapper:k,currentSettings:C,isElementList:_,classNameBullet:R,isEditorTagOutside:ce,selectedText:x,range:P,selection:H,checkForTextNodes:ke,commit:o,getInnerText:ne,getSelectedText:a.getSelectedText,addNewRange:t,refreshElementSettings:n,findElementWithSelectedText:r,getParentElementOfSelection:i,rgbToHex:a.rgbToHex,activeElement:S,hasItalicClass:ee,tempStyleClass:z,checkForWorkClass:we,removeFormattingTags:Ht,cleanEmptySpans:ie,request:v,findOutermostParentWithText:l,cleanStrikesInElement:Co,mutableState:Cn}),k=Cn.parentWrapper,C.value===!1&&k){const B=window.getSelection(),K=B&&B.rangeCount>0?B.getRangeAt(0):P,Ie={textStrong:["strong","b"],textItalic:["em","i"],textStrikethrough:["s","strike"],textUnderline:["u"]}[C.name];let ze=!1;Ie&&Ie.forEach(X=>{Array.from(k.getElementsByTagName(X)).reverse().forEach(he=>{if(!m(he,K))return;const Ve=ne(he);if(!Ve||Ve.trim().length===0)return;const de=he.parentElement;he.hasAttribute("em-edit")&&de&&!de.hasAttribute("em-edit")&&de.setAttribute("em-edit",he.getAttribute("em-edit")||"active"),he.outerHTML=he.innerHTML,ze=!0,g(de,k,x)})}),ze&&setTimeout(()=>{const X=document.querySelector("[em-edit]")||r(x)||(k?.isConnected?k:null);X&&n(X,x)},0)}if(C.value===!0&&k&&ce){const B={textStrong:"strong",textItalic:"em",textStrikethrough:"s",textUnderline:"u"},K={textStrong:["strong","b"],textItalic:["em","i"],textStrikethrough:["s","strike"],textUnderline:["u"]},Ie=B[C.name],ze=K[C.name];if(Ie&&ze&&x&&x.trim().length>0){const X=k,he=ze.some(Qe=>X.getElementsByTagName(Qe).length>0),Ve=(X.style?.textDecoration||"").toLowerCase(),de=(X.style?.textDecorationLine||"").toLowerCase(),Ne=Ve.includes("underline")||de.includes("underline"),me=Ve.includes("line-through")||de.includes("line-through"),vt=C.name==="textUnderline"&&Ne||C.name==="textStrikethrough"&&me,To=ne(X)===x;if(!he&&!vt&&To){const Qe=document.createElement(Ie);for(;X.firstChild;)Qe.appendChild(X.firstChild);X.appendChild(Qe);try{const Oe=document.createRange();Oe.selectNodeContents(Qe),t(Oe),P=Oe,Y.range=Oe}catch{}setTimeout(()=>{const Oe=document.querySelector("[em-edit]")||r(x)||(X.isConnected?X:null);Oe&&n(Oe,x)},0)}}}const W={parentWrapper:k,parentNode:Q,range:P,selection:H};jp({parentElement:O,parentNode:Q,parentWrapper:k,currentSettings:C,isElementList:_,classNameBullet:R,isEditorTagOutside:ce,selectedText:x,range:P,selection:H,checkForTextNodes:ke,commit:o,getInnerText:ne,getSelectedText:a.getSelectedText,addNewRange:t,refreshElementSettings:n,findElementWithSelectedText:r,getParentElementOfSelection:i,rgbToHex:a.rgbToHex,isColorChange:Ae,tempColor:vo,outerContextColor:jt,outerContextElement:Ke,stylePropretyName:fe,currentStyle:Pe,canselExecCommand:re,isProgrammaticSelection:Ye,request:v,setCustomColor:He,checkForWorkClass:we,cleanEmptySpans:ie,mutableState:W}),k=W.parentWrapper,Q=W.parentNode;const pe={parentWrapper:k,parentNode:Q,range:P,selection:H};if(Yp({parentElement:O,parentNode:Q,parentWrapper:k,currentSettings:C,isElementList:_,classNameBullet:R,isEditorTagOutside:ce,selectedText:x,range:P,selection:H,checkForTextNodes:ke,commit:o,getInnerText:ne,getSelectedText:a.getSelectedText,addNewRange:t,refreshElementSettings:n,findElementWithSelectedText:r,getParentElementOfSelection:i,rgbToHex:a.rgbToHex,findOutermostParentWithText:l,activeElement:S,commonStyles:_e,cleanEmptySpansWithParent:ie,mutableState:pe}),P=pe.range,C.name==="textLink"&&C.value===!0&&ce&&k&&x?.trim().length>0){const B=pe.range||P,K=x.trim(),Ie=[...k?Array.from(k.querySelectorAll("a")):[],...k?.parentElement?Array.from(k.parentElement.querySelectorAll("a")):[]],ze=Ie.find(X=>ne(X)?.trim()===K)||Ie[0]||null;if(!(p(B,k)||p(B,k.parentElement)||ze)&&B&&!B.collapsed){const X=document.createElement("a"),{color:he,textDecoration:Ve}=f(_e);X.setAttribute("target","_blank"),X.setAttribute("href",""),X.setAttribute("new","true"),X.setAttribute("style",`color: ${he}; text-decoration: ${Ve};`);let de=!1;const Ne=k.querySelector("editor");if(Ne&&ne(Ne)===x&&Ne.querySelector("a")===null){for(;Ne.firstChild;)X.appendChild(Ne.firstChild);Ne.appendChild(X),de=!0}try{if(!de){const me=B.extractContents();me.childNodes.length>0&&(X.appendChild(me),B.insertNode(X),de=!0)}}catch{de=!1}if(!de&&ne(k)===x){for(;k.firstChild;)X.appendChild(k.firstChild);k.appendChild(X),de=!0}if(de){try{const me=document.createRange();me.selectNodeContents(X),t(me),P=me,pe.range=me,Y.range=me}catch{}n(X,x)}}}const vn=C.name==="textUnderline"&&!C.value;if((!Ae&&re||vn)&&ie(x),Kp.has(C.name)){const B=pe.parentWrapper||k||r(x)||i();B&&ie(x,B)}_&&O.querySelectorAll(`tr td:first-child > div.${R}, tr td:first-child > editor div.${R}`).forEach(B=>{B.classList.remove(`${R}`)});const Ao=r(x);Ao?.hasAttribute("em-edit")||Ao?.setAttribute("em-edit","active"),o()}}var ve=null,gt=!1,Ai=!1,Ue="",je="",bt=null,Ti=null,rt=null,un=!1,go=!1,fn=!1,oe,Xe,pn,it,$e,bo,j,ho,Li,gn,yo,$t,bn=".em-prevent-action",F,zt,lt,ht;function ge(e){return Rd(e,{HTMLDocument:j,documentMapping:it,remoteDocument:Xe,messageService:a.messageService})}function Zp(e){bo?.setEditorFocus(e)}function Jp(e,o=a.getSelectedText()){let n=(i=>i?.nodeType===Node.ELEMENT_NODE?i:i?.parentElement||null)((typeof a.findElementWithSelectedText=="function"?a.findElementWithSelectedText(o,e):null)||e);if(!n||n.tagName==="EDITOR"&&(n=n.firstElementChild||null,!n))return;const r=a.state.get("activeElementLocked")>0;try{r&&a.state.decrement("activeElementLocked"),ae({elem:n})}finally{r&&a.state.increment("activeElementLocked")}}function Qp(e,o){const t=j.getRangeByElement(e,!0);t&&it.hasMappedReplacementRangeInRange(t)||$e.whenEditorLostFocus(()=>lt(e,o),"editor")}function eg(e){return a.prepareEditorHTML(e,a.parseFromString)}var tg=a.checkIsEditorInited;function wi(e=!1){zd({state:a.state,getEmailWidth:()=>a.state.get("emailWidth"),messageService:a.messageService,removeHiddenClasses:a.removeHiddenClasses,findGlobalHolder:yi,elMarkupHelper:og,rgbToHex:a.rgbToHex,getSubject:Go,getPreheader:so,getUsedColors:Fr,commit:F,setGlobalHolder:o=>{ve=o}},e)}function og(){Jd(ve)}function ng(e){return em(e,j)}function rg(e){return kp(e,{getLockEditor:()=>a.state.get("lockEditor"),applyStylesToDocument:ng,commonStylesApply:Ze,commonStylesApplyToBlock:Je,setFloatBlocksWidth:Ge,appName:a.state.get("appName"),wrapEditor:lt,setCursorPosition:ge,messageService:a.messageService,commit:F})}function ig(e){bu(e,{setBlockGroupControlsPosition:Eo,commit:F})}var ki=qt,_i=Wt;function lg(){return a.stickyCheck(F)}var ag=a.checkSandboxStyles,hn=a.getElementParent;function sg(e){return a.addBlockToProject(e,{HTMLDocument:j,messageService:a.messageService})}function Eo(){return a.setBlockGroupControlsPosition({scrollTop:a.state.get("scrollTop")})}function Ge(e){return a.setFloatBlocksWidth(e,oe)}function yt(e){return a.setBlockMaxWidth(e,oe)}var at=a.setImageWidth;function st(e){return a.insertCountdown(e,F)}var Vt=a.uptimeCountdown,Et=a.checkBlockAdaptivity;function yn(e){return a.addFontFamilyClass(e,F)}function En(e){a.clearLinkTags(e,o=>{F(o)}),Ni()}function Ni(){a.clearProjectFontFaces(e=>{F(e)})}function Ze(e){return a.commonStylesApply(e,F)}var Je=a.commonStylesApplyToBlock,cg=a.getStructureColumns,dg=a.getElementTdDiv,Bi=a.setStructureBlocksWidth;function mg(e){e=oe.getVisibleNode(e),a.implementResizableElems(e),$e.whenEditorLostFocus(()=>{e.isConnected})}function Mi({target:e}){return Qd({target:e},F)}var Ri;function ug(e){const o=["textStrong","textItalic","textStrikethrough","textUnderline","textColor","textBackgroundColor","textLink","lineHeight","fontSize","fontFamily"];try{a.state.increment("activeElementLocked");let t=e.data;t.settings=ho.escape(t.settings),Object.keys(t.settings)[0];let n=a.getActiveEditElement();const r=n;let i=r?.parentElement??null;for(;i&&!i.tagName.startsWith("AMP-");)i=i.parentElement;const l=r?.tagName??"",s=i&&r?Array.from(i.getElementsByTagName(l)).indexOf(r):-1,{classNameOl:c,classNameUl:d,isListOL:u,isListUL:g,isList:m}=a.getListContext(n),f=a.getListContainer(n);if(t.type==="img"||t.type==="countdown"||t.type==="video")zf(t.settings,{activeElement:n,getActiveEditElement:a.getActiveEditElement,setCursorPosition:ge,setElementBorder:a.setElementBorder,setElementBoxShadow:a.setElementBoxShadow,setElementBorderRadius:a.setElementBorderRadius,setElementMobileWidth:a.setElementMobileWidth,setElementMobileHeight:a.setElementMobileHeight,setElementMobileBorder:a.setElementMobileBorder,setElementMobileBorderRadius:a.setElementMobileBorderRadius,setElementMobileBoxShadow:a.setElementMobileBoxShadow,setElementMobileAlign:a.setElementMobileAlign,setElementMobileVerticalAlign:a.setElementMobileVerticalAlign,setElementShow:a.setElementShow});else if(t.type==="a")Vf(t.settings,{activeElement:n,textStyleProperties:o,toggleTextStyle:ht});else if(t.type==="table")Uu(t.settings,{activeElement:n,setElementBorder:a.setElementBorder,setElementBoxShadow:a.setElementBoxShadow,setElementBorderRadius:a.setElementBorderRadius,setElementMobileTableAlign:a.setElementMobileTableAlign,setElementMobileWidth:a.setElementMobileWidth,setElementMobileBorder:a.setElementMobileBorder,setElementMobileBorderRadius:a.setElementMobileBorderRadius,setElementMobileBoxShadow:a.setElementMobileBoxShadow,setElementMobileBackgroundColor:a.setElementMobileBackgroundColor,setElementMobileBackgroundImage:a.setElementMobileBackgroundImage,setElementMobileBackgroundPositionX:a.setElementMobileBackgroundPositionX,setElementMobileBackgroundPositionY:a.setElementMobileBackgroundPositionY,setElementMobileBackgroundRepeat:a.setElementMobileBackgroundRepeat,setElementMobileBackgroundSize:a.setElementMobileBackgroundSize,setElementShow:a.setElementShow});else if(t.type==="td"||t.type==="structure"||t.type==="group"||t.type==="column")Gu(t.settings,{activeElement:n,requestType:t.type,textStyleProperties:o,isElementListContainer:f,isProgrammaticSelection:{get value(){return gt},set value(b){gt=b}},setElementBorder:a.setElementBorder,setElementBoxShadow:a.setElementBoxShadow,setElementBorderRadius:a.setElementBorderRadius,setElementMobileWidth:a.setElementMobileWidth,setElementMobileHeight:a.setElementMobileHeight,setElementMobileBorder:a.setElementMobileBorder,setElementMobileBorderRadius:a.setElementMobileBorderRadius,setElementMobileBoxShadow:a.setElementMobileBoxShadow,setElementMobileAlign:a.setElementMobileAlign,setElementMobileTableAlign:a.setElementMobileTableAlign,setElementMobileVerticalAlign:a.setElementMobileVerticalAlign,setElementMobileDirection:a.setElementMobileDirection,setElementMobileBackgroundColor:a.setElementMobileBackgroundColor,setElementMobileBackgroundImage:a.setElementMobileBackgroundImage,setElementMobileBackgroundPositionX:a.setElementMobileBackgroundPositionX,setElementMobileBackgroundPositionY:a.setElementMobileBackgroundPositionY,setElementMobileBackgroundRepeat:a.setElementMobileBackgroundRepeat,setElementMobileBackgroundSize:a.setElementMobileBackgroundSize,setElementMobilePadding:a.setElementMobilePadding,setElementShow:a.setElementShow,setContrastBlock:a.setContrastBlock,setStructureBlocksWidth:Bi,toggleTextStyle:ht,removeEditorTags:a.removeEditorTags,addClassToSecondCell:a.addClassToSecondCell,wrapEditor:lt,addNewRange:a.addNewRange});else if(t.type==="button")Wu(t.settings,{activeElement:n,textStyleProperties:o,setElementBorder:a.setElementBorder,setElementBoxShadow:a.setElementBoxShadow,setElementBorderRadius:a.setElementBorderRadius,setElementMobileWidth:a.setElementMobileWidth,setElementMobileHeight:a.setElementMobileHeight,setElementMobileLineHeight:a.setElementMobileLineHeight,setElementMobileBorder:a.setElementMobileBorder,setElementMobileBorderRadius:a.setElementMobileBorderRadius,setElementMobileBoxShadow:a.setElementMobileBoxShadow,setElementMobileAlign:a.setElementMobileAlign,setElementMobileTableAlign:a.setElementMobileTableAlign,setElementMobileVerticalAlign:a.setElementMobileVerticalAlign,setElementMobileBackgroundColor:a.setElementMobileBackgroundColor,setElementMobileBackgroundImage:a.setElementMobileBackgroundImage,setElementMobileBackgroundPositionX:a.setElementMobileBackgroundPositionX,setElementMobileBackgroundPositionY:a.setElementMobileBackgroundPositionY,setElementMobileBackgroundRepeat:a.setElementMobileBackgroundRepeat,setElementMobileBackgroundSize:a.setElementMobileBackgroundSize,setElementMobilePadding:a.setElementMobilePadding,setElementMobileFontSize:a.setElementMobileFontSize,setElementShow:a.setElementShow,toggleTextStyle:ht,compareStrings:a.compareStrings});else if(t.type==="div")Vu(t.settings,{activeElement:n,setElementBorder:a.setElementBorder,setElementBoxShadow:a.setElementBoxShadow,setElementBorderRadius:a.setElementBorderRadius,setElementMobileWidth:a.setElementMobileWidth,setElementMobileHeight:a.setElementMobileHeight,setElementMobileBorder:a.setElementMobileBorder,setElementMobileBorderRadius:a.setElementMobileBorderRadius,setElementMobileBoxShadow:a.setElementMobileBoxShadow,setElementMobileAlign:a.setElementMobileAlign,setElementMobileVerticalAlign:a.setElementMobileVerticalAlign,setElementMobileDirection:a.setElementMobileDirection,setElementMobileBackgroundColor:a.setElementMobileBackgroundColor,setElementMobileBackgroundImage:a.setElementMobileBackgroundImage,setElementMobileBackgroundPositionX:a.setElementMobileBackgroundPositionX,setElementMobileBackgroundPositionY:a.setElementMobileBackgroundPositionY,setElementMobileBackgroundRepeat:a.setElementMobileBackgroundRepeat,setElementMobileBackgroundSize:a.setElementMobileBackgroundSize,setElementMobilePadding:a.setElementMobilePadding,setElementShow:a.setElementShow});else if(t.type==="vindent")Uf(t.settings,{activeElement:n,setElementMobileHeight:a.setElementMobileHeight});else if(t.type==="var")jf(t.settings,{activeElement:n,isVariableText:a.isVariableText});else if(t.type==="floatBlock")Zu(t.settings,{activeElement:n,setElementMobileWidth:a.setElementMobileWidth,setElementMobileContentWidth:a.setElementMobileContentWidth,setElementMobileVerticalAlign:a.setElementMobileVerticalAlign,setElementShow:a.setElementShow});else if(t.type==="text")Of(t.settings,{activeElement:n,textStyleProperties:o,toggleTextStyle:ht,collectVMLContent:Ro,updateVMLComments:Po,removeClassesByPrefix:a.removeClassesByPrefix$1,createFontClassName:a.createFontClassName,addFontFamilyClass:yn,clearLinkTags:En,handleTextScriptSettings:ff,handleTextReplacer:pf,handleTextAnchor:Sf,unwrapNestedTags:bd,wrapInTag:hd,unwrapTag:yd,isRangeMatching:Ed,splitWrapper:Sd,cleanEmptyTags:Cd,applicationElementSettingsSet:ae,compareStrings:a.compareStrings,setElementMobileFontSize:a.setElementMobileFontSize,setElementMobileLineHeight:a.setElementMobileLineHeight,setElementMobileAlign:a.setElementMobileAlign,updateTableStyle:a.updateTableStyle,changeBullets:a.changeBullets,changeBulletsColor:a.changeBulletsColor,changeBulletsSize:a.changeBulletsSize,changeBulletsItalic:a.changeBulletsItalic,changeBulletsWeight:a.changeBulletsWeight,changeBulletsStrikethrough:a.changeBulletsStrikethrough,changeBulletsUnderline:a.changeBulletsUnderline,findElementWithSelectedText:a.findElementWithSelectedText,removeEditorTags:a.removeEditorTags,isElementList:m,isElementListOL:u,classNameOl:c,classNameUl:d,commit:F});else if(t.type==="floatBlocksWidths")Ju(t.settings,{activeElement:n,setPercentsForColumns:a.setPercentsForColumns,setElementMobileHeight:a.setElementMobileHeight});else if(t.type==="floatBlocksPreset")Qu(t.settings,{activeElement:n,setPercentsForColumns:a.setPercentsForColumns,setElementMobileHeight:a.setElementMobileHeight});else if(t.type==="floatBlocksValign")ef(t.settings,{activeElement:n,setPercentsForColumns:a.setPercentsForColumns,setElementMobileHeight:a.setElementMobileHeight});else if(t.type==="floatBlocksGap")tf(t.settings,{activeElement:n,setPercentsForColumns:a.setPercentsForColumns,setElementMobileHeight:a.setElementMobileHeight});else if(t.type==="floatBlocksGapMobile")of(t.settings,{activeElement:n,setPercentsForColumns:a.setPercentsForColumns,setElementMobileHeight:a.setElementMobileHeight});else if(t.type==="carousel")nf(t.settings,{activeElement:n,HTMLDocument:j,parseFromString:a.parseFromString,setElementBorderRadius:a.setElementBorderRadius,commit:F});else if(t.type==="accordion")rf(t.settings,{activeElement:n,HTMLDocument:j,parseFromString:a.parseFromString,setElementBorderRadius:a.setElementBorderRadius,commit:F});else if(t.type==="social"){const b=uf(t.settings,{activeElement:n,parseFromString:a.parseFromString,commit:F});b&&(n=b)}else t.type==="customTable"&&Cf(t.settings,{activeElement:n,activeCell:a.state.get("activeCell"),state:a.state,parseTableElementToModel:Rt,tableModelToHtml:Se,updateTablePadding:qa,updateBackgroundPosition:Wa,removeStyleProperty:Za,updateBorderRadius:Qa,removeClassByPrefix:os,getCellsWithClasses:za,updateTableCellBackgroundByIds:Va,addClassToCellsByIds:Ua,getExternalBorders:Ga,mergeUniCells:ns,updateCellBordersByIds:ja,getExternalCorners:Ka,updateCellBorderRadiusByIds:Ya,updateCellPaddingByIds:Xa,removeOuterBorders:es,simplifyBorders:ts,wrapEditor:lt,addNewRange:a.addNewRange,toggleTextStyle:ht,textStyleProperties:o,commit:F,setElementMobileWidth:a.setElementMobileWidth,setElementMobileHeight:a.setElementMobileHeight,setElementShow:a.setElementShow,setElementMobileBackgroundColor:a.setElementMobileBackgroundColor,setElementMobileBackgroundImage:a.setElementMobileBackgroundImage,setElementMobileBackgroundPositionX:a.setElementMobileBackgroundPositionX,setElementMobileBackgroundPositionY:a.setElementMobileBackgroundPositionY,setElementMobileBackgroundRepeat:a.setElementMobileBackgroundRepeat,setElementMobileBackgroundSize:a.setElementMobileBackgroundSize,setElementMobileBoxShadow:a.setElementMobileBoxShadow,setElementMobileBorder:a.setElementMobileBorder,setElementMobileBorderRadius:a.setElementMobileBorderRadius});try{a.emFilterCSS()}catch{}a.state.increment("activeElementLocked");const p=n;zt().finally(()=>{const b=j.getMappedParent(n);if(b?.isConnected){const h=b,y=h.tagName.startsWith("AMP-"),E=y&&h===i&&s>=0,S=y?Array.from(h.querySelectorAll("section"),A=>A.hasAttribute("expanded")):[],v=oe.getOuterHtml(b),C=a.parseFromString(v)[0];b.parentNode?.replaceChild(C,b);const L=C,w=E?L.getElementsByTagName(l)[s]??null:null;if(w)w.setAttribute("em-edit","active"),n=w;else if(p?.tagName==="A"&&C.tagName!=="A"){const A=C.querySelector?.("a");A?(A.setAttribute("em-edit","active"),n=A):(C.setAttribute("em-edit","active"),n=C)}else C.setAttribute("em-edit","active"),n=C;zt().finally(()=>{L.querySelectorAll("section").forEach((A,M)=>{S[M]&&A.setAttribute("expanded","")}),a.state.decrement("activeElementLocked"),ge(n)})}else a.state.decrement("activeElementLocked"),ge(n)})}catch{}finally{Promise.resolve().then(()=>a.state.decrement("activeElementLocked"))}}function ae(e){if(!a.state.isActiveElementLocked()){if(!e.elem){const o=document.querySelector("[em-edit]");o&&(e.elem=o)}try{a.state.increment("activeElementLocked"),a.removeAllAttributes("em-edit");let o={};if(e.elem){if(e.elem.closest?.(bn))return;e.elem=Zf(e.elem,{getVariableByIcon:a.getVariableByIcon,htmlDocument:oe,findOutermostParentWithText:a.findOutermostParentWithText,sendResizeEvent:a.sendResizeEvent});const t=e.elem.tagName==="EDITOR"&&e.elem.firstChild?.nodeType===1?e.elem.firstChild:e.elem,{classNameOl:n,classNameUl:r,isListOL:i,isListUL:l,isList:s}=a.getListContext(e.elem),c=s?a.getListBullet(e.elem):null,d=!!e.elem.closest(".em-element-custom-table"),u=a.getLineHeightInPixels,g=E=>a.getFontFamilyFromElement(E,t),m=a.textHasStyle,f=(E,S=!1)=>Xf(S,{getSelectedText:a.getSelectedText,getRangeFromSelection:a.getRangeFromSelection});Kf(e.elem,window.getSelection()?.isCollapsed??!0,!!e.elem.querySelector("editor"),{removeAllAttributes:a.removeAllAttributes}),o={operation:"application_element_settings_set",settings:{}};const p=Jf({elem:e.elem,isCellCustomTable:d,listContext:{isListOL:i,isListUL:l,isList:s},requestElemBullet:c,variableElement:f},{...Ri,Locale:$t,isProgrammaticSelection:gt,getElementTdDiv:dg,getLineHeghtInPixels:u,getFontFamilyFromElement:g,textHasStyle:m,activeCell:a.state.get("activeCell"),CLASS_FOR_BASIC_CELL:a.CLASS_FOR_BASIC_CELL,requestElemWithStyle:t}),b=ep(e.elem,window.getSelection()?.isCollapsed??!0,p);o.type=b.type,o.caption=b.caption,o.settings=b.settings;const h=Yf(e.elem,b,o,{removeAllAttributes:a.removeAllAttributes});if(h.isProgrammaticSelectionReset&&(gt=!1),h.shouldReturn)return;const y=Gf({elem:e.elem,message:o,activateSection:e.activateSection},{getElementParentCaption:Xr,getStructureColumns:cg,getUsedColors:Fr,getElementPath:cm,getCurrentElementPath:rm,ampService:Li,mapObj:ho,commonStyles:a.state.get("commonStyles")});o=y.message,a.state.update({elementPath:y.elementPath})}else{setTimeout(()=>{let t=document.querySelector("[em-edit]");if(t?.isConnected){ae({elem:t});return}const n={operation:"application_element_settings_set",settings:ho.unescape({parent:void 0,nextElem:!1,prevElem:!1}),type:null};JSON.stringify(n),a.messageService.send(n)},0);return}JSON.stringify(o),Ue=e.elem?j.getOuterHtml(e.elem):"",je=Ot(e.elem),a.messageService.send(o)}finally{Promise.resolve().then(()=>{const o=document.querySelector("[em-edit]");Ue=o?j.getOuterHtml(o):"",je=Ot(o),a.state.decrement("activeElementLocked")})}}}function fg(){document.addEventListener("keydown",m=>{document.body?.classList.contains("mceNonEditable")||a.state.get("lockEditor")||!m.target?.closest?.('[contenteditable="true"]')||!m.key||m.ctrlKey||m.altKey||m.metaKey||m.key.length===1&&(m.preventDefault(),m.stopImmediatePropagation(),document.execCommand("insertText",!1,m.key))},!0);const e=m=>{const f=m.target,p=f?.closest?.("a")||f?.querySelector?.("a");if(!p)return;const b=p.closest("td")||p.parentElement;b&&a.findRoundrectComment(b)&&F(!1).then(()=>{!b.isConnected||!p.isConnected||(p.closest("editor")||p.querySelector("editor")||b.querySelector("editor"))&&a.updateButtonVMLLabel(b,p.textContent||"")&&F(!1)})};document.addEventListener("input",e,!1),document.addEventListener("focusout",m=>{a.handleVMLButtonInput(m)&&F(!1)},!1),a.state.update({isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1,actualTargetCount:0,activeCell:[],lockEditorInit:!0,globalHolder:null,applicationTheme:"light",iframeOffsetTop:0,scrollTop:0,previewHeight:0,applicationMode:"default",emailWidth:0,lockEdit:!1,elementPath:[],copyPasteEnabled:!0,saveBlockEnabled:!0,editImageControlEnabled:!0,elementAIimageEnabled:!0,imageCenterStockEnabled:!0,imageCenterGifEnabled:!0,imageCenterEditorEnabled:!0,blocksAddPanelEnabled:!0,lockEditor:!0,codeMode:!0,appName:"",commonStyles:{},isProgrammaticSelection:!1});let o=a.state.get("activeElementLocked");a.state.subscribe(m=>{if(m.activeElementLocked!==void 0){const f=o,p=m.activeElementLocked;o=p,f>0&&p===0&&Promise.resolve().then(()=>{if(a.state.get("activeElementLocked")!==0)return;const b=document.querySelector("[em-edit]");Ue=b?j.getOuterHtml(b):"",je=Ot(b)})}"globalHolder"in m&&(ve=m.globalHolder),"isProgrammaticSelection"in m&&(gt=m.isProgrammaticSelection)}),a.implementPolyfills(),setTimeout(()=>{Ai=!0},1e3),a.provideSandboxState(a.container);const t=a.provideAttributePipeline(a.container).pipeline,n=a.provideDocumentSync(a.container,$c,{prepareHtml:m=>a.emFilter({node:m,isPartial:!0}),lock:{increment:()=>a.state.increment("activeElementLocked"),decrement:()=>a.state.decrement("activeElementLocked")}});oe=n.htmlDocument,Xe=n.remoteDocument,pn=n.textDocument,it=n.documentMapping,a.provideImageCache(a.container,{pipeline:t,htmlDocument:oe}),gn=a.provideEmVersion(a.container,{pipeline:t,htmlDocument:oe}).reload,n.onDocumentReplaced(()=>gn?.clear()),a.messageService.addListener(a.EVENT_TYPES.SANDBOX_IMAGE_RESET,({url:m})=>{m&&(a.container.getInstance(a.IMAGE_CACHE_ID)?.forget(m),gn?.reload(m))}),a.initDocuments({htmlDocument:oe,remoteDocument:Xe,textDocument:pn,documentMapping:it}),F=m=>n.commit(m),zt=m=>n.commitLockedAsync(m),bo=a.provideFocus(a.container,{htmlDocument:oe,remoteDocument:Xe}),$e=bo.controller,a.initFocusManager($e),a.attachFocusService(bo),j=oe,zc(),Xc(oe,$e),Zc(oe,$e),a.registerCrossDomainDD(),a.registerThemeVariablesService(oe),a.registerProjectFontsService(),ld(Xe,m=>{F(m)}),od(oe,it,ge),a.registerCorrectVariableSelectionService(),a.registerResizeWatch(oe,Xe),a.registerResetService(oe),ad(oe,$e,Xe),a.registerExtensionScriptsService(oe),Li=a.provideAmp(a.container,oe).service,yo=a.registerLocalizationService(oe),sd({container:a.container,focusController:$e,features:gd}),nm(yo),$t=yo.localized,yo.onChangeLocale(({data:m})=>{$t=m}),du({getLocale:()=>$t,commit:m=>F(m)}),a.initSandboxStyles({textDocument:pn,commit:m=>F(m)}),a.initResizableElements({getLocale:()=>$t,commit:m=>F(m),messageService:a.messageService}),oe.onChange(m=>{m.some(f=>f.added.length||f.characterDataChanged||f.reordered?.length||f.reparented?.length)&&a.initSortable(j)}),ho=a.createMapObj(it),j.onChange(()=>{ag()}),oe.onRefresh(wi),j.onChange(m=>{for(const f of m)for(const p of f.removed)(p instanceof HTMLHeadElement||p instanceof HTMLLinkElement&&p.hasAttribute("em"))&&document.querySelector(".em-editor-wrapper")?.remove()});const r=new a.UpdateQueue;let i=0;j.onChange(m=>{for(const f of m)for(const p of f.added)r.add(p.parentElement?p.parentElement:p);i||(i=setTimeout(()=>{$e.whenEditorLostFocus(()=>{r.clear(),F(!1)}),i=0},1e3))}),j.onChange(a.createHandleChangesWithRemovedElementsOnly(ae)),j.onChange(()=>{if(a.state.get("activeElementLocked")>0)return;const m=document.querySelector("[em-edit]"),f=m?j.getOuterHtml(m):"",p=Ot(m);(Ue!==f||je!==p)&&(document.body&&!document.body.classList.contains("em-sandbox-discuss")?m?m.closest?.(bn)||(Ue=f,je=p,ae({elem:m})):setTimeout(()=>{let h=document.querySelector("[em-edit]");if(h){const y=j.getOuterHtml(h),E=Ot(h);(Ue!==y||je!==E)&&(Ue=y,je=E,h.closest?.(bn)||ae({elem:h}))}else Ue=f,je=p,ae({elem:null})},0):(Ue=f,je=p));const b=document.body;b&&((a.state.get("lockEdit")!==b.classList.contains("mceNonEditable")||a.state.get("lockEditor"))&&(a.state.get("lockEdit")||a.state.get("lockEditor")?b.classList.add("mceNonEditable"):b.classList.remove("mceNonEditable")),b.classList.toggle("em-sandbox-preview",a.state.get("previewPage")))}),ht=Xp({commit:F,addNewRange:a.addNewRange,refreshElementSettings:Jp,findElementWithSelectedText:a.findElementWithSelectedText,getParentElementOfSelection:a.getParentElementOfSelection$1,findOutermostParentWithText:a.findOutermostParentWithText,clearLinkTags:En,addFontFamilyClass:yn,getIsProgrammaticSelection:()=>gt,getCommonStyles:()=>a.state.get("commonStyles")}),lt=a.createWrapEditor({removeHiddenClasses:a.removeHiddenClasses,checkIsInited:tg,prepareEditorHTML:eg,getVisibleText:a.getVisibleText,defaultVisibleTextMapFn:a.defaultVisibleTextMapFn,getTagNameForContainer:a.getTagNameForContainer,applyAttributesToTag:(m,f,p)=>a.applyAttributesToTag(m,f,p,a.rgbToHex),setCursorToElement:a.setCursorToElement,removeLastWord:a.removeLastWord,hasOnlyTextNodesDeep:a.hasOnlyTextNodesDeep,isRangeCoveringAllVisibleText:a.isRangeCoveringAllVisibleText,isEditorContentOnlyNbsp:a.isEditorContentOnlyNbsp$1,isClickAtEndOfEmReplace:a.isClickAtEndOfEmReplace,getOrCreateAfterSpan:a.getOrCreateAfterSpan,setCursorInsideSpan:a.setCursorInsideSpan,commit:F,createBeforeInputHandler:a.createBeforeInputHandler}),Ri={_isCarouselElement:um,_isAccordionElement:pm,_isSocialBlockElement:wm,_isImageElement:_n,_isLinkElement:Pm,_isButtonElement:Rm,_isTableElement:bl,_isCustomTableElement:Qm,_isAtomElement:tu,_isTdColumnGroup:Vm,_isTdStructure:Um,_isEmptyTd:jm,_isTdCell:Gm,_isVindentTd:xm,_isVindentDiv:Dm,_isFloatBlockElement:zm,_isDivTextElement:dl,_isInlineButtonElement:Hm,_extractTextSettings:Zt,_extractCarouselSettings:dm,_extractAccordionSettings:fm,_extractSocialSettings:km,_extractImgSettings:Xt,_extractButtonSettings:Mm,_extractLinkTextSettings:ml,_extractTableSettings:gl,_extractCustomTableSettings:eu,_extractAtomElementSettings:ru,_extractProgrammaticElementSettings:iu,_extractTdColumnGroupSettings:Km,_extractTdStructureSettings:Xm,_extractTdCellSettings:Zm,_extractVindentSettings:Fm,_extractFloatBlockSettings:$m,_extractDivContainerSettings:Jm,_clearActiveEditElements:a.clearActiveEditElements,HTMLDocument:j,parseFromString:a.parseFromString,getParentElementOfSelection:a.getParentElementOfSelection$1,getSelectedText:a.getSelectedText,findElementWithSelectedText:a.findElementWithSelectedText,parseTableElementToModel:Rt,extractBorderRadius:Ja,parseBackgroundStyles:$a,isElementHasBold:a.isElementHasBold$1},Dc(),Hc(ae),Ac(function(m){typeof ge=="function"&&ge(m)}),Tc(function(m){wi(m)}),Lc(function(m){a.state.set("commonStyles",m)}),wc(function(m){return hn(m)}),kc(function(m){return a.getVariableByIcon(m)}),_c(function(m){return vd(m)}),Nc({getOuterHtml:function(m){return a.getOuterHtml(m)}}),Bc({increment:function(m){a.state.increment(m)},decrement:function(m){a.state.decrement(m)}}),Mc(function(m){a.setPercentsForColumns(m)}),Rc(function(){return a.getActiveEditElement()}),Pc(function(m){return a.parseFromString(m)}),a.state.subscribe(m=>{const f={};"iframeOffsetTop"in m&&(f.iframeOffsetTop=m.iframeOffsetTop),"previewHeight"in m&&(f.previewHeight=m.previewHeight),"emailWidth"in m&&(f.emailWidth=m.emailWidth),"elementPath"in m&&(f.elementPath=m.elementPath),"lockEdit"in m&&(f.lockEdit=m.lockEdit),Object.keys(f).length>0&&Oc(f)}),a.messageService.addListener(function(m){if(m.data.operation=="update_position_from_editor"){let f=m.data.data;if(f){f=Xe.correctOffset(f,!0),f=it.correctOffset(f,!0);let p=j.getElementByPosition(f);if(p&&!(p instanceof Element)&&(p=p.parentElement),p){const b=p.getBoundingClientRect(),h=document.querySelector("[em-edit]");p.tagName!=="BODY"&&b.height&&b.width&&h!==p&&ae({elem:p});let y=p,E={operation:"application_scroll-to",settings:{value:a.state.get("applicationMode")==="default"?y.getBoundingClientRect().top+a.state.get("iframeOffsetTop")-a.state.get("previewHeight")/2+y.getBoundingClientRect().height/2:y.getBoundingClientRect().top-a.state.get("previewHeight")/2+y.getBoundingClientRect().height/2}};a.messageService.send(E)}}}if(m.data.operation=="sandbox_email_settings_set"){let f=m.data;if(ve=yi(),ve){const h=ve.classList.contains("full-wrap")?ve.querySelector("td"):ve;h&&a.setEmailBackgroundSettings(h,f.settings,jo())}f.settings.subject!==void 0&&(document.title=f.settings.subject);const p=pp(f.settings,{globalHolder:ve,emailWidth:a.state.get("emailWidth"),state:a.state,findParentTr:a.findParentTr});vp(f.settings,ve),op(f.settings,{globalHolder:ve,commonStyles:a.state.get("commonStyles"),lockEditor:a.state.get("lockEditor"),removeClassesByPrefix:a.removeClassesByPrefix$1,createFontClassName:a.createFontClassName,addFontFamilyClass:yn,clearLinkTags:En,clearProjectFontFaces:Ni,rgbToHex:a.rgbToHex,setElementBorder:a.setElementBorder,setElementBorderRadius:a.setElementBorderRadius,setStructureBlocksWidth:Bi,messageService:a.messageService});const b=Object.keys(f.settings).filter(h=>f.settings[h]!==void 0);(p||!(b.length===1&&b[0]==="width"))&&zt()}m.data.operation==="sandbox_element_settings_set"&&$e.whenEditorLostFocus(()=>ug(m)),(m?.data?.operation??m?.operation)==="sandbox_native-image-drop-clear"&&qn(),m.data.operation==="sandbox_window-characteristic"&&Fu(m.data.settings,m.data.mode,{state:a.state,previewHeight:a.state.get("previewHeight"),iframeOffsetTop:a.state.get("iframeOffsetTop"),scrollTop:a.state.get("scrollTop"),globalHolder:ve,setBlockGroupControlsPosition:Eo,messageService:a.messageService}),m.data.operation=="sandbox_iframe-setsize"&&qu(m.data.settings,{state:a.state,previewHeight:a.state.get("previewHeight"),iframeOffsetTop:a.state.get("iframeOffsetTop"),scrollTop:a.state.get("scrollTop"),globalHolder:ve,setBlockGroupControlsPosition:Eo,messageService:a.messageService}),m.data.operation=="sandbox_atom-insert"&&Pu({action:m.data.action,atomHTML:m.data.settings?.atomHTML,name:m.data.settings?.name},{state:a.state,commit:F,lockEditor:a.state.get("lockEditor"),emailWidth:a.state.get("emailWidth"),iframeOffsetTop:a.state.get("iframeOffsetTop"),previewHeight:a.state.get("previewHeight"),parseFromString:a.parseFromString,getOuterHtml:a.getOuterHtml,HTMLDocument:j,minify:a.minifyStylesheet,cssbeautify,insertAdjacentHTML:a.insertAdjacentHTML,messageService:a.messageService,setDocumentStyles:f=>a.setDocumentStyles(f,{minify:a.minifyStylesheet,cssbeautify,HTMLDocument:j}),setImageWidth:at,commonStylesApply:Ze,commonStylesApplyToBlock:Je,insertCountdown:st,uptimeCountdown:Vt,setBlockMaxWidth:yt,setFloatBlocksWidth:Ge,checkBlockAdaptivity:Et,setAtomReplaced:f=>{rt=f}}),m.data.operation=="sandbox_block-insert"&&Ou({action:m.data.action,blockHTML:m.data.settings?.blockHTML,type:m.data.settings?.type,project:m.data.settings?.project,name:m.data.settings?.name,blockId:m.data.settings?.blockId},{state:a.state,commit:F,lockEditor:a.state.get("lockEditor"),emailWidth:a.state.get("emailWidth"),iframeOffsetTop:a.state.get("iframeOffsetTop"),previewHeight:a.state.get("previewHeight"),parseFromString:a.parseFromString,getOuterHtml:a.getOuterHtml,HTMLDocument:j,minify:a.minifyStylesheet,cssbeautify,insertAdjacentHTML:a.insertAdjacentHTML,messageService:a.messageService,setDocumentStyles:f=>a.setDocumentStyles(f,{minify:a.minifyStylesheet,cssbeautify,HTMLDocument:j}),setImageWidth:at,commonStylesApply:Ze,commonStylesApplyToBlock:Je,insertCountdown:st,uptimeCountdown:Vt,setBlockMaxWidth:yt,setFloatBlocksWidth:Ge,checkBlockAdaptivity:Et}),m.data.operation=="sandbox_global_block_replace"&&Iu({emBlockId:m.data.settings?.emBlockId,blockHTML:m.data.settings?.blockHTML,type:m.data.settings?.type,project:m.data.settings?.project,name:m.data.settings?.name},{state:a.state,commit:F,lockEditor:a.state.get("lockEditor"),emailWidth:a.state.get("emailWidth"),iframeOffsetTop:a.state.get("iframeOffsetTop"),previewHeight:a.state.get("previewHeight"),parseFromString:a.parseFromString,getOuterHtml:a.getOuterHtml,HTMLDocument:j,minify:a.minifyStylesheet,cssbeautify,insertAdjacentHTML:a.insertAdjacentHTML,messageService:a.messageService,setDocumentStyles:f=>a.setDocumentStyles(f,{minify:a.minifyStylesheet,cssbeautify,HTMLDocument:j}),setImageWidth:at,commonStylesApply:Ze,commonStylesApplyToBlock:Je,insertCountdown:st,uptimeCountdown:Vt,setBlockMaxWidth:yt,setFloatBlocksWidth:Ge,checkBlockAdaptivity:Et})}),document.addEventListener("click",()=>{}),document.addEventListener("click",function(m){a.state.get("lockEditor")||Du(m,{lockEditor:a.state.get("lockEditor"),commit:F,atomDropCtx:{messageService:a.messageService,isJsonString:a.isJsonString,getOuterHtml:a.getOuterHtml,minify:a.minifyStylesheet,cssbeautify,HTMLDocument:j,_setDocumentStyles:a.setDocumentStyles,commonStylesApply:Ze,commonStylesApplyToBlock:Je,setImageWidth:at,setFloatBlocksWidth:Ge,insertCountdown:st,mutableState:{atomReplaced:rt}},blockDropCtx:{lockEditor:a.state.get("lockEditor"),state:a.state,commit:F,messageService:a.messageService,emailWidth:a.state.get("emailWidth"),parseFromString:a.parseFromString,getOuterHtml:a.getOuterHtml,isJsonString:a.isJsonString,isTableElement:a.isTableElement,insertAdjacentHTML:a.insertAdjacentHTML,minify:a.minifyStylesheet,cssbeautify,HTMLDocument:j,commonStylesApplyToBlock:Je,commonStylesApply:Ze,uptimeCountdown:Vt,setBlockMaxWidth:yt,setFloatBlocksWidth:Ge,checkBlockAdaptivity:Et,setImageWidth:at,insertCountdown:st,_setDocumentStyles:a.setDocumentStyles,applicationElementSettingsSet:ae,mutableState:{atomReplaced:rt}}})},!0),document.onmouseover=_p({getVisibleNode:m=>j.getVisibleNode(m),isInExternal:m=>j.isInExternal(m),isVisible:m=>oe.isVisible(m),incrementActiveElementLocked:()=>a.state.increment("activeElementLocked"),decrementActiveElementLocked:()=>a.state.decrement("activeElementLocked"),getLockEditorInit:()=>a.state.get("lockEditorInit"),getIsLeftButtonDown:()=>go,getLoadStylesTimer:()=>Ai,hasTextNodeInElement:a.hasTextNodeInElement,wrapEditor:Qp,implementElementsEditors:ig,implementResizableElems:mg,commit:F}),document.onmouseleave=function(){_i(),document.querySelectorAll('[em="group"] .em-element-editor, .em-element-path, .em-element-block-add').forEach(m=>{m.remove(),F(!1)})},document.addEventListener("mousedown",function(m){m.shiftKey||m.button===2||window.getSelection()?.removeAllRanges(),m.button===0&&(go=!0,a.state.set("isLeftButtonDown",!0))}),document.addEventListener("mouseup",function(m){m.button===0&&(go=!1,a.state.set("isLeftButtonDown",!1))}),document.addEventListener("dragend",function(m){m.button===0&&(go=!1,a.state.set("isLeftButtonDown",!1))});const l=()=>({parseFromString:a.parseFromString,HTMLDocument:j,commit:F,implementElementEditor:ki,setCursorPosition:ge,scrollTop:a.state.get("scrollTop")}),s=()=>({parseFromString:a.parseFromString,HTMLDocument:j,commit:F,implementElementEditor:ki,setCursorPosition:ge,scrollTop:a.state.get("scrollTop"),iframeOffsetTop:a.state.get("iframeOffsetTop"),applicationElementSettingsSet:ae});document.onclick=Lp({getLockEditor:()=>a.state.get("lockEditor"),setEditorFocus:Zp,setCursorPosition:ge,getParentElementOfSelection:a.getParentElementOfSelection$1,findOutermostParentWithText:a.findOutermostParentWithText,setBlockGroupControlsPosition:Eo,applicationElementSettingsSet:ae,insertTextAtomIntoEmptyNarrowTable:rg,handleRemoveAtom:m=>a.handleRemoveAtom(m,{getElementParent:hn,setCursorPosition:ge,getVariableByIcon:a.getVariableByIcon,commit:F}),handleCloneAtom:m=>a.handleCloneAtom(m,l()),handleMoveBlockUp:m=>a.handleMoveBlockUp(m,l()),handleMoveBlockDown:m=>a.handleMoveBlockDown(m,l()),handleRemoveBlock:m=>a.handleRemoveBlock(m,l()),handleCloneBlock:m=>a.handleCloneBlock(m,l()),handleCopyBlock:(m,f)=>Ap(m,f,{HTMLDocument:j}),handlePasteBlock:(m,f)=>Tp(m,f,{HTMLDocument:j,parseFromString:a.parseFromString,getOuterHtml:a.getOuterHtml,minify:a.minifyStylesheet,cssbeautify,insertAdjacentHTML:a.insertAdjacentHTML,setBlockMaxWidth:yt,setFloatBlocksWidth:Ge,checkBlockAdaptivity:Et,commit:F,setCursorPosition:ge,emailWidth:a.state.get("emailWidth"),appName:a.state.get("appName")}),handleMergeBlocks:m=>a.handleMergeBlocks(m,{...l(),emFilter:a.emFilter}),handleUnmergeBlocks:m=>a.handleUnmergeBlocks(m,l()),isAddBlockMenuClick:a.isAddBlockMenuClick,handleAddBlockMenu:(m,f)=>a.handleAddBlockMenu(m,f,{removeAllAttributes:a.removeAllAttributes,state:a.state,commitLockedAsync:zt}),addBlockToProject:sg,handleMoveGroupUp:m=>a.handleMoveGroupUp(m,s()),handleMoveGroupDown:m=>a.handleMoveGroupDown(m,s()),handleAddGroup:m=>a.handleAddGroup(m,s()),handleCloneGroup:m=>a.handleCloneGroup(m,s()),handleRemoveGroup:m=>a.handleRemoveGroup(m,s()),isDiscussViewMode:a.isDiscussViewMode,isDiscussSetTargetMode:a.isDiscussSetTargetMode,handleDiscussViewClick:a.handleDiscussViewClick,handleDiscussSetTargetClick:m=>a.handleDiscussSetTargetClick(m,{makeId:a.makeId,commit:F}),handleEmReplaceClick:(m,f)=>Es(m,f,{isClickAtEndOfEmReplace:a.isClickAtEndOfEmReplace,getOrCreateAfterSpan:a.getOrCreateAfterSpan,setCursorInsideSpan:a.setCursorInsideSpan,_wrapEditor:lt,commit:F}),handleCustomTableClick:hs}),document.addEventListener("mouseup",()=>{}),window.addEventListener("mousemove",function(){a.state.set("lockEditorInit",!1)}),document.addEventListener("keydown",Np({getCursorPositionType:a.getCursorPositionType,getListContext:a.getListContext,LIST_TEMP_CLASSES:a.LIST_TEMP_CLASSES,LIST_REGEX:a.LIST_REGEX,collectVMLContent:Ro,updateVMLComments:Po,handleVMLButtonText:a.handleVMLButtonText,handleDeleteKey:a.handleDeleteKey,handleEnterForBr:a.handleEnterForBr,handleEnterInList:ia,handleArrowRightInList:ca,handleArrowUpDownInList:sa,handleDeleteInList:da,handlePreventBulletCellEdit:ma,handleArrowRight:a.handleArrowRight,getElementParent:hn,setCursorPosition:ge,removeElementEditors:_i,getVariableByIcon:a.getVariableByIcon,removeEmptyParents:a.removeEmptyParents,getAllComments:a.getAllComments,isVariableComment:a.isVariableComment,getVariableIcon:a.getVariableIcon,removeAllAttributes:a.removeAllAttributes,applicationElementSettingsSet:ae,removeTemporaryListClasses:a.removeTemporaryListClasses,findNodeAtPosition:Vd,setCursorSafely:Ud,isCaretAtEndOfEmReplace:a.isCaretAtEndOfEmReplace,getOrCreateAfterSpan:a.getOrCreateAfterSpan,setCursorInsideSpan:a.setCursorInsideSpan,isCaretAtEndOfStandardElement:a.isCaretAtEndOfStandardElement,setCursorPositionSimple:a.setCursorPositionSimple,handlePasteTextFragment:Wr,changeMsoValue:Mi,getCommonStyles:()=>a.state.get("commonStyles"),setIsPasteFromContextMenu:m=>{fn=m},wrapEditor:lt,messageService:a.messageService,commit:F}),!1),oe.beforeCommit(()=>{try{un||(un=!0,a.emFilterCSS())}finally{un=!1}}),document.addEventListener("click",m=>{m.target?.closest(".em-element-editor-widget-clone")||(document.querySelectorAll('.em-element-editor-widget-clone[data-open="true"]').forEach(f=>{f.setAttribute("data-open","false"),f.querySelector("ul").style.display="none"}),lg())}),document.addEventListener("drag",function(m){m.preventDefault()},!1);const c={targetBlock:bt,atomReplaced:rt};document.addEventListener("dragstart",function(m){Id(m,{lockEditor:a.state.get("lockEditor")})},!0),document.addEventListener("dragstart",function(m){Gl(m,{lockEditor:a.state.get("lockEditor"),commit:F,messageService:a.messageService,mutableState:c}),rt=c.atomReplaced},!1);const d={targetBlock:bt};document.addEventListener("dragover",function(m){Kl(m,{lockEditor:a.state.get("lockEditor"),mutableState:d}),bt=d.targetBlock},!1);const u={targetBlock:bt};document.addEventListener("dragenter",function(m){Xl(m,{lockEditor:a.state.get("lockEditor"),mutableState:u}),bt=u.targetBlock},!1);const g={targetBlock:bt,newTargetblock:Ti};document.addEventListener("dragleave",function(m){Zl(m,{lockEditor:a.state.get("lockEditor"),mutableState:g}),Ti=g.newTargetblock},!1),document.addEventListener("drop",function(m){if(!a.state.get("lockEditor"))try{if(m.preventDefault(),m.stopPropagation(),jl(m,{lockEditor:a.state.get("lockEditor"),applicationElementSettingsSet:ae,messageService:a.messageService})||Od(m,{applicationElementSettingsSet:ae}))return a.state.increment("activeElementLocked"),to(),F(),!1;if(a.state.increment("activeElementLocked"),document.body.classList.contains("em-block-insert-body"))try{const f=JSON.parse(m.dataTransfer?.getData("Text")||"{}");Wn(m,f,{lockEditor:a.state.get("lockEditor"),state:a.state,commit:F,messageService:a.messageService,emailWidth:a.state.get("emailWidth"),parseFromString:a.parseFromString,getOuterHtml:a.getOuterHtml,isJsonString:a.isJsonString,isTableElement:a.isTableElement,insertAdjacentHTML:a.insertAdjacentHTML,minify:a.minifyStylesheet,cssbeautify,HTMLDocument:j,commonStylesApplyToBlock:Je,commonStylesApply:Ze,uptimeCountdown:Vt,setBlockMaxWidth:yt,setFloatBlocksWidth:Ge,checkBlockAdaptivity:Et,setImageWidth:at,insertCountdown:st,_setDocumentStyles:a.setDocumentStyles,applicationElementSettingsSet:ae,mutableState:{atomReplaced:rt}})}catch{}else if(document.body.classList.contains("em-atom-insert-body")||document.body.classList.contains("em-atom-insert-body-inside"))try{zn(m,{messageService:a.messageService,isJsonString:a.isJsonString,getOuterHtml:a.getOuterHtml,minify:a.minifyStylesheet,cssbeautify,HTMLDocument:j,_setDocumentStyles:a.setDocumentStyles,commonStylesApply:Ze,commonStylesApplyToBlock:Je,setImageWidth:at,setFloatBlocksWidth:Ge,insertCountdown:st,mutableState:{atomReplaced:rt}})}catch{}return to(),F(),!1}finally{Promise.resolve().then(()=>{a.state.decrement("activeElementLocked");const f=document.querySelector(".em-just-inserted");if(f){ae({elem:f}),f.classList.remove("em-just-inserted"),F();const p=wn(f);setTimeout(()=>{a.messageService.send({operation:"application_open-image-ai-popup",src:p})},1e3)}})}},!1),document.addEventListener("dragend",function(m){Yl(m,{lockEditor:a.state.get("lockEditor"),messageService:a.messageService})},!1),a.initResizer({applicationElementSettingsSet:m=>ae(m),setCursorPosition:m=>ge(m),commit:m=>F(m)}),document.addEventListener("contextmenu",m=>{fn=!!m.target?.nodeName}),document.addEventListener("paste",m=>{fn&&Wr(m,!1,a.state.get("commonStyles"),Mi,F)}),document.addEventListener("click",()=>a.messageService.send({operation:"application_focus_in_iframe"}))}var pg="__emmDiagnostics__",gg="diagnostics";function bg(){try{const e=new URLSearchParams(window.location.search).get(gg);return e!==null&&e!=="0"}catch{return!1}}function Sn(e){try{window.parent.postMessage({mark:pg,...e},"*")}catch{}}function hg(){const e=window.performance.getEntriesByType("resource").map(o=>{const t=o;return{name:t.name,initiatorType:t.initiatorType,startTime:t.startTime,responseEnd:t.responseEnd,transferSize:t.transferSize,decodedBodySize:t.decodedBodySize}});Sn({type:"resources",timeOrigin:window.performance.timeOrigin,items:e})}function St(){return window.performance.timeOrigin+window.performance.now()}function yg(){return Array.from(document.images).every(e=>e.complete)}function Eg(e,o){const n=window.setInterval(()=>{!yg()||St()-e()<500||(window.clearInterval(n),Sn({type:"settled",at:Math.max(e(),o)}),hg())},100)}function Sg(){if(!bg()||typeof MutationObserver!="function")return;let e=!1,o=St();new MutationObserver(()=>{o=St(),!e&&(e=!0,window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const t=St();Sn({type:"paint",at:t}),Eg(()=>o,t)})}))}).observe(document.documentElement,{childList:!0,subtree:!0,characterData:!0}),window.addEventListener("load",()=>{o=St()}),document.addEventListener("load",()=>{o=St()},!0)}var Cg=500,vg=300,Ut,So=!1;function Pi(){if(So)return;So=!0;let e=!1;const o=window.setTimeout(()=>{e||(e=!0,Ut=!1,So=!1)},vg);window.requestAnimationFrame(()=>{e||(e=!0,window.clearTimeout(o),Ut=!0,So=!1)})}function Ag(){return Ut===!1?(Pi(),Promise.resolve()):new Promise(e=>{let o=!1;const t=()=>{o||(o=!0,e())},n=window.setTimeout(()=>{Ut=!1,t()},Cg);window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{window.clearTimeout(n),Ut=!0,t()})})})}var Tg=1;function Lg(){Pi();const e=async(o,t)=>{await t?.(o),await Ag()};a.messageService.addListenerAsync(a.EVENT_TYPES.SANDBOX_INITED,e,Tg)}var wg=16;function Hi(e,o){return o===WheelEvent.DOM_DELTA_LINE?e*wg:o===WheelEvent.DOM_DELTA_PAGE?e*window.innerHeight:e}function kg(){let e=0,o=0,t=!1;const n=()=>{t=!1;const r=e,i=o;e=0,o=0,!(r===0&&i===0)&&a.messageService.send(a.EVENT_TYPES.SANDBOX_WHEEL,{deltaX:r,deltaY:i})};window.addEventListener("wheel",r=>{r.ctrlKey||(r.preventDefault(),e+=Hi(r.deltaX,r.deltaMode),o+=Hi(r.deltaY,r.deltaMode),t||(t=!0,window.requestAnimationFrame(n)))},{passive:!1})}Sg(),fg(),Lg(),kg()});
319
+ `);const l=e.querySelector('[em="block"]:last-child [em="atom"]');if(l){const s=l.querySelector("div");let c=null;s&&(s.innerHTML="",s.appendChild(document.createTextNode("​")),o.wrapEditor(s,!0),s.classList.add("em-just-inserted"),setTimeout(()=>{const d=s.closest("editor")||s,u=d?.querySelector("div")||s,g=u||d||s,m=g.getBoundingClientRect();["mouseover","mousedown","mouseup","click"].forEach(b=>{g.dispatchEvent(new MouseEvent(b,{bubbles:!0,cancelable:!0,view:window,clientX:m.left+Math.min(1,Math.max(0,m.width/2)),clientY:m.top+Math.min(1,Math.max(0,m.height/2)),button:0}))});let f=u.firstChild;f||(f=document.createTextNode("​"),u.appendChild(f)),d?.focus?.();const p=window.getSelection();if(p&&f){const b=document.createRange();b.setStart(f,0),b.collapse(!0),p.removeAllRanges(),p.addRange(b)}o.setCursorPosition(d||s)},0),c=s.closest("editor")||s),s&&o.setCursorPosition(c||s)}return o.messageService.send("application_atom_inserted","text"),o.commit(),!0}function Mp(e){return function(t){let n=t.target;try{n=e.getVisibleNode(n);const r=e.isInExternal(n);e.incrementActiveElementLocked();const i=document.body;if(i?.classList.contains("mceNonEditable")&&!i.classList.contains("em-sandbox-discuss")||i?.classList.contains("em-sandbox-discuss")&&!i.classList.contains("em-sandbox-discuss_set-target"))return;if(i?.classList.contains("em-sandbox-discuss_set-target")){document.querySelectorAll('[em-hover="true"]').forEach(u=>{u.removeAttribute("em-hover"),u.removeAttribute("contenteditable")}),n.closest(".em-element-vindent")||(n.setAttribute("em-hover","true"),n.setAttribute("contenteditable","true"));return}if(n.tagName!=="BODY"){const u=n.parentElement;a.unwrapForeignEditors(n)&&!n.isConnected&&u&&(n=u)}if(n&&(n?.closest('[em="atom"]')||!r)&&n.getAttribute("contenteditable")!=="false"&&n.parentElement?.getAttribute("contenteditable")!=="false"&&n.tagName!=="BODY"&&n.parentElement?.tagName!=="SECTION"){const u=!n.closest("editor"),g=!e.getLockEditorInit(),m=n.tagName!=="IMG",f=!(n.childElementCount===1&&n.firstElementChild?.tagName==="IMG"&&(n.textContent?.trim()??"")==="");if(u&&g&&m&&f){let p=n;do if(p=p.closest("div, p, h1, h2, h3, h4, h5")||p.closest("span, b, strong, i, em, s, a, sup, sub"),p)if(!e.isVisible(p))p=p.parentElement;else break;while(p);if(n.tagName==="LI"&&n.style.fontFamily&&n.style.fontSize){const b=n.closest("ul, ol");b&&e.wrapEditor(b,!0)}else if(n.tagName==="TD"&&n.style.fontFamily&&n.style.fontSize&&!n.querySelector("editor"))e.wrapEditor(n);else if(p&&p.style.fontFamily&&p.style.fontSize&&(n.tagName==="LI"||!n.querySelector("img")))if(n.tagName==="LI"){const b=n.closest("ul, ol");b&&e.wrapEditor(b,!0)}else n.querySelector("img")||e.wrapEditor(n,!0);else if(p&&p.closest('[style*="font-family"][style*="font-size"]')){const b=p.closest('[style*="font-family"][style*="font-size"]');b&&b.tagName!=="BODY"&&b.tagName!=="TD"&&b.tagName!=="TABLE"?e.wrapEditor(b,!1):b?.tagName==="TD"&&!b.querySelector("editor")&&!b.closest(".em-element-custom-table")&&e.wrapEditor(b)}else if(p&&p?.tagName==="DIV"&&!p.querySelector("table")){const b=!!p.style.height?.length,h=p.className.includes("em-element-img-change-group"),y=p.querySelector("img")?.parentNode,E=!!p.querySelector("img")&&y&&!e.hasTextNodeInElement(y);!b&&!h&&!E&&e.wrapEditor(p,!0)}else for(let b=0;b<n.childNodes.length;b++){const h=n.childNodes[b];if(h.nodeName==="#text"&&(h.textContent?.trim().length??0)>0&&!n.querySelector("table")){const y=n.tagName==="P"?n.parentElement:n;y&&e.wrapEditor(y);break}}}}(n?.closest('[em="atom"]')||!r)&&!e.getIsLeftButtonDown()&&e.implementElementsEditors(n),n?.classList.contains("em-element-vindent-bg")&&(n=n.closest(".em-vindent")),n?.closest(".em-gap")?n.closest("tr")?.querySelectorAll(".em-mob-wrap:nth-child(even) .em-gap").forEach(u=>u.classList.add("em-hover")):e.getIsLeftButtonDown()||document.querySelectorAll(".em-gap").forEach(u=>u.classList.remove("em-hover"));const l=e.getLoadStylesTimer(),s=!!n.style.padding||!!n.style.paddingTop||!!n.style.paddingBottom||!!n.style.paddingLeft||!!n.style.paddingRight,c=n.closest('[em="block"]'),d=!!c?.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")&&(c?.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").length??0)>2;l&&(n.tagName==="TD"&&(n.innerHTML===""||n.querySelector(".em-element-vindent"))&&n.getAttribute("height")||n.tagName==="DIV"&&n.style.height&&n.style.fontSize||n.tagName==="IMG"||s||d)&&e.implementResizableElems(n)}catch{}finally{Promise.resolve().then(()=>e.decrementActiveElementLocked())}}}function Rp(e){return function(t){const n=window.getSelection(),r=(n?.rangeCount?n.getRangeAt(0):null)?.commonAncestorContainer,i=r?.nodeType===1?r:r?.parentElement,l=i?.closest("editor"),s=window.navigator.platform.match("Mac"),c=l?e.getCursorPositionType(l):null,d=l?.closest("tr")?.querySelector("tr td:nth-of-type(2) div"),u=t.target,g=e.getListContext(u),{isList:m}=g,f=d?.textContent===l?.textContent,p=l?e.LIST_REGEX.EMPTY_TEXT.test(l.textContent||""):!1,b=s?t.metaKey:t.ctrlKey;if(b&&t.keyCode===83){t.preventDefault(),e.messageService.send({operation:"application_action",action:"save_email"});return}if(b&&t.keyCode===90){t.preventDefault(),e.messageService.send({operation:"application_action",action:t.shiftKey?"redo":"undo"});return}if(b&&t.keyCode===89&&!t.shiftKey){t.preventDefault(),e.messageService.send({operation:"application_action",action:"redo"});return}if(t.altKey&&t.keyCode===88){t.preventDefault(),e.messageService.send({operation:"application_action",action:"toggle_editor"});return}const h={getElementParent:e.getElementParent,setCursorPosition:e.setCursorPosition,removeElementEditors:e.removeElementEditors,getVariableByIcon:e.getVariableByIcon,removeEmptyParents:e.removeEmptyParents,getAllComments:e.getAllComments,isVariableComment:e.isVariableComment,getVariableIcon:e.getVariableIcon,commit:e.commit,messageService:e.messageService};if(e.handleDeleteKey(t,m,c,h))return;if(t.keyCode===27){const C=document.querySelector(".em-editor-wrapper");C?.style&&(C.style.display="none"),e.removeAllAttributes("em-edit"),document.querySelectorAll("editor").forEach(L=>L.blur()),n?.removeAllRanges(),e.applicationElementSettingsSet({elem:null}),e.messageService.send({operation:"application_close-image-edit-popup"});return}b&&t.keyCode===66&&(t.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_strong"}));const y=s?t.keyCode===88:t.keyCode===53;if((s?t.metaKey:t.altKey)&&t.shiftKey&&y&&(t.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_strikethrough"})),b&&t.shiftKey&&t.keyCode===76&&(t.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"textAlign_left"})),b&&t.shiftKey&&t.keyCode===82&&(t.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"textAlign_right"})),b&&t.shiftKey&&t.keyCode===69&&(t.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"textAlign_center"})),b&&t.keyCode===73&&(t.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_italic"})),b&&t.keyCode===85&&(t.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_underline"})),Ca(t,{commit:e.commit})||e.handleEnterForBr(t,l,m,f,{commit:e.commit}))return;if(b&&t.keyCode===86){e.setIsPasteFromContextMenu(!1);const C=L=>{e.handlePasteTextFragment(L,!1,e.getCommonStyles(),e.changeMsoValue,e.commit),document.removeEventListener("paste",C)};document.addEventListener("paste",C)}else e.changeMsoValue(t);const E={activeElem:l,listContext:g,cursorPositionType:c,isTargetCell:f,isEmptyText:p,commit:e.commit,wrapEditor:e.wrapEditor,removeTemporaryListClasses:e.removeTemporaryListClasses};if(e.handleEnterInList(t,E)||(e.handleArrowRightInList(t,c,p),e.handleArrowUpDownInList(t,E)))return;const S={...E,parentElement:i,findNodeAtPosition:e.findNodeAtPosition,setCursorSafely:e.setCursorSafely};if(e.handleDeleteInList(t,S)||e.handlePreventBulletCellEdit(t,m,f))return;const v={isCaretAtEndOfEmReplace:e.isCaretAtEndOfEmReplace,getOrCreateAfterSpan:e.getOrCreateAfterSpan,setCursorInsideSpan:e.setCursorInsideSpan,isCaretAtEndOfStandardElement:e.isCaretAtEndOfStandardElement,setCursorPositionSimple:e.setCursorPositionSimple,wrapEditor:e.wrapEditor,commit:e.commit};e.handleArrowRight(t,v)&&e.commit()}}var ne=e=>a.normalizeSpaces(e?.innerText);function Pp(e,o){return e.hasOwnProperty("textStrong")?{name:"textStrong",tags:["b","strong","a","[style*=font-weight]"],value:e.textStrong,command:"bold"}:e.hasOwnProperty("textItalic")?{name:"textItalic",tags:["em","i","[style*=font-style]","a"],value:e.textItalic,command:"italic"}:e.hasOwnProperty("textStrikethrough")?{name:"textStrikethrough",tags:["s","strike","u","[style*=text-decoration]","a"],value:e.textStrikethrough,command:"strikethrough"}:e.hasOwnProperty("textUnderline")?{name:"textUnderline",tags:["u","strike","[style*=text-decoration]","span","a"],value:e.textUnderline,command:"underline"}:e.hasOwnProperty("textColor")?{name:"textColor",tags:["a","[style*='color']","span"],value:o(e.textColor)||"",command:"foreColor"}:e.hasOwnProperty("textBackgroundColor")?{name:"textBackgroundColor",tags:["a","[style*='background-color']","[style*='color']","span"],value:o(e.textBackgroundColor)||"",command:"hilitecolor"}:e.hasOwnProperty("fontFamily")?{name:"fontFamily",tags:["[style*='font-family']","span","a"],value:e.fontFamily?.[e.fontFamily.length-1],command:"fontName"}:e.hasOwnProperty("textLink")?{name:"textLink",tags:["a","[href]","div","p","td"],value:e.textLink||"",command:"createLink"}:e.hasOwnProperty("fontSize")?{name:"fontSize",tags:["a","[style*='font-size']","span","div"],value:parseFloat(e.fontSize),command:"fontSize"}:e.hasOwnProperty("lineHeight")?{name:"lineHeight",tags:["div","[style*='line-height']","p","td"],value:parseFloat(e.lineHeight),command:null}:{}}var Hp=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,Ip=/^rgba?\s*\(\s*(?<r>\d+)\s*,\s*(?<g>\d+)\s*,\s*(?<b>\d+)\s*(?:,\s*(?<a>(?:0?\.)?\d+)\s*)?\)$/i,dn=e=>e.toString(16).padStart(2,"0");function Op(e){const o=Ip.exec(e)?.groups;if(!o)return;const t=Number.parseInt(o.r,10),n=Number.parseInt(o.g,10),r=Number.parseInt(o.b,10);if(![t,n,r].some(i=>!Number.isFinite(i)||i<0||i>255))return`#${dn(t)}${dn(n)}${dn(r)}`}function Ci(e){return e.split("").map(o=>`${o}${o}`).join("")}function We(e,o){if(!e)return;const t=e.trim();if(!t)return;if(Hp.test(t)){const r=t.slice(1);return r.length===3?`#${Ci(r).toLowerCase()}`:r.length===4?`#${Ci(r.slice(0,3)).toLowerCase()}`:r.length===8?`#${r.slice(0,6).toLowerCase()}`:`#${r.toLowerCase()}`}const n=Op(t);if(n)return n;if(o){const r=o(t);if(r&&r!==t)return We(r)}}function xp(e){const o=e.parentNode;if(o){for(;e.firstChild;)o.insertBefore(e.firstChild,e);o.removeChild(e)}}function mn(e,o,t){const n=o.parentElement;let r=e.parentElement;for(;r&&r!==n;){const i=We(r.style.color,t);if(i)return i;r=r.parentElement}}function Dp(e,o){Array.from(e.querySelectorAll("span")).reverse().forEach(t=>{if(!t.style.color)return;const n=We(t.style.color,o);if(!n)return;const r=mn(t,e,o);!r||r!==n||(t.style.removeProperty("color"),t.getAttribute("style")||t.removeAttribute("style"),t.attributes.length===0&&xp(t))})}function Fp(e){const o=e.commonAncestorContainer.nodeType===Node.ELEMENT_NODE?e.commonAncestorContainer:e.commonAncestorContainer.parentElement;if(!o)return[];if(e.commonAncestorContainer.nodeType===Node.TEXT_NODE){const r=e.commonAncestorContainer;return r.data.trim()?[r]:[]}const t=document.createTreeWalker(o,NodeFilter.SHOW_TEXT,null),n=[];for(;t.nextNode();){const r=t.currentNode;!r.data.trim()||!e.intersectsNode(r)||n.push(r)}return n}function qp(e,o,t){const n=We(o,t);if(!n)return!1;const r=window.getSelection();if(!r||r.rangeCount===0)return!1;const i=r.getRangeAt(0);if(i.collapsed||!i.toString().trim())return!1;const l=Fp(i);if(!l.length||l.every(d=>{const u=d.parentElement;return u?We(u.style.color,t)===n?!0:mn(u,e,t)===n:!1}))return!1;const s=document.createElement("span");s.style.color=o;try{i.surroundContents(s)}catch{s.appendChild(i.extractContents()),i.insertNode(s)}const c=document.createRange();return c.selectNodeContents(s),r.removeAllRanges(),r.addRange(c),!0}function Wp(e,o,t){const n=Array.from(e.querySelectorAll('a[style*="color"]'));e.tagName==="A"&&e.style.color&&n.unshift(e),n.forEach(r=>{const i=We(r.style.color,o);if(!i)return;const l=mn(r,e,o)||(t?We(t,o):void 0);l&&Array.from(r.querySelectorAll("span")).forEach(s=>{if(!s.style.color)return;const c=We(s.style.color,o);c&&c!==i&&c===l&&(s.style.color=r.style.color)})})}function $p(e){if(e.currentSettings.name!=="lineHeight")return!1;const o=e.parentElement.closest('[style*="line-height"]')||e.parentElement.closest("div, p, td");if(e.parentElement?.querySelector('[em-edit="active"]')){const t=[];e.checkForTextNodes(e.parentNode,t),t.forEach(n=>{const r=n.closest('[style*="line-height"]')||n.closest("div, p, td");r&&(r.style.lineHeight=e.currentSettings.value+"px")})}else if(e.isElementList){const t=!!e.parentElement.querySelector("div"),n=t?e.parentElement.closest("tr")?.querySelector(`.${e.classNameBullet}`):null;if(n&&(n.style.lineHeight=e.currentSettings.value+"px"),t){const r=e.parentElement.querySelector("div");r&&(r.style.lineHeight=e.currentSettings.value+"px")}else e.parentElement.style.lineHeight=e.currentSettings.value+"px"}else o&&(o.style.lineHeight=e.currentSettings.value+"px");return e.commit(),!0}function zp(e){if(e.currentSettings.name!=="fontFamily")return!1;let o=(e.findElementWithSelectedText(e.selectedText)||e.getParentElementOfSelection())?.closest('[style*="font-family"]')||e.parentWrapper;const t=!!e.parentElement?.querySelector('[em-edit="active"]');if(!t&&(!e.range?.collapsed||e.getSelectedText()))if(e.getInnerText(e.parentWrapper)===e.selectedText)o=e.parentWrapper;else if(e.getInnerText(e.parentElement)===e.selectedText)o=e.parentElement;else{const r=document.createElement("span");e.range.commonAncestorContainer.nodeType===3?e.range.surroundContents(r):(r.appendChild(e.range.extractContents()),e.range.insertNode(r)),o=r,e.range.deleteContents(),e.range.insertNode(o),e.range.selectNode(o),e.addNewRange(e.range)}e.fontFamilyArray?e.fontFamilyArray[0]==="Safe Fonts"?(o.style.fontFamily=e.fontFamilyArray[1],e.removeClassesByPrefix(o,"em-font"),e.clearLinkTags({elem:document.head})):e.fontFamilyArray[0]==="Google Fonts"&&(e.fontFamilyArray[1]==="Sans Serif"?o.style.fontFamily="Helvetica, Arial, sans-serif":e.fontFamilyArray[1]==="Serif"?o.style.fontFamily='"Times New Roman", Times, serif':e.fontFamilyArray[1]==="Project Fonts"&&a.applyProjectFontInlineFallback(o,e.fontFamilyArray[2]),e.removeClassesByPrefix(o,"em-font"),o.classList.add(e.createFontClassName(e.fontFamilyArray)),a.markProjectFontClass(o,e.fontFamilyArray),e.addFontFamilyClass({fontFamilyArray:e.fontFamilyArray})):o.style.removeProperty("font-family");let n;return t?(n=e.parentElement.querySelectorAll('[style*="font-family"]'),n.forEach(r=>r.style.fontFamily=o.style.fontFamily)):(n=o.querySelectorAll('[style*="font-family"]'),n.forEach(r=>r.style.fontFamily="")),e.cleanEmptySpans(e.selectedText),e.refreshElementSettings(o,e.selectedText),e.range.selectNode(o),e.addNewRange(e.range),e.commit(),!0}function Vp(e){if(e.currentSettings.command==="bold"){if(e.hasItalicClass&&e.tempStyleClass&&e.parentWrapper&&e.parentWrapper.classList.add(e.tempStyleClass),!e.isEditorTagOutside){const o=[];e.checkForTextNodes(e.parentNode,o),o.filter(t=>e.checkForWorkClass(t)).forEach(t=>{t.innerHTML=e.removeFormattingTags(t.innerHTML,"bold"),t.tagName!=="STRONG"?e.currentSettings.value&&(t.innerHTML="<strong>"+t.innerHTML+"</strong>"):e.currentSettings.value||(t.outerHTML=t.innerHTML)})}if(e.currentSettings.value===!0)Array.from(e.parentNode?.getElementsByTagName("b")||[]).reverse().forEach(o=>{const t=document.createElement("strong");if(t.innerHTML=o.innerHTML,o.parentNode?.replaceChild(t,o),e.getInnerText(t)===e.selectedText){const n=t.closest("span");n?.textContent===t.innerText&&!n.getAttribute("style")&&n.childNodes[0]?.nodeType===3&&n.parentNode?.replaceChild(t,n),e.refreshElementSettings(t,e.selectedText),e.range.selectNode(t),e.addNewRange(e.range)}});else if(Array.from(e.parentWrapper?.getElementsByTagName("b")||[]).reverse().forEach(o=>{const t=document.createElement("strong");t.innerHTML=o.innerHTML,o.parentNode?.replaceChild(t,o)}),e.getInnerText(e.parentWrapper)===e.selectedText){const o=e.parentWrapper||e.findElementWithSelectedText(e.selectedText,e.activeElement);o&&(e.range.selectNode(o),e.addNewRange(e.range))}e.cleanEmptySpans(e.selectedText)}}function Up(e){if(e.currentSettings.command==="italic"){if(e.hasItalicClass&&e.tempStyleClass&&e.parentWrapper&&e.parentWrapper.classList.add(e.tempStyleClass),!e.isEditorTagOutside){const o=[];e.checkForTextNodes(e.parentNode,o),o.filter(t=>e.checkForWorkClass(t)).forEach(t=>{t.innerHTML=e.removeFormattingTags(t.innerHTML,"italic"),t.tagName!=="EM"?e.currentSettings.value&&(t.innerHTML="<em>"+t.innerHTML+"</em>"):e.currentSettings.value||(t.outerHTML=t.innerHTML)})}if(e.currentSettings.value)Array.from(e.parentNode?.getElementsByTagName("i")||[]).reverse().forEach(o=>{const t=document.createElement("em");if(t.innerHTML=o.innerHTML,o.parentNode?.replaceChild(t,o),e.getInnerText(t)===e.selectedText){const n=t.closest("span");n?.textContent===t.innerText&&!n.getAttribute("style")&&n.childNodes[0]?.nodeType===3&&n.parentNode?.replaceChild(t,n),e.refreshElementSettings(t,e.selectedText),e.range.selectNode(t),e.addNewRange(e.range)}});else if(Array.from(e.parentElement?.getElementsByTagName("i")||[]).reverse().forEach(o=>{const t=document.createElement("em");t.innerHTML=o.innerHTML,o.parentNode?.replaceChild(t,o)}),e.getInnerText(e.parentWrapper)===e.selectedText){const o=e.parentWrapper||e.findElementWithSelectedText(e.selectedText,e.activeElement);o&&(e.range.selectNode(o),e.addNewRange(e.range))}e.cleanEmptySpans(e.selectedText)}}function jp(e){if(e.currentSettings.name!=="fontSize")return;const{mutableState:o}=e;if(e.getInnerText(o.parentWrapper)!==e.selectedText){let i=!1;const l=e.findParentWithFontSizeAndTag(e.activeElement||o.parentNode)||o.parentWrapper;l&&l.style.fontSize.length&&(i=l.style.fontSize,l.style.fontSize=""),document.execCommand("fontSize",!1,"1"),i&&l&&(l.style.fontSize=i);const s=window.getSelection()?.getRangeAt(0).commonAncestorContainer;o.parentElement=o.parentNode.querySelector('[size="1"]')||(s?.nodeType===1?s:s?.parentElement),o.parentElement&&(o.parentElement.style.fontSize=e.currentSettings.value+"px")}let t=null;if(o.parentElement?.tagName==="FONT"){const i=document.createElement("span");i.innerHTML=o.parentElement.innerHTML,o.parentElement.getAttribute("size")?(i.style.fontSize=e.currentSettings.value+"px",i.removeAttribute("size")):Array.from(o.parentElement.attributes).forEach(l=>i.setAttribute(l.name,l.value)),o.parentElement.parentNode?.replaceChild(i,o.parentElement),e.refreshElementSettings(i,e.selectedText),o.range.selectNode(i),e.addNewRange(o.range)}if((e.activeElement.tagName==="A"||e.activeElement.closest("a"))&&(o.parentWrapper=e.activeElement.closest("a")),e.getInnerText(o.parentWrapper)===e.selectedText){if(Array.from(o.parentWrapper?.getElementsByTagName("span")||[]).forEach(l=>l.style.fontSize=""),!o.parentWrapper?.hasAttribute("em-edit")&&e.isElementList&&o.parentWrapper&&e.isProgrammaticSelection){const l=o.parentWrapper.closest("tr")?.querySelector(`.${e.classNameBullet}`);l&&(l.style.fontSize=e.currentSettings.value+"px")}o.parentWrapper&&(o.parentWrapper.style.fontSize=e.currentSettings.value+"px");const i=o.parentWrapper?.firstChild;i?.nodeType===1&&i.tagName==="SPAN"&&i.innerText===e.selectedText&&(i.style.fontSize="")}else o.parentWrapper?.style.hasOwnProperty("font-size")&&(t=o.parentWrapper.style.fontSize,t&&o.parentWrapper.style.removeProperty("font-size"));t&&o.parentWrapper&&(o.parentWrapper.style.fontSize=t);const n=Array.from(o.parentNode?.querySelectorAll("font")||[]).reverse(),r=[];e.isEditorTagOutside?e.currentSettings.value||(o.selection=window.getSelection(),o.range=o.selection.getRangeAt(0),o.parentNode=o.selection.anchorNode?.nodeType===1?o.selection.anchorNode:o.selection.anchorNode?.parentElement,o.parentNode&&o.parentNode.style.removeProperty(e.currentStyle),e.cleanEmptySpans(e.selectedText)):(e.checkForTextNodes(o.parentNode,r),r.filter(i=>e.checkForWorkClass(i)).forEach(i=>{i.style.fontSize=e.currentSettings.value+"px",i.querySelectorAll('[style*="font-size"]').forEach(l=>{l.tagName!=="A"?l.style.removeProperty("font-size"):l.style.fontSize=e.currentSettings.value+"px"})})),e.isEditorTagOutside&&n.forEach(i=>{const l=document.createElement("span");l.innerHTML=i.innerHTML;const s=e.currentSettings.value+"px",c=i.children?.length===1&&i.firstChild?.nodeType===1?i.firstChild:null,d=[];if(e.checkForTextNodes(i,d),d.forEach(u=>{if(u.tagName==="FONT"){const g=document.createElement("span");g.innerHTML=u.innerHTML,u.getAttribute("size")?g.style.fontSize=e.getInnerText(u)===e.selectedText?s:"":Array.from(u.attributes).forEach(m=>g.setAttribute(m.name,m.value)),u.parentNode?.replaceChild(g,u)}}),c)i.parentNode?.replaceChild(c,i);else if(i.getAttribute("size")&&i.parentNode){const u=document.createElement("span");u.innerHTML=i.innerHTML,u.style.fontSize=s,i.parentNode.replaceChild(u,i)}if(!d.length&&i.tagName==="FONT"){const u=document.createElement("span");u.innerHTML=i.innerHTML,i.parentNode?.replaceChild(u,i)}}),Array.from(document.getElementsByTagName("span")).reverse().forEach(i=>{e.getInnerText(i)===e.selectedText&&i.closest('[em-edit="active"]')&&(e.refreshElementSettings(i,e.selectedText),o.range.selectNode(i),e.addNewRange(o.range))}),e.cleanEmptySpans(e.selectedText)}function Gp(e){if(e.currentSettings.command!=="strikethrough")return;const{mutableState:o}=e;let t=e.getSelectedText(),n=null;if(!e.isEditorTagOutside){const r=[];e.checkForTextNodes(e.parentNode,r),r.filter(i=>e.checkForWorkClass(i)).forEach(i=>{i.innerHTML=e.removeFormattingTags(i.innerHTML,"strike"),i.tagName!=="STRIKE"?e.currentSettings.value&&(i.innerHTML="<strike>"+i.innerHTML+"</strike>"):e.currentSettings.value||(i.outerHTML=i.innerHTML)})}if(e.currentSettings.value===!0){let r=t;Array.from(document?.getElementsByTagName("strike")||[]).reverse().forEach(i=>{if(e.getInnerText(i)===r&&(e.getInnerText(i.parentNode)===r&&i.parentNode.tagName==="U"&&(i.parentNode.outerHTML=i.parentNode.innerHTML),n=e.findElementWithSelectedText(r),n)){const l=e.findOutermostParentWithText(n,"A");l&&(l.style.textDecoration="none"),e.refreshElementSettings(n,r),o.range.selectNode(n),e.addNewRange(o.range)}})}else{let r=t;if(e.cleanEmptySpans(r),e.getInnerText(o.parentWrapper)===r){const i=window.getSelection();if(n=e.findElementWithSelectedText(r,e.activeElement),n&&(o.range.selectNode(n),e.addNewRange(o.range),o.range.cloneContents())){const l=o.range.firstElementChild?o.range.firstElementChild:o.range.parentElement||o.range.commonAncestorContainer;l&&e.refreshElementSettings(l,r)}if(i&&i.rangeCount>0&&e.isElementList&&!n){const l=i.getRangeAt(0);let s=l.commonAncestorContainer;s.nodeType!==Node.ELEMENT_NODE&&(s=s.parentNode),s.querySelectorAll("strike").forEach(c=>{c.outerHTML=c.innerHTML}),s.style.textDecoration="none",s.querySelectorAll('span[style*="text-decoration"]').forEach(c=>{c.style.textDecoration=""}),e.refreshElementSettings(s,r),l.selectNodeContents(s),i.removeAllRanges(),i.addRange(l),e.addNewRange(l)}}}if(e.request.type==="button"||e.activeElement.tagName==="A"){e.request.type!=="button"&&e.activeElement.tagName==="A"&&(o.parentWrapper=e.activeElement);let r=t;if(e.getInnerText(o.parentWrapper)===r&&o.parentWrapper)o.parentWrapper.style.textDecoration=e.currentSettings.value?"line-through":"none",Array.from(o.parentWrapper.querySelectorAll('span[style*="text-decoration"]')).forEach(i=>i.style.textDecoration=""),o.parentWrapper.innerHTML=e.removeFormattingTags(o.parentWrapper.innerHTML,"strikeUnderline"),e.refreshElementSettings(o.parentWrapper,r),o.range.selectNode(o.parentWrapper),e.addNewRange(o.range);else{const i=o.selection.getRangeAt(0),l=document.createElement("span");l.style.textDecoration=e.currentSettings.value?"line-through":"none",e.activeElement.nodeType===1&&e.activeElement.tagName==="SPAN"?(e.activeElement.style.textDecoration=e.activeElement.style.textDecoration==="line-through"?"none":"line-through",Array.from(e.activeElement.querySelectorAll('span[style*="text-decoration"]')).forEach(s=>s.style.textDecoration=""),e.refreshElementSettings(e.activeElement,r)):(l.appendChild(i.extractContents()),Array.from(l.querySelectorAll('span[style*="text-decoration"]')).forEach(s=>s.style.textDecoration=""),i.insertNode(l),n=l,e.refreshElementSettings(l,r),e.addNewRange(i))}}if(o.range.cloneContents()){if(o.range=o.selection.getRangeAt(0),n&&e.getInnerText(n)===t)o.range.selectNode(n),e.addNewRange(o.range);else{const r=o.range.commonAncestorContainer,i=r.nodeType===1?r:r.parentElement,l=o.range.firstElementChild?o.range.firstElementChild:o.range.parentElement||i;l&&e.getInnerText(l)===t&&(o.range.selectNode(l),e.addNewRange(o.range))}n&&e.refreshElementSettings(n,t)}}function Yp(e){if(e.currentSettings.command!=="underline")return;const{mutableState:o}=e,t=r=>{const i=r.parentNode;if(i){for(;r.firstChild;)i.insertBefore(r.firstChild,r);i.removeChild(r)}},n=r=>{r.querySelectorAll("u").forEach(i=>{t(i)}),r.querySelectorAll('span[style*="text-decoration"], span[style*="text-decoration-line"]').forEach(i=>{i.style.removeProperty("text-decoration"),i.style.removeProperty("text-decoration-line"),i.getAttribute("style")||i.removeAttribute("style"),i.attributes.length===0&&t(i)})};if(!e.isEditorTagOutside){const r=[];e.checkForTextNodes(e.parentNode,r),r.filter(i=>e.checkForWorkClass(i)).forEach(i=>{i.innerHTML=e.removeFormattingTags(i.innerHTML,"underline"),i.tagName!=="U"?e.currentSettings.value&&(i.innerHTML="<u>"+i.innerHTML+"</u>"):e.currentSettings.value||(i.outerHTML=i.innerHTML)})}if(e.currentSettings.value){const r=Array.from(e.findOutermostParentWithText(e.parentElement)?.getElementsByTagName("u")||[]).reverse();r.push(...Array.from(e.findOutermostParentWithText(e.parentElement)?.querySelectorAll("a,span[style*=text-decoration]")||[]).reverse()),r.filter(i=>e.getInnerText(i)===e.selectedText).forEach(i=>{if(e.selectedText&&e.getInnerText(i)===e.selectedText){i.style.textDecoration="underline";const l=i.firstChild;l?.tagName==="STRIKE"&&e.getInnerText(l)===e.selectedText&&[...l.attributes].forEach(s=>{i.setAttribute(s.name,s.value),l.removeAttribute(s.name)}),e.cleanStrikesInElement(i,e.getParentElementOfSelection())}}),e.cleanEmptySpans(e.selectedText),e.getInnerText(e.parentElement)===e.selectedText&&e.cleanStrikesInElement(e.parentElement,e.getParentElementOfSelection())}else{const r=e.findElementWithSelectedText(e.selectedText,e.activeElement);if(!r&&e.isElementList){let i=null;const l=window.getSelection();if(l&&l.rangeCount>0){let c=l.getRangeAt(0).commonAncestorContainer;for(c.nodeType!==Node.ELEMENT_NODE&&(c=c.parentNode);c&&c!==e.activeElement&&!["DIV"].includes(c.tagName);)c=c.parentNode;c&&c.contains(e.activeElement)&&(i=c)}const s=i?e.findOutermostParentWithText(i,"A"):null;s&&(s.style.textDecoration="none"),e.getInnerText(o.parentWrapper)===e.selectedText&&i&&(e.refreshElementSettings(i,e.selectedText),o.range.selectNode(i),e.addNewRange(o.range))}else{const i=e.findOutermostParentWithText(r,"A");i&&(i.style.textDecoration="none"),e.getInnerText(o.parentWrapper)===e.selectedText&&r&&(e.refreshElementSettings(r,e.selectedText),o.range.selectNode(r),e.addNewRange(o.range))}}if(e.request.type==="button"||e.activeElement.tagName==="A")if(e.request.type!=="button"&&e.activeElement.tagName==="A"&&(o.parentWrapper=e.activeElement),e.getInnerText(o.parentWrapper)===e.selectedText&&o.parentWrapper)o.parentWrapper.style.textDecoration=e.currentSettings.value?"underline solid":"none",Array.from(o.parentWrapper.querySelectorAll('span[style*="text-decoration"]')).forEach(r=>r.style.textDecoration=""),e.cleanStrikesInElement(o.parentWrapper,e.getParentElementOfSelection());else{const r=o.selection.getRangeAt(0);if(e.activeElement.nodeType===1&&e.activeElement.tagName==="SPAN")e.currentSettings.value?e.activeElement.style.textDecoration="underline":(e.activeElement.style.removeProperty("text-decoration"),e.activeElement.style.removeProperty("text-decoration-line")),Array.from(e.activeElement.querySelectorAll('span[style*="text-decoration"]')).forEach(i=>i.style.textDecoration=""),e.activeElement.getAttribute("style")||e.activeElement.removeAttribute("style"),e.refreshElementSettings(e.activeElement,e.selectedText);else if(e.activeElement.tagName!=="A")if(e.currentSettings.value){const i=document.createElement("span");i.style.textDecoration="underline",i.appendChild(r.extractContents()),Array.from(i.querySelectorAll('span[style*="text-decoration"]')).forEach(l=>l.style.textDecoration=""),e.refreshElementSettings(i,e.selectedText),r.insertNode(i),e.addNewRange(r)}else{const i=r.extractContents(),l=document.createElement("span");l.appendChild(i),n(l);const s=document.createDocumentFragment();for(;l.firstChild;)s.appendChild(l.firstChild);r.insertNode(s),e.addNewRange(r)}}}function Kp(e){if(!e.isColorChange)return;const{mutableState:o}=e;let t=[];if(e.tempColor&&e.isEditorTagOutside&&o.parentWrapper&&(o.parentWrapper.style[e.stylePropretyName]=e.tempColor,!o.parentWrapper?.hasAttribute("em-edit")&&e.isElementList&&o.parentWrapper&&e.isProgrammaticSelection)){const l=o.parentWrapper.closest("tr")?.querySelector(`.${e.classNameBullet}`);l&&(l.style[e.stylePropretyName]=e.tempColor)}if(e.outerContextColor&&e.outerContextElement&&(e.outerContextElement.style.color=e.outerContextColor),e.getInnerText(o.parentWrapper)===e.selectedText&&o.parentWrapper){const l=e.rgbToHex(e.currentSettings.value?.toString())||"";if(e.currentStyle==="color"){const s=(e.parentElement||o.parentNode).closest("a");if(e.request.type==="button"||s)s&&(s.style.color=l,s.querySelectorAll('span[style*="color"]').forEach(c=>c.style.color=""));else{o.parentWrapper.style.color=l,e.canselExecCommand&&(e.setCustomColor(o.parentWrapper,e.stylePropretyName,e.currentSettings.value),o.range.selectNode(o.parentWrapper),e.addNewRange(o.range));const c=o.parentWrapper.firstChild;c?.nodeType===1&&c.tagName==="SPAN"&&e.getInnerText(c)===e.selectedText&&(c.style[e.stylePropretyName]="")}}else if(!e.canselExecCommand){const s=document.createElement("span");s.style[e.stylePropretyName]=l;const c=o.parentWrapper.firstChild;if(c?.nodeType===1&&c.tagName==="SPAN"&&e.getInnerText(c)===e.selectedText)c.style[e.stylePropretyName]=l;else{for(;o.parentWrapper.firstChild;)s.appendChild(o.parentWrapper.firstChild);o.parentWrapper.appendChild(s)}}o.parentWrapper.querySelectorAll(`span[style*="${e.stylePropretyName}"]`).forEach(s=>{s.innerText!==o.parentWrapper.innerText&&s.style.removeProperty(e.stylePropretyName)})}e.isEditorTagOutside?!e.currentSettings.value&&o.selection.isCollapsed&&(o.parentNode=o.selection.anchorNode?.nodeType===1?o.selection.anchorNode:o.selection.anchorNode?.parentElement,o.parentNode&&o.parentNode.style.removeProperty(e.stylePropretyName),e.cleanEmptySpans(e.selectedText)):(e.checkForTextNodes(o.parentNode,t),t.forEach(l=>{l.classList&&l.classList.contains(e.classNameBullet)||e.checkForWorkClass(l)&&(l.style[e.stylePropretyName]=e.currentSettings.value,l.querySelectorAll(`[style*="${e.stylePropretyName}"]`).forEach(s=>{s.tagName!=="A"?s.style.removeProperty(e.currentStyle):s.style[e.stylePropretyName]=e.currentSettings.value}))}));const n=Array.from(o.parentNode?.querySelectorAll("font")||[]).reverse();e.isEditorTagOutside&&n.forEach(l=>{const s=document.createElement("span");s.innerHTML=l.innerHTML;const c=l.getAttribute(e.currentStyle),d=e.rgbToHex(c||"").toString(),u=l.children.length===1&&l.firstChild?.nodeType===1?l.firstChild:null;let g=[];if(e.checkForTextNodes(l,g),g.forEach(m=>{if(m.tagName==="FONT"){const f=document.createElement("span");f.innerHTML=m.innerHTML,f.style[e.stylePropretyName]=d,m.parentNode?.replaceChild(f,m),e.refreshElementSettings(f,e.selectedText),o.range.selectNode(f),e.addNewRange(o.range)}else m.style[e.stylePropretyName]=d}),u)l.parentNode?.replaceChild(u,l);else if(l.getAttribute(e.currentStyle)&&l.parentNode){const m=document.createElement("span");m.innerHTML=l.innerHTML,m.style[e.stylePropretyName]=d;const f=l.closest("a");f&&f.innerText===l.innerHTML&&(f.style[e.stylePropretyName]=d),l.parentNode.replaceChild(m,l)}});const r=Array.from(o.parentWrapper?.getElementsByTagName("span")||[]).reverse();e.isEditorTagOutside&&r.forEach(l=>{l.style[e.stylePropretyName]=e.rgbToHex(l.style[e.stylePropretyName]),e.getInnerText(l)===e.selectedText&&e.canselExecCommand&&(e.setCustomColor(l,e.stylePropretyName,e.currentSettings.value),o.range.selectNode(l),e.addNewRange(o.range))});const i=o.parentWrapper||o.parentNode;e.currentStyle==="color"&&i&&(Wp(i,e.rgbToHex,e.outerContextColor||e.tempColor),Dp(i,e.rgbToHex)),i&&e.cleanEmptySpans(e.selectedText,i)}function Xp(e){const o=e.parentElement;if(!o)return!1;let t=e,n=o;for(;n;){const r=n.tagName;if(r==="TD"||r==="TH")return n.childElementCount!==1||n.firstElementChild!==t?!1:!Array.from(n.childNodes).some(i=>i.nodeType===Node.TEXT_NODE&&i.textContent?.trim()!=="");if(r==="SPAN"||r==="EDITOR"){if(n.childElementCount!==1||n.firstElementChild!==t||Array.from(n.childNodes).some(i=>i.nodeType===Node.TEXT_NODE&&i.textContent?.trim()!==""))return!1;t=n,n=n.parentElement;continue}return!1}return!1}function vi(e,o){const t=e.style.color?.trim();if(!t)return null;const n=We(t),r=We(o??"");return!n||n===r?null:t}function Zp(e){if(e.currentSettings.name!=="textLink")return;const{mutableState:o}=e;let t=o.parentNode.querySelector('a[href=" "]');if(e.isEditorTagOutside||(t=e.findOutermostParentWithText(e.activeElement,"a")),e.currentSettings.value){const n=e.findOutermostParentWithText(e.activeElement,"a")||e.findOutermostParentWithText(o.parentNode,"a")||e.findOutermostParentWithText(o.parentWrapper,"a");if(!(t||n))return;const r=e.commonStyles?.links?.underline===void 0||e.commonStyles?.links?.underline?"underline":"none";t||(t=n);const i=e.findOutermostParentWithText(t);if(i&&i!==t&&i!==o.parentWrapper&&["b","strong","a","em","i","s","strike","u","br","span"].includes(i?.tagName.toLowerCase())){const l=t.cloneNode(!1),s=t.innerHTML;t.parentNode&&(t.parentNode.innerHTML=s),l.appendChild(i.cloneNode(!0)),i.parentNode&&i.parentNode.replaceChild(l,i),t=l,o.range.selectNode(t),e.addNewRange(o.range)}if(t){t.setAttribute("target","_blank"),t.setAttribute("href","");const l=e.commonStyles?.links?.color||t.closest('[style*="color"]')?.style?.color||"";t.setAttribute("style",`color: ${l}; text-decoration: ${r};`),t.setAttribute("new","true"),e.refreshElementSettings(t,e.selectedText)}}else if(t=o.parentNode.closest("a")||o.parentNode.querySelector('a[em-edit="active"]')||e.findOutermostParentWithText(e.activeElement,"a"),t)if(t.style.fontFamily||t.style.fontSize){const n=Xp(t)?"div":"span",r=document.createElement(n);if(r.innerHTML=t.innerHTML,Array.from(t.attributes).forEach(l=>{l.name!=="href"&&l.name!=="target"&&l.name!=="color"&&r.setAttribute(l.name,l.value)}),!r.style.lineHeight){const l=t.closest('[style*="line-height"]');l?.style.lineHeight&&(r.style.lineHeight=l.style.lineHeight)}r.style.textDecoration="";const i=vi(t,e.commonStyles?.links?.color);if(i?r.style.color=i:r.style.color="",t.parentNode?.replaceChild(r,t),n==="div"){let l=r.parentElement;for(;l&&l.tagName!=="TD"&&l.tagName!=="TH";){const s=l.parentElement;if(!s)break;s.replaceChild(r,l),l=r.parentElement}}e.cleanEmptySpansWithParent(e.selectedText,r),e.refreshElementSettings(r,e.selectedText),o.range.selectNodeContents(r),e.addNewRange(o.range)}else{const n=vi(t,e.commonStyles?.links?.color);if(n){const r=document.createElement("span");for(r.style.color=n;t.firstChild;)r.appendChild(t.firstChild);t.parentNode?.replaceChild(r,t),o.range=document.createRange(),o.range.selectNodeContents(r)}else{const r=Array.from(t.childNodes);r.forEach(i=>{t.parentNode?.insertBefore(i,t)}),t.parentNode?.removeChild(t),o.range=document.createRange(),o.range.setStartBefore(r[0]),o.range.setEndAfter(r[r.length-1])}if(e.addNewRange(o.range),o.range.cloneContents()){o.range=o.selection.getRangeAt(0);const r=o.range.commonAncestorContainer,i=r.nodeType===1?r:r.parentElement,l=o.range.firstElementChild?o.range.firstElementChild:o.range.parentElement||i;l&&e.refreshElementSettings(l,e.selectedText)}}}var Jp=new Set(["textStrong","textItalic","textStrikethrough","textUnderline","textLink","textColor","textBackgroundColor"]);function Qp(e){const{commit:o,addNewRange:t,refreshElementSettings:n,findElementWithSelectedText:r,getParentElementOfSelection:i,findOutermostParentWithText:l,clearLinkTags:s,addFontFamilyClass:c,getIsProgrammaticSelection:d,getCommonStyles:u}=e;function g(E,S,v){const C=!!E&&!!S&&S.tagName==="DIV"&&E.tagName==="EDITOR"&&E.parentElement===S&&S.childElementCount===1&&S.firstElementChild===E&&!Array.from(S.childNodes).some(R=>R!==E&&R.nodeType===Node.TEXT_NODE&&!!R.textContent?.trim()),L=!!E&&E.childElementCount===0&&Array.from(E.childNodes).some(R=>R.nodeType===Node.TEXT_NODE&&!!R.textContent?.trim()),w=!!E&&ne(E).trim()===v.trim();if(!C||!L||!w||!E.hasAttribute("em-edit")||!S.parentNode)return;const A=S.parentNode,M=E.getAttribute("em-edit")||"active";for(;E.firstChild;)S.appendChild(E.firstChild);E.remove(),E.removeAttribute("em-edit"),S.setAttribute("em-edit",M),A.replaceChild(E,S),E.appendChild(S)}function m(E,S){try{return S.intersectsNode(E)}catch{const v=document.createRange();return v.selectNodeContents(E),S.compareBoundaryPoints(Range.END_TO_START,v)<0&&S.compareBoundaryPoints(Range.START_TO_END,v)>0}}function f(E){const S=E?.links||{},v=S.underline,C=S.color,L=typeof v=="boolean"?v?"underline":"none":"underline";return{color:typeof C=="string"&&C.trim()?C.trim():"inherit",textDecoration:L}}function p(E,S){if(!E||!S)return null;const v=S,C=Array.from(v.querySelectorAll("a"));v.tagName==="A"&&C.unshift(v);const L=typeof window<"u"&&window.Range?window.Range.START_TO_START:0,w=typeof window<"u"&&window.Range?window.Range.END_TO_END:2;for(const A of C){const M=document.createRange();M.selectNodeContents(A);const R=M.compareBoundaryPoints(L,E)<=0,$=M.compareBoundaryPoints(w,E)>=0;if(R&&$)return A}return null}function b(E,S,v){const C=Array.from(S?.getElementsByTagName("span")||[]).reverse();let L=!1;ne(S)===E&&C.length&&(L=!0),C.forEach(w=>{const A=w.getAttribute("style"),M=!!A&&A.trim().length>0;let R=Array.from(w.attributes).filter(J=>J.name!=="style");if(!M&&R.length===1&&R[0].name==="em-edit"&&w.parentElement&&!w.parentElement.hasAttribute("em-edit")){const J=w.getAttribute("em-edit")||"active";w.parentElement.setAttribute("em-edit",J),w.removeAttribute("em-edit"),R=Array.from(w.attributes).filter(_=>_.name!=="style")}const $=R.length>0;if(!M&&!$){const J=ne(w);if(w.childNodes.length===1&&w.childNodes[0].nodeType===3){const _=w.childNodes[0];w.parentNode?.replaceChild(_,w),v.isEditorTagOutside&&ne(S)!==E&&_.parentNode&&(v.range?.selectNode(_),t(v.range))}else{const _=Array.from(w.childNodes);_.forEach(G=>{w.parentNode?.insertBefore(G,w)}),E===J&&(v.range=document.createRange(),v.range.setStartBefore(_[0]),v.range.setEndAfter(_[_.length-1]),t(v.range)),w.parentNode?.removeChild(w)}}}),L&&(n(S,E),v.range.selectNode(S),t(v.range))}function h(E,S){if(E?.rangeCount>0){const v=E.getRangeAt(0),C=v.commonAncestorContainer;let L=v.startOffset,w=v.endOffset;for(;C.data&&L>0&&!/\s/.test(C.data[L-1]);)L--;for(;C.data&&w<C.length&&!/\s/.test(C.data[w]);)w++;S.setStart(C,L),S.setEnd(C,w),t(S)}}function y(E,S,v){E.innerHTML=E.innerHTML.replaceAll(/<\/?strike[^>]*>/gi,""),E.parentNode&&(v.selectNode(E),t(v),n(E,S))}return function(S,v){const C=Pp(v.settings,a.rgbToHex),L=v.settings.textColor??v.settings.textBackgroundColor;if(typeof L=="string"&&L.trim()!==""&&!a.rgbToHex(L))return!1;const w=a.getListContext(S),{classNameOl:A,classNameUl:M,classNameBullet:R,isListOL:$,isListUL:J,isList:_}=w;_&&w.tableElement?.querySelectorAll("tbody > tr > td:first-child")?.forEach(B=>{const K=B.querySelector(":scope > div")||B.querySelector(":scope > editor div");K&&K.classList.add(`${R}`)}),S?.querySelectorAll(".em-element-path").forEach(B=>B.remove());const G=Object.keys(v.settings)[0];let H=window.getSelection();if(!H||H.rangeCount===0){if(!S||!S.isConnected)return;const B=document.createRange();if(B.selectNodeContents(S),H=window.getSelection(),!H)return;H.removeAllRanges(),H.addRange(B)}let P=H.getRangeAt(0);const q=P.commonAncestorContainer;let O=q.nodeType===1?q:q.parentElement,Q=H.anchorNode?.nodeType===1?H.anchorNode:H.anchorNode?.parentElement,re=!1,x=a.getSelectedText();if(S||(S=H.anchorNode?.childNodes.length===1&&H.anchorNode.firstChild?.nodeType===1?H.anchorNode.firstChild:O,S.tagName==="EDITOR"&&(S=S.parentElement)),C.name==="textLink"&&C.value===""){const B=O?.closest?.("a, [href]")||null;B&&(P.selectNode(B),t(P),S=B)}if(C.name==="textUnderline"&&!C.value){let B=O.closest(["u","strike","[style*=text-decoration]","span","a"].find(K=>O?.closest(K))||"u");!B&&S?.tagName==="A"&&(B=S),B?.tagName==="A"&&(B.style.textDecoration="none",n(B,x),P.selectNode(B),t(P),S=B,re=!0)}let k=v.type==="button"?(S||Q)?.closest("a"):(S||Q)?.closest("a, div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub");const se=v.settings.fontFamily;let z=null;const ee=Array.from(k?.classList||[]).some(B=>(B.startsWith("em-font-")&&(z=B),B.startsWith("em-font-")&&B.includes(C.name==="textItalic"?"Italic":"Bold")));ee&&(C.name==="textItalic"||C.name==="textStrong")&&z&&k?.classList.remove(z);const Y={range:P,isEditorTagOutside:!1},ie=(B=a.getSelectedText(),K=k)=>{b(B,K,Y)},we=a.checkForWorkClass,ke=a.checkForTextNodes,Co=(B,K)=>{y(B,x,Y.range)};let Pe,fe;G==="textColor"?Pe=fe="color":G==="textBackgroundColor"&&(Pe="backgroundColor",fe="background-color");const Ae=v.settings.hasOwnProperty("textColor")||v.settings.hasOwnProperty("textBackgroundColor"),ce=!!O?.closest("editor")||ne(O)===x||ne(O.querySelector("editor"))===x;Y.isEditorTagOutside=ce,v.settings.hasOwnProperty("textColor")&&C.value&&document.execCommand("styleWithCSS",!1,"true");const He=a.setCustomColor,Ye=d(),_e=u();if($p({parentElement:O,parentNode:Q,parentWrapper:k,currentSettings:C,isElementList:_,classNameBullet:R,isEditorTagOutside:ce,selectedText:x,range:P,selection:H,checkForTextNodes:ke,commit:o,getInnerText:ne,getSelectedText:a.getSelectedText,addNewRange:t,refreshElementSettings:n,findElementWithSelectedText:r,getParentElementOfSelection:i,rgbToHex:a.rgbToHex})||zp({parentElement:O,parentNode:Q,parentWrapper:k,currentSettings:C,isElementList:_,classNameBullet:R,isEditorTagOutside:ce,selectedText:x,range:P,selection:H,checkForTextNodes:ke,commit:o,getInnerText:ne,getSelectedText:a.getSelectedText,addNewRange:t,refreshElementSettings:n,findElementWithSelectedText:r,getParentElementOfSelection:i,rgbToHex:a.rgbToHex,fontFamilyArray:se,removeClassesByPrefix:a.removeClassesByPrefix$1,createFontClassName:a.createFontClassName,clearLinkTags:s,addFontFamilyClass:c,cleanEmptySpans:ie}))return!1;const be=O.closest(C.tags.find(B=>O?.closest(B))||"span");(P?.collapsed||!a.getSelectedText())&&(C.value?C.value&&ce&&(v.type==="button"||S.tagName==="A"&&be?P.selectNodeContents(be):h(H,P)):be&&P.selectNodeContents(be)),(v.type==="button"||S.tagName==="A"||S?.closest("a"))&&a.getSelectedText()&&a.getSelectedText()!==ne(S)&&be&&(v.settings.hasOwnProperty("textLink")||v.settings.hasOwnProperty("textUnderline"))&&(P.selectNode(be),t(P),v.settings.hasOwnProperty("textUnderline")&&S.tagName==="A"&&(S.style.textDecoration=C.value?"underline":"none",re=!0)),H=window.getSelection(),P=H.getRangeAt(0),Y.range=P,x=a.getSelectedText(),Array.from(k?.querySelectorAll("span,div")||[]).reverse().forEach(B=>{B.getAttribute("style")===""&&B.removeAttribute("style"),B.hasAttribute("contenteditable")&&B.removeAttribute("contenteditable"),B.hasAttribute("em-edit")&&B.removeAttribute("em-edit"),B.hasAttribute("em-relative")&&B.removeAttribute("em-relative"),B.hasAttribute("class")&&(B.classList.remove("em-relative"),B.classList.length===0&&B.removeAttribute("class"))});let vo=null;Ae&&fe&&k?.style?.getPropertyValue?.(fe)?.trim()&&(ne(k)===x&&(k.style[Pe]=a.rgbToHex(C.value?.toString())||"",re=!0),Pe==="color"&&(O===k||S?.closest('[style*="color"]')===k)&&(vo=a.rgbToHex(k.style[fe]),k.style.removeProperty(fe),!k?.hasAttribute("em-edit")&&_&&k&&Ye&&k.closest("tr")?.querySelector(`.${R}`)?.style.removeProperty(fe)));let jt=null,Ke=null;if(Ae&&Pe==="color"&&k?.tagName==="A"){let B=k.parentElement;for(;B&&!["BODY","HTML","TD","TH"].includes(B.tagName);){const K=B.style.getPropertyValue("color")?.trim();if(K){jt=a.rgbToHex(K)||K,Ke=B,B.style.removeProperty("color");break}B=B.parentElement}}fe&&!(C.value.length===7||C.value.length===4)&&(re=!0),ce&&(!C.value&&C.name!=="fontSize"&&C.name!=="textLink"||C.value)&&(!(C.name==="textUnderline"||C.name==="textStrikethrough")||v.type!=="button")&&!re&&(C.name!=="fontSize"&&!Ae&&ne(k)===x?document.execCommand(C.command,!1,Ae?C.value:C.name==="textLink"?" ":void 0):ne(k)!==x&&(v.settings.hasOwnProperty("textColor")&&document.execCommand("styleWithCSS",!1,"true"),document.execCommand(C.command,!1,Ae?String(C.value):C.name==="textLink"?" ":void 0),v.settings.hasOwnProperty("textColor")&&C.value&&qp(k||O,String(C.value),a.rgbToHex))),x=a.getSelectedText();{const B={parentElement:O,parentNode:Q,parentWrapper:k,selection:H,range:P};jp({parentElement:O,parentNode:Q,parentWrapper:k,currentSettings:C,isElementList:_,classNameBullet:R,isEditorTagOutside:ce,selectedText:x,range:P,selection:H,checkForTextNodes:ke,commit:o,getInnerText:ne,getSelectedText:a.getSelectedText,addNewRange:t,refreshElementSettings:n,findElementWithSelectedText:r,getParentElementOfSelection:i,rgbToHex:a.rgbToHex,activeElement:S,hasItalicClass:ee,tempStyleClass:z,checkForWorkClass:we,removeFormattingTags:Ht,cleanEmptySpans:ie,mutableState:B,currentStyle:Pe,isProgrammaticSelection:Ye,findParentWithFontSizeAndTag:a.findParentWithFontSizeAndTag}),O=B.parentElement,Q=B.parentNode,k=B.parentWrapper,H=B.selection,P=B.range,Y.range=P}Vp({parentElement:O,parentNode:Q,parentWrapper:k,currentSettings:C,isElementList:_,classNameBullet:R,isEditorTagOutside:ce,selectedText:x,range:P,selection:H,checkForTextNodes:ke,commit:o,getInnerText:ne,getSelectedText:a.getSelectedText,addNewRange:t,refreshElementSettings:n,findElementWithSelectedText:r,getParentElementOfSelection:i,rgbToHex:a.rgbToHex,activeElement:S,hasItalicClass:ee,tempStyleClass:z,checkForWorkClass:we,removeFormattingTags:Ht,cleanEmptySpans:ie}),Up({parentElement:O,parentNode:Q,parentWrapper:k,currentSettings:C,isElementList:_,classNameBullet:R,isEditorTagOutside:ce,selectedText:x,range:P,selection:H,checkForTextNodes:ke,commit:o,getInnerText:ne,getSelectedText:a.getSelectedText,addNewRange:t,refreshElementSettings:n,findElementWithSelectedText:r,getParentElementOfSelection:i,rgbToHex:a.rgbToHex,activeElement:S,hasItalicClass:ee,tempStyleClass:z,checkForWorkClass:we,removeFormattingTags:Ht,cleanEmptySpans:ie});const Ct={parentWrapper:k,range:P,selection:H};Gp({parentElement:O,parentNode:Q,parentWrapper:k,currentSettings:C,isElementList:_,classNameBullet:R,isEditorTagOutside:ce,selectedText:x,range:P,selection:H,checkForTextNodes:ke,commit:o,getInnerText:ne,getSelectedText:a.getSelectedText,addNewRange:t,refreshElementSettings:n,findElementWithSelectedText:r,getParentElementOfSelection:i,rgbToHex:a.rgbToHex,activeElement:S,hasItalicClass:ee,tempStyleClass:z,checkForWorkClass:we,removeFormattingTags:Ht,cleanEmptySpans:ie,request:v,findOutermostParentWithText:l,mutableState:Ct}),k=Ct.parentWrapper,P=Ct.range,Y.range=P;const Cn={parentWrapper:k,range:P,selection:H};if(Yp({parentElement:O,parentNode:Q,parentWrapper:k,currentSettings:C,isElementList:_,classNameBullet:R,isEditorTagOutside:ce,selectedText:x,range:P,selection:H,checkForTextNodes:ke,commit:o,getInnerText:ne,getSelectedText:a.getSelectedText,addNewRange:t,refreshElementSettings:n,findElementWithSelectedText:r,getParentElementOfSelection:i,rgbToHex:a.rgbToHex,activeElement:S,hasItalicClass:ee,tempStyleClass:z,checkForWorkClass:we,removeFormattingTags:Ht,cleanEmptySpans:ie,request:v,findOutermostParentWithText:l,cleanStrikesInElement:Co,mutableState:Cn}),k=Cn.parentWrapper,C.value===!1&&k){const B=window.getSelection(),K=B&&B.rangeCount>0?B.getRangeAt(0):P,Ie={textStrong:["strong","b"],textItalic:["em","i"],textStrikethrough:["s","strike"],textUnderline:["u"]}[C.name];let ze=!1;Ie&&Ie.forEach(X=>{Array.from(k.getElementsByTagName(X)).reverse().forEach(he=>{if(!m(he,K))return;const Ve=ne(he);if(!Ve||Ve.trim().length===0)return;const de=he.parentElement;he.hasAttribute("em-edit")&&de&&!de.hasAttribute("em-edit")&&de.setAttribute("em-edit",he.getAttribute("em-edit")||"active"),he.outerHTML=he.innerHTML,ze=!0,g(de,k,x)})}),ze&&setTimeout(()=>{const X=document.querySelector("[em-edit]")||r(x)||(k?.isConnected?k:null);X&&n(X,x)},0)}if(C.value===!0&&k&&ce){const B={textStrong:"strong",textItalic:"em",textStrikethrough:"s",textUnderline:"u"},K={textStrong:["strong","b"],textItalic:["em","i"],textStrikethrough:["s","strike"],textUnderline:["u"]},Ie=B[C.name],ze=K[C.name];if(Ie&&ze&&x&&x.trim().length>0){const X=k,he=ze.some(Qe=>X.getElementsByTagName(Qe).length>0),Ve=(X.style?.textDecoration||"").toLowerCase(),de=(X.style?.textDecorationLine||"").toLowerCase(),Ne=Ve.includes("underline")||de.includes("underline"),me=Ve.includes("line-through")||de.includes("line-through"),vt=C.name==="textUnderline"&&Ne||C.name==="textStrikethrough"&&me,To=ne(X)===x;if(!he&&!vt&&To){const Qe=document.createElement(Ie);for(;X.firstChild;)Qe.appendChild(X.firstChild);X.appendChild(Qe);try{const Oe=document.createRange();Oe.selectNodeContents(Qe),t(Oe),P=Oe,Y.range=Oe}catch{}setTimeout(()=>{const Oe=document.querySelector("[em-edit]")||r(x)||(X.isConnected?X:null);Oe&&n(Oe,x)},0)}}}const W={parentWrapper:k,parentNode:Q,range:P,selection:H};Kp({parentElement:O,parentNode:Q,parentWrapper:k,currentSettings:C,isElementList:_,classNameBullet:R,isEditorTagOutside:ce,selectedText:x,range:P,selection:H,checkForTextNodes:ke,commit:o,getInnerText:ne,getSelectedText:a.getSelectedText,addNewRange:t,refreshElementSettings:n,findElementWithSelectedText:r,getParentElementOfSelection:i,rgbToHex:a.rgbToHex,isColorChange:Ae,tempColor:vo,outerContextColor:jt,outerContextElement:Ke,stylePropretyName:fe,currentStyle:Pe,canselExecCommand:re,isProgrammaticSelection:Ye,request:v,setCustomColor:He,checkForWorkClass:we,cleanEmptySpans:ie,mutableState:W}),k=W.parentWrapper,Q=W.parentNode;const pe={parentWrapper:k,parentNode:Q,range:P,selection:H};if(Zp({parentElement:O,parentNode:Q,parentWrapper:k,currentSettings:C,isElementList:_,classNameBullet:R,isEditorTagOutside:ce,selectedText:x,range:P,selection:H,checkForTextNodes:ke,commit:o,getInnerText:ne,getSelectedText:a.getSelectedText,addNewRange:t,refreshElementSettings:n,findElementWithSelectedText:r,getParentElementOfSelection:i,rgbToHex:a.rgbToHex,findOutermostParentWithText:l,activeElement:S,commonStyles:_e,cleanEmptySpansWithParent:ie,mutableState:pe}),P=pe.range,C.name==="textLink"&&C.value===!0&&ce&&k&&x?.trim().length>0){const B=pe.range||P,K=x.trim(),Ie=[...k?Array.from(k.querySelectorAll("a")):[],...k?.parentElement?Array.from(k.parentElement.querySelectorAll("a")):[]],ze=Ie.find(X=>ne(X)?.trim()===K)||Ie[0]||null;if(!(p(B,k)||p(B,k.parentElement)||ze)&&B&&!B.collapsed){const X=document.createElement("a"),{color:he,textDecoration:Ve}=f(_e);X.setAttribute("target","_blank"),X.setAttribute("href",""),X.setAttribute("new","true"),X.setAttribute("style",`color: ${he}; text-decoration: ${Ve};`);let de=!1;const Ne=k.querySelector("editor");if(Ne&&ne(Ne)===x&&Ne.querySelector("a")===null){for(;Ne.firstChild;)X.appendChild(Ne.firstChild);Ne.appendChild(X),de=!0}try{if(!de){const me=B.extractContents();me.childNodes.length>0&&(X.appendChild(me),B.insertNode(X),de=!0)}}catch{de=!1}if(!de&&ne(k)===x){for(;k.firstChild;)X.appendChild(k.firstChild);k.appendChild(X),de=!0}if(de){try{const me=document.createRange();me.selectNodeContents(X),t(me),P=me,pe.range=me,Y.range=me}catch{}n(X,x)}}}const vn=C.name==="textUnderline"&&!C.value;if((!Ae&&re||vn)&&ie(x),Jp.has(C.name)){const B=pe.parentWrapper||k||r(x)||i();B&&ie(x,B)}_&&O.querySelectorAll(`tr td:first-child > div.${R}, tr td:first-child > editor div.${R}`).forEach(B=>{B.classList.remove(`${R}`)});const Ao=r(x);Ao?.hasAttribute("em-edit")||Ao?.setAttribute("em-edit","active"),o()}}var ve=null,gt=!1,Ai=!1,Ue="",je="",bt=null,Ti=null,rt=null,un=!1,go=!1,fn=!1,oe,Xe,pn,it,$e,bo,j,ho,Li,gn,yo,$t,bn=".em-prevent-action",F,zt,lt,ht;function ge(e){return Id(e,{HTMLDocument:j,documentMapping:it,remoteDocument:Xe,messageService:a.messageService})}function eg(e){bo?.setEditorFocus(e)}function tg(e,o=a.getSelectedText()){let n=(i=>i?.nodeType===Node.ELEMENT_NODE?i:i?.parentElement||null)((typeof a.findElementWithSelectedText=="function"?a.findElementWithSelectedText(o,e):null)||e);if(!n||n.tagName==="EDITOR"&&(n=n.firstElementChild||null,!n))return;const r=a.state.get("activeElementLocked")>0;try{r&&a.state.decrement("activeElementLocked"),ae({elem:n})}finally{r&&a.state.increment("activeElementLocked")}}function og(e,o){const t=j.getRangeByElement(e,!0);t&&it.hasMappedReplacementRangeInRange(t)||$e.whenEditorLostFocus(()=>lt(e,o),"editor")}function ng(e){return a.prepareEditorHTML(e,a.parseFromString)}var rg=a.checkIsEditorInited;function wi(e=!1){jd({state:a.state,getEmailWidth:()=>a.state.get("emailWidth"),messageService:a.messageService,removeHiddenClasses:a.removeHiddenClasses,findGlobalHolder:yi,elMarkupHelper:ig,rgbToHex:a.rgbToHex,getSubject:Go,getPreheader:so,getUsedColors:Fr,commit:F,setGlobalHolder:o=>{ve=o}},e)}function ig(){tm(ve)}function lg(e){return nm(e,j)}function ag(e){return Bp(e,{getLockEditor:()=>a.state.get("lockEditor"),applyStylesToDocument:lg,commonStylesApply:Ze,commonStylesApplyToBlock:Je,setFloatBlocksWidth:Ge,appName:a.state.get("appName"),wrapEditor:lt,setCursorPosition:ge,messageService:a.messageService,commit:F})}function sg(e){Eu(e,{setBlockGroupControlsPosition:Eo,commit:F})}var ki=qt,_i=Wt;function cg(){return a.stickyCheck(F)}var dg=a.checkSandboxStyles,hn=a.getElementParent;function mg(e){return a.addBlockToProject(e,{HTMLDocument:j,messageService:a.messageService})}function Eo(){return a.setBlockGroupControlsPosition({scrollTop:a.state.get("scrollTop")})}function Ge(e){return a.setFloatBlocksWidth(e,oe)}function yt(e){return a.setBlockMaxWidth(e,oe)}var at=a.setImageWidth;function st(e){return a.insertCountdown(e,F)}var Vt=a.uptimeCountdown,Et=a.checkBlockAdaptivity;function yn(e){return a.addFontFamilyClass(e,F)}function En(e){a.clearLinkTags(e,o=>{F(o)}),Ni()}function Ni(){a.clearProjectFontFaces(e=>{F(e)})}function Ze(e){return a.commonStylesApply(e,F)}var Je=a.commonStylesApplyToBlock,ug=a.getStructureColumns,fg=a.getElementTdDiv,Bi=a.setStructureBlocksWidth;function pg(e){e=oe.getVisibleNode(e),a.implementResizableElems(e),$e.whenEditorLostFocus(()=>{e.isConnected})}function Mi({target:e}){return om({target:e},F)}var Ri;function gg(e){const o=["textStrong","textItalic","textStrikethrough","textUnderline","textColor","textBackgroundColor","textLink","lineHeight","fontSize","fontFamily"];try{a.state.increment("activeElementLocked");let t=e.data;t.settings=ho.escape(t.settings),Object.keys(t.settings)[0];let n=a.getActiveEditElement();const r=n;let i=r?.parentElement??null;for(;i&&!i.tagName.startsWith("AMP-");)i=i.parentElement;const l=r?.tagName??"",s=i&&r?Array.from(i.getElementsByTagName(l)).indexOf(r):-1,{classNameOl:c,classNameUl:d,isListOL:u,isListUL:g,isList:m}=a.getListContext(n),f=a.getListContainer(n);if(t.type==="img"||t.type==="countdown"||t.type==="video")jf(t.settings,{activeElement:n,getActiveEditElement:a.getActiveEditElement,setCursorPosition:ge,setElementBorder:a.setElementBorder,setElementBoxShadow:a.setElementBoxShadow,setElementBorderRadius:a.setElementBorderRadius,setElementMobileWidth:a.setElementMobileWidth,setElementMobileHeight:a.setElementMobileHeight,setElementMobileBorder:a.setElementMobileBorder,setElementMobileBorderRadius:a.setElementMobileBorderRadius,setElementMobileBoxShadow:a.setElementMobileBoxShadow,setElementMobileAlign:a.setElementMobileAlign,setElementMobileVerticalAlign:a.setElementMobileVerticalAlign,setElementShow:a.setElementShow});else if(t.type==="a")Gf(t.settings,{activeElement:n,textStyleProperties:o,toggleTextStyle:ht});else if(t.type==="table")Yu(t.settings,{activeElement:n,setElementBorder:a.setElementBorder,setElementBoxShadow:a.setElementBoxShadow,setElementBorderRadius:a.setElementBorderRadius,setElementMobileTableAlign:a.setElementMobileTableAlign,setElementMobileWidth:a.setElementMobileWidth,setElementMobileBorder:a.setElementMobileBorder,setElementMobileBorderRadius:a.setElementMobileBorderRadius,setElementMobileBoxShadow:a.setElementMobileBoxShadow,setElementMobileBackgroundColor:a.setElementMobileBackgroundColor,setElementMobileBackgroundImage:a.setElementMobileBackgroundImage,setElementMobileBackgroundPositionX:a.setElementMobileBackgroundPositionX,setElementMobileBackgroundPositionY:a.setElementMobileBackgroundPositionY,setElementMobileBackgroundRepeat:a.setElementMobileBackgroundRepeat,setElementMobileBackgroundSize:a.setElementMobileBackgroundSize,setElementShow:a.setElementShow});else if(t.type==="td"||t.type==="structure"||t.type==="group"||t.type==="column")Xu(t.settings,{activeElement:n,requestType:t.type,textStyleProperties:o,isElementListContainer:f,isProgrammaticSelection:{get value(){return gt},set value(b){gt=b}},setElementBorder:a.setElementBorder,setElementBoxShadow:a.setElementBoxShadow,setElementBorderRadius:a.setElementBorderRadius,setElementMobileWidth:a.setElementMobileWidth,setElementMobileHeight:a.setElementMobileHeight,setElementMobileBorder:a.setElementMobileBorder,setElementMobileBorderRadius:a.setElementMobileBorderRadius,setElementMobileBoxShadow:a.setElementMobileBoxShadow,setElementMobileAlign:a.setElementMobileAlign,setElementMobileTableAlign:a.setElementMobileTableAlign,setElementMobileVerticalAlign:a.setElementMobileVerticalAlign,setElementMobileDirection:a.setElementMobileDirection,setElementMobileBackgroundColor:a.setElementMobileBackgroundColor,setElementMobileBackgroundImage:a.setElementMobileBackgroundImage,setElementMobileBackgroundPositionX:a.setElementMobileBackgroundPositionX,setElementMobileBackgroundPositionY:a.setElementMobileBackgroundPositionY,setElementMobileBackgroundRepeat:a.setElementMobileBackgroundRepeat,setElementMobileBackgroundSize:a.setElementMobileBackgroundSize,setElementMobilePadding:a.setElementMobilePadding,setElementShow:a.setElementShow,setContrastBlock:a.setContrastBlock,setStructureBlocksWidth:Bi,toggleTextStyle:ht,removeEditorTags:a.removeEditorTags,addClassToSecondCell:a.addClassToSecondCell,wrapEditor:lt,addNewRange:a.addNewRange});else if(t.type==="button")Vu(t.settings,{activeElement:n,textStyleProperties:o,setElementBorder:a.setElementBorder,setElementBoxShadow:a.setElementBoxShadow,setElementBorderRadius:a.setElementBorderRadius,setElementMobileWidth:a.setElementMobileWidth,setElementMobileHeight:a.setElementMobileHeight,setElementMobileLineHeight:a.setElementMobileLineHeight,setElementMobileBorder:a.setElementMobileBorder,setElementMobileBorderRadius:a.setElementMobileBorderRadius,setElementMobileBoxShadow:a.setElementMobileBoxShadow,setElementMobileAlign:a.setElementMobileAlign,setElementMobileTableAlign:a.setElementMobileTableAlign,setElementMobileVerticalAlign:a.setElementMobileVerticalAlign,setElementMobileBackgroundColor:a.setElementMobileBackgroundColor,setElementMobileBackgroundImage:a.setElementMobileBackgroundImage,setElementMobileBackgroundPositionX:a.setElementMobileBackgroundPositionX,setElementMobileBackgroundPositionY:a.setElementMobileBackgroundPositionY,setElementMobileBackgroundRepeat:a.setElementMobileBackgroundRepeat,setElementMobileBackgroundSize:a.setElementMobileBackgroundSize,setElementMobilePadding:a.setElementMobilePadding,setElementMobileFontSize:a.setElementMobileFontSize,setElementShow:a.setElementShow,toggleTextStyle:ht,compareStrings:a.compareStrings});else if(t.type==="div")Gu(t.settings,{activeElement:n,setElementBorder:a.setElementBorder,setElementBoxShadow:a.setElementBoxShadow,setElementBorderRadius:a.setElementBorderRadius,setElementMobileWidth:a.setElementMobileWidth,setElementMobileHeight:a.setElementMobileHeight,setElementMobileBorder:a.setElementMobileBorder,setElementMobileBorderRadius:a.setElementMobileBorderRadius,setElementMobileBoxShadow:a.setElementMobileBoxShadow,setElementMobileAlign:a.setElementMobileAlign,setElementMobileVerticalAlign:a.setElementMobileVerticalAlign,setElementMobileDirection:a.setElementMobileDirection,setElementMobileBackgroundColor:a.setElementMobileBackgroundColor,setElementMobileBackgroundImage:a.setElementMobileBackgroundImage,setElementMobileBackgroundPositionX:a.setElementMobileBackgroundPositionX,setElementMobileBackgroundPositionY:a.setElementMobileBackgroundPositionY,setElementMobileBackgroundRepeat:a.setElementMobileBackgroundRepeat,setElementMobileBackgroundSize:a.setElementMobileBackgroundSize,setElementMobilePadding:a.setElementMobilePadding,setElementShow:a.setElementShow});else if(t.type==="vindent")Yf(t.settings,{activeElement:n,setElementMobileHeight:a.setElementMobileHeight});else if(t.type==="var")Kf(t.settings,{activeElement:n,isVariableText:a.isVariableText});else if(t.type==="floatBlock")ef(t.settings,{activeElement:n,setElementMobileWidth:a.setElementMobileWidth,setElementMobileContentWidth:a.setElementMobileContentWidth,setElementMobileVerticalAlign:a.setElementMobileVerticalAlign,setElementShow:a.setElementShow});else if(t.type==="text")Ff(t.settings,{activeElement:n,textStyleProperties:o,toggleTextStyle:ht,collectVMLContent:Ro,updateVMLComments:Po,removeClassesByPrefix:a.removeClassesByPrefix$1,createFontClassName:a.createFontClassName,addFontFamilyClass:yn,clearLinkTags:En,handleTextScriptSettings:bf,handleTextReplacer:hf,handleTextAnchor:Af,unwrapNestedTags:Ed,wrapInTag:Sd,unwrapTag:Cd,isRangeMatching:vd,splitWrapper:Ad,cleanEmptyTags:Td,applicationElementSettingsSet:ae,compareStrings:a.compareStrings,setElementMobileFontSize:a.setElementMobileFontSize,setElementMobileLineHeight:a.setElementMobileLineHeight,setElementMobileAlign:a.setElementMobileAlign,updateTableStyle:a.updateTableStyle,changeBullets:a.changeBullets,changeBulletsColor:a.changeBulletsColor,changeBulletsSize:a.changeBulletsSize,changeBulletsItalic:a.changeBulletsItalic,changeBulletsWeight:a.changeBulletsWeight,changeBulletsStrikethrough:a.changeBulletsStrikethrough,changeBulletsUnderline:a.changeBulletsUnderline,findElementWithSelectedText:a.findElementWithSelectedText,removeEditorTags:a.removeEditorTags,isElementList:m,isElementListOL:u,classNameOl:c,classNameUl:d,commit:F});else if(t.type==="floatBlocksWidths")tf(t.settings,{activeElement:n,setPercentsForColumns:a.setPercentsForColumns,setElementMobileHeight:a.setElementMobileHeight});else if(t.type==="floatBlocksPreset")of(t.settings,{activeElement:n,setPercentsForColumns:a.setPercentsForColumns,setElementMobileHeight:a.setElementMobileHeight});else if(t.type==="floatBlocksValign")nf(t.settings,{activeElement:n,setPercentsForColumns:a.setPercentsForColumns,setElementMobileHeight:a.setElementMobileHeight});else if(t.type==="floatBlocksGap")rf(t.settings,{activeElement:n,setPercentsForColumns:a.setPercentsForColumns,setElementMobileHeight:a.setElementMobileHeight});else if(t.type==="floatBlocksGapMobile")lf(t.settings,{activeElement:n,setPercentsForColumns:a.setPercentsForColumns,setElementMobileHeight:a.setElementMobileHeight});else if(t.type==="carousel")af(t.settings,{activeElement:n,HTMLDocument:j,parseFromString:a.parseFromString,setElementBorderRadius:a.setElementBorderRadius,commit:F});else if(t.type==="accordion")sf(t.settings,{activeElement:n,HTMLDocument:j,parseFromString:a.parseFromString,setElementBorderRadius:a.setElementBorderRadius,commit:F});else if(t.type==="social"){const b=gf(t.settings,{activeElement:n,parseFromString:a.parseFromString,commit:F});b&&(n=b)}else t.type==="customTable"&&Tf(t.settings,{activeElement:n,activeCell:a.state.get("activeCell"),state:a.state,parseTableElementToModel:Rt,tableModelToHtml:Se,updateTablePadding:$a,updateBackgroundPosition:za,removeStyleProperty:Qa,updateBorderRadius:ts,removeClassByPrefix:rs,getCellsWithClasses:Ua,updateTableCellBackgroundByIds:ja,addClassToCellsByIds:Ga,getExternalBorders:Ka,mergeUniCells:is,updateCellBordersByIds:Ya,getExternalCorners:Za,updateCellBorderRadiusByIds:Xa,updateCellPaddingByIds:Ja,removeOuterBorders:os,simplifyBorders:ns,wrapEditor:lt,addNewRange:a.addNewRange,toggleTextStyle:ht,textStyleProperties:o,commit:F,setElementMobileWidth:a.setElementMobileWidth,setElementMobileHeight:a.setElementMobileHeight,setElementShow:a.setElementShow,setElementMobileBackgroundColor:a.setElementMobileBackgroundColor,setElementMobileBackgroundImage:a.setElementMobileBackgroundImage,setElementMobileBackgroundPositionX:a.setElementMobileBackgroundPositionX,setElementMobileBackgroundPositionY:a.setElementMobileBackgroundPositionY,setElementMobileBackgroundRepeat:a.setElementMobileBackgroundRepeat,setElementMobileBackgroundSize:a.setElementMobileBackgroundSize,setElementMobileBoxShadow:a.setElementMobileBoxShadow,setElementMobileBorder:a.setElementMobileBorder,setElementMobileBorderRadius:a.setElementMobileBorderRadius});try{a.emFilterCSS()}catch{}a.state.increment("activeElementLocked");const p=n;zt().finally(()=>{const b=j.getMappedParent(n);if(b?.isConnected){const h=b,y=h.tagName.startsWith("AMP-"),E=y&&h===i&&s>=0,S=y?Array.from(h.querySelectorAll("section"),A=>A.hasAttribute("expanded")):[],v=oe.getOuterHtml(b),C=a.parseFromString(v)[0];b.parentNode?.replaceChild(C,b);const L=C,w=E?L.getElementsByTagName(l)[s]??null:null;if(w)w.setAttribute("em-edit","active"),n=w;else if(p?.tagName==="A"&&C.tagName!=="A"){const A=C.querySelector?.("a");A?(A.setAttribute("em-edit","active"),n=A):(C.setAttribute("em-edit","active"),n=C)}else C.setAttribute("em-edit","active"),n=C;zt().finally(()=>{L.querySelectorAll("section").forEach((A,M)=>{S[M]&&A.setAttribute("expanded","")}),a.state.decrement("activeElementLocked"),ge(n)})}else a.state.decrement("activeElementLocked"),ge(n)})}catch{}finally{Promise.resolve().then(()=>a.state.decrement("activeElementLocked"))}}function ae(e){if(!a.state.isActiveElementLocked()){if(!e.elem){const o=document.querySelector("[em-edit]");o&&(e.elem=o)}try{a.state.increment("activeElementLocked"),a.removeAllAttributes("em-edit");let o={};if(e.elem){if(e.elem.closest?.(bn))return;e.elem=ep(e.elem,{getVariableByIcon:a.getVariableByIcon,htmlDocument:oe,findOutermostParentWithText:a.findOutermostParentWithText,sendResizeEvent:a.sendResizeEvent});const t=e.elem.tagName==="EDITOR"&&e.elem.firstChild?.nodeType===1?e.elem.firstChild:e.elem,{classNameOl:n,classNameUl:r,isListOL:i,isListUL:l,isList:s}=a.getListContext(e.elem),c=s?a.getListBullet(e.elem):null,d=!!e.elem.closest(".em-element-custom-table"),u=a.getLineHeightInPixels,g=E=>a.getFontFamilyFromElement(E,t),m=a.textHasStyle,f=(E,S=!1)=>Qf(S,{getSelectedText:a.getSelectedText,getRangeFromSelection:a.getRangeFromSelection});Jf(e.elem,window.getSelection()?.isCollapsed??!0,!!e.elem.querySelector("editor"),{removeAllAttributes:a.removeAllAttributes}),o={operation:"application_element_settings_set",settings:{}};const p=tp({elem:e.elem,isCellCustomTable:d,listContext:{isListOL:i,isListUL:l,isList:s},requestElemBullet:c,variableElement:f},{...Ri,Locale:$t,isProgrammaticSelection:gt,getElementTdDiv:fg,getLineHeghtInPixels:u,getFontFamilyFromElement:g,textHasStyle:m,activeCell:a.state.get("activeCell"),CLASS_FOR_BASIC_CELL:a.CLASS_FOR_BASIC_CELL,requestElemWithStyle:t}),b=np(e.elem,window.getSelection()?.isCollapsed??!0,p);o.type=b.type,o.caption=b.caption,o.settings=b.settings;const h=Zf(e.elem,b,o,{removeAllAttributes:a.removeAllAttributes});if(h.isProgrammaticSelectionReset&&(gt=!1),h.shouldReturn)return;const y=Xf({elem:e.elem,message:o,activateSection:e.activateSection},{getElementParentCaption:Xr,getStructureColumns:ug,getUsedColors:Fr,getElementPath:um,getCurrentElementPath:am,ampService:Li,mapObj:ho,commonStyles:a.state.get("commonStyles")});o=y.message,a.state.update({elementPath:y.elementPath})}else{setTimeout(()=>{let t=document.querySelector("[em-edit]");if(t?.isConnected){ae({elem:t});return}const n={operation:"application_element_settings_set",settings:ho.unescape({parent:void 0,nextElem:!1,prevElem:!1}),type:null};JSON.stringify(n),a.messageService.send(n)},0);return}JSON.stringify(o),Ue=e.elem?j.getOuterHtml(e.elem):"",je=Ot(e.elem),a.messageService.send(o)}finally{Promise.resolve().then(()=>{const o=document.querySelector("[em-edit]");Ue=o?j.getOuterHtml(o):"",je=Ot(o),a.state.decrement("activeElementLocked")})}}}function bg(){document.addEventListener("keydown",m=>{document.body?.classList.contains("mceNonEditable")||a.state.get("lockEditor")||!m.target?.closest?.('[contenteditable="true"]')||!m.key||m.ctrlKey||m.altKey||m.metaKey||m.key.length===1&&(m.preventDefault(),m.stopImmediatePropagation(),document.execCommand("insertText",!1,m.key))},!0);const e=m=>{const f=m.target,p=f?.closest?.("a")||f?.querySelector?.("a");if(!p)return;const b=p.closest("td")||p.parentElement;b&&a.findRoundrectComment(b)&&F(!1).then(()=>{!b.isConnected||!p.isConnected||(p.closest("editor")||p.querySelector("editor")||b.querySelector("editor"))&&a.updateButtonVMLLabel(b,p.textContent||"")&&F(!1)})};document.addEventListener("input",e,!1),document.addEventListener("focusout",m=>{a.handleVMLButtonInput(m)&&F(!1)},!1),a.state.update({isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1,actualTargetCount:0,activeCell:[],lockEditorInit:!0,globalHolder:null,applicationTheme:"light",iframeOffsetTop:0,scrollTop:0,previewHeight:0,applicationMode:"default",emailWidth:0,lockEdit:!1,elementPath:[],copyPasteEnabled:!0,saveBlockEnabled:!0,editImageControlEnabled:!0,elementAIimageEnabled:!0,imageCenterStockEnabled:!0,imageCenterGifEnabled:!0,imageCenterEditorEnabled:!0,blocksAddPanelEnabled:!0,lockEditor:!0,codeMode:!0,appName:"",commonStyles:{},isProgrammaticSelection:!1});let o=a.state.get("activeElementLocked");a.state.subscribe(m=>{if(m.activeElementLocked!==void 0){const f=o,p=m.activeElementLocked;o=p,f>0&&p===0&&Promise.resolve().then(()=>{if(a.state.get("activeElementLocked")!==0)return;const b=document.querySelector("[em-edit]");Ue=b?j.getOuterHtml(b):"",je=Ot(b)})}"globalHolder"in m&&(ve=m.globalHolder),"isProgrammaticSelection"in m&&(gt=m.isProgrammaticSelection)}),a.implementPolyfills(),setTimeout(()=>{Ai=!0},1e3),a.provideSandboxState(a.container);const t=a.provideAttributePipeline(a.container).pipeline,n=a.provideDocumentSync(a.container,Uc,{prepareHtml:m=>a.emFilter({node:m,isPartial:!0}),lock:{increment:()=>a.state.increment("activeElementLocked"),decrement:()=>a.state.decrement("activeElementLocked")}});oe=n.htmlDocument,Xe=n.remoteDocument,pn=n.textDocument,it=n.documentMapping,a.provideImageCache(a.container,{pipeline:t,htmlDocument:oe}),gn=a.provideEmVersion(a.container,{pipeline:t,htmlDocument:oe}).reload,n.onDocumentReplaced(()=>gn?.clear()),$c(),a.messageService.addListener(a.EVENT_TYPES.SANDBOX_IMAGE_RESET,({url:m})=>{m&&(a.container.getInstance(a.IMAGE_CACHE_ID)?.forget(m),gn?.reload(m))}),a.initDocuments({htmlDocument:oe,remoteDocument:Xe,textDocument:pn,documentMapping:it}),F=m=>n.commit(m),zt=m=>n.commitLockedAsync(m),bo=a.provideFocus(a.container,{htmlDocument:oe,remoteDocument:Xe}),$e=bo.controller,a.initFocusManager($e),a.attachFocusService(bo),j=oe,jc(),Qc(oe,$e),ed(oe,$e),a.registerCrossDomainDD(),a.registerThemeVariablesService(oe),a.registerProjectFontsService(),cd(Xe,m=>{F(m)}),id(oe,it,ge),a.registerCorrectVariableSelectionService(),a.registerResizeWatch(oe,Xe),a.registerResetService(oe),dd(oe,$e,Xe),a.registerExtensionScriptsService(oe),Li=a.provideAmp(a.container,oe).service,yo=a.registerLocalizationService(oe),md({container:a.container,focusController:$e,features:yd}),lm(yo),$t=yo.localized,yo.onChangeLocale(({data:m})=>{$t=m}),fu({getLocale:()=>$t,commit:m=>F(m)}),a.initSandboxStyles({textDocument:pn,commit:m=>F(m)}),a.initResizableElements({getLocale:()=>$t,commit:m=>F(m),messageService:a.messageService}),oe.onChange(m=>{m.some(f=>f.added.length||f.characterDataChanged||f.reordered?.length||f.reparented?.length)&&a.initSortable(j)}),ho=a.createMapObj(it),j.onChange(()=>{dg()}),oe.onRefresh(wi),j.onChange(m=>{for(const f of m)for(const p of f.removed)(p instanceof HTMLHeadElement||p instanceof HTMLLinkElement&&p.hasAttribute("em"))&&document.querySelector(".em-editor-wrapper")?.remove()});const r=new a.UpdateQueue;let i=0;j.onChange(m=>{for(const f of m)for(const p of f.added)r.add(p.parentElement?p.parentElement:p);i||(i=setTimeout(()=>{$e.whenEditorLostFocus(()=>{r.clear(),F(!1)}),i=0},1e3))}),j.onChange(a.createHandleChangesWithRemovedElementsOnly(ae)),j.onChange(()=>{if(a.state.get("activeElementLocked")>0)return;const m=document.querySelector("[em-edit]"),f=m?j.getOuterHtml(m):"",p=Ot(m);(Ue!==f||je!==p)&&(document.body&&!document.body.classList.contains("em-sandbox-discuss")?m?m.closest?.(bn)||(Ue=f,je=p,ae({elem:m})):setTimeout(()=>{let h=document.querySelector("[em-edit]");if(h){const y=j.getOuterHtml(h),E=Ot(h);(Ue!==y||je!==E)&&(Ue=y,je=E,h.closest?.(bn)||ae({elem:h}))}else Ue=f,je=p,ae({elem:null})},0):(Ue=f,je=p));const b=document.body;b&&((a.state.get("lockEdit")!==b.classList.contains("mceNonEditable")||a.state.get("lockEditor"))&&(a.state.get("lockEdit")||a.state.get("lockEditor")?b.classList.add("mceNonEditable"):b.classList.remove("mceNonEditable")),b.classList.toggle("em-sandbox-preview",a.state.get("previewPage")))}),ht=Qp({commit:F,addNewRange:a.addNewRange,refreshElementSettings:tg,findElementWithSelectedText:a.findElementWithSelectedText,getParentElementOfSelection:a.getParentElementOfSelection$1,findOutermostParentWithText:a.findOutermostParentWithText,clearLinkTags:En,addFontFamilyClass:yn,getIsProgrammaticSelection:()=>gt,getCommonStyles:()=>a.state.get("commonStyles")}),lt=a.createWrapEditor({removeHiddenClasses:a.removeHiddenClasses,checkIsInited:rg,prepareEditorHTML:ng,getVisibleText:a.getVisibleText,defaultVisibleTextMapFn:a.defaultVisibleTextMapFn,getTagNameForContainer:a.getTagNameForContainer,applyAttributesToTag:(m,f,p)=>a.applyAttributesToTag(m,f,p,a.rgbToHex),setCursorToElement:a.setCursorToElement,removeLastWord:a.removeLastWord,hasOnlyTextNodesDeep:a.hasOnlyTextNodesDeep,isRangeCoveringAllVisibleText:a.isRangeCoveringAllVisibleText,isEditorContentOnlyNbsp:a.isEditorContentOnlyNbsp$1,isClickAtEndOfEmReplace:a.isClickAtEndOfEmReplace,getOrCreateAfterSpan:a.getOrCreateAfterSpan,setCursorInsideSpan:a.setCursorInsideSpan,commit:F,createBeforeInputHandler:a.createBeforeInputHandler}),Ri={_isCarouselElement:gm,_isAccordionElement:hm,_isSocialBlockElement:Nm,_isImageElement:_n,_isLinkElement:Om,_isButtonElement:Im,_isTableElement:yl,_isCustomTableElement:ou,_isAtomElement:ru,_isTdColumnGroup:Gm,_isTdStructure:Ym,_isEmptyTd:Km,_isTdCell:Xm,_isVindentTd:qm,_isVindentDiv:Wm,_isFloatBlockElement:jm,_isDivTextElement:ul,_isInlineButtonElement:xm,_extractTextSettings:Zt,_extractCarouselSettings:fm,_extractAccordionSettings:bm,_extractSocialSettings:Bm,_extractImgSettings:Xt,_extractButtonSettings:Hm,_extractLinkTextSettings:fl,_extractTableSettings:hl,_extractCustomTableSettings:nu,_extractAtomElementSettings:au,_extractProgrammaticElementSettings:su,_extractTdColumnGroupSettings:Jm,_extractTdStructureSettings:Qm,_extractTdCellSettings:eu,_extractVindentSettings:$m,_extractFloatBlockSettings:Um,_extractDivContainerSettings:tu,_clearActiveEditElements:a.clearActiveEditElements,HTMLDocument:j,parseFromString:a.parseFromString,getParentElementOfSelection:a.getParentElementOfSelection$1,getSelectedText:a.getSelectedText,findElementWithSelectedText:a.findElementWithSelectedText,parseTableElementToModel:Rt,extractBorderRadius:es,parseBackgroundStyles:Va,isElementHasBold:a.isElementHasBold$1},qc(),Oc(ae),Lc(function(m){typeof ge=="function"&&ge(m)}),wc(function(m){wi(m)}),kc(function(m){a.state.set("commonStyles",m)}),_c(function(m){return hn(m)}),Nc(function(m){return a.getVariableByIcon(m)}),Bc(function(m){return Ld(m)}),Mc({getOuterHtml:function(m){return a.getOuterHtml(m)}}),Rc({increment:function(m){a.state.increment(m)},decrement:function(m){a.state.decrement(m)}}),Pc(function(m){a.setPercentsForColumns(m)}),Hc(function(){return a.getActiveEditElement()}),Ic(function(m){return a.parseFromString(m)}),a.state.subscribe(m=>{const f={};"iframeOffsetTop"in m&&(f.iframeOffsetTop=m.iframeOffsetTop),"previewHeight"in m&&(f.previewHeight=m.previewHeight),"emailWidth"in m&&(f.emailWidth=m.emailWidth),"elementPath"in m&&(f.elementPath=m.elementPath),"lockEdit"in m&&(f.lockEdit=m.lockEdit),Object.keys(f).length>0&&Dc(f)}),a.watchLockEditor(),a.messageService.addListener(function(m){if(m.data.operation=="update_position_from_editor"){let f=m.data.data;if(f){f=Xe.correctOffset(f,!0),f=it.correctOffset(f,!0);let p=j.getElementByPosition(f);if(p&&!(p instanceof Element)&&(p=p.parentElement),p){const b=p.getBoundingClientRect(),h=document.querySelector("[em-edit]");p.tagName!=="BODY"&&b.height&&b.width&&h!==p&&ae({elem:p});let y=p,E={operation:"application_scroll-to",settings:{value:a.state.get("applicationMode")==="default"?y.getBoundingClientRect().top+a.state.get("iframeOffsetTop")-a.state.get("previewHeight")/2+y.getBoundingClientRect().height/2:y.getBoundingClientRect().top-a.state.get("previewHeight")/2+y.getBoundingClientRect().height/2}};a.messageService.send(E)}}}if(m.data.operation=="sandbox_email_settings_set"){let f=m.data;if(ve=yi(),ve){const h=ve.classList.contains("full-wrap")?ve.querySelector("td"):ve;h&&a.setEmailBackgroundSettings(h,f.settings,jo())}f.settings.subject!==void 0&&(document.title=f.settings.subject);const p=hp(f.settings,{globalHolder:ve,emailWidth:a.state.get("emailWidth"),state:a.state,findParentTr:a.findParentTr});Lp(f.settings,ve),ip(f.settings,{globalHolder:ve,commonStyles:a.state.get("commonStyles"),lockEditor:a.state.get("lockEditor"),removeClassesByPrefix:a.removeClassesByPrefix$1,createFontClassName:a.createFontClassName,addFontFamilyClass:yn,clearLinkTags:En,clearProjectFontFaces:Ni,rgbToHex:a.rgbToHex,setElementBorder:a.setElementBorder,setElementBorderRadius:a.setElementBorderRadius,setStructureBlocksWidth:Bi,messageService:a.messageService});const b=Object.keys(f.settings).filter(h=>f.settings[h]!==void 0);(p||!(b.length===1&&b[0]==="width"))&&zt()}m.data.operation==="sandbox_element_settings_set"&&$e.whenEditorLostFocus(()=>gg(m)),(m?.data?.operation??m?.operation)==="sandbox_native-image-drop-clear"&&qn(),m.data.operation==="sandbox_window-characteristic"&&$u(m.data.settings,m.data.mode,{state:a.state,previewHeight:a.state.get("previewHeight"),iframeOffsetTop:a.state.get("iframeOffsetTop"),scrollTop:a.state.get("scrollTop"),globalHolder:ve,setBlockGroupControlsPosition:Eo,messageService:a.messageService}),m.data.operation=="sandbox_iframe-setsize"&&zu(m.data.settings,{state:a.state,previewHeight:a.state.get("previewHeight"),iframeOffsetTop:a.state.get("iframeOffsetTop"),scrollTop:a.state.get("scrollTop"),globalHolder:ve,setBlockGroupControlsPosition:Eo,messageService:a.messageService}),m.data.operation=="sandbox_atom-insert"&&Ou({action:m.data.action,atomHTML:m.data.settings?.atomHTML,name:m.data.settings?.name},{state:a.state,commit:F,lockEditor:a.state.get("lockEditor"),emailWidth:a.state.get("emailWidth"),iframeOffsetTop:a.state.get("iframeOffsetTop"),previewHeight:a.state.get("previewHeight"),parseFromString:a.parseFromString,getOuterHtml:a.getOuterHtml,HTMLDocument:j,minify:a.minifyStylesheet,cssbeautify,insertAdjacentHTML:a.insertAdjacentHTML,messageService:a.messageService,setDocumentStyles:f=>a.setDocumentStyles(f,{minify:a.minifyStylesheet,cssbeautify,HTMLDocument:j}),setImageWidth:at,commonStylesApply:Ze,commonStylesApplyToBlock:Je,insertCountdown:st,uptimeCountdown:Vt,setBlockMaxWidth:yt,setFloatBlocksWidth:Ge,fitImagesToColumns:a.fitImagesToColumns,checkBlockAdaptivity:Et,setAtomReplaced:f=>{rt=f}}),m.data.operation=="sandbox_block-insert"&&Fu({action:m.data.action,blockHTML:m.data.settings?.blockHTML,type:m.data.settings?.type,project:m.data.settings?.project,name:m.data.settings?.name,blockId:m.data.settings?.blockId},{state:a.state,commit:F,lockEditor:a.state.get("lockEditor"),emailWidth:a.state.get("emailWidth"),iframeOffsetTop:a.state.get("iframeOffsetTop"),previewHeight:a.state.get("previewHeight"),parseFromString:a.parseFromString,getOuterHtml:a.getOuterHtml,HTMLDocument:j,minify:a.minifyStylesheet,cssbeautify,insertAdjacentHTML:a.insertAdjacentHTML,messageService:a.messageService,setDocumentStyles:f=>a.setDocumentStyles(f,{minify:a.minifyStylesheet,cssbeautify,HTMLDocument:j}),setImageWidth:at,commonStylesApply:Ze,commonStylesApplyToBlock:Je,insertCountdown:st,uptimeCountdown:Vt,setBlockMaxWidth:yt,setFloatBlocksWidth:Ge,fitImagesToColumns:a.fitImagesToColumns,checkBlockAdaptivity:Et}),m.data.operation=="sandbox_global_block_replace"&&Du({emBlockId:m.data.settings?.emBlockId,blockHTML:m.data.settings?.blockHTML,type:m.data.settings?.type,project:m.data.settings?.project,name:m.data.settings?.name},{state:a.state,commit:F,lockEditor:a.state.get("lockEditor"),emailWidth:a.state.get("emailWidth"),iframeOffsetTop:a.state.get("iframeOffsetTop"),previewHeight:a.state.get("previewHeight"),parseFromString:a.parseFromString,getOuterHtml:a.getOuterHtml,HTMLDocument:j,minify:a.minifyStylesheet,cssbeautify,insertAdjacentHTML:a.insertAdjacentHTML,messageService:a.messageService,setDocumentStyles:f=>a.setDocumentStyles(f,{minify:a.minifyStylesheet,cssbeautify,HTMLDocument:j}),setImageWidth:at,commonStylesApply:Ze,commonStylesApplyToBlock:Je,insertCountdown:st,uptimeCountdown:Vt,setBlockMaxWidth:yt,setFloatBlocksWidth:Ge,fitImagesToColumns:a.fitImagesToColumns,checkBlockAdaptivity:Et})}),document.addEventListener("click",()=>{}),document.addEventListener("click",function(m){a.state.get("lockEditor")||Wu(m,{lockEditor:a.state.get("lockEditor"),commit:F,atomDropCtx:{messageService:a.messageService,isJsonString:a.isJsonString,getOuterHtml:a.getOuterHtml,minify:a.minifyStylesheet,cssbeautify,HTMLDocument:j,_setDocumentStyles:a.setDocumentStyles,commonStylesApply:Ze,commonStylesApplyToBlock:Je,setImageWidth:at,setFloatBlocksWidth:Ge,fitImagesToColumns:a.fitImagesToColumns,insertCountdown:st,mutableState:{atomReplaced:rt}},blockDropCtx:{lockEditor:a.state.get("lockEditor"),state:a.state,commit:F,messageService:a.messageService,emailWidth:a.state.get("emailWidth"),parseFromString:a.parseFromString,getOuterHtml:a.getOuterHtml,isJsonString:a.isJsonString,isTableElement:a.isTableElement,insertAdjacentHTML:a.insertAdjacentHTML,minify:a.minifyStylesheet,cssbeautify,HTMLDocument:j,commonStylesApplyToBlock:Je,commonStylesApply:Ze,uptimeCountdown:Vt,setBlockMaxWidth:yt,setFloatBlocksWidth:Ge,checkBlockAdaptivity:Et,setImageWidth:at,insertCountdown:st,_setDocumentStyles:a.setDocumentStyles,applicationElementSettingsSet:ae,mutableState:{atomReplaced:rt}}})},!0),document.onmouseover=Mp({getVisibleNode:m=>j.getVisibleNode(m),isInExternal:m=>j.isInExternal(m),isVisible:m=>oe.isVisible(m),incrementActiveElementLocked:()=>a.state.increment("activeElementLocked"),decrementActiveElementLocked:()=>a.state.decrement("activeElementLocked"),getLockEditorInit:()=>a.state.get("lockEditorInit"),getIsLeftButtonDown:()=>go,getLoadStylesTimer:()=>Ai,hasTextNodeInElement:a.hasTextNodeInElement,wrapEditor:og,implementElementsEditors:sg,implementResizableElems:pg,commit:F}),document.onmouseleave=function(){_i(),document.querySelectorAll('[em="group"] .em-element-editor, .em-element-path, .em-element-block-add').forEach(m=>{m.remove(),F(!1)})},document.addEventListener("mousedown",function(m){m.shiftKey||m.button===2||window.getSelection()?.removeAllRanges(),m.button===0&&(go=!0,a.state.set("isLeftButtonDown",!0))}),document.addEventListener("mouseup",function(m){m.button===0&&(go=!1,a.state.set("isLeftButtonDown",!1))}),document.addEventListener("dragend",function(m){m.button===0&&(go=!1,a.state.set("isLeftButtonDown",!1))});const l=()=>({parseFromString:a.parseFromString,HTMLDocument:j,commit:F,implementElementEditor:ki,setCursorPosition:ge,scrollTop:a.state.get("scrollTop")}),s=()=>({parseFromString:a.parseFromString,HTMLDocument:j,commit:F,implementElementEditor:ki,setCursorPosition:ge,scrollTop:a.state.get("scrollTop"),iframeOffsetTop:a.state.get("iframeOffsetTop"),applicationElementSettingsSet:ae});document.onclick=_p({getLockEditor:()=>a.state.get("lockEditor"),setEditorFocus:eg,setCursorPosition:ge,getParentElementOfSelection:a.getParentElementOfSelection$1,findOutermostParentWithText:a.findOutermostParentWithText,setBlockGroupControlsPosition:Eo,applicationElementSettingsSet:ae,insertTextAtomIntoEmptyNarrowTable:ag,handleRemoveAtom:m=>a.handleRemoveAtom(m,{getElementParent:hn,setCursorPosition:ge,getVariableByIcon:a.getVariableByIcon,commit:F}),handleCloneAtom:m=>a.handleCloneAtom(m,l()),handleMoveBlockUp:m=>a.handleMoveBlockUp(m,l()),handleMoveBlockDown:m=>a.handleMoveBlockDown(m,l()),handleRemoveBlock:m=>a.handleRemoveBlock(m,l()),handleCloneBlock:m=>a.handleCloneBlock(m,l()),handleCopyBlock:(m,f)=>wp(m,f,{HTMLDocument:j}),handlePasteBlock:(m,f)=>kp(m,f,{HTMLDocument:j,parseFromString:a.parseFromString,getOuterHtml:a.getOuterHtml,minify:a.minifyStylesheet,cssbeautify,insertAdjacentHTML:a.insertAdjacentHTML,setBlockMaxWidth:yt,setFloatBlocksWidth:Ge,checkBlockAdaptivity:Et,commit:F,setCursorPosition:ge,emailWidth:a.state.get("emailWidth"),appName:a.state.get("appName")}),handleMergeBlocks:m=>a.handleMergeBlocks(m,{...l(),emFilter:a.emFilter}),handleUnmergeBlocks:m=>a.handleUnmergeBlocks(m,l()),isAddBlockMenuClick:a.isAddBlockMenuClick,handleAddBlockMenu:(m,f)=>a.handleAddBlockMenu(m,f,{removeAllAttributes:a.removeAllAttributes,state:a.state,commitLockedAsync:zt}),addBlockToProject:mg,handleMoveGroupUp:m=>a.handleMoveGroupUp(m,s()),handleMoveGroupDown:m=>a.handleMoveGroupDown(m,s()),handleAddGroup:m=>a.handleAddGroup(m,s()),handleCloneGroup:m=>a.handleCloneGroup(m,s()),handleRemoveGroup:m=>a.handleRemoveGroup(m,s()),isDiscussViewMode:a.isDiscussViewMode,isDiscussSetTargetMode:a.isDiscussSetTargetMode,handleDiscussViewClick:a.handleDiscussViewClick,handleDiscussSetTargetClick:m=>a.handleDiscussSetTargetClick(m,{makeId:a.makeId,commit:F}),handleEmReplaceClick:(m,f)=>Cs(m,f,{isClickAtEndOfEmReplace:a.isClickAtEndOfEmReplace,getOrCreateAfterSpan:a.getOrCreateAfterSpan,setCursorInsideSpan:a.setCursorInsideSpan,_wrapEditor:lt,commit:F}),handleCustomTableClick:Es}),document.addEventListener("mouseup",()=>{}),window.addEventListener("mousemove",function(){a.state.set("lockEditorInit",!1)}),document.addEventListener("keydown",Rp({getCursorPositionType:a.getCursorPositionType,getListContext:a.getListContext,LIST_TEMP_CLASSES:a.LIST_TEMP_CLASSES,LIST_REGEX:a.LIST_REGEX,collectVMLContent:Ro,updateVMLComments:Po,handleVMLButtonText:a.handleVMLButtonText,handleDeleteKey:a.handleDeleteKey,handleEnterForBr:a.handleEnterForBr,handleEnterInList:aa,handleArrowRightInList:ma,handleArrowUpDownInList:da,handleDeleteInList:ua,handlePreventBulletCellEdit:fa,handleArrowRight:a.handleArrowRight,getElementParent:hn,setCursorPosition:ge,removeElementEditors:_i,getVariableByIcon:a.getVariableByIcon,removeEmptyParents:a.removeEmptyParents,getAllComments:a.getAllComments,isVariableComment:a.isVariableComment,getVariableIcon:a.getVariableIcon,removeAllAttributes:a.removeAllAttributes,applicationElementSettingsSet:ae,removeTemporaryListClasses:a.removeTemporaryListClasses,findNodeAtPosition:Gd,setCursorSafely:Yd,isCaretAtEndOfEmReplace:a.isCaretAtEndOfEmReplace,getOrCreateAfterSpan:a.getOrCreateAfterSpan,setCursorInsideSpan:a.setCursorInsideSpan,isCaretAtEndOfStandardElement:a.isCaretAtEndOfStandardElement,setCursorPositionSimple:a.setCursorPositionSimple,handlePasteTextFragment:Wr,changeMsoValue:Mi,getCommonStyles:()=>a.state.get("commonStyles"),setIsPasteFromContextMenu:m=>{fn=m},wrapEditor:lt,messageService:a.messageService,commit:F}),!1),oe.beforeCommit(()=>{try{un||(un=!0,a.emFilterCSS())}finally{un=!1}}),document.addEventListener("click",m=>{m.target?.closest(".em-element-editor-widget-clone")||(document.querySelectorAll('.em-element-editor-widget-clone[data-open="true"]').forEach(f=>{f.setAttribute("data-open","false"),f.querySelector("ul").style.display="none"}),cg())}),document.addEventListener("drag",function(m){m.preventDefault()},!1);const c={targetBlock:bt,atomReplaced:rt};document.addEventListener("dragstart",function(m){Dd(m,{lockEditor:a.state.get("lockEditor")})},!0),document.addEventListener("dragstart",function(m){Kl(m,{lockEditor:a.state.get("lockEditor"),commit:F,messageService:a.messageService,mutableState:c}),rt=c.atomReplaced},!1);const d={targetBlock:bt};document.addEventListener("dragover",function(m){Zl(m,{lockEditor:a.state.get("lockEditor"),mutableState:d}),bt=d.targetBlock},!1);const u={targetBlock:bt};document.addEventListener("dragenter",function(m){Jl(m,{lockEditor:a.state.get("lockEditor"),mutableState:u}),bt=u.targetBlock},!1);const g={targetBlock:bt,newTargetblock:Ti};document.addEventListener("dragleave",function(m){Ql(m,{lockEditor:a.state.get("lockEditor"),mutableState:g}),Ti=g.newTargetblock},!1),document.addEventListener("drop",function(m){if(!a.state.get("lockEditor"))try{if(m.preventDefault(),m.stopPropagation(),Yl(m,{lockEditor:a.state.get("lockEditor"),applicationElementSettingsSet:ae,messageService:a.messageService})||Fd(m,{applicationElementSettingsSet:ae}))return a.state.increment("activeElementLocked"),to(),F(),!1;if(a.state.increment("activeElementLocked"),document.body.classList.contains("em-block-insert-body"))try{const f=JSON.parse(m.dataTransfer?.getData("Text")||"{}");Wn(m,f,{lockEditor:a.state.get("lockEditor"),state:a.state,commit:F,messageService:a.messageService,emailWidth:a.state.get("emailWidth"),parseFromString:a.parseFromString,getOuterHtml:a.getOuterHtml,isJsonString:a.isJsonString,isTableElement:a.isTableElement,insertAdjacentHTML:a.insertAdjacentHTML,minify:a.minifyStylesheet,cssbeautify,HTMLDocument:j,commonStylesApplyToBlock:Je,commonStylesApply:Ze,uptimeCountdown:Vt,setBlockMaxWidth:yt,setFloatBlocksWidth:Ge,checkBlockAdaptivity:Et,setImageWidth:at,insertCountdown:st,_setDocumentStyles:a.setDocumentStyles,applicationElementSettingsSet:ae,mutableState:{atomReplaced:rt}})}catch{}else if(document.body.classList.contains("em-atom-insert-body")||document.body.classList.contains("em-atom-insert-body-inside"))try{zn(m,{messageService:a.messageService,isJsonString:a.isJsonString,getOuterHtml:a.getOuterHtml,minify:a.minifyStylesheet,cssbeautify,HTMLDocument:j,_setDocumentStyles:a.setDocumentStyles,commonStylesApply:Ze,commonStylesApplyToBlock:Je,setImageWidth:at,setFloatBlocksWidth:Ge,fitImagesToColumns:a.fitImagesToColumns,insertCountdown:st,mutableState:{atomReplaced:rt}})}catch{}return to(),F(),!1}finally{Promise.resolve().then(()=>{a.state.decrement("activeElementLocked");const f=document.querySelector(".em-just-inserted");if(f){ae({elem:f}),f.classList.remove("em-just-inserted"),F();const p=wn(f);setTimeout(()=>{a.messageService.send({operation:"application_open-image-ai-popup",src:p})},1e3)}})}},!1),document.addEventListener("dragend",function(m){Xl(m,{lockEditor:a.state.get("lockEditor"),messageService:a.messageService})},!1),a.initResizer({applicationElementSettingsSet:m=>ae(m),setCursorPosition:m=>ge(m),commit:m=>F(m)}),document.addEventListener("contextmenu",m=>{fn=!!m.target?.nodeName}),document.addEventListener("paste",m=>{fn&&Wr(m,!1,a.state.get("commonStyles"),Mi,F)}),document.addEventListener("click",()=>a.messageService.send({operation:"application_focus_in_iframe"}))}var hg="__emmDiagnostics__",yg="diagnostics";function Eg(){try{const e=new URLSearchParams(window.location.search).get(yg);return e!==null&&e!=="0"}catch{return!1}}function Sn(e){try{window.parent.postMessage({mark:hg,...e},"*")}catch{}}function Sg(){const e=window.performance.getEntriesByType("resource").map(o=>{const t=o;return{name:t.name,initiatorType:t.initiatorType,startTime:t.startTime,responseEnd:t.responseEnd,transferSize:t.transferSize,decodedBodySize:t.decodedBodySize}});Sn({type:"resources",timeOrigin:window.performance.timeOrigin,items:e})}function St(){return window.performance.timeOrigin+window.performance.now()}function Cg(){return Array.from(document.images).every(e=>e.complete)}function vg(e,o){const n=window.setInterval(()=>{!Cg()||St()-e()<500||(window.clearInterval(n),Sn({type:"settled",at:Math.max(e(),o)}),Sg())},100)}function Ag(){if(!Eg()||typeof MutationObserver!="function")return;let e=!1,o=St();new MutationObserver(()=>{o=St(),!e&&(e=!0,window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const t=St();Sn({type:"paint",at:t}),vg(()=>o,t)})}))}).observe(document.documentElement,{childList:!0,subtree:!0,characterData:!0}),window.addEventListener("load",()=>{o=St()}),document.addEventListener("load",()=>{o=St()},!0)}var Tg=500,Lg=300,Ut,So=!1;function Pi(){if(So)return;So=!0;let e=!1;const o=window.setTimeout(()=>{e||(e=!0,Ut=!1,So=!1)},Lg);window.requestAnimationFrame(()=>{e||(e=!0,window.clearTimeout(o),Ut=!0,So=!1)})}function wg(){return Ut===!1?(Pi(),Promise.resolve()):new Promise(e=>{let o=!1;const t=()=>{o||(o=!0,e())},n=window.setTimeout(()=>{Ut=!1,t()},Tg);window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{window.clearTimeout(n),Ut=!0,t()})})})}var kg=1;function _g(){Pi();const e=async(o,t)=>{await t?.(o),await wg()};a.messageService.addListenerAsync(a.EVENT_TYPES.SANDBOX_INITED,e,kg)}var Ng=16;function Hi(e,o){return o===WheelEvent.DOM_DELTA_LINE?e*Ng:o===WheelEvent.DOM_DELTA_PAGE?e*window.innerHeight:e}function Ii(e,o,t){if(t===0)return!1;const n=getComputedStyle(e),r=o==="y"?n.overflowY:n.overflowX;if(r!=="auto"&&r!=="scroll"&&r!=="overlay")return!1;const i=o==="y"?e.scrollTop:Math.abs(e.scrollLeft),l=o==="y"?e.scrollHeight-e.clientHeight:e.scrollWidth-e.clientWidth;return l<=0?!1:(o==="x"&&e.scrollLeft<0?-t:t)>0?i<l-.5:i>.5}function Oi(e,o,t){const n=document.scrollingElement??document.documentElement;for(let r=e instanceof Element?e:null;r;r=r.parentElement){if(r===n||r===document.body)return!1;if(Ii(r,"y",t)||Ii(r,"x",o))return!0}return!1}function Bg(){let e=0,o=0,t=!1;const n=()=>{t=!1;const l=e,s=o;e=0,o=0,!(l===0&&s===0)&&a.messageService.send(a.EVENT_TYPES.SANDBOX_WHEEL,{deltaX:l,deltaY:s})},r=(l,s)=>{e+=l,o+=s,t||(t=!0,window.requestAnimationFrame(n))};window.addEventListener("wheel",l=>{l.ctrlKey||Oi(l.target,l.deltaX,l.deltaY)||(l.preventDefault(),r(Hi(l.deltaX,l.deltaMode),Hi(l.deltaY,l.deltaMode)))},{passive:!1});let i;window.addEventListener("touchstart",l=>{const s=l.touches.length===1?l.touches[0]:void 0;i=s?{x:s.clientX,y:s.clientY}:void 0},{passive:!0}),window.addEventListener("touchmove",l=>{const s=l.touches.length===1?l.touches[0]:void 0;if(!s||!i){i=void 0;return}const c=i.x-s.clientX,d=i.y-s.clientY;i={x:s.clientX,y:s.clientY},!Oi(l.target,c,d)&&(l.cancelable&&l.preventDefault(),r(c,d))},{passive:!1})}Ag(),bg(),_g(),Bg()});