@jackuait/blok 0.7.2 → 0.7.3-beta.2

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 (238) hide show
  1. package/dist/blok.mjs +3 -3
  2. package/dist/chunks/{blok-3RuPZd3G.mjs → blok-Cv1zWiST.mjs} +2147 -2099
  3. package/dist/chunks/{constants-BkelccB1.mjs → constants-DWpV4hCh.mjs} +186 -58
  4. package/dist/chunks/{i18next-loader-qjweOJ-t.mjs → i18next-loader-D5HxE5ZQ.mjs} +1 -1
  5. package/dist/chunks/{lightweight-i18n-vbtPx5C4.mjs → lightweight-i18n-Safdy0ua.mjs} +0 -1
  6. package/dist/chunks/{messages-CjcSWeud.mjs → messages-1C3OS98e.mjs} +0 -1
  7. package/dist/chunks/{messages-3bOAVT3X2.mjs → messages-3ePgbbpx2.mjs} +0 -1
  8. package/dist/chunks/{messages-CG2xl0IV.mjs → messages-6EJxSImH.mjs} +0 -1
  9. package/dist/{messages-BjnJajTO2.mjs → chunks/messages-6z-ULVyk.mjs} +0 -1
  10. package/dist/{messages-B8jjwMLK.mjs → chunks/messages-BKtWlK39.mjs} +0 -1
  11. package/dist/chunks/{messages-CpnXbVOK2.mjs → messages-BM1Su_Uy2.mjs} +0 -1
  12. package/dist/{messages-DZo0x7Bd.mjs → chunks/messages-BUy3odZo.mjs} +0 -1
  13. package/dist/{messages-BflWzIcP2.mjs → chunks/messages-BZ45xBlV.mjs} +0 -1
  14. package/dist/chunks/{messages-Dr7yA3xM.mjs → messages-B_90PYaG.mjs} +0 -1
  15. package/dist/{messages-49ZJ_ISf.mjs → chunks/messages-B_nVGWdk.mjs} +0 -1
  16. package/dist/{messages-cOqXp22e.mjs → chunks/messages-BjkDJuqh.mjs} +0 -1
  17. package/dist/chunks/{messages-CvamFN6x.mjs → messages-BtNOlsMj.mjs} +0 -1
  18. package/dist/{messages-DmX52AQr.mjs → chunks/messages-C1iQkKu82.mjs} +0 -1
  19. package/dist/{messages-CaAdEXoh2.mjs → chunks/messages-C1lqY56F2.mjs} +0 -1
  20. package/dist/chunks/{messages-BoTtYEct2.mjs → messages-C232njMF2.mjs} +0 -1
  21. package/dist/chunks/{messages-DPe7kW6J.mjs → messages-C3AJz_i6.mjs} +0 -1
  22. package/dist/{messages-BEDVb3ZX.mjs → chunks/messages-C9XSSqS5.mjs} +0 -1
  23. package/dist/chunks/{messages-DriB5lEF.mjs → messages-CRxkRJRN.mjs} +0 -1
  24. package/dist/{messages-XwPD18Kk.mjs → chunks/messages-CVzvKl6U.mjs} +0 -1
  25. package/dist/chunks/{messages-B_Qcy8kr2.mjs → messages-Cb-x47kY2.mjs} +0 -1
  26. package/dist/{messages-DvTVsLOK2.mjs → chunks/messages-CejEH4FW2.mjs} +0 -1
  27. package/dist/{messages-CicggErN2.mjs → chunks/messages-CficsmSH2.mjs} +0 -1
  28. package/dist/chunks/{messages-CFr0Ha6p2.mjs → messages-ClOxDE0y2.mjs} +0 -1
  29. package/dist/chunks/{messages-BRrtoRdw2.mjs → messages-Cn5n0nHe2.mjs} +0 -1
  30. package/dist/{messages-DwPfgL_u.mjs → chunks/messages-CnzaTbel.mjs} +0 -1
  31. package/dist/chunks/{messages-CIGX0FfW.mjs → messages-Cq6wj6FG.mjs} +0 -1
  32. package/dist/chunks/{messages-Csq7JatN.mjs → messages-CteKp81J.mjs} +0 -1
  33. package/dist/{messages-Dr-YJYIK2.mjs → chunks/messages-CvLXClh9.mjs} +0 -1
  34. package/dist/chunks/{messages-43N0Vfg42.mjs → messages-CxTq0x772.mjs} +0 -1
  35. package/dist/chunks/{messages-DkSwQvmi2.mjs → messages-CzCqu58X2.mjs} +0 -1
  36. package/dist/{messages-CkVfziK_2.mjs → chunks/messages-D6SAC8Lc2.mjs} +0 -1
  37. package/dist/chunks/{messages-Doxcj7Qy.mjs → messages-D7aoKTPD.mjs} +0 -1
  38. package/dist/chunks/{messages-B0cg-ThO2.mjs → messages-D9nReG4C2.mjs} +0 -1
  39. package/dist/{messages-g58itYPI.mjs → chunks/messages-D9qyilS0.mjs} +0 -1
  40. package/dist/chunks/{messages-BQZtOYxr2.mjs → messages-DDRCk44J2.mjs} +0 -1
  41. package/dist/chunks/{messages-B87-89os.mjs → messages-DDr8J4FE.mjs} +0 -1
  42. package/dist/{messages-DzhR8Klk.mjs → chunks/messages-DJWRON2S.mjs} +0 -1
  43. package/dist/{messages-DBwaWI0X.mjs → chunks/messages-DK6pBwD2.mjs} +0 -1
  44. package/dist/chunks/{messages-BFiMCfDX2.mjs → messages-DNrK8lCg2.mjs} +0 -1
  45. package/dist/chunks/{messages-D7fI9Pj52.mjs → messages-DQ4VyVJf2.mjs} +0 -1
  46. package/dist/{messages-BHOI7R4K.mjs → chunks/messages-DacahKek.mjs} +0 -1
  47. package/dist/chunks/{messages-Bn6LwI4B.mjs → messages-DbS9Oibb.mjs} +0 -1
  48. package/dist/chunks/{messages-Dg6kSnxq.mjs → messages-DcPtg90i.mjs} +0 -1
  49. package/dist/{messages-BpA30dPf.mjs → chunks/messages-DfTU2I8J.mjs} +0 -1
  50. package/dist/{messages-BdA_xvxj.mjs → chunks/messages-Dhe8_mnQ.mjs} +0 -1
  51. package/dist/{messages-CCKZS2f4.mjs → chunks/messages-DjOY_EqX.mjs} +0 -1
  52. package/dist/chunks/{messages-DRYKKPk8.mjs → messages-DnPkoMz1.mjs} +0 -1
  53. package/dist/chunks/{messages-B_uTiuQ-.mjs → messages-DoDbCS02.mjs} +0 -1
  54. package/dist/chunks/{messages-CRMdL0jG.mjs → messages-DotEkUpQ.mjs} +0 -1
  55. package/dist/chunks/{messages-DV5c_ZRQ.mjs → messages-Dxrg70jo.mjs} +0 -1
  56. package/dist/chunks/{messages-CwRhVVui.mjs → messages-DziA-L3p.mjs} +0 -1
  57. package/dist/{messages-CkAWTSc4.mjs → chunks/messages-IJhiftj5.mjs} +0 -1
  58. package/dist/chunks/{messages-yuqArCc6.mjs → messages-JRavIeeW.mjs} +0 -1
  59. package/dist/{messages-CERs9LC9.mjs → chunks/messages-Ul43l29K2.mjs} +0 -1
  60. package/dist/chunks/{messages-BU_YdaAf.mjs → messages-Yk__PXZQ.mjs} +0 -1
  61. package/dist/{messages-BX2KVzJp2.mjs → chunks/messages-h474TGR72.mjs} +0 -1
  62. package/dist/chunks/{messages-M8noQ6Kp2.mjs → messages-hngFJrES2.mjs} +0 -1
  63. package/dist/chunks/{messages-D0v0Xa_i2.mjs → messages-kHTrX3wo2.mjs} +0 -1
  64. package/dist/chunks/{messages-DqGQvcXv2.mjs → messages-m6bLP64R2.mjs} +0 -1
  65. package/dist/chunks/{messages-ClDJuy8K2.mjs → messages-nE9Ko73n2.mjs} +0 -1
  66. package/dist/chunks/{messages-C0ZWDShx2.mjs → messages-ni0ahgYk2.mjs} +0 -1
  67. package/dist/chunks/{messages-B7LU-b6n2.mjs → messages-pKUiAqlX2.mjs} +0 -1
  68. package/dist/{messages-BSlQrYwp.mjs → chunks/messages-rJdSnvyi.mjs} +0 -1
  69. package/dist/{messages-BrPEPj382.mjs → chunks/messages-tBHnC2Rj2.mjs} +0 -1
  70. package/dist/chunks/{messages-Cimsel4e.mjs → messages-tg78NAmW.mjs} +0 -1
  71. package/dist/{messages-CCm71gq3.mjs → chunks/messages-uLIUXFmU.mjs} +0 -1
  72. package/dist/{messages-BfgHOkAy.mjs → chunks/messages-yJmwc3zD.mjs} +0 -1
  73. package/dist/chunks/{tools-rsbC2UUN.mjs → tools-CUIpIxxP.mjs} +645 -641
  74. package/dist/full.mjs +3 -3
  75. package/dist/locales.mjs +67 -68
  76. package/dist/{chunks/messages-BhZcNoIQ.mjs → messages--XEfVx572.mjs} +0 -1
  77. package/dist/{messages-BTNuOkhL.mjs → messages-3aRjZXpv.mjs} +0 -1
  78. package/dist/{chunks/messages-JyZvGvrN.mjs → messages-6G0Eia-2.mjs} +0 -1
  79. package/dist/{messages-C3tLCwJp2.mjs → messages-B2bHgIcC2.mjs} +0 -1
  80. package/dist/{messages-aNMLsF8T2.mjs → messages-B8M4YRFO2.mjs} +0 -1
  81. package/dist/{messages-Bt_9ptDu.mjs → messages-B9qltgXa.mjs} +0 -1
  82. package/dist/{messages-CLQvtc_8.mjs → messages-BBgyeB_N.mjs} +0 -1
  83. package/dist/{messages-BigRnQS92.mjs → messages-BENRci-_2.mjs} +0 -1
  84. package/dist/{chunks/messages-DihczS7L.mjs → messages-BOxe7ewT.mjs} +0 -1
  85. package/dist/{chunks/messages-CA-jms9R.mjs → messages-BP8ZuVaD.mjs} +0 -1
  86. package/dist/{messages-DYlxQEIv.mjs → messages-BQJzUYP-.mjs} +0 -1
  87. package/dist/{chunks/messages-Cn1AC0Qk.mjs → messages-BU9luYgO.mjs} +0 -1
  88. package/dist/{messages-CYLYnOV82.mjs → messages-BZgGD0zf2.mjs} +0 -1
  89. package/dist/{messages-MBBSKGjJ2.mjs → messages-BbLCMWln2.mjs} +0 -1
  90. package/dist/{chunks/messages-elZUbCrN.mjs → messages-BdJ1lCo_.mjs} +0 -1
  91. package/dist/{chunks/messages-D3JVx_CH2.mjs → messages-Be1CCcsp2.mjs} +0 -1
  92. package/dist/{messages-D5KmRsUV2.mjs → messages-BlnZ8CkJ2.mjs} +0 -1
  93. package/dist/{messages-DDGzypb4.mjs → messages-Bsz7Qgj_.mjs} +0 -1
  94. package/dist/{messages-DdUpYaJ1.mjs → messages-Bw-GC0m5.mjs} +0 -1
  95. package/dist/{chunks/messages-FB_MePlt.mjs → messages-BwdowdYD.mjs} +0 -1
  96. package/dist/{chunks/messages-kC92TJI72.mjs → messages-BxQ1gzJF2.mjs} +0 -1
  97. package/dist/{messages-C45IBZtA2.mjs → messages-BztXgybv2.mjs} +0 -1
  98. package/dist/{chunks/messages-M0HT-kBW.mjs → messages-C0gyqo4h2.mjs} +0 -1
  99. package/dist/{messages-DhdWq5oQ2.mjs → messages-C7R0m6oE2.mjs} +0 -1
  100. package/dist/{chunks/messages-CtufKbaD.mjs → messages-C8iAUPzI.mjs} +0 -1
  101. package/dist/{messages-BaGwIHPb2.mjs → messages-CAffVeAE2.mjs} +0 -1
  102. package/dist/{messages-vssmW7KO.mjs → messages-CB0RKGVM.mjs} +0 -1
  103. package/dist/{messages-CPx1R-PH.mjs → messages-CE305J0p.mjs} +0 -1
  104. package/dist/{chunks/messages-Byp0YFMg.mjs → messages-CEhkWwqI.mjs} +0 -1
  105. package/dist/{messages-D0i5Vdyy2.mjs → messages-CJYE0_hr2.mjs} +0 -1
  106. package/dist/{messages-CYFdbooL2.mjs → messages-COU4L-pL2.mjs} +0 -1
  107. package/dist/{messages-BRPH_a6a.mjs → messages-CRMZ79Xf.mjs} +0 -1
  108. package/dist/{messages-CA0hwajz.mjs → messages-CVBsztOg.mjs} +0 -1
  109. package/dist/{messages-YfjdnhUF.mjs → messages-C_4VGaBC.mjs} +0 -1
  110. package/dist/{chunks/messages-D4jR5Oc-.mjs → messages-C_RPN2GV.mjs} +0 -1
  111. package/dist/{messages-CsM2iz1H2.mjs → messages-CaJRIGUu2.mjs} +0 -1
  112. package/dist/{messages-BeJaje7e2.mjs → messages-Cb5JJ8C_2.mjs} +0 -1
  113. package/dist/{chunks/messages-KdvbGwLH.mjs → messages-Cgy54529.mjs} +0 -1
  114. package/dist/{chunks/messages-CRdl14uE.mjs → messages-CkmVEyEQ2.mjs} +0 -1
  115. package/dist/{chunks/messages-CzCezryo.mjs → messages-CzSLUJQt.mjs} +0 -1
  116. package/dist/{chunks/messages-BWbZYIs12.mjs → messages-D6Sr5cUE.mjs} +0 -1
  117. package/dist/{messages-C0cXOCHN2.mjs → messages-DAssrN5L2.mjs} +0 -1
  118. package/dist/{messages-CYZVFnaF.mjs → messages-DB9U3VIh.mjs} +0 -1
  119. package/dist/{messages-DxKIxLKw.mjs → messages-DCOKudVN.mjs} +0 -1
  120. package/dist/{chunks/messages-DLrmLkco2.mjs → messages-DGZQXeav2.mjs} +0 -1
  121. package/dist/{chunks/messages-CqsES1wk2.mjs → messages-DZbsds_k2.mjs} +0 -1
  122. package/dist/{messages-RNusm48G2.mjs → messages-DkkrjINb2.mjs} +0 -1
  123. package/dist/{messages-DQGzw4IC.mjs → messages-DlrZrm3s.mjs} +0 -1
  124. package/dist/{messages-D-12TeCM2.mjs → messages-DpY9s4Qi2.mjs} +0 -1
  125. package/dist/{chunks/messages-BrvAiuWT.mjs → messages-DrouoDgp.mjs} +0 -1
  126. package/dist/{messages-DWZyaZNA.mjs → messages-GrVSCmXW.mjs} +0 -1
  127. package/dist/{chunks/messages-BLxyso1L.mjs → messages-K7ROT6ea.mjs} +0 -1
  128. package/dist/{chunks/messages-B3StvafX.mjs → messages-Kye1BINC.mjs} +0 -1
  129. package/dist/{chunks/messages-BdWTM73p.mjs → messages-MaHxNgKA.mjs} +0 -1
  130. package/dist/{messages-2iHnlF0U.mjs → messages-TseLyyoU.mjs} +0 -1
  131. package/dist/{chunks/messages-iWMOMK822.mjs → messages-e-KHuxtY2.mjs} +0 -1
  132. package/dist/{messages-DgstU8GH.mjs → messages-eCyczLYY.mjs} +0 -1
  133. package/dist/{messages-BFT0F9pw.mjs → messages-gldjQk7M.mjs} +0 -1
  134. package/dist/{chunks/messages-v1HkA3kF2.mjs → messages-huTzItxA.mjs} +0 -1
  135. package/dist/{messages-BEEr6Vh82.mjs → messages-m1uf_AMy2.mjs} +0 -1
  136. package/dist/{messages-Dc1yFFBM.mjs → messages-mVFAkdcY.mjs} +0 -1
  137. package/dist/{chunks/messages-tfyq1JIh2.mjs → messages-oH0ADQ362.mjs} +0 -1
  138. package/dist/{chunks/messages-Cuk0QaLM.mjs → messages-pgqtPci-.mjs} +0 -1
  139. package/dist/{messages-DuubRyFf.mjs → messages-q7HzQPVt.mjs} +0 -1
  140. package/dist/{messages-vfkwiKQo.mjs → messages-ruU_e2LK.mjs} +0 -1
  141. package/dist/{chunks/messages-Dgfbmyf-.mjs → messages-voUPclMU.mjs} +0 -1
  142. package/dist/{chunks/messages-DGodJU2R.mjs → messages-wRvz0vQ3.mjs} +0 -1
  143. package/dist/react.mjs +2 -2
  144. package/dist/tools.mjs +2 -2
  145. package/package.json +1 -1
  146. package/src/blok.ts +0 -1
  147. package/src/components/constants/data-attributes.ts +2 -0
  148. package/src/components/core.ts +1 -1
  149. package/src/components/i18n/locales/am/messages.json +0 -1
  150. package/src/components/i18n/locales/ar/messages.json +0 -1
  151. package/src/components/i18n/locales/az/messages.json +0 -1
  152. package/src/components/i18n/locales/bg/messages.json +0 -1
  153. package/src/components/i18n/locales/bn/messages.json +0 -1
  154. package/src/components/i18n/locales/bs/messages.json +0 -1
  155. package/src/components/i18n/locales/cs/messages.json +0 -1
  156. package/src/components/i18n/locales/da/messages.json +0 -1
  157. package/src/components/i18n/locales/de/messages.json +0 -1
  158. package/src/components/i18n/locales/dv/messages.json +0 -1
  159. package/src/components/i18n/locales/el/messages.json +0 -1
  160. package/src/components/i18n/locales/en/messages.json +0 -1
  161. package/src/components/i18n/locales/es/messages.json +0 -1
  162. package/src/components/i18n/locales/et/messages.json +0 -1
  163. package/src/components/i18n/locales/fa/messages.json +0 -1
  164. package/src/components/i18n/locales/fi/messages.json +0 -1
  165. package/src/components/i18n/locales/fil/messages.json +0 -1
  166. package/src/components/i18n/locales/fr/messages.json +1 -2
  167. package/src/components/i18n/locales/gu/messages.json +0 -1
  168. package/src/components/i18n/locales/he/messages.json +0 -1
  169. package/src/components/i18n/locales/hi/messages.json +0 -1
  170. package/src/components/i18n/locales/hr/messages.json +0 -1
  171. package/src/components/i18n/locales/hu/messages.json +0 -1
  172. package/src/components/i18n/locales/hy/messages.json +0 -1
  173. package/src/components/i18n/locales/id/messages.json +0 -1
  174. package/src/components/i18n/locales/it/messages.json +0 -1
  175. package/src/components/i18n/locales/ja/messages.json +0 -1
  176. package/src/components/i18n/locales/ka/messages.json +0 -1
  177. package/src/components/i18n/locales/km/messages.json +0 -1
  178. package/src/components/i18n/locales/kn/messages.json +0 -1
  179. package/src/components/i18n/locales/ko/messages.json +0 -1
  180. package/src/components/i18n/locales/ku/messages.json +0 -1
  181. package/src/components/i18n/locales/lo/messages.json +0 -1
  182. package/src/components/i18n/locales/lt/messages.json +0 -1
  183. package/src/components/i18n/locales/lv/messages.json +0 -1
  184. package/src/components/i18n/locales/mk/messages.json +0 -1
  185. package/src/components/i18n/locales/ml/messages.json +0 -1
  186. package/src/components/i18n/locales/mn/messages.json +0 -1
  187. package/src/components/i18n/locales/mr/messages.json +0 -1
  188. package/src/components/i18n/locales/ms/messages.json +0 -1
  189. package/src/components/i18n/locales/my/messages.json +0 -1
  190. package/src/components/i18n/locales/ne/messages.json +0 -1
  191. package/src/components/i18n/locales/nl/messages.json +0 -1
  192. package/src/components/i18n/locales/no/messages.json +0 -1
  193. package/src/components/i18n/locales/pa/messages.json +0 -1
  194. package/src/components/i18n/locales/pl/messages.json +0 -1
  195. package/src/components/i18n/locales/ps/messages.json +0 -1
  196. package/src/components/i18n/locales/pt/messages.json +0 -1
  197. package/src/components/i18n/locales/ro/messages.json +0 -1
  198. package/src/components/i18n/locales/ru/messages.json +0 -1
  199. package/src/components/i18n/locales/sd/messages.json +0 -1
  200. package/src/components/i18n/locales/si/messages.json +0 -1
  201. package/src/components/i18n/locales/sk/messages.json +0 -1
  202. package/src/components/i18n/locales/sl/messages.json +0 -1
  203. package/src/components/i18n/locales/sq/messages.json +0 -1
  204. package/src/components/i18n/locales/sr/messages.json +0 -1
  205. package/src/components/i18n/locales/sv/messages.json +0 -1
  206. package/src/components/i18n/locales/sw/messages.json +0 -1
  207. package/src/components/i18n/locales/ta/messages.json +0 -1
  208. package/src/components/i18n/locales/te/messages.json +0 -1
  209. package/src/components/i18n/locales/th/messages.json +0 -1
  210. package/src/components/i18n/locales/tr/messages.json +0 -1
  211. package/src/components/i18n/locales/ug/messages.json +0 -1
  212. package/src/components/i18n/locales/uk/messages.json +0 -1
  213. package/src/components/i18n/locales/ur/messages.json +0 -1
  214. package/src/components/i18n/locales/vi/messages.json +0 -1
  215. package/src/components/i18n/locales/yi/messages.json +0 -1
  216. package/src/components/i18n/locales/zh/messages.json +0 -1
  217. package/src/components/icons/index.ts +0 -16
  218. package/src/components/modules/api/index.ts +1 -1
  219. package/src/components/modules/api/theme.ts +17 -0
  220. package/src/components/modules/index.ts +8 -6
  221. package/src/components/modules/themeManager.ts +160 -0
  222. package/src/components/modules/toolbar/blockSettings.ts +12 -0
  223. package/src/components/modules/toolbar/index.ts +27 -1
  224. package/src/components/ui/toolbox.ts +3 -1
  225. package/src/components/utils/data-model-transform.ts +149 -5
  226. package/src/components/utils/popover/popover-desktop.ts +329 -44
  227. package/src/styles/main.css +1 -1
  228. package/src/tools/toggle/index.ts +14 -0
  229. package/src/types-internal/blok-modules.d.ts +6 -4
  230. package/types/api/index.d.ts +2 -1
  231. package/types/api/theme.d.ts +29 -0
  232. package/types/configs/blok-config.d.ts +10 -20
  233. package/types/index.d.ts +8 -4
  234. package/types/utils/popover/popover.d.ts +7 -0
  235. package/src/components/block-tunes/block-tune-width.ts +0 -39
  236. package/src/components/modules/api/width.ts +0 -17
  237. package/src/components/modules/widthManager.ts +0 -69
  238. package/types/api/width.d.ts +0 -19
@@ -1,8 +1,8 @@
1
- import { $ as e, A as t, At as n, B as r, D as i, Dn as a, Dt as o, En as s, F as c, Ft as l, G as u, H as d, I as f, J as p, K as m, L as h, M as g, N as ee, P as te, Pt as ne, Q as re, R as ie, Tt as ae, U as oe, V as se, W as ce, X as le, Xt as ue, _t as de, a as fe, bn as pe, bt as me, c as he, ct as ge, d as _e, dt as ve, et as ye, f as be, ft as xe, g as Se, gt as Ce, h as we, ht as Te, i as Ee, it as De, j as Oe, jt as _, k as ke, l as Ae, lt as je, mt as Me, n as Ne, nt as Pe, o as Fe, p as Ie, pt as Le, q as Re, r as ze, rt as Be, s as Ve, t as He, tt as Ue, u as v, ut as We, v as Ge, wt as Ke, z as qe } from "./constants-BkelccB1.mjs";
2
- import { t as y } from "./objectSpread2-CyPxu8-u.mjs";
3
- import { n as b } from "./tw-DmW6-pCY.mjs";
1
+ import { $ as e, A as t, B as n, Ct as r, D as i, F as a, G as o, H as s, I as c, J as l, Jt as u, K as d, L as f, M as p, Mt as m, N as h, Nt as g, Ot as _, P as ee, Q as te, R as ne, St as re, Tn as v, Tt as ie, U as ae, V as oe, W as se, X as ce, a as le, c as ue, ct as de, d as fe, dt as pe, et as me, f as he, ft as ge, g as _e, h as ve, ht as ye, i as be, it as xe, j as Se, k as Ce, kt as y, l as we, lt as Te, mt as Ee, n as De, nt as Oe, o as ke, ot as Ae, p as je, pt as Me, q as Ne, r as Pe, rt as Fe, s as Ie, st as Le, t as Re, tt as ze, u as b, ut as Be, v as Ve, vn as He, vt as Ue, wn as x, z as We } from "./constants-DWpV4hCh.mjs";
2
+ import { t as S } from "./objectSpread2-CyPxu8-u.mjs";
3
+ import { n as C } from "./tw-DmW6-pCY.mjs";
4
4
  //#region src/components/utils/html.ts
5
- var Je = (e) => {
5
+ var Ge = (e) => {
6
6
  if (!e || !e.includes("data-blok-fake-background")) return e;
7
7
  let t = document.createElement("div");
8
8
  return t.innerHTML = e, t.querySelectorAll("[data-blok-fake-background=\"true\"]").forEach((e) => {
@@ -12,7 +12,7 @@ var Je = (e) => {
12
12
  t.removeChild(e);
13
13
  }
14
14
  }), t.innerHTML;
15
- }, x = [
15
+ }, w = [
16
16
  "empty:before:pointer-events-none",
17
17
  "empty:before:text-gray-text",
18
18
  "empty:before:cursor-text",
@@ -21,7 +21,7 @@ var Je = (e) => {
21
21
  "data-[blok-empty=true]:before:text-gray-text",
22
22
  "data-[blok-empty=true]:before:cursor-text",
23
23
  "data-[blok-empty=true]:before:content-[attr(data-placeholder)]"
24
- ], Ye = [
24
+ ], Ke = [
25
25
  "empty:before:pointer-events-none",
26
26
  "empty:before:text-gray-text",
27
27
  "empty:before:cursor-text",
@@ -30,7 +30,7 @@ var Je = (e) => {
30
30
  "data-[empty=true]:before:text-gray-text",
31
31
  "data-[empty=true]:before:cursor-text",
32
32
  "data-[empty=true]:before:content-[attr(data-blok-placeholder-active)]"
33
- ], Xe = [
33
+ ], qe = [
34
34
  "empty:focus:before:pointer-events-none",
35
35
  "empty:focus:before:text-gray-text",
36
36
  "empty:focus:before:cursor-text",
@@ -39,7 +39,7 @@ var Je = (e) => {
39
39
  "[&[data-empty=true]:focus]:before:text-gray-text",
40
40
  "[&[data-empty=true]:focus]:before:cursor-text",
41
41
  "[&[data-empty=true]:focus]:before:content-[attr(data-blok-placeholder-active)]"
42
- ], Ze = [
42
+ ], Je = [
43
43
  "empty:in-data-[blok-empty=true]:before:pointer-events-none",
44
44
  "empty:in-data-[blok-empty=true]:before:text-gray-text",
45
45
  "empty:in-data-[blok-empty=true]:before:cursor-text",
@@ -48,25 +48,25 @@ var Je = (e) => {
48
48
  "[[data-blok-empty=true]_&[data-empty=true]]:before:text-gray-text",
49
49
  "[[data-blok-empty=true]_&[data-empty=true]]:before:cursor-text",
50
50
  "[[data-blok-empty=true]_&[data-empty=true]]:before:content-[attr(data-blok-placeholder-active)]"
51
- ], Qe = (e) => {
51
+ ], Ye = (e) => {
52
52
  let t = e.innerHTML.trim();
53
53
  return t === "" || t === "<br>";
54
- }, $e = (e) => {
54
+ }, Xe = (e) => {
55
55
  e.innerHTML === "<br>" && (e.innerHTML = "");
56
56
  let t = window.getSelection();
57
57
  if (!t) return;
58
58
  let n = document.createRange();
59
59
  n.selectNodeContents(e), n.collapse(!0), t.removeAllRanges(), t.addRange(n);
60
- }, et = (e) => {
61
- Qe(e) && $e(e);
62
- }, S = (e, t, n = "data-placeholder") => {
63
- e.setAttribute(n, t == null ? "" : t), e.addEventListener("focus", () => et(e));
64
- }, tt, nt = (e) => {
60
+ }, Ze = (e) => {
61
+ Ye(e) && Xe(e);
62
+ }, Qe = (e, t, n = "data-placeholder") => {
63
+ e.setAttribute(n, t == null ? "" : t), e.addEventListener("focus", () => Ze(e));
64
+ }, $e, et = (e) => {
65
65
  let t = document.createElement("div");
66
66
  t.innerHTML = e.trim();
67
67
  let n = document.createDocumentFragment();
68
68
  return n.append(...Array.from(t.childNodes)), n;
69
- }, rt = class t {
69
+ }, tt = class t {
70
70
  static get DEFAULT_PLACEHOLDER() {
71
71
  return "tools.paragraph.placeholder";
72
72
  }
@@ -85,9 +85,9 @@ var Je = (e) => {
85
85
  }
86
86
  drawView() {
87
87
  let e = document.createElement("DIV");
88
- e.className = b(this.api.styles.block, t.WRAPPER_CLASSES, Xe, Ze), e.setAttribute(s.tool, "paragraph"), e.contentEditable = "false";
88
+ e.className = C(this.api.styles.block, t.WRAPPER_CLASSES, qe, Je), e.setAttribute(x.tool, "paragraph"), e.contentEditable = "false";
89
89
  let n = this.buildInlineStyles();
90
- return Object.keys(n).length > 0 && Object.assign(e.style, n), this._data.text ? e.innerHTML = this._data.text : this.readOnly && (e.innerHTML = "<br>"), this.readOnly || (e.contentEditable = "true", e.addEventListener("keyup", this.onKeyUp), S(e, this.api.i18n.t(this._placeholder), "data-blok-placeholder-active")), e;
90
+ return Object.keys(n).length > 0 && Object.assign(e.style, n), this._data.text ? e.innerHTML = this._data.text : this.readOnly && (e.innerHTML = "<br>"), this.readOnly || (e.contentEditable = "true", e.addEventListener("keyup", this.onKeyUp), Qe(e, this.api.i18n.t(this._placeholder), "data-blok-placeholder-active")), e;
91
91
  }
92
92
  render() {
93
93
  return this._element = this.drawView(), this._element;
@@ -95,14 +95,14 @@ var Je = (e) => {
95
95
  merge(e) {
96
96
  if (!this._element) return;
97
97
  this._data.text += e.text;
98
- let t = nt(e.text);
98
+ let t = et(e.text);
99
99
  this._element.appendChild(t), this._element.normalize();
100
100
  }
101
101
  validate(e) {
102
102
  return !(e.text.trim() === "" && !this._preserveBlank);
103
103
  }
104
104
  save(e) {
105
- return { text: Je(e.innerHTML) };
105
+ return { text: Ge(e.innerHTML) };
106
106
  }
107
107
  onPaste(e) {
108
108
  let t = e.detail;
@@ -145,7 +145,7 @@ var Je = (e) => {
145
145
  };
146
146
  }
147
147
  };
148
- tt = rt, tt.WRAPPER_CLASSES = [
148
+ $e = tt, $e.WRAPPER_CLASSES = [
149
149
  "leading-[1.6em]",
150
150
  "outline-hidden",
151
151
  "mt-[2px]",
@@ -155,54 +155,54 @@ tt = rt, tt.WRAPPER_CLASSES = [
155
155
  ];
156
156
  //#endregion
157
157
  //#region src/tools/toggle/dom-builder.ts
158
- var it = (e) => {
159
- let { data: t, readOnly: n, isOpen: r, keydownHandler: i, onArrowClick: a, onBodyPlaceholderClick: o } = e, c = document.createElement("div");
160
- c.className = fe, c.setAttribute(s.tool, Ie), c.setAttribute(v.toggleOpen, String(r));
161
- let l = document.createElement("div");
162
- l.className = be;
163
- let u = at(r, a, {}, e.ariaLabels), d = st(t, n, i);
164
- l.appendChild(u), l.appendChild(d);
165
- let f = ot(o, e.bodyPlaceholderText), p = document.createElement("div");
166
- return p.className = _e, p.setAttribute(v.toggleChildren, ""), p.setAttribute("data-blok-mutation-free", "true"), p.id = `toggle-children-${Date.now()}-${Math.random().toString(36).slice(2)}`, u.setAttribute("aria-controls", p.id), c.appendChild(l), c.appendChild(f), c.appendChild(p), {
167
- wrapper: c,
168
- arrowElement: u,
169
- contentElement: d,
170
- bodyPlaceholderElement: f,
171
- childContainerElement: p
158
+ var nt = (e) => {
159
+ let { data: t, readOnly: n, isOpen: r, keydownHandler: i, onArrowClick: a, onBodyPlaceholderClick: o } = e, s = document.createElement("div");
160
+ s.className = le, s.setAttribute(x.tool, je), s.setAttribute(b.toggleOpen, String(r));
161
+ let c = document.createElement("div");
162
+ c.className = he;
163
+ let l = rt(r, a, {}, e.ariaLabels), u = at(t, n, i);
164
+ c.appendChild(l), c.appendChild(u);
165
+ let d = it(o, e.bodyPlaceholderText), f = document.createElement("div");
166
+ return f.className = fe, f.setAttribute(b.toggleChildren, ""), f.setAttribute("data-blok-mutation-free", "true"), f.id = `toggle-children-${Date.now()}-${Math.random().toString(36).slice(2)}`, l.setAttribute("aria-controls", f.id), s.appendChild(c), s.appendChild(d), s.appendChild(f), {
167
+ wrapper: s,
168
+ arrowElement: l,
169
+ contentElement: u,
170
+ bodyPlaceholderElement: d,
171
+ childContainerElement: f
172
172
  };
173
- }, at = (e, t, n = {}, r = {
173
+ }, rt = (e, t, n = {}, r = {
174
174
  collapse: "Collapse",
175
175
  expand: "Expand"
176
176
  }) => {
177
177
  let i = document.createElement("span");
178
- i.className = Ee, i.setAttribute(v.toggleArrow, ""), i.setAttribute(s.mutationFree, "true"), i.setAttribute("role", "button"), i.setAttribute("tabindex", "0"), i.setAttribute("aria-label", e ? r.collapse : r.expand), i.setAttribute("aria-expanded", String(e)), n.contentEditableFalse === !0 && (i.contentEditable = "false"), i.innerHTML = ze;
178
+ i.className = be, i.setAttribute(b.toggleArrow, ""), i.setAttribute(x.mutationFree, "true"), i.setAttribute("role", "button"), i.setAttribute("tabindex", "0"), i.setAttribute("aria-label", e ? r.collapse : r.expand), i.setAttribute("aria-expanded", String(e)), n.contentEditableFalse === !0 && (i.contentEditable = "false"), i.innerHTML = Pe;
179
179
  let a = i.querySelector("svg");
180
180
  return a && (a.style.transition = "transform 200ms ease-in-out", e && (a.style.transform = "rotate(90deg)")), t && (i.addEventListener("click", (e) => {
181
181
  e.stopPropagation(), t();
182
182
  }), i.addEventListener("keydown", (e) => {
183
183
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), t());
184
184
  })), i;
185
- }, ot = (e, t) => {
185
+ }, it = (e, t) => {
186
186
  let n = document.createElement("div");
187
- return n.className = Ve, n.setAttribute(v.toggleBodyPlaceholder, ""), n.setAttribute("data-blok-mutation-free", "true"), n.textContent = t, e && n.addEventListener("click", e), n;
188
- }, st = (e, t, n) => {
187
+ return n.className = Ie, n.setAttribute(b.toggleBodyPlaceholder, ""), n.setAttribute("data-blok-mutation-free", "true"), n.textContent = t, e && n.addEventListener("click", e), n;
188
+ }, at = (e, t, n) => {
189
189
  let r = document.createElement("div");
190
- return r.className = b(he, Ye, Ze), r.setAttribute(v.toggleContent, ""), r.contentEditable = t ? "false" : "true", r.innerHTML = e.text, n && r.addEventListener("keydown", n), r;
191
- }, ct = (e) => {
192
- let t = it(e);
193
- return t.contentElement && S(t.contentElement, e.placeholder, "data-blok-placeholder-active"), t;
194
- }, C = (e, t, n, r = {
190
+ return r.className = C(ue, Ke, Je), r.setAttribute(b.toggleContent, ""), r.contentEditable = t ? "false" : "true", r.innerHTML = e.text, n && r.addEventListener("keydown", n), r;
191
+ }, ot = (e) => {
192
+ let t = nt(e);
193
+ return t.contentElement && Qe(t.contentElement, e.placeholder, "data-blok-placeholder-active"), t;
194
+ }, T = (e, t, n, r = {
195
195
  collapse: "Collapse",
196
196
  expand: "Expand"
197
197
  }) => {
198
198
  let i = e.querySelector("svg");
199
- i && (i.style.transform = n ? "rotate(90deg)" : ""), e.setAttribute("aria-label", n ? r.collapse : r.expand), e.setAttribute("aria-expanded", String(n)), t.setAttribute(v.toggleOpen, String(n));
200
- }, lt = (e, t, n, r, i) => {
199
+ i && (i.style.transform = n ? "rotate(90deg)" : ""), e.setAttribute("aria-label", n ? r.collapse : r.expand), e.setAttribute("aria-expanded", String(n)), t.setAttribute(b.toggleOpen, String(n));
200
+ }, st = (e, t, n, r, i) => {
201
201
  let a = e.blocks.getChildren(t);
202
202
  !n && r && i && r.contains(document.activeElement) && i.focus();
203
203
  for (let e of a) r && e.holder.parentElement !== r && r.appendChild(e.holder), n ? e.holder.classList.remove("hidden") : e.holder.classList.add("hidden");
204
204
  r && (n ? r.removeAttribute("aria-hidden") : r.setAttribute("aria-hidden", "true"));
205
- }, ut = (e, t, n, r, i) => {
205
+ }, ct = (e, t, n, r, i) => {
206
206
  if (e === null) return;
207
207
  if (i) {
208
208
  e.classList.add("hidden");
@@ -210,27 +210,27 @@ var it = (e) => {
210
210
  }
211
211
  let a = t.blocks.getChildren(n);
212
212
  r && a.length === 0 ? e.classList.remove("hidden") : e.classList.add("hidden");
213
- }, dt = async (e) => {
213
+ }, lt = async (e) => {
214
214
  var t;
215
215
  let { api: n, blockId: r, data: i, getContentElement: a, syncContentFromDOM: o, isOpen: s } = e;
216
216
  if (o(), r === void 0) return;
217
217
  let c = a(), l = window.getSelection();
218
218
  if (!c || !l || l.rangeCount === 0) return;
219
- let { beforeContent: u, afterContent: d } = pt(c, l.getRangeAt(0)), f = (t = n.blocks.getBlockIndex(r)) == null ? n.blocks.getCurrentBlockIndex() : t;
219
+ let { beforeContent: u, afterContent: d } = dt(c, l.getRangeAt(0)), f = (t = n.blocks.getBlockIndex(r)) == null ? n.blocks.getCurrentBlockIndex() : t;
220
220
  if (s && d === "") {
221
221
  let e = n.blocks.insertInsideParent(r, f + 1);
222
222
  n.caret.setToBlock(e.id, "start");
223
223
  return;
224
224
  }
225
- n.blocks.splitBlock(r, { text: u }, Ie, { text: d }, f + 1), i.text = u;
226
- }, ft = async (e, t) => {
225
+ n.blocks.splitBlock(r, { text: u }, je, { text: d }, f + 1), i.text = u;
226
+ }, ut = async (e, t) => {
227
227
  let { api: n, blockId: r, data: i, getContentElement: a, syncContentFromDOM: o } = e;
228
228
  if (o(), r === void 0) return;
229
229
  let s = a();
230
- if (!s || !me(s)) return;
230
+ if (!s || !Ue(s)) return;
231
231
  let c = i.text;
232
232
  c === "" && (t.preventDefault(), await n.blocks.convert(r, "paragraph", { text: c }));
233
- }, pt = (e, t) => {
233
+ }, dt = (e, t) => {
234
234
  if (!e.lastChild) return {
235
235
  beforeContent: "",
236
236
  afterContent: ""
@@ -246,13 +246,13 @@ var it = (e) => {
246
246
  beforeContent: i.innerHTML,
247
247
  afterContent: a.innerHTML
248
248
  };
249
- }, mt = async (e) => {
249
+ }, ft = async (e) => {
250
250
  var t;
251
251
  let { api: n, blockId: r, getContentElement: i, syncContentFromDOM: a, isOpen: o, currentLevel: s } = e;
252
252
  if (a(), r === void 0) return;
253
253
  let c = i(), l = window.getSelection();
254
254
  if (!c || !l || l.rangeCount === 0) return;
255
- let { beforeContent: u, afterContent: d } = pt(c, l.getRangeAt(0)), f = (t = n.blocks.getBlockIndex(r)) == null ? n.blocks.getCurrentBlockIndex() : t;
255
+ let { beforeContent: u, afterContent: d } = dt(c, l.getRangeAt(0)), f = (t = n.blocks.getBlockIndex(r)) == null ? n.blocks.getCurrentBlockIndex() : t;
256
256
  if (o && d === "") {
257
257
  let e = n.blocks.insertInsideParent(r, f + 1);
258
258
  n.caret.setToBlock(e.id, "start");
@@ -267,17 +267,17 @@ var it = (e) => {
267
267
  level: s,
268
268
  isToggleable: !0
269
269
  }, f + 1);
270
- }, ht = async (e, t) => {
270
+ }, pt = async (e, t) => {
271
271
  let { api: n, blockId: r, getText: i, getContentElement: a, syncContentFromDOM: o, currentLevel: s } = e;
272
272
  if (o(), r === void 0) return;
273
273
  let c = a();
274
- if (!c || !me(c)) return;
274
+ if (!c || !Ue(c)) return;
275
275
  let l = i();
276
276
  l === "" && (t.preventDefault(), await n.blocks.convert(r, "header", {
277
277
  text: l,
278
278
  level: s
279
279
  }));
280
- }, gt, _t = class e {
280
+ }, mt, ht = class e {
281
281
  constructor({ data: e, config: t, api: n, readOnly: r, block: i }) {
282
282
  var a;
283
283
  this._arrowElement = null, this._wrapper = null, this._headerRow = null, this._childContainerElement = null, this._bodyPlaceholderElement = null, this.handleKeyDown = (e) => {
@@ -285,7 +285,7 @@ var it = (e) => {
285
285
  e.preventDefault(), this.handleEnter();
286
286
  return;
287
287
  }
288
- e.key === "Backspace" && ht(this.createKeyboardContext(), e);
288
+ e.key === "Backspace" && pt(this.createKeyboardContext(), e);
289
289
  }, this.handleBlockChanged = (e) => {
290
290
  this.isBlockChangedPayload(e) && (e.event.type === "block-removed" || e.event.type === "block-added") && this.updateBodyPlaceholderVisibility();
291
291
  }, this.api = n, this.readOnly = r, this._settings = t || {}, this._data = this.normalizeData(e), this._isOpen = (a = this._data.isOpen) == null ? !r : a, this._element = this.getTag(), i && (this.blockId = i.id), !r && this._data.isToggleable && this.api.events.on("block changed", this.handleBlockChanged);
@@ -311,7 +311,7 @@ var it = (e) => {
311
311
  if (e.isToggleable === !0 && (r.isToggleable = !0), typeof e.isOpen == "boolean" && (r.isOpen = e.isOpen), r.text) {
312
312
  let e = document.createElement("div");
313
313
  e.innerHTML = r.text;
314
- let t = e.querySelector(`[${v.toggleArrow}]`);
314
+ let t = e.querySelector(`[${b.toggleArrow}]`);
315
315
  t && (t.remove(), r.text = e.innerHTML);
316
316
  }
317
317
  return r;
@@ -326,13 +326,13 @@ var it = (e) => {
326
326
  this.api.events.off("block changed", this.handleBlockChanged), this._element.removeEventListener("keydown", this.handleKeyDown);
327
327
  }
328
328
  expand() {
329
- !this._data.isToggleable || this._isOpen || (this._isOpen = !0, this._arrowElement && this._element && C(this._arrowElement, this._element, this._isOpen, {
329
+ !this._data.isToggleable || this._isOpen || (this._isOpen = !0, this._arrowElement && this._element && T(this._arrowElement, this._element, this._isOpen, {
330
330
  collapse: this.api.i18n.t("tools.toggle.ariaLabelCollapse"),
331
331
  expand: this.api.i18n.t("tools.toggle.ariaLabelExpand")
332
332
  }), this.updateChildrenVisibility(), this.updateBodyPlaceholderVisibility());
333
333
  }
334
334
  collapse() {
335
- !this._data.isToggleable || !this._isOpen || (this._isOpen = !1, this._arrowElement && this._element && C(this._arrowElement, this._element, this._isOpen, {
335
+ !this._data.isToggleable || !this._isOpen || (this._isOpen = !1, this._arrowElement && this._element && T(this._arrowElement, this._element, this._isOpen, {
336
336
  collapse: this.api.i18n.t("tools.toggle.ariaLabelCollapse"),
337
337
  expand: this.api.i18n.t("tools.toggle.ariaLabelExpand")
338
338
  }), this.updateChildrenVisibility(), this.updateBodyPlaceholderVisibility());
@@ -360,14 +360,14 @@ var it = (e) => {
360
360
  merge(e) {
361
361
  let t = document.createElement("div");
362
362
  t.innerHTML = e.text;
363
- let n = t.querySelector(`[${v.toggleArrow}]`);
363
+ let n = t.querySelector(`[${b.toggleArrow}]`);
364
364
  n && n.remove(), this._element.insertAdjacentHTML("beforeend", t.innerHTML);
365
365
  }
366
366
  validate(e) {
367
367
  return typeof e.text == "string";
368
368
  }
369
369
  setData(e) {
370
- return this._data = this.normalizeData(e), typeof e.text == "string" && (this._element.innerHTML = e.text), this._data.isToggleable && typeof this._data.isOpen == "boolean" && (this._isOpen = this._data.isOpen, this._arrowElement && this._element && C(this._arrowElement, this._element, this._isOpen, {
370
+ return this._data = this.normalizeData(e), typeof e.text == "string" && (this._element.innerHTML = e.text), this._data.isToggleable && typeof this._data.isOpen == "boolean" && (this._isOpen = this._data.isOpen, this._arrowElement && this._element && T(this._arrowElement, this._element, this._isOpen, {
371
371
  collapse: this.api.i18n.t("tools.toggle.ariaLabelCollapse"),
372
372
  expand: this.api.i18n.t("tools.toggle.ariaLabelExpand")
373
373
  }), this.updateChildrenVisibility(), this.updateBodyPlaceholderVisibility()), !0;
@@ -406,13 +406,13 @@ var it = (e) => {
406
406
  e.innerHTML = this._element.innerHTML, this._element.parentNode.replaceChild(e, this._element), this._element = e;
407
407
  }
408
408
  if (t.text !== void 0 && (this._element.innerHTML = this._data.text || ""), this._data.isToggleable) {
409
- if (this._element.setAttribute(v.toggleOpen, String(this._isOpen)), this._element.className = b(e.BASE_STYLES, this.currentLevel.styles, x, "pl-8"), !this._wrapper) this.createToggleWrapper();
410
- else if (!this._wrapper.querySelector(`[${v.toggleArrow}]`)) {
409
+ if (this._element.setAttribute(b.toggleOpen, String(this._isOpen)), this._element.className = C(e.BASE_STYLES, this.currentLevel.styles, w, "pl-8"), !this._wrapper) this.createToggleWrapper();
410
+ else if (!this._wrapper.querySelector(`[${b.toggleArrow}]`)) {
411
411
  var n;
412
412
  let e = this.buildArrow();
413
413
  this._arrowElement = e, ((n = this._headerRow) == null ? this._wrapper : n).prepend(e);
414
414
  }
415
- } else if (this._element.removeAttribute(v.toggleOpen), this._element.className = b(e.BASE_STYLES, this.currentLevel.styles, x), this._arrowElement = null, this._wrapper) {
415
+ } else if (this._element.removeAttribute(b.toggleOpen), this._element.className = C(e.BASE_STYLES, this.currentLevel.styles, w), this._arrowElement = null, this._wrapper) {
416
416
  let e = this._wrapper.parentNode;
417
417
  e && e.replaceChild(this._element, this._wrapper), this._wrapper = null, this._headerRow = null;
418
418
  }
@@ -422,14 +422,14 @@ var it = (e) => {
422
422
  }
423
423
  getTag() {
424
424
  let t = document.createElement(this.currentLevel.tag);
425
- t.innerHTML = this._data.text || "", t.className = b(e.BASE_STYLES, this.currentLevel.styles, x, this._data.isToggleable ? "pl-8" : "");
425
+ t.innerHTML = this._data.text || "", t.className = C(e.BASE_STYLES, this.currentLevel.styles, w, this._data.isToggleable ? "pl-8" : "");
426
426
  let { inlineStyles: n } = this.currentLevel;
427
- n && Object.assign(t.style, n), t.setAttribute(s.tool, "header"), t.contentEditable = this.readOnly ? "false" : "true", this._data.isToggleable && t.setAttribute(v.toggleOpen, String(this._isOpen));
427
+ n && Object.assign(t.style, n), t.setAttribute(x.tool, "header"), t.contentEditable = this.readOnly ? "false" : "true", this._data.isToggleable && t.setAttribute(b.toggleOpen, String(this._isOpen));
428
428
  let r = this.api.i18n.t(this.currentLevel.nameKey), i = this.resolvePlaceholderText(r);
429
- return this.readOnly ? t.setAttribute("data-placeholder", i) : S(t, i), !this.readOnly && this._data.isToggleable && t.addEventListener("keydown", this.handleKeyDown), t;
429
+ return this.readOnly ? t.setAttribute("data-placeholder", i) : Qe(t, i), !this.readOnly && this._data.isToggleable && t.addEventListener("keydown", this.handleKeyDown), t;
430
430
  }
431
431
  buildArrow() {
432
- let e = at(this._isOpen, this.readOnly ? null : () => this.toggleOpen(), {}, {
432
+ let e = rt(this._isOpen, this.readOnly ? null : () => this.toggleOpen(), {}, {
433
433
  collapse: this.api.i18n.t("tools.toggle.ariaLabelCollapse"),
434
434
  expand: this.api.i18n.t("tools.toggle.ariaLabelExpand")
435
435
  });
@@ -441,9 +441,9 @@ var it = (e) => {
441
441
  let n = this.buildArrow();
442
442
  this._arrowElement = n, t.appendChild(n), t.appendChild(this._element), e.appendChild(t);
443
443
  let r = document.createElement("div");
444
- r.className = Ve, r.setAttribute(v.toggleBodyPlaceholder, ""), r.setAttribute("data-blok-mutation-free", "true"), r.textContent = this.api.i18n.t("tools.toggle.bodyPlaceholder"), this.readOnly || r.addEventListener("click", () => this.handleBodyPlaceholderClick()), this._bodyPlaceholderElement = r, e.appendChild(r);
444
+ r.className = Ie, r.setAttribute(b.toggleBodyPlaceholder, ""), r.setAttribute("data-blok-mutation-free", "true"), r.textContent = this.api.i18n.t("tools.toggle.bodyPlaceholder"), this.readOnly || r.addEventListener("click", () => this.handleBodyPlaceholderClick()), this._bodyPlaceholderElement = r, e.appendChild(r);
445
445
  let i = document.createElement("div");
446
- return i.className = _e, i.setAttribute(v.toggleChildren, ""), i.setAttribute("data-blok-mutation-free", "true"), this._childContainerElement = i, e.appendChild(i), e;
446
+ return i.className = fe, i.setAttribute(b.toggleChildren, ""), i.setAttribute("data-blok-mutation-free", "true"), this._childContainerElement = i, e.appendChild(i), e;
447
447
  }
448
448
  createToggleWrapper() {
449
449
  let e = this._element.parentNode;
@@ -468,19 +468,19 @@ var it = (e) => {
468
468
  }
469
469
  async handleEnter() {
470
470
  var e = this;
471
- await mt(e.createKeyboardContext()), e.updateChildrenVisibility(), e.updateBodyPlaceholderVisibility();
471
+ await ft(e.createKeyboardContext()), e.updateChildrenVisibility(), e.updateBodyPlaceholderVisibility();
472
472
  }
473
473
  toggleOpen() {
474
- this._isOpen = !this._isOpen, this._arrowElement && this._element && C(this._arrowElement, this._element, this._isOpen, {
474
+ this._isOpen = !this._isOpen, this._arrowElement && this._element && T(this._arrowElement, this._element, this._isOpen, {
475
475
  collapse: this.api.i18n.t("tools.toggle.ariaLabelCollapse"),
476
476
  expand: this.api.i18n.t("tools.toggle.ariaLabelExpand")
477
477
  }), this.updateChildrenVisibility(), this.updateBodyPlaceholderVisibility();
478
478
  }
479
479
  updateChildrenVisibility() {
480
- this.blockId !== void 0 && lt(this.api, this.blockId, this._isOpen, this._childContainerElement, this._arrowElement);
480
+ this.blockId !== void 0 && st(this.api, this.blockId, this._isOpen, this._childContainerElement, this._arrowElement);
481
481
  }
482
482
  updateBodyPlaceholderVisibility() {
483
- this.blockId !== void 0 && ut(this._bodyPlaceholderElement, this.api, this.blockId, this._isOpen, this.readOnly);
483
+ this.blockId !== void 0 && ct(this._bodyPlaceholderElement, this.api, this.blockId, this._isOpen, this.readOnly);
484
484
  }
485
485
  handleBodyPlaceholderClick() {
486
486
  var e;
@@ -558,9 +558,9 @@ var it = (e) => {
558
558
  ],
559
559
  shortcut: "#".repeat(e.number)
560
560
  })), n = {
561
- 1: ye,
562
- 2: Ue,
563
- 3: Pe
561
+ 1: me,
562
+ 2: ze,
563
+ 3: Oe
564
564
  }, r = e.DEFAULT_LEVELS.filter((e) => e.number <= 3).map((e) => ({
565
565
  icon: n[e.number],
566
566
  title: `Toggle heading ${e.number}`,
@@ -581,13 +581,13 @@ var it = (e) => {
581
581
  return [...t, ...r];
582
582
  }
583
583
  };
584
- gt = _t, gt.BASE_STYLES = "py-[3px] px-[2px] m-0 leading-[1.3]! outline-hidden [&_p]:p-0! [&_p]:m-0! [&_div]:p-0! [&_div]:m-0!", gt.DEFAULT_LEVELS = [
584
+ mt = ht, mt.BASE_STYLES = "py-[3px] px-[2px] m-0 leading-[1.3]! outline-hidden [&_p]:p-0! [&_p]:m-0! [&_div]:p-0! [&_div]:m-0!", mt.DEFAULT_LEVELS = [
585
585
  {
586
586
  number: 1,
587
587
  tag: "H1",
588
588
  nameKey: "tools.header.heading1",
589
589
  name: "Heading 1",
590
- icon: Oe,
590
+ icon: Se,
591
591
  styles: "text-4xl font-bold mt-8 mb-1"
592
592
  },
593
593
  {
@@ -595,7 +595,7 @@ gt = _t, gt.BASE_STYLES = "py-[3px] px-[2px] m-0 leading-[1.3]! outline-hidden [
595
595
  tag: "H2",
596
596
  nameKey: "tools.header.heading2",
597
597
  name: "Heading 2",
598
- icon: g,
598
+ icon: p,
599
599
  styles: "text-3xl font-semibold mt-6 mb-px"
600
600
  },
601
601
  {
@@ -603,7 +603,7 @@ gt = _t, gt.BASE_STYLES = "py-[3px] px-[2px] m-0 leading-[1.3]! outline-hidden [
603
603
  tag: "H3",
604
604
  nameKey: "tools.header.heading3",
605
605
  name: "Heading 3",
606
- icon: ee,
606
+ icon: h,
607
607
  styles: "text-2xl font-semibold mt-4 mb-px"
608
608
  },
609
609
  {
@@ -611,7 +611,7 @@ gt = _t, gt.BASE_STYLES = "py-[3px] px-[2px] m-0 leading-[1.3]! outline-hidden [
611
611
  tag: "H4",
612
612
  nameKey: "tools.header.heading4",
613
613
  name: "Heading 4",
614
- icon: te,
614
+ icon: ee,
615
615
  styles: "text-xl font-semibold mt-3 mb-px"
616
616
  },
617
617
  {
@@ -619,7 +619,7 @@ gt = _t, gt.BASE_STYLES = "py-[3px] px-[2px] m-0 leading-[1.3]! outline-hidden [
619
619
  tag: "H5",
620
620
  nameKey: "tools.header.heading5",
621
621
  name: "Heading 5",
622
- icon: c,
622
+ icon: a,
623
623
  styles: "text-base font-semibold mt-3 mb-px"
624
624
  },
625
625
  {
@@ -627,16 +627,16 @@ gt = _t, gt.BASE_STYLES = "py-[3px] px-[2px] m-0 leading-[1.3]! outline-hidden [
627
627
  tag: "H6",
628
628
  nameKey: "tools.header.heading6",
629
629
  name: "Heading 6",
630
- icon: f,
630
+ icon: c,
631
631
  styles: "text-sm font-semibold mt-3 mb-px"
632
632
  }
633
633
  ];
634
634
  //#endregion
635
635
  //#region src/tools/list/constants.ts
636
- var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 leading-[1.6em]", bt = "flex items-start pl-0.5", xt = "mt-1 w-4 mr-2 h-4 cursor-pointer accent-current", St = "tools.list.placeholder", Ct = "list", wt = {
636
+ var gt = "outline-hidden py-[3px] mt-[2px] mb-px", _t = "outline-hidden pl-0.5 leading-[1.6em]", vt = "flex items-start pl-0.5", yt = "mt-1 w-4 mr-2 h-4 cursor-pointer accent-current", bt = "tools.list.placeholder", xt = "list", St = {
637
637
  contentContainer: "list-content-container",
638
638
  checklistContent: "list-checklist-content"
639
- }, Tt = (e, t) => {
639
+ }, Ct = (e, t) => {
640
640
  let n = e;
641
641
  n._placeholder = t, Object.defineProperty(n, "getPlaceholder", {
642
642
  value: () => n._placeholder,
@@ -644,8 +644,8 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
644
644
  enumerable: !0,
645
645
  configurable: !1
646
646
  });
647
- }, Et = (e) => {
648
- let { data: t, keydownHandler: n, readOnly: r } = e, i = Dt(e), a = t.style === "checklist" ? kt(e) : Ot(e);
647
+ }, wt = (e) => {
648
+ let { data: t, keydownHandler: n, readOnly: r } = e, i = Tt(e), a = t.style === "checklist" ? Dt(e) : Et(e);
649
649
  i.appendChild(a), !r && n && i.addEventListener("keydown", n);
650
650
  let o = a.querySelector("[data-list-marker]"), s = a.querySelector("input[type=\"checkbox\"]"), c = a.querySelector("[contenteditable]");
651
651
  return {
@@ -654,46 +654,46 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
654
654
  markerElement: o,
655
655
  checkboxElement: s
656
656
  };
657
- }, Dt = (e) => {
657
+ }, Tt = (e) => {
658
658
  var t;
659
659
  let { data: n } = e, r = document.createElement("div");
660
- return r.className = vt, r.setAttribute(s.tool, Ct), r.setAttribute("data-list-style", n.style), r.setAttribute("data-list-depth", String((t = n.depth) == null ? 0 : t)), n.start !== void 0 && n.start !== 1 && r.setAttribute("data-list-start", String(n.start)), r;
661
- }, Ot = (e) => {
660
+ return r.className = gt, r.setAttribute(x.tool, xt), r.setAttribute("data-list-style", n.style), r.setAttribute("data-list-depth", String((t = n.depth) == null ? 0 : t)), n.start !== void 0 && n.start !== 1 && r.setAttribute("data-list-start", String(n.start)), r;
661
+ }, Et = (e) => {
662
662
  var t;
663
663
  let { data: n, itemColor: r, itemSize: i, placeholder: a } = e, o = document.createElement("div");
664
- o.setAttribute("role", "listitem"), o.className = b(yt, "flex", ...x), r && (o.style.color = r), i && (o.style.fontSize = i);
664
+ o.setAttribute("role", "listitem"), o.className = C(_t, "flex", ...w), r && (o.style.color = r), i && (o.style.fontSize = i);
665
665
  let s = (t = n.depth) == null ? 0 : t;
666
666
  s > 0 && (o.style.marginLeft = `${s * 24}px`);
667
- let c = At(n.style, s);
667
+ let c = Ot(n.style, s);
668
668
  c.setAttribute("data-list-marker", "true"), c.setAttribute("data-blok-mutation-free", "true"), o.appendChild(c);
669
669
  let l = document.createElement("div");
670
- return l.className = b("flex-1 min-w-0 outline-hidden", ...x), l.setAttribute("data-blok-testid", wt.contentContainer), l.contentEditable = e.readOnly ? "false" : "true", l.innerHTML = n.text, Tt(l, a), o.appendChild(l), o;
671
- }, kt = (e) => {
670
+ return l.className = C("flex-1 min-w-0 outline-hidden", ...w), l.setAttribute("data-blok-testid", St.contentContainer), l.contentEditable = e.readOnly ? "false" : "true", l.innerHTML = n.text, Ct(l, a), o.appendChild(l), o;
671
+ }, Dt = (e) => {
672
672
  var t;
673
673
  let { data: n, itemColor: r, itemSize: i, placeholder: a, readOnly: o } = e, s = document.createElement("div");
674
- s.setAttribute("role", "listitem"), s.className = bt, r && (s.style.color = r), i && (s.style.fontSize = i);
674
+ s.setAttribute("role", "listitem"), s.className = vt, r && (s.style.color = r), i && (s.style.fontSize = i);
675
675
  let c = (t = n.depth) == null ? 0 : t;
676
676
  c > 0 && (s.style.marginLeft = `${c * 24}px`);
677
677
  let l = document.createElement("input");
678
- l.type = "checkbox", l.className = xt, l.checked = !!n.checked, l.disabled = o;
678
+ l.type = "checkbox", l.className = yt, l.checked = !!n.checked, l.disabled = o;
679
679
  let u = document.createElement("div");
680
- return u.className = b("flex-1 outline-hidden leading-[1.6em]", n.checked ? "line-through opacity-60" : "", ...x), u.setAttribute("data-blok-testid", wt.checklistContent), u.setAttribute("data-checked", String(n.checked)), u.contentEditable = o ? "false" : "true", u.innerHTML = n.text, Tt(u, a), s.appendChild(l), s.appendChild(u), s;
681
- }, At = (e, t) => {
680
+ return u.className = C("flex-1 outline-hidden leading-[1.6em]", n.checked ? "line-through opacity-60" : "", ...w), u.setAttribute("data-blok-testid", St.checklistContent), u.setAttribute("data-checked", String(n.checked)), u.contentEditable = o ? "false" : "true", u.innerHTML = n.text, Ct(u, a), s.appendChild(l), s.appendChild(u), s;
681
+ }, Ot = (e, t) => {
682
682
  let n = document.createElement("span");
683
- return n.className = "shrink-0 select-none", n.setAttribute("aria-hidden", "true"), n.contentEditable = "false", e === "ordered" ? (n.textContent = "1.", n.className = b(n.className, "text-right"), n.style.paddingRight = "11px", n.style.minWidth = "fit-content") : (n.textContent = jt(t), n.className = b(n.className, "w-6 text-center flex justify-center"), n.style.paddingLeft = "1px", n.style.paddingRight = "13px", n.style.fontSize = "24px", n.style.fontFamily = "Arial"), n;
684
- }, jt = (e) => {
683
+ return n.className = "shrink-0 select-none", n.setAttribute("aria-hidden", "true"), n.contentEditable = "false", e === "ordered" ? (n.textContent = "1.", n.className = C(n.className, "text-right"), n.style.paddingRight = "11px", n.style.minWidth = "fit-content") : (n.textContent = kt(t), n.className = C(n.className, "w-6 text-center flex justify-center"), n.style.paddingLeft = "1px", n.style.paddingRight = "13px", n.style.fontSize = "24px", n.style.fontFamily = "Arial"), n;
684
+ }, kt = (e) => {
685
685
  let t = [
686
686
  "•",
687
687
  "◦",
688
688
  "▪"
689
689
  ];
690
690
  return t[e % t.length];
691
- }, Mt = (e) => {
691
+ }, At = (e) => {
692
692
  let { data: t, readOnly: n, placeholder: r, itemColor: i, itemSize: a, element: o, setupItemPlaceholder: s, onCheckboxChange: c, keydownHandler: l } = e;
693
693
  if (!o) return null;
694
694
  let u = o.parentNode;
695
695
  if (!u) return null;
696
- let d = Et({
696
+ let d = wt({
697
697
  data: t,
698
698
  readOnly: n,
699
699
  placeholder: r,
@@ -708,14 +708,14 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
708
708
  });
709
709
  }
710
710
  return u.replaceChild(d.wrapper, o), d.wrapper;
711
- }, Nt = (e, t, n) => {
711
+ }, jt = (e, t, n) => {
712
712
  if (!t) return e;
713
- let r = n(), i = y({
714
- text: r ? Je(r.innerHTML) : e.text,
713
+ let r = n(), i = S({
714
+ text: r ? Ge(r.innerHTML) : e.text,
715
715
  style: e.style
716
716
  }, e.style === "checklist" ? { checked: !!e.checked } : {});
717
717
  return e.start !== void 0 && e.start !== 1 && (i.start = e.start), e.depth !== void 0 && e.depth > 0 && (i.depth = e.depth), i;
718
- }, Pt = (e, t, n, r, i) => {
718
+ }, Mt = (e, t, n, r, i) => {
719
719
  var a, o;
720
720
  if (!n) return {
721
721
  newData: e,
@@ -726,7 +726,7 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
726
726
  newData: e,
727
727
  inPlace: !1
728
728
  };
729
- let d = "depth" in t ? t.depth : 0, f = y(y(y({}, e), t), {}, { depth: d }), p = r();
729
+ let d = "depth" in t ? t.depth : 0, f = S(S(S({}, e), t), {}, { depth: d }), p = r();
730
730
  if (p && typeof t.text == "string" && (p.innerHTML = t.text), s !== c) return i.adjustDepthTo(c), i.updateMarkerForDepth(c, u), {
731
731
  newData: f,
732
732
  inPlace: !0
@@ -739,7 +739,7 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
739
739
  newData: f,
740
740
  inPlace: !0
741
741
  };
742
- }, Ft = (e, t) => {
742
+ }, Nt = (e, t) => {
743
743
  let { element: n, getContentElement: r, parseHTML: i, data: a } = e;
744
744
  if (!n) return;
745
745
  a.text += t.text;
@@ -748,29 +748,29 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
748
748
  let e = i(t.text);
749
749
  o.appendChild(e), o.normalize();
750
750
  }
751
- }, It = (e, t, n, r) => e.map((e) => ({
751
+ }, Pt = (e, t, n, r) => e.map((e) => ({
752
752
  icon: e.icon,
753
753
  title: n(`toolNames.${e.titleKey}`),
754
754
  onActivate: () => r(e.style),
755
755
  closeOnActivate: !0,
756
756
  isActive: t === e.style
757
- })), Lt = (e) => {
757
+ })), Ft = (e) => {
758
758
  if (!e) return;
759
759
  let t = (e.getAttribute("style") || "").match(/margin-left:\s*(\d+)px/);
760
760
  if (!t) return;
761
761
  let n = parseInt(t[1], 10);
762
762
  return n > 0 ? { left: n } : void 0;
763
- }, Rt = (e) => {
763
+ }, It = (e) => {
764
764
  let t = e.closest("[data-list-depth]");
765
765
  if (!t) return;
766
766
  let n = t.getAttribute("data-list-depth");
767
767
  if (n === null) return;
768
768
  let r = parseInt(n, 10);
769
769
  return r > 0 ? { left: r * 24 } : void 0;
770
- }, zt = (e) => {
771
- let t = Lt(e.closest("[role=\"listitem\"]") || e.querySelector("[role=\"listitem\"]"));
772
- return t === void 0 ? Rt(e) : t;
773
- }, Bt = (e, t) => {
770
+ }, Lt = (e) => {
771
+ let t = Ft(e.closest("[role=\"listitem\"]") || e.querySelector("[role=\"listitem\"]"));
772
+ return t === void 0 ? It(e) : t;
773
+ }, Rt = (e, t) => {
774
774
  let n = document.createRange();
775
775
  if (n.setStart(e, 0), n.setEnd(t.startContainer, t.startOffset), !e.lastChild) return {
776
776
  beforeContent: "",
@@ -778,32 +778,32 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
778
778
  };
779
779
  let r = document.createRange();
780
780
  return r.setStart(t.endContainer, t.endOffset), r.setEndAfter(e.lastChild), {
781
- beforeContent: Vt(n.cloneContents()),
782
- afterContent: Vt(r.cloneContents())
781
+ beforeContent: zt(n.cloneContents()),
782
+ afterContent: zt(r.cloneContents())
783
783
  };
784
- }, Vt = (e) => {
784
+ }, zt = (e) => {
785
785
  let t = document.createElement("div");
786
786
  return t.appendChild(e), t.innerHTML;
787
- }, Ht = (e) => {
787
+ }, Bt = (e) => {
788
788
  let t = document.createElement("div");
789
789
  t.innerHTML = e.trim();
790
790
  let n = document.createDocumentFragment();
791
791
  return n.append(...Array.from(t.childNodes)), n;
792
- }, Ut = (e, t) => {
792
+ }, Vt = (e, t) => {
793
793
  let n = document.createRange();
794
794
  return n.selectNodeContents(e), n.setEnd(t.startContainer, t.startOffset), n.toString().length === 0;
795
- }, Wt = (e, t) => {
795
+ }, Ht = (e, t) => {
796
796
  let n = document.createRange();
797
797
  n.selectNodeContents(e), n.setEnd(t.startContainer, t.startOffset);
798
798
  let r = n.toString().length === 0, i = document.createRange();
799
799
  i.selectNodeContents(e), i.setStart(t.endContainer, t.endOffset);
800
800
  let a = i.toString().length === 0;
801
801
  return r && a;
802
- }, Gt = (e) => {
802
+ }, Ut = (e) => {
803
803
  if (typeof e != "object" || !e) return !1;
804
804
  let t = Object.entries(e).find(([e]) => e === "items");
805
805
  return t === void 0 ? !1 : Array.isArray(t[1]);
806
- }, Kt = (e) => typeof e == "object" && !!e, qt = (e) => typeof e == "string" ? e : "", Jt = (e, t) => e === "unordered" || e === "ordered" || e === "checklist" ? e : t, Yt = (e) => !!e, Xt = (e, t) => typeof e == "number" ? e : t, Zt = (e, t) => {
806
+ }, Wt = (e) => typeof e == "object" && !!e, Gt = (e) => typeof e == "string" ? e : "", Kt = (e, t) => e === "unordered" || e === "ordered" || e === "checklist" ? e : t, qt = (e) => !!e, Jt = (e, t) => typeof e == "number" ? e : t, Yt = (e, t) => {
807
807
  let n = t.defaultStyle || "unordered";
808
808
  if (!e || typeof e != "object") return {
809
809
  text: "",
@@ -811,18 +811,18 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
811
811
  checked: !1,
812
812
  depth: 0
813
813
  };
814
- if (Gt(e)) {
814
+ if (Ut(e)) {
815
815
  let t = e.items[0], r = (t == null ? void 0 : t.content) || "", i = (t == null ? void 0 : t.checked) || !1;
816
- return y({
816
+ return S({
817
817
  text: r,
818
818
  style: e.style || n,
819
819
  checked: !!i,
820
820
  depth: 0
821
821
  }, e.start !== void 0 && e.start !== 1 ? { start: e.start } : {});
822
822
  }
823
- if (Kt(e)) {
824
- let t = qt(e.text), r = Jt(e.style, n), i = Yt(e.checked), a = Xt(e.depth, 0), o = e.start, s = typeof o == "number" && o !== void 0 && o !== 1 ? o : void 0;
825
- return y({
823
+ if (Wt(e)) {
824
+ let t = Gt(e.text), r = Kt(e.style, n), i = qt(e.checked), a = Jt(e.depth, 0), o = e.start, s = typeof o == "number" && o !== void 0 && o !== 1 ? o : void 0;
825
+ return S({
826
826
  text: t,
827
827
  style: r,
828
828
  checked: i,
@@ -835,7 +835,7 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
835
835
  checked: !1,
836
836
  depth: 0
837
837
  };
838
- }, Qt = class {
838
+ }, Xt = class {
839
839
  constructor(e) {
840
840
  this.blocks = e;
841
841
  }
@@ -862,7 +862,7 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
862
862
  let n = (t = e.holder) == null || (t = t.querySelector("[role=\"listitem\"]")) == null ? void 0 : t.getAttribute("style"), r = n == null ? void 0 : n.match(/margin-left:\s*(\d+)px/);
863
863
  return r ? Math.round(parseInt(r[1], 10) / 24) : 0;
864
864
  }
865
- }, $t = (e, t) => {
865
+ }, Zt = (e, t) => {
866
866
  if (!e) return null;
867
867
  if (t === "checklist") {
868
868
  let t = e.querySelector("[contenteditable]");
@@ -870,15 +870,15 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
870
870
  }
871
871
  let n = e.querySelector("[data-blok-testid=\"list-content-container\"]");
872
872
  return n instanceof HTMLElement ? n : null;
873
- }, en = (e, t, n) => {
873
+ }, Qt = (e, t, n) => {
874
874
  e && e.setAttribute("data-list-depth", String(n));
875
875
  let r = e == null ? void 0 : e.querySelector("[role=\"listitem\"]");
876
876
  r instanceof HTMLElement && (r.style.marginLeft = n > 0 ? `${n * 24}px` : ""), t.depth = n;
877
- }, tn = (e, t) => t.getBlockDepth(e), nn = (e, t) => t.getBlockStyle(e), rn = (e, t) => t.getBulletCharacter(e), an = (e, t, n, r, i) => {
877
+ }, $t = (e, t) => t.getBlockDepth(e), en = (e, t) => t.getBlockStyle(e), tn = (e, t) => t.getBulletCharacter(e), nn = (e, t, n, r, i) => {
878
878
  var a;
879
879
  let o = e ? (a = r.getBlockIndex(e)) == null ? r.getCurrentBlockIndex() : a : r.getCurrentBlockIndex();
880
880
  return o <= 0 ? 0 : i.getSiblingIndex(o, t, n);
881
- }, on = (e, t, n, r, i, a) => {
881
+ }, rn = (e, t, n, r, i, a) => {
882
882
  var o;
883
883
  if (e === 0) {
884
884
  var s;
@@ -886,10 +886,10 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
886
886
  }
887
887
  let c = n ? (o = i.getBlockIndex(n)) == null ? i.getCurrentBlockIndex() : o : i.getCurrentBlockIndex(), l = a.findFirstItemIndex(c - 1, t, e, r.style);
888
888
  return l === null ? 1 : a.getBlockStartValue(l);
889
- }, sn = (e, t, n, r, i, a) => {
890
- let o = on(e, t, r, n, i, a) + e;
889
+ }, an = (e, t, n, r, i, a) => {
890
+ let o = rn(e, t, r, n, i, a) + e;
891
891
  return a.formatNumber(o, t);
892
- }, cn = (e, t, n, r) => r.findGroupStart(e, t, n), ln = (e, t, n, r) => {
892
+ }, on = (e, t, n, r) => r.findGroupStart(e, t, n), sn = (e, t, n, r) => {
893
893
  if (!e) return;
894
894
  let i = e.holder, a = i == null ? void 0 : i.querySelector("[data-list-style=\"ordered\"]");
895
895
  if (!a) return;
@@ -897,9 +897,9 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
897
897
  if (!o) return;
898
898
  let s = t.getBlockIndex(e.id);
899
899
  if (s == null) return;
900
- let c = tn(e, n), l = nn(e, r) || "ordered", u = r.getSiblingIndex(s, c, l), d = r.getGroupStartValue(s, c, u, l) + u;
900
+ let c = $t(e, n), l = en(e, r) || "ordered", u = r.getSiblingIndex(s, c, l), d = r.getGroupStartValue(s, c, u, l) + u;
901
901
  o.textContent = r.formatNumber(d, c);
902
- }, un = (e, t, n, r, i, a, o, s) => {
902
+ }, cn = (e, t, n, r, i, a, o, s) => {
903
903
  let c = (e) => {
904
904
  if (e >= t) return;
905
905
  if (e === n) {
@@ -908,25 +908,25 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
908
908
  }
909
909
  let l = a.getBlockByIndex(e);
910
910
  if (!l || l.name !== "list") return;
911
- let u = tn(l, o);
911
+ let u = $t(l, o);
912
912
  if (!(u < r)) {
913
913
  if (u > r) {
914
914
  c(e + 1);
915
915
  return;
916
916
  }
917
- nn(l, s) === i && (ln(l, a, o, s), c(e + 1));
917
+ en(l, s) === i && (sn(l, a, o, s), c(e + 1));
918
918
  }
919
919
  };
920
920
  c(e);
921
- }, dn = (e, t, n) => {
921
+ }, ln = (e, t, n) => {
922
922
  let r = e.getBlocksCount();
923
923
  Array.from({ length: r }, (e, t) => t).forEach((r) => {
924
924
  let i = e.getBlockByIndex(r);
925
925
  if (!i || i.name !== "list") return;
926
926
  let a = i.holder;
927
- a != null && a.querySelector("[data-list-style=\"ordered\"]") && ln(i, e, t, n);
927
+ a != null && a.querySelector("[data-list-style=\"ordered\"]") && sn(i, e, t, n);
928
928
  });
929
- }, w = (e, t, n = "end") => {
929
+ }, E = (e, t, n = "end") => {
930
930
  let r = () => {
931
931
  let r = t.holder;
932
932
  if (!r) return;
@@ -942,7 +942,7 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
942
942
  n === "start" ? (o.setStart(i, 0), o.collapse(!0)) : (o.selectNodeContents(i), o.collapse(!1)), a.removeAllRanges(), a.addRange(o), e.caret.updateLastCaretAfterPosition();
943
943
  }, i = t.holder;
944
944
  (i == null ? void 0 : i.querySelector("[contenteditable=\"true\"]")) instanceof HTMLElement ? r() : requestAnimationFrame(() => r());
945
- }, fn = async (e) => {
945
+ }, un = async (e) => {
946
946
  var t;
947
947
  let { api: n, blockId: r, data: i, element: a, getContentElement: o } = e, s = window.getSelection();
948
948
  if (!s || !a) return;
@@ -950,49 +950,49 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
950
950
  if (!c) return;
951
951
  let l = c.innerHTML.trim();
952
952
  if (l === "" || l === "<br>") {
953
- await pn(e);
953
+ await dn(e);
954
954
  return;
955
955
  }
956
- let { beforeContent: u, afterContent: d } = Bt(c, s.getRangeAt(0)), f = r ? (t = n.blocks.getBlockIndex(r)) == null ? n.blocks.getCurrentBlockIndex() : t : n.blocks.getCurrentBlockIndex();
956
+ let { beforeContent: u, afterContent: d } = Rt(c, s.getRangeAt(0)), f = r ? (t = n.blocks.getBlockIndex(r)) == null ? n.blocks.getCurrentBlockIndex() : t : n.blocks.getCurrentBlockIndex();
957
957
  if (!r) {
958
- c.innerHTML = u, i.text = u, w(n, n.blocks.insert(Ct, y(y({
958
+ c.innerHTML = u, i.text = u, E(n, n.blocks.insert(xt, S(S({
959
959
  text: d,
960
960
  style: i.style
961
961
  }, i.style === "checklist" ? { checked: !!i.checked } : {}), {}, { depth: i.depth }), void 0, f + 1, !0), "start");
962
962
  return;
963
963
  }
964
- let p = n.blocks.splitBlock(r, { text: u }, Ct, y(y({
964
+ let p = n.blocks.splitBlock(r, { text: u }, xt, S(S({
965
965
  text: d,
966
966
  style: i.style
967
967
  }, i.style === "checklist" ? { checked: !!i.checked } : {}), {}, { depth: i.depth }), f + 1);
968
- i.text = u, w(n, p, "start");
969
- }, pn = async (e) => {
968
+ i.text = u, E(n, p, "start");
969
+ }, dn = async (e) => {
970
970
  let { api: t, blockId: n, getDepth: r } = e;
971
971
  if (r() > 0) {
972
- await gn(e);
972
+ await mn(e);
973
973
  return;
974
974
  }
975
- n !== void 0 && w(t, await t.blocks.convert(n, "paragraph", { text: "" }), "start");
976
- }, mn = async (e, t) => {
975
+ n !== void 0 && E(t, await t.blocks.convert(n, "paragraph", { text: "" }), "start");
976
+ }, fn = async (e, t) => {
977
977
  let { api: n, blockId: r, data: i, element: a, getContentElement: o, getDepth: s, syncContentFromDOM: c } = e, l = window.getSelection();
978
978
  if (!l || !a) return;
979
979
  let u = l.getRangeAt(0), d = o();
980
980
  if (!d) return;
981
981
  c();
982
982
  let f = i.text, p = s();
983
- if (Wt(d, u) && !l.isCollapsed) {
983
+ if (Ht(d, u) && !l.isCollapsed) {
984
984
  t.preventDefault(), d.innerHTML = "", i.text = "";
985
985
  let e = document.createRange();
986
986
  e.setStart(d, 0), e.collapse(!0), l.removeAllRanges(), l.addRange(e);
987
987
  return;
988
988
  }
989
- if (!Ut(d, u) || (t.preventDefault(), r === void 0)) return;
989
+ if (!Vt(d, u) || (t.preventDefault(), r === void 0)) return;
990
990
  let m = await n.blocks.convert(r, "paragraph", { text: f });
991
991
  p > 0 && requestAnimationFrame(() => {
992
992
  let e = m.holder;
993
993
  e && (e.style.marginLeft = `${p * 24}px`, e.setAttribute("data-blok-depth", String(p)));
994
- }), w(n, m, "start");
995
- }, hn = async (e, t) => {
994
+ }), E(n, m, "start");
995
+ }, pn = async (e, t) => {
996
996
  let { api: n, blockId: r, data: i, syncContentFromDOM: a, getDepth: o } = e, s = n.blocks.getCurrentBlockIndex();
997
997
  if (s === 0) return;
998
998
  let c = n.blocks.getBlockByIndex(s - 1);
@@ -1001,15 +1001,15 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1001
1001
  if (l > t.getBlockDepth(c)) return;
1002
1002
  a();
1003
1003
  let u = l + 1;
1004
- i.depth = u, w(n, await n.blocks.update(r || "", y(y({}, i), {}, { depth: u })));
1005
- }, gn = async (e) => {
1004
+ i.depth = u, E(n, await n.blocks.update(r || "", S(S({}, i), {}, { depth: u })));
1005
+ }, mn = async (e) => {
1006
1006
  let { api: t, blockId: n, data: r, syncContentFromDOM: i, getDepth: a } = e, o = a();
1007
1007
  if (o === 0) return;
1008
1008
  i();
1009
1009
  let s = o - 1;
1010
- r.depth = s, w(t, await t.blocks.update(n || "", y(y({}, r), {}, { depth: s })));
1011
- }, _n = (e) => {
1012
- let { data: t, readOnly: n, placeholder: r, itemColor: i, itemSize: a, setupItemPlaceholder: o, onCheckboxChange: s, keydownHandler: c } = e, l = Et({
1010
+ r.depth = s, E(t, await t.blocks.update(n || "", S(S({}, r), {}, { depth: s })));
1011
+ }, hn = (e) => {
1012
+ let { data: t, readOnly: n, placeholder: r, itemColor: i, itemSize: a, setupItemPlaceholder: o, onCheckboxChange: s, keydownHandler: c } = e, l = wt({
1013
1013
  data: t,
1014
1014
  readOnly: n,
1015
1015
  placeholder: r,
@@ -1024,14 +1024,14 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1024
1024
  });
1025
1025
  }
1026
1026
  return l.wrapper;
1027
- }, vn = (e) => {
1027
+ }, gn = (e) => {
1028
1028
  let t = (e) => {
1029
1029
  if (e <= 0) return "";
1030
1030
  let n = e - 1;
1031
1031
  return t(Math.floor(n / 26)) + String.fromCharCode(97 + n % 26);
1032
1032
  };
1033
1033
  return t(e);
1034
- }, yn = (e) => {
1034
+ }, _n = (e) => {
1035
1035
  let t = [
1036
1036
  [1e3, "m"],
1037
1037
  [900, "cm"],
@@ -1052,7 +1052,7 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1052
1052
  return e >= i ? a + n(e - i, r) : n(e, r + 1);
1053
1053
  };
1054
1054
  return n(e, 0);
1055
- }, bn = class {
1055
+ }, vn = class {
1056
1056
  constructor(e) {
1057
1057
  this.blocks = e;
1058
1058
  }
@@ -1078,7 +1078,7 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1078
1078
  }
1079
1079
  formatNumber(e, t) {
1080
1080
  let n = t % 3;
1081
- return n === 1 ? `${vn(e)}.` : n === 2 ? `${yn(e)}.` : `${e}.`;
1081
+ return n === 1 ? `${gn(e)}.` : n === 2 ? `${_n(e)}.` : `${e}.`;
1082
1082
  }
1083
1083
  getGroupStartValue(e, t, n, r) {
1084
1084
  if (n === 0) return this.getBlockStartValue(e);
@@ -1133,9 +1133,9 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1133
1133
  let a = this.getBlockDepth(i);
1134
1134
  return a < n ? t : a > n ? this.findGroupStartRecursive(e - 1, t, n, r) : this.getBlockStyle(i) === r ? this.findGroupStartRecursive(e - 1, e, n, r) : t;
1135
1135
  }
1136
- }, xn = { value: !1 }, Sn = class {
1136
+ }, yn = { value: !1 }, bn = class {
1137
1137
  constructor(e) {
1138
- this.blocks = e, this.depthValidator = new Qt(e), this.markerCalculator = new bn(e);
1138
+ this.blocks = e, this.depthValidator = new Xt(e), this.markerCalculator = new vn(e);
1139
1139
  }
1140
1140
  updateMarker(e, t, n) {
1141
1141
  let r = e.querySelector("[data-list-marker]");
@@ -1162,8 +1162,8 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1162
1162
  }
1163
1163
  }
1164
1164
  scheduleUpdateAll() {
1165
- xn.value || (xn.value = !0, requestAnimationFrame(() => {
1166
- xn.value = !1, this.updateAllMarkers();
1165
+ yn.value || (yn.value = !0, requestAnimationFrame(() => {
1166
+ yn.value = !1, this.updateAllMarkers();
1167
1167
  }));
1168
1168
  }
1169
1169
  findListGroupStartIndex(e, t, n) {
@@ -1202,12 +1202,12 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1202
1202
  })() : c) + s;
1203
1203
  r.textContent = this.markerCalculator.formatNumber(l, a);
1204
1204
  }
1205
- }, Cn = (e) => e instanceof HTMLElement, wn = new Set(/* @__PURE__ */ "decimal.decimal-leading-zero.lower-roman.upper-roman.lower-greek.lower-latin.upper-latin.lower-alpha.upper-alpha.arabic-indic.armenian.bengali.cambodian.cjk-decimal.devanagari.georgian.gujarati.gurmukhi.hebrew.kannada.khmer.lao.malayalam.mongolian.myanmar.oriya.persian.telugu.thai.tibetan".split(".")), Tn = new Set([
1205
+ }, xn = (e) => e instanceof HTMLElement, Sn = new Set(/* @__PURE__ */ "decimal.decimal-leading-zero.lower-roman.upper-roman.lower-greek.lower-latin.upper-latin.lower-alpha.upper-alpha.arabic-indic.armenian.bengali.cambodian.cjk-decimal.devanagari.georgian.gujarati.gurmukhi.hebrew.kannada.khmer.lao.malayalam.mongolian.myanmar.oriya.persian.telugu.thai.tibetan".split(".")), Cn = new Set([
1206
1206
  "disc",
1207
1207
  "circle",
1208
1208
  "square",
1209
1209
  "none"
1210
- ]), En = (e) => {
1210
+ ]), wn = (e) => {
1211
1211
  let t = e.getAttribute("data-list-style");
1212
1212
  if (t === "ordered") return "ordered";
1213
1213
  if (t === "unordered") return "unordered";
@@ -1216,24 +1216,24 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1216
1216
  let r = n.match(/list-style-type\s*:\s*([^;]+)/);
1217
1217
  if (!r) return null;
1218
1218
  let i = r[1].trim().toLowerCase();
1219
- return wn.has(i) ? "ordered" : Tn.has(i) ? "unordered" : null;
1220
- }, Dn = (e, t) => {
1219
+ return Sn.has(i) ? "ordered" : Cn.has(i) ? "unordered" : null;
1220
+ }, Tn = (e, t) => {
1221
1221
  let n = e.parentElement;
1222
- return (n == null ? void 0 : n.tagName) === "OL" ? "ordered" : (n == null ? void 0 : n.tagName) === "UL" ? e.querySelector("input[type=\"checkbox\"]") ? "checklist" : "unordered" : En(e) || t;
1223
- }, On = (e) => {
1222
+ return (n == null ? void 0 : n.tagName) === "OL" ? "ordered" : (n == null ? void 0 : n.tagName) === "UL" ? e.querySelector("input[type=\"checkbox\"]") ? "checklist" : "unordered" : wn(e) || t;
1223
+ }, En = (e) => {
1224
1224
  let t = e.innerHTML || e.textContent || "", n = e.querySelector("input[type=\"checkbox\"]");
1225
1225
  return {
1226
1226
  text: t,
1227
1227
  checked: n instanceof HTMLInputElement ? n.checked : !1
1228
1228
  };
1229
- }, kn = (e) => {
1229
+ }, Dn = (e) => {
1230
1230
  let t = e.getAttribute("aria-level");
1231
1231
  if (t) {
1232
1232
  let e = parseInt(t, 10);
1233
1233
  return Math.max(0, e - 1);
1234
1234
  }
1235
1235
  return 0;
1236
- }, An = () => ({ text: {
1236
+ }, On = () => ({ text: {
1237
1237
  br: !0,
1238
1238
  a: {
1239
1239
  href: !0,
@@ -1242,38 +1242,38 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1242
1242
  },
1243
1243
  b: !0,
1244
1244
  i: !0
1245
- } }), jn = () => ({ tags: [{ li: {
1245
+ } }), kn = () => ({ tags: [{ li: {
1246
1246
  style: !0,
1247
1247
  "aria-level": !0
1248
- } }] }), Mn = () => ({
1248
+ } }] }), An = () => ({
1249
1249
  export: (e) => e.text,
1250
1250
  import: (e) => ({
1251
1251
  text: e,
1252
1252
  style: "unordered",
1253
1253
  checked: !1
1254
1254
  })
1255
- }), Nn = [
1255
+ }), jn = [
1256
1256
  {
1257
1257
  name: "bulletedList",
1258
1258
  titleKey: "bulletedList",
1259
1259
  style: "unordered",
1260
- icon: u
1260
+ icon: o
1261
1261
  },
1262
1262
  {
1263
1263
  name: "numberedList",
1264
1264
  titleKey: "numberedList",
1265
1265
  style: "ordered",
1266
- icon: Re
1266
+ icon: Ne
1267
1267
  },
1268
1268
  {
1269
1269
  name: "todoList",
1270
1270
  titleKey: "todoList",
1271
1271
  style: "checklist",
1272
- icon: m
1272
+ icon: d
1273
1273
  }
1274
- ], Pn = () => [
1274
+ ], Mn = () => [
1275
1275
  {
1276
- icon: u,
1276
+ icon: o,
1277
1277
  title: "Bulleted list",
1278
1278
  titleKey: "bulletedList",
1279
1279
  data: { style: "unordered" },
@@ -1287,7 +1287,7 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1287
1287
  shortcut: "-"
1288
1288
  },
1289
1289
  {
1290
- icon: Re,
1290
+ icon: Ne,
1291
1291
  title: "Numbered list",
1292
1292
  titleKey: "numberedList",
1293
1293
  data: { style: "ordered" },
@@ -1301,7 +1301,7 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1301
1301
  shortcut: "1."
1302
1302
  },
1303
1303
  {
1304
- icon: m,
1304
+ icon: d,
1305
1305
  title: "To-do list",
1306
1306
  titleKey: "todoList",
1307
1307
  data: { style: "checklist" },
@@ -1315,24 +1315,24 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1315
1315
  ],
1316
1316
  shortcut: "[]"
1317
1317
  }
1318
- ], Fn = class {
1318
+ ], Nn = class {
1319
1319
  constructor({ data: e, config: t, api: n, readOnly: r, block: i }) {
1320
1320
  this._element = null, this.handleBlockChanged = (e) => {
1321
1321
  if (this.isBlockChangedEventPayload(e) && (e.event.type === "block-removed" || e.event.type === "block-added")) {
1322
1322
  var t;
1323
1323
  (t = this.markerManager) == null || t.scheduleUpdateAll();
1324
1324
  }
1325
- }, this.api = n, this.readOnly = r, this._settings = t || {}, this._data = this.normalizeData(e), this.depthValidator = new Qt(n.blocks), this.markerCalculator = new bn(n.blocks), this.markerManager = this._data.style === "ordered" ? new Sn(n.blocks) : null, i && (this.blockId = i.id), this._data.style === "ordered" && this.api.events.on("block changed", this.handleBlockChanged);
1325
+ }, this.api = n, this.readOnly = r, this._settings = t || {}, this._data = this.normalizeData(e), this.depthValidator = new Xt(n.blocks), this.markerCalculator = new vn(n.blocks), this.markerManager = this._data.style === "ordered" ? new bn(n.blocks) : null, i && (this.blockId = i.id), this._data.style === "ordered" && this.api.events.on("block changed", this.handleBlockChanged);
1326
1326
  }
1327
1327
  isBlockChangedEventPayload(e) {
1328
1328
  return typeof e == "object" && !!e && "event" in e && typeof e.event == "object" && e.event !== null && "type" in e.event && typeof e.event.type == "string";
1329
1329
  }
1330
1330
  normalizeData(e) {
1331
- return Zt(e, this._settings);
1331
+ return Yt(e, this._settings);
1332
1332
  }
1333
1333
  get availableStyles() {
1334
1334
  let e = this._settings.styles;
1335
- return !e || e.length === 0 ? Nn : Nn.filter((t) => e.includes(t.style));
1335
+ return !e || e.length === 0 ? jn : jn.filter((t) => e.includes(t.style));
1336
1336
  }
1337
1337
  get itemColor() {
1338
1338
  return this._settings.itemColor;
@@ -1341,13 +1341,13 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1341
1341
  return this._settings.itemSize;
1342
1342
  }
1343
1343
  get placeholder() {
1344
- return this.api.i18n.t(St);
1344
+ return this.api.i18n.t(bt);
1345
1345
  }
1346
1346
  setupItemPlaceholder(e) {
1347
- this.readOnly || S(e, this.placeholder);
1347
+ this.readOnly || Qe(e, this.placeholder);
1348
1348
  }
1349
1349
  render() {
1350
- return this._element = _n({
1350
+ return this._element = hn({
1351
1351
  data: this._data,
1352
1352
  readOnly: this.readOnly,
1353
1353
  placeholder: this.placeholder,
@@ -1377,31 +1377,31 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1377
1377
  t !== n && this.adjustDepthTo(n);
1378
1378
  }
1379
1379
  adjustDepthTo(e) {
1380
- en(this._element, this._data, e);
1380
+ Qt(this._element, this._data, e);
1381
1381
  }
1382
1382
  removed() {
1383
1383
  var e;
1384
1384
  this._data.style === "ordered" && (this.api.events.off("block changed", this.handleBlockChanged), (e = this.markerManager) == null || e.scheduleUpdateAll());
1385
1385
  }
1386
1386
  updateAllOrderedListMarkers() {
1387
- dn(this.api.blocks, this.depthValidator, this.markerCalculator);
1387
+ ln(this.api.blocks, this.depthValidator, this.markerCalculator);
1388
1388
  }
1389
1389
  updateMarker() {
1390
1390
  var e;
1391
1391
  let t = (e = this._element) == null ? void 0 : e.querySelector("[data-list-marker]");
1392
1392
  if (!t) return;
1393
1393
  let n = this.getDepth();
1394
- t.textContent = sn(an(this.blockId, n, this._data.style, this.api.blocks, this.markerCalculator), n, this._data, this.blockId, this.api.blocks, this.markerCalculator);
1394
+ t.textContent = an(nn(this.blockId, n, this._data.style, this.api.blocks, this.markerCalculator), n, this._data, this.blockId, this.api.blocks, this.markerCalculator);
1395
1395
  }
1396
1396
  updateSiblingListMarkers() {
1397
1397
  var e;
1398
1398
  let t = this.blockId ? (e = this.api.blocks.getBlockIndex(this.blockId)) == null ? this.api.blocks.getCurrentBlockIndex() : e : this.api.blocks.getCurrentBlockIndex(), n = this.getDepth(), r = this._data.style, i = this.api.blocks.getBlocksCount();
1399
- un(cn(t, n, r, this.markerCalculator), i, t, n, r, this.api.blocks, this.depthValidator, this.markerCalculator);
1399
+ cn(on(t, n, r, this.markerCalculator), i, t, n, r, this.api.blocks, this.depthValidator, this.markerCalculator);
1400
1400
  }
1401
1401
  updateMarkerForDepth(e, t) {
1402
1402
  var n;
1403
1403
  let r = (n = this._element) == null ? void 0 : n.querySelector("[aria-hidden=\"true\"]");
1404
- r instanceof HTMLElement && (t === "ordered" ? r.textContent = sn(an(this.blockId, e, this._data.style, this.api.blocks, this.markerCalculator), e, this._data, this.blockId, this.api.blocks, this.markerCalculator) : r.textContent = rn(e, this.markerCalculator));
1404
+ r instanceof HTMLElement && (t === "ordered" ? r.textContent = an(nn(this.blockId, e, this._data.style, this.api.blocks, this.markerCalculator), e, this._data, this.blockId, this.api.blocks, this.markerCalculator) : r.textContent = tn(e, this.markerCalculator));
1405
1405
  }
1406
1406
  updateCheckboxState(e) {
1407
1407
  var t;
@@ -1431,7 +1431,7 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1431
1431
  }
1432
1432
  async handleEnter() {
1433
1433
  var e = this;
1434
- await fn({
1434
+ await un({
1435
1435
  api: e.api,
1436
1436
  blockId: e.blockId,
1437
1437
  data: e._data,
@@ -1443,7 +1443,7 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1443
1443
  }
1444
1444
  async handleBackspace(e) {
1445
1445
  var t = this;
1446
- await mn({
1446
+ await fn({
1447
1447
  api: t.api,
1448
1448
  blockId: t.blockId,
1449
1449
  data: t._data,
@@ -1455,7 +1455,7 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1455
1455
  }
1456
1456
  async handleIndent() {
1457
1457
  var e = this;
1458
- await hn({
1458
+ await pn({
1459
1459
  api: e.api,
1460
1460
  blockId: e.blockId,
1461
1461
  data: e._data,
@@ -1467,7 +1467,7 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1467
1467
  }
1468
1468
  async handleOutdent() {
1469
1469
  var e = this;
1470
- await gn({
1470
+ await mn({
1471
1471
  api: e.api,
1472
1472
  blockId: e.blockId,
1473
1473
  data: e._data,
@@ -1485,10 +1485,10 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1485
1485
  n instanceof HTMLInputElement && (this._data.checked = n.checked);
1486
1486
  }
1487
1487
  getContentElement() {
1488
- return $t(this._element, this._data.style);
1488
+ return Zt(this._element, this._data.style);
1489
1489
  }
1490
1490
  renderSettings() {
1491
- return It(this.availableStyles, this._data.style, this.api.i18n.t, (e) => this.setStyle(e));
1491
+ return Pt(this.availableStyles, this._data.style, this.api.i18n.t, (e) => this.setStyle(e));
1492
1492
  }
1493
1493
  setStyle(e) {
1494
1494
  let t = this._data.style;
@@ -1498,7 +1498,7 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1498
1498
  }
1499
1499
  }
1500
1500
  rerender() {
1501
- let e = Mt({
1501
+ let e = At({
1502
1502
  data: this._data,
1503
1503
  readOnly: this.readOnly,
1504
1504
  placeholder: this.placeholder,
@@ -1517,10 +1517,10 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1517
1517
  return typeof e.text == "string";
1518
1518
  }
1519
1519
  save() {
1520
- return Nt(this._data, this._element, this.getContentElement.bind(this));
1520
+ return jt(this._data, this._element, this.getContentElement.bind(this));
1521
1521
  }
1522
1522
  setData(e) {
1523
- let t = Pt(this._data, e, this._element, this.getContentElement.bind(this), {
1523
+ let t = Mt(this._data, e, this._element, this.getContentElement.bind(this), {
1524
1524
  adjustDepthTo: this.adjustDepthTo.bind(this),
1525
1525
  updateMarkerForDepth: this.updateMarkerForDepth.bind(this),
1526
1526
  updateCheckboxState: this.updateCheckboxState.bind(this)
@@ -1528,31 +1528,31 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1528
1528
  return this._data = t.newData, t.inPlace;
1529
1529
  }
1530
1530
  merge(e) {
1531
- Ft({
1531
+ Nt({
1532
1532
  data: this._data,
1533
1533
  element: this._element,
1534
1534
  getContentElement: this.getContentElement.bind(this),
1535
- parseHTML: Ht
1535
+ parseHTML: Bt
1536
1536
  }, e);
1537
1537
  }
1538
1538
  static get conversionConfig() {
1539
- return Mn();
1539
+ return An();
1540
1540
  }
1541
1541
  static get sanitize() {
1542
- return An();
1542
+ return On();
1543
1543
  }
1544
1544
  static get pasteConfig() {
1545
- return jn();
1545
+ return kn();
1546
1546
  }
1547
1547
  onPaste(e) {
1548
1548
  let t = e.detail;
1549
1549
  if (!("data" in t)) return;
1550
1550
  let n = t.data;
1551
- if (!Cn(n)) return;
1552
- let { text: r, checked: i } = On(n), a = kn(n);
1551
+ if (!xn(n)) return;
1552
+ let { text: r, checked: i } = En(n), a = Dn(n);
1553
1553
  this._data = {
1554
1554
  text: r,
1555
- style: Dn(n, this._data.style),
1555
+ style: Tn(n, this._data.style),
1556
1556
  checked: i,
1557
1557
  depth: a
1558
1558
  }, this.rerender();
@@ -1561,18 +1561,18 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1561
1561
  return !0;
1562
1562
  }
1563
1563
  getContentOffset(e) {
1564
- return zt(e);
1564
+ return Lt(e);
1565
1565
  }
1566
1566
  static get toolbox() {
1567
- return Pn();
1567
+ return Mn();
1568
1568
  }
1569
- }, In = "data-blok-table-add-row", Ln = "data-blok-table-add-col", Rn = 150, zn = 5, Bn = 40, Vn = [
1569
+ }, Pn = "data-blok-table-add-row", Fn = "data-blok-table-add-col", In = 150, Ln = 5, Rn = 40, zn = [
1570
1570
  "flex",
1571
1571
  "items-center",
1572
1572
  "justify-center",
1573
1573
  "transition-opacity",
1574
1574
  "duration-150"
1575
- ], Hn = [
1575
+ ], Bn = [
1576
1576
  "flex",
1577
1577
  "items-center",
1578
1578
  "justify-center",
@@ -1580,7 +1580,7 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1580
1580
  "border-gray-300",
1581
1581
  "rounded-full",
1582
1582
  "group-hover/add:bg-gray-50"
1583
- ], Un = "12", Wn = class {
1583
+ ], Vn = "12", Hn = class {
1584
1584
  constructor(e) {
1585
1585
  this.rowHideTimeout = null, this.colHideTimeout = null, this.rowVisible = !1, this.colVisible = !1, this.interactive = !0, this.dragState = null, this.scrollContainer = null, this.boundScrollHandler = null, this.scrollContainerResizeObserver = null, this.wrapper = e.wrapper, this.grid = e.grid, this.i18n = e.i18n, this.boundAddRowClick = e.onAddRow, this.boundAddColClick = e.onAddColumn, this.onDragStart = e.onDragStart, this.onDragAddRow = e.onDragAddRow, this.onDragRemoveRow = e.onDragRemoveRow, this.onDragAddCol = e.onDragAddCol, this.onDragRemoveCol = e.onDragRemoveCol, this.onDragEnd = e.onDragEnd, this.getNewColumnWidth = e.getNewColumnWidth, this.boundMouseMove = this.handleMouseMove.bind(this), this.boundDocumentMouseMove = this.handleDocumentMouseMove.bind(this), this.boundMouseLeave = this.handleMouseLeave.bind(this), this.boundPointerMove = this.handlePointerMove.bind(this), this.boundPointerUp = this.handlePointerUp.bind(this), this.boundPointerCancel = this.handlePointerCancel.bind(this), this.boundRowPointerDown = (e) => this.handlePointerDown("row", e), this.boundColPointerDown = (e) => this.handlePointerDown("col", e), this.addRowBtn = this.createAddRowButton(), this.addColBtn = this.createAddColumnButton(), this.wrapper.appendChild(this.addRowBtn), this.wrapper.appendChild(this.addColBtn), this.syncRowButtonWidth(), this.wrapper.addEventListener("mousemove", this.boundMouseMove), this.wrapper.addEventListener("mouseleave", this.boundMouseLeave), document.addEventListener("mousemove", this.boundDocumentMouseMove), this.addRowBtn.addEventListener("pointerdown", this.boundRowPointerDown), this.addColBtn.addEventListener("pointerdown", this.boundColPointerDown);
1586
1586
  }
@@ -1656,7 +1656,7 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1656
1656
  let { axis: t, startPos: n, unitSize: r } = this.dragState, i = (t === "row" ? e.clientY : e.clientX) - n, a = Math.floor(i / r);
1657
1657
  for (; this.dragState.addedCount < a;) t === "row" ? this.onDragAddRow() : this.onDragAddCol(), this.dragState.addedCount++;
1658
1658
  for (; this.dragState.addedCount > a;) t === "row" ? this.onDragRemoveRow() : this.onDragRemoveCol(), this.dragState.addedCount--;
1659
- Math.abs(i) > zn && !this.dragState.didDrag && (this.dragState.didDrag = !0, document.body.style.cursor = t === "row" ? "row-resize" : "col-resize", Ke(), this.onDragStart());
1659
+ Math.abs(i) > Ln && !this.dragState.didDrag && (this.dragState.didDrag = !0, document.body.style.cursor = t === "row" ? "row-resize" : "col-resize", re(), this.onDragStart());
1660
1660
  }
1661
1661
  handlePointerUp(e) {
1662
1662
  if (!this.dragState) return;
@@ -1685,14 +1685,14 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1685
1685
  }
1686
1686
  handleMouseMove(e) {
1687
1687
  let t = this.grid.getBoundingClientRect(), n = this.grid.parentElement, r = n !== null && n !== this.wrapper ? Math.min(t.right, n.getBoundingClientRect().right) : t.right, i = Math.abs(e.clientY - t.bottom), a = Math.abs(e.clientX - r);
1688
- i <= Bn ? this.showRow() : this.scheduleHideRow(), a <= Bn ? this.showCol() : this.scheduleHideCol();
1688
+ i <= Rn ? this.showRow() : this.scheduleHideRow(), a <= Rn ? this.showCol() : this.scheduleHideCol();
1689
1689
  }
1690
1690
  handleMouseLeave() {
1691
1691
  this.scheduleHideRow(), this.scheduleHideCol();
1692
1692
  }
1693
1693
  handleDocumentMouseMove(e) {
1694
1694
  if (this.wrapper.contains(e.target)) return;
1695
- let t = this.grid.getBoundingClientRect(), n = Bn;
1695
+ let t = this.grid.getBoundingClientRect(), n = Rn;
1696
1696
  e.clientX >= t.left - n && e.clientX <= t.right + n && e.clientY >= t.top - n && e.clientY <= t.bottom + n && this.handleMouseMove(e);
1697
1697
  }
1698
1698
  showRow() {
@@ -1705,13 +1705,13 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1705
1705
  var e;
1706
1706
  !this.rowVisible || this.rowHideTimeout !== null || ((e = this.dragState) == null ? void 0 : e.axis) === "row" || (this.rowHideTimeout = setTimeout(() => {
1707
1707
  this.addRowBtn.style.opacity = "0", this.addRowBtn.style.pointerEvents = "none", this.rowVisible = !1, this.rowHideTimeout = null;
1708
- }, Rn));
1708
+ }, In));
1709
1709
  }
1710
1710
  scheduleHideCol() {
1711
1711
  var e;
1712
1712
  !this.colVisible || this.colHideTimeout !== null || ((e = this.dragState) == null ? void 0 : e.axis) === "col" || (this.colHideTimeout = setTimeout(() => {
1713
1713
  this.addColBtn.style.opacity = "0", this.addColBtn.style.pointerEvents = "none", this.colVisible = !1, this.colHideTimeout = null;
1714
- }, Rn));
1714
+ }, In));
1715
1715
  }
1716
1716
  clearRowTimeout() {
1717
1717
  this.rowHideTimeout !== null && (clearTimeout(this.rowHideTimeout), this.rowHideTimeout = null);
@@ -1721,25 +1721,25 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1721
1721
  }
1722
1722
  createAddRowButton() {
1723
1723
  let e = document.createElement("div");
1724
- e.className = b(Vn, "group/add", "items-start", "cursor-row-resize"), e.setAttribute(In, ""), e.setAttribute("contenteditable", "false"), e.style.opacity = "0", e.style.pointerEvents = "none", e.style.position = "absolute", e.style.left = "0", e.style.bottom = "-36px", e.style.zIndex = "1", e.style.height = "32px";
1724
+ e.className = C(zn, "group/add", "items-start", "cursor-row-resize"), e.setAttribute(Pn, ""), e.setAttribute("contenteditable", "false"), e.style.opacity = "0", e.style.pointerEvents = "none", e.style.position = "absolute", e.style.left = "0", e.style.bottom = "-36px", e.style.zIndex = "1", e.style.height = "32px";
1725
1725
  let t = document.createElement("div");
1726
- return t.className = b(Hn), t.style.width = "100%", t.style.height = "16px", this.appendIcon(t), e.appendChild(t), ae(e, we([this.i18n.t("tools.table.clickToAddRow"), this.i18n.t("tools.table.dragToAddRemoveRows")]), {
1726
+ return t.className = C(Bn), t.style.width = "100%", t.style.height = "16px", this.appendIcon(t), e.appendChild(t), r(e, ve([this.i18n.t("tools.table.clickToAddRow"), this.i18n.t("tools.table.dragToAddRemoveRows")]), {
1727
1727
  placement: "bottom",
1728
1728
  marginTop: -16
1729
1729
  }), e;
1730
1730
  }
1731
1731
  createAddColumnButton() {
1732
1732
  let e = document.createElement("div");
1733
- e.className = b(Vn, "group/add", "justify-start", "cursor-col-resize"), e.setAttribute(Ln, ""), e.setAttribute("contenteditable", "false"), e.style.opacity = "0", e.style.pointerEvents = "none", e.style.position = "absolute", e.style.right = "-36px", e.style.top = "0px", e.style.bottom = "0px", e.style.width = "32px";
1733
+ e.className = C(zn, "group/add", "justify-start", "cursor-col-resize"), e.setAttribute(Fn, ""), e.setAttribute("contenteditable", "false"), e.style.opacity = "0", e.style.pointerEvents = "none", e.style.position = "absolute", e.style.right = "-36px", e.style.top = "0px", e.style.bottom = "0px", e.style.width = "32px";
1734
1734
  let t = document.createElement("div");
1735
- return t.className = b(Hn), t.style.width = "16px", t.style.height = "100%", this.appendIcon(t), e.appendChild(t), ae(e, we([this.i18n.t("tools.table.clickToAddColumn"), this.i18n.t("tools.table.dragToAddRemoveColumns")]), { placement: "bottom" }), e;
1735
+ return t.className = C(Bn), t.style.width = "16px", t.style.height = "100%", this.appendIcon(t), e.appendChild(t), r(e, ve([this.i18n.t("tools.table.clickToAddColumn"), this.i18n.t("tools.table.dragToAddRemoveColumns")]), { placement: "bottom" }), e;
1736
1736
  }
1737
1737
  appendIcon(e) {
1738
- e.insertAdjacentHTML("beforeend", le);
1738
+ e.insertAdjacentHTML("beforeend", ce);
1739
1739
  let t = e.querySelector("svg");
1740
- t && (t.setAttribute("width", Un), t.setAttribute("height", Un), t.setAttribute("viewBox", "0 0 24 24"), t.classList.add("text-gray-500", "pointer-events-none"));
1740
+ t && (t.setAttribute("width", Vn), t.setAttribute("height", Vn), t.setAttribute("viewBox", "0 0 24 24"), t.classList.add("text-gray-500", "pointer-events-none"));
1741
1741
  }
1742
- }, T = "data-blok-table-row", E = "data-blok-table-cell", D = "1px solid #d1d5db", Gn = ["flex"], Kn = [
1742
+ }, D = "data-blok-table-row", O = "data-blok-table-cell", k = "1px solid #d1d5db", Un = ["flex"], Wn = [
1743
1743
  "py-1",
1744
1744
  "px-2",
1745
1745
  "min-h-[2em]",
@@ -1747,37 +1747,37 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1747
1747
  "leading-normal",
1748
1748
  "text-sm",
1749
1749
  "cursor-text"
1750
- ], qn = (e) => {
1750
+ ], Gn = (e) => {
1751
1751
  let t = Math.round(100 / e * 100) / 100;
1752
1752
  return Array.from({ length: e }, () => t);
1753
- }, Jn = class {
1753
+ }, Kn = class {
1754
1754
  constructor(e) {
1755
1755
  this.readOnly = e.readOnly;
1756
1756
  }
1757
1757
  createGrid(e, t, n) {
1758
1758
  let r = document.createElement("div");
1759
- r.style.borderTop = D, r.style.borderLeft = D;
1760
- let i = n == null ? qn(t) : n;
1759
+ r.style.borderTop = k, r.style.borderLeft = k;
1760
+ let i = n == null ? Gn(t) : n;
1761
1761
  return Array.from({ length: e }).forEach(() => {
1762
1762
  r.appendChild(this.createRow(t, i));
1763
1763
  }), r;
1764
1764
  }
1765
1765
  fillGrid(e, t) {}
1766
1766
  addRow(e, t) {
1767
- let n = this.getColumnCount(e), r = this.getRawCellWidths(e), i = this.createRow(n, r), a = e.querySelectorAll(`[${T}]`);
1767
+ let n = this.getColumnCount(e), r = this.getRawCellWidths(e), i = this.createRow(n, r), a = e.querySelectorAll(`[${D}]`);
1768
1768
  return t !== void 0 && t < a.length ? e.insertBefore(i, a[t]) : e.appendChild(i), i;
1769
1769
  }
1770
1770
  deleteRow(e, t) {
1771
- let n = e.querySelectorAll(`[${T}]`);
1771
+ let n = e.querySelectorAll(`[${D}]`);
1772
1772
  t < n.length && n[t].remove();
1773
1773
  }
1774
1774
  addColumn(e, t, n, r) {
1775
- let i = e.querySelectorAll(`[${T}]`), a = this.getColumnCount(e), o = n !== void 0 && n.length === a, s = o || this.detectWidthUnit(e) === "px";
1775
+ let i = e.querySelectorAll(`[${D}]`), a = this.getColumnCount(e), o = n !== void 0 && n.length === a, s = o || this.detectWidthUnit(e) === "px";
1776
1776
  return o && this.convertToPixelWidths(i, n), s ? (this.addColumnPx(i, a, t, r), !0) : (this.addColumnPercent(i, a, t), !0);
1777
1777
  }
1778
1778
  convertToPixelWidths(e, t) {
1779
1779
  e.forEach((e) => {
1780
- e.querySelectorAll(`[${E}]`).forEach((e, n) => {
1780
+ e.querySelectorAll(`[${O}]`).forEach((e, n) => {
1781
1781
  if (n < t.length) {
1782
1782
  let r = e;
1783
1783
  r.style.width = `${t[n]}px`;
@@ -1788,7 +1788,7 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1788
1788
  addColumnPx(e, t, n, r) {
1789
1789
  let i = r == null ? this.computeHalfAvgPxWidth(e, t) : r;
1790
1790
  e.forEach((e) => {
1791
- let t = e.querySelectorAll(`[${E}]`), r = n === void 0 || n >= t.length, a = this.createCell(`${i}px`);
1791
+ let t = e.querySelectorAll(`[${O}]`), r = n === void 0 || n >= t.length, a = this.createCell(`${i}px`);
1792
1792
  if (!r) {
1793
1793
  e.insertBefore(a, t[n]);
1794
1794
  return;
@@ -1797,17 +1797,17 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1797
1797
  });
1798
1798
  }
1799
1799
  computeHalfAvgPxWidth(e, t) {
1800
- let n = e[0], r = n == null ? void 0 : n.querySelectorAll(`[${E}]`), i = Array.from(r == null ? [] : r).reduce((e, t) => e + (parseFloat(t.style.width) || 0), 0);
1800
+ let n = e[0], r = n == null ? void 0 : n.querySelectorAll(`[${O}]`), i = Array.from(r == null ? [] : r).reduce((e, t) => e + (parseFloat(t.style.width) || 0), 0);
1801
1801
  return t > 0 ? Math.round(i / t / 2 * 100) / 100 : 0;
1802
1802
  }
1803
1803
  addColumnPercent(e, t, n) {
1804
1804
  let r = 1 - .5 / t;
1805
1805
  e.forEach((e) => {
1806
- e.querySelectorAll(`[${E}]`).forEach((e) => {
1806
+ e.querySelectorAll(`[${O}]`).forEach((e) => {
1807
1807
  let n = e, i = parseFloat(n.style.width) || 100 / t, a = Math.round(i * r * 100) / 100;
1808
1808
  n.style.width = `${a}%`;
1809
1809
  });
1810
- let i = Math.round(100 / t / 2 * 100) / 100, a = e.querySelectorAll(`[${E}]`), o = n === void 0 || n >= a.length, s = this.createCell(`${i}%`);
1810
+ let i = Math.round(100 / t / 2 * 100) / 100, a = e.querySelectorAll(`[${O}]`), o = n === void 0 || n >= a.length, s = this.createCell(`${i}%`);
1811
1811
  if (!o) {
1812
1812
  e.insertBefore(s, a[n]);
1813
1813
  return;
@@ -1816,77 +1816,77 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1816
1816
  });
1817
1817
  }
1818
1818
  deleteColumn(e, t) {
1819
- e.querySelectorAll(`[${T}]`).forEach((e) => {
1820
- let n = e.querySelectorAll(`[${E}]`);
1819
+ e.querySelectorAll(`[${D}]`).forEach((e) => {
1820
+ let n = e.querySelectorAll(`[${O}]`);
1821
1821
  t >= n.length || n[t].remove();
1822
1822
  });
1823
1823
  }
1824
1824
  moveRow(e, t, n) {
1825
1825
  if (t === n) return;
1826
- let r = Array.from(e.querySelectorAll(`[${T}]`));
1826
+ let r = Array.from(e.querySelectorAll(`[${D}]`));
1827
1827
  if (t >= r.length || n >= r.length) return;
1828
1828
  let i = r[t];
1829
1829
  i.remove();
1830
- let a = Array.from(e.querySelectorAll(`[${T}]`));
1830
+ let a = Array.from(e.querySelectorAll(`[${D}]`));
1831
1831
  n >= a.length ? e.appendChild(i) : e.insertBefore(i, a[n]);
1832
1832
  }
1833
1833
  moveColumn(e, t, n) {
1834
- t !== n && e.querySelectorAll(`[${T}]`).forEach((e) => {
1835
- let r = Array.from(e.querySelectorAll(`[${E}]`));
1834
+ t !== n && e.querySelectorAll(`[${D}]`).forEach((e) => {
1835
+ let r = Array.from(e.querySelectorAll(`[${O}]`));
1836
1836
  if (t >= r.length || n >= r.length) return;
1837
1837
  let i = r[t];
1838
1838
  i.remove();
1839
- let a = Array.from(e.querySelectorAll(`[${E}]`));
1839
+ let a = Array.from(e.querySelectorAll(`[${O}]`));
1840
1840
  n >= a.length ? e.appendChild(i) : e.insertBefore(i, a[n]);
1841
1841
  });
1842
1842
  }
1843
1843
  getRowCount(e) {
1844
- return e.querySelectorAll(`[${T}]`).length;
1844
+ return e.querySelectorAll(`[${D}]`).length;
1845
1845
  }
1846
1846
  getColumnCount(e) {
1847
- let t = e.querySelector(`[${T}]`);
1848
- return t ? t.querySelectorAll(`[${E}]`).length : 0;
1847
+ let t = e.querySelector(`[${D}]`);
1848
+ return t ? t.querySelectorAll(`[${O}]`).length : 0;
1849
1849
  }
1850
1850
  getCell(e, t, n) {
1851
- let r = e.querySelectorAll(`[${T}]`);
1851
+ let r = e.querySelectorAll(`[${D}]`);
1852
1852
  if (t >= r.length) return null;
1853
- let i = r[t].querySelectorAll(`[${E}]`);
1853
+ let i = r[t].querySelectorAll(`[${O}]`);
1854
1854
  return n >= i.length ? null : i[n];
1855
1855
  }
1856
1856
  getColWidths(e) {
1857
- let t = e.querySelector(`[${T}]`);
1857
+ let t = e.querySelector(`[${D}]`);
1858
1858
  if (!t) return [];
1859
- let n = t.querySelectorAll(`[${E}]`), r = [];
1859
+ let n = t.querySelectorAll(`[${O}]`), r = [];
1860
1860
  return n.forEach((e) => {
1861
1861
  let t = parseFloat(e.style.width);
1862
1862
  r.push(isNaN(t) ? 0 : t);
1863
1863
  }), r;
1864
1864
  }
1865
1865
  detectWidthUnit(e) {
1866
- let t = e.querySelector(`[${T}]`);
1866
+ let t = e.querySelector(`[${D}]`);
1867
1867
  if (!t) return "%";
1868
- let n = t.querySelector(`[${E}]`);
1868
+ let n = t.querySelector(`[${O}]`);
1869
1869
  return n && n.style.width.endsWith("px") ? "px" : "%";
1870
1870
  }
1871
1871
  getRawCellWidths(e) {
1872
- let t = e.querySelector(`[${T}]`);
1872
+ let t = e.querySelector(`[${D}]`);
1873
1873
  if (!t) return [];
1874
- let n = t.querySelectorAll(`[${E}]`);
1874
+ let n = t.querySelectorAll(`[${O}]`);
1875
1875
  return Array.from(n).map((e) => e.style.width);
1876
1876
  }
1877
1877
  createRow(e, t) {
1878
1878
  let n = document.createElement("div");
1879
- return n.className = b(Gn), n.setAttribute(T, ""), Array.from({ length: e }).forEach((e, r) => {
1879
+ return n.className = C(Un), n.setAttribute(D, ""), Array.from({ length: e }).forEach((e, r) => {
1880
1880
  n.appendChild(this.createCell(t[r]));
1881
1881
  }), n;
1882
1882
  }
1883
1883
  createCell(e) {
1884
1884
  let t = document.createElement("div");
1885
- t.className = b(Kn), t.style.borderRight = D, t.style.borderBottom = D, t.style.flexShrink = "0", t.style.overflow = "hidden", t.style.overflowWrap = "break-word", e !== void 0 && (t.style.width = typeof e == "string" ? e : `${e}%`), t.setAttribute(E, "");
1885
+ t.className = C(Wn), t.style.borderRight = k, t.style.borderBottom = k, t.style.flexShrink = "0", t.style.overflow = "hidden", t.style.overflowWrap = "break-word", e !== void 0 && (t.style.width = typeof e == "string" ? e : `${e}%`), t.setAttribute(O, "");
1886
1886
  let n = document.createElement("div");
1887
- return n.setAttribute(k, ""), t.appendChild(n), t;
1887
+ return n.setAttribute(j, ""), t.appendChild(n), t;
1888
1888
  }
1889
- }, O = (e) => typeof e == "object" && !!e && "blocks" in e, k = "data-blok-table-cell-blocks", Yn = class {
1889
+ }, A = (e) => typeof e == "object" && !!e && "blocks" in e, j = "data-blok-table-cell-blocks", qn = class {
1890
1890
  constructor(e) {
1891
1891
  var t;
1892
1892
  this._activeCellWithBlocks = null, this.cellsPendingCheck = /* @__PURE__ */ new Set(), this.pendingCheckScheduled = !1, this.removedBlockCells = /* @__PURE__ */ new Map(), this.deferredEvents = [], this.isExitingTable = !1, this.handleBlockMutation = (e) => {
@@ -1908,9 +1908,9 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1908
1908
  this.claimBlockForCell(i.cell, n.target.id), this.syncBlockToModel(i.cell, n.target.id), this.cellsPendingCheck.delete(i.cell);
1909
1909
  return;
1910
1910
  }
1911
- let a = n.target.holder, o = a.closest(`[${k}]`);
1911
+ let a = n.target.holder, o = a.closest(`[${j}]`);
1912
1912
  o && this.stripPlaceholders(o);
1913
- let s = o && !this.model.findCellForBlock(n.target.id) ? o.closest(`[${E}]`) : null;
1913
+ let s = o && !this.model.findCellForBlock(n.target.id) ? o.closest(`[${O}]`) : null;
1914
1914
  if (s && this.syncBlockToModel(s, n.target.id), o) return;
1915
1915
  if (!this.gridElement.contains(a)) {
1916
1916
  let e = this.api.blocks.getCurrentBlockIndex(), t = e >= 0 ? this.api.blocks.getBlockByIndex(e) : null;
@@ -1924,11 +1924,11 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
1924
1924
  }, this.handleCellBlankSpaceClick = (e) => {
1925
1925
  let t = e.target;
1926
1926
  if (!t) return;
1927
- let n = t.hasAttribute(E), r = t.hasAttribute(k);
1927
+ let n = t.hasAttribute(O), r = t.hasAttribute(j);
1928
1928
  if (!n && !r) return;
1929
- let i = n ? t : t.closest(`[${E}]`);
1929
+ let i = n ? t : t.closest(`[${O}]`);
1930
1930
  if (!i) return;
1931
- let a = n ? i.querySelector(`[${k}]`) : t;
1931
+ let a = n ? i.querySelector(`[${j}]`) : t;
1932
1932
  if (!a) return;
1933
1933
  let o = a.querySelectorAll("[data-blok-id]"), s = o[o.length - 1];
1934
1934
  if (!s) return;
@@ -2026,7 +2026,7 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
2026
2026
  this.clearActiveCellWithBlocks();
2027
2027
  let r = this.getCell(e.row, e.col);
2028
2028
  if (!r) return;
2029
- let i = r.querySelector(`[${k}]`);
2029
+ let i = r.querySelector(`[${j}]`);
2030
2030
  if (!i) return;
2031
2031
  let a = i.querySelectorAll("[contenteditable=\"true\"]");
2032
2032
  a.length !== 0 && ((t ? a[a.length - 1] : a[0]).focus(), (n = this.onNavigateToCell) == null || n.call(this, e));
@@ -2045,18 +2045,18 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
2045
2045
  return r ? (n = r.querySelectorAll("[data-blok-table-cell]")[t]) == null ? null : n : null;
2046
2046
  }
2047
2047
  initializeCells(e) {
2048
- let t = this.gridElement.querySelectorAll(`[${T}]`), n = [];
2048
+ let t = this.gridElement.querySelectorAll(`[${D}]`), n = [];
2049
2049
  return e.forEach((e, r) => {
2050
2050
  let i = t[r];
2051
2051
  if (!i) return;
2052
- let a = i.querySelectorAll(`[${E}]`), o = [];
2052
+ let a = i.querySelectorAll(`[${O}]`), o = [];
2053
2053
  e.forEach((e, t) => {
2054
2054
  let n = a[t];
2055
2055
  if (!n) return;
2056
- let r = n.querySelector(`[${k}]`);
2056
+ let r = n.querySelector(`[${j}]`);
2057
2057
  if (!r) return;
2058
- let i = O(e) && e.blocks.length > 0 ? [...e.blocks] : null, s = i ? this.mountBlocksInCell(r, i) : [], c = {};
2059
- if (O(e) && (e.color !== void 0 && (c.color = e.color), e.textColor !== void 0 && (c.textColor = e.textColor)), s.length > 0) o.push(y({ blocks: i == null ? s : i }, c));
2058
+ let i = A(e) && e.blocks.length > 0 ? [...e.blocks] : null, s = i ? this.mountBlocksInCell(r, i) : [], c = {};
2059
+ if (A(e) && (e.color !== void 0 && (c.color = e.color), e.textColor !== void 0 && (c.textColor = e.textColor)), s.length > 0) o.push(S({ blocks: i == null ? s : i }, c));
2060
2060
  else {
2061
2061
  var l;
2062
2062
  let t = typeof e == "string" ? e : (l = e.text) == null ? "" : l, n = t.split(/<br\s*\/?>/i).map((e) => e.trim()).filter(Boolean), a = n.length > 0 ? n : [t], s = [];
@@ -2064,7 +2064,7 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
2064
2064
  let t = this.api.blocks.insert("paragraph", { text: e }, {}, this.api.blocks.getBlocksCount(), !1);
2065
2065
  r.appendChild(t.holder), this.api.blocks.setBlockParent(t.id, this.tableBlockId), s.push(t.id);
2066
2066
  }
2067
- o.push(y({ blocks: i === null ? s : [...i, ...s] }, c));
2067
+ o.push(S({ blocks: i === null ? s : [...i, ...s] }, c));
2068
2068
  }
2069
2069
  this.stripPlaceholders(r);
2070
2070
  }), n.push(o);
@@ -2089,7 +2089,7 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
2089
2089
  }
2090
2090
  claimBlockForCell(e, t) {
2091
2091
  var n, r;
2092
- let i = e.querySelector(`[${k}]`);
2092
+ let i = e.querySelector(`[${j}]`);
2093
2093
  if (!i) return;
2094
2094
  let a = this.api.blocks.getBlockIndex(t);
2095
2095
  if (a === void 0) return;
@@ -2103,12 +2103,12 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
2103
2103
  }
2104
2104
  findCellForAdjacentBlock(e) {
2105
2105
  if (e < 0 || e >= this.api.blocks.getBlocksCount()) return null;
2106
- let t = this.api.blocks.getBlockByIndex(e), n = t == null ? void 0 : t.holder.closest(`[${E}]`);
2106
+ let t = this.api.blocks.getBlockByIndex(e), n = t == null ? void 0 : t.holder.closest(`[${O}]`);
2107
2107
  return n && this.gridElement.contains(n) ? n : null;
2108
2108
  }
2109
2109
  ensureCellHasBlock(e) {
2110
2110
  var t, n;
2111
- let r = e.querySelector(`[${k}]`);
2111
+ let r = e.querySelector(`[${j}]`);
2112
2112
  r && r.querySelector("[data-blok-id]") === null && ((t = (n = this.api.blocks).transactWithoutCapture) == null || t.call(n, () => {
2113
2113
  let t = this.api.blocks.insert("paragraph", { text: "" }, {}, this.api.blocks.getBlocksCount(), !0);
2114
2114
  r.appendChild(t.holder), this.api.blocks.setBlockParent(t.id, this.tableBlockId), this.syncBlockToModel(e, t.id), this.stripPlaceholders(r);
@@ -2130,11 +2130,11 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
2130
2130
  n && this.model.addBlockToCell(n.row, n.col, t);
2131
2131
  }
2132
2132
  getCellPosition(e) {
2133
- let t = e.closest(`[${T}]`);
2133
+ let t = e.closest(`[${D}]`);
2134
2134
  if (!t) return null;
2135
- let n = Array.from(this.gridElement.querySelectorAll(`[${T}]`)).indexOf(t);
2135
+ let n = Array.from(this.gridElement.querySelectorAll(`[${D}]`)).indexOf(t);
2136
2136
  if (n < 0) return null;
2137
- let r = Array.from(t.querySelectorAll(`[${E}]`)).indexOf(e);
2137
+ let r = Array.from(t.querySelectorAll(`[${O}]`)).indexOf(e);
2138
2138
  return r < 0 ? null : {
2139
2139
  row: n,
2140
2140
  col: r
@@ -2142,7 +2142,7 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
2142
2142
  }
2143
2143
  recordRemovedBlockCell(e) {
2144
2144
  if (e.index === void 0) return;
2145
- let t = e.target.holder.closest(`[${E}]`);
2145
+ let t = e.target.holder.closest(`[${O}]`);
2146
2146
  t && this.gridElement.contains(t) && this.removedBlockCells.set(e.target.id, {
2147
2147
  cell: t,
2148
2148
  index: e.index
@@ -2190,7 +2190,7 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
2190
2190
  getBlockIdsFromCells(e) {
2191
2191
  let t = [];
2192
2192
  return Array.from(e).forEach((e) => {
2193
- let n = e.querySelector(`[${k}]`);
2193
+ let n = e.querySelector(`[${j}]`);
2194
2194
  n && n.querySelectorAll("[data-blok-id]").forEach((e) => {
2195
2195
  let n = e.getAttribute("data-blok-id");
2196
2196
  n && t.push(n);
@@ -2203,7 +2203,7 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
2203
2203
  });
2204
2204
  }
2205
2205
  deleteAllBlocks() {
2206
- let e = this.gridElement.querySelectorAll(`[${E}]`), t = this.getBlockIdsFromCells(e);
2206
+ let e = this.gridElement.querySelectorAll(`[${O}]`), t = this.getBlockIdsFromCells(e);
2207
2207
  this.deleteBlocks(t);
2208
2208
  }
2209
2209
  destroy() {
@@ -2220,13 +2220,13 @@ var vt = "outline-hidden py-[3px] mt-[2px] mb-px", yt = "outline-hidden pl-0.5 l
2220
2220
  };
2221
2221
  //#endregion
2222
2222
  //#region src/components/shared/color-picker.ts
2223
- function Xn(e, t) {
2223
+ function Jn(e, t) {
2224
2224
  if (e === t) return !0;
2225
- let n = Ce(e), r = Ce(t);
2225
+ let n = Ee(e), r = Ee(t);
2226
2226
  return n === null || r === null ? !1 : n[0] === r[0] && n[1] === r[1] && n[2] === r[2];
2227
2227
  }
2228
- var Zn = "flex-1 py-1.5 text-xs text-center rounded-md cursor-pointer border-none outline-hidden transition-colors", Qn = "#f7f7f5";
2229
- function $n(e) {
2228
+ var Yn = "flex-1 py-1.5 text-xs text-center rounded-md cursor-pointer border-none outline-hidden transition-colors", Xn = "#f7f7f5";
2229
+ function Zn(e) {
2230
2230
  var t;
2231
2231
  let { i18n: n, modes: r, testIdPrefix: i, onColorSelect: a } = e, o = (t = e.defaultModeIndex) == null ? 0 : t, s = {
2232
2232
  modeIndex: o,
@@ -2243,20 +2243,20 @@ function $n(e) {
2243
2243
  }), u.push(r), l.appendChild(r);
2244
2244
  });
2245
2245
  let d = () => {
2246
- for (let [e, t] of u.entries()) t.className = b(Zn, e === s.modeIndex ? "bg-item-hover-bg font-medium" : "bg-transparent hover:bg-item-hover-bg/50");
2246
+ for (let [e, t] of u.entries()) t.className = C(Yn, e === s.modeIndex ? "bg-item-hover-bg font-medium" : "bg-transparent hover:bg-item-hover-bg/50");
2247
2247
  }, f = document.createElement("div");
2248
2248
  f.setAttribute("data-blok-testid", `${i}-grid`), f.className = "grid grid-cols-5 gap-1.5";
2249
2249
  let p = () => {
2250
2250
  f.innerHTML = "";
2251
2251
  let e = r[s.modeIndex];
2252
- for (let t of de) {
2253
- let n = document.createElement("button"), r = e.presetField === "text" ? t.text : t.bg, o = s.activeColor !== null && Xn(r, s.activeColor);
2254
- n.setAttribute("data-blok-testid", `${i}-swatch-${t.name}`), n.className = b("w-8 h-8 rounded-md cursor-pointer border-none outline-hidden", "flex items-center justify-center text-sm font-semibold", "transition-shadow ring-inset hover:ring-2 hover:ring-black/10", o && "ring-2 ring-black/30"), n.textContent = "A", e.presetField === "text" ? (n.style.color = t.text, n.style.backgroundColor = Qn) : (n.style.color = "", n.style.backgroundColor = t.bg), n.addEventListener("click", () => {
2252
+ for (let t of ye) {
2253
+ let n = document.createElement("button"), r = e.presetField === "text" ? t.text : t.bg, o = s.activeColor !== null && Jn(r, s.activeColor);
2254
+ n.setAttribute("data-blok-testid", `${i}-swatch-${t.name}`), n.className = C("w-8 h-8 rounded-md cursor-pointer border-none outline-hidden", "flex items-center justify-center text-sm font-semibold", "transition-shadow ring-inset hover:ring-2 hover:ring-black/10", o && "ring-2 ring-black/30"), n.textContent = "A", e.presetField === "text" ? (n.style.color = t.text, n.style.backgroundColor = Xn) : (n.style.color = "", n.style.backgroundColor = t.bg), n.addEventListener("click", () => {
2255
2255
  a(r, e.key);
2256
2256
  }), f.appendChild(n);
2257
2257
  }
2258
2258
  }, m = document.createElement("button");
2259
- return m.setAttribute("data-blok-testid", `${i}-default-btn`), m.className = b("w-full py-1.5 text-xs text-center rounded-md cursor-pointer", "bg-transparent border-none outline-hidden hover:bg-item-hover-bg", "mt-0.5 transition-colors"), m.textContent = n.t("tools.marker.default"), m.addEventListener("click", () => {
2259
+ return m.setAttribute("data-blok-testid", `${i}-default-btn`), m.className = C("w-full py-1.5 text-xs text-center rounded-md cursor-pointer", "bg-transparent border-none outline-hidden hover:bg-item-hover-bg", "mt-0.5 transition-colors"), m.textContent = n.t("tools.marker.default"), m.addEventListener("click", () => {
2260
2260
  a(null, r[s.modeIndex].key);
2261
2261
  }), d(), p(), c.appendChild(l), c.appendChild(f), c.appendChild(m), {
2262
2262
  element: c,
@@ -2272,7 +2272,7 @@ function $n(e) {
2272
2272
  }
2273
2273
  //#endregion
2274
2274
  //#region src/tools/table/table-cell-color-picker.ts
2275
- var er = (e) => ({ element: $n({
2275
+ var Qn = (e) => ({ element: Zn({
2276
2276
  i18n: e.i18n,
2277
2277
  testIdPrefix: "cell-color",
2278
2278
  defaultModeIndex: 1,
@@ -2288,38 +2288,38 @@ var er = (e) => ({ element: $n({
2288
2288
  onColorSelect: (t, n) => {
2289
2289
  e.onColorSelect(t, n);
2290
2290
  }
2291
- }).element }), tr = [
2291
+ }).element }), $n = [
2292
2292
  [2, 2],
2293
2293
  [8, 2],
2294
2294
  [2, 7],
2295
2295
  [8, 7],
2296
2296
  [2, 12],
2297
2297
  [8, 12]
2298
- ], nr = [
2298
+ ], er = [
2299
2299
  [2, 2],
2300
2300
  [7, 2],
2301
2301
  [12, 2],
2302
2302
  [2, 8],
2303
2303
  [7, 8],
2304
2304
  [12, 8]
2305
- ], rr = (e) => {
2305
+ ], tr = (e) => {
2306
2306
  let t = document.createElementNS("http://www.w3.org/2000/svg", "svg"), n = e === "horizontal";
2307
2307
  t.setAttribute("width", n ? "14" : "10"), t.setAttribute("height", n ? "10" : "14"), t.setAttribute("viewBox", n ? "0 0 14 10" : "0 0 10 14"), t.setAttribute("fill", "currentColor"), t.classList.add("opacity-0", "transition-opacity", "duration-150", "text-gray-400", "pointer-events-none");
2308
- let r = n ? nr : tr;
2308
+ let r = n ? er : $n;
2309
2309
  for (let [e, n] of r) {
2310
2310
  let r = document.createElementNS("http://www.w3.org/2000/svg", "circle");
2311
2311
  r.setAttribute("cx", String(e)), r.setAttribute("cy", String(n)), r.setAttribute("r", "1.5"), t.appendChild(r);
2312
2312
  }
2313
2313
  return t;
2314
- }, ir = (e, t) => {
2314
+ }, nr = (e, t) => {
2315
2315
  t === "col" ? Object.assign(e.style, { height: "16px" }) : Object.assign(e.style, { width: "16px" }), e.classList.add("bg-gray-200"), e.classList.remove("bg-gray-300");
2316
2316
  let n = e.querySelector("svg");
2317
2317
  n && (n.classList.remove("opacity-0"), n.classList.add("opacity-100"));
2318
- }, ar = (e, t, n) => {
2318
+ }, rr = (e, t, n) => {
2319
2319
  t === "col" ? Object.assign(e.style, { height: `${n}px` }) : Object.assign(e.style, { width: `${n}px` }), e.classList.remove("bg-gray-200"), e.classList.add("bg-gray-300");
2320
2320
  let r = e.querySelector("svg");
2321
2321
  r && (r.classList.add("opacity-0"), r.classList.remove("opacity-100"));
2322
- }, or = "data-blok-table-cell-selected", sr = "2px solid #3b82f6", cr = "data-blok-table-selection-pill", lr = 16, ur = 20, dr = 4, fr = [
2322
+ }, ir = "data-blok-table-cell-selected", ar = "2px solid #3b82f6", or = "data-blok-table-selection-pill", sr = 16, cr = 20, lr = 4, ur = [
2323
2323
  "absolute",
2324
2324
  "z-3",
2325
2325
  "rounded-sm",
@@ -2332,7 +2332,7 @@ var er = (e) => ({ element: $n({
2332
2332
  "overflow-hidden",
2333
2333
  "cursor-pointer",
2334
2334
  "bg-blue-500"
2335
- ], pr = (e) => e.style.userSelect === "none", mr = class {
2335
+ ], dr = (e) => e.style.userSelect === "none", fr = class {
2336
2336
  constructor(e) {
2337
2337
  this.anchorCell = null, this.extentCell = null, this.isSelecting = !1, this.hasSelection = !1, this.selectedCells = [], this.overlay = null, this.pill = null, this.pillPopover = null, this.resizeObserver = null, this.lastPaintedRange = null, this.grid = e.grid, this.rectangleSelection = e.rectangleSelection, this.onSelectionActiveChange = e.onSelectionActiveChange, this.onClearContent = e.onClearContent, this.onCopy = e.onCopy, this.onCut = e.onCut, this.onCopyViaButton = e.onCopyViaButton, this.onColorChange = e.onColorChange, this.onSelectionRangeChange = e.onSelectionRangeChange, this.onPointerDragActiveChange = e.onPointerDragActiveChange, this.isPopoverOpen = e.isPopoverOpen, this.i18n = e.i18n, this.grid.style.position = "relative", this.boundPointerDown = this.handlePointerDown.bind(this), this.boundPointerMove = this.handlePointerMove.bind(this), this.boundPointerUp = this.handlePointerUp.bind(this), this.boundClearSelection = this.handleClearSelection.bind(this), this.boundCancelRectangle = this.handleCancelRectangle.bind(this), this.boundKeyDown = this.handleKeyDown.bind(this), this.boundCopyHandler = this.handleCopy.bind(this), this.boundCutHandler = this.handleCut.bind(this), this.boundPreventDragStart = this.handleDragStart.bind(this), this.grid.addEventListener("pointerdown", this.boundPointerDown), this.grid.addEventListener("dragstart", this.boundPreventDragStart), document.addEventListener("keydown", this.boundKeyDown), document.addEventListener("copy", this.boundCopyHandler), document.addEventListener("cut", this.boundCutHandler);
2338
2338
  }
@@ -2349,7 +2349,7 @@ var er = (e) => ({ element: $n({
2349
2349
  r !== 0 && this.showProgrammaticSelection(e, 0, e, r - 1);
2350
2350
  }
2351
2351
  selectColumn(e) {
2352
- let t = this.grid.querySelectorAll(`[${T}]`).length;
2352
+ let t = this.grid.querySelectorAll(`[${D}]`).length;
2353
2353
  t !== 0 && this.showProgrammaticSelection(0, e, t - 1, e);
2354
2354
  }
2355
2355
  clearActiveSelection() {
@@ -2366,9 +2366,9 @@ var er = (e) => ({ element: $n({
2366
2366
  }
2367
2367
  handlePointerDown(e) {
2368
2368
  var t;
2369
- if (pr(this.grid) || e.button !== 0) return;
2369
+ if (dr(this.grid) || e.button !== 0) return;
2370
2370
  let n = e.target;
2371
- if (n.closest("[data-blok-table-grip]") || n.closest("[data-blok-table-resize]") || n.closest(`[${cr}]`)) return;
2371
+ if (n.closest("[data-blok-table-grip]") || n.closest("[data-blok-table-resize]") || n.closest(`[${or}]`)) return;
2372
2372
  let r = this.resolveCellCoord(n);
2373
2373
  r && (this.hasSelection && this.lastPaintedRange !== null && this.lastPaintedRange.minRow === r.row && this.lastPaintedRange.maxRow === r.row && this.lastPaintedRange.minCol === r.col && this.lastPaintedRange.maxCol === r.col ? document.removeEventListener("pointerdown", this.boundClearSelection) : this.hasSelection && this.clearSelection(), this.anchorCell = r, this.isSelecting = !1, (t = this.onPointerDragActiveChange) == null || t.call(this, !0), document.addEventListener("mousemove", this.boundCancelRectangle, !0), document.addEventListener("pointermove", this.boundPointerMove), document.addEventListener("pointerup", this.boundPointerUp), document.addEventListener("pointercancel", this.boundPointerUp));
2374
2374
  }
@@ -2410,7 +2410,7 @@ var er = (e) => ({ element: $n({
2410
2410
  }
2411
2411
  handleClearSelection(e) {
2412
2412
  let t = e.target;
2413
- t instanceof HTMLElement && t.closest(`[${cr}]`) || t instanceof HTMLElement && t.closest("[data-blok-popover-opened]") !== null || (this.pillPopover !== null && this.destroyPillPopover(), document.removeEventListener("pointerdown", this.boundClearSelection), this.clearSelection());
2413
+ t instanceof HTMLElement && t.closest(`[${or}]`) || t instanceof HTMLElement && t.closest("[data-blok-popover-opened]") !== null || (this.pillPopover !== null && this.destroyPillPopover(), document.removeEventListener("pointerdown", this.boundClearSelection), this.clearSelection());
2414
2414
  }
2415
2415
  handleKeyDown(e) {
2416
2416
  var t;
@@ -2433,7 +2433,7 @@ var er = (e) => ({ element: $n({
2433
2433
  }
2434
2434
  restoreModifiedCells() {
2435
2435
  this.destroyPillPopover(), this.disconnectResizeObserver(), this.selectedCells.forEach((e) => {
2436
- e.removeAttribute(or);
2436
+ e.removeAttribute(ir);
2437
2437
  }), this.pill && (this.pill.remove(), this.pill = null), this.overlay && (this.overlay.remove(), this.overlay = null), this.selectedCells = [];
2438
2438
  }
2439
2439
  showProgrammaticSelection(e, t, n, r) {
@@ -2454,7 +2454,7 @@ var er = (e) => ({ element: $n({
2454
2454
  var e, t;
2455
2455
  if (!this.anchorCell || !this.extentCell) return;
2456
2456
  this.selectedCells.forEach((e) => {
2457
- e.removeAttribute(or);
2457
+ e.removeAttribute(ir);
2458
2458
  }), this.selectedCells = [];
2459
2459
  let n = Math.min(this.anchorCell.row, this.extentCell.row), r = Math.max(this.anchorCell.row, this.extentCell.row), i = Math.min(this.anchorCell.col, this.extentCell.col), a = Math.max(this.anchorCell.col, this.extentCell.col);
2460
2460
  this.lastPaintedRange = {
@@ -2463,20 +2463,20 @@ var er = (e) => ({ element: $n({
2463
2463
  minCol: i,
2464
2464
  maxCol: a
2465
2465
  };
2466
- let o = this.grid.querySelectorAll(`[${T}]`);
2466
+ let o = this.grid.querySelectorAll(`[${D}]`);
2467
2467
  this.selectedCells = this.collectCellsInRange(o, n, r, i, a), this.selectedCells.forEach((e) => {
2468
- e.setAttribute(or, "");
2468
+ e.setAttribute(ir, "");
2469
2469
  });
2470
- let s = (e = o[n]) == null ? void 0 : e.querySelectorAll(`[${E}]`)[i], c = (t = o[r]) == null ? void 0 : t.querySelectorAll(`[${E}]`)[a];
2470
+ let s = (e = o[n]) == null ? void 0 : e.querySelectorAll(`[${O}]`)[i], c = (t = o[r]) == null ? void 0 : t.querySelectorAll(`[${O}]`)[a];
2471
2471
  if (!s || !c) return;
2472
- let l = this.grid.getBoundingClientRect(), u = s.getBoundingClientRect(), d = c.getBoundingClientRect(), f = getComputedStyle(this.grid), p = parseFloat(f.borderTopWidth) || 0, m = parseFloat(f.borderLeftWidth) || 0, h = d.right - u.left + 1, g = d.bottom - u.top + 1, ee = u.top - l.top - p - 1, te = u.left - l.left - m - 1;
2473
- this.overlay || (this.overlay = document.createElement("div"), this.overlay.setAttribute("data-blok-table-selection-overlay", ""), this.overlay.style.position = "absolute", this.overlay.style.border = sr, this.overlay.style.pointerEvents = "none", this.overlay.style.boxSizing = "border-box", this.overlay.style.borderRadius = "2px", this.grid.appendChild(this.overlay)), this.overlay.style.top = `${ee}px`, this.overlay.style.left = `${te}px`, this.overlay.style.width = `${h}px`, this.overlay.style.height = `${g}px`, this.pill || (this.pill = this.createPill(), this.grid.appendChild(this.pill)), this.pill.style.left = `${te + h - 1}px`, this.pill.style.top = `${ee + g / 2}px`, this.observeCellResizes();
2472
+ let l = this.grid.getBoundingClientRect(), u = s.getBoundingClientRect(), d = c.getBoundingClientRect(), f = getComputedStyle(this.grid), p = parseFloat(f.borderTopWidth) || 0, m = parseFloat(f.borderLeftWidth) || 0, h = d.right - u.left + 1, g = d.bottom - u.top + 1, _ = u.top - l.top - p - 1, ee = u.left - l.left - m - 1;
2473
+ this.overlay || (this.overlay = document.createElement("div"), this.overlay.setAttribute("data-blok-table-selection-overlay", ""), this.overlay.style.position = "absolute", this.overlay.style.border = ar, this.overlay.style.pointerEvents = "none", this.overlay.style.boxSizing = "border-box", this.overlay.style.borderRadius = "2px", this.grid.appendChild(this.overlay)), this.overlay.style.top = `${_}px`, this.overlay.style.left = `${ee}px`, this.overlay.style.width = `${h}px`, this.overlay.style.height = `${g}px`, this.pill || (this.pill = this.createPill(), this.grid.appendChild(this.pill)), this.pill.style.left = `${ee + h - 1}px`, this.pill.style.top = `${_ + g / 2}px`, this.observeCellResizes();
2474
2474
  }
2475
2475
  repositionOverlay() {
2476
2476
  var e, t;
2477
2477
  let n = this.lastPaintedRange;
2478
2478
  if (!n || !this.overlay) return;
2479
- let r = this.grid.querySelectorAll(`[${T}]`), i = (e = r[n.minRow]) == null ? void 0 : e.querySelectorAll(`[${E}]`)[n.minCol], a = (t = r[n.maxRow]) == null ? void 0 : t.querySelectorAll(`[${E}]`)[n.maxCol];
2479
+ let r = this.grid.querySelectorAll(`[${D}]`), i = (e = r[n.minRow]) == null ? void 0 : e.querySelectorAll(`[${O}]`)[n.minCol], a = (t = r[n.maxRow]) == null ? void 0 : t.querySelectorAll(`[${O}]`)[n.maxCol];
2480
2480
  if (!i || !a) return;
2481
2481
  let o = this.grid.getBoundingClientRect(), s = i.getBoundingClientRect(), c = a.getBoundingClientRect(), l = getComputedStyle(this.grid), u = parseFloat(l.borderTopWidth) || 0, d = parseFloat(l.borderLeftWidth) || 0, f = c.right - s.left + 1, p = c.bottom - s.top + 1, m = s.top - o.top - u - 1, h = s.left - o.left - d - 1;
2482
2482
  this.overlay.style.top = `${m}px`, this.overlay.style.left = `${h}px`, this.overlay.style.width = `${f}px`, this.overlay.style.height = `${p}px`, this.pill && (this.pill.style.left = `${h + f - 1}px`, this.pill.style.top = `${m + p / 2}px`);
@@ -2494,8 +2494,8 @@ var er = (e) => ({ element: $n({
2494
2494
  }
2495
2495
  createPill() {
2496
2496
  let e = document.createElement("div");
2497
- e.setAttribute(cr, ""), e.setAttribute("contenteditable", "false"), e.className = b(fr), e.style.width = `${dr}px`, e.style.height = `${ur}px`, e.style.pointerEvents = "auto", e.style.transform = "translate(-50%, -50%)", e.style.outline = "2px solid white";
2498
- let t = rr("vertical");
2497
+ e.setAttribute(or, ""), e.setAttribute("contenteditable", "false"), e.className = C(ur), e.style.width = `${lr}px`, e.style.height = `${cr}px`, e.style.pointerEvents = "auto", e.style.transform = "translate(-50%, -50%)", e.style.outline = "2px solid white";
2498
+ let t = tr("vertical");
2499
2499
  return t.classList.remove("text-gray-400"), t.classList.add("text-white"), e.appendChild(t), e.addEventListener("mouseenter", () => {
2500
2500
  this.pillPopover === null && this.expandPill();
2501
2501
  }), e.addEventListener("mouseleave", () => {
@@ -2507,22 +2507,22 @@ var er = (e) => ({ element: $n({
2507
2507
  openPillPopover() {
2508
2508
  if (this.destroyPillPopover(), !this.pill) return;
2509
2509
  this.expandPill();
2510
- let e = l === "Meta" ? "⌘C" : "Ctrl+C", r = [];
2510
+ let e = g === "Meta" ? "⌘C" : "Ctrl+C", n = [];
2511
2511
  if (this.onColorChange !== void 0) {
2512
- let { element: e } = er({
2512
+ let { element: e } = Qn({
2513
2513
  i18n: this.i18n,
2514
2514
  onColorSelect: (e, t) => {
2515
2515
  var n;
2516
2516
  (n = this.onColorChange) == null || n.call(this, [...this.selectedCells], e, t);
2517
2517
  }
2518
2518
  });
2519
- r.push({
2520
- icon: p,
2519
+ n.push({
2520
+ icon: l,
2521
2521
  title: this.i18n.t("tools.table.cellColor"),
2522
2522
  name: "cellColor",
2523
2523
  children: {
2524
2524
  items: [{
2525
- type: n.Html,
2525
+ type: _.Html,
2526
2526
  element: e
2527
2527
  }],
2528
2528
  isFlippable: !1,
@@ -2530,11 +2530,11 @@ var er = (e) => ({ element: $n({
2530
2530
  }
2531
2531
  });
2532
2532
  }
2533
- this.pillPopover = new Se({
2533
+ this.pillPopover = new _e({
2534
2534
  items: [
2535
- ...r,
2535
+ ...n,
2536
2536
  {
2537
- icon: ke,
2537
+ icon: Ce,
2538
2538
  title: this.i18n.t("tools.table.copySelection"),
2539
2539
  secondaryLabel: e,
2540
2540
  closeOnActivate: !0,
@@ -2556,19 +2556,19 @@ var er = (e) => ({ element: $n({
2556
2556
  ],
2557
2557
  trigger: this.pill,
2558
2558
  flippable: !0
2559
- }), this.pillPopover.on(Ge.Closed, () => {
2559
+ }), this.pillPopover.on(Ve.Closed, () => {
2560
2560
  this.pillPopover !== null && (this.destroyPillPopover(), this.collapsePill());
2561
2561
  }), this.pillPopover.show();
2562
2562
  }
2563
2563
  expandPill() {
2564
2564
  if (!this.pill) return;
2565
- this.pill.style.width = `${lr}px`;
2565
+ this.pill.style.width = `${sr}px`;
2566
2566
  let e = this.pill.querySelector("svg");
2567
2567
  e && (e.classList.remove("opacity-0"), e.classList.add("opacity-100"));
2568
2568
  }
2569
2569
  collapsePill() {
2570
2570
  if (!this.pill) return;
2571
- this.pill.style.width = `${dr}px`;
2571
+ this.pill.style.width = `${lr}px`;
2572
2572
  let e = this.pill.querySelector("svg");
2573
2573
  e && (e.classList.add("opacity-0"), e.classList.remove("opacity-100"));
2574
2574
  }
@@ -2579,13 +2579,13 @@ var er = (e) => ({ element: $n({
2579
2579
  }
2580
2580
  }
2581
2581
  resolveCellCoord(e) {
2582
- let t = e.closest(`[${E}]`);
2582
+ let t = e.closest(`[${O}]`);
2583
2583
  if (!t) return null;
2584
- let n = t.closest(`[${T}]`);
2584
+ let n = t.closest(`[${D}]`);
2585
2585
  if (!n || !this.grid.contains(n)) return null;
2586
- let r = Array.from(this.grid.querySelectorAll(`[${T}]`)).indexOf(n);
2586
+ let r = Array.from(this.grid.querySelectorAll(`[${D}]`)).indexOf(n);
2587
2587
  if (r < 0) return null;
2588
- let i = Array.from(n.querySelectorAll(`[${E}]`)).indexOf(t);
2588
+ let i = Array.from(n.querySelectorAll(`[${O}]`)).indexOf(t);
2589
2589
  return i < 0 ? null : {
2590
2590
  row: r,
2591
2591
  col: i
@@ -2594,7 +2594,7 @@ var er = (e) => ({ element: $n({
2594
2594
  clampExtentToEdge(e) {
2595
2595
  var t, n, r, i, a, o;
2596
2596
  if (!this.anchorCell || !this.isSelecting) return;
2597
- let s = this.grid.getBoundingClientRect(), c = this.grid.querySelectorAll(`[${T}]`), l = c.length, u = (t = (n = c[0]) == null ? void 0 : n.querySelectorAll("[data-blok-table-cell]").length) == null ? 0 : t;
2597
+ let s = this.grid.getBoundingClientRect(), c = this.grid.querySelectorAll(`[${D}]`), l = c.length, u = (t = (n = c[0]) == null ? void 0 : n.querySelectorAll("[data-blok-table-cell]").length) == null ? 0 : t;
2598
2598
  if (l === 0 || u === 0) return;
2599
2599
  let d = {
2600
2600
  row: this.clampAxis(e.clientY, s.top, s.bottom, l, (r = (i = this.extentCell) == null ? void 0 : i.row) == null ? this.anchorCell.row : r),
@@ -2604,106 +2604,106 @@ var er = (e) => ({ element: $n({
2604
2604
  }
2605
2605
  collectCellsInRange(e, t, n, r, i) {
2606
2606
  return Array.from(e).slice(t, n + 1).flatMap((e) => {
2607
- let t = e.querySelectorAll(`[${E}]`);
2607
+ let t = e.querySelectorAll(`[${O}]`);
2608
2608
  return Array.from(t).slice(r, i + 1).filter((e) => e instanceof HTMLElement);
2609
2609
  });
2610
2610
  }
2611
2611
  clampAxis(e, t, n, r, i) {
2612
2612
  return e < t ? 0 : e > n ? r - 1 : i;
2613
2613
  }
2614
- }, A = (e) => {
2615
- let t = e.querySelector(`[${T}]`);
2614
+ }, M = (e) => {
2615
+ let t = e.querySelector(`[${D}]`);
2616
2616
  if (!t) return [];
2617
- let n = t.querySelectorAll(`[${E}]`);
2617
+ let n = t.querySelectorAll(`[${O}]`);
2618
2618
  return Array.from(n).map((e) => e.getBoundingClientRect().width);
2619
- }, j = (e, t) => {
2619
+ }, pr = (e, t) => {
2620
2620
  let n = t.reduce((e, t) => e + t, 0), r = e;
2621
- r.style.width = `${n + 1}px`, e.querySelectorAll(`[${T}]`).forEach((e) => {
2622
- e.querySelectorAll(`[${E}]`).forEach((e, n) => {
2621
+ r.style.width = `${n + 1}px`, e.querySelectorAll(`[${D}]`).forEach((e) => {
2622
+ e.querySelectorAll(`[${O}]`).forEach((e, n) => {
2623
2623
  if (n < t.length) {
2624
2624
  let r = e;
2625
2625
  r.style.width = `${t[n]}px`;
2626
2626
  }
2627
2627
  });
2628
2628
  });
2629
- }, hr = (e, t) => {
2630
- let n = Array.from(e.querySelectorAll(`[${T}]`)), r = n.findIndex((e) => Array.from(e.querySelectorAll(`[${E}]`)).includes(t));
2629
+ }, mr = (e, t) => {
2630
+ let n = Array.from(e.querySelectorAll(`[${D}]`)), r = n.findIndex((e) => Array.from(e.querySelectorAll(`[${O}]`)).includes(t));
2631
2631
  return r === -1 ? null : {
2632
2632
  row: r,
2633
- col: Array.from(n[r].querySelectorAll(`[${E}]`)).indexOf(t)
2633
+ col: Array.from(n[r].querySelectorAll(`[${O}]`)).indexOf(t)
2634
2634
  };
2635
- }, gr = (e) => {
2635
+ }, hr = (e) => {
2636
2636
  var t;
2637
- let n = e.querySelector(`[${k}]`);
2637
+ let n = e.querySelector(`[${j}]`);
2638
2638
  return n ? ((t = n.textContent) == null ? "" : t).trim().length === 0 : !0;
2639
- }, _r = (e, t) => {
2640
- let n = e.querySelectorAll(`[${T}]`)[t];
2639
+ }, gr = (e, t) => {
2640
+ let n = e.querySelectorAll(`[${D}]`)[t];
2641
2641
  if (!n) return !0;
2642
- let r = n.querySelectorAll(`[${E}]`);
2643
- return Array.from(r).every((e) => gr(e));
2644
- }, vr = (e, t) => {
2645
- let n = e.querySelectorAll(`[${T}]`);
2642
+ let r = n.querySelectorAll(`[${O}]`);
2643
+ return Array.from(r).every((e) => hr(e));
2644
+ }, _r = (e, t) => {
2645
+ let n = e.querySelectorAll(`[${D}]`);
2646
2646
  return Array.from(n).every((e) => {
2647
- let n = e.querySelectorAll(`[${E}]`)[t];
2648
- return !n || gr(n);
2647
+ let n = e.querySelectorAll(`[${O}]`)[t];
2648
+ return !n || hr(n);
2649
2649
  });
2650
- }, yr = (e) => {
2651
- let t = e.querySelectorAll(`[${T}]`), n = t[0];
2650
+ }, vr = (e) => {
2651
+ let t = e.querySelectorAll(`[${D}]`), n = t[0];
2652
2652
  if (!n) return;
2653
- let r = n.querySelectorAll(`[${E}]`), i = Array.from(r).reduce((e, t) => e + (parseFloat(t.style.width) || 0), 0);
2653
+ let r = n.querySelectorAll(`[${O}]`), i = Array.from(r).reduce((e, t) => e + (parseFloat(t.style.width) || 0), 0);
2654
2654
  if (i <= 0) return;
2655
2655
  let a = 100 / i;
2656
2656
  t.forEach((e) => {
2657
- e.querySelectorAll(`[${E}]`).forEach((e) => {
2657
+ e.querySelectorAll(`[${O}]`).forEach((e) => {
2658
2658
  let t = e, n = parseFloat(t.style.width) || 0;
2659
2659
  t.style.width = `${Math.round(n * a * 100) / 100}%`;
2660
2660
  });
2661
2661
  });
2662
- }, br = (e, t, n) => {
2662
+ }, yr = (e, t, n) => {
2663
2663
  if (!e) return e;
2664
2664
  let r = [...e], [i] = r.splice(t, 1);
2665
2665
  return r.splice(n, 0, i), r;
2666
- }, xr = (e, t) => {
2666
+ }, br = (e, t) => {
2667
2667
  if (!e) return e;
2668
2668
  let n = [...e];
2669
2669
  return n.splice(t, 1), n.length > 0 ? n : void 0;
2670
- }, Sr = (e, t, n, r, i) => {
2671
- let a = n == null ? A(e) : n, o = r === void 0 ? M(a) : Math.round(r / 2 * 100) / 100;
2670
+ }, xr = (e, t, n, r, i) => {
2671
+ let a = n == null ? M(e) : n, o = r === void 0 ? N(a) : Math.round(r / 2 * 100) / 100;
2672
2672
  i.addColumn(e, t, a, o);
2673
2673
  let s = [...a];
2674
2674
  return s.splice(t, 0, o), s;
2675
- }, M = (e) => Math.round(e.reduce((e, t) => e + t, 0) / e.length / 2 * 100) / 100, Cr = (e) => e.length === 0 ? 0 : Math.round(e.reduce((e, t) => e + t, 0) / e.length * 100) / 100, wr = (e, t, n) => {
2675
+ }, N = (e) => Math.round(e.reduce((e, t) => e + t, 0) / e.length / 2 * 100) / 100, Sr = (e) => e.length === 0 ? 0 : Math.round(e.reduce((e, t) => e + t, 0) / e.length * 100) / 100, Cr = (e, t, n) => {
2676
2676
  var r;
2677
2677
  if (!e) return [];
2678
- let i = e.querySelectorAll(`[${T}]`)[n];
2678
+ let i = e.querySelectorAll(`[${D}]`)[n];
2679
2679
  return i ? (r = t == null ? void 0 : t.getBlockIdsFromCells(i.querySelectorAll("[data-blok-table-cell]"))) == null ? [] : r : [];
2680
- }, Tr = (e, t, n) => {
2680
+ }, wr = (e, t, n) => {
2681
2681
  var r;
2682
2682
  if (!e) return [];
2683
- let i = e.querySelectorAll(`[${T}]`), a = [];
2683
+ let i = e.querySelectorAll(`[${D}]`), a = [];
2684
2684
  return i.forEach((e) => {
2685
- let t = e.querySelectorAll(`[${E}]`);
2685
+ let t = e.querySelectorAll(`[${O}]`);
2686
2686
  n < t.length && a.push(t[n]);
2687
2687
  }), (r = t == null ? void 0 : t.getBlockIdsFromCells(a)) == null ? [] : r;
2688
- }, N = (e, t) => {
2689
- e.querySelectorAll(`[${E}]`).forEach((e) => {
2688
+ }, P = (e, t) => {
2689
+ e.querySelectorAll(`[${O}]`).forEach((e) => {
2690
2690
  t == null || t.ensureCellHasBlock(e);
2691
2691
  });
2692
- }, Er = (e, t, n, r) => {
2693
- let i = e.querySelectorAll(`[${T}]`);
2692
+ }, Tr = (e, t, n, r) => {
2693
+ let i = e.querySelectorAll(`[${D}]`);
2694
2694
  t.forEach((e, t) => {
2695
2695
  let r = i[t];
2696
2696
  if (!r) return;
2697
- let a = r.querySelectorAll(`[${E}]`);
2697
+ let a = r.querySelectorAll(`[${O}]`);
2698
2698
  e.forEach((e, t) => {
2699
2699
  var r;
2700
2700
  let i = a[t];
2701
2701
  if (!i) return;
2702
- let o = i.querySelector(`[${k}]`);
2702
+ let o = i.querySelector(`[${j}]`);
2703
2703
  if (!o) return;
2704
2704
  let s = o.querySelectorAll("[data-blok-id]").length > 0;
2705
- if (!(!O(e) && s)) {
2706
- if (!O(e)) {
2705
+ if (!(!A(e) && s)) {
2706
+ if (!A(e)) {
2707
2707
  o.innerHTML = e;
2708
2708
  return;
2709
2709
  }
@@ -2722,7 +2722,7 @@ var er = (e) => ({ element: $n({
2722
2722
  }
2723
2723
  });
2724
2724
  });
2725
- }, Dr = (e, t) => {
2725
+ }, Er = (e, t) => {
2726
2726
  var n, r, i, a, o, s, c;
2727
2727
  if (!(typeof e == "object" && e && "content" in e)) {
2728
2728
  var l, u;
@@ -2742,40 +2742,40 @@ var er = (e) => ({ element: $n({
2742
2742
  colWidths: m,
2743
2743
  initialColWidth: d.initialColWidth
2744
2744
  };
2745
- }, Or = (e, t) => {
2745
+ }, Dr = (e, t) => {
2746
2746
  e.addEventListener("keydown", (n) => {
2747
- let r = n.target.closest(`[${E}]`);
2747
+ let r = n.target.closest(`[${O}]`);
2748
2748
  if (!r) return;
2749
- let i = hr(e, r);
2749
+ let i = mr(e, r);
2750
2750
  i && (t == null || t.handleKeyDown(n, i));
2751
2751
  });
2752
- }, kr = ["overflow-x-auto", "overflow-y-hidden"], Ar = (e) => {
2753
- e == null || e.classList.add(...kr);
2754
- }, P = (e, t) => {
2752
+ }, Or = ["overflow-x-auto", "overflow-y-hidden"], kr = (e) => {
2753
+ e == null || e.classList.add(...Or);
2754
+ }, F = (e, t) => {
2755
2755
  if (!e) return;
2756
- let n = e.querySelectorAll(`[${T}]`);
2756
+ let n = e.querySelectorAll(`[${D}]`);
2757
2757
  n.forEach((e) => {
2758
2758
  e.removeAttribute("data-blok-table-heading");
2759
2759
  }), t && n.length > 0 && n[0].setAttribute("data-blok-table-heading", "");
2760
- }, F = (e, t) => {
2761
- let n = e.querySelectorAll(`[${T}]`);
2760
+ }, I = (e, t) => {
2761
+ let n = e.querySelectorAll(`[${D}]`);
2762
2762
  t.forEach((e, t) => {
2763
2763
  if (t >= n.length) return;
2764
- let r = n[t].querySelectorAll(`[${E}]`);
2764
+ let r = n[t].querySelectorAll(`[${O}]`);
2765
2765
  e.forEach((e, t) => {
2766
2766
  if (t >= r.length) return;
2767
2767
  let n = r[t];
2768
- O(e) && e.color ? n.style.backgroundColor = e.color : n.style.backgroundColor = "", O(e) && e.textColor ? n.style.color = e.textColor : n.style.color = "";
2768
+ A(e) && e.color ? n.style.backgroundColor = e.color : n.style.backgroundColor = "", A(e) && e.textColor ? n.style.color = e.textColor : n.style.color = "";
2769
2769
  });
2770
2770
  });
2771
- }, I = (e, t) => {
2772
- e && (e.querySelectorAll(`[${E}]`).forEach((e) => {
2771
+ }, L = (e, t) => {
2772
+ e && (e.querySelectorAll(`[${O}]`).forEach((e) => {
2773
2773
  e.removeAttribute("data-blok-table-heading-col");
2774
- }), t && e.querySelectorAll(`[${T}]`).forEach((e) => {
2775
- let t = e.querySelector(`[${E}]`);
2774
+ }), t && e.querySelectorAll(`[${D}]`).forEach((e) => {
2775
+ let t = e.querySelector(`[${O}]`);
2776
2776
  t && t.setAttribute("data-blok-table-heading-col", "");
2777
2777
  }));
2778
- }, L = (e) => !!(/^#[0-9a-f]{3,4}$/i.test(e) || /^#[0-9a-f]{6}([0-9a-f]{2})?$/i.test(e) || /^rgba?\(\s*[\d.]+\s*,\s*[\d.]+\s*,\s*[\d.]+\s*(,\s*[\d.]+\s*)?\)$/i.test(e) || /^hsla?\(\s*[\d.]+\s*,\s*[\d.]+%\s*,\s*[\d.]+%\s*(,\s*[\d.]+\s*)?\)$/i.test(e) || e === "transparent"), jr = class {
2778
+ }, R = (e) => !!(/^#[0-9a-f]{3,4}$/i.test(e) || /^#[0-9a-f]{6}([0-9a-f]{2})?$/i.test(e) || /^rgba?\(\s*[\d.]+\s*,\s*[\d.]+\s*,\s*[\d.]+\s*(,\s*[\d.]+\s*)?\)$/i.test(e) || /^hsla?\(\s*[\d.]+\s*,\s*[\d.]+%\s*,\s*[\d.]+%\s*(,\s*[\d.]+\s*)?\)$/i.test(e) || e === "transparent"), Ar = class {
2779
2779
  constructor(e) {
2780
2780
  var t, n, r;
2781
2781
  this.withHeadingsValue = (t = e == null ? void 0 : e.withHeadings) == null ? !1 : t, this.withHeadingColumnValue = (n = e == null ? void 0 : e.withHeadingColumn) == null ? !1 : n, this.stretchedValue = (r = e == null ? void 0 : e.stretched) == null ? !1 : r, this.colWidthsValue = e != null && e.colWidths ? [...e.colWidths] : void 0, this.initialColWidthValue = e == null ? void 0 : e.initialColWidth, this.contentGrid = this.normalizeContent(e == null ? void 0 : e.content), this.blockCellMap = /* @__PURE__ */ new Map(), this.rebuildBlockCellMap();
@@ -2848,13 +2848,13 @@ var er = (e) => ({ element: $n({
2848
2848
  return this.isInBounds(e, t) ? [...this.contentGrid[e][t].blocks] : [];
2849
2849
  }
2850
2850
  setCellColor(e, t, n) {
2851
- this.isInBounds(e, t) && (n === void 0 ? delete this.contentGrid[e][t].color : L(n) && (this.contentGrid[e][t].color = n));
2851
+ this.isInBounds(e, t) && (n === void 0 ? delete this.contentGrid[e][t].color : R(n) && (this.contentGrid[e][t].color = n));
2852
2852
  }
2853
2853
  getCellColor(e, t) {
2854
2854
  if (this.isInBounds(e, t)) return this.contentGrid[e][t].color;
2855
2855
  }
2856
2856
  setCellTextColor(e, t, n) {
2857
- this.isInBounds(e, t) && (n === void 0 ? delete this.contentGrid[e][t].textColor : L(n) && (this.contentGrid[e][t].textColor = n));
2857
+ this.isInBounds(e, t) && (n === void 0 ? delete this.contentGrid[e][t].textColor : R(n) && (this.contentGrid[e][t].textColor = n));
2858
2858
  }
2859
2859
  getCellTextColor(e, t) {
2860
2860
  if (this.isInBounds(e, t)) return this.contentGrid[e][t].textColor;
@@ -2992,9 +2992,9 @@ var er = (e) => ({ element: $n({
2992
2992
  return !e || !Array.isArray(e) ? [] : e.map((e) => (e == null ? [] : e).map((e) => this.normalizeCell(e)));
2993
2993
  }
2994
2994
  normalizeCell(e) {
2995
- if (O(e)) {
2995
+ if (A(e)) {
2996
2996
  let t = { blocks: [...e.blocks] };
2997
- return e.color !== void 0 && L(e.color) && (t.color = e.color), e.textColor !== void 0 && L(e.textColor) && (t.textColor = e.textColor), t;
2997
+ return e.color !== void 0 && R(e.color) && (t.color = e.color), e.textColor !== void 0 && R(e.textColor) && (t.textColor = e.textColor), t;
2998
2998
  }
2999
2999
  return { blocks: [] };
3000
3000
  }
@@ -3027,7 +3027,7 @@ var er = (e) => ({ element: $n({
3027
3027
  for (let n of this.contentGrid) e < n.length && t.push(...n[e].blocks);
3028
3028
  return t;
3029
3029
  }
3030
- }, Mr = "data-blok-table-resize", Nr = "data-blok-table-cell", Pr = "data-blok-table-row", Fr = 50, Ir = 16, Lr = class {
3030
+ }, jr = "data-blok-table-resize", Mr = "data-blok-table-cell", Nr = "data-blok-table-row", Pr = 50, Fr = 16, Ir = class {
3031
3031
  get enabled() {
3032
3032
  return this._enabled;
3033
3033
  }
@@ -3054,7 +3054,7 @@ var er = (e) => ({ element: $n({
3054
3054
  }
3055
3055
  createHandle(e) {
3056
3056
  let t = document.createElement("div"), n = this.getHandleLeftPx(e);
3057
- return t.setAttribute(Mr, ""), t.setAttribute("data-col", String(e)), t.style.position = "absolute", t.style.top = "-1px", t.style.bottom = "0px", t.style.width = `${Ir}px`, t.style.left = `${n - Ir / 2}px`, t.style.cursor = "col-resize", t.style.zIndex = "2", t.style.background = "linear-gradient(to right, transparent 7px, #3b82f6 7px, #3b82f6 9px, transparent 9px)", t.style.opacity = "0", t.style.transition = "opacity 150ms ease", t.setAttribute("contenteditable", "false"), t.addEventListener("mouseenter", () => {
3057
+ return t.setAttribute(jr, ""), t.setAttribute("data-col", String(e)), t.style.position = "absolute", t.style.top = "-1px", t.style.bottom = "0px", t.style.width = `${Fr}px`, t.style.left = `${n - Fr / 2}px`, t.style.cursor = "col-resize", t.style.zIndex = "2", t.style.background = "linear-gradient(to right, transparent 7px, #3b82f6 7px, #3b82f6 9px, transparent 9px)", t.style.opacity = "0", t.style.transition = "opacity 150ms ease", t.setAttribute("contenteditable", "false"), t.addEventListener("mouseenter", () => {
3058
3058
  this.isDragging || (t.style.opacity = "1");
3059
3059
  }), t.addEventListener("mouseleave", () => {
3060
3060
  this.isDragging || (t.style.opacity = "0");
@@ -3066,14 +3066,14 @@ var er = (e) => ({ element: $n({
3066
3066
  updateHandlePositions() {
3067
3067
  this.handles.forEach((e, t) => {
3068
3068
  let n = this.getHandleLeftPx(t), r = e;
3069
- r.style.left = `${n - Ir / 2}px`;
3069
+ r.style.left = `${n - Fr / 2}px`;
3070
3070
  });
3071
3071
  }
3072
3072
  onPointerDown(e) {
3073
3073
  var t;
3074
3074
  if (!this._enabled) return;
3075
3075
  let n = e.target;
3076
- if (!n.hasAttribute(Mr)) return;
3076
+ if (!n.hasAttribute(jr)) return;
3077
3077
  e.preventDefault(), this.needsInitialApply && (this.applyWidths(), this.updateHandlePositions(), this.needsInitialApply = !1);
3078
3078
  let r = n.getAttribute("data-col");
3079
3079
  r !== null && (this.dragColIndex = Number(r), this.isDragging = !0, this.dragStartX = e.clientX, this.startColWidth = this.colWidths[this.dragColIndex], this.dragRowCells = this.resolveRowCells(), (t = this.onDragStart) == null || t.call(this), this.gridEl.style.userSelect = "none", n.style.opacity = "1", n.setPointerCapture && n.setPointerCapture(e.pointerId), document.addEventListener("pointermove", this.boundPointerMove), document.addEventListener("pointerup", this.boundPointerUp));
@@ -3081,7 +3081,7 @@ var er = (e) => ({ element: $n({
3081
3081
  onPointerMove(e) {
3082
3082
  var t, n;
3083
3083
  if (!this.isDragging) return;
3084
- let r = e.clientX - this.dragStartX, i = this.startColWidth + r, a = Math.max(Fr, i);
3084
+ let r = e.clientX - this.dragStartX, i = this.startColWidth + r, a = Math.max(Pr, i);
3085
3085
  this.colWidths[this.dragColIndex] = a, this.applyWidths((t = this.dragRowCells) == null ? void 0 : t), this.updateHandlePositions(), (n = this.onDrag) == null || n.call(this);
3086
3086
  }
3087
3087
  onPointerUp() {
@@ -3091,8 +3091,8 @@ var er = (e) => ({ element: $n({
3091
3091
  e && (e.style.opacity = "0"), document.removeEventListener("pointermove", this.boundPointerMove), document.removeEventListener("pointerup", this.boundPointerUp), this.dragRowCells = null, this.onChange([...this.colWidths]);
3092
3092
  }
3093
3093
  resolveRowCells() {
3094
- let e = this.gridEl.querySelectorAll(`[${Pr}]`);
3095
- return Array.from(e, (e) => Array.from(e.querySelectorAll(`[${Nr}]`)));
3094
+ let e = this.gridEl.querySelectorAll(`[${Nr}]`);
3095
+ return Array.from(e, (e) => Array.from(e.querySelectorAll(`[${Mr}]`)));
3096
3096
  }
3097
3097
  applyWidths(e = this.resolveRowCells()) {
3098
3098
  let t = this.colWidths.reduce((e, t) => e + t, 0);
@@ -3102,7 +3102,7 @@ var er = (e) => ({ element: $n({
3102
3102
  });
3103
3103
  });
3104
3104
  }
3105
- }, Rr = (e, t, n) => (n.grid.addRow(e, t), N(e, n.cellBlocks), {
3105
+ }, Lr = (e, t, n) => (n.grid.addRow(e, t), P(e, n.cellBlocks), {
3106
3106
  pendingHighlight: {
3107
3107
  type: "row",
3108
3108
  index: t
@@ -3111,9 +3111,9 @@ var er = (e) => ({ element: $n({
3111
3111
  colWidths: n.data.colWidths,
3112
3112
  withHeadings: n.data.withHeadings,
3113
3113
  withHeadingColumn: n.data.withHeadingColumn
3114
- }), zr = (e, t, n) => {
3115
- let r = Sr(e, t, n.data.colWidths, n.data.initialColWidth, n.grid);
3116
- return N(e, n.cellBlocks), {
3114
+ }), Rr = (e, t, n) => {
3115
+ let r = xr(e, t, n.data.colWidths, n.data.initialColWidth, n.grid);
3116
+ return P(e, n.cellBlocks), {
3117
3117
  pendingHighlight: {
3118
3118
  type: "col",
3119
3119
  index: t
@@ -3123,7 +3123,7 @@ var er = (e) => ({ element: $n({
3123
3123
  withHeadings: n.data.withHeadings,
3124
3124
  withHeadingColumn: n.data.withHeadingColumn
3125
3125
  };
3126
- }, Br = (e, t, n, r) => (r.grid.moveRow(e, t, n), {
3126
+ }, zr = (e, t, n, r) => (r.grid.moveRow(e, t, n), {
3127
3127
  pendingHighlight: null,
3128
3128
  moveSelection: {
3129
3129
  type: "row",
@@ -3132,16 +3132,16 @@ var er = (e) => ({ element: $n({
3132
3132
  colWidths: r.data.colWidths,
3133
3133
  withHeadings: r.data.withHeadings,
3134
3134
  withHeadingColumn: r.data.withHeadingColumn
3135
- }), Vr = (e, t, n, r) => (r.grid.moveColumn(e, t, n), {
3135
+ }), Br = (e, t, n, r) => (r.grid.moveColumn(e, t, n), {
3136
3136
  pendingHighlight: null,
3137
3137
  moveSelection: {
3138
3138
  type: "col",
3139
3139
  index: n
3140
3140
  },
3141
- colWidths: br(r.data.colWidths, t, n),
3141
+ colWidths: yr(r.data.colWidths, t, n),
3142
3142
  withHeadings: r.data.withHeadings,
3143
3143
  withHeadingColumn: r.data.withHeadingColumn
3144
- }), Hr = (e, t, n) => {
3144
+ }), Vr = (e, t, n) => {
3145
3145
  var r, i;
3146
3146
  return (r = n.cellBlocks) == null || r.deleteBlocks((i = n.blocksToDelete) == null ? [] : i), n.grid.deleteRow(e, t), {
3147
3147
  pendingHighlight: {
@@ -3153,11 +3153,11 @@ var er = (e) => ({ element: $n({
3153
3153
  withHeadings: n.data.withHeadings,
3154
3154
  withHeadingColumn: n.data.withHeadingColumn
3155
3155
  };
3156
- }, Ur = (e, t, n) => {
3156
+ }, Hr = (e, t, n) => {
3157
3157
  var r, i;
3158
3158
  (r = n.cellBlocks) == null || r.deleteBlocks((i = n.blocksToDelete) == null ? [] : i), n.grid.deleteColumn(e, t);
3159
- let a = xr(n.data.colWidths, t);
3160
- return a ? j(e, a) : yr(e), {
3159
+ let a = br(n.data.colWidths, t);
3160
+ return a ? pr(e, a) : vr(e), {
3161
3161
  pendingHighlight: {
3162
3162
  type: "col",
3163
3163
  index: t < n.grid.getColumnCount(e) ? t : t - 1
@@ -3167,16 +3167,16 @@ var er = (e) => ({ element: $n({
3167
3167
  withHeadings: n.data.withHeadings,
3168
3168
  withHeadingColumn: n.data.withHeadingColumn
3169
3169
  };
3170
- }, Wr = (e, t, n) => {
3170
+ }, Ur = (e, t, n) => {
3171
3171
  switch (t.type) {
3172
- case "insert-row-above": return Rr(e, t.index, n);
3173
- case "insert-row-below": return Rr(e, t.index + 1, n);
3174
- case "insert-col-left": return zr(e, t.index, n);
3175
- case "insert-col-right": return zr(e, t.index + 1, n);
3176
- case "move-row": return Br(e, t.fromIndex, t.toIndex, n);
3177
- case "move-col": return Vr(e, t.fromIndex, t.toIndex, n);
3178
- case "delete-row": return Hr(e, t.index, n);
3179
- case "delete-col": return Ur(e, t.index, n);
3172
+ case "insert-row-above": return Lr(e, t.index, n);
3173
+ case "insert-row-below": return Lr(e, t.index + 1, n);
3174
+ case "insert-col-left": return Rr(e, t.index, n);
3175
+ case "insert-col-right": return Rr(e, t.index + 1, n);
3176
+ case "move-row": return zr(e, t.fromIndex, t.toIndex, n);
3177
+ case "move-col": return Br(e, t.fromIndex, t.toIndex, n);
3178
+ case "delete-row": return Vr(e, t.index, n);
3179
+ case "delete-col": return Hr(e, t.index, n);
3180
3180
  case "toggle-heading": return {
3181
3181
  pendingHighlight: {
3182
3182
  type: "row",
@@ -3198,13 +3198,13 @@ var er = (e) => ({ element: $n({
3198
3198
  withHeadingColumn: !n.data.withHeadingColumn
3199
3199
  };
3200
3200
  }
3201
- }, Gr = 10, Kr = "data-blok-table-drag-ghost", qr = (e) => {
3202
- let t = e.querySelector(`[${T}]`);
3203
- return t ? Array.from(t.querySelectorAll(`[${E}]`)).reduce((e, t) => {
3201
+ }, Wr = 10, Gr = "data-blok-table-drag-ghost", Kr = (e) => {
3202
+ let t = e.querySelector(`[${D}]`);
3203
+ return t ? Array.from(t.querySelectorAll(`[${O}]`)).reduce((e, t) => {
3204
3204
  let n = e[e.length - 1];
3205
3205
  return [...e, n + t.offsetWidth];
3206
3206
  }, [0]) : [0];
3207
- }, Jr = class {
3207
+ }, qr = class {
3208
3208
  constructor(e) {
3209
3209
  var t;
3210
3210
  this.isDragging = !1, this.dragType = null, this.dragFromIndex = -1, this.dragStartX = 0, this.dragStartY = 0, this.dropIndicator = null, this.dragOverlayCells = [], this.ghostEl = null, this.ghostOffsetX = 0, this.ghostOffsetY = 0, this.resolveTracking = null, this.grid = e.grid, this.onAction = e.onAction, this.onDragStateChange = (t = e.onDragStateChange) == null ? null : t, this.boundDocPointerMove = this.handleDocPointerMove.bind(this), this.boundDocPointerUp = this.handleDocPointerUp.bind(this), this.boundDocPointerCancel = this.handleDocPointerCancel.bind(this);
@@ -3223,7 +3223,7 @@ var er = (e) => ({ element: $n({
3223
3223
  }
3224
3224
  handleDocPointerMove(e) {
3225
3225
  let t = Math.abs(e.clientX - this.dragStartX), n = Math.abs(e.clientY - this.dragStartY);
3226
- !this.isDragging && (t > Gr || n > Gr) && (this.isDragging = !0, this.startDrag()), this.isDragging && (this.updateDragIndicator(e), this.updateGhostPosition(e));
3226
+ !this.isDragging && (t > Wr || n > Wr) && (this.isDragging = !0, this.startDrag()), this.isDragging && (this.updateDragIndicator(e), this.updateGhostPosition(e));
3227
3227
  }
3228
3228
  handleDocPointerUp(e) {
3229
3229
  if (document.removeEventListener("pointermove", this.boundDocPointerMove), document.removeEventListener("pointerup", this.boundDocPointerUp), document.removeEventListener("pointercancel", this.boundDocPointerCancel), this.isDragging) {
@@ -3244,7 +3244,7 @@ var er = (e) => ({ element: $n({
3244
3244
  this.grid.style.userSelect = "none", document.body.style.cursor = "grabbing", (e = this.onDragStateChange) == null || e.call(this, !0, this.dragType), this.highlightSourceCells(), this.createDropIndicator(), this.createGhost();
3245
3245
  }
3246
3246
  highlightSourceCells() {
3247
- let e = this.grid.querySelectorAll(`[${T}]`);
3247
+ let e = this.grid.querySelectorAll(`[${D}]`);
3248
3248
  if (this.dragType === "row") {
3249
3249
  this.highlightRowCells(e);
3250
3250
  return;
@@ -3253,14 +3253,14 @@ var er = (e) => ({ element: $n({
3253
3253
  }
3254
3254
  highlightRowCells(e) {
3255
3255
  let t = e[this.dragFromIndex];
3256
- t && t.querySelectorAll(`[${E}]`).forEach((e) => {
3256
+ t && t.querySelectorAll(`[${O}]`).forEach((e) => {
3257
3257
  let t = e;
3258
3258
  t.style.backgroundColor = "#f3f4f6", t.style.opacity = "0.7", this.dragOverlayCells.push(t);
3259
3259
  });
3260
3260
  }
3261
3261
  highlightColumnCells(e) {
3262
3262
  e.forEach((e) => {
3263
- let t = e.querySelectorAll(`[${E}]`);
3263
+ let t = e.querySelectorAll(`[${O}]`);
3264
3264
  if (this.dragFromIndex >= t.length) return;
3265
3265
  let n = t[this.dragFromIndex];
3266
3266
  n.style.backgroundColor = "#f3f4f6", n.style.opacity = "0.7", this.dragOverlayCells.push(n);
@@ -3271,7 +3271,7 @@ var er = (e) => ({ element: $n({
3271
3271
  let e = this.dropIndicator.style;
3272
3272
  if (e.position = "absolute", e.backgroundColor = "#3b82f6", e.borderRadius = "1.5px", e.zIndex = "5", e.pointerEvents = "none", this.dropIndicator.setAttribute("contenteditable", "false"), this.dragType === "row") e.height = "3px", e.left = "-1px", e.right = "0", e.transition = "top 100ms ease";
3273
3273
  else {
3274
- let t = this.grid.querySelectorAll(`[${T}]`), n = t[t.length - 1], r = n ? n.offsetTop + n.offsetHeight : 0;
3274
+ let t = this.grid.querySelectorAll(`[${D}]`), n = t[t.length - 1], r = n ? n.offsetTop + n.offsetHeight : 0;
3275
3275
  e.width = "3px", e.top = "-1px", e.height = `${r + 1}px`, e.transition = "left 100ms ease";
3276
3276
  }
3277
3277
  this.grid.appendChild(this.dropIndicator);
@@ -3293,7 +3293,7 @@ var er = (e) => ({ element: $n({
3293
3293
  updateColIndicator(e, t) {
3294
3294
  var n;
3295
3295
  if (!this.dropIndicator) return;
3296
- let r = e.clientX - t.left, i = this.getColDropIndex(r), a = qr(this.grid);
3296
+ let r = e.clientX - t.left, i = this.getColDropIndex(r), a = Kr(this.grid);
3297
3297
  this.dropIndicator.style.left = `${((n = a[i]) == null ? 0 : n) - 1.5}px`;
3298
3298
  }
3299
3299
  finishDrag(e) {
@@ -3322,7 +3322,7 @@ var er = (e) => ({ element: $n({
3322
3322
  }
3323
3323
  createGhost() {
3324
3324
  let e = document.createElement("div");
3325
- e.setAttribute(Kr, ""), e.setAttribute("contenteditable", "false");
3325
+ e.setAttribute(Gr, ""), e.setAttribute("contenteditable", "false");
3326
3326
  let t = e.style;
3327
3327
  t.position = "fixed", t.pointerEvents = "none", t.opacity = "0.5", t.zIndex = "50", t.borderRadius = "4px", t.overflow = "hidden", t.boxShadow = "0 4px 12px rgba(0,0,0,0.15)", this.ghostEl = e;
3328
3328
  let n = this.getSourceRect();
@@ -3333,22 +3333,22 @@ var er = (e) => ({ element: $n({
3333
3333
  }
3334
3334
  getRowSourceRect() {
3335
3335
  var e;
3336
- let t = this.grid.querySelectorAll(`[${T}]`)[this.dragFromIndex];
3336
+ let t = this.grid.querySelectorAll(`[${D}]`)[this.dragFromIndex];
3337
3337
  return (e = t == null ? void 0 : t.getBoundingClientRect()) == null ? null : e;
3338
3338
  }
3339
3339
  getColSourceRect() {
3340
- let e = this.grid.querySelectorAll(`[${T}]`), t = e[0], n = e[e.length - 1];
3340
+ let e = this.grid.querySelectorAll(`[${D}]`), t = e[0], n = e[e.length - 1];
3341
3341
  if (!t || !n) return null;
3342
- let r = t.querySelectorAll(`[${E}]`)[this.dragFromIndex], i = n.querySelectorAll(`[${E}]`)[this.dragFromIndex];
3342
+ let r = t.querySelectorAll(`[${O}]`)[this.dragFromIndex], i = n.querySelectorAll(`[${O}]`)[this.dragFromIndex];
3343
3343
  if (!r || !i) return null;
3344
3344
  let a = r.getBoundingClientRect(), o = i.getBoundingClientRect();
3345
3345
  return new DOMRect(a.left, a.top, a.width, o.bottom - a.top);
3346
3346
  }
3347
3347
  buildRowGhost() {
3348
- let e = this.grid.querySelectorAll(`[${T}]`)[this.dragFromIndex];
3348
+ let e = this.grid.querySelectorAll(`[${D}]`)[this.dragFromIndex];
3349
3349
  if (!e || !this.ghostEl) return;
3350
3350
  let t = this.ghostEl.style;
3351
- t.display = "flex", t.height = `${e.offsetHeight}px`, e.querySelectorAll(`[${E}]`).forEach((e) => {
3351
+ t.display = "flex", t.height = `${e.offsetHeight}px`, e.querySelectorAll(`[${O}]`).forEach((e) => {
3352
3352
  var t;
3353
3353
  let n = e, r = n.cloneNode(!0);
3354
3354
  r.style.width = `${n.offsetWidth}px`, r.style.flexShrink = "0", r.removeAttribute("contenteditable"), (t = this.ghostEl) == null || t.appendChild(r);
@@ -3356,10 +3356,10 @@ var er = (e) => ({ element: $n({
3356
3356
  }
3357
3357
  buildColumnGhost() {
3358
3358
  if (!this.ghostEl) return;
3359
- let e = this.grid.querySelectorAll(`[${T}]`), t = this.ghostEl.style;
3359
+ let e = this.grid.querySelectorAll(`[${D}]`), t = this.ghostEl.style;
3360
3360
  t.display = "flex", t.flexDirection = "column", e.forEach((e) => {
3361
3361
  var t;
3362
- let n = e.querySelectorAll(`[${E}]`);
3362
+ let n = e.querySelectorAll(`[${O}]`);
3363
3363
  if (this.dragFromIndex >= n.length) return;
3364
3364
  let r = n[this.dragFromIndex], i = r.cloneNode(!0);
3365
3365
  i.style.width = `${r.offsetWidth}px`, i.style.height = `${r.offsetHeight}px`, i.removeAttribute("contenteditable"), (t = this.ghostEl) == null || t.appendChild(i);
@@ -3371,7 +3371,7 @@ var er = (e) => ({ element: $n({
3371
3371
  this.dragType === "row" && (t.top = `${e.clientY - this.ghostOffsetY}px`), this.dragType === "col" && (t.left = `${e.clientX - this.ghostOffsetX}px`);
3372
3372
  }
3373
3373
  getRowDropIndex(e) {
3374
- let t = Array.from(this.grid.querySelectorAll(`[${T}]`)), n = t.map((e) => e.offsetTop);
3374
+ let t = Array.from(this.grid.querySelectorAll(`[${D}]`)), n = t.map((e) => e.offsetTop);
3375
3375
  if (t.length > 0) {
3376
3376
  let e = t[t.length - 1];
3377
3377
  n.push(e.offsetTop + e.offsetHeight);
@@ -3380,7 +3380,7 @@ var er = (e) => ({ element: $n({
3380
3380
  return r.indexOf(i);
3381
3381
  }
3382
3382
  getRowDropTopPx(e) {
3383
- let t = this.grid.querySelectorAll(`[${T}]`);
3383
+ let t = this.grid.querySelectorAll(`[${D}]`);
3384
3384
  if (e < t.length) return t[e].offsetTop;
3385
3385
  if (t.length > 0) {
3386
3386
  let e = t[t.length - 1];
@@ -3389,10 +3389,10 @@ var er = (e) => ({ element: $n({
3389
3389
  return 0;
3390
3390
  }
3391
3391
  getColDropIndex(e) {
3392
- let t = qr(this.grid).map((t) => Math.abs(e - t)), n = Math.min(...t);
3392
+ let t = Kr(this.grid).map((t) => Math.abs(e - t)), n = Math.min(...t);
3393
3393
  return t.indexOf(n);
3394
3394
  }
3395
- }, Yr = [
3395
+ }, Jr = [
3396
3396
  "flex",
3397
3397
  "items-center",
3398
3398
  "select-none",
@@ -3404,7 +3404,7 @@ var er = (e) => ({ element: $n({
3404
3404
  "mb-px",
3405
3405
  "cursor-pointer",
3406
3406
  "can-hover:hover:bg-item-hover-bg"
3407
- ], Xr = [
3407
+ ], Yr = [
3408
3408
  "flex",
3409
3409
  "items-center",
3410
3410
  "justify-center",
@@ -3413,13 +3413,13 @@ var er = (e) => ({ element: $n({
3413
3413
  "mr-2",
3414
3414
  "[&_svg]:w-icon",
3415
3415
  "[&_svg]:h-icon"
3416
- ], Zr = [
3416
+ ], Xr = [
3417
3417
  "mr-auto",
3418
3418
  "truncate",
3419
3419
  "text-sm",
3420
3420
  "font-medium",
3421
3421
  "leading-5"
3422
- ], Qr = [
3422
+ ], Zr = [
3423
3423
  "relative",
3424
3424
  "w-[34px]",
3425
3425
  "h-[20px]",
@@ -3427,7 +3427,7 @@ var er = (e) => ({ element: $n({
3427
3427
  "transition-colors",
3428
3428
  "duration-200",
3429
3429
  "shrink-0"
3430
- ], $r = [
3430
+ ], Qr = [
3431
3431
  "absolute",
3432
3432
  "top-[2px]",
3433
3433
  "w-4",
@@ -3437,36 +3437,36 @@ var er = (e) => ({ element: $n({
3437
3437
  "shadow-xs",
3438
3438
  "transition-[left]",
3439
3439
  "duration-200"
3440
- ], ei = (e) => {
3440
+ ], $r = (e) => {
3441
3441
  let { icon: t, label: n, isActive: r, onToggle: i } = e, a = { active: r }, o = document.createElement("div");
3442
- o.className = b(Yr);
3442
+ o.className = C(Jr);
3443
3443
  let s = document.createElement("div");
3444
- s.className = b(Xr), s.innerHTML = t, o.appendChild(s);
3444
+ s.className = C(Yr), s.innerHTML = t, o.appendChild(s);
3445
3445
  let c = document.createElement("span");
3446
- c.className = b(Zr), c.textContent = n, o.appendChild(c);
3446
+ c.className = C(Xr), c.textContent = n, o.appendChild(c);
3447
3447
  let l = document.createElement("div");
3448
- l.className = b(Qr);
3448
+ l.className = C(Zr);
3449
3449
  let u = document.createElement("div");
3450
- u.className = b($r), l.appendChild(u), o.appendChild(l);
3450
+ u.className = C(Qr), l.appendChild(u), o.appendChild(l);
3451
3451
  let d = () => {
3452
3452
  l.style.backgroundColor = a.active ? "#3b82f6" : "#d1d5db", u.style.left = a.active ? "16px" : "2px";
3453
3453
  };
3454
3454
  return d(), o.addEventListener("click", (e) => {
3455
3455
  e.stopPropagation(), a.active = !a.active, d(), i(a.active);
3456
3456
  }), o;
3457
- }, ti = (e, t) => {
3458
- let r = e === 0 ? [{
3459
- type: n.Html,
3460
- element: ei({
3461
- icon: h,
3457
+ }, ei = (e, t) => {
3458
+ let n = e === 0 ? [{
3459
+ type: _.Html,
3460
+ element: $r({
3461
+ icon: f,
3462
3462
  label: t.i18n.t("tools.table.headerColumn"),
3463
3463
  isActive: t.isHeadingColumn(),
3464
3464
  onToggle: () => {
3465
3465
  t.onAction({ type: "toggle-heading-column" });
3466
3466
  }
3467
3467
  })
3468
- }, { type: n.Separator }] : [], i = [{
3469
- icon: se,
3468
+ }, { type: _.Separator }] : [], r = [{
3469
+ icon: oe,
3470
3470
  title: t.i18n.t("tools.table.insertColumnLeft"),
3471
3471
  closeOnActivate: !0,
3472
3472
  onActivate: () => {
@@ -3476,7 +3476,7 @@ var er = (e) => ({ element: $n({
3476
3476
  });
3477
3477
  }
3478
3478
  }, {
3479
- icon: d,
3479
+ icon: s,
3480
3480
  title: t.i18n.t("tools.table.insertColumnRight"),
3481
3481
  closeOnActivate: !0,
3482
3482
  onActivate: () => {
@@ -3485,11 +3485,11 @@ var er = (e) => ({ element: $n({
3485
3485
  index: e
3486
3486
  });
3487
3487
  }
3488
- }], a = t.getColumnCount() > 1, o = [{ type: n.Separator }, {
3489
- icon: De,
3488
+ }], i = t.getColumnCount() > 1, a = [{ type: _.Separator }, {
3489
+ icon: xe,
3490
3490
  title: t.i18n.t("tools.table.deleteColumn"),
3491
3491
  isDestructive: !0,
3492
- isDisabled: !a,
3492
+ isDisabled: !i,
3493
3493
  closeOnActivate: !0,
3494
3494
  onActivate: () => {
3495
3495
  t.onAction({
@@ -3499,23 +3499,23 @@ var er = (e) => ({ element: $n({
3499
3499
  }
3500
3500
  }];
3501
3501
  return [
3502
+ ...n,
3502
3503
  ...r,
3503
- ...i,
3504
- ...o
3504
+ ...a
3505
3505
  ];
3506
- }, ni = (e, t) => {
3507
- let i = e === 0 ? [{
3508
- type: n.Html,
3509
- element: ei({
3510
- icon: ie,
3506
+ }, ti = (e, t) => {
3507
+ let r = e === 0 ? [{
3508
+ type: _.Html,
3509
+ element: $r({
3510
+ icon: ne,
3511
3511
  label: t.i18n.t("tools.table.headerRow"),
3512
3512
  isActive: t.isHeadingRow(),
3513
3513
  onToggle: () => {
3514
3514
  t.onAction({ type: "toggle-heading" });
3515
3515
  }
3516
3516
  })
3517
- }, { type: n.Separator }] : [], a = [{
3518
- icon: qe,
3517
+ }, { type: _.Separator }] : [], i = [{
3518
+ icon: We,
3519
3519
  title: t.i18n.t("tools.table.insertRowAbove"),
3520
3520
  closeOnActivate: !0,
3521
3521
  onActivate: () => {
@@ -3525,7 +3525,7 @@ var er = (e) => ({ element: $n({
3525
3525
  });
3526
3526
  }
3527
3527
  }, {
3528
- icon: r,
3528
+ icon: n,
3529
3529
  title: t.i18n.t("tools.table.insertRowBelow"),
3530
3530
  closeOnActivate: !0,
3531
3531
  onActivate: () => {
@@ -3534,11 +3534,11 @@ var er = (e) => ({ element: $n({
3534
3534
  index: e
3535
3535
  });
3536
3536
  }
3537
- }], o = t.getRowCount() > 1, s = [{ type: n.Separator }, {
3538
- icon: De,
3537
+ }], a = t.getRowCount() > 1, o = [{ type: _.Separator }, {
3538
+ icon: xe,
3539
3539
  title: t.i18n.t("tools.table.deleteRow"),
3540
3540
  isDestructive: !0,
3541
- isDisabled: !o,
3541
+ isDisabled: !a,
3542
3542
  closeOnActivate: !0,
3543
3543
  onActivate: () => {
3544
3544
  t.onAction({
@@ -3548,30 +3548,30 @@ var er = (e) => ({ element: $n({
3548
3548
  }
3549
3549
  }];
3550
3550
  return [
3551
+ ...r,
3551
3552
  ...i,
3552
- ...a,
3553
- ...s
3553
+ ...o
3554
3554
  ];
3555
- }, ri = (e, t, n, r, i) => {
3555
+ }, ni = (e, t, n, r, i) => {
3556
3556
  i.destroyPopover(), i.clearHideTimeout();
3557
3557
  let a = e === "col" ? n.col[t] : n.row[t];
3558
3558
  if (!a) return {
3559
3559
  popover: null,
3560
3560
  grip: null
3561
3561
  };
3562
- let o = new Se({
3563
- items: e === "col" ? ti(t, r) : ni(t, r),
3562
+ let o = new _e({
3563
+ items: e === "col" ? ei(t, r) : ti(t, r),
3564
3564
  trigger: a,
3565
3565
  flippable: !0
3566
3566
  });
3567
- return o.on(Ge.Closed, () => {
3567
+ return o.on(Ve.Closed, () => {
3568
3568
  var e;
3569
3569
  i.destroyPopover(), i.applyVisibleClasses(a), i.scheduleHideAll(), (e = i.onGripPopoverClose) == null || e.call(i);
3570
3570
  }), i.hideAllGripsExcept(a), i.applyActiveClasses(a), e === "col" ? a.style.height = "16px" : a.style.width = "16px", {
3571
3571
  popover: o,
3572
3572
  grip: a
3573
3573
  };
3574
- }, ii = "data-blok-table-grip", R = "data-blok-table-grip-col", ai = "data-blok-table-grip-row", oi = 150, si = 24, z = 4, B = 4, ci = 20, li = [
3574
+ }, ri = "data-blok-table-grip", z = "data-blok-table-grip-col", ii = "data-blok-table-grip-row", ai = 150, oi = 24, si = 4, B = 4, ci = 20, li = [
3575
3575
  "absolute",
3576
3576
  "z-3",
3577
3577
  "rounded-sm",
@@ -3602,7 +3602,7 @@ var er = (e) => ({ element: $n({
3602
3602
  this.colGrips = [], this.rowGrips = [], this.popoverState = {
3603
3603
  popover: null,
3604
3604
  grip: null
3605
- }, this.lockedGrip = null, this.hideTimeout = null, this.activeColGripIndex = -1, this.activeRowGripIndex = -1, this.isInsideTable = !1, this.rowResizeObserver = null, this.boundScrollHandler = null, this.grid = e.grid, this.overlay = e.overlay, this.scrollContainer = e.scrollContainer, this.getColumnCount = e.getColumnCount, this.getRowCount = e.getRowCount, this.isHeadingRow = e.isHeadingRow, this.isHeadingColumn = e.isHeadingColumn, this.onAction = e.onAction, this.onGripClick = e.onGripClick, this.onGripPopoverClose = e.onGripPopoverClose, this.i18n = e.i18n, this.drag = new Jr({
3605
+ }, this.lockedGrip = null, this.hideTimeout = null, this.activeColGripIndex = -1, this.activeRowGripIndex = -1, this.isInsideTable = !1, this.rowResizeObserver = null, this.boundScrollHandler = null, this.grid = e.grid, this.overlay = e.overlay, this.scrollContainer = e.scrollContainer, this.getColumnCount = e.getColumnCount, this.getRowCount = e.getRowCount, this.isHeadingRow = e.isHeadingRow, this.isHeadingColumn = e.isHeadingColumn, this.onAction = e.onAction, this.onGripClick = e.onGripClick, this.onGripPopoverClose = e.onGripPopoverClose, this.i18n = e.i18n, this.drag = new qr({
3606
3606
  grid: this.grid,
3607
3607
  onAction: this.onAction,
3608
3608
  onDragStateChange: (t, n) => {
@@ -3623,7 +3623,7 @@ var er = (e) => ({ element: $n({
3623
3623
  }
3624
3624
  handleUnlockGrip(e) {
3625
3625
  document.removeEventListener("pointerdown", this.boundUnlockGrip), this.lockedGrip && (this.applyIdleClasses(this.lockedGrip), this.lockedGrip = null);
3626
- let t = e.target instanceof HTMLElement ? e.target : null, n = t == null ? void 0 : t.closest(`[${E}]`);
3626
+ let t = e.target instanceof HTMLElement ? e.target : null, n = t == null ? void 0 : t.closest(`[${O}]`);
3627
3627
  if (n) {
3628
3628
  let e = this.getCellPosition(n);
3629
3629
  e && (this.clearHideTimeout(), this.showColGrip(e.col), this.showRowGrip(e.row), this.isInsideTable = !0);
@@ -3670,18 +3670,18 @@ var er = (e) => ({ element: $n({
3670
3670
  }
3671
3671
  createGripElement(e, t) {
3672
3672
  let n = document.createElement("div");
3673
- n.className = b(li, ui), n.setAttribute(ii, ""), n.setAttribute(e === "col" ? R : ai, String(t)), n.setAttribute("contenteditable", "false");
3674
- let r = e === "col" ? si : B, i = e === "col" ? z : ci, a = e === "col" ? z : B;
3675
- return n.style.width = `${r}px`, n.style.height = `${i}px`, n.style.transform = "translate(-50%, -50%)", n.style.outline = "2px solid white", n.appendChild(rr(e === "col" ? "horizontal" : "vertical")), n.addEventListener("pointerdown", this.boundPointerDown), n.addEventListener("mouseenter", () => {
3676
- this.overlay && this.clearHideTimeout(), this.isGripInteractionLocked() || ir(n, e);
3673
+ n.className = C(li, ui), n.setAttribute(ri, ""), n.setAttribute(e === "col" ? z : ii, String(t)), n.setAttribute("contenteditable", "false");
3674
+ let r = e === "col" ? oi : B, i = e === "col" ? si : ci, a = e === "col" ? si : B;
3675
+ return n.style.width = `${r}px`, n.style.height = `${i}px`, n.style.transform = "translate(-50%, -50%)", n.style.outline = "2px solid white", n.appendChild(tr(e === "col" ? "horizontal" : "vertical")), n.addEventListener("pointerdown", this.boundPointerDown), n.addEventListener("mouseenter", () => {
3676
+ this.overlay && this.clearHideTimeout(), this.isGripInteractionLocked() || nr(n, e);
3677
3677
  }), n.addEventListener("mouseleave", () => {
3678
- this.isGripInteractionLocked() || (ar(n, e, a), this.overlay && this.scheduleHideAll());
3678
+ this.isGripInteractionLocked() || (rr(n, e, a), this.overlay && this.scheduleHideAll());
3679
3679
  }), n;
3680
3680
  }
3681
3681
  positionGrips() {
3682
- let e = this.grid.querySelectorAll(`[${T}]`);
3682
+ let e = this.grid.querySelectorAll(`[${D}]`);
3683
3683
  if (!e[0]) return;
3684
- let t = qr(this.grid), n = this.overlay && this.scrollContainer ? this.scrollContainer.scrollLeft : 0, r = this.overlay && this.scrollContainer ? this.scrollContainer.clientWidth : Infinity;
3684
+ let t = Kr(this.grid), n = this.overlay && this.scrollContainer ? this.scrollContainer.scrollLeft : 0, r = this.overlay && this.scrollContainer ? this.scrollContainer.clientWidth : Infinity;
3685
3685
  this.colGrips.forEach((e, i) => {
3686
3686
  if (i + 1 >= t.length) return;
3687
3687
  let a = (t[i] + t[i + 1]) / 2 - n, o = e.style;
@@ -3696,7 +3696,7 @@ var er = (e) => ({ element: $n({
3696
3696
  var e;
3697
3697
  (e = this.rowResizeObserver) == null || e.disconnect(), this.rowResizeObserver = new ResizeObserver(() => {
3698
3698
  this.positionGrips();
3699
- }), this.grid.querySelectorAll(`[${T}]`).forEach((e) => {
3699
+ }), this.grid.querySelectorAll(`[${D}]`).forEach((e) => {
3700
3700
  var t;
3701
3701
  (t = this.rowResizeObserver) == null || t.observe(e);
3702
3702
  });
@@ -3706,7 +3706,7 @@ var er = (e) => ({ element: $n({
3706
3706
  }
3707
3707
  handleMouseOver(e) {
3708
3708
  if (this.isGripInteractionLocked()) return;
3709
- let t = e.target.closest(`[${E}]`);
3709
+ let t = e.target.closest(`[${O}]`);
3710
3710
  if (!t) return;
3711
3711
  this.clearHideTimeout();
3712
3712
  let n = this.getCellPosition(t);
@@ -3716,11 +3716,11 @@ var er = (e) => ({ element: $n({
3716
3716
  this.isGripInteractionLocked() || this.scheduleHideAll();
3717
3717
  }
3718
3718
  getCellPosition(e) {
3719
- let t = e.closest(`[${T}]`);
3719
+ let t = e.closest(`[${D}]`);
3720
3720
  if (!t) return null;
3721
- let n = Array.from(this.grid.querySelectorAll(`[${T}]`)).indexOf(t);
3721
+ let n = Array.from(this.grid.querySelectorAll(`[${D}]`)).indexOf(t);
3722
3722
  if (n < 0) return null;
3723
- let r = Array.from(t.querySelectorAll(`[${E}]`)).indexOf(e);
3723
+ let r = Array.from(t.querySelectorAll(`[${O}]`)).indexOf(e);
3724
3724
  return r < 0 ? null : {
3725
3725
  row: n,
3726
3726
  col: r
@@ -3749,13 +3749,13 @@ var er = (e) => ({ element: $n({
3749
3749
  this.activeRowGripIndex >= 0 && this.activeRowGripIndex < this.rowGrips.length && this.applyIdleClasses(this.rowGrips[this.activeRowGripIndex]), this.activeRowGripIndex = -1;
3750
3750
  }
3751
3751
  applyVisibleClasses(e) {
3752
- let t = e, n = t.hasAttribute(R);
3753
- ar(t, n ? "col" : "row", n ? z : B), this.isInsideTable && (t.style.transition = "none"), t.className = b(li, di), t.setAttribute("data-blok-table-grip-visible", ""), this.isInsideTable && (t.offsetHeight, t.style.transition = "");
3752
+ let t = e, n = t.hasAttribute(z);
3753
+ rr(t, n ? "col" : "row", n ? si : B), this.isInsideTable && (t.style.transition = "none"), t.className = C(li, di), t.setAttribute("data-blok-table-grip-visible", ""), this.isInsideTable && (t.offsetHeight, t.style.transition = "");
3754
3754
  let r = t.querySelector("svg");
3755
3755
  r && (r.classList.remove("text-white"), r.classList.add("text-gray-400"));
3756
3756
  }
3757
3757
  applyActiveClasses(e) {
3758
- Object.assign(e, { className: b(li, fi) }), e.setAttribute("data-blok-table-grip-visible", "");
3758
+ Object.assign(e, { className: C(li, fi) }), e.setAttribute("data-blok-table-grip-visible", "");
3759
3759
  let t = e.querySelector("svg");
3760
3760
  t && (t.classList.remove("text-gray-400", "opacity-0"), t.classList.add("text-white", "opacity-100"));
3761
3761
  }
@@ -3765,8 +3765,8 @@ var er = (e) => ({ element: $n({
3765
3765
  });
3766
3766
  }
3767
3767
  applyIdleClasses(e) {
3768
- let t = e, n = t.hasAttribute(R), r = n ? "col" : "row", i = n ? z + 12 : B + 12;
3769
- this.isInsideTable && (t.style.transition = "none"), ar(t, r, i), t.className = b(li, ui), t.removeAttribute("data-blok-table-grip-visible"), this.isInsideTable && (t.offsetHeight, t.style.transition = "");
3768
+ let t = e, n = t.hasAttribute(z), r = n ? "col" : "row", i = n ? si + 12 : B + 12;
3769
+ this.isInsideTable && (t.style.transition = "none"), rr(t, r, i), t.className = C(li, ui), t.removeAttribute("data-blok-table-grip-visible"), this.isInsideTable && (t.offsetHeight, t.style.transition = "");
3770
3770
  }
3771
3771
  handleDragStateChange(e, t) {
3772
3772
  [...this.colGrips, ...this.rowGrips].forEach((t) => {
@@ -3777,13 +3777,13 @@ var er = (e) => ({ element: $n({
3777
3777
  scheduleHideAll() {
3778
3778
  this.hideTimeout = setTimeout(() => {
3779
3779
  this.hideColGrip(), this.hideRowGrip(), this.isInsideTable = !1, this.hideTimeout = null;
3780
- }, oi);
3780
+ }, ai);
3781
3781
  }
3782
3782
  clearHideTimeout() {
3783
3783
  this.hideTimeout !== null && (clearTimeout(this.hideTimeout), this.hideTimeout = null);
3784
3784
  }
3785
3785
  handlePointerDown(e) {
3786
- let t = e.target.closest(`[${ii}]`);
3786
+ let t = e.target.closest(`[${ri}]`);
3787
3787
  if (!t) return;
3788
3788
  e.preventDefault(), e.stopPropagation();
3789
3789
  let n = this.detectGripType(t);
@@ -3792,12 +3792,12 @@ var er = (e) => ({ element: $n({
3792
3792
  });
3793
3793
  }
3794
3794
  detectGripType(e) {
3795
- let t = e.getAttribute(R);
3795
+ let t = e.getAttribute(z);
3796
3796
  if (t !== null) return {
3797
3797
  type: "col",
3798
3798
  index: Number(t)
3799
3799
  };
3800
- let n = e.getAttribute(ai);
3800
+ let n = e.getAttribute(ii);
3801
3801
  return n === null ? null : {
3802
3802
  type: "row",
3803
3803
  index: Number(n)
@@ -3805,7 +3805,7 @@ var er = (e) => ({ element: $n({
3805
3805
  }
3806
3806
  openPopover(e, t) {
3807
3807
  var n, r;
3808
- this.popoverState = ri(e, t, {
3808
+ this.popoverState = ni(e, t, {
3809
3809
  col: this.colGrips,
3810
3810
  row: this.rowGrips
3811
3811
  }, {
@@ -3902,8 +3902,8 @@ var er = (e) => ({ element: $n({
3902
3902
  ], Ti = class {
3903
3903
  constructor({ data: e, config: t, api: n, readOnly: r, block: i }) {
3904
3904
  this.initialContent = null, this.resize = null, this.addControls = null, this.rowColControls = null, this.cellBlocks = null, this.cellSelection = null, this.scrollHaze = null, this.element = null, this.gridElement = null, this.scrollContainer = null, this.gripOverlay = null, this.pendingHighlight = null, this.isNewTable = !1, this.unregisterRestrictedTools = null, this.setDataGeneration = 0, this.structuralOpDepth = 0, this.api = n, this.readOnly = r, this.config = t == null ? {} : t;
3905
- let a = Dr(e, this.config);
3906
- this.initialContent = a.content, this.grid = new Jn({ readOnly: r }), this.model = new jr(a), this.blockId = i == null ? void 0 : i.id, this.config.restrictedTools !== void 0 && (this.unregisterRestrictedTools = ue(this.config.restrictedTools));
3905
+ let a = Er(e, this.config);
3906
+ this.initialContent = a.content, this.grid = new Kn({ readOnly: r }), this.model = new Ar(a), this.blockId = i == null ? void 0 : i.id, this.config.restrictedTools !== void 0 && (this.unregisterRestrictedTools = u(this.config.restrictedTools));
3907
3907
  }
3908
3908
  runStructuralOp(e, t = !1) {
3909
3909
  this.structuralOpDepth++;
@@ -3938,7 +3938,7 @@ var er = (e) => ({ element: $n({
3938
3938
  }
3939
3939
  static get toolbox() {
3940
3940
  return {
3941
- icon: re,
3941
+ icon: te,
3942
3942
  title: "Table",
3943
3943
  titleKey: "tools.table.title",
3944
3944
  searchTerms: [
@@ -3971,7 +3971,7 @@ var er = (e) => ({ element: $n({
3971
3971
  em: !0,
3972
3972
  mark: (e) => {
3973
3973
  let t = e.style, n = Array.from({ length: t.length }, (e, n) => t.item(n));
3974
- for (let e of n) ge.has(e) || t.removeProperty(e);
3974
+ for (let e of n) Ae.has(e) || t.removeProperty(e);
3975
3975
  return t.length > 0 ? { style: !0 } : {};
3976
3976
  },
3977
3977
  a: { href: !0 },
@@ -3992,26 +3992,26 @@ var er = (e) => ({ element: $n({
3992
3992
  render() {
3993
3993
  var e, t, n, r, i, a;
3994
3994
  let o = document.createElement("div");
3995
- o.className = b(Ci, !this.readOnly && wi), o.setAttribute(s.tool, "table"), this.readOnly && o.setAttribute("data-blok-table-readonly", ""), this.isNewTable = ((e = (t = this.initialContent) == null ? void 0 : t.length) == null ? 0 : e) === 0;
3996
- let c = ((n = this.initialContent) == null ? void 0 : n.length) || this.config.rows || xi, l = ((r = this.initialContent) == null ? void 0 : r.reduce((e, t) => {
3995
+ o.className = C(Ci, !this.readOnly && wi), o.setAttribute(x.tool, "table"), this.readOnly && o.setAttribute("data-blok-table-readonly", ""), this.isNewTable = ((e = (t = this.initialContent) == null ? void 0 : t.length) == null ? 0 : e) === 0;
3996
+ let s = ((n = this.initialContent) == null ? void 0 : n.length) || this.config.rows || xi, c = ((r = this.initialContent) == null ? void 0 : r.reduce((e, t) => {
3997
3997
  var n;
3998
3998
  return Math.max(e, (n = t == null ? void 0 : t.length) == null ? 0 : n);
3999
- }, 0)) || this.config.cols || Si, u = this.grid.createGrid(c, l, this.model.colWidths);
3999
+ }, 0)) || this.config.cols || Si, l = this.grid.createGrid(s, c, this.model.colWidths);
4000
4000
  if (((i = (a = this.initialContent) == null ? void 0 : a.length) == null ? 0 : i) > 0) {
4001
- var d;
4002
- this.grid.fillGrid(u, (d = this.initialContent) == null ? [] : d);
4001
+ var u;
4002
+ this.grid.fillGrid(l, (u = this.initialContent) == null ? [] : u);
4003
4003
  }
4004
- if (this.model.colWidths && j(u, this.model.colWidths), this.gridElement = u, this.model.colWidths || !this.readOnly) {
4004
+ if (this.model.colWidths && pr(l, this.model.colWidths), this.gridElement = l, this.model.colWidths || !this.readOnly) {
4005
4005
  let e = document.createElement("div");
4006
4006
  e.setAttribute("data-blok-table-scroll", "");
4007
- let t = this.model.colWidths ? kr : [];
4008
- e.classList.add(...t), e.appendChild(u), o.appendChild(e), this.scrollContainer = e;
4009
- } else o.appendChild(u), this.scrollContainer = null;
4007
+ let t = this.model.colWidths ? Or : [];
4008
+ e.classList.add(...t), e.appendChild(l), o.appendChild(e), this.scrollContainer = e;
4009
+ } else o.appendChild(l), this.scrollContainer = null;
4010
4010
  if (!this.readOnly) {
4011
4011
  let e = document.createElement("div");
4012
4012
  e.setAttribute("data-blok-table-grip-overlay", ""), e.style.position = "absolute", e.style.inset = "0", e.style.pointerEvents = "none", e.style.zIndex = "3", o.appendChild(e), this.gripOverlay = e;
4013
4013
  }
4014
- return this.element = o, this.model.withHeadings && P(this.gridElement, this.model.withHeadings), this.model.withHeadingColumn && I(this.gridElement, this.model.withHeadingColumn), this.readOnly || (this.initCellBlocks(u), Or(u, this.cellBlocks)), o;
4014
+ return this.element = o, this.model.withHeadings && F(this.gridElement, this.model.withHeadings), this.model.withHeadingColumn && L(this.gridElement, this.model.withHeadingColumn), this.readOnly || (this.initCellBlocks(l), Dr(l, this.cellBlocks)), o;
4015
4015
  }
4016
4016
  rendered() {
4017
4017
  if (!this.element || this.initialContent === null) return;
@@ -4020,22 +4020,22 @@ var er = (e) => ({ element: $n({
4020
4020
  let t = this.initialContent;
4021
4021
  if (this.initialContent = null, this.readOnly) {
4022
4022
  var n;
4023
- Er(e, t, this.api, (n = this.blockId) == null ? "" : n), F(e, this.model.snapshot().content), this.initScrollHaze();
4023
+ Tr(e, t, this.api, (n = this.blockId) == null ? "" : n), I(e, this.model.snapshot().content), this.initScrollHaze();
4024
4024
  return;
4025
4025
  }
4026
4026
  if (this.runTransactedStructuralOp(() => {
4027
4027
  var n, r;
4028
- let i = (n = (r = this.cellBlocks) == null ? void 0 : r.initializeCells(t)) == null ? t : n, a = this.isNewTable && i.length === 0 ? Array.from(e.querySelectorAll(`[${T}]`), (e) => {
4029
- let t = e.querySelectorAll(`[${E}]`).length;
4028
+ let i = (n = (r = this.cellBlocks) == null ? void 0 : r.initializeCells(t)) == null ? t : n, a = this.isNewTable && i.length === 0 ? Array.from(e.querySelectorAll(`[${D}]`), (e) => {
4029
+ let t = e.querySelectorAll(`[${O}]`).length;
4030
4030
  return Array.from({ length: t }, () => ({ blocks: [] }));
4031
4031
  }) : i;
4032
- this.model.replaceAll(y(y({}, this.model.snapshot()), {}, { content: a })), this.isNewTable && N(e, this.cellBlocks), this.removeGhostChildren();
4032
+ this.model.replaceAll(S(S({}, this.model.snapshot()), {}, { content: a })), this.isNewTable && P(e, this.cellBlocks), this.removeGhostChildren();
4033
4033
  }, !0), this.model.initialColWidth === void 0) {
4034
4034
  var r;
4035
- let t = (r = this.model.colWidths) == null ? A(e) : r;
4036
- this.model.setInitialColWidth(t.length > 0 ? Cr(t) : void 0);
4035
+ let t = (r = this.model.colWidths) == null ? M(e) : r;
4036
+ this.model.setInitialColWidth(t.length > 0 ? Sr(t) : void 0);
4037
4037
  }
4038
- if (this.initSubsystems(e), F(e, this.model.snapshot().content), this.isNewTable) {
4038
+ if (this.initSubsystems(e), I(e, this.model.snapshot().content), this.isNewTable) {
4039
4039
  var i;
4040
4040
  (i = this.cellSelection) == null || i.selectRange({
4041
4041
  minRow: 0,
@@ -4063,7 +4063,7 @@ var er = (e) => ({ element: $n({
4063
4063
  setData(e) {
4064
4064
  var t, n, r, i, a;
4065
4065
  this.setDataGeneration++;
4066
- let o = this.setDataGeneration, s = Dr(y(y({}, this.model.snapshot()), e), this.config);
4066
+ let o = this.setDataGeneration, s = Er(S(S({}, this.model.snapshot()), e), this.config);
4067
4067
  this.initialContent = s.content, this.model.replaceAll(s), this.api.blocks.isSyncingFromYjs || this.runStructuralOp(() => {
4068
4068
  var e;
4069
4069
  (e = this.cellBlocks) == null || e.deleteAllBlocks();
@@ -4077,7 +4077,7 @@ var er = (e) => ({ element: $n({
4077
4077
  let f = this.gridElement;
4078
4078
  if (f) {
4079
4079
  if (this.readOnly) {
4080
- F(f, this.model.snapshot().content);
4080
+ I(f, this.model.snapshot().content);
4081
4081
  return;
4082
4082
  }
4083
4083
  o === this.setDataGeneration && (this.runStructuralOp(() => {
@@ -4085,15 +4085,15 @@ var er = (e) => ({ element: $n({
4085
4085
  let i = (e = (t = (n = this.cellBlocks) == null ? void 0 : n.initializeCells((r = this.initialContent) == null ? [] : r)) == null ? this.initialContent : t) == null ? [] : e;
4086
4086
  if (o === this.setDataGeneration) {
4087
4087
  if (this.api.blocks.isSyncingFromYjs && i.length === 0 && f) {
4088
- let e = Array.from(f.querySelectorAll(`[${T}]`), (e) => {
4089
- let t = e.querySelectorAll(`[${E}]`).length;
4088
+ let e = Array.from(f.querySelectorAll(`[${D}]`), (e) => {
4089
+ let t = e.querySelectorAll(`[${O}]`).length;
4090
4090
  return Array.from({ length: t }, () => ({ blocks: [] }));
4091
4091
  });
4092
- this.model.replaceAll(y(y({}, this.model.snapshot()), {}, { content: e })), N(f, this.cellBlocks);
4093
- } else this.model.replaceAll(y(y({}, this.model.snapshot()), {}, { content: i }));
4092
+ this.model.replaceAll(S(S({}, this.model.snapshot()), {}, { content: e })), P(f, this.cellBlocks);
4093
+ } else this.model.replaceAll(S(S({}, this.model.snapshot()), {}, { content: i }));
4094
4094
  this.initialContent = null;
4095
4095
  }
4096
- }, !0), o === this.setDataGeneration && (this.initSubsystems(f), l !== null && this.cellSelection !== null && this.cellSelection.selectRange(l), u !== null && this.rowColControls !== null && this.rowColControls.restoreVisibleGrips(u.col, u.row), F(f, this.model.snapshot().content)));
4096
+ }, !0), o === this.setDataGeneration && (this.initSubsystems(f), l !== null && this.cellSelection !== null && this.cellSelection.selectRange(l), u !== null && this.rowColControls !== null && this.rowColControls.restoreVisibleGrips(u.col, u.row), I(f, this.model.snapshot().content)));
4097
4097
  }
4098
4098
  }
4099
4099
  onPaste(e) {
@@ -4105,9 +4105,9 @@ var er = (e) => ({ element: $n({
4105
4105
  var t;
4106
4106
  n.push(e.innerHTML);
4107
4107
  let i = (t = e.getAttribute("style")) == null ? "" : t, a = {}, o = /background-color\s*:\s*([^;]+)/i.exec(i);
4108
- o != null && o[1] && (a.color = Te(o[1].trim(), "bg"));
4108
+ o != null && o[1] && (a.color = Me(o[1].trim(), "bg"));
4109
4109
  let s = (/* @__PURE__ */ RegExp("(?<![a-z-])color\\s*:\\s*([^;]+)", "i")).exec(i);
4110
- s != null && s[1] && !ve(s[1].trim()) && (a.textColor = Te(s[1].trim(), "text")), r.push(a);
4110
+ s != null && s[1] && !Te(s[1].trim()) && (a.textColor = Me(s[1].trim(), "text")), r.push(a);
4111
4111
  }), n.length > 0 && (a.push(n), o.push(r));
4112
4112
  });
4113
4113
  let s = r.querySelector("thead") !== null, c = ((t = i[0]) == null ? void 0 : t.querySelector("th")) !== null, l = s || c;
@@ -4123,12 +4123,12 @@ var er = (e) => ({ element: $n({
4123
4123
  !this.readOnly && f && (this.runStructuralOp(() => {
4124
4124
  var e, t, n, r;
4125
4125
  let i = (e = (t = (n = this.cellBlocks) == null ? void 0 : n.initializeCells((r = this.initialContent) == null ? [] : r)) == null ? this.initialContent : t) == null ? [] : e;
4126
- this.model.replaceAll(y(y({}, this.model.snapshot()), {}, { content: i })), this.initialContent = null, o.forEach((e, t) => {
4126
+ this.model.replaceAll(S(S({}, this.model.snapshot()), {}, { content: i })), this.initialContent = null, o.forEach((e, t) => {
4127
4127
  e.forEach((e, n) => {
4128
4128
  e.color !== void 0 && this.model.setCellColor(t, n, e.color), e.textColor !== void 0 && this.model.setCellTextColor(t, n, e.textColor);
4129
4129
  });
4130
4130
  });
4131
- }, !0), this.initSubsystems(f), F(f, this.model.snapshot().content));
4131
+ }, !0), this.initSubsystems(f), I(f, this.model.snapshot().content));
4132
4132
  }
4133
4133
  destroy() {
4134
4134
  var e, t;
@@ -4155,35 +4155,35 @@ var er = (e) => ({ element: $n({
4155
4155
  });
4156
4156
  }
4157
4157
  getBlockIdsInRow(e) {
4158
- return wr(this.element, this.cellBlocks, e);
4158
+ return Cr(this.element, this.cellBlocks, e);
4159
4159
  }
4160
4160
  getBlockIdsInColumn(e) {
4161
- return Tr(this.element, this.cellBlocks, e);
4161
+ return wr(this.element, this.cellBlocks, e);
4162
4162
  }
4163
4163
  initAddControls(e) {
4164
4164
  var t;
4165
4165
  if ((t = this.addControls) == null || t.destroy(), !this.element) return;
4166
4166
  let n = { addedCols: 0 };
4167
- this.addControls = new Wn({
4167
+ this.addControls = new Hn({
4168
4168
  wrapper: this.element,
4169
4169
  grid: e,
4170
4170
  i18n: this.api.i18n,
4171
4171
  getNewColumnWidth: () => {
4172
4172
  var t;
4173
- let n = (t = this.model.colWidths) == null ? A(e) : t;
4174
- return this.model.initialColWidth === void 0 ? M(n) : Math.round(this.model.initialColWidth / 2 * 100) / 100;
4173
+ let n = (t = this.model.colWidths) == null ? M(e) : t;
4174
+ return this.model.initialColWidth === void 0 ? N(n) : Math.round(this.model.initialColWidth / 2 * 100) / 100;
4175
4175
  },
4176
4176
  onAddRow: () => {
4177
4177
  this.runTransactedStructuralOp(() => {
4178
4178
  var t, n;
4179
- this.grid.addRow(e), this.model.addRow(), N(e, this.cellBlocks), P(this.gridElement, this.model.withHeadings), I(this.gridElement, this.model.withHeadingColumn), this.initResize(e), (t = this.addControls) == null || t.syncRowButtonWidth(), (n = this.rowColControls) == null || n.refresh();
4179
+ this.grid.addRow(e), this.model.addRow(), P(e, this.cellBlocks), F(this.gridElement, this.model.withHeadings), L(this.gridElement, this.model.withHeadingColumn), this.initResize(e), (t = this.addControls) == null || t.syncRowButtonWidth(), (n = this.rowColControls) == null || n.refresh();
4180
4180
  });
4181
4181
  },
4182
4182
  onAddColumn: () => {
4183
4183
  this.runTransactedStructuralOp(() => {
4184
4184
  var t, n, r;
4185
- let i = (t = this.model.colWidths) == null ? A(e) : t, a = this.model.initialColWidth === void 0 ? M(i) : Math.round(this.model.initialColWidth / 2 * 100) / 100;
4186
- this.grid.addColumn(e, void 0, i, a), this.model.addColumn(void 0, a), this.model.setColWidths([...i, a]), N(e, this.cellBlocks), I(this.gridElement, this.model.withHeadingColumn), this.initResize(e), (n = this.rowColControls) == null || n.refresh(), this.scrollContainer && (this.scrollContainer.scrollLeft = this.scrollContainer.scrollWidth), (r = this.addControls) == null || r.syncRowButtonWidth();
4185
+ let i = (t = this.model.colWidths) == null ? M(e) : t, a = this.model.initialColWidth === void 0 ? N(i) : Math.round(this.model.initialColWidth / 2 * 100) / 100;
4186
+ this.grid.addColumn(e, void 0, i, a), this.model.addColumn(void 0, a), this.model.setColWidths([...i, a]), P(e, this.cellBlocks), L(this.gridElement, this.model.withHeadingColumn), this.initResize(e), (n = this.rowColControls) == null || n.refresh(), this.scrollContainer && (this.scrollContainer.scrollLeft = this.scrollContainer.scrollWidth), (r = this.addControls) == null || r.syncRowButtonWidth();
4187
4187
  });
4188
4188
  },
4189
4189
  onDragStart: () => {
@@ -4192,13 +4192,13 @@ var er = (e) => ({ element: $n({
4192
4192
  },
4193
4193
  onDragAddRow: () => {
4194
4194
  this.runTransactedStructuralOp(() => {
4195
- this.grid.addRow(e), this.model.addRow(), N(e, this.cellBlocks), P(this.gridElement, this.model.withHeadings), I(this.gridElement, this.model.withHeadingColumn);
4195
+ this.grid.addRow(e), this.model.addRow(), P(e, this.cellBlocks), F(this.gridElement, this.model.withHeadings), L(this.gridElement, this.model.withHeadingColumn);
4196
4196
  });
4197
4197
  },
4198
4198
  onDragRemoveRow: () => {
4199
4199
  this.runTransactedStructuralOp(() => {
4200
4200
  let t = this.grid.getRowCount(e);
4201
- if (t > 1 && _r(e, t - 1)) {
4201
+ if (t > 1 && gr(e, t - 1)) {
4202
4202
  var n;
4203
4203
  let { blocksToDelete: r } = this.model.deleteRow(t - 1);
4204
4204
  (n = this.cellBlocks) == null || n.deleteBlocks(r), this.grid.deleteRow(e, t - 1);
@@ -4208,19 +4208,19 @@ var er = (e) => ({ element: $n({
4208
4208
  onDragAddCol: () => {
4209
4209
  this.runTransactedStructuralOp(() => {
4210
4210
  var t;
4211
- let r = (t = this.model.colWidths) == null ? A(e) : t, i = this.model.initialColWidth === void 0 ? M(r) : Math.round(this.model.initialColWidth / 2 * 100) / 100, a = [...r, i];
4212
- this.grid.addColumn(e, void 0, r, i), this.model.addColumn(void 0, i), this.model.setColWidths(a), j(e, a), N(e, this.cellBlocks), I(this.gridElement, this.model.withHeadingColumn), this.initResize(e), n.addedCols++, this.scrollContainer && (this.scrollContainer.scrollLeft = this.scrollContainer.scrollWidth);
4211
+ let r = (t = this.model.colWidths) == null ? M(e) : t, i = this.model.initialColWidth === void 0 ? N(r) : Math.round(this.model.initialColWidth / 2 * 100) / 100, a = [...r, i];
4212
+ this.grid.addColumn(e, void 0, r, i), this.model.addColumn(void 0, i), this.model.setColWidths(a), pr(e, a), P(e, this.cellBlocks), L(this.gridElement, this.model.withHeadingColumn), this.initResize(e), n.addedCols++, this.scrollContainer && (this.scrollContainer.scrollLeft = this.scrollContainer.scrollWidth);
4213
4213
  });
4214
4214
  },
4215
4215
  onDragRemoveCol: () => {
4216
4216
  this.runTransactedStructuralOp(() => {
4217
4217
  var t;
4218
4218
  let r = this.grid.getColumnCount(e);
4219
- if (r <= 1 || !vr(e, r - 1)) return;
4219
+ if (r <= 1 || !_r(e, r - 1)) return;
4220
4220
  let { blocksToDelete: i } = this.model.deleteColumn(r - 1);
4221
4221
  (t = this.cellBlocks) == null || t.deleteBlocks(i), this.grid.deleteColumn(e, r - 1);
4222
4222
  let a = this.model.colWidths;
4223
- a && j(e, a), this.initResize(e), n.addedCols--;
4223
+ a && pr(e, a), this.initResize(e), n.addedCols--;
4224
4224
  });
4225
4225
  },
4226
4226
  onDragEnd: () => {
@@ -4279,7 +4279,7 @@ var er = (e) => ({ element: $n({
4279
4279
  this.runTransactedStructuralOp(() => {
4280
4280
  var r, i;
4281
4281
  if (n !== this.setDataGeneration || this.gridElement !== e) return;
4282
- let a = this.model.colWidths, { blocksToDelete: o } = this.syncModelForAction(t), s = Wr(e, t, {
4282
+ let a = this.model.colWidths, { blocksToDelete: o } = this.syncModelForAction(t), s = Ur(e, t, {
4283
4283
  grid: this.grid,
4284
4284
  data: {
4285
4285
  colWidths: a,
@@ -4291,7 +4291,7 @@ var er = (e) => ({ element: $n({
4291
4291
  blocksToDelete: o
4292
4292
  });
4293
4293
  if (n !== this.setDataGeneration || this.gridElement !== e) return;
4294
- if (this.model.setColWidths(s.colWidths), this.model.setWithHeadings(s.withHeadings), this.model.setWithHeadingColumn(s.withHeadingColumn), this.pendingHighlight = s.pendingHighlight, P(this.gridElement, this.model.withHeadings), I(this.gridElement, this.model.withHeadingColumn), this.initResize(e), (r = this.addControls) == null || r.syncRowButtonWidth(), !(t.type === "toggle-heading" || t.type === "toggle-heading-column")) {
4294
+ if (this.model.setColWidths(s.colWidths), this.model.setWithHeadings(s.withHeadings), this.model.setWithHeadingColumn(s.withHeadingColumn), this.pendingHighlight = s.pendingHighlight, F(this.gridElement, this.model.withHeadings), L(this.gridElement, this.model.withHeadingColumn), this.initResize(e), (r = this.addControls) == null || r.syncRowButtonWidth(), !(t.type === "toggle-heading" || t.type === "toggle-heading-column")) {
4295
4295
  var c;
4296
4296
  (c = this.rowColControls) == null || c.refresh();
4297
4297
  }
@@ -4337,10 +4337,10 @@ var er = (e) => ({ element: $n({
4337
4337
  initResize(e) {
4338
4338
  var t, n;
4339
4339
  (t = this.resize) == null || t.destroy();
4340
- let r = this.model.colWidths === void 0, i = (n = this.model.colWidths) == null ? A(e) : n;
4341
- r || Ar(this.ensureScrollContainer()), this.resize = new Lr(e, i, (e) => {
4340
+ let r = this.model.colWidths === void 0, i = (n = this.model.colWidths) == null ? M(e) : n;
4341
+ r || kr(this.ensureScrollContainer()), this.resize = new Ir(e, i, (e) => {
4342
4342
  var t, n, r;
4343
- this.model.setColWidths(e), Ar(this.ensureScrollContainer()), (t = this.rowColControls) == null || t.positionGrips(), (n = this.addControls) == null || n.syncRowButtonWidth(), (r = this.scrollHaze) == null || r.update();
4343
+ this.model.setColWidths(e), kr(this.ensureScrollContainer()), (t = this.rowColControls) == null || t.positionGrips(), (n = this.addControls) == null || n.syncRowButtonWidth(), (r = this.scrollHaze) == null || r.update();
4344
4344
  }, () => {
4345
4345
  var e;
4346
4346
  (e = this.rowColControls) == null || e.hideAllGrips();
@@ -4351,7 +4351,7 @@ var er = (e) => ({ element: $n({
4351
4351
  }
4352
4352
  initCellBlocks(e) {
4353
4353
  var t;
4354
- this.cellBlocks = new Yn({
4354
+ this.cellBlocks = new qn({
4355
4355
  api: this.api,
4356
4356
  gridElement: e,
4357
4357
  tableBlockId: (t = this.blockId) == null ? "" : t,
@@ -4362,13 +4362,13 @@ var er = (e) => ({ element: $n({
4362
4362
  handleCellCopy(e, t) {
4363
4363
  let n = this.collectCellBlockData(e);
4364
4364
  if (n.length === 0) return;
4365
- let r = Me(n);
4366
- t.setData("text/html", je(r)), t.setData("text/plain", We(r));
4365
+ let r = ge(n);
4366
+ t.setData("text/html", Le(r)), t.setData("text/plain", de(r));
4367
4367
  }
4368
4368
  handleCellCopyViaButton(e) {
4369
4369
  let t = this.collectCellBlockData(e);
4370
4370
  if (t.length === 0) return;
4371
- let n = Me(t), r = je(n), i = We(n), a = new Blob([r], { type: "text/html" }), o = new Blob([i], { type: "text/plain" });
4371
+ let n = ge(t), r = Le(n), i = de(n), a = new Blob([r], { type: "text/html" }), o = new Blob([i], { type: "text/plain" });
4372
4372
  navigator.clipboard.write([new ClipboardItem({
4373
4373
  "text/html": a,
4374
4374
  "text/plain": o
@@ -4378,7 +4378,7 @@ var er = (e) => ({ element: $n({
4378
4378
  let r = this.gridElement;
4379
4379
  r && this.runTransactedStructuralOp(() => {
4380
4380
  for (let i of e) {
4381
- let e = hr(r, i);
4381
+ let e = mr(r, i);
4382
4382
  e && (n === "backgroundColor" ? (this.model.setCellColor(e.row, e.col, t == null ? void 0 : t), i.style.backgroundColor = t == null ? "" : t) : (this.model.setCellTextColor(e.row, e.col, t == null ? void 0 : t), i.style.color = t == null ? "" : t));
4383
4383
  }
4384
4384
  });
@@ -4386,12 +4386,12 @@ var er = (e) => ({ element: $n({
4386
4386
  collectCellBlockData(e) {
4387
4387
  let t = this.gridElement;
4388
4388
  if (!t) return [];
4389
- let n = Array.from(t.querySelectorAll(`[${T}]`));
4389
+ let n = Array.from(t.querySelectorAll(`[${D}]`));
4390
4390
  return e.map((e) => {
4391
4391
  var t;
4392
- let r = e.closest(`[${T}]`);
4392
+ let r = e.closest(`[${D}]`);
4393
4393
  if (!r) return null;
4394
- let i = n.indexOf(r), a = Array.from(r.querySelectorAll(`[${E}]`)).indexOf(e), o = e.querySelector(`[${k}]`), s = [];
4394
+ let i = n.indexOf(r), a = Array.from(r.querySelectorAll(`[${O}]`)).indexOf(e), o = e.querySelector(`[${j}]`), s = [];
4395
4395
  if (!o) return {
4396
4396
  row: i,
4397
4397
  col: a,
@@ -4403,7 +4403,7 @@ var er = (e) => ({ element: $n({
4403
4403
  let n = this.api.blocks.getBlockIndex(t);
4404
4404
  if (n === void 0) return;
4405
4405
  let r = this.api.blocks.getBlockByIndex(n);
4406
- r && s.push(y({
4406
+ r && s.push(S({
4407
4407
  tool: r.name,
4408
4408
  data: r.preservedData
4409
4409
  }, Object.keys(r.preservedTunes).length > 0 ? { tunes: r.preservedTunes } : {}));
@@ -4414,7 +4414,7 @@ var er = (e) => ({ element: $n({
4414
4414
  data: { text: c }
4415
4415
  });
4416
4416
  let l = this.model.getCellColor(i, a), u = this.model.getCellTextColor(i, a);
4417
- return y(y({
4417
+ return S(S({
4418
4418
  row: i,
4419
4419
  col: a,
4420
4420
  blocks: s
@@ -4425,7 +4425,7 @@ var er = (e) => ({ element: $n({
4425
4425
  var t;
4426
4426
  (t = this.cellSelection) == null || t.destroy();
4427
4427
  let n = this.api.rectangleSelection;
4428
- this.cellSelection = new mr({
4428
+ this.cellSelection = new fr({
4429
4429
  grid: e,
4430
4430
  rectangleSelection: n,
4431
4431
  i18n: this.api.i18n,
@@ -4452,7 +4452,7 @@ var er = (e) => ({ element: $n({
4452
4452
  t.deleteBlocks(n);
4453
4453
  let r = this.gridElement;
4454
4454
  if (r) for (let t of e) {
4455
- let e = hr(r, t);
4455
+ let e = mr(r, t);
4456
4456
  e && (this.model.setCellColor(e.row, e.col, void 0), this.model.setCellTextColor(e.row, e.col, void 0), t.style.backgroundColor = "", t.style.color = "");
4457
4457
  }
4458
4458
  });
@@ -4482,20 +4482,20 @@ var er = (e) => ({ element: $n({
4482
4482
  }
4483
4483
  handleGridPaste(e, t) {
4484
4484
  if (this.readOnly || !e.clipboardData || e.defaultPrevented) return;
4485
- let n = e.clipboardData.getData("text/html"), r = xe(n), i = r === null ? Le(n) : null, a = r == null ? i : r;
4485
+ let n = e.clipboardData.getData("text/html"), r = Be(n), i = r === null ? pe(n) : null, a = r == null ? i : r;
4486
4486
  if (!a || i !== null && new DOMParser().parseFromString(n, "text/html").querySelectorAll("table").length > 1) return;
4487
4487
  let o = document.activeElement;
4488
4488
  if (!o) return;
4489
- let s = o.closest(`[${E}]`);
4489
+ let s = o.closest(`[${O}]`);
4490
4490
  if (!s || !t.contains(s)) return;
4491
- let c = s.closest(`[${T}]`);
4491
+ let c = s.closest(`[${D}]`);
4492
4492
  if (!c) return;
4493
4493
  if (a.rows === 1 && a.cols === 1) {
4494
4494
  e.preventDefault(), e.stopPropagation(), this.insertSingleCellPayloadInline(a.cells[0][0]);
4495
4495
  return;
4496
4496
  }
4497
4497
  e.preventDefault(), e.stopPropagation();
4498
- let l = Array.from(t.querySelectorAll(`[${T}]`)).indexOf(c), u = Array.from(c.querySelectorAll(`[${E}]`)).indexOf(s);
4498
+ let l = Array.from(t.querySelectorAll(`[${D}]`)).indexOf(c), u = Array.from(c.querySelectorAll(`[${O}]`)).indexOf(s);
4499
4499
  this.pastePayloadIntoCells(t, a, l, u);
4500
4500
  }
4501
4501
  insertSingleCellPayloadInline(e) {
@@ -4516,11 +4516,11 @@ var er = (e) => ({ element: $n({
4516
4516
  this.runTransactedStructuralOp(() => {
4517
4517
  var i, a;
4518
4518
  this.expandGridForPaste(e, n + t.rows, r + t.cols);
4519
- let o = e.querySelectorAll(`[${T}]`);
4519
+ let o = e.querySelectorAll(`[${D}]`);
4520
4520
  Array.from({ length: t.rows }, (e, t) => t).forEach((e) => {
4521
4521
  let i = o[n + e];
4522
4522
  if (!i) return;
4523
- let a = i.querySelectorAll(`[${E}]`);
4523
+ let a = i.querySelectorAll(`[${O}]`);
4524
4524
  Array.from({ length: t.cols }, (e, t) => t).forEach((i) => {
4525
4525
  let o = a[r + i];
4526
4526
  if (o) {
@@ -4535,7 +4535,7 @@ var er = (e) => ({ element: $n({
4535
4535
  });
4536
4536
  }), this.initResize(e), (i = this.addControls) == null || i.syncRowButtonWidth(), (a = this.rowColControls) == null || a.refresh();
4537
4537
  });
4538
- let i = e.querySelectorAll(`[${T}]`)[n + t.rows - 1], a = i == null ? void 0 : i.querySelectorAll(`[${E}]`)[r + t.cols - 1];
4538
+ let i = e.querySelectorAll(`[${D}]`)[n + t.rows - 1], a = i == null ? void 0 : i.querySelectorAll(`[${O}]`)[r + t.cols - 1];
4539
4539
  if (!a || !this.cellBlocks || !this.api.caret) return;
4540
4540
  let o = this.cellBlocks.getBlockIdsFromCells([a]), s = o[o.length - 1];
4541
4541
  s !== void 0 && this.api.caret.setToBlock(s, "end");
@@ -4543,11 +4543,11 @@ var er = (e) => ({ element: $n({
4543
4543
  expandGridForPaste(e, t, n) {
4544
4544
  let r = this.grid.getRowCount(e), i = this.grid.getColumnCount(e);
4545
4545
  Array.from({ length: Math.max(0, t - r) }).forEach(() => {
4546
- this.grid.addRow(e), this.model.addRow(), N(e, this.cellBlocks), P(this.gridElement, this.model.withHeadings), I(this.gridElement, this.model.withHeadingColumn);
4546
+ this.grid.addRow(e), this.model.addRow(), P(e, this.cellBlocks), F(this.gridElement, this.model.withHeadings), L(this.gridElement, this.model.withHeadingColumn);
4547
4547
  }), Array.from({ length: Math.max(0, n - i) }).forEach(() => {
4548
4548
  var t;
4549
- let n = (t = this.model.colWidths) == null ? A(e) : t, r = this.model.initialColWidth === void 0 ? M(n) : Math.round(this.model.initialColWidth / 2 * 100) / 100;
4550
- this.grid.addColumn(e, void 0, n, r), this.model.addColumn(void 0, r), this.model.setColWidths([...n, r]), N(e, this.cellBlocks), I(this.gridElement, this.model.withHeadingColumn);
4549
+ let n = (t = this.model.colWidths) == null ? M(e) : t, r = this.model.initialColWidth === void 0 ? N(n) : Math.round(this.model.initialColWidth / 2 * 100) / 100;
4550
+ this.grid.addColumn(e, void 0, n, r), this.model.addColumn(void 0, r), this.model.setColWidths([...n, r]), P(e, this.cellBlocks), L(this.gridElement, this.model.withHeadingColumn);
4551
4551
  });
4552
4552
  }
4553
4553
  pasteCellPayload(e, t) {
@@ -4555,7 +4555,7 @@ var er = (e) => ({ element: $n({
4555
4555
  let t = this.cellBlocks.getBlockIdsFromCells([e]);
4556
4556
  this.cellBlocks.deleteBlocks(t);
4557
4557
  }
4558
- let n = e.querySelector(`[${k}]`);
4558
+ let n = e.querySelector(`[${j}]`);
4559
4559
  if (n) {
4560
4560
  if (t.blocks.length === 0) {
4561
4561
  var r;
@@ -4578,7 +4578,7 @@ var er = (e) => ({ element: $n({
4578
4578
  if (!t) return e;
4579
4579
  let i = n();
4580
4580
  return {
4581
- text: i ? Je(i.innerHTML) : e.text,
4581
+ text: i ? Ge(i.innerHTML) : e.text,
4582
4582
  isOpen: r
4583
4583
  };
4584
4584
  }, Oi = (e, t) => {
@@ -4595,7 +4595,7 @@ var er = (e) => ({ element: $n({
4595
4595
  newData: e,
4596
4596
  inPlace: !1
4597
4597
  };
4598
- let i = y(y({}, e), t);
4598
+ let i = S(S({}, e), t);
4599
4599
  return typeof t.text == "string" && (r.innerHTML = t.text), {
4600
4600
  newData: i,
4601
4601
  inPlace: !0
@@ -4612,15 +4612,19 @@ var er = (e) => ({ element: $n({
4612
4612
  let t = { text: typeof e.text == "string" ? e.text : "" };
4613
4613
  return typeof e.isOpen == "boolean" && (t.isOpen = e.isOpen), t;
4614
4614
  }
4615
+ if (typeof e == "object" && e && "title" in e) {
4616
+ let t = e, n = { text: typeof t.title == "string" ? t.title : "" };
4617
+ return typeof t.isExpanded == "boolean" && (n.isOpen = t.isExpanded), n;
4618
+ }
4615
4619
  return { text: "" };
4616
4620
  }
4617
4621
  get placeholder() {
4618
4622
  if (this._settings.placeholder) return this._settings.placeholder;
4619
- let e = this.api.i18n.t(Ae);
4623
+ let e = this.api.i18n.t(we);
4620
4624
  return e === "tools.toggle.placeholder" ? "Toggle" : e;
4621
4625
  }
4622
4626
  render() {
4623
- let e = ct({
4627
+ let e = ot({
4624
4628
  data: this._data,
4625
4629
  readOnly: this.readOnly,
4626
4630
  isOpen: this._isOpen,
@@ -4628,10 +4632,10 @@ var er = (e) => ({ element: $n({
4628
4632
  keydownHandler: this.readOnly ? null : this.handleKeyDown.bind(this),
4629
4633
  onArrowClick: this.readOnly ? null : () => this.toggleOpen(),
4630
4634
  onBodyPlaceholderClick: this.readOnly ? null : () => this.handleBodyPlaceholderClick(),
4631
- bodyPlaceholderText: this.api.i18n.t(Fe),
4635
+ bodyPlaceholderText: this.api.i18n.t(ke),
4632
4636
  ariaLabels: {
4633
- collapse: this.api.i18n.t(He),
4634
- expand: this.api.i18n.t(Ne)
4637
+ collapse: this.api.i18n.t(Re),
4638
+ expand: this.api.i18n.t(De)
4635
4639
  }
4636
4640
  });
4637
4641
  return this._element = e.wrapper, this._contentElement = e.contentElement, this._arrowElement = e.arrowElement, this._bodyPlaceholderElement = e.bodyPlaceholderElement, this._childContainerElement = e.childContainerElement, this._element;
@@ -4655,16 +4659,16 @@ var er = (e) => ({ element: $n({
4655
4659
  onPaste(t) {
4656
4660
  let n = t.detail;
4657
4661
  if (!("data" in n)) return;
4658
- let r = n.data, i = r.querySelector("summary"), a = o(i === null ? r.innerHTML : i.innerHTML, e.sanitize.text);
4662
+ let r = n.data, i = r.querySelector("summary"), a = ie(i === null ? r.innerHTML : i.innerHTML, e.sanitize.text);
4659
4663
  this._data = { text: a };
4660
- let s = this.getContentElement();
4661
- s !== null && (s.innerHTML = a);
4664
+ let o = this.getContentElement();
4665
+ o !== null && (o.innerHTML = a);
4662
4666
  }
4663
4667
  setData(e) {
4664
4668
  let t = ki(this._data, e, this.getContentElement.bind(this));
4665
- return this._data = t.newData, typeof this._data.isOpen == "boolean" && (this._isOpen = this._data.isOpen), this._arrowElement && this._element && C(this._arrowElement, this._element, this._isOpen, {
4666
- collapse: this.api.i18n.t(He),
4667
- expand: this.api.i18n.t(Ne)
4669
+ return this._data = t.newData, typeof this._data.isOpen == "boolean" && (this._isOpen = this._data.isOpen), this._arrowElement && this._element && T(this._arrowElement, this._element, this._isOpen, {
4670
+ collapse: this.api.i18n.t(Re),
4671
+ expand: this.api.i18n.t(De)
4668
4672
  }), this.updateChildrenVisibility(), this.updateBodyPlaceholderVisibility(), t.inPlace;
4669
4673
  }
4670
4674
  renderSettings() {
@@ -4686,19 +4690,19 @@ var er = (e) => ({ element: $n({
4686
4690
  return this._contentElement;
4687
4691
  }
4688
4692
  setOpenState(e) {
4689
- this._isOpen = e, this._arrowElement && this._element && C(this._arrowElement, this._element, this._isOpen, {
4690
- collapse: this.api.i18n.t(He),
4691
- expand: this.api.i18n.t(Ne)
4693
+ this._isOpen = e, this._arrowElement && this._element && T(this._arrowElement, this._element, this._isOpen, {
4694
+ collapse: this.api.i18n.t(Re),
4695
+ expand: this.api.i18n.t(De)
4692
4696
  }), this.updateChildrenVisibility(), this.updateBodyPlaceholderVisibility();
4693
4697
  }
4694
4698
  toggleOpen() {
4695
4699
  this.setOpenState(!this._isOpen);
4696
4700
  }
4697
4701
  updateChildrenVisibility() {
4698
- this.blockId !== void 0 && lt(this.api, this.blockId, this._isOpen, this._childContainerElement, this._arrowElement);
4702
+ this.blockId !== void 0 && st(this.api, this.blockId, this._isOpen, this._childContainerElement, this._arrowElement);
4699
4703
  }
4700
4704
  updateBodyPlaceholderVisibility() {
4701
- this.blockId !== void 0 && ut(this._bodyPlaceholderElement, this.api, this.blockId, this._isOpen, this.readOnly);
4705
+ this.blockId !== void 0 && ct(this._bodyPlaceholderElement, this.api, this.blockId, this._isOpen, this.readOnly);
4702
4706
  }
4703
4707
  handleBodyPlaceholderClick() {
4704
4708
  var e;
@@ -4734,10 +4738,10 @@ var er = (e) => ({ element: $n({
4734
4738
  }
4735
4739
  async handleEnter() {
4736
4740
  var e = this;
4737
- await dt(e.createKeyboardContext()), e.updateBodyPlaceholderVisibility();
4741
+ await lt(e.createKeyboardContext()), e.updateBodyPlaceholderVisibility();
4738
4742
  }
4739
4743
  async handleBackspace(e) {
4740
- await ft(this.createKeyboardContext(), e);
4744
+ await ut(this.createKeyboardContext(), e);
4741
4745
  }
4742
4746
  syncContentFromDOM() {
4743
4747
  let e = this.getContentElement();
@@ -4745,10 +4749,10 @@ var er = (e) => ({ element: $n({
4745
4749
  }
4746
4750
  static get toolbox() {
4747
4751
  return {
4748
- icon: Be,
4752
+ icon: Fe,
4749
4753
  title: "Toggle list",
4750
4754
  titleKey: "toggleList",
4751
- name: Ie,
4755
+ name: je,
4752
4756
  searchTerms: [
4753
4757
  "toggle",
4754
4758
  "collapse",
@@ -4921,10 +4925,10 @@ var er = (e) => ({ element: $n({
4921
4925
  }
4922
4926
  synchronize(e) {
4923
4927
  var t, n;
4924
- let r = (t = e == null ? void 0 : e.anchorNode) == null ? e == null ? void 0 : e.focusNode : t, i = r && r.nodeType === Node.ELEMENT_NODE ? r : r == null ? void 0 : r.parentElement, o = (n = i == null ? void 0 : i.closest(a(s.editor))) == null ? i == null ? void 0 : i.ownerDocument : n;
4925
- if (!o) return;
4926
- let c = `strong[${W.COLLAPSED_ACTIVE}="true"]`;
4927
- o.querySelectorAll(c).forEach((t) => {
4928
+ let r = (t = e == null ? void 0 : e.anchorNode) == null ? e == null ? void 0 : e.focusNode : t, i = r && r.nodeType === Node.ELEMENT_NODE ? r : r == null ? void 0 : r.parentElement, a = (n = i == null ? void 0 : i.closest(v(x.editor))) == null ? i == null ? void 0 : i.ownerDocument : n;
4929
+ if (!a) return;
4930
+ let o = `strong[${W.COLLAPSED_ACTIVE}="true"]`;
4931
+ a.querySelectorAll(o).forEach((t) => {
4928
4932
  var n;
4929
4933
  let r = t.getAttribute(W.PREV_LENGTH), i = t.previousSibling;
4930
4934
  if (!r || !i || i.nodeType !== Node.TEXT_NODE) return;
@@ -4939,15 +4943,15 @@ var er = (e) => ({ element: $n({
4939
4943
  let d = t.textContent, f = d + l, p = (n = t.getAttribute(W.LEADING_WHITESPACE)) == null ? "" : n, m = p.length > 0 && d.length === 0 && !f.startsWith(p) ? p + f : f, h = document.createTextNode(m);
4940
4944
  for (; t.firstChild;) t.removeChild(t.firstChild);
4941
4945
  if (t.appendChild(h), !(e != null && e.isCollapsed) || !Fi(e.focusNode, o)) return;
4942
- let g = document.createRange(), ee = h.textContent.length;
4943
- g.setStart(h, ee), g.collapse(!0), e.removeAllRanges(), e.addRange(g);
4946
+ let g = document.createRange(), _ = h.textContent.length;
4947
+ g.setStart(h, _), g.collapse(!0), e.removeAllRanges(), e.addRange(g);
4944
4948
  });
4945
4949
  }
4946
4950
  enforceLengths(e) {
4947
4951
  var t;
4948
4952
  let n = (t = e == null ? void 0 : e.anchorNode) == null ? e == null ? void 0 : e.focusNode : t;
4949
4953
  if (!n) return;
4950
- let r = n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement, i = r == null ? void 0 : r.closest(a(s.editor));
4954
+ let r = n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement, i = r == null ? void 0 : r.closest(v(x.editor));
4951
4955
  i && i.querySelectorAll(`strong[${W.COLLAPSED_LENGTH}]`).forEach((t) => {
4952
4956
  var n;
4953
4957
  let r = t.getAttribute(W.COLLAPSED_LENGTH);
@@ -5067,7 +5071,7 @@ var Li = {
5067
5071
  preserveNode: null
5068
5072
  }, K = class e {
5069
5073
  constructor(e) {
5070
- this.options = y(y({}, Li), e);
5074
+ this.options = S(S({}, Li), e);
5071
5075
  }
5072
5076
  run(e) {
5073
5077
  if (typeof document > "u") return;
@@ -5141,7 +5145,7 @@ var Li = {
5141
5145
  let r = (t = e == null ? void 0 : e.anchorNode) == null ? e == null ? void 0 : e.focusNode : t;
5142
5146
  if (!r) return null;
5143
5147
  let i = r.nodeType === Node.ELEMENT_NODE ? r : r.parentElement;
5144
- return i ? ((n = i.closest("[data-blok-component=\"paragraph\"]")) == null ? i.closest(a(s.elementContent)) : n) || i.closest(a(s.editor)) : null;
5148
+ return i ? ((n = i.closest("[data-blok-component=\"paragraph\"]")) == null ? i.closest(v(x.elementContent)) : n) || i.closest(v(x.editor)) : null;
5145
5149
  }
5146
5150
  }, Ri, zi = class e {
5147
5151
  constructor() {
@@ -5404,12 +5408,12 @@ var Bi = (e, t) => {
5404
5408
  updateToolbarButtonState() {
5405
5409
  let e = window.getSelection();
5406
5410
  if (!e) return;
5407
- let t = e.anchorNode, n = (t == null ? void 0 : t.nodeType) === Node.ELEMENT_NODE ? t : t == null ? void 0 : t.parentElement, r = n == null ? void 0 : n.closest(a(s.editor));
5411
+ let t = e.anchorNode, n = (t == null ? void 0 : t.nodeType) === Node.ELEMENT_NODE ? t : t == null ? void 0 : t.parentElement, r = n == null ? void 0 : n.closest(v(x.editor));
5408
5412
  if (!r) return;
5409
5413
  let i = r.querySelector("[data-blok-testid=inline-toolbar]");
5410
5414
  if (!(i instanceof HTMLElement)) return;
5411
- let o = i.querySelector("[data-blok-item-name=\"bold\"]");
5412
- o instanceof HTMLElement && (this.isSelectionVisuallyBold(e) ? o.setAttribute("data-blok-popover-item-active", "true") : o.removeAttribute("data-blok-popover-item-active"));
5415
+ let a = i.querySelector("[data-blok-item-name=\"bold\"]");
5416
+ a instanceof HTMLElement && (this.isSelectionVisuallyBold(e) ? a.setAttribute("data-blok-popover-item-active", "true") : a.removeAttribute("data-blok-popover-item-active"));
5413
5417
  }
5414
5418
  static refreshSelectionState(e) {
5415
5419
  let t = window.getSelection();
@@ -5446,7 +5450,7 @@ var Bi = (e, t) => {
5446
5450
  }
5447
5451
  static findBlokScopeFromNode(e) {
5448
5452
  let t = e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement;
5449
- return !t || typeof t.closest != "function" ? null : t.closest(`${a(s.interface)}, ${a(s.editor)}`);
5453
+ return !t || typeof t.closest != "function" ? null : t.closest(`${v(x.interface)}, ${v(x.editor)}`);
5450
5454
  }
5451
5455
  static getBoundaryBold(t) {
5452
5456
  let n = t.startContainer;
@@ -5468,7 +5472,7 @@ var Bi = (e, t) => {
5468
5472
  let t = e.anchorNode;
5469
5473
  if (!t) return !1;
5470
5474
  let n = t.nodeType === Node.ELEMENT_NODE ? t : t.parentElement;
5471
- return !!(n != null && n.closest(a(s.editor)));
5475
+ return !!(n != null && n.closest(v(x.editor)));
5472
5476
  }
5473
5477
  getRangeHtmlWithoutBold(e) {
5474
5478
  let t = e.cloneContents();
@@ -5499,7 +5503,7 @@ var X, Gi = (e) => {
5499
5503
  }
5500
5504
  render() {
5501
5505
  return {
5502
- icon: oe,
5506
+ icon: ae,
5503
5507
  name: "italic",
5504
5508
  onActivate: () => {
5505
5509
  this.toggleItalic();
@@ -5649,18 +5653,18 @@ var Z, qi = class {
5649
5653
  button: null
5650
5654
  }, this.inputOpened = !1, this.unlinkAvailable = !1, this.handleButtonClick = (e) => {
5651
5655
  !this.inputOpened || !this.unlinkAvailable || (e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation(), this.restoreSelection(), this.unlink(), this.inlineToolbar.close());
5652
- }, this.toolbar = e.toolbar, this.inlineToolbar = e.inlineToolbar, this.notifier = e.notifier, this.i18n = e.i18n, this.selection = new _(), this.nodes.input = this.createInput();
5656
+ }, this.toolbar = e.toolbar, this.inlineToolbar = e.inlineToolbar, this.notifier = e.notifier, this.i18n = e.i18n, this.selection = new y(), this.nodes.input = this.createInput();
5653
5657
  }
5654
5658
  render() {
5655
5659
  return {
5656
- icon: ce,
5660
+ icon: se,
5657
5661
  name: "link",
5658
5662
  isActive: () => !!this.selection.findParentTag("A"),
5659
5663
  children: {
5660
5664
  hideChevron: !0,
5661
5665
  width: "200px",
5662
5666
  items: [{
5663
- type: n.Html,
5667
+ type: _.Html,
5664
5668
  element: this.nodes.input
5665
5669
  }],
5666
5670
  onOpen: () => {
@@ -5685,7 +5689,7 @@ var Z, qi = class {
5685
5689
  let e = t.getAttribute("href");
5686
5690
  this.nodes.input.value = e === null ? "" : e;
5687
5691
  } else this.nodes.input.value = "";
5688
- this.nodes.input.className = b(this.INPUT_BASE_CLASSES, "block"), this.setBooleanStateAttribute(this.nodes.input, this.DATA_ATTRIBUTES.inputOpened, !0), this.selection.setFakeBackground(), this.selection.save(), e && this.focusInputWithRetry(), this.inputOpened = !0;
5692
+ this.nodes.input.className = C(this.INPUT_BASE_CLASSES, "block"), this.setBooleanStateAttribute(this.nodes.input, this.DATA_ATTRIBUTES.inputOpened, !0), this.selection.setFakeBackground(), this.selection.save(), e && this.focusInputWithRetry(), this.inputOpened = !0;
5689
5693
  }
5690
5694
  focusInputWithRetry() {
5691
5695
  this.nodes.input && (this.nodes.input.focus(), !(typeof window > "u" || typeof document > "u") && window.setTimeout(() => {
@@ -5696,7 +5700,7 @@ var Z, qi = class {
5696
5700
  }, 0));
5697
5701
  }
5698
5702
  getButtonElement() {
5699
- let e = document.querySelector(`${a(s.interface, ne)} [data-blok-item-name="link"]`);
5703
+ let e = document.querySelector(`${v(x.interface, m)} [data-blok-item-name="link"]`);
5700
5704
  return e && e !== this.nodes.button && (e.addEventListener("click", this.handleButtonClick, !0), this.nodes.button = e), e;
5701
5705
  }
5702
5706
  updateButtonStateAttributes(e) {
@@ -5709,7 +5713,7 @@ var Z, qi = class {
5709
5713
  (this.selection.isFakeBackgroundEnabled || e && this.selection.savedSelectionRange) && this.restoreSelection(), this.nodes.input && (this.nodes.input.className = this.INPUT_BASE_CLASSES, this.setBooleanStateAttribute(this.nodes.input, this.DATA_ATTRIBUTES.inputOpened, !1), this.nodes.input.value = "", this.updateButtonStateAttributes(!1), this.unlinkAvailable = !1, e && this.selection.clearSaved(), this.inputOpened = !1);
5710
5714
  }
5711
5715
  restoreSelection() {
5712
- let e = new _(), t = _.isAtBlok;
5716
+ let e = new y(), t = y.isAtBlok;
5713
5717
  if (t && e.save(), this.selection.removeFakeBackground(), this.selection.restore(), !t && this.selection.savedSelectionRange) {
5714
5718
  let e = this.selection.savedSelectionRange.commonAncestorContainer, t = e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement;
5715
5719
  t == null || t.focus();
@@ -5733,7 +5737,7 @@ var Z, qi = class {
5733
5737
  this.notifier.show({
5734
5738
  message: this.i18n.t("tools.link.invalidLink"),
5735
5739
  style: "error"
5736
- }), pe("Incorrect Link pasted", "warn", t);
5740
+ }), He("Incorrect Link pasted", "warn", t);
5737
5741
  return;
5738
5742
  }
5739
5743
  let n = this.prepareLink(t);
@@ -5756,7 +5760,7 @@ var Z, qi = class {
5756
5760
  this.selection.expandToTag(t), t.href = e, t.target = "_blank", t.rel = "nofollow";
5757
5761
  return;
5758
5762
  }
5759
- let n = _.range;
5763
+ let n = y.range;
5760
5764
  if (!n) return;
5761
5765
  let r = document.createElement("a");
5762
5766
  r.href = e, r.target = "_blank", r.rel = "nofollow", r.appendChild(n.extractContents()), n.insertNode(r), this.selection.expandToTag(r);
@@ -5790,7 +5794,7 @@ var Q = (e) => e.tagName === "MARK", Ji = (e) => q(e, Q), $, Yi = {
5790
5794
  } };
5791
5795
  }
5792
5796
  constructor({ api: e }) {
5793
- this.colorMode = "color", this.i18n = e.i18n, this.inlineToolbar = e.inlineToolbar, this.selection = new _(), this.picker = $n({
5797
+ this.colorMode = "color", this.i18n = e.i18n, this.inlineToolbar = e.inlineToolbar, this.selection = new y(), this.picker = Zn({
5794
5798
  i18n: this.i18n,
5795
5799
  testIdPrefix: "marker",
5796
5800
  defaultModeIndex: 0,
@@ -5810,7 +5814,7 @@ var Q = (e) => e.tagName === "MARK", Ji = (e) => q(e, Q), $, Yi = {
5810
5814
  }
5811
5815
  render() {
5812
5816
  return {
5813
- icon: p,
5817
+ icon: l,
5814
5818
  name: "marker",
5815
5819
  isActive: () => {
5816
5820
  let e = window.getSelection();
@@ -5820,7 +5824,7 @@ var Q = (e) => e.tagName === "MARK", Ji = (e) => q(e, Q), $, Yi = {
5820
5824
  hideChevron: !0,
5821
5825
  width: "200px",
5822
5826
  items: [{
5823
- type: n.Html,
5827
+ type: _.Html,
5824
5828
  element: this.picker.element
5825
5829
  }],
5826
5830
  onOpen: () => {
@@ -6020,4 +6024,4 @@ var Zi = {
6020
6024
  marker: {}
6021
6025
  };
6022
6026
  //#endregion
6023
- export { Ki as a, Ti as c, rt as d, qi as i, Fn as l, Qi as n, Wi as o, Xi as r, Ai as s, Zi as t, _t as u };
6027
+ export { Ki as a, Ti as c, tt as d, qi as i, Nn as l, Qi as n, Wi as o, Xi as r, Ai as s, Zi as t, ht as u };