@tempots/beatui 0.81.0 → 0.82.1

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 (237) hide show
  1. package/dist/_commonjsHelpers-DKOUU3wS.cjs +1 -0
  2. package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
  3. package/dist/{ar-DwHLVgKj.cjs → ar-D7CXDmVZ.cjs} +1 -1
  4. package/dist/{ar-Bo_FZZi7.js → ar-nOSKXpIW.js} +1 -1
  5. package/dist/auth/index.cjs.js +1 -1
  6. package/dist/auth/index.es.js +63 -1349
  7. package/dist/auth-divider-BqZPH1-z.cjs +1 -0
  8. package/dist/auth-divider-Wr-S16kF.js +1355 -0
  9. package/dist/beatui.css +2035 -295
  10. package/dist/beatui.tailwind.css +2036 -296
  11. package/dist/better-auth/index.cjs.js +1 -0
  12. package/dist/better-auth/index.es.js +754 -0
  13. package/dist/{de-zI5mdV4M.cjs → de-WzsOu9Gn.cjs} +1 -1
  14. package/dist/{de-CCqwOkqN.js → de-f2xcEb34.js} +1 -1
  15. package/dist/{deep-merge-1uN6CG6K.js → deep-merge-BYm0y62g.js} +271 -285
  16. package/dist/deep-merge-d7sf0xmN.cjs +1 -0
  17. package/dist/duration-input-B9UNmUCh.cjs +1 -0
  18. package/dist/{duration-input-C9kpsw-t.js → duration-input-DqcJbxKD.js} +31 -29
  19. package/dist/editor-toolbar-group--a-xgsJw.cjs +1 -0
  20. package/dist/editor-toolbar-group-CVpl5mxF.js +31 -0
  21. package/dist/{es-BF02UrPL.js → es-CDqqzpCw.js} +1 -1
  22. package/dist/{es-Cw90CAbu.cjs → es-Ds2Xf3wV.cjs} +1 -1
  23. package/dist/{fa-DPQV4YB8.js → fa-C7tE_hR3.js} +1 -1
  24. package/dist/{fa-B4lssnzR.cjs → fa-Ct1UtDB7.cjs} +1 -1
  25. package/dist/{fr-1Kd6z1F-.cjs → fr-CzAkRFed.cjs} +1 -1
  26. package/dist/{fr-dmxPhwkD.js → fr-yOW_68YY.js} +1 -1
  27. package/dist/{he-BtQbrVt3.js → he-D2oUloCJ.js} +1 -1
  28. package/dist/{he-CJ3XnuPm.cjs → he-DlXALrK7.cjs} +1 -1
  29. package/dist/{hi-BpfnFKHp.cjs → hi-3dBhLwDs.cjs} +1 -1
  30. package/dist/{hi-D_Le4Yka.js → hi-D5ZlZoQq.js} +1 -1
  31. package/dist/{hls.light.min-Bhrf47iR.cjs → hls.light.min-C6xKDzRR.cjs} +1 -1
  32. package/dist/{hls.light.min-C6VwviEa.js → hls.light.min-hEMf_E8u.js} +1 -1
  33. package/dist/{index-CfaWytS2.cjs → index-05UbKOYe.cjs} +1 -1
  34. package/dist/{index-K6u33-GC.cjs → index-Bt7FYl80.cjs} +19 -19
  35. package/dist/{index-YtW7SCWB.js → index-C2Lq1m45.js} +1434 -1463
  36. package/dist/{index-CGEzILlC.js → index-lYhXnu6I.js} +1 -1
  37. package/dist/index.cjs.js +4 -4
  38. package/dist/index.es.js +2389 -2738
  39. package/dist/input-container-C6qEIjcA.cjs +1 -0
  40. package/dist/input-container-DiCjOzR2.js +247 -0
  41. package/dist/{it-DyHjSuHN.js → it-6e6X-4BB.js} +1 -1
  42. package/dist/{it-COCZ9NyB.cjs → it-DohtcWi9.cjs} +1 -1
  43. package/dist/{ja-X43lABza.js → ja-BxNuNo2H.js} +1 -1
  44. package/dist/{ja--NdggLU9.cjs → ja-eyTArrgS.cjs} +1 -1
  45. package/dist/json-schema/index.cjs.js +1 -8
  46. package/dist/json-schema/index.es.js +1359 -7608
  47. package/dist/json-schema-display/index.cjs.js +1 -0
  48. package/dist/json-schema-display/index.es.js +846 -0
  49. package/dist/json-structure/index.cjs.js +1 -1
  50. package/dist/json-structure/index.es.js +542 -698
  51. package/dist/{ko-BUvb0ggK.cjs → ko-BFLCDMMs.cjs} +1 -1
  52. package/dist/{ko-B9g9iw99.js → ko-Ch0jFsBV.js} +1 -1
  53. package/dist/lexical/index.cjs.js +46 -0
  54. package/dist/lexical/index.es.js +21370 -0
  55. package/dist/lexical.css +1124 -0
  56. package/dist/menu-CZzRsQP_.js +372 -0
  57. package/dist/menu-ClrU72xH.cjs +1 -0
  58. package/dist/modal-I5srcntN.cjs +1 -0
  59. package/dist/modal-v3u2Fpnd.js +488 -0
  60. package/dist/{nl-0S25Gsld.cjs → nl-Bx2ACvr4.cjs} +1 -1
  61. package/dist/{nl-Ew5jnSsT.js → nl-NuTdZO1s.js} +1 -1
  62. package/dist/{notice-C-964yaY.js → notice-BuZvdvZh.js} +84 -82
  63. package/dist/notice-CLDdy1MW.cjs +1 -0
  64. package/dist/oneof-branch-detection-DsM1K5xc.cjs +8 -0
  65. package/dist/oneof-branch-detection-Dt8ss9lc.js +6281 -0
  66. package/dist/{pl-C9f6UBSe.js → pl-Bs4nLJ__.js} +1 -1
  67. package/dist/{pl-B3k-K3S4.cjs → pl-QHl6sl8f.cjs} +1 -1
  68. package/dist/prosemirror/index.cjs.js +1 -1
  69. package/dist/prosemirror/index.es.js +1 -1
  70. package/dist/{pt-DYtAvbrw.js → pt-BETjHZrL.js} +1 -1
  71. package/dist/{pt-CKoikRO5.cjs → pt-DZGw2Z-1.cjs} +1 -1
  72. package/dist/{ru-ZexN-b8V.js → ru-Bi1_DEKM.js} +1 -1
  73. package/dist/{ru-COb7RSDt.cjs → ru-D03IuLqh.cjs} +1 -1
  74. package/dist/session-id-3KiilioY.js +8 -0
  75. package/dist/session-id-B5lJMzbB.cjs +1 -0
  76. package/dist/stack-BJgsPJ9A.js +873 -0
  77. package/dist/stack-DcZ_u50f.cjs +1 -0
  78. package/dist/string-B9vVyfq3.cjs +1 -0
  79. package/dist/string-DYyMxBl-.js +19 -0
  80. package/dist/styles-url-B2dzXrYt.cjs +1 -0
  81. package/dist/styles-url-Cw_mxshe.js +4 -0
  82. package/dist/text-input-B3VBat1k.js +44 -0
  83. package/dist/text-input-Ds8e7Z1G.cjs +1 -0
  84. package/dist/{toolbar-DNpBIoJo.js → toolbar-D994_E_s.js} +4 -4
  85. package/dist/toolbar-x0_8lmKu.cjs +1 -0
  86. package/dist/{tr-tO_EH-Y2.cjs → tr-B_-_1wua.cjs} +1 -1
  87. package/dist/{tr-BDvn05-H.js → tr-DiYB-FwX.js} +1 -1
  88. package/dist/translations-B4-Zd2LM.cjs +1 -0
  89. package/dist/translations-Cq8bUKJP.js +584 -0
  90. package/dist/{translations-DwGC_94w.cjs → translations-D62qqNV9.cjs} +1 -1
  91. package/dist/{translations-CfWR4loD.js → translations-DPr6c05Z.js} +1 -1
  92. package/dist/types/better-auth/bridge.d.ts +2 -0
  93. package/dist/types/better-auth/callbacks.d.ts +6 -0
  94. package/dist/types/better-auth/components/authenticated.d.ts +4 -0
  95. package/dist/types/better-auth/components/better-auth-container.d.ts +4 -0
  96. package/dist/types/better-auth/components/better-auth-modal.d.ts +4 -0
  97. package/dist/types/better-auth/components/magic-link-form.d.ts +7 -0
  98. package/dist/types/better-auth/components/passkey-management.d.ts +6 -0
  99. package/dist/types/better-auth/components/passkey-signin.d.ts +12 -0
  100. package/dist/types/better-auth/components/two-factor-setup.d.ts +8 -0
  101. package/dist/types/better-auth/components/two-factor-verify.d.ts +10 -0
  102. package/dist/types/better-auth/i18n/default.d.ts +29 -0
  103. package/dist/types/better-auth/i18n/locales/en.d.ts +28 -0
  104. package/dist/types/better-auth/i18n/translations.d.ts +27 -0
  105. package/dist/types/better-auth/index.d.ts +22 -0
  106. package/dist/types/better-auth/provider.d.ts +6 -0
  107. package/dist/types/better-auth/session.d.ts +14 -0
  108. package/dist/types/better-auth/social-mapping.d.ts +2 -0
  109. package/dist/types/better-auth/types.d.ts +164 -0
  110. package/dist/types/components/auth/auth-container.d.ts +1 -1
  111. package/dist/types/components/auth/social-providers.d.ts +1 -1
  112. package/dist/types/components/auth/types.d.ts +2 -0
  113. package/dist/types/components/editor-toolbar/editor-toolbar-button.d.ts +16 -0
  114. package/dist/types/components/editor-toolbar/editor-toolbar-group.d.ts +9 -0
  115. package/dist/types/components/editor-toolbar/index.d.ts +2 -0
  116. package/dist/types/components/json-schema-display/display-widget-customization.d.ts +61 -0
  117. package/dist/types/components/json-schema-display/display-wrapper.d.ts +14 -0
  118. package/dist/types/components/json-schema-display/displays/any-display.d.ts +14 -0
  119. package/dist/types/components/json-schema-display/displays/array-display.d.ts +13 -0
  120. package/dist/types/components/json-schema-display/displays/boolean-display.d.ts +13 -0
  121. package/dist/types/components/json-schema-display/displays/composition-display.d.ts +14 -0
  122. package/dist/types/components/json-schema-display/displays/enum-const-display.d.ts +13 -0
  123. package/dist/types/components/json-schema-display/displays/generic-display.d.ts +18 -0
  124. package/dist/types/components/json-schema-display/displays/null-display.d.ts +13 -0
  125. package/dist/types/components/json-schema-display/displays/number-display.d.ts +13 -0
  126. package/dist/types/components/json-schema-display/displays/object-display.d.ts +13 -0
  127. package/dist/types/components/json-schema-display/displays/string-display.d.ts +14 -0
  128. package/dist/types/components/json-schema-display/index.d.ts +14 -0
  129. package/dist/types/components/json-schema-display/json-schema-display.d.ts +25 -0
  130. package/dist/types/components/json-schema-display/mismatch.d.ts +14 -0
  131. package/dist/types/components/json-structure/controls/control-utils.d.ts +19 -0
  132. package/dist/types/components/json-structure/controls/index.d.ts +1 -0
  133. package/dist/types/components/lexical/bare-editor.d.ts +29 -0
  134. package/dist/types/components/lexical/code/index.d.ts +1 -0
  135. package/dist/types/components/lexical/code/language-selector.d.ts +13 -0
  136. package/dist/types/components/lexical/contextual-editor.d.ts +22 -0
  137. package/dist/types/components/lexical/docked-editor.d.ts +23 -0
  138. package/dist/types/components/lexical/floating/block-handle.d.ts +16 -0
  139. package/dist/types/components/lexical/floating/floating-toolbar.d.ts +12 -0
  140. package/dist/types/components/lexical/floating/index.d.ts +6 -0
  141. package/dist/types/components/lexical/floating/slash-command-palette.d.ts +20 -0
  142. package/dist/types/components/lexical/index.d.ts +8 -0
  143. package/dist/types/components/lexical/lexical-editor-input.d.ts +30 -0
  144. package/dist/types/components/lexical/table/index.d.ts +1 -0
  145. package/dist/types/components/lexical/table/table-controls.d.ts +12 -0
  146. package/dist/types/components/lexical/toolbar/index.d.ts +6 -0
  147. package/dist/types/components/lexical/toolbar/lexical-toolbar.d.ts +12 -0
  148. package/dist/types/components/lexical/toolbar/toolbar-button.d.ts +1 -0
  149. package/dist/types/components/lexical/toolbar/toolbar-group.d.ts +1 -0
  150. package/dist/types/components/lexical/toolbar/toolbar-helpers.d.ts +30 -0
  151. package/dist/types/components/prosemirror/etoolbar-button.d.ts +1 -11
  152. package/dist/types/components/prosemirror/etoolbar-group.d.ts +1 -4
  153. package/dist/types/json-schema-display/index.d.ts +1 -0
  154. package/dist/types/lexical/commands/index.d.ts +17 -0
  155. package/dist/types/lexical/headless.d.ts +39 -0
  156. package/dist/types/lexical/horizontal-rule-node.d.ts +20 -0
  157. package/dist/types/lexical/index.d.ts +20 -0
  158. package/dist/types/lexical/lazy-loader.d.ts +35 -0
  159. package/dist/types/lexical/nodes.d.ts +29 -0
  160. package/dist/types/lexical/plugins/auto-link.d.ts +7 -0
  161. package/dist/types/lexical/plugins/clipboard.d.ts +11 -0
  162. package/dist/types/lexical/plugins/code-shiki.d.ts +11 -0
  163. package/dist/types/lexical/plugins/code.d.ts +7 -0
  164. package/dist/types/lexical/plugins/dragon.d.ts +6 -0
  165. package/dist/types/lexical/plugins/file-io.d.ts +10 -0
  166. package/dist/types/lexical/plugins/hashtag.d.ts +7 -0
  167. package/dist/types/lexical/plugins/history.d.ts +7 -0
  168. package/dist/types/lexical/plugins/horizontal-rule.d.ts +12 -0
  169. package/dist/types/lexical/plugins/html-io.d.ts +9 -0
  170. package/dist/types/lexical/plugins/index.d.ts +24 -0
  171. package/dist/types/lexical/plugins/link.d.ts +6 -0
  172. package/dist/types/lexical/plugins/list.d.ts +6 -0
  173. package/dist/types/lexical/plugins/mark.d.ts +15 -0
  174. package/dist/types/lexical/plugins/markdown-io.d.ts +13 -0
  175. package/dist/types/lexical/plugins/offset.d.ts +6 -0
  176. package/dist/types/lexical/plugins/overflow.d.ts +7 -0
  177. package/dist/types/lexical/plugins/plain-text.d.ts +6 -0
  178. package/dist/types/lexical/plugins/rich-text.d.ts +6 -0
  179. package/dist/types/lexical/plugins/selection.d.ts +6 -0
  180. package/dist/types/lexical/plugins/slash-commands.d.ts +26 -0
  181. package/dist/types/lexical/plugins/table.d.ts +11 -0
  182. package/dist/types/lexical/plugins/text.d.ts +13 -0
  183. package/dist/types/lexical/plugins/yjs.d.ts +9 -0
  184. package/dist/types/lexical/styles-url.d.ts +2 -0
  185. package/dist/types/lexical/styles.d.ts +2 -0
  186. package/dist/types/lexical/types.d.ts +634 -0
  187. package/dist/types/lexical-i18n/default.d.ts +92 -0
  188. package/dist/types/lexical-i18n/index.d.ts +21 -0
  189. package/dist/types/lexical-i18n/locales/ar.d.ts +91 -0
  190. package/dist/types/lexical-i18n/locales/de.d.ts +91 -0
  191. package/dist/types/lexical-i18n/locales/en.d.ts +91 -0
  192. package/dist/types/lexical-i18n/locales/es.d.ts +91 -0
  193. package/dist/types/lexical-i18n/locales/fa.d.ts +91 -0
  194. package/dist/types/lexical-i18n/locales/fr.d.ts +91 -0
  195. package/dist/types/lexical-i18n/locales/he.d.ts +91 -0
  196. package/dist/types/lexical-i18n/locales/hi.d.ts +91 -0
  197. package/dist/types/lexical-i18n/locales/it.d.ts +91 -0
  198. package/dist/types/lexical-i18n/locales/ja.d.ts +91 -0
  199. package/dist/types/lexical-i18n/locales/ko.d.ts +91 -0
  200. package/dist/types/lexical-i18n/locales/nl.d.ts +91 -0
  201. package/dist/types/lexical-i18n/locales/pl.d.ts +91 -0
  202. package/dist/types/lexical-i18n/locales/pt.d.ts +91 -0
  203. package/dist/types/lexical-i18n/locales/ru.d.ts +91 -0
  204. package/dist/types/lexical-i18n/locales/tr.d.ts +91 -0
  205. package/dist/types/lexical-i18n/locales/ur.d.ts +91 -0
  206. package/dist/types/lexical-i18n/locales/vi.d.ts +91 -0
  207. package/dist/types/lexical-i18n/locales/zh.d.ts +91 -0
  208. package/dist/types/lexical-i18n/translations.d.ts +21 -0
  209. package/dist/{ur-DbEqQgS6.js → ur-B69X-xNs.js} +1 -1
  210. package/dist/{ur-BbnYJ3HS.cjs → ur-DyUSmIbo.cjs} +1 -1
  211. package/dist/use-animated-toggle-ChycsEoj.js +175 -0
  212. package/dist/use-animated-toggle-DR6CyMac.cjs +1 -0
  213. package/dist/use-form-B56E_x5Y.js +859 -0
  214. package/dist/use-form-Cnp3XQ5X.cjs +2 -0
  215. package/dist/utils-DEbsp9Q9.js +129 -0
  216. package/dist/utils-DIUEhA-Z.cjs +1 -0
  217. package/dist/{vi-CpZUeuSj.js → vi-BdzxA60L.js} +1 -1
  218. package/dist/{vi-ByBwvGQY.cjs → vi-CBmPaHxg.cjs} +1 -1
  219. package/dist/widget-customization-Dk7XcVly.cjs +1 -0
  220. package/dist/widget-customization-Ds9sicAg.js +1073 -0
  221. package/dist/{zh-DnxK0ieB.cjs → zh-Cb1b8uik.cjs} +1 -1
  222. package/dist/{zh-DJyhKO0I.js → zh-Dn1UJiZa.js} +1 -1
  223. package/package.json +59 -8
  224. package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
  225. package/dist/_commonjsHelpers-DwGv2jUC.cjs +0 -1
  226. package/dist/deep-merge-CBIkQM4E.cjs +0 -1
  227. package/dist/duration-input-DHWhQJnn.cjs +0 -1
  228. package/dist/modal-CSHIhHvI.js +0 -654
  229. package/dist/modal-cc8Ehngz.cjs +0 -1
  230. package/dist/notice-C_BWqu2K.cjs +0 -1
  231. package/dist/toolbar-D5FcnRju.cjs +0 -1
  232. package/dist/translations-0tLX4x7M.js +0 -866
  233. package/dist/translations-WPN3ibDg.cjs +0 -1
  234. package/dist/use-form-D4JFOcjo.cjs +0 -2
  235. package/dist/use-form-D4rqJkvG.js +0 -1731
  236. package/dist/widget-customization-BSjJz3_Y.js +0 -1195
  237. package/dist/widget-customization-CrFVrt4V.cjs +0 -1
@@ -0,0 +1,46 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Vu=require("../_commonjsHelpers-DKOUU3wS.cjs"),w=require("@tempots/dom"),wc=require("../link-portal-_tiDFZqh.cjs"),vc=require("../theme-Dt6lCAvY.cjs"),P_=require("../toolbar-x0_8lmKu.cjs"),ct=require("../editor-toolbar-group--a-xgsJw.cjs"),Yu=require("../menu-ClrU72xH.cjs"),Oa=require("../translations-B4-Zd2LM.cjs"),B_=require("../input-container-C6qEIjcA.cjs");function F(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function $h(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);t.search=r.toString(),console.warn(`Minified Lexical warning #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Lt=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,z_=Lt&&"documentMode"in document?document.documentMode:null,Nt=Lt&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),$n=Lt&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),so=!(!Lt||!("InputEvent"in window)||z_)&&"getTargetRanges"in new window.InputEvent("input"),ms=Lt&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),ri=Lt&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,U_=Lt&&/Android/.test(navigator.userAgent),Ih=Lt&&/^(?=.*Chrome).*/i.test(navigator.userAgent),qu=Lt&&U_&&Ih,_s=Lt&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Nt&&!Ih,K_=0,W_=1,j_=2,H_=1,J_=2,G_=4,V_=8,Y_=16,q_=32,Z_=64,Ec=128,X_=2047,Q_=1,ey=2,ty=3,ny=4,ry=5,iy=6,Wo=ms||ri||_s?" ":"​",jo=`
2
+
3
+ `,sy=$n?" ":Wo,Fh="֑-߿יִ-﷽ﹰ-ﻼ",Dh="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",oy=new RegExp("^[^"+Dh+"]*["+Fh+"]"),ly=new RegExp("^[^"+Fh+"]*["+Dh+"]"),Ue={bold:1,capitalize:1024,code:16,highlight:Ec,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},ay={directionless:1,unmergeable:2},Zu={center:2,end:6,justify:4,left:1,right:3,start:5},cy={[ey]:"center",[iy]:"end",[ny]:"justify",[Q_]:"left",[ty]:"right",[ry]:"start"},uy={normal:0,segmented:2,token:1},dy={[K_]:"normal",[j_]:"segmented",[W_]:"token"},fy="$",Xu="$config";function Lh(n,e,t,r,i,s){let o=n.getFirstChild();for(;o!==null;){const l=o.__key;o.__parent===e&&(O(o)&&Lh(o,l,t,r,i,s),t.has(l)||s.delete(l),i.push(l)),o=o.getNextSibling()}}let Ma=!1,kc=0;function hy(n){kc=n.timeStamp}function Vl(n,e,t){const r=n.nodeName==="BR",i=e.__lexicalLineBreak;return i&&(n===i||r&&n.previousSibling===i)||r&&al(n,t)!==void 0}function gy(n,e,t){const r=Et(vt(t));let i=null,s=null;r!==null&&r.anchorNode===n&&(i=r.anchorOffset,s=r.focusOffset);const o=n.nodeValue;o!==null&&Zc(e,o,i,s,!1)}function py(n,e,t){if(N(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return qt(e)&&t.isAttached()}function my(n,e,t,r){for(let i=n;i&&!jg(i);i=ws(i)){const s=al(i,e);if(s!==void 0){const o=Y(s,t);if(o)return V(o)||!re(i)?void 0:[i,o]}else if(i===r)return[r,Mg(t)]}}function Rh(n,e,t){Ma=!0;const r=performance.now()-kc>100;try{Wt(n,()=>{const i=M()||(function(f){return f.getEditorState().read(()=>{const h=M();return h!==null?h.clone():null})})(n),s=new Map,o=n.getRootElement(),l=n._editorState,a=n._blockCursorElement;let c=!1,u="";for(let f=0;f<e.length;f++){const h=e[f],g=h.type,p=h.target,m=my(p,n,l,o);if(!m)continue;const[b,_]=m;if(g==="characterData")r&&I(_)&&qt(p)&&py(i,p,_)&&gy(p,_,n);else if(g==="childList"){c=!0;const y=h.addedNodes;for(let x=0;x<y.length;x++){const k=y[x],v=Vc(k),E=k.parentNode;if(E!=null&&k!==a&&v===null&&!Vl(k,E,n)){if($n){const A=(re(k)?k.innerText:null)||k.nodeValue;A&&(u+=A)}E.removeChild(k)}}const C=h.removedNodes,S=C.length;if(S>0){let x=0;for(let k=0;k<S;k++){const v=C[k];(Vl(v,p,n)||a===v)&&(p.appendChild(v),x++)}S!==x&&s.set(b,_)}}}if(s.size>0)for(const[f,h]of s)h.reconcileObservedMutation(f,n);const d=t.takeRecords();if(d.length>0){for(let f=0;f<d.length;f++){const h=d[f],g=h.addedNodes,p=h.target;for(let m=0;m<g.length;m++){const b=g[m],_=b.parentNode;_==null||b.nodeName!=="BR"||Vl(b,p,n)||_.removeChild(b)}}t.takeRecords()}i!==null&&(c&&Fe(i),$n&&Lg(n)&&i.insertRawText(u))})}finally{Ma=!1}}function Ph(n){const e=n._observer;e!==null&&Rh(n,e.takeRecords(),e)}function Bh(n){(function(e){kc===0&&vt(e).addEventListener("textInput",hy,!0)})(n),n._observer=new MutationObserver((e,t)=>{Rh(n,e,t)})}let _y=class{key;parse;unparse;isEqual;defaultValue;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||xy).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0)}};function Tc(n,e){return new _y(n,e)}function Yi(n,e,t="latest"){const r=(t==="latest"?n.getLatest():n).__state;return r?r.getValue(e):e.defaultValue}function yy(n,e,t){const r=Yi(n,t,"direct"),i=Yi(e,t,"direct");return t.isEqual(r,i)?null:[r,i]}function Vs(n,e,t){let r;if(Oe(),typeof t=="function"){const s=n.getLatest(),o=Yi(s,e);if(r=t(o),e.isEqual(o,r))return s}else r=t;const i=n.getWritable();return Ho(i).updateFromKnown(e,r),i}function zh(n){const e=new Map,t=new Set;for(let r=typeof n=="function"?n:n.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){const{ownNodeConfig:i}=vs(r);if(i&&i.stateConfigs)for(const s of i.stateConfigs){let o;"stateConfig"in s?(o=s.stateConfig,s.flat&&t.add(o.key)):o=s,e.set(o.key,o)}}return{flatKeys:t,sharedConfigMap:e}}let by=class Uh{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,r=void 0,i=new Map,s=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=r,this.knownState=i;const{sharedConfigMap:o}=this.sharedNodeState,l=s!==void 0?s:(function(a,c,u){let d=u.size;if(c)for(const f in c){const h=a.get(f);h&&u.has(h)||d++}return d})(o,r,i);this.size=l}getValue(e){const t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let r=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){const i=this.unknownState[e.key];i!==void 0&&(r=e.parse(i)),this.updateFromKnown(e,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const e={...this.unknownState},t={};for(const[r,i]of this.knownState)r.isEqual(i,r.defaultValue)?delete e[r.key]:e[r.key]=r.unparse(i);for(const r of this.sharedNodeState.flatKeys)r in e&&(t[r]=e[r],delete e[r]);return Qu(e)&&(t.$=e),t}getWritable(e){if(this.node===e)return this;const{sharedNodeState:t,unknownState:r}=this,i=new Map(this.knownState);return new Uh(e,t,(function(s,o,l){let a;if(l)for(const[c,u]of Object.entries(l)){const d=s.get(c);d?o.has(d)||o.set(d,d.parse(u)):(a=a||{},a[c]=u)}return a})(t.sharedConfigMap,i,r),i,this.size)}updateFromKnown(e,t){const r=e.key;this.sharedNodeState.sharedConfigMap.set(r,e);const{knownState:i,unknownState:s}=this;i.has(e)||s&&r in s||(s&&(delete s[r],this.unknownState=Qu(s)),this.size++),i.set(e,t)}updateFromUnknown(e,t){const r=this.sharedNodeState.sharedConfigMap.get(e);r?this.updateFromKnown(r,r.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){const{knownState:t}=this;for(const r of t.keys())t.set(r,r.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(const[r,i]of Object.entries(e))this.updateFromUnknown(r,i)}};function Ho(n){const e=n.getWritable(),t=e.__state?e.__state.getWritable(e):new by(e,Kh(e));return e.__state=t,t}function Kh(n){return n.__state?n.__state.sharedNodeState:Hc(gi(),n.getType()).sharedNodeState}function Qu(n){if(n)for(const e in n)return n}function xy(n){return n}function ed(n,e,t){for(const[r,i]of e.knownState){if(n.has(r.key))continue;n.add(r.key);const s=t?t.getValue(r):r.defaultValue;if(s!==i&&!r.isEqual(s,i))return!0}return!1}function td(n,e,t){const{unknownState:r}=e,i=t?t.unknownState:void 0;if(r){for(const[s,o]of Object.entries(r))if(!n.has(s)&&(n.add(s),o!==(i?i[s]:void 0)))return!0}return!1}function nd(n,e){const t=n.__state;return t&&t.node===n?t.getWritable(e):t}function rd(n,e){const t=n.__mode,r=n.__format,i=n.__style,s=e.__mode,o=e.__format,l=e.__style,a=n.__state,c=e.__state;return(t===null||t===s)&&(r===null||r===o)&&(i===null||i===l)&&(n.__state===null||a===c||(function(u,d){if(u===d)return!0;if(u&&d&&u.size!==d.size)return!1;const f=new Set;return!(u&&ed(f,u,d)||d&&ed(f,d,u)||u&&td(f,u,d)||d&&td(f,d,u))})(a,c))}function id(n,e){const t=n.mergeWithSibling(e),r=ie()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function sd(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&I(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(rd(e,r)){r=id(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&I(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(rd(r,t)){r=id(r,t);break}break}t.remove()}}else r.remove()}function In(n){return od(n.anchor),od(n.focus),n}function od(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,i;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),i=!0):(r=e.getChildAtIndex(t),i=!1),I(r)){n.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!O(r))break;n.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}let sr,Ve,qi,Jo,$a,Ia,or,At,Fa,Zi,Ee="",Pt=null,Yn=null,Br=!1,oo=!1;function lo(n,e){const t=or.get(n);if(e!==null){const r=Pa(n);r.parentNode===e&&e.removeChild(r)}if(At.has(n)||Ve._keyToDOMMap.delete(n),O(t)){const r=co(t,or);Da(r,0,r.length-1,null)}t!==void 0&&Qc(Zi,qi,Jo,t,"destroyed")}function Da(n,e,t,r){for(let i=e;i<=t;++i){const s=n[i];s!==void 0&&lo(s,r)}}function Gn(n,e){n.setProperty("text-align",e)}const Sy="40px";function Wh(n,e){const t=sr.theme.indent;if(typeof t=="string"){const i=n.classList.contains(t);e>0&&!i?n.classList.add(t):e<1&&i&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||Sy;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function jh(n,e){const t=n.style;e===0?Gn(t,""):e===1?Gn(t,"left"):e===2?Gn(t,"center"):e===3?Gn(t,"right"):e===4?Gn(t,"justify"):e===5?Gn(t,"start"):e===6&&Gn(t,"end")}function La(n,e){const t=(function(r){const i=r.__dir;if(i!==null)return i;if(ye(r))return null;const s=r.getParentOrThrow();return ye(s)&&s.__dir===null?"auto":null})(e);t!==null?n.dir=t:n.removeAttribute("dir")}function ao(n,e){const t=At.get(n);t===void 0&&F(60);const r=t.createDOM(sr,Ve);if((function(i,s,o){const l=o._keyToDOMMap;(function(a,c,u){const d=`__lexicalKey_${c._key}`;a[d]=u})(s,o,i),l.set(i,s)})(n,r,Ve),I(t)?r.setAttribute("data-lexical-text","true"):V(t)&&r.setAttribute("data-lexical-decorator","true"),O(t)){const i=t.__indent,s=t.__size;if(La(r,t),i!==0&&Wh(r,i),s!==0){const l=s-1;Ra(co(t,At),t,0,l,t.getDOMSlot(r))}const o=t.__format;o!==0&&jh(r,o),t.isInline()||Hh(null,t,r)}else{const i=t.getTextContent();if(V(t)){const s=t.decorate(Ve,sr);s!==null&&Jh(n,s),r.contentEditable="false"}Ee+=i}return e!==null&&e.insertChild(r),Qc(Zi,qi,Jo,t,"created"),r}function Ra(n,e,t,r,i){const s=Ee;Ee="";let o=t;for(;o<=r;++o){ao(n[o],i);const l=At.get(n[o]);l!==null&&I(l)?Pt===null&&(Pt=l.getFormat(),Yn=l.getStyle()):O(l)&&o<r&&!l.isInline()&&(Ee+=jo)}i.element.__lexicalTextContent=Ee,Ee=s+Ee}function ld(n,e){if(n){const t=n.__last;if(t){const r=e.get(t);if(r)return ue(r)?"line-break":V(r)&&r.isInline()?"decorator":null}return"empty"}return null}function Hh(n,e,t){const r=ld(n,or),i=ld(e,At);r!==i&&e.getDOMSlot(t).setManagedLineBreak(i)}function Cy(n,e,t){var r;Pt=null,Yn=null,(function(i,s,o){const l=Ee,a=i.__size,c=s.__size;Ee="";const u=o.element;if(a===1&&c===1){const d=i.__first,f=s.__first;if(d===f)Ys(d,u);else{const g=Pa(d),p=ao(f,null);try{u.replaceChild(p,g)}catch(m){if(typeof m=="object"&&m!=null){const b=`${m.toString()} Parent: ${u.tagName}, new child: {tag: ${p.tagName} key: ${f}}, old child: {tag: ${g.tagName}, key: ${d}}.`;throw new Error(b)}throw m}lo(d,null)}const h=At.get(f);I(h)&&Pt===null&&(Pt=h.getFormat(),Yn=h.getStyle())}else{const d=co(i,or),f=co(s,At);if(d.length!==a&&F(227),f.length!==c&&F(228),a===0)c!==0&&Ra(f,0,0,c-1,o);else if(c===0){if(a!==0){const h=o.after==null&&o.before==null&&o.element.__lexicalLineBreak==null;Da(d,0,a-1,h?null:u),h&&(u.textContent="")}}else(function(h,g,p,m,b,_){const y=m-1,C=b-1;let S,x,k=_.getFirstChild(),v=0,E=0;for(;v<=y&&E<=C;){const D=g[v],P=p[E];if(D===P)k=Yl(Ys(P,_.element)),v++,E++;else{if(x===void 0&&(x=ad(p,E)),S===void 0)S=ad(g,v);else if(!S.has(D)){v++;continue}if(!x.has(D)){k=Yl(Pa(D)),lo(D,_.element),v++,S.delete(D);continue}if(S.has(P)){const U=dr(Ve,P);U!==k&&_.withBefore(k).insertChild(U),k=Yl(Ys(P,_.element)),v++,E++}else ao(P,_.withBefore(k)),E++}const $=At.get(P);$!==null&&I($)?Pt===null&&(Pt=$.getFormat(),Yn=$.getStyle()):O($)&&E<=C&&!$.isInline()&&(Ee+=jo)}const A=v>y,T=E>C;if(A&&!T){const D=p[C+1],P=D===void 0?null:Ve.getElementByKey(D);Ra(p,0,E,C,_.withBefore(P))}else T&&!A&&Da(g,v,y,_.element)})(0,d,f,a,c,o)}u.__lexicalTextContent=Ee,Ee=l+Ee})(n,e,e.getDOMSlot(t)),r=e,Pt==null||Pt===r.__textFormat||oo||r.setTextFormat(Pt),(function(i){Yn==null||Yn===i.__textStyle||oo||i.setTextStyle(Yn)})(e)}function co(n,e){const t=[];let r=n.__first;for(;r!==null;){const i=e.get(r);i===void 0&&F(101),t.push(r),r=i.__next}return t}function Ys(n,e){const t=or.get(n);let r=At.get(n);t!==void 0&&r!==void 0||F(61);const i=Br||Ia.has(n)||$a.has(n),s=dr(Ve,n);if(t===r&&!i){let o;if(O(t)){const l=s.__lexicalTextContent;typeof l=="string"?o=l:(o=t.getTextContent(),s.__lexicalTextContent=o)}else o=t.getTextContent();return Ee+=o,s}if(t!==r&&i&&Qc(Zi,qi,Jo,r,"updated"),r.updateDOM(t,s,sr)){const o=ao(n,null);return e===null&&F(62),e.replaceChild(o,s),lo(n,null),o}if(O(t)){O(r)||F(334,n);const o=r.__indent;(Br||o!==t.__indent)&&Wh(s,o);const l=r.__format;if((Br||l!==t.__format)&&jh(s,l),i)Cy(t,r,s),ye(r)||r.isInline()||Hh(t,r,s);else{const a=s.__lexicalTextContent;let c;typeof a=="string"?c=a:(c=t.getTextContent(),s.__lexicalTextContent=c),Ee+=c}if((Br||r.__dir!==t.__dir)&&(La(s,r),ye(r)&&!Br))for(const a of r.getChildren())O(a)&&La(dr(Ve,a.getKey()),a)}else{const o=r.getTextContent();if(V(r)){const l=r.decorate(Ve,sr);l!==null&&Jh(n,l)}Ee+=o}if(!oo&&ye(r)&&r.__cachedText!==Ee){const o=r.getWritable();o.__cachedText=Ee,r=o}return s}function Jh(n,e){let t=Ve._pendingDecorators;const r=Ve._decorators;if(t===null){if(r[n]===e)return;t=Og(Ve)}t[n]=e}function Yl(n){let e=n.nextSibling;return e!==null&&e===Ve._blockCursorElement&&(e=e.nextSibling),e}function ad(n,e){const t=new Set;for(let r=e;r<n.length;r++)t.add(n[r]);return t}function wy(n,e,t,r,i,s){Ee="",Br=r===2,Ve=t,sr=t._config,qi=t._nodes,Jo=Ve._listeners.mutation,$a=i,Ia=s,or=n._nodeMap,At=e._nodeMap,oo=e._readOnly,Fa=new Map(t._keyToDOMMap);const o=new Map;return Zi=o,Ys("root",null),Ve=void 0,qi=void 0,$a=void 0,Ia=void 0,or=void 0,At=void 0,sr=void 0,Fa=void 0,Zi=void 0,o}function Pa(n){const e=Fa.get(n);return e===void 0&&F(75,n),e}function z(n){return{type:n}}const ii=z("SELECTION_CHANGE_COMMAND"),Nc=z("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),_r=z("CLICK_COMMAND"),Ac=z("BEFORE_INPUT_COMMAND"),Oc=z("INPUT_COMMAND"),Mc=z("COMPOSITION_START_COMMAND"),$c=z("COMPOSITION_END_COMMAND"),Ot=z("DELETE_CHARACTER_COMMAND"),cn=z("INSERT_LINE_BREAK_COMMAND"),Fn=z("INSERT_PARAGRAPH_COMMAND"),An=z("CONTROLLED_TEXT_INSERTION_COMMAND"),si=z("PASTE_COMMAND"),Xi=z("REMOVE_TEXT_COMMAND"),lr=z("DELETE_WORD_COMMAND"),ar=z("DELETE_LINE_COMMAND"),Ce=z("FORMAT_TEXT_COMMAND"),oi=z("UNDO_COMMAND"),li=z("REDO_COMMAND"),Ic=z("KEYDOWN_COMMAND"),Go=z("KEY_ARROW_RIGHT_COMMAND"),uo=z("MOVE_TO_END"),ys=z("KEY_ARROW_LEFT_COMMAND"),Qi=z("MOVE_TO_START"),dn=z("KEY_ARROW_UP_COMMAND"),cr=z("KEY_ARROW_DOWN_COMMAND"),Dn=z("KEY_ENTER_COMMAND"),Vo=z("KEY_SPACE_COMMAND"),Yo=z("KEY_BACKSPACE_COMMAND"),ai=z("KEY_ESCAPE_COMMAND"),qo=z("KEY_DELETE_COMMAND"),bs=z("KEY_TAB_COMMAND"),fo=z("INSERT_TAB_COMMAND"),Ut=z("INDENT_CONTENT_COMMAND"),sn=z("OUTDENT_CONTENT_COMMAND"),Zo=z("DROP_COMMAND"),Fc=z("FORMAT_ELEMENT_COMMAND"),Xo=z("DRAGSTART_COMMAND"),Dc=z("DRAGOVER_COMMAND"),Gh=z("DRAGEND_COMMAND"),yr=z("COPY_COMMAND"),ci=z("CUT_COMMAND"),qr=z("SELECT_ALL_COMMAND"),Lc=z("CLEAR_EDITOR_COMMAND"),Vh=z("CLEAR_HISTORY_COMMAND"),Ii=z("CAN_REDO_COMMAND"),Fi=z("CAN_UNDO_COMMAND"),Rc=z("FOCUS_COMMAND"),ui=z("BLUR_COMMAND"),Yh=z("KEY_MODIFIER_COMMAND"),Xt=Object.freeze({}),Ba=[["keydown",function(n,e){es=n.timeStamp,qh=n.key,!e.isComposing()&&L(e,Ic,n)}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;jn(t)&&r!=="touch"&&r!=="pen"&&n.button===0&&Wt(e,()=>{Tg(t)||(Ka=!0)})}],["compositionstart",function(n,e){L(e,Mc,n)}],["compositionend",function(n,e){$n?Di=!0:ri||!ms&&!_s?L(e,$c,n):(Wa=!0,ja=n.data)}],["input",function(n,e){n.stopPropagation(),Wt(e,()=>{e.dispatchCommand(Oc,n)},{event:n}),zr=null}],["click",function(n,e){Wt(e,()=>{const t=M(),r=Et(vt(e)),i=bn();if(r){if(N(t)){const s=t.anchor,o=s.getNode();if(s.type==="element"&&s.offset===0&&t.isCollapsed()&&!ye(o)&&fe().getChildrenSize()===1&&o.getTopLevelElementOrThrow().isEmpty()&&i!==null&&t.is(i))r.removeAllRanges(),t.dirty=!0;else if(n.detail===3&&!t.isCollapsed()&&o!==t.focus.getNode()){const l=oe(o,a=>O(a)&&!a.isInline());O(l)&&l.select(0)}}else if(n.pointerType==="touch"||n.pointerType==="pen"){const s=r.anchorNode;(re(s)||qt(s))&&Fe(el(i,r,e,n))}}L(e,_r,n)})}],["cut",Xt],["copy",Xt],["dragstart",Xt],["dragover",Xt],["dragend",Xt],["paste",Xt],["focus",Xt],["blur",Xt],["drop",Xt]];so&&Ba.push(["beforeinput",(n,e)=>(function(t,r){const i=t.inputType;i==="deleteCompositionText"||$n&&Lg(r)||i!=="insertCompositionText"&&L(r,Ac,t)})(n,e)]);let es=0,qh=null,Zh=0,zr=null;const za=new WeakMap,ho=new WeakMap;let Ua=!1,Ka=!1,Ui=!1,Di=!1,Wa=!1,ja="",Zn=null,Xh=[0,"",0,"root",0];function Qh(n,e,t,r,i){const s=n.anchor,o=n.focus,l=s.getNode(),a=ie(),c=Et(vt(a)),u=c!==null?c.anchorNode:null,d=s.key,f=a.getElementByKey(d),h=t.length;return d!==o.key||!I(l)||(!i&&(!so||Zh<r+50)||l.isDirty()&&h<2||$g(t))&&s.offset!==o.offset&&!l.isComposing()||Tt(l)||l.isDirty()&&h>1||(i||!so)&&f!==null&&!l.isComposing()&&u!==ur(f)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||l.getFormat()!==n.format||l.getStyle()!==n.style||(function(g,p){if(p.isSegmented())return!0;if(!g.isCollapsed())return!1;const m=g.anchor.offset,b=p.getParentOrThrow(),_=On(p);return m===0?!p.canInsertTextBefore()||!b.canInsertTextBefore()&&!p.isComposing()||_||(function(y){const C=y.getPreviousSibling();return(I(C)||O(C)&&C.isInline())&&!C.canInsertTextAfter()})(p):m===p.getTextContentSize()&&(!p.canInsertTextAfter()||!b.canInsertTextAfter()&&!p.isComposing()||_)})(n,l)}function cd(n,e){return qt(n)&&n.nodeValue!==null&&e!==0&&e!==n.nodeValue.length}function ud(n,e,t){const{anchorNode:r,anchorOffset:i,focusNode:s,focusOffset:o}=n;Ua&&(Ua=!1,cd(r,i)&&cd(s,o)&&!Zn)||Wt(e,()=>{if(!t)return void Fe(null);if(!hi(e,r,s))return;let l=M();if(Zn&&N(l)&&l.isCollapsed()){const a=l.anchor,c=Zn.anchor;(a.key===c.key&&a.offset===c.offset+1||a.offset===1&&c.getNode().is(a.getNode().getPreviousSibling()))&&(l=Zn.clone(),Fe(l))}if(Zn=null,N(l)){const a=l.anchor,c=a.getNode();if(l.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(l.dirty=!0);const u=vt(e).event,d=u?u.timeStamp:performance.now(),[f,h,g,p,m]=Xh,b=fe(),_=e.isComposing()===!1&&b.getTextContent()==="";if(d<m+200&&a.offset===g&&a.key===p)qs(l,f,h);else if(a.type==="text")I(c)||F(141),eg(l,c);else if(a.type==="element"&&!_){O(c)||F(259);const y=a.getNode();y.isEmpty()?(function(C,S){const x=S.getTextFormat(),k=S.getTextStyle();qs(C,x,k)})(l,y):qs(l,0,"")}}else{const u=a.key,d=l.focus.key,f=l.getNodes(),h=f.length,g=l.isBackward(),p=g?o:i,m=g?i:o,b=g?d:u,_=g?u:d;let y=2047,C=!1;for(let S=0;S<h;S++){const x=f[S],k=x.getTextContentSize();if(I(x)&&k!==0&&!(S===0&&x.__key===b&&p===k||S===h-1&&x.__key===_&&m===0)&&(C=!0,y&=x.getFormat(),y===0))break}l.format=C?y:0}}L(e,ii,void 0)})}function qs(n,e,t){n.format===e&&n.style===t||(n.format=e,n.style=t,n.dirty=!0)}function eg(n,e){qs(n,e.getFormat(),e.getStyle())}function tg(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function vy(n){const e=n.inputType,t=tg(n),r=ie(),i=M();if(e==="deleteContentBackward"){if(i===null){const d=bn();if(!N(d))return!0;Fe(d.clone())}if(N(i)){const d=i.anchor.key===i.focus.key;if(s=n.timeStamp,qh==="MediaLast"&&s<es+30&&r.isComposing()&&d){if(Me(null),es=0,setTimeout(()=>{Wt(r,()=>{Me(null)})},30),N(i)){const f=i.anchor.getNode();f.markDirty(),I(f)||F(142),eg(i,f)}}else{Me(null),n.preventDefault();const f=i.anchor.getNode(),h=f.getTextContent(),g=f.canInsertTextAfter(),p=i.anchor.offset===0&&i.focus.offset===h.length;let m=qu&&d&&!p&&g;if(m&&i.isCollapsed()&&(m=!V(wo(i.anchor,!0))),!m){L(r,Ot,!0);const b=M();qu&&N(b)&&b.isCollapsed()&&(Zn=b,setTimeout(()=>Zn=null))}}return!0}}var s;if(!N(i))return!0;const o=n.data;zr!==null&&qc(!1,r,zr),i.dirty&&zr===null||!i.isCollapsed()||ye(i.anchor.getNode())||t===null||i.applyDOMRange(t),zr=null;const l=i.anchor,a=i.focus,c=l.getNode(),u=a.getNode();if(e==="insertText"||e==="insertTranspose"){if(o===`
4
+ `)n.preventDefault(),L(r,cn,!1);else if(o===jo)n.preventDefault(),L(r,Fn,void 0);else if(o==null&&n.dataTransfer){const d=n.dataTransfer.getData("text/plain");n.preventDefault(),i.insertRawText(d)}else o!=null&&Qh(i,t,o,n.timeStamp,!0)?(n.preventDefault(),L(r,An,o)):zr=o;return Zh=n.timeStamp,!0}switch(n.preventDefault(),e){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":L(r,An,n);break;case"insertFromComposition":Me(null),L(r,An,n);break;case"insertLineBreak":Me(null),L(r,cn,!1);break;case"insertParagraph":Me(null),Ui&&!ri?(Ui=!1,L(r,cn,!1)):L(r,Fn,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":L(r,si,n);break;case"deleteByComposition":(function(d,f){return d!==f||O(d)||O(f)||!On(d)||!On(f)})(c,u)&&L(r,Xi,n);break;case"deleteByDrag":case"deleteByCut":L(r,Xi,n);break;case"deleteContent":L(r,Ot,!1);break;case"deleteWordBackward":L(r,lr,!0);break;case"deleteWordForward":L(r,lr,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":L(r,ar,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":L(r,ar,!1);break;case"formatStrikeThrough":L(r,Ce,"strikethrough");break;case"formatBold":L(r,Ce,"bold");break;case"formatItalic":L(r,Ce,"italic");break;case"formatUnderline":L(r,Ce,"underline");break;case"historyUndo":L(r,oi,void 0);break;case"historyRedo":L(r,li,void 0)}return!0}function Ey(n){if(re(n.target)&&Tg(n.target))return!0;const e=ie(),t=M(),r=n.data,i=tg(n);if(r!=null&&N(t)&&Qh(t,i,r,n.timeStamp,!1)){Di&&(go(e,r),Di=!1);const s=t.anchor.getNode(),o=Et(vt(e));if(o===null)return!0;const l=t.isBackward(),a=l?t.anchor.offset:t.focus.offset,c=l?t.focus.offset:t.anchor.offset;so&&!t.isCollapsed()&&I(s)&&o.anchorNode!==null&&s.getTextContent().slice(0,a)+r+s.getTextContent().slice(a+c)===Fg(o.anchorNode)||L(e,An,r);const u=r.length;$n&&u>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),ms||ri||_s||!e.isComposing()||(es=0,Me(null))}else qc(!1,e,r!==null?r:void 0),Di&&(go(e,r||void 0),Di=!1);return(function(){Oe();const s=ie();Ph(s)})(),!0}function ky(n){const e=ie(),t=M();if(N(t)&&!e.isComposing()){const r=t.anchor,i=t.anchor.getNode();Me(r.key),(n.timeStamp<es+30||r.type==="element"||!t.isCollapsed()||i.getFormat()!==t.format||I(i)&&i.getStyle()!==t.style)&&L(e,An,sy)}return!0}function Ty(n){return go(ie(),n.data),!0}function go(n,e){const t=n._compositionKey;if(Me(null),t!==null&&e!=null){if(e===""){const r=Y(t),i=ur(n.getElementByKey(t));return void(i!==null&&i.nodeValue!==null&&I(r)&&Zc(r,i.nodeValue,null,null,!0))}if(e[e.length-1]===`
5
+ `){const r=M();if(N(r)){const i=r.focus;return r.anchor.set(i.key,i.offset,i.type),void L(n,Dn,null)}}}qc(!0,n,e)}function Ny(n){const e=ie();if(n.key==null)return!0;if(Wa&&Dd(n))return Wt(e,()=>{go(e,ja)}),Wa=!1,ja="",!0;if((function(t){return te(t,"ArrowRight",{shiftKey:"any"})})(n))L(e,Go,n);else if((function(t){return te(t,"ArrowRight",tn)})(n))L(e,uo,n);else if((function(t){return te(t,"ArrowLeft",{shiftKey:"any"})})(n))L(e,ys,n);else if((function(t){return te(t,"ArrowLeft",tn)})(n))L(e,Qi,n);else if((function(t){return te(t,"ArrowUp",{altKey:"any",shiftKey:"any"})})(n))L(e,dn,n);else if((function(t){return te(t,"ArrowDown",{altKey:"any",shiftKey:"any"})})(n))L(e,cr,n);else if((function(t){return te(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})})(n))Ui=!0,L(e,Dn,n);else if((function(t){return t.key===" "})(n))L(e,Vo,n);else if((function(t){return Nt&&te(t,"o",{ctrlKey:!0})})(n))n.preventDefault(),Ui=!0,L(e,cn,!0);else if((function(t){return te(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})})(n))Ui=!1,L(e,Dn,n);else if((function(t){return te(t,"Backspace",{shiftKey:"any"})||Nt&&te(t,"h",{ctrlKey:!0})})(n))Dd(n)?L(e,Yo,n):(n.preventDefault(),L(e,Ot,!0));else if((function(t){return t.key==="Escape"})(n))L(e,ai,n);else if((function(t){return te(t,"Delete",{})||Nt&&te(t,"d",{ctrlKey:!0})})(n))(function(t){return t.key==="Delete"})(n)?L(e,qo,n):(n.preventDefault(),L(e,Ot,!1));else if((function(t){return te(t,"Backspace",Fd)})(n))n.preventDefault(),L(e,lr,!0);else if((function(t){return te(t,"Delete",Fd)})(n))n.preventDefault(),L(e,lr,!1);else if((function(t){return Nt&&te(t,"Backspace",{metaKey:!0})})(n))n.preventDefault(),L(e,ar,!0);else if((function(t){return Nt&&(te(t,"Delete",{metaKey:!0})||te(t,"k",{ctrlKey:!0}))})(n))n.preventDefault(),L(e,ar,!1);else if((function(t){return te(t,"b",tn)})(n))n.preventDefault(),L(e,Ce,"bold");else if((function(t){return te(t,"u",tn)})(n))n.preventDefault(),L(e,Ce,"underline");else if((function(t){return te(t,"i",tn)})(n))n.preventDefault(),L(e,Ce,"italic");else if((function(t){return te(t,"Tab",{shiftKey:"any"})})(n))L(e,bs,n);else if((function(t){return te(t,"z",tn)})(n))n.preventDefault(),L(e,oi,void 0);else if((function(t){return Nt?te(t,"z",{metaKey:!0,shiftKey:!0}):te(t,"y",{ctrlKey:!0})||te(t,"z",{ctrlKey:!0,shiftKey:!0})})(n))n.preventDefault(),L(e,li,void 0);else{const t=e._editorState._selection;t===null||N(t)?Ld(n)&&(n.preventDefault(),L(e,qr,n)):(function(r){return te(r,"c",tn)})(n)?(n.preventDefault(),L(e,yr,n)):(function(r){return te(r,"x",tn)})(n)?(n.preventDefault(),L(e,ci,n)):Ld(n)&&(n.preventDefault(),L(e,qr,n))}return(function(t){return t.ctrlKey||t.shiftKey||t.altKey||t.metaKey})(n)&&e.dispatchCommand(Yh,n),!0}function ng(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}const jr=new Map;function rg(n){const e=Ug(n.target);if(e===null)return;const t=ll(e.anchorNode);if(t===null)return;Ka&&(Ka=!1,Wt(t,()=>{const a=bn(),c=e.anchorNode;(re(c)||qt(c))&&Fe(el(a,e,t,n))}));const r=Yc(t),i=r[r.length-1],s=i._key,o=jr.get(s),l=o||i;l!==t&&ud(e,l,!1),ud(e,t,!0),t!==i?jr.set(s,t):o&&jr.delete(s)}function dd(n){n._lexicalHandled=!0}function fd(n){return n._lexicalHandled===!0}function Ay(n){const e=za.get(n);if(e===void 0)return;const t=ho.get(e);if(t===void 0)return;const r=t-1;r>=0||F(164),za.delete(n),ho.set(e,r),r===0&&e.removeEventListener("selectionchange",rg);const i=Cs(n);ol(i)?((function(o){if(o._parentEditor!==null){const l=Yc(o),a=l[l.length-1]._key;jr.get(a)===o&&jr.delete(a)}else jr.delete(o._key)})(i),n.__lexicalEditor=null):i&&F(198);const s=ng(n);for(let o=0;o<s.length;o++)s[o]();n.__lexicalEventHandles=[]}function Ha(n,e,t){Oe();const r=n.__key,i=n.getParent();if(i===null)return;const s=(function(l){const a=M();if(!N(a)||!O(l))return a;const{anchor:c,focus:u}=a,d=c.getNode(),f=u.getNode();return vo(d,l)&&c.set(l.__key,0,"element"),vo(f,l)&&u.set(l.__key,0,"element"),a})(n);let o=!1;if(N(s)&&e){const l=s.anchor,a=s.focus;l.key===r&&(xo(l,n,i,n.getPreviousSibling(),n.getNextSibling()),o=!0),a.key===r&&(xo(a,n,i,n.getPreviousSibling(),n.getNextSibling()),o=!0)}else He(s)&&e&&n.isSelected()&&n.selectPrevious();if(N(s)&&e&&!o){const l=n.getIndexWithinParent();jt(n),bo(s,i,l,-1)}else jt(n);t||We(i)||i.canBeEmpty()||!i.isEmpty()||Ha(i,e),e&&s&&ye(i)&&i.isEmpty()&&i.selectEnd()}function Oy(n){return n}const ig=Symbol.for("ephemeral");function po(n){return n[ig]||!1}class Kt{__type;__key;__parent;__prev;__next;__state;static getType(){const{ownNodeType:e}=vs(this);return e===void 0&&F(64,this.name),e}static clone(e){F(65,this.name)}$config(){return{}}config(e,t){const r=t.extends||Object.getPrototypeOf(this.constructor);return Object.assign(t,{extends:r,type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),Ag(this,e)}getType(){return this.__type}isInline(){F(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;const t=Y(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){const t=e||M();if(t==null)return!1;const r=t.getNodes().some(i=>i.__key===this.__key);if(I(this))return r;if(N(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const i=this.getParent();if(V(this)&&this.isInline()&&i){const s=t.isBackward()?t.focus:t.anchor;if(i.is(s.getNode())&&s.offset===i.getChildrenSize()&&this.is(i.getLastChild()))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),r=0;for(;t!==null;){if(this.is(t))return r;r++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return e===null?null:Y(e)}getParentOrThrow(){const e=this.getParent();return e===null&&F(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(We(t))return O(e)||e===this&&V(e)||F(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&F(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return e===null?null:Y(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(t===null)return e;let r=t.getFirstChild();for(;r!==null&&!r.is(this);)e.push(r),r=r.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return e===null?null:Y(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=O(this)?this:this.getParent(),r=O(e)?e:e.getParent(),i=t&&r?ji(t,r):null;return i?i.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){const t=ji(this,e);return t!==null&&(t.type==="descendant"||(t.type==="branch"?cu(t)===-1:(t.type!=="same"&&t.type!=="ancestor"&&F(279),!1)))}isParentOf(e){const t=ji(this,e);return t!==null&&t.type==="ancestor"}getNodesBetween(e){const t=this.isBefore(e),r=[],i=new Set;let s=this;for(;s!==null;){const o=s.__key;if(i.has(o)||(i.add(o),r.push(s)),s===e)break;const l=O(s)?t?s.getFirstChild():s.getLastChild():null;if(l!==null){s=l;continue}const a=t?s.getNextSibling():s.getPreviousSibling();if(a!==null){s=a;continue}const c=s.getParentOrThrow();if(i.has(c.__key)||r.push(c),c===e)break;let u=null,d=c;do{if(d===null&&F(68),u=t?d.getNextSibling():d.getPreviousSibling(),d=d.getParent(),d===null)break;u!==null||i.has(d.__key)||r.push(d)}while(u===null);s=u}return t||r.reverse(),r}isDirty(){const e=ie()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(po(this))return this;const e=Y(this.__key);return e===null&&F(113),e}getWritable(){if(po(this))return this;Oe();const e=xn(),t=ie(),r=e._nodeMap,i=this.__key,s=this.getLatest(),o=t._cloneNotNeeded,l=M();if(l!==null&&l.setCachedNodes(null),o.has(i))return Co(s),s;const a=iu(s);return o.add(i),Co(a),r.set(i,a),a}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){F(70)}updateDOM(e,t,r){F(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){const e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){F(18,this.name)}updateFromJSON(e){return(function(t,r){const i=t.getWritable(),s=r.$;let o=s;for(const l of Kh(i).flatKeys)l in r&&(o!==void 0&&o!==s||(o={...s}),o[l]=r[l]);return(i.__state||o)&&Ho(t).updateFromJSON(o),i})(this,e)}static transform(){return null}remove(e){Ha(this,!0,e)}replace(e,t){Oe();let r=M();r!==null&&(r=r.clone()),ta(this,e);const i=this.getLatest(),s=this.__key,o=e.__key,l=e.getWritable(),a=this.getParentOrThrow().getWritable(),c=a.__size;jt(l);const u=i.getPreviousSibling(),d=i.getNextSibling(),f=i.__prev,h=i.__next,g=i.__parent;if(Ha(i,!1,!0),u===null?a.__first=o:u.getWritable().__next=o,l.__prev=f,d===null?a.__last=o:d.getWritable().__prev=o,l.__next=h,l.__parent=g,a.__size=c,t&&(O(this)&&O(l)||F(139),this.getChildren().forEach(p=>{l.append(p)})),N(r)){Fe(r);const p=r.anchor,m=r.focus;p.key===s&&md(p,l),m.key===s&&md(m,l)}return kn()===s&&Me(o),l}insertAfter(e,t=!0){Oe(),ta(this,e);const r=this.getWritable(),i=e.getWritable(),s=i.getParent(),o=M();let l=!1,a=!1;if(s!==null){const h=e.getIndexWithinParent();if(jt(i),N(o)){const g=s.__key,p=o.anchor,m=o.focus;l=p.type==="element"&&p.key===g&&p.offset===h+1,a=m.type==="element"&&m.key===g&&m.offset===h+1}}const c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),d=i.__key,f=r.__next;if(c===null?u.__last=d:c.getWritable().__prev=d,u.__size++,r.__next=d,i.__next=f,i.__prev=r.__key,i.__parent=r.__parent,t&&N(o)){const h=this.getIndexWithinParent();bo(o,u,h+1);const g=u.__key;l&&o.anchor.set(g,h+2,"element"),a&&o.focus.set(g,h+2,"element")}return e}insertBefore(e,t=!0){Oe(),ta(this,e);const r=this.getWritable(),i=e.getWritable(),s=i.__key;jt(i);const o=this.getPreviousSibling(),l=this.getParentOrThrow().getWritable(),a=r.__prev,c=this.getIndexWithinParent();o===null?l.__first=s:o.getWritable().__next=s,l.__size++,r.__prev=s,i.__prev=a,i.__next=r.__key,i.__parent=r.__parent;const u=M();return t&&N(u)&&bo(u,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return H()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){Oe();const r=this.getPreviousSibling(),i=this.getParentOrThrow();if(r===null)return i.select(0,0);if(O(r))return r.select();if(!I(r)){const s=r.getIndexWithinParent()+1;return i.select(s,s)}return r.select(e,t)}selectNext(e,t){Oe();const r=this.getNextSibling(),i=this.getParentOrThrow();if(r===null)return i.select();if(O(r))return r.select(0,0);if(!I(r)){const s=r.getIndexWithinParent();return i.select(s,s)}return r.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}const mo="historic",sg="history-push",Hr="history-merge",Pc="paste",og="collaboration",My="skip-collab",lg="skip-scroll-into-view",ag="skip-dom-selection",Ja="skip-selection-focus";class br extends Kt{static getType(){return"linebreak"}static clone(e){return new br(e.__key)}constructor(e){super(e)}getTextContent(){return`
6
+ `}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>(function(t){const r=t.parentElement;if(r!==null&&ts(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&Is(i)){const s=r.lastChild;if(s===t||s.previousSibling===t&&Is(s))return!0}}return!1})(e)||(function(t){const r=t.parentElement;if(r!==null&&ts(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&Is(i))return!1;const s=r.lastChild;if(s===t||s.previousSibling===t&&Is(s))return!0}return!1})(e)?null:{conversion:$y,priority:0}}}static importJSON(e){return ot().updateFromJSON(e)}}function $y(n){return{node:ot()}}function ot(){return Le(new br)}function ue(n){return n instanceof br}function Is(n){return qt(n)&&/^( |\t|\r?\n)+$/.test(n.textContent||"")}function ql(n,e){return 16&e?"code":e&Ec?"mark":32&e?"sub":64&e?"sup":null}function Zl(n,e){return 1&e?"strong":2&e?"em":"span"}function cg(n,e,t,r,i){const s=r.classList;let o=Jr(i,"base");o!==void 0&&s.add(...o),o=Jr(i,"underlineStrikethrough");let l=!1;const a=8&e&&4&e;o!==void 0&&(8&t&&4&t?(l=!0,a||s.add(...o)):a&&s.remove(...o));for(const c in Ue){const u=Ue[c];if(o=Jr(i,c),o!==void 0)if(t&u){if(l&&(c==="underline"||c==="strikethrough")){e&u&&s.remove(...o);continue}((e&u)===0||a&&c==="underline"||c==="strikethrough")&&s.add(...o)}else e&u&&s.remove(...o)}}function ug(n,e,t){const r=e.firstChild,i=t.isComposing(),s=n+(i?Wo:"");if(r==null)e.textContent=s;else{const o=r.nodeValue;if(o!==s)if(i||$n){const[l,a,c]=(function(u,d){const f=u.length,h=d.length;let g=0,p=0;for(;g<f&&g<h&&u[g]===d[g];)g++;for(;p+g<f&&p+g<h&&u[f-p-1]===d[h-p-1];)p++;return[g,f-g-p,d.slice(g,h-p)]})(o,s);a!==0&&r.deleteData(l,a),r.insertData(l,c)}else r.nodeValue=s}}function hd(n,e,t,r,i,s){ug(i,n,e);const o=s.theme.text;o!==void 0&&cg(0,0,r,n,o)}function Fs(n,e){const t=document.createElement(e);return t.appendChild(n),t}class qe extends Kt{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(e){return new qe(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e="",t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return dy[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===kn()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=Ue[e];return(this.getFormat()&t)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return So(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){const r=this.__format,i=ql(0,r),s=Zl(0,r),o=i===null?s:i,l=document.createElement(o);let a=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),i!==null&&(a=document.createElement(s),l.appendChild(a)),hd(a,this,0,r,this.__text,e);const c=this.__style;return c!==""&&(l.style.cssText=c),l}updateDOM(e,t,r){const i=this.__text,s=e.__format,o=this.__format,l=ql(0,s),a=ql(0,o),c=Zl(0,s),u=Zl(0,o);if((l===null?c:l)!==(a===null?u:a))return!0;if(l===a&&c!==u){const p=t.firstChild;p==null&&F(48);const m=document.createElement(u);return hd(m,this,0,o,i,r),t.replaceChild(m,p),!1}let d=t;a!==null&&l!==null&&(d=t.firstChild,d==null&&F(49)),ug(i,d,this);const f=r.theme.text;f!==void 0&&s!==o&&cg(0,s,o,d,f);const h=e.__style,g=this.__style;return h!==g&&(t.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:Ly,priority:0}),b:()=>({conversion:Fy,priority:0}),code:()=>({conversion:Qt,priority:0}),em:()=>({conversion:Qt,priority:0}),i:()=>({conversion:Qt,priority:0}),mark:()=>({conversion:Qt,priority:0}),s:()=>({conversion:Qt,priority:0}),span:()=>({conversion:Iy,priority:0}),strong:()=>({conversion:Qt,priority:0}),sub:()=>({conversion:Qt,priority:0}),sup:()=>({conversion:Qt,priority:0}),u:()=>({conversion:Qt,priority:0})}}static importJSON(e){return de().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return re(t)||F(132),t.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?t.style.textTransform="lowercase":this.hasFormat("uppercase")?t.style.textTransform="uppercase":this.hasFormat("capitalize")&&(t.style.textTransform="capitalize"),this.hasFormat("bold")&&(t=Fs(t,"b")),this.hasFormat("italic")&&(t=Fs(t,"i")),this.hasFormat("strikethrough")&&(t=Fs(t,"s")),this.hasFormat("underline")&&(t=Fs(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format=typeof e=="string"?Ue[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail=typeof e=="string"?ay[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=So(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=uy[e];if(this.__mode===t)return this;const r=this.getWritable();return r.__mode=t,r}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){Oe();let r=e,i=t;const s=M(),o=this.getTextContent(),l=this.__key;if(typeof o=="string"){const a=o.length;r===void 0&&(r=a),i===void 0&&(i=a)}else r=0,i=0;if(!N(s))return hg(l,r,l,i,"text","text");{const a=kn();a!==s.anchor.key&&a!==s.focus.key||Me(l),s.setTextNodeRange(this,r,this,i)}return s}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,r,i){const s=this.getWritable(),o=s.__text,l=r.length;let a=e;a<0&&(a=l+a,a<0&&(a=0));const c=M();if(i&&N(c)){const d=e+l;c.setTextNodeRange(s,d,s,d)}const u=o.slice(0,a)+r+o.slice(a+t);return s.__text=u,s}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){Oe();const t=this.getLatest(),r=t.getTextContent();if(r==="")return[];const i=t.__key,s=kn(),o=r.length;e.sort((v,E)=>v-E),e.push(o);const l=[],a=e.length;for(let v=0,E=0;v<o&&E<=a;E++){const A=e[E];A>v&&(l.push(r.slice(v,A)),v=A)}const c=l.length;if(c===1)return[t];const u=l[0],d=t.getParent();let f;const h=t.getFormat(),g=t.getStyle(),p=t.__detail;let m=!1,b=null,_=null;const y=M();if(N(y)){const[v,E]=y.isBackward()?[y.focus,y.anchor]:[y.anchor,y.focus];v.type==="text"&&v.key===i&&(b=v),E.type==="text"&&E.key===i&&(_=E)}t.isSegmented()?(f=de(u),f.__format=h,f.__style=g,f.__detail=p,f.__state=nd(t,f),m=!0):f=t.setTextContent(u);const C=[f];for(let v=1;v<c;v++){const E=de(l[v]);E.__format=h,E.__style=g,E.__detail=p,E.__state=nd(t,E);const A=E.__key;s===i&&Me(A),C.push(E)}const S=b?b.offset:null,x=_?_.offset:null;let k=0;for(const v of C){if(!b&&!_)break;const E=k+v.getTextContentSize();if(b!==null&&S!==null&&S<=E&&S>=k&&(b.set(v.getKey(),S-k,"text"),S<E&&(b=null)),_!==null&&x!==null&&x<=E&&x>=k){_.set(v.getKey(),x-k,"text");break}k=E}if(d!==null){(function(A){const T=A.getPreviousSibling(),D=A.getNextSibling();T!==null&&Co(T),D!==null&&Co(D)})(this);const v=d.getWritable(),E=this.getIndexWithinParent();m?(v.splice(E,0,C),this.remove()):v.splice(E,1,C),N(y)&&bo(y,d,E,c-1)}return C}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||F(50);const r=this.__key,i=e.__key,s=this.__text,o=s.length;kn()===i&&Me(r);const l=M();if(N(l)){const d=l.anchor,f=l.focus;d!==null&&d.key===i&&wd(d,t,r,e,o),f!==null&&f.key===i&&wd(f,t,r,e,o)}const a=e.__text,c=t?a+s:s+a;this.setTextContent(c);const u=this.getWritable();return e.remove(),u}isTextEntity(){return!1}}function Iy(n){return{forChild:Bc(n.style),node:null}}function Fy(n){const e=n,t=e.style.fontWeight==="normal";return{forChild:Bc(e.style,t?void 0:"bold"),node:null}}const gd=new WeakMap;function Dy(n){if(!re(n))return!1;if(n.nodeName==="PRE")return!0;const e=n.style.whiteSpace;return typeof e=="string"&&e.startsWith("pre")}function Ly(n){const e=n;n.parentElement===null&&F(129);let t=e.textContent||"";if((function(r){let i,s=r.parentNode;const o=[r];for(;s!==null&&(i=gd.get(s))===void 0&&!Dy(s);)o.push(s),s=s.parentNode;const l=i===void 0?s:i;for(let a=0;a<o.length;a++)gd.set(o[a],l);return l})(e)!==null){const r=t.split(/(\r?\n|\t)/),i=[],s=r.length;for(let o=0;o<s;o++){const l=r[o];l===`
7
+ `||l===`\r
8
+ `?i.push(ot()):l===" "?i.push(St()):l!==""&&i.push(de(l))}return{node:i}}if(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," "),t==="")return{node:null};if(t[0]===" "){let r=e,i=!0;for(;r!==null&&(r=pd(r,!1))!==null;){const s=r.textContent||"";if(s.length>0){/[ \t\n]$/.test(s)&&(t=t.slice(1)),i=!1;break}}i&&(t=t.slice(1))}if(t[t.length-1]===" "){let r=e,i=!0;for(;r!==null&&(r=pd(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){i=!1;break}i&&(t=t.slice(0,t.length-1))}return t===""?{node:null}:{node:de(t)}}function pd(n,e){let t=n;for(;;){let r;for(;(r=e?t.nextSibling:t.previousSibling)===null;){const s=t.parentElement;if(s===null)return null;t=s}if(t=r,re(t)){const s=t.style.display;if(s===""&&!ko(t)||s!==""&&!s.startsWith("inline"))return null}let i=t;for(;(i=e?t.firstChild:t.lastChild)!==null;)t=i;if(qt(t))return t;if(t.nodeName==="BR")return null}}const Ry={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Qt(n){const e=Ry[n.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:Bc(n.style,e),node:null}}function de(n=""){return Le(new qe(n))}function I(n){return n instanceof qe}function Bc(n,e){const t=n.fontWeight,r=n.textDecoration.split(" "),i=t==="700"||t==="bold",s=r.includes("line-through"),o=n.fontStyle==="italic",l=r.includes("underline"),a=n.verticalAlign;return c=>(I(c)&&(i&&!c.hasFormat("bold")&&c.toggleFormat("bold"),s&&!c.hasFormat("strikethrough")&&c.toggleFormat("strikethrough"),o&&!c.hasFormat("italic")&&c.toggleFormat("italic"),l&&!c.hasFormat("underline")&&c.toggleFormat("underline"),a!=="sub"||c.hasFormat("subscript")||c.toggleFormat("subscript"),a!=="super"||c.hasFormat("superscript")||c.toggleFormat("superscript"),e&&!c.hasFormat(e)&&c.toggleFormat(e)),c)}class xr extends qe{static getType(){return"tab"}static clone(e){return new xr(e.__key)}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}createDOM(e){const t=super.createDOM(e),r=Jr(e.theme,"tab");return r!==void 0&&t.classList.add(...r),t}static importJSON(e){return St().updateFromJSON(e)}setTextContent(e){return e!==" "&&e!==""&&$h(126),super.setTextContent(" ")}spliceText(e,t,r,i){return r===""&&t===0||r===" "&&t===1||F(286),this}setDetail(e){return e!==2&&F(127),this}setMode(e){return e!=="normal"&&F(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function St(){return Le(new xr)}function Je(n){return n instanceof xr}class Py{key;offset;type;_selection;constructor(e,t,r){this._selection=null,this.key=e,this.offset=t,this.type=r}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:au(et(Dt(this,"next")),et(Dt(e,"next")))<0}getNode(){const e=Y(this.key);return e===null&&F(20),e}set(e,t,r,i){const s=this._selection,o=this.key;i&&this.key===e&&this.offset===t&&this.type===r||(this.key=e,this.offset=t,this.type=r,Cr()||(kn()===o&&Me(e),s!==null&&(s.setCachedNodes(null),s.dirty=!0)))}}function Te(n,e,t){return new Py(n,e,t)}function Xl(n,e){let t=e.__key,r=n.offset,i="element";if(I(e)){i="text";const s=e.getTextContentSize();r>s&&(r=s)}else if(!O(e)){const s=e.getNextSibling();if(I(s))t=s.__key,r=0,i="text";else{const o=e.getParent();o&&(t=o.__key,r=e.getIndexWithinParent()+1)}}n.set(t,r,i)}function md(n,e){if(O(e)){const t=e.getLastDescendant();O(t)||I(t)?Xl(n,t):Xl(n,e)}else Xl(n,e)}class Qo{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!He(e))return!1;const t=this._nodes,r=e._nodes;return t.size===r.size&&Array.from(t).every(i=>r.has(i))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new Qo(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),r=t.length,i=t[r-1];let s;if(I(i))s=i.select();else{const o=i.getIndexWithinParent()+1;s=i.getParentOrThrow().select(o,o)}s.insertNodes(e);for(let o=0;o<r;o++)t[o].remove()}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this._nodes,r=[];for(const i of t){const s=Y(i);s!==null&&r.push(s)}return Cr()||(this._cachedNodes=r),r}getTextContent(){const e=this.getNodes();let t="";for(let r=0;r<e.length;r++)t+=e[r].getTextContent();return t}deleteNodes(){const e=this.getNodes();if((M()||bn())===this&&e[0]){const t=_e(e[0],"next");hl(Vt(t,t))}for(const t of e)t.remove()}}function N(n){return n instanceof Sr}class Sr{format;style;anchor;focus;_cachedNodes;dirty;constructor(e,t,r,i){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=r,this.style=i,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!N(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=(function(r){const i=[],[s,o]=r.getTextSlices();s&&i.push(s.caret.origin);const l=new Set,a=new Set;for(const c of r)if(ht(c)){const{origin:u}=c;i.length===0?l.add(u):(a.add(u),i.push(u))}else{const{origin:u}=c;O(u)&&a.has(u)||i.push(u)}if(o&&i.push(o.caret.origin),Ln(r.focus)&&O(r.focus.origin)&&r.focus.getNodeAtCaret()===null)for(let c=lt(r.focus.origin,"previous");ht(c)&&l.has(c.origin)&&!c.origin.isEmpty()&&c.origin.is(i[i.length-1]);c=gr(c))l.delete(c.origin),i.pop();for(;i.length>1;){const c=i[i.length-1];if(!O(c)||a.has(c)||c.isEmpty()||l.has(c))break;i.pop()}if(i.length===0&&r.isCollapsed()){const c=et(r.anchor),u=et(r.anchor.getFlipped()),d=h=>Mt(h)?h.origin:h.getNodeAtCaret(),f=d(c)||d(u)||(r.anchor.getNodeAtCaret()?c.origin:u.origin);i.push(f)}return i})(gl(To(this),"next"));return Cr()||(this._cachedNodes=t),t}setTextNodeRange(e,t,r,i){this.anchor.set(e.__key,t,"text"),this.focus.set(r.__key,i,"text")}getTextContent(){const e=this.getNodes();if(e.length===0)return"";const t=e[0],r=e[e.length-1],i=this.anchor,s=this.focus,o=i.isBefore(s),[l,a]=_o(this);let c="",u=!0;for(let d=0;d<e.length;d++){const f=e[d];if(O(f)&&!f.isInline())u||(c+=`
9
+ `),u=!f.isEmpty();else if(u=!1,I(f)){let h=f.getTextContent();f===t?f===r?i.type==="element"&&s.type==="element"&&s.offset!==i.offset||(h=l<a?h.slice(l,a):h.slice(a,l)):h=o?h.slice(l):h.slice(a):f===r&&(h=o?h.slice(0,a):h.slice(0,l)),c+=h}else!V(f)&&!ue(f)||f===r&&this.isCollapsed()||(c+=f.getTextContent())}return c}applyDOMRange(e){const t=ie(),r=t.getEditorState()._selection,i=fg(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,r);if(i===null)return;const[s,o]=i;this.anchor.set(s.key,s.offset,s.type,!0),this.focus.set(o.key,o.offset,o.type,!0),In(this)}clone(){const e=this.anchor,t=this.focus;return new Sr(Te(e.key,e.offset,e.type),Te(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=So(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=Ue[e];return(this.format&t)!==0}insertRawText(e){const t=e.split(/(\r?\n|\t)/),r=[],i=t.length;for(let s=0;s<i;s++){const o=t[s];o===`
10
+ `||o===`\r
11
+ `?r.push(ot()):o===" "?r.push(St()):r.push(de(o))}this.insertNodes(r)}insertText(e){const t=this.anchor,r=this.focus,i=this.format,s=this.style;let o=t,l=r;!this.isCollapsed()&&r.isBefore(t)&&(o=r,l=t),o.type==="element"&&(function(m,b,_,y){const C=m.getNode(),S=C.getChildAtIndex(m.offset),x=de();if(x.setFormat(_),x.setStyle(y),Er(S))S.splice(0,0,[x]);else{const k=ye(C)?H().append(x):x;S===null?C.append(k):S.insertBefore(k)}m.is(b)&&b.set(x.__key,0,"text"),m.set(x.__key,0,"text")})(o,l,i,s),l.type==="element"&&Rn(l,et(Dt(l,"next")));const a=o.offset;let c=l.offset;const u=this.getNodes(),d=u.length;let f=u[0];I(f)||F(26);const h=f.getTextContent().length,g=f.getParentOrThrow();let p=u[d-1];if(d===1&&l.type==="element"&&(c=h,l.set(o.key,c,"text")),this.isCollapsed()&&a===h&&(Tt(f)||!f.canInsertTextAfter()||!g.canInsertTextAfter()&&f.getNextSibling()===null)){let m=f.getNextSibling();if(I(m)&&m.canInsertTextBefore()&&!Tt(m)||(m=de(),m.setFormat(i),m.setStyle(s),g.canInsertTextAfter()?f.insertAfter(m):g.insertAfter(m)),m.select(0,0),f=m,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&a===0&&(Tt(f)||!f.canInsertTextBefore()||!g.canInsertTextBefore()&&f.getPreviousSibling()===null)){let m=f.getPreviousSibling();if(I(m)&&!Tt(m)||(m=de(),m.setFormat(i),g.canInsertTextBefore()?f.insertBefore(m):g.insertBefore(m)),m.select(),f=m,e!=="")return void this.insertText(e)}else if(f.isSegmented()&&a!==h){const m=de(f.getTextContent());m.setFormat(i),f.replace(m),f=m}else if(!this.isCollapsed()&&e!==""){const m=p.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||O(m)&&(!m.canInsertTextBefore()||!m.canInsertTextAfter()))return this.insertText(""),dg(this.anchor,this.focus,null),void this.insertText(e)}if(d===1){if(On(f)){const y=de(e);return y.select(),void f.replace(y)}const m=f.getFormat(),b=f.getStyle();if(a!==c||m===i&&b===s){if(Je(f)){const y=de(e);return y.setFormat(i),y.setStyle(s),y.select(),void f.replace(y)}}else{if(f.getTextContent()!==""){const y=de(e);if(y.setFormat(i),y.setStyle(s),y.select(),a===0)f.insertBefore(y,!1);else{const[C]=f.splitText(a);C.insertAfter(y,!1)}return void(y.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}f.setFormat(i),f.setStyle(s)}const _=c-a;f=f.spliceText(a,_,e,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(f.isComposing()?this.anchor.offset-=e.length:(this.format=m,this.style=b))}else{const m=new Set([...f.getParentKeys(),...p.getParentKeys()]),b=O(f)?f:f.getParentOrThrow();let _=O(p)?p:p.getParentOrThrow(),y=p;if(!b.is(_)&&_.isInline())do y=_,_=_.getParentOrThrow();while(_.isInline());if(l.type==="text"&&(c!==0||p.getTextContent()==="")||l.type==="element"&&p.getIndexWithinParent()<c)if(I(p)&&!On(p)&&c!==p.getTextContentSize()){if(p.isSegmented()){const v=de(p.getTextContent());p.replace(v),p=v}ye(l.getNode())||l.type!=="text"||(p=p.spliceText(0,c,"")),m.add(p.__key)}else{const v=p.getParentOrThrow();v.canBeEmpty()||v.getChildrenSize()!==1?p.remove():v.remove()}else m.add(p.__key);const C=_.getChildren(),S=new Set(u),x=b.is(_),k=b.isInline()&&f.getNextSibling()===null?b:f;for(let v=C.length-1;v>=0;v--){const E=C[v];if(E.is(f)||O(E)&&E.isParentOf(f))break;E.isAttached()&&(!S.has(E)||E.is(y)?x||k.insertAfter(E,!1):E.remove())}if(!x){let v=_,E=null;for(;v!==null;){const A=v.getChildren(),T=A.length;(T===0||A[T-1].is(E))&&(m.delete(v.__key),E=v),v=v.getParent()}}if(On(f))if(a===h)f.select();else{const v=de(e);v.select(),f.replace(v)}else f=f.spliceText(a,h-a,e,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(f.isComposing()?this.anchor.offset-=e.length:(this.format=f.getFormat(),this.style=f.getStyle()));for(let v=1;v<d;v++){const E=u[v],A=E.__key;m.has(A)||E.remove()}}}removeText(){const e=M()===this;Hi(this,Vg(To(this))),e&&M()!==this&&Fe(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void Me(null);const r=this.getNodes(),i=[];for(const C of r)I(C)&&i.push(C);const s=C=>{r.forEach(S=>{if(O(S)){const x=S.getFormatFlags(e,C);S.setTextFormat(x)}})},o=i.length;if(o===0)return this.toggleFormat(e),Me(null),void s(t);const l=this.anchor,a=this.focus,c=this.isBackward(),u=c?a:l,d=c?l:a;let f=0,h=i[0],g=u.type==="element"?0:u.offset;if(u.type==="text"&&g===h.getTextContentSize()&&(f=1,h=i[1],g=0),h==null)return;const p=h.getFormatFlags(e,t);s(p);const m=o-1;let b=i[m];const _=d.type==="text"?d.offset:b.getTextContentSize();if(h.is(b)){if(g===_)return;if(Tt(h)||g===0&&_===h.getTextContentSize())h.setFormat(p);else{const C=h.splitText(g,_),S=g===0?C[0]:C[1];S.setFormat(p),u.type==="text"&&u.set(S.__key,0,"text"),d.type==="text"&&d.set(S.__key,_-g,"text")}return void(this.format=p)}g===0||Tt(h)||([,h]=h.splitText(g),g=0),h.setFormat(p);const y=b.getFormatFlags(e,p);_>0&&(_===b.getTextContentSize()||Tt(b)||([b]=b.splitText(_)),b.setFormat(y));for(let C=f+1;C<m;C++){const S=i[C],x=S.getFormatFlags(e,y);S.setFormat(x)}u.type==="text"&&u.set(h.__key,g,"text"),d.type==="text"&&d.set(b.__key,_,"text"),this.format=p|y}insertNodes(e){if(e.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();const g=M();return N(g)||F(134),g.insertNodes(e)}const t=(this.isBackward()?this.focus:this.anchor).getNode(),r=oe(t,dt),i=e[e.length-1];if(O(r)&&"__language"in r){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const g=Ql(this);r.splice(g,0,e),i.selectEnd()}return}if(!e.some(g=>(O(g)||V(g))&&!g.isInline())){O(r)||F(211,t.constructor.name,t.getType());const g=Ql(this);return r.splice(g,0,e),void i.selectEnd()}const s=(function(g){const p=H();let m=null;for(let b=0;b<g.length;b++){const _=g[b],y=ue(_);if(y||V(_)&&_.isInline()||O(_)&&_.isInline()||I(_)||_.isParentRequired()){if(m===null&&(m=_.createParentElementNode(),p.append(m),y))continue;m!==null&&m.append(_)}else p.append(_),m=null}return p})(e),o=s.getLastDescendant(),l=s.getChildren(),a=!O(r)||!r.isEmpty()?this.insertParagraph():null,c=l[l.length-1];let u=l[0];var d;O(d=u)&&dt(d)&&!d.isEmpty()&&O(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(O(r)||F(211,t.constructor.name,t.getType()),r.append(...u.getChildren()),u=l[1]),u&&(r===null&&F(212,t.constructor.name,t.getType()),(function(g,p){const m=p.getParentOrThrow().getLastChild();let b=p;const _=[p];for(;b!==m;)b.getNextSibling()||F(140),b=b.getNextSibling(),_.push(b);let y=g;for(const C of _)y=y.insertAfter(C)})(r,u));const f=oe(o,dt);a&&O(f)&&(a.canMergeWhenEmpty()||dt(c))&&(f.append(...a.getChildren()),a.remove()),O(r)&&r.isEmpty()&&r.remove(),o.selectEnd();const h=O(r)?r.getLastChild():null;ue(h)&&f!==r&&h.remove()}insertParagraph(){if(this.anchor.key==="root"){const o=H();return fe().splice(this.anchor.offset,0,[o]),o.select(),o}const e=Ql(this),t=oe(this.anchor.getNode(),dt);O(t)||F(213);const r=t.getChildAtIndex(e),i=r?[r,...r.getNextSiblings()]:[],s=t.insertNewAfter(this,!1);return s?(s.append(...i),s.selectStart(),s):null}insertLineBreak(e){const t=ot();if(this.insertNodes([t]),e){const r=t.getParentOrThrow(),i=t.getIndexWithinParent();r.select(i,i)}}extract(){const e=[...this.getNodes()],t=e.length;let r=e[0],i=e[t-1];const[s,o]=_o(this),l=this.isBackward(),[a,c]=l?[this.focus,this.anchor]:[this.anchor,this.focus],[u,d]=l?[o,s]:[s,o];if(t===0)return[];if(t===1){if(I(r)&&!this.isCollapsed()){const f=r.splitText(u,d),h=u===0?f[0]:f[1];return h?(a.set(h.getKey(),0,"text"),c.set(h.getKey(),h.getTextContentSize(),"text"),[h]):[]}return[r]}if(I(r)&&(u===r.getTextContentSize()?e.shift():u!==0&&([,r]=r.splitText(u),e[0]=r,a.set(r.getKey(),0,"text"))),I(i)){const f=i.getTextContent().length;d===0?e.pop():d!==f&&([i]=i.splitText(d),e[e.length-1]=i,c.set(i.getKey(),i.getTextContentSize(),"text"))}return e}modify(e,t,r){if(vd(this,e,t,r))return;const i=e==="move",s=ie(),o=Et(vt(s));if(!o)return;const l=s._blockCursorElement,a=s._rootElement,c=this.focus.getNode();if(a===null||l===null||!O(c)||c.isInline()||c.canBeEmpty()||Va(l,s,a),this.dirty){let u=dr(s,this.anchor.key),d=dr(s,this.focus.key);this.anchor.type==="text"&&(u=ur(u)),this.focus.type==="text"&&(d=ur(d)),u&&d&&gg(o,u,this.anchor.offset,d,this.focus.offset)}if((function(u,d,f,h){u.modify(d,f,h)})(o,e,t?"backward":"forward",r),o.rangeCount>0){const u=o.getRangeAt(0),d=this.anchor.getNode(),f=ye(d)?d:zg(d);if(this.applyDOMRange(u),this.dirty=!0,!i){const h=this.getNodes(),g=[];let p=!1;for(let m=0;m<h.length;m++){const b=h[m];vo(b,f)?g.push(b):p=!0}if(p&&g.length>0)if(t){const m=g[0];O(m)?m.selectStart():m.getParentOrThrow().selectStart()}else{const m=g[g.length-1];O(m)?m.selectEnd():m.getParentOrThrow().selectEnd()}o.anchorNode===u.startContainer&&o.anchorOffset===u.startOffset||(function(m){const b=m.focus,_=m.anchor,y=_.key,C=_.offset,S=_.type;_.set(b.key,b.offset,b.type,!0),b.set(y,C,S,!0)})(this)}}r==="lineboundary"&&vd(this,e,t,r,"decorators")}forwardDeletion(e,t,r){if(!r&&(e.type==="element"&&O(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){const i=t.getParent(),s=t.getNextSibling()||(i===null?null:i.getNextSibling());if(O(s)&&s.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let i=r.getNode();if(this.forwardDeletion(r,i,e))return;const s=dl(Dt(r,e?"previous":"next"));if(s.getTextSlices().every(l=>l===null||l.distance===0)){let l={type:"initial"};for(const a of s.iterNodeCarets("shadowRoot"))if(ht(a)){if(!a.origin.isInline()){if(a.origin.isShadowRoot()){if(l.type==="merge-block")break;if(O(s.anchor.origin)&&s.anchor.origin.isEmpty()){const c=et(a);Hi(this,Vt(c,c)),s.anchor.origin.remove()}return}l.type!=="merge-next-block"&&l.type!=="merge-block"||(l={block:l.block,caret:a,type:"merge-block"})}}else{if(l.type==="merge-block")break;if(Ln(a)){if(O(a.origin)){if(a.origin.isInline()){if(!a.origin.isParentOf(s.anchor.origin))break}else l={block:a.origin,type:"merge-next-block"};continue}if(V(a.origin)){if(!a.origin.isIsolated())if(l.type==="merge-next-block"&&(a.origin.isKeyboardSelectable()||!a.origin.isInline())&&O(s.anchor.origin)&&s.anchor.origin.isEmpty()){s.anchor.origin.remove();const c=zc();c.add(a.origin.getKey()),Fe(c)}else a.origin.remove();return}break}}if(l.type==="merge-block"){const{caret:a,block:c}=l;return Hi(this,Vt(!a.origin.isEmpty()&&c.isEmpty()?pi(_e(c,a.direction)):s.anchor,a)),this.removeText()}}const o=this.focus;if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&r.offset===0&&yd(this,r.getNode()))return}else{const l=o.type==="text"?o.getNode():null;if(i=r.type==="text"?r.getNode():null,l!==null&&l.isSegmented()){const a=o.offset,c=l.getTextContentSize();if(l.is(i)||e&&a!==c||!e&&a!==0)return void bd(l,e,a)}else if(i!==null&&i.isSegmented()){const a=r.offset,c=i.getTextContentSize();if(i.is(l)||e&&a!==0||!e&&a!==c)return void bd(i,e,a)}(function(a,c){const u=a.anchor,d=a.focus,f=u.getNode(),h=d.getNode();if(f===h&&u.type==="text"&&d.type==="text"){const g=u.offset,p=d.offset,m=g<p,b=m?g:p,_=m?p:g,y=_-1;b!==y&&(function(C){return!($g(C)||By(C))})(f.getTextContent().slice(b,_))&&(c?d.set(d.key,y,d.type):u.set(u.key,y,u.type))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&ye(r.getParent())&&r.getPreviousSibling()===null&&yd(this,r)}}deleteLine(e){this.isCollapsed()&&this.modify("extend",e,"lineboundary"),this.isCollapsed()?this.deleteCharacter(e):this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,r=t.getNode();if(this.forwardDeletion(t,r,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function He(n){return n instanceof Qo}function _d(n){const e=n.offset;if(n.type==="text")return e;const t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function _o(n){const e=n.getStartEndPoints();if(e===null)return[0,0];const[t,r]=e;return t.type==="element"&&r.type==="element"&&t.key===r.key&&t.offset===r.offset?[0,0]:[_d(t),_d(r)]}function yd(n,e){for(let t=e;t;t=t.getParent()){if(O(t)){if(t.collapseAtStart(n))return!0;if(We(t))break}if(t.getPreviousSibling())break}return!1}const By=(()=>{try{const n=new RegExp("\\p{Emoji}","u"),e=n.test.bind(n);if(e("❤️")&&e("#️⃣")&&e("👍"))return e}catch{}return()=>!1})();function bd(n,e,t){const r=n,i=r.getTextContent().split(/(?=\s)/g),s=i.length;let o=0,l=0;for(let c=0;c<s;c++){const u=c===s-1;if(l=o,o+=i[c].length,e&&o===t||o>t||u){i.splice(c,1),u&&(l=void 0);break}}const a=i.join("").trim();a===""?r.remove():(r.setTextContent(a),r.select(l,l))}function xd(n,e,t,r){let i,s=e;if(re(n)){let o=!1;const l=n.childNodes,a=l.length,c=r._blockCursorElement;s===a&&(o=!0,s=a-1);let u=l[s],d=!1;if(u===c)u=l[s+1],d=!0;else if(c!==null){const f=c.parentNode;n===f&&e>Array.prototype.indexOf.call(f.children,c)&&s--}if(i=Wr(u),I(i))s=$t(i,o?"next":"previous");else{let f=Wr(n);if(f===null)return null;if(O(f)){const h=r.getElementByKey(f.getKey());h===null&&F(214),[f,s]=f.getDOMSlot(h).resolveChildIndex(f,h,n,e),O(f)||F(215),o&&s>=f.getChildrenSize()&&(s=Math.max(0,f.getChildrenSize()-1));let p=f.getChildAtIndex(s);if(O(p)&&(function(m,b,_){const y=m.getParent();return _===null||y===null||!y.canBeEmpty()||y!==_.getNode()})(p,0,t)){const m=o?p.getLastDescendant():p.getFirstDescendant();m===null?f=p:(p=m,f=O(p)?p:p.getParentOrThrow()),s=0}I(p)?(i=p,f=null,s=$t(p,o?"next":"previous")):p!==f&&o&&!d&&(O(f)||F(216),s=Math.min(f.getChildrenSize(),s+1))}else{const h=f.getIndexWithinParent();s=e===0&&V(f)&&Wr(n)===f?h:h+1,f=f.getParentOrThrow()}if(O(f))return Te(f.__key,s,"element")}}else i=Wr(n);return I(i)?Te(i.__key,$t(i,s,"clamp"),"text"):null}function Sd(n,e,t){const r=n.offset,i=n.getNode();if(r===0){const s=i.getPreviousSibling(),o=i.getParent();if(e){if((t||!e)&&s===null&&O(o)&&o.isInline()){const l=o.getPreviousSibling();I(l)&&n.set(l.__key,l.getTextContent().length,"text")}}else O(s)&&!t&&s.isInline()?n.set(s.__key,s.getChildrenSize(),"element"):I(s)&&n.set(s.__key,s.getTextContent().length,"text")}else if(r===i.getTextContent().length){const s=i.getNextSibling(),o=i.getParent();if(e&&O(s)&&s.isInline())n.set(s.__key,0,"element");else if((t||e)&&s===null&&O(o)&&o.isInline()&&!o.canInsertTextAfter()){const l=o.getNextSibling();I(l)&&n.set(l.__key,0,"text")}}}function dg(n,e,t){if(n.type==="text"&&e.type==="text"){const r=n.isBefore(e),i=n.is(e);Sd(n,r,i),Sd(e,!r,i),i&&e.set(n.key,n.offset,n.type);const s=ie();if(s.isComposing()&&s._compositionKey!==n.key&&N(t)){const o=t.anchor,l=t.focus;n.set(o.key,o.offset,o.type,!0),e.set(l.key,l.offset,l.type,!0)}}}function fg(n,e,t,r,i,s){if(n===null||t===null||!hi(i,n,t))return null;const o=xd(n,e,N(s)?s.anchor:null,i);if(o===null)return null;const l=xd(t,r,N(s)?s.focus:null,i);if(l===null)return null;if(o.type==="element"&&l.type==="element"){const a=Wr(n),c=Wr(t);if(V(a)&&V(c))return null}return dg(o,l,s),[o,l]}function yo(n){return O(n)&&!n.isInline()}function hg(n,e,t,r,i,s){const o=xn(),l=new Sr(Te(n,e,i),Te(t,r,s),0,"");return l.dirty=!0,o._selection=l,l}function di(){const n=Te("root",0,"element"),e=Te("root",0,"element");return new Sr(n,e,0,"")}function zc(){return new Qo(new Set)}function zy(n,e){return el(null,n,e,null)}function el(n,e,t,r){const i=t._window;if(i===null)return null;const s=r||i.event,o=s?s.type:void 0,l=o==="selectionchange",a=!Ma&&(l||o==="beforeinput"||o==="compositionstart"||o==="compositionend"||o==="click"&&s&&s.detail===3||o==="drop"||o===void 0);let c,u,d,f;if(N(n)&&!a)return n.clone();if(e===null)return null;if(c=e.anchorNode,u=e.focusNode,d=e.anchorOffset,f=e.focusOffset,(l||o===void 0)&&N(n)&&!hi(t,c,u))return n.clone();const h=fg(c,d,u,f,t,n);if(h===null)return null;const[g,p]=h;return new Sr(g,p,N(n)?n.format:0,N(n)?n.style:"")}function M(){return xn()._selection}function bn(){return ie()._editorState._selection}function bo(n,e,t,r=1){const i=n.anchor,s=n.focus,o=i.getNode(),l=s.getNode();if(!e.is(o)&&!e.is(l))return;const a=e.__key;if(n.isCollapsed()){const c=i.offset;if(t<=c&&r>0||t<c&&r<0){const u=Math.max(0,c+r);i.set(a,u,"element"),s.set(a,u,"element"),Cd(n)}}else{const c=n.isBackward(),u=c?s:i,d=u.getNode(),f=c?i:s,h=f.getNode();if(e.is(d)){const g=u.offset;(t<=g&&r>0||t<g&&r<0)&&u.set(a,Math.max(0,g+r),"element")}if(e.is(h)){const g=f.offset;(t<=g&&r>0||t<g&&r<0)&&f.set(a,Math.max(0,g+r),"element")}}Cd(n)}function Cd(n){const e=n.anchor,t=e.offset,r=n.focus,i=r.offset,s=e.getNode(),o=r.getNode();if(n.isCollapsed()){if(!O(s))return;const l=s.getChildrenSize(),a=t>=l,c=a?s.getChildAtIndex(l-1):s.getChildAtIndex(t);if(I(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text"),r.set(c.__key,u,"text")}return}if(O(s)){const l=s.getChildrenSize(),a=t>=l,c=a?s.getChildAtIndex(l-1):s.getChildAtIndex(t);if(I(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text")}}if(O(o)){const l=o.getChildrenSize(),a=i>=l,c=a?o.getChildAtIndex(l-1):o.getChildAtIndex(i);if(I(c)){let u=0;a&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}function xo(n,e,t,r,i){let s=null,o=0,l=null;r!==null?(s=r.__key,I(r)?(o=r.getTextContentSize(),l="text"):O(r)&&(o=r.getChildrenSize(),l="element")):i!==null&&(s=i.__key,I(i)?l="text":O(i)&&(l="element")),s!==null&&l!==null?n.set(s,o,l):(o=e.getIndexWithinParent(),o===-1&&(o=t.getChildrenSize()),n.set(t.__key,o,"element"))}function wd(n,e,t,r,i){n.type==="text"?n.set(t,n.offset+(e?0:i),"text"):n.offset>r.getIndexWithinParent()&&n.set(n.key,n.offset-1,"element")}function gg(n,e,t,r,i){try{n.setBaseAndExtent(e,t,r,i)}catch{}}function Uy(n,e,t,r,i,s,o){const l=r.anchorNode,a=r.focusNode,c=r.anchorOffset,u=r.focusOffset,d=document.activeElement;if(i.has(og)&&d!==s||d!==null&&sl(d))return;if(!N(e))return void(n!==null&&hi(t,l,a)&&r.removeAllRanges());const f=e.anchor,h=e.focus,g=f.key,p=h.key,m=dr(t,g),b=dr(t,p),_=f.offset,y=h.offset,C=e.format,S=e.style,x=e.isCollapsed();let k=m,v=b,E=!1;if(f.type==="text"){k=ur(m);const U=f.getNode();E=U.getFormat()!==C||U.getStyle()!==S}else N(n)&&n.anchor.type==="text"&&(E=!0);var A,T,D,P,$;if(h.type==="text"&&(v=ur(b)),k!==null&&v!==null&&(x&&(n===null||E||N(n)&&(n.format!==C||n.style!==S))&&(A=C,T=S,D=_,P=g,$=performance.now(),Xh=[A,T,D,P,$]),c!==_||u!==y||l!==k||a!==v||r.type==="Range"&&x||(d!==null&&s.contains(d)||i.has(Ja)||s.focus({preventScroll:!0}),f.type==="element"))){if(gg(r,k,_,v,y),!$n||!e.isCollapsed()||s===null||i.has(Ja)||document.activeElement!==null&&s.contains(document.activeElement)||s.focus({preventScroll:!0}),!i.has(lg)&&e.isCollapsed()&&s!==null&&s===document.activeElement){const U=N(e)&&e.anchor.type==="element"?k.childNodes[_]||null:r.rangeCount>0?r.getRangeAt(0):null;if(U!==null){let W;if(U instanceof Text){const q=document.createRange();q.selectNode(U),W=q.getBoundingClientRect()}else W=U.getBoundingClientRect();(function(q,se,Q){const Pe=eu(Q),at=tu(Pe);if(Pe===null||at===null)return;let{top:j,bottom:xe}=se,le=0,Ze=0,ve=Q;for(;ve!==null;){const Be=ve===Pe.body;if(Be)le=0,Ze=vt(q).innerHeight;else{const kt=ve.getBoundingClientRect();le=kt.top,Ze=kt.bottom}let ze=0;if(j<le?ze=-(le-j):xe>Ze&&(ze=xe-Ze),ze!==0)if(Be)at.scrollBy(0,ze);else{const kt=ve.scrollTop;ve.scrollTop+=ze;const Ne=ve.scrollTop-kt;j-=Ne,xe-=Ne}if(Be)break;ve=ws(ve)}})(t,W,s)}}Ua=!0}}function tl(n){let e=M()||bn();e===null&&(e=fe().selectEnd()),e.insertNodes(n)}function Ky(){const n=M();return n===null?"":n.getTextContent()}function Ql(n){let e=n;n.isCollapsed()||e.removeText();const t=M();N(t)&&(e=t),N(e)||F(161);const r=e.anchor;let i=r.getNode(),s=r.offset;for(;!dt(i);){const o=i;if([i,s]=Wy(i,s),o.is(i))break}return s}function Wy(n,e){const t=n.getParent();if(!t){const i=H();return fe().append(i),i.select(),[fe(),0]}if(I(n)){const i=n.splitText(e);if(i.length===0)return[t,n.getIndexWithinParent()];const s=e===0?0:1;return[t,i[0].getIndexWithinParent()+s]}if(!O(n)||e===0)return[t,n.getIndexWithinParent()];const r=n.getChildAtIndex(e);if(r){const i=new Sr(Te(n.__key,e,"element"),Te(n.__key,e,"element"),0,""),s=n.insertNewAfter(i);s&&s.append(r,...r.getNextSiblings())}return[t,n.getIndexWithinParent()+1]}function vd(n,e,t,r,i="decorators-and-blocks"){if(e==="move"&&r==="character"&&!n.isCollapsed()){const[u,d]=t===n.isBackward()?[n.focus,n.anchor]:[n.anchor,n.focus];return d.set(u.key,u.offset,u.type),!0}const s=Dt(n.focus,t?"previous":"next"),o=r==="lineboundary",l=e==="move";let a=s,c=i==="decorators-and-blocks";if(!uu(a)){for(const u of a){c=!1;const{origin:d}=u;if(!V(d)||d.isIsolated()||(a=u,!o||!d.isInline()))break}if(c)for(const u of dl(s).iterNodeCarets(e==="extend"?"shadowRoot":"root")){if(ht(u))u.origin.isInline()||(a=u);else{if(O(u.origin))continue;V(u.origin)&&!u.origin.isInline()&&(a=u)}break}}if(a===s)return!1;if(l&&!o&&V(a.origin)&&a.origin.isKeyboardSelectable()){const u=zc();return u.add(a.origin.getKey()),Fe(u),!0}return a=et(a),l&&Rn(n.anchor,a),Rn(n.focus,a),c||!o}let $e=null,Ie=null,it=!1,ea=!1,Zs=0;const Ed={characterData:!0,childList:!0,subtree:!0};function Cr(){return it||$e!==null&&$e._readOnly}function Oe(){it&&F(13)}function pg(){Zs>99&&F(14)}function xn(){return $e===null&&F(195,mg()),$e}function ie(){return Ie===null&&F(196,mg()),Ie}function mg(){let n=0;const e=new Set,t=Zr.version;if(typeof window<"u")for(const i of document.querySelectorAll("[contenteditable]")){const s=Cs(i);if(ol(s))n++;else if(s){let o=String(s.constructor.version||"<0.17.1");o===t&&(o+=" (separately built, likely a bundler configuration issue)"),e.add(o)}}let r=` Detected on the page: ${n} compatible editor(s) with version ${t}`;return e.size&&(r+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),r}function jy(){return Ie}function kd(n,e,t){const r=e.__type,i=Hc(n,r);let s=t.get(r);s===void 0&&(s=Array.from(i.transforms),t.set(r,s));const o=s.length;for(let l=0;l<o&&(s[l](e),e.isAttached());l++);}function Td(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function _g(n,e){if(!e)return;const t=n._updateTags;let r=e;Array.isArray(e)||(r=[e]);for(const i of r)t.add(i)}function yg(n){return Uc(n,ie()._nodes)}function Uc(n,e){const t=n.type,r=e.get(t);r===void 0&&F(17,t);const i=r.klass;n.type!==i.getType()&&F(18,i.name);const s=i.importJSON(n),o=n.children;if(O(s)&&Array.isArray(o))for(let l=0;l<o.length;l++){const a=Uc(o[l],e);s.append(a)}return s}function Nd(n,e,t){const r=$e,i=it,s=Ie;$e=e,it=!0,Ie=n;try{return t()}finally{$e=r,it=i,Ie=s}}function nn(n,e){const t=n._pendingEditorState,r=n._rootElement,i=n._headless||r===null;if(t===null)return;const s=n._editorState,o=s._selection,l=t._selection,a=n._dirtyType!==0,c=$e,u=it,d=Ie,f=n._updating,h=n._observer;let g=null;if(n._pendingEditorState=null,n._editorState=t,!i&&a&&h!==null){Ie=n,$e=t,it=!1,n._updating=!0;try{const x=n._dirtyType,k=n._dirtyElements,v=n._dirtyLeaves;h.disconnect(),g=wy(s,t,n,x,k,v)}catch(x){if(x instanceof Error&&n._onError(x),ea)throw x;return vg(n,null,r,t),Bh(n),n._dirtyType=2,ea=!0,nn(n,s),void(ea=!1)}finally{h.observe(r,Ed),n._updating=f,$e=c,it=u,Ie=d}}t._readOnly||(t._readOnly=!0);const p=n._dirtyLeaves,m=n._dirtyElements,b=n._normalizedNodes,_=n._updateTags,y=n._deferred;a&&(n._dirtyType=0,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),(function(x,k){const v=x._decorators;let E=x._pendingDecorators||v;const A=k._nodeMap;let T;for(T in E)A.has(T)||(E===v&&(E=Og(x)),delete E[T])})(n,t);const C=i?null:Et(vt(n));if(n._editable&&C!==null&&(a||l===null||l.dirty||!l.is(o))&&r!==null&&!_.has(ag)){Ie=n,$e=t;try{if(h!==null&&h.disconnect(),a||l===null||l.dirty){const x=n._blockCursorElement;x!==null&&Va(x,n,r),Uy(o,l,n,C,_,r)}(function(x,k,v){let E=x._blockCursorElement;if(N(v)&&v.isCollapsed()&&v.anchor.type==="element"&&k.contains(document.activeElement)){const A=v.anchor,T=A.getNode(),D=A.offset;let P=!1,$=null;if(D===T.getChildrenSize())na(T.getChildAtIndex(D-1))&&(P=!0);else{const U=T.getChildAtIndex(D);if(U!==null&&na(U)){const W=U.getPreviousSibling();(W===null||na(W))&&(P=!0,$=x.getElementByKey(U.__key))}}if(P){const U=x.getElementByKey(T.__key);return E===null&&(x._blockCursorElement=E=(function(W){const q=W.theme,se=document.createElement("div");se.contentEditable="false",se.setAttribute("data-lexical-cursor","true");let Q=q.blockCursor;if(Q!==void 0){if(typeof Q=="string"){const Pe=hn(Q);Q=q.blockCursor=Pe}Q!==void 0&&se.classList.add(...Q)}return se})(x._config)),k.style.caretColor="transparent",void($===null?U.appendChild(E):U.insertBefore(E,$))}}E!==null&&Va(E,x,k)})(n,r,l)}finally{h!==null&&h.observe(r,Ed),Ie=d,$e=c}}g!==null&&(function(x,k,v,E,A){const T=Array.from(x._listeners.mutation),D=T.length;for(let P=0;P<D;P++){const[$,U]=T[P];for(const W of U){const q=k.get(W);q!==void 0&&$(q,{dirtyLeaves:E,prevEditorState:A,updateTags:v})}}})(n,g,_,p,s),N(l)||l===null||o!==null&&o.is(l)||n.dispatchCommand(ii,void 0);const S=n._pendingDecorators;S!==null&&(n._decorators=S,n._pendingDecorators=null,Ki("decorator",n,!0,S)),(function(x,k,v){const E=$d(k),A=$d(v);E!==A&&Ki("textcontent",x,!0,A)})(n,e||s,t),Ki("update",n,!0,{dirtyElements:m,dirtyLeaves:p,editorState:t,mutatedNodes:g,normalizedNodes:b,prevEditorState:e||s,tags:_}),(function(x,k){if(x._deferred=[],k.length!==0){const v=x._updating;x._updating=!0;try{for(let E=0;E<k.length;E++)k[E]()}finally{x._updating=v}}})(n,y),(function(x){const k=x._updates;if(k.length!==0){const v=k.shift();if(v){const[E,A]=v;nl(x,E,A)}}})(n)}function Ki(n,e,t,...r){const i=e._updating;e._updating=t;try{const s=Array.from(e._listeners[n]);for(let o=0;o<s.length;o++)s[o].apply(null,r)}finally{e._updating=i}}function Ad(n,e){const t=n._updates;let r=e||!1;for(;t.length!==0;){const i=t.shift();if(i){const[s,o]=i,l=n._pendingEditorState;let a;o!==void 0&&(a=o.onUpdate,o.skipTransforms&&(r=!0),o.discrete&&(l===null&&F(191),l._flushSync=!0),a&&n._deferred.push(a),_g(n,o.tag)),l==null?nl(n,s,o):s()}}return r}function nl(n,e,t){const r=n._updateTags;let i,s=!1,o=!1;t!==void 0&&(i=t.onUpdate,_g(n,t.tag),s=t.skipTransforms||!1,o=t.discrete||!1),i&&n._deferred.push(i);const l=n._editorState;let a=n._pendingEditorState,c=!1;(a===null||a._readOnly)&&(a=n._pendingEditorState=bg(a||l),c=!0),a._flushSync=o;const u=$e,d=it,f=Ie,h=n._updating;$e=a,it=!1,n._updating=!0,Ie=n;const g=n._headless||n.getRootElement()===null;jc(null);try{c&&(g?l._selection!==null&&(a._selection=l._selection.clone()):a._selection=(function(_,y){const C=_.getEditorState()._selection,S=Et(vt(_));return N(C)||C==null?el(C,S,_,y):C.clone()})(n,t&&t.event||null));const m=n._compositionKey;e(),s=Ad(n,s),(function(_,y){const C=y.getEditorState()._selection,S=_._selection;if(N(S)){const x=S.anchor,k=S.focus;let v;if(x.type==="text"&&(v=x.getNode(),v.selectionTransform(C,S)),k.type==="text"){const E=k.getNode();v!==E&&E.selectionTransform(C,S)}}})(a,n),n._dirtyType!==0&&(s?(function(_,y){const C=y._dirtyLeaves,S=_._nodeMap;for(const x of C){const k=S.get(x);I(k)&&k.isAttached()&&k.isSimpleText()&&!k.isUnmergeable()&&sd(k)}})(a,n):(function(_,y){const C=y._dirtyLeaves,S=y._dirtyElements,x=_._nodeMap,k=kn(),v=new Map;let E=C,A=E.size,T=S,D=T.size;for(;A>0||D>0;){if(A>0){y._dirtyLeaves=new Set;for(const P of E){const $=x.get(P);I($)&&$.isAttached()&&$.isSimpleText()&&!$.isUnmergeable()&&sd($),$!==void 0&&Td($,k)&&kd(y,$,v),C.add(P)}if(E=y._dirtyLeaves,A=E.size,A>0){Zs++;continue}}y._dirtyLeaves=new Set,y._dirtyElements=new Map,T.delete("root")&&T.set("root",!0);for(const P of T){const $=P[0],U=P[1];if(S.set($,U),!U)continue;const W=x.get($);W!==void 0&&Td(W,k)&&kd(y,W,v)}E=y._dirtyLeaves,A=E.size,T=y._dirtyElements,D=T.size,Zs++}y._dirtyLeaves=C,y._dirtyElements=S})(a,n),Ad(n),(function(_,y,C,S){const x=_._nodeMap,k=y._nodeMap,v=[];for(const[E]of S){const A=k.get(E);A!==void 0&&(A.isAttached()||(O(A)&&Lh(A,E,x,k,v,S),x.has(E)||S.delete(E),v.push(E)))}for(const E of v)k.delete(E);for(const E of C){const A=k.get(E);A===void 0||A.isAttached()||(x.has(E)||C.delete(E),k.delete(E))}})(l,a,n._dirtyLeaves,n._dirtyElements)),m!==n._compositionKey&&(a._flushSync=!0);const b=a._selection;if(N(b)){const _=a._nodeMap,y=b.anchor.key,C=b.focus.key;_.get(y)!==void 0&&_.get(C)!==void 0||F(19)}else He(b)&&b._nodes.size===0&&(a._selection=null)}catch(m){return m instanceof Error&&n._onError(m),n._pendingEditorState=l,n._dirtyType=2,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void nn(n)}finally{$e=u,it=d,Ie=f,n._updating=h,Zs=0}n._dirtyType!==0||n._deferred.length>0||(function(m,b){const _=b.getEditorState()._selection,y=m._selection;if(y!==null){if(y.dirty||!y.is(_))return!0}else if(_!==null)return!0;return!1})(a,n)?a._flushSync?(a._flushSync=!1,nn(n)):c&&Gy(()=>{nn(n)}):(a._flushSync=!1,c&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function Wt(n,e,t){Ie===n&&t===void 0?e():nl(n,e,t)}class Wi{element;before;after;constructor(e,t,r){this.element=e,this.before=t||null,this.after=r||null}withBefore(e){return new Wi(this.element,e,this.after)}withAfter(e){return new Wi(this.element,this.before,e)}withElement(e){return this.element===e?this:new Wi(e,this.before,this.after)}insertChild(e){const t=this.before||this.getManagedLineBreak();return t!==null&&t.parentElement!==this.element&&F(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&F(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&F(224),this.element.replaceChild(e,t),this}getFirstChild(){const e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(e===null)this.removeManagedLineBreak();else{const t=e==="decorator"&&(_s||ri||ms);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){const e=this.getManagedLineBreak();if(e){const t=this.element,r=e.nodeName==="IMG"?e.nextSibling:null;r&&t.removeChild(r),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){const t=this.getManagedLineBreak();if(t){if(e===(t.nodeName==="IMG"))return;this.removeManagedLineBreak()}const r=this.element,i=this.before,s=document.createElement("br");if(r.insertBefore(s,i),e){const o=document.createElement("img");o.setAttribute("data-lexical-linebreak","true"),o.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",o.alt="",r.insertBefore(o,s),r.__lexicalLineBreak=o}else r.__lexicalLineBreak=s}getFirstChildOffset(){let e=0;for(let t=this.after;t!==null;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,r,i){if(r===this.element){const a=this.getFirstChildOffset();return[e,Math.min(a+e.getChildrenSize(),Math.max(a,i))]}const s=Od(t,r);s.push(i);const o=Od(t,this.element);let l=e.getIndexWithinParent();for(let a=0;a<o.length;a++){const c=s[a],u=o[a];if(c===void 0||c<u)break;if(c>u){l+=1;break}}return[e.getParentOrThrow(),l]}}function Od(n,e){const t=[];let r=e;for(;r!==n&&r!==null;r=r.parentNode){let i=0;for(let s=r.previousSibling;s!==null;s=s.previousSibling)i++;t.push(i)}return r!==n&&F(225),t.reverse()}class be extends Kt{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return cy[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const e=ie()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;t!==null;){if(I(t)&&e.push(t),O(t)){const r=t.getAllTextNodes();e.push(...r)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;O(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;O(e);){const t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),r=t.length;if(e>=r){const s=t[r-1];return O(s)&&s.getLastDescendant()||s||null}const i=t[e];return O(i)&&i.getFirstDescendant()||i||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:Y(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&F(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:Y(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&F(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let r,i;if(e<t/2){for(r=this.getFirstChild(),i=0;r!==null&&i<=e;){if(i===e)return r;r=r.getNextSibling(),i++}return null}for(r=this.getLastChild(),i=t-1;r!==null&&i>=e;){if(i===e)return r;r=r.getPreviousSibling(),i--}return null}getTextContent(){let e="";const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const s=t[i];e+=s.getTextContent(),O(s)&&i!==r-1&&!s.isInline()&&(e+=jo)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const s=t[i];e+=s.getTextContentSize(),O(s)&&i!==r-1&&!s.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==""){const t=Zu[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){const t=Ue[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return So(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){Oe();const r=M();let i=e,s=t;const o=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const a=this.getFirstChild();if(I(a)||O(a))return a.select(0,0)}else if(!(e!==void 0&&e!==o||t!==void 0&&t!==o)){const a=this.getLastChild();if(I(a)||O(a))return a.select()}}i===void 0&&(i=o),s===void 0&&(s=o);const l=this.__key;return N(r)?(r.anchor.set(l,i,"element"),r.focus.set(l,s,"element"),r.dirty=!0,r):hg(l,i,l,s,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach(t=>t.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==""?Zu[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,r){po(this)&&F(324,this.__key,this.__type);const i=this.getChildrenSize(),s=this.getWritable();e+t<=i||F(226,String(e),String(t),String(i));const o=s.__key,l=[],a=[],c=this.getChildAtIndex(e+t);let u=null,d=i-t+r.length;if(e!==0)if(e===i)u=this.getLastChild();else{const h=this.getChildAtIndex(e);h!==null&&(u=h.getPreviousSibling())}if(t>0){let h=u===null?this.getFirstChild():u.getNextSibling();for(let g=0;g<t;g++){h===null&&F(100);const p=h.getNextSibling(),m=h.__key;jt(h.getWritable()),a.push(m),h=p}}let f=u;for(const h of r){f!==null&&h.is(f)&&(u=f=f.getPreviousSibling());const g=h.getWritable();g.__parent===o&&d--,jt(g);const p=h.__key;if(f===null)s.__first=p,g.__prev=null;else{const m=f.getWritable();m.__next=p,g.__prev=m.__key}h.__key===o&&F(76),g.__parent=o,l.push(p),f=h}if(e+t===i)f!==null&&(f.getWritable().__next=null,s.__last=f.__key);else if(c!==null){const h=c.getWritable();if(f!==null){const g=f.getWritable();h.__prev=f.__key,g.__next=c.__key}else h.__prev=null}if(s.__size=d,a.length){const h=M();if(N(h)){const g=new Set(a),p=new Set(l),{anchor:m,focus:b}=h;Md(m,g,p)&&xo(m,m.getNode(),this,u,c),Md(b,g,p)&&xo(b,b.getNode(),this,u,c),d!==0||this.canBeEmpty()||We(this)||this.remove()}}return s}getDOMSlot(e){return new Wi(e)}exportDOM(e){const{element:t}=super.exportDOM(e);if(re(t)){const r=this.getIndent();r>0&&(t.style.paddingInlineStart=40*r+"px");const i=this.getDirection();i&&(t.dir=i)}return{element:t}}exportJSON(){const e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),r=this.getTextStyle();return t===0&&r===""||We(this)||this.getChildren().some(I)||(t!==0&&(e.textFormat=t),r!==""&&(e.textStyle=r)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,r){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){const r=this.getDOMSlot(e);let i=r.getFirstChild();for(let s=this.getFirstChild();s;s=s.getNextSibling()){const o=t.getElementByKey(s.getKey());o!==null&&(i==null?(r.insertChild(o),i=o):i!==o&&r.replaceChild(o,i),i=i.nextSibling)}}}function O(n){return n instanceof be}function Md(n,e,t){let r=n.getNode();for(;r;){const i=r.__key;if(e.has(i)&&!t.has(i))return!0;r=r.getParent()}return!1}class xs extends Kt{decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function V(n){return n instanceof xs}class wr extends be{__cachedText;static getType(){return"root"}static clone(){return new wr}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){F(51)}getTextContent(){const e=this.__cachedText;return!Cr()&&ie()._dirtyType!==0||e===null?super.getTextContent():e}remove(){F(52)}replace(e){F(53)}insertBefore(e){F(54)}insertAfter(e){F(55)}updateDOM(e,t){return!1}splice(e,t,r){for(const i of r)O(i)||V(i)||F(282);return super.splice(e,t,r)}static importJSON(e){return fe().updateFromJSON(e)}collapseAtStart(){return!0}}function ye(n){return n instanceof wr}function bg(n){return new Ss(new Map(n._nodeMap))}function Kc(){return new Ss(new Map([["root",new wr]]))}function xg(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&F(130,t.name),O(n)){const r=e.children;Array.isArray(r)||F(59,t.name);const i=n.getChildren();for(let s=0;s<i.length;s++){const o=xg(i[s]);r.push(o)}}return e}function Sg(n){return n instanceof Ss}class Ss{_nodeMap;_selection;_flushSync;_readOnly;constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return Nd(t&&t.editor||null,this,e)}clone(e){const t=new Ss(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return Nd(null,this,()=>({root:xg(fe())}))}}class rl extends be{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class vr extends be{static getType(){return"paragraph"}static clone(e){return new vr(e.__key)}createDOM(e){const t=document.createElement("p"),r=Jr(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:Hy,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(re(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r)}return{element:t}}static importJSON(e){return H().updateFromJSON(e)}exportJSON(){const e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){const t=this.getChildren().find(I);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){const r=H();r.setTextFormat(e.format),r.setTextStyle(e.style);const i=this.getDirection();return r.setDirection(i),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,t),r}collapseAtStart(){const e=this.getChildren();if(e.length===0||I(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function Hy(n){const e=H();return n.style&&(e.setFormat(n.style.textAlign),cl(n,e)),{node:e}}function H(){return Le(new vr)}function Er(n){return n instanceof vr}const B=0,G=1,Cg=2,wg=3,Wc=4;function vg(n,e,t,r){const i=n._keyToDOMMap;i.clear(),n._editorState=Kc(),n._pendingEditorState=r,n._compositionKey=null,n._dirtyType=0,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),n._normalizedNodes=new Set,n._updateTags=new Set,n._updates=[],n._blockCursorElement=null;const s=n._observer;s!==null&&(s.disconnect(),n._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",i.set("root",t))}function Eg(n){const e=new Set,t=new Set;let r=n;for(;r;){const{ownNodeConfig:i}=vs(r),s=r.transform;if(!t.has(s)){t.add(s);const o=r.transform();o&&e.add(o)}if(i){const o=i.$transform;o&&e.add(o),r=i.extends}else{const o=Object.getPrototypeOf(r);r=o.prototype instanceof Kt&&o!==Kt?o:void 0}}return e}function fi(n){const e=n||{},t=jy(),r=e.theme||{},i=n===void 0?t:e.parentEditor||null,s=e.disableEvents||!1,o=Kc(),l=e.namespace||(i!==null?i._config.namespace:Ig()),a=e.editorState,c=[wr,qe,br,xr,vr,rl,...e.nodes||[]],{onError:u,html:d}=e,f=e.editable===void 0||e.editable;let h;if(n===void 0&&t!==null)h=t._nodes;else{h=new Map;for(let p=0;p<c.length;p++){let m=c[p],b=null,_=null;if(typeof m!="function"){const S=m;m=S.replace,b=S.with,_=S.withKlass||null}vs(m);const y=m.getType(),C=Eg(m);h.set(y,{exportDOM:d&&d.export?d.export.get(m):void 0,klass:m,replace:b,replaceWithKlass:_,sharedNodeState:zh(c[p]),transforms:C})}}const g=new Zr(o,i,h,{disableEvents:s,namespace:l,theme:r},u||console.error,(function(p,m){const b=new Map,_=new Set,y=C=>{Object.keys(C).forEach(S=>{let x=b.get(S);x===void 0&&(x=[],b.set(S,x)),x.push(C[S])})};return p.forEach(C=>{const S=C.klass.importDOM;if(S==null||_.has(S))return;_.add(S);const x=S.call(C.klass);x!==null&&y(x)}),m&&y(m),b})(h,d?d.import:void 0),f,n);return a!==void 0&&(g._pendingEditorState=a,g._dirtyType=2),(function(p){p.registerCommand(Ac,vy,B),p.registerCommand(Oc,Ey,B),p.registerCommand(Mc,ky,B),p.registerCommand($c,Ty,B),p.registerCommand(Ic,Ny,B)})(g),g}class Zr{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(e,t,r,i,s,o,l,a){this._createEditorArgs=a,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=i,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Ig(),this._onError=s,this._htmlConversions=o,this._editable=l,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,r){r===void 0&&F(35);const i=this._commands;i.has(e)||i.set(e,[new Set,new Set,new Set,new Set,new Set]);const s=i.get(e);s===void 0&&F(36,String(e));const o=s[r];return o.add(t),()=>{o.delete(t),s.every(l=>l.size===0)&&i.delete(e)}}registerMutationListener(e,t,r){const i=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,s=this._listeners.mutation;let o=s.get(t);o===void 0&&(o=new Set,s.set(t,o)),o.add(i);const l=r&&r.skipInitialization;return l!==void 0&&l||this.initializeMutationListener(t,i),()=>{o.delete(i),o.size===0&&s.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&F(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const r=this._editorState,i=Ya(r).get(t.getType());if(!i)return;const s=new Map;for(const o of i.keys())s.set(o,"created");s.size>0&&e(s,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const r=this.getRegisteredNode(e);return r.transforms.add(t),r}registerNodeTransform(e,t){const r=this.registerNodeTransformToKlass(e,t),i=[r],s=r.replaceWithKlass;if(s!=null){const o=this.registerNodeTransformToKlass(s,t);i.push(o)}return(function(o,l){const a=Ya(o.getEditorState()),c=[];for(const u of l){const d=a.get(u);d&&c.push(d)}c.length!==0&&o.update(()=>{for(const u of c)for(const d of u.keys()){const f=Y(d);f&&f.markDirty()}},o._pendingEditorState===null?{tag:Hr}:void 0)})(this,i.map(o=>o.klass.getType())),()=>{i.forEach(o=>o.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return L(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const r=Jr(this._config.theme,"root"),i=this._pendingEditorState||this._editorState;if(this._rootElement=e,vg(this,t,e,i),t!==null&&(this._config.disableEvents||Ay(t),r!=null&&t.classList.remove(...r)),e!==null){const s=tu(e),o=e.style;o.userSelect="text",o.whiteSpace="pre-wrap",o.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=s,this._dirtyType=2,Bh(this),this._updateTags.add(Hr),nn(this),this._config.disableEvents||(function(l,a){const c=l.ownerDocument;za.set(l,c);const u=ho.get(c)??0;u<1&&c.addEventListener("selectionchange",rg),ho.set(c,u+1),l.__lexicalEditor=a;const d=ng(l);for(let f=0;f<Ba.length;f++){const[h,g]=Ba[f],p=typeof g=="function"?m=>{fd(m)||(dd(m),(a.isEditable()||h==="click")&&g(m,a))}:m=>{if(fd(m))return;dd(m);const b=a.isEditable();switch(h){case"cut":return b&&L(a,ci,m);case"copy":return L(a,yr,m);case"paste":return b&&L(a,si,m);case"dragstart":return b&&L(a,Xo,m);case"dragover":return b&&L(a,Dc,m);case"dragend":return b&&L(a,Gh,m);case"focus":return b&&L(a,Rc,m);case"blur":return b&&L(a,ui,m);case"drop":return b&&L(a,Zo,m)}};l.addEventListener(h,p),d.push(()=>{l.removeEventListener(h,p)})}})(e,this),r!=null&&e.classList.add(...r)}else this._window=null,this._updateTags.add(Hr),nn(this);Ki("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&F(38);let r=e;r._readOnly&&(r=bg(e),r._selection=e._selection?e._selection.clone():null),Ph(this);const i=this._pendingEditorState,s=this._updateTags,o=t!==void 0?t.tag:null;i===null||i.isEmpty()||(o!=null&&s.add(o),nn(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,o!=null&&s.add(o),this._updating||nn(this)}parseEditorState(e,t){return(function(r,i,s){const o=Kc(),l=$e,a=it,c=Ie,u=i._dirtyElements,d=i._dirtyLeaves,f=i._cloneNotNeeded,h=i._dirtyType;i._dirtyElements=new Map,i._dirtyLeaves=new Set,i._cloneNotNeeded=new Set,i._dirtyType=0,$e=o,it=!1,Ie=i,jc(null);try{const g=i._nodes;Uc(r.root,g),s&&s(),o._readOnly=!0}catch(g){g instanceof Error&&i._onError(g)}finally{i._dirtyElements=u,i._dirtyLeaves=d,i._cloneNotNeeded=f,i._dirtyType=h,$e=l,it=a,Ie=c}return o})(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return nn(this),this.getEditorState().read(e,{editor:this})}update(e,t){(function(r,i,s){r._updating?r._updates.push([i,s]):nl(r,i,s)})(this,e,t)}focus(e,t={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),Wt(this,()=>{const i=M(),s=fe();i!==null?i.dirty||Fe(i.clone()):s.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?s.selectStart():s.selectEnd()),Rg("focus"),Pg(()=>{r.removeAttribute("autocapitalize"),e&&e()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=Et(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Ki("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}Zr.version="0.40.0+prod.esm";let Ga=null;function jc(n){Ga=n}let kg=1;function Jy(){kg=1}function Hc(n,e){const t=il(n,e);return t===void 0&&F(30,e),t}function il(n,e){return n._nodes.get(e)}const Gy=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function Tg(n){return V(gt(n))}function sl(n){const e=document.activeElement;if(!re(e))return!1;const t=e.nodeName;return V(gt(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&Cs(e)==null)}function hi(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!sl(e)&&ll(e)===n}catch{return!1}}function ol(n){return n instanceof Zr}function ll(n){let e=n;for(;e!=null;){const t=Cs(e);if(ol(t))return t;e=ws(e)}return null}function Cs(n){return n?n.__lexicalEditor:null}function Ng(n){return oy.test(n)?"rtl":ly.test(n)?"ltr":null}function On(n){return Je(n)||n.isToken()}function Tt(n){return On(n)||n.isSegmented()}function qt(n){return jn(n)&&n.nodeType===3}function Jc(n){return jn(n)&&n.nodeType===9}function ur(n){let e=n;for(;e!=null;){if(qt(e))return e;e=e.firstChild}return null}function So(n,e,t){const r=Ue[e];if(t!==null&&(n&r)===(t&r))return n;let i=n^r;return e==="subscript"?i&=~Ue.superscript:e==="superscript"?i&=~Ue.subscript:e==="lowercase"?(i&=~Ue.uppercase,i&=~Ue.capitalize):e==="uppercase"?(i&=~Ue.lowercase,i&=~Ue.capitalize):e==="capitalize"&&(i&=~Ue.lowercase,i&=~Ue.uppercase),i}function Gc(n){return I(n)||ue(n)||V(n)}function Ag(n,e){const t=(function(){const o=Ga;return Ga=null,o})();if((e=e||t&&t.__key)!=null)return void(n.__key=e);Oe(),pg();const r=ie(),i=xn(),s=""+kg++;i._nodeMap.set(s,n),O(n)?r._dirtyElements.set(s,!0):r._dirtyLeaves.add(s),r._cloneNotNeeded.add(s),r._dirtyType=1,n.__key=s}function jt(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),i=n.getPreviousSibling(),s=n.getNextSibling(),o=s!==null?s.__key:null,l=i!==null?i.__key:null,a=i!==null?i.getWritable():null,c=s!==null?s.getWritable():null;i===null&&(r.__first=o),s===null&&(r.__last=l),a!==null&&(a.__next=o),c!==null&&(c.__prev=l),t.__prev=null,t.__next=null,t.__parent=null,r.__size--}}function Co(n){pg(),po(n)&&F(323,n.__key,n.__type);const e=n.getLatest(),t=e.__parent,r=xn(),i=ie(),s=r._nodeMap,o=i._dirtyElements;t!==null&&(function(a,c,u){let d=a;for(;d!==null;){if(u.has(d))return;const f=c.get(d);if(f===void 0)break;u.set(d,!1),d=f.__parent}})(t,s,o);const l=e.__key;i._dirtyType=1,O(n)?o.set(l,!0):i._dirtyLeaves.add(l)}function Me(n){Oe();const e=ie(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){const r=Y(t);r!==null&&r.getWritable()}if(n!==null){const r=Y(n);r!==null&&r.getWritable()}}}function kn(){return Cr()?null:ie()._compositionKey}function Y(n,e){const t=(e||xn())._nodeMap.get(n);return t===void 0?null:t}function Vc(n,e){const t=al(n,ie());return t!==void 0?Y(t,e):null}function al(n,e){return n[`__lexicalKey_${e._key}`]}function gt(n,e){let t=n;for(;t!=null;){const r=Vc(t,e);if(r!==null)return r;t=ws(t)}return null}function Og(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function $d(n){return n.read(()=>fe().getTextContent())}function fe(){return Mg(xn())}function Mg(n){return n._nodeMap.get("root")}function Fe(n){Oe();const e=xn();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function Wr(n){const e=ie(),t=(function(r,i){let s=r;for(;s!=null;){const o=al(s,i);if(o!==void 0)return o;s=ws(s)}return null})(n,e);return t===null?n===e.getRootElement()?Y("root"):null:Y(t)}function $g(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function Yc(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function Ig(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function Fg(n){return qt(n)?n.nodeValue:null}function qc(n,e,t){const r=Et(vt(e));if(r===null)return;const i=r.anchorNode;let{anchorOffset:s,focusOffset:o}=r;if(i!==null){let l=Fg(i);const a=gt(i);if(l!==null&&I(a)){if(l===Wo&&t){const c=t.length;l=t,s=c,o=c}l!==null&&Zc(a,l,s,o,n)}}}function Zc(n,e,t,r,i){let s=n;if(s.isAttached()&&(i||!s.isDirty())){const o=s.isComposing();let l=e;(o||i)&&e[e.length-1]===Wo&&(l=e.slice(0,-1));const a=s.getTextContent();if(i||l!==a){if(l===""){if(Me(null),ms||ri||_s)s.remove();else{const p=ie();setTimeout(()=>{p.update(()=>{s.isAttached()&&s.remove()})},20)}return}const c=s.getParent(),u=bn(),d=s.getTextContentSize(),f=kn(),h=s.getKey();if(s.isToken()||f!==null&&h===f&&!o||N(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===n.__key&&u.anchor.offset===0&&!s.canInsertTextBefore()&&!o||u.focus.key===n.__key&&u.focus.offset===d&&!s.canInsertTextAfter()&&!o))return void s.markDirty();const g=M();if(!N(g)||t===null||r===null)return void Id(s,l,g);if(g.setTextNodeRange(s,t,s,r),s.isSegmented()){const p=de(s.getTextContent());s.replace(p),s=p}Id(s,l,g)}}}function Id(n,e,t){if(n.setTextContent(e),N(t)){const r=n.getKey();for(const i of["anchor","focus"]){const s=t[i];s.type==="text"&&s.key===r&&(s.offset=$t(n,s.offset,"clamp"))}}}function Ds(n,e,t){const r=e[t]||!1;return r==="any"||r===n[t]}function Dg(n,e){return Ds(n,e,"altKey")&&Ds(n,e,"ctrlKey")&&Ds(n,e,"shiftKey")&&Ds(n,e,"metaKey")}function te(n,e,t){return Dg(n,t)&&n.key.toLowerCase()===e.toLowerCase()}const tn={ctrlKey:!Nt,metaKey:Nt},Fd={altKey:Nt,ctrlKey:!Nt};function Dd(n){return n.key==="Backspace"}function Ld(n){return te(n,"a",tn)}function Xc(n){const e=fe();if(N(n)){const t=n.anchor,r=n.focus,i=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(i.getKey(),0,"element"),r.set(i.getKey(),i.getChildrenSize(),"element"),In(n),n}{const t=e.select(0,e.getChildrenSize());return Fe(In(t)),t}}function Jr(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});const t=n.__lexicalClassNameCache,r=t[e];if(r!==void 0)return r;const i=n[e];if(typeof i=="string"){const s=hn(i);return t[e]=s,s}return i}function Qc(n,e,t,r,i){if(t.size===0)return;const s=r.__type,o=r.__key,l=e.get(s);l===void 0&&F(33,s);const a=l.klass;let c=n.get(a);c===void 0&&(c=new Map,n.set(a,c));const u=c.get(o),d=u==="destroyed"&&i==="created";(u===void 0||d)&&c.set(o,d?"updated":i)}function Vy(n){const e=n.getType(),t=xn();if(t._readOnly){const s=Ya(t).get(e);return s?Array.from(s.values()):[]}const r=t._nodeMap,i=[];for(const[,s]of r)s instanceof n&&s.__type===e&&s.isAttached()&&i.push(s);return i}function Rd(n,e,t){const r=n.getParent();let i=t,s=n;return r!==null&&(e&&t===0?(i=s.getIndexWithinParent(),s=r):e||t!==s.getChildrenSize()||(i=s.getIndexWithinParent()+1,s=r)),s.getChildAtIndex(e?i-1:i)}function wo(n,e){const t=n.offset;if(n.type==="element")return Rd(n.getNode(),e,t);{const r=n.getNode();if(e&&t===0||!e&&t===r.getTextContentSize()){const i=e?r.getPreviousSibling():r.getNextSibling();return i===null?Rd(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):i}}return null}function Lg(n){const e=vt(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function L(n,e,t){return(function(r,i,s){const o=Yc(r);for(let l=4;l>=0;l--)for(let a=0;a<o.length;a++){const c=o[a],u=c._commands.get(i);if(u!==void 0){const d=u[l];if(d!==void 0){const f=Array.from(d),h=f.length;let g=!1;if(Wt(c,()=>{for(let p=0;p<h;p++)if(f[p](s,r))return void(g=!0)}),g)return g}}}return!1})(n,e,t)}function dr(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&F(75,e),t}function ws(n){const e=n.assignedSlot||n.parentElement;return Eo(e)?e.host:e}function eu(n){return Jc(n)?n:re(n)?n.ownerDocument:null}function Yy(n){return ie()._updateTags.has(n)}function Rg(n){Oe(),ie()._updateTags.add(n)}function Pg(n){Oe(),ie()._deferred.push(n)}function vo(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function tu(n){const e=eu(n);return e?e.defaultView:null}function vt(n){const e=n._window;return e===null&&F(78),e}function Bg(n){return O(n)&&n.isInline()||V(n)&&n.isInline()}function zg(n){let e=n.getParentOrThrow();for(;e!==null;){if(We(e))return e;e=e.getParentOrThrow()}return e}function We(n){return ye(n)||O(n)&&n.isShadowRoot()}function nu(n){const e=n.constructor.clone(n);return Ag(e,null),e.afterCloneFrom(n),e}function Le(n){const e=ie(),t=n.getType(),r=il(e,t);r===void 0&&F(200,n.constructor.name,t);const{replace:i,replaceWithKlass:s}=r;if(i!==null){const o=i(n),l=o.constructor;return s!==null?o instanceof s||F(201,s.name,s.getType(),l.name,l.getType(),n.constructor.name,t):o instanceof n.constructor&&l!==n.constructor||F(202,l.name,l.getType(),n.constructor.name,t),o.__key===n.__key&&F(203,n.constructor.name,t,l.name,l.getType()),o}return n}function ta(n,e){!ye(n.getParent())||O(e)||V(e)||F(99)}function Xn(n){const e=Y(n);return e===null&&F(63,n),e}function na(n){return(V(n)||O(n)&&!n.canBeEmpty())&&!n.isInline()}function Va(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function Et(n){return Lt?(n||window).getSelection():null}function Ug(n){const e=tu(n);return e?e.getSelection():null}function qy(n,e){let t=n.getChildAtIndex(e);t==null&&(t=n),We(n)&&F(102);const r=o=>{const l=o.getParentOrThrow(),a=We(l),c=o!==t||a?nu(o):o;if(a)return O(o)&&O(c)||F(133),o.insertAfter(c),[o,c,c];{const[u,d,f]=r(l),h=o.getNextSiblings();return f.append(c,...h),[u,d,c]}},[i,s]=r(t);return[i,s]}function ru(n){return re(n)&&n.tagName==="A"}function re(n){return jn(n)&&n.nodeType===1}function jn(n){return typeof n=="object"&&n!==null&&"nodeType"in n&&typeof n.nodeType=="number"}function Eo(n){return jn(n)&&n.nodeType===11}function ko(n){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return n.nodeName.match(e)!==null}function ts(n){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return n.nodeName.match(e)!==null}function dt(n){if(V(n)&&!n.isInline())return!0;if(!O(n)||We(n))return!1;const e=n.getFirstChild(),t=e===null||ue(e)||I(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function gi(){return ie()}const Pd=new WeakMap,Zy=new Map;function Ya(n){if(!n._readOnly&&n.isEmpty())return Zy;n._readOnly||F(192);let e=Pd.get(n);return e||(e=(function(t){const r=new Map;for(const[i,s]of t._nodeMap){const o=s.__type;let l=r.get(o);l||(l=new Map,r.set(o,l)),l.set(i,s)}return r})(n),Pd.set(n,e)),e}function iu(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function Kg(n){return(e=iu(n))[ig]=!0,e;var e}function cl(n,e){const t=parseInt(n.style.paddingInlineStart,10)||0,r=Math.round(t/40);e.setIndent(r)}function Wg(n){n.__lexicalUnmanaged=!0}function jg(n){return n.__lexicalUnmanaged===!0}function Ni(n,e){return(function(t,r){return Object.prototype.hasOwnProperty.call(t,r)})(n,e)&&n[e]!==Kt[e]}function vs(n){const e=Xu in n.prototype?n.prototype[Xu]():void 0,t=(function(o){if(!(o===Kt||o.prototype instanceof Kt)){let l="<unknown>",a="<unknown>";try{l=o.getType()}catch{}try{Zr.version&&(a=JSON.parse(Zr.version))}catch{}F(290,o.name,l,a)}return o===xs||o===be||o===Kt})(n),r=!t&&Ni(n,"getType")?n.getType():void 0;let i,s=r;if(e)if(r)i=e[r];else for(const[o,l]of Object.entries(e))s=o,i=l;if(!t&&s&&(Ni(n,"getType")||(n.getType=()=>s),Ni(n,"clone")||(n.clone=o=>(jc(o),new n)),Ni(n,"importJSON")||(n.importJSON=i&&i.$importJSON||(o=>new n().updateFromJSON(o))),!Ni(n,"importDOM")&&i)){const{importDOM:o}=i;o&&(n.importDOM=()=>o)}return{ownNodeConfig:i,ownNodeType:s}}function Hg(n){const e=gi();return Oe(),new(e.resolveRegisteredNodeAfterReplacements(e.getRegisteredNode(n))).klass}const oe=(n,e)=>{let t=n;for(;t!=null&&!ye(t);){if(e(t))return t;t=t.getParent()}return null},Xy={next:"previous",previous:"next"};class ul{origin;constructor(e){this.origin=e}[Symbol.iterator](){return fl({hasNext:Ln,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return _e(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return _e(this.origin,this.direction)}remove(){const e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){const r=this.getNodeAtCaret();return e.is(this.origin)||e.is(r)||(r===null?this.insert(e):r.replace(e,t)),this}splice(e,t,r="next"){const i=r===this.direction?t:Array.from(t).reverse();let s=this;const o=this.getParentAtCaret(),l=new Map;for(let a=s.getAdjacentCaret();a!==null&&l.size<e;a=a.getAdjacentCaret()){const c=a.origin.getWritable();l.set(c.getKey(),c)}for(const a of i){if(l.size>0){const c=s.getNodeAtCaret();if(c){if(l.delete(c.getKey()),l.delete(a.getKey()),!(c.is(a)||s.origin.is(a))){const u=a.getParent();u&&u.is(o)&&a.remove(),c.replace(a)}}else c===null&&F(263,Array.from(l).join(" "))}else s.insert(a);s=_e(a,this.direction)}for(const a of l.values())a.remove();return this}}class ns extends ul{type="child";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:lt(e,this.direction)}getParentCaret(e="root"){return _e(su(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=Hn(this.direction);return _e(this.getNodeAtCaret(),e)||lt(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof ns&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}const Qy={root:ye,shadowRoot:We};function Hn(n){return Xy[n]}function su(n,e="root"){return Qy[e](n)?null:n}class fr extends ul{type="sibling";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:_e(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return O(this.origin)?lt(this.origin,this.direction):null}getParentCaret(e="root"){return _e(su(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=Hn(this.direction);return _e(this.getNodeAtCaret(),e)||lt(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof fr&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof fr||e instanceof hr)&&this.direction===e.direction&&this.origin.is(e.origin)}}class hr extends ul{type="text";offset;constructor(e,t){super(e),this.offset=t}getLatest(){const e=this.origin.getLatest();return e===this.origin?this:fn(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return _e(su(this.getParentAtCaret(),e),this.direction)}getFlipped(){return fn(this.origin,Hn(this.direction),this.offset)}isSamePointCaret(e){return e instanceof hr&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof fr||e instanceof hr)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return _e(this.origin,this.direction)}}function Mt(n){return n instanceof hr}function eb(n){return n instanceof ul}function Ln(n){return n instanceof fr}function ht(n){return n instanceof ns}const tb={next:class extends hr{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(n){return this.origin.insertAfter(n),this}},previous:class extends hr{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(n){return this.origin.insertBefore(n),this}}},nb={next:class extends fr{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(n){return this.origin.insertAfter(n),this}},previous:class extends fr{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(n){return this.origin.insertBefore(n),this}}},rb={next:class extends ns{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(n){return this.origin.splice(0,0,[n]),this}},previous:class extends ns{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(n){return this.origin.splice(this.origin.getChildrenSize(),0,[n]),this}}};function _e(n,e){return n?new nb[e](n):null}function fn(n,e,t){return n?new tb[e](n,$t(n,t)):null}function $t(n,e,t="error"){const r=n.getTextContentSize();let i=e==="next"?r:e==="previous"?0:e;return(i<0||i>r)&&(t!=="clamp"&&$h(284,String(e),String(r),n.getKey()),i=i<0?0:r),i}function qa(n,e){return new Gg(n,e)}function lt(n,e){return O(n)?new rb[e](n):null}function Jg(n){return n&&n.getChildCaret()||n}function gr(n){return n&&Jg(n.getAdjacentCaret())}class ou{type="node-caret-range";direction;anchor;focus;constructor(e,t,r){this.anchor=e,this.focus=t,this.direction=r}getLatest(){const e=this.anchor.getLatest(),t=this.focus.getLatest();return e===this.anchor&&t===this.focus?this:new ou(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const e=i=>{const s=this[i].getLatest();return Mt(s)?(function(o,l){const{direction:a,origin:c}=o,u=$t(c,l==="focus"?Hn(a):a);return qa(o,u-o.offset)})(s,i):null},t=e("anchor"),r=e("focus");if(t&&r){const{caret:i}=t,{caret:s}=r;if(i.isSameNodeCaret(s))return[qa(i,s.offset-i.offset),null]}return[t,r]}iterNodeCarets(e="root"){const t=Mt(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),i=Mt(r),s=o=>o.isSameNodeCaret(r)?null:gr(o)||o.getParentCaret(e);return fl({hasNext:o=>o!==null&&!(i&&r.isSameNodeCaret(o)),initial:t.isSameNodeCaret(r)?null:s(t),map:o=>o,step:s})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class Gg{type="slice";caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){const{distance:e,caret:{offset:t}}=this,r=t+e;return r<t?[r,t]:[t,r]}getTextContent(){const[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:e,direction:t}}=this,[r,i]=this.getSliceIndices(),s=e.getTextContent();return fn(e.setTextContent(s.slice(0,r)+s.slice(i)),t,r)}}function ib(n){return n instanceof Gg}function dl(n){return Vt(n,_e(fe(),n.direction))}function lu(n){return Vt(n,n)}function Vt(n,e){return n.direction!==e.direction&&F(265),new ou(n,e,n.direction)}function fl(n){const{initial:e,hasNext:t,step:r,map:i}=n;let s=e;return{[Symbol.iterator](){return this},next(){if(!t(s))return{done:!0,value:void 0};const o={done:!1,value:i(s)};return s=r(s),o}}}function au(n,e){const t=ji(n.origin,e.origin);switch(t===null&&F(275,n.origin.getKey(),e.origin.getKey()),t.type){case"same":{const r=n.type==="text",i=e.type==="text";return r&&i?(function(s,o){return Math.sign(s-o)})(n.offset,e.offset):n.type===e.type?0:r?-1:i?1:n.type==="child"?-1:1}case"ancestor":return n.type==="child"?-1:1;case"descendant":return e.type==="child"?1:-1;case"branch":return cu(t)}}function cu(n){const{a:e,b:t}=n,r=e.__key,i=t.__key;let s=e,o=t;for(;s&&o;s=s.getNextSibling(),o=o.getNextSibling()){if(s.__key===i)return-1;if(o.__key===r)return 1}return s===null?1:-1}function Ls(n,e){return e.is(n)}function Bd(n){return O(n)?[n.getLatest(),null]:[n.getParent(),n.getLatest()]}function ji(n,e){if(n.is(e))return{commonAncestor:n,type:"same"};const t=new Map;for(let[r,i]=Bd(n);r;i=r,r=r.getParent())t.set(r,i);for(let[r,i]=Bd(e);r;i=r,r=r.getParent()){const s=t.get(r);if(s!==void 0)return s===null?(Ls(n,r)||F(276),{commonAncestor:r,type:"ancestor"}):i===null?(Ls(e,r)||F(277),{commonAncestor:r,type:"descendant"}):((O(s)||Ls(n,s))&&(O(i)||Ls(e,i))&&r.is(s.getParent())&&r.is(i.getParent())||F(278),{a:s,b:i,commonAncestor:r,type:"branch"})}return null}function Dt(n,e){const{type:t,key:r,offset:i}=n,s=Xn(n.key);return t==="text"?(I(s)||F(266,s.getType(),r),fn(s,e,i)):(O(s)||F(267,s.getType(),r),Yg(s,n.offset,e))}function Rn(n,e){const{origin:t,direction:r}=e,i=r==="next";Mt(e)?n.set(t.getKey(),e.offset,"text"):Ln(e)?I(t)?n.set(t.getKey(),$t(t,r),"text"):n.set(t.getParentOrThrow().getKey(),t.getIndexWithinParent()+(i?1:0),"element"):(ht(e)&&O(t)||F(268),n.set(t.getKey(),i?0:t.getChildrenSize(),"element"))}function hl(n){const e=M(),t=N(e)?e:di();return Hi(t,n),Fe(t),t}function Hi(n,e){Rn(n.anchor,e.anchor),Rn(n.focus,e.focus)}function To(n){const{anchor:e,focus:t}=n,r=Dt(e,"next"),i=Dt(t,"next"),s=au(r,i)<=0?"next":"previous";return Vt(Yt(r,s),Yt(i,s))}function pi(n){const{direction:e,origin:t}=n,r=_e(t,Hn(e)).getNodeAtCaret();return r?_e(r,e):lt(t.getParentOrThrow(),e)}function zd(n,e="root"){const t=[n];for(let r=ht(n)?n.getParentCaret(e):n.getSiblingCaret();r!==null;r=r.getParentCaret(e))t.push(pi(r));return t}function ra(n){return!!n&&n.origin.isAttached()}function Vg(n,e="removeEmptySlices"){if(n.isCollapsed())return n;const t="root",r="next";let i=e;const s=gl(n,r),o=zd(s.anchor,t),l=zd(s.focus.getFlipped(),t),a=new Set,c=[];for(const g of s.iterNodeCarets(t))if(ht(g))a.add(g.origin.getKey());else if(Ln(g)){const{origin:p}=g;O(p)&&!a.has(p.getKey())||c.push(p)}for(const g of c)g.remove();for(const g of s.getTextSlices()){if(!g)continue;const{origin:p}=g.caret,m=p.getTextContentSize(),b=pi(_e(p,r)),_=p.getMode();if(Math.abs(g.distance)===m&&i==="removeEmptySlices"||_==="token"&&g.distance!==0)b.remove();else if(g.distance!==0){i="removeEmptySlices";let y=g.removeTextSlice();const C=g.caret.origin;if(_==="segmented"){const S=y.origin,x=de(S.getTextContent()).setStyle(S.getStyle()).setFormat(S.getFormat());b.replaceOrInsert(x),y=fn(x,r,y.offset)}C.is(o[0].origin)&&(o[0]=y),C.is(l[0].origin)&&(l[0]=y.getFlipped())}}let u,d;for(const g of o)if(ra(g)){u=et(g);break}for(const g of l)if(ra(g)){d=et(g);break}const f=(function(g,p,m){if(!g||!p)return null;const b=g.getParentAtCaret(),_=p.getParentAtCaret();if(!b||!_)return null;const y=b.getParents().reverse();y.push(b);const C=_.getParents().reverse();C.push(_);const S=Math.min(y.length,C.length);let x;for(x=0;x<S&&y[x]===C[x];x++);const k=(A,T)=>{let D;for(let P=x;P<A.length;P++){const $=A[P];if(We($))return;!D&&T($)&&(D=$)}return D},v=k(y,dt),E=v&&k(C,A=>m.has(A.getKey())&&dt(A));return v&&E?[v,E]:null})(u,d,a);if(f){const[g,p]=f;lt(g,"previous").splice(0,p.getChildren()),p.remove()}const h=[u,d,...o,...l].find(ra);if(h)return lu(Yt(et(h),n.direction));F(269,JSON.stringify(o.map(g=>g.origin.__key)))}function et(n){const e=(function(i){let s=i;for(;ht(s);){const o=gr(s);if(!ht(o))break;s=o}return s})(n.getLatest()),{direction:t}=e;if(I(e.origin))return Mt(e)?e:fn(e.origin,t,t);const r=e.getAdjacentCaret();return Ln(r)&&I(r.origin)?fn(r.origin,t,Hn(t)):e}function uu(n){return Mt(n)&&n.offset!==$t(n.origin,n.direction)}function Yt(n,e){return n.direction===e?n:n.getFlipped()}function gl(n,e){return n.direction===e?n:Vt(Yt(n.focus,e),Yt(n.anchor,e))}function Yg(n,e,t){let r=lt(n,"next");for(let i=0;i<e;i++){const s=r.getAdjacentCaret();if(s===null)break;r=s}return Yt(r,t)}function sb(n,e="root"){let t=0,r=n,i=gr(r);for(;i===null;){if(t--,i=r.getParentCaret(e),!i)return null;r=i,i=gr(r)}return i&&[i,t]}function ob(n){const{origin:e,offset:t,direction:r}=n;if(t===$t(e,r))return n.getSiblingCaret();if(t===$t(e,Hn(r)))return pi(n.getSiblingCaret());const[i]=e.splitText(t);return I(i)||F(281),Yt(_e(i,"next"),r)}function lb(n,e){return!0}function qg(n,{$copyElementNode:e=nu,$splitTextPointCaretNext:t=ob,rootMode:r="shadowRoot",$shouldSplit:i=lb}={}){if(Mt(n))return t(n);const s=n.getParentCaret(r);if(s){const{origin:o}=s;if(ht(n)&&(!o.canBeEmpty()||!i(o,"first")))return pi(s);const l=(function(a){const c=[];for(let u=a.getAdjacentCaret();u;u=u.getAdjacentCaret())c.push(u.origin);return c})(n);(l.length>0||o.canBeEmpty()&&i(o,"last"))&&s.insert(e(o).splice(0,0,l))}return s}function ab(n){return n}function Zg(...n){return n}function cb(n,e){return[n,e]}function ub(n){return n}function Xg(n,e){if(!e||n===e)return n;for(const t in e)if(n[t]!==e[t])return{...n,...e};return n}function hn(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}function pe(n,...e){const t=hn(...e);t.length>0&&n.classList.add(...t)}function un(n,...e){const t=hn(...e);t.length>0&&n.classList.remove(...t)}function pt(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}const db=Object.freeze(Object.defineProperty({__proto__:null,$addUpdateTag:Rg,$applyNodeReplacement:Le,$caretFromPoint:Dt,$caretRangeFromSelection:To,$cloneWithProperties:iu,$cloneWithPropertiesEphemeral:Kg,$comparePointCaretNext:au,$copyNode:nu,$create:Hg,$createLineBreakNode:ot,$createNodeSelection:zc,$createParagraphNode:H,$createPoint:Te,$createRangeSelection:di,$createRangeSelectionFromDom:zy,$createTabNode:St,$createTextNode:de,$extendCaretToRange:dl,$findMatchingParent:oe,$getAdjacentChildCaret:gr,$getAdjacentNode:wo,$getAdjacentSiblingOrParentSiblingCaret:sb,$getCaretInDirection:Yt,$getCaretRange:Vt,$getCaretRangeInDirection:gl,$getCharacterOffsets:_o,$getChildCaret:lt,$getChildCaretAtIndex:Yg,$getChildCaretOrSelf:Jg,$getCollapsedCaretRange:lu,$getCommonAncestor:ji,$getCommonAncestorResultBranchOrder:cu,$getEditor:gi,$getNearestNodeFromDOMNode:gt,$getNearestRootOrShadowRoot:zg,$getNodeByKey:Y,$getNodeByKeyOrThrow:Xn,$getNodeFromDOMNode:Vc,$getPreviousSelection:bn,$getRoot:fe,$getSelection:M,$getSiblingCaret:_e,$getState:Yi,$getStateChange:yy,$getTextContent:Ky,$getTextNodeOffset:$t,$getTextPointCaret:fn,$getTextPointCaretSlice:qa,$getWritableNodeState:Ho,$hasAncestor:vo,$hasUpdateTag:Yy,$insertNodes:tl,$isBlockElementNode:yo,$isChildCaret:ht,$isDecoratorNode:V,$isEditorState:Sg,$isElementNode:O,$isExtendableTextPointCaret:uu,$isInlineElementOrDecoratorNode:Bg,$isLeafNode:Gc,$isLineBreakNode:ue,$isNodeCaret:eb,$isNodeSelection:He,$isParagraphNode:Er,$isRangeSelection:N,$isRootNode:ye,$isRootOrShadowRoot:We,$isSiblingCaret:Ln,$isTabNode:Je,$isTextNode:I,$isTextPointCaret:Mt,$isTextPointCaretSlice:ib,$isTokenOrSegmented:Tt,$isTokenOrTab:On,$nodesOfType:Vy,$normalizeCaret:et,$normalizeSelection__EXPERIMENTAL:In,$onUpdate:Pg,$parseSerializedNode:yg,$removeTextFromCaretRange:Vg,$rewindSiblingCaret:pi,$selectAll:Xc,$setCompositionKey:Me,$setPointFromCaret:Rn,$setSelection:Fe,$setSelectionFromCaretRange:hl,$setState:Vs,$splitAtPointCaretNext:qg,$splitNode:qy,$updateRangeSelectionFromCaretRange:Hi,ArtificialNode__DO_NOT_USE:rl,BEFORE_INPUT_COMMAND:Ac,BLUR_COMMAND:ui,CAN_REDO_COMMAND:Ii,CAN_UNDO_COMMAND:Fi,CLEAR_EDITOR_COMMAND:Lc,CLEAR_HISTORY_COMMAND:Vh,CLICK_COMMAND:_r,COLLABORATION_TAG:og,COMMAND_PRIORITY_CRITICAL:Wc,COMMAND_PRIORITY_EDITOR:B,COMMAND_PRIORITY_HIGH:wg,COMMAND_PRIORITY_LOW:G,COMMAND_PRIORITY_NORMAL:Cg,COMPOSITION_END_COMMAND:$c,COMPOSITION_START_COMMAND:Mc,CONTROLLED_TEXT_INSERTION_COMMAND:An,COPY_COMMAND:yr,CUT_COMMAND:ci,DELETE_CHARACTER_COMMAND:Ot,DELETE_LINE_COMMAND:ar,DELETE_WORD_COMMAND:lr,DRAGEND_COMMAND:Gh,DRAGOVER_COMMAND:Dc,DRAGSTART_COMMAND:Xo,DROP_COMMAND:Zo,DecoratorNode:xs,ElementNode:be,FOCUS_COMMAND:Rc,FORMAT_ELEMENT_COMMAND:Fc,FORMAT_TEXT_COMMAND:Ce,HISTORIC_TAG:mo,HISTORY_MERGE_TAG:Hr,HISTORY_PUSH_TAG:sg,INDENT_CONTENT_COMMAND:Ut,INPUT_COMMAND:Oc,INSERT_LINE_BREAK_COMMAND:cn,INSERT_PARAGRAPH_COMMAND:Fn,INSERT_TAB_COMMAND:fo,INTERNAL_$isBlock:dt,IS_ALL_FORMATTING:X_,IS_BOLD:H_,IS_CODE:Y_,IS_HIGHLIGHT:Ec,IS_ITALIC:J_,IS_STRIKETHROUGH:G_,IS_SUBSCRIPT:q_,IS_SUPERSCRIPT:Z_,IS_UNDERLINE:V_,KEY_ARROW_DOWN_COMMAND:cr,KEY_ARROW_LEFT_COMMAND:ys,KEY_ARROW_RIGHT_COMMAND:Go,KEY_ARROW_UP_COMMAND:dn,KEY_BACKSPACE_COMMAND:Yo,KEY_DELETE_COMMAND:qo,KEY_DOWN_COMMAND:Ic,KEY_ENTER_COMMAND:Dn,KEY_ESCAPE_COMMAND:ai,KEY_MODIFIER_COMMAND:Yh,KEY_SPACE_COMMAND:Vo,KEY_TAB_COMMAND:bs,LineBreakNode:br,MOVE_TO_END:uo,MOVE_TO_START:Qi,NODE_STATE_KEY:fy,OUTDENT_CONTENT_COMMAND:sn,PASTE_COMMAND:si,PASTE_TAG:Pc,ParagraphNode:vr,REDO_COMMAND:li,REMOVE_TEXT_COMMAND:Xi,RootNode:wr,SELECTION_CHANGE_COMMAND:ii,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:Nc,SELECT_ALL_COMMAND:qr,SKIP_COLLAB_TAG:My,SKIP_DOM_SELECTION_TAG:ag,SKIP_SCROLL_INTO_VIEW_TAG:lg,SKIP_SELECTION_FOCUS_TAG:Ja,TEXT_TYPE_TO_FORMAT:Ue,TabNode:xr,TextNode:qe,UNDO_COMMAND:oi,addClassNamesToElement:pe,buildImportMap:Oy,configExtension:Zg,createCommand:z,createEditor:fi,createSharedNodeState:zh,createState:Tc,declarePeerDependency:cb,defineExtension:ab,flipDirection:Hn,getDOMOwnerDocument:eu,getDOMSelection:Et,getDOMSelectionFromTarget:Ug,getDOMTextNode:ur,getEditorPropertyFromDOMNode:Cs,getNearestEditorFromDOMNode:ll,getRegisteredNode:il,getRegisteredNodeOrThrow:Hc,getStaticNodeConfig:vs,getTextDirection:Ng,getTransformSetFromKlass:Eg,isBlockDomNode:ts,isCurrentlyReadOnlyMode:Cr,isDOMDocumentNode:Jc,isDOMNode:jn,isDOMTextNode:qt,isDOMUnmanaged:jg,isDocumentFragment:Eo,isExactShortcutMatch:te,isHTMLAnchorElement:ru,isHTMLElement:re,isInlineDomNode:ko,isLexicalEditor:ol,isModifierMatch:Dg,isSelectionCapturedInDecoratorInput:sl,isSelectionWithinEditor:hi,makeStepwiseIterator:fl,mergeRegister:pt,normalizeClassNames:hn,removeClassNamesFromElement:un,removeFromParent:jt,resetRandomKey:Jy,safeCast:ub,setDOMUnmanaged:Wg,setNodeIndentFromDOM:cl,shallowMergeConfig:Xg},Symbol.toStringTag,{value:"Module"}));function fb(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const No=new Map;function Qg(n){const e={};if(!n)return e;const t=n.split(";");for(const r of t)if(r!==""){const[i,s]=r.split(/:([^]+)/);i&&s&&(e[i.trim()]=s.trim())}return e}function rs(n){let e=No.get(n);return e===void 0&&(e=Qg(n),No.set(n,e)),e}function hb(n){let e="";for(const t in n)t&&(e+=`${t}: ${n[t]};`);return e}function ep(n){const e=gi().getElementByKey(n.getKey());if(e===null)return null;const t=e.ownerDocument.defaultView;return t===null?null:t.getComputedStyle(e)}function tp(n){return ep(ye(n)?n:n.getParentOrThrow())}function Ud(n){const e=tp(n);return e!==null&&e.direction==="rtl"}function np(n,e,t="self"){const r=n.getStartEndPoints();if(e.isSelected(n)&&!Tt(e)&&r!==null){const[i,s]=r,o=n.isBackward(),l=i.getNode(),a=s.getNode(),c=e.is(l),u=e.is(a);if(c||u){const[d,f]=_o(n),h=l.is(a),g=e.is(o?a:l),p=e.is(o?l:a);let m,b=0;h?(b=d>f?f:d,m=d>f?d:f):g?(b=o?f:d,m=void 0):p&&(b=0,m=o?d:f);const _=e.__text.slice(b,m);_!==e.__text&&(t==="clone"&&(e=Kg(e)),e.__text=_)}}return e}function gb(n){const e=n.getStyle(),t=Qg(e);No.set(e,t)}function Rs(n,e){(N(n)?n.isCollapsed():I(n)||O(n))||fb(280);const t=rs(N(n)?n.style:I(n)?n.getStyle():n.getTextStyle()),r=Object.entries(e).reduce((s,[o,l])=>(typeof l=="function"?s[o]=l(t[o],n):l===null?delete s[o]:s[o]=l,s),{...t}),i=hb(r);N(n)||I(n)?n.setStyle(i):n.setTextStyle(i),No.set(i,r)}function Ps(n,e){if(N(n)&&n.isCollapsed()){Rs(n,e);const r=n.anchor.getNode();O(r)&&r.isEmpty()&&Rs(r,e)}pb(r=>{Rs(r,e)});const t=n.getNodes();if(t.length>0){const r=new Set;for(const i of t){if(!O(i)||!i.canBeEmpty()||i.getChildrenSize()!==0)continue;const s=i.getKey();r.has(s)||(r.add(s),Rs(i,e))}}}function pb(n){const e=M();if(!e)return;const t=new Map,r=s=>t.get(s.getKey())||[0,s.getTextContentSize()];if(N(e))for(const s of To(e).getTextSlices())s&&t.set(s.caret.origin.getKey(),s.getSliceIndices());const i=e.getNodes();for(const s of i){if(!I(s)||!s.canHaveFormat())continue;const[o,l]=r(s);l!==o&&(Tt(s)||o===0&&l===s.getTextContentSize()?n(s):n(s.splitText(o,l)[o===0?0:1]))}N(e)&&e.anchor.type==="text"&&e.focus.type==="text"&&e.anchor.key===e.focus.key&&mb(e)}function mb(n){if(n.isBackward()){const{anchor:e,focus:t}=n,{key:r,offset:i,type:s}=e;e.set(t.key,t.offset,t.type),t.set(r,i,s)}}function _b(n,e){const t=n.getFormatType(),r=n.getIndent();t!==e.getFormatType()&&e.setFormat(t),r!==e.getIndent()&&e.setIndent(r)}function Qe(n,e,t=_b){if(n===null)return;const r=n.getStartEndPoints(),i=new Map;let s=null;if(r){const[o,l]=r;s=di(),s.anchor.set(o.key,o.offset,o.type),s.focus.set(l.key,l.offset,l.type);const a=oe(o.getNode(),dt),c=oe(l.getNode(),dt);O(a)&&i.set(a.getKey(),a),O(c)&&i.set(c.getKey(),c)}for(const o of n.getNodes())if(O(o)&&dt(o))i.set(o.getKey(),o);else if(r===null){const l=oe(o,dt);O(l)&&i.set(l.getKey(),l)}for(const[o,l]of i){const a=e();t(l,a),l.replace(a,!0),s&&(o===s.anchor.key&&s.anchor.set(a.getKey(),s.anchor.offset,s.anchor.type),o===s.focus.key&&s.focus.set(a.getKey(),s.focus.offset,s.focus.type))}s&&n.is(M())&&Fe(s)}function rp(n){const e=ip(n);return e!==null&&e.writingMode==="vertical-rl"}function ip(n){const e=n.anchor.getNode();return O(e)?ep(e):tp(e)}function Ao(n,e){let t=rp(n)?!e:e;sp(n)&&(t=!t);const r=Dt(n.focus,t?"previous":"next");if(uu(r))return!1;for(const i of dl(r)){if(ht(i))return!i.origin.isInline();if(!O(i.origin)){if(V(i.origin))return!0;break}}return!1}function yb(n,e,t,r){n.modify(e?"extend":"move",t,r)}function sp(n){const e=ip(n);return e!==null&&e.direction==="rtl"}function Oo(n,e,t){const r=sp(n);let i;i=rp(n)||r?!t:t,yb(n,e,i,"character")}function bb(n,e,t){const r=rs(n.getStyle());return r!==null&&r[e]||t}function Bs(n,e,t=""){let r=null;const i=n.getNodes(),s=n.anchor,o=n.focus,l=n.isBackward(),a=l?o.offset:s.offset,c=l?o.getNode():s.getNode();if(N(n)&&n.isCollapsed()&&n.style!==""){const u=rs(n.style);if(u!==null&&e in u)return u[e]}for(let u=0;u<i.length;u++){const d=i[u];if((u===0||a!==0||!d.is(c))&&I(d)){const f=bb(d,e,t);if(r===null)r=f;else if(r!==f){r="";break}}}return r===null?t:r}function op(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const pl=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,xb=pl&&"documentMode"in document?document.documentMode:null,Sb=pl&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);!(!pl||!("InputEvent"in window)||xb)&&"getTargetRanges"in new window.InputEvent("input");const Cb=pl,wb=Sb;function vb(n){return n?n.getAdjacentCaret():null}function Eb(n,e){let t=n;for(;t!=null;){if(t instanceof e)return t;t=t.getParent()}return null}function kb(n){const e=oe(n,t=>O(t)&&!t.isInline());return O(e)||op(4,n.__key),e}function Tb(n){const e=M()||bn();let t;if(N(e))t=Dt(e.focus,"next");else{if(e!=null){const o=e.getNodes(),l=o[o.length-1];l&&(t=_e(l,"next"))}t=t||lt(fe(),"previous").getFlipped().insert(H())}const r=Nb(n,t),i=gr(r),s=ht(i)?et(i):r;return hl(lu(s)),n.getLatest()}function Nb(n,e,t){let r=Yt(e,"next");for(let i=r;i;i=qg(i,t))r=i;return Mt(r)&&op(283),r.insert(n.isInline()?H().append(n):n),Yt(_e(n.getLatest(),"next"),e.direction)}function on(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}let ia=!(wb||!Cb)&&void 0;function Ab(n,e=!1){let t=1;if((function(){if(ia===void 0){const r=document.createElement("div");r.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(r);const i=r.getBoundingClientRect();r.style.setProperty("zoom","2"),ia=r.getBoundingClientRect().width===i.width,document.body.removeChild(r)}return ia})()||e)for(;n;)t*=Number(window.getComputedStyle(n).getPropertyValue("zoom")),n=n.parentElement;return t}function lp(n,e){return ap(n,e,null)}function ap(n,e,t){let r=!1;for(const i of up(n))e(i)?t!==null&&t(i):(r=!0,O(i)&&ap(i,e,t||(s=>i.insertAfter(s))),i.remove());return r}function cp(n,e){const t=[],r=Array.from(n).reverse();for(let i=r.pop();i!==void 0;i=r.pop())if(e(i))t.push(i);else if(O(i))for(const s of up(i))r.push(s);return t}function up(n){return Ob(lt(n,"previous"))}function Ob(n){return fl({hasNext:Ln,initial:n.getAdjacentCaret(),map:e=>e.origin.getLatest(),step:e=>e.getAdjacentCaret()})}function dp(n,e){const t=Jc(e)?e.body.childNodes:e.childNodes;let r=[];const i=[];for(const s of t)if(!gp.has(s.nodeName)){const o=pp(s,n,i,!1);o!==null&&(r=r.concat(o))}return(function(s){for(const o of s)o.getNextSibling()instanceof rl&&o.insertAfter(ot());for(const o of s){const l=o.getChildren();for(const a of l)o.insertBefore(a);o.remove()}})(i),r}function fp(n,e){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const t=document.createElement("div"),r=fe().getChildren();for(let i=0;i<r.length;i++)hp(n,r[i],t,e);return t.innerHTML}function hp(n,e,t,r=null){let i=r===null||e.isSelected(r);const s=O(e)&&e.excludeFromCopy("html");let o=e;r!==null&&I(e)&&(o=np(r,e,"clone"));const l=O(o)?o.getChildren():[],a=il(n,o.getType());let c;c=a&&a.exportDOM!==void 0?a.exportDOM(n,o):o.exportDOM(n);const{element:u,after:d}=c;if(!u)return!1;const f=document.createDocumentFragment();for(let h=0;h<l.length;h++){const g=l[h],p=hp(n,g,f,r);!i&&O(e)&&p&&e.extractWithChild(g,r,"html")&&(i=!0)}if(i&&!s){if((re(u)||Eo(u))&&u.append(f),t.append(u),d){const h=d.call(o,u);h&&(Eo(u)?u.replaceChildren(h):u.replaceWith(h))}}else t.append(f);return i}const gp=new Set(["STYLE","SCRIPT"]);function pp(n,e,t,r,i=new Map,s){let o=[];if(gp.has(n.nodeName))return o;let l=null;const a=(function(g,p){const{nodeName:m}=g,b=p._htmlConversions.get(m.toLowerCase());let _=null;if(b!==void 0)for(const y of b){const C=y(g);C!==null&&(_===null||(_.priority||0)<=(C.priority||0))&&(_=C)}return _!==null?_.conversion:null})(n,e),c=a?a(n):null;let u=null;if(c!==null){u=c.after;const g=c.node;if(l=Array.isArray(g)?g[g.length-1]:g,l!==null){for(const[,p]of i)if(l=p(l,s),!l)break;l&&o.push(...Array.isArray(g)?g:[l])}c.forChild!=null&&i.set(n.nodeName,c.forChild)}const d=n.childNodes;let f=[];const h=(l==null||!We(l))&&(l!=null&&yo(l)||r);for(let g=0;g<d.length;g++)f.push(...pp(d[g],e,t,h,new Map(i),l));return u!=null&&(f=u(f)),ts(n)&&(f=Mb(n,f,h?()=>{const g=new rl;return t.push(g),g}:H)),l==null?f.length>0?o=o.concat(f):ts(n)&&(function(g){return g.nextSibling==null||g.previousSibling==null?!1:ko(g.nextSibling)&&ko(g.previousSibling)})(n)&&(o=o.concat(ot())):O(l)&&l.append(...f),o}function Mb(n,e,t){const r=n.style.textAlign,i=[];let s=[];for(let o=0;o<e.length;o++){const l=e[o];if(yo(l))r&&!l.getFormat()&&l.setFormat(r),i.push(l);else if(s.push(l),o===e.length-1||o<e.length-1&&yo(e[o+1])){const a=t();a.setFormat(r),a.append(...s),i.push(a),s=[]}}return i}function Mo(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function mp(n,e=M()){return e==null&&Mo(166),N(e)&&e.isCollapsed()||e.getNodes().length===0?"":fp(n,e)}function $b(n,e=M()){return e==null&&Mo(166),N(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(Ib(n,e))}function Kd(n,e){const t=n.getData("text/plain")||n.getData("text/uri-list");t!=null&&e.insertRawText(t)}function Wd(n,e,t){const r=n.getData("application/x-lexical-editor");if(r)try{const l=JSON.parse(r);if(l.namespace===t._config.namespace&&Array.isArray(l.nodes))return jd(t,Fb(l.nodes),e)}catch(l){console.error(l)}const i=n.getData("text/html"),s=n.getData("text/plain");if(i&&s!==i)try{const l=new DOMParser().parseFromString((function(a){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:c=>c}).createHTML(a):a})(i),"text/html");return jd(t,dp(t,l),e)}catch(l){console.error(l)}const o=s||n.getData("text/uri-list");if(o!=null)if(N(e)){const l=o.split(/(\r?\n|\t)/);l[l.length-1]===""&&l.pop();for(let a=0;a<l.length;a++){const c=M();if(N(c)){const u=l[a];u===`
12
+ `||u===`\r
13
+ `?c.insertParagraph():u===" "?c.insertNodes([St()]):c.insertText(u)}}}else e.insertRawText(o)}function jd(n,e,t){n.dispatchCommand(Nc,{nodes:e,selection:t})||(t.insertNodes(e),(function(r){if(N(r)&&r.isCollapsed()){const i=r.anchor;let s=null;const o=Dt(i,"previous");if(o)if(Mt(o))s=o.origin;else{const l=Vt(o,lt(fe(),"next").getFlipped());for(const a of l){if(I(a.origin)){s=a.origin;break}if(O(a.origin)&&!a.origin.isInline())break}}if(s&&I(s)){const l=s.getFormat(),a=s.getStyle();r.format===l&&r.style===a||(r.format=l,r.style=a,r.dirty=!0)}}})(t))}function _p(n,e,t,r=[]){let i=e===null||t.isSelected(e);const s=O(t)&&t.excludeFromCopy("html");let o=t;e!==null&&I(o)&&(o=np(e,o,"clone"));const l=O(o)?o.getChildren():[],a=(function(c){const u=c.exportJSON(),d=c.constructor;if(u.type!==d.getType()&&Mo(58,d.name),O(c)){const f=u.children;Array.isArray(f)||Mo(59,d.name)}return u})(o);I(o)&&o.getTextContentSize()===0&&(i=!1);for(let c=0;c<l.length;c++){const u=l[c],d=_p(n,e,u,a.children);!i&&O(t)&&d&&t.extractWithChild(u,e,"clone")&&(i=!0)}if(i&&!s)r.push(a);else if(Array.isArray(a.children))for(let c=0;c<a.children.length;c++){const u=a.children[c];r.push(u)}return i}function Ib(n,e){const t=[],r=fe().getChildren();for(let i=0;i<r.length;i++)_p(n,e,r[i],t);return{namespace:n._config.namespace,nodes:t}}function Fb(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=yg(r);I(i)&&gb(i),e.push(i)}return e}let Ir=null;async function Hd(n,e,t){if(Ir!==null)return!1;if(e!==null)return new Promise((c,u)=>{n.update(()=>{c(Jd(n,e,t))})});const r=n.getRootElement(),i=n._window||window,s=i.document,o=Et(i);if(r===null||o===null)return!1;const l=s.createElement("span");l.style.cssText="position: fixed; top: -1000px;",l.append(s.createTextNode("#")),r.append(l);const a=new Range;return a.setStart(l,0),a.setEnd(l,1),o.removeAllRanges(),o.addRange(a),new Promise((c,u)=>{const d=n.registerCommand(yr,f=>(on(f,ClipboardEvent)&&(d(),Ir!==null&&(i.clearTimeout(Ir),Ir=null),c(Jd(n,f,t))),!0),Wc);Ir=i.setTimeout(()=>{d(),Ir=null,c(!1)},50),s.execCommand("copy"),l.remove()})}function Jd(n,e,t){if(t===void 0){const i=Et(n._window),s=M();if(!s||s.isCollapsed()||!i)return!1;const o=i.anchorNode,l=i.focusNode;if(o!==null&&l!==null&&!hi(n,o,l))return!1;t=Db(s)}e.preventDefault();const r=e.clipboardData;return r!==null&&(Lb(r,t),!0)}const yp=[["text/html",mp],["application/x-lexical-editor",$b]];function Db(n=M()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=gi();for(const[r,i]of yp){const s=i(t,n);s!==null&&(e[r]=s)}}return e}function Lb(n,e){for(const[t]of yp)e[t]===void 0&&n.setData(t,"");for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}const Rb=Symbol.for("preact-signals");function ml(){if(Mn>1)return void Mn--;let n,e=!1;for(;Ji!==void 0;){let t=Ji;for(Ji=void 0,Za++;t!==void 0;){const r=t.o;if(t.o=void 0,t.f&=-3,!(8&t.f)&&xp(t))try{t.c()}catch(i){e||(n=i,e=!0)}t=r}}if(Za=0,Mn--,e)throw n}function Pb(n){if(Mn>0)return n();Mn++;try{return n()}finally{ml()}}let ne,Ji;function Gd(n){const e=ne;ne=void 0;try{return n()}finally{ne=e}}let Mn=0,Za=0,Xs=0;function Vd(n){if(ne===void 0)return;let e=n.n;return e===void 0||e.t!==ne?(e={i:0,S:n,p:ne.s,n:void 0,t:ne,e:void 0,x:void 0,r:e},ne.s!==void 0&&(ne.s.n=e),ne.s=e,n.n=e,32&ne.f&&n.S(e),e):e.i===-1?(e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=ne.s,e.n=void 0,ne.s.n=e,ne.s=e),e):void 0}function Xe(n,e){this.v=n,this.i=0,this.n=void 0,this.t=void 0,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function bp(n,e){return new Xe(n,e)}function xp(n){for(let e=n.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function Yd(n){for(let e=n.s;e!==void 0;e=e.n){const t=e.S.n;if(t!==void 0&&(e.r=t),e.S.n=e,e.i=-1,e.n===void 0){n.s=e;break}}}function Sp(n){let e,t=n.s;for(;t!==void 0;){const r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):e=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}n.s=e}function Fr(n,e){Xe.call(this,void 0),this.x=n,this.s=void 0,this.g=Xs-1,this.f=4,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function Cp(n){const e=n.u;if(n.u=void 0,typeof e=="function"){Mn++;const t=ne;ne=void 0;try{e()}catch(r){throw n.f&=-2,n.f|=8,du(n),r}finally{ne=t,ml()}}}function du(n){for(let e=n.s;e!==void 0;e=e.n)e.S.U(e);n.x=void 0,n.s=void 0,Cp(n)}function Bb(n){if(ne!==this)throw new Error("Out-of-order effect");Sp(this),ne=n,this.f&=-2,8&this.f&&du(this),ml()}function Ur(n,e){this.x=n,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=e?.name}function fu(n,e){const t=new Ur(n,e);try{t.c()}catch(i){throw t.d(),i}const r=t.d.bind(t);return r[Symbol.dispose]=r,r}function zb(n,e={}){const t={};for(const r in n){const i=e[r],s=bp(i===void 0?n[r]:i);t[r]=s}return t}Xe.prototype.brand=Rb,Xe.prototype.h=function(){return!0},Xe.prototype.S=function(n){const e=this.t;e!==n&&n.e===void 0&&(n.x=e,this.t=n,e!==void 0?e.e=n:Gd(()=>{var t;(t=this.W)==null||t.call(this)}))},Xe.prototype.U=function(n){if(this.t!==void 0){const e=n.e,t=n.x;e!==void 0&&(e.x=t,n.e=void 0),t!==void 0&&(t.e=e,n.x=void 0),n===this.t&&(this.t=t,t===void 0&&Gd(()=>{var r;(r=this.Z)==null||r.call(this)}))}},Xe.prototype.subscribe=function(n){return fu(()=>{const e=this.value,t=ne;ne=void 0;try{n(e)}finally{ne=t}},{name:"sub"})},Xe.prototype.valueOf=function(){return this.value},Xe.prototype.toString=function(){return this.value+""},Xe.prototype.toJSON=function(){return this.value},Xe.prototype.peek=function(){const n=ne;ne=void 0;try{return this.value}finally{ne=n}},Object.defineProperty(Xe.prototype,"value",{get(){const n=Vd(this);return n!==void 0&&(n.i=this.i),this.v},set(n){if(n!==this.v){if(Za>100)throw new Error("Cycle detected");this.v=n,this.i++,Xs++,Mn++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{ml()}}}}),Fr.prototype=new Xe,Fr.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Xs))return!0;if(this.g=Xs,this.f|=1,this.i>0&&!xp(this))return this.f&=-2,!0;const n=ne;try{Yd(this),ne=this;const e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return ne=n,Sp(this),this.f&=-2,!0},Fr.prototype.S=function(n){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}Xe.prototype.S.call(this,n)},Fr.prototype.U=function(n){if(this.t!==void 0&&(Xe.prototype.U.call(this,n),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},Fr.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let n=this.t;n!==void 0;n=n.x)n.t.N()}},Object.defineProperty(Fr.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const n=Vd(this);if(this.h(),n!==void 0&&(n.i=this.i),16&this.f)throw this.v;return this.v}}),Ur.prototype.c=function(){const n=this.S();try{if(8&this.f||this.x===void 0)return;const e=this.x();typeof e=="function"&&(this.u=e)}finally{n()}},Ur.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Cp(this),Yd(this),Mn++;const n=ne;return ne=this,Bb.bind(this,n)},Ur.prototype.N=function(){2&this.f||(this.f|=2,this.o=Ji,Ji=this)},Ur.prototype.d=function(){this.f|=8,1&this.f||du(this)},Ur.prototype.dispose=function(){this.d()};function Ub(n){return(typeof n.nodes=="function"?n.nodes():n.nodes)||[]}function ae(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function wp(n,e){if(n&&e&&!Array.isArray(e)&&typeof n=="object"&&typeof e=="object"){const t=n,r=e;for(const i in r)t[i]=wp(t[i],r[i]);return n}return e}const hu=0,Xa=1,vp=2,sa=3,zs=4,Dr=5,oa=6,Ai=7;function la(n){return n.id===hu}function Ep(n){return n.id===vp}function Kb(n){return(function(e){return e.id===Xa})(n)||ae(305,String(n.id),String(Xa)),Object.assign(n,{id:vp})}const Wb=new Set;let jb=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:hu}}mergeConfigs(){let e=this.extension.config||{};const t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):Xg;for(const r of this.configs)e=t(e,r);return e}init(e){const t=this.state;Ep(t)||ae(306,String(t.id));const r={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},i={...r,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},s=(function(l,a,c){return Object.assign(l,{config:a,id:sa,registerState:c})})(t,this.mergeConfigs(),r);let o;this.state=s,this.extension.init&&(o=this.extension.init(e,s.config,r)),this.state=(function(l,a,c){return Object.assign(l,{id:zs,initResult:a,registerState:c})})(s,o,i)}build(e){const t=this.state;let r;t.id!==zs&&ae(307,String(t.id),String(Dr)),this.extension.build&&(r=this.extension.build(e,t.config,t.registerState));const i={...t.registerState,getOutput:()=>r,getSignal:this.getSignal.bind(this)};this.state=(function(s,o,l){return Object.assign(s,{id:Dr,output:o,registerState:l})})(t,r,i)}register(e,t){this._signal=t;const r=this.state;r.id!==Dr&&ae(308,String(r.id),String(Dr));const i=this.extension.register&&this.extension.register(e,r.config,r.registerState);return this.state=(function(s){return Object.assign(s,{id:oa})})(r),()=>{const s=this.state;s.id!==Ai&&ae(309,String(r.id),String(Ai)),this.state=(function(o){return Object.assign(o,{id:Dr})})(s),i&&i()}}afterRegistration(e){const t=this.state;let r;return t.id!==oa&&ae(310,String(t.id),String(oa)),this.extension.afterRegistration&&(r=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=(function(i){return Object.assign(i,{id:Ai})})(t),r}getSignal(){return this._signal===void 0&&ae(311),this._signal}getInitResult(){this.extension.init===void 0&&ae(312,this.extension.name);const e=this.state;return(function(t){return t.id>=zs})(e)||ae(313,String(e.id),String(zs)),e.initResult}getInitPeer(e){const t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){const e=this.state;return(function(t){return t.id>=sa})(e)||ae(314,String(e.id),String(sa)),{config:e.config}}getPeer(e){const t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){const t=this.builder.getExtensionRep(e);return t===void 0&&ae(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){const t=this.builder.getExtensionRep(e);return t===void 0&&ae(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){const e=this.state;return(function(t){return t.id>=Ai})(e)||ae(316,String(e.id),String(Ai)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||Wb}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([t])=>t)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){const e=this.state;(function(t){return t.id>=Dr})(e)||ae(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}};const qd={tag:Hr};function Hb(){const n=fe();n.isEmpty()&&n.append(H())}const Jb={config:{setOptions:qd,updateOptions:qd},init:({$initialEditorState:n=Hb})=>({$initialEditorState:n,initialized:!1}),afterRegistration(n,{updateOptions:e,setOptions:t},r){const i=r.getInitResult();if(!i.initialized){i.initialized=!0;const{$initialEditorState:s}=i;if(Sg(s))n.setEditorState(s,t);else if(typeof s=="function")n.update(()=>{s(n)},e);else if(s&&(typeof s=="string"||typeof s=="object")){const o=n.parseEditorState(s);n.setEditorState(o,t)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[wr,qe,br,xr,vr]},Zd=Symbol.for("@lexical/extension/LexicalBuilder");function Xd(){}function Gb(n){throw n}function Us(n){return Array.isArray(n)?n:[n]}const aa="0.40.0+prod.esm";let Vb=class Qs{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=aa,this.roots=e;for(const t of e)this.addExtension(t)}static fromExtensions(e){const t=[Us(Jb)];for(const r of e)t.push(Us(r));return new Qs(t)}static maybeFromEditor(e){const t=e[Zd];return t&&(t.PACKAGE_VERSION!==aa&&ae(292,t.PACKAGE_VERSION,aa),t instanceof Qs||ae(293)),t}static fromEditor(e){const t=Qs.maybeFromEditor(e);return t===void 0&&ae(294),t}constructEditor(){const{$initialEditorState:e,onError:t,...r}=this.buildCreateEditorArgs(),i=Object.assign(fi({...r,...t?{onError:s=>{t(s,i)}}:{}}),{[Zd]:this});for(const s of this.sortedExtensionReps())s.build(i);return i}buildEditor(){let e=Xd;function t(){try{e()}finally{e=Xd}}const r=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=pt(this.registerEditor(r),()=>r.setRootElement(null)),r}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){const t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&ae(295,e.name),t}addEdge(e,t,r){const i=this.outgoingConfigEdges.get(e);i?i.set(t,r):this.outgoingConfigEdges.set(e,new Map([[t,r]]));const s=this.incomingEdges.get(t);s?s.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&ae(296);const t=Us(e),[r]=t;typeof r.name!="string"&&ae(297,typeof r.name);let i=this.extensionNameMap.get(r.name);if(i!==void 0&&i.extension!==r&&ae(298,r.name),!i){i=new jb(this,r),this.extensionNameMap.set(r.name,i);const s=this.conflicts.get(r.name);typeof s=="string"&&ae(299,r.name,s);for(const o of r.conflictsWith||[])this.extensionNameMap.has(o)&&ae(299,r.name,o),this.conflicts.set(o,r.name);for(const o of r.dependencies||[]){const l=Us(o);this.addEdge(r.name,l[0].name,l.slice(1)),this.addExtension(l)}for(const[o,l]of r.peerDependencies||[])this.addEdge(r.name,o,l?[l]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const e=[],t=(r,i)=>{let s=r.state;if(Ep(s))return;const o=r.extension.name;var l;la(s)||ae(300,o,i||"[unknown]"),la(l=s)||ae(304,String(l.id),String(hu)),s=Object.assign(l,{id:Xa}),r.state=s;const a=this.outgoingConfigEdges.get(o);if(a)for(const c of a.keys()){const u=this.extensionNameMap.get(c);u&&t(u,o)}s=Kb(s),r.state=s,e.push(r)};for(const r of this.extensionNameMap.values())la(r.state)&&t(r);for(const r of e)for(const[i,s]of this.outgoingConfigEdges.get(r.extension.name)||[])if(s.length>0){const o=this.extensionNameMap.get(i);if(o)for(const l of s)o.configs.add(l)}for(const[r,...i]of this.roots)if(i.length>0){const s=this.extensionNameMap.get(r.name);s===void 0&&ae(301,r.name);for(const o of i)s.configs.add(o)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){const t=this.sortedExtensionReps(),r=new AbortController,i=[()=>r.abort()],s=r.signal;for(const o of t){const l=o.register(e,s);l&&i.push(l)}for(const o of t){const l=o.afterRegistration(e);l&&i.push(l)}return pt(...i)}buildCreateEditorArgs(){const e={},t=new Set,r=new Map,i=new Map,s={},o={},l=this.sortedExtensionReps();for(const u of l){const{extension:d}=u;if(d.onError!==void 0&&(e.onError=d.onError),d.disableEvents!==void 0&&(e.disableEvents=d.disableEvents),d.parentEditor!==void 0&&(e.parentEditor=d.parentEditor),d.editable!==void 0&&(e.editable=d.editable),d.namespace!==void 0&&(e.namespace=d.namespace),d.$initialEditorState!==void 0&&(e.$initialEditorState=d.$initialEditorState),d.nodes)for(const f of Ub(d)){if(typeof f!="function"){const h=r.get(f.replace);h&&ae(302,d.name,f.replace.name,h.extension.name),r.set(f.replace,u)}t.add(f)}if(d.html){if(d.html.export)for(const[f,h]of d.html.export.entries())i.set(f,h);d.html.import&&Object.assign(s,d.html.import)}d.theme&&wp(o,d.theme)}Object.keys(o).length>0&&(e.theme=o),t.size&&(e.nodes=[...t]);const a=Object.keys(s).length>0,c=i.size>0;(a||c)&&(e.html={},a&&(e.html.import=s),c&&(e.html.export=i));for(const u of l)u.init(e);return e.onError||(e.onError=Gb),e}};function Yb(n,e){const t=Vb.fromEditor(n).extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}function Qd(n){const e=window.location.origin,t=r=>{if(r.origin!==e)return;const i=n.getRootElement();if(document.activeElement!==i)return;const s=r.data;if(typeof s=="string"){let o;try{o=JSON.parse(s)}catch{return}if(o&&o.protocol==="nuanria_messaging"&&o.type==="request"){const l=o.payload;if(l&&l.functionId==="makeChanges"){const a=l.args;if(a){const[c,u,d,f,h]=a;n.update(()=>{const g=M();if(N(g)){const p=g.anchor;let m=p.getNode(),b=0,_=0;if(I(m)&&c>=0&&u>=0&&(b=c,_=c+u,g.setTextNodeRange(m,b,m,_)),b===_&&d===""||(g.insertRawText(d),m=p.getNode()),I(m)){b=f,_=f+h;const y=m.getTextContentSize();b=b>y?y:b,_=_>y?y:_,g.setTextNodeRange(m,b,m,_)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}function ef(n,e){if(document.caretRangeFromPoint!==void 0){const t=document.caretRangeFromPoint(n,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const t=document.caretPositionFromPoint(n,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}return null}const kr=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,qb=kr&&"documentMode"in document?document.documentMode:null,Zb=kr&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Xb=!(!kr||!("InputEvent"in window)||qb)&&"getTargetRanges"in new window.InputEvent("input"),Qb=kr&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),tf=kr&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,ex=kr&&/^(?=.*Chrome).*/i.test(navigator.userAgent),tx=kr&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Zb&&!ex,nf=z("DRAG_DROP_PASTE_FILE");let _l=class kp extends be{static getType(){return"quote"}static clone(e){return new kp(e.__key)}createDOM(e){const t=document.createElement("blockquote");return pe(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:nx,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(re(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r);const i=this.getDirection();i&&(t.dir=i)}return{element:t}}static importJSON(e){return mi().updateFromJSON(e)}insertNewAfter(e,t){const r=H(),i=this.getDirection();return r.setDirection(i),this.insertAfter(r,t),r}collapseAtStart(){const e=H();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function mi(){return Le(new _l)}function Qa(n){return n instanceof _l}let yl=class Tp extends be{__tag;static getType(){return"heading"}static clone(e){return new Tp(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}setTag(e){const t=this.getWritable();return this.__tag=e,t}createDOM(e){const t=this.__tag,r=document.createElement(t),i=e.theme.heading;if(i!==void 0){const s=i[t];pe(r,s)}return r}updateDOM(e,t,r){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:Lr,priority:0}),h2:e=>({conversion:Lr,priority:0}),h3:e=>({conversion:Lr,priority:0}),h4:e=>({conversion:Lr,priority:0}),h5:e=>({conversion:Lr,priority:0}),h6:e=>({conversion:Lr,priority:0}),p:e=>{const t=e.firstChild;return t!==null&&rf(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>rf(e)?{conversion:t=>({node:ft("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(re(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r);const i=this.getDirection();i&&(t.dir=i)}return{element:t}}static importJSON(e){return ft(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){const r=e?e.anchor.offset:0,i=this.getLastDescendant(),s=!i||e&&e.anchor.key===i.getKey()&&r===i.getTextContentSize()||!e?H():ft(this.getTag()),o=this.getDirection();if(s.setDirection(o),this.insertAfter(s,t),r===0&&!this.isEmpty()&&e){const l=H();l.select(),this.replace(l,!0)}return s}collapseAtStart(){const e=this.isEmpty()?H():ft(this.getTag());return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}extractWithChild(){return!0}};function rf(n){return n.nodeName.toLowerCase()==="span"&&n.style.fontSize==="26pt"}function Lr(n){const e=n.nodeName.toLowerCase();let t=null;return e!=="h1"&&e!=="h2"&&e!=="h3"&&e!=="h4"&&e!=="h5"&&e!=="h6"||(t=ft(e),n.style!==null&&(cl(n,t),t.setFormat(n.style.textAlign))),{node:t}}function nx(n){const e=mi();return n.style!==null&&(e.setFormat(n.style.textAlign),cl(n,e)),{node:e}}function ft(n="h1"){return Le(new yl(n))}function rx(n){return n instanceof yl}function Ks(n){let e=null;if(on(n,DragEvent)?e=n.dataTransfer:on(n,ClipboardEvent)&&(e=n.clipboardData),e===null)return[!1,[],!1];const t=e.types,r=t.includes("Files"),i=t.includes("text/html")||t.includes("text/plain");return[r,Array.from(e.files),i]}function sf(n){const e=M();if(!N(e))return!1;const t=new Set,r=e.getNodes();for(let i=0;i<r.length;i++){const s=r[i],o=s.getKey();if(t.has(o))continue;const l=oe(s,c=>O(c)&&!c.isInline());if(l===null)continue;const a=l.getKey();l.canIndent()&&!t.has(a)&&(t.add(a),n(l))}return t.size>0}function of(n){const e=gt(n);return V(e)}function ca(n){for(const e of["lowercase","uppercase","capitalize"])n.hasFormat(e)&&n.toggleFormat(e)}function ix(n){return pt(n.registerCommand(_r,e=>{const t=M();return!!He(t)&&(t.clear(),!0)},B),n.registerCommand(Ot,e=>{const t=M();return N(t)?(t.deleteCharacter(e),!0):!!He(t)&&(t.deleteNodes(),!0)},B),n.registerCommand(lr,e=>{const t=M();return!!N(t)&&(t.deleteWord(e),!0)},B),n.registerCommand(ar,e=>{const t=M();return!!N(t)&&(t.deleteLine(e),!0)},B),n.registerCommand(An,e=>{const t=M();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const r=e.dataTransfer;if(r!=null)Wd(r,t,n);else if(N(t)){const i=e.data;return i&&t.insertText(i),!0}}return!0},B),n.registerCommand(Xi,()=>{const e=M();return!!N(e)&&(e.removeText(),!0)},B),n.registerCommand(Ce,e=>{const t=M();return!!N(t)&&(t.formatText(e),!0)},B),n.registerCommand(Fc,e=>{const t=M();if(!N(t)&&!He(t))return!1;const r=t.getNodes();for(const i of r){const s=oe(i,o=>O(o)&&!o.isInline());s!==null&&s.setFormat(e)}return!0},B),n.registerCommand(cn,e=>{const t=M();return!!N(t)&&(t.insertLineBreak(e),!0)},B),n.registerCommand(Fn,()=>{const e=M();return!!N(e)&&(e.insertParagraph(),!0)},B),n.registerCommand(fo,()=>(tl([St()]),!0),B),n.registerCommand(Ut,()=>sf(e=>{const t=e.getIndent();e.setIndent(t+1)}),B),n.registerCommand(sn,()=>sf(e=>{const t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),B),n.registerCommand(dn,e=>{const t=M();if(He(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}else if(N(t)){const r=wo(t.focus,!0);if(!e.shiftKey&&V(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},B),n.registerCommand(cr,e=>{const t=M();if(He(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectNext(0,0),!0}else if(N(t)){if((function(i){const s=i.focus;return s.key==="root"&&s.offset===fe().getChildrenSize()})(t))return e.preventDefault(),!0;const r=wo(t.focus,!1);if(!e.shiftKey&&V(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},B),n.registerCommand(ys,e=>{const t=M();if(He(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),Ud(r[0])?r[0].selectNext(0,0):r[0].selectPrevious(),!0}if(!N(t))return!1;if(Ao(t,!0)){const r=e.shiftKey;return e.preventDefault(),Oo(t,r,!0),!0}return!1},B),n.registerCommand(Go,e=>{const t=M();if(He(t)){const i=t.getNodes();if(i.length>0)return e.preventDefault(),Ud(i[0])?i[0].selectPrevious():i[0].selectNext(0,0),!0}if(!N(t))return!1;const r=e.shiftKey;return!!Ao(t,!1)&&(e.preventDefault(),Oo(t,r,!1),!0)},B),n.registerCommand(Yo,e=>{if(of(e.target))return!1;const t=M();if(N(t)){if((function(r){if(!r.isCollapsed())return!1;const{anchor:i}=r;if(i.offset!==0)return!1;const s=i.getNode();if(ye(s))return!1;const o=kb(s);return o.getIndent()>0&&(o.is(s)||s.is(o.getFirstDescendant()))})(t))return e.preventDefault(),n.dispatchCommand(sn,void 0);if(tf&&navigator.language==="ko-KR")return!1}else if(!He(t))return!1;return e.preventDefault(),n.dispatchCommand(Ot,!0)},B),n.registerCommand(qo,e=>{if(of(e.target))return!1;const t=M();return!(!N(t)&&!He(t))&&(e.preventDefault(),n.dispatchCommand(Ot,!1))},B),n.registerCommand(Dn,e=>{const t=M();if(!N(t))return!1;if(ca(t),e!==null){if((tf||Qb||tx)&&Xb)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(cn,!1)}return n.dispatchCommand(Fn,void 0)},B),n.registerCommand(ai,()=>{const e=M();return!!N(e)&&(n.blur(),!0)},B),n.registerCommand(Zo,e=>{const[,t]=Ks(e);if(t.length>0){const i=ef(e.clientX,e.clientY);if(i!==null){const{offset:s,node:o}=i,l=gt(o);if(l!==null){const a=di();if(I(l))a.anchor.set(l.getKey(),s,"text"),a.focus.set(l.getKey(),s,"text");else{const u=l.getParentOrThrow().getKey(),d=l.getIndexWithinParent()+1;a.anchor.set(u,d,"element"),a.focus.set(u,d,"element")}const c=In(a);Fe(c)}n.dispatchCommand(nf,t)}return e.preventDefault(),!0}const r=M();return!!N(r)},B),n.registerCommand(Xo,e=>{const[t]=Ks(e),r=M();return!(t&&!N(r))},B),n.registerCommand(Dc,e=>{const[t]=Ks(e),r=M();if(t&&!N(r))return!1;const i=ef(e.clientX,e.clientY);if(i!==null){const s=gt(i.node);V(s)&&e.preventDefault()}return!0},B),n.registerCommand(qr,()=>(Xc(),!0),B),n.registerCommand(yr,e=>(Hd(n,on(e,ClipboardEvent)?e:null),!0),B),n.registerCommand(ci,e=>((async function(t,r){await Hd(r,on(t,ClipboardEvent)?t:null),r.update(()=>{const i=M();N(i)?i.removeText():He(i)&&i.getNodes().forEach(s=>s.remove())})})(e,n),!0),B),n.registerCommand(si,e=>{const[,t,r]=Ks(e);return t.length>0&&!r?(n.dispatchCommand(nf,t),!0):jn(e.target)&&sl(e.target)?!1:M()!==null&&((function(i,s){i.preventDefault(),s.update(()=>{const o=M(),l=on(i,InputEvent)||on(i,KeyboardEvent)?null:i.clipboardData;l!=null&&o!==null&&Wd(l,o,s)},{tag:Pc})})(e,n),!0)},B),n.registerCommand(Vo,e=>{const t=M();return N(t)&&ca(t),!1},B),n.registerCommand(bs,e=>{const t=M();return N(t)&&ca(t),!1},B))}function Tn(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function sx(n){let e=1,t=n.getParent();for(;t!=null;){if(X(t)){const r=t.getParent();if(J(r)){e++,t=r.getParent();continue}Tn(40)}return e}return e}function ec(n){let e=n.getParent();J(e)||Tn(40);let t=e;for(;t!==null;)t=t.getParent(),J(t)&&(e=t);return e}function Np(n){let e=[];const t=n.getChildren().filter(X);for(let r=0;r<t.length;r++){const i=t[r],s=i.getFirstChild();J(s)?e=e.concat(Np(s)):e.push(i)}return e}function zt(n){return X(n)&&J(n.getFirstChild())}function lf(n){return mt().append(n)}function Ap(n,e){return X(n)&&(e.length===0||e.length===1&&n.is(e[0])&&n.getChildrenSize()===0)}function $o(n){const e=M();if(e!==null){let t=e.getNodes();if(N(e)){const i=e.getStartEndPoints();i===null&&Tn(143);const[s]=i,o=s.getNode(),l=o.getParent();if(We(o)){const a=o.getFirstChild();if(a)t=a.selectStart().getNodes();else{const c=H();o.append(c),t=c.select().getNodes()}}else if(Ap(o,t)){const a=st(n);if(We(l)){o.replace(a);const c=mt();O(o)&&(c.setFormat(o.getFormatType()),c.setIndent(o.getIndent())),a.append(c)}else if(X(o)){const c=o.getParentOrThrow();pr(a,c.getChildren()),c.replace(a)}return}}const r=new Set;for(let i=0;i<t.length;i++){const s=t[i];if(O(s)&&s.isEmpty()&&!X(s)&&!r.has(s.getKey())){af(s,n);continue}let o=Gc(s)?s.getParent():X(s)&&s.isEmpty()?s:null;for(;o!=null;){const l=o.getKey();if(J(o)){if(!r.has(l)){const a=st(n);pr(a,o.getChildren()),o.replace(a),r.add(l)}break}{const a=o.getParent();if(We(a)&&!r.has(l)){r.add(l),af(o,n);break}o=a}}}}}function pr(n,e){n.splice(n.getChildrenSize(),0,e)}function af(n,e){if(J(n))return n;const t=n.getPreviousSibling(),r=n.getNextSibling(),i=mt();let s;if(pr(i,n.getChildren()),J(t)&&e===t.getListType())t.append(i),J(r)&&e===r.getListType()&&(pr(t,r.getChildren()),r.remove()),s=t;else if(J(r)&&e===r.getListType())r.getFirstChildOrThrow().insertBefore(i),s=r;else{const l=st(e);l.append(i),n.replace(l),s=l}i.setFormat(n.getFormatType()),i.setIndent(n.getIndent());const o=M();return N(o)&&(s.getKey()===o.anchor.key&&o.anchor.set(i.getKey(),o.anchor.offset,"element"),s.getKey()===o.focus.key&&o.focus.set(i.getKey(),o.focus.offset,"element")),n.remove(),s}function gu(n,e){const t=n.getLastChild(),r=e.getFirstChild();t&&r&&zt(t)&&zt(r)&&(gu(t.getFirstChild(),r.getFirstChild()),r.remove());const i=e.getChildren();i.length>0&&n.append(...i),e.remove()}function Op(){const n=M();if(N(n)){const e=new Set,t=n.getNodes(),r=n.anchor.getNode();if(Ap(r,t))e.add(ec(r));else for(let i=0;i<t.length;i++){const s=t[i];if(Gc(s)){const o=Eb(s,Tr);o!=null&&e.add(ec(o))}}for(const i of e){let s=i;const o=Np(i);for(const l of o){const a=H().setTextStyle(n.style).setTextFormat(n.format);pr(a,l.getChildren()),s.insertAfter(a),s=a,l.__key===n.anchor.key&&Rn(n.anchor,et(lt(a,"next"))),l.__key===n.focus.key&&Rn(n.focus,et(lt(a,"next"))),l.remove()}i.remove()}}}function Mp(n){const e=n.getListType()!=="check";let t=n.getStart();for(const r of n.getChildren())X(r)&&(r.getValue()!==t&&r.setValue(t),e&&r.getLatest().__checked!=null&&r.setChecked(void 0),J(r.getFirstChild())||t++)}function ox(n){const e=new Set;if(zt(n)||e.has(n.getKey()))return;const t=n.getParent(),r=n.getNextSibling(),i=n.getPreviousSibling();if(zt(r)&&zt(i)){const s=i.getFirstChild();if(J(s)){s.append(n);const o=r.getFirstChild();J(o)&&(pr(s,o.getChildren()),r.remove(),e.add(r.getKey()))}}else if(zt(r)){const s=r.getFirstChild();if(J(s)){const o=s.getFirstChild();o!==null&&o.insertBefore(n)}}else if(zt(i)){const s=i.getFirstChild();J(s)&&s.append(n)}else if(J(t)){const s=mt().setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle()),o=st(t.getListType()).setTextFormat(t.getTextFormat()).setTextStyle(t.getTextStyle());s.append(o),o.append(n),i?i.insertAfter(s):r?r.insertBefore(s):t.append(s)}}function lx(n){if(zt(n))return;const e=n.getParent(),t=e?e.getParent():void 0;if(J(t?t.getParent():void 0)&&X(t)&&J(e)){const r=e?e.getFirstChild():void 0,i=e?e.getLastChild():void 0;if(n.is(r))t.insertBefore(n),e.isEmpty()&&t.remove();else if(n.is(i))t.insertAfter(n),e.isEmpty()&&t.remove();else{const s=e.getListType(),o=mt(),l=st(s);o.append(l),n.getPreviousSiblings().forEach(u=>l.append(u));const a=mt(),c=st(s);a.append(c),pr(c,n.getNextSiblings()),t.insertBefore(o),t.insertAfter(a),t.replace(n)}}}function ax(){const n=M();if(!N(n)||!n.isCollapsed())return!1;const e=n.anchor.getNode();let t=null;if(X(e)&&e.getChildrenSize()===0)t=e;else if(I(e)){const a=e.getParent();X(a)&&a.getChildren().every(c=>I(c)&&c.getTextContent().trim()==="")&&(t=a)}if(t===null)return!1;const r=ec(t),i=t.getParent();J(i)||Tn(40);const s=i.getParent();let o;if(We(s))o=H(),r.insertAfter(o);else{if(!X(s))return!1;o=mt(),s.insertAfter(o)}o.setTextStyle(n.style).setTextFormat(n.format).select();const l=t.getNextSiblings();if(l.length>0){const a=st(i.getListType());if(X(o)){const c=mt();c.append(a),o.insertAfter(c)}else o.insertAfter(a);a.append(...l)}return(function(a){let c=a;for(;c.getNextSibling()==null&&c.getPreviousSibling()==null;){const u=c.getParent();if(u==null||!X(u)&&!J(u))break;c=u}c.remove()})(t),!0}let Tr=class extends be{__value;__checked;$config(){return this.config("listitem",{$transform:e=>{if(e.__checked==null)return;const t=e.getParent();J(t)&&t.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0)},extends:be,importDOM:{li:()=>({conversion:cx,priority:0})}})}constructor(e=1,t=void 0,r){super(r),this.__value=e===void 0?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){const t=document.createElement("li");return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,r){(function(o,l,a){const c=l.getParent();!J(c)||c.getListType()!=="check"||J(l.getFirstChild())?(o.removeAttribute("role"),o.removeAttribute("tabIndex"),o.removeAttribute("aria-checked")):(o.setAttribute("role","checkbox"),o.setAttribute("tabIndex","-1"),a&&l.__checked===a.__checked||o.setAttribute("aria-checked",l.getChecked()?"true":"false"))})(t,this,e),t.value=this.__value,(function(o,l,a){const c=[],u=[],d=l.list,f=d?d.listitem:void 0;let h;if(d&&d.nested&&(h=d.nested.listitem),f!==void 0&&c.push(...hn(f)),d){const g=a.getParent(),p=J(g)&&g.getListType()==="check",m=a.getChecked();p&&!m||u.push(d.listitemUnchecked),p&&m||u.push(d.listitemChecked),p&&c.push(m?d.listitemChecked:d.listitemUnchecked)}if(h!==void 0){const g=hn(h);a.getChildren().some(p=>J(p))?c.push(...g):u.push(...g)}u.length>0&&un(o,...u),c.length>0&&pe(o,...c)})(t,r.theme,this);const i=e?e.__style:"",s=this.__style;i!==s&&(s===""?t.removeAttribute("style"):t.style.cssText=s),(function(o,l,a){const c=rs(l.__textStyle);for(const u in c)o.style.setProperty(`--listitem-marker-${u}`,c[u]);if(a)for(const u in rs(a.__textStyle))u in c||o.style.removeProperty(`--listitem-marker-${u}`)})(t,this,e)}updateDOM(e,t,r){const i=t;return this.updateListItemDOM(e,i,r),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){const t=this.createDOM(e._config),r=this.getFormatType();r&&(t.style.textAlign=r);const i=this.getDirection();return i&&(t.dir=i),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){const r=e[t];if(O(r)&&this.canMergeWith(r)){const i=r.getChildren();this.append(...i),r.remove()}else super.append(r)}return this}replace(e,t){if(X(e))return super.replace(e);this.setIndent(0);const r=this.getParentOrThrow();if(!J(r))return e;if(r.__first===this.getKey())r.insertBefore(e);else if(r.__last===this.getKey())r.insertAfter(e);else{const i=st(r.getListType());let s=this.getNextSibling();for(;s;){const o=s;s=s.getNextSibling(),i.append(o)}r.insertAfter(e),e.insertAfter(i)}return t&&(O(e)||Tn(139),this.getChildren().forEach(i=>{e.append(i)})),this.remove(),r.getChildrenSize()===0&&r.remove(),e}insertAfter(e,t=!0){const r=this.getParentOrThrow();if(J(r)||Tn(39),X(e))return super.insertAfter(e,t);const i=this.getNextSiblings();if(r.insertAfter(e,t),i.length!==0){const s=st(r.getListType());i.forEach(o=>s.append(o)),e.insertAfter(s,t)}return e}remove(e){const t=this.getPreviousSibling(),r=this.getNextSibling();super.remove(e),t&&r&&zt(t)&&zt(r)&&(gu(t.getFirstChild(),r.getFirstChild()),r.remove())}insertNewAfter(e,t=!0){const r=mt().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(r,t),r}collapseAtStart(e){const t=H();this.getChildren().forEach(o=>t.append(o));const r=this.getParentOrThrow(),i=r.getParentOrThrow(),s=X(i);if(r.getChildrenSize()===1)if(s)r.remove(),i.select();else{r.insertBefore(t),r.remove();const o=e.anchor,l=e.focus,a=t.getKey();o.type==="element"&&o.getNode().is(this)&&o.set(a,o.offset,"element"),l.type==="element"&&l.getNode().is(this)&&l.set(a,l.offset,"element")}else r.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){const t=this.getWritable();return t.__value=e,t}getChecked(){const e=this.getLatest();let t;const r=this.getParent();return J(r)&&(t=r.getListType()),t==="check"?!!e.__checked:void 0}setChecked(e){const t=this.getWritable();return t.__checked=e,t}toggleChecked(){const e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){const e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),r=0;for(;X(t);)t=t.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(e){typeof e!="number"&&Tn(117),(e=Math.floor(e))>=0||Tn(199);let t=this.getIndent();for(;t!==e;)t<e?(ox(this),t++):(lx(this),t--);return this}canInsertAfter(e){return X(e)}canReplaceWith(e){return X(e)}canMergeWith(e){return X(e)||Er(e)}extractWithChild(e,t){if(!N(t))return!1;const r=t.anchor.getNode(),i=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return st("bullet")}canMergeWhenEmpty(){return!0}};function cx(n){if(n.classList.contains("task-list-item")){for(const t of n.children)if(t.tagName==="INPUT")return cf(t)}if(n.classList.contains("joplin-checkbox")){for(const t of n.children)if(t.classList.contains("checkbox-wrapper")&&t.children.length>0&&t.children[0].tagName==="INPUT")return cf(t.children[0])}const e=n.getAttribute("aria-checked");return{node:mt(e==="true"||e!=="false"&&void 0)}}function cf(n){return n.getAttribute("type")!=="checkbox"?{node:null}:{node:mt(n.hasAttribute("checked"))}}function mt(n){return Le(new Tr(void 0,n))}function X(n){return n instanceof Tr}let Es=class extends be{__tag;__start;__listType;$config(){return this.config("list",{$transform:e=>{(function(t){const r=t.getNextSibling();J(r)&&t.getListType()===r.getListType()&&gu(t,r)})(e),Mp(e)},extends:be,importDOM:{ol:()=>({conversion:df,priority:0}),ul:()=>({conversion:df,priority:0})}})}constructor(e="number",t=1,r){super(r);const i=dx[e]||e;this.__listType=i,this.__tag=i==="number"?"ol":"ul",this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){const t=this.getWritable();return t.__listType=e,t.__tag=e==="number"?"ol":"ul",t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){const t=this.getWritable();return t.__start=e,t}createDOM(e,t){const r=this.__tag,i=document.createElement(r);return this.__start!==1&&i.setAttribute("start",String(this.__start)),i.__lexicalListType=this.__listType,uf(i,e.theme,this),i}updateDOM(e,t,r){return e.__tag!==this.__tag||e.__listType!==this.__listType||(uf(t,r.theme,this),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){const t=this.createDOM(e._config,e);return re(t)&&(this.__start!==1&&t.setAttribute("start",String(this.__start)),this.__listType==="check"&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,r){let i=r;for(let s=0;s<r.length;s++){const o=r[s];X(o)||(i===r&&(i=[...r]),i[s]=mt().append(!O(o)||J(o)||o.isInline()?o:de(o.getTextContent())))}return super.splice(e,t,i)}extractWithChild(e){return X(e)}};function uf(n,e,t){const r=[],i=[],s=e.list;if(s!==void 0){const o=s[`${t.__tag}Depth`]||[],l=sx(t)-1,a=l%o.length,c=o[a],u=s[t.__tag];let d;const f=s.nested,h=s.checklist;if(f!==void 0&&f.list&&(d=f.list),u!==void 0&&r.push(u),h!==void 0&&t.__listType==="check"&&r.push(h),c!==void 0){r.push(...hn(c));for(let g=0;g<o.length;g++)g!==a&&i.push(t.__tag+g)}if(d!==void 0){const g=hn(d);l>1?r.push(...g):i.push(...g)}}i.length>0&&un(n,...i),r.length>0&&pe(n,...r)}function ux(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t];if(X(r)){e.push(r);const i=r.getChildren();i.length>1&&i.forEach(s=>{J(s)&&e.push(lf(s))})}else e.push(lf(r))}return e}function df(n){const e=n.nodeName.toLowerCase();let t=null;return e==="ol"?t=st("number",n.start):e==="ul"&&(t=(function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list")||r.getAttribute("data-is-checklist")==="1")return!0;for(const i of r.childNodes)if(re(i)&&i.hasAttribute("aria-checked"))return!0;return!1})(n)?st("check"):st("bullet")),{after:ux,node:t}}const dx={ol:"number",ul:"bullet"};function st(n="number",e=1){return Le(new Es(n,e))}function J(n){return n instanceof Es}const bl=z("INSERT_CHECK_LIST_COMMAND");function ff(n){return pt(n.registerCommand(bl,()=>($o("check"),!0),G),n.registerCommand(cr,e=>pf(e,n,!1),G),n.registerCommand(dn,e=>pf(e,n,!0),G),n.registerCommand(ai,()=>{if(tc()!=null){const e=n.getRootElement();return e?.focus(),!0}return!1},G),n.registerCommand(Vo,e=>{const t=tc();return!(t==null||!n.isEditable())&&(n.update(()=>{const r=gt(t);X(r)&&(e.preventDefault(),r.toggleChecked())}),!0)},G),n.registerCommand(ys,e=>n.getEditorState().read(()=>{const t=M();if(N(t)&&t.isCollapsed()){const{anchor:r}=t,i=r.type==="element";if(i||r.offset===0){const s=r.getNode(),o=oe(s,l=>O(l)&&!l.isInline());if(X(o)){const l=o.getParent();if(J(l)&&l.getListType()==="check"&&(i||o.getFirstDescendant()===s)){const a=n.getElementByKey(o.__key);if(a!=null&&document.activeElement!==a)return a.focus(),e.preventDefault(),!0}}}}return!1}),G),n.registerRootListener((e,t)=>{e!==null&&(e.addEventListener("click",hf),e.addEventListener("pointerdown",gf)),t!==null&&(t.removeEventListener("click",hf),t.removeEventListener("pointerdown",gf))}))}function $p(n,e){const t=n.target;if(!re(t))return;const r=t.firstChild;if(re(r)&&(r.tagName==="UL"||r.tagName==="OL"))return;const i=t.parentNode;if(!i||i.__lexicalListType!=="check")return;const s=t.getBoundingClientRect(),o=Ab(t),l=n.clientX/o,a=window.getComputedStyle?window.getComputedStyle(t,"::before"):{width:"0px"},c=parseFloat(a.width),u=n.pointerType==="touch"?32:0;(t.dir==="rtl"?l<s.right+u&&l>s.right-c-u:l>s.left-u&&l<s.left+c+u)&&e()}function hf(n){$p(n,()=>{if(re(n.target)){const e=n.target,t=ll(e);t!=null&&t.isEditable()&&t.update(()=>{const r=gt(e);X(r)&&(e.focus(),r.toggleChecked())})}})}function gf(n){$p(n,()=>{n.preventDefault()})}function tc(){const n=document.activeElement;return re(n)&&n.tagName==="LI"&&n.parentNode!=null&&n.parentNode.__lexicalListType==="check"?n:null}function pf(n,e,t){const r=tc();return r!=null&&e.update(()=>{const i=gt(r);if(!X(i))return;const s=(function(o,l){let a=l?o.getPreviousSibling():o.getNextSibling(),c=o;for(;a==null&&X(c);)c=c.getParentOrThrow().getParent(),c!=null&&(a=l?c.getPreviousSibling():c.getNextSibling());for(;X(a);){const u=l?a.getLastChild():a.getFirstChild();if(!J(u))return a;a=l?u.getLastChild():u.getFirstChild()}return null})(i,t);if(s!=null){s.selectStart();const o=e.getElementByKey(s.__key);o!=null&&(n.preventDefault(),setTimeout(()=>{o.focus()},0))}}),!1}const fx=z("UPDATE_LIST_START_COMMAND"),_i=z("INSERT_UNORDERED_LIST_COMMAND"),yi=z("INSERT_ORDERED_LIST_COMMAND"),pu=z("REMOVE_LIST_COMMAND");function ua(n){return pt(n.registerCommand(yi,()=>($o("number"),!0),G),n.registerCommand(fx,e=>{const{listNodeKey:t,newStart:r}=e,i=Y(t);return!!J(i)&&(i.getListType()==="number"&&(i.setStart(r),Mp(i)),!0)},G),n.registerCommand(_i,()=>($o("bullet"),!0),G),n.registerCommand(pu,()=>(Op(),!0),G),n.registerCommand(Fn,()=>ax(),G),n.registerNodeTransform(Tr,e=>{const t=e.getFirstChild();if(t){if(I(t)){const r=t.getStyle(),i=t.getFormat();e.getTextStyle()!==r&&e.setTextStyle(r),e.getTextFormat()!==i&&e.setTextFormat(i)}}else{const r=M();N(r)&&(r.style!==e.getTextStyle()||r.format!==e.getTextFormat())&&r.isCollapsed()&&e.is(r.anchor.getNode())&&e.setTextStyle(r.style).setTextFormat(r.format)}}),n.registerNodeTransform(qe,e=>{const t=e.getParent();if(X(t)&&e.is(t.getFirstChild())){const r=e.getStyle(),i=e.getFormat();r===t.getTextStyle()&&i===t.getTextFormat()||t.setTextStyle(r).setTextFormat(i)}}))}function da(n,e){n.update(()=>$o(e))}function hx(n){n.update(()=>Op())}const mu=/^(\d+(?:\.\d+)?)px$/,ke={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class Nr extends be{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;static getType(){return"tablecell"}static clone(e){return new Nr(e.__headerState,e.__colSpan,e.__width,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__rowSpan=e.__rowSpan,this.__backgroundColor=e.__backgroundColor,this.__verticalAlign=e.__verticalAlign}static importDOM(){return{td:e=>({conversion:mf,priority:0}),th:e=>({conversion:mf,priority:0})}}static importJSON(e){return Ht().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHeaderStyles(e.headerState).setColSpan(e.colSpan||1).setRowSpan(e.rowSpan||1).setWidth(e.width||void 0).setBackgroundColor(e.backgroundColor||null).setVerticalAlign(e.verticalAlign||void 0)}constructor(e=ke.NO_STATUS,t=1,r,i){super(i),this.__colSpan=t,this.__rowSpan=1,this.__headerState=e,this.__width=r,this.__backgroundColor=null,this.__verticalAlign=void 0}createDOM(e){const t=document.createElement(this.getTag());return this.__width&&(t.style.width=`${this.__width}px`),this.__colSpan>1&&(t.colSpan=this.__colSpan),this.__rowSpan>1&&(t.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(t.style.backgroundColor=this.__backgroundColor),nc(this.__verticalAlign)&&(t.style.verticalAlign=this.__verticalAlign),pe(t,e.theme.tableCell,this.hasHeader()&&e.theme.tableCellHeader),t}exportDOM(e){const t=super.exportDOM(e);if(re(t.element)){const r=t.element;r.setAttribute("data-temporary-table-cell-lexical-key",this.getKey()),r.style.border="1px solid black",this.__colSpan>1&&(r.colSpan=this.__colSpan),this.__rowSpan>1&&(r.rowSpan=this.__rowSpan),r.style.width=`${this.getWidth()||75}px`,r.style.verticalAlign=this.getVerticalAlign()||"top",r.style.textAlign="start",this.__backgroundColor===null&&this.hasHeader()&&(r.style.backgroundColor="#f2f3f5")}return t}exportJSON(){return{...super.exportJSON(),...nc(this.__verticalAlign)&&{verticalAlign:this.__verticalAlign},backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,width:this.getWidth()}}getColSpan(){return this.getLatest().__colSpan}setColSpan(e){const t=this.getWritable();return t.__colSpan=e,t}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(e){const t=this.getWritable();return t.__rowSpan=e,t}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(e,t=ke.BOTH){const r=this.getWritable();return r.__headerState=e&t|r.__headerState&~t,r}getHeaderStyles(){return this.getLatest().__headerState}setWidth(e){const t=this.getWritable();return t.__width=e,t}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(e){const t=this.getWritable();return t.__backgroundColor=e,t}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(e){const t=this.getWritable();return t.__verticalAlign=e||void 0,t}toggleHeaderStyle(e){const t=this.getWritable();return(t.__headerState&e)===e?t.__headerState-=e:t.__headerState+=e,t}hasHeaderState(e){return(this.getHeaderStyles()&e)===e}hasHeader(){return this.getLatest().__headerState!==ke.NO_STATUS}updateDOM(e){return e.__headerState!==this.__headerState||e.__width!==this.__width||e.__colSpan!==this.__colSpan||e.__rowSpan!==this.__rowSpan||e.__backgroundColor!==this.__backgroundColor||e.__verticalAlign!==this.__verticalAlign}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function nc(n){return n==="middle"||n==="bottom"}function mf(n){const e=n,t=n.nodeName.toLowerCase();let r;mu.test(e.style.width)&&(r=parseFloat(e.style.width));const i=Ht(t==="th"?ke.ROW:ke.NO_STATUS,e.colSpan,r);i.__rowSpan=e.rowSpan;const s=e.style.backgroundColor;s!==""&&(i.__backgroundColor=s);const o=e.style.verticalAlign;nc(o)&&(i.__verticalAlign=o);const l=e.style,a=(l&&l.textDecoration||"").split(" "),c=l.fontWeight==="700"||l.fontWeight==="bold",u=a.includes("line-through"),d=l.fontStyle==="italic",f=a.includes("underline");return{after:h=>{const g=[];let p=null;const m=()=>{if(p){const b=p.getFirstChild();ue(b)&&p.getChildrenSize()===1&&b.remove()}};for(const b of h)Bg(b)||I(b)||ue(b)?(I(b)&&(c&&b.toggleFormat("bold"),u&&b.toggleFormat("strikethrough"),d&&b.toggleFormat("italic"),f&&b.toggleFormat("underline")),p?p.append(b):(p=H().append(b),g.push(p))):(g.push(b),m(),p=null);return m(),g.length===0&&g.push(H()),g},node:i}}function Ht(n=ke.NO_STATUS,e=1,t){return Le(new Nr(n,e,t))}function ge(n){return n instanceof Nr}const ks=z("INSERT_TABLE_COMMAND");function ee(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}class bi extends be{__height;static getType(){return"tablerow"}static clone(e){return new bi(e.__height,e.__key)}static importDOM(){return{tr:e=>({conversion:gx,priority:0})}}static importJSON(e){return is().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHeight(e.height)}constructor(e,t){super(t),this.__height=e}exportJSON(){const e=this.getHeight();return{...super.exportJSON(),...e===void 0?void 0:{height:e}}}createDOM(e){const t=document.createElement("tr");return this.__height&&(t.style.height=`${this.__height}px`),pe(t,e.theme.tableRow),t}extractWithChild(e,t,r){return r==="html"}isShadowRoot(){return!0}setHeight(e){const t=this.getWritable();return t.__height=e,t}getHeight(){return this.getLatest().__height}updateDOM(e){return e.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function gx(n){const e=n;let t;return mu.test(e.style.height)&&(t=parseFloat(e.style.height)),{after:r=>cp(r,ge),node:is(t)}}function is(n){return Le(new bi(n))}function tt(n){return n instanceof bi}const Ip=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,px=Ip&&"documentMode"in document?document.documentMode:null;function mx(n,e,t=!0){const r=yu();for(let i=0;i<n;i++){const s=is();for(let o=0;o<e;o++){let l=ke.NO_STATUS;typeof t=="object"?(i===0&&t.rows&&(l|=ke.ROW),o===0&&t.columns&&(l|=ke.COLUMN)):t&&(i===0&&(l|=ke.ROW),o===0&&(l|=ke.COLUMN));const a=Ht(l),c=H();c.append(de()),a.append(c),s.append(a)}r.append(s)}return r}function _x(n){const e=oe(n,t=>ge(t));return ge(e)?e:null}function Fp(n){const e=oe(n,t=>Jt(t));if(Jt(e))return e;throw new Error("Expected table cell to be inside of table.")}Ip&&"InputEvent"in window&&!px&&new window.InputEvent("input");const rc=(n,e)=>n===ke.BOTH||n===e?e:ke.NO_STATUS;function _f(n=!0){const e=M();N(e)||Ar(e)||ee(188);const t=e.anchor.getNode(),r=e.focus.getNode(),[i]=_t(t),[s,,o]=_t(r),[,l,a]=Sn(o,s,i),{startRow:c}=a,{startRow:u}=l;return n?ic(c+i.__rowSpan>u+s.__rowSpan?i:s,!0):ic(u<c?s:i,!1)}function ic(n,e=!0){const[,,t]=_t(n),[r,i]=Sn(t,n,n),s=r[0].length,{startRow:o}=i;let l=null;if(e){const a=o+n.__rowSpan-1,c=r[a],u=is();for(let f=0;f<s;f++){const{cell:h,startRow:g}=c[f];if(g+h.__rowSpan-1<=a){const p=c[f].cell.__headerState,m=rc(p,ke.COLUMN);u.append(Ht(m).append(H()))}else h.setRowSpan(h.__rowSpan+1)}const d=t.getChildAtIndex(a);tt(d)||ee(256),d.insertAfter(u),l=u}else{const a=o,c=r[a],u=is();for(let f=0;f<s;f++){const{cell:h,startRow:g}=c[f];if(g===a){const p=c[f].cell.__headerState,m=rc(p,ke.COLUMN);u.append(Ht(m).append(H()))}else h.setRowSpan(h.__rowSpan+1)}const d=t.getChildAtIndex(a);tt(d)||ee(257),d.insertBefore(u),l=u}return l}function yf(n=!0){const e=M();N(e)||Ar(e)||ee(188);const t=e.anchor.getNode(),r=e.focus.getNode(),[i]=_t(t),[s,,o]=_t(r),[,l,a]=Sn(o,s,i),{startColumn:c}=a,{startColumn:u}=l;return n?sc(c+i.__colSpan>u+s.__colSpan?i:s,!0):sc(u<c?s:i,!1)}function sc(n,e=!0,t=!0){const[,,r]=_t(n),[i,s]=Sn(r,n,n),o=i.length,{startColumn:l}=s,a=e?l+n.__colSpan-1:l-1,c=r.getFirstChild();tt(c)||ee(120);let u=null;function d(g=ke.NO_STATUS){const p=Ht(g).append(H());return u===null&&(u=p),p}let f=c;e:for(let g=0;g<o;g++){if(g!==0){const S=f.getNextSibling();tt(S)||ee(121),f=S}const p=i[g],m=p[a<0?0:a].cell.__headerState,b=rc(m,ke.ROW);if(a<0){_u(f,d(b));continue}const{cell:_,startColumn:y,startRow:C}=p[a];if(y+_.__colSpan-1<=a){let S=_,x=C,k=a;for(;x!==g&&S.__rowSpan>1;){if(k-=_.__colSpan,!(k>=0)){f.append(d(b));continue e}{const{cell:v,startRow:E}=p[k];S=v,x=E}}S.insertAfter(d(b))}else _.setColSpan(_.__colSpan+1)}u!==null&&t&&ss(u);const h=r.getColWidths();if(h){const g=[...h],p=a<0?0:a,m=g[p];g.splice(p,0,m),r.setColWidths(g)}return u}function yx(){const n=M();N(n)||Ar(n)||ee(188);const[e,t]=n.isBackward()?[n.focus.getNode(),n.anchor.getNode()]:[n.anchor.getNode(),n.focus.getNode()],[r,,i]=_t(e),[s]=_t(t),[o,l,a]=Sn(i,r,s),{startRow:c}=l,{startRow:u}=a,d=u+s.__rowSpan-1;if(o.length===d-c+1)return void i.remove();const f=o[0].length,h=o[d+1],g=i.getChildAtIndex(d+1);for(let p=d;p>=c;p--){for(let b=f-1;b>=0;b--){const{cell:_,startRow:y,startColumn:C}=o[p][b];if(C===b){if(y<c||y+_.__rowSpan-1>d){const S=Math.max(y,c),x=Math.min(_.__rowSpan+y-1,d),k=S<=x?x-S+1:0;_.setRowSpan(_.__rowSpan-k)}if(y>=c&&y+_.__rowSpan-1>d&&p===d){g===null&&ee(122);let S=null;for(let x=0;x<b;x++){const k=h[x],v=k.cell;k.startRow===p+1&&(S=v),v.__colSpan>1&&(x+=v.__colSpan-1)}S===null?_u(g,_):S.insertAfter(_)}}}const m=i.getChildAtIndex(p);tt(m)||ee(206,String(p)),m.remove()}if(h!==void 0){const{cell:p}=h[0];ss(p)}else{const p=o[c-1],{cell:m}=p[0];ss(m)}}function bx(){const n=M();N(n)||Ar(n)||ee(188);const e=n.anchor.getNode(),t=n.focus.getNode(),[r,,i]=_t(e),[s]=_t(t),[o,l,a]=Sn(i,r,s),{startColumn:c}=l,{startRow:u,startColumn:d}=a,f=Math.min(c,d),h=Math.max(c+r.__colSpan-1,d+s.__colSpan-1),g=h-f+1;if(o[0].length===h-f+1)return i.selectPrevious(),void i.remove();const p=o.length;for(let y=0;y<p;y++)for(let C=f;C<=h;C++){const{cell:S,startColumn:x}=o[y][C];if(x<f){if(C===f){const k=f-x;S.setColSpan(S.__colSpan-Math.min(g,S.__colSpan-k))}}else if(x+S.__colSpan-1>h){if(C===h){const k=h-x+1;S.setColSpan(S.__colSpan-k)}}else S.remove()}const m=o[u],b=c>d?m[c+r.__colSpan]:m[d+s.__colSpan];if(b!==void 0){const{cell:y}=b;ss(y)}else{const y=d<c?m[d-1]:m[c-1],{cell:C}=y;ss(C)}const _=i.getColWidths();if(_){const y=[..._];y.splice(f,g),i.setColWidths(y)}}function ss(n){const e=n.getFirstDescendant();e==null?n.selectStart():e.getParentOrThrow().selectStart()}function _u(n,e){const t=n.getFirstChild();t!==null?t.insertBefore(e):n.append(e)}function xx(n){if(n.length===0)return null;const e=Fp(n[0]),[t]=ln(e,null,null);let r=1/0,i=-1/0,s=1/0,o=-1/0;const l=new Set;for(const h of t)for(const g of h){if(!g||!g.cell)continue;const p=g.cell.getKey();if(!l.has(p)&&n.some(m=>m.is(g.cell))){l.add(p);const m=g.startRow,b=g.startColumn,_=g.cell.__rowSpan||1,y=g.cell.__colSpan||1;r=Math.min(r,m),i=Math.max(i,m+_-1),s=Math.min(s,b),o=Math.max(o,b+y-1)}}if(r===1/0||s===1/0)return null;const a=i-r+1,c=o-s+1,u=t[r][s];if(!u.cell)return null;const d=u.cell;d.setColSpan(c),d.setRowSpan(a);const f=new Set([d.getKey()]);for(let h=r;h<=i;h++)for(let g=s;g<=o;g++){const p=t[h][g];if(!p.cell)continue;const m=p.cell,b=m.getKey();f.has(b)||(f.add(b),Sx(m)||d.append(...m.getChildren()),m.remove())}return d.getChildrenSize()===0&&d.append(H()),d}function Sx(n){if(n.getChildrenSize()!==1)return!1;const e=n.getFirstChildOrThrow();return!(!Er(e)||!e.isEmpty())}function Cx(n){const[e,t,r]=_t(n),i=e.__colSpan,s=e.__rowSpan;if(i===1&&s===1)return;const[o,l]=Sn(r,e,e),{startColumn:a,startRow:c}=l,u=e.__headerState&ke.COLUMN,d=Array.from({length:i},(g,p)=>{let m=u;for(let b=0;m!==0&&b<o.length;b++)m&=o[b][p+a].cell.__headerState;return m}),f=e.__headerState&ke.ROW,h=Array.from({length:s},(g,p)=>{let m=f;for(let b=0;m!==0&&b<o[0].length;b++)m&=o[p+c][b].cell.__headerState;return m});if(i>1){for(let g=1;g<i;g++)e.insertAfter(Ht(d[g]|h[0]).append(H()));e.setColSpan(1)}if(s>1){let g;for(let p=1;p<s;p++){const m=c+p,b=o[m];g=(g||t).getNextSibling(),tt(g)||ee(125);let _=null;for(let y=0;y<a;y++){const C=b[y],S=C.cell;C.startRow===m&&(_=S),S.__colSpan>1&&(y+=S.__colSpan-1)}if(_===null)for(let y=i-1;y>=0;y--)_u(g,Ht(d[y]|h[p]).append(H()));else for(let y=i-1;y>=0;y--)_.insertAfter(Ht(d[y]|h[p]).append(H()))}e.setRowSpan(1)}}function Sn(n,e,t){const[r,i,s]=ln(n,e,t);return i===null&&ee(207),s===null&&ee(208),[r,i,s]}function ln(n,e,t){const r=[];let i=null,s=null;function o(a){let c=r[a];return c===void 0&&(r[a]=c=[]),c}const l=n.getChildren();for(let a=0;a<l.length;a++){const c=l[a];tt(c)||ee(209);const u=o(a);for(let d=c.getFirstChild(),f=0;d!=null;d=d.getNextSibling()){for(ge(d)||ee(147);u[f]!==void 0;)f++;const h={cell:d,startColumn:f,startRow:a},{__rowSpan:g,__colSpan:p}=d;for(let m=0;m<g&&!(a+m>=l.length);m++){const b=o(a+m);for(let _=0;_<p;_++)b[f+_]=h}e!==null&&i===null&&e.is(d)&&(i=h),t!==null&&s===null&&t.is(d)&&(s=h)}}return[r,i,s]}function _t(n){let e;if(n instanceof Nr)e=n;else if("__type"in n){const i=oe(n,ge);ge(i)||ee(148),e=i}else{const i=oe(n.getNode(),ge);ge(i)||ee(148),e=i}const t=e.getParent();tt(t)||ee(149);const r=t.getParent();return Jt(r)||ee(210),[e,t,r]}function Dp(n,e,t){let r,i=Math.min(e.startColumn,t.startColumn),s=Math.min(e.startRow,t.startRow),o=Math.max(e.startColumn+e.cell.__colSpan-1,t.startColumn+t.cell.__colSpan-1),l=Math.max(e.startRow+e.cell.__rowSpan-1,t.startRow+t.cell.__rowSpan-1);do{r=!1;for(let a=0;a<n.length;a++)for(let c=0;c<n[0].length;c++){const u=n[a][c];if(!u)continue;const d=u.startColumn+u.cell.__colSpan-1,f=u.startRow+u.cell.__rowSpan-1,h=u.startColumn<=o&&d>=i,g=u.startRow<=l&&f>=s;if(h&&g){const p=Math.min(i,u.startColumn),m=Math.max(o,d),b=Math.min(s,u.startRow),_=Math.max(l,f);p===i&&m===o&&b===s&&_===l||(i=p,o=m,s=b,l=_,r=!0)}}}while(r);return{maxColumn:o,maxRow:l,minColumn:i,minRow:s}}function bf(n){const[e,,t]=_t(n),r=t.getChildren(),i=r.length,s=r[0].getChildren().length,o=new Array(i);for(let l=0;l<i;l++)o[l]=new Array(s);for(let l=0;l<i;l++){const a=r[l].getChildren();let c=0;for(let u=0;u<a.length;u++){for(;o[l][c];)c++;const d=a[u],f=d.__rowSpan||1,h=d.__colSpan||1;for(let g=0;g<f;g++)for(let p=0;p<h;p++)o[l+g][c+p]=d;if(e===d)return{colSpan:h,columnIndex:c,rowIndex:l,rowSpan:f};c+=h}}return null}function xf(n){const[[e,t,r,i],[s,o,l,a]]=["anchor","focus"].map(c=>{const u=n[c].getNode(),d=oe(u,ge);ge(d)||ee(238,c,u.getKey(),u.getType());const f=d.getParent();tt(f)||ee(239,c);const h=f.getParent();return Jt(h)||ee(240,c),[u,d,f,h]});return i.is(a)||ee(241),{anchorCell:t,anchorNode:e,anchorRow:r,anchorTable:i,focusCell:o,focusNode:s,focusRow:l,focusTable:a}}let Lp=class Rp{tableKey;anchor;focus;_cachedNodes;dirty;constructor(e,t,r){this.anchor=t,this.focus=r,t._selection=this,r._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=e}getStartEndPoints(){return[this.anchor,this.focus]}isValid(){if(this.tableKey==="root"||this.anchor.key==="root"||this.anchor.type!=="element"||this.focus.key==="root"||this.focus.type!=="element")return!1;const e=Y(this.tableKey),t=Y(this.anchor.key),r=Y(this.focus.key);return e!==null&&t!==null&&r!==null}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return Ar(e)&&this.tableKey===e.tableKey&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)}set(e,t,r){this.dirty=this.dirty||e!==this.tableKey||t!==this.anchor.key||r!==this.focus.key,this.tableKey=e,this.anchor.key=t,this.focus.key=r,this._cachedNodes=null}clone(){return new Rp(this.tableKey,Te(this.anchor.key,this.anchor.offset,this.anchor.type),Te(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(e){}insertText(){}hasFormat(e){let t=0;this.getNodes().filter(ge).forEach(i=>{const s=i.getFirstChild();Er(s)&&(t|=s.getTextFormat())});const r=Ue[e];return(t&r)!==0}insertNodes(e){const t=this.focus.getNode();O(t)||ee(151),In(t.select(0,t.getChildrenSize())).insertNodes(e)}getShape(){const{anchorCell:e,focusCell:t}=xf(this),r=bf(e);r===null&&ee(153);const i=bf(t);i===null&&ee(155);const s=Math.min(r.columnIndex,i.columnIndex),o=Math.max(r.columnIndex+r.colSpan-1,i.columnIndex+i.colSpan-1),l=Math.min(r.rowIndex,i.rowIndex),a=Math.max(r.rowIndex+r.rowSpan-1,i.rowIndex+i.rowSpan-1);return{fromX:Math.min(s,o),fromY:Math.min(l,a),toX:Math.max(s,o),toY:Math.max(l,a)}}getNodes(){if(!this.isValid())return[];const e=this._cachedNodes;if(e!==null)return e;const{anchorTable:t,anchorCell:r,focusCell:i}=xf(this),s=i.getParents()[1];if(s!==t){if(t.isParentOf(i)){const m=s.getParent();m==null&&ee(159),this.set(this.tableKey,i.getKey(),m.getKey())}else{const m=t.getParent();m==null&&ee(158),this.set(this.tableKey,m.getKey(),i.getKey())}return this.getNodes()}const[o,l,a]=Sn(t,r,i),{minColumn:c,maxColumn:u,minRow:d,maxRow:f}=Dp(o,l,a),h=new Map([[t.getKey(),t]]);let g=null;for(let m=d;m<=f;m++)for(let b=c;b<=u;b++){const{cell:_}=o[m][b],y=_.getParent();tt(y)||ee(160),y!==g&&(h.set(y.getKey(),y),g=y),h.has(_.getKey())||Ex(_,C=>{h.set(C.getKey(),C)})}const p=Array.from(h.values());return Cr()||(this._cachedNodes=p),p}getTextContent(){const e=this.getNodes().filter(r=>ge(r));let t="";for(let r=0;r<e.length;r++){const i=e[r],s=i.__parent,o=(e[r+1]||{}).__parent;t+=i.getTextContent()+(o!==s?`
14
+ `:" ")}return t}};function Ar(n){return n instanceof Lp}function wx(){const n=Te("root",0,"element"),e=Te("root",0,"element");return new Lp("root",n,e)}function vx(n,e,t){n.getKey(),e.getKey(),t.getKey();const r=M(),i=Ar(r)?r.clone():wx();return i.set(n.getKey(),e.getKey(),t.getKey()),i}function Ex(n,e){const t=[[n]];for(let r=t.at(-1);r!==void 0&&t.length>0;r=t.at(-1)){const i=r.pop();i===void 0?t.pop():e(i)!==!1&&O(i)&&t.push(i.getChildren())}}function Oi(n){return re(n)&&n.nodeName==="TABLE"}function kx(n,e){for(let t=e,r=null;t!==null;t=t.getParent()){if(n.is(t))return r;ge(t)&&(r=t)}return null}function oc(n){const e=oe(n,Jt);return Jt(e)?e:null}function Tx(n,e,t){return kx(n,gt(e,t))}function Sf(n,e,t){if(!e.theme.tableAlignment)return;const r=[],i=[];for(const s of["center","right"]){const o=e.theme.tableAlignment[s];o&&(s===t?i:r).push(o)}un(n,...r),pe(n,...i)}const Nx=new WeakSet;function Cf(n=gi()){return Nx.has(n)}class mr extends be{__rowStriping;__frozenColumnCount;__frozenRowCount;__colWidths;static getType(){return"table"}getColWidths(){return this.getLatest().__colWidths}setColWidths(e){const t=this.getWritable();return t.__colWidths=e,t}static clone(e){return new mr(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__colWidths=e.__colWidths,this.__rowStriping=e.__rowStriping,this.__frozenColumnCount=e.__frozenColumnCount,this.__frozenRowCount=e.__frozenRowCount}static importDOM(){return{table:e=>({conversion:Ax,priority:1})}}static importJSON(e){return yu().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setRowStriping(e.rowStriping||!1).setFrozenColumns(e.frozenColumnCount||0).setFrozenRows(e.frozenRowCount||0).setColWidths(e.colWidths)}constructor(e){super(e),this.__rowStriping=!1,this.__frozenColumnCount=0,this.__frozenRowCount=0,this.__colWidths=void 0}exportJSON(){return{...super.exportJSON(),colWidths:this.getColWidths(),frozenColumnCount:this.__frozenColumnCount?this.__frozenColumnCount:void 0,frozenRowCount:this.__frozenRowCount?this.__frozenRowCount:void 0,rowStriping:this.__rowStriping?this.__rowStriping:void 0}}extractWithChild(e,t,r){return r==="html"}getDOMSlot(e){const t=Oi(e)?e:e.querySelector("table");return Oi(t)||ee(229),super.getDOMSlot(e).withElement(t).withAfter(t.querySelector("colgroup"))}createDOM(e,t){const r=document.createElement("table");this.__style&&(r.style.cssText=this.__style);const i=document.createElement("colgroup");if(r.appendChild(i),Wg(i),pe(r,e.theme.table),this.updateTableElement(null,r,e),Cf(t)){const s=document.createElement("div"),o=e.theme.tableScrollableWrapper;return o?pe(s,o):s.style.cssText="overflow-x: auto;",s.appendChild(r),this.updateTableWrapper(null,s,r,e),s}return r}updateTableWrapper(e,t,r,i){this.__frozenColumnCount!==(e?e.__frozenColumnCount:0)&&(function(s,o,l,a){a>0?(pe(s,l.theme.tableFrozenColumn),o.setAttribute("data-lexical-frozen-column","true")):(un(s,l.theme.tableFrozenColumn),o.removeAttribute("data-lexical-frozen-column"))})(t,r,i,this.__frozenColumnCount),this.__frozenRowCount!==(e?e.__frozenRowCount:0)&&(function(s,o,l,a){a>0?(pe(s,l.theme.tableFrozenRow),o.setAttribute("data-lexical-frozen-row","true")):(un(s,l.theme.tableFrozenRow),o.removeAttribute("data-lexical-frozen-row"))})(t,r,i,this.__frozenRowCount)}updateTableElement(e,t,r){this.__style!==(e?e.__style:"")&&(t.style.cssText=this.__style),this.__rowStriping!==(!!e&&e.__rowStriping)&&(function(i,s,o){o?(pe(i,s.theme.tableRowStriping),i.setAttribute("data-lexical-row-striping","true")):(un(i,s.theme.tableRowStriping),i.removeAttribute("data-lexical-row-striping"))})(t,r,this.__rowStriping),(function(i,s,o,l){const a=i.querySelector("colgroup");if(!a)return;const c=[];for(let u=0;u<o;u++){const d=document.createElement("col"),f=l&&l[u];f&&(d.style.width=`${f}px`),c.push(d)}a.replaceChildren(...c)})(t,0,this.getColumnCount(),this.getColWidths()),Sf(t,r,this.getFormatType())}updateDOM(e,t,r){const i=this.getDOMSlot(t).element;return t===i===Cf()||(re(s=t)&&s.nodeName==="DIV"&&this.updateTableWrapper(e,t,i,r),this.updateTableElement(e,i,r),!1);var s}exportDOM(e){const t=super.exportDOM(e),{element:r}=t;return{after:i=>{if(t.after&&(i=t.after(i)),!Oi(i)&&re(i)&&(i=i.querySelector("table")),!Oi(i))return null;Sf(i,e._config,this.getFormatType());const[s]=ln(this,null,null),o=new Map;for(const u of s)for(const d of u){const f=d.cell.getKey();o.has(f)||o.set(f,{colSpan:d.cell.getColSpan(),startColumn:d.startColumn})}const l=new Set;for(const u of i.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")){const d=u.getAttribute("data-temporary-table-cell-lexical-key");if(d){const f=o.get(d);if(u.removeAttribute("data-temporary-table-cell-lexical-key"),f){o.delete(d);for(let h=0;h<f.colSpan;h++)l.add(h+f.startColumn)}}}const a=i.querySelector(":scope > colgroup");if(a){const u=Array.from(i.querySelectorAll(":scope > colgroup > col")).filter((d,f)=>l.has(f));a.replaceChildren(...u)}const c=i.querySelectorAll(":scope > tr");if(c.length>0){const u=document.createElement("tbody");for(const d of c)u.appendChild(d);i.append(u)}return i},element:!Oi(r)&&re(r)?r.querySelector("table"):r}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(e,t){const{rows:r,domRows:i}=t;for(let s=0;s<r;s++){const o=i[s];if(o!=null)for(let l=0;l<o.length;l++){const a=o[l];if(a==null)continue;const{elem:c}=a,u=Tx(this,c);if(u!==null&&e.is(u))return{x:l,y:s}}}throw new Error("Cell not found in table.")}getDOMCellFromCords(e,t,r){const{domRows:i}=r,s=i[t];if(s==null)return null;const o=s[e<s.length?e:s.length-1];return o??null}getDOMCellFromCordsOrThrow(e,t,r){const i=this.getDOMCellFromCords(e,t,r);if(!i)throw new Error("Cell not found at cords.");return i}getCellNodeFromCords(e,t,r){const i=this.getDOMCellFromCords(e,t,r);if(i==null)return null;const s=gt(i.elem);return ge(s)?s:null}getCellNodeFromCordsOrThrow(e,t,r){const i=this.getCellNodeFromCords(e,t,r);if(!i)throw new Error("Node at cords not TableCellNode.");return i}getRowStriping(){return!!this.getLatest().__rowStriping}setRowStriping(e){const t=this.getWritable();return t.__rowStriping=e,t}setFrozenColumns(e){const t=this.getWritable();return t.__frozenColumnCount=e,t}getFrozenColumns(){return this.getLatest().__frozenColumnCount}setFrozenRows(e){const t=this.getWritable();return t.__frozenRowCount=e,t}getFrozenRows(){return this.getLatest().__frozenRowCount}canSelectBefore(){return!0}canIndent(){return!1}getColumnCount(){const e=this.getFirstChild();if(!e)return 0;let t=0;return e.getChildren().forEach(r=>{ge(r)&&(t+=r.getColSpan())}),t}}function Ax(n){const e=yu();n.hasAttribute("data-lexical-row-striping")&&e.setRowStriping(!0),n.hasAttribute("data-lexical-frozen-column")&&e.setFrozenColumns(1),n.hasAttribute("data-lexical-frozen-row")&&e.setFrozenRows(1);const t=n.querySelector(":scope > colgroup");if(t){let r=[];for(const i of t.querySelectorAll(":scope > col")){let s=i.style.width||"";if(!mu.test(s)&&(s=i.getAttribute("width")||"",!/^\d+$/.test(s))){r=void 0;break}r.push(parseFloat(s))}r&&e.setColWidths(r)}return{after:r=>cp(r,tt),node:e}}function yu(){return Le(new mr)}function Jt(n){return n instanceof mr}function Ox(n){tt(n.getParent())?n.isEmpty()&&n.append(H()):n.remove()}function Mx(n){Jt(n.getParent())?lp(n,ge):n.remove()}function $x(n){lp(n,tt);const[e]=ln(n,null,null),t=e.reduce((o,l)=>Math.max(o,l.length),0),r=n.getChildren();for(let o=0;o<e.length;++o){const l=r[o];if(!l)continue;tt(l)||ee(254,l.constructor.name,l.getType());const a=e[o].reduce((c,u)=>u?1+c:c,0);if(a!==t)for(let c=a;c<t;++c){const u=Ht();u.append(H()),l.append(u)}}const i=n.getColWidths(),s=n.getColumnCount();if(i&&i.length!==s){let o;if(s<i.length)o=i.slice(0,s);else if(i.length>0){const l=i[i.length-1];o=[...i,...Array(s-i.length).fill(l)]}n.setColWidths(o)}}function Ix(n){if(n.detail<3||!jn(n.target))return!1;const e=gt(n.target);if(e===null)return!1;const t=oe(e,r=>O(r)&&!r.isInline());return t===null?!1:!!ge(t.getParent())&&(t.select(0),!0)}function Fx(){const n=M();if(!N(n))return!1;const e=oc(n.anchor.getNode());if(e===null)return!1;const t=fe();if(!t.is(e.getParent())||t.getChildrenSize()!==1)return!1;const[r]=ln(e,null,null);if(r.length===0||r[0].length===0)return!1;const i=r[0][0];if(!i||!i.cell)return!1;const s=r[r.length-1],o=s[s.length-1];if(!o||!o.cell)return!1;const l=vx(e,i.cell,o.cell);return Fe(l),!0}function wf(n,e){n.hasNodes([mr])||ee(255);const{hasNestedTables:t=bp(!1)}=e??{};return pt(n.registerCommand(ks,r=>(function({rows:i,columns:s,includeHeaders:o},l){const a=M()||bn();if(!a||!N(a)||!l&&oc(a.anchor.getNode()))return!1;const c=mx(Number(i),Number(s),o);Tb(c);const u=c.getFirstDescendant();return I(u)&&u.select(),!0})(r,t.peek()),B),n.registerCommand(Nc,(r,i)=>{if(n!==i)return!1;if((function(l){const{nodes:a,selection:c}=l,u=c.getStartEndPoints(),d=Ar(c),f=N(c),h=f&&oe(c.anchor.getNode(),j=>ge(j))!==null&&oe(c.focus.getNode(),j=>ge(j))!==null||d;if(a.length!==1||!Jt(a[0])||!h||u===null)return!1;const[g,p]=u,[m,b,_]=_t(g),y=oe(p.getNode(),j=>ge(j));if(!(ge(m)&&ge(y)&&tt(b)&&Jt(_)))return!1;const C=a[0],[S,x,k]=Sn(_,m,y),[v]=ln(C,null,null),E=S.length,A=E>0?S[0].length:0;let T=x.startRow,D=x.startColumn,P=v.length,$=P>0?v[0].length:0;if(d){const j=Dp(S,x,k),xe=j.maxRow-j.minRow+1,le=j.maxColumn-j.minColumn+1;T=j.minRow,D=j.minColumn,P=Math.min(P,xe),$=Math.min($,le)}let U=!1;const W=Math.min(E,T+P)-1,q=Math.min(A,D+$)-1,se=new Set;for(let j=T;j<=W;j++)for(let xe=D;xe<=q;xe++){const le=S[j][xe];se.has(le.cell.getKey())||le.cell.__rowSpan===1&&le.cell.__colSpan===1||(Cx(le.cell),se.add(le.cell.getKey()),U=!0)}let[Q]=ln(_.getWritable(),null,null);const Pe=P-E+T;for(let j=0;j<Pe;j++)ic(Q[E-1][0].cell);const at=$-A+D;for(let j=0;j<at;j++)sc(Q[0][A-1].cell,!0,!1);[Q]=ln(_.getWritable(),null,null);for(let j=T;j<T+P;j++)for(let xe=D;xe<D+$;xe++){const le=j-T,Ze=xe-D,ve=v[le][Ze];if(ve.startRow!==le||ve.startColumn!==Ze)continue;const Be=ve.cell;if(Be.__rowSpan!==1||Be.__colSpan!==1){const Ne=[],wn=Math.min(j+Be.__rowSpan,T+P)-1,Ei=Math.min(xe+Be.__colSpan,D+$)-1;for(let Zt=j;Zt<=wn;Zt++)for(let ki=xe;ki<=Ei;ki++){const Gl=Q[Zt][ki];Ne.push(Gl.cell)}xx(Ne),U=!0}const{cell:ze}=Q[j][xe],kt=ze.getChildren();Be.getChildren().forEach(Ne=>{I(Ne)&&H().append(Ne),ze.append(Ne)}),kt.forEach(Ne=>Ne.remove())}if(d&&U){const[j]=ln(_.getWritable(),null,null);j[x.startRow][x.startColumn].cell.selectEnd()}return!0})(r))return!0;const{selection:s,nodes:o}=r;return t.peek()||n!==i||!N(s)?!1:oc(s.anchor.getNode())!==null&&o.some(Jt)},B),n.registerCommand(qr,Fx,G),n.registerCommand(_r,Ix,B),n.registerNodeTransform(mr,$x),n.registerNodeTransform(bi,Mx),n.registerNodeTransform(Nr,Ox))}const Dx=new Set(["http:","https:","mailto:","sms:","tel:"]);class Or extends be{__url;__target;__rel;__title;static getType(){return"link"}static clone(e){return new Or(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e="",t={},r){super(r);const{target:i=null,rel:s=null,title:o=null}=t;this.__url=e,this.__target=i,this.__rel=s,this.__title=o}createDOM(e){const t=document.createElement("a");return this.updateLinkDOM(null,t,e),pe(t,e.theme.link),t}updateLinkDOM(e,t,r){if(ru(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(const i of["target","rel","title"]){const s=`__${i}`,o=this[s];e&&e[s]===o||(o?t[i]=o:t.removeAttribute(i))}}}updateDOM(e,t,r){return this.updateLinkDOM(e,t,r),!1}static importDOM(){return{a:e=>({conversion:Lx,priority:1})}}static importJSON(e){return tr().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){e=kf(e);try{const t=new URL(kf(e));if(!Dx.has(t.protocol))return"about:blank"}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){const t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){const t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){const t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){const t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){const r=tr(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,t),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,r){if(!N(t))return!1;const i=t.anchor.getNode(),s=t.focus.getNode();return this.isParentOf(i)&&this.isParentOf(s)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function Lx(n){let e=null;if(ru(n)){const t=n.textContent;(t!==null&&t!==""||n.children.length>0)&&(e=tr(n.getAttribute("href")||"",{rel:n.getAttribute("rel"),target:n.getAttribute("target"),title:n.getAttribute("title")}))}return{node:e}}function tr(n="",e){return Le(new Or(n,e))}function vn(n){return n instanceof Or}let bu=class Pp extends Or{__isUnlinked;constructor(e="",t={},r){super(e,t,r),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}static getType(){return"autolink"}static clone(e){return new Pp(e.__url,{isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title},e.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){const t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement("span"):super.createDOM(e)}updateDOM(e,t,r){return super.updateDOM(e,t,r)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return vf().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){const r=this.getParentOrThrow().insertNewAfter(e,t);if(O(r)){const i=vf(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return r.append(i),i}return null}};function vf(n="",e){return Le(new bu(n,e))}function Li(n){return n instanceof bu}const lc=z("TOGGLE_LINK_COMMAND");function Ef(n,e){if(n.type==="element"){const t=n.getNode();return O(t)||(function(r,...i){const s=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",r);for(const l of i)o.append("v",l);throw s.search=o.toString(),Error(`Minified Lexical error #${r}; visit ${s.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(252),t.getChildren()[n.offset+e]||null}return null}function Rx(n,e={}){let t;if(n&&typeof n=="object"){const{url:u,...d}=n;t=u,e={...d,...e}}else t=n;const{target:r,title:i}=e,s=e.rel===void 0?"noreferrer":e.rel,o=M();if(o===null||!N(o)&&!He(o))return;if(He(o)){const u=o.getNodes();return u.length===0?void 0:void u.forEach(d=>{if(t===null){const f=oe(d,h=>!Li(h)&&vn(h));f&&(f.insertBefore(d),f.getChildren().length===0&&f.remove())}else{const f=oe(d,h=>!Li(h)&&vn(h));if(f)f.setURL(t),r!==void 0&&f.setTarget(r),s!==void 0&&f.setRel(s);else{const h=tr(t,{rel:s,target:r});d.insertBefore(h),h.append(d)}}})}const l=o.extract();if(t===null){const u=new Set;return void l.forEach(d=>{const f=oe(d,h=>!Li(h)&&vn(h));if(f!==null){const h=f.getKey();if(u.has(h))return;(function(g,p){const m=new Set(p.filter(v=>g.isParentOf(v)).map(v=>v.getKey())),b=g.getChildren(),_=v=>m.has(v.getKey())||O(v)&&p.some(E=>g.isParentOf(E)&&v.isParentOf(E)),y=b.filter(_);if(y.length===b.length)return b.forEach(v=>g.insertBefore(v)),void g.remove();const C=b.findIndex(_),S=b.findLastIndex(_),x=C===0,k=S===b.length-1;if(x)y.forEach(v=>g.insertBefore(v));else if(k)for(let v=y.length-1;v>=0;v--)g.insertAfter(y[v]);else{for(let E=y.length-1;E>=0;E--)g.insertAfter(y[E]);const v=b.slice(S+1);if(v.length>0){const E=tr(g.getURL(),{rel:g.getRel(),target:g.getTarget(),title:g.getTitle()});y[y.length-1].insertAfter(E),v.forEach(A=>E.append(A))}}})(f,l),u.add(h)}})}const a=new Set,c=u=>{a.has(u.getKey())||(a.add(u.getKey()),u.setURL(t),r!==void 0&&u.setTarget(r),s!==void 0&&u.setRel(s),i!==void 0&&u.setTitle(i))};if(l.length===1){const u=l[0],d=oe(u,vn);if(d!==null)return c(d)}(function(u){const d=M();if(!N(d))return u();const f=In(d),h=f.isBackward(),g=Ef(f.anchor,h?-1:0),p=Ef(f.focus,h?0:-1);if(u(),g||p){const m=M();if(N(m)){const b=m.clone();if(g){const _=g.getParent();_&&b.anchor.set(_.getKey(),g.getIndexWithinParent()+(h?1:0),"element")}if(p){const _=p.getParent();_&&b.focus.set(_.getKey(),p.getIndexWithinParent()+(h?0:1),"element")}Fe(In(b))}}})(()=>{let u=null;for(const d of l){if(!d.isAttached())continue;const f=oe(d,vn);if(f){c(f);continue}if(O(d)){if(!d.isInline())continue;if(vn(d)){if(!(Li(d)||u!==null&&u.getParentOrThrow().isParentOf(d))){c(d),u=d;continue}for(const g of d.getChildren())d.insertBefore(g);d.remove();continue}}const h=d.getPreviousSibling();vn(h)&&h.is(u)?h.append(d):(u=tr(t,{rel:s,target:r,title:i}),d.insertAfter(u),u.append(d))}})}const Px=/^\+?[0-9\s()-]{5,}$/;function kf(n){return n.match(/^[a-z][a-z0-9+.-]*:/i)||n.match(/^[/#.]/)?n:n.includes("@")?`mailto:${n}`:Px.test(n)?`tel:${n}`:`https://${n}`}const fa=Rx;var ha={exports:{}},Tf;function Bx(){return Tf||(Tf=1,(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
15
+ * Prism: Lightweight, robust, elegant syntax highlighting
16
+ *
17
+ * @license MIT <https://opensource.org/licenses/MIT>
18
+ * @author Lea Verou <https://lea.verou.me>
19
+ * @namespace
20
+ * @public
21
+ */var t=(function(r){var i=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,s=0,o={},l={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function _(y){return y instanceof a?new a(y.type,_(y.content),y.alias):Array.isArray(y)?y.map(_):y.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(_){return Object.prototype.toString.call(_).slice(8,-1)},objId:function(_){return _.__id||Object.defineProperty(_,"__id",{value:++s}),_.__id},clone:function _(y,C){C=C||{};var S,x;switch(l.util.type(y)){case"Object":if(x=l.util.objId(y),C[x])return C[x];S={},C[x]=S;for(var k in y)y.hasOwnProperty(k)&&(S[k]=_(y[k],C));return S;case"Array":return x=l.util.objId(y),C[x]?C[x]:(S=[],C[x]=S,y.forEach(function(v,E){S[E]=_(v,C)}),S);default:return y}},getLanguage:function(_){for(;_;){var y=i.exec(_.className);if(y)return y[1].toLowerCase();_=_.parentElement}return"none"},setLanguage:function(_,y){_.className=_.className.replace(RegExp(i,"gi"),""),_.classList.add("language-"+y)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(S){var _=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(S.stack)||[])[1];if(_){var y=document.getElementsByTagName("script");for(var C in y)if(y[C].src==_)return y[C]}return null}},isActive:function(_,y,C){for(var S="no-"+y;_;){var x=_.classList;if(x.contains(y))return!0;if(x.contains(S))return!1;_=_.parentElement}return!!C}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(_,y){var C=l.util.clone(l.languages[_]);for(var S in y)C[S]=y[S];return C},insertBefore:function(_,y,C,S){S=S||l.languages;var x=S[_],k={};for(var v in x)if(x.hasOwnProperty(v)){if(v==y)for(var E in C)C.hasOwnProperty(E)&&(k[E]=C[E]);C.hasOwnProperty(v)||(k[v]=x[v])}var A=S[_];return S[_]=k,l.languages.DFS(l.languages,function(T,D){D===A&&T!=_&&(this[T]=k)}),k},DFS:function _(y,C,S,x){x=x||{};var k=l.util.objId;for(var v in y)if(y.hasOwnProperty(v)){C.call(y,v,y[v],S||v);var E=y[v],A=l.util.type(E);A==="Object"&&!x[k(E)]?(x[k(E)]=!0,_(E,C,null,x)):A==="Array"&&!x[k(E)]&&(x[k(E)]=!0,_(E,C,v,x))}}},plugins:{},highlightAll:function(_,y){l.highlightAllUnder(document,_,y)},highlightAllUnder:function(_,y,C){var S={callback:C,container:_,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};l.hooks.run("before-highlightall",S),S.elements=Array.prototype.slice.apply(S.container.querySelectorAll(S.selector)),l.hooks.run("before-all-elements-highlight",S);for(var x=0,k;k=S.elements[x++];)l.highlightElement(k,y===!0,S.callback)},highlightElement:function(_,y,C){var S=l.util.getLanguage(_),x=l.languages[S];l.util.setLanguage(_,S);var k=_.parentElement;k&&k.nodeName.toLowerCase()==="pre"&&l.util.setLanguage(k,S);var v=_.textContent,E={element:_,language:S,grammar:x,code:v};function A(D){E.highlightedCode=D,l.hooks.run("before-insert",E),E.element.innerHTML=E.highlightedCode,l.hooks.run("after-highlight",E),l.hooks.run("complete",E),C&&C.call(E.element)}if(l.hooks.run("before-sanity-check",E),k=E.element.parentElement,k&&k.nodeName.toLowerCase()==="pre"&&!k.hasAttribute("tabindex")&&k.setAttribute("tabindex","0"),!E.code){l.hooks.run("complete",E),C&&C.call(E.element);return}if(l.hooks.run("before-highlight",E),!E.grammar){A(l.util.encode(E.code));return}if(y&&r.Worker){var T=new Worker(l.filename);T.onmessage=function(D){A(D.data)},T.postMessage(JSON.stringify({language:E.language,code:E.code,immediateClose:!0}))}else A(l.highlight(E.code,E.grammar,E.language))},highlight:function(_,y,C){var S={code:_,grammar:y,language:C};if(l.hooks.run("before-tokenize",S),!S.grammar)throw new Error('The language "'+S.language+'" has no grammar.');return S.tokens=l.tokenize(S.code,S.grammar),l.hooks.run("after-tokenize",S),a.stringify(l.util.encode(S.tokens),S.language)},tokenize:function(_,y){var C=y.rest;if(C){for(var S in C)y[S]=C[S];delete y.rest}var x=new d;return f(x,x.head,_),u(_,x,y,x.head,0),g(x)},hooks:{all:{},add:function(_,y){var C=l.hooks.all;C[_]=C[_]||[],C[_].push(y)},run:function(_,y){var C=l.hooks.all[_];if(!(!C||!C.length))for(var S=0,x;x=C[S++];)x(y)}},Token:a};r.Prism=l;function a(_,y,C,S){this.type=_,this.content=y,this.alias=C,this.length=(S||"").length|0}a.stringify=function _(y,C){if(typeof y=="string")return y;if(Array.isArray(y)){var S="";return y.forEach(function(A){S+=_(A,C)}),S}var x={type:y.type,content:_(y.content,C),tag:"span",classes:["token",y.type],attributes:{},language:C},k=y.alias;k&&(Array.isArray(k)?Array.prototype.push.apply(x.classes,k):x.classes.push(k)),l.hooks.run("wrap",x);var v="";for(var E in x.attributes)v+=" "+E+'="'+(x.attributes[E]||"").replace(/"/g,"&quot;")+'"';return"<"+x.tag+' class="'+x.classes.join(" ")+'"'+v+">"+x.content+"</"+x.tag+">"};function c(_,y,C,S){_.lastIndex=y;var x=_.exec(C);if(x&&S&&x[1]){var k=x[1].length;x.index+=k,x[0]=x[0].slice(k)}return x}function u(_,y,C,S,x,k){for(var v in C)if(!(!C.hasOwnProperty(v)||!C[v])){var E=C[v];E=Array.isArray(E)?E:[E];for(var A=0;A<E.length;++A){if(k&&k.cause==v+","+A)return;var T=E[A],D=T.inside,P=!!T.lookbehind,$=!!T.greedy,U=T.alias;if($&&!T.pattern.global){var W=T.pattern.toString().match(/[imsuy]*$/)[0];T.pattern=RegExp(T.pattern.source,W+"g")}for(var q=T.pattern||T,se=S.next,Q=x;se!==y.tail&&!(k&&Q>=k.reach);Q+=se.value.length,se=se.next){var Pe=se.value;if(y.length>_.length)return;if(!(Pe instanceof a)){var at=1,j;if($){if(j=c(q,Q,_,P),!j||j.index>=_.length)break;var ve=j.index,xe=j.index+j[0].length,le=Q;for(le+=se.value.length;ve>=le;)se=se.next,le+=se.value.length;if(le-=se.value.length,Q=le,se.value instanceof a)continue;for(var Ze=se;Ze!==y.tail&&(le<xe||typeof Ze.value=="string");Ze=Ze.next)at++,le+=Ze.value.length;at--,Pe=_.slice(Q,le),j.index-=Q}else if(j=c(q,0,Pe,P),!j)continue;var ve=j.index,Be=j[0],ze=Pe.slice(0,ve),kt=Pe.slice(ve+Be.length),Ne=Q+Pe.length;k&&Ne>k.reach&&(k.reach=Ne);var wn=se.prev;ze&&(wn=f(y,wn,ze),Q+=ze.length),h(y,wn,at);var Ei=new a(v,D?l.tokenize(Be,D):Be,U,Be);if(se=f(y,wn,Ei),kt&&f(y,se,kt),at>1){var Zt={cause:v+","+A,reach:Ne};u(_,y,C,se.prev,Q,Zt),k&&Zt.reach>k.reach&&(k.reach=Zt.reach)}}}}}}function d(){var _={value:null,prev:null,next:null},y={value:null,prev:_,next:null};_.next=y,this.head=_,this.tail=y,this.length=0}function f(_,y,C){var S=y.next,x={value:C,prev:y,next:S};return y.next=x,S.prev=x,_.length++,x}function h(_,y,C){for(var S=y.next,x=0;x<C&&S!==_.tail;x++)S=S.next;y.next=S,S.prev=y,_.length-=x}function g(_){for(var y=[],C=_.head.next;C!==_.tail;)y.push(C.value),C=C.next;return y}if(!r.document)return r.addEventListener&&(l.disableWorkerMessageHandler||r.addEventListener("message",function(_){var y=JSON.parse(_.data),C=y.language,S=y.code,x=y.immediateClose;r.postMessage(l.highlight(S,l.languages[C],C)),x&&r.close()},!1)),l;var p=l.util.currentScript();p&&(l.filename=p.src,p.hasAttribute("data-manual")&&(l.manual=!0));function m(){l.manual||l.highlightAll()}if(!l.manual){var b=document.readyState;b==="loading"||b==="interactive"&&p&&p.defer?document.addEventListener("DOMContentLoaded",m):window.requestAnimationFrame?window.requestAnimationFrame(m):window.setTimeout(m,16)}return l})(e);n.exports&&(n.exports=t),typeof Vu.commonjsGlobal<"u"&&(Vu.commonjsGlobal.Prism=t),t.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&amp;/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(i,s){var o={};o["language-"+s]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:t.languages[s]},o.cdata=/^<!\[CDATA\[|\]\]>$/i;var l={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:o}};l["language-"+s]={pattern:/[\s\S]+/,inside:t.languages[s]};var a={};a[i]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return i}),"i"),lookbehind:!0,greedy:!0,inside:l},t.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(r,i){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[i,"language-"+i],inside:t.languages[i]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,(function(r){var i=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+i.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+i.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+i.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+i.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:i,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var s=r.languages.markup;s&&(s.tag.addInlined("style","css"),s.tag.addAttribute("style","css"))})(t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),t.languages.js=t.languages.javascript,(function(){if(typeof t>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",i=function(p,m){return"✖ Error "+p+" while fetching file: "+m},s="✖ Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},l="data-src-status",a="loading",c="loaded",u="failed",d="pre[data-src]:not(["+l+'="'+c+'"]):not(['+l+'="'+a+'"])';function f(p,m,b){var _=new XMLHttpRequest;_.open("GET",p,!0),_.onreadystatechange=function(){_.readyState==4&&(_.status<400&&_.responseText?m(_.responseText):_.status>=400?b(i(_.status,_.statusText)):b(s))},_.send(null)}function h(p){var m=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(p||"");if(m){var b=Number(m[1]),_=m[2],y=m[3];return _?y?[b,Number(y)]:[b,void 0]:[b,b]}}t.hooks.add("before-highlightall",function(p){p.selector+=", "+d}),t.hooks.add("before-sanity-check",function(p){var m=p.element;if(m.matches(d)){p.code="",m.setAttribute(l,a);var b=m.appendChild(document.createElement("CODE"));b.textContent=r;var _=m.getAttribute("data-src"),y=p.language;if(y==="none"){var C=(/\.(\w+)$/.exec(_)||[,"none"])[1];y=o[C]||C}t.util.setLanguage(b,y),t.util.setLanguage(m,y);var S=t.plugins.autoloader;S&&S.loadLanguages(y),f(_,function(x){m.setAttribute(l,c);var k=h(m.getAttribute("data-range"));if(k){var v=x.split(/\r\n?|\n/g),E=k[0],A=k[1]==null?v.length:k[1];E<0&&(E+=v.length),E=Math.max(0,Math.min(E-1,v.length)),A<0&&(A+=v.length),A=Math.max(0,Math.min(A,v.length)),x=v.slice(E,A).join(`
22
+ `),m.hasAttribute("data-start")||m.setAttribute("data-start",String(E+1))}b.textContent=x,t.highlightElement(b)},function(x){m.setAttribute(l,u),b.textContent=x})}}),t.plugins.fileHighlight={highlight:function(m){for(var b=(m||document).querySelectorAll(d),_=0,y;y=b[_++];)t.highlightElement(y)}};var g=!1;t.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}})()})(ha)),ha.exports}Bx();Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));Prism.languages.js=Prism.languages.javascript;Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity;Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup;Prism.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.replace(/&amp;/,"&"))});Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var r={};r["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};i["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var s={};s[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:i},Prism.languages.insertBefore("markup","cdata",s)}});Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(n,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Prism.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});Prism.languages.html=Prism.languages.markup;Prism.languages.mathml=Prism.languages.markup;Prism.languages.svg=Prism.languages.markup;Prism.languages.xml=Prism.languages.extend("markup",{});Prism.languages.ssml=Prism.languages.xml;Prism.languages.atom=Prism.languages.xml;Prism.languages.rss=Prism.languages.xml;(function(n){var e=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function t(u){return u=u.replace(/<inner>/g,function(){return e}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+u+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),s=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;n.languages.markdown=n.languages.extend("markup",{}),n.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:n.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+s+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+s+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+s+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:n.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:t(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:t(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:t(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:t(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(u){["url","bold","italic","strike","code-snippet"].forEach(function(d){u!==d&&(n.languages.markdown[u].inside.content.inside[d]=n.languages.markdown[d])})}),n.hooks.add("after-tokenize",function(u){if(u.language!=="markdown"&&u.language!=="md")return;function d(f){if(!(!f||typeof f=="string"))for(var h=0,g=f.length;h<g;h++){var p=f[h];if(p.type!=="code"){d(p.content);continue}var m=p.content[1],b=p.content[3];if(m&&b&&m.type==="code-language"&&b.type==="code-block"&&typeof m.content=="string"){var _=m.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");_=(/[a-z][\w-]*/i.exec(_)||[""])[0].toLowerCase();var y="language-"+_;b.alias?typeof b.alias=="string"?b.alias=[b.alias,y]:b.alias.push(y):b.alias=[y]}}}d(u.tokens)}),n.hooks.add("wrap",function(u){if(u.type==="code-block"){for(var d="",f=0,h=u.classes.length;f<h;f++){var g=u.classes[f],p=/language-(.+)/.exec(g);if(p){d=p[1];break}}var m=n.languages[d];if(m)u.content=n.highlight(c(u.content),m,d);else if(d&&d!=="none"&&n.plugins.autoloader){var b="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);u.attributes.id=b,n.plugins.autoloader.loadLanguages(d,function(){var _=document.getElementById(b);_&&(_.innerHTML=n.highlight(_.textContent,n.languages[d],d))})}}});var o=RegExp(n.languages.markup.tag.pattern.source,"gi"),l={amp:"&",lt:"<",gt:">",quot:'"'},a=String.fromCodePoint||String.fromCharCode;function c(u){var d=u.replace(o,"");return d=d.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(f,h){if(h=h.toLowerCase(),h[0]==="#"){var g;return h[1]==="x"?g=parseInt(h.slice(2),16):g=Number(h.slice(1)),a(g)}else{var p=l[h];return p||f}}),d}n.languages.md=n.languages.markdown})(Prism);Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/});Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}});Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}});Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/});delete Prism.languages.c.boolean;(function(n){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var t=n.languages.markup;t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))})(Prism);Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/});delete Prism.languages.objectivec["class-name"];Prism.languages.objc=Prism.languages.objectivec;Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};(function(n){var e=n.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};e.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:e},boolean:e.boolean,variable:e.variable}})(Prism);var Nf={},Af;function zx(){return Af||(Af=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),Nf}zx();var Of={},Mf;function Ux(){return Mf||(Mf=1,(function(n){for(var e=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,t=0;t<2;t++)e=e.replace(/<self>/g,function(){return e});e=e.replace(/<self>/g,function(){return/[^\s\S]/.source}),n.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+e),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},n.languages.rust["closure-params"].inside.rest=n.languages.rust,n.languages.rust.attribute.inside.string=n.languages.rust.string})(Prism)),Of}Ux();Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/};Prism.languages.swift["string-literal"].forEach(function(n){n.inside.interpolation.inside=Prism.languages.swift});var $f={},If;function Kx(){return If||(If=1,(function(n){n.languages.typescript=n.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),n.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete n.languages.typescript.parameter,delete n.languages.typescript["literal-property"];var e=n.languages.extend("typescript",{});delete e["class-name"],n.languages.typescript["class-name"].inside=e,n.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e}}}}),n.languages.ts=n.languages.typescript})(Prism)),$f}Kx();var Ff={},Df;function Wx(){return Df||(Df=1,(function(n){var e=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,t=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+t+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};n.languages.java=n.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+t+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+t+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:e,function:[n.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),n.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),n.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+t+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+t+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism)),Ff}Wx();var Lf={},Rf;function jx(){return Rf||(Rf=1,(function(n){var e=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,t=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return e.source});n.languages.cpp=n.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:e,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),n.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return t})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),n.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n.languages.cpp}}}}),n.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),n.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:n.languages.extend("cpp",{})}}),n.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},n.languages.cpp["base-clause"])})(Prism)),Lf}jx();function xl(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Hx="javascript";function Bp(n,e){for(const t of n.childNodes){if(re(t)&&t.tagName===e)return!0;Bp(t,e)}return!1}const Ri="data-language",Mi="data-highlight-language",Ws="data-theme";let nr=class zp extends be{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(e){return new zp(e.__language,e.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){const t=document.createElement("code");pe(t,e.theme.code),t.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(t.setAttribute(Ri,r),this.getIsSyntaxHighlightSupported()&&t.setAttribute(Mi,r));const i=this.getTheme();i&&t.setAttribute(Ws,i);const s=this.getStyle();return s&&t.setAttribute("style",s),t}updateDOM(e,t,r){const i=this.__language,s=e.__language;i?i!==s&&t.setAttribute(Ri,i):s&&t.removeAttribute(Ri);const o=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&s?o&&i?i!==s&&t.setAttribute(Mi,i):t.removeAttribute(Mi):o&&i&&t.setAttribute(Mi,i);const l=this.__theme,a=e.__theme;l?l!==a&&t.setAttribute(Ws,l):a&&t.removeAttribute(Ws);const c=this.__style,u=e.__style;return c?c!==u&&t.setAttribute("style",c):u&&t.removeAttribute("style"),!1}exportDOM(e){const t=document.createElement("pre");pe(t,e._config.theme.code),t.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(t.setAttribute(Ri,r),this.getIsSyntaxHighlightSupported()&&t.setAttribute(Mi,r));const i=this.getTheme();i&&t.setAttribute(Ws,i);const s=this.getStyle();return s&&t.setAttribute("style",s),{element:t}}static importDOM(){return{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||Bp(e,"BR"))?{conversion:Pf,priority:1}:null,div:()=>({conversion:Jx,priority:1}),pre:()=>({conversion:Pf,priority:0}),table:e=>ga(e)?{conversion:Gx,priority:3}:null,td:e=>{const t=e,r=t.closest("table");return t.classList.contains("js-file-line")||r&&ga(r)?{conversion:Bf,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&ga(t)?{conversion:Bf,priority:3}:null}}}static importJSON(e){return xt().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,t=!0){const r=this.getChildren(),i=r.length;if(i>=2&&r[i-1].getTextContent()===`
23
+ `&&r[i-2].getTextContent()===`
24
+ `&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===i){r[i-1].remove(),r[i-2].remove();const a=H();return this.insertAfter(a,t),a}const{anchor:s,focus:o}=e,l=(s.isBefore(o)?s:o).getNode();if(I(l)){let a=rr(l);const c=[];for(;;)if(Je(a))c.push(St()),a=a.getNextSibling();else{if(!Se(a))break;{let m=0;const b=a.getTextContent(),_=a.getTextContentSize();for(;m<_&&b[m]===" ";)m++;if(m!==0&&c.push(xu(" ".repeat(m))),m!==_)break;a=a.getNextSibling()}}const u=l.splitText(s.offset)[0],d=s.offset===0?0:1,f=u.getIndexWithinParent()+d,h=l.getParentOrThrow(),g=[ot(),...c];h.splice(f,0,g);const p=c[c.length-1];p?p.select():s.offset===0?u.selectPrevious():u.getNextSibling().selectNext(0,0)}if(It(l)){const{offset:a}=e.anchor;l.splice(a,0,[ot()]),l.select(a+1,a+1)}return null}canIndent(){return!1}collapseAtStart(){const e=H();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}setLanguage(e){const t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){const t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){const t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}};function xt(n,e){return Hg(nr).setLanguage(n).setTheme(e)}function It(n){return n instanceof nr}function Pf(n){return{node:xt(n.getAttribute(Ri))}}function Jx(n){const e=n,t=zf(e);return t||(function(r){let i=r.parentElement;for(;i!==null;){if(zf(i))return!0;i=i.parentElement}return!1})(e)?{node:t?xt():null}:{node:null}}function Gx(){return{node:xt()}}function Bf(){return{node:null}}function zf(n){return n.style.fontFamily.match("monospace")!==null}function ga(n){return n.classList.contains("js-file-line-container")}let os=class Up extends qe{__highlightType;constructor(e="",t,r){super(e,r),this.__highlightType=t}static getType(){return"code-highlight"}static clone(e){return new Up(e.__text,e.__highlightType||void 0,e.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){const t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){const t=super.createDOM(e),r=pa(e.theme,this.__highlightType);return pe(t,r),t}updateDOM(e,t,r){const i=super.updateDOM(e,t,r),s=pa(r.theme,e.__highlightType),o=pa(r.theme,this.__highlightType);return s!==o&&(s&&un(t,s),o&&pe(t,o)),i}static importJSON(e){return xu().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return xt()}};function pa(n,e){return e&&n&&n.codeHighlight&&n.codeHighlight[e]}function xu(n="",e){return Le(new os(n,e))}function Se(n){return n instanceof os}function Kp(n,e){let t=n;for(let r=_e(n,e);r&&(Se(r.origin)||Je(r.origin));r=vb(r))t=r.origin;return t}function rr(n){return Kp(n,"previous")}function Gr(n){return Kp(n,"next")}function Vx(n){const e=rr(n),t=Gr(n);let r=e;for(;r!==null;){if(Se(r)){const s=Ng(r.getTextContent());if(s!==null)return s}if(r===t)break;r=r.getNextSibling()}const i=e.getParent();if(O(i)){const s=i.getDirection();if(s==="ltr"||s==="rtl")return s}return null}function Yx(n,e){let t=null,r=null,i=n,s=e,o=n.getTextContent();for(;;){if(s===0){if(i=i.getPreviousSibling(),i===null)break;if(Se(i)||Je(i)||ue(i)||xl(167),ue(i)){t={node:i,offset:1};break}s=Math.max(0,i.getTextContentSize()-1),o=i.getTextContent()}else s--;const a=o[s];Se(i)&&a!==" "&&(r={node:i,offset:s})}if(r!==null)return r;let l=null;if(e<n.getTextContentSize())Se(n)&&(l=n.getTextContent()[e]);else{const a=n.getNextSibling();Se(a)&&(l=a.getTextContent()[0])}if(l!==null&&l!==" ")return t;{const a=(function(c,u){let d=c,f=u,h=c.getTextContent(),g=c.getTextContentSize();for(;;){if(!Se(d)||f===g){if(d=d.getNextSibling(),d===null||ue(d))return null;Se(d)&&(f=0,h=d.getTextContent(),g=d.getTextContentSize())}if(Se(d)){if(h[f]!==" ")return{node:d,offset:f};f++}}})(n,e);return a!==null?a:t}}function qx(n){const e=Gr(n);return ue(e)&&xl(168),e}(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var e={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(e).forEach(function(t){var r=e[t],i=[];/^\w+$/.test(t)||i.push(/\w+/.exec(t)[0]),t==="diff"&&i.push("bold"),n.languages.diff[t]={pattern:RegExp("^(?:["+r+`].*(?:\r
25
+ ?|
26
+ |(?![\\s\\S])))+`,"m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(t)[0]}}}}),Object.defineProperty(n.languages.diff,"PREFIXES",{value:e})})(Prism);const Bt=globalThis.Prism||window.Prism;function ac(n){return typeof n=="string"?n:Array.isArray(n)?n.map(ac).join(""):ac(n.content)}function Zx(n,e){const t=/^diff-([\w-]+)/i.exec(e),r=n.getTextContent();let i=Bt.tokenize(r,Bt.languages[t?"diff":e]);return t&&(i=(function(s,o){const l=o,a=Bt.languages[l],c={tokens:s},u=Bt.languages.diff.PREFIXES;for(const d of c.tokens){if(typeof d=="string"||!(d.type in u)||!Array.isArray(d.content))continue;const f=d.type;let h=0;const g=()=>(h++,new Bt.Token("prefix",u[f],f.replace(/^(\w+).*/,"$1"))),p=d.content.filter(S=>typeof S=="string"||S.type!=="prefix"),m=d.content.length-p.length,b=Bt.tokenize(ac(p),a);b.unshift(g());const _=/\r\n|\n/g,y=S=>{const x=[];_.lastIndex=0;let k,v=0;for(;h<m&&(k=_.exec(S));){const E=k.index+k[0].length;x.push(S.slice(v,E)),v=E,x.push(g())}if(x.length!==0)return v<S.length&&x.push(S.slice(v)),x},C=S=>{for(let x=0;x<S.length&&h<m;x++){const k=S[x];if(typeof k=="string"){const v=y(k);v&&(S.splice(x,1,...v),x+=v.length-1)}else if(typeof k.content=="string"){const v=y(k.content);v&&(k.content=v)}else Array.isArray(k.content)?C(k.content):C([k.content])}};C(b),h<m&&b.push(g()),d.content=b}return c.tokens})(i,t[1])),cc(i)}function cc(n,e){const t=[];for(const r of n)if(typeof r=="string"){const i=r.split(/(\n|\t)/),s=i.length;for(let o=0;o<s;o++){const l=i[o];l===`
27
+ `||l===`\r
28
+ `?t.push(ot()):l===" "?t.push(St()):l.length>0&&t.push(xu(l,e))}}else{const{content:i,alias:s}=r;typeof i=="string"?t.push(...cc([i],r.type==="prefix"&&typeof s=="string"?s:r.type)):Array.isArray(i)&&t.push(...cc(i,r.type==="unchanged"?void 0:r.type))}return t}const Xx={$tokenize(n,e){return Zx(n,e||this.defaultLanguage)},defaultLanguage:Hx,tokenize(n,e){return Bt.tokenize(n,Bt.languages[e||""]||Bt.languages[this.defaultLanguage])}};function Uf(n,e,t){const r=n.getParent();It(r)?Wp(r,e,t):Se(n)&&n.replace(de(n.__text))}function Qx(n,e){const t=e.getElementByKey(n.getKey());if(t===null)return;const r=n.getChildren(),i=r.length;if(i===t.__cachedChildrenLength)return;t.__cachedChildrenLength=i;let s="1",o=1;for(let l=0;l<i;l++)ue(r[l])&&(s+=`
29
+ `+ ++o);t.setAttribute("data-gutter",s)}const ma=new Set;function Wp(n,e,t){const r=n.getKey(),i=e.getKey()+"/"+r;n.getLanguage()===void 0&&n.setLanguage(t.defaultLanguage);const s=n.getLanguage()||t.defaultLanguage;if(!(function(o){const l=(function(c){const u=/^diff-([\w-]+)/i.exec(c);return u?u[1]:null})(o),a=l||o;try{return!!a&&Bt.languages.hasOwnProperty(a)}catch{return!1}})(s))return n.getIsSyntaxHighlightSupported()&&n.setIsSyntaxHighlightSupported(!1),void(async function(){})();n.getIsSyntaxHighlightSupported()||n.setIsSyntaxHighlightSupported(!0),ma.has(i)||(ma.add(i),e.update(()=>{(function(o,l){const a=Y(o);if(!It(a)||!a.isAttached())return;const c=M();if(!N(c))return void l();const u=c.anchor,d=u.offset,f=u.type==="element"&&ue(a.getChildAtIndex(u.offset-1));let h=0;if(!f){const g=u.getNode();h=d+g.getPreviousSiblings().reduce((p,m)=>p+m.getTextContentSize(),0)}if(l()){if(f)return void u.getNode().select(d,d);a.getChildren().some(g=>{const p=I(g);if(p||ue(g)){const m=g.getTextContentSize();if(p&&m>=h)return g.select(h,h),!0;h-=m}return!1})}})(r,()=>{const o=Y(r);if(!It(o)||!o.isAttached())return!1;const l=o.getLanguage()||t.defaultLanguage,a=t.$tokenize(o,l),c=(function(h,g){let p=0;for(;p<h.length&&Kf(h[p],g[p]);)p++;const m=h.length,b=g.length,_=Math.min(m,b)-p;let y=0;for(;y<_;)if(y++,!Kf(h[m-y],g[b-y])){y--;break}const C=p,S=m-y,x=g.slice(p,b-y);return{from:C,nodesForReplacement:x,to:S}})(o.getChildren(),a),{from:u,to:d,nodesForReplacement:f}=c;return!(u===d&&!f.length)&&(n.splice(u,d-u,f),!0)})},{onUpdate:()=>{ma.delete(i)},skipTransforms:!0}))}function Kf(n,e){return Se(n)&&Se(e)&&n.__text===e.__text&&n.__highlightType===e.__highlightType||Je(n)&&Je(e)||ue(n)&&ue(e)}function er(n){if(!N(n))return!1;const e=n.anchor.getNode(),t=It(e)?e:e.getParent(),r=n.focus.getNode(),i=It(r)?r:r.getParent();return It(t)&&t.is(i)}function jp(n){const e=n.getNodes(),t=[];if(e.length===1&&It(e[0]))return t;let r=[];for(let i=0;i<e.length;i++){const s=e[i];Se(s)||Je(s)||ue(s)||xl(169),ue(s)?r.length>0&&(t.push(r),r=[]):r.push(s)}if(r.length>0){const i=n.isBackward()?n.anchor:n.focus,s=Te(r[0].getKey(),0,"text");i.is(s)||t.push(r)}return t}function Wf(n){const e=M();if(!N(e)||!er(e))return!1;const t=jp(e),r=t.length;if(r===0&&e.isCollapsed())return n===Ut&&e.insertNodes([St()]),!0;if(r===0&&n===Ut&&e.getTextContent()===`
30
+ `){const i=St(),s=ot(),o=e.isBackward()?"previous":"next";return e.insertNodes([i,s]),hl(gl(Vt(fn(i,"next",0),et(_e(s,"next"))),o)),!0}for(let i=0;i<r;i++){const s=t[i];if(s.length>0){let o=s[0];if(i===0&&(o=rr(o)),n===Ut){const l=St();if(o.insertBefore(l),i===0){const a=e.isBackward()?"focus":"anchor",c=Te(o.getKey(),0,"text");e[a].is(c)&&e[a].set(l.getKey(),0,"text")}}else Je(o)&&o.remove()}}return!0}function jf(n,e){const t=M();if(!N(t))return!1;const{anchor:r,focus:i}=t,s=r.offset,o=i.offset,l=r.getNode(),a=i.getNode(),c=n===dn;if(!er(t)||!Se(l)&&!Je(l)||!Se(a)&&!Je(a))return!1;if(!e.altKey){if(t.isCollapsed()){const b=l.getParentOrThrow();if(c&&s===0&&l.getPreviousSibling()===null){if(b.getPreviousSibling()===null)return b.selectPrevious(),e.preventDefault(),!0}else if(!c&&s===l.getTextContentSize()&&l.getNextSibling()===null&&b.getNextSibling()===null)return b.selectNext(),e.preventDefault(),!0}return!1}let u,d;if(l.isBefore(a)?(u=rr(l),d=Gr(a)):(u=rr(a),d=Gr(l)),u==null||d==null)return!1;const f=u.getNodesBetween(d);for(let b=0;b<f.length;b++){const _=f[b];if(!Se(_)&&!Je(_)&&!ue(_))return!1}e.preventDefault(),e.stopPropagation();const h=c?u.getPreviousSibling():d.getNextSibling();if(!ue(h))return!0;const g=c?h.getPreviousSibling():h.getNextSibling();if(g==null)return!0;const p=Se(g)||Je(g)||ue(g)?c?rr(g):Gr(g):null;let m=p??g;return h.remove(),f.forEach(b=>b.remove()),n===dn?(f.forEach(b=>m.insertBefore(b)),m.insertBefore(h)):(m.insertAfter(h),m=h,f.forEach(b=>{m.insertAfter(b),m=b})),t.setTextNodeRange(l,s,a,o),!0}function Hf(n,e){const t=M();if(!N(t))return!1;const{anchor:r,focus:i}=t,s=r.getNode(),o=i.getNode(),l=n===Qi;if(!er(t)||!Se(s)&&!Je(s)||!Se(o)&&!Je(o))return!1;const a=o;if(Vx(a)==="rtl"?!l:l){const c=Yx(a,i.offset);if(c!==null){const{node:u,offset:d}=c;ue(u)?u.selectNext(0,0):t.setTextNodeRange(u,d,u,d)}else a.getParentOrThrow().selectStart()}else qx(a).select();return e.preventDefault(),e.stopPropagation(),!0}function Io(n,e){if(!n.hasNodes([nr,os]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");e==null&&(e=Xx);const t=[];return n._headless!==!0&&t.push(n.registerMutationListener(nr,r=>{n.getEditorState().read(()=>{for(const[i,s]of r)if(s!=="destroyed"){const o=Y(i);o!==null&&Qx(o,n)}})},{skipInitialization:!1})),t.push(n.registerNodeTransform(nr,r=>Wp(r,n,e)),n.registerNodeTransform(qe,r=>Uf(r,n,e)),n.registerNodeTransform(os,r=>Uf(r,n,e)),n.registerCommand(bs,r=>{const i=(function(s){const o=M();if(!N(o)||!er(o))return null;const l=s?sn:Ut,a=s?sn:fo,c=o.anchor,u=o.focus;if(c.is(u))return a;const d=jp(o);if(d.length!==1)return l;const f=d[0];let h,g;f.length===0&&xl(285),o.isBackward()?(h=u,g=c):(h=c,g=u);const p=rr(f[0]),m=Gr(f[0]),b=Te(p.getKey(),0,"text"),_=Te(m.getKey(),m.getTextContentSize(),"text");return h.isBefore(b)||_.isBefore(g)?l:b.isBefore(h)||g.isBefore(_)?a:l})(r.shiftKey);return i!==null&&(r.preventDefault(),n.dispatchCommand(i,void 0),!0)},G),n.registerCommand(fo,()=>!!er(M())&&(tl([St()]),!0),G),n.registerCommand(Ut,r=>Wf(Ut),G),n.registerCommand(sn,r=>Wf(sn),G),n.registerCommand(dn,r=>{const i=M();if(!N(i))return!1;const{anchor:s}=i,o=s.getNode();return!!er(i)&&(i.isCollapsed()&&s.offset===0&&o.getPreviousSibling()===null&&It(o.getParentOrThrow())?(r.preventDefault(),!0):jf(dn,r))},G),n.registerCommand(cr,r=>{const i=M();if(!N(i))return!1;const{anchor:s}=i,o=s.getNode();return!!er(i)&&(i.isCollapsed()&&s.offset===o.getTextContentSize()&&o.getNextSibling()===null&&It(o.getParentOrThrow())?(r.preventDefault(),!0):jf(cr,r))},G),n.registerCommand(Qi,r=>Hf(Qi,r),G),n.registerCommand(uo,r=>Hf(uo,r),G)),pt(...t)}function eS(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function tS(n,e,t,r){const i=o=>o instanceof t,s=o=>{const l=de(o.getTextContent());l.setFormat(o.getFormat()),o.replace(l)};return[n.registerNodeTransform(qe,o=>{if(!o.isSimpleText())return;let l,a=o.getPreviousSibling(),c=o.getTextContent(),u=o;if(I(a)){const f=a.getTextContent(),h=e(f+c);if(i(a)){if(h===null||(g=>g.getLatest().__mode)(a)!==0)return void s(a);{const g=h.end-f.length;if(g>0){const p=f+c.slice(0,g);if(a.select(),a.setTextContent(p),g===c.length)o.remove();else{const m=c.slice(g);o.setTextContent(m)}return}}}else if(h===null||h.start<f.length)return}let d=0;for(;;){l=e(c);let f,h=l===null?"":c.slice(l.end);if(c=h,h===""){const p=u.getNextSibling();if(I(p)){h=u.getTextContent()+p.getTextContent();const m=e(h);if(m===null)return void(i(p)?s(p):p.markDirty());if(m.start!==0)return}}if(l===null)return;if(l.start===0&&I(a)&&a.isTextEntity()){d+=l.end;continue}l.start===0?[f,u]=u.splitText(l.end):[,f,u]=u.splitText(l.start+d,l.end+d),f===void 0&&eS(165,"nodeToReplace");const g=r(f);if(g.setFormat(f.getFormat()),f.replace(g),u==null)return;d=0,a=g}}),n.registerNodeTransform(t,o=>{const l=o.getTextContent(),a=e(l);if(a===null||a.start!==0)return void s(o);if(l.length>a.end)return void o.splitText(a.end);const c=o.getPreviousSibling();I(c)&&c.isTextEntity()&&(s(c),s(o));const u=o.getNextSibling();I(u)&&u.isTextEntity()&&(s(u),i(o)&&s(o))})]}let Sl=class Hp extends qe{static getType(){return"hashtag"}static clone(e){return new Hp(e.__text,e.__key)}createDOM(e){const t=super.createDOM(e);return pe(t,e.theme.hashtag),t}static importJSON(e){return nS().updateFromJSON(e)}canInsertTextBefore(){return!1}isTextEntity(){return!0}};function nS(n=""){return Le(new Sl(n))}const Jp=[];let Su=class Gp extends be{__ids;static getType(){return"mark"}static clone(e){return new Gp(e.__ids,e.__key)}static importDOM(){return null}static importJSON(e){return uc().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIDs(e.ids)}exportJSON(){return{...super.exportJSON(),ids:this.getIDs()}}constructor(e=Jp,t){super(t),this.__ids=e}createDOM(e){const t=document.createElement("mark");return pe(t,e.theme.mark),this.__ids.length>1&&pe(t,e.theme.markOverlap),t}updateDOM(e,t,r){const i=e.__ids,s=this.__ids,o=i.length,l=s.length,a=r.theme.markOverlap;return o!==l&&(o===1?l===2&&pe(t,a):l===1&&un(t,a)),!1}hasID(e){return this.getIDs().includes(e)}getIDs(){return Array.from(this.getLatest().__ids)}setIDs(e){const t=this.getWritable();return t.__ids=e,t}addID(e){const t=this.getWritable();return t.__ids.includes(e)?t:t.setIDs([...t.__ids,e])}deleteID(e){const t=this.getWritable(),r=t.__ids.indexOf(e);if(r===-1)return t;const i=Array.from(t.__ids);return i.splice(r,1),t.setIDs(i)}insertNewAfter(e,t=!0){const r=uc(this.__ids);return this.insertAfter(r,t),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,r){if(!N(t)||r==="html")return!1;const i=t.anchor,s=t.focus,o=i.getNode(),l=s.getNode(),a=t.isBackward()?i.offset-s.offset:s.offset-i.offset;return this.isParentOf(o)&&this.isParentOf(l)&&this.getTextContent().length===a}excludeFromCopy(e){return e!=="clone"}};function uc(n=Jp){return Le(new Su(n))}function ls(n){return n instanceof Su}function rS(n){const e=n.getChildren();let t=null;for(let r=0;r<e.length;r++){const i=e[r];t===null?n.insertBefore(i):t.insertAfter(i),t=i}n.remove()}function iS(n,e,t,r){const i=di(),[s,o]=n.isBackward()?[n.focus,n.anchor]:[n.anchor,n.focus];let l,a;i.anchor.set(s.key,s.offset,s.type),i.focus.set(o.key,o.offset,o.type);const c=i.extract();for(const u of c){if(O(a)&&a.isParentOf(u))continue;let d=null;if(I(u))d=u;else{if(ls(u))continue;(O(u)||V(u))&&u.isInline()&&(d=u)}if(d!==null){if(d&&d.is(l))continue;const f=d.getParent();f!=null&&f.is(l)||(a=void 0),l=f,a===void 0&&(a=uc([t]),d.insertBefore(a)),a.append(d)}else l=void 0,a=void 0}O(a)&&(e?a.selectStart():a.selectEnd())}function sS(n,e){let t=n;for(;t!==null;){if(ls(t))return t.getIDs();if(I(t)&&e===t.getTextContentSize()){const r=t.getNextSibling();if(ls(r))return r.getIDs()}t=t.getParent()}return null}class oS extends be{$config(){return this.config("overflow",{$transform(e){e.isEmpty()&&e.remove()},extends:be})}createDOM(e){const t=document.createElement("span"),r=e.theme.characterLimit;return typeof r=="string"&&(t.className=r),t}updateDOM(e,t){return!1}insertNewAfter(e,t=!0){return this.getParentOrThrow().insertNewAfter(e,t)}excludeFromCopy(){return!0}}class Mr extends xs{static getType(){return"horizontal-rule"}static clone(e){return new Mr(e.__key)}static importJSON(e){return Ts()}static importDOM(){return{hr:()=>({conversion:lS,priority:0})}}exportJSON(){return{...super.exportJSON(),type:"horizontal-rule",version:1}}exportDOM(){return{element:document.createElement("hr")}}createDOM(){return document.createElement("hr")}updateDOM(){return!1}getTextContent(){return`
31
+ `}isInline(){return!1}decorate(){return null}}function lS(){return{node:Ts()}}function Ts(){return Le(new Mr)}function Vp(n){return n instanceof Mr}function Cl(n){const e=[yl,_l,Es,Tr,Or,nr,os,Mr];return n.table&&e.push(mr,Nr,bi),n.autoLink&&e.push(bu),n.hashtag&&e.push(Sl),n.mark&&e.push(Su),n.overflow&&e.push(oS),[...new Set(e)]}function wl(n){switch(n){case"bare":return{richText:!0,history:!0,clipboard:!0};case"docked":return{richText:!0,history:!0,clipboard:!0,list:!0,link:!0,autoLink:!0,code:!0,table:!0};case"contextual":return{richText:!0,history:!0,clipboard:!0,list:!0,link:!0,autoLink:!0,code:!0,table:!0}}}const $r=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,aS=$r&&"documentMode"in document?document.documentMode:null,cS=$r&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),uS=!(!$r||!("InputEvent"in window)||aS)&&"getTargetRanges"in new window.InputEvent("input"),dS=$r&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Jf=$r&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,fS=$r&&/^(?=.*Chrome).*/i.test(navigator.userAgent),hS=$r&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&cS&&!fS;function Gf(n,e){e.update(()=>{if(n!==null){const t=on(n,KeyboardEvent)?null:n.clipboardData,r=M();if(r!==null&&!r.isCollapsed()&&t!=null){n.preventDefault();const i=mp(e);i!==null&&t.setData("text/html",i),t.setData("text/plain",r.getTextContent())}}})}function gS(n){return pt(n.registerCommand(Ot,e=>{const t=M();return!!N(t)&&(t.deleteCharacter(e),!0)},B),n.registerCommand(lr,e=>{const t=M();return!!N(t)&&(t.deleteWord(e),!0)},B),n.registerCommand(ar,e=>{const t=M();return!!N(t)&&(t.deleteLine(e),!0)},B),n.registerCommand(An,e=>{const t=M();if(!N(t))return!1;if(typeof e=="string")t.insertText(e);else{const r=e.dataTransfer;if(r!=null)Kd(r,t);else{const i=e.data;i&&t.insertText(i)}}return!0},B),n.registerCommand(Xi,()=>{const e=M();return!!N(e)&&(e.removeText(),!0)},B),n.registerCommand(cn,e=>{const t=M();return!!N(t)&&(t.insertLineBreak(e),!0)},B),n.registerCommand(Fn,()=>{const e=M();return!!N(e)&&(e.insertLineBreak(),!0)},B),n.registerCommand(ys,e=>{const t=M();if(!N(t))return!1;const r=e,i=r.shiftKey;return!!Ao(t,!0)&&(r.preventDefault(),Oo(t,i,!0),!0)},B),n.registerCommand(Go,e=>{const t=M();if(!N(t))return!1;const r=e,i=r.shiftKey;return!!Ao(t,!1)&&(r.preventDefault(),Oo(t,i,!1),!0)},B),n.registerCommand(Yo,e=>{const t=M();return!!N(t)&&(!Jf||navigator.language!=="ko-KR")&&(e.preventDefault(),n.dispatchCommand(Ot,!0))},B),n.registerCommand(qo,e=>{const t=M();return!!N(t)&&(e.preventDefault(),n.dispatchCommand(Ot,!1))},B),n.registerCommand(Dn,e=>{const t=M();if(!N(t))return!1;if(e!==null){if((Jf||dS||hS)&&uS)return!1;e.preventDefault()}return n.dispatchCommand(cn,!1)},B),n.registerCommand(qr,()=>(Xc(),!0),B),n.registerCommand(yr,e=>{const t=M();return!!N(t)&&(Gf(e,n),!0)},B),n.registerCommand(ci,e=>{const t=M();return!!N(t)&&((function(r,i){Gf(r,i),i.update(()=>{const s=M();N(s)&&s.removeText()})})(e,n),!0)},B),n.registerCommand(si,e=>{const t=M();return!!N(t)&&((function(r,i){r.preventDefault(),i.update(()=>{const s=M(),o=on(r,ClipboardEvent)?r.clipboardData:null;o!=null&&N(s)&&Kd(o,s)},{tag:Pc})})(e,n),!0)},B),n.registerCommand(Zo,e=>{const t=M();return!!N(t)&&(e.preventDefault(),!0)},B),n.registerCommand(Xo,e=>{const t=M();return!!N(t)&&(e.preventDefault(),!0)},B))}function pS(n,e,t,r,i){if(n===null||t.size===0&&r.size===0&&!i)return 0;const s=e._selection,o=n._selection;if(i)return 1;if(!(N(s)&&N(o)&&o.isCollapsed()&&s.isCollapsed()))return 0;const l=(function(b,_,y){const C=b._nodeMap,S=[];for(const x of _){const k=C.get(x);k!==void 0&&S.push(k)}for(const[x,k]of y){if(!k)continue;const v=C.get(x);v===void 0||ye(v)||S.push(v)}return S})(e,t,r);if(l.length===0)return 0;if(l.length>1){const b=e._nodeMap,_=b.get(s.anchor.key),y=b.get(o.anchor.key);return _&&y&&!n._nodeMap.has(_.__key)&&I(_)&&_.__text.length===1&&s.anchor.offset===1?2:0}const a=l[0],c=n._nodeMap.get(a.__key);if(!I(c)||!I(a)||c.__mode!==a.__mode)return 0;const u=c.__text,d=a.__text;if(u===d)return 0;const f=s.anchor,h=o.anchor;if(f.key!==h.key||f.type!=="text")return 0;const g=f.offset,p=h.offset,m=d.length-u.length;return m===1&&p===g-1?2:m===-1&&p===g+1?3:m===-1&&p===g?4:0}function mS(n,e){let t=Date.now(),r=0;return(i,s,o,l,a,c)=>{const u=Date.now();if(c.has(mo))return r=0,t=u,2;const d=pS(i,s,l,a,n.isComposing()),f=(()=>{const h=o===null||o.editor===n,g=c.has(sg);if(!g&&h&&c.has(Hr))return 0;if(i===null)return 1;const p=s._selection;if(!(l.size>0||a.size>0))return p!==null?0:2;const m=typeof e=="number"?e:e.peek();return g===!1&&d!==0&&d===r&&u<t+m&&h||l.size===1&&(function(b,_,y){const C=_._nodeMap.get(b),S=y._nodeMap.get(b),x=_._selection,k=y._selection;return!(N(x)&&N(k)&&x.anchor.type==="element"&&x.focus.type==="element"&&k.anchor.type==="text"&&k.focus.type==="text"||!I(C)||!I(S)||C.__parent!==S.__parent)&&JSON.stringify(_.read(()=>C.exportJSON()))===JSON.stringify(y.read(()=>S.exportJSON()))})(Array.from(l)[0],i,s)?0:1})();return t=u,r=d,f}}function Vf(n){n.undoStack=[],n.redoStack=[],n.current=null}function Yp(n,e,t){const r=mS(n,t);return pt(n.registerCommand(oi,()=>((function(s,o){const l=o.redoStack,a=o.undoStack;if(a.length!==0){const c=o.current,u=a.pop();c!==null&&(l.push(c),s.dispatchCommand(Ii,!0)),a.length===0&&s.dispatchCommand(Fi,!1),o.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:mo})}})(n,e),!0),B),n.registerCommand(li,()=>((function(s,o){const l=o.redoStack,a=o.undoStack;if(l.length!==0){const c=o.current;c!==null&&(a.push(c),s.dispatchCommand(Fi,!0));const u=l.pop();l.length===0&&s.dispatchCommand(Ii,!1),o.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:mo})}})(n,e),!0),B),n.registerCommand(Lc,()=>(Vf(e),!1),B),n.registerCommand(Vh,()=>(Vf(e),n.dispatchCommand(Ii,!1),n.dispatchCommand(Fi,!1),!0),B),n.registerUpdateListener(({editorState:s,prevEditorState:o,dirtyLeaves:l,dirtyElements:a,tags:c})=>{const u=e.current,d=e.redoStack,f=e.undoStack,h=u===null?null:u.editorState;if(u!==null&&s===h)return;const g=r(o,s,u,l,a,c);if(g===1)d.length!==0&&(e.redoStack=[],n.dispatchCommand(Ii,!1)),u!==null&&(f.push({...u}),n.dispatchCommand(Fi,!0));else if(g===2)return;e.current={editor:n,editorState:s}}))}function qp(){return{current:null,redoStack:[],undoStack:[]}}const _a={build:(n,{delay:e,createInitialHistoryState:t,disabled:r})=>zb({delay:e,disabled:r,historyState:t(n)}),config:{createInitialHistoryState:qp,delay:300,disabled:typeof window>"u"},name:"@lexical/history/History",register:(n,e,t)=>{const r=t.getOutput();return fu(()=>r.disabled.value?void 0:Yp(n,r.historyState.value,r.delay))}};Zg(_a,{createInitialHistoryState:()=>{throw new Error("SharedHistory did not inherit parent history")},disabled:!0});function _S(n,e){const t={};for(const r of n){const i=e(r);i&&(t[i]?t[i].push(r):t[i]=[r])}return t}function Zp(n){const e=_S(n,t=>t.type);return{element:e.element||[],multilineElement:e["multiline-element"]||[],textFormat:e["text-format"]||[],textMatch:e["text-match"]||[]}}const Yf=/[ \t\n\r\f]/,dc=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,yS=/^\s{0,3}$/;function fc(n){if(!Er(n))return!1;const e=n.getFirstChild();return e==null||n.getChildrenSize()===1&&I(e)&&yS.test(e.getTextContent())}function bS(n,e,t,r){for(const i of e){if(!i.export)continue;const s=i.export(n,o=>Fo(o,t,r));if(s!=null)return s}return O(n)?Fo(n,t,r):V(n)?n.getTextContent():null}function Fo(n,e,t,r,i){const s=[],o=n.getChildren();r||(r=[]),i||(i=[]);e:for(const l of o){for(const a of t){if(!a.export)continue;const c=a.export(l,u=>Fo(u,e,t,r,[...i,...r]),(u,d)=>qf(u,d,e,r,i));if(c!=null){s.push(c);continue e}}ue(l)?s.push(`
32
+ `):I(l)?s.push(qf(l,l.getTextContent(),e,r,i)):O(l)?s.push(Fo(l,e,t,r,i)):V(l)&&s.push(l.getTextContent())}return s.join("")}function qf(n,e,t,r,i){let s=n.getFormat()===0?e:(function(f){return f.replace(/^\s+|\s+$/g,h=>[...h].map(g=>"&#"+g.codePointAt(0)+";").join(""))})(e);n.hasFormat("code")||(s=s.replace(/([*_`~\\])/g,"\\$1"));let o="",l="",a="";const c=Zf(n,!0),u=Zf(n,!1),d=new Set;for(const f of t){const h=f.format[0],g=f.tag;js(n,h)&&!d.has(h)&&(d.add(h),js(c,h)&&r.find(p=>p.tag===g)||(r.push({format:h,tag:g}),o+=g))}for(let f=0;f<r.length;f++){const h=js(n,r[f].format),g=js(u,r[f].format);if(h&&g)continue;const p=[...r];for(;p.length>f;){const m=p.pop();i&&m&&i.find(b=>b.tag===m.tag)||(m&&typeof m.tag=="string"&&(h?g||(a+=m.tag):l+=m.tag),r.pop())}break}return s=o+s+a,l+s}function Zf(n,e){const t=e?n.getPreviousSibling():n.getNextSibling();return I(t)?t:null}function js(n,e){return I(n)&&n.hasFormat(e)}function xS(n,e){const t=n.getTextContent(),r=e.fullMatchRegExpByTag["`"],i=e.transformersByTag["`"],s=[];let o=null;if(r&&i){const f=new RegExp(r.source,"g"),h=Array.from(t.matchAll(f));for(const g of h){const p=g.index,m=p+g[0].length;o||(o={content:g[2],endIndex:m,startIndex:p,tag:"`"}),s.push({end:m,start:p})}}const l=(function(f,h,g=[]){const p=[],m=new Set(Object.keys(h.transformersByTag).filter(C=>C[0]!=="`").map(C=>C[0])),b=C=>{let S=0;for(let x=C-1;x>=0&&f[x]==="\\";x--)S++;return S%2==1},_=C=>g.some(S=>C>=S.start&&C<S.end);let y=0;for(;y<f.length;){const C=f[y];if(!m.has(C)||b(y)||_(y)){y++;continue}let S=1;for(;y+S<f.length&&f[y+S]===C;)S++;const x=Xf(C,f,y,S,!0),k=Xf(C,f,y,S,!1);(x||k)&&p.push({active:!0,canClose:k,canOpen:x,char:C,index:y,length:S,originalLength:S}),y+=S}return p})(t,e,s),a=l.length>0?(function(f,h,g){const p={};let m=0,b=null;for(;m<h.length;){const _=h[m];if(!_.active||!_.canClose||_.length===0){m++;continue}const y=`${_.char}${_.canOpen}`,C=p[y]??-1;let S=!1;for(let x=m-1;x>C;x--){const k=h[x];if(!k.active||!k.canOpen||k.length===0||k.char!==_.char||(k.canClose||_.canOpen)&&(k.originalLength+_.originalLength)%3==0&&k.originalLength%3!=0&&_.originalLength%3!=0)continue;const v=Math.min(k.length,_.length),E=Object.keys(g.transformersByTag).filter(D=>D[0]===k.char&&D.length<=v).sort((D,P)=>P.length-D.length)[0];if(!E)continue;S=!0;const A=E.length,T={content:f.slice(k.index+k.length,_.index),endIndex:_.index+A,startIndex:k.index+(k.length-A),tag:E};(!b||T.startIndex<b.startIndex||T.startIndex===b.startIndex&&T.endIndex>b.endIndex)&&(b=T);for(let D=x+1;D<m;D++)h[D].active=!1;k.length-=A,_.length-=A,k.active=k.length>0,_.length>0?_.index+=A:(_.active=!1,m++);break}S||(p[y]=m-1,_.canOpen||(_.active=!1),m++)}return b})(t,l,e):null;let c=null,u=null;if(o&&a?a.startIndex<=o.startIndex&&a.endIndex>=o.endIndex?(c=a,u=e.transformersByTag[a.tag]):(c=o,u=i):o?(c=o,u=i):a&&(c=a,u=e.transformersByTag[a.tag]),!c||!u)return null;const d=[t.slice(c.startIndex,c.endIndex),c.tag,c.content];return d.index=c.startIndex,d.input=t,{endIndex:c.endIndex,match:d,startIndex:c.startIndex,transformer:u}}function Xf(n,e,t,r,i){if(!Qf(e,t,r,i))return!1;if(n==="*")return!0;if(n==="_"){if(!Qf(e,t,r,!i))return!0;const s=i?e[t-1]:e[t+r];return s!==void 0&&dc.test(s)}return!0}function Qf(n,e,t,r){const i=n[e-1],s=n[e+t],[o,l]=r?[s,i]:[i,s];return o!==void 0&&!Yf.test(o)&&(!dc.test(o)||l===void 0||Yf.test(l)||dc.test(l))}function Rr(n){return I(n)&&!n.hasFormat("code")}function qn(n,e,t){let r=xS(n,e),i=(function(o,l){const a=o;let c,u,d,f;for(const h of l){if(!h.replace||!h.importRegExp)continue;const g=a.getTextContent().match(h.importRegExp);if(!g)continue;const p=g.index||0,m=h.getEndIndex?h.getEndIndex(a,g):p+g[0].length;m!==!1&&(c===void 0||u===void 0||p<c&&(m>u||m<=c))&&(c=p,u=m,d=h,f=g)}return c===void 0||u===void 0||d===void 0||f===void 0?null:{endIndex:u,match:f,startIndex:c,transformer:d}})(n,t);if(r&&i&&(r.startIndex<=i.startIndex&&r.endIndex>=i.endIndex||i.startIndex>r.endIndex?i=null:r=null),r){const o=(function(l,a,c,u,d){const f=l.getTextContent();let h,g,p;if(d[0]===f?h=l:a===0?[h,g]=l.splitText(c):[p,h,g]=l.splitText(a,c),h.setTextContent(d[2]),u)for(const m of u.format)h.hasFormat(m)||h.toggleFormat(m);return{nodeAfter:g,nodeBefore:p,transformedNode:h}})(n,r.startIndex,r.endIndex,r.transformer,r.match);Rr(o.nodeAfter)&&qn(o.nodeAfter,e,t),Rr(o.nodeBefore)&&qn(o.nodeBefore,e,t),Rr(o.transformedNode)&&qn(o.transformedNode,e,t)}else if(i){const o=(function(l,a,c,u,d){let f,h,g;return a===0?[f,h]=l.splitText(c):[g,f,h]=l.splitText(a,c),u.replace?{nodeAfter:h,nodeBefore:g,transformedNode:u.replace(f,d)||void 0}:null})(n,i.startIndex,i.endIndex,i.transformer,i.match);if(!o)return;Rr(o.nodeAfter)&&qn(o.nodeAfter,e,t),Rr(o.nodeBefore)&&qn(o.nodeBefore,e,t),Rr(o.transformedNode)&&qn(o.transformedNode,e,t)}const s=n.getTextContent().replace(/\\([*_`~\\])/g,"$1").replace(/&#(\d+);/g,(o,l)=>String.fromCodePoint(l));n.setTextContent(s)}function SS(n,e=!1){const t=Zp(n),r=(function(i){const s={},o={},l=[],a="(?<![\\\\])";for(const c of i){const{tag:u}=c;s[u]=c;const d=u.replace(/(\*|\^|\+)/g,"\\$1");l.push(d),u.length===1?o[u]=u==="`"?new RegExp("(?<![\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)"):new RegExp(`(?<![\\\\${d}])(${d})((\\\\${d})?.*?[^${d}\\s](\\\\${d})?)((?<!\\\\)|(?<=\\\\\\\\))(${d})(?![\\\\${d}])`):o[u]=new RegExp(`(?<!\\\\)(${d})((\\\\${d})?.*?[^\\s](\\\\${d})?)((?<!\\\\)|(?<=\\\\\\\\))(${d})(?!\\\\)`)}return{fullMatchRegExpByTag:o,openTagsRegExp:new RegExp(`${a}(${l.join("|")})`,"g"),transformersByTag:s}})(t.textFormat);return(i,s)=>{const o=i.split(`
33
+ `),l=o.length,a=s||fe();a.clear();for(let u=0;u<l;u++){const d=o[u],[f,h]=CS(o,u,t.multilineElement,a);f?u=h:wS(d,a,t.element,r,t.textMatch,e)}const c=a.getChildren();for(const u of c)!e&&fc(u)&&a.getChildrenSize()>1&&u.remove();M()!==null&&a.selectStart()}}function CS(n,e,t,r){for(const i of t){const{handleImportAfterStartMatch:s,regExpEnd:o,regExpStart:l,replace:a}=i,c=n[e].match(l);if(!c)continue;if(s){const g=s({lines:n,rootNode:r,startLineIndex:e,startMatch:c,transformer:i});if(g===null)continue;if(g)return g}const u=typeof o=="object"&&"regExp"in o?o.regExp:o,d=o&&typeof o=="object"&&"optional"in o?o.optional:!o;let f=e;const h=n.length;for(;f<h;){const g=u?n[f].match(u):null;if(!g&&(!d||d&&f<h-1)){f++;continue}if(g&&e===f&&g.index===c.index){f++;continue}const p=[];if(g&&e===f)p.push(n[e].slice(c[0].length,-g[0].length));else for(let m=e;m<=f;m++)if(m===e){const b=n[m].slice(c[0].length);p.push(b)}else if(m===f&&g){const b=n[m].slice(0,-g[0].length);p.push(b)}else p.push(n[m]);if(a(r,null,c,g,p,!0)!==!1)return[!0,f];break}}return[!1,e]}function wS(n,e,t,r,i,s){const o=de(n),l=H();l.append(o),e.append(l);for(const{regExp:a,replace:c}of t){const u=n.match(a);if(u&&(o.setTextContent(n.slice(u[0].length)),c(l,[o],u,!0)!==!1))break}if(qn(o,r,i),l.isAttached()&&n.length>0){const a=l.getPreviousSibling();if(!s&&(Er(a)||Qa(a)||J(a))){let c=a;if(J(a)){const u=a.getLastDescendant();c=u==null?null:oe(u,X)}c!=null&&c.getTextContentSize()>0&&(c.splice(c.getChildrenSize(),0,[ot(),...l.getChildren()]),l.remove())}}}const Xp=/^(\s*)(\d{1,})\.\s/,Qp=/^(\s*)[-*+]\s/,vS=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,hc=/^(#{1,6})\s/,em=/^>\s/,tm=/^[ \t]*```([\w-]+)?/,gc=/[ \t]*```$/,ES=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,kS=/^(?:\|)(.+)(?:\|)\s?$/,TS=/^(\| ?:?-*:? ?)+\|\s?$/,eh=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,th=/^<\/[a-z_][\w-]*\s*>/i,nh=n=>new RegExp(`(?:${n.source})$`,n.flags),Pi=Tc("mdListMarker",{parse:n=>typeof n=="string"&&/^[-*+]$/.test(n)?n:"-"}),nm=n=>(e,t,r,i)=>{const s=n(r);s.append(...t),e.replace(s),i||s.select(0,0)},rm=n=>(e,t,r,i)=>{const s=e.getPreviousSibling(),o=e.getNextSibling(),l=mt(n==="check"?r[3]==="x":void 0),a=r[0].trim()[0],c=n!=="bullet"&&n!=="check"||a!==Pi.parse(a)?void 0:a;if(J(o)&&o.getListType()===n){c&&Vs(o,Pi,c);const d=o.getFirstChild();d!==null?d.insertBefore(l):o.append(l),e.remove()}else if(J(s)&&s.getListType()===n)c&&Vs(s,Pi,c),s.append(l),e.remove();else{const d=st(n,n==="number"?Number(r[2]):void 0);c&&Vs(d,Pi,c),d.append(l),e.replace(d)}l.append(...t),i||l.select(0,0);const u=(function(d){const f=d.match(/\t/g),h=d.match(/ /g);let g=0;return f&&(g+=f.length),h&&(g+=Math.floor(h.length/4)),g})(r[1]);u&&l.setIndent(u)},Cu=(n,e,t)=>{const r=[],i=n.getChildren();let s=0;for(const o of i)if(X(o)){if(o.getChildrenSize()===1){const d=o.getFirstChild();if(J(d)){r.push(Cu(d,e,t+1));continue}}const l=" ".repeat(4*t),a=n.getListType(),c=Yi(n,Pi),u=a==="number"?`${n.getStart()+s}. `:a==="check"?`${c} [${o.getChecked()?"x":" "}] `:c+" ";r.push(l+u+e(o)),s++}return r.join(`
34
+ `)},NS={dependencies:[yl],export:(n,e)=>{if(!rx(n))return null;const t=Number(n.getTag().slice(1));return"#".repeat(t)+" "+e(n)},regExp:hc,replace:nm(n=>{const e="h"+n[1].length;return ft(e)}),type:"element"},AS={dependencies:[_l],export:(n,e)=>{if(!Qa(n))return null;const t=e(n).split(`
35
+ `),r=[];for(const i of t)r.push("> "+i);return r.join(`
36
+ `)},regExp:em,replace:(n,e,t,r)=>{if(r){const s=n.getPreviousSibling();if(Qa(s))return s.splice(s.getChildrenSize(),0,[ot(),...e]),void n.remove()}const i=mi();i.append(...e),n.replace(i),r||i.select(0,0)},type:"element"},OS={dependencies:[nr],export:n=>{if(!It(n))return null;const e=n.getTextContent();return"```"+(n.getLanguage()||"")+(e?`
37
+ `+e:"")+"\n```"},regExpEnd:{optional:!0,regExp:gc},regExpStart:tm,replace:(n,e,t,r,i,s)=>{let o,l;if(!e&&i){if(i.length===1)r?(o=xt(),l=t[1]+i[0]):(o=xt(t[1]),l=i[0].startsWith(" ")?i[0].slice(1):i[0]);else{if(o=xt(t[1]),i[0].trim().length===0)for(;i.length>0&&!i[0].length;)i.shift();else i[0]=i[0].startsWith(" ")?i[0].slice(1):i[0];for(;i.length>0&&!i[i.length-1].length;)i.pop();l=i.join(`
38
+ `)}const a=de(l);o.append(a),n.append(o)}else e&&nm(a=>xt(a?a[1]:void 0))(n,e,t,s)},type:"multiline-element"},MS={dependencies:[Es,Tr],export:(n,e)=>J(n)?Cu(n,e,0):null,regExp:Qp,replace:rm("bullet"),type:"element"},$S={dependencies:[Es,Tr],export:(n,e)=>J(n)?Cu(n,e,0):null,regExp:Xp,replace:rm("number"),type:"element"},IS={format:["code"],tag:"`",type:"text-format"},FS={format:["highlight"],tag:"==",type:"text-format"},DS={format:["bold","italic"],tag:"***",type:"text-format"},LS={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},RS={format:["bold"],tag:"**",type:"text-format"},PS={format:["bold"],intraword:!1,tag:"__",type:"text-format"},BS={format:["strikethrough"],tag:"~~",type:"text-format"},zS={format:["italic"],tag:"*",type:"text-format"},US={format:["italic"],intraword:!1,tag:"_",type:"text-format"},KS={dependencies:[Or],export:(n,e,t)=>{if(!vn(n)||Li(n))return null;const r=n.getTitle(),i=e(n);return r?`[${i}](${n.getURL()} "${r}")`:`[${i}](${n.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(n,e)=>{const[,t,r,i]=e,s=tr(r,{title:i}),o=t.split("[").length-1,l=t.split("]").length-1;let a=t,c="";if(o<l)return;if(o>l){const d=t.split("[");c="["+d[0],a=d.slice(1).join("[")}const u=de(a);return u.setFormat(n.getFormat()),s.append(u),n.replace(s),c&&s.insertBefore(de(c)),u},trigger:")",type:"text-match"},WS=[NS,AS,MS,$S],jS=[OS],HS=[IS,DS,LS,RS,PS,FS,zS,US,BS],JS=[KS],wu=[...WS,...jS,...HS,...JS];function GS(n,e=wu,t,r=!1,i=!1){const s=r?n:(function(o,l=!1){const a=o.split(`
39
+ `);let c=!1;const u=[];for(let d=0;d<a.length;d++){const f=a[d].trimEnd(),h=u[u.length-1];ES.test(f)?u.push(f):tm.test(f)||gc.test(f)?(c=!c,u.push(f)):c||f===""||h===""||!h||hc.test(h)||hc.test(f)||em.test(f)||Xp.test(f)||Qp.test(f)||vS.test(f)||kS.test(f)||TS.test(f)||!l||eh.test(f)||th.test(f)||nh(th).test(h)||nh(eh).test(h)||gc.test(h)?u.push(f):u[u.length-1]=h+" "+f.trimStart()}return u.join(`
40
+ `)})(n,i);return SS(e,r)(s,t)}function VS(n=wu,e,t=!1){return(function(i,s=!1){const o=Zp(i),l=[...o.multilineElement,...o.element],a=!s,c=o.textFormat.filter(u=>u.format.length===1).sort((u,d)=>Number(u.format.includes("code"))-Number(d.format.includes("code")));return u=>{const d=[],f=(u||fe()).getChildren();for(let h=0;h<f.length;h++){const g=f[h],p=bS(g,l,c,o.textMatch);p!=null&&d.push(a&&h>0&&!fc(g)&&!fc(f[h-1])?`
41
+ `.concat(p):p)}return d.join(`
42
+ `)}})(n,t)(e)}function im(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}class sm{_offsetMap;_firstNode;_blockOffsetSize;constructor(e,t,r=1){this._offsetMap=e,this._firstNode=t,this._blockOffsetSize=r}createSelectionFromOffsets(e,t,r){const i=this._firstNode;if(i===null)return null;let s=e,o=t,l=Bi(i,s,this._blockOffsetSize),a=Bi(i,o,this._blockOffsetSize);if(r!==void 0&&(s=rh(s,l,r,this,this._blockOffsetSize),l=Bi(i,s,this._blockOffsetSize),o=rh(o,a,r,this,this._blockOffsetSize),a=Bi(i,o,this._blockOffsetSize)),l===null||a===null)return null;let c=l.key,u=a.key;const d=Y(c),f=Y(u);if(d===null||f===null)return null;let h=0,g=0,p="element",m="element";if(l.type==="text"){h=s-l.start,p="text";const _=d.getNextSibling();s!==o&&h===d.getTextContentSize()&&I(_)&&(h=0,c=_.__key)}else l.type==="inline"&&(c=d.getParentOrThrow().getKey(),h=o>l.start?l.end:l.start);a.type==="text"?(g=o-a.start,m="text"):a.type==="inline"&&(u=f.getParentOrThrow().getKey(),g=o>a.start?a.end:a.start);const b=di();return b===null?null:(b.anchor.set(c,h,p),b.focus.set(u,g,m),b)}getOffsetsFromSelection(e){const t=e.anchor,r=e.focus,i=this._offsetMap,s=t.offset,o=r.offset;let l=-1,a=-1;if(t.type==="text"){const c=i.get(t.key);c!==void 0&&(l=c.start+s)}else{const c=t.getNode().getDescendantByIndex(s);if(c!==null){const u=i.get(c.getKey());u!==void 0&&(l=c.getIndexWithinParent()!==s?u.end:u.start)}}if(r.type==="text"){const c=i.get(r.key);c!==void 0&&(a=c.start+r.offset)}else{const c=r.getNode().getDescendantByIndex(o);if(c!==null){const u=i.get(c.getKey());u!==void 0&&(a=c.getIndexWithinParent()!==o?u.end:u.start)}}return[l,a]}}function rh(n,e,t,r,i){const s=t._offsetMap,o=r._offsetMap,l=new Set;let a=n,c=e;for(;c!==null;){const d=c.key,f=s.get(d),h=c.end-c.start;if(l.add(d),f===void 0)a+=h;else{const m=f.end-f.start;m!==h&&(a+=h-m)}const g=c.prev;if(g!==null){c=g;continue}let p=c.parent;for(;p!==null;){let m=p.prev;if(m!==null){const b=m.key,_=s.get(b),y=m.end-m.start;if(l.add(b),_===void 0)a+=y;else{const C=_.end-_.start;C!==y&&(a+=y-C)}m=m.prev}p=p.parent}break}const u=t._firstNode;if(u!==null){c=Bi(u,n,i);let d=!1;for(;c!==null;){if(!l.has(c.key)){d=!0;break}c=c.parent}if(!d)for(;c!==null;){const f=c.key;if(!l.has(f)){const h=o.get(f),g=c.end-c.start;if(h===void 0)a-=g;else{const p=h.end-h.start;g!==p&&(a+=p-g)}}c=c.prev}}return a}function Bi(n,e,t){let r=n;for(;r!==null;){if(e<r.end+(r.type!=="element"||t===0?1:0)){const s=r.child;if(s!==null){r=s;continue}return r}const i=r.next;if(i===null)break;r=i}return null}function ih(n,e,t,r,i,s){return{child:n,end:r,key:i,next:null,parent:s,prev:null,start:t,type:e}}function YS(n,e,t,r,i,s){const o=r.get(e);o===void 0&&im(3);const l=n.offset;if(O(o)){const d=ir(o,r),f=d.length===0,h=f?null:om(n,d,null,r,i,s);n.prevIsBlock&&!f||(n.prevIsBlock=!0,n.offset+=s);const g=ih(h,"element",l,l,e,t);h!==null&&(h.parent=g);const p=n.offset;return g.end=p,i.set(e,g),g}n.prevIsBlock=!1;const a=I(o),c=a?o.__text.length:1,u=ih(null,a?"text":"inline",l,n.offset+=c,e,t);return i.set(e,u),u}function om(n,e,t,r,i,s){let o=null,l=null;const a=e.length;for(let c=0;c<a;c++){const u=YS(n,e[c],t,r,i,s);l===null?o=u:(u.prev=l,l.next=u),l=u}return o}function ir(n,e){const t=[];let r=n.__first;for(;r!==null;){const i=e===null?Y(r):e.get(r);i==null&&im(174),t.push(r),r=i.__next}return t}const qS=ir;function ZS(n,e=1,t){const r=(t||n._pendingEditorState||n._editorState)._nodeMap,i=r.get("root"),s=new Map,o=om({offset:0,prevIsBlock:!1},ir(i,r),null,r,s,e);return new sm(s,o,e)}const XS=Object.freeze(Object.defineProperty({__proto__:null,$createChildrenArray:ir,$createOffsetView:ZS,OffsetView:sm,createChildrenArray:qS},Symbol.toStringTag,{value:"Module"})),Gt=()=>new Map,pc=n=>{const e=Gt();return n.forEach((t,r)=>{e.set(r,t)}),e},xi=(n,e,t)=>{let r=n.get(e);return r===void 0&&n.set(e,r=t()),r},QS=(n,e)=>{const t=[];for(const[r,i]of n)t.push(e(i,r));return t},eC=(n,e)=>{for(const[t,r]of n)if(e(r,t))return!0;return!1},Xr=()=>new Set,ya=n=>n[n.length-1],Qr=Array.from,vu=(n,e)=>{for(let t=0;t<n.length;t++)if(!e(n[t],t,n))return!1;return!0},lm=(n,e)=>{for(let t=0;t<n.length;t++)if(e(n[t],t,n))return!0;return!1},tC=(n,e)=>{const t=new Array(n);for(let r=0;r<n;r++)t[r]=e(r,t);return t},vl=Array.isArray;class nC{constructor(){this._observers=Gt()}on(e,t){return xi(this._observers,e,Xr).add(t),t}once(e,t){const r=(...i)=>{this.off(e,r),t(...i)};this.on(e,r)}off(e,t){const r=this._observers.get(e);r!==void 0&&(r.delete(t),r.size===0&&this._observers.delete(e))}emit(e,t){return Qr((this._observers.get(e)||Gt()).values()).forEach(r=>r(...t))}destroy(){this._observers=Gt()}}const gn=Math.floor,eo=Math.abs,am=(n,e)=>n<e?n:e,Si=(n,e)=>n>e?n:e,rC=n=>n!==0?n<0:1/n<0,sh=1,oh=2,ba=4,xa=8,iC=32,cm=64,Do=128,sC=31,lh=63,Gi=127,oC=2147483647,ah=Number.MAX_SAFE_INTEGER,ch=Number.MIN_SAFE_INTEGER,lC=Number.isInteger||(n=>typeof n=="number"&&isFinite(n)&&gn(n)===n),aC=String.fromCharCode,cC=n=>n.toLowerCase(),uC=/^\s*/g,dC=n=>n.replace(uC,""),fC=/([A-Z])/g,uh=(n,e)=>dC(n.replace(fC,t=>`${e}${cC(t)}`)),hC=n=>{const e=unescape(encodeURIComponent(n)),t=e.length,r=new Uint8Array(t);for(let i=0;i<t;i++)r[i]=e.codePointAt(i);return r},as=typeof TextEncoder<"u"?new TextEncoder:null,gC=n=>as.encode(n),pC=as?gC:hC;let Sa=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});Sa&&Sa.decode(new Uint8Array).length===1&&(Sa=null);const mC=(n,e)=>tC(e,()=>n).join("");class Ns{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const Eu=()=>new Ns,_C=n=>{let e=n.cpos;for(let t=0;t<n.bufs.length;t++)e+=n.bufs[t].length;return e},an=n=>{const e=new Uint8Array(_C(n));let t=0;for(let r=0;r<n.bufs.length;r++){const i=n.bufs[r];e.set(i,t),t+=i.length}return e.set(new Uint8Array(n.cbuf.buffer,0,n.cpos),t),e},yC=(n,e)=>{const t=n.cbuf.length;t-n.cpos<e&&(n.bufs.push(new Uint8Array(n.cbuf.buffer,0,n.cpos)),n.cbuf=new Uint8Array(Si(t,e)*2),n.cpos=0)},Ae=(n,e)=>{const t=n.cbuf.length;n.cpos===t&&(n.bufs.push(n.cbuf),n.cbuf=new Uint8Array(t*2),n.cpos=0),n.cbuf[n.cpos++]=e},mc=Ae,ce=(n,e)=>{for(;e>Gi;)Ae(n,Do|Gi&e),e=gn(e/128);Ae(n,Gi&e)},ku=(n,e)=>{const t=rC(e);for(t&&(e=-e),Ae(n,(e>lh?Do:0)|(t?cm:0)|lh&e),e=gn(e/64);e>0;)Ae(n,(e>Gi?Do:0)|Gi&e),e=gn(e/128)},_c=new Uint8Array(3e4),bC=_c.length/3,xC=(n,e)=>{if(e.length<bC){const t=as.encodeInto(e,_c).written||0;ce(n,t);for(let r=0;r<t;r++)Ae(n,_c[r])}else ut(n,pC(e))},SC=(n,e)=>{const t=unescape(encodeURIComponent(e)),r=t.length;ce(n,r);for(let i=0;i<r;i++)Ae(n,t.codePointAt(i))},Vr=as&&as.encodeInto?xC:SC,Tu=(n,e)=>{const t=n.cbuf.length,r=n.cpos,i=am(t-r,e.length),s=e.length-i;n.cbuf.set(e.subarray(0,i),r),n.cpos+=i,s>0&&(n.bufs.push(n.cbuf),n.cbuf=new Uint8Array(Si(t*2,s)),n.cbuf.set(e.subarray(i)),n.cpos=s)},ut=(n,e)=>{ce(n,e.byteLength),Tu(n,e)},Nu=(n,e)=>{yC(n,e);const t=new DataView(n.cbuf.buffer,n.cpos,e);return n.cpos+=e,t},CC=(n,e)=>Nu(n,4).setFloat32(0,e,!1),wC=(n,e)=>Nu(n,8).setFloat64(0,e,!1),vC=(n,e)=>Nu(n,8).setBigInt64(0,e,!1),dh=new DataView(new ArrayBuffer(4)),EC=n=>(dh.setFloat32(0,n),dh.getFloat32(0)===n),cs=(n,e)=>{switch(typeof e){case"string":Ae(n,119),Vr(n,e);break;case"number":lC(e)&&eo(e)<=oC?(Ae(n,125),ku(n,e)):EC(e)?(Ae(n,124),CC(n,e)):(Ae(n,123),wC(n,e));break;case"bigint":Ae(n,122),vC(n,e);break;case"object":if(e===null)Ae(n,126);else if(vl(e)){Ae(n,117),ce(n,e.length);for(let t=0;t<e.length;t++)cs(n,e[t])}else if(e instanceof Uint8Array)Ae(n,116),ut(n,e);else{Ae(n,118);const t=Object.keys(e);ce(n,t.length);for(let r=0;r<t.length;r++){const i=t[r];Vr(n,i),cs(n,e[i])}}break;case"boolean":Ae(n,e?120:121);break;default:Ae(n,127)}};class fh extends Ns{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&ce(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const hh=n=>{n.count>0&&(ku(n.encoder,n.count===1?n.s:-n.s),n.count>1&&ce(n.encoder,n.count-2))};class to{constructor(){this.encoder=new Ns,this.s=0,this.count=0}write(e){this.s===e?this.count++:(hh(this),this.count=1,this.s=e)}toUint8Array(){return hh(this),an(this.encoder)}}const gh=n=>{if(n.count>0){const e=n.diff*2+(n.count===1?0:1);ku(n.encoder,e),n.count>1&&ce(n.encoder,n.count-2)}};class Ca{constructor(){this.encoder=new Ns,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(gh(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return gh(this),an(this.encoder)}}class kC{constructor(){this.sarr=[],this.s="",this.lensE=new to}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new Ns;return this.sarr.push(this.s),this.s="",Vr(e,this.sarr.join("")),Tu(e,this.lensE.toUint8Array()),an(e)}}const Pn=n=>new Error(n),Ft=()=>{throw Pn("Method unimplemented")},pn=()=>{throw Pn("Unexpected case")},TC=crypto.getRandomValues.bind(crypto),um=()=>TC(new Uint32Array(1))[0],NC="10000000-1000-4000-8000"+-1e11,AC=()=>NC.replace(/[018]/g,n=>(n^um()&15>>n/4).toString(16)),ph=n=>new Promise(n);Promise.all.bind(Promise);const mh=n=>n===void 0?null:n;class OC{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}}let dm=new OC,MC=!0;try{typeof localStorage<"u"&&localStorage&&(dm=localStorage,MC=!1)}catch{}const $C=dm,us=Symbol("Equality"),fm=(n,e)=>n===e||!!n?.[us]?.(e)||!1,IC=n=>typeof n=="object",FC=Object.assign,DC=Object.keys,LC=(n,e)=>{for(const t in n)e(n[t],t)},Lo=n=>DC(n).length,RC=n=>{for(const e in n)return!1;return!0},As=(n,e)=>{for(const t in n)if(!e(n[t],t))return!1;return!0},Au=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),PC=(n,e)=>n===e||Lo(n)===Lo(e)&&As(n,(t,r)=>(t!==void 0||Au(e,r))&&fm(e[r],t)),BC=Object.freeze,hm=n=>{for(const e in n){const t=n[e];(typeof t=="object"||typeof t=="function")&&hm(n[e])}return BC(n)},Ou=(n,e,t=0)=>{try{for(;t<n.length;t++)n[t](...e)}finally{t<n.length&&Ou(n,e,t+1)}},no=(n,e)=>{if(n===e)return!0;if(n==null||e==null||n.constructor!==e.constructor&&(n.constructor||Object)!==(e.constructor||Object))return!1;if(n[us]!=null)return n[us](e);switch(n.constructor){case ArrayBuffer:n=new Uint8Array(n),e=new Uint8Array(e);case Uint8Array:{if(n.byteLength!==e.byteLength)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;break}case Set:{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;break}case Map:{if(n.size!==e.size)return!1;for(const t of n.keys())if(!e.has(t)||!no(n.get(t),e.get(t)))return!1;break}case void 0:case Object:if(Lo(n)!==Lo(e))return!1;for(const t in n)if(!Au(n,t)||!no(n[t],e[t]))return!1;break;case Array:if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(!no(n[t],e[t]))return!1;break;default:return!1}return!0},zC=(n,e)=>e.includes(n),ds=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";let Rt;const UC=()=>{if(Rt===void 0)if(ds){Rt=Gt();const n=process.argv;let e=null;for(let t=0;t<n.length;t++){const r=n[t];r[0]==="-"?(e!==null&&Rt.set(e,""),e=r):e!==null&&(Rt.set(e,r),e=null)}e!==null&&Rt.set(e,"")}else typeof location=="object"?(Rt=Gt(),(location.search||"?").slice(1).split("&").forEach(n=>{if(n.length!==0){const[e,t]=n.split("=");Rt.set(`--${uh(e,"-")}`,t),Rt.set(`-${uh(e,"-")}`,t)}})):Rt=Gt();return Rt},yc=n=>UC().has(n),Ro=n=>mh(ds?process.env[n.toUpperCase().replaceAll("-","_")]:$C.getItem(n)),gm=n=>yc("--"+n)||Ro(n)!==null,KC=gm("production"),WC=ds&&zC(process.env.FORCE_COLOR,["true","1","2"]),jC=WC||!yc("--no-colors")&&!gm("no-color")&&(!ds||process.stdout.isTTY)&&(!ds||yc("--color")||Ro("COLORTERM")!==null||(Ro("TERM")||"").includes("color"));class HC{constructor(e,t){this.left=e,this.right=t}}const en=(n,e)=>new HC(n,e),_h=n=>n.next()>=.5,wa=(n,e,t)=>gn(n.next()*(t+1-e)+e),pm=(n,e,t)=>gn(n.next()*(t+1-e)+e),Mu=(n,e,t)=>pm(n,e,t),JC=n=>aC(Mu(n,97,122)),GC=(n,e=0,t=20)=>{const r=Mu(n,e,t);let i="";for(let s=0;s<r;s++)i+=JC(n);return i},va=(n,e)=>e[Mu(n,0,e.length-1)],VC=Symbol("0schema");class YC{constructor(){this._rerrs=[]}extend(e,t,r,i=null){this._rerrs.push({path:e,expected:t,has:r,message:i})}toString(){const e=[];for(let t=this._rerrs.length-1;t>0;t--){const r=this._rerrs[t];e.push(mC(" ",(this._rerrs.length-t)*2)+`${r.path!=null?`[${r.path}] `:""}${r.has} doesn't match ${r.expected}. ${r.message}`)}return e.join(`
43
+ `)}}const bc=(n,e)=>n===e?!0:n==null||e==null||n.constructor!==e.constructor?!1:n[us]?fm(n,e):vl(n)?vu(n,t=>lm(e,r=>bc(t,r))):IC(n)?As(n,(t,r)=>bc(t,e[r])):!1;class nt{static _dilutes=!1;extends(e){let[t,r]=[this.shape,e.shape];return this.constructor._dilutes&&([r,t]=[t,r]),bc(t,r)}equals(e){return this.constructor===e.constructor&&no(this.shape,e.shape)}[VC](){return!0}[us](e){return this.equals(e)}validate(e){return this.check(e)}check(e,t){Ft()}get nullable(){return Ci(this,Al)}get optional(){return new ym(this)}cast(e){return yh(e,this),e}expect(e){return yh(e,this),e}}class $u extends nt{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t=void 0){const r=e?.constructor===this.shape&&(this._c==null||this._c(e));return!r&&t?.extend(null,this.shape.name,e?.constructor.name,e?.constructor!==this.shape?"Constructor match failed":"Check failed"),r}}const we=(n,e=null)=>new $u(n,e);we($u);class Iu extends nt{constructor(e){super(),this.shape=e}check(e,t){const r=this.shape(e);return!r&&t?.extend(null,"custom prop",e?.constructor.name,"failed to check custom prop"),r}}const Re=n=>new Iu(n);we(Iu);class El extends nt{constructor(e){super(),this.shape=e}check(e,t){const r=this.shape.some(i=>i===e);return!r&&t?.extend(null,this.shape.join(" | "),e.toString()),r}}const kl=(...n)=>new El(n),mm=we(El),qC=RegExp.escape||(n=>n.replace(/[().|&,$^[\]]/g,e=>"\\"+e)),_m=n=>{if(ei.check(n))return[qC(n)];if(mm.check(n))return n.shape.map(e=>e+"");if(Tm.check(n))return["[+-]?\\d+.?\\d*"];if(Nm.check(n))return[".*"];if(Po.check(n))return n.shape.map(_m).flat(1);pn()};class ZC extends nt{constructor(e){super(),this.shape=e,this._r=new RegExp("^"+e.map(_m).map(t=>`(${t.join("|")})`).join("")+"$")}check(e,t){const r=this._r.exec(e)!=null;return!r&&t?.extend(null,this._r.toString(),e.toString(),"String doesn't match string template."),r}}we(ZC);const XC=Symbol("optional");class ym extends nt{constructor(e){super(),this.shape=e}check(e,t){const r=e===void 0||this.shape.check(e);return!r&&t?.extend(null,"undefined (optional)","()"),r}get[XC](){return!0}}const QC=we(ym);class ew extends nt{check(e,t){return t?.extend(null,"never",typeof e),!1}}we(ew);class Tl extends nt{constructor(e,t=!1){super(),this.shape=e,this._isPartial=t}static _dilutes=!0;get partial(){return new Tl(this.shape,!0)}check(e,t){return e==null?(t?.extend(null,"object","null"),!1):As(this.shape,(r,i)=>{const s=this._isPartial&&!Au(e,i)||r.check(e[i],t);return!s&&t?.extend(i.toString(),r.toString(),typeof e[i],"Object property does not match"),s})}}const tw=n=>new Tl(n),nw=we(Tl),rw=Re(n=>n!=null&&(n.constructor===Object||n.constructor==null));class bm extends nt{constructor(e,t){super(),this.shape={keys:e,values:t}}check(e,t){return e!=null&&As(e,(r,i)=>{const s=this.shape.keys.check(i,t);return!s&&t?.extend(i+"","Record",typeof e,s?"Key doesn't match schema":"Value doesn't match value"),s&&this.shape.values.check(r,t)})}}const xm=(n,e)=>new bm(n,e),iw=we(bm);class Sm extends nt{constructor(e){super(),this.shape=e}check(e,t){return e!=null&&As(this.shape,(r,i)=>{const s=r.check(e[i],t);return!s&&t?.extend(i.toString(),"Tuple",typeof r),s})}}const sw=(...n)=>new Sm(n);we(Sm);class Cm extends nt{constructor(e){super(),this.shape=e.length===1?e[0]:new Fu(e)}check(e,t){const r=vl(e)&&vu(e,i=>this.shape.check(i));return!r&&t?.extend(null,"Array",""),r}}const wm=(...n)=>new Cm(n),ow=we(Cm),lw=Re(n=>vl(n));class vm extends nt{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t){const r=e instanceof this.shape&&(this._c==null||this._c(e));return!r&&t?.extend(null,this.shape.name,e?.constructor.name),r}}const aw=(n,e=null)=>new vm(n,e);we(vm);const cw=aw(nt);class uw extends nt{constructor(e){super(),this.len=e.length-1,this.args=sw(...e.slice(-1)),this.res=e[this.len]}check(e,t){const r=e.constructor===Function&&e.length<=this.len;return!r&&t?.extend(null,"function",typeof e),r}}const dw=we(uw),fw=Re(n=>typeof n=="function");class hw extends nt{constructor(e){super(),this.shape=e}check(e,t){const r=vu(this.shape,i=>i.check(e,t));return!r&&t?.extend(null,"Intersectinon",typeof e),r}}we(hw,n=>n.shape.length>0);class Fu extends nt{static _dilutes=!0;constructor(e){super(),this.shape=e}check(e,t){const r=lm(this.shape,i=>i.check(e,t));return t?.extend(null,"Union",typeof e),r}}const Ci=(...n)=>n.findIndex(e=>Po.check(e))>=0?Ci(...n.map(e=>fs(e)).map(e=>Po.check(e)?e.shape:[e]).flat(1)):n.length===1?n[0]:new Fu(n),Po=we(Fu),Em=()=>!0,Bo=Re(Em),gw=we(Iu,n=>n.shape===Em),Du=Re(n=>typeof n=="bigint"),pw=Re(n=>n===Du),km=Re(n=>typeof n=="symbol");Re(n=>n===km);const Yr=Re(n=>typeof n=="number"),Tm=Re(n=>n===Yr),ei=Re(n=>typeof n=="string"),Nm=Re(n=>n===ei),Nl=Re(n=>typeof n=="boolean"),mw=Re(n=>n===Nl),Am=kl(void 0);we(El,n=>n.shape.length===1&&n.shape[0]===void 0);kl(void 0);const Al=kl(null),_w=we(El,n=>n.shape.length===1&&n.shape[0]===null);we(Uint8Array);we($u,n=>n.shape===Uint8Array);const yw=Ci(Yr,ei,Al,Am,Du,Nl,km);(()=>{const n=wm(Bo),e=xm(ei,Bo),t=Ci(Yr,ei,Al,Nl,n,e);return n.shape=t,e.shape.values=t,t})();const fs=n=>{if(cw.check(n))return n;if(rw.check(n)){const e={};for(const t in n)e[t]=fs(n[t]);return tw(e)}else{if(lw.check(n))return Ci(...n.map(fs));if(yw.check(n))return kl(n);if(fw.check(n))return we(n)}pn()},yh=KC?()=>{}:(n,e)=>{const t=new YC;if(!e.check(n,t))throw Pn(`Expected value to be of type ${e.constructor.name}.
44
+ ${t.toString()}`)};class bw{constructor(e){this.patterns=[],this.$state=e}if(e,t){return this.patterns.push({if:fs(e),h:t}),this}else(e){return this.if(Bo,e)}done(){return(e,t)=>{for(let r=0;r<this.patterns.length;r++){const i=this.patterns[r];if(i.if.check(e))return i.h(e,t)}throw Pn("Unhandled pattern")}}}const xw=n=>new bw(n),Om=xw(Bo).if(Tm,(n,e)=>wa(e,ch,ah)).if(Nm,(n,e)=>GC(e)).if(mw,(n,e)=>_h(e)).if(pw,(n,e)=>BigInt(wa(e,ch,ah))).if(Po,(n,e)=>Pr(e,va(e,n.shape))).if(nw,(n,e)=>{const t={};for(const r in n.shape){let i=n.shape[r];if(QC.check(i)){if(_h(e))continue;i=i.shape}t[r]=Om(i,e)}return t}).if(ow,(n,e)=>{const t=[],r=pm(e,0,42);for(let i=0;i<r;i++)t.push(Pr(e,n.shape));return t}).if(mm,(n,e)=>va(e,n.shape)).if(_w,(n,e)=>null).if(dw,(n,e)=>{const t=Pr(e,n.res);return()=>t}).if(gw,(n,e)=>Pr(e,va(e,[Yr,ei,Al,Am,Du,Nl,wm(Yr),xm(Ci("a","b","c"),Yr)]))).if(iw,(n,e)=>{const t={},r=wa(e,0,3);for(let i=0;i<r;i++){const s=Pr(e,n.shape.keys),o=Pr(e,n.shape.values);t[s]=o}return t}).done(),Pr=(n,e)=>Om(fs(e),n),Ol=typeof document<"u"?document:{};Re(n=>n.nodeType===Ew);typeof DOMParser<"u"&&new DOMParser;Re(n=>n.nodeType===Cw);Re(n=>n.nodeType===ww);const Sw=n=>QS(n,(e,t)=>`${t}:${e};`).join(""),Cw=Ol.ELEMENT_NODE,ww=Ol.TEXT_NODE,vw=Ol.DOCUMENT_NODE,Ew=Ol.DOCUMENT_FRAGMENT_NODE;Re(n=>n.nodeType===vw);const Cn=Symbol,Mm=Cn(),$m=Cn(),kw=Cn(),Tw=Cn(),Nw=Cn(),Im=Cn(),Aw=Cn(),Lu=Cn(),Ow=Cn(),Mw=n=>{n.length===1&&n[0]?.constructor===Function&&(n=n[0]());const e=[],t=[];let r=0;for(;r<n.length;r++){const i=n[r];if(i===void 0)break;if(i.constructor===String||i.constructor===Number)e.push(i);else if(i.constructor===Object)break}for(r>0&&t.push(e.join(""));r<n.length;r++){const i=n[r];i instanceof Symbol||t.push(i)}return t},$w={[Mm]:en("font-weight","bold"),[$m]:en("font-weight","normal"),[kw]:en("color","blue"),[Nw]:en("color","green"),[Tw]:en("color","grey"),[Im]:en("color","red"),[Aw]:en("color","purple"),[Lu]:en("color","orange"),[Ow]:en("color","black")},Iw=n=>{n.length===1&&n[0]?.constructor===Function&&(n=n[0]());const e=[],t=[],r=Gt();let i=[],s=0;for(;s<n.length;s++){const o=n[s],l=$w[o];if(l!==void 0)r.set(l.left,l.right);else{if(o===void 0)break;if(o.constructor===String||o.constructor===Number){const a=Sw(r);s>0||a.length>0?(e.push("%c"+o),t.push(a)):e.push(o)}else break}}for(s>0&&(i=t,i.unshift(e.join("")));s<n.length;s++){const o=n[s];o instanceof Symbol||i.push(o)}return i},Fm=jC?Iw:Mw,Fw=(...n)=>{console.log(...Fm(n)),Dm.forEach(e=>e.print(n))},Dw=(...n)=>{console.warn(...Fm(n)),n.unshift(Lu),Dm.forEach(e=>e.print(n))},Dm=Xr(),Lm=n=>({[Symbol.iterator](){return this},next:n}),Lw=(n,e)=>Lm(()=>{let t;do t=n.next();while(!t.done&&!e(t.value));return t}),Ea=(n,e)=>Lm(()=>{const{done:t,value:r}=n.next();return{done:t,value:t?void 0:e(r)}});class Rw{constructor(e,t){this.clock=e,this.len=t}}class Pw{constructor(){this.clients=new Map}}const Rm=(n,e,t)=>e.clients.forEach((r,i)=>{const s=n.doc.store.clients.get(i);if(s!=null){const o=s[s.length-1],l=o.id.clock+o.length;for(let a=0,c=r[a];a<r.length&&c.clock<l;c=r[++a])jm(n,s,c.clock,c.len,t)}}),Bw=(n,e)=>{let t=0,r=n.length-1;for(;t<=r;){const i=gn((t+r)/2),s=n[i],o=s.clock;if(o<=e){if(e<o+s.len)return i;t=i+1}else r=i-1}return null},Pm=(n,e)=>{const t=n.clients.get(e.client);return t!==void 0&&Bw(t,e.clock)!==null},Bm=n=>{n.clients.forEach(e=>{e.sort((i,s)=>i.clock-s.clock);let t,r;for(t=1,r=1;t<e.length;t++){const i=e[r-1],s=e[t];i.clock+i.len>=s.clock?i.len=Si(i.len,s.clock+s.len-i.clock):(r<t&&(e[r]=s),r++)}e.length=r})},zm=(n,e,t,r)=>{xi(n.clients,e,()=>[]).push(new Rw(t,r))},zw=(n,e)=>{ce(n.restEncoder,e.clients.size),Qr(e.clients.entries()).sort((t,r)=>r[0]-t[0]).forEach(([t,r])=>{n.resetDsCurVal(),ce(n.restEncoder,t);const i=r.length;ce(n.restEncoder,i);for(let s=0;s<i;s++){const o=r[s];n.writeDsClock(o.clock),n.writeDsLen(o.len)}})},Um=um;class Bn extends nC{constructor({guid:e=AC(),collectionid:t=null,gc:r=!0,gcFilter:i=()=>!0,meta:s=null,autoLoad:o=!1,shouldLoad:l=!0}={}){super(),this.gc=r,this.gcFilter=i,this.clientID=Um(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new qw,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=l,this.autoLoad=o,this.meta=s,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=ph(c=>{this.on("load",()=>{this.isLoaded=!0,c(this)})});const a=()=>ph(c=>{const u=d=>{(d===void 0||d===!0)&&(this.off("sync",u),c())};this.on("sync",u)});this.on("sync",c=>{c===!1&&this.isSynced&&(this.whenSynced=a()),this.isSynced=c===void 0||c===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=a()}load(){const e=this._item;e!==null&&!this.shouldLoad&&he(e.parent.doc,t=>{t.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(Qr(this.subdocs).map(e=>e.guid))}transact(e,t=null){return he(this,e,t)}get(e,t=je){const r=xi(this.share,e,()=>{const s=new t;return s._integrate(this,null),s}),i=r.constructor;if(t!==je&&i!==t)if(i===je){const s=new t;s._map=r._map,r._map.forEach(o=>{for(;o!==null;o=o.left)o.parent=s}),s._start=r._start;for(let o=s._start;o!==null;o=o.right)o.parent=s;return s._length=r._length,this.share.set(e,s),s._integrate(this,null),s}else throw new Error(`Type with the name ${e} has already been defined with a different constructor`);return r}getArray(e=""){return this.get(e,Vi)}getText(e=""){return this.get(e,ps)}getMap(e=""){return this.get(e,yt)}getXmlElement(e=""){return this.get(e,_n)}getXmlFragment(e=""){return this.get(e,ti)}toJSON(){const e={};return this.share.forEach((t,r)=>{e[r]=t.toJSON()}),e}destroy(){this.isDestroyed=!0,Qr(this.subdocs).forEach(t=>t.destroy());const e=this._item;if(e!==null){this._item=null;const t=e.content;t.doc=new Bn({guid:this.guid,...t.opts,shouldLoad:!1}),t.doc._item=e,he(e.parent.doc,r=>{const i=t.doc;e.deleted||r.subdocsAdded.add(i),r.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class Uw{constructor(){this.restEncoder=Eu()}toUint8Array(){return an(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){ce(this.restEncoder,e)}writeDsLen(e){ce(this.restEncoder,e)}}class Kw extends Uw{writeLeftID(e){ce(this.restEncoder,e.client),ce(this.restEncoder,e.clock)}writeRightID(e){ce(this.restEncoder,e.client),ce(this.restEncoder,e.clock)}writeClient(e){ce(this.restEncoder,e)}writeInfo(e){mc(this.restEncoder,e)}writeString(e){Vr(this.restEncoder,e)}writeParentInfo(e){ce(this.restEncoder,e?1:0)}writeTypeRef(e){ce(this.restEncoder,e)}writeLen(e){ce(this.restEncoder,e)}writeAny(e){cs(this.restEncoder,e)}writeBuf(e){ut(this.restEncoder,e)}writeJSON(e){Vr(this.restEncoder,JSON.stringify(e))}writeKey(e){Vr(this.restEncoder,e)}}class Ww{constructor(){this.restEncoder=Eu(),this.dsCurrVal=0}toUint8Array(){return an(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const t=e-this.dsCurrVal;this.dsCurrVal=e,ce(this.restEncoder,t)}writeDsLen(e){e===0&&pn(),ce(this.restEncoder,e-1),this.dsCurrVal+=e}}class jw extends Ww{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new Ca,this.clientEncoder=new to,this.leftClockEncoder=new Ca,this.rightClockEncoder=new Ca,this.infoEncoder=new fh(mc),this.stringEncoder=new kC,this.parentInfoEncoder=new fh(mc),this.typeRefEncoder=new to,this.lenEncoder=new to}toUint8Array(){const e=Eu();return ce(e,0),ut(e,this.keyClockEncoder.toUint8Array()),ut(e,this.clientEncoder.toUint8Array()),ut(e,this.leftClockEncoder.toUint8Array()),ut(e,this.rightClockEncoder.toUint8Array()),ut(e,an(this.infoEncoder)),ut(e,this.stringEncoder.toUint8Array()),ut(e,an(this.parentInfoEncoder)),ut(e,this.typeRefEncoder.toUint8Array()),ut(e,this.lenEncoder.toUint8Array()),Tu(e,an(this.restEncoder)),an(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){cs(this.restEncoder,e)}writeBuf(e){ut(this.restEncoder,e)}writeJSON(e){cs(this.restEncoder,e)}writeKey(e){const t=this.keyMap.get(e);t===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(t)}}const Hw=(n,e,t,r)=>{r=Si(r,e[0].id.clock);const i=mn(e,r);ce(n.restEncoder,e.length-i),n.writeClient(t),ce(n.restEncoder,r);const s=e[i];s.write(n,r-s.id.clock);for(let o=i+1;o<e.length;o++)e[o].write(n,0)},Jw=(n,e,t)=>{const r=new Map;t.forEach((i,s)=>{rt(e,s)>i&&r.set(s,i)}),Ru(e).forEach((i,s)=>{t.has(s)||r.set(s,0)}),ce(n.restEncoder,r.size),Qr(r.entries()).sort((i,s)=>s[0]-i[0]).forEach(([i,s])=>{Hw(n,e.clients.get(i),i,s)})},Gw=(n,e)=>Jw(n,e.doc.store,e.beforeState);class Vw{constructor(){this.l=[]}}const bh=()=>new Vw,xh=(n,e)=>n.l.push(e),Sh=(n,e)=>{const t=n.l,r=t.length;n.l=t.filter(i=>e!==i),r===n.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},Km=(n,e,t)=>Ou(n.l,[e,t]);class ro{constructor(e,t){this.client=e,this.clock=t}}const Hs=(n,e)=>n===e||n!==null&&e!==null&&n.client===e.client&&n.clock===e.clock,me=(n,e)=>new ro(n,e),Yw=n=>{for(const[e,t]of n.doc.share.entries())if(t===n)return e;throw pn()},Kr=(n,e)=>e===void 0?!n.deleted:e.sv.has(n.id.client)&&(e.sv.get(n.id.client)||0)>n.id.clock&&!Pm(e.ds,n.id),xc=(n,e)=>{const t=xi(n.meta,xc,Xr),r=n.doc.store;t.has(e)||(e.sv.forEach((i,s)=>{i<rt(r,s)&&zn(n,me(s,i))}),Rm(n,e.ds,i=>{}),t.add(e))};class qw{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const Ru=n=>{const e=new Map;return n.clients.forEach((t,r)=>{const i=t[t.length-1];e.set(r,i.id.clock+i.length)}),e},rt=(n,e)=>{const t=n.clients.get(e);if(t===void 0)return 0;const r=t[t.length-1];return r.id.clock+r.length},Wm=(n,e)=>{let t=n.clients.get(e.id.client);if(t===void 0)t=[],n.clients.set(e.id.client,t);else{const r=t[t.length-1];if(r.id.clock+r.length!==e.id.clock)throw pn()}t.push(e)},mn=(n,e)=>{let t=0,r=n.length-1,i=n[r],s=i.id.clock;if(s===e)return r;let o=gn(e/(s+i.length-1)*r);for(;t<=r;){if(i=n[o],s=i.id.clock,s<=e){if(e<s+i.length)return o;t=o+1}else r=o-1;o=gn((t+r)/2)}throw pn()},Zw=(n,e)=>{const t=n.clients.get(e.client);return t[mn(t,e.clock)]},ka=Zw,Sc=(n,e,t)=>{const r=mn(e,t),i=e[r];return i.id.clock<t&&i instanceof Ge?(e.splice(r+1,0,a_(n,i,t-i.id.clock)),r+1):r},zn=(n,e)=>{const t=n.doc.store.clients.get(e.client);return t[Sc(n,t,e.clock)]},Ch=(n,e,t)=>{const r=e.clients.get(t.client),i=mn(r,t.clock),s=r[i];return t.clock!==s.id.clock+s.length-1&&s.constructor!==En&&r.splice(i+1,0,a_(n,s,t.clock-s.id.clock+1)),s},Xw=(n,e,t)=>{const r=n.clients.get(e.id.client);r[mn(r,e.id.clock)]=t},jm=(n,e,t,r,i)=>{if(r===0)return;const s=t+r;let o=Sc(n,e,t),l;do l=e[o++],s<l.id.clock+l.length&&Sc(n,e,s),i(l);while(o<e.length&&e[o].id.clock<s)};class Qw{constructor(e,t,r){this.doc=e,this.deleteSet=new Pw,this.beforeState=Ru(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=t,this.meta=new Map,this.local=r,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const wh=(n,e)=>e.deleteSet.clients.size===0&&!eC(e.afterState,(t,r)=>e.beforeState.get(r)!==t)?!1:(Bm(e.deleteSet),Gw(n,e),zw(n,e.deleteSet),!0),vh=(n,e,t)=>{const r=e._item;(r===null||r.id.clock<(n.beforeState.get(r.id.client)||0)&&!r.deleted)&&xi(n.changed,e,Xr).add(t)},io=(n,e)=>{let t=n[e],r=n[e-1],i=e;for(;i>0;t=r,r=n[--i-1]){if(r.deleted===t.deleted&&r.constructor===t.constructor&&r.mergeWith(t)){t instanceof Ge&&t.parentSub!==null&&t.parent._map.get(t.parentSub)===t&&t.parent._map.set(t.parentSub,r);continue}break}const s=e-i;return s&&n.splice(e+1-s,s),s},ev=(n,e,t)=>{for(const[r,i]of n.clients.entries()){const s=e.clients.get(r);for(let o=i.length-1;o>=0;o--){const l=i[o],a=l.clock+l.len;for(let c=mn(s,l.clock),u=s[c];c<s.length&&u.id.clock<a;u=s[++c]){const d=s[c];if(l.clock+l.len<=d.id.clock)break;d instanceof Ge&&d.deleted&&!d.keep&&t(d)&&d.gc(e,!1)}}}},tv=(n,e)=>{n.clients.forEach((t,r)=>{const i=e.clients.get(r);for(let s=t.length-1;s>=0;s--){const o=t[s],l=am(i.length-1,1+mn(i,o.clock+o.len-1));for(let a=l,c=i[a];a>0&&c.id.clock>=o.clock;c=i[a])a-=1+io(i,a)}})},Hm=(n,e)=>{if(e<n.length){const t=n[e],r=t.doc,i=r.store,s=t.deleteSet,o=t._mergeStructs;try{Bm(s),t.afterState=Ru(t.doc.store),r.emit("beforeObserverCalls",[t,r]);const l=[];t.changed.forEach((a,c)=>l.push(()=>{(c._item===null||!c._item.deleted)&&c._callObserver(t,a)})),l.push(()=>{t.changedParentTypes.forEach((a,c)=>{c._dEH.l.length>0&&(c._item===null||!c._item.deleted)&&(a=a.filter(u=>u.target._item===null||!u.target._item.deleted),a.forEach(u=>{u.currentTarget=c,u._path=null}),a.sort((u,d)=>u.path.length-d.path.length),l.push(()=>{Km(c._dEH,a,t)}))}),l.push(()=>r.emit("afterTransaction",[t,r])),l.push(()=>{t._needFormattingCleanup&&hv(t)})}),Ou(l,[])}finally{r.gc&&ev(s,i,r.gcFilter),tv(s,i),t.afterState.forEach((u,d)=>{const f=t.beforeState.get(d)||0;if(f!==u){const h=i.clients.get(d),g=Si(mn(h,f),1);for(let p=h.length-1;p>=g;)p-=1+io(h,p)}});for(let u=o.length-1;u>=0;u--){const{client:d,clock:f}=o[u].id,h=i.clients.get(d),g=mn(h,f);g+1<h.length&&io(h,g+1)>1||g>0&&io(h,g)}if(!t.local&&t.afterState.get(r.clientID)!==t.beforeState.get(r.clientID)&&(Fw(Lu,Mm,"[yjs] ",$m,Im,"Changed the client-id because another client seems to be using it."),r.clientID=Um()),r.emit("afterTransactionCleanup",[t,r]),r._observers.has("update")){const u=new Kw;wh(u,t)&&r.emit("update",[u.toUint8Array(),t.origin,r,t])}if(r._observers.has("updateV2")){const u=new jw;wh(u,t)&&r.emit("updateV2",[u.toUint8Array(),t.origin,r,t])}const{subdocsAdded:l,subdocsLoaded:a,subdocsRemoved:c}=t;(l.size>0||c.size>0||a.size>0)&&(l.forEach(u=>{u.clientID=r.clientID,u.collectionid==null&&(u.collectionid=r.collectionid),r.subdocs.add(u)}),c.forEach(u=>r.subdocs.delete(u)),r.emit("subdocs",[{loaded:a,added:l,removed:c},r,t]),c.forEach(u=>u.destroy())),n.length<=e+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,n])):Hm(n,e+1)}}},he=(n,e,t=null,r=!0)=>{const i=n._transactionCleanups;let s=!1,o=null;n._transaction===null&&(s=!0,n._transaction=new Qw(n,t,r),i.push(n._transaction),i.length===1&&n.emit("beforeAllTransactions",[n]),n.emit("beforeTransaction",[n._transaction,n]));try{o=e(n._transaction)}finally{if(s){const l=n._transaction===i[0];n._transaction=null,l&&Hm(i,0)}}return o},Eh="You must not compute changes after the event-handler fired.";class Ml{constructor(e,t){this.target=e,this.currentTarget=e,this.transaction=t,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=nv(this.currentTarget,this.target))}deletes(e){return Pm(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw Pn(Eh);const e=new Map,t=this.target;this.transaction.changed.get(t).forEach(i=>{if(i!==null){const s=t._map.get(i);let o,l;if(this.adds(s)){let a=s.left;for(;a!==null&&this.adds(a);)a=a.left;if(this.deletes(s))if(a!==null&&this.deletes(a))o="delete",l=ya(a.content.getContent());else return;else a!==null&&this.deletes(a)?(o="update",l=ya(a.content.getContent())):(o="add",l=void 0)}else if(this.deletes(s))o="delete",l=ya(s.content.getContent());else return;e.set(i,{action:o,oldValue:l})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw Pn(Eh);const t=this.target,r=Xr(),i=Xr(),s=[];if(e={added:r,deleted:i,delta:s,keys:this.keys},this.transaction.changed.get(t).has(null)){let l=null;const a=()=>{l&&s.push(l)};for(let c=t._start;c!==null;c=c.right)c.deleted?this.deletes(c)&&!this.adds(c)&&((l===null||l.delete===void 0)&&(a(),l={delete:0}),l.delete+=c.length,i.add(c)):this.adds(c)?((l===null||l.insert===void 0)&&(a(),l={insert:[]}),l.insert=l.insert.concat(c.content.getContent()),r.add(c)):((l===null||l.retain===void 0)&&(a(),l={retain:0}),l.retain+=c.length);l!==null&&l.retain===void 0&&a()}this._changes=e}return e}}const nv=(n,e)=>{const t=[];for(;e._item!==null&&e!==n;){if(e._item.parentSub!==null)t.unshift(e._item.parentSub);else{let r=0,i=e._item.parent._start;for(;i!==e._item&&i!==null;)!i.deleted&&i.countable&&(r+=i.length),i=i.right;t.unshift(r)}e=e._item.parent}return t},Ye=()=>{Dw("Invalid access: Add Yjs type to a document before reading data.")},Jm=80;let Pu=0;class rv{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=Pu++}}const iv=n=>{n.timestamp=Pu++},Gm=(n,e,t)=>{n.p.marker=!1,n.p=e,e.marker=!0,n.index=t,n.timestamp=Pu++},sv=(n,e,t)=>{if(n.length>=Jm){const r=n.reduce((i,s)=>i.timestamp<s.timestamp?i:s);return Gm(r,e,t),r}else{const r=new rv(e,t);return n.push(r),r}},$l=(n,e)=>{if(n._start===null||e===0||n._searchMarker===null)return null;const t=n._searchMarker.length===0?null:n._searchMarker.reduce((s,o)=>eo(e-s.index)<eo(e-o.index)?s:o);let r=n._start,i=0;for(t!==null&&(r=t.p,i=t.index,iv(t));r.right!==null&&i<e;){if(!r.deleted&&r.countable){if(e<i+r.length)break;i+=r.length}r=r.right}for(;r.left!==null&&i>e;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);return t!==null&&eo(t.index-i)<r.parent.length/Jm?(Gm(t,r,i),t):sv(n._searchMarker,r,i)},hs=(n,e,t)=>{for(let r=n.length-1;r>=0;r--){const i=n[r];if(t>0){let s=i.p;for(s.marker=!1;s&&(s.deleted||!s.countable);)s=s.left,s&&!s.deleted&&s.countable&&(i.index-=s.length);if(s===null||s.marker===!0){n.splice(r,1);continue}i.p=s,s.marker=!0}(e<i.index||t>0&&e===i.index)&&(i.index=Si(e,i.index+t))}},Il=(n,e,t)=>{const r=n,i=e.changedParentTypes;for(;xi(i,n,()=>[]).push(t),n._item!==null;)n=n._item.parent;Km(r._eH,t,e)};class je{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=bh(),this._dEH=bh(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw Ft()}clone(){throw Ft()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,t){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){xh(this._eH,e)}observeDeep(e){xh(this._dEH,e)}unobserve(e){Sh(this._eH,e)}unobserveDeep(e){Sh(this._dEH,e)}toJSON(){}}const Vm=(n,e,t)=>{n.doc??Ye(),e<0&&(e=n._length+e),t<0&&(t=n._length+t);let r=t-e;const i=[];let s=n._start;for(;s!==null&&r>0;){if(s.countable&&!s.deleted){const o=s.content.getContent();if(o.length<=e)e-=o.length;else{for(let l=e;l<o.length&&r>0;l++)i.push(o[l]),r--;e=0}}s=s.right}return i},Ym=n=>{n.doc??Ye();const e=[];let t=n._start;for(;t!==null;){if(t.countable&&!t.deleted){const r=t.content.getContent();for(let i=0;i<r.length;i++)e.push(r[i])}t=t.right}return e},gs=(n,e)=>{let t=0,r=n._start;for(n.doc??Ye();r!==null;){if(r.countable&&!r.deleted){const i=r.content.getContent();for(let s=0;s<i.length;s++)e(i[s],t++,n)}r=r.right}},qm=(n,e)=>{const t=[];return gs(n,(r,i)=>{t.push(e(r,i,n))}),t},ov=n=>{let e=n._start,t=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(t===null){for(;e!==null&&e.deleted;)e=e.right;if(e===null)return{done:!0,value:void 0};t=e.content.getContent(),r=0,e=e.right}const i=t[r++];return t.length<=r&&(t=null),{done:!1,value:i}}}},Zm=(n,e)=>{n.doc??Ye();const t=$l(n,e);let r=n._start;for(t!==null&&(r=t.p,e-=t.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(e<r.length)return r.content.getContent()[e];e-=r.length}},zo=(n,e,t,r)=>{let i=t;const s=n.doc,o=s.clientID,l=s.store,a=t===null?e._start:t.right;let c=[];const u=()=>{c.length>0&&(i=new Ge(me(o,rt(l,o)),i,i&&i.lastId,a,a&&a.id,e,null,new ni(c)),i.integrate(n,0),c=[])};r.forEach(d=>{if(d===null)c.push(d);else switch(d.constructor){case Number:case Object:case Boolean:case Array:case String:c.push(d);break;default:switch(u(),d.constructor){case Uint8Array:case ArrayBuffer:i=new Ge(me(o,rt(l,o)),i,i&&i.lastId,a,a&&a.id,e,null,new Fl(new Uint8Array(d))),i.integrate(n,0);break;case Bn:i=new Ge(me(o,rt(l,o)),i,i&&i.lastId,a,a&&a.id,e,null,new Dl(d)),i.integrate(n,0);break;default:if(d instanceof je)i=new Ge(me(o,rt(l,o)),i,i&&i.lastId,a,a&&a.id,e,null,new Jn(d)),i.integrate(n,0);else throw new Error("Unexpected content type in insert operation")}}}),u()},Xm=()=>Pn("Length exceeded!"),Qm=(n,e,t,r)=>{if(t>e._length)throw Xm();if(t===0)return e._searchMarker&&hs(e._searchMarker,t,r.length),zo(n,e,null,r);const i=t,s=$l(e,t);let o=e._start;for(s!==null&&(o=s.p,t-=s.index,t===0&&(o=o.prev,t+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(t<=o.length){t<o.length&&zn(n,me(o.id.client,o.id.clock+t));break}t-=o.length}return e._searchMarker&&hs(e._searchMarker,i,r.length),zo(n,e,o,r)},lv=(n,e,t)=>{let i=(e._searchMarker||[]).reduce((s,o)=>o.index>s.index?o:s,{index:0,p:e._start}).p;if(i)for(;i.right;)i=i.right;return zo(n,e,i,t)},e_=(n,e,t,r)=>{if(r===0)return;const i=t,s=r,o=$l(e,t);let l=e._start;for(o!==null&&(l=o.p,t-=o.index);l!==null&&t>0;l=l.right)!l.deleted&&l.countable&&(t<l.length&&zn(n,me(l.id.client,l.id.clock+t)),t-=l.length);for(;r>0&&l!==null;)l.deleted||(r<l.length&&zn(n,me(l.id.client,l.id.clock+r)),l.delete(n),r-=l.length),l=l.right;if(r>0)throw Xm();e._searchMarker&&hs(e._searchMarker,i,-s+r)},Uo=(n,e,t)=>{const r=e._map.get(t);r!==void 0&&r.delete(n)},Bu=(n,e,t,r)=>{const i=e._map.get(t)||null,s=n.doc,o=s.clientID;let l;if(r==null)l=new ni([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:l=new ni([r]);break;case Uint8Array:l=new Fl(r);break;case Bn:l=new Dl(r);break;default:if(r instanceof je)l=new Jn(r);else throw new Error("Unexpected content type")}new Ge(me(o,rt(s.store,o)),i,i&&i.lastId,null,null,e,t,l).integrate(n,0)},zu=(n,e)=>{n.doc??Ye();const t=n._map.get(e);return t!==void 0&&!t.deleted?t.content.getContent()[t.length-1]:void 0},t_=n=>{const e={};return n.doc??Ye(),n._map.forEach((t,r)=>{t.deleted||(e[r]=t.content.getContent()[t.length-1])}),e},n_=(n,e)=>{n.doc??Ye();const t=n._map.get(e);return t!==void 0&&!t.deleted},av=(n,e)=>{const t={};return n._map.forEach((r,i)=>{let s=r;for(;s!==null&&(!e.sv.has(s.id.client)||s.id.clock>=(e.sv.get(s.id.client)||0));)s=s.left;s!==null&&Kr(s,e)&&(t[i]=s.content.getContent()[s.length-1])}),t},Js=n=>(n.doc??Ye(),Lw(n._map.entries(),e=>!e[1].deleted));class cv extends Ml{}class Vi extends je{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const t=new Vi;return t.push(e),t}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Vi}clone(){const e=new Vi;return e.insert(0,this.toArray().map(t=>t instanceof je?t.clone():t)),e}get length(){return this.doc??Ye(),this._length}_callObserver(e,t){super._callObserver(e,t),Il(this,e,new cv(this,e))}insert(e,t){this.doc!==null?he(this.doc,r=>{Qm(r,this,e,t)}):this._prelimContent.splice(e,0,...t)}push(e){this.doc!==null?he(this.doc,t=>{lv(t,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,t=1){this.doc!==null?he(this.doc,r=>{e_(r,this,e,t)}):this._prelimContent.splice(e,t)}get(e){return Zm(this,e)}toArray(){return Ym(this)}slice(e=0,t=this.length){return Vm(this,e,t)}toJSON(){return this.map(e=>e instanceof je?e.toJSON():e)}map(e){return qm(this,e)}forEach(e){gs(this,e)}[Symbol.iterator](){return ov(this)}_write(e){e.writeTypeRef(bv)}}class uv extends Ml{constructor(e,t,r){super(e,t),this.keysChanged=r}}class yt extends je{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,t){super._integrate(e,t),this._prelimContent.forEach((r,i)=>{this.set(i,r)}),this._prelimContent=null}_copy(){return new yt}clone(){const e=new yt;return this.forEach((t,r)=>{e.set(r,t instanceof je?t.clone():t)}),e}_callObserver(e,t){Il(this,e,new uv(this,e,t))}toJSON(){this.doc??Ye();const e={};return this._map.forEach((t,r)=>{if(!t.deleted){const i=t.content.getContent()[t.length-1];e[r]=i instanceof je?i.toJSON():i}}),e}get size(){return[...Js(this)].length}keys(){return Ea(Js(this),e=>e[0])}values(){return Ea(Js(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return Ea(Js(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??Ye(),this._map.forEach((t,r)=>{t.deleted||e(t.content.getContent()[t.length-1],r,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc!==null?he(this.doc,t=>{Uo(t,this,e)}):this._prelimContent.delete(e)}set(e,t){return this.doc!==null?he(this.doc,r=>{Bu(r,this,e,t)}):this._prelimContent.set(e,t),t}get(e){return zu(this,e)}has(e){return n_(this,e)}clear(){this.doc!==null?he(this.doc,e=>{this.forEach(function(t,r,i){Uo(e,i,r)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef(xv)}}const Nn=(n,e)=>n===e||typeof n=="object"&&typeof e=="object"&&n&&e&&PC(n,e);class Cc{constructor(e,t,r,i){this.left=e,this.right=t,this.index=r,this.currentAttributes=i}forward(){switch(this.right===null&&pn(),this.right.content.constructor){case De:this.right.deleted||wi(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}}const kh=(n,e,t)=>{for(;e.right!==null&&t>0;){switch(e.right.content.constructor){case De:e.right.deleted||wi(e.currentAttributes,e.right.content);break;default:e.right.deleted||(t<e.right.length&&zn(n,me(e.right.id.client,e.right.id.clock+t)),e.index+=e.right.length,t-=e.right.length);break}e.left=e.right,e.right=e.right.right}return e},Gs=(n,e,t,r)=>{const i=new Map,s=r?$l(e,t):null;if(s){const o=new Cc(s.p.left,s.p,s.index,i);return kh(n,o,t-s.index)}else{const o=new Cc(null,e._start,0,i);return kh(n,o,t)}},r_=(n,e,t,r)=>{for(;t.right!==null&&(t.right.deleted===!0||t.right.content.constructor===De&&Nn(r.get(t.right.content.key),t.right.content.value));)t.right.deleted||r.delete(t.right.content.key),t.forward();const i=n.doc,s=i.clientID;r.forEach((o,l)=>{const a=t.left,c=t.right,u=new Ge(me(s,rt(i.store,s)),a,a&&a.lastId,c,c&&c.id,e,null,new De(l,o));u.integrate(n,0),t.right=u,t.forward()})},wi=(n,e)=>{const{key:t,value:r}=e;r===null?n.delete(t):n.set(t,r)},i_=(n,e)=>{for(;n.right!==null;){if(!(n.right.deleted||n.right.content.constructor===De&&Nn(e[n.right.content.key]??null,n.right.content.value)))break;n.forward()}},s_=(n,e,t,r)=>{const i=n.doc,s=i.clientID,o=new Map;for(const l in r){const a=r[l],c=t.currentAttributes.get(l)??null;if(!Nn(c,a)){o.set(l,c);const{left:u,right:d}=t;t.right=new Ge(me(s,rt(i.store,s)),u,u&&u.lastId,d,d&&d.id,e,null,new De(l,a)),t.right.integrate(n,0),t.forward()}}return o},Ta=(n,e,t,r,i)=>{t.currentAttributes.forEach((f,h)=>{i[h]===void 0&&(i[h]=null)});const s=n.doc,o=s.clientID;i_(t,i);const l=s_(n,e,t,i),a=r.constructor===String?new yn(r):r instanceof je?new Jn(r):new vi(r);let{left:c,right:u,index:d}=t;e._searchMarker&&hs(e._searchMarker,t.index,a.getLength()),u=new Ge(me(o,rt(s.store,o)),c,c&&c.lastId,u,u&&u.id,e,null,a),u.integrate(n,0),t.right=u,t.index=d,t.forward(),r_(n,e,t,l)},Th=(n,e,t,r,i)=>{const s=n.doc,o=s.clientID;i_(t,i);const l=s_(n,e,t,i);e:for(;t.right!==null&&(r>0||l.size>0&&(t.right.deleted||t.right.content.constructor===De));){if(!t.right.deleted)switch(t.right.content.constructor){case De:{const{key:a,value:c}=t.right.content,u=i[a];if(u!==void 0){if(Nn(u,c))l.delete(a);else{if(r===0)break e;l.set(a,c)}t.right.delete(n)}else t.currentAttributes.set(a,c);break}default:r<t.right.length&&zn(n,me(t.right.id.client,t.right.id.clock+r)),r-=t.right.length;break}t.forward()}if(r>0){let a="";for(;r>0;r--)a+=`
45
+ `;t.right=new Ge(me(o,rt(s.store,o)),t.left,t.left&&t.left.lastId,t.right,t.right&&t.right.id,e,null,new yn(a)),t.right.integrate(n,0),t.forward()}r_(n,e,t,l)},o_=(n,e,t,r,i)=>{let s=e;const o=Gt();for(;s&&(!s.countable||s.deleted);){if(!s.deleted&&s.content.constructor===De){const c=s.content;o.set(c.key,c)}s=s.right}let l=0,a=!1;for(;e!==s;){if(t===e&&(a=!0),!e.deleted){const c=e.content;switch(c.constructor){case De:{const{key:u,value:d}=c,f=r.get(u)??null;(o.get(u)!==c||f===d)&&(e.delete(n),l++,!a&&(i.get(u)??null)===d&&f!==d&&(f===null?i.delete(u):i.set(u,f))),!a&&!e.deleted&&wi(i,c);break}}}e=e.right}return l},dv=(n,e)=>{for(;e&&e.right&&(e.right.deleted||!e.right.countable);)e=e.right;const t=new Set;for(;e&&(e.deleted||!e.countable);){if(!e.deleted&&e.content.constructor===De){const r=e.content.key;t.has(r)?e.delete(n):t.add(r)}e=e.left}},fv=n=>{let e=0;return he(n.doc,t=>{let r=n._start,i=n._start,s=Gt();const o=pc(s);for(;i;){if(i.deleted===!1)switch(i.content.constructor){case De:wi(o,i.content);break;default:e+=o_(t,r,i,s,o),s=pc(o),r=i;break}i=i.right}}),e},hv=n=>{const e=new Set,t=n.doc;for(const[r,i]of n.afterState.entries()){const s=n.beforeState.get(r)||0;i!==s&&jm(n,t.store.clients.get(r),s,i,o=>{!o.deleted&&o.content.constructor===De&&o.constructor!==En&&e.add(o.parent)})}he(t,r=>{Rm(n,n.deleteSet,i=>{if(i instanceof En||!i.parent._hasFormatting||e.has(i.parent))return;const s=i.parent;i.content.constructor===De?e.add(s):dv(r,i)});for(const i of e)fv(i)})},Nh=(n,e,t)=>{const r=t,i=pc(e.currentAttributes),s=e.right;for(;t>0&&e.right!==null;){if(e.right.deleted===!1)switch(e.right.content.constructor){case Jn:case vi:case yn:t<e.right.length&&zn(n,me(e.right.id.client,e.right.id.clock+t)),t-=e.right.length,e.right.delete(n);break}e.forward()}s&&o_(n,s,e.right,i,e.currentAttributes);const o=(e.left||e.right).parent;return o._searchMarker&&hs(o._searchMarker,e.index,-r+t),e};class gv extends Ml{constructor(e,t,r){super(e,t),this.childListChanged=!1,this.keysChanged=new Set,r.forEach(i=>{i===null?this.childListChanged=!0:this.keysChanged.add(i)})}get changes(){if(this._changes===null){const e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(this._delta===null){const e=this.target.doc,t=[];he(e,r=>{const i=new Map,s=new Map;let o=this.target._start,l=null;const a={};let c="",u=0,d=0;const f=()=>{if(l!==null){let h=null;switch(l){case"delete":d>0&&(h={delete:d}),d=0;break;case"insert":(typeof c=="object"||c.length>0)&&(h={insert:c},i.size>0&&(h.attributes={},i.forEach((g,p)=>{g!==null&&(h.attributes[p]=g)}))),c="";break;case"retain":u>0&&(h={retain:u},RC(a)||(h.attributes=FC({},a))),u=0;break}h&&t.push(h),l=null}};for(;o!==null;){switch(o.content.constructor){case Jn:case vi:this.adds(o)?this.deletes(o)||(f(),l="insert",c=o.content.getContent()[0],f()):this.deletes(o)?(l!=="delete"&&(f(),l="delete"),d+=1):o.deleted||(l!=="retain"&&(f(),l="retain"),u+=1);break;case yn:this.adds(o)?this.deletes(o)||(l!=="insert"&&(f(),l="insert"),c+=o.content.str):this.deletes(o)?(l!=="delete"&&(f(),l="delete"),d+=o.length):o.deleted||(l!=="retain"&&(f(),l="retain"),u+=o.length);break;case De:{const{key:h,value:g}=o.content;if(this.adds(o)){if(!this.deletes(o)){const p=i.get(h)??null;Nn(p,g)?g!==null&&o.delete(r):(l==="retain"&&f(),Nn(g,s.get(h)??null)?delete a[h]:a[h]=g)}}else if(this.deletes(o)){s.set(h,g);const p=i.get(h)??null;Nn(p,g)||(l==="retain"&&f(),a[h]=p)}else if(!o.deleted){s.set(h,g);const p=a[h];p!==void 0&&(Nn(p,g)?p!==null&&o.delete(r):(l==="retain"&&f(),g===null?delete a[h]:a[h]=g))}o.deleted||(l==="insert"&&f(),wi(i,o.content));break}}o=o.right}for(f();t.length>0;){const h=t[t.length-1];if(h.retain!==void 0&&h.attributes===void 0)t.pop();else break}}),this._delta=t}return this._delta}}class ps extends je{constructor(e){super(),this._pending=e!==void 0?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??Ye(),this._length}_integrate(e,t){super._integrate(e,t);try{this._pending.forEach(r=>r())}catch(r){console.error(r)}this._pending=null}_copy(){return new ps}clone(){const e=new ps;return e.applyDelta(this.toDelta()),e}_callObserver(e,t){super._callObserver(e,t);const r=new gv(this,e,t);Il(this,e,r),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??Ye();let e="",t=this._start;for(;t!==null;)!t.deleted&&t.countable&&t.content.constructor===yn&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){this.doc!==null?he(this.doc,r=>{const i=new Cc(null,this._start,0,new Map);for(let s=0;s<e.length;s++){const o=e[s];if(o.insert!==void 0){const l=!t&&typeof o.insert=="string"&&s===e.length-1&&i.right===null&&o.insert.slice(-1)===`
46
+ `?o.insert.slice(0,-1):o.insert;(typeof l!="string"||l.length>0)&&Ta(r,this,i,l,o.attributes||{})}else o.retain!==void 0?Th(r,this,i,o.retain,o.attributes||{}):o.delete!==void 0&&Nh(r,i,o.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,t,r){this.doc??Ye();const i=[],s=new Map,o=this.doc;let l="",a=this._start;function c(){if(l.length>0){const d={};let f=!1;s.forEach((g,p)=>{f=!0,d[p]=g});const h={insert:l};f&&(h.attributes=d),i.push(h),l=""}}const u=()=>{for(;a!==null;){if(Kr(a,e)||t!==void 0&&Kr(a,t))switch(a.content.constructor){case yn:{const d=s.get("ychange");e!==void 0&&!Kr(a,e)?(d===void 0||d.user!==a.id.client||d.type!=="removed")&&(c(),s.set("ychange",r?r("removed",a.id):{type:"removed"})):t!==void 0&&!Kr(a,t)?(d===void 0||d.user!==a.id.client||d.type!=="added")&&(c(),s.set("ychange",r?r("added",a.id):{type:"added"})):d!==void 0&&(c(),s.delete("ychange")),l+=a.content.str;break}case Jn:case vi:{c();const d={insert:a.content.getContent()[0]};if(s.size>0){const f={};d.attributes=f,s.forEach((h,g)=>{f[g]=h})}i.push(d);break}case De:Kr(a,e)&&(c(),wi(s,a.content));break}a=a.right}c()};return e||t?he(o,d=>{e&&xc(d,e),t&&xc(d,t),u()},"cleanup"):u(),i}insert(e,t,r){if(t.length<=0)return;const i=this.doc;i!==null?he(i,s=>{const o=Gs(s,this,e,!r);r||(r={},o.currentAttributes.forEach((l,a)=>{r[a]=l})),Ta(s,this,o,t,r)}):this._pending.push(()=>this.insert(e,t,r))}insertEmbed(e,t,r){const i=this.doc;i!==null?he(i,s=>{const o=Gs(s,this,e,!r);Ta(s,this,o,t,r||{})}):this._pending.push(()=>this.insertEmbed(e,t,r||{}))}delete(e,t){if(t===0)return;const r=this.doc;r!==null?he(r,i=>{Nh(i,Gs(i,this,e,!0),t)}):this._pending.push(()=>this.delete(e,t))}format(e,t,r){if(t===0)return;const i=this.doc;i!==null?he(i,s=>{const o=Gs(s,this,e,!1);o.right!==null&&Th(s,this,o,t,r)}):this._pending.push(()=>this.format(e,t,r))}removeAttribute(e){this.doc!==null?he(this.doc,t=>{Uo(t,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,t){this.doc!==null?he(this.doc,r=>{Bu(r,this,e,t)}):this._pending.push(()=>this.setAttribute(e,t))}getAttribute(e){return zu(this,e)}getAttributes(){return t_(this)}_write(e){e.writeTypeRef(Sv)}}class Na{constructor(e,t=()=>!0){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??Ye()}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(t)))do if(t=e.content.type,!e.deleted&&(t.constructor===_n||t.constructor===ti)&&t._start!==null)e=t._start;else for(;e!==null;){const r=e.next;if(r!==null){e=r;break}else e.parent===this._root?e=null:e=e.parent._item}while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class ti extends je{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new ti}clone(){const e=new ti;return e.insert(0,this.toArray().map(t=>t instanceof je?t.clone():t)),e}get length(){return this.doc??Ye(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new Na(this,e)}querySelector(e){e=e.toUpperCase();const r=new Na(this,i=>i.nodeName&&i.nodeName.toUpperCase()===e).next();return r.done?null:r.value}querySelectorAll(e){return e=e.toUpperCase(),Qr(new Na(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e))}_callObserver(e,t){Il(this,e,new pv(this,t,e))}toString(){return qm(this,e=>e.toString()).join("")}toJSON(){return this.toString()}toDOM(e=document,t={},r){const i=e.createDocumentFragment();return r!==void 0&&r._createAssociation(i,this),gs(this,s=>{i.insertBefore(s.toDOM(e,t,r),null)}),i}insert(e,t){this.doc!==null?he(this.doc,r=>{Qm(r,this,e,t)}):this._prelimContent.splice(e,0,...t)}insertAfter(e,t){if(this.doc!==null)he(this.doc,r=>{const i=e&&e instanceof je?e._item:e;zo(r,this,i,t)});else{const r=this._prelimContent,i=e===null?0:r.findIndex(s=>s===e)+1;if(i===0&&e!==null)throw Pn("Reference item not found");r.splice(i,0,...t)}}delete(e,t=1){this.doc!==null?he(this.doc,r=>{e_(r,this,e,t)}):this._prelimContent.splice(e,t)}toArray(){return Ym(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return Zm(this,e)}slice(e=0,t=this.length){return Vm(this,e,t)}forEach(e){gs(this,e)}_write(e){e.writeTypeRef(wv)}}class _n extends ti{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,t){super._integrate(e,t),this._prelimAttrs.forEach((r,i)=>{this.setAttribute(i,r)}),this._prelimAttrs=null}_copy(){return new _n(this.nodeName)}clone(){const e=new _n(this.nodeName),t=this.getAttributes();return LC(t,(r,i)=>{e.setAttribute(i,r)}),e.insert(0,this.toArray().map(r=>r instanceof je?r.clone():r)),e}toString(){const e=this.getAttributes(),t=[],r=[];for(const l in e)r.push(l);r.sort();const i=r.length;for(let l=0;l<i;l++){const a=r[l];t.push(a+'="'+e[a]+'"')}const s=this.nodeName.toLocaleLowerCase(),o=t.length>0?" "+t.join(" "):"";return`<${s}${o}>${super.toString()}</${s}>`}removeAttribute(e){this.doc!==null?he(this.doc,t=>{Uo(t,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,t){this.doc!==null?he(this.doc,r=>{Bu(r,this,e,t)}):this._prelimAttrs.set(e,t)}getAttribute(e){return zu(this,e)}hasAttribute(e){return n_(this,e)}getAttributes(e){return e?av(this,e):t_(this)}toDOM(e=document,t={},r){const i=e.createElement(this.nodeName),s=this.getAttributes();for(const o in s){const l=s[o];typeof l=="string"&&i.setAttribute(o,l)}return gs(this,o=>{i.appendChild(o.toDOM(e,t,r))}),r!==void 0&&r._createAssociation(i,this),i}_write(e){e.writeTypeRef(Cv),e.writeKey(this.nodeName)}}class pv extends Ml{constructor(e,t,r){super(e,r),this.childListChanged=!1,this.attributesChanged=new Set,t.forEach(i=>{i===null?this.childListChanged=!0:this.attributesChanged.add(i)})}}class Un extends ps{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new Un}clone(){const e=new Un;return e.applyDelta(this.toDelta()),e}toDOM(e=document,t,r){const i=e.createTextNode(this.toString());return r!==void 0&&r._createAssociation(i,this),i}toString(){return this.toDelta().map(e=>{const t=[];for(const i in e.attributes){const s=[];for(const o in e.attributes[i])s.push({key:o,value:e.attributes[i][o]});s.sort((o,l)=>o.key<l.key?-1:1),t.push({nodeName:i,attrs:s})}t.sort((i,s)=>i.nodeName<s.nodeName?-1:1);let r="";for(let i=0;i<t.length;i++){const s=t[i];r+=`<${s.nodeName}`;for(let o=0;o<s.attrs.length;o++){const l=s.attrs[o];r+=` ${l.key}="${l.value}"`}r+=">"}r+=e.insert;for(let i=t.length-1;i>=0;i--)r+=`</${t[i].nodeName}>`;return r}).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(vv)}}class l_{constructor(e,t){this.id=e,this.length=t}get deleted(){throw Ft()}mergeWith(e){return!1}write(e,t,r){throw Ft()}integrate(e,t){throw Ft()}}const mv=0;class En extends l_{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,t){t>0&&(this.id.clock+=t,this.length-=t),Wm(e.doc.store,this)}write(e,t){e.writeInfo(mv),e.writeLen(this.length-t)}getMissing(e,t){return null}}class Fl{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Fl(this.content)}splice(e){throw Ft()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}}class Ko{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new Ko(this.len)}splice(e){const t=new Ko(this.len-e);return this.len=e,t}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){zm(e.deleteSet,t.id.client,t.id.clock,this.len),t.markDeleted()}delete(e){}gc(e){}write(e,t){e.writeLen(this.len-t)}getRef(){return 1}}const _v=(n,e)=>new Bn({guid:n,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1});class Dl{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const t={};this.opts=t,e.gc||(t.gc=!1),e.autoLoad&&(t.autoLoad=!0),e.meta!==null&&(t.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new Dl(_v(this.doc.guid,this.opts))}splice(e){throw Ft()}mergeWith(e){return!1}integrate(e,t){this.doc._item=t,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,t){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}class vi{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new vi(this.embed)}splice(e){throw Ft()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}}class De{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new De(this.key,this.value)}splice(e){throw Ft()}mergeWith(e){return!1}integrate(e,t){const r=t.parent;r._searchMarker=null,r._hasFormatting=!0}delete(e){}gc(e){}write(e,t){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}const yv=Ro("node_env")==="development";class ni{constructor(e){this.arr=e,yv&&hm(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new ni(this.arr)}splice(e){const t=new ni(this.arr.slice(e));return this.arr=this.arr.slice(0,e),t}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){const r=this.arr.length;e.writeLen(r-t);for(let i=t;i<r;i++){const s=this.arr[i];e.writeAny(s)}}getRef(){return 8}}class yn{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new yn(this.str)}splice(e){const t=new yn(this.str.slice(e));this.str=this.str.slice(0,e);const r=this.str.charCodeAt(e-1);return r>=55296&&r<=56319&&(this.str=this.str.slice(0,e-1)+"�",t.str="�"+t.str.slice(1)),t}mergeWith(e){return this.str+=e.str,!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeString(t===0?this.str:this.str.slice(t))}getRef(){return 4}}const bv=0,xv=1,Sv=2,Cv=3,wv=4,vv=6;class Jn{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new Jn(this.type._copy())}splice(e){throw Ft()}mergeWith(e){return!1}integrate(e,t){this.type._integrate(e.doc,t)}delete(e){let t=this.type._start;for(;t!==null;)t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e),t=t.right;this.type._map.forEach(r=>{r.deleted?r.id.clock<(e.beforeState.get(r.id.client)||0)&&e._mergeStructs.push(r):r.delete(e)}),e.changed.delete(this.type)}gc(e){let t=this.type._start;for(;t!==null;)t.gc(e,!0),t=t.right;this.type._start=null,this.type._map.forEach(r=>{for(;r!==null;)r.gc(e,!0),r=r.left}),this.type._map=new Map}write(e,t){this.type._write(e)}getRef(){return 7}}const a_=(n,e,t)=>{const{client:r,clock:i}=e.id,s=new Ge(me(r,i+t),e,me(r,i+t-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(t));return e.deleted&&s.markDeleted(),e.keep&&(s.keep=!0),e.redone!==null&&(s.redone=me(e.redone.client,e.redone.clock+t)),e.right=s,s.right!==null&&(s.right.left=s),n._mergeStructs.push(s),s.parentSub!==null&&s.right===null&&s.parent._map.set(s.parentSub,s),e.length=t,s};class Ge extends l_{constructor(e,t,r,i,s,o,l,a){super(e,a.getLength()),this.origin=r,this.left=t,this.right=i,this.rightOrigin=s,this.parent=o,this.parentSub=l,this.redone=null,this.content=a,this.info=this.content.isCountable()?oh:0}set marker(e){(this.info&xa)>0!==e&&(this.info^=xa)}get marker(){return(this.info&xa)>0}get keep(){return(this.info&sh)>0}set keep(e){this.keep!==e&&(this.info^=sh)}get countable(){return(this.info&oh)>0}get deleted(){return(this.info&ba)>0}set deleted(e){this.deleted!==e&&(this.info^=ba)}markDeleted(){this.info|=ba}getMissing(e,t){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=rt(t,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=rt(t,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===ro&&this.id.client!==this.parent.client&&this.parent.clock>=rt(t,this.parent.client))return this.parent.client;if(this.origin&&(this.left=Ch(e,t,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=zn(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===En||this.right&&this.right.constructor===En)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===Ge?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===Ge&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===ro){const r=ka(t,this.parent);r.constructor===En?this.parent=null:this.parent=r.content.type}return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=Ch(e,e.doc.store,me(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(t),this.length-=t),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let r=this.left,i;if(r!==null)i=r.right;else if(this.parentSub!==null)for(i=this.parent._map.get(this.parentSub)||null;i!==null&&i.left!==null;)i=i.left;else i=this.parent._start;const s=new Set,o=new Set;for(;i!==null&&i!==this.right;){if(o.add(i),s.add(i),Hs(this.origin,i.origin)){if(i.id.client<this.id.client)r=i,s.clear();else if(Hs(this.rightOrigin,i.rightOrigin))break}else if(i.origin!==null&&o.has(ka(e.doc.store,i.origin)))s.has(ka(e.doc.store,i.origin))||(r=i,s.clear());else break;i=i.right}this.left=r}if(this.left!==null){const r=this.left.right;this.right=r,this.left.right=this}else{let r;if(this.parentSub!==null)for(r=this.parent._map.get(this.parentSub)||null;r!==null&&r.left!==null;)r=r.left;else r=this.parent._start,this.parent._start=this;this.right=r}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),Wm(e.doc.store,this),this.content.integrate(e,this),vh(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new En(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:me(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&Hs(e.origin,this.lastId)&&this.right===e&&Hs(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){const t=this.parent._searchMarker;return t&&t.forEach(r=>{r.p===e&&(r.p=this,!this.deleted&&this.countable&&(r.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const t=this.parent;this.countable&&this.parentSub===null&&(t._length-=this.length),this.markDeleted(),zm(e.deleteSet,this.id.client,this.id.clock,this.length),vh(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw pn();this.content.gc(e),t?Xw(e,this,new En(this.id,this.length)):this.content=new Ko(this.length)}write(e,t){const r=t>0?me(this.id.client,this.id.clock+t-1):this.origin,i=this.rightOrigin,s=this.parentSub,o=this.content.getRef()&sC|(r===null?0:Do)|(i===null?0:cm)|(s===null?0:iC);if(e.writeInfo(o),r!==null&&e.writeLeftID(r),i!==null&&e.writeRightID(i),r===null&&i===null){const l=this.parent;if(l._item!==void 0){const a=l._item;if(a===null){const c=Yw(l);e.writeParentInfo(!0),e.writeString(c)}else e.writeParentInfo(!1),e.writeLeftID(a.id)}else l.constructor===String?(e.writeParentInfo(!0),e.writeString(l)):l.constructor===ro?(e.writeParentInfo(!1),e.writeLeftID(l)):pn();s!==null&&e.writeString(s)}this.content.write(e,t)}}const c_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},u_="__ $YJS$ __";c_[u_]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");c_[u_]=!0;function Ke(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Ev(n,e,t){const r=n.length,i=e.length;let s=0,o=0;for(;s<r&&s<i&&n[s]===e[s]&&s<t;)s++;for(;o+s<r&&o+s<i&&n[r-o-1]===e[i-o-1];)o++;for(;o+s<r&&o+s<i&&n[s]===e[s];)s++;return{index:s,insert:e.slice(s,i-o),remove:r-s-o}}class Qn{_xmlElem;_key;_parent;_type;constructor(e,t,r){this._key="",this._xmlElem=e,this._parent=t,this._type=r}getPrevNode(e){if(e===null)return null;const t=e.get(this._key);return V(t)?t:null}getNode(){const e=Y(this._key);return V(e)?e:null}getSharedType(){return this._xmlElem}getType(){return this._type}getKey(){return this._key}getSize(){return 1}getOffset(){return this._parent.getChildOffset(this)}syncPropertiesFromLexical(e,t,r){const i=this.getPrevNode(r);Wu(e,this._xmlElem,i,t)}syncPropertiesFromYjs(e,t){const r=this.getNode();r===null&&Ke(83),Ku(e,this._xmlElem,r,t)}destroy(e){const t=e.collabNodeMap;t.get(this._key)===this&&t.delete(this._key)}}function d_(n,e,t){const r=new Qn(n,e,t);return n._collabNode=r,r}class zi{_map;_key;_parent;_type;constructor(e,t){this._key="",this._map=e,this._parent=t,this._type="linebreak"}getNode(){const e=Y(this._key);return ue(e)?e:null}getKey(){return this._key}getSharedType(){return this._map}getType(){return this._type}getSize(){return 1}getOffset(){return this._parent.getChildOffset(this)}destroy(e){const t=e.collabNodeMap;t.get(this._key)===this&&t.delete(this._key)}}function f_(n,e){const t=new zi(n,e);return n._collabNode=t,t}class bt{_map;_key;_parent;_text;_type;_normalized;constructor(e,t,r,i){this._key="",this._map=e,this._parent=r,this._text=t,this._type=i,this._normalized=!1}getPrevNode(e){if(e===null)return null;const t=e.get(this._key);return I(t)?t:null}getNode(){const e=Y(this._key);return I(e)?e:null}getSharedType(){return this._map}getType(){return this._type}getKey(){return this._key}getSize(){return this._text.length+(this._normalized?0:1)}getOffset(){return this._parent.getChildOffset(this)}spliceText(e,t,r){const i=this._parent._xmlText,s=this.getOffset()+1+e;t!==0&&i.delete(s,t),r!==""&&i.insert(s,r)}syncPropertiesAndTextFromLexical(e,t,r){const i=this.getPrevNode(r),s=t.__text;if(Wu(e,this._map,i,t),i!==null){const o=i.__text;o!==s&&((function(l,a,c,u){const d=M();let f=u.length;if(N(d)&&d.isCollapsed()){const g=d.anchor;g.key===a&&(f=g.offset)}const h=Ev(c,u,f);l.spliceText(h.index,h.remove,h.insert)})(this,t.__key,o,s),this._text=s)}}syncPropertiesAndTextFromYjs(e,t){const r=this.getNode();r===null&&Ke(84),Ku(e,this._map,r,t);const i=this._text;r.__text!==i&&r.setTextContent(i)}destroy(e){const t=e.collabNodeMap;t.get(this._key)===this&&t.delete(this._key)}}function h_(n,e,t,r){const i=new bt(n,e,t,r);return n._collabNode=i,i}class rn{_key;_children;_xmlText;_type;_parent;constructor(e,t,r){this._key="",this._children=[],this._xmlText=e,this._type=r,this._parent=t}getPrevNode(e){if(e===null)return null;const t=e.get(this._key);return O(t)?t:null}getNode(){const e=Y(this._key);return O(e)?e:null}getSharedType(){return this._xmlText}getType(){return this._type}getKey(){return this._key}isEmpty(){return this._children.length===0}getSize(){return 1}getOffset(){const e=this._parent;return e===null&&Ke(90),e.getChildOffset(this)}syncPropertiesFromYjs(e,t){const r=this.getNode();r===null&&Ke(91),Ku(e,this._xmlText,r,t)}applyChildrenYjsDelta(e,t){const r=this._children;let i=0,s=null;for(let o=0;o<t.length;o++){const l=t[o],a=l.insert,c=l.delete;if(l.retain!=null)i+=l.retain;else if(typeof c=="number"){let u=c;for(;u>0;){const{node:d,nodeIndex:f,offset:h,length:g}=Aa(this,i,!1);if(d instanceof rn||d instanceof zi||d instanceof Qn)r.splice(f,1),u-=1;else{if(!(d instanceof bt))break;{const p=Math.min(u,g),m=f!==0?r[f-1]:null,b=d.getSize();if(h===0&&g===b){r.splice(f,1);const _=$i(d._text,h,p-1,"");_.length>0&&(m instanceof bt?m._text+=_:this._xmlText.delete(h,_.length))}else d._text=$i(d._text,h,p,"");u-=p}}}}else{if(a==null)throw new Error("Unexpected delta format");if(typeof a=="string"){const{node:u,offset:d}=Aa(this,i,!0);u instanceof bt?u._text=$i(u._text,d,0,a):this._xmlText.delete(d,a.length),i+=a.length}else{const u=a,{node:d,nodeIndex:f,length:h}=Aa(this,i,!1),g=p_(e,u,this);if(d instanceof bt&&h>0&&h<d._text.length){const p=d._text,m=p.length-h;d._text=$i(p,m,h,""),r.splice(f+1,0,g),s=$i(p,0,m,"")}else r.splice(f,0,g);s!==null&&g instanceof bt&&(g._text=s+g._text,s=null),i+=1}}}}syncChildrenFromYjs(e){const t=this.getNode();t===null&&Ke(92);const r=t.__key,i=ir(t,null),s=i.length,o=this._children,l=o.length,a=e.collabNodeMap,c=new Set;let u,d,f=0,h=null;l!==s&&(d=t.getWritable());for(let g=0;g<l;g++){const p=i[f],m=o[g],b=m.getNode(),_=m._key;if(b!==null&&p===_){const y=I(b);if(c.add(p),y)if(m._key=p,m instanceof rn){const C=m._xmlText;m.syncPropertiesFromYjs(e,null),m.applyChildrenYjsDelta(e,C.toDelta()),m.syncChildrenFromYjs(e)}else m instanceof bt?m.syncPropertiesAndTextFromYjs(e,null):m instanceof Qn?m.syncPropertiesFromYjs(e,null):m instanceof zi||Ke(93);h=b,f++}else{if(u===void 0){u=new Set;for(let S=0;S<l;S++){const x=o[S]._key;x!==""&&u.add(x)}}if(b!==null&&p!==void 0&&!u.has(p)){const S=Xn(p);jt(S),g--,f++;continue}d=t.getWritable();const y=Dv(e,m,r),C=y.__key;if(a.set(C,m),h===null){const S=d.getFirstChild();if(d.__first=C,S!==null){const x=S.getWritable();x.__prev=C,y.__next=x.__key}}else{const S=h.getWritable(),x=h.getNextSibling();if(S.__next=C,y.__prev=h.__key,x!==null){const k=x.getWritable();k.__prev=C,y.__next=k.__key}}g===l-1&&(d.__last=C),d.__size++,h=y}}for(let g=0;g<s;g++){const p=i[g];if(!c.has(p)){const m=Xn(p),b=e.collabNodeMap.get(p);b!==void 0&&b.destroy(e),jt(m)}}}syncPropertiesFromLexical(e,t,r){Wu(e,this._xmlText,this.getPrevNode(r),t)}_syncChildFromLexical(e,t,r,i,s,o){const l=this._children[t],a=Xn(r);l instanceof rn&&O(a)?(l.syncPropertiesFromLexical(e,a,i),l.syncChildrenFromLexical(e,a,i,s,o)):l instanceof bt&&I(a)?l.syncPropertiesAndTextFromLexical(e,a,i):l instanceof Qn&&V(a)&&l.syncPropertiesFromLexical(e,a,i)}syncChildrenFromLexical(e,t,r,i,s){const o=this.getPrevNode(r),l=o===null?[]:ir(o,r),a=ir(t,null),c=l.length-1,u=a.length-1,d=e.collabNodeMap;let f,h,g=0,p=0;for(;g<=c&&p<=u;){const _=l[g],y=a[p];if(_===y)this._syncChildFromLexical(e,p,y,r,i,s),g++,p++;else{f===void 0&&(f=new Set(l)),h===void 0&&(h=new Set(a));const C=h.has(_),S=f.has(y);if(C){const x=Ah(e,Xn(y),this);d.set(y,x),S?(this.splice(e,p,1,x),g++,p++):(this.splice(e,p,0,x),p++)}else this.splice(e,p,1),g++}}const m=g>c,b=p>u;if(m&&!b)for(;p<=u;++p){const _=a[p],y=Ah(e,Xn(_),this);this.append(y),d.set(_,y)}else if(b&&!m)for(let _=this._children.length-1;_>=p;_--)this.splice(e,_,1)}append(e){const t=this._xmlText,r=this._children,i=r[r.length-1],s=i!==void 0?i.getOffset()+i.getSize():0;if(e instanceof rn)t.insertEmbed(s,e._xmlText);else if(e instanceof bt){const o=e._map;o.parent===null&&t.insertEmbed(s,o),t.insert(s+1,e._text)}else e instanceof zi?t.insertEmbed(s,e._map):e instanceof Qn&&t.insertEmbed(s,e._xmlElem);this._children.push(e)}splice(e,t,r,i){const s=this._children,o=s[t];if(o===void 0)return i===void 0&&Ke(94),void this.append(i);const l=o.getOffset();l===-1&&Ke(95);const a=this._xmlText;if(r!==0&&a.delete(l,o.getSize()),i instanceof rn)a.insertEmbed(l,i._xmlText);else if(i instanceof bt){const c=i._map;c.parent===null&&a.insertEmbed(l,c),a.insert(l+1,i._text)}else i instanceof zi?a.insertEmbed(l,i._map):i instanceof Qn&&a.insertEmbed(l,i._xmlElem);if(r!==0){const c=s.slice(t,t+r);for(let u=0;u<c.length;u++)c[u].destroy(e)}i!==void 0?s.splice(t,r,i):s.splice(t,r)}getChildOffset(e){let t=0;const r=this._children;for(let i=0;i<r.length;i++){const s=r[i];if(s===e)return t;t+=s.getSize()}return-1}destroy(e){const t=e.collabNodeMap,r=this._children;for(let i=0;i<r.length;i++)r[i].destroy(e);t.get(this._key)===this&&t.delete(this._key)}}function Uu(n,e,t){const r=new rn(n,e,t);return n._collabNode=r,r}function kv(n,e,t,r,i){t==null&&Ke(81);const s={clientID:t.clientID,cursors:new Map,cursorsContainer:null,doc:t,docMap:r,editor:n,excludedProperties:i||new Map,id:e,nodeProperties:new Map};return(function(o){const{editor:l,nodeProperties:a}=o;l.update(()=>{l._nodes.forEach(c=>{const u=new c.klass,d={};for(const[f,h]of Object.entries(u))g_(f,u,o)||(d[f]=h);a.set(u.__type,Object.freeze(d))})})})(s),s}function Tv(n,e,t,r,i,s){r==null&&Ke(81);const o=Uu(r.get("root",Un),null,"root");return o._key="root",{...kv(n,t,r,i,s),collabNodeMap:new Map,root:o}}function Nv(n){return Object.hasOwn(n,"collabNodeMap")}const Av=new Set(["__key","__parent","__next","__prev","__state"]),Ov=new Set(["__first","__last","__size"]),Mv=new Set(["__cachedText"]),$v=new Set(["__text"]);function g_(n,e,t){if(Av.has(n)||typeof e[n]=="function")return!0;if(I(e)){if($v.has(n))return!0}else if(O(e)&&(Ov.has(n)||ye(e)&&Mv.has(n)))return!0;const r=e.constructor,i=t.excludedProperties.get(r);return i!=null&&i.has(n)}function Iv(n,e){const t=n.__type,{nodeProperties:r}=e,i=r.get(t);return i===void 0&&Ke(330,t),i}function Ah(n,e,t){const r=e.__type;let i;if(O(e))i=Uu(new Un,t,r),i.syncPropertiesFromLexical(n,e,null),i.syncChildrenFromLexical(n,e,null,null,null);else if(I(e))i=h_(new yt,e.__text,t,r),i.syncPropertiesAndTextFromLexical(n,e,null);else if(ue(e)){const s=new yt;s.set("__type","linebreak"),i=f_(s,t)}else V(e)?(i=d_(new _n,t,r),i.syncPropertiesFromLexical(n,e,null)):Ke(86);return i._key=e.__key,i}function Fv(n){const e=Ll(n,"__type");return typeof e!="string"&&e!==void 0&&Ke(87),e}function p_(n,e,t){const r=e._collabNode;if(r===void 0){const i=n.editor._nodes,s=Fv(e);typeof s!="string"&&Ke(87),i.get(s)===void 0&&Ke(88,s);const o=e.parent,l=t===void 0&&o!==null?p_(n,o):t||null;if(l instanceof rn||Ke(89),e instanceof Un)return Uu(e,l,s);if(e instanceof yt)return s==="linebreak"?f_(e,l):h_(e,"",l,s);if(e instanceof _n)return d_(e,l,s)}return r}function Dv(n,e,t){const r=e.getType(),i=n.editor._nodes.get(r);i===void 0&&Ke(88,r);const s=new i.klass;if(s.__parent=t,e._key=s.__key,e instanceof rn){const o=e._xmlText;e.syncPropertiesFromYjs(n,null),e.applyChildrenYjsDelta(n,o.toDelta()),e.syncChildrenFromYjs(n)}else e instanceof bt?e.syncPropertiesAndTextFromYjs(n,null):e instanceof Qn&&e.syncPropertiesFromYjs(n,null);return n.collabNodeMap.set(s.__key,e),s}function Ku(n,e,t,r){const i=r===null?e instanceof yt?Array.from(e.keys()):e instanceof Un||e instanceof _n?Object.keys(e.getAttributes()):Object.keys(e):Array.from(r);let s;for(let o=0;o<i.length;o++){const l=i[o];if(g_(l,t,n)){l==="__state"&&Nv(n)&&(s||(s=t.getWritable()),Lv(e,s));continue}const a=t[l];let c=Ll(e,l);if(a!==c){if(c instanceof Bn){const u=n.docMap;a instanceof Bn&&u.delete(a.guid);const d=fi(),f=c.guid;d._key=f,u.set(f,c),c=d}s===void 0&&(s=t.getWritable()),s[l]=c}}}function Ll(n,e){return n instanceof yt?n.get(e):n instanceof Un||n instanceof _n?n.getAttribute(e):n[e]}function Oh(n,e,t){n instanceof yt?n.set(e,t):n.setAttribute(e,t)}function Lv(n,e){const t=Ll(n,"__state");t instanceof yt&&Ho(e).updateFromJSON(t.toJSON())}function Wu(n,e,t,r){const i=Object.keys(Iv(r,n)),s=n.editor.constructor;(function(o,l,a,c){const u=c.__state,d=Ll(l,"__state");if(!u)return;const[f,h]=u.getInternalState(),g=a&&a.__state,p=d instanceof yt?d:new yt;if(g===u)return;const[m,b]=g&&p.doc?g.getInternalState():[void 0,new Map];if(f)for(const[_,y]of Object.entries(f))m&&y!==m[_]&&p.set(_,y);for(const[_,y]of h)b.get(_)!==y&&p.set(_.key,_.unparse(y));d||Oh(l,"__state",p)})(0,e,t,r);for(let o=0;o<i.length;o++){const l=i[o],a=t===null?void 0:t[l];let c=r[l];if(a!==c){if(c instanceof s){const u=n.docMap;let d;if(a instanceof s){const g=a._key;d=u.get(g),u.delete(g)}const f=d||new Bn,h=f.guid;c._key=h,u.set(h,f),c=f,n.editor.update(()=>{r.markDirty()})}Oh(e,l,c)}}}function $i(n,e,t,r){return n.slice(0,e)+r+n.slice(e+t)}function Aa(n,e,t){let r=0,i=0;const s=n._children,o=s.length;for(;i<o;i++){const l=s[i],a=r;if(r+=l.getSize(),(t?r>=e:r>e)&&l instanceof bt){let c=e-a-1;return c<0&&(c=0),{length:r-e,node:l,nodeIndex:i,offset:c}}if(r>e)return{length:0,node:l,nodeIndex:i,offset:a};if(i===o-1)return{length:0,node:null,nodeIndex:i+1,offset:a+1}}return{length:0,node:null,nodeIndex:0,offset:0}}Tc("ychange",{isEqual:(n,e)=>n===e,parse:n=>n??null});async function m_(){return db}async function Rl(n){return ix(n)}async function Pl(n){return gS(n)}async function Bl(n,e){const t=qp(),r=e?.delay??300;return Yp(n,t,r)}async function zl(n){return()=>{}}async function Ul(n){return typeof ua=="function"?typeof ff=="function"?pt(ua(n),ff(n)):ua(n):pt(n.registerCommand(yi,()=>(da(n,"number"),!0),G),n.registerCommand(_i,()=>(da(n,"bullet"),!0),G),n.registerCommand(bl,()=>(da(n,"check"),!0),G),n.registerCommand(pu,()=>(hx(n),!0),G))}async function Kl(n){return n.registerCommand(lc,e=>(e===null||typeof e=="string"?fa(e):fa(e.url,e),!0),G)}async function Rv(n,e,t){const r=e?.trigger||"/";let i=!1,s=null,o=0;const l=()=>n.getEditorState().read(()=>{const p=M();if(!N(p)||!p.isCollapsed())return!1;const m=p.anchor,b=m.getNode();if(!I(b))return!1;const _=b.getTextContent(),y=m.offset;if(y===0||_[y-1]!==r)return!1;if(y===1)return!0;const S=_[y-2];return!!/\s/.test(S)}),a=()=>s?n.getEditorState().read(()=>{if(!s)return"";const p=s.getTextContent(),m=p.indexOf(r,o);if(m===-1)return"";const b=M();if(!N(b))return"";const _=b.anchor;if(_.getNode().getKey()!==s.getKey())return"";const C=_.offset;return C<=m?"":p.slice(m+1,C)}):"",c=()=>{n.getEditorState().read(()=>{const p=M();if(N(p)){const m=p.anchor,b=m.getNode();if(I(b)){s=b,o=m.offset-1,i=!0;const _={isActive:!0,filterText:"",anchorNode:s,anchorOffset:o};t?.onTrigger?.(_,d),t?.onUpdate?.(_,d)}}})},u=()=>{i&&(i=!1,s=null,o=0,t?.onDismiss?.())},d=()=>{s&&n.update(()=>{if(!s)return;const p=s.getTextContent(),m=p.indexOf(r,o);if(m===-1)return;const b=M();if(!N(b))return;const _=b.anchor;if(_.getNode().getKey()!==s.getKey())return;const C=_.offset,S=p.slice(0,m),x=p.slice(C);s.setTextContent(S+x);const k=M();N(k)&&(k.anchor.set(s.getKey(),m,"text"),k.focus.set(s.getKey(),m,"text"))})},f=()=>{if(!i)return;const m={isActive:!0,filterText:a(),anchorNode:s,anchorOffset:o};t?.onUpdate?.(m,d)},h=n.registerMutationListener(qe,p=>{if(!i&&l()){c();return}i&&(s&&!p.has(s.getKey())?f():u())}),g=pt(n.registerUpdateListener(({editorState:p})=>{p.read(()=>{if(!i)return;const m=M();if(!N(m)){u();return}const b=m.anchor,_=b.getNode();if(!s||_.getKey()!==s.getKey()){u();return}const C=s.getTextContent().indexOf(r,o);if(C===-1||b.offset<=C){u();return}})}),n.registerCommand(cr,p=>i?(p.preventDefault(),!0):!1,G),n.registerCommand(dn,p=>i?(p.preventDefault(),!0):!1,G),n.registerCommand(Dn,p=>i?(p?.preventDefault(),!0):!1,G),n.registerCommand(ai,p=>i?(p?.preventDefault(),u(),!0):!1,G));return()=>{u(),h(),g()}}function Pv(n,e,t){t(),e.handler(n),n.focus()}const Bv=z("TOGGLE_SLASH_COMMAND_PALETTE"),Os=z("INSERT_HORIZONTAL_RULE_COMMAND"),zv=z("INSERT_IMAGE_COMMAND");function Wl(n){return n.registerCommand(Os,()=>{const e=M();if(!N(e))return!1;if(e.focus.getNode()!==null){const r=Ts();e.insertNodes([r]);const i=H();r.insertAfter(i),i.selectStart()}return!0},G)}const __={dependencies:[Mr],export:n=>Vp(n)?"---":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(n,e,t,r)=>{const i=Ts();if(r)n.replace(i);else{n.replace(i);const s=H();i.insertAfter(s),s.selectStart()}},type:"element"},ju=[...wu,__];async function Ct(n){let e="";return n.getEditorState().read(()=>{e=VS(ju)}),e}async function Kn(n,e){n.update(()=>{GS(e,ju)})}async function y_(){return ju}const Hu=Object.freeze(Object.defineProperty({__proto__:null,exportToMarkdown:Ct,getMarkdownTransformers:y_,importFromMarkdown:Kn},Symbol.toStringTag,{value:"Module"}));async function wt(n){let e="";return n.getEditorState().read(()=>{e=fp(n)}),e}async function Wn(n,e){n.update(()=>{const r=new DOMParser().parseFromString(e,"text/html"),i=dp(n,r);fe().clear(),tl(i)})}const Ju=Object.freeze(Object.defineProperty({__proto__:null,exportToHtml:wt,importFromHtml:Wn},Symbol.toStringTag,{value:"Module"}));async function Uv(n,e,t){let r,i,s;switch(e){case"markdown":r=await Ct(n),i="text/markdown",s="md";break;case"html":r=await wt(n),i="text/html",s="html";break;case"json":r=JSON.stringify(n.getEditorState().toJSON(),null,2),i="application/json",s="json";break}const o=new Blob([r],{type:i}),l=URL.createObjectURL(o),a=document.createElement("a");a.href=l,a.download=t??`document.${s}`,a.click(),URL.revokeObjectURL(l)}async function Kv(n,e,t){const r=await new Promise((s,o)=>{const l=new FileReader;l.onload=()=>s(l.result),l.onerror=()=>o(l.error),l.readAsText(e)});switch(t??Wv(e.name)){case"markdown":{const{importFromMarkdown:s}=await Promise.resolve().then(()=>Hu);await s(n,r);break}case"html":{const{importFromHtml:s}=await Promise.resolve().then(()=>Ju);await s(n,r);break}case"json":{const s=n.parseEditorState(r);n.setEditorState(s);break}}}function Wv(n){return n.endsWith(".md")||n.endsWith(".markdown")?"markdown":n.endsWith(".html")||n.endsWith(".htm")?"html":"json"}async function jl(n,e){return typeof wf=="function"?wf(n):()=>{}}async function jv(n,e=3,t=3){n.dispatchCommand(ks,{rows:String(e),columns:String(t),includeHeaders:!0})}async function Hv(n,e){return typeof Io=="function"?Io(n):()=>{}}async function Jv(n,e){return typeof Io=="function"?Io(n):()=>{}}const Gv=/#[\w\u0590-\u05ff]+/;function Vv(n){return new Sl(n)}async function Yv(n,e){const t=[],r=tS(n,i=>{const s=Gv.exec(i);return s?{start:s.index,end:s.index+s[0].length}:null},Sl,Vv);if(Array.isArray(r)?t.push(...r):typeof r=="function"&&t.push(r),e?.onHashtagClick){const i=n.registerCommand(_r,s=>{const o=s.target;if(o.classList.contains("bc-lexical-hashtag")){const l=o.textContent;if(l)return e.onHashtagClick(l.replace("#","")),!0}return!1},G);t.push(i)}return()=>{t.forEach(i=>i())}}const qv=/((https?:\/\/(www\.)?|www\.)[^\s<>]+)/g,Zv=/([a-zA-Z0-9._+-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/g,Xv=[{pattern:qv,urlTransformer:n=>n.startsWith("http")?n:`https://${n}`},{pattern:Zv,urlTransformer:n=>`mailto:${n}`}];async function Qv(n,e){const t=e?.matchers??Xv;return n.registerMutationListener(qe,r=>{n.update(()=>{for(const[i,s]of r){if(s!=="created"&&s!=="updated")continue;const o=Y(i);if(!o||!I(o))continue;const l=o.getTextContent();for(const a of t){const c=new RegExp(a.pattern.source,a.pattern.flags);let u;for(;(u=c.exec(l))!==null;)a.urlTransformer(u[0])}}})})}async function e0(n,e){const t=[];return e?.onMarkClick&&t.push(n.registerCommand(_r,r=>{const i=r.target;if(i.classList.contains("bc-lexical-mark")){const s=i.dataset.markId;if(s)return e.onMarkClick(s,{id:s,type:i.dataset.markType||"annotation",data:{}}),!0}return!1},G)),()=>t.forEach(r=>r())}async function t0(n,e,t){n.update(()=>{const r=M();N(r)&&iS(r,r.isBackward(),e)})}async function n0(n,e){n.update(()=>{const r=fe().getAllTextNodes().filter(i=>{const s=i.getParent();return ls(s)?sS(i,0)?.includes(e)??!1:!1});for(const i of r){const s=i.getParent();ls(s)&&rS(s)}})}async function r0(n,e){const{maxLength:t,onOverflow:r}=e;return n.registerUpdateListener(({editorState:i})=>{i.read(()=>{const l=fe().getTextContent().length,a=l>t;r&&r(a,l)})})}async function Hl(n){return typeof Qd=="function"?Qd(n):()=>{}}async function Jl(n,e){const t=e.docMap??new Map,r=e.id??"lexical",i=e.doc.getText(r),s=Tv(n,e.provider,i,e.doc,t),o=n.registerUpdateListener(()=>{});return()=>{o(),s&&typeof s.destroy=="function"&&s.destroy()}}function i0(n){let e={hasSelection:!1,selectedText:"",anchorOffset:0,focusOffset:0};return n.getEditorState().read(()=>{const t=M();N(t)&&(e={hasSelection:!t.isCollapsed(),selectedText:t.getTextContent(),anchorOffset:t.anchor.offset,focusOffset:t.focus.offset})}),e}function Gu(n){let e="";return n.getEditorState().read(()=>{e=fe().getTextContent()}),e}function s0(n){return Gu(n).length}function o0(n){const e=Gu(n).trim();return e?e.split(/\s+/).length:0}async function l0(){return XS}async function Ms(n={}){const{nodes:e=[],plugins:t=[],onError:r}=n,s=(await m_()).createEditor({namespace:"BeatUIHeadless",nodes:e,onError:o=>{r?r(o,s):console.error("[BeatUI Headless]",o)},editable:!1});if(t.length>0)for(const o of t)o.register(s);return s}async function a0(n){const e=await Ms(),{importFromMarkdown:t}=await Promise.resolve().then(()=>Hu);return await t(e,n),e.getEditorState().toJSON()}async function c0(n){const e=await Ms(),{exportToMarkdown:t}=await Promise.resolve().then(()=>Hu),r=e.parseEditorState(JSON.stringify(n));return e.setEditorState(r),await t(e)}async function u0(n){const e=await Ms(),{importFromHtml:t}=await Promise.resolve().then(()=>Ju);return await t(e,n),e.getEditorState().toJSON()}async function d0(n){const e=await Ms(),{exportToHtml:t}=await Promise.resolve().then(()=>Ju),r=e.parseEditorState(JSON.stringify(n));return e.setEditorState(r),await t(e)}const b_=n=>{const{value:e,format:t,plugins:r,readOnly:i,placeholder:s,class:o,namespace:l="BeatUILexical",heightMode:a="auto",onError:c,onInput:u,onChange:d,onBlur:f,onReady:h}=n;return w.Use(vc.Theme,({appearance:g})=>w.html.div(w.Task(()=>Promise.resolve().then(()=>require("../styles-url-B2dzXrYt.cjs")),({default:p})=>wc.LinkPortal({id:"beatui-lexical-css",href:p})),w.attr.class("bc-lexical-editor-container"),a==="fixed"?w.attr.class("bc-lexical-editor-container--fixed"):null,w.attr.class(o),w.html.div(w.attr.class("bc-lexical-editor"),w.attr.class(`bc-lexical-editor--${a}`),w.attr.contenteditable(i!=null?w.Value.map(i,p=>p?"false":"true"):"true"),i!=null?w.attr.class(w.Value.map(i,p=>p?"bc-lexical-editor--readonly":"")):null,w.WithElement(p=>{let m=null;const b=[];return(async()=>{try{const y=r??wl("bare"),C=Cl(y),S=w.Value.get(t??"markdown"),x=fi({namespace:l,nodes:C,theme:{heading:{h1:"bc-lexical-h1",h2:"bc-lexical-h2",h3:"bc-lexical-h3",h4:"bc-lexical-h4",h5:"bc-lexical-h5",h6:"bc-lexical-h6"},text:{bold:"bc-lexical-bold",italic:"bc-lexical-italic",underline:"bc-lexical-underline",strikethrough:"bc-lexical-strikethrough",code:"bc-lexical-code"},list:{ul:"bc-lexical-ul",ol:"bc-lexical-ol",listitem:"bc-lexical-li",listitemChecked:"bc-lexical-li-checked",listitemUnchecked:"bc-lexical-li-unchecked"},link:"bc-lexical-link",quote:"bc-lexical-blockquote",code:"bc-lexical-code-block",codeHighlight:{},hashtag:"bc-lexical-hashtag",table:"bc-lexical-table",tableCell:"bc-lexical-table-cell",tableCellHeader:"bc-lexical-table-cell-header",tableRow:"bc-lexical-table-row",mark:"bc-lexical-mark",paragraph:"bc-lexical-paragraph"},onError:E=>{c?c(E,x):console.error("[BeatUI Lexical]",E)},editable:i?!w.Value.get(i):!0});m=x,x.setRootElement(p);const k=[];if(y.richText?k.push(Rl(x)):y.plainText&&k.push(Pl(x)),y.history){const E=typeof y.history=="object"?y.history:void 0;k.push(Bl(x,E))}if(y.clipboard&&k.push(zl(x)),y.list&&k.push(Ul(x)),y.link&&k.push(Kl(x)),y.yjs&&k.push(Jl(x,y.yjs)),y.dragon&&k.push(Hl(x)),y.table&&k.push(jl(x)),(await Promise.all(k)).forEach(E=>{E&&b.push(E)}),b.push(Wl(x)),e!=null){const E=w.Value.get(e);if(E!=null&&(E!==""||S==="json"&&typeof E=="object")){if(S==="markdown"&&typeof E=="string")await Kn(x,E);else if(S==="html"&&typeof E=="string")await Wn(x,E);else if(S==="json"&&typeof E=="object")try{const T=JSON.stringify(E),D=x.parseEditorState(T);x.setEditorState(D)}catch(T){console.error("[BeatUI] Failed to parse JSON editor state:",T),c&&c(T instanceof Error?T:new Error(String(T)),x)}}}b.push(x.registerUpdateListener(({editorState:E,dirtyElements:A,dirtyLeaves:T})=>{A.size===0&&T.size===0||u&&E.read(async()=>{if(S==="markdown"){const D=await Ct(x);u(D,x)}else if(S==="html"){const D=await wt(x);u(D,x)}else S==="json"&&u(E.toJSON(),x)})})),e!=null&&b.push(w.Value.on(e,async E=>{if(E!=null){if(S==="markdown"&&typeof E=="string"){const A=await Ct(x);E!==A&&await Kn(x,E)}else if(S==="html"&&typeof E=="string"){const A=await wt(x);E!==A&&await Wn(x,E)}else if(S==="json"&&typeof E=="object"){const A=JSON.stringify(x.getEditorState().toJSON()),T=JSON.stringify(E);if(A!==T){const D=x.parseEditorState(T);x.setEditorState(D)}}}})),i!=null&&b.push(w.Value.on(i,E=>{x.setEditable(!E)})),b.push(x.registerCommand(ui,()=>(f&&f(x),d&&x.getEditorState().read(async()=>{if(S==="markdown"){const E=await Ct(x);d(E,x)}else if(S==="html"){const E=await wt(x);d(E,x)}else S==="json"&&d(x.getEditorState().toJSON(),x)}),!1),G)),b.push(g.on(E=>{const A=x.getRootElement();A&&(A.dataset.theme=E)})),h&&h(x)}catch(y){console.error("[BeatUI] Failed to initialize Lexical editor:",y);const C=p;C.textContent="Failed to load Lexical editor."}})(),w.OnDispose(()=>{try{b.forEach(y=>y())}catch{}try{m?.setRootElement(null)}catch{}})}))))};function x_(n,e){const t=(f,h)=>e.map(()=>{const g=n.value;return g?g.getEditorState().read(()=>{const p=M();return N(p)?f(p):h}):h}),r=f=>{const h=f.anchor.getNode();return h.getKey()==="root"?h:h.getTopLevelElementOrThrow()};return{withSelection:t,getAnchorElement:r,textFormatActive:f=>t(h=>h.hasFormat(f),!1),blockTypeActive:f=>t(h=>r(h).getType()===f,!1),listTypeActive:f=>t(h=>{const g=r(h).getParent();return J(g)&&g.getListType()===f},!1),headingActive:f=>e.map(()=>{const h=n.value;return h?h.getEditorState().read(()=>{const g=M();if(N(g)){const p=r(g);if(p.getType()==="heading")return h.getElementByKey(p.getKey())?.tagName===`H${f}`}return!1}):!1}),linkActive:()=>t(f=>{const h=f.anchor.getNode();return h.getParent()?.getType()==="link"||h.getType()==="link"},!1),dispatch:(f,h)=>()=>{const g=n.value;g&&(g.dispatchCommand(f,h),g.focus())},toggleBlock:(f,h)=>()=>{const g=n.value;g&&(g.update(()=>{const p=M();if(N(p)){const m=r(p);Qe(p,()=>m.getType()===f?H():h())}}),g.focus())},toggleLink:()=>{const f=n.value;f&&(f.getEditorState().read(()=>{const h=M();if(N(h)){const g=h.anchor.getNode();if(g.getParent()?.getType()==="link"||g.getType()==="link")f.dispatchCommand(lc,null);else{const b=prompt("Enter URL:");b&&f.dispatchCommand(lc,b)}}}),f.focus())}}}function S_(n,e){return t=>r=>ct.EditorToolbarButton({...r,display:t,disabled:n,size:e})}const f0=[{value:"Arial",label:"Arial"},{value:"Courier New",label:"Courier New"},{value:"Georgia",label:"Georgia"},{value:"Times New Roman",label:"Times New Roman"},{value:"Trebuchet MS",label:"Trebuchet MS"},{value:"Verdana",label:"Verdana"}],h0=[{value:"10px",label:"10"},{value:"12px",label:"12"},{value:"14px",label:"14"},{value:"16px",label:"16"},{value:"18px",label:"18"},{value:"20px",label:"20"},{value:"24px",label:"24"},{value:"30px",label:"30"},{value:"36px",label:"36"}],Mh={value:"",label:"Default"};function C_({editor:n,stateUpdate:e,toolbar:t={},readOnly:r=w.signal(!1),size:i="sm"}){const{visibleGroups:s,hiddenGroups:o,maxHeadingLevel:l=3}=t,a=c=>!(o?.includes(c)||s&&!s.includes(c));return w.Ensure(n,c=>{const u=c,d=w.signal(a("text-formatting")),f=w.signal(a("headings")),h=w.signal(a("lists")),g=w.signal(a("blocks")),p=w.signal(a("links")),m=w.signal(a("indent")),b=w.signal(a("tables")),_=w.signal(a("history")),y=w.signal(a("clipboard")),C=w.signal(a("font")),S=w.signal(a("color")),x=w.signal(a("clear-formatting")),{getAnchorElement:k,textFormatActive:v,blockTypeActive:E,listTypeActive:A,headingActive:T,linkActive:D,dispatch:P,toggleBlock:$,toggleLink:U}=x_(u,e),W=S_(r,i),q=()=>{const R=u.value;R&&(R.update(()=>{const K=M();N(K)&&Qe(K,()=>H())}),R.focus())},se=R=>{const K=u.value;K&&(K.update(()=>{const Z=M();if(N(Z)){const Ti=k(Z),$s=`h${R}`,R_=K.getElementByKey(Ti.getKey());Ti.getType()==="heading"&&R_?.tagName===`H${R}`?Qe(Z,()=>H()):Qe(Z,()=>ft($s))}}),K.focus())},Q=W(d),Pe=W(f),at=W(h),j=W(g),xe=W(p),le=W(m),Ze=W(b),ve=W(x),Be=W(_),ze=W(y),kt=()=>{const R=u.value;if(!R)return;const K=R.getRootElement();K&&(K.focus(),document.execCommand("copy"))},Ne=()=>{const R=u.value;if(!R)return;const K=R.getRootElement();K&&(K.focus(),document.execCommand("cut"))},wn=()=>{const R=u.value;R&&navigator.clipboard.readText().then(K=>{R.update(()=>{const Z=M();N(Z)&&Z.insertText(K)}),R.focus()}).catch(()=>{})},Ei=()=>{const R=u.value;R&&(R.update(()=>{const K=M();if(N(K))for(const Z of K.getNodes())I(Z)&&(Z.setFormat(0),Z.setStyle(""))}),R.focus())},Zt=()=>{const R=u.value;R&&(R.dispatchCommand(ks,{rows:"3",columns:"3",includeHeaders:!0}),R.focus())},ki=[Mh,...t.fontFamilies??f0],Gl=[Mh,...t.fontSizes??h0],T_=e.map(()=>{const R=u.value;return R?R.getEditorState().read(()=>{const K=M();return N(K)?Bs(K,"font-family",""):""}):""}),N_=e.map(()=>{const R=u.value;return R?R.getEditorState().read(()=>{const K=M();return N(K)?Bs(K,"font-size",""):""}):""}),A_=R=>{const K=u.value;K&&(K.update(()=>{const Z=M();N(Z)&&Ps(Z,{"font-family":R||null})}),K.focus())},O_=R=>{const K=u.value;K&&(K.update(()=>{const Z=M();N(Z)&&Ps(Z,{"font-size":R||null})}),K.focus())},M_=e.map(()=>{const R=u.value;return R?R.getEditorState().read(()=>{const K=M();return N(K)&&Bs(K,"color","")||"#000000"}):"#000000"}),$_=e.map(()=>{const R=u.value;return R?R.getEditorState().read(()=>{const K=M();return N(K)&&Bs(K,"background-color","")||"#ffffff"}):"#ffffff"}),I_=e.map(()=>{const R=u.value;return R?R.getEditorState().read(()=>{const K=M();if(N(K)){const Z=k(K);return R.getElementByKey(Z.getKey())?.style.backgroundColor||"#ffffff"}return"#ffffff"}):"#ffffff"}),F_=R=>{const K=u.value;K&&(K.update(()=>{const Z=M();N(Z)&&Ps(Z,{color:R})}),K.focus())},D_=R=>{const K=u.value;K&&(K.update(()=>{const Z=M();N(Z)&&Ps(Z,{"background-color":R})}),K.focus())},L_=R=>{const K=u.value;K&&(K.update(()=>{const Z=M();if(N(Z)){const Ti=k(Z),$s=K.getElementByKey(Ti.getKey());$s&&($s.style.backgroundColor=R)}}),K.focus())};return P_.Toolbar(w.attr.class("bc-lexical-toolbar"),w.When(C,()=>ct.EditorToolbarGroup({display:[C]},w.html.select(w.attr.class("bc-lexical-toolbar-select"),w.attr.title("Font Family"),w.attr.disabled(r),w.on.change(R=>A_(R.target.value)),...ki.map(R=>w.html.option(w.attr.value(R.value),w.attr.selected(T_.map(K=>K===R.value)),R.label))),w.html.select(w.attr.class("bc-lexical-toolbar-select"),w.attr.title("Font Size"),w.attr.disabled(r),w.on.change(R=>O_(R.target.value)),...Gl.map(R=>w.html.option(w.attr.value(R.value),w.attr.selected(N_.map(K=>K===R.value)),R.label))))),w.When(S,()=>ct.EditorToolbarGroup({display:[S]},w.html.label(w.attr.class("bc-lexical-toolbar-color"),w.attr.title("Font Color"),w.html.input(w.attr.type("color"),w.attr.value(M_),w.attr.disabled(r),w.on.input(R=>F_(R.target.value))),w.html.span(w.attr.class("bc-lexical-toolbar-color-icon"),"A")),w.html.label(w.attr.class("bc-lexical-toolbar-color"),w.attr.title("Highlight Color"),w.html.input(w.attr.type("color"),w.attr.value($_),w.attr.disabled(r),w.on.input(R=>D_(R.target.value))),w.html.span(w.attr.class("bc-lexical-toolbar-color-icon bc-lexical-toolbar-color-icon--highlight"),"A")),w.html.label(w.attr.class("bc-lexical-toolbar-color"),w.attr.title("Background Color"),w.html.input(w.attr.type("color"),w.attr.value(I_),w.attr.disabled(r),w.on.input(R=>L_(R.target.value))),w.html.span(w.attr.class("bc-lexical-toolbar-color-icon bc-lexical-toolbar-color-icon--bg"),"■")))),ct.EditorToolbarGroup({display:Array(5).fill(d)},Q({active:v("bold"),onClick:P(Ce,"bold"),label:"Bold",icon:"mdi:format-bold"}),Q({active:v("italic"),onClick:P(Ce,"italic"),label:"Italic",icon:"mdi:format-italic"}),Q({active:v("underline"),onClick:P(Ce,"underline"),label:"Underline",icon:"mdi:format-underline"}),Q({active:v("strikethrough"),onClick:P(Ce,"strikethrough"),label:"Strikethrough",icon:"mdi:format-strikethrough"}),Q({active:v("code"),onClick:P(Ce,"code"),label:"Code",icon:"mdi:code-tags"})),ct.EditorToolbarGroup({display:[x]},ve({active:w.signal(!1),onClick:Ei,label:"Clear Formatting",icon:"mdi:format-clear"})),ct.EditorToolbarGroup({display:[f,...Array(l).fill(f)]},Pe({active:E("paragraph"),onClick:q,label:"Normal",icon:"mdi:format-paragraph"}),...Array.from({length:l},(R,K)=>{const Z=K+1;return Pe({active:T(Z),onClick:()=>se(Z),label:`Heading ${Z}`,icon:`mdi:format-header-${Z}`})})),ct.EditorToolbarGroup({display:Array(3).fill(h)},at({active:A("bullet"),onClick:P(_i,void 0),label:"Bullet List",icon:"mdi:format-list-bulleted"}),at({active:A("number"),onClick:P(yi,void 0),label:"Ordered List",icon:"mdi:format-list-numbered"}),at({active:A("check"),onClick:P(bl,void 0),label:"Check List",icon:"mdi:format-list-checks"})),ct.EditorToolbarGroup({display:Array(2).fill(m)},le({active:w.signal(!1),onClick:P(Ut,void 0),label:"Indent",icon:"mdi:format-indent-increase"}),le({active:w.signal(!1),onClick:P(sn,void 0),label:"Outdent",icon:"mdi:format-indent-decrease"})),ct.EditorToolbarGroup({display:Array(3).fill(g)},j({active:E("quote"),onClick:$("quote",mi),label:"Blockquote",icon:"mdi:format-quote-close"}),j({active:E("code"),onClick:$("code",xt),label:"Code Block",icon:"mdi:code-braces"}),j({active:w.signal(!1),onClick:P(Os,void 0),label:"Horizontal Rule",icon:"mdi:minus"})),ct.EditorToolbarGroup({display:[b]},Ze({active:w.signal(!1),onClick:Zt,label:"Insert Table",icon:"mdi:table-plus"})),ct.EditorToolbarGroup({display:[p]},xe({active:D(),onClick:U,label:"Link",icon:"mdi:link"})),ct.EditorToolbarGroup({display:Array(2).fill(_)},Be({active:w.signal(!1),onClick:P(oi,void 0),label:"Undo",icon:"mdi:undo"}),Be({active:w.signal(!1),onClick:P(li,void 0),label:"Redo",icon:"mdi:redo"})),ct.EditorToolbarGroup({display:Array(3).fill(y)},ze({active:w.signal(!1),onClick:Ne,label:"Cut",icon:"mdi:content-cut"}),ze({active:w.signal(!1),onClick:kt,label:"Copy",icon:"mdi:content-copy"}),ze({active:w.signal(!1),onClick:wn,label:"Paste",icon:"mdi:content-paste"})))})}function w_({editor:n,stateUpdate:e,readOnly:t=w.signal(!1)}){const r=w.prop(!1),i=w.prop(0),s=w.prop(0),o=()=>{const p=n.value;if(!p){r.value=!1;return}p.getEditorState().read(()=>{const m=M();if(!N(m)){r.value=!1;return}let _=m.anchor.getNode(),y=null;for(;_;){if(ge(_)){y=_;break}if(_=_.getParent(),!_||_.getKey()==="root")break}if(!y){r.value=!1;return}const C=p.getElementByKey(y.getKey()),S=p.getRootElement();if(C&&S){const x=C.getBoundingClientRect(),k=S.closest(".bc-lexical-editor-container"),v=k?k.getBoundingClientRect():S.getBoundingClientRect();i.value=x.bottom-v.top+4,s.value=x.left-v.left}r.value=!0})};e.onChange(o);const l=()=>{const p=n.value;p&&(p.update(()=>{_f(!1)}),p.focus())},a=()=>{const p=n.value;p&&(p.update(()=>{_f(!0)}),p.focus())},c=()=>{const p=n.value;p&&(p.update(()=>{yf(!1)}),p.focus())},u=()=>{const p=n.value;p&&(p.update(()=>{yf(!0)}),p.focus())},d=()=>{const p=n.value;p&&(p.update(()=>{yx()}),p.focus())},f=()=>{const p=n.value;p&&(p.update(()=>{bx()}),p.focus())},h=()=>{const p=n.value;p&&(p.update(()=>{const m=M();if(!N(m))return;const b=m.anchor.getNode(),_=_x(b);if(!_)return;Fp(_).remove()}),p.focus())},g=w.html.div(w.attr.class("bc-table-context-menu"),w.attr.role("menu"),w.style.position("absolute"),w.style.top(i.map(p=>`${p}px`)),w.style.left(s.map(p=>`${p}px`)),w.style.zIndex("1000"),w.style.backgroundColor("var(--color-surface)"),w.style.border("1px solid var(--color-border)"),w.style.borderRadius("var(--radius-md)"),w.style.boxShadow("0 2px 8px rgba(0, 0, 0, 0.15)"),w.style.padding("var(--spacing-xs)"),w.style.minWidth("180px"),w.WithElement(p=>{const m=_=>{if(_.key==="Escape"&&r.value){r.value=!1;const y=n.value;y&&y.focus()}},b=_=>{if(r.value&&!p.contains(_.target)){const y=n.value;if(y){const C=y.getRootElement();if(C&&C.contains(_.target))return}r.value=!1}};return document.addEventListener("keydown",m),document.addEventListener("mousedown",b),w.OnDispose(()=>{document.removeEventListener("keydown",m),document.removeEventListener("mousedown",b)})}),Vn("Insert row above",l,t),Vn("Insert row below",a,t),Vn("Insert column left",c,t),Vn("Insert column right",u,t),w.html.div(w.attr.class("bc-table-menu-separator"),w.style.height("1px"),w.style.backgroundColor("var(--color-border)"),w.style.margin("var(--spacing-xs) 0")),Vn("Delete row",d,t,"danger"),Vn("Delete column",f,t,"danger"),Vn("Delete table",h,t,"danger"));return w.When(r,()=>g)}function Vn(n,e,t,r="default"){return w.html.button(w.attr.class("bc-table-menu-button"),w.attr.type("button"),w.attr.role("menuitem"),w.attr.disabled(t),w.on.click(e),w.style.display("block"),w.style.width("100%"),w.style.padding("var(--spacing-xs) var(--spacing-sm)"),w.style.border("none"),w.style.backgroundColor("transparent"),w.style.color(r==="danger"?"var(--color-danger-600)":"var(--color-neutral-900)"),w.style.textAlign("left"),w.style.cursor("pointer"),w.style.borderRadius("var(--radius-sm)"),w.style.fontSize("0.875rem"),w.style.transition("background-color 0.15s"),w.html.span(n))}const g0=n=>{const{value:e,format:t,plugins:r,readOnly:i,placeholder:s,class:o,namespace:l="BeatUILexical",heightMode:a="fixed",toolbar:c,onError:u,onInput:d,onChange:f,onBlur:h,onReady:g}=n,p=w.prop(null),m=w.prop(0),b=y=>typeof y=="object"&&y!==null&&"map"in y&&typeof y.map=="function",_=i!=null?b(i)?i:w.prop(w.Value.get(i)):w.prop(!1);return w.Use(vc.Theme,({appearance:y})=>w.html.div(w.Task(()=>Promise.resolve().then(()=>require("../styles-url-B2dzXrYt.cjs")),({default:C})=>wc.LinkPortal({id:"beatui-lexical-css",href:C})),w.attr.class("bc-lexical-editor-container"),a==="fixed"?w.attr.class("bc-lexical-editor-container--fixed"):null,w.attr.class(o),w.When(_.map(C=>!C),()=>C_({editor:p,stateUpdate:m,toolbar:c,readOnly:_,size:"sm"})),w_({editor:p,stateUpdate:m,readOnly:_}),w.html.div(w.attr.class("bc-lexical-editor"),w.attr.class(`bc-lexical-editor--${a}`),w.attr.contenteditable(i!=null?w.Value.map(i,C=>C?"false":"true"):"true"),i!=null?w.attr.class(w.Value.map(i,C=>C?"bc-lexical-editor--readonly":"")):null,w.WithElement(C=>{let S=null;const x=[];return(async()=>{try{const v=r??wl("docked"),E=Cl(v),A=w.Value.get(t??"markdown"),T=fi({namespace:l,nodes:E,theme:{heading:{h1:"bc-lexical-h1",h2:"bc-lexical-h2",h3:"bc-lexical-h3",h4:"bc-lexical-h4",h5:"bc-lexical-h5",h6:"bc-lexical-h6"},text:{bold:"bc-lexical-bold",italic:"bc-lexical-italic",underline:"bc-lexical-underline",strikethrough:"bc-lexical-strikethrough",code:"bc-lexical-code"},list:{ul:"bc-lexical-ul",ol:"bc-lexical-ol",listitem:"bc-lexical-li",listitemChecked:"bc-lexical-li-checked",listitemUnchecked:"bc-lexical-li-unchecked"},link:"bc-lexical-link",quote:"bc-lexical-blockquote",code:"bc-lexical-code-block",codeHighlight:{},hashtag:"bc-lexical-hashtag",table:"bc-lexical-table",tableCell:"bc-lexical-table-cell",tableCellHeader:"bc-lexical-table-cell-header",tableRow:"bc-lexical-table-row",mark:"bc-lexical-mark",paragraph:"bc-lexical-paragraph"},onError:$=>{u?u($,T):console.error("[BeatUI Lexical]",$)},editable:i?!w.Value.get(i):!0});S=T,p.set(T),T.setRootElement(C);const D=[];if(v.richText?D.push(Rl(T)):v.plainText&&D.push(Pl(T)),v.history){const $=typeof v.history=="object"?v.history:void 0;D.push(Bl(T,$))}if(v.clipboard&&D.push(zl(T)),v.list&&D.push(Ul(T)),v.link&&D.push(Kl(T)),v.yjs&&D.push(Jl(T,v.yjs)),v.dragon&&D.push(Hl(T)),v.table&&D.push(jl(T)),(await Promise.all(D)).forEach($=>{$&&x.push($)}),x.push(Wl(T)),x.push(T.registerCommand(ii,()=>(m.set(m.value+1),!1),G)),x.push(T.registerUpdateListener(({editorState:$,dirtyElements:U,dirtyLeaves:W})=>{(U.size>0||W.size>0)&&m.set(m.value+1),d&&(U.size>0||W.size>0)&&$.read(async()=>{if(A==="markdown"){const q=await Ct(T);d(q,T)}else if(A==="html"){const q=await wt(T);d(q,T)}else A==="json"&&d($.toJSON(),T)})})),e!=null){const $=w.Value.get(e);if($!=null&&($!==""||A==="json"&&typeof $=="object")){if(A==="markdown"&&typeof $=="string")await Kn(T,$);else if(A==="html"&&typeof $=="string")await Wn(T,$);else if(A==="json"&&typeof $=="object")try{const W=JSON.stringify($),q=T.parseEditorState(W);T.setEditorState(q)}catch(W){console.error("[BeatUI] Failed to parse JSON editor state:",W),u&&u(W instanceof Error?W:new Error(String(W)),T)}}}e!=null&&x.push(w.Value.on(e,async $=>{if($!=null){if(A==="markdown"&&typeof $=="string"){const U=await Ct(T);$!==U&&await Kn(T,$)}else if(A==="html"&&typeof $=="string"){const U=await wt(T);$!==U&&await Wn(T,$)}else if(A==="json"&&typeof $=="object"){const U=JSON.stringify(T.getEditorState().toJSON()),W=JSON.stringify($);if(U!==W){const q=T.parseEditorState(W);T.setEditorState(q)}}}})),i!=null&&x.push(w.Value.on(i,$=>{T.setEditable(!$)})),x.push(T.registerCommand(ui,()=>(h&&h(T),f&&T.getEditorState().read(async()=>{if(A==="markdown"){const $=await Ct(T);f($,T)}else if(A==="html"){const $=await wt(T);f($,T)}else A==="json"&&f(T.getEditorState().toJSON(),T)}),!1),G)),x.push(y.on($=>{const U=T.getRootElement();U&&(U.dataset.theme=$)})),g&&g(T)}catch(v){console.error("[BeatUI] Failed to initialize Lexical editor:",v);const E=C;E.textContent="Failed to load Lexical editor."}})(),w.OnDispose(()=>{try{x.forEach(v=>v())}catch{}try{S?.setRootElement(null)}catch{}p.set(null)})}))))};function v_({editor:n,stateUpdate:e,groups:t=["text-formatting"],readOnly:r=w.signal(!1),size:i="sm"}){const s=w.prop(!1),o=w.prop(0),l=w.prop(0);return w.Ensure(n,a=>{const c=a,u=S=>t.includes(S),{textFormatActive:d,linkActive:f,dispatch:h,toggleLink:g}=x_(c,e),m=S_(r,i)(w.signal(!0)),b=()=>{const S=c.value;if(!S){s.value=!1;return}const x=S.getRootElement();if(!x){s.value=!1;return}const k=window.getSelection();if(!k||k.rangeCount===0||k.isCollapsed){s.value=!1;return}const v=k.anchorNode;if(v&&!x.contains(v)){s.value=!1;return}const A=k.getRangeAt(0).getBoundingClientRect();if(A.width===0&&A.height===0){s.value=!1;return}const T=40,D=8;let P=A.top-T-D;const $=A.left+A.width/2;P<0&&(P=A.bottom+D),o.value=P,l.value=$,s.value=!0},_=e.onChange(b),y=()=>{b()};document.addEventListener("selectionchange",y);const C=w.html.div(w.attr.class("bc-floating-toolbar"),w.style.position("fixed"),w.style.top(o.map(S=>`${S}px`)),w.style.left(l.map(S=>`${S}px`)),w.style.transform("translateX(-50%)"),w.WithElement(S=>{const x=v=>{if(v.key==="Escape"&&s.value){s.value=!1;const E=c.value;E&&E.focus()}},k=v=>{if(s.value&&!S.contains(v.target)){const E=c.value;if(E){const A=E.getRootElement();if(A&&A.contains(v.target))return}s.value=!1}};return document.addEventListener("keydown",x),document.addEventListener("mousedown",k),w.OnDispose(()=>{_(),document.removeEventListener("keydown",x),document.removeEventListener("mousedown",k),document.removeEventListener("selectionchange",y)})}),...u("text-formatting")?[m({active:d("bold"),onClick:h(Ce,"bold"),label:"Bold",icon:"mdi:format-bold"}),m({active:d("italic"),onClick:h(Ce,"italic"),label:"Italic",icon:"mdi:format-italic"}),m({active:d("underline"),onClick:h(Ce,"underline"),label:"Underline",icon:"mdi:format-underline"}),m({active:d("strikethrough"),onClick:h(Ce,"strikethrough"),label:"Strikethrough",icon:"mdi:format-strikethrough"}),m({active:d("code"),onClick:h(Ce,"code"),label:"Code",icon:"mdi:code-tags"})]:[],...u("links")?[m({active:f(),onClick:g,label:"Link",icon:"mdi:link"})]:[],...u("clipboard")?[m({active:w.signal(!1),onClick:()=>{const S=c.value;if(!S)return;const x=S.getRootElement();x&&(x.focus(),document.execCommand("cut"))},label:"Cut",icon:"mdi:content-cut"}),m({active:w.signal(!1),onClick:()=>{const S=c.value;if(!S)return;const x=S.getRootElement();x&&(x.focus(),document.execCommand("copy"))},label:"Copy",icon:"mdi:content-copy"}),m({active:w.signal(!1),onClick:()=>{const S=c.value;S&&navigator.clipboard.readText().then(x=>{S.update(()=>{const k=M();N(k)&&k.insertText(x)}),S.focus()}).catch(()=>{})},label:"Paste",icon:"mdi:content-paste"})]:[]);return w.When(s,()=>C)})}const p0=[{id:"heading1",label:"Heading 1",description:"Large section heading",icon:"mdi:format-header-1",keywords:["h1","heading","title"],category:"Basic blocks",handler:n=>{n.update(()=>{const e=M();N(e)&&Qe(e,()=>ft("h1"))})}},{id:"heading2",label:"Heading 2",description:"Medium section heading",icon:"mdi:format-header-2",keywords:["h2","heading"],category:"Basic blocks",handler:n=>{n.update(()=>{const e=M();N(e)&&Qe(e,()=>ft("h2"))})}},{id:"heading3",label:"Heading 3",description:"Small section heading",icon:"mdi:format-header-3",keywords:["h3","heading"],category:"Basic blocks",handler:n=>{n.update(()=>{const e=M();N(e)&&Qe(e,()=>ft("h3"))})}},{id:"bullet-list",label:"Bullet List",description:"Create a bulleted list",icon:"mdi:format-list-bulleted",keywords:["ul","unordered","bullets"],category:"Lists",handler:n=>{n.dispatchCommand(_i,void 0)}},{id:"ordered-list",label:"Ordered List",description:"Create a numbered list",icon:"mdi:format-list-numbered",keywords:["ol","numbered","1","2","3"],category:"Lists",handler:n=>{n.dispatchCommand(yi,void 0)}},{id:"quote",label:"Quote",description:"Insert a blockquote",icon:"mdi:format-quote-close",keywords:["blockquote","citation"],category:"Basic blocks",handler:n=>{n.update(()=>{const e=M();N(e)&&Qe(e,()=>mi())})}},{id:"code-block",label:"Code Block",description:"Insert a code block",icon:"mdi:code-braces",keywords:["code","pre","programming"],category:"Basic blocks",handler:n=>{n.update(()=>{const e=M();N(e)&&Qe(e,()=>xt())})}},{id:"divider",label:"Divider",description:"Insert a horizontal rule",icon:"mdi:minus",keywords:["hr","horizontal","line","separator"],category:"Basic blocks",handler:n=>{n.dispatchCommand(Os,void 0)}},{id:"table",label:"Table",description:"Insert a table",icon:"mdi:table",keywords:["table","grid","cells","rows","columns"],category:"Advanced",handler:n=>{n.dispatchCommand(ks,{rows:"3",columns:"3",includeHeaders:!0})}}];function m0({commands:n,isVisible:e,filterText:t,position:r,onSelect:i,onDismiss:s}){const o=w.prop(0),l=t.map(f=>{const h=f.toLowerCase().trim();return h?n.filter(g=>[g.label.toLowerCase(),g.description?.toLowerCase()||"",...g.keywords?.map(m=>m.toLowerCase())||[]].join(" ").includes(h)):n});l.onChange(()=>{o.value=0});const a=f=>{const h=l.value;if(f>=0&&f<h.length){const g=h[f];i(g)}},c=f=>{if(!e.value)return;const g=l.value.length-1;switch(f.key){case"ArrowDown":f.preventDefault(),o.value=Math.min(o.value+1,g);break;case"ArrowUp":f.preventDefault(),o.value=Math.max(o.value-1,0);break;case"Enter":f.preventDefault(),a(o.value);break;case"Escape":f.preventDefault(),s();break}},u=(f,h)=>{const g=o.map(m=>m===h),p=`slash-cmd-${f.id}`;return w.html.div(w.attr.class("bc-slash-command-palette__item"),w.attr.id(p),w.attr.role("option"),w.aria.selected(g),w.WithElement(m=>{const b=()=>{o.value=h},_=()=>{a(h)};return m.addEventListener("mouseenter",b),m.addEventListener("click",_),w.OnDispose(()=>{m.removeEventListener("mouseenter",b),m.removeEventListener("click",_)})}),typeof f.icon=="string"?w.html.div(w.attr.class("bc-slash-command-palette__icon"),Oa.Icon({icon:f.icon,size:"sm"})):f.icon,w.html.div(w.attr.class("bc-slash-command-palette__content"),w.html.div(w.attr.class("bc-slash-command-palette__label"),f.label),f.description?w.html.div(w.attr.class("bc-slash-command-palette__description"),f.description):void 0),f.category?w.html.div(w.attr.class("bc-slash-command-palette__category"),f.category):void 0)},d=w.html.div(w.attr.class("bc-slash-command-palette"),w.attr.role("listbox"),w.aria.label("Slash commands"),w.style.position("absolute"),w.style.top(r.map(f=>`${f.top}px`)),w.style.left(r.map(f=>`${f.left}px`)),w.WithElement(()=>(document.addEventListener("keydown",c),w.OnDispose(()=>{document.removeEventListener("keydown",c)}))),w.When(l.map(f=>f.length===0),()=>w.html.div(w.attr.class("bc-slash-command-palette__empty"),"No commands found")),w.ForEach(l,(f,h)=>{const g=f.value;return u(g,h.index)}));return w.When(e,()=>d)}const E_=[{id:"paragraph",label:"Paragraph",icon:"mdi:format-paragraph",handler:n=>{n.update(()=>{const e=M();N(e)&&Qe(e,()=>H())})}},{id:"heading1",label:"Heading 1",icon:"mdi:format-header-1",handler:n=>{n.update(()=>{const e=M();N(e)&&Qe(e,()=>ft("h1"))})}},{id:"heading2",label:"Heading 2",icon:"mdi:format-header-2",handler:n=>{n.update(()=>{const e=M();N(e)&&Qe(e,()=>ft("h2"))})}},{id:"heading3",label:"Heading 3",icon:"mdi:format-header-3",handler:n=>{n.update(()=>{const e=M();N(e)&&Qe(e,()=>ft("h3"))})}},{id:"bullet-list",label:"Bullet List",icon:"mdi:format-list-bulleted",handler:n=>{n.dispatchCommand(_i,void 0)}},{id:"ordered-list",label:"Ordered List",icon:"mdi:format-list-numbered",handler:n=>{n.dispatchCommand(yi,void 0)}},{id:"quote",label:"Quote",icon:"mdi:format-quote-close",handler:n=>{n.update(()=>{const e=M();N(e)&&Qe(e,()=>mi())})}},{id:"code-block",label:"Code Block",icon:"mdi:code-braces",handler:n=>{n.update(()=>{const e=M();N(e)&&Qe(e,()=>xt())})}},{id:"divider",label:"Divider",icon:"mdi:minus",handler:n=>{n.dispatchCommand(Os,void 0)}},{id:"table",label:"Table",icon:"mdi:table",handler:n=>{n.dispatchCommand(ks,{rows:"3",columns:"3",includeHeaders:!0})}}];function k_({editor:n,stateUpdate:e,readOnly:t=w.signal(!1),commands:r=E_}){const i=w.prop(!1),s=w.prop(!1),o=w.prop(0),l=w.prop(0);return w.Ensure(n,a=>{const c=a;let u=null,d=!1,f=null,h=null;const g=24,p=4,m=200,b=A=>{if(A===u&&i.value)return;u=A;const T=A.getBoundingClientRect();o.value=T.top,l.value=T.left-g-p,i.value=!0},_=()=>{f!=null&&(clearTimeout(f),f=null)},y=()=>{s.value||(_(),f=setTimeout(()=>{f=null,s.value||(i.value=!1,u=null)},m))},C=()=>{const A=c.value;if(!A)return;const T=A.getRootElement();T&&(k(T),A.getEditorState().read(()=>{const D=M();if(N(D))try{const $=D.anchor.getNode().getTopLevelElementOrThrow(),U=A.getElementByKey($.getKey());U&&b(U)}catch{}}))},S=A=>{if(s.value)return;const T=c.value;if(!T)return;const D=T.getRootElement();if(D)for(const P of Array.from(D.children)){const $=P.getBoundingClientRect();if(A.clientY>=$.top&&A.clientY<=$.bottom){_(),b(P);return}}},x=()=>{y()},k=A=>{d||(d=!0,A.addEventListener("mousemove",S),A.addEventListener("mouseleave",x))},v=e.onChange(C);return[w.OnDispose(()=>{v(),_();const A=c.value;if(A){const T=A.getRootElement();T&&d&&(T.removeEventListener("mousemove",S),T.removeEventListener("mouseleave",x))}}),w.When(i,()=>w.html.div(w.attr.class("bc-block-handle"),w.style.position("fixed"),w.style.top(o.map(A=>`${A}px`)),w.style.left(l.map(A=>`${A}px`)),w.on.mouseenter(_),w.on.mouseleave(()=>y()),w.WithElement(A=>{A.addEventListener("mousedown",T=>{T.preventDefault()})}),w.html.button(w.attr.class("bc-block-handle__button"),w.attr.type("button"),w.attr.title("Change block type"),w.attr.disabled(t),Oa.Icon({icon:"mdi:drag-horizontal-variant",size:"sm"}),w.WithElement(A=>{const T=new MutationObserver(()=>{const D=A.getAttribute("aria-expanded")==="true";s.value=D});return T.observe(A,{attributes:!0,attributeFilter:["aria-expanded"]}),w.OnDispose(()=>T.disconnect())}),Yu.Menu({items:()=>r.map(A=>Yu.MenuItem({key:A.id,content:A.label,startContent:Oa.Icon({icon:A.icon,size:"sm"}),onClick:()=>{const T=c.value;T&&(A.handler(T),h?.(),T.focus())}})),placement:"bottom-start",showOn:(A,T)=>(h=T,w.on.click(()=>{s.value?T():(A(),s.value=!0)})),showDelay:0,hideDelay:0,mainAxisOffset:4,onClose:()=>{const A=c.value;A&&A.focus()},ariaLabel:"Block types"}))))]})}const _0=n=>{const{value:e,format:t,plugins:r,readOnly:i,placeholder:s,class:o,namespace:l="BeatUILexical",heightMode:a="auto",floatingToolbarGroups:c,onError:u,onInput:d,onChange:f,onBlur:h,onReady:g}=n,p=w.prop(null),m=w.prop(0),b=y=>typeof y=="object"&&y!==null&&"map"in y&&typeof y.map=="function",_=i!=null?b(i)?i:w.prop(w.Value.get(i)):w.prop(!1);return w.Use(vc.Theme,({appearance:y})=>w.html.div(w.Task(()=>Promise.resolve().then(()=>require("../styles-url-B2dzXrYt.cjs")),({default:C})=>wc.LinkPortal({id:"beatui-lexical-css",href:C})),w.attr.class("bc-lexical-editor-container"),a==="fixed"?w.attr.class("bc-lexical-editor-container--fixed"):null,w.attr.class(o),v_({editor:p,stateUpdate:m,groups:c??["text-formatting","links"],readOnly:_}),k_({editor:p,stateUpdate:m,readOnly:_}),w_({editor:p,stateUpdate:m,readOnly:_}),w.html.div(w.attr.class("bc-lexical-editor"),w.attr.class(`bc-lexical-editor--${a}`),w.attr.contenteditable(i!=null?w.Value.map(i,C=>C?"false":"true"):"true"),i!=null?w.attr.class(w.Value.map(i,C=>C?"bc-lexical-editor--readonly":"")):null,w.WithElement(C=>{let S=null;const x=[];return(async()=>{try{const v=r??wl("contextual"),E=Cl(v),A=w.Value.get(t??"markdown"),T=fi({namespace:l,nodes:E,theme:{heading:{h1:"bc-lexical-h1",h2:"bc-lexical-h2",h3:"bc-lexical-h3",h4:"bc-lexical-h4",h5:"bc-lexical-h5",h6:"bc-lexical-h6"},text:{bold:"bc-lexical-bold",italic:"bc-lexical-italic",underline:"bc-lexical-underline",strikethrough:"bc-lexical-strikethrough",code:"bc-lexical-code"},list:{ul:"bc-lexical-ul",ol:"bc-lexical-ol",listitem:"bc-lexical-li",listitemChecked:"bc-lexical-li-checked",listitemUnchecked:"bc-lexical-li-unchecked"},link:"bc-lexical-link",quote:"bc-lexical-blockquote",code:"bc-lexical-code-block",codeHighlight:{},hashtag:"bc-lexical-hashtag",table:"bc-lexical-table",tableCell:"bc-lexical-table-cell",tableCellHeader:"bc-lexical-table-cell-header",tableRow:"bc-lexical-table-row",mark:"bc-lexical-mark",paragraph:"bc-lexical-paragraph"},onError:$=>{u?u($,T):console.error("[BeatUI Lexical]",$)},editable:i?!w.Value.get(i):!0});S=T,p.set(T),T.setRootElement(C);const D=[];if(v.richText?D.push(Rl(T)):v.plainText&&D.push(Pl(T)),v.history){const $=typeof v.history=="object"?v.history:void 0;D.push(Bl(T,$))}if(v.clipboard&&D.push(zl(T)),v.list&&D.push(Ul(T)),v.link&&D.push(Kl(T)),v.yjs&&D.push(Jl(T,v.yjs)),v.dragon&&D.push(Hl(T)),v.table&&D.push(jl(T)),(await Promise.all(D)).forEach($=>{$&&x.push($)}),x.push(Wl(T)),x.push(T.registerCommand(ii,()=>(m.set(m.value+1),!1),G)),x.push(T.registerUpdateListener(({editorState:$,dirtyElements:U,dirtyLeaves:W})=>{(U.size>0||W.size>0)&&m.set(m.value+1),d&&(U.size>0||W.size>0)&&$.read(async()=>{if(A==="markdown"){const q=await Ct(T);d(q,T)}else if(A==="html"){const q=await wt(T);d(q,T)}else A==="json"&&d($.toJSON(),T)})})),e!=null){const $=w.Value.get(e);if($!=null&&($!==""||A==="json"&&typeof $=="object")){if(A==="markdown"&&typeof $=="string")await Kn(T,$);else if(A==="html"&&typeof $=="string")await Wn(T,$);else if(A==="json"&&typeof $=="object")try{const W=JSON.stringify($),q=T.parseEditorState(W);T.setEditorState(q)}catch(W){console.error("[BeatUI] Failed to parse JSON editor state:",W),u&&u(W instanceof Error?W:new Error(String(W)),T)}}}e!=null&&x.push(w.Value.on(e,async $=>{if($!=null){if(A==="markdown"&&typeof $=="string"){const U=await Ct(T);$!==U&&await Kn(T,$)}else if(A==="html"&&typeof $=="string"){const U=await wt(T);$!==U&&await Wn(T,$)}else if(A==="json"&&typeof $=="object"){const U=JSON.stringify(T.getEditorState().toJSON()),W=JSON.stringify($);if(U!==W){const q=T.parseEditorState(W);T.setEditorState(q)}}}})),i!=null&&x.push(w.Value.on(i,$=>{T.setEditable(!$)})),x.push(T.registerCommand(ui,()=>(h&&h(T),f&&T.getEditorState().read(async()=>{if(A==="markdown"){const $=await Ct(T);f($,T)}else if(A==="html"){const $=await wt(T);f($,T)}else A==="json"&&f(T.getEditorState().toJSON(),T)}),!1),G)),x.push(y.on($=>{const U=T.getRootElement();U&&(U.dataset.theme=$)})),g&&g(T)}catch(v){console.error("[BeatUI] Failed to initialize Lexical editor:",v);const E=C;E.textContent="Failed to load Lexical editor."}})(),w.OnDispose(()=>{try{x.forEach(v=>v())}catch{}try{S?.setRootElement(null)}catch{}p.set(null)})}))))},y0=n=>{const{value:e,before:t,after:r,onChange:i,onInput:s,onBlur:o,disabled:l,hasError:a,name:c,placeholder:u,id:d,required:f,tabIndex:h,size:g,class:p,namespace:m,format:b,plugins:_,readOnly:y,onError:C,onReady:S,marks:x}=n,k=l!=null&&y!=null?w.computedOf(l,y)((v,E)=>(v??!1)||(E??!1)):l??y;return B_.InputContainer({disabled:l,hasError:a,size:g,baseContainer:!0,growInput:!0,focusableSelector:"[contenteditable]",before:t,after:r,input:w.html.div(w.attr.class("bc-lexical-editor-input"),w.attr.name(c),w.attr.id(d),f!=null?w.aria.required(f):null,h!=null?w.attr.tabindex(h):null,a!=null?w.attr.class(w.Value.map(a,v=>v?"bc-lexical-editor-input--error":"")):null,b_({value:e,format:b??"markdown",plugins:_,readOnly:k,placeholder:u,namespace:m,class:p,onError:C,onReady:S,onInput:s?(v,E)=>{s(v)}:void 0,onChange:i?(v,E)=>{i(v)}:void 0,onBlur:o?v=>{o()}:void 0}))})};exports.$createHorizontalRuleNode=Ts;exports.$isHorizontalRuleNode=Vp;exports.BLUR_COMMAND=ui;exports.BareEditor=b_;exports.BlockHandle=k_;exports.CLEAR_EDITOR_COMMAND=Lc;exports.CLICK_COMMAND=_r;exports.COMMAND_PRIORITY_CRITICAL=Wc;exports.COMMAND_PRIORITY_EDITOR=B;exports.COMMAND_PRIORITY_HIGH=wg;exports.COMMAND_PRIORITY_LOW=G;exports.COMMAND_PRIORITY_NORMAL=Cg;exports.COPY_COMMAND=yr;exports.CUT_COMMAND=ci;exports.ContextualEditor=_0;exports.DEFAULT_BLOCK_COMMANDS=E_;exports.DEFAULT_SLASH_COMMANDS=p0;exports.DecoratorNode=xs;exports.DockedEditor=g0;exports.ElementNode=be;exports.FOCUS_COMMAND=Rc;exports.FORMAT_ELEMENT_COMMAND=Fc;exports.FORMAT_TEXT_COMMAND=Ce;exports.FloatingToolbar=v_;exports.HR_TRANSFORMER=__;exports.HorizontalRuleNode=Mr;exports.INDENT_CONTENT_COMMAND=Ut;exports.INSERT_CHECK_LIST_COMMAND=bl;exports.INSERT_HORIZONTAL_RULE_COMMAND=Os;exports.INSERT_IMAGE_COMMAND=zv;exports.INSERT_ORDERED_LIST_COMMAND=yi;exports.INSERT_PARAGRAPH_COMMAND=Fn;exports.INSERT_UNORDERED_LIST_COMMAND=_i;exports.KEY_ENTER_COMMAND=Dn;exports.KEY_ESCAPE_COMMAND=ai;exports.KEY_TAB_COMMAND=bs;exports.LexicalEditorInput=y0;exports.LexicalToolbar=C_;exports.OUTDENT_CONTENT_COMMAND=sn;exports.PASTE_COMMAND=si;exports.REDO_COMMAND=li;exports.REMOVE_LIST_COMMAND=pu;exports.SELECTION_CHANGE_COMMAND=ii;exports.SlashCommandPalette=m0;exports.TOGGLE_SLASH_COMMAND_PALETTE=Bv;exports.TextNode=qe;exports.UNDO_COMMAND=oi;exports.applyMark=t0;exports.createCommand=z;exports.createDefaultPluginConfig=wl;exports.createHeadlessEditor=Ms;exports.executeSlashCommand=Pv;exports.exportEditorToFile=Uv;exports.exportToHtml=wt;exports.exportToMarkdown=Ct;exports.getCharacterCount=s0;exports.getMarkdownTransformers=y_;exports.getNodesForPlugins=Cl;exports.getSelectionInfo=i0;exports.getTextContent=Gu;exports.getWordCount=o0;exports.htmlToLexicalJson=u0;exports.importFileToEditor=Kv;exports.importFromHtml=Wn;exports.importFromMarkdown=Kn;exports.insertTable=jv;exports.lexicalJsonToHtml=d0;exports.lexicalJsonToMarkdown=c0;exports.loadLexicalCore=m_;exports.loadOffsetUtils=l0;exports.markdownToLexicalJson=a0;exports.registerAutoLinkPlugin=Qv;exports.registerClipboardPlugin=zl;exports.registerCodePlugin=Hv;exports.registerCodeShikiPlugin=Jv;exports.registerDragonPlugin=Hl;exports.registerHashtagPlugin=Yv;exports.registerHistoryPlugin=Bl;exports.registerHorizontalRulePlugin=Wl;exports.registerLinkPlugin=Kl;exports.registerListPlugin=Ul;exports.registerMarkPlugin=e0;exports.registerOverflowPlugin=r0;exports.registerPlainTextPlugin=Pl;exports.registerRichTextPlugin=Rl;exports.registerSlashCommandsPlugin=Rv;exports.registerTablePlugin=jl;exports.registerYjsPlugin=Jl;exports.removeMark=n0;