@baasix/baasix 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (666) hide show
  1. package/LICENSE.MD +85 -0
  2. package/README.md +526 -0
  3. package/assets/banner.jpg +0 -0
  4. package/assets/banner_small.jpg +0 -0
  5. package/assets/logo_icon.svg +20 -0
  6. package/assets/logo_icon_rounded.svg +20 -0
  7. package/dist/LICENSE.MD +85 -0
  8. package/dist/README.md +526 -0
  9. package/dist/app/404/index.html +1 -0
  10. package/dist/app/404.html +1 -0
  11. package/dist/app/_next/static/chunks/041e1f03-56ae8a902a7f2fe6.js +24 -0
  12. package/dist/app/_next/static/chunks/1117-05479929a8da73e3.js +1 -0
  13. package/dist/app/_next/static/chunks/1299.77cc7b7b76b75cba.js +1 -0
  14. package/dist/app/_next/static/chunks/1303-35a96e9c9cdeab9d.js +1 -0
  15. package/dist/app/_next/static/chunks/1509-56ac00cdaaecdf53.js +1 -0
  16. package/dist/app/_next/static/chunks/1668-e3eabd0f6753c780.js +1 -0
  17. package/dist/app/_next/static/chunks/1783-d9fb550fd324300c.js +1 -0
  18. package/dist/app/_next/static/chunks/2117-29b5fa47421595ad.js +2 -0
  19. package/dist/app/_next/static/chunks/2344.35b46d2179a765b5.js +1 -0
  20. package/dist/app/_next/static/chunks/257.990da16794a31292.js +1 -0
  21. package/dist/app/_next/static/chunks/2676-73b0ee7c80073a84.js +1 -0
  22. package/dist/app/_next/static/chunks/3563-b8842744384391fe.js +1 -0
  23. package/dist/app/_next/static/chunks/363642f4-933b579ed3c85f60.js +1 -0
  24. package/dist/app/_next/static/chunks/3817-e20c8f0a0810fc95.js +1 -0
  25. package/dist/app/_next/static/chunks/3834.84944e390d902509.js +2 -0
  26. package/dist/app/_next/static/chunks/4043-3a30c8a75896f241.js +1 -0
  27. package/dist/app/_next/static/chunks/4225-14090c7c0cd9dec6.js +1 -0
  28. package/dist/app/_next/static/chunks/4438-c9a12ca15b6e9160.js +1 -0
  29. package/dist/app/_next/static/chunks/4458-679fd0c6884f456a.js +1 -0
  30. package/dist/app/_next/static/chunks/4475-8bdfbd536fba8c48.js +1 -0
  31. package/dist/app/_next/static/chunks/4883-8a924721bb21b3b0.js +1 -0
  32. package/dist/app/_next/static/chunks/489-683ab07188f9df2b.js +1 -0
  33. package/dist/app/_next/static/chunks/4952-1b97320cf61f3f21.js +1 -0
  34. package/dist/app/_next/static/chunks/5094-8d53e403235d4ca6.js +1 -0
  35. package/dist/app/_next/static/chunks/5101-3a146e0625747ad1.js +1 -0
  36. package/dist/app/_next/static/chunks/54a60aa6-d9747982e0a81f58.js +79 -0
  37. package/dist/app/_next/static/chunks/5650-f096291df402bfc2.js +1 -0
  38. package/dist/app/_next/static/chunks/600-539045311240f579.js +1 -0
  39. package/dist/app/_next/static/chunks/6170-803b82e19d3ade6d.js +89 -0
  40. package/dist/app/_next/static/chunks/6241-30d7169d1010e5a4.js +1 -0
  41. package/dist/app/_next/static/chunks/6530-a91e10cffa4200c4.js +1 -0
  42. package/dist/app/_next/static/chunks/6547-4bbbdb5c399aef1e.js +1 -0
  43. package/dist/app/_next/static/chunks/6712-781937c53a2c49da.js +1 -0
  44. package/dist/app/_next/static/chunks/6fcbdc68-90be1a5480b8d353.js +1 -0
  45. package/dist/app/_next/static/chunks/70e0d97a-aeaf0cdc26ba1a58.js +1 -0
  46. package/dist/app/_next/static/chunks/7214-5154a89d08d24dde.js +1 -0
  47. package/dist/app/_next/static/chunks/7324-b53229c59a640880.js +10 -0
  48. package/dist/app/_next/static/chunks/7636-66424f0b51d350e9.js +1 -0
  49. package/dist/app/_next/static/chunks/7874-39a3f2541165a675.js +1 -0
  50. package/dist/app/_next/static/chunks/7982-9da12b83f11e3f5f.js +1 -0
  51. package/dist/app/_next/static/chunks/8213a2eb-da25a3b3c5521b2b.js +1 -0
  52. package/dist/app/_next/static/chunks/8473-6598318371eca31b.js +1 -0
  53. package/dist/app/_next/static/chunks/8640fa6b-72e43370f68e5587.js +1 -0
  54. package/dist/app/_next/static/chunks/9090-3ef676f29c95f1c7.js +1 -0
  55. package/dist/app/_next/static/chunks/9124-a02f9e209e6e3cce.js +1 -0
  56. package/dist/app/_next/static/chunks/926-156f32067d111d6b.js +1 -0
  57. package/dist/app/_next/static/chunks/9487-b17481605e513b83.js +1 -0
  58. package/dist/app/_next/static/chunks/9599-a7e572bb88c3392b.js +1 -0
  59. package/dist/app/_next/static/chunks/9881-419697138376e755.js +1 -0
  60. package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/all-activity/page-8917930b4d663405.js +1 -0
  61. package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/email-log/page-b27a6ee32782d7df.js +1 -0
  62. package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/notifications/page-b7eda523ede2702c.js +1 -0
  63. package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/page-1cfa62d1caedaed0.js +1 -0
  64. package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/sessions/page-3e21e20db90aeff7.js +1 -0
  65. package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/workflow-executions/page-27bcc26b747fb29b.js +1 -0
  66. package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/workflow-logs/page-9f9e9e952aef436e.js +1 -0
  67. package/dist/app/_next/static/chunks/app/(authenticated)/change-password/page-8d61aa499eabb127.js +1 -0
  68. package/dist/app/_next/static/chunks/app/(authenticated)/dashboard/page-1ceeac9e72997a8a.js +1 -0
  69. package/dist/app/_next/static/chunks/app/(authenticated)/data-browser/page-8cda2b57759dd670.js +1 -0
  70. package/dist/app/_next/static/chunks/app/(authenticated)/file-manager/page-8c6f1b1da66ad7e4.js +1 -0
  71. package/dist/app/_next/static/chunks/app/(authenticated)/layout-f70d225b2759c998.js +1 -0
  72. package/dist/app/_next/static/chunks/app/(authenticated)/settings/migrations/page-aacec8f7cfb40ab2.js +1 -0
  73. package/dist/app/_next/static/chunks/app/(authenticated)/settings/permissions/page-828110cfcde429c6.js +1 -0
  74. package/dist/app/_next/static/chunks/app/(authenticated)/settings/project/page-420e794bb76bd204.js +1 -0
  75. package/dist/app/_next/static/chunks/app/(authenticated)/settings/roles/page-9001d02b28f70708.js +1 -0
  76. package/dist/app/_next/static/chunks/app/(authenticated)/settings/schema/page-899574f35091dd58.js +1 -0
  77. package/dist/app/_next/static/chunks/app/(authenticated)/settings/tasks/page-ad7ab3e27c83f44f.js +1 -0
  78. package/dist/app/_next/static/chunks/app/(authenticated)/settings/templates/edit/page-bd83414cb8c4cb04.js +1 -0
  79. package/dist/app/_next/static/chunks/app/(authenticated)/settings/templates/page-3181447f8772b1d3.js +1 -0
  80. package/dist/app/_next/static/chunks/app/(authenticated)/settings/tenants/page-ef9bfbacef5a1d73.js +1 -0
  81. package/dist/app/_next/static/chunks/app/(authenticated)/users/invites/page-480306b7b2bbac7e.js +1 -0
  82. package/dist/app/_next/static/chunks/app/(authenticated)/users/list/page-74da51254c2606b3.js +1 -0
  83. package/dist/app/_next/static/chunks/app/(authenticated)/users/page-e99c6f0b915001b2.js +1 -0
  84. package/dist/app/_next/static/chunks/app/(authenticated)/users/preferences/page-1a935630ce8f2b12.js +1 -0
  85. package/dist/app/_next/static/chunks/app/(authenticated)/users/user-roles/page-901dfb8ea1f39ca8.js +1 -0
  86. package/dist/app/_next/static/chunks/app/(authenticated)/workflows/detail/page-9a6b839aea688ca4.js +1 -0
  87. package/dist/app/_next/static/chunks/app/(authenticated)/workflows/edit/page-11774efbc2fecae2.js +1 -0
  88. package/dist/app/_next/static/chunks/app/(authenticated)/workflows/execution/page-8ec1aea90412c03d.js +1 -0
  89. package/dist/app/_next/static/chunks/app/(authenticated)/workflows/page-88bc5b36ccb0a1f7.js +1 -0
  90. package/dist/app/_next/static/chunks/app/(public)/forgot-password/page-ed263fd46ef81c20.js +1 -0
  91. package/dist/app/_next/static/chunks/app/(public)/layout-f538977545844af8.js +1 -0
  92. package/dist/app/_next/static/chunks/app/(public)/login/page-c0a10b137f346096.js +1 -0
  93. package/dist/app/_next/static/chunks/app/(public)/register/page-4cb7644893efd9b3.js +1 -0
  94. package/dist/app/_next/static/chunks/app/_not-found/page-653f8815b78256cc.js +1 -0
  95. package/dist/app/_next/static/chunks/app/layout-591ca7a3e16528a1.js +1 -0
  96. package/dist/app/_next/static/chunks/app/page-dd19d124b5fa2577.js +1 -0
  97. package/dist/app/_next/static/chunks/c37d3baf.c2ff165f5b02c692.js +1 -0
  98. package/dist/app/_next/static/chunks/d0deef33.0379166a4ec23470.js +1 -0
  99. package/dist/app/_next/static/chunks/fd9d1056-54169f07cd680d6c.js +1 -0
  100. package/dist/app/_next/static/chunks/framework-8e0e0f4a6b83a956.js +1 -0
  101. package/dist/app/_next/static/chunks/main-324e91f5a430cddf.js +1 -0
  102. package/dist/app/_next/static/chunks/main-app-55bcae20c77aaf0e.js +1 -0
  103. package/dist/app/_next/static/chunks/pages/_app-3c9ca398d360b709.js +1 -0
  104. package/dist/app/_next/static/chunks/pages/_error-cf5ca766ac8f493f.js +1 -0
  105. package/dist/app/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
  106. package/dist/app/_next/static/chunks/webpack-2c306566f7ee1b63.js +1 -0
  107. package/dist/app/_next/static/css/6c4002bae4e236b2.css +3 -0
  108. package/dist/app/_next/static/css/a275cc2b185e04f8.css +1 -0
  109. package/dist/app/_next/static/eCWhKA8XHqmB1zgFcEtN2/_buildManifest.js +1 -0
  110. package/dist/app/_next/static/eCWhKA8XHqmB1zgFcEtN2/_ssgManifest.js +1 -0
  111. package/dist/app/activity-log/all-activity/index.html +1 -0
  112. package/dist/app/activity-log/all-activity/index.txt +14 -0
  113. package/dist/app/activity-log/email-log/index.html +1 -0
  114. package/dist/app/activity-log/email-log/index.txt +14 -0
  115. package/dist/app/activity-log/index.html +1 -0
  116. package/dist/app/activity-log/index.txt +14 -0
  117. package/dist/app/activity-log/notifications/index.html +1 -0
  118. package/dist/app/activity-log/notifications/index.txt +14 -0
  119. package/dist/app/activity-log/sessions/index.html +1 -0
  120. package/dist/app/activity-log/sessions/index.txt +14 -0
  121. package/dist/app/activity-log/workflow-executions/index.html +1 -0
  122. package/dist/app/activity-log/workflow-executions/index.txt +14 -0
  123. package/dist/app/activity-log/workflow-logs/index.html +1 -0
  124. package/dist/app/activity-log/workflow-logs/index.txt +14 -0
  125. package/dist/app/change-password/index.html +1 -0
  126. package/dist/app/change-password/index.txt +14 -0
  127. package/dist/app/dashboard/index.html +1 -0
  128. package/dist/app/dashboard/index.txt +14 -0
  129. package/dist/app/data-browser/index.html +1 -0
  130. package/dist/app/data-browser/index.txt +14 -0
  131. package/dist/app/file-manager/index.html +1 -0
  132. package/dist/app/file-manager/index.txt +14 -0
  133. package/dist/app/forgot-password/index.html +1 -0
  134. package/dist/app/forgot-password/index.txt +13 -0
  135. package/dist/app/index.html +1 -0
  136. package/dist/app/index.txt +9 -0
  137. package/dist/app/login/index.html +1 -0
  138. package/dist/app/login/index.txt +13 -0
  139. package/dist/app/logo-dark.png +0 -0
  140. package/dist/app/logo-icon.svg +81 -0
  141. package/dist/app/logo-light.png +0 -0
  142. package/dist/app/register/index.html +1 -0
  143. package/dist/app/register/index.txt +13 -0
  144. package/dist/app/settings/migrations/index.html +1 -0
  145. package/dist/app/settings/migrations/index.txt +14 -0
  146. package/dist/app/settings/permissions/index.html +1 -0
  147. package/dist/app/settings/permissions/index.txt +14 -0
  148. package/dist/app/settings/project/index.html +1 -0
  149. package/dist/app/settings/project/index.txt +14 -0
  150. package/dist/app/settings/roles/index.html +1 -0
  151. package/dist/app/settings/roles/index.txt +14 -0
  152. package/dist/app/settings/schema/index.html +1 -0
  153. package/dist/app/settings/schema/index.txt +14 -0
  154. package/dist/app/settings/tasks/index.html +1 -0
  155. package/dist/app/settings/tasks/index.txt +14 -0
  156. package/dist/app/settings/templates/edit/index.html +1 -0
  157. package/dist/app/settings/templates/edit/index.txt +14 -0
  158. package/dist/app/settings/templates/index.html +1 -0
  159. package/dist/app/settings/templates/index.txt +14 -0
  160. package/dist/app/settings/tenants/index.html +1 -0
  161. package/dist/app/settings/tenants/index.txt +14 -0
  162. package/dist/app/users/index.html +1 -0
  163. package/dist/app/users/index.txt +14 -0
  164. package/dist/app/users/invites/index.html +1 -0
  165. package/dist/app/users/invites/index.txt +14 -0
  166. package/dist/app/users/list/index.html +1 -0
  167. package/dist/app/users/list/index.txt +14 -0
  168. package/dist/app/users/preferences/index.html +1 -0
  169. package/dist/app/users/preferences/index.txt +14 -0
  170. package/dist/app/users/user-roles/index.html +1 -0
  171. package/dist/app/users/user-roles/index.txt +14 -0
  172. package/dist/app/workflows/detail/index.html +1 -0
  173. package/dist/app/workflows/detail/index.txt +14 -0
  174. package/dist/app/workflows/edit/index.html +1 -0
  175. package/dist/app/workflows/edit/index.txt +14 -0
  176. package/dist/app/workflows/execution/index.html +1 -0
  177. package/dist/app/workflows/execution/index.txt +14 -0
  178. package/dist/app/workflows/index.html +1 -0
  179. package/dist/app/workflows/index.txt +14 -0
  180. package/dist/app.d.ts +36 -0
  181. package/dist/app.d.ts.map +1 -0
  182. package/dist/app.js +546 -0
  183. package/dist/app.js.map +1 -0
  184. package/dist/auth/adapters/baasix-adapter.d.ts +12 -0
  185. package/dist/auth/adapters/baasix-adapter.d.ts.map +1 -0
  186. package/dist/auth/adapters/baasix-adapter.js +318 -0
  187. package/dist/auth/adapters/baasix-adapter.js.map +1 -0
  188. package/dist/auth/adapters/index.d.ts +6 -0
  189. package/dist/auth/adapters/index.d.ts.map +1 -0
  190. package/dist/auth/adapters/index.js +5 -0
  191. package/dist/auth/adapters/index.js.map +1 -0
  192. package/dist/auth/core.d.ts +73 -0
  193. package/dist/auth/core.d.ts.map +1 -0
  194. package/dist/auth/core.js +528 -0
  195. package/dist/auth/core.js.map +1 -0
  196. package/dist/auth/index.d.ts +56 -0
  197. package/dist/auth/index.d.ts.map +1 -0
  198. package/dist/auth/index.js +58 -0
  199. package/dist/auth/index.js.map +1 -0
  200. package/dist/auth/oauth2/index.d.ts +5 -0
  201. package/dist/auth/oauth2/index.d.ts.map +1 -0
  202. package/dist/auth/oauth2/index.js +5 -0
  203. package/dist/auth/oauth2/index.js.map +1 -0
  204. package/dist/auth/oauth2/utils.d.ts +90 -0
  205. package/dist/auth/oauth2/utils.d.ts.map +1 -0
  206. package/dist/auth/oauth2/utils.js +167 -0
  207. package/dist/auth/oauth2/utils.js.map +1 -0
  208. package/dist/auth/providers/apple.d.ts +28 -0
  209. package/dist/auth/providers/apple.d.ts.map +1 -0
  210. package/dist/auth/providers/apple.js +192 -0
  211. package/dist/auth/providers/apple.js.map +1 -0
  212. package/dist/auth/providers/credential.d.ts +87 -0
  213. package/dist/auth/providers/credential.d.ts.map +1 -0
  214. package/dist/auth/providers/credential.js +162 -0
  215. package/dist/auth/providers/credential.js.map +1 -0
  216. package/dist/auth/providers/facebook.d.ts +26 -0
  217. package/dist/auth/providers/facebook.d.ts.map +1 -0
  218. package/dist/auth/providers/facebook.js +112 -0
  219. package/dist/auth/providers/facebook.js.map +1 -0
  220. package/dist/auth/providers/github.d.ts +29 -0
  221. package/dist/auth/providers/github.d.ts.map +1 -0
  222. package/dist/auth/providers/github.js +144 -0
  223. package/dist/auth/providers/github.js.map +1 -0
  224. package/dist/auth/providers/google.d.ts +32 -0
  225. package/dist/auth/providers/google.d.ts.map +1 -0
  226. package/dist/auth/providers/google.js +145 -0
  227. package/dist/auth/providers/google.js.map +1 -0
  228. package/dist/auth/providers/index.d.ts +22 -0
  229. package/dist/auth/providers/index.d.ts.map +1 -0
  230. package/dist/auth/providers/index.js +17 -0
  231. package/dist/auth/providers/index.js.map +1 -0
  232. package/dist/auth/routes.d.ts +63 -0
  233. package/dist/auth/routes.d.ts.map +1 -0
  234. package/dist/auth/routes.js +827 -0
  235. package/dist/auth/routes.js.map +1 -0
  236. package/dist/auth/services/index.d.ts +10 -0
  237. package/dist/auth/services/index.d.ts.map +1 -0
  238. package/dist/auth/services/index.js +7 -0
  239. package/dist/auth/services/index.js.map +1 -0
  240. package/dist/auth/services/session.d.ts +81 -0
  241. package/dist/auth/services/session.d.ts.map +1 -0
  242. package/dist/auth/services/session.js +186 -0
  243. package/dist/auth/services/session.js.map +1 -0
  244. package/dist/auth/services/token.d.ts +41 -0
  245. package/dist/auth/services/token.d.ts.map +1 -0
  246. package/dist/auth/services/token.js +44 -0
  247. package/dist/auth/services/token.js.map +1 -0
  248. package/dist/auth/services/verification.d.ts +77 -0
  249. package/dist/auth/services/verification.d.ts.map +1 -0
  250. package/dist/auth/services/verification.js +143 -0
  251. package/dist/auth/services/verification.js.map +1 -0
  252. package/dist/auth/types.d.ts +318 -0
  253. package/dist/auth/types.d.ts.map +1 -0
  254. package/dist/auth/types.js +6 -0
  255. package/dist/auth/types.js.map +1 -0
  256. package/dist/customTypes/arrays.d.ts +200 -0
  257. package/dist/customTypes/arrays.d.ts.map +1 -0
  258. package/dist/customTypes/arrays.js +309 -0
  259. package/dist/customTypes/arrays.js.map +1 -0
  260. package/dist/customTypes/index.d.ts +8 -0
  261. package/dist/customTypes/index.d.ts.map +1 -0
  262. package/dist/customTypes/index.js +11 -0
  263. package/dist/customTypes/index.js.map +1 -0
  264. package/dist/customTypes/postgis.d.ts +146 -0
  265. package/dist/customTypes/postgis.d.ts.map +1 -0
  266. package/dist/customTypes/postgis.js +315 -0
  267. package/dist/customTypes/postgis.js.map +1 -0
  268. package/dist/customTypes/ranges.d.ts +128 -0
  269. package/dist/customTypes/ranges.d.ts.map +1 -0
  270. package/dist/customTypes/ranges.js +257 -0
  271. package/dist/customTypes/ranges.js.map +1 -0
  272. package/dist/index.d.ts +37 -0
  273. package/dist/index.d.ts.map +1 -0
  274. package/dist/index.js +42 -0
  275. package/dist/index.js.map +1 -0
  276. package/dist/migrations/0.1.0-alpha.0_initial_setup.d.ts +29 -0
  277. package/dist/migrations/0.1.0-alpha.0_initial_setup.d.ts.map +1 -0
  278. package/dist/migrations/0.1.0-alpha.0_initial_setup.js +72 -0
  279. package/dist/migrations/0.1.0-alpha.0_initial_setup.js.map +1 -0
  280. package/dist/migrations/_example_migration.d.ts +31 -0
  281. package/dist/migrations/_example_migration.d.ts.map +1 -0
  282. package/dist/migrations/_example_migration.js +75 -0
  283. package/dist/migrations/_example_migration.js.map +1 -0
  284. package/dist/plugins/definePlugin.d.ts +49 -0
  285. package/dist/plugins/definePlugin.d.ts.map +1 -0
  286. package/dist/plugins/definePlugin.js +131 -0
  287. package/dist/plugins/definePlugin.js.map +1 -0
  288. package/dist/plugins/softDelete.d.ts +179 -0
  289. package/dist/plugins/softDelete.d.ts.map +1 -0
  290. package/dist/plugins/softDelete.js +235 -0
  291. package/dist/plugins/softDelete.js.map +1 -0
  292. package/dist/routes/auth.route.d.ts +14 -0
  293. package/dist/routes/auth.route.d.ts.map +1 -0
  294. package/dist/routes/auth.route.js +421 -0
  295. package/dist/routes/auth.route.js.map +1 -0
  296. package/dist/routes/file.route.d.ts +7 -0
  297. package/dist/routes/file.route.d.ts.map +1 -0
  298. package/dist/routes/file.route.js +274 -0
  299. package/dist/routes/file.route.js.map +1 -0
  300. package/dist/routes/items.route.d.ts +7 -0
  301. package/dist/routes/items.route.d.ts.map +1 -0
  302. package/dist/routes/items.route.js +369 -0
  303. package/dist/routes/items.route.js.map +1 -0
  304. package/dist/routes/migration.route.d.ts +7 -0
  305. package/dist/routes/migration.route.d.ts.map +1 -0
  306. package/dist/routes/migration.route.js +225 -0
  307. package/dist/routes/migration.route.js.map +1 -0
  308. package/dist/routes/notification.route.d.ts +7 -0
  309. package/dist/routes/notification.route.d.ts.map +1 -0
  310. package/dist/routes/notification.route.js +124 -0
  311. package/dist/routes/notification.route.js.map +1 -0
  312. package/dist/routes/openapi.route.d.ts +7 -0
  313. package/dist/routes/openapi.route.d.ts.map +1 -0
  314. package/dist/routes/openapi.route.js +2169 -0
  315. package/dist/routes/openapi.route.js.map +1 -0
  316. package/dist/routes/permission.route.d.ts +7 -0
  317. package/dist/routes/permission.route.d.ts.map +1 -0
  318. package/dist/routes/permission.route.js +158 -0
  319. package/dist/routes/permission.route.js.map +1 -0
  320. package/dist/routes/realtime.route.d.ts +21 -0
  321. package/dist/routes/realtime.route.d.ts.map +1 -0
  322. package/dist/routes/realtime.route.js +243 -0
  323. package/dist/routes/realtime.route.js.map +1 -0
  324. package/dist/routes/reports.route.d.ts +7 -0
  325. package/dist/routes/reports.route.d.ts.map +1 -0
  326. package/dist/routes/reports.route.js +95 -0
  327. package/dist/routes/reports.route.js.map +1 -0
  328. package/dist/routes/schema.route.d.ts +7 -0
  329. package/dist/routes/schema.route.d.ts.map +1 -0
  330. package/dist/routes/schema.route.js +1780 -0
  331. package/dist/routes/schema.route.js.map +1 -0
  332. package/dist/routes/settings.route.d.ts +7 -0
  333. package/dist/routes/settings.route.d.ts.map +1 -0
  334. package/dist/routes/settings.route.js +154 -0
  335. package/dist/routes/settings.route.js.map +1 -0
  336. package/dist/routes/templates.route.d.ts +7 -0
  337. package/dist/routes/templates.route.d.ts.map +1 -0
  338. package/dist/routes/templates.route.js +91 -0
  339. package/dist/routes/templates.route.js.map +1 -0
  340. package/dist/routes/utils.route.d.ts +7 -0
  341. package/dist/routes/utils.route.d.ts.map +1 -0
  342. package/dist/routes/utils.route.js +33 -0
  343. package/dist/routes/utils.route.js.map +1 -0
  344. package/dist/routes/workflow.route.d.ts +7 -0
  345. package/dist/routes/workflow.route.d.ts.map +1 -0
  346. package/dist/routes/workflow.route.js +787 -0
  347. package/dist/routes/workflow.route.js.map +1 -0
  348. package/dist/services/AssetsService.d.ts +39 -0
  349. package/dist/services/AssetsService.d.ts.map +1 -0
  350. package/dist/services/AssetsService.js +255 -0
  351. package/dist/services/AssetsService.js.map +1 -0
  352. package/dist/services/CacheService.d.ts +169 -0
  353. package/dist/services/CacheService.d.ts.map +1 -0
  354. package/dist/services/CacheService.js +722 -0
  355. package/dist/services/CacheService.js.map +1 -0
  356. package/dist/services/FilesService.d.ts +30 -0
  357. package/dist/services/FilesService.d.ts.map +1 -0
  358. package/dist/services/FilesService.js +268 -0
  359. package/dist/services/FilesService.js.map +1 -0
  360. package/dist/services/HooksManager.d.ts +38 -0
  361. package/dist/services/HooksManager.d.ts.map +1 -0
  362. package/dist/services/HooksManager.js +165 -0
  363. package/dist/services/HooksManager.js.map +1 -0
  364. package/dist/services/ItemsService.d.ts +273 -0
  365. package/dist/services/ItemsService.d.ts.map +1 -0
  366. package/dist/services/ItemsService.js +2458 -0
  367. package/dist/services/ItemsService.js.map +1 -0
  368. package/dist/services/MailService.d.ts +76 -0
  369. package/dist/services/MailService.d.ts.map +1 -0
  370. package/dist/services/MailService.js +585 -0
  371. package/dist/services/MailService.js.map +1 -0
  372. package/dist/services/MigrationService.d.ts +243 -0
  373. package/dist/services/MigrationService.d.ts.map +1 -0
  374. package/dist/services/MigrationService.js +914 -0
  375. package/dist/services/MigrationService.js.map +1 -0
  376. package/dist/services/NotificationService.d.ts +35 -0
  377. package/dist/services/NotificationService.d.ts.map +1 -0
  378. package/dist/services/NotificationService.js +159 -0
  379. package/dist/services/NotificationService.js.map +1 -0
  380. package/dist/services/PermissionService.d.ts +128 -0
  381. package/dist/services/PermissionService.d.ts.map +1 -0
  382. package/dist/services/PermissionService.js +373 -0
  383. package/dist/services/PermissionService.js.map +1 -0
  384. package/dist/services/PluginManager.d.ts +138 -0
  385. package/dist/services/PluginManager.d.ts.map +1 -0
  386. package/dist/services/PluginManager.js +463 -0
  387. package/dist/services/PluginManager.js.map +1 -0
  388. package/dist/services/RealtimeService.d.ts +209 -0
  389. package/dist/services/RealtimeService.d.ts.map +1 -0
  390. package/dist/services/RealtimeService.js +978 -0
  391. package/dist/services/RealtimeService.js.map +1 -0
  392. package/dist/services/ReportService.d.ts +13 -0
  393. package/dist/services/ReportService.d.ts.map +1 -0
  394. package/dist/services/ReportService.js +91 -0
  395. package/dist/services/ReportService.js.map +1 -0
  396. package/dist/services/SettingsService.d.ts +60 -0
  397. package/dist/services/SettingsService.d.ts.map +1 -0
  398. package/dist/services/SettingsService.js +474 -0
  399. package/dist/services/SettingsService.js.map +1 -0
  400. package/dist/services/SocketService.d.ts +129 -0
  401. package/dist/services/SocketService.d.ts.map +1 -0
  402. package/dist/services/SocketService.js +600 -0
  403. package/dist/services/SocketService.js.map +1 -0
  404. package/dist/services/StatsService.d.ts +10 -0
  405. package/dist/services/StatsService.d.ts.map +1 -0
  406. package/dist/services/StatsService.js +40 -0
  407. package/dist/services/StatsService.js.map +1 -0
  408. package/dist/services/StorageService.d.ts +20 -0
  409. package/dist/services/StorageService.d.ts.map +1 -0
  410. package/dist/services/StorageService.js +164 -0
  411. package/dist/services/StorageService.js.map +1 -0
  412. package/dist/services/TasksService.d.ts +74 -0
  413. package/dist/services/TasksService.d.ts.map +1 -0
  414. package/dist/services/TasksService.js +404 -0
  415. package/dist/services/TasksService.js.map +1 -0
  416. package/dist/services/WorkflowService.d.ts +305 -0
  417. package/dist/services/WorkflowService.d.ts.map +1 -0
  418. package/dist/services/WorkflowService.js +1811 -0
  419. package/dist/services/WorkflowService.js.map +1 -0
  420. package/dist/templates/logo/logo.png +0 -0
  421. package/dist/templates/mails/default.liquid +23 -0
  422. package/dist/types/aggregation.d.ts +40 -0
  423. package/dist/types/aggregation.d.ts.map +1 -0
  424. package/dist/types/aggregation.js +6 -0
  425. package/dist/types/aggregation.js.map +1 -0
  426. package/dist/types/assets.d.ts +32 -0
  427. package/dist/types/assets.d.ts.map +1 -0
  428. package/dist/types/assets.js +6 -0
  429. package/dist/types/assets.js.map +1 -0
  430. package/dist/types/auth.d.ts +50 -0
  431. package/dist/types/auth.d.ts.map +1 -0
  432. package/dist/types/auth.js +6 -0
  433. package/dist/types/auth.js.map +1 -0
  434. package/dist/types/cache.d.ts +47 -0
  435. package/dist/types/cache.d.ts.map +1 -0
  436. package/dist/types/cache.js +6 -0
  437. package/dist/types/cache.js.map +1 -0
  438. package/dist/types/database.d.ts +16 -0
  439. package/dist/types/database.d.ts.map +1 -0
  440. package/dist/types/database.js +6 -0
  441. package/dist/types/database.js.map +1 -0
  442. package/dist/types/fields.d.ts +71 -0
  443. package/dist/types/fields.d.ts.map +1 -0
  444. package/dist/types/fields.js +6 -0
  445. package/dist/types/fields.js.map +1 -0
  446. package/dist/types/files.d.ts +33 -0
  447. package/dist/types/files.d.ts.map +1 -0
  448. package/dist/types/files.js +6 -0
  449. package/dist/types/files.js.map +1 -0
  450. package/dist/types/hooks.d.ts +29 -0
  451. package/dist/types/hooks.d.ts.map +1 -0
  452. package/dist/types/hooks.js +6 -0
  453. package/dist/types/hooks.js.map +1 -0
  454. package/dist/types/import-export.d.ts +62 -0
  455. package/dist/types/import-export.d.ts.map +1 -0
  456. package/dist/types/import-export.js +6 -0
  457. package/dist/types/import-export.js.map +1 -0
  458. package/dist/types/index.d.ts +31 -0
  459. package/dist/types/index.d.ts.map +1 -0
  460. package/dist/types/index.js +58 -0
  461. package/dist/types/index.js.map +1 -0
  462. package/dist/types/mail.d.ts +34 -0
  463. package/dist/types/mail.d.ts.map +1 -0
  464. package/dist/types/mail.js +6 -0
  465. package/dist/types/mail.js.map +1 -0
  466. package/dist/types/notifications.d.ts +16 -0
  467. package/dist/types/notifications.d.ts.map +1 -0
  468. package/dist/types/notifications.js +6 -0
  469. package/dist/types/notifications.js.map +1 -0
  470. package/dist/types/plugin.d.ts +351 -0
  471. package/dist/types/plugin.d.ts.map +1 -0
  472. package/dist/types/plugin.js +8 -0
  473. package/dist/types/plugin.js.map +1 -0
  474. package/dist/types/query.d.ts +71 -0
  475. package/dist/types/query.d.ts.map +1 -0
  476. package/dist/types/query.js +6 -0
  477. package/dist/types/query.js.map +1 -0
  478. package/dist/types/relations.d.ts +111 -0
  479. package/dist/types/relations.d.ts.map +1 -0
  480. package/dist/types/relations.js +6 -0
  481. package/dist/types/relations.js.map +1 -0
  482. package/dist/types/reports.d.ts +17 -0
  483. package/dist/types/reports.d.ts.map +1 -0
  484. package/dist/types/reports.js +6 -0
  485. package/dist/types/reports.js.map +1 -0
  486. package/dist/types/schema.d.ts +26 -0
  487. package/dist/types/schema.d.ts.map +1 -0
  488. package/dist/types/schema.js +6 -0
  489. package/dist/types/schema.js.map +1 -0
  490. package/dist/types/seed.d.ts +27 -0
  491. package/dist/types/seed.d.ts.map +1 -0
  492. package/dist/types/seed.js +6 -0
  493. package/dist/types/seed.js.map +1 -0
  494. package/dist/types/services.d.ts +68 -0
  495. package/dist/types/services.d.ts.map +1 -0
  496. package/dist/types/services.js +6 -0
  497. package/dist/types/services.js.map +1 -0
  498. package/dist/types/settings.d.ts +36 -0
  499. package/dist/types/settings.d.ts.map +1 -0
  500. package/dist/types/settings.js +6 -0
  501. package/dist/types/settings.js.map +1 -0
  502. package/dist/types/sockets.d.ts +26 -0
  503. package/dist/types/sockets.d.ts.map +1 -0
  504. package/dist/types/sockets.js +6 -0
  505. package/dist/types/sockets.js.map +1 -0
  506. package/dist/types/sort.d.ts +25 -0
  507. package/dist/types/sort.d.ts.map +1 -0
  508. package/dist/types/sort.js +6 -0
  509. package/dist/types/sort.js.map +1 -0
  510. package/dist/types/spatial.d.ts +19 -0
  511. package/dist/types/spatial.d.ts.map +1 -0
  512. package/dist/types/spatial.js +6 -0
  513. package/dist/types/spatial.js.map +1 -0
  514. package/dist/types/stats.d.ts +21 -0
  515. package/dist/types/stats.d.ts.map +1 -0
  516. package/dist/types/stats.js +6 -0
  517. package/dist/types/stats.js.map +1 -0
  518. package/dist/types/storage.d.ts +19 -0
  519. package/dist/types/storage.d.ts.map +1 -0
  520. package/dist/types/storage.js +6 -0
  521. package/dist/types/storage.js.map +1 -0
  522. package/dist/types/tasks.d.ts +14 -0
  523. package/dist/types/tasks.d.ts.map +1 -0
  524. package/dist/types/tasks.js +6 -0
  525. package/dist/types/tasks.js.map +1 -0
  526. package/dist/types/utils.d.ts +54 -0
  527. package/dist/types/utils.d.ts.map +1 -0
  528. package/dist/types/utils.js +6 -0
  529. package/dist/types/utils.js.map +1 -0
  530. package/dist/types/workflow.d.ts +17 -0
  531. package/dist/types/workflow.d.ts.map +1 -0
  532. package/dist/types/workflow.js +6 -0
  533. package/dist/types/workflow.js.map +1 -0
  534. package/dist/utils/aggregationUtils.d.ts +192 -0
  535. package/dist/utils/aggregationUtils.d.ts.map +1 -0
  536. package/dist/utils/aggregationUtils.js +450 -0
  537. package/dist/utils/aggregationUtils.js.map +1 -0
  538. package/dist/utils/auth.d.ts +93 -0
  539. package/dist/utils/auth.d.ts.map +1 -0
  540. package/dist/utils/auth.js +557 -0
  541. package/dist/utils/auth.js.map +1 -0
  542. package/dist/utils/cache.d.ts +64 -0
  543. package/dist/utils/cache.d.ts.map +1 -0
  544. package/dist/utils/cache.js +464 -0
  545. package/dist/utils/cache.js.map +1 -0
  546. package/dist/utils/common.d.ts +53 -0
  547. package/dist/utils/common.d.ts.map +1 -0
  548. package/dist/utils/common.js +162 -0
  549. package/dist/utils/common.js.map +1 -0
  550. package/dist/utils/db.d.ts +101 -0
  551. package/dist/utils/db.d.ts.map +1 -0
  552. package/dist/utils/db.js +413 -0
  553. package/dist/utils/db.js.map +1 -0
  554. package/dist/utils/dirname.d.ts +30 -0
  555. package/dist/utils/dirname.d.ts.map +1 -0
  556. package/dist/utils/dirname.js +95 -0
  557. package/dist/utils/dirname.js.map +1 -0
  558. package/dist/utils/dynamicVariableResolver.d.ts +17 -0
  559. package/dist/utils/dynamicVariableResolver.d.ts.map +1 -0
  560. package/dist/utils/dynamicVariableResolver.js +262 -0
  561. package/dist/utils/dynamicVariableResolver.js.map +1 -0
  562. package/dist/utils/env.d.ts +38 -0
  563. package/dist/utils/env.d.ts.map +1 -0
  564. package/dist/utils/env.js +80 -0
  565. package/dist/utils/env.js.map +1 -0
  566. package/dist/utils/errorHandler.d.ts +14 -0
  567. package/dist/utils/errorHandler.d.ts.map +1 -0
  568. package/dist/utils/errorHandler.js +79 -0
  569. package/dist/utils/errorHandler.js.map +1 -0
  570. package/dist/utils/fieldExpansion.d.ts +30 -0
  571. package/dist/utils/fieldExpansion.d.ts.map +1 -0
  572. package/dist/utils/fieldExpansion.js +145 -0
  573. package/dist/utils/fieldExpansion.js.map +1 -0
  574. package/dist/utils/fieldUtils.d.ts +179 -0
  575. package/dist/utils/fieldUtils.d.ts.map +1 -0
  576. package/dist/utils/fieldUtils.js +424 -0
  577. package/dist/utils/fieldUtils.js.map +1 -0
  578. package/dist/utils/filterOperators.d.ts +472 -0
  579. package/dist/utils/filterOperators.d.ts.map +1 -0
  580. package/dist/utils/filterOperators.js +1229 -0
  581. package/dist/utils/filterOperators.js.map +1 -0
  582. package/dist/utils/importUtils.d.ts +127 -0
  583. package/dist/utils/importUtils.d.ts.map +1 -0
  584. package/dist/utils/importUtils.js +437 -0
  585. package/dist/utils/importUtils.js.map +1 -0
  586. package/dist/utils/index.d.ts +75 -0
  587. package/dist/utils/index.d.ts.map +1 -0
  588. package/dist/utils/index.js +101 -0
  589. package/dist/utils/index.js.map +1 -0
  590. package/dist/utils/logger.d.ts +41 -0
  591. package/dist/utils/logger.d.ts.map +1 -0
  592. package/dist/utils/logger.js +217 -0
  593. package/dist/utils/logger.js.map +1 -0
  594. package/dist/utils/orderUtils.d.ts +117 -0
  595. package/dist/utils/orderUtils.d.ts.map +1 -0
  596. package/dist/utils/orderUtils.js +249 -0
  597. package/dist/utils/orderUtils.js.map +1 -0
  598. package/dist/utils/queryBuilder.d.ts +118 -0
  599. package/dist/utils/queryBuilder.d.ts.map +1 -0
  600. package/dist/utils/queryBuilder.js +489 -0
  601. package/dist/utils/queryBuilder.js.map +1 -0
  602. package/dist/utils/relationLoader.d.ts +65 -0
  603. package/dist/utils/relationLoader.d.ts.map +1 -0
  604. package/dist/utils/relationLoader.js +1081 -0
  605. package/dist/utils/relationLoader.js.map +1 -0
  606. package/dist/utils/relationPathResolver.d.ts +30 -0
  607. package/dist/utils/relationPathResolver.d.ts.map +1 -0
  608. package/dist/utils/relationPathResolver.js +173 -0
  609. package/dist/utils/relationPathResolver.js.map +1 -0
  610. package/dist/utils/relationUtils.d.ts +139 -0
  611. package/dist/utils/relationUtils.d.ts.map +1 -0
  612. package/dist/utils/relationUtils.js +711 -0
  613. package/dist/utils/relationUtils.js.map +1 -0
  614. package/dist/utils/router.d.ts +6 -0
  615. package/dist/utils/router.d.ts.map +1 -0
  616. package/dist/utils/router.js +95 -0
  617. package/dist/utils/router.js.map +1 -0
  618. package/dist/utils/schema.d.ts +88 -0
  619. package/dist/utils/schema.d.ts.map +1 -0
  620. package/dist/utils/schema.js +24 -0
  621. package/dist/utils/schema.js.map +1 -0
  622. package/dist/utils/schemaManager.d.ts +238 -0
  623. package/dist/utils/schemaManager.d.ts.map +1 -0
  624. package/dist/utils/schemaManager.js +1992 -0
  625. package/dist/utils/schemaManager.js.map +1 -0
  626. package/dist/utils/schemaValidator.d.ts +83 -0
  627. package/dist/utils/schemaValidator.d.ts.map +1 -0
  628. package/dist/utils/schemaValidator.js +491 -0
  629. package/dist/utils/schemaValidator.js.map +1 -0
  630. package/dist/utils/seed.d.ts +45 -0
  631. package/dist/utils/seed.d.ts.map +1 -0
  632. package/dist/utils/seed.js +248 -0
  633. package/dist/utils/seed.js.map +1 -0
  634. package/dist/utils/sessionCleanup.d.ts +10 -0
  635. package/dist/utils/sessionCleanup.d.ts.map +1 -0
  636. package/dist/utils/sessionCleanup.js +49 -0
  637. package/dist/utils/sessionCleanup.js.map +1 -0
  638. package/dist/utils/sortUtils.d.ts +117 -0
  639. package/dist/utils/sortUtils.d.ts.map +1 -0
  640. package/dist/utils/sortUtils.js +232 -0
  641. package/dist/utils/sortUtils.js.map +1 -0
  642. package/dist/utils/spatialUtils.d.ts +244 -0
  643. package/dist/utils/spatialUtils.d.ts.map +1 -0
  644. package/dist/utils/spatialUtils.js +359 -0
  645. package/dist/utils/spatialUtils.js.map +1 -0
  646. package/dist/utils/systemschema.d.ts +11040 -0
  647. package/dist/utils/systemschema.d.ts.map +1 -0
  648. package/dist/utils/systemschema.js +1777 -0
  649. package/dist/utils/systemschema.js.map +1 -0
  650. package/dist/utils/tenantUtils.d.ts +34 -0
  651. package/dist/utils/tenantUtils.d.ts.map +1 -0
  652. package/dist/utils/tenantUtils.js +124 -0
  653. package/dist/utils/tenantUtils.js.map +1 -0
  654. package/dist/utils/typeMapper.d.ts +25 -0
  655. package/dist/utils/typeMapper.d.ts.map +1 -0
  656. package/dist/utils/typeMapper.js +282 -0
  657. package/dist/utils/typeMapper.js.map +1 -0
  658. package/dist/utils/valueValidator.d.ts +60 -0
  659. package/dist/utils/valueValidator.d.ts.map +1 -0
  660. package/dist/utils/valueValidator.js +303 -0
  661. package/dist/utils/valueValidator.js.map +1 -0
  662. package/dist/utils/workflow.d.ts +87 -0
  663. package/dist/utils/workflow.d.ts.map +1 -0
  664. package/dist/utils/workflow.js +205 -0
  665. package/dist/utils/workflow.js.map +1 -0
  666. package/package.json +115 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3572],{79006:function(e,t,n){n.d(t,{EH:function(){return tv},p:function(){return tg},tk:function(){return t$}});var o=n(17213),i=n(10121),s=n(94536);let r=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},l=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},d=null,a=function(e,t,n){let o=d||(d=document.createRange());return o.setEnd(e,null==n?e.nodeValue.length:n),o.setStart(e,t||0),o},c=function(){d=null},h=function(e,t,n,o){return n&&(f(e,t,n,o,-1)||f(e,t,n,o,1))},u=/^(img|br|input|textarea|hr)$/i;function f(e,t,n,o,i){for(var s;;){if(e==n&&t==o)return!0;if(t==(i<0?0:p(e))){let n=e.parentNode;if(!n||1!=n.nodeType||m(e)||u.test(e.nodeName)||"false"==e.contentEditable)return!1;t=r(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;let n=e.childNodes[t+(i<0?-1:0)];if(1==n.nodeType&&"false"==n.contentEditable){if(null===(s=n.pmViewDesc)||void 0===s||!s.ignoreForSelection)return!1;t+=i}else e=n,t=i<0?p(e):0}}}function p(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function m(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}let g=function(e){return e.focusNode&&h(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function y(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}let b="undefined"!=typeof navigator?navigator:null,v="undefined"!=typeof document?document:null,w=b&&b.userAgent||"",D=/Edge\/(\d+)/.exec(w),N=/MSIE \d/.exec(w),C=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(w),O=!!(N||C||D),S=N?document.documentMode:C?+C[1]:D?+D[1]:0,M=!O&&/gecko\/(\d+)/i.test(w);M&&(/Firefox\/(\d+)/.exec(w)||[0,0])[1];let x=!O&&/Chrome\/(\d+)/.exec(w),T=!!x,k=x?+x[1]:0,P=!O&&!!b&&/Apple Computer/.test(b.vendor),E=P&&(/Mobile\/\w+/.test(w)||!!b&&b.maxTouchPoints>2),V=E||!!b&&/Mac/.test(b.platform),A=!!b&&/Win/.test(b.platform),R=/Android \d/.test(w),B=!!v&&"webkitFontSmoothing"in v.documentElement.style,q=B?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function z(e,t){return"number"==typeof e?e:e[t]}function I(e,t,n){let o=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,s=e.dom.ownerDocument;for(let r=n||e.dom;r;){if(1!=r.nodeType){r=l(r);continue}let e=r,n=e==s.body,d=n?function(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}(s):function(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,o=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*o}}(e),a=0,c=0;if(t.top<d.top+z(o,"top")?c=-(d.top-t.top+z(i,"top")):t.bottom>d.bottom-z(o,"bottom")&&(c=t.bottom-t.top>d.bottom-d.top?t.top+z(i,"top")-d.top:t.bottom-d.bottom+z(i,"bottom")),t.left<d.left+z(o,"left")?a=-(d.left-t.left+z(i,"left")):t.right>d.right-z(o,"right")&&(a=t.right-d.right+z(i,"right")),a||c){if(n)s.defaultView.scrollBy(a,c);else{let n=e.scrollLeft,o=e.scrollTop;c&&(e.scrollTop+=c),a&&(e.scrollLeft+=a);let i=e.scrollLeft-n,s=e.scrollTop-o;t={left:t.left-i,top:t.top-s,right:t.right-i,bottom:t.bottom-s}}}let h=n?"fixed":getComputedStyle(r).position;if(/^(fixed|sticky)$/.test(h))break;r="absolute"==h?r.offsetParent:l(r)}}function L(e){let t=[],n=e.ownerDocument;for(let o=e;o&&(t.push({dom:o,top:o.scrollTop,left:o.scrollLeft}),e!=n);o=l(o));return t}function F(e,t){for(let n=0;n<e.length;n++){let{dom:o,top:i,left:s}=e[n];o.scrollTop!=i+t&&(o.scrollTop=i+t),o.scrollLeft!=s&&(o.scrollLeft=s)}}let K=null;function $(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function H(e){return e.top<e.bottom||e.left<e.right}function W(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(H(e))return e}return Array.prototype.find.call(n,H)||e.getBoundingClientRect()}let _=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Y(e,t,n){let{node:o,offset:i,atom:s}=e.docView.domFromPos(t,n<0?-1:1),r=B||M;if(3==o.nodeType){if(r&&(_.test(o.nodeValue)||(n<0?!i:i==o.nodeValue.length))){let e=W(a(o,i,i),n);if(M&&i&&/\s/.test(o.nodeValue[i-1])&&i<o.nodeValue.length){let t=W(a(o,i-1,i-1),-1);if(t.top==e.top){let n=W(a(o,i,i+1),-1);if(n.top!=e.top)return G(n,n.left<t.left)}}return e}{let e=i,t=i,s=n<0?1:-1;return n<0&&!i?(t++,s=-1):n>=0&&i==o.nodeValue.length?(e--,s=1):n<0?e--:t++,G(W(a(o,e,t),s),s<0)}}if(!e.state.doc.resolve(t-(s||0)).parent.inlineContent){if(null==s&&i&&(n<0||i==p(o))){let e=o.childNodes[i-1];if(1==e.nodeType)return U(e.getBoundingClientRect(),!1)}if(null==s&&i<p(o)){let e=o.childNodes[i];if(1==e.nodeType)return U(e.getBoundingClientRect(),!0)}return U(o.getBoundingClientRect(),n>=0)}if(null==s&&i&&(n<0||i==p(o))){let e=o.childNodes[i-1],t=3==e.nodeType?a(e,p(e)-(r?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return G(W(t,1),!1)}if(null==s&&i<p(o)){let e=o.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?a(e,0,r?0:1):1==e.nodeType?e:null:null;if(t)return G(W(t,-1),!0)}return G(W(3==o.nodeType?a(o):o,-n),n>=0)}function G(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function U(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function j(e,t,n){let o=e.state,i=e.root.activeElement;o!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{o!=t&&e.updateState(o),i!=e.dom&&i&&i.focus()}}let X=/[\u0590-\u08ac]/,J=null,Q=null,Z=!1;class ee{constructor(e,t,n,o){this.parent=e,this.children=t,this.dom=n,this.contentDOM=o,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let o=this.children[t];if(o==e)return n;n+=o.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){let o;if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,o;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((o=n.pmViewDesc)&&o.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(o)+o.size:this.posAtStart}{let n,o;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((o=n.pmViewDesc)&&o.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(o):this.posAtEnd}}if(e==this.dom&&this.contentDOM)o=t>r(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){o=!1;break}if(t.previousSibling)break}if(null==o&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){o=!0;break}if(t.nextSibling)break}}return(null==o?n>0:o)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,o=e;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!t||i.node)){if(!n||!(s=i.nodeDOM)||(1==s.nodeType?s.contains(1==e.nodeType?e:e.parentNode):s==e))return i;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let o=e;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(e,t,n)}return -1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let o=this.children[t],i=n+o.size;if(n==e&&i!=n){for(;!o.border&&o.children.length;)for(let e=0;e<o.children.length;e++){let t=o.children[e];if(t.size){o=t;break}}return o}if(e<i)return o.descAt(e-n-o.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,o=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],s=t+i.size;if(s>e||i instanceof el){o=e-t;break}t=s}if(o)return this.children[n].domFromPos(o-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof et&&e.side>=0;n--);if(t<=0){let e,o=!0;for(;(e=n?this.children[n-1]:null)&&e.dom.parentNode!=this.contentDOM;n--,o=!1);return e&&t&&o&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?r(e.dom)+1:0}}{let e,o=!0;for(;(e=n<this.children.length?this.children[n]:null)&&e.dom.parentNode!=this.contentDOM;n++,o=!1);return e&&o&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?r(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,i=-1;for(let s=n,l=0;;l++){let n=this.children[l],d=s+n.size;if(-1==o&&e<=d){let i=s+n.border;if(e>=i&&t<=d-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=s;for(let t=l;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){o=r(n.dom)+1;break}e-=n.size}-1==o&&(o=0)}if(o>-1&&(d>t||l==this.children.length-1)){t=d;for(let e=l+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=r(n.dom);break}t+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}s=d}return{node:this.contentDOM,from:e,to:t,fromOffset:o,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,o=!1){let i=Math.min(e,t),s=Math.max(e,t);for(let r=0,l=0;r<this.children.length;r++){let d=this.children[r],a=l+d.size;if(i>l&&s<a)return d.setSelection(e-l-d.border,t-l-d.border,n,o);l=a}let l=this.domFromPos(e,e?-1:1),d=t==e?l:this.domFromPos(t,t?-1:1),a=n.root.getSelection(),c=n.domSelectionRange(),u=!1;if((M||P)&&e==t){let{node:e,offset:t}=l;if(3==e.nodeType){if((u=!!(t&&"\n"==e.nodeValue[t-1]))&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){"BR"==n.nodeName&&(l=d={node:n.parentNode,offset:r(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(M&&c.focusNode&&c.focusNode!=d.node&&1==c.focusNode.nodeType){let e=c.focusNode.childNodes[c.focusOffset];e&&"false"==e.contentEditable&&(o=!0)}if(!(o||u&&P)&&h(l.node,l.offset,c.anchorNode,c.anchorOffset)&&h(d.node,d.offset,c.focusNode,c.focusOffset))return;let f=!1;if((a.extend||e==t)&&!(u&&M)){a.collapse(l.node,l.offset);try{e!=t&&a.extend(d.node,d.offset),f=!0}catch(e){}}if(!f){if(e>t){let e=l;l=d,d=e}let n=document.createRange();n.setEnd(d.node,d.offset),n.setStart(l.node,l.offset),a.removeAllRanges(),a.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,o=0;o<this.children.length;o++){let i=this.children[o],s=n+i.size;if(n==s?e<=s&&t>=n:e<s&&t>n){let o=n+i.border,r=s-i.border;if(e>=o&&t<=r){this.dirty=e==n||t==s?2:1,e==o&&t==r&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=3:i.markDirty(e-o,t-o);return}i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=s}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class et extends ee{constructor(e,t,n,o){let i,s=t.type.toDOM;if("function"==typeof s&&(s=s(n,()=>i?i.parent?i.parent.posBeforeChild(i):void 0:o)),!t.type.spec.raw){if(1!=s.nodeType){let e=document.createElement("span");e.appendChild(s),s=e}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class en extends ee{constructor(e,t,n,o){super(e,[],t,null),this.textDOM=n,this.text=o}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class eo extends ee{constructor(e,t,n,o,i){super(e,[],n,o),this.mark=t,this.spec=i}static create(e,t,n,o){let s=o.nodeViews[t.type.name],r=s&&s(t,o,n);return r&&r.dom||(r=i.PW.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new eo(e,t,r.dom,r.contentDOM||r.dom,r)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let o=eo.create(this.parent,this.mark,!0,n),i=this.children,s=this.size;t<s&&(i=eb(i,t,s,n)),e>0&&(i=eb(i,0,e,n));for(let e=0;e<i.length;e++)i[e].parent=o;return o.children=i,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class ei extends ee{constructor(e,t,n,o,i,s,r,l,d){super(e,[],i,s),this.node=t,this.outerDeco=n,this.innerDeco=o,this.nodeDOM=r}static create(e,t,n,o,s,r){let l=s.nodeViews[t.type.name],d,a=l&&l(t,s,()=>d?d.parent?d.parent.posBeforeChild(d):void 0:r,n,o),c=a&&a.dom,h=a&&a.contentDOM;if(t.isText){if(c){if(3!=c.nodeType)throw RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text)}else if(!c){let e=i.PW.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:c,contentDOM:h}=e)}h||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let u=c;return(c=ef(c,n,t),a)?d=new ed(e,t,n,o,c,h||null,u,a,s,r+1):t.isText?new er(e,t,n,o,c,u,s):new ei(e,t,n,o,c,h||null,u,s,r+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM){if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>i.HY.empty)}else e.contentElement=this.contentDOM}else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&ep(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,o=t,s=e.composing?this.localCompositionInfo(e,t):null,r=s&&s.pos>-1?s:null,l=s&&s.pos<0,d=new eg(this,r&&r.node,e);(function(e,t,n,o){let i=t.locals(e),s=0;if(0==i.length){for(let n=0;n<e.childCount;n++){let r=e.child(n);o(r,i,t.forChild(s,r),n),s+=r.nodeSize}return}let r=0,l=[],d=null;for(let a=0;;){let c,h,u,f;for(;r<i.length&&i[r].to==s;){let e=i[r++];e.widget&&(c?(h||(h=[c])).push(e):c=e)}if(c){if(h){h.sort(ey);for(let e=0;e<h.length;e++)n(h[e],a,!!d)}else n(c,a,!!d)}if(d)f=-1,u=d,d=null;else if(a<e.childCount)f=a,u=e.child(a++);else break;for(let e=0;e<l.length;e++)l[e].to<=s&&l.splice(e--,1);for(;r<i.length&&i[r].from<=s&&i[r].to>s;)l.push(i[r++]);let p=s+u.nodeSize;if(u.isText){let e=p;r<i.length&&i[r].from<e&&(e=i[r].from);for(let t=0;t<l.length;t++)l[t].to<e&&(e=l[t].to);e<p&&(d=u.cut(e-s),u=u.cut(0,e-s),p=e,f=-1)}else for(;r<i.length&&i[r].to<p;)r++;let m=u.isInline&&!u.isLeaf?l.filter(e=>!e.inline):l.slice();o(u,m,t.forChild(s,u),f),s=p}})(this.node,this.innerDeco,(t,s,r)=>{t.spec.marks?d.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!r&&d.syncToMarks(s==this.node.childCount?i.vc.none:this.node.child(s).marks,n,e),d.placeWidget(t,e,o)},(t,i,r,a)=>{let c;d.syncToMarks(t.marks,n,e),d.findNodeMatch(t,i,r,a)||l&&e.state.selection.from>o&&e.state.selection.to<o+t.nodeSize&&(c=d.findIndexWithChild(s.node))>-1&&d.updateNodeAt(t,i,r,c,e)||d.updateNextNode(t,i,r,e,a,o)||d.addNode(t,i,r,e,o),o+=t.nodeSize}),d.syncToMarks([],n,e),this.node.isTextblock&&d.addTextblockHacks(),d.destroyRest(),(d.changed||2==this.dirty)&&(r&&this.protectLocalComposition(e,r),function e(t,n,o){let i=t.firstChild,s=!1;for(let r=0;r<n.length;r++){let l=n[r],d=l.dom;if(d.parentNode==t){for(;d!=i;)i=em(i),s=!0;i=i.nextSibling}else s=!0,t.insertBefore(d,i);if(l instanceof eo){let n=i?i.previousSibling:t.lastChild;e(l.contentDOM,l.children,o),i=n?n.nextSibling:t.firstChild}}for(;i;)i=em(i),s=!0;s&&o.trackWrites==t&&(o.trackWrites=null)}(this.contentDOM,this.children,e),E&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:i}=e.state.selection;if(!(e.state.selection instanceof o.Bs)||n<t||i>t+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(!this.node.inlineContent)return{node:s,pos:-1,text:""};{let e=s.nodeValue,o=function(e,t,n,o){for(let i=0,s=0;i<e.childCount&&s<=o;){let r=e.child(i++),l=s;if(s+=r.nodeSize,!r.isText)continue;let d=r.text;for(;i<e.childCount;){let t=e.child(i++);if(s+=t.nodeSize,!t.isText)break;d+=t.text}if(s>=n){if(s>=o&&d.slice(o-t.length-l,o-l)==t)return o-t.length;let e=l<o?d.lastIndexOf(t,o-l-1):-1;if(e>=0&&e+t.length+l>=n)return l+e;if(n==o&&d.length>=o+t.length-l&&d.slice(o-l,o-l+t.length)==t)return o}}return -1}(this.node.content,e,n-t,i-t);return o<0?null:{node:s,pos:o,text:e}}}protectLocalComposition(e,{node:t,pos:n,text:o}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new en(this,i,t,o);e.input.compositionNodes.push(s),this.children=eb(this.children,n,n+o.length,e,s)}update(e,t,n,o){return!!(3!=this.dirty&&e.sameMarkup(this.node))&&(this.updateInner(e,t,n,o),!0)}updateInner(e,t,n,o){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(ep(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=eu(this.dom,this.nodeDOM,eh(this.outerDeco,this.node,t),eh(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function es(e,t,n,o,i){ef(o,t,e);let s=new ei(void 0,e,t,n,o,o,o,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class er extends ei{constructor(e,t,n,o,i,s,r){super(e,t,n,o,i,null,s,r,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,o){return!!(3!=this.dirty&&(0==this.dirty||this.inParent())&&e.sameMarkup(this.node))&&(this.updateOuterDeco(t),(0!=this.dirty||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=0,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let o=this.node.cut(e,t),i=document.createTextNode(o.text);return new er(this.parent,o,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(0==e||t==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class el extends ee{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class ed extends ei{constructor(e,t,n,o,i,s,r,l,d,a){super(e,t,n,o,i,s,r,d,a),this.spec=l}update(e,t,n,o){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,o),i}return(!!this.contentDOM||!!e.isLeaf)&&super.update(e,t,n,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,o){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}let ea=function(e){e&&(this.nodeName=e)};ea.prototype=Object.create(null);let ec=[new ea];function eh(e,t,n){if(0==e.length)return ec;let o=n?ec[0]:new ea,i=[o];for(let s=0;s<e.length;s++){let r=e[s].type.attrs;if(r)for(let e in r.nodeName&&i.push(o=new ea(r.nodeName)),r){let s=r[e];null!=s&&(n&&1==i.length&&i.push(o=new ea(t.isInline?"span":"div")),"class"==e?o.class=(o.class?o.class+" ":"")+s:"style"==e?o.style=(o.style?o.style+";":"")+s:"nodeName"!=e&&(o[e]=s))}}return i}function eu(e,t,n,o){if(n==ec&&o==ec)return t;let i=t;for(let t=0;t<o.length;t++){let s=o[t],r=n[t];if(t){let t;r&&r.nodeName==s.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==s.nodeName||((t=document.createElement(s.nodeName)).pmIsDeco=!0,t.appendChild(i),r=ec[0]),i=t}!function(e,t,n){for(let o in t)"class"==o||"style"==o||"nodeName"==o||o in n||e.removeAttribute(o);for(let o in n)"class"!=o&&"style"!=o&&"nodeName"!=o&&n[o]!=t[o]&&e.setAttribute(o,n[o]);if(t.class!=n.class){let o=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<o.length;t++)-1==i.indexOf(o[t])&&e.classList.remove(o[t]);for(let t=0;t<i.length;t++)-1==o.indexOf(i[t])&&e.classList.add(i[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=n.exec(t.style);)e.style.removeProperty(o[1])}n.style&&(e.style.cssText+=n.style)}}(i,r||ec[0],s)}return i}function ef(e,t,n){return eu(e,e,ec,eh(t,n,1!=e.nodeType))}function ep(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function em(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class eg{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,o=n.children.length,i=e.childCount,s=new Map,r=[];e:for(;i>0;){let l;for(;;)if(o){let e=n.children[o-1];if(e instanceof eo)n=e,o=e.children.length;else{l=e,o--;break}}else if(n==t)break e;else o=n.parent.children.indexOf(n),n=n.parent;let d=l.node;if(d){if(d!=e.child(i-1))break;--i,s.set(l,i),r.push(l)}}return{index:i,matched:s,matches:r.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n){let o=0,i=this.stack.length>>1,s=Math.min(i,e.length);for(;o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&!1!==e[o].type.spec.spanning;)o++;for(;o<i;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let o=-1;for(let t=this.index;t<Math.min(this.index+3,this.top.children.length);t++){let n=this.top.children[t];if(n.matchesMark(e[i])&&!this.isLocked(n.dom)){o=t;break}}if(o>-1)o>this.index&&(this.changed=!0,this.destroyBetween(this.index,o)),this.top=this.top.children[this.index];else{let o=eo.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,o),this.top=o,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(e,t,n))i=this.top.children.indexOf(s,this.index);else for(let o=this.index,s=Math.min(this.top.children.length,o+5);o<s;o++){let s=this.top.children[o];if(s.matchesNode(e,t,n)&&!this.preMatch.matched.has(s)){i=o;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,o,i){let s=this.top.children[o];return 3==s.dirty&&s.dom==s.contentDOM&&(s.dirty=2),!!s.update(e,t,n,i)&&(this.destroyBetween(this.index,o),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return -1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return -1}e=t}}updateNextNode(e,t,n,o,i,s){for(let r=this.index;r<this.top.children.length;r++){let l=this.top.children[r];if(l instanceof ei){let d=this.preMatch.matched.get(l);if(null!=d&&d!=i)return!1;let a=l.dom,c,h=this.isLocked(a)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&3!=l.dirty&&ep(t,l.outerDeco));if(!h&&l.update(e,t,n,o))return this.destroyBetween(this.index,r),l.dom!=a&&(this.changed=!0),this.index++,!0;if(!h&&(c=this.recreateWrapper(l,e,t,n,o,s)))return this.destroyBetween(this.index,r),this.top.children[this.index]=c,c.contentDOM&&(c.dirty=2,c.updateChildren(o,s+1),c.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,o,i,s){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!ep(n,e.outerDeco)||!o.eq(e.innerDeco))return null;let r=ei.create(this.top,t,n,o,i,s);if(r.contentDOM)for(let t of(r.children=e.children,e.children=[],r.children))t.parent=r;return e.destroy(),r}addNode(e,t,n,o,i){let s=ei.create(this.top,e,t,n,o,i);s.contentDOM&&s.updateChildren(o,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,t,n){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(e)&&(e==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let o=new et(this.top,e,t,n);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof eo;)e=(t=e).children[t.children.length-1];(!e||!(e instanceof er)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((P||T)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let o=new el(this.top,[],n,null);t!=this.top?t.children.push(o):t.children.splice(this.index++,0,o),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function ey(e,t){return e.type.side-t.type.side}function eb(e,t,n,o,i){let s=[];for(let r=0,l=0;r<e.length;r++){let d=e[r],a=l,c=l+=d.size;a>=n||c<=t?s.push(d):(a<t&&s.push(d.slice(0,t-a,o)),i&&(s.push(i),i=void 0),c>n&&s.push(d.slice(n-a,d.size,o)))}return s}function ev(e,t=null){let n=e.domSelectionRange(),i=e.state.doc;if(!n.focusNode)return null;let s=e.docView.nearestDesc(n.focusNode),l=s&&0==s.size,d=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(d<0)return null;let a=i.resolve(d),c,h;if(g(n)){for(c=d;s&&!s.node;)s=s.parent;let e=s.node;if(s&&e.isAtom&&o.qv.isSelectable(e)&&s.parent&&!(e.isInline&&function(e,t,n){for(let o=0==t,i=t==p(e);o||i;){if(e==n)return!0;let t=r(e);if(!(e=e.parentNode))return!1;o=o&&0==t,i=i&&t==p(e)}}(n.focusNode,n.focusOffset,s.dom))){let e=s.posBefore;h=new o.qv(d==e?a:i.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=d,o=d;for(let i=0;i<n.rangeCount;i++){let s=n.getRangeAt(i);t=Math.min(t,e.docView.posFromDOM(s.startContainer,s.startOffset,1)),o=Math.max(o,e.docView.posFromDOM(s.endContainer,s.endOffset,-1))}if(t<0)return null;[c,d]=o==e.state.selection.anchor?[o,t]:[t,o],a=i.resolve(d)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=i.resolve(c);if(!h){let n="pointer"==t||e.state.selection.head<a.pos&&!l?1:-1;h=eT(e,u,a,n)}return h}function ew(e){return e.editable?e.hasFocus():eP(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function eD(e,t=!1){let n=e.state.selection;if(eM(e,n),ew(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&T){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&h(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,o="IMG"==n.nodeName;o?t.collapse(n.parentNode,r(n)+1):t.collapse(n,0),!o&&!e.state.selection.visible&&O&&S<=11&&(n.disabled=!0,n.disabled=!1)}(e);else{let i,s,r,l,{anchor:d,head:a}=n,c,h;!eN||n instanceof o.Bs||(n.$from.parent.inlineContent||(c=eC(e,n.from)),n.empty||n.$from.parent.inlineContent||(h=eC(e,n.to))),e.docView.setSelection(d,a,e,t),eN&&(c&&eS(c),h&&eS(h)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&((i=e.dom.ownerDocument).removeEventListener("selectionchange",e.input.hideSelectionGuard),r=(s=e.domSelectionRange()).anchorNode,l=s.anchorOffset,i.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(s.anchorNode!=r||s.anchorOffset!=l)&&(i.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!ew(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}let eN=P||T&&k<63;function eC(e,t){let{node:n,offset:o}=e.docView.domFromPos(t,0),i=o<n.childNodes.length?n.childNodes[o]:null,s=o?n.childNodes[o-1]:null;if(P&&i&&"false"==i.contentEditable)return eO(i);if((!i||"false"==i.contentEditable)&&(!s||"false"==s.contentEditable)){if(i)return eO(i);if(s)return eO(s)}}function eO(e){return e.contentEditable="true",P&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function eS(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function eM(e,t){if(t instanceof o.qv){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(ex(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else ex(e)}function ex(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function eT(e,t,n,i){return e.someProp("createSelectionBetween",o=>o(e,t,n))||o.Bs.between(t,n,i)}function ek(e){return(!e.editable||!!e.hasFocus())&&eP(e)}function eP(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function eE(e,t){let{$anchor:n,$head:i}=e.selection,s=t>0?n.max(i):n.min(i),r=s.parent.inlineContent?s.depth?e.doc.resolve(t>0?s.after():s.before()):null:s;return r&&o.Y1.findFrom(r,t)}function eV(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function eA(e,t,n){let i=e.state.selection;if(i instanceof o.Bs){if(n.indexOf("s")>-1){let{$head:n}=i,s=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let r=e.state.doc.resolve(n.pos+s.nodeSize*(t<0?-1:1));return eV(e,new o.Bs(i.$anchor,r))}if(!i.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=eE(e.state,t);return!!n&&n instanceof o.qv&&eV(e,n)}if(!(V&&n.indexOf("m")>-1)){let n=i.$head,s=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,r;if(!s||s.isText)return!1;let l=t<0?n.pos-s.nodeSize:n.pos;return!!(s.isAtom||(r=e.docView.descAt(l))&&!r.contentDOM)&&(o.qv.isSelectable(s)?eV(e,new o.qv(t<0?e.state.doc.resolve(n.pos-s.nodeSize):n)):!!B&&eV(e,new o.Bs(e.state.doc.resolve(t<0?l:l+s.nodeSize))))}}else{if(i instanceof o.qv&&i.node.isInline)return eV(e,new o.Bs(t>0?i.$to:i.$from));let n=eE(e.state,t);return!!n&&eV(e,n)}}function eR(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function eB(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function eq(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,o=t.focusOffset;if(!n)return;let i,s,l=!1;for(M&&1==n.nodeType&&o<eR(n)&&eB(n.childNodes[o],-1)&&(l=!0);;)if(o>0){if(1!=n.nodeType)break;{let e=n.childNodes[o-1];if(eB(e,-1))i=n,s=--o;else if(3==e.nodeType)o=(n=e).nodeValue.length;else break}}else if(ez(n))break;else{let t=n.previousSibling;for(;t&&eB(t,-1);)i=n.parentNode,s=r(t),t=t.previousSibling;if(t)o=eR(n=t);else{if((n=n.parentNode)==e.dom)break;o=0}}l?eI(e,n,o):i&&eI(e,i,s)}(e):function(e){let t,n,o=e.domSelectionRange(),i=o.focusNode,s=o.focusOffset;if(!i)return;let l=eR(i);for(;;)if(s<l){if(1!=i.nodeType)break;if(eB(i.childNodes[s],1))t=i,n=++s;else break}else if(ez(i))break;else{let o=i.nextSibling;for(;o&&eB(o,1);)t=o.parentNode,n=r(o)+1,o=o.nextSibling;if(o)s=0,l=eR(i=o);else{if((i=i.parentNode)==e.dom)break;s=l=0}}t&&eI(e,t,n)}(e)}function ez(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function eI(e,t,n){if(3!=t.nodeType){let e,o;(o=function(e,t){for(;e&&t==e.childNodes.length&&!m(e);)t=r(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=o,n=0):(e=function(e,t){for(;e&&!t&&!m(e);)t=r(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let o=e.domSelection();if(!o)return;if(g(o)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),o.removeAllRanges(),o.addRange(e)}else o.extend&&o.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&eD(e)},50)}function eL(e,t){let n=e.state.doc.resolve(t);if(!(T||A)&&n.parent.inlineContent){let o=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>o.top&&i<o.bottom&&Math.abs(n.left-o.left)>1)return n.left<o.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>o.top&&i<o.bottom&&Math.abs(n.left-o.left)>1)return n.left>o.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function eF(e,t,n){let i=e.state.selection;if(i instanceof o.Bs&&!i.empty||n.indexOf("s")>-1||V&&n.indexOf("m")>-1)return!1;let{$from:s,$to:r}=i;if(!s.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=eE(e.state,t);if(n&&n instanceof o.qv)return eV(e,n)}if(!s.parent.inlineContent){let n=t<0?s:r,l=i instanceof o.C1?o.Y1.near(n,t):o.Y1.findFrom(n,t);return!!l&&eV(e,l)}return!1}function eK(e,t){if(!(e.state.selection instanceof o.Bs))return!0;let{$head:n,$anchor:i,empty:s}=e.state.selection;if(!n.sameParent(i))return!0;if(!s)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let r=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(r&&!r.isText){let o=e.state.tr;return t<0?o.delete(n.pos-r.nodeSize,n.pos):o.delete(n.pos,n.pos+r.nodeSize),e.dispatch(o),!0}return!1}function e$(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function eH(e,t){e.someProp("transformCopied",n=>{t=n(t,e)});let n=[],{content:o,openStart:s,openEnd:r}=t;for(;s>1&&r>1&&1==o.childCount&&1==o.firstChild.childCount;){s--,r--;let e=o.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),o=e.content}let l=e.someProp("clipboardSerializer")||i.PW.fromSchema(e.state.schema),d=eJ(),a=d.createElement("div");a.appendChild(l.serializeFragment(o,{document:d}));let c=a.firstChild,h,u=0;for(;c&&1==c.nodeType&&(h=ej[c.nodeName.toLowerCase()]);){for(let e=h.length-1;e>=0;e--){let t=d.createElement(h[e]);for(;a.firstChild;)t.appendChild(a.firstChild);a.appendChild(t),u++}c=a.firstChild}return c&&1==c.nodeType&&c.setAttribute("data-pm-slice",`${s} ${r}${u?` -${u}`:""} ${JSON.stringify(n)}`),{dom:a,text:e.someProp("clipboardTextSerializer",n=>n(t,e))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function eW(e,t,n,o,s){let r,l,d=s.parent.type.spec.code;if(!n&&!t)return null;let a=!!t&&(o||d||!n);if(a){if(e.someProp("transformPastedText",n=>{t=n(t,d||o,e)}),d)return l=new i.p2(i.HY.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",t=>{l=t(l,e,!0)}),l;let n=e.someProp("clipboardTextParser",n=>n(t,s,o,e));if(n)l=n;else{let n=s.marks(),{schema:o}=e.state,l=i.PW.fromSchema(o);r=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=r.appendChild(document.createElement("p"));e&&t.appendChild(l.serializeNode(o.text(e,n)))})}}else e.someProp("transformPastedHTML",t=>{n=t(n,e)}),r=function(e){var t;let n,o=/^(\s*<meta [^>]*>)*/.exec(e);o&&(e=e.slice(o[0].length));let i=eJ().createElement("div"),s=/<([a-z][^>\s]+)/i.exec(e),r;if((r=s&&ej[s[1].toLowerCase()])&&(e=r.map(e=>"<"+e+">").join("")+e+r.map(e=>"</"+e+">").reverse().join("")),i.innerHTML=(t=e,(n=window.trustedTypes)?(eQ||(eQ=n.defaultPolicy||n.createPolicy("ProseMirrorClipboard",{createHTML:e=>e})),eQ.createHTML(t)):t),r)for(let e=0;e<r.length;e++)i=i.querySelector(r[e])||i;return i}(n),B&&function(e){let t=e.querySelectorAll(T?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let o=t[n];1==o.childNodes.length&&"\xa0"==o.textContent&&o.parentNode&&o.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),o)}}(r);let c=r&&r.querySelector("[data-pm-slice]"),h=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(h&&h[3])for(let e=+h[3];e>0;e--){let e=r.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;r=e}if(l||(l=(e.someProp("clipboardParser")||e.someProp("domParser")||i.aw.fromSchema(e.state.schema)).parseSlice(r,{preserveWhitespace:!!(a||h),context:s,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||e_.test(e.parentNode.nodeName)?null:{ignore:!0}})),h)l=function(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,o;try{o=JSON.parse(t)}catch(t){return e}let{content:s,openStart:r,openEnd:l}=e;for(let e=o.length-2;e>=0;e-=2){let t=n.nodes[o[e]];if(!t||t.hasRequiredAttrs())break;s=i.HY.from(t.create(o[e+1],s)),r++,l++}return new i.p2(s,r,l)}(eU(l,+h[1],+h[2]),h[4]);else if((l=i.p2.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let o=t.node(n).contentMatchAt(t.index(n)),s,r=[];if(e.forEach(e=>{if(!r)return;let t=o.findWrapping(e.type),n;if(!t)return r=null;if(n=r.length&&s.length&&function e(t,n,o,s,r){if(r<t.length&&r<n.length&&t[r]==n[r]){let l=e(t,n,o,s.lastChild,r+1);if(l)return s.copy(s.content.replaceChild(s.childCount-1,l));if(s.contentMatchAt(s.childCount).matchType(r==t.length-1?o.type:t[r+1]))return s.copy(s.content.append(i.HY.from(eY(o,t,r+1))))}}(t,s,e,r[r.length-1],0))r[r.length-1]=n;else{r.length&&(r[r.length-1]=function e(t,n){if(0==n)return t;let o=t.content.replaceChild(t.childCount-1,e(t.lastChild,n-1)),s=t.contentMatchAt(t.childCount).fillBefore(i.HY.empty,!0);return t.copy(o.append(s))}(r[r.length-1],s.length));let n=eY(e,t);r.push(n),o=o.matchType(n.type),s=t}}),r)return i.HY.from(r)}return e}(l.content,s),!0)).openStart||l.openEnd){let e=0,t=0;for(let t=l.content.firstChild;e<l.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=l.content.lastChild;t<l.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);l=eU(l,e,t)}return e.someProp("transformPasted",t=>{l=t(l,e,a)}),l}let e_=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function eY(e,t,n=0){for(let o=t.length-1;o>=n;o--)e=t[o].create(null,i.HY.from(e));return e}function eG(e,t,n,o,s,r){let l=t<0?e.firstChild:e.lastChild,d=l.content;return e.childCount>1&&(r=0),s<o-1&&(d=eG(d,t,n,o,s+1,r)),s>=n&&(d=t<0?l.contentMatchAt(0).fillBefore(d,r<=s).append(d):d.append(l.contentMatchAt(l.childCount).fillBefore(i.HY.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,l.copy(d))}function eU(e,t,n){return t<e.openStart&&(e=new i.p2(eG(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new i.p2(eG(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}let ej={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},eX=null;function eJ(){return eX||(eX=document.implementation.createHTMLDocument("title"))}let eQ=null,eZ={},e0={},e1={touchstart:!0,touchmove:!0};class e2{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function e3(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function e5(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>e6(e,t))})}function e6(e,t){return e.someProp("handleDOMEvents",n=>{let o=n[t.type];return!!o&&(o(e,t)||t.defaultPrevented)})}function e8(e){return{left:e.clientX,top:e.clientY}}function e9(e,t,n,o,i){if(-1==o)return!1;let s=e.state.doc.resolve(o);for(let o=s.depth+1;o>0;o--)if(e.someProp(t,t=>o>s.depth?t(e,n,s.nodeAfter,s.before(o),i,!0):t(e,n,s.node(o),s.before(o),i,!1)))return!0;return!1}function e7(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let o=e.state.tr.setSelection(t);"pointer"==n&&o.setMeta("pointer",!0),e.dispatch(o)}e0.keydown=(e,t)=>{if(e.input.shiftKey=16==t.keyCode||t.shiftKey,!tt(e,t)&&(e.input.lastKeyCode=t.keyCode,e.input.lastKeyCodeTime=Date.now(),!R||!T||13!=t.keyCode)){if(229!=t.keyCode&&e.domObserver.forceFlush(),!E||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)e.someProp("handleKeyDown",n=>n(e,t))||function(e,t){let n;let o=t.keyCode,i=(n="",t.ctrlKey&&(n+="c"),t.metaKey&&(n+="m"),t.altKey&&(n+="a"),t.shiftKey&&(n+="s"),n);if(8==o||V&&72==o&&"c"==i)return eK(e,-1)||eq(e,-1);if(46==o&&!t.shiftKey||V&&68==o&&"c"==i)return eK(e,1)||eq(e,1);if(13==o||27==o)return!0;if(37==o||V&&66==o&&"c"==i){let t=37==o?"ltr"==eL(e,e.state.selection.from)?-1:1:-1;return eA(e,t,i)||eq(e,t)}if(39==o||V&&70==o&&"c"==i){let t=39==o?"ltr"==eL(e,e.state.selection.from)?1:-1:1;return eA(e,t,i)||eq(e,t)}if(38==o||V&&80==o&&"c"==i)return eF(e,-1,i)||eq(e,-1);if(40==o||V&&78==o&&"c"==i)return function(e){if(!P||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;e$(e,n,"true"),setTimeout(()=>e$(e,n,"false"),20)}return!1}(e)||eF(e,1,i)||eq(e,1);else if(i==(V?"m":"c")&&(66==o||73==o||89==o||90==o))return!0;return!1}(e,t)?t.preventDefault():e3(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",t=>t(e,y(13,"Enter"))),e.input.lastIOSEnter=0)},200)}}},e0.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},e0.keypress=(e,t)=>{if(tt(e,t)||!t.charCode||t.ctrlKey&&!t.altKey||V&&t.metaKey)return;if(e.someProp("handleKeyPress",n=>n(e,t))){t.preventDefault();return}let n=e.state.selection;if(!(n instanceof o.Bs)||!n.$from.sameParent(n.$to)){let o=String.fromCharCode(t.charCode),i=()=>e.state.tr.insertText(o).scrollIntoView();/[\r\n]/.test(o)||e.someProp("handleTextInput",t=>t(e,n.$from.pos,n.$to.pos,o,i))||e.dispatch(i()),t.preventDefault()}};let e4=V?"metaKey":"ctrlKey";eZ.mousedown=(e,t)=>{var n;let i,s;e.input.shiftKey=t.shiftKey;let r=ts(e),l=Date.now(),d="singleClick";l-e.input.lastClick.time<500&&(i=(n=e.input.lastClick).x-t.clientX)*i+(s=n.y-t.clientY)*s<100&&!t[e4]&&e.input.lastClick.button==t.button&&("singleClick"==e.input.lastClick.type?d="doubleClick":"doubleClick"==e.input.lastClick.type&&(d="tripleClick")),e.input.lastClick={time:l,x:t.clientX,y:t.clientY,type:d,button:t.button};let a=e.posAtCoords(e8(t));a&&("singleClick"==d?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new te(e,a,t,!!r)):("doubleClick"==d?function(e,t,n,o){return e9(e,"handleDoubleClickOn",t,n,o)||e.someProp("handleDoubleClick",n=>n(e,t,o))}:function(e,t,n,i){return e9(e,"handleTripleClickOn",t,n,i)||e.someProp("handleTripleClick",n=>n(e,t,i))||function(e,t,n){if(0!=n.button)return!1;let i=e.state.doc;if(-1==t)return!!i.inlineContent&&(e7(e,o.Bs.create(i,0,i.content.size),"pointer"),!0);let s=i.resolve(t);for(let t=s.depth+1;t>0;t--){let n=t>s.depth?s.nodeAfter:s.node(t),r=s.before(t);if(n.inlineContent)e7(e,o.Bs.create(i,r+1,r+1+n.content.size),"pointer");else{if(!o.qv.isSelectable(n))continue;e7(e,o.qv.create(i,r),"pointer")}return!0}}(e,n,i)})(e,a.pos,a.inside,t)?t.preventDefault():e3(e,"pointer"))};class te{constructor(e,t,n,i){let s,r;if(this.view=e,this.pos=t,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[e4],this.allowDefault=n.shiftKey,t.inside>-1)s=e.state.doc.nodeAt(t.inside),r=t.inside;else{let n=e.state.doc.resolve(t.pos);s=n.parent,r=n.depth?n.before():0}let l=i?null:n.target,d=l?e.docView.nearestDesc(l,!0):null;this.target=d&&1==d.nodeDOM.nodeType?d.nodeDOM:null;let{selection:a}=e.state;(0==n.button&&s.type.spec.draggable&&!1!==s.type.spec.selectable||a instanceof o.qv&&a.from<=r&&a.to>r)&&(this.mightDrag={node:s,pos:r,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&M&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),e3(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>eD(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;if(this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(e8(e))),this.updateAllowDefault(e),this.allowDefault||!t)e3(this.view,"pointer");else{var n,i,s,r;(n=this.view,i=t.pos,s=t.inside,r=this.selectNode,e9(n,"handleClickOn",i,s,e)||n.someProp("handleClick",t=>t(n,i,e))||(r?function(e,t){if(-1==t)return!1;let n=e.state.selection,i,s;n instanceof o.qv&&(i=n.node);let r=e.state.doc.resolve(t);for(let e=r.depth+1;e>0;e--){let t=e>r.depth?r.nodeAfter:r.node(e);if(o.qv.isSelectable(t)){s=i&&n.$from.depth>0&&e>=n.$from.depth&&r.before(n.$from.depth+1)==n.$from.pos?r.before(n.$from.depth):r.before(e);break}}return null!=s&&(e7(e,o.qv.create(e.state.doc,s),"pointer"),!0)}(n,s):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),i=n.nodeAfter;return!!(i&&i.isAtom&&o.qv.isSelectable(i))&&(e7(e,new o.qv(n),"pointer"),!0)}(n,s)))?e.preventDefault():0==e.button&&(this.flushed||P&&this.mightDrag&&!this.mightDrag.node.isAtom||T&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to)))?(e7(this.view,o.Y1.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):e3(this.view,"pointer")}}move(e){this.updateAllowDefault(e),e3(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function tt(e,t){return!!e.composing||!!(P&&500>Math.abs(t.timeStamp-e.input.compositionEndedAt))&&(e.input.compositionEndedAt=-2e8,!0)}eZ.touchstart=e=>{e.input.lastTouch=Date.now(),ts(e),e3(e,"pointer")},eZ.touchmove=e=>{e.input.lastTouch=Date.now(),e3(e,"pointer")},eZ.contextmenu=e=>ts(e);let tn=R?5e3:-1;function to(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>ts(e),t))}function ti(e){let t;for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=((t=document.createEvent("Event")).initEvent("event",!0,!0),t.timeStamp));e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function ts(e,t=!1){if(!R||!(e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),ti(e),t||e.docView&&e.docView.dirty){let n=ev(e),o=e.state.selection;return n&&!n.eq(o)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!o.$from.node(o.$from.sharedDepth(o.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}e0.compositionstart=e0.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof o.Bs&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)||T&&A&&function(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||1!=t.nodeType||n>=t.childNodes.length)return!1;let o=t.childNodes[n];return 1==o.nodeType&&"false"==o.contentEditable}(e)))e.markCursor=e.state.storedMarks||n.marks(),ts(e,!0),e.markCursor=null;else if(ts(e,!t.selection.empty),M&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,o=t.focusOffset;n&&1==n.nodeType&&0!=o;){let t=o<0?n.lastChild:n.childNodes[o-1];if(!t)break;if(3==t.nodeType){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,o=-1}}e.input.composing=!0}to(e,tn)},e0.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,to(e,20))};let tr=O&&S<15||E&&q<604;function tl(e,t,n,o,s){let r=eW(e,t,n,o,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,s,r||i.p2.empty)))return!0;if(!r)return!1;let l=0==r.openStart&&0==r.openEnd&&1==r.content.childCount?r.content.firstChild:null,d=l?e.state.tr.replaceSelectionWith(l,o):e.state.tr.replaceSelection(r);return e.dispatch(d.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function td(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}eZ.copy=e0.cut=(e,t)=>{let n=e.state.selection,o="cut"==t.type;if(n.empty)return;let i=tr?null:t.clipboardData,{dom:s,text:r}=eH(e,n.content());i?(t.preventDefault(),i.clearData(),i.setData("text/html",s.innerHTML),i.setData("text/plain",r)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let o=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),o.removeAllRanges(),o.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}(e,s),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},e0.paste=(e,t)=>{if(e.composing&&!R)return;let n=tr?null:t.clipboardData,o=e.input.shiftKey&&45!=e.input.lastKeyCode;n&&tl(e,td(n),n.getData("text/html"),o,t)?t.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,o=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(o.contentEditable="true"),o.style.cssText="position: fixed; left: -10000px; top: 10px",o.focus();let i=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout(()=>{e.focus(),o.parentNode&&o.parentNode.removeChild(o),n?tl(e,o.value,null,i,t):tl(e,o.textContent,o.innerHTML,i,t)},50)}(e,t)};class ta{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}let tc=V?"altKey":"ctrlKey";function th(e,t){let n=e.someProp("dragCopies",e=>!e(t));return null!=n?n:!t[tc]}for(let e in eZ.dragstart=(e,t)=>{let n;let i=e.input.mouseDown;if(i&&i.done(),!t.dataTransfer)return;let s=e.state.selection,r=s.empty?null:e.posAtCoords(e8(t));if(r&&r.pos>=s.from&&r.pos<=(s instanceof o.qv?s.to-1:s.to));else if(i&&i.mightDrag)n=o.qv.create(e.state.doc,i.mightDrag.pos);else if(t.target&&1==t.target.nodeType){let i=e.docView.nearestDesc(t.target,!0);i&&i.node.type.spec.draggable&&i!=e.docView&&(n=o.qv.create(e.state.doc,i.posBefore))}let l=(n||e.state.selection).content(),{dom:d,text:a,slice:c}=eH(e,l);t.dataTransfer.files.length&&T&&!(k>120)||t.dataTransfer.clearData(),t.dataTransfer.setData(tr?"Text":"text/html",d.innerHTML),t.dataTransfer.effectAllowed="copyMove",tr||t.dataTransfer.setData("text/plain",a),e.dragging=new ta(c,th(e,t),n)},eZ.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},e0.dragover=e0.dragenter=(e,t)=>t.preventDefault(),e0.drop=(e,t)=>{try{(function(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(e8(t));if(!r)return;let l=e.state.doc.resolve(r.pos),d=n&&n.slice;d?e.someProp("transformPasted",t=>{d=t(d,e,!1)}):d=eW(e,td(t.dataTransfer),tr?null:t.dataTransfer.getData("text/html"),!1,l);let a=!!(n&&th(e,t));if(e.someProp("handleDrop",n=>n(e,t,d||i.p2.empty,a))){t.preventDefault();return}if(!d)return;t.preventDefault();let c=d?(0,s.nj)(e.state.doc,l.pos,d):l.pos;null==c&&(c=l.pos);let h=e.state.tr;if(a){let{node:e}=n;e?e.replace(h):h.deleteSelection()}let u=h.mapping.map(c),f=0==d.openStart&&0==d.openEnd&&1==d.content.childCount,p=h.doc;if(f?h.replaceRangeWith(u,u,d.content.firstChild):h.replaceRange(u,u,d),h.doc.eq(p))return;let m=h.doc.resolve(u);if(f&&o.qv.isSelectable(d.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(d.content.firstChild))h.setSelection(new o.qv(m));else{let t=h.mapping.map(c);h.mapping.maps[h.mapping.maps.length-1].forEach((e,n,o,i)=>t=i),h.setSelection(eT(e,m,h.doc.resolve(t)))}e.focus(),e.dispatch(h.setMeta("uiEvent","drop"))})(e,t,e.dragging)}finally{e.dragging=null}},eZ.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&eD(e)},20))},eZ.blur=(e,t)=>{e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),t.relatedTarget&&e.dom.contains(t.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},eZ.beforeinput=(e,t)=>{if(T&&R&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",t=>t(e,y(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}},e0)eZ[e]=e0[e];function tu(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class tf{constructor(e,t){this.toDOM=e,this.spec=t||tb,this.side=this.spec.side||0}map(e,t,n,o){let{pos:i,deleted:s}=e.mapResult(t.from+o,this.side<0?-1:1);return s?null:new tg(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof tf&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&tu(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class tp{constructor(e,t){this.attrs=e,this.spec=t||tb}map(e,t,n,o){let i=e.map(t.from+o,this.spec.inclusiveStart?-1:1)-n,s=e.map(t.to+o,this.spec.inclusiveEnd?1:-1)-n;return i>=s?null:new tg(i,s,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof tp&&tu(this.attrs,e.attrs)&&tu(this.spec,e.spec)}static is(e){return e.type instanceof tp}destroy(){}}class tm{constructor(e,t){this.attrs=e,this.spec=t||tb}map(e,t,n,o){let i=e.mapResult(t.from+o,1);if(i.deleted)return null;let s=e.mapResult(t.to+o,-1);return s.deleted||s.pos<=i.pos?null:new tg(i.pos-n,s.pos-n,this)}valid(e,t){let{index:n,offset:o}=e.content.findIndex(t.from),i;return o==t.from&&!(i=e.child(n)).isText&&o+i.nodeSize==t.to}eq(e){return this==e||e instanceof tm&&tu(this.attrs,e.attrs)&&tu(this.spec,e.spec)}destroy(){}}class tg{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new tg(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new tg(e,e,new tf(t,n))}static inline(e,t,n,o){return new tg(e,t,new tp(n,o))}static node(e,t,n,o){return new tg(e,t,new tm(n,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof tp}get widget(){return this.type instanceof tf}}let ty=[],tb={};class tv{constructor(e,t){this.local=e.length?e:ty,this.children=t.length?t:ty}static create(e,t){return t.length?tS(t,e,0,tb):tw}find(e,t,n){let o=[];return this.findInner(null==e?0:e,null==t?1e9:t,o,0,n),o}findInner(e,t,n,o,i){for(let s=0;s<this.local.length;s++){let r=this.local[s];r.from<=t&&r.to>=e&&(!i||i(r.spec))&&n.push(r.copy(r.from+o,r.to+o))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<t&&this.children[s+1]>e){let r=this.children[s]+1;this.children[s+2].findInner(e-r,t-r,n,o+r,i)}}map(e,t,n){return this==tw||0==e.maps.length?this:this.mapInner(e,t,0,0,n||tb)}mapInner(e,t,n,o,i){let s;for(let r=0;r<this.local.length;r++){let l=this.local[r].map(e,n,o);l&&l.type.valid(t,l)?(s||(s=[])).push(l):i.onRemove&&i.onRemove(this.local[r].spec)}return this.children.length?function(e,t,n,o,i,s,r){let l=e.slice();for(let e=0,t=s;e<n.maps.length;e++){let o=0;n.maps[e].forEach((e,n,i,s)=>{let r=s-i-(n-e);for(let i=0;i<l.length;i+=3){let s=l[i+1];if(s<0||e>s+t-o)continue;let d=l[i]+t-o;n>=d?l[i+1]=e<=d?-2:-1:e>=t&&r&&(l[i]+=r,l[i+1]+=r)}o+=r}),t=n.maps[e].map(t,-1)}let d=!1;for(let t=0;t<l.length;t+=3)if(l[t+1]<0){if(-2==l[t+1]){d=!0,l[t+1]=-1;continue}let a=n.map(e[t]+s),c=a-i;if(c<0||c>=o.content.size){d=!0;continue}let h=n.map(e[t+1]+s,-1)-i,{index:u,offset:f}=o.content.findIndex(c),p=o.maybeChild(u);if(p&&f==c&&f+p.nodeSize==h){let o=l[t+2].mapInner(n,p,a+1,e[t]+s+1,r);o!=tw?(l[t]=c,l[t+1]=h,l[t+2]=o):(l[t+1]=-2,d=!0)}else d=!0}if(d){let d=tS(function(e,t,n,o,i,s,r){for(let l=0;l<e.length;l+=3)-1==e[l+1]&&function e(t,s){for(let e=0;e<t.local.length;e++){let l=t.local[e].map(o,i,s);l?n.push(l):r.onRemove&&r.onRemove(t.local[e].spec)}for(let n=0;n<t.children.length;n+=3)e(t.children[n+2],t.children[n]+s+1)}(e[l+2],t[l]+s+1);return n}(l,e,t,n,i,s,r),o,0,r);t=d.local;for(let e=0;e<l.length;e+=3)l[e+1]<0&&(l.splice(e,3),e-=3);for(let e=0,t=0;e<d.children.length;e+=3){let n=d.children[e];for(;t<l.length&&l[t]<n;)t+=3;l.splice(t,0,d.children[e],d.children[e+1],d.children[e+2])}}return new tv(t.sort(tM),l)}(this.children,s||[],e,t,n,o,i):s?new tv(s.sort(tM),ty):tw}add(e,t){return t.length?this==tw?tv.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let o,i=0;e.forEach((e,s)=>{let r=s+n,l;if(l=tC(t,e,r)){for(o||(o=this.children.slice());i<o.length&&o[i]<s;)i+=3;o[i]==s?o[i+2]=o[i+2].addInner(e,l,r+1):o.splice(i,0,s,s+e.nodeSize,tS(l,e,r+1,tb)),i+=3}});let s=tN(i?tO(t):t,-n);for(let t=0;t<s.length;t++)s[t].type.valid(e,s[t])||s.splice(t--,1);return new tv(s.length?this.local.concat(s).sort(tM):this.local,o||this.children)}remove(e){return 0==e.length||this==tw?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,o=this.local;for(let o=0;o<n.length;o+=3){let i;let s=n[o]+t,r=n[o+1]+t;for(let t=0,n;t<e.length;t++)(n=e[t])&&n.from>s&&n.to<r&&(e[t]=null,(i||(i=[])).push(n));if(!i)continue;n==this.children&&(n=this.children.slice());let l=n[o+2].removeInner(i,s+1);l!=tw?n[o+2]=l:(n.splice(o,3),o-=3)}if(o.length){for(let n=0,i;n<e.length;n++)if(i=e[n])for(let e=0;e<o.length;e++)o[e].eq(i,t)&&(o==this.local&&(o=this.local.slice()),o.splice(e--,1))}return n==this.children&&o==this.local?this:o.length||n.length?new tv(o,n):tw}forChild(e,t){let n,o;if(this==tw)return this;if(t.isLeaf)return tv.empty;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let i=e+1,s=i+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<s&&t.to>i&&t.type instanceof tp){let e=Math.max(i,t.from)-i,n=Math.min(s,t.to)-i;e<n&&(o||(o=[])).push(t.copy(e,n))}}if(o){let e=new tv(o.sort(tM),ty);return n?new tD([e,n]):e}return n||tw}eq(e){if(this==e)return!0;if(!(e instanceof tv)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return tx(this.localsInner(e))}localsInner(e){if(this==tw)return ty;if(e.inlineContent||!this.local.some(tp.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof tp||t.push(this.local[e]);return t}forEachSet(e){e(this)}}tv.empty=new tv([],[]),tv.removeOverlap=tx;let tw=tv.empty;class tD{constructor(e){this.members=e}map(e,t){let n=this.members.map(n=>n.map(e,t,tb));return tD.from(n)}forChild(e,t){if(t.isLeaf)return tv.empty;let n=[];for(let o=0;o<this.members.length;o++){let i=this.members[o].forChild(e,t);i!=tw&&(i instanceof tD?n=n.concat(i.members):n.push(i))}return tD.from(n)}eq(e){if(!(e instanceof tD)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let o=0;o<this.members.length;o++){let i=this.members[o].localsInner(e);if(i.length){if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e])}else t=i}}return t?tx(n?t:t.sort(tM)):ty}static from(e){switch(e.length){case 0:return tw;case 1:return e[0];default:return new tD(e.every(e=>e instanceof tv)?e:e.reduce((e,t)=>e.concat(t instanceof tv?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function tN(e,t){if(!t||!e.length)return e;let n=[];for(let o=0;o<e.length;o++){let i=e[o];n.push(new tg(i.from+t,i.to+t,i.type))}return n}function tC(e,t,n){if(t.isLeaf)return null;let o=n+t.nodeSize,i=null;for(let t=0,s;t<e.length;t++)(s=e[t])&&s.from>n&&s.to<o&&((i||(i=[])).push(s),e[t]=null);return i}function tO(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function tS(e,t,n,o){let i=[],s=!1;t.forEach((t,r)=>{let l=tC(e,t,r+n);if(l){s=!0;let e=tS(l,t,n+r+1,o);e!=tw&&i.push(r,r+t.nodeSize,e)}});let r=tN(s?tO(e):e,-n).sort(tM);for(let e=0;e<r.length;e++)r[e].type.valid(t,r[e])||(o.onRemove&&o.onRemove(r[e].spec),r.splice(e--,1));return r.length||i.length?new tv(r,i):tw}function tM(e,t){return e.from-t.from||e.to-t.to}function tx(e){let t=e;for(let n=0;n<t.length-1;n++){let o=t[n];if(o.from!=o.to)for(let i=n+1;i<t.length;i++){let s=t[i];if(s.from==o.from){s.to!=o.to&&(t==e&&(t=e.slice()),t[i]=s.copy(s.from,o.to),tT(t,i+1,s.copy(o.to,s.to)));continue}s.from<o.to&&(t==e&&(t=e.slice()),t[n]=o.copy(o.from,s.from),tT(t,i,o.copy(s.from,o.to)));break}}return t}function tT(e,t,n){for(;t<e.length&&tM(n,e[t])>0;)t++;e.splice(t,0,n)}function tk(e){let t=[];return e.someProp("decorations",n=>{let o=n(e.state);o&&o!=tw&&t.push(o)}),e.cursorWrapper&&t.push(tv.create(e.state.doc,[e.cursorWrapper.deco])),tD.from(t)}let tP={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},tE=O&&S<=11;class tV{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class tA{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new tV,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(e=>{for(let t=0;t<e.length;t++)this.queue.push(e[t]);O&&S<=11&&e.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),tE&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,tP)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(ek(this.view)){if(this.suppressingSelectionUpdates)return eD(this.view);if(O&&S<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&h(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=l(n))t.add(n);for(let o=e.anchorNode;o;o=l(o))if(t.has(o)){n=o;break}let o=n&&this.view.docView.nearestDesc(n);if(o&&o.ignoreMutation({type:"selection",target:3==n.nodeType?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&ek(e)&&!this.ignoreSelectionChange(n),s=-1,r=-1,l=!1,d=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],d);n&&(s=s<0?n.from:Math.min(n.from,s),r=r<0?n.to:Math.max(n.to,r),n.typeOver&&(l=!0))}if(M&&d.length){let t=d.filter(e=>"BR"==e.nodeName);if(2==t.length){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let o of t){let t=o.parentNode;t&&"LI"==t.nodeName&&(!n||function(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}(e,n)!=t)&&o.remove()}}}else if((T||P)&&d.some(e=>"BR"==e.nodeName)&&(8==e.input.lastKeyCode||46==e.input.lastKeyCode)){for(let e of d)if("BR"==e.nodeName&&e.parentNode){let t=e.nextSibling;t&&1==t.nodeType&&"false"==t.contentEditable&&e.parentNode.removeChild(e)}}let a=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&g(n)&&(a=ev(e))&&a.eq(o.Y1.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,eD(e),this.currentSelection.set(n),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,r),tR.has(e)||(tR.set(e,null),-1===["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))||(e.requiresGeckoHackNode=M,tB||(console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),tB=!0))),this.handleDOMChange(s,r,l,d),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||eD(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++){let o=e.addedNodes[n];t.push(o),3==o.nodeType&&(this.lastChangedTextNode=o)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let o=e.previousSibling,i=e.nextSibling;if(O&&S<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:s}=e.addedNodes[t];(!n||0>Array.prototype.indexOf.call(e.addedNodes,n))&&(o=n),(!s||0>Array.prototype.indexOf.call(e.addedNodes,s))&&(i=s)}let s=o&&o.parentNode==e.target?r(o)+1:0,l=n.localPosFromDOM(e.target,s,-1),d=i&&i.parentNode==e.target?r(i):e.target.childNodes.length;return{from:l,to:n.localPosFromDOM(e.target,d,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let tR=new WeakMap,tB=!1;function tq(e,t){let n=t.startContainer,o=t.startOffset,i=t.endContainer,s=t.endOffset,r=e.domAtPos(e.state.selection.anchor);return h(r.node,r.offset,i,s)&&([n,o,i,s]=[i,s,n,o]),{anchorNode:n,anchorOffset:o,focusNode:i,focusOffset:s}}function tz(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(P&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||P&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}let tI=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function tL(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:eT(e,t.resolve(n.anchor),t.resolve(n.head))}function tF(e,t,n){let o=e.depth,i=t?e.end():e.pos;for(;o>0&&(t||e.indexAfter(o)==e.node(o).childCount);)o--,i++,t=!1;if(n){let t=e.node(o).maybeChild(e.indexAfter(o));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function tK(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class t${constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new e2,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(tG),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=t_(this),tW(this),this.nodeViews=tY(this),this.docView=es(this.state.doc,tH(this),tk(this),this.dom,this),this.domObserver=new tA(this,(e,t,n,s)=>(function(e,t,n,s,r){let l,d,a,c=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=ev(e,t);if(n&&!e.state.selection.eq(n)){if(T&&R&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,y(13,"Enter"))))return;let o=e.state.tr.setSelection(n);"pointer"==t?o.setMeta("pointer",!0):"key"==t&&o.scrollIntoView(),c&&o.setMeta("composition",c),e.dispatch(o)}return}let h=e.state.doc.resolve(t),u=h.sharedDepth(n);t=h.before(u+1),n=e.state.doc.resolve(n).after(u+1);let f=e.state.selection,p=function(e,t,n){let o,{node:s,fromOffset:r,toOffset:l,from:d,to:a}=e.docView.parseRange(t,n),c=e.domSelectionRange(),h=c.anchorNode;if(h&&e.dom.contains(1==h.nodeType?h:h.parentNode)&&(o=[{node:h,offset:c.anchorOffset}],g(c)||o.push({node:c.focusNode,offset:c.focusOffset})),T&&8===e.input.lastKeyCode)for(let e=l;e>r;e--){let t=s.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){l=e;break}if(!n||n.size)break}let u=e.state.doc,f=e.someProp("domParser")||i.aw.fromSchema(e.state.schema),p=u.resolve(d),m=null,y=f.parse(s,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:r,to:l,preserveWhitespace:"pre"!=p.parent.type.whitespace||"full",findPositions:o,ruleFromNode:tz,context:p});if(o&&null!=o[0].pos){let e=o[0].pos,t=o[1]&&o[1].pos;null==t&&(t=e),m={anchor:e+d,head:t+d}}return{doc:y,sel:m,from:d,to:a}}(e,t,n),m=e.state.doc,b=m.slice(p.from,p.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(l=e.state.selection.to,d="end"):(l=e.state.selection.from,d="start"),e.input.lastKeyCode=null;let v=function(e,t,n,o,i){let s=e.findDiffStart(t,n);if(null==s)return null;let{a:r,b:l}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==i){let e=Math.max(0,s-Math.min(r,l));o-=r+e-s}if(r<s&&e.size<t.size){let e=o<=s&&o>=r?s-o:0;(s-=e)&&s<t.size&&tK(t.textBetween(s-1,s+1))&&(s+=e?1:-1),l=s+(l-r),r=s}else if(l<s){let t=o<=s&&o>=l?s-o:0;(s-=t)&&s<e.size&&tK(e.textBetween(s-1,s+1))&&(s+=t?1:-1),r=s+(r-l),l=s}return{start:s,endA:r,endB:l}}(b.content,p.doc.content,p.from,l,d);if(v&&e.input.domChangeCount++,(E&&e.input.lastIOSEnter>Date.now()-225||R)&&r.some(e=>1==e.nodeType&&!tI.test(e.nodeName))&&(!v||v.endA>=v.endB)&&e.someProp("handleKeyDown",t=>t(e,y(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!v){if(s&&f instanceof o.Bs&&!f.empty&&f.$head.sameParent(f.$anchor)&&!e.composing&&!(p.sel&&p.sel.anchor!=p.sel.head))v={start:f.from,endA:f.to,endB:f.to};else{if(p.sel){let t=tL(e,e.state.doc,p.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);c&&n.setMeta("composition",c),e.dispatch(n)}}return}}e.state.selection.from<e.state.selection.to&&v.start==v.endB&&e.state.selection instanceof o.Bs&&(v.start>e.state.selection.from&&v.start<=e.state.selection.from+2&&e.state.selection.from>=p.from?v.start=e.state.selection.from:v.endA<e.state.selection.to&&v.endA>=e.state.selection.to-2&&e.state.selection.to<=p.to&&(v.endB+=e.state.selection.to-v.endA,v.endA=e.state.selection.to)),O&&S<=11&&v.endB==v.start+1&&v.endA==v.start&&v.start>p.from&&" \xa0"==p.doc.textBetween(v.start-p.from-1,v.start-p.from+1)&&(v.start--,v.endA--,v.endB--);let w=p.doc.resolveNoCache(v.start-p.from),D=p.doc.resolveNoCache(v.endB-p.from),N=m.resolve(v.start),C=w.sameParent(D)&&w.parent.inlineContent&&N.end()>=v.endA;if((E&&e.input.lastIOSEnter>Date.now()-225&&(!C||r.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!C&&w.pos<p.doc.content.size&&(!w.sameParent(D)||!w.parent.inlineContent)&&w.pos<D.pos&&!/\S/.test(p.doc.textBetween(w.pos,D.pos,"","")))&&e.someProp("handleKeyDown",t=>t(e,y(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>v.start&&function(e,t,n,o,i){if(n-t<=i.pos-o.pos||tF(o,!0,!1)<i.pos)return!1;let s=e.resolve(t);if(!o.parent.isTextblock){let e=s.nodeAfter;return null!=e&&n==t+e.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let r=e.resolve(tF(s,!0,!0));return!(!r.parent.isTextblock||r.pos>n||tF(r,!0,!1)<n)&&o.parent.content.cut(o.parentOffset).eq(r.parent.content)}(m,v.start,v.endA,w,D)&&e.someProp("handleKeyDown",t=>t(e,y(8,"Backspace")))){R&&T&&e.domObserver.suppressSelectionUpdates();return}T&&v.endB==v.start&&(e.input.lastChromeDelete=Date.now()),R&&!C&&w.start()!=D.start()&&0==D.parentOffset&&w.depth==D.depth&&p.sel&&p.sel.anchor==p.sel.head&&p.sel.head==v.endA&&(v.endB-=2,D=p.doc.resolveNoCache(v.endB-p.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,y(13,"Enter"))})},20));let M=v.start,x=v.endA,k=t=>{let n=t||e.state.tr.replace(M,x,p.doc.slice(v.start-p.from,v.endB-p.from));if(p.sel){let t=tL(e,n.doc,p.sel);t&&!(T&&e.composing&&t.empty&&(v.start!=v.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==M||t.head==n.mapping.map(x)-1)||O&&t.empty&&t.head==M)&&n.setSelection(t)}return c&&n.setMeta("composition",c),n.scrollIntoView()};if(C){if(w.pos==D.pos){O&&S<=11&&0==w.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>eD(e),20));let t=k(e.state.tr.delete(M,x)),n=m.resolve(v.start).marksAcross(m.resolve(v.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(v.endA==v.endB&&(a=function(e,t){let n=e.firstChild.marks,o=t.firstChild.marks,s=n,r=o,l,d,a;for(let e=0;e<o.length;e++)s=o[e].removeFromSet(s);for(let e=0;e<n.length;e++)r=n[e].removeFromSet(r);if(1==s.length&&0==r.length)d=s[0],l="add",a=e=>e.mark(d.addToSet(e.marks));else{if(0!=s.length||1!=r.length)return null;d=r[0],l="remove",a=e=>e.mark(d.removeFromSet(e.marks))}let c=[];for(let e=0;e<t.childCount;e++)c.push(a(t.child(e)));if(i.HY.from(c).eq(e))return{mark:d,type:l}}(w.parent.content.cut(w.parentOffset,D.parentOffset),N.parent.content.cut(N.parentOffset,v.endA-N.start())))){let t=k(e.state.tr);"add"==a.type?t.addMark(M,x,a.mark):t.removeMark(M,x,a.mark),e.dispatch(t)}else if(w.parent.child(w.index()).isText&&w.index()==D.index()-(D.textOffset?0:1)){let t=w.parent.textBetween(w.parentOffset,D.parentOffset),n=()=>k(e.state.tr.insertText(t,M,x));e.someProp("handleTextInput",o=>o(e,M,x,t,n))||e.dispatch(n())}else e.dispatch(k())}else e.dispatch(k())})(this,e,t,n,s)),this.domObserver.start(),function(e){for(let t in eZ){let n=eZ[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}(e,t)||e6(e,t)||!e.editable&&t.type in e0||n(e,t)},e1[t]?{passive:!0}:void 0)}P&&e.dom.addEventListener("input",()=>null),e5(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;for(let t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&e5(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(tG),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];for(let n in t.state=this.state,e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n,o,i;let s=this.state,l=!1,d=!1;e.storedMarks&&this.composing&&(ti(this),d=!0),this.state=e;let a=s.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=tY(this);(function(e,t){let n=0,o=0;for(let o in e){if(e[o]!=t[o])return!0;n++}for(let e in t)o++;return n!=o})(e,this.nodeViews)&&(this.nodeViews=e,l=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&e5(this),this.editable=t_(this),tW(this);let c=tk(this),u=tH(this),f=s.plugins==e.plugins||s.doc.eq(e.doc)?e.scrollToSelection>s.scrollToSelection?"to selection":"preserve":"reset",g=l||!this.docView.matchesNode(e.doc,u,c);(g||!e.selection.eq(s.selection))&&(d=!0);let y="preserve"==f&&d&&null==this.dom.style.overflowAnchor&&function(e){let t,n,o=e.dom.getBoundingClientRect(),i=Math.max(0,o.top);for(let s=(o.left+o.right)/2,r=i+1;r<Math.min(innerHeight,o.bottom);r+=5){let o=e.root.elementFromPoint(s,r);if(!o||o==e.dom||!e.dom.contains(o))continue;let l=o.getBoundingClientRect();if(l.top>=i-20){t=o,n=l.top;break}}return{refDOM:t,refTop:n,stack:L(e.dom)}}(this);if(d){let t,n,d;this.domObserver.stop();let a=g&&(O||T)&&!this.composing&&!s.selection.empty&&!e.selection.empty&&(o=s.selection,i=e.selection,d=Math.min(o.$anchor.sharedDepth(o.head),i.$anchor.sharedDepth(i.head)),o.$anchor.start(d)!=i.$anchor.start(d));if(g){let t=T?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=p(e=e.childNodes[t-1])}else{if(!e.parentNode||m(e))return null;t=r(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),o=function(e,t){for(;;){if(3==e.nodeType&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||m(e))return null;t=r(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);if(n&&o&&n!=o){let t=o.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||o==i)return i;if(!t||!t.isText(o.nodeValue))return o;if(e.input.compositionNode==o){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return o}}return n||o}(this)),(l||!this.docView.update(e.doc,u,c,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=es(e.doc,u,c,this.dom,this)),t&&!this.trackWrites&&(a=!0)}a||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(t=this.docView.domFromPos(this.state.selection.anchor,0),n=this.domSelectionRange(),h(t.node,t.offset,n.anchorNode,n.anchorOffset)))?eD(this,a):(eM(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(s),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!s.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,s),"reset"==f?this.dom.scrollTop=0:"to selection"==f?this.scrollToSelection():y&&function({refDOM:e,refTop:t,stack:n}){let o=e?e.getBoundingClientRect().top:0;F(n,0==o?0:o-t)}(y)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(1==e.nodeType?e:e.parentNode)){if(this.someProp("handleScrollToSelection",e=>e(this)));else if(this.state.selection instanceof o.qv){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&I(this,t.getBoundingClientRect(),e)}else I(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}updateDraggedNode(e,t){let n=e.node,i=-1;if(this.state.doc.nodeAt(n.from)==n.node)i=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&this.state.doc.nodeAt(e))==n.node&&(i=e)}this.dragging=new ta(e.slice,e.move,i<0?void 0:o.qv.create(this.state.doc,i))}someProp(e,t){let n=this._props&&this._props[e],o;if(null!=n&&(o=t?t(n):n))return o;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(null!=i&&(o=t?t(i):i))return o}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let s=i[n].props[e];if(null!=s&&(o=t?t(s):s))return o}}hasFocus(){if(O){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(K)return e.focus(K);let t=L(e);e.focus(null==K?{get preventScroll(){return K={preventScroll:!0},!0}}:void 0),K||(K=!1,F(t,0))}(this.dom),eD(this),this.domObserver.start()}get root(){let e=this._root;if(null==e){for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return function(e,t){var n;let o,i,s=e.dom.ownerDocument,r,d=0,c=function(e,t,n){if(e.caretPositionFromPoint)try{let o=e.caretPositionFromPoint(t,n);if(o)return{node:o.offsetNode,offset:Math.min(p(o.offsetNode),o.offset)}}catch(e){}if(e.caretRangeFromPoint){let o=e.caretRangeFromPoint(t,n);if(o)return{node:o.startContainer,offset:Math.min(p(o.startContainer),o.startOffset)}}}(s,t.left,t.top);c&&({node:r,offset:d}=c);let h=(e.root.elementFromPoint?e.root:s).elementFromPoint(t.left,t.top);if(!h||!e.dom.contains(1!=h.nodeType?h.parentNode:h)){let n=e.dom.getBoundingClientRect();if(!$(t,n)||!(h=function e(t,n,o){let i=t.childNodes.length;if(i&&o.top<o.bottom)for(let s=Math.max(0,Math.min(i-1,Math.floor(i*(n.top-o.top)/(o.bottom-o.top))-2)),r=s;;){let o=t.childNodes[r];if(1==o.nodeType){let t=o.getClientRects();for(let i=0;i<t.length;i++){let s=t[i];if($(n,s))return e(o,n,s)}}if((r=(r+1)%i)==s)break}return t}(e.dom,t,n)))return null}if(P)for(let e=h;r&&e;e=l(e))e.draggable&&(r=void 0);if(h=(o=(n=h).parentNode)&&/^li$/i.test(o.nodeName)&&t.left<n.getBoundingClientRect().left?o:n,r){let n;if(M&&1==r.nodeType&&(d=Math.min(d,r.childNodes.length))<r.childNodes.length){let e=r.childNodes[d],n;"IMG"==e.nodeName&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&d++}B&&d&&1==r.nodeType&&1==(n=r.childNodes[d-1]).nodeType&&"false"==n.contentEditable&&n.getBoundingClientRect().top>=t.top&&d--,r==e.dom&&d==r.childNodes.length-1&&1==r.lastChild.nodeType&&t.top>r.lastChild.getBoundingClientRect().bottom?i=e.state.doc.content.size:(0==d||1!=r.nodeType||"BR"!=r.childNodes[d-1].nodeName)&&(i=function(e,t,n,o){let i=-1;for(let n=t,s=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),r;if(!t)return null;if(1==t.dom.nodeType&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((r=t.dom.getBoundingClientRect()).width||r.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!s&&r.left>o.left||r.top>o.top?i=t.posBefore:(!s&&r.right<o.left||r.bottom<o.top)&&(i=t.posAfter),s=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?o.top<(r.top+r.bottom)/2:o.left<(r.left+r.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}(e,r,d,t))}null==i&&(i=function(e,t,n){let{node:o,offset:i}=function e(t,n){let o,i,s,r=2e8,l,d=0,c=n.top,h=n.top;for(let e=t.firstChild,u=0;e;e=e.nextSibling,u++){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=a(e).getClientRects()}for(let a=0;a<t.length;a++){let f=t[a];if(f.top<=c&&f.bottom>=h){c=Math.max(f.bottom,c),h=Math.min(f.top,h);let t=f.left>n.left?f.left-n.left:f.right<n.left?n.left-f.right:0;if(t<r){s=e,r=t,l=t&&3==s.nodeType?{left:f.right<n.left?f.right:f.left,top:n.top}:n,1==e.nodeType&&t&&(d=u+(n.left>=(f.left+f.right)/2?1:0));continue}}else f.top>n.top&&!o&&f.left<=n.left&&f.right>=n.left&&(o=e,i={left:Math.max(f.left,Math.min(f.right,n.left)),top:f.top});!s&&(n.left>=f.right&&n.top>=f.top||n.left>=f.left&&n.top>=f.bottom)&&(d=u+1)}}return(!s&&o&&(s=o,l=i,r=0),s&&3==s.nodeType)?function(e,t){let n=e.nodeValue.length,o=document.createRange(),i;for(let s=0;s<n;s++){o.setEnd(e,s+1),o.setStart(e,s);let n=W(o,1);if(n.top!=n.bottom&&$(t,n)){i={node:e,offset:s+(t.left>=(n.left+n.right)/2?1:0)};break}}return o.detach(),i||{node:e,offset:0}}(s,l):!s||r&&1==s.nodeType?{node:t,offset:d}:e(s,l)}(t,n),s=-1;if(1==o.nodeType&&!o.firstChild){let e=o.getBoundingClientRect();s=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(o,i,s)}(e,h,t));let u=e.docView.nearestDesc(h,!0);return{pos:i,inside:u?u.posAtStart-u.border:-1}}(this,e)}coordsAtPos(e,t=1){return Y(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let o=this.docView.posFromDOM(e,t,n);if(null==o)throw RangeError("DOM position not inside the editor");return o}endOfTextblock(e,t){var n,o,i;let s,r;return n=this,o=t||this.state,i=e,J==o&&Q==i?Z:(J=o,Q=i,Z="up"==i||"down"==i?(s=o.selection,r="up"==i?s.$from:s.$to,j(n,o,()=>{let{node:e}=n.docView.domFromPos(r.pos,"up"==i?-1:1);for(;;){let t=n.docView.nearestDesc(e,!0);if(!t)break;if(t.node.isBlock){e=t.contentDOM||t.dom;break}e=t.dom.parentNode}let t=Y(n,r.pos,1);for(let n=e.firstChild;n;n=n.nextSibling){let e;if(1==n.nodeType)e=n.getClientRects();else{if(3!=n.nodeType)continue;e=a(n,0,n.nodeValue.length).getClientRects()}for(let n=0;n<e.length;n++){let o=e[n];if(o.bottom>o.top+1&&("up"==i?t.top-o.top>(o.bottom-t.top)*2:o.bottom-t.bottom>(t.bottom-o.top)*2))return!1}}return!0})):function(e,t,n){let{$head:o}=t.selection;if(!o.parent.isTextblock)return!1;let i=o.parentOffset,s=i==o.parent.content.size,r=e.domSelection();return r?X.test(o.parent.textContent)&&r.modify?j(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:s,anchorOffset:l}=e.domSelectionRange(),d=r.caretBidiLevel;r.modify("move",n,"character");let a=o.depth?e.docView.domAfterPos(o.before()):e.dom,{focusNode:c,focusOffset:h}=e.domSelectionRange(),u=c&&!a.contains(1==c.nodeType?c:c.parentNode)||t==c&&i==h;try{r.collapse(s,l),t&&(t!=s||i!=l)&&r.extend&&r.extend(t,i)}catch(e){}return null!=d&&(r.caretBidiLevel=d),u}):"left"==n||"backward"==n?!i:s:o.pos==o.start()||o.pos==o.end()}(n,o,i))}pasteHTML(e,t){return tl(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return tl(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return eH(this,e)}destroy(){this.docView&&(!function(e){for(let t in e.domObserver.stop(),e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],tk(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,c())}get isDestroyed(){return null==this.docView}dispatchEvent(e){e6(this,e)||!eZ[e.type]||!this.editable&&e.type in e0||eZ[e.type](this,e)}domSelectionRange(){let e=this.domSelection();return e?P&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){let n;if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return tq(e,n)}function o(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",o,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",o,!0),n?tq(e,n):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function tH(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))}),t.translate||(t.translate="no"),[tg.node(0,e.state.doc.content.size,t)]}function tW(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:tg.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function t_(e){return!e.someProp("editable",t=>!1===t(e.state))}function tY(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function tG(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError("Plugins passed directly to the view must not have a state component")}t$.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7214],{79205:function(e,s,a){a.d(s,{Z:function(){return d}});var l=a(2265);let n=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),r=function(){for(var e=arguments.length,s=Array(e),a=0;a<e;a++)s[a]=arguments[a];return s.filter((e,s,a)=>!!e&&a.indexOf(e)===s).join(" ")};var t={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,l.forwardRef)((e,s)=>{let{color:a="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:d,className:c="",children:o,iconNode:u,...h}=e;return(0,l.createElement)("svg",{ref:s,...t,width:n,height:n,stroke:a,strokeWidth:d?24*Number(i)/Number(n):i,className:r("lucide",c),...h},[...u.map(e=>{let[s,a]=e;return(0,l.createElement)(s,a)}),...Array.isArray(o)?o:[o]])}),d=(e,s)=>{let a=(0,l.forwardRef)((a,t)=>{let{className:d,...c}=a;return(0,l.createElement)(i,{ref:t,iconNode:s,className:r("lucide-".concat(n(e)),d),...c})});return a.displayName="".concat(e),a}},54001:function(e,s,a){a.d(s,{Z:function(){return l}});let l=(0,a(79205).Z)("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]])},51817:function(e,s,a){a.d(s,{Z:function(){return l}});let l=(0,a(79205).Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},29090:function(e,s,a){a.d(s,{Z:function(){return l}});let l=(0,a(79205).Z)("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]])},88906:function(e,s,a){a.d(s,{Z:function(){return l}});let l=(0,a(79205).Z)("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]])},65422:function(e,s,a){a.d(s,{t:function(){return P}});var l=a(57437),n=a(2265),r=a(72135),t=a(72337),i=a(74291),d=a(12381),c=a(40279),o=a(75060),u=a(32060),h=a(15291),x=a(12749),m=a(2596),p=a(69174),j=a(67782),v=a(42208),f=a(15868),g=a(29090),N=a(54001),C=a(88906);let w=(0,a(79205).Z)("UserCog",[["circle",{cx:"18",cy:"15",r:"3",key:"gjjjvw"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M10 15H6a4 4 0 0 0-4 4v2",key:"1nfge6"}],["path",{d:"m21.7 16.4-.9-.3",key:"12j9ji"}],["path",{d:"m15.2 13.9-.9-.3",key:"1fdjdi"}],["path",{d:"m16.6 18.7.3-.9",key:"heedtr"}],["path",{d:"m19.1 12.2.3-.9",key:"1af3ki"}],["path",{d:"m19.6 18.7-.4-1",key:"1x9vze"}],["path",{d:"m16.8 12.3-.4-1",key:"vqeiwj"}],["path",{d:"m14.3 16.6 1-.4",key:"1qlj63"}],["path",{d:"m20.7 13.8 1-.4",key:"1v5t8k"}]]);var y=a(40875),k=a(30401),S=a(32489),b=a(14438),I=a(81853),A=a(93448),Z=a(99246);function P(e){let{excludeColumns:s=[]}=e,{isMultiTenant:a}=(0,I.PY)(),[P,_]=(0,n.useState)("all"),[z,L]=(0,n.useState)("all"),[q,E]=(0,n.useState)("all"),[R,V]=(0,n.useState)(""),M=(0,Z.N)(R,300),[O,T]=(0,n.useState)(!1),[B,Q]=(0,n.useState)(null),[F,U]=(0,n.useState)(!1),[$,K]=(0,n.useState)(!1),[X,Y]=(0,n.useState)(!1),[D,W]=(0,n.useState)(!1),[H,J]=(0,n.useState)(""),[G,ee]=(0,n.useState)(""),[es,ea]=(0,n.useState)([]),[el,en]=(0,n.useState)(""),[er,et]=(0,n.useState)(null),[ei,ed]=(0,n.useState)(!1),[ec,eo]=(0,n.useState)(""),[eu,eh]=(0,n.useState)(""),ex=(0,Z.N)(ec,300),{mutate:em}=(0,r.PQ)(),{mutate:ep}=(0,r.uC)(),{data:ej}=(0,r.sm)({resource:"baasix_Role",pagination:{mode:"off"}}),ev=(null==ej?void 0:ej.data)||[],{data:ef,isLoading:eg}=(0,r.sm)({resource:"baasix_Tenant",pagination:{current:1,pageSize:20},filters:M?[{field:"name",operator:"contains",value:M}]:[],queryOptions:{enabled:a}}),eN=(null==ef?void 0:ef.data)||[],{data:eC,isLoading:ew}=(0,r.sm)({resource:"baasix_Tenant",pagination:{current:1,pageSize:20},filters:ex?[{field:"name",operator:"contains",value:ex}]:[],queryOptions:{enabled:a&&ei}}),ey=(null==eC?void 0:eC.data)||[],{data:ek,isLoading:eS,refetch:eb}=(0,r.sm)({resource:"baasix_UserRole",filters:B?[{field:"user_Id",operator:"eq",value:B.id}]:[],pagination:{mode:"off"},queryOptions:{enabled:!!B&&$}}),{data:eI,isLoading:eA}=(0,r.sm)({resource:"baasix_Account",filters:B?[{field:"user_Id",operator:"eq",value:B.id}]:[],pagination:{mode:"off"},queryOptions:{enabled:!!B&&D}}),eZ=(null==eI?void 0:eI.data)||[];(0,n.useEffect)(()=>{(null==ek?void 0:ek.data)&&$&&ea(ek.data.map(e=>({roleId:e.role_Id,tenantId:e.tenant_Id||void 0})).filter(e=>e.roleId))},[ek,$]);let eP=(0,n.useMemo)(()=>{let e=[];return"all"!==P&&e.push({field:"status",operator:"eq",value:P}),"all"!==z&&e.push({field:"userRoles.role_Id",operator:"eq",value:z}),"all"!==q&&e.push({field:"userRoles.tenant_Id",operator:"eq",value:q}),e},[P,z,q]),e_=(0,n.useMemo)(()=>{if("all"===q)return"All Tenants";let e=eN.find(e=>e.id===q);return(null==e?void 0:e.name)||q},[q,eN]),ez=(0,n.useCallback)(e=>{Q(e),J(""),ee(""),U(!0)},[]),eL=(0,n.useCallback)(e=>{Q(e),ea([]),K(!0)},[]),eq=(0,n.useCallback)(e=>{Q(e),W(!0)},[]),eE=(0,n.useCallback)(e=>{Q(e),en(e.status||"active"),Y(!0)},[]),eR=e=>{let s=ev.find(s=>s.id===e);s&&(s.isTenantSpecific&&a?(et({roleId:e,roleName:s.name}),eo(""),ed(!0)):(es.find(s=>s.roleId===e)||ea([...es,{roleId:e}]),eh("")))},eV=e=>{er&&(es.find(s=>s.roleId===er.roleId&&s.tenantId===e)||ea([...es,{roleId:er.roleId,tenantId:e}]),ed(!1),et(null),eh(""))},eM=(e,s)=>{ea(es.filter(a=>!(a.roleId===e&&a.tenantId===s)))},eO=e=>{let s=ev.find(s=>s.id===e);return(null==s?void 0:s.name)||e},eT=e=>{let s=[...eN,...ey].find(s=>s.id===e);return(null==s?void 0:s.name)||e},eB=(0,n.useCallback)(e=>{let{record:s,onView:a,onEdit:n}=e;return(0,l.jsxs)(u.h_,{children:[(0,l.jsx)(u.$F,{asChild:!0,children:(0,l.jsx)(d.z,{variant:"ghost",size:"icon",children:(0,l.jsx)(j.Z,{className:"h-4 w-4"})})}),(0,l.jsxs)(u.AW,{align:"end",children:[(0,l.jsxs)(u.Xi,{onClick:a,children:[(0,l.jsx)(v.Z,{className:"mr-2 h-4 w-4"}),"View"]}),(0,l.jsxs)(u.Xi,{onClick:n,children:[(0,l.jsx)(f.Z,{className:"mr-2 h-4 w-4"}),"Edit"]}),(0,l.jsxs)(u.Xi,{onClick:()=>eq(s),children:[(0,l.jsx)(g.Z,{className:"mr-2 h-4 w-4"}),"Login Methods"]}),(0,l.jsxs)(u.Xi,{onClick:()=>ez(s),children:[(0,l.jsx)(N.Z,{className:"mr-2 h-4 w-4"}),"Change Password"]}),(0,l.jsxs)(u.Xi,{onClick:()=>eL(s),children:[(0,l.jsx)(C.Z,{className:"mr-2 h-4 w-4"}),"Manage Roles"]}),(0,l.jsxs)(u.Xi,{onClick:()=>eE(s),children:[(0,l.jsx)(w,{className:"mr-2 h-4 w-4"}),"Change Status"]})]})]})},[ez,eL,eE,eq]),eQ=(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)(h.Ph,{value:P,onValueChange:_,children:[(0,l.jsx)(h.i4,{className:"w-[130px] h-9",children:(0,l.jsx)(h.ki,{placeholder:"Status"})}),(0,l.jsxs)(h.Bw,{children:[(0,l.jsx)(h.Ql,{value:"all",children:"All Status"}),(0,l.jsx)(h.Ql,{value:"active",children:"Active"}),(0,l.jsx)(h.Ql,{value:"inactive",children:"Inactive"}),(0,l.jsx)(h.Ql,{value:"suspended",children:"Suspended"})]})]}),(0,l.jsxs)(h.Ph,{value:z,onValueChange:L,children:[(0,l.jsx)(h.i4,{className:"w-[150px] h-9",children:(0,l.jsx)(h.ki,{placeholder:"Role"})}),(0,l.jsxs)(h.Bw,{children:[(0,l.jsx)(h.Ql,{value:"all",children:"All Roles"}),ev.map(e=>(0,l.jsx)(h.Ql,{value:e.id,children:e.name},e.id))]})]}),a&&(0,l.jsxs)(x.J2,{open:O,onOpenChange:T,children:[(0,l.jsx)(x.xo,{asChild:!0,children:(0,l.jsxs)(d.z,{variant:"outline",role:"combobox","aria-expanded":O,className:"w-[180px] h-9 justify-between",children:[(0,l.jsx)("span",{className:"truncate",children:e_}),(0,l.jsx)(y.Z,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,l.jsx)(x.yk,{className:"w-[200px] p-0",children:(0,l.jsxs)(m.mY,{children:[(0,l.jsx)(m.sZ,{placeholder:"Search tenants...",value:R,onValueChange:V}),(0,l.jsxs)(m.e8,{children:[(0,l.jsx)(m.rb,{children:eg?"Loading...":"No tenants found"}),(0,l.jsxs)(m.fu,{children:[(0,l.jsxs)(m.di,{value:"all",onSelect:()=>{E("all"),T(!1)},children:[(0,l.jsx)(k.Z,{className:(0,A.cn)("mr-2 h-4 w-4","all"===q?"opacity-100":"opacity-0")}),"All Tenants"]}),eN.map(e=>(0,l.jsxs)(m.di,{value:e.name,onSelect:()=>{E(e.id),T(!1)},children:[(0,l.jsx)(k.Z,{className:(0,A.cn)("mr-2 h-4 w-4",q===e.id?"opacity-100":"opacity-0")}),e.name]},e.id))]})]})]})})]})]});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(t.DataBrowserInner,{selectedCollection:"baasix_User",title:"Users",permanentFilters:eP,quickFilters:eQ,renderRowActions:eB,enableView:!0,enableEdit:!0,defaultVisibleColumns:["fullName","email","phone","status","lastAccess","createdAt"]}),(0,l.jsx)(i.Vq,{open:F,onOpenChange:U,children:(0,l.jsxs)(i.cZ,{children:[(0,l.jsxs)(i.fK,{children:[(0,l.jsx)(i.$N,{children:"Change Password"}),(0,l.jsxs)(i.Be,{children:["Change password for ",null==B?void 0:B.email]})]}),(0,l.jsxs)("div",{className:"grid gap-4 py-4",children:[(0,l.jsxs)("div",{className:"grid gap-2",children:[(0,l.jsx)(o._,{htmlFor:"newPassword",children:"New Password"}),(0,l.jsx)(c.I,{id:"newPassword",type:"password",value:H,onChange:e=>J(e.target.value)})]}),(0,l.jsxs)("div",{className:"grid gap-2",children:[(0,l.jsx)(o._,{htmlFor:"confirmPassword",children:"Confirm Password"}),(0,l.jsx)(c.I,{id:"confirmPassword",type:"password",value:G,onChange:e=>ee(e.target.value)})]})]}),(0,l.jsxs)(i.cN,{children:[(0,l.jsx)(d.z,{variant:"outline",onClick:()=>U(!1),children:"Cancel"}),(0,l.jsx)(d.z,{onClick:()=>{if(!H){b.Am.error("Please enter a new password");return}if(H!==G){b.Am.error("Passwords do not match");return}ep({url:"/auth/admin/password/change",method:"post",values:{userId:B.id,newPassword:H}},{onSuccess:()=>{b.Am.success("Password changed successfully"),U(!1),J(""),ee("")},onError:e=>{var s,a,l,n,r;let t=(null==e?void 0:null===(a=e.response)||void 0===a?void 0:null===(s=a.data)||void 0===s?void 0:s.message)||(null==e?void 0:null===(r=e.response)||void 0===r?void 0:null===(n=r.data)||void 0===n?void 0:null===(l=n.error)||void 0===l?void 0:l.message)||(null==e?void 0:e.message)||"Failed to change password";b.Am.error(t)}})},children:"Change Password"})]})]})}),(0,l.jsx)(i.Vq,{open:$,onOpenChange:K,children:(0,l.jsxs)(i.cZ,{className:"max-w-lg",children:[(0,l.jsxs)(i.fK,{children:[(0,l.jsx)(i.$N,{children:"Manage Roles"}),(0,l.jsxs)(i.Be,{children:["Manage roles for ",null==B?void 0:B.email]})]}),(0,l.jsxs)("div",{className:"grid gap-4 py-4",children:[(0,l.jsx)("div",{className:"flex flex-wrap gap-2",children:eS?(0,l.jsx)("span",{className:"text-muted-foreground text-sm",children:"Loading roles..."}):0===es.length?(0,l.jsx)("span",{className:"text-muted-foreground text-sm",children:"No roles assigned"}):es.map((e,s)=>(0,l.jsxs)(p.C,{variant:"secondary",className:"flex items-center gap-1",children:[eO(e.roleId),e.tenantId&&(0,l.jsxs)("span",{className:"text-xs opacity-70",children:["(",eT(e.tenantId),")"]}),(0,l.jsx)("button",{type:"button",onClick:()=>eM(e.roleId,e.tenantId),className:"ml-1 hover:text-destructive",children:(0,l.jsx)(S.Z,{className:"h-3 w-3"})})]},s))}),(0,l.jsxs)("div",{className:"grid gap-2",children:[(0,l.jsx)(o._,{children:"Add Role"}),(0,l.jsxs)(h.Ph,{value:eu,onValueChange:e=>{eh(e),eR(e)},children:[(0,l.jsx)(h.i4,{children:(0,l.jsx)(h.ki,{placeholder:"Select a role to add"})}),(0,l.jsx)(h.Bw,{children:ev.map(e=>(0,l.jsxs)(h.Ql,{value:e.id,children:[e.name,e.isTenantSpecific&&(0,l.jsx)("span",{className:"ml-1 text-xs opacity-70",children:"(Tenant Specific)"})]},e.id))})]})]})]}),(0,l.jsxs)(i.cN,{children:[(0,l.jsx)(d.z,{variant:"outline",onClick:()=>K(!1),children:"Cancel"}),(0,l.jsx)(d.z,{onClick:()=>{let e=es.map(e=>({role_Id:e.roleId,tenant_Id:e.tenantId}));em({resource:"baasix_User",id:B.id,values:{userRoles:e}},{onSuccess:()=>{b.Am.success("Roles updated successfully"),K(!1)},onError:e=>{b.Am.error((null==e?void 0:e.message)||"Failed to update roles")}})},children:"Save Roles"})]})]})}),(0,l.jsx)(i.Vq,{open:ei,onOpenChange:e=>{ed(e),e||(et(null),eh(""))},children:(0,l.jsxs)(i.cZ,{children:[(0,l.jsxs)(i.fK,{children:[(0,l.jsx)(i.$N,{children:"Select Tenant"}),(0,l.jsxs)(i.Be,{children:["Select a tenant for the role: ",null==er?void 0:er.roleName]})]}),(0,l.jsx)("div",{className:"py-4",children:(0,l.jsxs)(m.mY,{children:[(0,l.jsx)(m.sZ,{placeholder:"Search tenants...",value:ec,onValueChange:eo}),(0,l.jsxs)(m.e8,{children:[(0,l.jsx)(m.rb,{children:ew?"Loading...":"No tenants found"}),(0,l.jsx)(m.fu,{children:ey.map(e=>(0,l.jsx)(m.di,{value:e.name,onSelect:()=>eV(e.id),children:e.name},e.id))})]})]})}),(0,l.jsx)(i.cN,{children:(0,l.jsx)(d.z,{variant:"outline",onClick:()=>{ed(!1),et(null),eh("")},children:"Cancel"})})]})}),(0,l.jsx)(i.Vq,{open:D,onOpenChange:W,children:(0,l.jsxs)(i.cZ,{children:[(0,l.jsxs)(i.fK,{children:[(0,l.jsx)(i.$N,{children:"Login Methods"}),(0,l.jsxs)(i.Be,{children:["Connected login methods for ",null==B?void 0:B.email]})]}),(0,l.jsx)("div",{className:"py-4",children:eA?(0,l.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,l.jsx)("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):0===eZ.length?(0,l.jsx)("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No login methods found"}):(0,l.jsx)("div",{className:"space-y-3",children:eZ.map(e=>(0,l.jsxs)("div",{className:"flex items-center justify-between p-3 border rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:(0,A.cn)("w-8 h-8 rounded-full flex items-center justify-center text-white text-xs font-medium","credential"===e.providerId&&"bg-slate-600","google"===e.providerId&&"bg-red-500","facebook"===e.providerId&&"bg-blue-600","github"===e.providerId&&"bg-gray-800","apple"===e.providerId&&"bg-black",!["credential","google","facebook","github","apple"].includes(e.providerId)&&"bg-purple-500"),children:"credential"===e.providerId?"EP":e.providerId.substring(0,2).toUpperCase()}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-sm font-medium capitalize",children:"credential"===e.providerId?"Email & Password":e.providerId}),(0,l.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Connected ",e.createdAt?new Date(e.createdAt).toLocaleDateString():"N/A"]})]})]}),(0,l.jsx)(p.C,{variant:"outline",className:"capitalize",children:"credential"===e.providerId?"Local":"OAuth"})]},e.id))})}),(0,l.jsx)(i.cN,{children:(0,l.jsx)(d.z,{variant:"outline",onClick:()=>W(!1),children:"Close"})})]})}),(0,l.jsx)(i.Vq,{open:X,onOpenChange:Y,children:(0,l.jsxs)(i.cZ,{children:[(0,l.jsxs)(i.fK,{children:[(0,l.jsx)(i.$N,{children:"Change Status"}),(0,l.jsxs)(i.Be,{children:["Change status for ",null==B?void 0:B.email]})]}),(0,l.jsx)("div",{className:"grid gap-4 py-4",children:(0,l.jsxs)("div",{className:"grid gap-2",children:[(0,l.jsx)(o._,{children:"Status"}),(0,l.jsxs)(h.Ph,{value:el,onValueChange:en,children:[(0,l.jsx)(h.i4,{children:(0,l.jsx)(h.ki,{placeholder:"Select status"})}),(0,l.jsxs)(h.Bw,{children:[(0,l.jsx)(h.Ql,{value:"active",children:"Active"}),(0,l.jsx)(h.Ql,{value:"inactive",children:"Inactive"}),(0,l.jsx)(h.Ql,{value:"suspended",children:"Suspended"})]})]})]})}),(0,l.jsxs)(i.cN,{children:[(0,l.jsx)(d.z,{variant:"outline",onClick:()=>Y(!1),children:"Cancel"}),(0,l.jsx)(d.z,{onClick:()=>{em({resource:"baasix_User",id:B.id,values:{status:el}},{onSuccess:()=>{b.Am.success("Status updated successfully"),Y(!1)},onError:e=>{b.Am.error((null==e?void 0:e.message)||"Failed to update status")}})},children:"Update Status"})]})]})})]})}},99246:function(e,s,a){a.d(s,{N:function(){return n}});var l=a(2265);function n(e,s){let[a,n]=(0,l.useState)(e);return(0,l.useEffect)(()=>{let a=setTimeout(()=>{n(e)},s);return()=>{clearTimeout(a)}},[e,s]),a}},81853:function(e,s,a){a.d(s,{Ml:function(){return i},PY:function(){return t}});var l=a(57437),n=a(2265);let r=(0,n.createContext)({projectSettings:null,isMultiTenant:!1,isLoading:!0,refetch:()=>{}}),t=()=>n.useContext(r)||(console.warn("useProject used outside of ProjectContextProvider, using defaults"),{projectSettings:null,isMultiTenant:!1,isLoading:!1,refetch:()=>{}}),i=e=>{let{children:s,baasixClient:a}=e,[t,i]=(0,n.useState)(null),[d,c]=(0,n.useState)(!0),o=(0,n.useCallback)(async()=>{try{c(!0);let e=await a.server.info();i(null==e?void 0:e.project)}catch(e){console.error("Failed to fetch project settings",e)}finally{c(!1)}},[a]);(0,n.useEffect)(()=>{o()},[o]);let u=(null==t?void 0:t.multitenant)===!0||(null==t?void 0:t.multitenant)==="true";return(0,l.jsx)(r.Provider,{value:{projectSettings:t,isMultiTenant:u,isLoading:d,refetch:o},children:s})}}}]);