@mndrk/agx 2.0.22 → 2.0.24
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.
- package/cloud-runtime/standalone/.next/BUILD_ID +1 -1
- package/cloud-runtime/standalone/.next/app-path-routes-manifest.json +1 -0
- package/cloud-runtime/standalone/.next/build-manifest.json +6 -6
- package/cloud-runtime/standalone/.next/prerender-manifest.json +3 -3
- package/cloud-runtime/standalone/.next/routes-manifest.json +6 -0
- package/cloud-runtime/standalone/.next/server/app/_global-error/page/build-manifest.json +4 -4
- package/cloud-runtime/standalone/.next/server/app/_global-error/page.js +2 -2
- package/cloud-runtime/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/cloud-runtime/standalone/.next/server/app/_global-error.html +2 -2
- package/cloud-runtime/standalone/.next/server/app/_global-error.rsc +1 -1
- package/cloud-runtime/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/cloud-runtime/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/cloud-runtime/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/cloud-runtime/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/cloud-runtime/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/cloud-runtime/standalone/.next/server/app/_not-found/page/build-manifest.json +4 -4
- package/cloud-runtime/standalone/.next/server/app/_not-found/page.js +6 -5
- package/cloud-runtime/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/cloud-runtime/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/.next/server/app/_not-found.html +14 -2
- package/cloud-runtime/standalone/.next/server/app/_not-found.rsc +11 -11
- package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +11 -11
- package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +3 -3
- package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +7 -7
- package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/cloud-runtime/standalone/.next/server/app/agents/[id]/page/build-manifest.json +4 -4
- package/cloud-runtime/standalone/.next/server/app/agents/[id]/page.js +5 -5
- package/cloud-runtime/standalone/.next/server/app/agents/[id]/page.js.nft.json +1 -1
- package/cloud-runtime/standalone/.next/server/app/agents/[id]/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/.next/server/app/agents/page/build-manifest.json +4 -4
- package/cloud-runtime/standalone/.next/server/app/agents/page.js +5 -5
- package/cloud-runtime/standalone/.next/server/app/agents/page.js.nft.json +1 -1
- package/cloud-runtime/standalone/.next/server/app/agents/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/.next/server/app/agents.html +14 -2
- package/cloud-runtime/standalone/.next/server/app/agents.rsc +10 -10
- package/cloud-runtime/standalone/.next/server/app/agents.segments/_full.segment.rsc +10 -10
- package/cloud-runtime/standalone/.next/server/app/agents.segments/_head.segment.rsc +3 -3
- package/cloud-runtime/standalone/.next/server/app/agents.segments/_index.segment.rsc +4 -4
- package/cloud-runtime/standalone/.next/server/app/agents.segments/_tree.segment.rsc +2 -2
- package/cloud-runtime/standalone/.next/server/app/agents.segments/agents/__PAGE__.segment.rsc +4 -4
- package/cloud-runtime/standalone/.next/server/app/agents.segments/agents.segment.rsc +3 -3
- package/cloud-runtime/standalone/.next/server/app/api/file-search/route.js.nft.json +1 -1
- package/cloud-runtime/standalone/.next/server/app/api/filesystem/browse/route/app-paths-manifest.json +3 -0
- package/cloud-runtime/standalone/.next/server/app/api/filesystem/browse/route/build-manifest.json +11 -0
- package/cloud-runtime/standalone/.next/server/app/api/filesystem/browse/route/server-reference-manifest.json +4 -0
- package/cloud-runtime/standalone/.next/server/app/api/filesystem/browse/route.js +7 -0
- package/cloud-runtime/standalone/.next/server/app/api/filesystem/browse/route.js.map +5 -0
- package/cloud-runtime/standalone/.next/server/app/api/filesystem/browse/route.js.nft.json +1 -0
- package/cloud-runtime/standalone/.next/server/app/api/filesystem/browse/route_client-reference-manifest.js +2 -0
- package/cloud-runtime/standalone/.next/server/app/api/providers/route.js +1 -1
- package/cloud-runtime/standalone/.next/server/app/api/providers/route.js.nft.json +1 -1
- package/cloud-runtime/standalone/.next/server/app/api/status/route.js +1 -1
- package/cloud-runtime/standalone/.next/server/app/api/status/route.js.nft.json +1 -1
- package/cloud-runtime/standalone/.next/server/app/automations/page/build-manifest.json +4 -4
- package/cloud-runtime/standalone/.next/server/app/automations/page.js +5 -5
- package/cloud-runtime/standalone/.next/server/app/automations/page.js.nft.json +1 -1
- package/cloud-runtime/standalone/.next/server/app/automations/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/.next/server/app/automations.html +14 -2
- package/cloud-runtime/standalone/.next/server/app/automations.rsc +11 -11
- package/cloud-runtime/standalone/.next/server/app/automations.segments/_full.segment.rsc +11 -11
- package/cloud-runtime/standalone/.next/server/app/automations.segments/_head.segment.rsc +3 -3
- package/cloud-runtime/standalone/.next/server/app/automations.segments/_index.segment.rsc +4 -4
- package/cloud-runtime/standalone/.next/server/app/automations.segments/_tree.segment.rsc +3 -3
- package/cloud-runtime/standalone/.next/server/app/automations.segments/automations/__PAGE__.segment.rsc +5 -5
- package/cloud-runtime/standalone/.next/server/app/automations.segments/automations.segment.rsc +3 -3
- package/cloud-runtime/standalone/.next/server/app/board/page/build-manifest.json +4 -4
- package/cloud-runtime/standalone/.next/server/app/board/page.js +6 -6
- package/cloud-runtime/standalone/.next/server/app/board/page.js.nft.json +1 -1
- package/cloud-runtime/standalone/.next/server/app/board/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/.next/server/app/board.html +14 -2
- package/cloud-runtime/standalone/.next/server/app/board.rsc +8 -8
- package/cloud-runtime/standalone/.next/server/app/board.segments/_full.segment.rsc +8 -8
- package/cloud-runtime/standalone/.next/server/app/board.segments/_head.segment.rsc +3 -3
- package/cloud-runtime/standalone/.next/server/app/board.segments/_index.segment.rsc +4 -4
- package/cloud-runtime/standalone/.next/server/app/board.segments/_tree.segment.rsc +2 -2
- package/cloud-runtime/standalone/.next/server/app/board.segments/board/__PAGE__.segment.rsc +2 -2
- package/cloud-runtime/standalone/.next/server/app/board.segments/board.segment.rsc +3 -3
- package/cloud-runtime/standalone/.next/server/app/execution-graph/page/build-manifest.json +4 -4
- package/cloud-runtime/standalone/.next/server/app/execution-graph/page.js +5 -5
- package/cloud-runtime/standalone/.next/server/app/execution-graph/page.js.nft.json +1 -1
- package/cloud-runtime/standalone/.next/server/app/execution-graph/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/.next/server/app/execution-graph.html +14 -2
- package/cloud-runtime/standalone/.next/server/app/execution-graph.rsc +10 -10
- package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/_full.segment.rsc +10 -10
- package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/_head.segment.rsc +3 -3
- package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/_index.segment.rsc +4 -4
- package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/_tree.segment.rsc +2 -2
- package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/execution-graph/__PAGE__.segment.rsc +4 -4
- package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/execution-graph.segment.rsc +3 -3
- package/cloud-runtime/standalone/.next/server/app/index.html +14 -2
- package/cloud-runtime/standalone/.next/server/app/index.rsc +10 -10
- package/cloud-runtime/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
- package/cloud-runtime/standalone/.next/server/app/index.segments/_full.segment.rsc +10 -10
- package/cloud-runtime/standalone/.next/server/app/index.segments/_head.segment.rsc +3 -3
- package/cloud-runtime/standalone/.next/server/app/index.segments/_index.segment.rsc +4 -4
- package/cloud-runtime/standalone/.next/server/app/index.segments/_tree.segment.rsc +3 -3
- package/cloud-runtime/standalone/.next/server/app/page/build-manifest.json +4 -4
- package/cloud-runtime/standalone/.next/server/app/page.js +5 -5
- package/cloud-runtime/standalone/.next/server/app/page.js.nft.json +1 -1
- package/cloud-runtime/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/.next/server/app/projects/[slug]/graph/[taskId]/page/build-manifest.json +4 -4
- package/cloud-runtime/standalone/.next/server/app/projects/[slug]/graph/[taskId]/page.js +5 -5
- package/cloud-runtime/standalone/.next/server/app/projects/[slug]/graph/[taskId]/page.js.nft.json +1 -1
- package/cloud-runtime/standalone/.next/server/app/projects/[slug]/graph/[taskId]/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/.next/server/app/projects/[slug]/page/build-manifest.json +4 -4
- package/cloud-runtime/standalone/.next/server/app/projects/[slug]/page.js +5 -5
- package/cloud-runtime/standalone/.next/server/app/projects/[slug]/page.js.nft.json +1 -1
- package/cloud-runtime/standalone/.next/server/app/projects/[slug]/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/.next/server/app/projects/orphans/page/build-manifest.json +4 -4
- package/cloud-runtime/standalone/.next/server/app/projects/orphans/page.js +5 -5
- package/cloud-runtime/standalone/.next/server/app/projects/orphans/page.js.nft.json +1 -1
- package/cloud-runtime/standalone/.next/server/app/projects/orphans/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/.next/server/app/projects/orphans.html +13 -1
- package/cloud-runtime/standalone/.next/server/app/projects/orphans.rsc +10 -10
- package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/_full.segment.rsc +10 -10
- package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/_head.segment.rsc +3 -3
- package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/_index.segment.rsc +4 -4
- package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/_tree.segment.rsc +2 -2
- package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/projects/orphans/__PAGE__.segment.rsc +4 -4
- package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/projects/orphans.segment.rsc +3 -3
- package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/projects.segment.rsc +3 -3
- package/cloud-runtime/standalone/.next/server/app/projects/page/build-manifest.json +4 -4
- package/cloud-runtime/standalone/.next/server/app/projects/page.js +5 -5
- package/cloud-runtime/standalone/.next/server/app/projects/page.js.nft.json +1 -1
- package/cloud-runtime/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/.next/server/app/projects.html +14 -2
- package/cloud-runtime/standalone/.next/server/app/projects.rsc +10 -10
- package/cloud-runtime/standalone/.next/server/app/projects.segments/_full.segment.rsc +10 -10
- package/cloud-runtime/standalone/.next/server/app/projects.segments/_head.segment.rsc +3 -3
- package/cloud-runtime/standalone/.next/server/app/projects.segments/_index.segment.rsc +4 -4
- package/cloud-runtime/standalone/.next/server/app/projects.segments/_tree.segment.rsc +2 -2
- package/cloud-runtime/standalone/.next/server/app/projects.segments/projects/__PAGE__.segment.rsc +4 -4
- package/cloud-runtime/standalone/.next/server/app/projects.segments/projects.segment.rsc +3 -3
- package/cloud-runtime/standalone/.next/server/app/settings/page/build-manifest.json +4 -4
- package/cloud-runtime/standalone/.next/server/app/settings/page.js +5 -5
- package/cloud-runtime/standalone/.next/server/app/settings/page.js.nft.json +1 -1
- package/cloud-runtime/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/.next/server/app/settings.html +14 -2
- package/cloud-runtime/standalone/.next/server/app/settings.rsc +9 -9
- package/cloud-runtime/standalone/.next/server/app/settings.segments/_full.segment.rsc +9 -9
- package/cloud-runtime/standalone/.next/server/app/settings.segments/_head.segment.rsc +3 -3
- package/cloud-runtime/standalone/.next/server/app/settings.segments/_index.segment.rsc +4 -4
- package/cloud-runtime/standalone/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
- package/cloud-runtime/standalone/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +3 -3
- package/cloud-runtime/standalone/.next/server/app/settings.segments/settings.segment.rsc +3 -3
- package/cloud-runtime/standalone/.next/server/app/status/page/build-manifest.json +4 -4
- package/cloud-runtime/standalone/.next/server/app/status/page.js +5 -5
- package/cloud-runtime/standalone/.next/server/app/status/page.js.nft.json +1 -1
- package/cloud-runtime/standalone/.next/server/app/status/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/.next/server/app/status.html +14 -2
- package/cloud-runtime/standalone/.next/server/app/status.rsc +10 -10
- package/cloud-runtime/standalone/.next/server/app/status.segments/_full.segment.rsc +10 -10
- package/cloud-runtime/standalone/.next/server/app/status.segments/_head.segment.rsc +3 -3
- package/cloud-runtime/standalone/.next/server/app/status.segments/_index.segment.rsc +4 -4
- package/cloud-runtime/standalone/.next/server/app/status.segments/_tree.segment.rsc +2 -2
- package/cloud-runtime/standalone/.next/server/app/status.segments/status/__PAGE__.segment.rsc +4 -4
- package/cloud-runtime/standalone/.next/server/app/status.segments/status.segment.rsc +3 -3
- package/cloud-runtime/standalone/.next/server/app/thread/[id]/page/build-manifest.json +4 -4
- package/cloud-runtime/standalone/.next/server/app/thread/[id]/page.js +5 -5
- package/cloud-runtime/standalone/.next/server/app/thread/[id]/page.js.nft.json +1 -1
- package/cloud-runtime/standalone/.next/server/app/thread/[id]/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/.next/server/app/welcome/page/build-manifest.json +4 -4
- package/cloud-runtime/standalone/.next/server/app/welcome/page.js +5 -5
- package/cloud-runtime/standalone/.next/server/app/welcome/page.js.nft.json +1 -1
- package/cloud-runtime/standalone/.next/server/app/welcome/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/.next/server/app/welcome.html +14 -2
- package/cloud-runtime/standalone/.next/server/app/welcome.rsc +10 -10
- package/cloud-runtime/standalone/.next/server/app/welcome.segments/_full.segment.rsc +10 -10
- package/cloud-runtime/standalone/.next/server/app/welcome.segments/_head.segment.rsc +3 -3
- package/cloud-runtime/standalone/.next/server/app/welcome.segments/_index.segment.rsc +4 -4
- package/cloud-runtime/standalone/.next/server/app/welcome.segments/_tree.segment.rsc +2 -2
- package/cloud-runtime/standalone/.next/server/app/welcome.segments/welcome/__PAGE__.segment.rsc +4 -4
- package/cloud-runtime/standalone/.next/server/app/welcome.segments/welcome.segment.rsc +3 -3
- package/cloud-runtime/standalone/.next/server/app-paths-manifest.json +1 -0
- package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__60ba5058._.js +1 -1
- package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__621dcb4a._.js +3 -0
- package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__babd2675._.js → [root-of-the-server]__82d76712._.js} +2 -2
- package/cloud-runtime/standalone/.next/server/chunks/{[root-of-the-server]__d36da34d._.js → [root-of-the-server]__c2767ca5._.js} +2 -2
- package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_filesystem_browse_route_actions_8e268170.js +3 -0
- package/cloud-runtime/standalone/.next/server/chunks/lib_history-store_ts_2e721df2._.js +4 -4
- package/cloud-runtime/standalone/.next/server/chunks/lib_history-store_ts_74d1c060._.js +6 -6
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{[root-of-the-server]__fb05a385._.js → [root-of-the-server]__056cdf7d._.js} +2 -2
- package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__113d6767._.js +3 -0
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{[root-of-the-server]__8d1af2c9._.js → [root-of-the-server]__11e33b9b._.js} +2 -2
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{[root-of-the-server]__296a25b5._.js → [root-of-the-server]__19cd257e._.js} +2 -2
- package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__226f8a19._.js +13 -1
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{[root-of-the-server]__51980630._.js → [root-of-the-server]__26d669c2._.js} +2 -2
- package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__47caef59._.js +1 -1
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0a103abc._.js → [root-of-the-server]__4ebf5947._.js} +2 -2
- package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__5ffa2883._.js +1 -1
- package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__6a9d3855._.js +1 -1
- package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__942ca438._.js +3 -0
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{[root-of-the-server]__c45c7360._.js → [root-of-the-server]__a667191a._.js} +2 -2
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1cfbd715._.js → [root-of-the-server]__aa28d46f._.js} +2 -2
- package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__bd4d5430._.js +3 -0
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{[root-of-the-server]__ab36b420._.js → [root-of-the-server]__bde5bc78._.js} +2 -2
- package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__cde88183._.js +3 -0
- package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__ce3b51aa._.js +3 -0
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{[root-of-the-server]__2503b467._.js → [root-of-the-server]__d36dd8bc._.js} +2 -2
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{[root-of-the-server]__b77ae83d._.js → [root-of-the-server]__dac5ab29._.js} +2 -2
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{[root-of-the-server]__3405b8e4._.js → [root-of-the-server]__e87ba2b0._.js} +2 -2
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{[root-of-the-server]__b9356576._.js → [root-of-the-server]__f62d412e._.js} +2 -2
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{[root-of-the-server]__756711b8._.js → [root-of-the-server]__f63d6594._.js} +2 -2
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{[root-of-the-server]__46de03a9._.js → [root-of-the-server]__febbd0b8._.js} +2 -2
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{[root-of-the-server]__89c70d6f._.js → [root-of-the-server]__ff22a10e._.js} +2 -2
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{_a19a362a._.js → _02c78cac._.js} +3 -3
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{node_modules_next_dist_08570d7f._.js → _0b36c9d6._.js} +3 -3
- package/cloud-runtime/standalone/.next/server/chunks/ssr/_0ff7c687._.js +3 -3
- package/cloud-runtime/standalone/.next/server/chunks/ssr/_0ffd2660._.js +2 -2
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{_37435df3._.js → _173da79d._.js} +3 -3
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{_4fe611fe._.js → _1c58ab2d._.js} +3 -3
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{_a88b4884._.js → _222af282._.js} +3 -3
- package/cloud-runtime/standalone/.next/server/chunks/ssr/_27cb3359._.js +95 -0
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{_8ebf36f6._.js → _3aa32c11._.js} +3 -3
- package/cloud-runtime/standalone/.next/server/chunks/ssr/_43472af3._.js +3 -0
- package/cloud-runtime/standalone/.next/server/chunks/ssr/_4b5d7c9b._.js +95 -0
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{_c52176ad._.js → _4d4ba84b._.js} +3 -3
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{_194cda6c._.js → _50d04b8f._.js} +3 -3
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{_a8eaf6bc._.js → _629dc55c._.js} +3 -3
- package/cloud-runtime/standalone/.next/server/chunks/ssr/_6a367524._.js +1 -1
- package/cloud-runtime/standalone/.next/server/chunks/ssr/_93914ecd._.js +2 -2
- package/cloud-runtime/standalone/.next/server/chunks/ssr/_94effa0f._.js +1 -1
- package/cloud-runtime/standalone/.next/server/chunks/ssr/_a696e9b3._.js +95 -0
- package/cloud-runtime/standalone/.next/server/chunks/ssr/_ae20456d._.js +4 -0
- package/cloud-runtime/standalone/.next/server/chunks/ssr/_c838f593._.js +95 -0
- package/cloud-runtime/standalone/.next/server/chunks/ssr/_cd5e154b._.js +1 -1
- package/cloud-runtime/standalone/.next/server/chunks/ssr/_d021529a._.js +3 -0
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{_fc18d7b5._.js → _e04b4053._.js} +3 -3
- package/cloud-runtime/standalone/.next/server/chunks/ssr/_e1769638._.js +3 -3
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{_b9d3574c._.js → _f1465cc8._.js} +3 -3
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{_d4878ef1._.js → _f2a7beb1._.js} +3 -3
- package/cloud-runtime/standalone/.next/server/chunks/ssr/_fbced30b._.js +3 -0
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{_8d8836a8._.js → _fc1aaf9e._.js} +3 -3
- package/cloud-runtime/standalone/.next/server/chunks/ssr/app_agents_[id]_page_tsx_9c49d8c8._.js +1 -1
- package/cloud-runtime/standalone/.next/server/chunks/ssr/app_agents_page_tsx_f5f08ed8._.js +1 -1
- package/cloud-runtime/standalone/.next/server/chunks/ssr/app_automations_page_tsx_3d732184._.js +1 -1
- package/cloud-runtime/standalone/.next/server/chunks/ssr/app_execution-graph_page_tsx_f854185a._.js +2 -2
- package/cloud-runtime/standalone/.next/server/chunks/ssr/app_global-error_tsx_9170b7a0._.js +3 -0
- package/cloud-runtime/standalone/.next/server/chunks/ssr/app_projects_[slug]_page_tsx_e0fabf6e._.js +2 -2
- package/cloud-runtime/standalone/.next/server/chunks/ssr/components_chat-ui_bfeda794._.js +5 -5
- package/cloud-runtime/standalone/.next/server/chunks/ssr/components_thread_WorkspaceSidebar_tsx_e660301b._.js +1 -1
- package/cloud-runtime/standalone/.next/server/chunks/ssr/node_modules_next_dist_03ec2107._.js +4 -0
- package/cloud-runtime/standalone/.next/server/chunks/ssr/{node_modules_next_dist_esm_build_templates_app-page_d92e159d.js → node_modules_next_dist_esm_build_templates_app-page_61c49327.js} +3 -3
- package/cloud-runtime/standalone/.next/server/middleware-build-manifest.js +4 -4
- package/cloud-runtime/standalone/.next/server/middleware-manifest.json +5 -5
- package/cloud-runtime/standalone/.next/server/pages/404.html +13 -1
- package/cloud-runtime/standalone/.next/server/pages/500.html +2 -2
- package/cloud-runtime/standalone/.next/server/server-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/.next/server/server-reference-manifest.json +1 -1
- package/cloud-runtime/standalone/.next/static/chunks/{785cb91c31bb3303.js → 09f9eeea393db0fd.js} +3 -3
- package/cloud-runtime/standalone/.next/static/chunks/1184bf1bfdf97666.js +1 -0
- package/cloud-runtime/standalone/.next/static/chunks/2acd153dc5252e88.js +30 -0
- package/cloud-runtime/standalone/.next/static/chunks/2deeba875ec50761.js +1 -0
- package/cloud-runtime/standalone/.next/static/chunks/45b4d0ee5c92d45b.js +93 -0
- package/cloud-runtime/standalone/.next/static/chunks/5ace4b4f4475962a.js +1 -0
- package/cloud-runtime/standalone/.next/static/chunks/616d66dbec9e4b8b.js +93 -0
- package/cloud-runtime/standalone/.next/static/chunks/64f812259cf8c243.js +18 -0
- package/cloud-runtime/standalone/.next/static/chunks/6dbf5940e30fa9c7.js +1 -0
- package/cloud-runtime/standalone/.next/static/chunks/7d4c1d97169c8522.js +1 -0
- package/cloud-runtime/standalone/.next/static/chunks/7f13efe9329d3f97.js +1 -0
- package/cloud-runtime/standalone/.next/static/chunks/80219bbddcf65109.js +1 -0
- package/cloud-runtime/standalone/.next/static/chunks/{47ef8bb2118ea917.js → 86ace6febb11ad71.js} +1 -1
- package/cloud-runtime/standalone/.next/static/chunks/{90c7dbc004f59a42.js → 88e24940a5d5d386.js} +1 -1
- package/cloud-runtime/standalone/.next/static/chunks/9d50c2514f72d926.css +1 -0
- package/cloud-runtime/standalone/.next/static/chunks/b079c677d9b39f98.js +5 -0
- package/cloud-runtime/standalone/.next/static/chunks/b4e298542d366e31.js +93 -0
- package/cloud-runtime/standalone/.next/static/chunks/b88352740262931f.js +6 -0
- package/cloud-runtime/standalone/.next/static/chunks/bd6c5b5b4fbd6413.css +2 -0
- package/cloud-runtime/standalone/.next/static/chunks/c5609fd2abb65850.js +1 -0
- package/cloud-runtime/standalone/.next/static/chunks/{7ca3e4f9ed7425a8.js → d95cd010361834be.js} +1 -1
- package/cloud-runtime/standalone/.next/static/chunks/da434b1ad885d636.js +30 -0
- package/cloud-runtime/standalone/.next/static/chunks/e44264686aa5ecbf.js +93 -0
- package/cloud-runtime/standalone/.next/static/chunks/eab1c7d0246592f8.js +8 -0
- package/cloud-runtime/standalone/.next/static/chunks/f7bbf5cfcfed8ba9.js +1 -0
- package/cloud-runtime/standalone/.next/static/chunks/{turbopack-92401168917c21f2.js → turbopack-5b5918f610666d2d.js} +1 -1
- package/cloud-runtime/standalone/README.md +15 -3
- package/cloud-runtime/standalone/app/agents/[id]/page.tsx +147 -147
- package/cloud-runtime/standalone/app/agents/page.tsx +115 -310
- package/cloud-runtime/standalone/app/api/filesystem/browse/route.ts +39 -0
- package/cloud-runtime/standalone/app/api/status/route.ts +1 -1
- package/cloud-runtime/standalone/app/api/threads/route.ts +4 -5
- package/cloud-runtime/standalone/app/automations/page.tsx +1 -1
- package/cloud-runtime/standalone/app/execution-graph/page.tsx +86 -86
- package/cloud-runtime/standalone/app/global-error.tsx +54 -0
- package/cloud-runtime/standalone/app/globals.css +165 -59
- package/cloud-runtime/standalone/app/layout.tsx +17 -0
- package/cloud-runtime/standalone/app/projects/[slug]/layout.tsx +1 -1
- package/cloud-runtime/standalone/app/projects/[slug]/page.tsx +58 -58
- package/cloud-runtime/standalone/app/status/page.tsx +20 -20
- package/cloud-runtime/standalone/app/welcome/page.tsx +20 -15
- package/cloud-runtime/standalone/components/AutomationsBoard.tsx +1 -1
- package/cloud-runtime/standalone/components/ClientOnly.tsx +17 -0
- package/cloud-runtime/standalone/components/ConsentToggle/index.tsx +3 -3
- package/cloud-runtime/standalone/components/ContextMenu.tsx +123 -0
- package/cloud-runtime/standalone/components/DaemonBar.tsx +9 -9
- package/cloud-runtime/standalone/components/DirectoryBrowser.tsx +140 -0
- package/cloud-runtime/standalone/components/FirstRunModal/index.tsx +10 -10
- package/cloud-runtime/standalone/components/KanbanBoard.tsx +9 -9
- package/cloud-runtime/standalone/components/OfflineIndicator.tsx +149 -0
- package/cloud-runtime/standalone/components/ProjectModal.tsx +32 -8
- package/cloud-runtime/standalone/components/TaskCard.tsx +3 -3
- package/cloud-runtime/standalone/components/WorkspaceRootsList/index.tsx +57 -35
- package/cloud-runtime/standalone/components/chat-ui/AttachmentTray.tsx +7 -7
- package/cloud-runtime/standalone/components/chat-ui/ChatContainer.tsx +218 -121
- package/cloud-runtime/standalone/components/chat-ui/ChatPreview.tsx +4 -4
- package/cloud-runtime/standalone/components/chat-ui/CommandPopover.tsx +4 -4
- package/cloud-runtime/standalone/components/chat-ui/Composer.tsx +65 -29
- package/cloud-runtime/standalone/components/chat-ui/FileMentionPopover.tsx +4 -4
- package/cloud-runtime/standalone/components/chat-ui/FileMentionPopoverItem.tsx +9 -9
- package/cloud-runtime/standalone/components/chat-ui/LogPanel.tsx +5 -5
- package/cloud-runtime/standalone/components/chat-ui/Markdown.tsx +11 -11
- package/cloud-runtime/standalone/components/chat-ui/MentionPopover.tsx +11 -11
- package/cloud-runtime/standalone/components/chat-ui/MessageAttachments.tsx +5 -5
- package/cloud-runtime/standalone/components/chat-ui/MessageBubble.tsx +6 -6
- package/cloud-runtime/standalone/components/chat-ui/MessageList.tsx +60 -135
- package/cloud-runtime/standalone/components/chat-ui/ParticipantBar.tsx +507 -263
- package/cloud-runtime/standalone/components/chat-ui/ProjectPicker.tsx +17 -17
- package/cloud-runtime/standalone/components/chat-ui/ReactionChip.tsx +1 -1
- package/cloud-runtime/standalone/components/chat-ui/SearchResults.tsx +14 -14
- package/cloud-runtime/standalone/components/chat-ui/StatusIndicator.tsx +7 -7
- package/cloud-runtime/standalone/components/chat-ui/TaskDraftCard.tsx +14 -14
- package/cloud-runtime/standalone/components/chat-ui/TaskStatusCard.tsx +10 -10
- package/cloud-runtime/standalone/components/chat-ui/ThreadMentionPopover.tsx +8 -8
- package/cloud-runtime/standalone/components/chat-ui/ThreadView.tsx +36 -33
- package/cloud-runtime/standalone/components/chat-ui/TypingIndicator.tsx +7 -7
- package/cloud-runtime/standalone/components/errors/StartupGuardWrapper.tsx +96 -0
- package/cloud-runtime/standalone/components/thread/WorkspaceSidebar.tsx +173 -193
- package/cloud-runtime/standalone/fix-primary.js +30 -0
- package/cloud-runtime/standalone/fix-theme.js +78 -0
- package/cloud-runtime/standalone/hooks/useKeyboardShortcuts.ts +131 -0
- package/cloud-runtime/standalone/lib/history-store.ts +6 -1
- package/cloud-runtime/standalone/lib/storage/thread-adapter.ts +3 -3
- package/cloud-runtime/standalone/state/windowState.ts +179 -0
- package/cloud-runtime/standalone/styles/workspaceSidebar.css +89 -94
- package/cloud-runtime/standalone/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__3fe0b1a1._.js +0 -3
- package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__5ea3dff5._.js +0 -3
- package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__931817d6._.js +0 -3
- package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__e68a6e30._.js +0 -3
- package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__fad8b80a._.js +0 -3
- package/cloud-runtime/standalone/.next/server/chunks/ssr/_181427d4._.js +0 -95
- package/cloud-runtime/standalone/.next/server/chunks/ssr/_2da02644._.js +0 -3
- package/cloud-runtime/standalone/.next/server/chunks/ssr/_60f7e403._.js +0 -3
- package/cloud-runtime/standalone/.next/server/chunks/ssr/_7dbc349d._.js +0 -95
- package/cloud-runtime/standalone/.next/server/chunks/ssr/_a17cabe8._.js +0 -95
- package/cloud-runtime/standalone/.next/server/chunks/ssr/_d743f11d._.js +0 -3
- package/cloud-runtime/standalone/.next/server/chunks/ssr/_e05b04a5._.js +0 -4
- package/cloud-runtime/standalone/.next/server/chunks/ssr/_f2970e5f._.js +0 -4
- package/cloud-runtime/standalone/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_001a8448._.js +0 -3
- package/cloud-runtime/standalone/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_ece394eb.js +0 -3
- package/cloud-runtime/standalone/.next/static/chunks/047593c886feba72.css +0 -2
- package/cloud-runtime/standalone/.next/static/chunks/0c589ec8063c3a1f.js +0 -30
- package/cloud-runtime/standalone/.next/static/chunks/1826707bd2f73ca6.js +0 -8
- package/cloud-runtime/standalone/.next/static/chunks/1f1b912fe2e3d5bd.js +0 -1
- package/cloud-runtime/standalone/.next/static/chunks/32f13ace6661115d.js +0 -93
- package/cloud-runtime/standalone/.next/static/chunks/3b0a3b913dd15028.js +0 -30
- package/cloud-runtime/standalone/.next/static/chunks/4b3358c52d01a3f9.css +0 -1
- package/cloud-runtime/standalone/.next/static/chunks/4ee6151684568990.js +0 -93
- package/cloud-runtime/standalone/.next/static/chunks/5488a71a8515e8b2.js +0 -1
- package/cloud-runtime/standalone/.next/static/chunks/5aad4adabb65cd20.js +0 -1
- package/cloud-runtime/standalone/.next/static/chunks/5ce01dbd17ce3bb2.js +0 -1
- package/cloud-runtime/standalone/.next/static/chunks/5f5ae2ea4fa2b8f0.js +0 -12
- package/cloud-runtime/standalone/.next/static/chunks/6bb1ecbc3b80922c.js +0 -1
- package/cloud-runtime/standalone/.next/static/chunks/7657d70cc0c40c81.js +0 -6
- package/cloud-runtime/standalone/.next/static/chunks/7f2513325b592f25.js +0 -18
- package/cloud-runtime/standalone/.next/static/chunks/8b658ccf17b771b9.js +0 -1
- package/cloud-runtime/standalone/.next/static/chunks/b39122b85655e5b0.js +0 -1
- package/cloud-runtime/standalone/.next/static/chunks/b649593a57df218f.js +0 -1
- package/cloud-runtime/standalone/.next/static/chunks/b8ca4cb386211980.js +0 -5
- package/cloud-runtime/standalone/.next/static/chunks/e103488c85a7b445.js +0 -1
- package/cloud-runtime/standalone/.next/static/chunks/e355ac901e70f43d.js +0 -1
- package/cloud-runtime/standalone/.next/static/chunks/ebebe08434070698.js +0 -93
- /package/cloud-runtime/standalone/.next/static/{H3MuYxcqCPfZoSC2uYW8f → Rn0z3Af30mHwrHLLwgKlz}/_buildManifest.js +0 -0
- /package/cloud-runtime/standalone/.next/static/{H3MuYxcqCPfZoSC2uYW8f → Rn0z3Af30mHwrHLLwgKlz}/_clientMiddlewareManifest.json +0 -0
- /package/cloud-runtime/standalone/.next/static/{H3MuYxcqCPfZoSC2uYW8f → Rn0z3Af30mHwrHLLwgKlz}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,83086,e=>{"use strict";let t=(0,e.i(75254).default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);e.s(["Sparkles",()=>t],83086)},66992,e=>{"use strict";let t=(0,e.i(75254).default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]);e.s(["Cpu",()=>t],66992)},37727,84614,e=>{"use strict";var t=e.i(75254);let n=(0,t.default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",()=>n],37727);let r=(0,t.default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);e.s(["User",()=>r],84614)},72664,e=>{"use strict";let t=(0,e.i(75254).default)("box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);e.s(["Box",()=>t],72664)},75505,e=>{"use strict";let t=(0,e.i(75254).default)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);e.s(["FolderOpen",()=>t],75505)},64659,e=>{"use strict";let t=(0,e.i(75254).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>t],64659)},74886,43531,e=>{"use strict";var t=e.i(75254);let n=(0,t.default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",()=>n],74886);let r=(0,t.default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",()=>r],43531)},16015,(e,t,n)=>{},98547,(e,t,n)=>{var r=e.i(47167);e.r(16015);var i=e.r(71645),o=i&&"object"==typeof i&&"default"in i?i:{default:i},s=void 0!==r.default&&r.default.env&&!0,l=function(e){return"[object String]"===Object.prototype.toString.call(e)},a=function(){function e(e){var t=void 0===e?{}:e,n=t.name,r=void 0===n?"stylesheet":n,i=t.optimizeForSpeed,o=void 0===i?s:i;c(l(r),"`name` must be a string"),this._name=r,this._deletedRulePlaceholder="#"+r+"-deleted-rule____{}",c("boolean"==typeof o,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=o,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var a="u">typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=a?a.getAttribute("content"):null}var t,n=e.prototype;return n.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},n.isOptimizeForSpeed=function(){return this._optimizeForSpeed},n.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"u">typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(s||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,n){return"number"==typeof n?e._serverSheet.cssRules[n]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),n},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},n.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},n.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},n.insertRule=function(e,t){if(c(l(e),"`insertRule` accepts only strings"),"u"<typeof window)return"number"!=typeof t&&(t=this._serverSheet.cssRules.length),this._serverSheet.insertRule(e,t),this._rulesCount++;if(this._optimizeForSpeed){var n=this.getSheet();"number"!=typeof t&&(t=n.cssRules.length);try{n.insertRule(e,t)}catch(t){return s||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var r=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,r))}return this._rulesCount++},n.replaceRule=function(e,t){if(this._optimizeForSpeed||"u"<typeof window){var n="u">typeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!n.cssRules[e])return e;n.deleteRule(e);try{n.insertRule(t,e)}catch(r){s||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),n.insertRule(this._deletedRulePlaceholder,e)}}else{var r=this._tags[e];c(r,"old rule at index `"+e+"` not found"),r.textContent=t}return e},n.deleteRule=function(e){if("u"<typeof window)return void this._serverSheet.deleteRule(e);if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];c(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},n.flush=function(){this._injected=!1,this._rulesCount=0,"u">typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},n.cssRules=function(){var e=this;return"u"<typeof window?this._serverSheet.cssRules:this._tags.reduce(function(t,n){return n?t=t.concat(Array.prototype.map.call(e.getSheetForTag(n).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},n.makeStyleTag=function(e,t,n){t&&c(l(t),"makeStyleTag accepts only strings as second parameter");var r=document.createElement("style");this._nonce&&r.setAttribute("nonce",this._nonce),r.type="text/css",r.setAttribute("data-"+e,""),t&&r.appendChild(document.createTextNode(t));var i=document.head||document.getElementsByTagName("head")[0];return n?i.insertBefore(r,n):i.appendChild(r),r},t=[{key:"length",get:function(){return this._rulesCount}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function c(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var d=function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0},u={};function h(e,t){if(!t)return"jsx-"+e;var n=String(t),r=e+n;return u[r]||(u[r]="jsx-"+d(e+"-"+n)),u[r]}function p(e,t){"u"<typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var n=e+t;return u[n]||(u[n]=t.replace(/__jsx-style-dynamic-selector/g,e)),u[n]}var f=function(){function e(e){var t=void 0===e?{}:e,n=t.styleSheet,r=void 0===n?null:n,i=t.optimizeForSpeed,o=void 0!==i&&i;this._sheet=r||new a({name:"styled-jsx",optimizeForSpeed:o}),this._sheet.inject(),r&&"boolean"==typeof o&&(this._sheet.setOptimizeForSpeed(o),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"u">typeof window&&!this._fromServer&&(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var n=this.getIdAndRules(e),r=n.styleId,i=n.rules;if(r in this._instancesCounts){this._instancesCounts[r]+=1;return}var o=i.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[r]=o,this._instancesCounts[r]=1},t.remove=function(e){var t=this,n=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(n in this._instancesCounts,"styleId: `"+n+"` not found"),this._instancesCounts[n]-=1,this._instancesCounts[n]<1){var r=this._fromServer&&this._fromServer[n];r?(r.parentNode.removeChild(r),delete this._fromServer[n]):(this._indices[n].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[n]),delete this._instancesCounts[n]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],n=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return n[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,n;return t=this.cssRules(),void 0===(n=e)&&(n={}),t.map(function(e){var t=e[0],r=e[1];return o.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:n.nonce?n.nonce:void 0,dangerouslySetInnerHTML:{__html:r}})})},t.getIdAndRules=function(e){var t=e.children,n=e.dynamic,r=e.id;if(n){var i=h(r,n);return{styleId:i,rules:Array.isArray(t)?t.map(function(e){return p(i,e)}):[p(i,t)]}}return{styleId:h(r),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),m=i.createContext(null);function g(){return new f}function y(){return i.useContext(m)}m.displayName="StyleSheetContext";var k=o.default.useInsertionEffect||o.default.useLayoutEffect,b="u">typeof window?g():void 0;function v(e){var t=b||y();return t&&("u"<typeof window?t.add(e):k(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}v.dynamic=function(e){return e.map(function(e){return h(e[0],e[1])}).join(" ")},n.StyleRegistry=function(e){var t=e.registry,n=e.children,r=i.useContext(m),s=i.useState(function(){return r||t||g()})[0];return o.default.createElement(m.Provider,{value:s},n)},n.createStyleRegistry=g,n.style=v,n.useStyleRegistry=y},37902,(e,t,n)=>{t.exports=e.r(98547).style},96736,(e,t,n)=>{var r=!0,i=!1,o=!1;function s(e,t,n){var r=e.attrIndex(t),i=[t,n];r<0?e.attrPush(i):e.attrs[r]=i}t.exports=function(e,t){t&&(r=!t.enabled,i=!!t.label,o=!!t.labelAfter),e.core.ruler.after("inline","github-task-lists",function(e){for(var t=e.tokens,n=2;n<t.length;n++)(function(e,t){var n;return"inline"===e[t].type&&"paragraph_open"===e[t-1].type&&"list_item_open"===e[t-2].type&&(0===(n=e[t]).content.indexOf("[ ] ")||0===n.content.indexOf("[x] ")||0===n.content.indexOf("[X] "))})(t,n)&&(function(e,t){if(e.children.unshift(function(e,t){var n=new t("html_inline","",0),i=r?' disabled="" ':"";return 0===e.content.indexOf("[ ] ")?n.content='<input class="task-list-item-checkbox"'+i+'type="checkbox">':(0===e.content.indexOf("[x] ")||0===e.content.indexOf("[X] "))&&(n.content='<input class="task-list-item-checkbox" checked=""'+i+'type="checkbox">'),n}(e,t)),e.children[1].content=e.children[1].content.slice(3),e.content=e.content.slice(3),i)if(o){e.children.pop();var n="task-item-"+Math.ceil(1e7*Math.random()-1e3);e.children[0].content=e.children[0].content.slice(0,-1)+' id="'+n+'">',e.children.push(function(e,t,n){var r=new n("html_inline","",0);return r.content='<label class="task-list-item-label" for="'+t+'">'+e+"</label>",r.attrs=[{for:t}],r}(e.content,n,t))}else e.children.unshift(function(e){var t=new e("html_inline","",0);return t.content="<label>",t}(t)),e.children.push(function(e){var t=new e("html_inline","",0);return t.content="</label>",t}(t))}(t[n],e.Token),s(t[n-2],"class","task-list-item"+(r?"":" enabled")),s(t[function(e,t){for(var n=e[t].level-1,r=t-1;r>=0;r--)if(e[r].level===n)return r;return -1}(t,n-2)],"class","contains-task-list"))})}},25459,10552,94499,56378,55841,e=>{"use strict";var t,n,r,i,o,s,l,a,c,d,u,h,p,f=e.i(18050),m=e.i(71645),g=e.i(37727),y=e.i(84614),k=e.i(66992),b=e.i(72664),v=e.i(10980),x=e.i(83086),w=e.i(7233),C=e.i(75505),S=e.i(64659),M=e.i(74886),E=e.i(43531),A=e.i(37902);e.i(47167);var D=m,_=e.i(74080),T=e.i(2239);function N(e){this.content=e}N.prototype={constructor:N,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return -1},get:function(e){var t=this.find(e);return -1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return -1==i?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new N(o)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new N(n)},addToStart:function(e,t){return new N([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new N(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(-1==o?i.length:o,0,t,n),new N(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=N.from(e)).size?new N(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=N.from(e)).size?new N(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=N.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},N.from=function(e){if(e instanceof N)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new N(t)};class O{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let o=0,s=0;s<t;o++){let l=this.content[o],a=s+l.nodeSize;if(a>e&&!1!==n(l,r+s,i||null,o)&&l.content.size){let i=s+1;l.nodesBetween(Math.max(0,e-i),Math.min(l.content.size,t-i),n,r+i)}s=a}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,(s,l)=>{let a=s.isText?s.text.slice(Math.max(e,l)-l,t-l):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&a||s.isTextblock)&&n&&(o?o=!1:i+=n),i+=a},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new O(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let i=0,o=0;o<t;i++){let s=this.content[i],l=o+s.nodeSize;l>e&&((o<e||l>t)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),r+=s.nodeSize),o=l}return new O(n,r)}cutByIndex(e,t){return e==t?O.empty:0==e&&t==this.content.length?this:new O(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new O(r,i)}addToStart(e){return new O([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new O(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return function e(t,n,r){for(let i=0;;i++){if(i==t.childCount||i==n.childCount)return t.childCount==n.childCount?null:r;let o=t.child(i),s=n.child(i);if(o==s){r+=o.nodeSize;continue}if(!o.sameMarkup(s))return r;if(o.isText&&o.text!=s.text){for(let e=0;o.text[e]==s.text[e];e++)r++;return r}if(o.content.size||s.content.size){let t=e(o.content,s.content,r+1);if(null!=t)return t}r+=o.nodeSize}}(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return function e(t,n,r,i){for(let o=t.childCount,s=n.childCount;;){if(0==o||0==s)return o==s?null:{a:r,b:i};let l=t.child(--o),a=n.child(--s),c=l.nodeSize;if(l==a){r-=c,i-=c;continue}if(!l.sameMarkup(a))return{a:r,b:i};if(l.isText&&l.text!=a.text){let e=0,t=Math.min(l.text.length,a.text.length);for(;e<t&&l.text[l.text.length-e-1]==a.text[a.text.length-e-1];)e++,r--,i--;return{a:r,b:i}}if(l.content.size||a.content.size){let t=e(l.content,a.content,r-1,i-1);if(t)return t}r-=c,i-=c}}(this,e,t,n)}findIndex(e){if(0==e)return F(0,e);if(e==this.size)return F(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=n+this.child(t).nodeSize;if(r>=e){if(r==e)return F(t+1,r);return F(t,n)}n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return O.empty;if(!Array.isArray(t))throw RangeError("Invalid input for Fragment.fromJSON");return new O(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return O.empty;let t,n=0;for(let r=0;r<e.length;r++){let i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(t||(t=e.slice(0,r)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new O(t||e,n)}static from(e){if(!e)return O.empty;if(e instanceof O)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new O([e],e.nodeSize);throw RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}O.empty=new O([],0);let R={index:0,offset:0};function F(e,t){return R.index=e,R.offset=t,R}function I(e,t){if(e===t)return!0;if(!(e&&"object"==typeof e)||!(t&&"object"==typeof t))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!I(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!I(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class L{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&I(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return L.none;if(e instanceof L)return[e];let t=e.slice();return t.sort((e,t)=>e.type.rank-t.type.rank),t}}L.none=[];class z extends Error{}class j{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=function e(t,n,r,i){let{index:o,offset:s}=t.findIndex(n),l=t.maybeChild(o);if(s==n||l.isText)return i&&!i.canReplace(o,o,r)?null:t.cut(0,n).append(r).append(t.cut(n));let a=e(l.content,n-s-1,r,l);return a&&t.replaceChild(o,l.copy(a))}(this.content,e+this.openStart,t);return n&&new j(n,this.openStart,this.openEnd)}removeBetween(e,t){return new j(function e(t,n,r){let{index:i,offset:o}=t.findIndex(n),s=t.maybeChild(i),{index:l,offset:a}=t.findIndex(r);if(o==n||s.isText){if(a!=r&&!t.child(l).isText)throw RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(r))}if(i!=l)throw RangeError("Removing non-flat range");return t.replaceChild(i,s.copy(e(s.content,n-o-1,r-o-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return j.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw RangeError("Invalid input for Slice.fromJSON");return new j(O.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new j(e,n,r)}}function B(e,t){if(!t.type.compatibleContent(e.type))throw new z("Cannot join "+t.type.name+" onto "+e.type.name)}function P(e,t,n){let r=e.node(n);return B(r,t.node(n)),r}function $(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function q(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&($(e.nodeAfter,r),o++));for(let e=o;e<s;e++)$(i.child(e),r);t&&t.depth==n&&t.textOffset&&$(t.nodeBefore,r)}function V(e,t){return e.type.checkContent(t),e.copy(t)}function H(e,t,n){let r=[];return q(null,e,n,r),e.depth>n&&$(V(P(e,t,n+1),H(e,t,n+1)),r),q(t,null,n,r),new O(r)}j.empty=new j(O.empty,0,0);class W{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return L.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new G(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let t=e;;){let{index:e,offset:o}=t.content.findIndex(i),s=i-o;if(n.push(t,e,r+o),!s||(t=t.child(e)).isText)break;i=s-1,r+=o+1}return new W(t,n,i)}static resolveCached(e,t){let n=J.get(e);if(n)for(let e=0;e<n.elts.length;e++){let r=n.elts[e];if(r.pos==t)return r}else J.set(e,n=new U);let r=n.elts[n.i]=W.resolve(e,t);return n.i=(n.i+1)%K,r}}class U{constructor(){this.elts=[],this.i=0}}let K=12,J=new WeakMap;class G{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}let Z=Object.create(null);class X{constructor(e,t,n,r=L.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||O.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&I(this.attrs,t||e.defaultAttrs||Z)&&L.sameSet(this.marks,n||L.none)}copy(e=null){return e==this.content?this:new X(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new X(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return j.empty;let r=this.resolve(e),i=this.resolve(t),o=n?0:r.sharedDepth(t),s=r.start(o);return new j(r.node(o).content.cut(r.pos-s,i.pos-s),r.depth-o,i.depth-o)}replace(e,t,n){var r=this.resolve(e),i=this.resolve(t);if(n.openStart>r.depth)throw new z("Inserted content deeper than insertion position");if(r.depth-n.openStart!=i.depth-n.openEnd)throw new z("Inconsistent open depths");return function e(t,n,r,i){let o=t.index(i),s=t.node(i);if(o==n.index(i)&&i<t.depth-r.openStart){let l=e(t,n,r,i+1);return s.copy(s.content.replaceChild(o,l))}if(!r.content.size)return V(s,H(t,n,i));if(r.openStart||r.openEnd||t.depth!=i||n.depth!=i){let{start:e,end:o}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(O.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(r,t);return V(s,function e(t,n,r,i,o){let s=t.depth>o&&P(t,n,o+1),l=i.depth>o&&P(r,i,o+1),a=[];return q(null,t,o,a),s&&l&&n.index(o)==r.index(o)?(B(s,l),$(V(s,e(t,n,r,i,o+1)),a)):(s&&$(V(s,H(t,n,o+1)),a),q(n,r,o,a),l&&$(V(l,H(r,i,o+1)),a)),q(i,null,o,a),new O(a)}(t,e,o,n,i))}{let e=t.parent,i=e.content;return V(e,i.cut(0,t.parentOffset).append(r.content).append(i.cut(n.parentOffset)))}}(r,i,n,0)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(!(t=t.maybeChild(n)))return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return W.resolveCached(this,e)}resolveNoCache(e){return W.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Y(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=O.empty,r=0,i=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,r,i),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),o=i&&i.matchFragment(this.content,t);return!!o&&o.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=L.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!L.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){let n;if(!t)throw RangeError("Invalid input for Node.fromJSON");if(t.marks){if(!Array.isArray(t.marks))throw RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=O.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}}X.prototype.text=void 0;class Q extends X{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Y(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Q(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Q(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Y(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class ee{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){var n;let r,i=new et(e,t);if(null==i.next)return ee.empty;let o=function e(t){let n=[];do n.push(function(t){let n=[];do n.push(function(t){let n=function(t){if(t.eat("(")){let n=e(t);return t.eat(")")||t.err("Missing closing paren"),n}if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=(function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return 0==i.length&&e.err("No node type or group '"+t+"' found"),i})(t,t.next).map(e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}}(t);for(;;)if(t.eat("+"))n={type:"plus",expr:n};else if(t.eat("*"))n={type:"star",expr:n};else if(t.eat("?"))n={type:"opt",expr:n};else if(t.eat("{"))n=function(e,t){let n=en(e),r=n;return e.eat(",")&&(r="}"!=e.next?en(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}(t,n);else break;return n}(t));while(t.next&&")"!=t.next&&"|"!=t.next)return 1==n.length?n[0]:{type:"seq",exprs:n}}(t));while(t.eat("|"))return 1==n.length?n[0]:{type:"choice",exprs:n}}(i);i.next&&i.err("Unexpected trailing text");let s=(n=function(e){let t=[[]];return i(function e(t,o){if("choice"==t.type)return t.exprs.reduce((t,n)=>t.concat(e(n,o)),[]);if("seq"==t.type)for(let r=0;;r++){let s=e(t.exprs[r],o);if(r==t.exprs.length-1)return s;i(s,o=n())}else if("star"==t.type){let s=n();return r(o,s),i(e(t.expr,s),s),[r(s)]}else if("plus"==t.type){let s=n();return i(e(t.expr,o),s),i(e(t.expr,s),s),[r(s)]}else if("opt"==t.type)return[r(o)].concat(e(t.expr,o));else if("range"==t.type){let s=o;for(let r=0;r<t.min;r++){let r=n();i(e(t.expr,s),r),s=r}if(-1==t.max)i(e(t.expr,s),s);else for(let o=t.min;o<t.max;o++){let o=n();r(s,o),i(e(t.expr,s),o),s=o}return[r(s)]}else if("name"==t.type)return[r(o,void 0,t.value)];else throw Error("Unknown expr type")}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}}(o),r=Object.create(null),function e(t){let i=[];t.forEach(e=>{n[e].forEach(({term:e,to:t})=>{let r;if(e){for(let t=0;t<i.length;t++)i[t][0]==e&&(r=i[t][1]);ei(n,t).forEach(t=>{r||i.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)})}})});let o=r[t.join(",")]=new ee(t.indexOf(n.length-1)>-1);for(let t=0;t<i.length;t++){let n=i[t][1].sort(er);o.next.push({type:i[t][0],next:r[n.join(",")]||e(n)})}return o}(ei(n,0)));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,o=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];o.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),-1==r.indexOf(s)&&r.push(s)}i&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(s,i),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function i(o,s){let l=o.matchFragment(e,n);if(l&&(!t||l.validEnd))return O.from(s.map(e=>e.createAndFill()));for(let e=0;e<o.next.length;e++){let{type:t,next:n}=o.next[e];if(!(t.isText||t.hasRequiredAttrs())&&-1==r.indexOf(n)){r.push(n);let e=i(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:o,next:s}=i.next[e];o.isLeaf||o.hasRequiredAttrs()||o.name in t||r.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),t[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return!function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)r+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return r}).join("\n")}}ee.empty=new ee(!0);class et{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+" (in content expression '"+this.string+"')")}}function en(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function er(e,t){return t-e}function ei(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e<i.length;e++){let{term:r,to:o}=i[e];r||-1!=n.indexOf(o)||t(o)}}(t),n.sort(er)}function eo(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function es(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(void 0===i){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function el(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function ea(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new ed(e,r,t[r]);return n}class ec{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=ea(e,n.attrs),this.defaultAttrs=eo(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==ee.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:es(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new X(this,this.computeAttrs(e),O.from(t),L.setFrom(n))}createChecked(e=null,t,n){return t=O.from(t),this.checkContent(t),new X(this,this.computeAttrs(e),t,L.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=O.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(O.empty,!0);return i?new X(this,e,t.append(i),L.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){el(this.attrs,e,"node",this.name)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){let t;if(null==this.markSet)return e;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:L.none:e}static compile(e,t){let n=Object.create(null);e.forEach((e,r)=>n[e]=new ec(e,t,r));let r=t.spec.topNode||"doc";if(!n[r])throw RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw RangeError("The text node type should not have attributes");return n}}class ed{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(e,t,n){let r=n.split("|");return n=>{let i=null===n?"null":typeof n;if(0>r.indexOf(i))throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class eu{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=ea(e,r.attrs),this.excluded=null;let i=eo(this.attrs);this.instance=i?new L(this,i):null}create(e=null){return!e&&this.instance?this.instance:new L(this,es(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach((e,i)=>n[e]=new eu(e,r++,t,i)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){el(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class eh{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=N.from(e.nodes),t.marks=N.from(e.marks||{}),this.nodes=ec.compile(this.spec.nodes,this),this.marks=eu.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+" can not be both a node and a mark");let t=this.nodes[e],r=t.spec.content||"",i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=ee.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError("Multiple linebreak nodes defined");if(!t.isInline||!t.isLeaf)throw RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=t}t.markSet="_"==i?null:i?ep(this,i.split(" ")):""!=i&&t.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:ep(this,n.split(" "))}this.nodeFromJSON=e=>X.fromJSON(this,e),this.markFromJSON=e=>L.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else if(e instanceof ec){if(e.schema!=this)throw RangeError("Node type from different schema used ("+e.name+")")}else throw RangeError("Invalid node type: "+e);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Q(n,n.defaultAttrs,e,L.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError("Unknown node type: "+e);return t}}function ep(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],s=o;if(o)n.push(o);else for(let t in e.marks){let r=e.marks[t];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=r)}if(!s)throw SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class ef{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(null!=e.tag)this.tags.push(e);else if(null!=e.style){let t=/[^=]*/.exec(e.style)[0];0>n.indexOf(t)&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new ev(this,t,!1);return n.addAll(e,L.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new ev(this,t,!0);return n.addAll(e,L.none,t.from,t.to),j.maxOpen(n.finish())}matchTag(e,t,n){for(let o=n?this.tags.indexOf(n)+1:0;o<this.tags.length;o++){var r,i;let n=this.tags[o];if(r=e,i=n.tag,(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,i)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],o=r.style;if(0==o.indexOf(e)&&(!r.context||n.matchesContext(r.context))&&(!(o.length>e.length)||61==o.charCodeAt(e.length)&&o.slice(e.length+1)==t)){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=ex(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=ex(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new ef(e,ef.schemaRules(e)))}}let em={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},eg={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ey={ol:!0,ul:!0};function ek(e,t,n){return null!=t?!!t|2*("full"===t):e&&"pre"==e.whitespace?3:-5&n}class eb{constructor(e,t,n,r,i,o){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=o,this.content=[],this.activeMarks=L.none,this.match=i||(4&o?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(O.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e=this.content[this.content.length-1],t;e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))&&(e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=e.withText(e.text.slice(0,e.text.length-t[0].length)))}let t=O.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(O.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!em.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class ev{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,o=ek(null,t.preserveWhitespace,0)|4*!!n;i=r?new eb(r.type,r.attrs,L.none,!0,t.topMatch||r.type.contentMatch,o):n?new eb(null,null,L.none,!0,null,o):new eb(e.schema.topNodeType,null,L.none,!0,null,o),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=2&r.options?"full":this.localPreserveWS||(1&r.options)>0,{schema:o}=this.parser;if("full"===i||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(i)if("full"===i)n=n.replace(/\r\n?/g,"\n");else if(o.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(o.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(o.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(o.text(e[n]),t,!/\S/.test(e[n]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&"BR"==i.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(o.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),s;ey.hasOwnProperty(o)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&ey.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,n));e:if(l?l.ignore:eg.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let n,r=this.needsBlock;if(em.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let s=l&&l.skip?t:this.readStyles(e,t);s&&this.addAll(e,s),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,l,n,!1===l.consuming?s:void 0)}this.localPreserveWS=r}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),!1===n.consuming)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,o;if(t.node)if((o=this.parser.schema.nodes[t.node]).isLeaf)this.insertNode(o.create(t.attrs),n,"BR"==e.nodeName)||this.leafFallback(e,n);else{let e=this.enter(o,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;"string"==typeof t.contentElement?r=e.querySelector(t.contentElement):"function"==typeof t.contentElement?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(s)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=null==r?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,o=0;t>=0;t--){let s=this.nodes[t],l=s.findWrapping(e);if(l&&(!r||r.length>l.length+o)&&(r=l,i=s,!l.length))break;if(s.solid){if(n)break;o+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&(t.match=t.match.matchType(e.type));let n=L.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):ew(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&(i=this.enterInner(e,t,n,!0,r)),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let s=ek(e,i,o.options);4&o.options&&0==o.content.length&&(s|=4);let l=L.none;return n=n.filter(t=>(o.type?!o.type.allowsMarkType(t.type):!ew(t.type,e))||(l=t.addToSet(l),!1)),this.nodes.push(new eb(e,t,l,r,null,s)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=1);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,o=(e,s)=>{for(;e>=0;e--){let l=t[e];if(""==l){if(e==t.length-1||0==e)continue;for(;s>=i;s--)if(o(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!e||e.name!=l&&!e.isInGroup(l))return!1;s--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}}function ex(e){let t={};for(let n in e)t[n]=e[n];return t}function ew(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||0>o.indexOf(i)&&s(i))return!0}};if(s(i.contentMatch))return!0}}class eC{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=eM(t).createDocumentFragment());let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,o=0;for(;n<i.length&&o<e.marks.length;){let t=e.marks[o];if(!this.marks[t.type.name]){o++;continue}if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,o++}for(;n<i.length;)r=i.pop()[1];for(;o<e.marks.length;){let n=e.marks[o++],s=this.serializeMark(n,e.isInline,t);s&&(i.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=eA(eM(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&eA(eM(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return eA(e,t,n,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new eC(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=eS(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return eS(e.marks)}}function eS(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function eM(e){return e.document||window.document}let eE=new WeakMap;function eA(e,t,n,r){let i,o,s;if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let l=t[0],a;if("string"!=typeof l)throw RangeError("Invalid array passed to renderSpec");if(r&&(void 0===(o=eE.get(r))&&eE.set(r,(s=null,!function e(t){if(t&&"object"==typeof t)if(Array.isArray(t))if("string"==typeof t[0])s||(s=[]),s.push(t);else for(let n=0;n<t.length;n++)e(t[n]);else for(let n in t)e(t[n])}(r),o=s)),a=o)&&a.indexOf(t)>-1)throw RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let c=l.indexOf(" ");c>0&&(n=l.slice(0,c),l=l.slice(c+1));let d=n?e.createElementNS(n,l):e.createElement(l),u=t[1],h=1;if(u&&"object"==typeof u&&null==u.nodeType&&!Array.isArray(u)){for(let e in h=2,u)if(null!=u[e]){let t=e.indexOf(" ");t>0?d.setAttributeNS(e.slice(0,t),e.slice(t+1),u[e]):"style"==e&&d.style?d.style.cssText=u[e]:d.setAttribute(e,u[e])}}for(let o=h;o<t.length;o++){let s=t[o];if(0===s){if(o<t.length-1||o>h)throw RangeError("Content hole must be the only child of its parent node");return{dom:d,contentDOM:d}}{let{dom:t,contentDOM:o}=eA(e,s,n,r);if(d.appendChild(t),o){if(i)throw RangeError("Multiple content holes");i=o}}}return{dom:d,contentDOM:i}}class eD{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class e_{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&e_.empty)return e_.empty}recover(e){let t=0,n=65535&e;if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+(e-(65535&e))/65536}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?r:0);if(l>e)break;let a=this.ranges[s+i],c=this.ranges[s+o],d=l+a;if(e<=d){let i=a?e==l?-1:e==d?1:t:t,o=l+r+(i<0?0:c);if(n)return o;let u=e==(t<0?l:d)?null:s/3+(e-l)*65536,h=e==l?2:e==d?1:4;return(t<0?e!=l:e!=d)&&(h|=8),new eD(o,h,u)}r+=c-a}return n?e+r:new eD(e+r,0,null)}touches(e,t){let n=0,r=65535&t,i=this.inverted?2:1,o=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let s=this.ranges[t]-(this.inverted?n:0);if(s>e)break;let l=this.ranges[t+i];if(e<=s+l&&t==3*r)return!0;n+=this.ranges[t+o]-l}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],s=o-(this.inverted?i:0),l=o+(this.inverted?0:i),a=this.ranges[r+t],c=this.ranges[r+n];e(s,s+a,l,l+c),i+=c-a}}invert(){return new e_(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?e_.empty:new e_(e<0?[0,-e,0]:[0,0,e])}}e_.empty=new e_([]);class eT{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new eT(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),null!=t&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new eT;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(null!=i.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new eD(e,r,null)}}let eN=Object.create(null);class eO{getMap(){return e_.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError("Invalid input for Step.fromJSON");let n=eN[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in eN)throw RangeError("Duplicate use of step JSON ID "+e);return eN[e]=t,t.prototype.jsonID=e,t}}class eR{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new eR(e,null)}static fail(e){return new eR(null,e)}static fromReplace(e,t,n,r){try{return eR.ok(e.replace(t,n,r))}catch(e){if(e instanceof z)return eR.fail(e.message);throw e}}}function eF(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(eF(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return O.fromArray(r)}class eI extends eO{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new j(eF(t.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,r),t.openStart,t.openEnd);return eR.fromReplace(e,this.from,this.to,i)}invert(){return new eL(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new eI(t.pos,n.pos,this.mark)}merge(e){return e instanceof eI&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new eI(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new eI(t.from,t.to,e.markFromJSON(t.mark))}}eO.jsonID("addMark",eI);class eL extends eO{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new j(eF(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return eR.fromReplace(e,this.from,this.to,n)}invert(){return new eI(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new eL(t.pos,n.pos,this.mark)}merge(e){return e instanceof eL&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new eL(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new eL(t.from,t.to,e.markFromJSON(t.mark))}}eO.jsonID("removeMark",eL);class ez extends eO{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return eR.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return eR.fromReplace(e,this.pos,this.pos+1,new j(O.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new ez(this.pos,t.marks[n]);return new ez(this.pos,this.mark)}}return new ej(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ez(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new ez(t.pos,e.markFromJSON(t.mark))}}eO.jsonID("addNodeMark",ez);class ej extends eO{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return eR.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return eR.fromReplace(e,this.pos,this.pos+1,new j(O.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new ez(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ej(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new ej(t.pos,e.markFromJSON(t.mark))}}eO.jsonID("removeNodeMark",ej);class eB extends eO{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&e$(e,this.from,this.to)?eR.fail("Structure replace would overwrite content"):eR.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new e_([this.from,this.to-this.from,this.slice.size])}invert(e){return new eB(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new eB(t.pos,Math.max(t.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof eB)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart)if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;else{let t=this.slice.size+e.slice.size==0?j.empty:new j(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new eB(e.from,this.to,t,this.structure)}{let t=this.slice.size+e.slice.size==0?j.empty:new j(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new eB(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new eB(t.from,t.to,j.fromJSON(e,t.slice),!!t.structure)}}eO.jsonID("replace",eB);class eP extends eO{constructor(e,t,n,r,i,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(e){if(this.structure&&(e$(e,this.from,this.gapFrom)||e$(e,this.gapTo,this.to)))return eR.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return eR.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?eR.fromReplace(e,this.from,this.to,n):eR.fail("Content does not fit in gap")}getMap(){return new e_([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new eP(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||i>n.pos?null:new eP(t.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new eP(t.from,t.to,t.gapFrom,t.gapTo,j.fromJSON(e,t.slice),t.insert,!!t.structure)}}function e$(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function eq(e,t,n,r=n.contentMatch,i=!0){let o=e.doc.nodeAt(t),s=[],l=t+1;for(let t=0;t<o.childCount;t++){let a=o.child(t),c=l+a.nodeSize,d=r.matchType(a.type);if(d){r=d;for(let t=0;t<a.marks.length;t++)n.allowsMarkType(a.marks[t].type)||e.step(new eL(l,c,a.marks[t]));if(i&&a.isText&&"pre"!=n.whitespace){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(a.text);)r||(r=new j(O.from(n.schema.text(" ",n.allowedMarks(a.marks))),0,0)),s.push(new eB(l+e.index,l+e.index+e[0].length,r))}}else s.push(new eB(l,c,j.empty));l=c}if(!r.validEnd){let t=r.fillBefore(O.empty,!0);e.replace(l,l,new j(t,0,0))}for(let t=s.length-1;t>=0;t--)e.step(s[t])}function eV(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let o=e.$from.node(n),s=e.$from.index(n)+r,l=e.$to.indexAfter(n)-i;if(n<e.depth&&o.canReplace(s,l,t))return n;if(0==n||o.type.spec.isolating||!((0==s||o.canReplace(s,o.childCount))&&(l==o.childCount||o.canReplace(0,l))))break;s&&(r=1),l<o.childCount&&(i=1)}return null}function eH(e,t,n=null,r=e){let i=function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let s=o.length?o[0]:t;return n.canReplaceWith(r,i,s)?o:null}(e,t),o=i&&function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),s=t.contentMatch.findWrapping(o.type);if(!s)return null;let l=(s.length?s[s.length-1]:t).contentMatch;for(let e=r;l&&e<i;e++)l=l.matchType(n.child(e).type);return l&&l.validEnd?s:null}(r,t);return o?i.map(eW).concat({type:t,attrs:n}).concat(o.map(eW)):null}function eW(e){return{type:e,attrs:null}}function eU(e,t,n,r){t.forEach((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let i=e.mapping.slice(r).map(n+1+o+s.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function eK(e,t,n,r){t.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+o);e.replaceWith(i,i+1,t.type.schema.text("\n"))}})}function eJ(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>o;e--,t--){let n=i.node(e),o=i.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(o,n.childCount),l=r&&r[t+1];l&&(s=s.replaceChild(0,l.type.create(l.attrs)));let a=r&&r[t]||n;if(!n.canReplace(o+1,n.childCount)||!a.type.validContent(s))return!1}let l=i.indexAfter(o),a=r&&r[0];return i.node(o).canReplaceWith(l,l,a?a.type:i.node(o+1).type)}function eG(e,t){let n=e.resolve(t),r=n.index();return eZ(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function eZ(e,t){return!!(e&&t&&!e.isLeaf&&function(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let o=t.child(i),s=o.type==r?e.type.schema.nodes.text:o.type;if(!(n=n.matchType(s))||!e.type.allowsMarks(o.marks))return!1}return n.validEnd}(e,t))}function eX(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,o,s=r.index(e);if(e==r.depth?(i=r.nodeBefore,o=r.nodeAfter):n>0?(i=r.node(e+1),s++,o=r.node(e).maybeChild(s)):(i=r.node(e).maybeChild(s-1),o=r.node(e+1)),i&&!i.isTextblock&&eZ(i,o)&&r.node(e).canReplace(s,s+1))return t;if(0==e)break;t=n<0?r.before(e):r.after(e)}}function eQ(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,o=r.index(t)+ +(n>0),s=r.node(t),l=!1;if(1==e)l=s.canReplace(o,o,i);else{let e=s.contentMatchAt(o).findWrapping(i.firstChild.type);l=e&&s.canReplaceWith(o,o,e[0])}if(l)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function eY(e,t,n=t,r=j.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return e0(i,o,r)?new eB(t,n,r):new e1(i,o,r).fit()}function e0(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}eO.jsonID("replaceAround",eP);class e1{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=O.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=O.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,o=n.depth,s=r.depth;for(;o&&s&&1==i.childCount;)i=i.firstChild.content,o--,s--;let l=new j(i,o,s);return e>-1?new eP(n.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||n.pos!=this.$to.pos?new eB(n.pos,r.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e=null,r=(n?(e=e5(this.unplaced.content,n-1).firstChild).content:this.unplaced.content).firstChild;for(let i=this.depth;i>=0;i--){let{type:o,match:s}=this.frontier[i],l,a=null;if(1==t&&(r?s.matchType(r.type)||(a=s.fillBefore(O.from(r),!1)):e&&o.compatibleContent(e.type)))return{sliceDepth:n,frontierDepth:i,parent:e,inject:a};if(2==t&&r&&(l=s.findWrapping(r.type)))return{sliceDepth:n,frontierDepth:i,parent:e,wrap:l};if(e&&s.matchType(e.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=e5(e,t);return!!r.childCount&&!r.firstChild.isLeaf&&(this.unplaced=new j(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=e5(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new j(e2(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new j(e2(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let o=this.unplaced,s=n?n.content:o.content,l=o.openStart-e,a=0,c=[],{match:d,type:u}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)c.push(r.child(e));d=d.matchFragment(r)}let h=s.size+e-(o.content.size-o.openEnd);for(;a<s.childCount;){let e=s.child(a),t=d.matchType(e.type);if(!t)break;(++a>1||0==l||e.content.size)&&(d=t,c.push(function e(t,n,r){if(n<=0)return t;let i=t.content;return n>1&&(i=i.replaceChild(0,e(i.firstChild,n-1,1==i.childCount?r-1:0))),n>0&&(i=t.type.contentMatch.fillBefore(i).append(i),r<=0&&(i=i.append(t.type.contentMatch.matchFragment(i).fillBefore(O.empty,!0)))),t.copy(i)}(e.mark(u.allowedMarks(e.marks)),1==a?l:0,a==s.childCount?h:-1)))}let p=a==s.childCount;p||(h=-1),this.placed=e3(this.placed,t,O.from(c)),this.frontier[t].match=d,p&&h<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=s;e<h;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?0==e?j.empty:new j(e2(o.content,e-1,1),e-1,h<0?o.openEnd:e-1):new j(e2(o.content,e,a),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!e4(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return -1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){t:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=e4(e,t,r,n,i);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=e4(e,n,r,t,!0);if(!i||i.childCount)continue t}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=e3(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=e3(this.placed,this.depth,O.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(O.empty,!0);e.childCount&&(this.placed=e3(this.placed,this.frontier.length,e))}}function e2(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(e2(e.firstChild.content,t-1,n)))}function e3(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(e3(e.lastChild.content,t-1,n)))}function e5(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function e4(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,o.content,s)?l:null}function e6(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}class e9 extends eO{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return eR.fail("No node at attribute step's position");let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return eR.fromReplace(e,this.pos,this.pos+1,new j(O.from(r),0,+!t.isLeaf))}getMap(){return e_.empty}invert(e){return new e9(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new e9(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new e9(t.pos,t.attr,t.value)}}eO.jsonID("attr",e9);class e8 extends eO{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return eR.ok(n)}getMap(){return e_.empty}invert(e){return new e8(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new e8(t.attr,t.value)}}eO.jsonID("docAttr",e8);let e7=class extends Error{};(e7=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype),e7.prototype.constructor=e7,e7.prototype.name="TransformError";class te{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new eT}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new e7(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,o)=>{e=Math.min(e,i),t=Math.max(t,o)})}return 1e9==e?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=j.empty){let r=eY(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new j(O.from(n),0,0))}delete(e,t){return this.replace(e,t,j.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return!function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(e0(i,o,r))return e.step(new eB(t,n,r));let s=e6(i,o);0==s[s.length-1]&&s.pop();let l=-(i.depth+1);s.unshift(l);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(e)>-1?l=e:i.before(e)==t&&s.splice(1,0,-e)}let a=s.indexOf(l),c=[],d=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(c.push(n),t==r.openStart)break;e=n.content}for(let e=d-1;e>=0;e--){var u;let t=c[e],n=(u=t.type).spec.defining||u.spec.definingForContent;if(n&&!t.sameMarkup(i.node(Math.abs(l)-1)))d=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let l=(t+d+1)%(r.openStart+1),u=c[l];if(u)for(let t=0;t<s.length;t++){let c=s[(t+a)%s.length],d=!0;c<0&&(d=!1,c=-c);let h=i.node(c-1),p=i.index(c-1);if(h.canReplaceWith(p,p,u.type,u.marks))return e.replace(i.before(c),d?o.after(c):n,new j(function e(t,n,r,i,o){if(n<r){let o=t.firstChild;t=t.replaceChild(0,o.copy(e(o.content,n+1,r,i,o)))}if(n>i){let e=o.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(O.empty,!0))}return t}(r.content,0,r.openStart,l),l,r.openEnd))}}let h=e.steps.length;for(let l=s.length-1;l>=0&&(e.replace(t,n,r),!(e.steps.length>h));l--){let e=s[l];e<0||(t=i.before(e),n=o.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){var r=e,i=t;if(!n.isInline&&r==i&&this.doc.resolve(r).parent.content.size){let e=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)break}return null}(this.doc,r,n.type);null!=e&&(r=i=e)}return this.replaceRange(r,i,new j(O.from(n),0,0)),this}deleteRange(e,t){return!function(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=e6(r,i);for(let t=0;t<o.length;t++){let n=o[t],s=t==o.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(t-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return e.delete(r.before(o),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return!function(e,t,n){let{$from:r,$to:i,depth:o}=t,s=r.before(o+1),l=i.after(o+1),a=s,c=l,d=O.empty,u=0;for(let e=o,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,d=O.from(r.node(e).copy(d)),u++):a--;let h=O.empty,p=0;for(let e=o,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,h=O.from(i.node(e).copy(h)),p++):c++;e.step(new eP(a,c,s,l,new j(d.append(h),u,p),d.size-u,!0))}(this,e,t),this}join(e,t=1){return!function(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,o=e.doc.resolve(t-n),s=o.node().type;if(i&&s.inlineContent){let e="pre"==s.whitespace,t=!!s.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let l=e.steps.length;if(!1===r){let r=e.doc.resolve(t+n);eK(e,r.node(),r.before(),l)}s.inlineContent&&eq(e,t+n-1,s,o.node().contentMatchAt(o.index()),null==r);let a=e.mapping.slice(l),c=a.map(t-n);if(e.step(new eB(c,a.map(t+n,-1),j.empty,!0)),!0===r){let t=e.doc.resolve(c);eU(e,t.node(),t.before(),e.steps.length)}}(this,e,t),this}wrap(e,t){return!function(e,t,n){let r=O.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=O.from(n[e].type.create(n[e].attrs,r))}let i=t.start,o=t.end;e.step(new eP(i,o,i,o,new j(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){var i=this;if(!n.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let o=i.steps.length;return i.doc.nodesBetween(e,t,(e,t)=>{var s,l,a;let c,d,u="function"==typeof r?r(e):r;if(e.isTextblock&&!e.hasMarkup(n,u)&&(s=i.doc,l=i.mapping.slice(o).map(t),a=n,d=(c=s.resolve(l)).index(),c.parent.canReplaceWith(d,d+1,a))){let r=null;if(n.schema.linebreakReplacement){let e="pre"==n.whitespace,t=!!n.contentMatch.matchType(n.schema.linebreakReplacement);e&&!t?r=!1:!e&&t&&(r=!0)}!1===r&&eK(i,e,t,o),eq(i,i.mapping.slice(o).map(t,1),n,void 0,null===r);let s=i.mapping.slice(o),l=s.map(t,1),a=s.map(t+e.nodeSize,1);return i.step(new eP(l,a,l+1,a-1,new j(O.from(n.create(u,null,e.marks)),0,0),1,!0)),!0===r&&eU(i,e,t,o),!1}}),this}setNodeMarkup(e,t,n=null,r){return!function(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw RangeError("Invalid content for node type "+n.name);e.step(new eP(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new j(O.from(s),0,0),1,!0))}(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new e9(e,t,n)),this}setDocAttribute(e,t){return this.step(new e8(e,t)),this}addNodeMark(e,t){return this.step(new ez(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError("No node at position "+e);if(t instanceof L)t.isInSet(n.marks)&&this.step(new ej(e,t));else{let r=n.marks,i,o=[];for(;i=t.isInSet(r);)o.push(new ej(e,i)),r=i.removeFromSet(r);for(let e=o.length-1;e>=0;e--)this.step(o[e])}return this}split(e,t=1,n){return!function(e,t,n=1,r){let i=e.doc.resolve(t),o=O.empty,s=O.empty;for(let e=i.depth,t=i.depth-n,l=n-1;e>t;e--,l--){o=O.from(i.node(e).copy(o));let t=r&&r[l];s=O.from(t?t.type.create(t.attrs,s):i.node(e).copy(s))}e.step(new eB(t,t,new j(o.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){var r;let i,o,s,l;return r=this,s=[],l=[],r.doc.nodesBetween(e,t,(r,a,c)=>{if(!r.isInline)return;let d=r.marks;if(!n.isInSet(d)&&c.type.allowsMarkType(n.type)){let c=Math.max(a,e),u=Math.min(a+r.nodeSize,t),h=n.addToSet(d);for(let e=0;e<d.length;e++)d[e].isInSet(h)||(i&&i.to==c&&i.mark.eq(d[e])?i.to=u:s.push(i=new eL(c,u,d[e])));o&&o.to==c?o.to=u:l.push(o=new eI(c,u,n))}}),s.forEach(e=>r.step(e)),l.forEach(e=>r.step(e)),this}removeMark(e,t,n){var r;let i,o;return r=this,i=[],o=0,r.doc.nodesBetween(e,t,(r,s)=>{if(!r.isInline)return;o++;let l=null;if(n instanceof eu){let e=r.marks,t;for(;t=n.isInSet(e);)(l||(l=[])).push(t),e=t.removeFromSet(e)}else n?n.isInSet(r.marks)&&(l=[n]):l=r.marks;if(l&&l.length){let n=Math.min(s+r.nodeSize,t);for(let t=0;t<l.length;t++){let r=l[t],a;for(let e=0;e<i.length;e++){let t=i[e];t.step==o-1&&r.eq(i[e].style)&&(a=t)}a?(a.to=n,a.step=o):i.push({style:r,from:Math.max(s,e),to:n,step:o})}}}),i.forEach(e=>r.step(new eL(e.from,e.to,e.style))),this}clearIncompatible(e,t,n){return eq(this,e,t,n),this}}let tt=Object.create(null);class tn{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new tr(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=j.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:l,$to:a}=o[s],c=e.mapping.slice(i);e.replaceRange(c.map(l.pos),c.map(a.pos),s?j.empty:t),0==s&&tp(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],l=e.mapping.slice(n),a=l.map(o.pos),c=l.map(s.pos);i?e.deleteRange(a,c):(e.replaceRangeWith(a,c,t),tp(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new ts(e):th(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?th(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):th(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new td(e.node(0))}static atStart(e){return th(e,e,0,0,1)||new td(e)}static atEnd(e){return th(e,e,e.content.size,e.childCount,-1)||new td(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError("Invalid input for Selection.fromJSON");let n=tt[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in tt)throw RangeError("Duplicate use of selection JSON ID "+e);return tt[e]=t,t.prototype.jsonID=e,t}getBookmark(){return ts.between(this.$anchor,this.$head).getBookmark()}}tn.prototype.visible=!0;class tr{constructor(e,t){this.$from=e,this.$to=t}}let ti=!1;function to(e){ti||e.parent.inlineContent||(ti=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class ts extends tn{constructor(e,t=e){to(e),to(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return tn.near(n);let r=e.resolve(t.map(this.anchor));return new ts(r.parent.inlineContent?r:n,n)}replace(e,t=j.empty){if(super.replace(e,t),t==j.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof ts&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new tl(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new ts(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if((!n||r)&&(n=r>=0?1:-1),!t.parent.inlineContent){let e=tn.findFrom(t,n,!0)||tn.findFrom(t,-n,!0);if(!e)return tn.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r?e=t:(e=(tn.findFrom(e,-n,!0)||tn.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0&&(e=t)),new ts(e,t)}}tn.jsonID("text",ts);class tl{constructor(e,t){this.anchor=e,this.head=t}map(e){return new tl(e.map(this.anchor),e.map(this.head))}resolve(e){return ts.between(e.resolve(this.anchor),e.resolve(this.head))}}class ta extends tn{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?tn.near(i):new ta(i)}content(){return new j(O.from(this.node),0,0)}eq(e){return e instanceof ta&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new tc(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new ta(e.resolve(t.anchor))}static create(e,t){return new ta(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}ta.prototype.visible=!1,tn.jsonID("node",ta);class tc{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new tl(n,n):new tc(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&ta.isSelectable(n)?new ta(t):tn.near(t)}}class td extends tn{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=j.empty){if(t==j.empty){e.delete(0,e.doc.content.size);let t=tn.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new td(e)}map(e){return new td(e)}eq(e){return e instanceof td}getBookmark(){return tu}}tn.jsonID("all",td);let tu={map(){return this},resolve:e=>new td(e)};function th(e,t,n,r,i,o=!1){if(t.inlineContent)return ts.create(e,n);for(let s=r-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){let r=t.child(s);if(r.isAtom){if(!o&&ta.isSelectable(r))return ta.create(e,n-(i<0?r.nodeSize:0))}else{let t=th(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function tp(e,t,n){let r,i=e.steps.length-1;if(i<t)return;let o=e.steps[i];(o instanceof eB||o instanceof eP)&&(e.mapping.maps[i].forEach((e,t,n,i)=>{null==r&&(r=i)}),e.setSelection(tn.near(e.doc.resolve(r),n)))}class tf extends te{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return L.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||L.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.selection.to!=t+e.length||this.setSelection(tn.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function tm(e,t){return t&&e?e.bind(t):e}class tg{constructor(e,t,n){this.name=e,this.init=tm(t.init,n),this.apply=tm(t.apply,n)}}let ty=[new tg("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new tg("selection",{init:(e,t)=>e.selection||tn.atStart(t.doc),apply:e=>e.selection}),new tg("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new tg("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class tk{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=ty.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new tg(e.key,e.spec.state,e))})}}class tb{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let s=this.config.plugins[o];if(s.spec.appendTransaction){let l=r?r[o].n:0,a=r?r[o].state:this,c=l<t.length&&s.spec.appendTransaction.call(s,l?t.slice(l):t,a,n);if(c&&n.filterTransaction(c,o)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<o?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),i=!0}r&&(r[o]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");let t=new tb(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new tf(this)}static create(e){let t=new tk(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new tb(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new tk(this.schema,e.plugins),n=t.fields,r=new tb(t);for(let t=0;t<n.length;t++){let i=n[t].name;r[i]=this.hasOwnProperty(i)?this[i]:n[t].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw RangeError("Required config field 'schema' missing");let r=new tk(e.schema,e.plugins),i=new tb(r);return r.fields.forEach(r=>{if("doc"==r.name)i.doc=X.fromJSON(e.schema,t.doc);else if("selection"==r.name)i.selection=tn.fromJSON(i.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let o in n){let s=n[o],l=s.spec.state;if(s.key==r.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(t,o)){i[r.name]=l.fromJSON.call(s,e,t[o],i);return}}i[r.name]=r.init(e,i)}}),i}}class tv{constructor(e){this.spec=e,this.props={},e.props&&function e(t,n,r){for(let i in t){let o=t[i];o instanceof Function?o=o.bind(n):"handleDOMEvents"==i&&(o=e(o,n,{})),r[i]=o}return r}(e.props,this,this.props),this.key=e.key?e.key.key:tw("plugin")}getState(e){return e[this.key]}}let tx=Object.create(null);function tw(e){return e in tx?e+"$"+ ++tx[e]:(tx[e]=0,e+"$")}class tC{constructor(e="key"){this.key=tw(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}let tS=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function tM(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("backward",e):!(n.parentOffset>0))?n:null}let tE=(e,t,n)=>{let r=tM(e,n);if(!r)return!1;let i=tT(r);if(!i){let n=r.blockRange(),i=n&&eV(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(tP(e,i,t,-1))return!0;if(0==r.parent.content.size&&(tD(o,"end")||ta.isSelectable(o)))for(let n=r.depth;;n--){let s=eY(e.doc,r.before(n),r.after(n),j.empty);if(s&&s.slice.size<s.to-s.from){if(t){let n=e.tr.step(s);n.setSelection(tD(o,"end")?tn.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):ta.create(n.doc,i.pos-o.nodeSize)),t(n.scrollIntoView())}return!0}if(1==n||r.node(n-1).childCount>1)break}return!!o.isAtom&&i.depth==r.depth-1&&(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0)};function tA(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let o=t.nodeAfter,s=t.pos+1;for(;!o.isTextblock;s++){if(o.type.spec.isolating)return!1;let e=o.firstChild;if(!e)return!1;o=e}let l=eY(e.doc,i,s,j.empty);if(!l||l.from!=i||l instanceof eB&&l.slice.size>=s-i)return!1;if(n){let t=e.tr.step(l);t.setSelection(ts.create(t.doc,i)),n(t.scrollIntoView())}return!0}function tD(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)break}return!1}let t_=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=tT(r)}let s=o&&o.nodeBefore;return!!s&&!!ta.isSelectable(s)&&(t&&t(e.tr.setSelection(ta.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function tT(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function tN(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("forward",e):!(n.parentOffset<n.parent.content.size))?n:null}let tO=(e,t,n)=>{let r=tN(e,n);if(!r)return!1;let i=tF(r);if(!i)return!1;let o=i.nodeAfter;if(tP(e,i,t,1))return!0;if(0==r.parent.content.size&&(tD(o,"start")||ta.isSelectable(o))){let n=eY(e.doc,r.before(),r.after(),j.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(tD(o,"start")?tn.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):ta.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return!!o.isAtom&&i.depth==r.depth-1&&(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0)},tR=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=tF(r)}let s=o&&o.nodeAfter;return!!s&&!!ta.isSelectable(s)&&(t&&t(e.tr.setSelection(ta.create(e.doc,o.pos)).scrollIntoView()),!0)};function tF(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}let tI=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!!n.parent.type.spec.code&&!!n.sameParent(r)&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)};function tL(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}let tz=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=tL(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,s.createAndFill());i.setSelection(tn.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},tj=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof td||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=tL(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=e.tr.insert(n,o.createAndFill());s.setSelection(ts.create(s.doc,n+1)),t(s.scrollIntoView())}return!0},tB=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(eJ(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&eV(r);return null!=i&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function tP(e,t,n,r){let i,o,s,l=t.nodeBefore,a=t.nodeAfter,c,d,u=l.type.spec.isolating||a.type.spec.isolating;if(!u&&(i=t.nodeBefore,o=t.nodeAfter,s=t.index(),i&&o&&i.type.compatibleContent(o.type)&&(!i.content.size&&t.parent.canReplace(s-1,s)?(n&&n(e.tr.delete(t.pos-i.nodeSize,t.pos).scrollIntoView()),!0):!!t.parent.canReplace(s,s+1)&&!!(o.isTextblock||eG(e.doc,t.pos))&&(n&&n(e.tr.join(t.pos).scrollIntoView()),!0))))return!0;let h=!u&&t.parent.canReplace(t.index(),t.index()+1);if(h&&(c=(d=l.contentMatchAt(l.childCount)).findWrapping(a.type))&&d.matchType(c[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,i=O.empty;for(let e=c.length-1;e>=0;e--)i=O.from(c[e].create(null,i));i=O.from(l.copy(i));let o=e.tr.step(new eP(t.pos-1,r,t.pos,r,new j(i,1,0),c.length,!0)),s=o.doc.resolve(r+2*c.length);s.nodeAfter&&s.nodeAfter.type==l.type&&eG(o.doc,s.pos)&&o.join(s.pos),n(o.scrollIntoView())}return!0}let p=a.type.spec.isolating||r>0&&u?null:tn.findFrom(t,1),f=p&&p.$from.blockRange(p.$to),m=f&&eV(f);if(null!=m&&m>=t.depth)return n&&n(e.tr.lift(f,m).scrollIntoView()),!0;if(h&&tD(a,"start",!0)&&tD(l,"end")){let r=l,i=[];for(;i.push(r),!r.isTextblock;)r=r.lastChild;let o=a,s=1;for(;!o.isTextblock;o=o.firstChild)s++;if(r.canReplace(r.childCount,r.childCount,o.content)){if(n){let r=O.empty;for(let e=i.length-1;e>=0;e--)r=O.from(i[e].copy(r));n(e.tr.step(new eP(t.pos-i.length,t.pos+a.nodeSize,t.pos+s,t.pos+a.nodeSize-s,new j(r,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function t$(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(t.tr.setSelection(ts.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}let tq=t$(-1),tV=t$(1);function tH(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:o},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(o,s,(r,o)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(o),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:o},$to:{pos:s}}=n.selection.ranges[r];i.setBlockType(o,s,e,t)}r(i.scrollIntoView())}return!0}}function tW(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}let tU=tW(tS,tE,t_),tK=tW(tS,tO,tR),tJ={Enter:tW(tI,tj,tB,(e,t)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof ta&&e.selection.node.isBlock)return!!n.parentOffset&&!!eJ(e.doc,n.pos)&&(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let i=[],o,s,l=!1,a=!1;for(let e=n.depth;;e--){if(n.node(e).isBlock){let t;l=n.end(e)==n.pos+(n.depth-e),a=n.start(e)==n.pos-(n.depth-e),s=tL(n.node(e-1).contentMatchAt(n.indexAfter(e-1)));i.unshift(t||(l&&s?{type:s}:null)),o=e;break}if(1==e)return!1;i.unshift(null)}let c=e.tr;(e.selection instanceof ts||e.selection instanceof td)&&c.deleteSelection();let d=c.mapping.map(n.pos),u=eJ(c.doc,d,i.length,i);if(u||(i[0]=s?{type:s}:null,u=eJ(c.doc,d,i.length,i)),!u)return!1;if(c.split(d,i.length,i),!l&&a&&n.node(o).type!=s){let e=c.mapping.map(n.before(o)),t=c.doc.resolve(e);s&&n.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&c.setNodeMarkup(c.mapping.map(n.before(o)),s)}return t&&t(c.scrollIntoView()),!0}),"Mod-Enter":tz,Backspace:tU,"Mod-Backspace":tU,"Shift-Backspace":tU,Delete:tK,"Mod-Delete":tK,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new td(e.doc))),!0)},tG={"Ctrl-h":tJ.Backspace,"Alt-Backspace":tJ["Mod-Backspace"],"Ctrl-d":tJ.Delete,"Ctrl-Alt-Backspace":tJ["Mod-Delete"],"Alt-Delete":tJ["Mod-Delete"],"Alt-d":tJ["Mod-Delete"],"Ctrl-a":tq,"Ctrl-e":tV};for(let e in tJ)tG[e]=tJ[e];"u">typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"u">typeof os&&os.platform&&os.platform();let tZ=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},tX=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},tQ=null,tY=function(e,t,n){let r=tQ||(tQ=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},t0=function(){tQ=null},t1=function(e,t,n,r){return n&&(t3(e,t,n,r,-1)||t3(e,t,n,r,1))},t2=/^(img|br|input|textarea|hr)$/i;function t3(e,t,n,r,i){for(var o;;){if(e==n&&t==r)return!0;if(t==(i<0?0:t5(e))){let n=e.parentNode;if(!n||1!=n.nodeType||t4(e)||t2.test(e.nodeName)||"false"==e.contentEditable)return!1;t=tZ(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==(o=n.pmViewDesc)||!o.ignoreForSelection)return!1;else t+=i;else e=n,t=i<0?t5(e):0}}}function t5(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function t4(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 t6=function(e){return e.focusNode&&t1(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function t9(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}let t8="u">typeof navigator?navigator:null,t7="u">typeof document?document:null,ne=t8&&t8.userAgent||"",nt=/Edge\/(\d+)/.exec(ne),nn=/MSIE \d/.exec(ne),nr=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ne),ni=!!(nn||nr||nt),no=nn?document.documentMode:nr?+nr[1]:nt?+nt[1]:0,ns=!ni&&/gecko\/(\d+)/i.test(ne);ns&&(/Firefox\/(\d+)/.exec(ne)||[0,0])[1];let nl=!ni&&/Chrome\/(\d+)/.exec(ne),na=!!nl,nc=nl?+nl[1]:0,nd=!ni&&!!t8&&/Apple Computer/.test(t8.vendor),nu=nd&&(/Mobile\/\w+/.test(ne)||!!t8&&t8.maxTouchPoints>2),nh=nu||!!t8&&/Mac/.test(t8.platform),np=!!t8&&/Win/.test(t8.platform),nf=/Android \d/.test(ne),nm=!!t7&&"webkitFontSmoothing"in t7.documentElement.style,ng=nm?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function ny(e,t){return"number"==typeof e?e:e[t]}function nk(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;){if(1!=s.nodeType){s=tX(s);continue}let e=s,n=e==o.body,l=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}}(o):function(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}(e),a=0,c=0;if(t.top<l.top+ny(r,"top")?c=-(l.top-t.top+ny(i,"top")):t.bottom>l.bottom-ny(r,"bottom")&&(c=t.bottom-t.top>l.bottom-l.top?t.top+ny(i,"top")-l.top:t.bottom-l.bottom+ny(i,"bottom")),t.left<l.left+ny(r,"left")?a=-(l.left-t.left+ny(i,"left")):t.right>l.right-ny(r,"right")&&(a=t.right-l.right+ny(i,"right")),a||c)if(n)o.defaultView.scrollBy(a,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),a&&(e.scrollLeft+=a);let i=e.scrollLeft-n,o=e.scrollTop-r;t={left:t.left-i,top:t.top-o,right:t.right-i,bottom:t.bottom-o}}let d=n?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(d))break;s="absolute"==d?s.offsetParent:tX(s)}}function nb(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=tX(r));return t}function nv(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let nx=null;function nw(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function nC(e){return e.top<e.bottom||e.left<e.right}function nS(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(nC(e))return e}return Array.prototype.find.call(n,nC)||e.getBoundingClientRect()}let nM=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function nE(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),s=nm||ns;if(3==r.nodeType)if(s&&(nM.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=nS(tY(r,i,i),n);if(ns&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=nS(tY(r,i-1,i-1),-1);if(t.top==e.top){let n=nS(tY(r,i,i+1),-1);if(n.top!=e.top)return nA(n,n.left<t.left)}}return e}else{let e=i,t=i,o=n<0?1:-1;return n<0&&!i?(t++,o=-1):n>=0&&i==r.nodeValue.length?(e--,o=1):n<0?e--:t++,nA(nS(tY(r,e,t),o),o<0)}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(null==o&&i&&(n<0||i==t5(r))){let e=r.childNodes[i-1];if(1==e.nodeType)return nD(e.getBoundingClientRect(),!1)}if(null==o&&i<t5(r)){let e=r.childNodes[i];if(1==e.nodeType)return nD(e.getBoundingClientRect(),!0)}return nD(r.getBoundingClientRect(),n>=0)}if(null==o&&i&&(n<0||i==t5(r))){let e=r.childNodes[i-1],t=3==e.nodeType?tY(e,t5(e)-!s):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return nA(nS(t,1),!1)}if(null==o&&i<t5(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?tY(e,0,+!s):1==e.nodeType?e:null:null;if(t)return nA(nS(t,-1),!0)}return nA(nS(3==r.nodeType?tY(r):r,-n),n>=0)}function nA(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 nD(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 n_(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}let nT=/[\u0590-\u08ac]/,nN=null,nO=null,nR=!1;class nF{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,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 r=this.children[t];if(r==e)return n;n+=r.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 r;if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}if(e==this.dom&&this.contentDOM)r=t>tZ(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),o;if(i&&(!t||i.node))if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==e.nodeType?e:e.parentNode):o==e))return i;else 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 r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return -1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],o=t+i.size;if(o>e||i instanceof n$){r=e-t;break}t=o}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof nI&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;(e=n?this.children[n-1]:null)&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?tZ(e.dom)+1:0}}{let e,r=!0;for(;(e=n<this.children.length?this.children[n]:null)&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?tZ(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 r=-1,i=-1;for(let o=n,s=0;;s++){let n=this.children[s],l=o+n.size;if(-1==r&&e<=l){let i=o+n.border;if(e>=i&&t<=l-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=o;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=tZ(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(l>t||s==this.children.length-1)){t=l;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=tZ(n.dom);break}t+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=l}return{node:this.contentDOM,from:e,to:t,fromOffset:r,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,r=!1){let i=Math.min(e,t),o=Math.max(e,t);for(let s=0,l=0;s<this.children.length;s++){let a=this.children[s],c=l+a.size;if(i>l&&o<c)return a.setSelection(e-l-a.border,t-l-a.border,n,r);l=c}let s=this.domFromPos(e,e?-1:1),l=t==e?s:this.domFromPos(t,t?-1:1),a=n.root.getSelection(),c=n.domSelectionRange(),d=!1;if((ns||nd)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if((d=!!(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&&(s=l={node:n.parentNode,offset:tZ(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];d=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(ns&&c.focusNode&&c.focusNode!=l.node&&1==c.focusNode.nodeType){let e=c.focusNode.childNodes[c.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||d&&nd)&&t1(s.node,s.offset,c.anchorNode,c.anchorOffset)&&t1(l.node,l.offset,c.focusNode,c.focusOffset))return;let u=!1;if((a.extend||e==t)&&!(d&&ns)){a.collapse(s.node,s.offset);try{e!=t&&a.extend(l.node,l.offset),u=!0}catch(e){}}if(!u){if(e>t){let e=s;s=l,l=e}let n=document.createRange();n.setEnd(l.node,l.offset),n.setStart(s.node,s.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,r=0;r<this.children.length;r++){let i=this.children[r],o=n+i.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let r=n+i.border,s=o-i.border;if(e>=r&&t<=s){this.dirty=e==n||t==o?2:1,e==r&&t==s&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=3:i.markDirty(e-r,t-r);return}i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=o}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 nI extends nF{constructor(e,t,n,r){let i,o=t.type.toDOM;if("function"==typeof o&&(o=o(n,()=>i?i.parent?i.parent.posBeforeChild(i):void 0:r)),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,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 nL extends nF{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}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 nz extends nF{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(e,t,n,r){let i=r.nodeViews[t.type.name],o=i&&i(t,r,n);return o&&o.dom||(o=eC.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new nz(e,t,o.dom,o.contentDOM||o.dom,o)}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 r=nz.create(this.parent,this.mark,!0,n),i=this.children,o=this.size;t<o&&(i=nQ(i,t,o,n)),e>0&&(i=nQ(i,0,e,n));for(let e=0;e<i.length;e++)i[e].parent=r;return r.children=i,r}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class nj extends nF{constructor(e,t,n,r,i,o,s,l,a){super(e,[],i,o),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s}static create(e,t,n,r,i,o){let s=i.nodeViews[t.type.name],l,a=s&&s(t,i,()=>l?l.parent?l.parent.posBeforeChild(l):void 0:o,n,r),c=a&&a.dom,d=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=eC.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:c,contentDOM:d}=e)}d||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let u=c;return(c=nK(c,n,t),a)?l=new nq(e,t,n,r,c,d||null,u,a,i,o+1):t.isText?new nP(e,t,n,r,c,u,i):new nj(e,t,n,r,c,d||null,u,i,o+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=()=>O.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)&&nJ(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,o=i&&i.pos>-1?i:null,s=i&&i.pos<0,l=new nZ(this,o&&o.node,e);(function(e,t,n,r){let i=t.locals(e),o=0;if(0==i.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,i,t.forChild(o,s),n),o+=s.nodeSize}return}let s=0,l=[],a=null;for(let c=0;;){let d,u,h,p;for(;s<i.length&&i[s].to==o;){let e=i[s++];e.widget&&(d?(u||(u=[d])).push(e):d=e)}if(d)if(u){u.sort(nX);for(let e=0;e<u.length;e++)n(u[e],c,!!a)}else n(d,c,!!a);if(a)p=-1,h=a,a=null;else if(c<e.childCount)p=c,h=e.child(c++);else break;for(let e=0;e<l.length;e++)l[e].to<=o&&l.splice(e--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)l.push(i[s++]);let f=o+h.nodeSize;if(h.isText){let e=f;s<i.length&&i[s].from<e&&(e=i[s].from);for(let t=0;t<l.length;t++)l[t].to<e&&(e=l[t].to);e<f&&(a=h.cut(e-o),h=h.cut(0,e-o),f=e,p=-1)}else for(;s<i.length&&i[s].to<f;)s++;let m=h.isInline&&!h.isLeaf?l.filter(e=>!e.inline):l.slice();r(h,m,t.forChild(o,h),p),o=f}})(this.node,this.innerDeco,(t,i,o)=>{t.spec.marks?l.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!o&&l.syncToMarks(i==this.node.childCount?L.none:this.node.child(i).marks,n,e,i),l.placeWidget(t,e,r)},(t,o,a,c)=>{let d;l.syncToMarks(t.marks,n,e,c),l.findNodeMatch(t,o,a,c)||s&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(d=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(t,o,a,d,e)||l.updateNextNode(t,o,a,e,c,r)||l.addNode(t,o,a,e,r),r+=t.nodeSize}),l.syncToMarks([],n,e,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(o&&this.protectLocalComposition(e,o),function e(t,n,r){let i=t.firstChild,o=!1;for(let s=0;s<n.length;s++){let l=n[s],a=l.dom;if(a.parentNode==t){for(;a!=i;)i=nG(i),o=!0;i=i.nextSibling}else o=!0,t.insertBefore(a,i);if(l instanceof nz){let n=i?i.previousSibling:t.lastChild;e(l.contentDOM,l.children,r),i=n?n.nextSibling:t.firstChild}}for(;i;)i=nG(i),o=!0;o&&r.trackWrites==t&&(r.trackWrites=null)}(this.contentDOM,this.children,e),nu&&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:r}=e.state.selection;if(!(e.state.selection instanceof ts)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(!this.node.inlineContent)return{node:i,pos:-1,text:""};{let e=i.nodeValue,o=function(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let s=e.child(i++),l=o;if(o+=s.nodeSize,!s.isText)continue;let a=s.text;for(;i<e.childCount;){let t=e.child(i++);if(o+=t.nodeSize,!t.isText)break;a+=t.text}if(o>=n){if(o>=r&&a.slice(r-t.length-l,r-l)==t)return r-t.length;let e=l<r?a.lastIndexOf(t,r-l-1):-1;if(e>=0&&e+t.length+l>=n)return l+e;if(n==r&&a.length>=r+t.length-l&&a.slice(r-l,r-l+t.length)==t)return r}}return -1}(this.node.content,e,n-t,r-t);return o<0?null:{node:i,pos:o,text:e}}}protectLocalComposition(e,{node:t,pos:n,text:r}){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 o=new nL(this,i,t,r);e.input.compositionNodes.push(o),this.children=nQ(this.children,n,n+r.length,e,o)}update(e,t,n,r){return 3!=this.dirty&&!!e.sameMarkup(this.node)&&(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(nJ(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=nU(this.dom,this.nodeDOM,nW(this.outerDeco,this.node,t),nW(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 nB(e,t,n,r,i){nK(r,t,e);let o=new nj(void 0,e,t,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class nP extends nj{constructor(e,t,n,r,i,o,s){super(e,t,n,r,i,null,o,s,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,r){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,r.trackWrites==this.nodeDOM&&(r.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 r=this.node.cut(e,t),i=document.createTextNode(r.text);return new nP(this.parent,r,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 n$ extends nF{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 nq extends nj{constructor(e,t,n,r,i,o,s,l,a,c){super(e,t,n,r,i,o,s,a,c),this.spec=l}update(e,t,n,r){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,r),i}return(!!this.contentDOM||!!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}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 nV=function(e){e&&(this.nodeName=e)};nV.prototype=Object.create(null);let nH=[new nV];function nW(e,t,n){if(0==e.length)return nH;let r=n?nH[0]:new nV,i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s)for(let e in s.nodeName&&i.push(r=new nV(s.nodeName)),s){let o=s[e];null!=o&&(n&&1==i.length&&i.push(r=new nV(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+o:"style"==e?r.style=(r.style?r.style+";":"")+o:"nodeName"!=e&&(r[e]=o))}}return i}function nU(e,t,n,r){if(n==nH&&r==nH)return t;let i=t;for(let t=0;t<r.length;t++){let o=r[t],s=n[t];if(t){let t;s&&s.nodeName==o.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==o.nodeName||((t=document.createElement(o.nodeName)).pmIsDeco=!0,t.appendChild(i),s=nH[0]),i=t}!function(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==i.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)-1==r.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,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}(i,s||nH[0],o)}return i}function nK(e,t,n){return nU(e,e,nH,nW(t,n,1!=e.nodeType))}function nJ(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 nG(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class nZ{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,r=n.children.length,i=e.childCount,o=new Map,s=[];n:for(;i>0;){let l;for(;;)if(r){let e=n.children[r-1];if(e instanceof nz)n=e,r=e.children.length;else{l=e,r--;break}}else if(n==t)break n;else r=n.parent.children.indexOf(n),n=n.parent;let a=l.node;if(a){if(a!=e.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.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,r){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&!1!==e[i].type.spec.spanning;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let i=-1,s=this.top.children.length;r<this.preMatch.index&&(s=Math.min(this.index+3,s));for(let t=this.index;t<s;t++){let n=this.top.children[t];if(n.matchesMark(e[o])&&!this.isLocked(n.dom)){i=t;break}}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=nz.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,n,r){let i=-1,o;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))i=this.top.children.indexOf(o,this.index);else for(let r=this.index,o=Math.min(this.top.children.length,r+5);r<o;r++){let o=this.top.children[r];if(o.matchesNode(e,t,n)&&!this.preMatch.matched.has(o)){i=r;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let o=this.top.children[r];return 3==o.dirty&&o.dom==o.contentDOM&&(o.dirty=2),!!o.update(e,t,n,i)&&(this.destroyBetween(this.index,r),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,r,i,o){for(let s=this.index;s<this.top.children.length;s++){let l=this.top.children[s];if(l instanceof nj){let a=this.preMatch.matched.get(l);if(null!=a&&a!=i)return!1;let c=l.dom,d,u=this.isLocked(c)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&3!=l.dirty&&nJ(t,l.outerDeco));if(!u&&l.update(e,t,n,r))return this.destroyBetween(this.index,s),l.dom!=c&&(this.changed=!0),this.index++,!0;if(!u&&(d=this.recreateWrapper(l,e,t,n,r,o)))return this.destroyBetween(this.index,s),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=2,d.updateChildren(r,o+1),d.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,o){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!nJ(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let s=nj.create(this.top,t,n,r,i,o);if(s.contentDOM)for(let t of(s.children=e.children,e.children=[],s.children))t.parent=s;return e.destroy(),s}addNode(e,t,n,r,i){let o=nj.create(this.top,e,t,n,r,i);o.contentDOM&&o.updateChildren(r,i+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new nI(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof nz;)e=(t=e).children[t.children.length-1];(!e||!(e instanceof nP)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((nd||na)&&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 r=new n$(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function nX(e,t){return e.type.side-t.type.side}function nQ(e,t,n,r,i){let o=[];for(let s=0,l=0;s<e.length;s++){let a=e[s],c=l,d=l+=a.size;c>=n||d<=t?o.push(a):(c<t&&o.push(a.slice(0,t-c,r)),i&&(o.push(i),i=void 0),d>n&&o.push(a.slice(n-c,a.size,r)))}return o}function nY(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&0==i.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l=r.resolve(s),a,c;if(t6(n)){for(a=s;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&ta.isSelectable(e)&&i.parent&&!(e.isInline&&function(e,t,n){for(let r=0==t,i=t==t5(e);r||i;){if(e==n)return!0;let t=tZ(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==t5(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;c=new ta(s==e?l:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=s,i=s;for(let r=0;r<n.rangeCount;r++){let o=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(o.startContainer,o.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(o.endContainer,o.endOffset,-1))}if(t<0)return null;[a,s]=i==e.state.selection.anchor?[i,t]:[t,i],l=r.resolve(s)}else a=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(a<0)return null}let d=r.resolve(a);if(!c){let n="pointer"==t||e.state.selection.head<l.pos&&!o?1:-1;c=n8(e,d,l,n)}return c}function n0(e){return e.editable?e.hasFocus():re(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function n1(e,t=!1){let n=e.state.selection;if(n6(e,n),n0(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&na){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&t1(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,r="IMG"==n.nodeName;r?t.collapse(n.parentNode,tZ(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&ni&&no<=11&&(n.disabled=!0,n.disabled=!1)}(e);else{var r;let i,o,s,l,{anchor:a,head:c}=n,d,u;n2&&!(n instanceof ts)&&(n.$from.parent.inlineContent||(d=n3(e,n.from)),n.empty||n.$from.parent.inlineContent||(u=n3(e,n.to))),e.docView.setSelection(a,c,e,t),n2&&(d&&n4(d),u&&n4(u)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&((i=(r=e).dom.ownerDocument).removeEventListener("selectionchange",r.input.hideSelectionGuard),s=(o=r.domSelectionRange()).anchorNode,l=o.anchorOffset,i.addEventListener("selectionchange",r.input.hideSelectionGuard=()=>{(o.anchorNode!=s||o.anchorOffset!=l)&&(i.removeEventListener("selectionchange",r.input.hideSelectionGuard),setTimeout(()=>{(!n0(r)||r.state.selection.visible)&&r.dom.classList.remove("ProseMirror-hideselection")},20))})))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}let n2=nd||na&&nc<63;function n3(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(nd&&i&&"false"==i.contentEditable)return n5(i);if((!i||"false"==i.contentEditable)&&(!o||"false"==o.contentEditable)){if(i)return n5(i);else if(o)return n5(o)}}function n5(e){return e.contentEditable="true",nd&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function n4(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function n6(e,t){if(t instanceof ta){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(n9(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else n9(e)}function n9(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function n8(e,t,n,r){return e.someProp("createSelectionBetween",r=>r(e,t,n))||ts.between(t,n,r)}function n7(e){return(!e.editable||!!e.hasFocus())&&re(e)}function re(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 rt(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&tn.findFrom(o,t)}function rn(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function rr(e,t,n){let r=e.state.selection;if(r instanceof ts){if(n.indexOf("s")>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return rn(e,new ts(r.$anchor,o))}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?"forward":"backward")){let n=rt(e.state,t);return!!n&&n instanceof ta&&rn(e,n)}else if(!(nh&&n.indexOf("m")>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,o;if(!i||i.isText)return!1;let s=t<0?n.pos-i.nodeSize:n.pos;return!!(i.isAtom||(o=e.docView.descAt(s))&&!o.contentDOM)&&(ta.isSelectable(i)?rn(e,new ta(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):!!nm&&rn(e,new ts(e.state.doc.resolve(t<0?s:s+i.nodeSize))))}}else{if(r instanceof ta&&r.node.isInline)return rn(e,new ts(t>0?r.$to:r.$from));let n=rt(e.state,t);return!!n&&rn(e,n)}}function ri(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function ro(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function rs(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(ns&&1==n.nodeType&&r<ri(n)&&ro(n.childNodes[r],-1)&&(s=!0);;)if(r>0)if(1!=n.nodeType)break;else{let e=n.childNodes[r-1];if(ro(e,-1))i=n,o=--r;else if(3==e.nodeType)r=(n=e).nodeValue.length;else break}else if(rl(n))break;else{let t=n.previousSibling;for(;t&&ro(t,-1);)i=n.parentNode,o=tZ(t),t=t.previousSibling;if(t)r=ri(n=t);else{if((n=n.parentNode)==e.dom)break;r=0}}s?ra(e,n,r):i&&ra(e,i,o)}(e):function(e){let t,n,r=e.domSelectionRange(),i=r.focusNode,o=r.focusOffset;if(!i)return;let s=ri(i);for(;;)if(o<s){if(1!=i.nodeType)break;if(ro(i.childNodes[o],1))t=i,n=++o;else break}else if(rl(i))break;else{let r=i.nextSibling;for(;r&&ro(r,1);)t=r.parentNode,n=tZ(r)+1,r=r.nextSibling;if(r)o=0,s=ri(i=r);else{if((i=i.parentNode)==e.dom)break;o=s=0}}t&&ra(e,t,n)}(e)}function rl(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function ra(e,t,n){if(3!=t.nodeType){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!t4(e);)t=tZ(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=r,n=0):(e=function(e,t){for(;e&&!t&&!t4(e);)t=tZ(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 r=e.domSelection();if(!r)return;if(t6(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&n1(e)},50)}function rc(e,t){let n=e.state.doc.resolve(t);if(!(na||np)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function rd(e,t,n){let r=e.state.selection;if(r instanceof ts&&!r.empty||n.indexOf("s")>-1||nh&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=rt(e.state,t);if(n&&n instanceof ta)return rn(e,n)}if(!i.parent.inlineContent){let n=t<0?i:o,s=r instanceof td?tn.near(n,t):tn.findFrom(n,t);return!!s&&rn(e,s)}return!1}function ru(e,t){if(!(e.state.selection instanceof ts))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function rh(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function rp(e,t){e.someProp("transformCopied",n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||eC.fromSchema(e.state.schema),l=rx(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let c=a.firstChild,d,u=0;for(;c&&1==c.nodeType&&(d=rb[c.nodeName.toLowerCase()]);){for(let e=d.length-1;e>=0;e--){let t=l.createElement(d[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",`${i} ${o}${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 rf(e,t,n,r,i){let o,s,l=i.parent.type.spec.code;if(!n&&!t)return null;let a=!!t&&(r||l||!n);if(a){if(e.someProp("transformPastedText",n=>{t=n(t,l||r,e)}),l)return s=new j(O.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",t=>{s=t(s,e,!0)}),s;let n=e.someProp("clipboardTextParser",n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,s=eC.fromSchema(r);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))})}}else e.someProp("transformPastedHTML",t=>{n=t(n,e)}),o=function(e){var t;let n,r=/^(\s*<meta [^>]*>)*/.exec(e);r&&(e=e.slice(r[0].length));let i=rx().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e),s;if((s=o&&rb[o[1].toLowerCase()])&&(e=s.map(e=>"<"+e+">").join("")+e+s.map(e=>"</"+e+">").reverse().join("")),i.innerHTML=(t=e,(n=window.trustedTypes)?(rw||(rw=n.defaultPolicy||n.createPolicy("ProseMirrorClipboard",{createHTML:e=>e})),rw.createHTML(t)):t),s)for(let e=0;e<s.length;e++)i=i.querySelector(s[e])||i;return i}(n),nm&&function(e){let t=e.querySelectorAll(na?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(o);let c=o&&o.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let e=+d[3];e>0;e--){let e=o.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;o=e}if(s||(s=(e.someProp("clipboardParser")||e.someProp("domParser")||ef.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(a||d),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||rm.test(e.parentNode.nodeName)?null:{ignore:!0}})),d)s=function(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch(t){return e}let{content:i,openStart:o,openEnd:s}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=O.from(t.create(r[e+1],i)),o++,s++}return new j(i,o,s)}(rk(s,+d[1],+d[2]),d[4]);else if((s=j.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,o=[];if(e.forEach(e=>{if(!o)return;let t=r.findWrapping(e.type),n;if(!t)return o=null;if(n=o.length&&i.length&&function e(t,n,r,i,o){if(o<t.length&&o<n.length&&t[o]==n[o]){let s=e(t,n,r,i.lastChild,o+1);if(s)return i.copy(i.content.replaceChild(i.childCount-1,s));if(i.contentMatchAt(i.childCount).matchType(o==t.length-1?r.type:t[o+1]))return i.copy(i.content.append(O.from(rg(r,t,o+1))))}}(t,i,e,o[o.length-1],0))o[o.length-1]=n;else{o.length&&(o[o.length-1]=function e(t,n){if(0==n)return t;let r=t.content.replaceChild(t.childCount-1,e(t.lastChild,n-1)),i=t.contentMatchAt(t.childCount).fillBefore(O.empty,!0);return t.copy(r.append(i))}(o[o.length-1],i.length));let n=rg(e,t);o.push(n),r=r.matchType(n.type),i=t}}),o)return O.from(o)}return e}(s.content,i),!0)).openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=rk(s,e,t)}return e.someProp("transformPasted",t=>{s=t(s,e,a)}),s}let rm=/^(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 rg(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,O.from(e));return e}function ry(e,t,n,r,i,o){let s=t<0?e.firstChild:e.lastChild,l=s.content;return e.childCount>1&&(o=0),i<r-1&&(l=ry(l,t,n,r,i+1,o)),i>=n&&(l=t<0?s.contentMatchAt(0).fillBefore(l,o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(O.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(l))}function rk(e,t,n){return t<e.openStart&&(e=new j(ry(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new j(ry(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}let rb={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},rv=null;function rx(){return rv||(rv=document.implementation.createHTMLDocument("title"))}let rw=null,rC={},rS={},rM={touchstart:!0,touchmove:!0};class rE{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.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function rA(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function rD(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>r_(e,t))})}function r_(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)})}function rT(e){return{left:e.clientX,top:e.clientY}}function rN(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let r=o.depth+1;r>0;r--)if(e.someProp(t,t=>r>o.depth?t(e,n,o.nodeAfter,o.before(r),i,!0):t(e,n,o.node(r),o.before(r),i,!1)))return!0;return!1}function rO(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}rS.keydown=(e,t)=>{if((e.input.shiftKey=16==t.keyCode||t.shiftKey,!rI(e,t))&&(e.input.lastKeyCode=t.keyCode,e.input.lastKeyCodeTime=Date.now(),!nf||!na||13!=t.keyCode))if(229!=t.keyCode&&e.domObserver.forceFlush(),!nu||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)e.someProp("handleKeyDown",n=>n(e,t))||function(e,t){let n,r=t.keyCode,i=(n="",t.ctrlKey&&(n+="c"),t.metaKey&&(n+="m"),t.altKey&&(n+="a"),t.shiftKey&&(n+="s"),n);if(8==r||nh&&72==r&&"c"==i)return ru(e,-1)||rs(e,-1);if(46==r&&!t.shiftKey||nh&&68==r&&"c"==i)return ru(e,1)||rs(e,1);if(13==r||27==r)return!0;if(37==r||nh&&66==r&&"c"==i){let t=37==r?"ltr"==rc(e,e.state.selection.from)?-1:1:-1;return rr(e,t,i)||rs(e,t)}if(39==r||nh&&70==r&&"c"==i){let t=39==r?"ltr"==rc(e,e.state.selection.from)?1:-1:1;return rr(e,t,i)||rs(e,t)}else if(38==r||nh&&80==r&&"c"==i)return rd(e,-1,i)||rs(e,-1);else if(40==r||nh&&78==r&&"c"==i)return function(e){if(!nd||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;rh(e,n,"true"),setTimeout(()=>rh(e,n,"false"),20)}return!1}(e)||rd(e,1,i)||rs(e,1);else if(i==(nh?"m":"c")&&(66==r||73==r||89==r||90==r))return!0;return!1}(e,t)?t.preventDefault():rA(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,t9(13,"Enter"))),e.input.lastIOSEnter=0)},200)}},rS.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},rS.keypress=(e,t)=>{if(rI(e,t)||!t.charCode||t.ctrlKey&&!t.altKey||nh&&t.metaKey)return;if(e.someProp("handleKeyPress",n=>n(e,t)))return void t.preventDefault();let n=e.state.selection;if(!(n instanceof ts)||!n.$from.sameParent(n.$to)){let r=String.fromCharCode(t.charCode),i=()=>e.state.tr.insertText(r).scrollIntoView();/[\r\n]/.test(r)||e.someProp("handleTextInput",t=>t(e,n.$from.pos,n.$to.pos,r,i))||e.dispatch(i()),t.preventDefault()}};let rR=nh?"metaKey":"ctrlKey";rC.mousedown=(e,t)=>{var n;let r,i;e.input.shiftKey=t.shiftKey;let o=rB(e),s=Date.now(),l="singleClick";s-e.input.lastClick.time<500&&(r=(n=e.input.lastClick).x-t.clientX)*r+(i=n.y-t.clientY)*i<100&&!t[rR]&&e.input.lastClick.button==t.button&&("singleClick"==e.input.lastClick.type?l="doubleClick":"doubleClick"==e.input.lastClick.type&&(l="tripleClick")),e.input.lastClick={time:s,x:t.clientX,y:t.clientY,type:l,button:t.button};let a=e.posAtCoords(rT(t));a&&("singleClick"==l?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new rF(e,a,t,!!o)):("doubleClick"==l?function(e,t,n,r){return rN(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",n=>n(e,t,r))}:function(e,t,n,r){return rN(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",n=>n(e,t,r))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(rO(e,ts.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),o=i.before(t);if(n.inlineContent)rO(e,ts.create(r,o+1,o+1+n.content.size),"pointer");else{if(!ta.isSelectable(n))continue;rO(e,ta.create(r,o),"pointer")}return!0}}(e,n,r)})(e,a.pos,a.inside,t)?t.preventDefault():rA(e,"pointer"))};class rF{constructor(e,t,n,r){let i,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[rR],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,o=n.depth?n.before():0}const s=r?null:n.target,l=s?e.docView.nearestDesc(s,!0):null;this.target=l&&1==l.nodeDOM.nodeType?l.nodeDOM:null;let{selection:a}=e.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||a instanceof ta&&a.from<=o&&a.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ns&&!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)),rA(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(()=>n1(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(rT(e))),this.updateAllowDefault(e),this.allowDefault||!t)rA(this.view,"pointer");else{var n,r,i,o;(n=this.view,r=t.pos,i=t.inside,o=this.selectNode,rN(n,"handleClickOn",r,i,e)||n.someProp("handleClick",t=>t(n,r,e))||(o?function(e,t){if(-1==t)return!1;let n=e.state.selection,r,i;n instanceof ta&&(r=n.node);let o=e.state.doc.resolve(t);for(let e=o.depth+1;e>0;e--){let t=e>o.depth?o.nodeAfter:o.node(e);if(ta.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?o.before(n.$from.depth):o.before(e);break}}return null!=i&&(rO(e,ta.create(e.state.doc,i),"pointer"),!0)}(n,i):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&ta.isSelectable(r))&&(rO(e,new ta(n),"pointer"),!0)}(n,i)))?e.preventDefault():0==e.button&&(this.flushed||nd&&this.mightDrag&&!this.mightDrag.node.isAtom||na&&!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)))?(rO(this.view,tn.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):rA(this.view,"pointer")}}move(e){this.updateAllowDefault(e),rA(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 rI(e,t){return!!e.composing||!!(nd&&500>Math.abs(t.timeStamp-e.input.compositionEndedAt))&&(e.input.compositionEndedAt=-2e8,!0)}rC.touchstart=e=>{e.input.lastTouch=Date.now(),rB(e),rA(e,"pointer")},rC.touchmove=e=>{e.input.lastTouch=Date.now(),rA(e,"pointer")},rC.contextmenu=e=>rB(e);let rL=nf?5e3:-1;function rz(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>rB(e),t))}function rj(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 rB(e,t=!1){if(!nf||!(e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),rj(e),t||e.docView&&e.docView.dirty){let n=nY(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}rS.compositionstart=rS.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof ts&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)||na&&np&&function(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||1!=t.nodeType||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return 1==r.nodeType&&"false"==r.contentEditable}(e)))e.markCursor=e.state.storedMarks||n.marks(),rB(e,!0),e.markCursor=null;else if(rB(e,!t.selection.empty),ns&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}rz(e,rL)},rS.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.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,rz(e,20))};let rP=ni&&no<15||nu&&ng<604;function r$(e,t,n,r,i){let o=rf(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,i,o||j.empty)))return!0;if(!o)return!1;let s=0==o.openStart&&0==o.openEnd&&1==o.content.childCount?o.content.firstChild:null,l=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(o);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function rq(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," "):""}rC.copy=rS.cut=(e,t)=>{let n=e.state.selection,r="cut"==t.type;if(n.empty)return;let i=rP?null:t.clipboardData,{dom:o,text:s}=rp(e,n.content());i?(t.preventDefault(),i.clearData(),i.setData("text/html",o.innerHTML),i.setData("text/plain",s)):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 r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}(e,o),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},rS.paste=(e,t)=>{if(e.composing&&!nf)return;let n=rP?null:t.clipboardData,r=e.input.shiftKey&&45!=e.input.lastKeyCode;n&&r$(e,rq(n),n.getData("text/html"),r,t)?t.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?r$(e,r.value,null,i,t):r$(e,r.textContent,r.innerHTML,i,t)},50)}(e,t)};class rV{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}let rH=nh?"altKey":"ctrlKey";function rW(e,t){let n=e.someProp("dragCopies",e=>!e(t));return null!=n?n:!t[rH]}for(let e in rC.dragstart=(e,t)=>{let n,r=e.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(rT(t));if(o&&o.pos>=i.from&&o.pos<=(i instanceof ta?i.to-1:i.to));else if(r&&r.mightDrag)n=ta.create(e.state.doc,r.mightDrag.pos);else if(t.target&&1==t.target.nodeType){let r=e.docView.nearestDesc(t.target,!0);r&&r.node.type.spec.draggable&&r!=e.docView&&(n=ta.create(e.state.doc,r.posBefore))}let s=(n||e.state.selection).content(),{dom:l,text:a,slice:c}=rp(e,s);t.dataTransfer.files.length&&na&&!(nc>120)||t.dataTransfer.clearData(),t.dataTransfer.setData(rP?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",rP||t.dataTransfer.setData("text/plain",a),e.dragging=new rV(c,rW(e,t),n)},rC.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},rS.dragover=rS.dragenter=(e,t)=>t.preventDefault(),rS.drop=(e,t)=>{try{!function(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(rT(t));if(!r)return;let i=e.state.doc.resolve(r.pos),o=n&&n.slice;o?e.someProp("transformPasted",t=>{o=t(o,e,!1)}):o=rf(e,rq(t.dataTransfer),rP?null:t.dataTransfer.getData("text/html"),!1,i);let s=!!(n&&rW(e,t));if(e.someProp("handleDrop",n=>n(e,t,o||j.empty,s)))return t.preventDefault();if(!o)return;t.preventDefault();let l=o?eQ(e.state.doc,i.pos,o):i.pos;null==l&&(l=i.pos);let a=e.state.tr;if(s){let{node:e}=n;e?e.replace(a):a.deleteSelection()}let c=a.mapping.map(l),d=0==o.openStart&&0==o.openEnd&&1==o.content.childCount,u=a.doc;if(d?a.replaceRangeWith(c,c,o.content.firstChild):a.replaceRange(c,c,o),a.doc.eq(u))return;let h=a.doc.resolve(c);if(d&&ta.isSelectable(o.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(o.content.firstChild))a.setSelection(new ta(h));else{let t=a.mapping.map(l);a.mapping.maps[a.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),a.setSelection(n8(e,h,a.doc.resolve(t)))}e.focus(),e.dispatch(a.setMeta("uiEvent","drop"))}(e,t,e.dragging)}finally{e.dragging=null}},rC.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())&&n1(e)},20))},rC.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)},rC.beforeinput=(e,t)=>{if(na&&nf&&"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,t9(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)}},rS)rC[e]=rS[e];function rU(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 rK{constructor(e,t){this.toDOM=e,this.spec=t||rQ,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new rZ(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof rK&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&rU(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class rJ{constructor(e,t){this.attrs=e,this.spec=t||rQ}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new rZ(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof rJ&&rU(this.attrs,e.attrs)&&rU(this.spec,e.spec)}static is(e){return e.type instanceof rJ}destroy(){}}class rG{constructor(e,t){this.attrs=e,this.spec=t||rQ}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let o=e.mapResult(t.to+r,-1);return o.deleted||o.pos<=i.pos?null:new rZ(i.pos-n,o.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(e){return this==e||e instanceof rG&&rU(this.attrs,e.attrs)&&rU(this.spec,e.spec)}destroy(){}}class rZ{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new rZ(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 rZ(e,e,new rK(t,n))}static inline(e,t,n,r){return new rZ(e,t,new rJ(n,r))}static node(e,t,n,r){return new rZ(e,t,new rG(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof rJ}get widget(){return this.type instanceof rK}}let rX=[],rQ={};class rY{constructor(e,t){this.local=e.length?e:rX,this.children=t.length?t:rX}static create(e,t){return t.length?r4(t,e,0,rQ):r0}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,i){for(let o=0;o<this.local.length;o++){let s=this.local[o];s.from<=t&&s.to>=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i)}}map(e,t,n){return this==r0||0==e.maps.length?this:this.mapInner(e,t,0,0,n||rQ)}mapInner(e,t,n,r,i){let o;for(let s=0;s<this.local.length;s++){let l=this.local[s].map(e,n,r);l&&l.type.valid(t,l)?(o||(o=[])).push(l):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,i,o,s){let l=e.slice();for(let e=0,t=o;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,o)=>{let s=o-i-(n-e);for(let i=0;i<l.length;i+=3){let o=l[i+1];if(o<0||e>o+t-r)continue;let a=l[i]+t-r;n>=a?l[i+1]=e<=a?-2:-1:e>=t&&s&&(l[i]+=s,l[i+1]+=s)}r+=s}),t=n.maps[e].map(t,-1)}let a=!1;for(let t=0;t<l.length;t+=3)if(l[t+1]<0){if(-2==l[t+1]){a=!0,l[t+1]=-1;continue}let c=n.map(e[t]+o),d=c-i;if(d<0||d>=r.content.size){a=!0;continue}let u=n.map(e[t+1]+o,-1)-i,{index:h,offset:p}=r.content.findIndex(d),f=r.maybeChild(h);if(f&&p==d&&p+f.nodeSize==u){let r=l[t+2].mapInner(n,f,c+1,e[t]+o+1,s);r!=r0?(l[t]=d,l[t+1]=u,l[t+2]=r):(l[t+1]=-2,a=!0)}else a=!0}if(a){let a=r4(function(e,t,n,r,i,o,s){for(let l=0;l<e.length;l+=3)-1==e[l+1]&&function e(t,o){for(let e=0;e<t.local.length;e++){let l=t.local[e].map(r,i,o);l?n.push(l):s.onRemove&&s.onRemove(t.local[e].spec)}for(let n=0;n<t.children.length;n+=3)e(t.children[n+2],t.children[n]+o+1)}(e[l+2],t[l]+o+1);return n}(l,e,t,n,i,o,s),r,0,s);t=a.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<a.children.length;e+=3){let n=a.children[e];for(;t<l.length&&l[t]<n;)t+=3;l.splice(t,0,a.children[e],a.children[e+1],a.children[e+2])}}return new rY(t.sort(r6),l)}(this.children,o||[],e,t,n,r,i):o?new rY(o.sort(r6),rX):r0}add(e,t){return t.length?this==r0?rY.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,i=0;e.forEach((e,o)=>{let s=o+n,l;if(l=r3(t,e,s)){for(r||(r=this.children.slice());i<r.length&&r[i]<o;)i+=3;r[i]==o?r[i+2]=r[i+2].addInner(e,l,s+1):r.splice(i,0,o,o+e.nodeSize,r4(l,e,s+1,rQ)),i+=3}});let o=r2(i?r5(t):t,-n);for(let t=0;t<o.length;t++)o[t].type.valid(e,o[t])||o.splice(t--,1);return new rY(o.length?this.local.concat(o).sort(r6):this.local,r||this.children)}remove(e){return 0==e.length||this==r0?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let i,o=n[r]+t,s=n[r+1]+t;for(let t=0,n;t<e.length;t++)(n=e[t])&&n.from>o&&n.to<s&&(e[t]=null,(i||(i=[])).push(n));if(!i)continue;n==this.children&&(n=this.children.slice());let l=n[r+2].removeInner(i,o+1);l!=r0?n[r+2]=l:(n.splice(r,3),r-=3)}if(r.length){for(let n=0,i;n<e.length;n++)if(i=e[n])for(let e=0;e<r.length;e++)r[e].eq(i,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1))}return n==this.children&&r==this.local?this:r.length||n.length?new rY(r,n):r0}forChild(e,t){let n,r;if(this==r0)return this;if(t.isLeaf)return rY.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,o=i+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>i&&t.type instanceof rJ){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new rY(r.sort(r6),rX);return n?new r1([e,n]):e}return n||r0}eq(e){if(this==e)return!0;if(!(e instanceof rY)||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 r9(this.localsInner(e))}localsInner(e){if(this==r0)return rX;if(e.inlineContent||!this.local.some(rJ.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof rJ||t.push(this.local[e]);return t}forEachSet(e){e(this)}}rY.empty=new rY([],[]),rY.removeOverlap=r9;let r0=rY.empty;class r1{constructor(e){this.members=e}map(e,t){let n=this.members.map(n=>n.map(e,t,rQ));return r1.from(n)}forChild(e,t){if(t.isLeaf)return rY.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=r0&&(i instanceof r1?n=n.concat(i.members):n.push(i))}return r1.from(n)}eq(e){if(!(e instanceof r1)||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 r=0;r<this.members.length;r++){let i=this.members[r].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?r9(n?t:t.sort(r6)):rX}static from(e){switch(e.length){case 0:return r0;case 1:return e[0];default:return new r1(e.every(e=>e instanceof rY)?e:e.reduce((e,t)=>e.concat(t instanceof rY?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function r2(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new rZ(i.from+t,i.to+t,i.type))}return n}function r3(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,o;t<e.length;t++)(o=e[t])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),e[t]=null);return i}function r5(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function r4(e,t,n,r){let i=[],o=!1;t.forEach((t,s)=>{let l=r3(e,t,s+n);if(l){o=!0;let e=r4(l,t,n+s+1,r);e!=r0&&i.push(s,s+t.nodeSize,e)}});let s=r2(o?r5(e):e,-n).sort(r6);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(r.onRemove&&r.onRemove(s[e].spec),s.splice(e--,1));return s.length||i.length?new rY(s,i):r0}function r6(e,t){return e.from-t.from||e.to-t.to}function r9(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from==r.from){o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),r8(t,i+1,o.copy(r.to,o.to)));continue}o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),r8(t,i,r.copy(o.from,r.to)));break}}return t}function r8(e,t,n){for(;t<e.length&&r6(n,e[t])>0;)t++;e.splice(t,0,n)}function r7(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=r0&&t.push(r)}),e.cursorWrapper&&t.push(rY.create(e.state.doc,[e.cursorWrapper.deco])),r1.from(t)}let ie={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},it=ni&&no<=11;class ir{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 ii{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new ir,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);ni&&no<=11&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():nd&&e.composing&&t.some(e=>"childList"==e.type&&"TR"==e.target.nodeName)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),it&&(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,ie)),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(n7(this.view)){if(this.suppressingSelectionUpdates)return n1(this.view);if(ni&&no<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&t1(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=tX(n))t.add(n);for(let r=e.anchorNode;r;r=tX(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.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(){var e;let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&n7(t)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,a=[];if(t.editable)for(let e=0;e<n.length;e++){let t=this.registerMutation(n[e],a);t&&(o=o<0?t.from:Math.min(t.from,o),s=s<0?t.to:Math.max(t.to,s),t.typeOver&&(l=!0))}if(ns&&a.length){let e=a.filter(e=>"BR"==e.nodeName);if(2==e.length){let[t,n]=e;t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of e){let e=r.parentNode;e&&"LI"==e.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}(t,n)!=e)&&r.remove()}}}else if((na||nd)&&a.some(e=>"BR"==e.nodeName)&&(8==t.input.lastKeyCode||46==t.input.lastKeyCode)){for(let e of a)if("BR"==e.nodeName&&e.parentNode){let t=e.nextSibling;t&&1==t.nodeType&&"false"==t.contentEditable&&e.parentNode.removeChild(e)}}let c=null;o<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&t6(r)&&(c=nY(t))&&c.eq(tn.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,n1(t),this.currentSelection.set(r),t.scrollToSelection()):(o>-1||i)&&(o>-1&&(t.docView.markDirty(o,s),e=t,!io.has(e)&&(io.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))&&(e.requiresGeckoHackNode=ns,is||(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."),is=!0))),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,function(e,t){var n;let{focusNode:r,focusOffset:i}=e.domSelectionRange();for(let o of t)if((null==(n=o.parentNode)?void 0:n.nodeName)=="TR"){let t=o.nextSibling;for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.nextSibling;if(t){let n=t;for(;;){let e=n.firstChild;if(!e||1!=e.nodeType||"false"==e.contentEditable||/^(BR|IMG)$/.test(e.nodeName))break;n=e}n.insertBefore(o,n.firstChild),r==o&&e.domSelection().collapse(o,i)}else o.parentNode.removeChild(o)}}(t,a)),this.handleDOMChange(o,s,l,a),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||n1(t),this.currentSelection.set(r))}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 r=e.addedNodes[n];t.push(r),3==r.nodeType&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(ni&&no<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:o}=e.addedNodes[t];(!n||0>Array.prototype.indexOf.call(e.addedNodes,n))&&(r=n),(!o||0>Array.prototype.indexOf.call(e.addedNodes,o))&&(i=o)}let o=r&&r.parentNode==e.target?tZ(r)+1:0,s=n.localPosFromDOM(e.target,o,-1),l=i&&i.parentNode==e.target?tZ(i):e.target.childNodes.length;return{from:s,to:n.localPosFromDOM(e.target,l,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 io=new WeakMap,is=!1;function il(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return t1(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function ia(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(nd&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}else if(e.parentNode.lastChild==e||nd&&/^(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 ic=/^(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 id(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:n8(e,t.resolve(n.anchor),t.resolve(n.head))}function iu(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function ih(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 ip{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 rE,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(ib),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=iy(this),ig(this),this.nodeViews=ik(this),this.docView=nB(this.state.doc,im(this),r7(this),this.dom,this),this.domObserver=new ii(this,(e,t,n,r)=>(function(e,t,n,r,i){let o,s,l,a=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=nY(e,t);if(n&&!e.state.selection.eq(n)){if(na&&nf&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,t9(13,"Enter"))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),a&&r.setMeta("composition",a),e.dispatch(r)}return}let c=e.state.doc.resolve(t),d=c.sharedDepth(n);t=c.before(d+1),n=e.state.doc.resolve(n).after(d+1);let u=e.state.selection,h=function(e,t,n){let r,{node:i,fromOffset:o,toOffset:s,from:l,to:a}=e.docView.parseRange(t,n),c=e.domSelectionRange(),d=c.anchorNode;if(d&&e.dom.contains(1==d.nodeType?d:d.parentNode)&&(r=[{node:d,offset:c.anchorOffset}],t6(c)||r.push({node:c.focusNode,offset:c.focusOffset})),na&&8===e.input.lastKeyCode)for(let e=s;e>o;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){s=e;break}if(!n||n.size)break}let u=e.state.doc,h=e.someProp("domParser")||ef.fromSchema(e.state.schema),p=u.resolve(l),f=null,m=h.parse(i,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:o,to:s,preserveWhitespace:"pre"!=p.parent.type.whitespace||"full",findPositions:r,ruleFromNode:ia,context:p});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),f={anchor:e+l,head:t+l}}return{doc:m,sel:f,from:l,to:a}}(e,t,n),p=e.state.doc,f=p.slice(h.from,h.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(o=e.state.selection.to,s="end"):(o=e.state.selection.from,s="start"),e.input.lastKeyCode=null;let m=function(e,t,n,r,i){let o=e.findDiffStart(t,n);if(null==o)return null;let{a:s,b:l}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==i){let e=Math.max(0,o-Math.min(s,l));r-=s+e-o}if(s<o&&e.size<t.size){let e=r<=o&&r>=s?o-r:0;(o-=e)&&o<t.size&&ih(t.textBetween(o-1,o+1))&&(o+=e?1:-1),l=o+(l-s),s=o}else if(l<o){let t=r<=o&&r>=l?o-r:0;(o-=t)&&o<e.size&&ih(e.textBetween(o-1,o+1))&&(o+=t?1:-1),s=o+(s-l),l=o}return{start:o,endA:s,endB:l}}(f.content,h.doc.content,h.from,o,s);if(m&&e.input.domChangeCount++,(nu&&e.input.lastIOSEnter>Date.now()-225||nf)&&i.some(e=>1==e.nodeType&&!ic.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp("handleKeyDown",t=>t(e,t9(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!m)if(r&&u instanceof ts&&!u.empty&&u.$head.sameParent(u.$anchor)&&!e.composing&&!(h.sel&&h.sel.anchor!=h.sel.head))m={start:u.from,endA:u.to,endB:u.to};else{if(h.sel){let t=id(e,e.state.doc,h.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta("composition",a),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof ts&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=h.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=h.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),ni&&no<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>h.from&&" "==h.doc.textBetween(m.start-h.from-1,m.start-h.from+1)&&(m.start--,m.endA--,m.endB--);let g=h.doc.resolveNoCache(m.start-h.from),y=h.doc.resolveNoCache(m.endB-h.from),k=p.resolve(m.start),b=g.sameParent(y)&&g.parent.inlineContent&&k.end()>=m.endA;if((nu&&e.input.lastIOSEnter>Date.now()-225&&(!b||i.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!b&&g.pos<h.doc.content.size&&(!g.sameParent(y)||!g.parent.inlineContent)&&g.pos<y.pos&&!/\S/.test(h.doc.textBetween(g.pos,y.pos,"","")))&&e.someProp("handleKeyDown",t=>t(e,t9(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&function(e,t,n,r,i){if(n-t<=i.pos-r.pos||iu(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(!r.parent.isTextblock){let e=o.nodeAfter;return null!=e&&n==t+e.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(iu(o,!0,!0));return!(!s.parent.isTextblock||s.pos>n||iu(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(p,m.start,m.endA,g,y)&&e.someProp("handleKeyDown",t=>t(e,t9(8,"Backspace")))){nf&&na&&e.domObserver.suppressSelectionUpdates();return}na&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),nf&&!b&&g.start()!=y.start()&&0==y.parentOffset&&g.depth==y.depth&&h.sel&&h.sel.anchor==h.sel.head&&h.sel.head==m.endA&&(m.endB-=2,y=h.doc.resolveNoCache(m.endB-h.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,t9(13,"Enter"))})},20));let v=m.start,x=m.endA,w=t=>{let n=t||e.state.tr.replace(v,x,h.doc.slice(m.start-h.from,m.endB-h.from));if(h.sel){let t=id(e,n.doc,h.sel);t&&!(na&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==v||t.head==n.mapping.map(x)-1)||ni&&t.empty&&t.head==v)&&n.setSelection(t)}return a&&n.setMeta("composition",a),n.scrollIntoView()};if(b)if(g.pos==y.pos){ni&&no<=11&&0==g.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>n1(e),20));let t=w(e.state.tr.delete(v,x)),n=p.resolve(m.start).marksAcross(p.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(l=function(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,o=r,s,l,a;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)o=n[e].removeFromSet(o);if(1==i.length&&0==o.length)l=i[0],s="add",a=e=>e.mark(l.addToSet(e.marks));else{if(0!=i.length||1!=o.length)return null;l=o[0],s="remove",a=e=>e.mark(l.removeFromSet(e.marks))}let c=[];for(let e=0;e<t.childCount;e++)c.push(a(t.child(e)));if(O.from(c).eq(e))return{mark:l,type:s}}(g.parent.content.cut(g.parentOffset,y.parentOffset),k.parent.content.cut(k.parentOffset,m.endA-k.start())))){let t=w(e.state.tr);"add"==l.type?t.addMark(v,x,l.mark):t.removeMark(v,x,l.mark),e.dispatch(t)}else if(g.parent.child(g.index()).isText&&g.index()==y.index()-!y.textOffset){let t=g.parent.textBetween(g.parentOffset,y.parentOffset),n=()=>w(e.state.tr.insertText(t,v,x));e.someProp("handleTextInput",r=>r(e,v,x,t,n))||e.dispatch(n())}else e.dispatch(w());else e.dispatch(w())})(this,e,t,n,r)),this.domObserver.start(),function(e){for(let t in rC){let n=rC[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)||r_(e,t)||!e.editable&&t.type in rS||n(e,t)},rM[t]?{passive:!0}:void 0)}nd&&e.dom.addEventListener("input",()=>null),rD(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&&rD(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(ib),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,r,i;let o=this.state,s=!1,l=!1;e.storedMarks&&this.composing&&(rj(this),l=!0),this.state=e;let a=o.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=ik(this);(function(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,s=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&rD(this),this.editable=iy(this),ig(this);let c=r7(this),d=im(this),u=o.plugins==e.plugins||o.doc.eq(e.doc)?e.scrollToSelection>o.scrollToSelection?"to selection":"preserve":"reset",h=s||!this.docView.matchesNode(e.doc,d,c);(h||!e.selection.eq(o.selection))&&(l=!0);let p="preserve"==u&&l&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,s=i+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(o,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let l=r.getBoundingClientRect();if(l.top>=i-20){t=r,n=l.top;break}}return{refDOM:t,refTop:n,stack:nb(e.dom)}}(this);if(l){let t,n,l;this.domObserver.stop();let a=h&&(ni||na)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&(r=o.selection,i=e.selection,l=Math.min(r.$anchor.sharedDepth(r.head),i.$anchor.sharedDepth(i.head)),r.$anchor.start(l)!=i.$anchor.start(l));if(h){let t=na?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=t5(e=e.childNodes[t-1])}else{if(!e.parentNode||t4(e))return null;t=tZ(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),r=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||t4(e))return null;t=tZ(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}(this)),(s||!this.docView.update(e.doc,d,c,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=nB(e.doc,d,c,this.dom,this)),!t||this.trackWrites&&this.dom.contains(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(),t1(t.node,t.offset,n.anchorNode,n.anchorOffset)))?n1(this,a):(n6(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),(null==(n=this.dragging)?void 0:n.node)&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),"reset"==u?this.dom.scrollTop=0:"to selection"==u?this.scrollToSelection():p&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;nv(n,0==r?0:r-t)}(p)}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 ta){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&nk(this,t.getBoundingClientRect(),e)}else nk(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,r=-1;if(this.state.doc.nodeAt(n.from)==n.node)r=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&&(r=e)}this.dragging=new rV(e.slice,e.move,r<0?void 0:ta.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(null!=n&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(null!=i&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let o=i[n].props[e];if(null!=o&&(r=t?t(o):o))return r}}hasFocus(){if(ni){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(nx)return e.focus(nx);let t=nb(e);e.focus(null==nx?{get preventScroll(){return nx={preventScroll:!0},!0}}:void 0),nx||(nx=!1,nv(t,0))}(this.dom),n1(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 r,i,o=e.dom.ownerDocument,s,l=0,a=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(t5(r.offsetNode),r.offset)}}catch(e){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(t5(r.startContainer),r.startOffset)}}}(o,t.left,t.top);a&&({node:s,offset:l}=a);let c=(e.root.elementFromPoint?e.root:o).elementFromPoint(t.left,t.top);if(!c||!e.dom.contains(1!=c.nodeType?c.parentNode:c)){let n=e.dom.getBoundingClientRect();if(!nw(t,n)||!(c=function e(t,n,r){let i=t.childNodes.length;if(i&&r.top<r.bottom)for(let o=Math.max(0,Math.min(i-1,Math.floor(i*(n.top-r.top)/(r.bottom-r.top))-2)),s=o;;){let r=t.childNodes[s];if(1==r.nodeType){let t=r.getClientRects();for(let i=0;i<t.length;i++){let o=t[i];if(nw(n,o))return e(r,n,o)}}if((s=(s+1)%i)==o)break}return t}(e.dom,t,n)))return null}if(nd)for(let e=c;s&&e;e=tX(e))e.draggable&&(s=void 0);if(c=(r=(n=c).parentNode)&&/^li$/i.test(r.nodeName)&&t.left<n.getBoundingClientRect().left?r:n,s){let n;if(ns&&1==s.nodeType&&(l=Math.min(l,s.childNodes.length))<s.childNodes.length){let e=s.childNodes[l],n;"IMG"==e.nodeName&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&l++}nm&&l&&1==s.nodeType&&1==(n=s.childNodes[l-1]).nodeType&&"false"==n.contentEditable&&n.getBoundingClientRect().top>=t.top&&l--,s==e.dom&&l==s.childNodes.length-1&&1==s.lastChild.nodeType&&t.top>s.lastChild.getBoundingClientRect().bottom?i=e.state.doc.content.size:(0==l||1!=s.nodeType||"BR"!=s.childNodes[l-1].nodeName)&&(i=function(e,t,n,r){let i=-1;for(let n=t,o=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),s;if(!t)return null;if(1==t.dom.nodeType&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((s=t.dom.getBoundingClientRect()).width||s.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!o&&s.left>r.left||s.top>r.top?i=t.posBefore:(!o&&s.right<r.left||s.bottom<r.top)&&(i=t.posAfter),o=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(s.top+s.bottom)/2:r.left<(s.left+s.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}(e,s,l,t))}null==i&&(i=function(e,t,n){let{node:r,offset:i}=function e(t,n){let r,i,o,s=2e8,l,a=0,c=n.top,d=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=tY(e).getClientRects()}for(let h=0;h<t.length;h++){let p=t[h];if(p.top<=c&&p.bottom>=d){c=Math.max(p.bottom,c),d=Math.min(p.top,d);let t=p.left>n.left?p.left-n.left:p.right<n.left?n.left-p.right:0;if(t<s){o=e,s=t,l=t&&3==o.nodeType?{left:p.right<n.left?p.right:p.left,top:n.top}:n,1==e.nodeType&&t&&(a=u+ +(n.left>=(p.left+p.right)/2));continue}}else p.top>n.top&&!r&&p.left<=n.left&&p.right>=n.left&&(r=e,i={left:Math.max(p.left,Math.min(p.right,n.left)),top:p.top});!o&&(n.left>=p.right&&n.top>=p.top||n.left>=p.left&&n.top>=p.bottom)&&(a=u+1)}}return(!o&&r&&(o=r,l=i,s=0),o&&3==o.nodeType)?function(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);let n=nS(r,1);if(n.top!=n.bottom&&nw(t,n)){i={node:e,offset:o+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}(o,l):!o||s&&1==o.nodeType?{node:t,offset:a}:e(o,l)}(t,n),o=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();o=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}(e,c,t));let d=e.docView.nearestDesc(c,!0);return{pos:i,inside:d?d.posAtStart-d.border:-1}}(this,e)}coordsAtPos(e,t=1){return nE(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 r=this.docView.posFromDOM(e,t,n);if(null==r)throw RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return function(e,t,n){let r,i;return nN==t&&nO==n?nR:(nN=t,nO=n,nR="up"==n||"down"==n?(r=t.selection,i="up"==n?r.$from:r.$to,n_(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=nE(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=tY(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&("up"==n?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=i==r.parent.content.size,s=e.domSelection();return s?nT.test(r.parent.textContent)&&s.modify?n_(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:o,anchorOffset:l}=e.domSelectionRange(),a=s.caretBidiLevel;s.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:d,focusOffset:u}=e.domSelectionRange(),h=d&&!c.contains(1==d.nodeType?d:d.parentNode)||t==d&&i==u;try{s.collapse(o,l),t&&(t!=o||i!=l)&&s.extend&&s.extend(t,i)}catch(e){}return null!=a&&(s.caretBidiLevel=a),h}):"left"==n||"backward"==n?!i:o:r.pos==r.start()||r.pos==r.end()}(e,t,n))}(this,t||this.state,e)}pasteHTML(e,t){return r$(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return r$(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return rp(this,e)}destroy(){if(this.docView){for(let e in this.domObserver.stop(),this.input.eventHandlers)this.dom.removeEventListener(e,this.input.eventHandlers[e]);clearTimeout(this.input.composingTimeout),clearTimeout(this.input.lastIOSEnterFallbackTimeout),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],r7(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,t0()}}get isDestroyed(){return null==this.docView}dispatchEvent(e){!r_(this,e)&&rC[e.type]&&(this.editable||!(e.type in rS))&&rC[e.type](this,e)}domSelectionRange(){let e=this.domSelection();return e?nd&&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 il(e,n)}function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?il(e,n):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function im(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"),[rZ.node(0,e.state.doc.content.size,t)]}function ig(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:rZ.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function iy(e){return!e.someProp("editable",t=>!1===t(e.state))}function ik(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 ib(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")}ip.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};for(var iv={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ix={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},iw="u">typeof navigator&&/Mac/.test(navigator.platform),iC="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),iS=0;iS<10;iS++)iv[48+iS]=iv[96+iS]=String(iS);for(var iS=1;iS<=24;iS++)iv[iS+111]="F"+iS;for(var iS=65;iS<=90;iS++)iv[iS]=String.fromCharCode(iS+32),ix[iS]=String.fromCharCode(iS);for(var iM in iv)ix.hasOwnProperty(iM)||(ix[iM]=iv[iM]);let iE="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),iA="u">typeof navigator&&/Win/.test(navigator.platform);function iD(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function i_(e){let t=function(e){let t=Object.create(null);for(let n in e)t[function(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let e=0;e<o.length-1;e++){let s=o[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))iE?i=!0:n=!0;else throw Error("Unrecognized modifier name: "+s)}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}(n)]=e[n];return t}(e);return function(e,n){var r;let i=("Esc"==(r=!(iw&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||iC&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?ix:iv)[n.keyCode]||n.key||"Unidentified")&&(r="Escape"),"Del"==r&&(r="Delete"),"Left"==r&&(r="ArrowLeft"),"Up"==r&&(r="ArrowUp"),"Right"==r&&(r="ArrowRight"),"Down"==r&&(r="ArrowDown"),r),o,s=t[iD(i,n)];if(s&&s(e.state,e.dispatch,e))return!0;if(1==i.length&&" "!=i){if(n.shiftKey){let r=t[iD(i,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(iA&&n.ctrlKey&&n.altKey)&&(o=iv[n.keyCode])&&o!=i){let r=t[iD(o,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var iT=Object.defineProperty,iN=(e,t)=>{for(var n in t)iT(e,n,{get:t[n],enumerable:!0})};function iO(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}var iR=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,o=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(o);return i.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s=[],l=!!e,a=e||i.tr,c=()=>(l||!t||a.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(a),s.every(e=>!0===e)),d={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(a,t),i=n(...e)(r);return s.push(i),d}])),run:c};return d}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s={tr:e,editor:r,view:o,state:iO({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(s)]))}};return s}},iF={};iN(iF,{blur:()=>iI,clearContent:()=>iL,clearNodes:()=>iz,command:()=>ij,createParagraphNear:()=>iB,cut:()=>iP,deleteCurrentNode:()=>i$,deleteNode:()=>iV,deleteRange:()=>iH,deleteSelection:()=>iW,enter:()=>iU,exitCode:()=>iK,extendMarkRange:()=>i0,first:()=>i1,focus:()=>i9,forEach:()=>i8,insertContent:()=>i7,insertContentAt:()=>or,joinBackward:()=>ol,joinDown:()=>oo,joinForward:()=>oa,joinItemBackward:()=>oc,joinItemForward:()=>od,joinTextblockBackward:()=>ou,joinTextblockForward:()=>oh,joinUp:()=>oi,keyboardShortcut:()=>of,lift:()=>og,liftEmptyBlock:()=>oy,liftListItem:()=>ok,newlineInCode:()=>ob,resetAttributes:()=>ow,scrollIntoView:()=>oC,selectAll:()=>oS,selectNodeBackward:()=>oM,selectNodeForward:()=>oE,selectParentNode:()=>oA,selectTextblockEnd:()=>oD,selectTextblockStart:()=>o_,setContent:()=>oN,setMark:()=>si,setMeta:()=>so,setNode:()=>ss,setNodeSelection:()=>sl,setTextDirection:()=>sa,setTextSelection:()=>sc,sinkListItem:()=>sd,splitBlock:()=>sh,splitListItem:()=>sp,toggleList:()=>sg,toggleMark:()=>sy,toggleNode:()=>sk,toggleWrap:()=>sb,undoInputRule:()=>sv,unsetAllMarks:()=>sx,unsetMark:()=>sw,unsetTextDirection:()=>sC,updateAttributes:()=>sS,wrapIn:()=>sM,wrapInList:()=>sE});var iI=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),null==(n=null==window?void 0:window.getSelection())||n.removeAllRanges())}),!0),iL=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),iz=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return!n||(i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,o=r.resolve(i.map(n)),s=r.resolve(i.map(n+e.nodeSize)),l=o.blockRange(s);if(!l)return;let a=eV(l);if(e.type.isTextblock){let{defaultType:e}=o.parent.contentMatchAt(o.index());t.setNodeMarkup(l.start,e)}(a||0===a)&&t.lift(l,a)})}),!0)},ij=e=>t=>e(t),iB=()=>({state:e,dispatch:t})=>tj(e,t),iP=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,o=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let s=r.mapping.map(t);return r.insert(s,o.content),r.setSelection(new ts(r.doc.resolve(Math.max(s-1,0)))),!0},i$=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;n-=1)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function iq(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var iV=e=>({tr:t,state:n,dispatch:r})=>{let i=iq(e,n.schema),o=t.selection.$anchor;for(let e=o.depth;e>0;e-=1)if(o.node(e).type===i){if(r){let n=o.before(e),r=o.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},iH=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},iW=()=>({state:e,dispatch:t})=>tS(e,t),iU=()=>({commands:e})=>e.keyboardShortcut("Enter"),iK=()=>({state:e,dispatch:t})=>tz(e,t);function iJ(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function iG(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:iJ(t[r])?t[r].test(e[r]):t[r]===e[r])}function iZ(e,t,n={}){return e.find(e=>e.type===t&&iG(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function iX(e,t,n={}){return!!iZ(e,t,n)}function iQ(e,t,n){var r;if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if(i.node&&i.node.marks.some(e=>e.type===t)||(i=e.parent.childBefore(e.parentOffset)),!i.node||!i.node.marks.some(e=>e.type===t)||(n=n||(null==(r=i.node.marks[0])?void 0:r.attrs),!iZ([...i.node.marks],t,n)))return;let o=i.index,s=e.start()+i.offset,l=o+1,a=s+i.node.nodeSize;for(;o>0&&iX([...e.parent.child(o-1).marks],t,n);)o-=1,s-=e.parent.child(o).nodeSize;for(;l<e.parent.childCount&&iX([...e.parent.child(l).marks],t,n);)a+=e.parent.child(l).nodeSize,l+=1;return{from:s,to:a}}function iY(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var i0=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=iY(e,r.schema),{doc:s,selection:l}=n,{$from:a,from:c,to:d}=l;if(i){let e=iQ(a,o,t);if(e&&e.from<=c&&e.to>=d){let t=ts.create(s,e.from,e.to);n.setSelection(t)}}return!0},i1=e=>t=>{let n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function i2(e){return e instanceof ts}function i3(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function i5(e,t=null){if(!t)return null;let n=tn.atStart(e),r=tn.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;let i=n.from,o=r.to;return"all"===t?ts.create(e,i3(0,i,o),i3(e.content.size,i,o)):ts.create(e,i3(t,i,o),i3(t,i,o))}function i4(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function i6(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var i9=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};let s=()=>{(i6()||i4())&&r.dom.focus(),"u">typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!i6()&&!i4()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{!n.isDestroyed&&(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&null===e||!1===e)return!0}catch{return!1}if(o&&null===e&&!i2(n.state.selection))return s(),!0;let l=i5(i.doc,e)||n.state.selection,a=n.state.selection.eq(l);return o&&(a||i.setSelection(l),a&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},i8=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),i7=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),oe=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){let r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&oe(r)}return e};function ot(e){if("u"<typeof window)throw Error("[tiptap error]: there is no window object available, so this function cannot be used");let t=`<body>${e}</body>`;return oe(new window.DOMParser().parseFromString(t,"text/html").body)}function on(e,t,n){if(e instanceof X||e instanceof O)return e;n={slice:!0,parseOptions:{},...n};let r="object"==typeof e&&null!==e,i="string"==typeof e;if(r)try{if(Array.isArray(e)&&e.length>0)return O.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error("[tiptap error]: Invalid JSON content",{cause:r});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),on("",t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i="",o=new eh({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:e=>(r=!0,i="string"==typeof e?e:e.outerHTML,null)}]}})});if(n.slice?ef.fromSchema(o).parseSlice(ot(e),n.parseOptions):ef.fromSchema(o).parse(ot(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error("[tiptap error]: Invalid HTML content",{cause:Error(`Invalid element found: ${i}`)})}let r=ef.fromSchema(t);return n.slice?r.parseSlice(ot(e),n.parseOptions).content:r.parse(ot(e),n.parseOptions)}return on("",t,n)}var or=(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){let i,l;n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a=e=>{o.emit("contentError",{editor:o,error:e,disableCollaboration:()=>{"collaboration"in o.storage&&"object"==typeof o.storage.collaboration&&o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!o.options.enableContentCheck&&o.options.emitContentError)try{on(t,o.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(e){a(e)}try{i=on(t,o.schema,{parseOptions:c,errorOnInvalidContent:null!=(s=n.errorOnInvalidContent)?s:o.options.enableContentCheck})}catch(e){return a(e),!1}let{from:d,to:u}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},h=!0,p=!0;if((!("type"in i)?i:[i]).forEach(e=>{e.check(),h=!!h&&e.isText&&0===e.marks.length,p=!!p&&e.isBlock}),d===u&&p){let{parent:e}=r.doc.resolve(d);!e.isTextblock||e.type.spec.code||e.childCount||(d-=1,u+=1)}if(h){if(Array.isArray(t))l=t.map(e=>e.text||"").join("");else if(t instanceof O){let e="";t.forEach(t=>{t.text&&(e+=t.text)}),l=e}else l="object"==typeof t&&t&&t.text?t.text:t;r.insertText(l,d,u)}else{l=i;let e=r.doc.resolve(d),t=e.node(),n=0===e.parentOffset,o=t.isText||t.isTextblock,s=t.content.size>0;n&&o&&s&&(d=Math.max(0,d-1)),r.replaceWith(d,u,l)}n.updateSelection&&function(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof eB||i instanceof eP))return;let o=e.mapping.maps[r],s=0;o.forEach((e,t,n,r)=>{0===s&&(s=r)}),e.setSelection(tn.near(e.doc.resolve(s),-1))}(r,r.steps.length-1,0),n.applyInputRules&&r.setMeta("applyInputRules",{from:d,text:l}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:d,text:l})}return!0},oi=()=>({state:e,dispatch:t})=>((e,t)=>{let n=e.selection,r=n instanceof ta,i;if(r){if(n.node.isTextblock||!eG(e.doc,n.from))return!1;i=n.from}else if(null==(i=eX(e.doc,n.from,-1)))return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(ta.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0})(e,t),oo=()=>({state:e,dispatch:t})=>((e,t)=>{let n=e.selection,r;if(n instanceof ta){if(n.node.isTextblock||!eG(e.doc,n.to))return!1;r=n.to}else if(null==(r=eX(e.doc,n.to,1)))return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0})(e,t),ol=()=>({state:e,dispatch:t})=>tE(e,t),oa=()=>({state:e,dispatch:t})=>tO(e,t),oc=()=>({state:e,dispatch:t,tr:n})=>{try{let r=eX(e.doc,e.selection.$from.pos,-1);if(null==r)return!1;return n.join(r,2),t&&t(n),!0}catch{return!1}},od=()=>({state:e,dispatch:t,tr:n})=>{try{let r=eX(e.doc,e.selection.$from.pos,1);if(null==r)return!1;return n.join(r,2),t&&t(n),!0}catch{return!1}},ou=()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=tM(e,n);if(!r)return!1;let i=tT(r);return!!i&&tA(e,i,t)})(e,t),oh=()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=tN(e,n);if(!r)return!1;let i=tF(r);return!!i&&tA(e,i,t)})(e,t);function op(){return"u">typeof navigator&&/Mac/.test(navigator.platform)}var of=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let o=(function(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"===s&&(s=" ");for(let e=0;e<o.length-1;e+=1){let s=o[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))i6()||op()?i=!0:n=!0;else throw Error(`Unrecognized modifier name: ${s}`)}return t&&(s=`Alt-${s}`),n&&(s=`Ctrl-${s}`),i&&(s=`Meta-${s}`),r&&(s=`Shift-${s}`),s})(e).split(/-(?!$)/),s=o.find(e=>!["Alt","Ctrl","Meta","Shift"].includes(e)),l=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),a=t.captureTransaction(()=>{n.someProp("handleKeyDown",e=>e(n,l))});return null==a||a.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0};function om(e,t,n={}){let{from:r,to:i,empty:o}=e.selection,s=t?iq(t,e.schema):null,l=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);l.push({node:e,from:n,to:o})});let a=i-r,c=l.filter(e=>!s||s.name===e.node.type.name).filter(e=>iG(e.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((e,t)=>e+t.to-t.from,0)>=a}var og=(e,t={})=>({state:n,dispatch:r})=>{let i=iq(e,n.schema);return!!om(n,i,t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&eV(i);return null!=o&&(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)})(n,r)},oy=()=>({state:e,dispatch:t})=>tB(e,t),ok=e=>({state:t,dispatch:n})=>{var r;return(r=iq(e,t.schema),function(e,t){let{$from:n,$to:i}=e.selection,o=n.blockRange(i,e=>e.childCount>0&&e.firstChild.type==r);return!!o&&(!t||(n.node(o.depth-1).type==r?function(e,t,n,r){let i=e.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new eP(o-1,s,o,s,new j(O.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new G(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));let l=eV(r);if(null==l)return!1;i.lift(r,l);let a=i.doc.resolve(i.mapping.map(o,-1)-1);return eG(i.doc,a.pos)&&a.nodeBefore.type==a.nodeAfter.type&&i.join(a.pos),t(i.scrollIntoView()),!0}(e,t,r,o):function(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,o=n.startIndex;t>o;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let l=0==n.startIndex,a=n.endIndex==i.childCount,c=o.node(-1),d=o.index(-1);if(!c.canReplace(d+ +!l,d+1,s.content.append(a?O.empty:O.from(i))))return!1;let u=o.pos,h=u+s.nodeSize;return r.step(new eP(u-!!l,h+ +!!a,u+1,h-1,new j((l?O.empty:O.from(i.copy(O.empty))).append(a?O.empty:O.from(i.copy(O.empty))),+!l,+!a),+!l)),t(r.scrollIntoView()),!0}(e,t,o)))})(t,n)},ob=()=>({state:e,dispatch:t})=>tI(e,t);function ov(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function ox(e,t){let n="string"==typeof t?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var ow=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=ov("string"==typeof e?e:e.name,r.schema);if(!l)return!1;"node"===l&&(o=iq(e,r.schema)),"mark"===l&&(s=iY(e,r.schema));let a=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{o&&o===e.type&&(a=!0,i&&n.setNodeMarkup(r,void 0,ox(e.attrs,t))),s&&e.marks.length&&e.marks.forEach(o=>{s===o.type&&(a=!0,i&&n.addMark(r,r+e.nodeSize,s.create(ox(o.attrs,t))))})})}),a},oC=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),oS=()=>({tr:e,dispatch:t})=>{if(t){let t=new td(e.doc);e.setSelection(t)}return!0},oM=()=>({state:e,dispatch:t})=>t_(e,t),oE=()=>({state:e,dispatch:t})=>tR(e,t),oA=()=>({state:e,dispatch:t})=>((e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return 0!=o&&(i=n.before(o),t&&t(e.tr.setSelection(ta.create(e.doc,i))),!0)})(e,t),oD=()=>({state:e,dispatch:t})=>tV(e,t),o_=()=>({state:e,dispatch:t})=>tq(e,t);function oT(e,t,n={},r={}){return on(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var oN=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:o,dispatch:s,commands:l})=>{let{doc:a}=o;if("full"!==r.preserveWhitespace){let l=oT(e,i.schema,r,{errorOnInvalidContent:null!=t?t:i.options.enableContentCheck});return s&&o.replaceWith(0,a.content.size,l).setMeta("preventUpdate",!n),!0}return s&&o.setMeta("preventUpdate",!n),l.insertContentAt({from:0,to:a.content.size},e,{parseOptions:r,errorOnInvalidContent:null!=t?t:i.options.enableContentCheck})};function oO(e,t){let n=iY(t,e.schema),{from:r,to:i,empty:o}=e.selection,s=[];o?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{s.push(...e.marks)});let l=s.find(e=>e.type.name===n.name);return l?{...l.attrs}:{}}function oR(e,t){let n=new te(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function oF(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function oI(e){return t=>(function(e,t){for(let n=e.depth;n>0;n-=1){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}})(t.$from,e)}function oL(e,t,n){return void 0===e.config[t]&&e.parent?oL(e.parent,t,n):"function"==typeof e.config[t]?e.config[t].bind({...n,parent:e.parent?oL(e.parent,t,n):null}):e.config[t]}function oz(e){return e.map(e=>{let t={name:e.name,options:e.options,storage:e.storage},n=oL(e,"addExtensions",t);return n?[e,...oz(n())]:e}).flat(10)}function oj(e,t){let n=eC.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function oB(e){return"function"==typeof e}function oP(e,t,...n){return oB(e)?t?e.bind(t)(...n):e(...n):e}function o$(e){let t=e.filter(e=>"extension"===e.type);return{baseExtensions:t,nodeExtensions:e.filter(e=>"node"===e.type),markExtensions:e.filter(e=>"mark"===e.type)}}function oq(e){let t=[],{nodeExtensions:n,markExtensions:r}=o$(e),i=[...n,...r],o={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(e=>{let n={name:e.name,options:e.options,storage:e.storage,extensions:i},r=oL(e,"addGlobalAttributes",n);r&&r().forEach(e=>{e.types.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...o,...r}})})})})}),i.forEach(e=>{let n={name:e.name,options:e.options,storage:e.storage},r=oL(e,"addAttributes",n);r&&Object.entries(r()).forEach(([n,r])=>{let i={...o,...r};"function"==typeof(null==i?void 0:i.default)&&(i.default=i.default()),(null==i?void 0:i.isRequired)&&(null==i?void 0:i.default)===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function oV(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if("class"===e){let r=t?String(t).split(" "):[],i=n[e]?n[e].split(" "):[],o=r.filter(e=>!i.includes(e));n[e]=[...i,...o].join(" ")}else if("style"===e){let r=t?t.split(";").map(e=>e.trim()).filter(Boolean):[],i=n[e]?n[e].split(";").map(e=>e.trim()).filter(Boolean):[],o=new Map;i.forEach(e=>{let[t,n]=e.split(":").map(e=>e.trim());o.set(t,n)}),r.forEach(e=>{let[t,n]=e.split(":").map(e=>e.trim());o.set(t,n)}),n[e]=Array.from(o.entries()).map(([e,t])=>`${e}: ${t}`).join("; ")}else n[e]=t}),n},{})}function oH(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>oV(e,t),{})}function oW(e,t){return"style"in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;let i=t.reduce((e,t)=>{var r;let i=t.attribute.parseHTML?t.attribute.parseHTML(n):"string"!=typeof(r=n.getAttribute(t.name))?r:r.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(r):"true"===r||"false"!==r&&r;return null==i?e:{...e,[t.name]:i}},{});return{...r,...i}}}}function oU(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>!("attrs"===e&&function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t))}function oK(e){var t,n;let r={};return!(null==(t=null==e?void 0:e.attribute)?void 0:t.isRequired)&&"default"in((null==e?void 0:e.attribute)||{})&&(r.default=e.attribute.default),(null==(n=null==e?void 0:e.attribute)?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function oJ(e){return e.sort((e,t)=>{let n=oL(e,"priority")||100,r=oL(t,"priority")||100;return n>r?-1:+(n<r)})}function oG(e){var t;let n=oJ(oz(e)),r=Array.from(new Set((t=n.map(e=>e.name)).filter((e,n)=>t.indexOf(e)!==n)));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(e=>`'${e}'`).join(", ")}]. This can lead to issues.`),n}function oZ(e,t,n){let{from:r,to:i}=t,{blockSeparator:o="\n\n",textSerializers:s={}}=n||{},l="";return e.nodesBetween(r,i,(e,n,a,c)=>{var d;e.isBlock&&n>r&&(l+=o);let u=null==s?void 0:s[e.type.name];if(u)return a&&(l+=u({node:e,pos:n,parent:a,index:c,range:t})),!1;e.isText&&(l+=null==(d=null==e?void 0:e.text)?void 0:d.slice(Math.max(r,n)-n,i-n))}),l}function oX(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function oQ(e,t){let n=ov("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){let n=iq(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,e=>{o.push(e)});let s=o.reverse().find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}(e,t):"mark"===n?oO(e,t):{}}function oY(e){let t,{mapping:n,steps:r}=e,i=[];return n.maps.forEach((e,t)=>{let o=[];if(e.ranges.length)e.forEach((e,t)=>{o.push({from:e,to:t})});else{let{from:e,to:n}=r[t];if(void 0===e||void 0===n)return;o.push({from:e,to:n})}o.forEach(({from:e,to:r})=>{let o=n.slice(t).map(e,-1),s=n.slice(t).map(r),l=n.invert().map(o,-1),a=n.invert().map(s);i.push({oldRange:{from:l,to:a},newRange:{from:o,to:s}})})}),1===(t=function(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)})}(i)).length?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function o0(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=iQ(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{e&&(null==e?void 0:e.nodeSize)!==void 0&&r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var o1=(e,t,n,r=20)=>{let i=e.doc.resolve(n),o=r,s=null;for(;o>0&&null===s;){let e=i.node(o);(null==e?void 0:e.type.name)===t?s=e:o-=1}return[s,o]};function o2(e,t){return t.nodes[e]||t.marks[e]||null}function o3(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return!!r&&r.attribute.keepOnSplit}))}function o5(e,t,n={}){let{empty:r,ranges:i}=e.selection,o=t?iY(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!o||o.name===e.type.name).find(e=>iG(e.attrs,n,{strict:!1}));let s=0,l=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);s+=o-n,l.push(...e.marks.map(e=>({mark:e,from:n,to:o})))})}),0===s)return!1;let a=l.filter(e=>!o||o.name===e.mark.type.name).filter(e=>iG(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),c=l.filter(e=>!o||e.mark.type!==o&&e.mark.type.excludes(o)).reduce((e,t)=>e+t.to-t.from,0);return(a>0?a+c:a)>=s}var o4=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=oI(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2)&&n.pos===r.pos},o6=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0)&&t.pos===n.pos};function o9(e,t){return Array.isArray(t)?t.some(t=>("string"==typeof t?t:t.name)===e.name):t}function o8(e,t){let{nodeExtensions:n}=o$(t),r=n.find(t=>t.name===e);if(!r)return!1;let i={name:r.name,options:r.options,storage:r.storage},o=oP(oL(r,"group",i));return"string"==typeof o&&o.split(" ").includes("list")}function o7(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if("hardBreak"===e.type.name)return!0;if(e.isText)return/^\s*$/m.test(null!=(r=e.text)?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(t){let r=!0;return e.content.forEach(e=>{!1!==r&&(o7(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function se(e){return e instanceof ta}var st=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function sn(e,t){let n=t.mapping.mapResult(e.position);return{position:new st(n.pos),mapResult:n}}function sr(e){return new st(e)}var si=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=n,{empty:s,ranges:l}=o,a=iY(e,r.schema);if(i)if(s){let e=oO(r,a);n.addStoredMark(a.create({...e,...t}))}else l.forEach(e=>{let i=e.$from.pos,o=e.$to.pos;r.doc.nodesBetween(i,o,(e,r)=>{let s=Math.max(r,i),l=Math.min(r+e.nodeSize,o);e.marks.find(e=>e.type===a)?e.marks.forEach(e=>{a===e.type&&n.addMark(s,l,a.create({...e.attrs,...t}))}):n.addMark(s,l,a.create(t))})});return function(e,t,n){var r;let{selection:i}=t,o=null;if(i2(i)&&(o=i.$cursor),o){let t=null!=(r=e.storedMarks)?r:o.marks();return o.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:s}=i;return s.some(({$from:t,$to:r})=>{let i=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),o=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&o}return!i}),i})}(r,n,a)},so=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),ss=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let o,s=iq(e,n.schema);return(n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),s.isTextblock)?i().command(({commands:e})=>!!tH(s,{...o,...t})(n)||e.clearNodes()).command(({state:e})=>tH(s,{...o,...t})(e,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},sl=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=i3(e,0,n.content.size),i=ta.create(n,r);t.setSelection(i)}return!0},sa=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o,s,{selection:l}=r;return"number"==typeof t?(o=t,s=t):t&&"from"in t&&"to"in t?(o=t.from,s=t.to):(o=l.from,s=l.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},sc=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}="number"==typeof e?{from:e,to:e}:e,o=ts.atStart(n).from,s=ts.atEnd(n).to,l=i3(r,o,s),a=i3(i,o,s),c=ts.create(n,l,a);t.setSelection(c)}return!0},sd=e=>({state:t,dispatch:n})=>{var r;return(r=iq(e,t.schema),function(e,t){let{$from:n,$to:i}=e.selection,o=n.blockRange(i,e=>e.childCount>0&&e.firstChild.type==r);if(!o)return!1;let s=o.startIndex;if(0==s)return!1;let l=o.parent,a=l.child(s-1);if(a.type!=r)return!1;if(t){let n=a.lastChild&&a.lastChild.type==l.type,i=O.from(n?r.create():null),s=new j(O.from(r.create(null,O.from(l.type.create(null,i)))),n?3:1,0),c=o.start,d=o.end;t(e.tr.step(new eP(c-(n?3:1),d,c,d,s,1,!0)).scrollIntoView())}return!0})(t,n)};function su(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>null==t?void 0:t.includes(e.type.name));e.tr.ensureMarks(r)}}var sh=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:o,doc:s}=t,{$from:l,$to:a}=o,c=o3(i.extensionManager.attributes,l.node().type.name,l.node().attrs);if(o instanceof ta&&o.node.isBlock)return!!l.parentOffset&&!!eJ(s,l.pos)&&(r&&(e&&su(n,i.extensionManager.splittableMarks),t.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;let d=a.parentOffset===a.parent.content.size,u=0===l.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(l.node(-1).contentMatchAt(l.indexAfter(-1))),h=d&&u?[{type:u,attrs:c}]:void 0,p=eJ(t.doc,t.mapping.map(l.pos),1,h);if(!h&&!p&&eJ(t.doc,t.mapping.map(l.pos),1,u?[{type:u}]:void 0)&&(p=!0,h=u?[{type:u,attrs:c}]:void 0),r){if(p&&(o instanceof ts&&t.deleteSelection(),t.split(t.mapping.map(l.pos),1,h),u&&!d&&!l.parentOffset&&l.parent.type!==u)){let e=t.mapping.map(l.before()),n=t.doc.resolve(e);l.node(-1).canReplaceWith(n.index(),n.index()+1,u)&&t.setNodeMarkup(t.mapping.map(l.before()),u)}e&&su(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return p},sp=(e,t={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;let l=iq(e,r.schema),{$from:a,$to:c}=r.selection,d=r.selection.node;if(d&&d.isBlock||a.depth<2||!a.sameParent(c))return!1;let u=a.node(-1);if(u.type!==l)return!1;let h=o.extensionManager.attributes;if(0===a.parent.content.size&&a.node(-1).childCount===a.indexAfter(-1)){if(2===a.depth||a.node(-3).type!==l||a.index(-2)!==a.node(-2).childCount-1)return!1;if(i){let e=O.empty,r=a.index(-1)?1:a.index(-2)?2:3;for(let t=a.depth-r;t>=a.depth-3;t-=1)e=O.from(a.node(t).copy(e));let i=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,o={...o3(h,a.node().type.name,a.node().attrs),...t},c=(null==(s=l.contentMatch.defaultType)?void 0:s.createAndFill(o))||void 0;e=e.append(O.from(l.createAndFill(null,c)||void 0));let d=a.before(a.depth-(r-1));n.replace(d,a.after(-i),new j(e,4-r,0));let u=-1;n.doc.nodesBetween(d,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&0===e.content.size&&(u=t+1)}),u>-1&&n.setSelection(ts.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let p=c.pos===a.end()?u.contentMatchAt(0).defaultType:null,f={...o3(h,u.type.name,u.attrs),...t},m={...o3(h,a.node().type.name,a.node().attrs),...t};n.delete(a.pos,c.pos);let g=p?[{type:l,attrs:f},{type:p,attrs:m}]:[{type:l,attrs:f}];if(!eJ(n.doc,a.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:s}=o.extensionManager,l=t||e.$to.parentOffset&&e.$from.marks();if(n.split(a.pos,2,g).scrollIntoView(),!l||!i)return!0;let c=l.filter(e=>s.includes(e.type.name));n.ensureMarks(c)}return!0},sf=(e,t)=>{let n=oI(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===(null==i?void 0:i.type)&&eG(e.doc,n.pos))||(e.join(n.pos),!0)},sm=(e,t)=>{let n=oI(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===(null==i?void 0:i.type)&&eG(e.doc,r))||(e.join(r),!0)},sg=(e,t,n,r={})=>({editor:i,tr:o,state:s,dispatch:l,chain:a,commands:c,can:d})=>{let{extensions:u,splittableMarks:h}=i.extensionManager,p=iq(e,s.schema),f=iq(t,s.schema),{selection:m,storedMarks:g}=s,{$from:y,$to:k}=m,b=y.blockRange(k),v=g||m.$to.parentOffset&&m.$from.marks();if(!b)return!1;let x=oI(e=>o8(e.type.name,u))(m);if(b.depth>=1&&x&&b.depth-x.depth<=1){if(x.node.type===p)return c.liftListItem(f);if(o8(x.node.type.name,u)&&p.validContent(x.node.content)&&l)return a().command(()=>(o.setNodeMarkup(x.pos,p),!0)).command(()=>sf(o,p)).command(()=>sm(o,p)).run()}return n&&v&&l?a().command(()=>{let e=d().wrapInList(p,r),t=v.filter(e=>h.includes(e.type.name));return o.ensureMarks(t),!!e||c.clearNodes()}).wrapInList(p,r).command(()=>sf(o,p)).command(()=>sm(o,p)).run():a().command(()=>!!d().wrapInList(p,r)||c.clearNodes()).wrapInList(p,r).command(()=>sf(o,p)).command(()=>sm(o,p)).run()},sy=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:o=!1}=n,s=iY(e,r.schema);return o5(r,s,t)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,t)},sk=(e,t,n={})=>({state:r,commands:i})=>{let o,s=iq(e,r.schema),l=iq(t,r.schema),a=om(r,s,n);return(r.selection.$anchor.sameParent(r.selection.$head)&&(o=r.selection.$anchor.parent.attrs),a)?i.setNode(l,o):i.setNode(s,{...o,...n})},sb=(e,t={})=>({state:n,commands:r})=>{let i=iq(e,n.schema);return om(n,i,t)?r.lift(i):r.wrapIn(i,t)},sv=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i,o=n[r];if(o.spec.isInputRules&&(i=o.getState(e))){if(t){let t=e.tr,n=i.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(i.text){let n=t.doc.resolve(i.from).marks();t.replaceWith(i.from,i.to,e.schema.text(i.text,n))}else t.delete(i.from,i.to)}return!0}}return!1},sx=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:i}=n;return!!r||(t&&i.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0)},sw=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;let{extendEmptyMarkRange:s=!1}=t,{selection:l}=n,a=iY(e,r.schema),{$from:c,empty:d,ranges:u}=l;if(!i)return!0;if(d&&s){let{from:e,to:t}=l,r=null==(o=c.marks().find(e=>e.type===a))?void 0:o.attrs,i=iQ(c,a,r);i&&(e=i.from,t=i.to),n.removeMark(e,t,a)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,a)});return n.removeStoredMark(a),!0},sC=e=>({tr:t,state:n,dispatch:r})=>{let i,o,{selection:s}=n;return"number"==typeof e?(i=e,o=e):e&&"from"in e&&"to"in e?(i=e.from,o=e.to):(i=s.from,o=s.to),r&&t.doc.nodesBetween(i,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},sS=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=ov("string"==typeof e?e:e.name,r.schema);if(!l)return!1;"node"===l&&(o=iq(e,r.schema)),"mark"===l&&(s=iY(e,r.schema));let a=!1;return n.selection.ranges.forEach(e=>{let l,c,d,u,h=e.$from.pos,p=e.$to.pos;n.selection.empty?r.doc.nodesBetween(h,p,(e,t)=>{o&&o===e.type&&(a=!0,d=Math.max(t,h),u=Math.min(t+e.nodeSize,p),l=t,c=e)}):r.doc.nodesBetween(h,p,(e,r)=>{r<h&&o&&o===e.type&&(a=!0,d=Math.max(r,h),u=Math.min(r+e.nodeSize,p),l=r,c=e),r>=h&&r<=p&&(o&&o===e.type&&(a=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),s&&e.marks.length&&e.marks.forEach(o=>{if(s===o.type&&(a=!0,i)){let i=Math.max(r,h),l=Math.min(r+e.nodeSize,p);n.addMark(i,l,s.create({...o.attrs,...t}))}}))}),c&&(void 0!==l&&i&&n.setNodeMarkup(l,void 0,{...c.attrs,...t}),s&&c.marks.length&&c.marks.forEach(e=>{s===e.type&&i&&n.addMark(d,u,s.create({...e.attrs,...t}))}))}),a},sM=(e,t={})=>({state:n,dispatch:r})=>(function(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=s&&eH(s,e,t);return!!l&&(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0)}})(iq(e,n.schema),t)(n,r),sE=(e,t={})=>({state:n,dispatch:r})=>(function(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o);if(!s)return!1;let l=r?n.tr:null;return!!function(e,t,n,r=null){let i=!1,o=t,s=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&0==t.startIndex){if(0==t.$from.index(t.depth-1))return!1;let e=s.resolve(t.start-2);o=new G(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new G(t.$from,s.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let l=eH(o,n,r,t);return!!l&&(e&&function(e,t,n,r,i){let o=O.empty;for(let e=n.length-1;e>=0;e--)o=O.from(n[e].type.create(n[e].attrs,o));e.step(new eP(t.start-2*!!r,t.end,t.start,t.end,new j(o,0,0),n.length,!0));let s=0;for(let e=0;e<n.length;e++)n[e].type==i&&(s=e+1);let l=n.length-s,a=t.start+n.length-2*!!r,c=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&eJ(e.doc,a,l)&&(e.split(a,l),a+=2*l),a+=c.child(n).nodeSize}(e,t,l,i,n),!0)}(l,s,e,t)&&(r&&r(l.scrollIntoView()),!0)}})(iq(e,n.schema),t)(n,r),sA=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},sD=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=null==(t=e.undoable)||t}};function s_(e){var t;let{editor:n,from:r,to:i,text:o,rules:s,plugin:l}=e,{view:a}=n;if(a.composing)return!1;let c=a.state.doc.resolve(r);if(c.parent.type.spec.code||(null==(t=c.nodeBefore||c.nodeAfter)?void 0:t.marks.find(e=>e.type.spec.code)))return!1;let d=!1,u=((e,t=500)=>{let n="",r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,o)=>{var s,l;let a=(null==(l=(s=e.type.spec).toText)?void 0:l.call(s,{node:e,pos:t,parent:i,index:o}))||e.textContent||"%leaf%";n+=e.isAtom&&!e.isText?a:a.slice(0,Math.max(0,r-t))}),n})(c)+o;return s.forEach(e=>{if(d)return;let t=((e,t)=>{if(iJ(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r})(u,e.find);if(!t)return;let s=a.state.tr,c=iO({state:a.state,transaction:s}),h={from:r-(t[0].length-o.length),to:i},{commands:p,chain:f,can:m}=new iR({editor:n,state:c});null!==e.handler({state:c,range:h,match:t,commands:p,chain:f,can:m})&&s.steps.length&&(e.undoable&&s.setMeta(l,{transform:s,from:r,to:i,text:o}),a.dispatch(s),d=!0)}),d}function sT(e){return"Object"===Object.prototype.toString.call(e).slice(8,-1)&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}var sN=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...oP(oL(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...oP(oL(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>(function e(t,n){let r={...t};return sT(t)&&sT(n)&&Object.keys(n).forEach(i=>{sT(n[i])&&sT(t[i])?r[i]=e(t[i],n[i]):r[i]=n[i]}),r})(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},sO=class e extends sN{constructor(){super(...arguments),this.type="mark"}static create(t={}){return new e("function"==typeof t?t():t)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>(null==e?void 0:e.type.name)===t.name))return!1;let o=i.find(e=>(null==e?void 0:e.type.name)===t.name);return o&&n.removeStoredMark(o),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}},sR=class{constructor(e){this.find=e.find,this.handler=e.handler}},sF=null,sI=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=oG(e),this.schema=function(e,t){var n;let r=oq(e),{nodeExtensions:i,markExtensions:o}=o$(e),s=null==(n=i.find(e=>oL(e,"topNode")))?void 0:n.name;return new eh({topNode:s,nodes:Object.fromEntries(i.map(n=>{let i=r.filter(e=>e.type===n.name),o={name:n.name,options:n.options,storage:n.storage,editor:t},s=oU({...e.reduce((e,t)=>{let r=oL(t,"extendNodeSchema",o);return{...e,...r?r(n):{}}},{}),content:oP(oL(n,"content",o)),marks:oP(oL(n,"marks",o)),group:oP(oL(n,"group",o)),inline:oP(oL(n,"inline",o)),atom:oP(oL(n,"atom",o)),selectable:oP(oL(n,"selectable",o)),draggable:oP(oL(n,"draggable",o)),code:oP(oL(n,"code",o)),whitespace:oP(oL(n,"whitespace",o)),linebreakReplacement:oP(oL(n,"linebreakReplacement",o)),defining:oP(oL(n,"defining",o)),isolating:oP(oL(n,"isolating",o)),attrs:Object.fromEntries(i.map(oK))}),l=oP(oL(n,"parseHTML",o));l&&(s.parseDOM=l.map(e=>oW(e,i)));let a=oL(n,"renderHTML",o);a&&(s.toDOM=e=>a({node:e,HTMLAttributes:oH(e,i)}));let c=oL(n,"renderText",o);return c&&(s.toText=c),[n.name,s]})),marks:Object.fromEntries(o.map(n=>{let i=r.filter(e=>e.type===n.name),o={name:n.name,options:n.options,storage:n.storage,editor:t},s=oU({...e.reduce((e,t)=>{let r=oL(t,"extendMarkSchema",o);return{...e,...r?r(n):{}}},{}),inclusive:oP(oL(n,"inclusive",o)),excludes:oP(oL(n,"excludes",o)),group:oP(oL(n,"group",o)),spanning:oP(oL(n,"spanning",o)),code:oP(oL(n,"code",o)),attrs:Object.fromEntries(i.map(oK))}),l=oP(oL(n,"parseHTML",o));l&&(s.parseDOM=l.map(e=>oW(e,i)));let a=oL(n,"renderHTML",o);return a&&(s.toDOM=e=>a({mark:e,HTMLAttributes:oH(e,i)})),[n.name,s]}))})}(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:o2(t.name,this.schema)},r=oL(t,"addCommands",n);return r?{...e,...r()}:e},{})}get plugins(){let{editor:e}=this;return oJ([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:o2(t.name,this.schema)},r=[],i=oL(t,"addKeyboardShortcuts",n),o={};if("mark"===t.type&&oL(t,"exitable",n)&&(o.ArrowRight=()=>sO.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));o={...o,...t}}let s=new tv({props:{handleKeyDown:i_(o)}});r.push(s);let l=oL(t,"addInputRules",n);if(o9(t,e.options.enableInputRules)&&l){let t=l();if(t&&t.length){let n=function(e){let{editor:t,rules:n}=e,r=new tv({state:{init:()=>null,apply(e,i,o){let s=e.getMeta(r);if(s)return s;let l=e.getMeta("applyInputRules");return l&&setTimeout(()=>{let{text:e}=l;"string"==typeof e||(e=oj(O.from(e),o.schema));let{from:i}=l,s=i+e.length;s_({editor:t,from:i,to:s,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput:(e,i,o,s)=>s_({editor:t,from:i,to:o,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&s_({editor:t,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if("Enter"!==i.key)return!1;let{$cursor:o}=e.state.selection;return!!o&&s_({editor:t,from:o.pos,to:o.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let a=oL(t,"addPasteRules",n);if(o9(t,e.options.enablePasteRules)&&a){let t=a();if(t&&t.length){let n=function(e){let t,{editor:n,rules:r}=e,i=null,o=!1,s=!1,l="u">typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{t="u">typeof DragEvent?new DragEvent("drop"):null}catch{t=null}let a=({state:e,from:r,to:i,rule:o,pasteEvt:s})=>{let a=e.tr;if(function(e){let{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=e,{commands:a,chain:c,can:d}=new iR({editor:t,state:n}),u=[];return n.doc.nodesBetween(r,i,(e,t)=>{var h,p,f,m,g;if((null==(p=null==(h=e.type)?void 0:h.spec)?void 0:p.code)||!(e.isText||e.isTextblock||e.isInline))return;let y=null!=(g=null!=(m=null==(f=e.content)?void 0:f.size)?m:e.nodeSize)?g:0,k=Math.max(r,t),b=Math.min(i,t+y);k>=b||((e,t,n)=>{if(iJ(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n}):[]})(e.isText?e.text||"":e.textBetween(k-t,b-t,void 0,""),o.find,s).forEach(e=>{if(void 0===e.index)return;let t=k+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},h=o.handler({state:n,range:i,match:e,commands:a,chain:c,can:d,pasteEvent:s,dropEvent:l});u.push(h)})}),u.every(e=>null!==e)}({editor:n,state:iO({state:e,transaction:a}),from:Math.max(r-1,0),to:i.b-1,rule:o,pasteEvent:s,dropEvent:t})&&a.steps.length){try{t="u">typeof DragEvent?new DragEvent("drop"):null}catch{t=null}return l="u">typeof ClipboardEvent?new ClipboardEvent("paste"):null,a}};return r.map(e=>new tv({view(e){let t=t=>{var r;(i=(null==(r=e.dom.parentElement)?void 0:r.contains(t.target))?e.dom.parentElement:null)&&(sF=n)},r=()=>{sF&&(sF=null)};return window.addEventListener("dragstart",t),window.addEventListener("dragend",r),{destroy(){window.removeEventListener("dragstart",t),window.removeEventListener("dragend",r)}}},props:{handleDOMEvents:{drop:(e,n)=>{if(s=i===e.dom.parentElement,t=n,!s){let e=sF;(null==e?void 0:e.isEditable)&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{var n;let r=null==(n=t.clipboardData)?void 0:n.getData("text/html");return l=t,o=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{let i=t[0],c="paste"===i.getMeta("uiEvent")&&!o,d="drop"===i.getMeta("uiEvent")&&!s,u=i.getMeta("applyPasteRules"),h=!!u;if(!c&&!d&&!h)return;if(h){var p,f;let t,{text:n}=u;"string"==typeof n||(n=oj(O.from(n),r.schema));let{from:i}=u,o=i+n.length;return a({rule:e,state:r,from:i,to:{b:o},pasteEvt:(p=n,null==(f=(t=new ClipboardEvent("paste",{clipboardData:new DataTransfer})).clipboardData)||f.setData("text/html",p),t)})}let m=n.doc.content.findDiffStart(r.doc.content),g=n.doc.content.findDiffEnd(r.doc.content);if("number"==typeof m&&g&&m!==g.b)return a({rule:e,state:r,from:m,to:g,pasteEvt:l})}}))}({editor:e,rules:t});r.push(...n)}}let c=oL(t,"addProseMirrorPlugins",n);if(c){let e=c();r.push(...e)}return r})}get attributes(){return oq(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=o$(this.extensions);return Object.fromEntries(t.filter(e=>!!oL(e,"addNodeView")).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:iq(t.name,this.schema)},i=oL(t,"addNodeView",r);if(!i)return[];let o=i();return o?[t.name,(r,i,s,l,a)=>{let c=oH(r,n);return o({node:r,view:i,getPos:s,decorations:l,innerDecorations:a,editor:e,extension:t,HTMLAttributes:c})}]:[]}))}dispatchTransaction(e){let{editor:t}=this;return oJ([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:o2(n.name,this.schema)},i=oL(n,"dispatchTransaction",r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}get markViews(){let{editor:e}=this,{markExtensions:t}=o$(this.extensions);return Object.fromEntries(t.filter(e=>!!oL(e,"addMarkView")).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:iY(t.name,this.schema)},i=oL(t,"addMarkView",r);return i?[t.name,(r,o,s)=>{let l=oH(r,n);return i()({mark:r,view:o,inline:s,editor:e,extension:t,HTMLAttributes:l,updateAttributes:t=>{ln(r,e,t)}})}]:[]}))}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{var t;let n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:o2(e.name,this.schema)};"mark"===e.type&&(null==(t=oP(oL(e,"keepOnSplit",n)))||t)&&this.splittableMarks.push(e.name);let r=oL(e,"onBeforeCreate",n),i=oL(e,"onCreate",n),o=oL(e,"onUpdate",n),s=oL(e,"onSelectionUpdate",n),l=oL(e,"onTransaction",n),a=oL(e,"onFocus",n),c=oL(e,"onBlur",n),d=oL(e,"onDestroy",n);r&&this.editor.on("beforeCreate",r),i&&this.editor.on("create",i),o&&this.editor.on("update",o),s&&this.editor.on("selectionUpdate",s),l&&this.editor.on("transaction",l),a&&this.editor.on("focus",a),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)})}};sI.resolve=oG,sI.sort=oJ,sI.flatten=oz;var sL={};iN(sL,{ClipboardTextSerializer:()=>sj,Commands:()=>sB,Delete:()=>sP,Drop:()=>s$,Editable:()=>sq,FocusEvents:()=>sH,Keymap:()=>sW,Paste:()=>sU,Tabindex:()=>sK,TextDirection:()=>sJ,focusEventsPluginKey:()=>sV});var sz=class e extends sN{constructor(){super(...arguments),this.type="extension"}static create(t={}){return new e("function"==typeof t?t():t)}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}},sj=sz.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new tv({key:new tC("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,s=Math.min(...o.map(e=>e.$from.pos)),l=Math.max(...o.map(e=>e.$to.pos)),a=oX(n);return oZ(r,{from:s,to:l},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),sB=sz.create({name:"commands",addCommands:()=>({...iF})}),sP=sz.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,i;let o=()=>{var n,r,i,o;if(null!=(o=null==(i=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.filterTransaction)?void 0:i.call(r,e))?o:e.getMeta("y-sync$"))return;let s=oR(e.before,[e,...t]);oY(s).forEach(t=>{s.mapping.mapResult(t.oldRange.from).deletedAfter&&s.mapping.mapResult(t.oldRange.to).deletedBefore&&s.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,r)=>{let i=r+n.nodeSize-2,o=t.oldRange.from<=r&&i<=t.oldRange.to;this.editor.emit("delete",{type:"node",node:n,from:r,to:i,newFrom:s.mapping.map(r),newTo:s.mapping.map(i),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:s})})});let l=s.mapping;s.steps.forEach((t,n)=>{var r,i;if(t instanceof eL){let o=l.slice(n).map(t.from,-1),a=l.slice(n).map(t.to),c=l.invert().map(o,-1),d=l.invert().map(a),u=null==(r=s.doc.nodeAt(o-1))?void 0:r.marks.some(e=>e.eq(t.mark)),h=null==(i=s.doc.nodeAt(a))?void 0:i.marks.some(e=>e.eq(t.mark));this.editor.emit("delete",{type:"mark",mark:t.mark,from:t.from,to:t.to,deletedRange:{from:c,to:d},newRange:{from:o,to:a},partial:!!(h||u),editor:this.editor,transaction:e,combinedTransform:s})}})};null==(i=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.async)||i?setTimeout(o,0):o()}}),s$=sz.create({name:"drop",addProseMirrorPlugins(){return[new tv({key:new tC("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),sq=sz.create({name:"editable",addProseMirrorPlugins(){return[new tv({key:new tC("editable"),props:{editable:()=>this.editor.options.editable}})]}}),sV=new tC("focusEvents"),sH=sz.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:e}=this;return[new tv({key:sV,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),sW=sz.create({name:"keymap",addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:o}=n,{pos:s,parent:l}=o,a=o.parent.isTextblock&&s>0?t.doc.resolve(s-1):o,c=a.parent.type.spec.isolating,d=o.pos-o.parentOffset,u=c&&1===a.parent.childCount?d===o.pos:tn.atStart(r).from===s;return!!i&&!!l.type.isTextblock&&!l.textContent.length&&!!u&&(!u||"paragraph"!==o.parent.type.name)&&e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return i6()||op()?i:r},addProseMirrorPlugins(){return[new tv({key:new tC("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta("composition")))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta("preventClearDocument"));if(!r||i)return;let{empty:o,from:s,to:l}=t.selection,a=tn.atStart(t.doc).from,c=tn.atEnd(t.doc).to;if(o||s!==a||l!==c||!o7(n.doc))return;let d=n.tr,u=iO({state:n,transaction:d}),{commands:h}=new iR({editor:this.editor,state:u});if(h.clearNodes(),d.steps.length)return d}})]}}),sU=sz.create({name:"paste",addProseMirrorPlugins(){return[new tv({key:new tC("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),sK=sz.create({name:"tabindex",addProseMirrorPlugins(){return[new tv({key:new tC("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),sJ=sz.create({name:"textDirection",addOptions:()=>({direction:void 0}),addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=o$(this.extensions);return[{types:e.filter(e=>"text"!==e.name).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute("dir");return t&&("ltr"===t||"rtl"===t||"auto"===t)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new tv({key:new tC("textDirection"),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),sG=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return null!=(e=this.actualDepth)?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(0===this.content.size)return void console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+ +!this.node.isText}get parent(){if(0===this.depth)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1);return new e(this.resolvedPos.doc.resolve(t),this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=n.isInline,l=this.pos+r+ +!o;if(l<0||l>this.resolvedPos.doc.nodeSize-2)return;let a=this.resolvedPos.doc.resolve(l);if(!i&&!s&&a.depth<=this.depth)return;let c=new e(a,this.editor,i,i||s?n:null);i&&(c.actualDepth=this.depth+1),t.push(c)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||0===this.children.length)return r;let i=Object.keys(t);return this.children.forEach(o=>{n&&r.length>0||(o.node.type.name===e&&i.every(e=>t[e]===o.node.attrs[e])&&r.push(o),n&&r.length>0||(r=r.concat(o.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},sZ=`.ProseMirror {
|
|
2
|
+
position: relative;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.ProseMirror {
|
|
6
|
+
word-wrap: break-word;
|
|
7
|
+
white-space: pre-wrap;
|
|
8
|
+
white-space: break-spaces;
|
|
9
|
+
-webkit-font-variant-ligatures: none;
|
|
10
|
+
font-variant-ligatures: none;
|
|
11
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.ProseMirror [contenteditable="false"] {
|
|
15
|
+
white-space: normal;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
19
|
+
white-space: pre-wrap;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.ProseMirror pre {
|
|
23
|
+
white-space: pre-wrap;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
img.ProseMirror-separator {
|
|
27
|
+
display: inline !important;
|
|
28
|
+
border: none !important;
|
|
29
|
+
margin: 0 !important;
|
|
30
|
+
width: 0 !important;
|
|
31
|
+
height: 0 !important;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.ProseMirror-gapcursor {
|
|
35
|
+
display: none;
|
|
36
|
+
pointer-events: none;
|
|
37
|
+
position: absolute;
|
|
38
|
+
margin: 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.ProseMirror-gapcursor:after {
|
|
42
|
+
content: "";
|
|
43
|
+
display: block;
|
|
44
|
+
position: absolute;
|
|
45
|
+
top: -2px;
|
|
46
|
+
width: 20px;
|
|
47
|
+
border-top: 1px solid black;
|
|
48
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@keyframes ProseMirror-cursor-blink {
|
|
52
|
+
to {
|
|
53
|
+
visibility: hidden;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.ProseMirror-hideselection *::selection {
|
|
58
|
+
background: transparent;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
62
|
+
background: transparent;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.ProseMirror-hideselection * {
|
|
66
|
+
caret-color: transparent;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
70
|
+
display: block;
|
|
71
|
+
}`,sX=class extends sA{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:"u">typeof document?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:sn,createMappablePosition:sr},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on("paste",({event:e,slice:t})=>this.options.onPaste(e,t)),this.on("delete",this.options.onDelete);const t=this.createDoc(),n=i5(t,this.options.autofocus);this.editorState=tb.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if("u"<typeof document)throw Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(!1!==this.options.autofocus&&null!==this.options.autofocus&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){let e=this.editorView.dom;(null==e?void 0:e.editor)&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{"function"==typeof this.css.remove?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&"u">typeof document&&(this.css=function(e,t,n){let r=document.querySelector("style[data-tiptap-style]");if(null!==r)return r;let i=document.createElement("style");return t&&i.setAttribute("nonce",t),i.setAttribute("data-tiptap-style",""),i.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(i),i}(sZ,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if("state"===t)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=oB(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t="string"==typeof e?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;let n=[...this.options.enableCoreExtensions?[sq,sj.configure({blockSeparator:null==(t=null==(e=this.options.coreExtensionOptions)?void 0:e.clipboardTextSerializer)?void 0:t.blockSeparator}),sB,sH,sW,sK,s$,sU,sP,sJ.configure({direction:this.options.textDirection})].filter(e=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[e.name]):[],...this.options.extensions].filter(e=>["extension","node","mark"].includes(null==e?void 0:e.type));this.extensionManager=new sI(n,this)}createCommandManager(){this.commandManager=new iR({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=oT(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&"object"==typeof this.storage.collaboration&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>"collaboration"!==e.name),this.createExtensionManager()}}),e=oT(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r;this.editorView=new ip(e,{...t,attributes:{role:"textbox",...null==t?void 0:t.attributes},dispatchTransaction:i,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let o=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(o),this.prependClass(),this.injectCSS(),this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>{var t;return null==(t=this.capturedTransaction)?void 0:t.step(e)});return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),o=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});let s=n.findLast(e=>e.getMeta("focus")||e.getMeta("blur")),l=null==s?void 0:s.getMeta("focus"),a=null==s?void 0:s.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:s}),a&&this.emit("blur",{editor:this,event:a.event,transaction:s}),e.getMeta("preventUpdate")||!n.some(e=>e.docChanged)||o.doc.eq(t.doc)||this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return oQ(this.state,e)}isActive(e,t){let n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return om(e,null,n)||o5(e,null,n);let r=ov(t,e.schema);return"node"===r?om(e,t,n):"mark"===r&&o5(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return oj(this.state.doc.content,this.schema)}getText(e){var t,n;let r,{blockSeparator:i="\n\n",textSerializers:o={}}=e||{};return t=this.state.doc,n={blockSeparator:i,textSerializers:{...oX(this.schema),...o}},r={from:0,to:t.content.size},oZ(t,r,n)}get isEmpty(){return o7(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var e,t;return null==(t=null==(e=this.editorView)?void 0:e.isDestroyed)||t}$node(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelectorAll(e,t))||null}$pos(e){return new sG(this.state.doc.resolve(e),this)}get $doc(){return this.$pos(0)}};function sQ(e){return new sD({find:e.find,handler:({state:t,range:n,match:r})=>{let i=oP(e.getAttributes,void 0,r);if(!1===i||null===i)return null;let{tr:o}=t,s=r[r.length-1],l=r[0];if(s){let r=l.search(/\S/),a=n.from+l.indexOf(s),c=a+s.length;if(o0(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>a).length)return null;c<n.to&&o.delete(c,n.to),a>n.from&&o.delete(n.from+r,a);let d=n.from+r+s.length;o.addMark(n.from+r,d,e.type.create(i||{})),o.removeStoredMark(e.type)}},undoable:e.undoable})}function sY(e){return new sD({find:e.find,handler:({state:t,range:n,match:r})=>{let i=oP(e.getAttributes,void 0,r)||{},{tr:o}=t,s=n.from,l=n.to,a=e.type.create(i);if(r[1]){let e=s+r[0].lastIndexOf(r[1]);e>l?e=l:l=e+r[1].length;let t=r[0][r[0].length-1];o.insertText(t,s+r[0].length-1),o.replaceWith(e,l,a)}else if(r[0]){let t=e.type.isInline?s:s-1;o.insert(t,e.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l))}o.scrollIntoView()},undoable:e.undoable})}function s0(e){return new sD({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),o=oP(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)},undoable:e.undoable})}function s1(e){return new sD({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let o=oP(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),a=l&&eH(l,e.type,o);if(!a)return null;if(s.wrap(l,a),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,o=r||n.$to.parentOffset&&n.$from.marks();if(o){let e=o.filter(e=>i.includes(e.type.name));s.ensureMarks(e)}}if(e.keepAttributes){let t="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";i().updateAttributes(t,o).run()}let c=s.doc.resolve(n.from-1).nodeBefore;c&&c.type===e.type&&eG(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,c))&&s.join(n.from-1)},undoable:e.undoable})}function s2(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof ta){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;i-=1}return!1}function s3(e){if(!(null==e?void 0:e.trim()))return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);i&&(t.class=i.map(e=>e.trim().slice(1)).join(" "));let o=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);o&&(t.id=o[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{var i;let o=n[parseInt((null==(i=r.match(/__QUOTED_(\d+)__/))?void 0:i[1])||"0",10)];o&&(t[e]=o.slice(1,-1))});let s=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return s&&s.split(/\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function s5(e){if(!e||0===Object.keys(e).length)return"";let t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{"class"!==e&&"id"!==e&&(!0===n?t.push(e):!1!==n&&null!=n&&t.push(`${e}="${String(n)}"`))}),t.join(" ")}function s4(e){let{nodeName:t,name:n,parseAttributes:r=s3,serializeAttributes:i=s5,defaultAttributes:o={},requiredAttributes:s=[],allowedAttributes:l}=e,a=n||t;return{parseMarkdown:(e,n)=>{let r={...o,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:"block",start(e){var t;let n=RegExp(`^:::${a}(?:\\s|$)`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,i){let o=RegExp(`^:::${a}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),l=e.match(o);if(!l)return;let c=r(l[1]||"");if(!s.find(e=>!(e in c)))return{type:t,raw:l[0],attributes:c}}},renderMarkdown:e=>{let t=i((e=>{if(!l)return e;let t={};return l.forEach(n=>{n in e&&(t[n]=e[n])}),t})(e.attrs||{})),n=t?` {${t}}`:"";return`:::${a}${n} :::`}}}function s6(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=s3,serializeAttributes:o=s5,defaultAttributes:s={},content:l="block",allowedAttributes:a}=e,c=n||t;return{parseMarkdown:(e,n)=>{let i;if(r){let t=r(e);i="string"==typeof t?[{type:"text",text:t}]:t}else i="block"===l?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);let o={...s,...e.attributes};return n.createNode(t,o,i)},markdownTokenizer:{name:t,level:"block",start(e){var t;let n=RegExp(`^:::${c}`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,r){var o;let s=RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),a=e.match(s);if(!a)return;let[d,u=""]=a,h=i(u),p=1,f=d.length,m="",g=/^:::([\w-]*)(\s.*)?/gm,y=e.slice(f);for(g.lastIndex=0;;){let n=g.exec(y);if(null===n)break;let i=n.index,s=n[1];if(null==(o=n[2])||!o.endsWith(":::")){if(s)p+=1;else if(0==(p-=1)){let o=y.slice(0,i);m=o.trim();let s=e.slice(0,f+i+n[0].length),a=[];if(m)if("block"===l)for((a=r.blockTokens(o)).forEach(e=>{e.text&&(!e.tokens||0===e.tokens.length)&&(e.tokens=r.inlineTokens(e.text))});a.length>0;){let e=a[a.length-1];if("paragraph"!==e.type||e.text&&""!==e.text.trim())break;a.pop()}else a=r.inlineTokens(m);return{type:t,raw:s,attributes:h,content:m,tokens:a}}}}}},renderMarkdown:(e,t)=>{let n=o((e=>{if(!a)return e;let t={};return a.forEach(n=>{n in e&&(t[n]=e[n])}),t})(e.attrs||{})),r=n?` {${n}}`:"",i=t.renderChildren(e.content||[],"\n\n");return`:::${c}${r}
|
|
72
|
+
|
|
73
|
+
${i}
|
|
74
|
+
|
|
75
|
+
:::`}}}function s9(e){if(!e.trim())return{};let t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;null!==r;){let[,i,o,s]=r;t[i]=o||s,r=n.exec(e)}return t}function s8(e){return Object.entries(e).filter(([,e])=>null!=e).map(([e,t])=>`${e}="${t}"`).join(" ")}function s7(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=s9,serializeAttributes:o=s8,defaultAttributes:s={},selfClosing:l=!1,allowedAttributes:a}=e,c=n||t,d=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(e,n)=>{let i={...s,...e.attributes};if(l)return n.createNode(t,i);let o=r?r(e):e.content||"";return o?n.createNode(t,i,[n.createTextNode(o)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:"inline",start(e){let t=l?RegExp(`\\[${d}\\s*[^\\]]*\\]`):RegExp(`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t),r=null==n?void 0:n.index;return void 0!==r?r:-1},tokenize(e,n,r){let o=l?RegExp(`^\\[${d}\\s*([^\\]]*)\\]`):RegExp(`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),s=e.match(o);if(!s)return;let a="",c="";if(l){let[,e]=s;c=e}else{let[,e,t]=s;c=e,a=t||""}let u=i(c.trim());return{type:t,raw:s[0],content:a.trim(),attributes:u}}},renderMarkdown:e=>{let t="";r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>"text"===e.type).map(e=>e.text).join(""));let n=o((e=>{if(!a)return e;let t={};return a.forEach(n=>{let r="string"==typeof n?n:n.name,i="string"==typeof n?void 0:n.skipIfDefault;if(r in e){let n=e[r];if(void 0!==i&&n===i)return;t[r]=n}}),t})(e.attrs||{})),i=n?` ${n}`:"";return l?`[${c}${i}]`:`[${c}${i}]${t}[/${c}]`}}}function le(e,t,n){var r,i,o,s;let l=e.split("\n"),a=[],c="",d=0,u=t.baseIndentSize||2;for(;d<l.length;){let e,h=l[d],p=h.match(t.itemPattern);if(!p)if(a.length>0)break;else{if(""!==h.trim())return;d+=1,c=`${c}${h}
|
|
76
|
+
`;continue}let f=t.extractItemData(p),{indentLevel:m,mainContent:g}=f;c=`${c}${h}
|
|
77
|
+
`;let y=[g];for(d+=1;d<l.length;){let e=l[d];if(""===e.trim()){let t=l.slice(d+1).findIndex(e=>""!==e.trim());if(-1===t)break;if(((null==(i=null==(r=l[d+1+t].match(/^(\s*)/))?void 0:r[1])?void 0:i.length)||0)>m){y.push(e),c=`${c}${e}
|
|
78
|
+
`,d+=1;continue}break}if(((null==(s=null==(o=e.match(/^(\s*)/))?void 0:o[1])?void 0:s.length)||0)>m)y.push(e),c=`${c}${e}
|
|
79
|
+
`,d+=1;else break}let k=y.slice(1);if(k.length>0){let r=k.map(e=>e.slice(m+u)).join("\n");r.trim()&&(e=t.customNestedParser?t.customNestedParser(r):n.blockTokens(r))}let b=t.createToken(f,e);a.push(b)}if(0!==a.length)return{items:a,raw:c}}function lt(e,t,n,r){if(!e||!Array.isArray(e.content))return"";let i="function"==typeof n?n(r):n,[o,...s]=e.content,l=t.renderChildren([o]),a=[`${i}${l}`];return s&&s.length>0&&s.forEach(e=>{let n=t.renderChildren([e]);if(n){let e=n.split("\n").map(e=>e?t.indent(e):"").join("\n");a.push(e)}}),a.join("\n")}function ln(e,t,n={}){let{state:r}=t,{doc:i,tr:o}=r;i.descendants((t,r)=>{let i=o.mapping.map(r),s=o.mapping.map(r)+t.nodeSize,l=null;if(t.marks.forEach(t=>{if(t!==e)return!1;l=t}),!l)return;let a=!1;if(Object.keys(n).forEach(e=>{n[e]!==l.attrs[e]&&(a=!0)}),a){let t=e.type.create({...e.attrs,...n});o.removeMark(i,s,e.type),o.addMark(i,s,t)}}),o.docChanged&&t.view.dispatch(o)}iN({},{createAtomBlockMarkdownSpec:()=>s4,createBlockMarkdownSpec:()=>s6,createInlineMarkdownSpec:()=>s7,parseAttributes:()=>s3,parseIndentedBlocks:()=>le,renderNestedMarkdownContent:()=>lt,serializeAttributes:()=>s5});var lr=class{constructor(e,t,n){this.component=e,this.editor=t.editor,this.options={...n},this.mark=t.mark,this.HTMLAttributes=t.HTMLAttributes}get dom(){return this.editor.view.dom}get contentDOM(){return null}updateAttributes(e,t){ln(t||this.mark,this.editor,e)}ignoreMutation(e){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:e}):!("selection"===e.type||this.dom.contains(e.target)&&"childList"===e.type&&(i6()||i4())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable))&&(this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)))}},li=class e extends sN{constructor(){super(...arguments),this.type="node"}static create(t={}){return new e("function"==typeof t?t():t)}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}},lo=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,r,i,o,s,l;let{view:a}=this.editor,c=e.target,d=3===c.nodeType?null==(t=c.parentElement)?void 0:t.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||(null==(n=this.contentDOM)?void 0:n.contains(c))||!d)return;let u=0,h=0;if(this.dom!==d){let t=this.dom.getBoundingClientRect(),n=d.getBoundingClientRect(),l=null!=(i=e.offsetX)?i:null==(r=e.nativeEvent)?void 0:r.offsetX,a=null!=(s=e.offsetY)?s:null==(o=e.nativeEvent)?void 0:o.offsetY;u=n.x-t.x+l,h=n.y-t.y+a}let p=this.dom.cloneNode(!0);try{let e=this.dom.getBoundingClientRect();p.style.width=`${Math.round(e.width)}px`,p.style.height=`${Math.round(e.height)}px`,p.style.boxSizing="border-box",p.style.pointerEvents="none"}catch{}let f=null;try{(f=document.createElement("div")).style.position="absolute",f.style.top="-9999px",f.style.left="-9999px",f.style.pointerEvents="none",f.appendChild(p),document.body.appendChild(f),null==(l=e.dataTransfer)||l.setDragImage(p,u,h)}finally{f&&setTimeout(()=>{try{null==f||f.remove()}catch{}},0)}let m=this.getPos();if("number"!=typeof m)return;let g=ta.create(a.state.doc,m),y=a.state.tr.setSelection(g);a.dispatch(y)}stopEvent(e){var t;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:e});let n=e.target;if(!(this.dom.contains(n)&&!(null==(t=this.contentDOM)?void 0:t.contains(n))))return!1;let r=e.type.startsWith("drag"),i="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!i&&!r)return!0;let{isEditable:o}=this.editor,{isDragging:s}=this,l=!!this.node.type.spec.draggable,a=ta.isSelectable(this.node),c="copy"===e.type,d="paste"===e.type,u="cut"===e.type,h="mousedown"===e.type;if(!l&&a&&r&&e.target===this.dom&&e.preventDefault(),l&&r&&!s&&e.target===this.dom)return e.preventDefault(),!1;if(l&&o&&!s&&h){let e=n.closest("[data-drag-handle]");e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!s&&!i&&!c&&!d&&!u&&(!h||!a)}ignoreMutation(e){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:e}):!!this.node.isLeaf||!!this.node.isAtom||!("selection"===e.type||this.dom.contains(e.target)&&"childList"===e.type&&(i6()||i4())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable))&&(this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)))}updateAttributes(e){this.editor.commands.command(({tr:t})=>{let n=this.getPos();return"number"==typeof n&&(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){let e=this.getPos();if("number"!=typeof e)return;let t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}};function ls(e){return new sR({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let o=oP(e.getAttributes,void 0,r,i);if(!1===o||null===o)return null;let{tr:s}=t,l=r[r.length-1],a=r[0],c=n.to;if(l){let r=a.search(/\S/),i=n.from+a.indexOf(l),d=i+l.length;if(o0(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>i).length)return null;d<n.to&&s.delete(d,n.to),i>n.from&&s.delete(n.from+r,i),c=n.from+r+l.length,s.addMark(n.from+r,c,e.type.create(o||{})),s.removeStoredMark(e.type)}}})}e.s(["Editor",()=>sX,"Extension",()=>sz,"Mark",()=>sO,"MarkView",()=>lr,"Node",()=>li,"NodeView",()=>lo,"callOrReturn",()=>oP,"canInsertNode",()=>s2,"combineTransactionSteps",()=>oR,"extensions",()=>sL,"findChildrenInRange",()=>oF,"getAttributes",()=>oQ,"getChangedRanges",()=>oY,"getExtensionField",()=>oL,"getHTMLFromFragment",()=>oj,"getMarksBetween",()=>o0,"getNodeAtPosition",()=>o1,"getNodeType",()=>iq,"getRenderedAttributes",()=>oH,"isAtEndOfNode",()=>o4,"isAtStartOfNode",()=>o6,"isNodeActive",()=>om,"isNodeEmpty",()=>o7,"isNodeSelection",()=>se,"markInputRule",()=>sQ,"markPasteRule",()=>ls,"mergeAttributes",()=>oV,"nodeInputRule",()=>sY,"parseIndentedBlocks",()=>le,"renderNestedMarkdownContent",()=>lt,"textblockTypeInputRule",()=>s0,"wrappingInputRule",()=>s1],10552);let{getOwnPropertyNames:ll,getOwnPropertySymbols:la}=Object,{hasOwnProperty:lc}=Object.prototype;function ld(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function lu(e){return function(t,n,r){if(!t||!n||"object"!=typeof t||"object"!=typeof n)return e(t,n,r);let{cache:i}=r,o=i.get(t),s=i.get(n);if(o&&s)return o===n&&s===t;i.set(t,n),i.set(n,t);let l=e(t,n,r);return i.delete(t),i.delete(n),l}}function lh(e){return ll(e).concat(la(e))}let lp=Object.hasOwn||((e,t)=>lc.call(e,t));function lf(e,t){return e===t||!e&&!t&&e!=e&&t!=t}let{getOwnPropertyDescriptor:lm,keys:lg}=Object;function ly(e,t){return e.byteLength===t.byteLength&&l_(new Uint8Array(e),new Uint8Array(t))}function lk(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function lb(e,t){return e.byteLength===t.byteLength&&l_(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function lv(e,t){return lf(e.getTime(),t.getTime())}function lx(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function lw(e,t){return e===t}function lC(e,t,n){let r,i,o=e.size;if(o!==t.size)return!1;if(!o)return!0;let s=Array(o),l=e.entries(),a=0;for(;(r=l.next())&&!r.done;){let o=t.entries(),l=!1,c=0;for(;(i=o.next())&&!i.done;){if(s[c]){c++;continue}let o=r.value,d=i.value;if(n.equals(o[0],d[0],a,c,e,t,n)&&n.equals(o[1],d[1],o[0],d[0],e,t,n)){l=s[c]=!0;break}c++}if(!l)return!1;a++}return!0}function lS(e,t,n){let r=lg(e),i=r.length;if(lg(t).length!==i)return!1;for(;i-- >0;)if(!lN(e,t,n,r[i]))return!1;return!0}function lM(e,t,n){let r,i,o,s=lh(e),l=s.length;if(lh(t).length!==l)return!1;for(;l-- >0;)if(!lN(e,t,n,r=s[l])||(i=lm(e,r),o=lm(t,r),(i||o)&&(!i||!o||i.configurable!==o.configurable||i.enumerable!==o.enumerable||i.writable!==o.writable)))return!1;return!0}function lE(e,t){return lf(e.valueOf(),t.valueOf())}function lA(e,t){return e.source===t.source&&e.flags===t.flags}function lD(e,t,n){let r,i,o=e.size;if(o!==t.size)return!1;if(!o)return!0;let s=Array(o),l=e.values();for(;(r=l.next())&&!r.done;){let o=t.values(),l=!1,a=0;for(;(i=o.next())&&!i.done;){if(!s[a]&&n.equals(r.value,i.value,r.value,i.value,e,t,n)){l=s[a]=!0;break}a++}if(!l)return!1}return!0}function l_(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function lT(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function lN(e,t,n,r){return("_owner"===r||"__o"===r||"__v"===r)&&(!!e.$$typeof||!!t.$$typeof)||lp(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}let lO={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},lR=Object.prototype.toString,lF=lI();function lI(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,o=function({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:o,areMapsEqual:s,areNumbersEqual:l,areObjectsEqual:a,arePrimitiveWrappersEqual:c,areRegExpsEqual:d,areSetsEqual:u,areTypedArraysEqual:h,areUrlsEqual:p,unknownTagComparators:f}){return function(m,g,y){if(m===g)return!0;if(null==m||null==g)return!1;let k=typeof m;if(k!==typeof g)return!1;if("object"!==k)return"number"===k?l(m,g,y):"function"===k&&o(m,g,y);let b=m.constructor;if(b!==g.constructor)return!1;if(b===Object)return a(m,g,y);if(Array.isArray(m))return t(m,g,y);if(b===Date)return r(m,g,y);if(b===RegExp)return d(m,g,y);if(b===Map)return s(m,g,y);if(b===Set)return u(m,g,y);let v=lR.call(m);if("[object Date]"===v)return r(m,g,y);if("[object RegExp]"===v)return d(m,g,y);if("[object Map]"===v)return s(m,g,y);if("[object Set]"===v)return u(m,g,y);if("[object Object]"===v)return"function"!=typeof m.then&&"function"!=typeof g.then&&a(m,g,y);if("[object URL]"===v)return p(m,g,y);if("[object Error]"===v)return i(m,g,y);if("[object Arguments]"===v)return a(m,g,y);if(lO[v])return h(m,g,y);if("[object ArrayBuffer]"===v)return e(m,g,y);if("[object DataView]"===v)return n(m,g,y);if("[object Boolean]"===v||"[object Number]"===v||"[object String]"===v)return c(m,g,y);if(f){let e=f[v];if(!e){let t=null!=m?m[Symbol.toStringTag]:void 0;t&&(e=f[t])}if(e)return e(m,g,y)}return!1}}(function({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:ly,areArraysEqual:n?lM:lk,areDataViewsEqual:lb,areDatesEqual:lv,areErrorsEqual:lx,areFunctionsEqual:lw,areMapsEqual:n?ld(lC,lM):lC,areNumbersEqual:lf,areObjectsEqual:n?lM:lS,arePrimitiveWrappersEqual:lE,areRegExpsEqual:lA,areSetsEqual:n?ld(lD,lM):lD,areTypedArraysEqual:n?ld(l_,lM):l_,areUrlsEqual:lT,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=lu(r.areArraysEqual),t=lu(r.areMapsEqual),n=lu(r.areObjectsEqual),i=lu(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}(e)),s=n?n(o):function(e,t,n,r,i,s,l){return o(e,t,l)};return function({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(o,s){let{cache:l=e?new WeakMap:void 0,meta:a}=n();return t(o,s,{cache:l,equals:r,meta:a,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let o={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,o)}}({circular:t,comparator:o,createState:r,equals:s,strict:i})}lI({strict:!0}),lI({circular:!0}),lI({circular:!0,strict:!0}),lI({createInternalComparator:()=>lf}),lI({strict:!0,createInternalComparator:()=>lf}),lI({circular:!0,createInternalComparator:()=>lf}),lI({circular:!0,createInternalComparator:()=>lf,strict:!0});var lL=e.i(30224),lz=({contentComponent:e})=>{let t=(0,T.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,f.jsx)(f.Fragment,{children:Object.values(t)})},lj=class extends D.default.Component{constructor(e){var t;super(e),this.editorContentRef=D.default.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(null==(t=e.editor)?void 0:t.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var e;let t=this.props.editor;if(t&&!t.isDestroyed&&(null==(e=t.view.dom)?void 0:e.parentNode)){let e,n;if(t.contentComponent)return;let r=this.editorContentRef.current;r.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:r}),e=new Set,n={},t.contentComponent={subscribe:t=>(e.add(t),()=>{e.delete(t)}),getSnapshot:()=>n,getServerSnapshot:()=>n,setRenderer(t,r){n={...n,[t]:_.default.createPortal(r.reactElement,r.element,t)},e.forEach(e=>e())},removeRenderer(t){let r={...n};delete r[t],n=r,e.forEach(e=>e())}},this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=t.contentComponent.subscribe(()=>{this.setState(e=>e.hasContentComponentInitialized?e:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),t.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var e;let t=this.props.editor;if(t){this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null;try{if(!(null==(e=t.view.dom)?void 0:e.parentNode))return;let n=document.createElement("div");n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{ref:((...e)=>t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})})(t,this.editorContentRef),...n}),(null==e?void 0:e.contentComponent)&&(0,f.jsx)(lz,{contentComponent:e.contentComponent})]})}},lB=(0,D.forwardRef)((e,t)=>{let n=D.default.useMemo(()=>Math.floor(0xffffffff*Math.random()).toString(),[e.editor]);return D.default.createElement(lj,{key:n,innerRef:t,...e})}),lP=D.default.memo(lB),l$="u">typeof window?D.useLayoutEffect:D.useEffect,lq=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}},lV="u"<typeof window,lH=lV||!!("u">typeof window&&window.next),lW=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){return void 0===this.options.current.immediatelyRender?lV||lH?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender)?this.createEditor():null}createEditor(){return new sX({...this.options.current,onBeforeCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBeforeCreate)?void 0:n.call(t,...e)},onBlur:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBlur)?void 0:n.call(t,...e)},onCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onCreate)?void 0:n.call(t,...e)},onDestroy:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDestroy)?void 0:n.call(t,...e)},onFocus:(...e)=>{var t,n;return null==(n=(t=this.options.current).onFocus)?void 0:n.call(t,...e)},onSelectionUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onSelectionUpdate)?void 0:n.call(t,...e)},onTransaction:(...e)=>{var t,n;return null==(n=(t=this.options.current).onTransaction)?void 0:n.call(t,...e)},onUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onUpdate)?void 0:n.call(t,...e)},onContentError:(...e)=>{var t,n;return null==(n=(t=this.options.current).onContentError)?void 0:n.call(t,...e)},onDrop:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDrop)?void 0:n.call(t,...e)},onPaste:(...e)=>{var t,n;return null==(n=(t=this.options.current).onPaste)?void 0:n.call(t,...e)},onDelete:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDelete)?void 0:n.call(t,...e)}})}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)||("extensions"===n&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every((e,n)=>{var r;return e===(null==(r=t.extensions)?void 0:r[n])}):e[n]===t[n]))}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===t.length?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function lU(e={},t=[]){let n=(0,D.useRef)(e);n.current=e;let[r]=(0,D.useState)(()=>new lW(n)),i=(0,T.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,D.useDebugValue)(i),(0,D.useEffect)(r.onRender(t)),!function(e){var t;let[n]=(0,D.useState)(()=>new lq(e.editor)),r=(0,lL.useSyncExternalStoreWithSelector)(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,null!=(t=e.equalityFn)?t:lF);l$(()=>n.watch(e.editor),[e.editor,n]),(0,D.useDebugValue)(r)}({editor:i,selector:({transactionNumber:t})=>!1===e.shouldRerenderOnTransaction||void 0===e.shouldRerenderOnTransaction?null:e.immediatelyRender&&0===t?0:t+1}),i}var lK=(0,D.createContext)({editor:null});lK.Consumer;var lJ=(0,D.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}});D.default.forwardRef((e,t)=>{let{onDragStart:n}=(0,D.useContext)(lJ),r=e.as||"div";return(0,f.jsx)(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})}),D.default.createContext({markViewContentRef:()=>{}});var lG=(0,D.createContext)({get editor(){throw Error("useTiptap must be used within a <Tiptap> provider")}});function lZ({editor:e,instance:t,children:n}){let r=null!=e?e:t;if(!r)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let i=(0,D.useMemo)(()=>({editor:r}),[r]),o=(0,D.useMemo)(()=>({editor:r}),[r]);return(0,f.jsx)(lK.Provider,{value:o,children:(0,f.jsx)(lG.Provider,{value:i,children:n})})}function lX({...e}){let{editor:t}=(0,D.useContext)(lG);return(0,f.jsx)(lP,{editor:t,...e})}lG.displayName="TiptapContext",lZ.displayName="Tiptap",lX.displayName="Tiptap.Content",Object.assign(lZ,{Content:lX}),e.s(["EditorContent",()=>lP,"useEditor",()=>lU],94499);var lQ=(e,t)=>{if("slot"===e)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=null!=t?t:{};if("svg"===e)throw Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[e,r,n]},lY=/^\s*>\s$/,l0=li.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return lQ("blockquote",{...oV(this.options.HTMLAttributes,e),children:lQ("slot",{})})},parseMarkdown:(e,t)=>t.createNode("blockquote",void 0,t.parseChildren(e.tokens||[])),renderMarkdown:(e,t)=>{if(!e.content)return"";let n=[];return e.content.forEach(e=>{let r=t.renderChildren([e]).split("\n").map(e=>""===e.trim()?">":`> ${e}`);n.push(r.join("\n"))}),n.join(`
|
|
80
|
+
>
|
|
81
|
+
`)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[s1({find:lY,type:this.type})]}}),l1=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,l2=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,l3=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,l5=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,l4=sO.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return lQ("strong",{...oV(this.options.HTMLAttributes,e),children:lQ("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[sQ({find:l1,type:this.type}),sQ({find:l3,type:this.type})]},addPasteRules(){return[ls({find:l2,type:this.type}),ls({find:l5,type:this.type})]}}),l6=/(^|[^`])`([^`]+)`(?!`)$/,l9=/(^|[^`])`([^`]+)`(?!`)/g,l8=sO.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",oV(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[sQ({find:l6,type:this.type})]},addPasteRules(){return[ls({find:l9,type:this.type})]}}),l7=/^```([a-z]+)?[\s\n]$/,ae=/^~~~([a-z]+)?[\s\n]$/,at=li.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;let{languageClassPrefix:n}=this.options;if(!n)return null;let r=[...(null==(t=e.firstElementChild)?void 0:t.classList)||[]].filter(e=>e.startsWith(n)).map(e=>e.replace(n,""))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",oV(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(e,t)=>{var n;return(null==(n=e.raw)?void 0:n.startsWith("```"))===!1&&"indented"!==e.codeBlockStyle?[]:t.createNode("codeBlock",{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[])},renderMarkdown:(e,t)=>{var n;let r=(null==(n=e.attrs)?void 0:n.language)||"";return e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join("\n"):`\`\`\`${r}
|
|
82
|
+
|
|
83
|
+
\`\`\``},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!!e&&t.parent.type.name===this.name&&(!!n||!t.parent.textContent.length)&&this.editor.commands.clearNodes()},Tab:({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;let n=null!=(t=this.options.tabSize)?t:4,{state:r}=e,{selection:i}=r,{$from:o,empty:s}=i;if(o.parent.type!==this.type)return!1;let l=" ".repeat(n);return s?e.commands.insertContent(l):e.commands.command(({tr:e})=>{let{from:t,to:n}=i,o=r.doc.textBetween(t,n,"\n","\n").split("\n").map(e=>l+e).join("\n");return e.replaceWith(t,n,r.schema.text(o)),!0})},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;let n=null!=(t=this.options.tabSize)?t:4,{state:r}=e,{selection:i}=r,{$from:o,empty:s}=i;return o.parent.type===this.type&&(s?e.commands.command(({tr:e})=>{var t;let{pos:i}=o,s=o.start(),l=o.end(),a=r.doc.textBetween(s,l,"\n","\n").split("\n"),c=0,d=0,u=i-s;for(let e=0;e<a.length;e+=1){if(d+a[e].length>=u){c=e;break}d+=a[e].length+1}let h=Math.min(((null==(t=a[c].match(/^ */))?void 0:t[0])||"").length,n);if(0===h)return!0;let p=s;for(let e=0;e<c;e+=1)p+=a[e].length+1;return e.delete(p,p+h),i-p<=h&&e.setSelection(ts.create(e.doc,p)),!0}):e.commands.command(({tr:e})=>{let{from:t,to:o}=i,s=r.doc.textBetween(t,o,"\n","\n").split("\n").map(e=>{var t;let r=Math.min(((null==(t=e.match(/^ */))?void 0:t[0])||"").length,n);return e.slice(r)}).join("\n");return e.replaceWith(t,o,r.schema.text(s)),!0}))},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith("\n\n");return!!o&&!!s&&e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let s=i.after();return void 0!==s&&(r.nodeAt(s)?e.commands.command(({tr:e})=>(e.setSelection(tn.near(r.resolve(s))),!0)):e.commands.exitCode())}}},addInputRules(){return[s0({find:l7,type:this.type,getAttributes:e=>({language:e[1]})}),s0({find:ae,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new tv({key:new tC("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=null==i?void 0:i.mode;if(!n||!o)return!1;let{tr:s,schema:l}=e.state,a=l.text(n.replace(/\r\n?/g,"\n"));return s.replaceSelectionWith(this.type.create({language:o},a)),s.selection.$from.parent.type!==this.type&&s.setSelection(ts.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),an=li.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n\n"):""}),ar=li.create({name:"hardBreak",markdownTokenName:"br",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",oV(this.options.HTMLAttributes,e)]},renderText:()=>"\n",renderMarkdown:()=>`
|
|
84
|
+
`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:o}=this.options,{splittableMarks:s}=r.extensionManager,l=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&l&&o){let t=l.filter(e=>s.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),ai=li.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){let n=this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0];return[`h${n}`,oV(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{var n;let r=(null==(n=e.attrs)?void 0:n.level)?parseInt(e.attrs.level,10):1,i="#".repeat(r);return e.content?`${i} ${t.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,...{[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}}),{})},addInputRules(){return this.options.levels.map(e=>s0({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),ao=li.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{},nextNodeType:"paragraph"}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",oV(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!s2(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return se(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(ts.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(ta.create(t.doc,n.pos)):t.setSelection(ts.create(t.doc,n.pos));else{let i=e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType,o=null==i?void 0:i.create();o&&(t.insert(r,o),t.setSelection(ts.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[sY({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),as=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,al=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,aa=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,ac=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,ad=sO.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",oV(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(e,t)=>t.applyMark("italic",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[sQ({find:as,type:this.type}),sQ({find:aa,type:this.type})]},addPasteRules(){return[ls({find:al,type:this.type}),ls({find:ac,type:this.type})]}});let au="numeric",ah="ascii",ap="alpha",af="asciinumeric",am="alphanumeric",ag="domain",ay="emoji",ak="whitespace";function ab(e,t,n){for(let r in t[au]&&(t[af]=!0,t[am]=!0),t[ah]&&(t[af]=!0,t[ap]=!0),t[af]&&(t[am]=!0),t[ap]&&(t[am]=!0),t[am]&&(t[ag]=!0),t[ay]&&(t[ag]=!0),t){let t=(r in n||(n[r]=[]),n[r]);0>t.indexOf(e)&&t.push(e)}}function av(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}av.groups={},av.prototype={accepts(){return!!this.t},go(e){let t=this.j[e];if(t)return t;for(let t=0;t<this.jr.length;t++){let n=this.jr[t][0],r=this.jr[t][1];if(r&&n.test(e))return r}return this.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){let i;return r=r||av.groups,t&&t.j?i=t:(i=new av(t),n&&r&&ab(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,o=e.length;if(!o)return i;for(let t=0;t<o-1;t++)i=i.tt(e[t]);return i.tt(e[o-1],t,n,r)},tt(e,t,n,r){if(r=r||av.groups,t&&t.j)return this.j[e]=t,t;let i,o=this.go(e);return o?(Object.assign((i=new av).j,o.j),i.jr.push.apply(i.jr,o.jr),i.jd=o.jd,i.t=o.t):i=new av,t&&(r&&(i.t&&"string"==typeof i.t?ab(t,Object.assign(function(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}(i.t,r),n),r):n&&ab(t,n,r)),i.t=t),this.j[e]=i,i}};let ax=(e,t,n,r,i)=>e.ta(t,n,r,i),aw=(e,t,n,r,i)=>e.tr(t,n,r,i),aC=(e,t,n,r,i)=>e.ts(t,n,r,i),aS=(e,t,n,r,i)=>e.tt(t,n,r,i),aM="WORD",aE="UWORD",aA="ASCIINUMERICAL",aD="ALPHANUMERICAL",a_="LOCALHOST",aT="UTLD",aN="SCHEME",aO="SLASH_SCHEME",aR="OPENBRACE",aF="CLOSEBRACE",aI="OPENBRACKET",aL="CLOSEBRACKET",az="OPENPAREN",aj="CLOSEPAREN",aB="OPENANGLEBRACKET",aP="CLOSEANGLEBRACKET",a$="FULLWIDTHLEFTPAREN",aq="FULLWIDTHRIGHTPAREN",aV="LEFTCORNERBRACKET",aH="RIGHTCORNERBRACKET",aW="LEFTWHITECORNERBRACKET",aU="RIGHTWHITECORNERBRACKET",aK="FULLWIDTHLESSTHAN",aJ="FULLWIDTHGREATERTHAN",aG="AMPERSAND",aZ="APOSTROPHE",aX="ASTERISK",aQ="BACKSLASH",aY="BACKTICK",a0="CARET",a1="COLON",a2="COMMA",a3="DOLLAR",a5="EQUALS",a4="EXCLAMATION",a6="HYPHEN",a9="PERCENT",a8="PIPE",a7="PLUS",ce="POUND",ct="QUERY",cn="QUOTE",cr="FULLWIDTHMIDDLEDOT",ci="SEMI",co="SLASH",cs="TILDE",cl="UNDERSCORE",ca="EMOJI";var cc=Object.freeze({__proto__:null,ALPHANUMERICAL:aD,AMPERSAND:aG,APOSTROPHE:aZ,ASCIINUMERICAL:aA,ASTERISK:aX,AT:"AT",BACKSLASH:aQ,BACKTICK:aY,CARET:a0,CLOSEANGLEBRACKET:aP,CLOSEBRACE:aF,CLOSEBRACKET:aL,CLOSEPAREN:aj,COLON:a1,COMMA:a2,DOLLAR:a3,DOT:"DOT",EMOJI:ca,EQUALS:a5,EXCLAMATION:a4,FULLWIDTHGREATERTHAN:aJ,FULLWIDTHLEFTPAREN:a$,FULLWIDTHLESSTHAN:aK,FULLWIDTHMIDDLEDOT:cr,FULLWIDTHRIGHTPAREN:aq,HYPHEN:a6,LEFTCORNERBRACKET:aV,LEFTWHITECORNERBRACKET:aW,LOCALHOST:a_,NL:"NL",NUM:"NUM",OPENANGLEBRACKET:aB,OPENBRACE:aR,OPENBRACKET:aI,OPENPAREN:az,PERCENT:a9,PIPE:a8,PLUS:a7,POUND:ce,QUERY:ct,QUOTE:cn,RIGHTCORNERBRACKET:aH,RIGHTWHITECORNERBRACKET:aU,SCHEME:aN,SEMI:ci,SLASH:co,SLASH_SCHEME:aO,SYM:"SYM",TILDE:cs,TLD:"TLD",UNDERSCORE:cl,UTLD:aT,UWORD:aE,WORD:aM,WS:"WS"});let cd=/[a-z]/,cu=/\p{L}/u,ch=/\p{Emoji}/u,cp=/\d/,cf=/\s/,cm=null,cg=null;function cy(e,t){let n=function(e){let t=[],n=e.length,r=0;for(;r<n;){let i,o=e.charCodeAt(r),s=o<55296||o>56319||r+1===n||(i=e.charCodeAt(r+1))<56320||i>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],o=0,s=0;for(;s<r;){let l=e,a=null,c=0,d=null,u=-1,h=-1;for(;s<r&&(a=l.go(n[s]));)(l=a).accepts()?(u=0,h=0,d=l):u>=0&&(u+=n[s].length,h++),c+=n[s].length,o+=n[s].length,s++;o-=u,s-=h,c-=u,i.push({t:d.t,v:t.slice(o-c,o),s:o-c,e:o})}return i}function ck(e,t,n,r,i){let o,s=t.length;for(let n=0;n<s-1;n++){let s=t[n];e.j[s]?o=e.j[s]:((o=new av(r)).jr=i.slice(),e.j[s]=o),e=o}return(o=new av(n)).jr=i.slice(),e.j[t[s-1]]=o,o}function cb(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;"0123456789".indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(""));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}let cv={defaultProtocol:"http",events:null,format:cw,formatHref:cw,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function cx(e,t=null){let n=Object.assign({},cv);e&&(n=Object.assign(n,e instanceof cx?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}function cw(e){return e}function cC(e,t){this.t="token",this.v=e,this.tk=t}function cS(e,t){class n extends cC{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}cx.prototype={o:cv,ignoreTags:[],defaultRender:e=>e,check(e){return this.get("validate",e.toString(),e)},get(e,t,n){let r=null!=t,i=this.o[e];return i&&("object"==typeof i?"function"==typeof(i=n.t in i?i[n.t]:cv[e])&&r&&(i=i(t,n)):"function"==typeof i&&r&&(i=i(t,n.t,n))),i},getObj(e,t,n){let r=this.o[e];return"function"==typeof r&&null!=t&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}},cC.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=cv.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){let t=this.toHref(e.get("defaultProtocol")),n=e.get("formatHref",t,this),r=e.get("tagName",t,this),i=this.toFormattedString(e),o={},s=e.get("className",t,this),l=e.get("target",t,this),a=e.get("rel",t,this),c=e.getObj("attributes",t,this),d=e.getObj("events",t,this);return o.href=n,s&&(o.class=s),l&&(o.target=l),a&&(o.rel=a),c&&Object.assign(o,c),{tagName:r,attributes:o,content:i,eventListeners:d}}};let cM=cS("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),cE=cS("text"),cA=cS("nl"),cD=cS("url",{isLink:!0,toHref(e=cv.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==a_&&e[1].t===a1}}),c_=e=>new av(e);function cT(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}let cN="u">typeof console&&console&&console.warn||(()=>{}),cO={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function cR(e,t=!1){if(cO.initialized&&cN(`linkifyjs: already initialized - will not register custom scheme "${e}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
|
|
85
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
86
|
+
2. Cannot start or end with "-"
|
|
87
|
+
3. "-" cannot repeat`);cO.customSchemes.push([e,t])}function cF(e){return cO.initialized||function(){cO.scanner=function(e=[]){let t={};av.groups=t;let n=new av;null==cm&&(cm=cb("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==cg&&(cg=cb("ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2")),aS(n,"'",aZ),aS(n,"{",aR),aS(n,"}",aF),aS(n,"[",aI),aS(n,"]",aL),aS(n,"(",az),aS(n,")",aj),aS(n,"<",aB),aS(n,">",aP),aS(n,"(",a$),aS(n,")",aq),aS(n,"「",aV),aS(n,"」",aH),aS(n,"『",aW),aS(n,"』",aU),aS(n,"<",aK),aS(n,">",aJ),aS(n,"&",aG),aS(n,"*",aX),aS(n,"@","AT"),aS(n,"`",aY),aS(n,"^",a0),aS(n,":",a1),aS(n,",",a2),aS(n,"$",a3),aS(n,".","DOT"),aS(n,"=",a5),aS(n,"!",a4),aS(n,"-",a6),aS(n,"%",a9),aS(n,"|",a8),aS(n,"+",a7),aS(n,"#",ce),aS(n,"?",ct),aS(n,'"',cn),aS(n,"/",co),aS(n,";",ci),aS(n,"~",cs),aS(n,"_",cl),aS(n,"\\",aQ),aS(n,"・",cr);let r=aw(n,cp,"NUM",{[au]:!0});aw(r,cp,r);let i=aw(r,cd,aA,{[af]:!0}),o=aw(r,cu,aD,{[am]:!0}),s=aw(n,cd,aM,{[ah]:!0});aw(s,cp,i),aw(s,cd,s),aw(i,cp,i),aw(i,cd,i);let l=aw(n,cu,aE,{[ap]:!0});aw(l,cd),aw(l,cp,o),aw(l,cu,l),aw(o,cp,o),aw(o,cd),aw(o,cu,o);let a=aS(n,"\n","NL",{[ak]:!0}),c=aS(n,"\r","WS",{[ak]:!0}),d=aw(n,cf,"WS",{[ak]:!0});aS(n,"",d),aS(c,"\n",a),aS(c,"",d),aw(c,cf,d),aS(d,"\r"),aS(d,"\n"),aw(d,cf,d),aS(d,"",d);let u=aw(n,ch,ca,{[ay]:!0});aS(u,"#"),aw(u,ch,u),aS(u,"️",u);let h=aS(u,"");aS(h,"#"),aw(h,ch,u);let p=[[cd,s],[cp,i]],f=[[cd,null],[cu,l],[cp,o]];for(let e=0;e<cm.length;e++)ck(n,cm[e],"TLD",aM,p);for(let e=0;e<cg.length;e++)ck(n,cg[e],aT,aE,f);ab("TLD",{tld:!0,ascii:!0},t),ab(aT,{utld:!0,alpha:!0},t),ck(n,"file",aN,aM,p),ck(n,"mailto",aN,aM,p),ck(n,"http",aO,aM,p),ck(n,"https",aO,aM,p),ck(n,"ftp",aO,aM,p),ck(n,"ftps",aO,aM,p),ab(aN,{scheme:!0,ascii:!0},t),ab(aO,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{scheme:!0}:{slashscheme:!0};r.indexOf("-")>=0?i[ag]=!0:cd.test(r)?cp.test(r)?i[af]=!0:i[ah]=!0:i[au]=!0,aC(n,r,r,i)}return aC(n,"localhost",a_,{ascii:!0}),n.jd=new av("SYM"),{start:n,tokens:Object.assign({groups:t},cc)}}(cO.customSchemes);for(let e=0;e<cO.tokenQueue.length;e++)cO.tokenQueue[e][1]({scanner:cO.scanner});cO.parser=function({groups:e}){let t=e.domain.concat([aG,aX,"AT",aQ,aY,a0,a3,a5,a6,"NUM",a9,a8,a7,ce,co,"SYM",cs,cl]),n=[aZ,a1,a2,"DOT",a4,a9,ct,cn,ci,aB,aP,aR,aF,aL,aI,az,aj,a$,aq,aV,aH,aW,aU,aK,aJ],r=[aG,aZ,aX,aQ,aY,a0,a3,a5,a6,aR,aF,a9,a8,a7,ce,ct,co,"SYM",cs,cl],i=c_(),o=aS(i,cs);ax(o,r,o),ax(o,e.domain,o);let s=c_(),l=c_(),a=c_();ax(i,e.domain,s),ax(i,e.scheme,l),ax(i,e.slashscheme,a),ax(s,r,o),ax(s,e.domain,s);let c=aS(s,"AT");aS(o,"AT",c),aS(l,"AT",c),aS(a,"AT",c);let d=aS(o,"DOT");ax(d,r,o),ax(d,e.domain,o);let u=c_();ax(c,e.domain,u),ax(u,e.domain,u);let h=aS(u,"DOT");ax(h,e.domain,u);let p=c_(cM);ax(h,e.tld,p),ax(h,e.utld,p),aS(c,a_,p);let f=aS(u,a6);aS(f,a6,f),ax(f,e.domain,u),ax(p,e.domain,u),aS(p,"DOT",h),aS(p,a6,f),ax(aS(p,a1),e.numeric,cM);let m=aS(s,a6),g=aS(s,"DOT");aS(m,a6,m),ax(m,e.domain,s),ax(g,r,o),ax(g,e.domain,s);let y=c_(cD);ax(g,e.tld,y),ax(g,e.utld,y),ax(y,e.domain,s),ax(y,r,o),aS(y,"DOT",g),aS(y,a6,m),aS(y,"AT",c);let k=aS(y,a1),b=c_(cD);ax(k,e.numeric,b);let v=c_(cD),x=c_();ax(v,t,v),ax(v,n,x),ax(x,t,v),ax(x,n,x),aS(y,co,v),aS(b,co,v);let w=aS(l,a1),C=aS(a,a1),S=aS(C,co),M=aS(S,co);ax(l,e.domain,s),aS(l,"DOT",g),aS(l,a6,m),ax(a,e.domain,s),aS(a,"DOT",g),aS(a,a6,m),ax(w,e.domain,v),aS(w,co,v),aS(w,ct,v),ax(M,e.domain,v),ax(M,t,v),aS(M,co,v);let E=[[aR,aF],[aI,aL],[az,aj],[aB,aP],[a$,aq],[aV,aH],[aW,aU],[aK,aJ]];for(let e=0;e<E.length;e++){let[r,i]=E[e],o=aS(v,r);aS(x,r,o),aS(o,i,v);let s=c_(cD);ax(o,t,s);let l=c_();ax(o,n),ax(s,t,s),ax(s,n,l),ax(l,t,s),ax(l,n,l),aS(s,i,v),aS(l,i,v)}return aS(i,a_,y),aS(i,"NL",cA),{start:i,tokens:cc}}(cO.scanner.tokens);for(let e=0;e<cO.pluginQueue.length;e++)cO.pluginQueue[e][1]({scanner:cO.scanner,parser:cO.parser});cO.initialized=!0}(),function(e,t,n){let r=n.length,i=0,o=[],s=[];for(;i<r;){let l=e,a=null,c=null,d=0,u=null,h=-1;for(;i<r&&!(a=l.go(n[i].t));)s.push(n[i++]);for(;i<r&&(c=a||l.go(n[i].t));)a=null,(l=c).accepts()?(h=0,u=l):h>=0&&h++,i++,d++;if(h<0)(i-=d)<r&&(s.push(n[i]),i++);else{s.length>0&&(o.push(cT(cE,t,s)),s=[]),i-=h,d-=h;let e=u.t,r=n.slice(i-d,i);o.push(cT(e,t,r))}}return s.length>0&&o.push(cT(cE,t,s)),o}(cO.parser.start,e,cy(cO.scanner.start,e))}function cI(e,t=null,n=null){if(t&&"object"==typeof t){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new cx(n),i=cF(e),o=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&o.push(n.toFormattedObject(r))}return o}cF.scan=cy;var cL="[\0- -\u2029 ]",cz=new RegExp(cL),cj=RegExp(`${cL}$`),cB=RegExp(cL,"g");function cP(e,t){let n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(e=>{let t="string"==typeof e?e:e.scheme;t&&n.push(t)}),!e||e.replace(cB,"").match(RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var c$=sO.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{"string"==typeof e?cR(e):cR(e.scheme,e.optionalSlashes)})},onDestroy(){av.groups={},cO.scanner=null,cO.parser=null,cO.tokenQueue=[],cO.pluginQueue=[],cO.customSchemes=[],cO.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!cP(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes("@"))return!0;let r=(e.includes("@")?e.split("@").pop():e).split(/[/?#:]/)[0];return!/^\d{1,3}(\.\d{1,3}){3}$/.test(r)&&!!/\./.test(r)}}),addAttributes(){return{href:{default:null,parseHTML:e=>e.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{let t=e.getAttribute("href");return!!t&&!!this.options.isAllowedUri(t,{defaultValidate:e=>!!cP(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!cP(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",oV(this.options.HTMLAttributes,e),0]:["a",oV(this.options.HTMLAttributes,{...e,href:""}),0]},markdownTokenName:"link",parseMarkdown:(e,t)=>t.applyMark("link",t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{var n,r,i,o;let s=null!=(r=null==(n=e.attrs)?void 0:n.href)?r:"",l=null!=(o=null==(i=e.attrs)?void 0:i.title)?o:"",a=t.renderChildren(e);return l?`[${a}](${s} "${l}")`:`[${a}](${s})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return!!this.options.isAllowedUri(n,{defaultValidate:e=>!!cP(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&t().setMark(this.name,e).setMeta("preventAutolink",!0).run()},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return(!n||!!this.options.isAllowedUri(n,{defaultValidate:e=>!!cP(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[ls({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=cI(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!cP(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>{var t;return{href:null==(t=e.data)?void 0:t.href}}})]},addProseMirrorPlugins(){var e,t,n;let r=[],{protocols:i,defaultProtocol:o}=this.options;return this.options.autolink&&r.push((e={type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!cP(e,i),protocols:i,defaultProtocol:o}),shouldAutoLink:this.options.shouldAutoLink},new tv({key:new tC("autolink"),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),o=t.some(e=>e.getMeta("preventAutolink"));if(!i||o)return;let{tr:s}=r;if(oY(oR(n.doc,[...t])).forEach(({newRange:t})=>{let n,i,o=oF(r.doc,t,e=>e.isTextblock);if(o.length>1)n=o[0],i=r.doc.textBetween(n.pos,n.pos+n.node.nodeSize,void 0," ");else if(o.length){let e=r.doc.textBetween(t.from,t.to," "," ");if(!cj.test(e))return;n=o[0],i=r.doc.textBetween(n.pos,t.to,void 0," ")}if(n&&i){let t=i.split(cz).filter(Boolean);if(t.length<=0)return!1;let o=t[t.length-1],l=n.pos+i.lastIndexOf(o);if(!o)return!1;let a=cF(o).map(t=>t.toObject(e.defaultProtocol));if(!(1===a.length?a[0].isLink:3===a.length&&!!a[1].isLink&&["()","[]"].includes(a[0].value+a[2].value)))return!1;a.filter(e=>e.isLink).map(e=>({...e,from:l+e.start+1,to:l+e.end+1})).filter(e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{o0(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||s.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),s.steps.length)return s}}))),r.push((t={type:this.type,editor:this.editor,openOnClick:"whenNotEditable"===this.options.openOnClick||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection},new tv({key:new tC("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,o;if(0!==r.button||!e.editable)return!1;let s=null;if(r.target instanceof HTMLAnchorElement)s=r.target;else{let e=r.target;if(!e)return!1;let n=t.editor.view.dom;(s=e.closest("a"))&&!n.contains(s)&&(s=null)}if(!s)return!1;let l=!1;if(t.enableClickSelection&&(l=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){let n=oQ(e.state,t.type.name),r=null!=(i=s.href)?i:n.href,a=null!=(o=s.target)?o:n.target;r&&(window.open(r,a),l=!0)}return l}}}))),this.options.linkOnPaste&&r.push((n={editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink},new tv({key:new tC("handlePasteLink"),props:{handlePaste:(e,t,r)=>{let{shouldAutoLink:i}=n,{state:o}=e,{selection:s}=o,{empty:l}=s;if(l)return!1;let a="";r.content.forEach(e=>{a+=e.textContent});let c=cI(a,{defaultProtocol:n.defaultProtocol}).find(e=>e.isLink&&e.value===a);return!!a&&!!c&&(void 0===i||!!i(c.value))&&n.editor.commands.setMark(n.type,{href:c.href})}}}))),r}}),cq=Object.defineProperty,cV="textStyle",cH=/^\s*([-+*])\s$/,cW=li.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",oV(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>"list"!==e.type||e.ordered?[]:{type:"bulletList",content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(cV)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=s1({find:cH,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=s1({find:cH,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(cV),editor:this.editor})),[e]}}),cU=li.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",oV(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,t)=>{if("list_item"!==e.type)return[];let n=[];if(e.tokens&&e.tokens.length>0)if(e.tokens.some(e=>"paragraph"===e.type))n=t.parseChildren(e.tokens);else{let r=e.tokens[0];if(r&&"text"===r.type&&r.tokens&&r.tokens.length>0){if(n=[{type:"paragraph",content:t.parseInline(r.tokens)}],e.tokens.length>1){let r=e.tokens.slice(1),i=t.parseChildren(r);n.push(...i)}}else n=t.parseChildren(e.tokens)}return 0===n.length&&(n=[{type:"paragraph",content:[]}]),{type:"listItem",content:n}},renderMarkdown:(e,t,n)=>lt(e,t,e=>{var t,n;if("bulletList"===e.parentType)return"- ";if("orderedList"===e.parentType){let r=(null==(n=null==(t=e.meta)?void 0:t.parentAttrs)?void 0:n.start)||1;return`${r+e.index}. `}return"- "},n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),cK={},cJ={findListItemPos:()=>cZ,getNextListDepth:()=>cX,handleBackspace:()=>c1,handleDelete:()=>c5,hasListBefore:()=>cQ,hasListItemAfter:()=>c4,hasListItemBefore:()=>cY,listItemHasSubList:()=>c0,nextListIsDeeper:()=>c2,nextListIsHigher:()=>c3};for(var cG in cJ)cq(cK,cG,{get:cJ[cG],enumerable:!0});var cZ=(e,t)=>{let{$from:n}=t.selection,r=iq(e,t.schema),i=n.depth,o=n.pos,s=null;for(;i>0&&null===s;)n.node(i).type===r?s=i:(i-=1,o-=1);return null===s?null:{$pos:t.doc.resolve(o),depth:s}},cX=(e,t)=>{let n=cZ(e,t);if(!n)return!1;let[,r]=o1(t,e,n.$pos.pos+4);return r},cQ=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),o=e.doc.resolve(i).node();return!!o&&!!n.includes(o.type.name)},cY=(e,t)=>{var n;let{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-2);return 0!==i.index()&&(null==(n=i.nodeBefore)?void 0:n.type.name)===e},c0=(e,t,n)=>{if(!n)return!1;let r=iq(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},c1=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!om(e.state,t)&&cQ(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let o=i.at(-1);if(!o)return!1;let s=e.state.doc.resolve(r.start()+o.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},s.end()).joinForward().run()}if(!om(e.state,t)||!o6(e.state))return!1;let r=cZ(t,e.state);if(!r)return!1;let i=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),o=c0(t,e.state,i);return cY(t,e.state)&&!o?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},c2=(e,t)=>{let n=cX(e,t),r=cZ(e,t);return!!r&&!!n&&n>r.depth},c3=(e,t)=>{let n=cX(e,t),r=cZ(e,t);return!!r&&!!n&&n<r.depth},c5=(e,t)=>{if(!om(e.state,t)||!o4(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!(!n.empty&&r.sameParent(i))&&(c2(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():c3(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward())},c4=(e,t)=>{var n;let{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-r.parentOffset-2);return i.index()!==i.parent.childCount-1&&(null==(n=i.nodeAfter)?void 0:n.type.name)===e},c6=sz.create({name:"listKeymap",addOptions:()=>({listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}),addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{void 0!==e.state.schema.nodes[n]&&c5(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{void 0!==e.state.schema.nodes[n]&&c5(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&c1(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&c1(e,n,r)&&(t=!0)}),t}}}}),c9=/^(\s*)(\d+)\.\s+(.*)$/,c8=/^\s/,c7="textStyle",de=/^(\d+)\.\s$/,dt=li.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return 1===t?["ol",oV(this.options.HTMLAttributes,n),0]:["ol",oV(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>{var n;if("list"!==e.type||!e.ordered)return[];let r=e.start||1,i=e.items?(n=e.items,n.map(e=>{if("list_item"!==e.type)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if("paragraph"===e.type||"list"===e.type||"blockquote"===e.type||"code"===e.type)n.push(...t.parseChildren([e]));else if("text"===e.type&&e.tokens){let r=t.parseChildren([e]);n.push({type:"paragraph",content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:"listItem",content:n}})):[];return 1!==r?{type:"orderedList",attrs:{start:r},content:i}:{type:"orderedList",content:i}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownTokenizer:{name:"orderedList",level:"block",start:e=>{let t=e.match(/^(\s*)(\d+)\.\s+/),n=null==t?void 0:t.index;return void 0!==n?n:-1},tokenize:(e,t,n)=>{var r;let i=e.split("\n"),[o,s]=function(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],o=i.match(c9);if(!o)break;let[,s,l,a]=o,c=s.length,d=a,u=n+1,h=[i];for(;u<e.length;){let t=e[u];if(t.match(c9))break;if(""===t.trim())h.push(t),d+="\n",u+=1;else if(t.match(c8))h.push(t),d+=`
|
|
88
|
+
${t.slice(c+2)}`,u+=1;else break}t.push({indent:c,number:parseInt(l,10),content:d.trim(),raw:h.join("\n")}),r=u,n=u}return[t,r]}(i);if(0===o.length)return;let l=function e(t,n,r){var i;let o=[],s=0;for(;s<t.length;){let l=t[s];if(l.indent===n){let a=l.content.split("\n"),c=(null==(i=a[0])?void 0:i.trim())||"",d=[];c&&d.push({type:"paragraph",raw:c,tokens:r.inlineTokens(c)});let u=a.slice(1).join("\n").trim();if(u){let e=r.blockTokens(u);d.push(...e)}let h=s+1,p=[];for(;h<t.length&&t[h].indent>n;)p.push(t[h]),h+=1;if(p.length>0){let t=Math.min(...p.map(e=>e.indent)),n=e(p,t,r);d.push({type:"list",ordered:!0,start:p[0].number,items:n,raw:p.map(e=>e.raw).join("\n")})}o.push({type:"list_item",raw:l.raw,tokens:d}),s=h}else s+=1}return o}(o,0,n);if(0!==l.length)return{type:"list",ordered:!0,start:(null==(r=o[0])?void 0:r.number)||1,items:l,raw:i.slice(0,s).join("\n")}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(c7)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=s1({find:de,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=s1({find:de,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(c7)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),dn=/^\s*(\[([( |x])?\])\s$/,dr=li.create({name:"taskItem",addOptions:()=>({nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute("data-checked");return""===t||"true"===t},renderHTML:e=>({"data-checked":e.checked})}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",oV(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode("paragraph",{},t.parseInline(e.tokens))):e.text?n.push(t.createNode("paragraph",{},[t.createNode("text",{text:e.text})])):n.push(t.createNode("paragraph",{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode("taskItem",{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>{var n;let r=(null==(n=e.attrs)?void 0:n.checked)?"x":" ";return lt(e,t,`- [${r}] `)},addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement("li"),o=document.createElement("label"),s=document.createElement("span"),l=document.createElement("input"),a=document.createElement("div"),c=e=>{var t,n;l.ariaLabel=(null==(n=null==(t=this.options.a11y)?void 0:t.checkboxLabel)?void 0:n.call(t,e,l.checked))||`Task item checkbox for ${e.textContent||"empty task item"}`};c(e),o.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",e=>e.preventDefault()),l.addEventListener("change",t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}let{checked:i}=t.target;r.isEditable&&"function"==typeof n&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if("number"!=typeof t)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...null==r?void 0:r.attrs,checked:i}),!0}).run(),r.isEditable||!this.options.onReadOnlyChecked||this.options.onReadOnlyChecked(e,i)||(l.checked=!l.checked)}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,l.checked=e.attrs.checked,o.append(l,s),i.append(o,a),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let d=new Set(Object.keys(t));return{dom:i,contentDOM:a,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,l.checked=e.attrs.checked,c(e);let t=oH(e,r.extensionManager.attributes),n=new Set(Object.keys(t)),o=this.options.HTMLAttributes;return d.forEach(e=>{n.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(t).forEach(([e,t])=>{null==t?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),d=n,!0}}}},addInputRules(){return[s1({find:dn,type:this.type,getAttributes:e=>({checked:"x"===e[e.length-1]})})]}}),di=li.create({name:"taskList",addOptions:()=>({itemTypeName:"taskItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",oV(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode("taskList",{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;let n=null==(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))?void 0:t.index;return void 0!==n?n:-1},tokenize(e,t,n){let r=e=>{let t=le(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}),createToken:(e,t)=>({type:"taskItem",raw:"",mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:"taskList",raw:t.raw,items:t.items}]:n.blockTokens(e)},i=le(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}),createToken:(e,t)=>({type:"taskItem",raw:"",mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});sz.create({name:"listKit",addExtensions(){let e=[];return!1!==this.options.bulletList&&e.push(cW.configure(this.options.bulletList)),!1!==this.options.listItem&&e.push(cU.configure(this.options.listItem)),!1!==this.options.listKeymap&&e.push(c6.configure(this.options.listKeymap)),!1!==this.options.orderedList&&e.push(dt.configure(this.options.orderedList)),!1!==this.options.taskItem&&e.push(dr.configure(this.options.taskItem)),!1!==this.options.taskList&&e.push(di.configure(this.options.taskList)),e}});var ds=" ",dl=li.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",oV(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(1===n.length&&"image"===n[0].type)return t.parseChildren([n[0]]);let r=t.parseInline(n);return 1===r.length&&"text"===r[0].type&&(r[0].text===ds||" "===r[0].text)?t.createNode("paragraph",void 0,[]):t.createNode("paragraph",void 0,r)},renderMarkdown:(e,t)=>{if(!e)return"";let n=Array.isArray(e.content)?e.content:[];return 0===n.length?ds:t.renderChildren(n)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),da=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,dc=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,dd=sO.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",oV(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,t)=>t.applyMark("strike",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[sQ({find:da,type:this.type})]},addPasteRules(){return[ls({find:dc,type:this.type})]}}),du=li.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),dh=sO.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",oV(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown:(e,t)=>`++${t.renderChildren(e)}++`,markdownTokenizer:{name:"underline",level:"inline",start:e=>e.indexOf("++"),tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:"underline",raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});class dp{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!=(n=t.width)?n:1,this.color=!1===t.color?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t,n=this.editorView.state.doc.resolve(this.cursorPos),r=!n.parent.inlineContent,i,o=this.editorView.dom,s=o.getBoundingClientRect(),l=s.width/o.offsetWidth,a=s.height/o.offsetHeight;if(r){let e=n.nodeBefore,t=n.nodeAfter;if(e||t){let n=this.editorView.nodeDOM(this.cursorPos-(e?e.nodeSize:0));if(n){let r=n.getBoundingClientRect(),o=e?r.bottom:r.top;e&&t&&(o=(o+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*a;i={left:r.left,right:r.right,top:o-s,bottom:o+s}}}}if(!i){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*l;i={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let c=this.editorView.dom.offsetParent;if(!this.element&&(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",r),this.element.classList.toggle("prosemirror-dropcursor-inline",!r),c&&(c!=document.body||"static"!=getComputedStyle(c).position)){let n=c.getBoundingClientRect(),r=n.width/c.offsetWidth,i=n.height/c.offsetHeight;e=n.left-c.scrollLeft*r,t=n.top-c.scrollTop*i}else e=-pageXOffset,t=-pageYOffset;this.element.style.left=(i.left-e)/l+"px",this.element.style.top=(i.top-t)/a+"px",this.element.style.width=(i.right-i.left)/l+"px",this.element.style.height=(i.bottom-i.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i="function"==typeof r?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=eQ(this.editorView.state.doc,e,this.editorView.dragging.slice);null!=t&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class df extends tn{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return df.valid(n)?new df(n):tn.near(n)}content(){return j.empty}eq(e){return e instanceof df&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for GapCursor.fromJSON");return new df(e.resolve(t.pos))}getBookmark(){return new dm(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0==n){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||dg(e.type))return!0;if(e.inlineContent)return!1}}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||dg(e.type))return!0;if(e.inlineContent)return!1}}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){r:for(;;){if(!n&&df.valid(e))return e;let r=e.pos,i=null;for(let n=e.depth;;n--){let o=e.node(n);if(t>0?e.indexAfter(n)<o.childCount:e.index(n)>0){i=o.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let s=e.doc.resolve(r);if(df.valid(s))return s}for(;;){let o=t>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!ta.isSelectable(i)){e=e.doc.resolve(r+i.nodeSize*t),n=!1;continue r}break}i=o,r+=t;let s=e.doc.resolve(r);if(df.valid(s))return s}return null}}}df.prototype.visible=!1,df.findFrom=df.findGapCursorFrom,tn.jsonID("gapcursor",df);class dm{constructor(e){this.pos=e}map(e){return new dm(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return df.valid(t)?new df(t):tn.near(t)}}function dg(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}let dy=i_({ArrowLeft:dk("horiz",-1),ArrowRight:dk("horiz",1),ArrowUp:dk("vert",-1),ArrowDown:dk("vert",1)});function dk(e,t){let n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,i){let o=e.selection,s=t>0?o.$to:o.$from,l=o.empty;if(o instanceof ts){if(!i.endOfTextblock(n)||0==s.depth)return!1;l=!1,s=e.doc.resolve(t>0?s.after():s.before())}let a=df.findGapCursorFrom(s,t,l);return!!a&&(r&&r(e.tr.setSelection(new df(a))),!0)}}function db(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!df.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&ta.isSelectable(e.state.doc.nodeAt(i.inside)))&&(e.dispatch(e.state.tr.setSelection(new df(r))),!0)}function dv(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof df))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=O.empty;for(let e=r.length-1;e>=0;e--)i=O.from(r[e].createAndFill(null,i));let o=e.state.tr.replace(n.pos,n.pos,new j(i,0,0));return o.setSelection(ts.near(o.doc.resolve(n.pos+1))),e.dispatch(o),!1}function dx(e){if(!(e.selection instanceof df))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",rY.create(e.doc,[rZ.widget(e.selection.head,t,{key:"gapcursor"})])}var dw=function(){};dw.prototype.append=function(e){return e.length?(e=dw.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},dw.prototype.prepend=function(e){return e.length?dw.from(e).append(this):this},dw.prototype.appendInner=function(e){return new dS(this,e)},dw.prototype.slice=function(e,t){return(void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t)?dw.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},dw.prototype.get=function(e){if(!(e<0)&&!(e>=this.length))return this.getInner(e)},dw.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},dw.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},dw.from=function(e){return e instanceof dw?e:e&&e.length?new dC(e):dw.empty};var dC=function(e){function t(t){e.call(this),this.values=t}t.__proto__=e,t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(!1===e(this.values[i],r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(dw);dw.empty=new dC([]);var dS=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return t.__proto__=e,t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&!1===this.left.forEachInner(e,t,Math.min(n,i),r)||n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)||n<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))return!1},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(dw);class dM{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){let n,r,i,o;if(0==this.eventCount)return null;let s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break}t&&(r=(n=this.remapping(s,this.items.length)).maps.length);let l=e.tr,a=[],c=[];return this.items.forEach((e,t)=>{if(!e.step){n||(r=(n=this.remapping(s,t+1)).maps.length),r--,c.push(e);return}if(n){c.push(new dE(e.map));let t=e.step.map(n.slice(r)),i;t&&l.maybeStep(t).doc&&(i=l.mapping.maps[l.mapping.maps.length-1],a.push(new dE(i,void 0,void 0,a.length+c.length))),r--,i&&n.appendMap(i,r)}else l.maybeStep(e.step);if(e.selection)return i=n?e.selection.map(n.slice(r)):e.selection,o=new dM(this.items.slice(0,s).append(c.reverse().concat(a)),this.eventCount-1),!1},this.items.length,0),{remaining:o,transform:l,selection:i}}addTransform(e,t,n,r){var i,o;let s,l=[],a=this.eventCount,c=this.items,d=!r&&c.length?c.get(c.length-1):null;for(let n=0;n<e.steps.length;n++){let i=e.steps[n].invert(e.docs[n]),o=new dE(e.mapping.maps[n],i,t),s;(s=d&&d.merge(o))&&(o=s,n?l.pop():c=c.slice(0,c.length-1)),l.push(o),t&&(a++,t=void 0),r||(d=o)}let u=a-n.depth;return u>dD&&(i=c,o=u,i.forEach((e,t)=>{if(e.selection&&0==o--)return s=t,!1}),c=i.slice(s),a-=u),new dM(c.append(l),a)}remapping(e,t){let n=new eT;return this.items.forEach((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(e){return 0==this.eventCount?this:new dM(this.items.append(e.map(e=>new dE(e))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},r);let l=t;this.items.forEach(t=>{let r=i.getMirror(--l);if(null==r)return;o=Math.min(o,r);let a=i.maps[r];if(t.step){let o=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(i.slice(l+1,r));c&&s++,n.push(new dE(a,o,c))}else n.push(new dE(a))},r);let a=[];for(let e=t;e<o;e++)a.push(new dE(i.maps[e]));let c=new dM(this.items.slice(0,r).append(a).append(n),s);return c.emptyItemCount()>500&&(c=c.compress(this.items.length-n.length)),c}emptyItemCount(){let e=0;return this.items.forEach(t=>{!t.step&&e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach((o,s)=>{if(s>=e)r.push(o),o.selection&&i++;else if(o.step){let e=o.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let l=o.selection&&o.selection.map(t.slice(n));l&&i++;let a=new dE(s.invert(),e,l),c,d=r.length-1;(c=r.length&&r[d].merge(a))?r[d]=c:r.push(a)}}else o.map&&n--},this.items.length,0),new dM(dw.from(r.reverse()),i)}}dM.empty=new dM(dw.empty,0);class dE{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new dE(t.getMap().invert(),t,this.selection)}}}class dA{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}let dD=20;function d_(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function dT(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}let dN=!1,dO=null;function dR(e){let t=e.plugins;if(dO!=t){dN=!1,dO=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){dN=!0;break}}return dN}let dF=new tC("history"),dI=new tC("closeHistory");function dL(e,t){return(n,r)=>{let i=dF.getState(n);if(!i||0==(e?i.undone:i.done).eventCount)return!1;if(r){let o=function(e,t,n){let r=dR(t),i=dF.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),l=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),a=new dA(n?l:o.remaining,n?o.remaining:l,null,0,-1);return o.transform.setSelection(s).setMeta(dF,{redo:n,historyState:a})}(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}let dz=dL(!1,!0),dj=dL(!0,!0);dL(!1,!1),dL(!0,!1),sz.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(e=>""!==e).length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{let t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){let e=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=(null==e?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new tv({key:new tC("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit;if(null==i||0===i){e=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let t=r.tr.deleteRange(0,o-i);return e=!0,t}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta("paste"))return!1;let o=e.selection.$head.pos;return e.deleteRange(o-(i-n),o),!(this.storage.characters({node:e.doc})>n)}})]}});var dB=sz.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[function(e={}){return new tv({view:t=>new dp(t,e)})}(this.options)]}});sz.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new tv({key:new tC("focus"),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,o=[];if(!n||!r)return rY.create(e,[]);let s=0;"deepest"===this.options.mode&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;s+=1}});let l=0;return e.descendants((e,t)=>!e.isText&&!!(i>=t&&i<=t+e.nodeSize-1)&&((l+=1,"deepest"===this.options.mode&&s-l>0||"shallowest"===this.options.mode&&l>1)?"deepest"===this.options.mode:void o.push(rZ.node(t,t+e.nodeSize,{class:this.options.className})))),rY.create(e,o)}}})]}});var dP=sz.create({name:"gapCursor",addProseMirrorPlugins:()=>[new tv({props:{decorations:dx,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&df.valid(n)?new df(n):null,handleClick:db,handleKeyDown:dy,handleDOMEvents:{beforeinput:dv}}})],extendNodeSchema(e){var t;let n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:null!=(t=oP(oL(e,"allowGapCursor",n)))?t:null}}}),d$="placeholder",dq=sz.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:d$,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){let e=this.options.dataAttribute?`data-${this.options.dataAttribute.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}`:`data-${d$}`;return[new tv({key:new tC("placeholder"),props:{decorations:({doc:t,selection:n})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,o=[];if(!r)return null;let s=this.editor.isEmpty;return t.descendants((t,n)=>{let r=i>=n&&i<=n+t.nodeSize,l=!t.isLeaf&&o7(t);if((r||!this.options.showOnlyCurrent)&&l){let i=[this.options.emptyNodeClass];s&&i.push(this.options.emptyEditorClass);let l=rZ.node(n,n+t.nodeSize,{class:i.join(" "),[e]:"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:r}):this.options.placeholder});o.push(l)}return this.options.includeChildren}),rY.create(t,o)}}})]}});function dV({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(null==t?void 0:t.type)===e}sz.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new tv({key:new tC("selection"),props:{decorations:n=>n.selection.empty||e.isFocused||!e.isEditable||se(n.selection)||e.view.dragging?null:rY.create(n.doc,[rZ.inline(n.selection.from,n.selection.to,{class:t.className})])}})]}});var dH=sz.create({name:"trailingNode",addOptions:()=>({node:void 0,notAfter:[]}),addProseMirrorPlugins(){var e;let t=new tC(this.name),n=this.options.node||(null==(e=this.editor.schema.topNodeType.contentMatch.defaultType)?void 0:e.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(n).includes(e.name));return[new tv({key:t,appendTransaction:(e,r,i)=>{let{doc:o,tr:s,schema:l}=i,a=t.getState(i),c=o.content.size,d=l.nodes[n];if(a)return s.insert(c,d.create())},state:{init:(e,t)=>!dV({node:t.tr.doc.lastChild,types:r}),apply:(e,t)=>!e.docChanged||e.getMeta("__uniqueIDTransaction")?t:!dV({node:e.doc.lastChild,types:r})}})]}}),dW=sz.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>dz(e,t),redo:()=>({state:e,dispatch:t})=>dj(e,t)}),addProseMirrorPlugins(){return[function(e={}){return new tv({key:dF,state:{init:()=>new dA(dM.empty,dM.empty,null,0,-1),apply:(t,n,r)=>(function(e,t,n,r){let i=n.getMeta(dF),o;if(i)return i.historyState;n.getMeta(dI)&&(e=new dA(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(dF))if(s.getMeta(dF).redo)return new dA(e.done.addTransform(n,void 0,r,dR(t)),e.undone,d_(n.mapping.maps),e.prevTime,e.prevComposition);else return new dA(e.done,e.undone.addTransform(n,void 0,r,dR(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))if(o=n.getMeta("rebased"))return new dA(e.done.rebased(n,o),e.undone.rebased(n,o),dT(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new dA(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),dT(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let i=n.getMeta("composition"),o=0==e.prevTime||!s&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}(n,e.prevRanges)),l=s?dT(e.prevRanges,n.mapping):d_(n.mapping.maps);return new dA(e.done.addTransform(n,o?t.selection.getBookmark():void 0,r,dR(t)),dM.empty,l,n.time,null==i?e.prevComposition:i)}})(n,r,t,e)},config:e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?dz:"historyRedo"==n?dj:null;return!!r&&!!e.editable&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),dU=sz.create({name:"starterKit",addExtensions(){var e,t,n,r;let i=[];return!1!==this.options.bold&&i.push(l4.configure(this.options.bold)),!1!==this.options.blockquote&&i.push(l0.configure(this.options.blockquote)),!1!==this.options.bulletList&&i.push(cW.configure(this.options.bulletList)),!1!==this.options.code&&i.push(l8.configure(this.options.code)),!1!==this.options.codeBlock&&i.push(at.configure(this.options.codeBlock)),!1!==this.options.document&&i.push(an.configure(this.options.document)),!1!==this.options.dropcursor&&i.push(dB.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&i.push(dP.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&i.push(ar.configure(this.options.hardBreak)),!1!==this.options.heading&&i.push(ai.configure(this.options.heading)),!1!==this.options.undoRedo&&i.push(dW.configure(this.options.undoRedo)),!1!==this.options.horizontalRule&&i.push(ao.configure(this.options.horizontalRule)),!1!==this.options.italic&&i.push(ad.configure(this.options.italic)),!1!==this.options.listItem&&i.push(cU.configure(this.options.listItem)),!1!==this.options.listKeymap&&i.push(c6.configure(null==(e=this.options)?void 0:e.listKeymap)),!1!==this.options.link&&i.push(c$.configure(null==(t=this.options)?void 0:t.link)),!1!==this.options.orderedList&&i.push(dt.configure(this.options.orderedList)),!1!==this.options.paragraph&&i.push(dl.configure(this.options.paragraph)),!1!==this.options.strike&&i.push(dd.configure(this.options.strike)),!1!==this.options.text&&i.push(du.configure(this.options.text)),!1!==this.options.underline&&i.push(dh.configure(null==(n=this.options)?void 0:n.underline)),!1!==this.options.trailingNode&&i.push(dH.configure(null==(r=this.options)?void 0:r.trailingNode)),i}});e.s(["default",()=>dU],56378),e.s(["default",()=>dq],55841);let dK={};function dJ(e,t){"string"!=typeof t&&(t=dJ.defaultChars);let n=function(e){let t=dK[e];if(t)return t;t=dK[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);t.push(n)}for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return t}(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(e){let t="";for(let r=0,i=e.length;r<i;r+=3){let o=parseInt(e.slice(r+1,r+3),16);if(o<128){t+=n[o];continue}if((224&o)==192&&r+3<i){let n=parseInt(e.slice(r+4,r+6),16);if((192&n)==128){let e=o<<6&1984|63&n;e<128?t+="��":t+=String.fromCharCode(e),r+=3;continue}}if((240&o)==224&&r+6<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16);if((192&n)==128&&(192&i)==128){let e=o<<12&61440|n<<6&4032|63&i;e<2048||e>=55296&&e<=57343?t+="���":t+=String.fromCharCode(e),r+=6;continue}}if((248&o)==240&&r+9<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16),s=parseInt(e.slice(r+10,r+12),16);if((192&n)==128&&(192&i)==128&&(192&s)==128){let e=o<<18&1835008|n<<12&258048|i<<6&4032|63&s;e<65536||e>1114111?t+="����":(e-=65536,t+=String.fromCharCode(55296+(e>>10),56320+(1023&e))),r+=9;continue}}t+="�"}return t})}dJ.defaultChars=";/?:@&=+$,#",dJ.componentChars="";let dG={};function dZ(e,t,n){"string"!=typeof t&&(n=t,t=dZ.defaultChars),void 0===n&&(n=!0);let r=function(e){let t=dG[e];if(t)return t;t=dG[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);/^[0-9a-z]$/i.test(n)?t.push(n):t.push("%"+("0"+e.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}(t),i="";for(let t=0,o=e.length;t<o;t++){let s=e.charCodeAt(t);if(n&&37===s&&t+2<o&&/^[0-9a-f]{2}$/i.test(e.slice(t+1,t+3))){i+=e.slice(t,t+3),t+=2;continue}if(s<128){i+=r[s];continue}if(s>=55296&&s<=57343){if(s>=55296&&s<=56319&&t+1<o){let n=e.charCodeAt(t+1);if(n>=56320&&n<=57343){i+=encodeURIComponent(e[t]+e[t+1]),t++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(e[t])}return i}function dX(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&-1!==e.hostname.indexOf(":")?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||""}function dQ(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}dZ.defaultChars=";/?:@&=+$,-_.!~*'()#",dZ.componentChars="-_.!~*'()";let dY=/^([a-z0-9.+-]+:)/i,d0=/:[0-9]*$/,d1=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,d2=["%","/","?",";","#"].concat(["'"].concat(["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n"," "]))),d3=["/","?","#"],d5=/^[+a-z0-9A-Z_-]{0,63}$/,d4=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,d6={javascript:!0,"javascript:":!0},d9={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};dQ.prototype.parse=function(e,t){let n,r,i,o=e;if(o=o.trim(),!t&&1===e.split("#").length){let e=d1.exec(o);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let s=dY.exec(o);if(s&&(n=(s=s[0]).toLowerCase(),this.protocol=s,o=o.substr(s.length)),(t||s||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i="//"===o.substr(0,2))&&!(s&&d6[s])&&(o=o.substr(2),this.slashes=!0),!d6[s]&&(i||s&&!d9[s])){let e,t,n=-1;for(let e=0;e<d3.length;e++)-1!==(r=o.indexOf(d3[e]))&&(-1===n||r<n)&&(n=r);-1!==(t=-1===n?o.lastIndexOf("@"):o.lastIndexOf("@",n))&&(e=o.slice(0,t),o=o.slice(t+1),this.auth=e),n=-1;for(let e=0;e<d2.length;e++)-1!==(r=o.indexOf(d2[e]))&&(-1===n||r<n)&&(n=r);-1===n&&(n=o.length),":"===o[n-1]&&n--;let i=o.slice(0,n);o=o.slice(n),this.parseHost(i),this.hostname=this.hostname||"";let s="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!s){let e=this.hostname.split(/\./);for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n&&!n.match(d5)){let r="";for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+="x":r+=n[e];if(!r.match(d5)){let r=e.slice(0,t),i=e.slice(t+1),s=n.match(d4);s&&(r.push(s[1]),i.unshift(s[2])),i.length&&(o=i.join(".")+o),this.hostname=r.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),s&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let l=o.indexOf("#");-1!==l&&(this.hash=o.substr(l),o=o.slice(0,l));let a=o.indexOf("?");return -1!==a&&(this.search=o.substr(a),o=o.slice(0,a)),o&&(this.pathname=o),d9[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this},dQ.prototype.parseHost=function(e){let t=d0.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};let d8=function(e,t){if(e&&e instanceof dQ)return e;let n=new dQ;return n.parse(e,t),n};e.s([],56918),e.i(56918),e.s(["decode",0,dJ,"encode",0,dZ,"format",()=>dX,"parse",0,d8],65555);var d7=e.i(65555);let ue=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ut=/[\0-\x1F\x7F-\x9F]/,un=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,ur=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,ui=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;e.s([],81911),e.i(81911),e.s(["Any",0,ue,"Cc",0,ut,"Cf",0,/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,"P",0,un,"S",0,ur,"Z",0,ui],7055);var uo=e.i(7055);let us=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),ul=new Uint16Array("Ȁaglq \x15\x18\x1bɭ\x0f\0\0\x12p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),ua=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),uc=null!=(l=String.fromCodePoint)?l:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e)};function ud(e){return e>=a.ZERO&&e<=a.NINE}(t=a||(a={}))[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z",(n=c||(c={}))[n.VALUE_LENGTH=49152]="VALUE_LENGTH",n[n.BRANCH_LENGTH=16256]="BRANCH_LENGTH",n[n.JUMP_TABLE=127]="JUMP_TABLE",(r=d||(d={}))[r.EntityStart=0]="EntityStart",r[r.NumericStart=1]="NumericStart",r[r.NumericDecimal=2]="NumericDecimal",r[r.NumericHex=3]="NumericHex",r[r.NamedEntity=4]="NamedEntity",(i=u||(u={}))[i.Legacy=0]="Legacy",i[i.Strict=1]="Strict",i[i.Attribute=2]="Attribute";class uu{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=d.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=u.Strict}startEntity(e){this.decodeMode=e,this.state=d.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case d.EntityStart:if(e.charCodeAt(t)===a.NUM)return this.state=d.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1);return this.state=d.NamedEntity,this.stateNamedEntity(e,t);case d.NumericStart:return this.stateNumericStart(e,t);case d.NumericDecimal:return this.stateNumericDecimal(e,t);case d.NumericHex:return this.stateNumericHex(e,t);case d.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(32|e.charCodeAt(t))===a.LOWER_X?(this.state=d.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=d.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*Math.pow(r,i)+parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){var r;let i=e.charCodeAt(t);if(!ud(i)&&(!((r=i)>=a.UPPER_A)||!(r<=a.UPPER_F))&&(!(r>=a.LOWER_A)||!(r<=a.LOWER_F)))return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(i,3);t+=1}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(!ud(r))return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2);t+=1}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n,r,i;if(this.consumed<=t)return null==(n=this.errors)||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===a.SEMI)this.consumed+=1;else if(this.decodeMode===u.Strict)return 0;return this.emitCodePoint((r=this.result)>=55296&&r<=57343||r>1114111?65533:null!=(i=ua.get(r))?i:r,this.consumed),this.errors&&(e!==a.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&c.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let o=e.charCodeAt(t);if(this.treeIndex=function(e,t,n,r){let i=(t&c.BRANCH_LENGTH)>>7,o=t&c.JUMP_TABLE;if(0===i)return 0!==o&&r===o?n:-1;if(o){let t=r-o;return t<0||t>=i?-1:e[n+t]-1}let s=n,l=s+i-1;for(;s<=l;){let t=s+l>>>1,n=e[t];if(n<r)s=t+1;else{if(!(n>r))return e[t+i];l=t-1}}return -1}(n,r,this.treeIndex+Math.max(1,i),o),this.treeIndex<0)return 0===this.result||this.decodeMode===u.Attribute&&(0===i||function(e){var t;return e===a.EQUALS||(t=e)>=a.UPPER_A&&t<=a.UPPER_Z||t>=a.LOWER_A&&t<=a.LOWER_Z||ud(t)}(o))?0:this.emitNotTerminatedNamedEntity();if(0!=(i=((r=n[this.treeIndex])&c.VALUE_LENGTH)>>14)){if(o===a.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==u.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return -1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&c.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),null==(e=this.errors)||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(1===t?r[e]&~c.VALUE_LENGTH:r[e+1],n),3===t&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case d.NamedEntity:return 0!==this.result&&(this.decodeMode!==u.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case d.NumericDecimal:return this.emitNumericEntity(0,2);case d.NumericHex:return this.emitNumericEntity(0,3);case d.NumericStart:return null==(e=this.errors)||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case d.EntityStart:return 0}}}function uh(e){let t="",n=new uu(e,e=>t+=uc(e));return function(e,r){let i=0,o=0;for(;(o=e.indexOf("&",o))>=0;){t+=e.slice(i,o),n.startEntity(r);let s=n.write(e,o+1);if(s<0){i=o+n.end();break}i=o+s,o=0===s?i+1:i}let s=t+e.slice(i);return t="",s}}let up=uh(us);function uf(e,t=u.Legacy){return up(e,t)}uh(ul);let um=new Map([[34,"""],[38,"&"],[39,"'"],[60,"<"],[62,">"]]);function ug(e,t){return function(n){let r,i=0,o="";for(;r=e.exec(n);)i!==r.index&&(o+=n.substring(i,r.index)),o+=t.get(r[0].charCodeAt(0)),i=r.index+1;return o+n.substring(i)}}function uy(e){return"[object String]"===Object.prototype.toString.call(e)}String.prototype.codePointAt,ug(/[&<>'"]/g,um),ug(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),ug(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]])),(o=h||(h={}))[o.XML=0]="XML",o[o.HTML=1]="HTML",(s=p||(p={}))[s.UTF8=0]="UTF8",s[s.ASCII=1]="ASCII",s[s.Extensive=2]="Extensive",s[s.Attribute=3]="Attribute",s[s.Text=4]="Text";let uk=Object.prototype.hasOwnProperty;function ub(e,t){return uk.call(e,t)}function uv(e){let t=Array.prototype.slice.call(arguments,1);return t.forEach(function(t){if(t){if("object"!=typeof t)throw TypeError(t+"must be object");Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e}function ux(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function uw(e){return(!(e>=55296)||!(e<=57343))&&(!(e>=64976)||!(e<=65007))&&(65535&e)!=65535&&(65535&e)!=65534&&(!(e>=0)||!(e<=8))&&11!==e&&(!(e>=14)||!(e<=31))&&(!(e>=127)||!(e<=159))&&!(e>1114111)&&!0}function uC(e){return e>65535?String.fromCharCode(55296+((e-=65536)>>10),56320+(1023&e)):String.fromCharCode(e)}let uS=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,uM=RegExp(uS.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),uE=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function uA(e){return 0>e.indexOf("\\")?e:e.replace(uS,"$1")}function uD(e){return 0>e.indexOf("\\")&&0>e.indexOf("&")?e:e.replace(uM,function(e,t,n){if(t)return t;if(35===n.charCodeAt(0)&&uE.test(n)){let t="x"===n[1].toLowerCase()?parseInt(n.slice(2),16):parseInt(n.slice(1),10);return uw(t)?uC(t):e}let r=uf(e);return r!==e?r:e})}let u_=/[&<>"]/,uT=/[&<>"]/g,uN={"&":"&","<":"<",">":">",'"':"""};function uO(e){return uN[e]}function uR(e){return u_.test(e)?e.replace(uT,uO):e}let uF=/[.?*+^$[\]\\(){}|-]/g;function uI(e){return e.replace(uF,"\\$&")}function uL(e){switch(e){case 9:case 32:return!0}return!1}function uz(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function uj(e){return un.test(e)||ur.test(e)}function uB(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function uP(e){return(e=e.trim().replace(/\s+/g," ")).toLowerCase().toUpperCase()}let u$={mdurl:d7,ucmicro:uo};e.s(["arrayReplaceAt",()=>ux,"assign",()=>uv,"escapeHtml",()=>uR,"escapeRE",()=>uI,"fromCodePoint",()=>uC,"has",()=>ub,"isMdAsciiPunct",()=>uB,"isPunctChar",()=>uj,"isSpace",()=>uL,"isString",()=>uy,"isValidEntityCode",()=>uw,"isWhiteSpace",()=>uz,"lib",()=>u$,"normalizeReference",()=>uP,"unescapeAll",()=>uD,"unescapeMd",()=>uA],37422);var uq=e.i(37422);function uV(e,t,n){let r,i,o,s,l=e.posMax,a=e.pos;for(e.pos=t+1,r=1;e.pos<l;){if(93===(o=e.src.charCodeAt(e.pos))&&0==--r){i=!0;break}if(s=e.pos,e.md.inline.skipToken(e),91===o){if(s===e.pos-1)r++;else if(n)return e.pos=a,-1}}let c=-1;return i&&(c=e.pos),e.pos=a,c}function uH(e,t,n){let r,i=t,o={ok:!1,pos:0,str:""};if(60===e.charCodeAt(i)){for(i++;i<n&&10!==(r=e.charCodeAt(i))&&60!==r;){if(62===r){o.pos=i+1,o.str=uD(e.slice(t+1,i)),o.ok=!0;break}if(92===r&&i+1<n){i+=2;continue}i++}return o}let s=0;for(;i<n&&32!==(r=e.charCodeAt(i))&&!(r<32)&&127!==r;){if(92===r&&i+1<n){if(32===e.charCodeAt(i+1))break;i+=2;continue}if(40===r&&++s>32)return o;if(41===r){if(0===s)break;s--}i++}return t===i||0!==s||(o.str=uD(e.slice(t,i)),o.pos=i,o.ok=!0),o}function uW(e,t,n,r){let i,o=t,s={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)s.str=r.str,s.marker=r.marker;else{if(o>=n)return s;let r=e.charCodeAt(o);if(34!==r&&39!==r&&40!==r)return s;t++,o++,40===r&&(r=41),s.marker=r}for(;o<n;){if((i=e.charCodeAt(o))===s.marker)return s.pos=o+1,s.str+=uD(e.slice(t,o)),s.ok=!0,s;if(40===i&&41===s.marker)return s;92===i&&o+1<n&&o++,o++}return s.can_continue=!0,s.str+=uD(e.slice(t,o)),s}e.s([],50919),e.i(50919),e.s(["parseLinkDestination",()=>uH,"parseLinkLabel",()=>uV,"parseLinkTitle",()=>uW],39414);var uU=e.i(39414);let uK={};function uJ(){this.rules=uv({},uK)}function uG(){this.__rules__=[],this.__cache__=null}function uZ(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}function uX(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}uK.code_inline=function(e,t,n,r,i){let o=e[t];return"<code"+i.renderAttrs(o)+">"+uR(o.content)+"</code>"},uK.code_block=function(e,t,n,r,i){let o=e[t];return"<pre"+i.renderAttrs(o)+"><code>"+uR(e[t].content)+"</code></pre>\n"},uK.fence=function(e,t,n,r,i){let o,s=e[t],l=s.info?uD(s.info).trim():"",a="",c="";if(l){let e=l.split(/(\s+)/g);a=e[0],c=e.slice(2).join("")}if(0===(o=n.highlight&&n.highlight(s.content,a,c)||uR(s.content)).indexOf("<pre"))return o+"\n";if(l){let e=s.attrIndex("class"),t=s.attrs?s.attrs.slice():[];return e<0?t.push(["class",n.langPrefix+a]):(t[e]=t[e].slice(),t[e][1]+=" "+n.langPrefix+a),`<pre><code${i.renderAttrs({attrs:t})}>${o}</code></pre>
|
|
89
|
+
`}return`<pre><code${i.renderAttrs(s)}>${o}</code></pre>
|
|
90
|
+
`},uK.image=function(e,t,n,r,i){let o=e[t];return o.attrs[o.attrIndex("alt")][1]=i.renderInlineAsText(o.children,n,r),i.renderToken(e,t,n)},uK.hardbreak=function(e,t,n){return n.xhtmlOut?"<br />\n":"<br>\n"},uK.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},uK.text=function(e,t){return uR(e[t].content)},uK.html_block=function(e,t){return e[t].content},uK.html_inline=function(e,t){return e[t].content},uJ.prototype.renderAttrs=function(e){let t,n,r;if(!e.attrs)return"";for(t=0,r="",n=e.attrs.length;t<n;t++)r+=" "+uR(e.attrs[t][0])+'="'+uR(e.attrs[t][1])+'"';return r},uJ.prototype.renderToken=function(e,t,n){let r=e[t],i="";if(r.hidden)return"";r.block&&-1!==r.nesting&&t&&e[t-1].hidden&&(i+="\n"),i+=(-1===r.nesting?"</":"<")+r.tag,i+=this.renderAttrs(r),0===r.nesting&&n.xhtmlOut&&(i+=" /");let o=!1;if(r.block&&(o=!0,1===r.nesting&&t+1<e.length)){let n=e[t+1];"inline"===n.type||n.hidden?o=!1:-1===n.nesting&&n.tag===r.tag&&(o=!1)}return i+(o?">\n":">")},uJ.prototype.renderInline=function(e,t,n){let r="",i=this.rules;for(let o=0,s=e.length;o<s;o++){let s=e[o].type;void 0!==i[s]?r+=i[s](e,o,t,n,this):r+=this.renderToken(e,o,t)}return r},uJ.prototype.renderInlineAsText=function(e,t,n){let r="";for(let i=0,o=e.length;i<o;i++)switch(e[i].type){case"text":case"html_inline":case"html_block":r+=e[i].content;break;case"image":r+=this.renderInlineAsText(e[i].children,t,n);break;case"softbreak":case"hardbreak":r+="\n"}return r},uJ.prototype.render=function(e,t,n){let r="",i=this.rules;for(let o=0,s=e.length;o<s;o++){let s=e[o].type;"inline"===s?r+=this.renderInline(e[o].children,t,n):void 0!==i[s]?r+=i[s](e,o,t,n,this):r+=this.renderToken(e,o,t,n)}return r},uG.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return -1},uG.prototype.__compile__=function(){let e=this,t=[""];e.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(e){0>t.indexOf(e)&&t.push(e)})}),e.__cache__={},t.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(n){!n.enabled||t&&0>n.alt.indexOf(t)||e.__cache__[t].push(n.fn)})})},uG.prototype.at=function(e,t,n){let r=this.__find__(e);if(-1===r)throw Error("Parser rule not found: "+e);this.__rules__[r].fn=t,this.__rules__[r].alt=(n||{}).alt||[],this.__cache__=null},uG.prototype.before=function(e,t,n,r){let i=this.__find__(e);if(-1===i)throw Error("Parser rule not found: "+e);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:(r||{}).alt||[]}),this.__cache__=null},uG.prototype.after=function(e,t,n,r){let i=this.__find__(e);if(-1===i)throw Error("Parser rule not found: "+e);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:(r||{}).alt||[]}),this.__cache__=null},uG.prototype.push=function(e,t,n){this.__rules__.push({name:e,enabled:!0,fn:t,alt:(n||{}).alt||[]}),this.__cache__=null},uG.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(function(e){let r=this.__find__(e);if(r<0){if(t)return;throw Error("Rules manager: invalid rule name "+e)}this.__rules__[r].enabled=!0,n.push(e)},this),this.__cache__=null,n},uG.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(e,t)},uG.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(function(e){let r=this.__find__(e);if(r<0){if(t)return;throw Error("Rules manager: invalid rule name "+e)}this.__rules__[r].enabled=!1,n.push(e)},this),this.__cache__=null,n},uG.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},uZ.prototype.attrIndex=function(e){if(!this.attrs)return -1;let t=this.attrs;for(let n=0,r=t.length;n<r;n++)if(t[n][0]===e)return n;return -1},uZ.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},uZ.prototype.attrSet=function(e,t){let n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r},uZ.prototype.attrGet=function(e){let t=this.attrIndex(e),n=null;return t>=0&&(n=this.attrs[t][1]),n},uZ.prototype.attrJoin=function(e,t){let n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+" "+t},uX.prototype.Token=uZ;let uQ=/\r\n?|\n/g,uY=/\0/g,u0=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,u1=/\((c|tm|r)\)/i,u2=/\((c|tm|r)\)/ig,u3={c:"©",r:"®",tm:"™"};function u5(e,t){return u3[t.toLowerCase()]}let u4=/['"]/,u6=/['"]/g;function u9(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}let u8=[["normalize",function(e){let t;t=(t=e.src.replace(uQ,"\n")).replace(uY,"�"),e.src=t}],["block",function(e){let t;e.inlineMode?((t=new e.Token("inline","",0)).content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}],["inline",function(e){let t=e.tokens;for(let n=0,r=t.length;n<r;n++){let r=t[n];"inline"===r.type&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}],["linkify",function(e){let t=e.tokens;if(e.md.options.linkify)for(let i=0,o=t.length;i<o;i++){if("inline"!==t[i].type||!e.md.linkify.pretest(t[i].content))continue;let o=t[i].children,s=0;for(let l=o.length-1;l>=0;l--){let a=o[l];if("link_close"===a.type){for(l--;o[l].level!==a.level&&"link_open"!==o[l].type;)l--;continue}if("html_inline"===a.type){var n,r;n=a.content,/^<a[>\s]/i.test(n)&&s>0&&s--,r=a.content,/^<\/a\s*>/i.test(r)&&s++}if(!(s>0)&&"text"===a.type&&e.md.linkify.test(a.content)){let n=a.content,r=e.md.linkify.match(n),s=[],c=a.level,d=0;r.length>0&&0===r[0].index&&l>0&&"text_special"===o[l-1].type&&(r=r.slice(1));for(let t=0;t<r.length;t++){let i=r[t].url,o=e.md.normalizeLink(i);if(!e.md.validateLink(o))continue;let l=r[t].text;l=r[t].schema?"mailto:"!==r[t].schema||/^mailto:/i.test(l)?e.md.normalizeLinkText(l):e.md.normalizeLinkText("mailto:"+l).replace(/^mailto:/,""):e.md.normalizeLinkText("http://"+l).replace(/^http:\/\//,"");let a=r[t].index;if(a>d){let t=new e.Token("text","",0);t.content=n.slice(d,a),t.level=c,s.push(t)}let u=new e.Token("link_open","a",1);u.attrs=[["href",o]],u.level=c++,u.markup="linkify",u.info="auto",s.push(u);let h=new e.Token("text","",0);h.content=l,h.level=c,s.push(h);let p=new e.Token("link_close","a",-1);p.level=--c,p.markup="linkify",p.info="auto",s.push(p),d=r[t].lastIndex}if(d<n.length){let t=new e.Token("text","",0);t.content=n.slice(d),t.level=c,s.push(t)}t[i].children=o=ux(o,l,s)}}}}],["replacements",function(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&(u1.test(e.tokens[t].content)&&function(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];"text"!==r.type||t||(r.content=r.content.replace(u2,u5)),"link_open"===r.type&&"auto"===r.info&&t--,"link_close"===r.type&&"auto"===r.info&&t++}}(e.tokens[t].children),u0.test(e.tokens[t].content)&&function(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];"text"===r.type&&!t&&u0.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),"link_open"===r.type&&"auto"===r.info&&t--,"link_close"===r.type&&"auto"===r.info&&t++}}(e.tokens[t].children))}],["smartquotes",function(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&u4.test(e.tokens[t].content)&&function(e,t){let n,r=[];for(let i=0;i<e.length;i++){let o=e[i],s=e[i].level;for(n=r.length-1;n>=0&&!(r[n].level<=s);n--);if(r.length=n+1,"text"!==o.type)continue;let l=o.content,a=0,c=l.length;i:for(;a<c;){u6.lastIndex=a;let d=u6.exec(l);if(!d)break;let u=!0,h=!0;a=d.index+1;let p="'"===d[0],f=32;if(d.index-1>=0)f=l.charCodeAt(d.index-1);else for(n=i-1;n>=0&&"softbreak"!==e[n].type&&"hardbreak"!==e[n].type;n--)if(e[n].content){f=e[n].content.charCodeAt(e[n].content.length-1);break}let m=32;if(a<c)m=l.charCodeAt(a);else for(n=i+1;n<e.length&&"softbreak"!==e[n].type&&"hardbreak"!==e[n].type;n++)if(e[n].content){m=e[n].content.charCodeAt(0);break}let g=uB(f)||uj(String.fromCharCode(f)),y=uB(m)||uj(String.fromCharCode(m)),k=uz(f),b=uz(m);if(b?u=!1:y&&!(k||g)&&(u=!1),k?h=!1:g&&!(b||y)&&(h=!1),34===m&&'"'===d[0]&&f>=48&&f<=57&&(h=u=!1),u&&h&&(u=g,h=y),!u&&!h){p&&(o.content=u9(o.content,d.index,"’"));continue}if(h)for(n=r.length-1;n>=0;n--){let u=r[n];if(r[n].level<s)break;if(u.single===p&&r[n].level===s){let s,h;u=r[n],p?(s=t.md.options.quotes[2],h=t.md.options.quotes[3]):(s=t.md.options.quotes[0],h=t.md.options.quotes[1]),o.content=u9(o.content,d.index,h),e[u.token].content=u9(e[u.token].content,u.pos,s),a+=h.length-1,u.token===i&&(a+=s.length-1),c=(l=o.content).length,r.length=n;continue i}}u?r.push({token:i,pos:d.index,single:p,level:s}):h&&p&&(o.content=u9(o.content,d.index,"’"))}}}(e.tokens[t].children,e)}],["text_join",function(e){let t,n,r=e.tokens,i=r.length;for(let e=0;e<i;e++){if("inline"!==r[e].type)continue;let i=r[e].children,o=i.length;for(t=0;t<o;t++)"text_special"===i[t].type&&(i[t].type="text");for(t=n=0;t<o;t++)"text"===i[t].type&&t+1<o&&"text"===i[t+1].type?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}}]];function u7(){this.ruler=new uG;for(let e=0;e<u8.length;e++)this.ruler.push(u8[e][0],u8[e][1])}function he(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;let i=this.src;for(let e=0,t=0,n=0,r=0,o=i.length,s=!1;t<o;t++){let l=i.charCodeAt(t);if(!s)if(uL(l)){n++,9===l?r+=4-r%4:r++;continue}else s=!0;(10===l||t===o-1)&&(10!==l&&t++,this.bMarks.push(e),this.eMarks.push(t),this.tShift.push(n),this.sCount.push(r),this.bsCount.push(0),s=!1,n=0,r=0,e=t+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}function ht(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function hn(e){let t=[],n=e.length,r=0,i=e.charCodeAt(r),o=!1,s=0,l="";for(;r<n;)124===i&&(o?(l+=e.substring(s,r-1),s=r):(t.push(l+e.substring(s,r)),l="",s=r+1)),o=92===i,r++,i=e.charCodeAt(r);return t.push(l+e.substring(s)),t}function hr(e,t){let n=e.eMarks[t],r=e.bMarks[t]+e.tShift[t],i=e.src.charCodeAt(r++);return 42!==i&&45!==i&&43!==i||r<n&&!uL(e.src.charCodeAt(r))?-1:r}function hi(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t],i=n;if(i+1>=r)return -1;let o=e.src.charCodeAt(i++);if(o<48||o>57)return -1;for(;;){if(i>=r)return -1;if((o=e.src.charCodeAt(i++))>=48&&o<=57){if(i-n>=10)return -1;continue}if(41===o||46===o)break;return -1}return i<r&&!uL(o=e.src.charCodeAt(i))?-1:i}u7.prototype.process=function(e){let t=this.ruler.getRules("");for(let n=0,r=t.length;n<r;n++)t[n](e)},u7.prototype.State=uX,he.prototype.push=function(e,t,n){let r=new uZ(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r},he.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},he.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},he.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t&&uL(this.src.charCodeAt(e));e++);return e},he.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!uL(this.src.charCodeAt(--e)))return e+1;return e},he.prototype.skipChars=function(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},he.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},he.prototype.getLines=function(e,t,n,r){if(e>=t)return"";let i=Array(t-e);for(let o=0,s=e;s<t;s++,o++){let e,l=0,a=this.bMarks[s],c=a;for(e=s+1<t||r?this.eMarks[s]+1:this.eMarks[s];c<e&&l<n;){let e=this.src.charCodeAt(c);if(uL(e))9===e?l+=4-(l+this.bsCount[s])%4:l++;else if(c-a<this.tShift[s])l++;else break;c++}l>n?i[o]=Array(l-n+1).join(" ")+this.src.slice(c,e):i[o]=this.src.slice(c,e)}return i.join("")},he.prototype.Token=uZ;let ho="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",hs="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",hl=RegExp("^(?:"+ho+"|"+hs+"|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)"),ha=RegExp("^(?:"+ho+"|"+hs+")"),hc=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp("^</?(address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?=(\\s|/?>|$))","i"),/^$/,!0],[RegExp(ha.source+"\\s*$"),/^$/,!1]],hd=[["table",function(e,t,n,r){let i;if(t+2>n)return!1;let o=t+1;if(e.sCount[o]<e.blkIndent||e.sCount[o]-e.blkIndent>=4)return!1;let s=e.bMarks[o]+e.tShift[o];if(s>=e.eMarks[o])return!1;let l=e.src.charCodeAt(s++);if(124!==l&&45!==l&&58!==l||s>=e.eMarks[o])return!1;let a=e.src.charCodeAt(s++);if(124!==a&&45!==a&&58!==a&&!uL(a)||45===l&&uL(a))return!1;for(;s<e.eMarks[o];){let t=e.src.charCodeAt(s);if(124!==t&&45!==t&&58!==t&&!uL(t))return!1;s++}let c=ht(e,t+1),d=c.split("|"),u=[];for(let e=0;e<d.length;e++){let t=d[e].trim();if(!t)if(0===e||e===d.length-1)continue;else return!1;if(!/^:?-+:?$/.test(t))return!1;58===t.charCodeAt(t.length-1)?u.push(58===t.charCodeAt(0)?"center":"right"):58===t.charCodeAt(0)?u.push("left"):u.push("")}if(-1===(c=ht(e,t).trim()).indexOf("|")||e.sCount[t]-e.blkIndent>=4)return!1;(d=hn(c)).length&&""===d[0]&&d.shift(),d.length&&""===d[d.length-1]&&d.pop();let h=d.length;if(0===h||h!==u.length)return!1;if(r)return!0;let p=e.parentType;e.parentType="table";let f=e.md.block.ruler.getRules("blockquote"),m=e.push("table_open","table",1),g=[t,0];m.map=g,e.push("thead_open","thead",1).map=[t,t+1],e.push("tr_open","tr",1).map=[t,t+1];for(let t=0;t<d.length;t++){let n=e.push("th_open","th",1);u[t]&&(n.attrs=[["style","text-align:"+u[t]]]);let r=e.push("inline","",0);r.content=d[t].trim(),r.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let y=0;for(o=t+2;o<n&&!(e.sCount[o]<e.blkIndent);o++){let r=!1;for(let t=0,i=f.length;t<i;t++)if(f[t](e,o,n,!0)){r=!0;break}if(r||!(c=ht(e,o).trim())||e.sCount[o]-e.blkIndent>=4||((d=hn(c)).length&&""===d[0]&&d.shift(),d.length&&""===d[d.length-1]&&d.pop(),(y+=h-d.length)>65536))break;o===t+2&&(e.push("tbody_open","tbody",1).map=i=[t+2,0]),e.push("tr_open","tr",1).map=[o,o+1];for(let t=0;t<h;t++){let n=e.push("td_open","td",1);u[t]&&(n.attrs=[["style","text-align:"+u[t]]]);let r=e.push("inline","",0);r.content=d[t]?d[t].trim():"",r.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return i&&(e.push("tbody_close","tbody",-1),i[1]=o),e.push("table_close","table",-1),g[1]=o,e.parentType=p,e.line=o,!0},["paragraph","reference"]],["code",function(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){i=++r;continue}break}e.line=i;let o=e.push("code_block","code",0);return o.content=e.getLines(t,i,4+e.blkIndent,!1)+"\n",o.map=[t,e.line],!0}],["fence",function(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>o)return!1;let s=e.src.charCodeAt(i);if(126!==s&&96!==s)return!1;let l=i,a=(i=e.skipChars(i,s))-l;if(a<3)return!1;let c=e.src.slice(l,i),d=e.src.slice(i,o);if(96===s&&d.indexOf(String.fromCharCode(s))>=0)return!1;if(r)return!0;let u=t,h=!1;for(;!(++u>=n)&&(!((i=l=e.bMarks[u]+e.tShift[u])<(o=e.eMarks[u]))||!(e.sCount[u]<e.blkIndent));){;if(!(e.src.charCodeAt(i)!==s||e.sCount[u]-e.blkIndent>=4||(i=e.skipChars(i,s))-l<a)&&!((i=e.skipSpaces(i))<o)){h=!0;break}}a=e.sCount[t],e.line=u+ +!!h;let p=e.push("fence","code",0);return p.info=d,p.content=e.getLines(t+1,u,a,!0),p.markup=c,p.map=[t,e.line],!0},["paragraph","reference","blockquote","list"]],["blockquote",function(e,t,n,r){let i,o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t],l=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||62!==e.src.charCodeAt(o))return!1;if(r)return!0;let a=[],c=[],d=[],u=[],h=e.md.block.ruler.getRules("blockquote"),p=e.parentType;e.parentType="blockquote";let f=!1;for(i=t;i<n;i++){let t=e.sCount[i]<e.blkIndent;if((o=e.bMarks[i]+e.tShift[i])>=(s=e.eMarks[i]))break;if(62===e.src.charCodeAt(o++)&&!t){let t,n,r=e.sCount[i]+1;32===e.src.charCodeAt(o)?(o++,r++,n=!1,t=!0):9===e.src.charCodeAt(o)?(t=!0,(e.bsCount[i]+r)%4==3?(o++,r++,n=!1):n=!0):t=!1;let l=r;for(a.push(e.bMarks[i]),e.bMarks[i]=o;o<s;){let t=e.src.charCodeAt(o);if(uL(t))9===t?l+=4-(l+e.bsCount[i]+ +!!n)%4:l++;else break;o++}f=o>=s,c.push(e.bsCount[i]),e.bsCount[i]=e.sCount[i]+1+ +!!t,d.push(e.sCount[i]),e.sCount[i]=l-r,u.push(e.tShift[i]),e.tShift[i]=o-e.bMarks[i];continue}if(f)break;let r=!1;for(let t=0,o=h.length;t<o;t++)if(h[t](e,i,n,!0)){r=!0;break}if(r){e.lineMax=i,0!==e.blkIndent&&(a.push(e.bMarks[i]),c.push(e.bsCount[i]),u.push(e.tShift[i]),d.push(e.sCount[i]),e.sCount[i]-=e.blkIndent);break}a.push(e.bMarks[i]),c.push(e.bsCount[i]),u.push(e.tShift[i]),d.push(e.sCount[i]),e.sCount[i]=-1}let m=e.blkIndent;e.blkIndent=0;let g=e.push("blockquote_open","blockquote",1);g.markup=">";let y=[t,0];g.map=y,e.md.block.tokenize(e,t,i),e.push("blockquote_close","blockquote",-1).markup=">",e.lineMax=l,e.parentType=p,y[1]=e.line;for(let n=0;n<u.length;n++)e.bMarks[n+t]=a[n],e.tShift[n+t]=u[n],e.sCount[n+t]=d[n],e.bsCount[n+t]=c[n];return e.blkIndent=m,!0},["paragraph","reference","blockquote","list"]],["hr",function(e,t,n,r){let i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.bMarks[t]+e.tShift[t],s=e.src.charCodeAt(o++);if(42!==s&&45!==s&&95!==s)return!1;let l=1;for(;o<i;){let t=e.src.charCodeAt(o++);if(t!==s&&!uL(t))return!1;t===s&&l++}if(l<3)return!1;if(r)return!0;e.line=t+1;let a=e.push("hr","hr",0);return a.map=[t,e.line],a.markup=Array(l+1).join(String.fromCharCode(s)),!0},["paragraph","reference","blockquote","list"]],["list",function(e,t,n,r){let i,o,s,l,a,c,d,u=t,h=!0;if(e.sCount[u]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[u]-e.listIndent>=4&&e.sCount[u]<e.blkIndent)return!1;let p=!1;if(r&&"paragraph"===e.parentType&&e.sCount[u]>=e.blkIndent&&(p=!0),(d=hi(e,u))>=0){if(a=!0,s=e.bMarks[u]+e.tShift[u],c=Number(e.src.slice(s,d-1)),p&&1!==c)return!1}else{if(!((d=hr(e,u))>=0))return!1;a=!1}if(p&&e.skipSpaces(d)>=e.eMarks[u])return!1;if(r)return!0;let f=e.src.charCodeAt(d-1),m=e.tokens.length;a?(l=e.push("ordered_list_open","ol",1),1!==c&&(l.attrs=[["start",c]])):l=e.push("bullet_list_open","ul",1);let g=[u,0];l.map=g,l.markup=String.fromCharCode(f);let y=!1,k=e.md.block.ruler.getRules("list"),b=e.parentType;for(e.parentType="list";u<n;){let t;o=d,i=e.eMarks[u];let r=e.sCount[u]+d-(e.bMarks[u]+e.tShift[u]),c=r;for(;o<i;){let t=e.src.charCodeAt(o);if(9===t)c+=4-(c+e.bsCount[u])%4;else if(32===t)c++;else break;o++}let p=o;(t=p>=i?1:c-r)>4&&(t=1);let m=r+t;(l=e.push("list_item_open","li",1)).markup=String.fromCharCode(f);let g=[u,0];l.map=g,a&&(l.info=e.src.slice(s,d-1));let b=e.tight,v=e.tShift[u],x=e.sCount[u],w=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=m,e.tight=!0,e.tShift[u]=p-e.bMarks[u],e.sCount[u]=c,p>=i&&e.isEmpty(u+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,u,n,!0),(!e.tight||y)&&(h=!1),y=e.line-u>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=w,e.tShift[u]=v,e.sCount[u]=x,e.tight=b,(l=e.push("list_item_close","li",-1)).markup=String.fromCharCode(f),u=e.line,g[1]=u,u>=n||e.sCount[u]<e.blkIndent||e.sCount[u]-e.blkIndent>=4)break;let C=!1;for(let t=0,r=k.length;t<r;t++)if(k[t](e,u,n,!0)){C=!0;break}if(C)break;if(a){if((d=hi(e,u))<0)break;s=e.bMarks[u]+e.tShift[u]}else if((d=hr(e,u))<0)break;if(f!==e.src.charCodeAt(d-1))break}return(l=a?e.push("ordered_list_close","ol",-1):e.push("bullet_list_close","ul",-1)).markup=String.fromCharCode(f),g[1]=u,e.line=u,e.parentType=b,h&&function(e,t){let n=e.level+2;for(let r=t+2,i=e.tokens.length-2;r<i;r++)e.tokens[r].level===n&&"paragraph_open"===e.tokens[r].type&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}(e,m),!0},["paragraph","reference","blockquote"]],["reference",function(e,t,n,r){let i,o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t],l=t+1;if(e.sCount[t]-e.blkIndent>=4||91!==e.src.charCodeAt(o))return!1;function a(t){let n=e.lineMax;if(t>=n||e.isEmpty(t))return null;let r=!1;if(e.sCount[t]-e.blkIndent>3&&(r=!0),e.sCount[t]<0&&(r=!0),!r){let r=e.md.block.ruler.getRules("reference"),i=e.parentType;e.parentType="reference";let o=!1;for(let i=0,s=r.length;i<s;i++)if(r[i](e,t,n,!0)){o=!0;break}if(e.parentType=i,o)return null}let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return e.src.slice(i,o+1)}let c=e.src.slice(o,s+1);s=c.length;let d=-1;for(o=1;o<s;o++){let e=c.charCodeAt(o);if(91===e)return!1;if(93===e){d=o;break}if(10===e){let e=a(l);null!==e&&(c+=e,s=c.length,l++)}else if(92===e&&++o<s&&10===c.charCodeAt(o)){let e=a(l);null!==e&&(c+=e,s=c.length,l++)}}if(d<0||58!==c.charCodeAt(d+1))return!1;for(o=d+2;o<s;o++){let e=c.charCodeAt(o);if(10===e){let e=a(l);null!==e&&(c+=e,s=c.length,l++)}else if(uL(e));else break}let u=e.md.helpers.parseLinkDestination(c,o,s);if(!u.ok)return!1;let h=e.md.normalizeLink(u.str);if(!e.md.validateLink(h))return!1;let p=o=u.pos,f=l,m=o;for(;o<s;o++){let e=c.charCodeAt(o);if(10===e){let e=a(l);null!==e&&(c+=e,s=c.length,l++)}else if(uL(e));else break}let g=e.md.helpers.parseLinkTitle(c,o,s);for(;g.can_continue;){let t=a(l);if(null===t)break;c+=t,o=s,s=c.length,l++,g=e.md.helpers.parseLinkTitle(c,o,s,g)}for(o<s&&m!==o&&g.ok?(i=g.str,o=g.pos):(i="",o=p,l=f);o<s&&uL(c.charCodeAt(o));)o++;if(o<s&&10!==c.charCodeAt(o)&&i)for(i="",o=p,l=f;o<s&&uL(c.charCodeAt(o));)o++;if(o<s&&10!==c.charCodeAt(o))return!1;let y=uP(c.slice(1,d));return!!y&&(!!r||(void 0===e.env.references&&(e.env.references={}),void 0===e.env.references[y]&&(e.env.references[y]={title:i,href:h}),e.line=l,!0))}],["html_block",function(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||60!==e.src.charCodeAt(i))return!1;let s=e.src.slice(i,o),l=0;for(;l<hc.length&&!hc[l][0].test(s);l++);if(l===hc.length)return!1;if(r)return hc[l][2];let a=t+1;if(!hc[l][1].test(s)){for(;a<n&&!(e.sCount[a]<e.blkIndent);a++)if(i=e.bMarks[a]+e.tShift[a],o=e.eMarks[a],s=e.src.slice(i,o),hc[l][1].test(s)){0!==s.length&&a++;break}}e.line=a;let c=e.push("html_block","",0);return c.map=[t,a],c.content=e.getLines(t,a,e.blkIndent,!0),!0},["paragraph","reference","blockquote"]],["heading",function(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.src.charCodeAt(i);if(35!==s||i>=o)return!1;let l=1;for(s=e.src.charCodeAt(++i);35===s&&i<o&&l<=6;)l++,s=e.src.charCodeAt(++i);if(l>6||i<o&&!uL(s))return!1;if(r)return!0;o=e.skipSpacesBack(o,i);let a=e.skipCharsBack(o,35,i);a>i&&uL(e.src.charCodeAt(a-1))&&(o=a),e.line=t+1;let c=e.push("heading_open","h"+String(l),1);c.markup="########".slice(0,l),c.map=[t,e.line];let d=e.push("inline","",0);return d.content=e.src.slice(i,o).trim(),d.map=[t,e.line],d.children=[],e.push("heading_close","h"+String(l),-1).markup="########".slice(0,l),!0},["paragraph","reference","blockquote"]],["lheading",function(e,t,n){let r,i=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.parentType;e.parentType="paragraph";let s=0,l=t+1;for(;l<n&&!e.isEmpty(l);l++){if(e.sCount[l]-e.blkIndent>3)continue;if(e.sCount[l]>=e.blkIndent){let t=e.bMarks[l]+e.tShift[l],n=e.eMarks[l];if(t<n&&(45===(r=e.src.charCodeAt(t))||61===r)&&(t=e.skipChars(t,r),(t=e.skipSpaces(t))>=n)){s=61===r?1:2;break}}if(e.sCount[l]<0)continue;let t=!1;for(let r=0,o=i.length;r<o;r++)if(i[r](e,l,n,!0)){t=!0;break}if(t)break}if(!s)return!1;let a=e.getLines(t,l,e.blkIndent,!1).trim();e.line=l+1;let c=e.push("heading_open","h"+String(s),1);c.markup=String.fromCharCode(r),c.map=[t,e.line];let d=e.push("inline","",0);return d.content=a,d.map=[t,e.line-1],d.children=[],e.push("heading_close","h"+String(s),-1).markup=String.fromCharCode(r),e.parentType=o,!0}],["paragraph",function(e,t,n){let r=e.md.block.ruler.getRules("paragraph"),i=e.parentType,o=t+1;for(e.parentType="paragraph";o<n&&!e.isEmpty(o);o++){if(e.sCount[o]-e.blkIndent>3||e.sCount[o]<0)continue;let t=!1;for(let i=0,s=r.length;i<s;i++)if(r[i](e,o,n,!0)){t=!0;break}if(t)break}let s=e.getLines(t,o,e.blkIndent,!1).trim();e.line=o,e.push("paragraph_open","p",1).map=[t,e.line];let l=e.push("inline","",0);return l.content=s,l.map=[t,e.line],l.children=[],e.push("paragraph_close","p",-1),e.parentType=i,!0}]];function hu(){this.ruler=new uG;for(let e=0;e<hd.length;e++)this.ruler.push(hd[e][0],hd[e][1],{alt:(hd[e][2]||[]).slice()})}function hh(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}hu.prototype.tokenize=function(e,t,n){let r=this.ruler.getRules(""),i=r.length,o=e.md.options.maxNesting,s=t,l=!1;for(;s<n&&(e.line=s=e.skipEmptyLines(s),!(s>=n)&&!(e.sCount[s]<e.blkIndent));){if(e.level>=o){e.line=n;break}let t=e.line,a=!1;for(let o=0;o<i;o++)if(a=r[o](e,s,n,!1)){if(t>=e.line)throw Error("block rule didn't increment state.line");break}if(!a)throw Error("none of the block rules matched");e.tight=!l,e.isEmpty(e.line-1)&&(l=!0),(s=e.line)<n&&e.isEmpty(s)&&(l=!0,e.line=++s)}},hu.prototype.parse=function(e,t,n,r){if(!e)return;let i=new this.State(e,t,n,r);this.tokenize(i,i.line,i.lineMax)},hu.prototype.State=he,hh.prototype.pushPending=function(){let e=new uZ("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},hh.prototype.push=function(e,t,n){this.pending&&this.pushPending();let r=new uZ(e,t,n),i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r},hh.prototype.scanDelims=function(e,t){let n=this.posMax,r=this.src.charCodeAt(e),i=e>0?this.src.charCodeAt(e-1):32,o=e;for(;o<n&&this.src.charCodeAt(o)===r;)o++;let s=o-e,l=o<n?this.src.charCodeAt(o):32,a=uB(i)||uj(String.fromCharCode(i)),c=uB(l)||uj(String.fromCharCode(l)),d=uz(i),u=uz(l),h=!u&&(!c||d||a),p=!d&&(!a||u||c);return{can_open:h&&(t||!p||a),can_close:p&&(t||!h||c),length:s}},hh.prototype.Token=uZ;let hp=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i,hf=[];for(let e=0;e<256;e++)hf.push(0);function hm(e,t){let n,r=[],i=t.length;for(let o=0;o<i;o++){let i=t[o];if(126!==i.marker||-1===i.end)continue;let s=t[i.end];(n=e.tokens[i.token]).type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",(n=e.tokens[s.token]).type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="","text"===e.tokens[s.token-1].type&&"~"===e.tokens[s.token-1].content&&r.push(s.token-1)}for(;r.length;){let t=r.pop(),i=t+1;for(;i<e.tokens.length&&"s_close"===e.tokens[i].type;)i++;t!==--i&&(n=e.tokens[i],e.tokens[i]=e.tokens[t],e.tokens[t]=n)}}"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){hf[e.charCodeAt(0)]=1});function hg(e,t){let n=t.length;for(let r=n-1;r>=0;r--){let n=t[r];if(95!==n.marker&&42!==n.marker||-1===n.end)continue;let i=t[n.end],o=r>0&&t[r-1].end===n.end+1&&t[r-1].marker===n.marker&&t[r-1].token===n.token-1&&t[n.end+1].token===i.token+1,s=String.fromCharCode(n.marker),l=e.tokens[n.token];l.type=o?"strong_open":"em_open",l.tag=o?"strong":"em",l.nesting=1,l.markup=o?s+s:s,l.content="";let a=e.tokens[i.token];a.type=o?"strong_close":"em_close",a.tag=o?"strong":"em",a.nesting=-1,a.markup=o?s+s:s,a.content="",o&&(e.tokens[t[r-1].token].content="",e.tokens[t[n.end+1].token].content="",r--)}}let hy=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,hk=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/,hb=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,hv=/^&([a-z][a-z0-9]{1,31});/i;function hx(e){let t={},n=e.length;if(!n)return;let r=0,i=-2,o=[];for(let s=0;s<n;s++){let n=e[s];if(o.push(0),(e[r].marker!==n.marker||i!==n.token-1)&&(r=s),i=n.token,n.length=n.length||0,!n.close)continue;t.hasOwnProperty(n.marker)||(t[n.marker]=[-1,-1,-1,-1,-1,-1]);let l=t[n.marker][3*!!n.open+n.length%3],a=r-o[r]-1,c=a;for(;a>l;a-=o[a]+1){let t=e[a];if(t.marker===n.marker&&t.open&&t.end<0){let r=!1;if((t.close||n.open)&&(t.length+n.length)%3==0&&(t.length%3!=0||n.length%3!=0)&&(r=!0),!r){let r=a>0&&!e[a-1].open?o[a-1]+1:0;o[s]=s-a+r,o[a]=r,n.open=!1,t.end=s,t.close=!1,c=-1,i=-2;break}}}-1!==c&&(t[n.marker][3*!!n.open+(n.length||0)%3]=c)}}let hw=[["text",function(e,t){let n=e.pos;for(;n<e.posMax&&!function(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}(e.src.charCodeAt(n));)n++;return n!==e.pos&&(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}],["linkify",function(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;let n=e.pos;if(n+3>e.posMax||58!==e.src.charCodeAt(n)||47!==e.src.charCodeAt(n+1)||47!==e.src.charCodeAt(n+2))return!1;let r=e.pending.match(hp);if(!r)return!1;let i=r[1],o=e.md.linkify.matchAtStart(e.src.slice(n-i.length));if(!o)return!1;let s=o.url;if(s.length<=i.length)return!1;s=s.replace(/\*+$/,"");let l=e.md.normalizeLink(s);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-i.length);let t=e.push("link_open","a",1);t.attrs=[["href",l]],t.markup="linkify",t.info="auto",e.push("text","",0).content=e.md.normalizeLinkText(s);let n=e.push("link_close","a",-1);n.markup="linkify",n.info="auto"}return e.pos+=s.length-i.length,!0}],["newline",function(e,t){let n=e.pos;if(10!==e.src.charCodeAt(n))return!1;let r=e.pending.length-1,i=e.posMax;if(!t)if(r>=0&&32===e.pending.charCodeAt(r))if(r>=1&&32===e.pending.charCodeAt(r-1)){let t=r-1;for(;t>=1&&32===e.pending.charCodeAt(t-1);)t--;e.pending=e.pending.slice(0,t),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n<i&&uL(e.src.charCodeAt(n));)n++;return e.pos=n,!0}],["escape",function(e,t){let n=e.pos,r=e.posMax;if(92!==e.src.charCodeAt(n)||++n>=r)return!1;let i=e.src.charCodeAt(n);if(10===i){for(t||e.push("hardbreak","br",0),n++;n<r&&uL(i=e.src.charCodeAt(n));)n++;return e.pos=n,!0}let o=e.src[n];if(i>=55296&&i<=56319&&n+1<r){let t=e.src.charCodeAt(n+1);t>=56320&&t<=57343&&(o+=e.src[n+1],n++)}let s="\\"+o;if(!t){let t=e.push("text_special","",0);i<256&&0!==hf[i]?t.content=o:t.content=s,t.markup=s,t.info="escape"}return e.pos=n+1,!0}],["backticks",function(e,t){let n,r=e.pos;if(96!==e.src.charCodeAt(r))return!1;let i=r;r++;let o=e.posMax;for(;r<o&&96===e.src.charCodeAt(r);)r++;let s=e.src.slice(i,r),l=s.length;if(e.backticksScanned&&(e.backticks[l]||0)<=i)return t||(e.pending+=s),e.pos+=l,!0;let a=r;for(;-1!==(n=e.src.indexOf("`",a));){for(a=n+1;a<o&&96===e.src.charCodeAt(a);)a++;let i=a-n;if(i===l){if(!t){let t=e.push("code_inline","code",0);t.markup=s,t.content=e.src.slice(r,n).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=a,!0}e.backticks[i]=n}return e.backticksScanned=!0,t||(e.pending+=s),e.pos+=l,!0}],["strikethrough",function(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||126!==r)return!1;let i=e.scanDelims(e.pos,!0),o=i.length,s=String.fromCharCode(r);if(o<2)return!1;o%2&&(e.push("text","",0).content=s,o--);for(let t=0;t<o;t+=2)e.push("text","",0).content=s+s,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}],["emphasis",function(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||95!==r&&42!==r)return!1;let i=e.scanDelims(e.pos,42===r);for(let t=0;t<i.length;t++)e.push("text","",0).content=String.fromCharCode(r),e.delimiters.push({marker:r,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}],["link",function(e,t){let n,r,i,o,s="",l="",a=e.pos,c=!0;if(91!==e.src.charCodeAt(e.pos))return!1;let d=e.pos,u=e.posMax,h=e.pos+1,p=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(p<0)return!1;let f=p+1;if(f<u&&40===e.src.charCodeAt(f)){for(c=!1,f++;f<u&&(uL(n=e.src.charCodeAt(f))||10===n);f++);if(f>=u)return!1;if(a=f,(i=e.md.helpers.parseLinkDestination(e.src,f,e.posMax)).ok){for(s=e.md.normalizeLink(i.str),e.md.validateLink(s)?f=i.pos:s="",a=f;f<u&&(uL(n=e.src.charCodeAt(f))||10===n);f++);if(i=e.md.helpers.parseLinkTitle(e.src,f,e.posMax),f<u&&a!==f&&i.ok)for(l=i.str,f=i.pos;f<u&&(uL(n=e.src.charCodeAt(f))||10===n);f++);}(f>=u||41!==e.src.charCodeAt(f))&&(c=!0),f++}if(c){if(void 0===e.env.references)return!1;if(f<u&&91===e.src.charCodeAt(f)?(a=f+1,(f=e.md.helpers.parseLinkLabel(e,f))>=0?r=e.src.slice(a,f++):f=p+1):f=p+1,r||(r=e.src.slice(h,p)),!(o=e.env.references[uP(r)]))return e.pos=d,!1;s=o.href,l=o.title}if(!t){e.pos=h,e.posMax=p;let t=e.push("link_open","a",1),n=[["href",s]];t.attrs=n,l&&n.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=f,e.posMax=u,!0}],["image",function(e,t){let n,r,i,o,s,l,a,c,d="",u=e.pos,h=e.posMax;if(33!==e.src.charCodeAt(e.pos)||91!==e.src.charCodeAt(e.pos+1))return!1;let p=e.pos+2,f=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(f<0)return!1;if((o=f+1)<h&&40===e.src.charCodeAt(o)){for(o++;o<h&&(uL(n=e.src.charCodeAt(o))||10===n);o++);if(o>=h)return!1;for(c=o,(l=e.md.helpers.parseLinkDestination(e.src,o,e.posMax)).ok&&(d=e.md.normalizeLink(l.str),e.md.validateLink(d)?o=l.pos:d=""),c=o;o<h&&(uL(n=e.src.charCodeAt(o))||10===n);o++);if(l=e.md.helpers.parseLinkTitle(e.src,o,e.posMax),o<h&&c!==o&&l.ok)for(a=l.str,o=l.pos;o<h&&(uL(n=e.src.charCodeAt(o))||10===n);o++);else a="";if(o>=h||41!==e.src.charCodeAt(o))return e.pos=u,!1;o++}else{if(void 0===e.env.references)return!1;if(o<h&&91===e.src.charCodeAt(o)?(c=o+1,(o=e.md.helpers.parseLinkLabel(e,o))>=0?i=e.src.slice(c,o++):o=f+1):o=f+1,i||(i=e.src.slice(p,f)),!(s=e.env.references[uP(i)]))return e.pos=u,!1;d=s.href,a=s.title}if(!t){r=e.src.slice(p,f);let t=[];e.md.inline.parse(r,e.md,e.env,t);let n=e.push("image","img",0),i=[["src",d],["alt",""]];n.attrs=i,n.children=t,n.content=r,a&&i.push(["title",a])}return e.pos=o,e.posMax=h,!0}],["autolink",function(e,t){let n=e.pos;if(60!==e.src.charCodeAt(n))return!1;let r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;let t=e.src.charCodeAt(n);if(60===t)return!1;if(62===t)break}let o=e.src.slice(r+1,n);if(hk.test(o)){let n=e.md.normalizeLink(o);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push("link_open","a",1);t.attrs=[["href",n]],t.markup="autolink",t.info="auto",e.push("text","",0).content=e.md.normalizeLinkText(o);let r=e.push("link_close","a",-1);r.markup="autolink",r.info="auto"}return e.pos+=o.length+2,!0}if(hy.test(o)){let n=e.md.normalizeLink("mailto:"+o);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push("link_open","a",1);t.attrs=[["href",n]],t.markup="autolink",t.info="auto",e.push("text","",0).content=e.md.normalizeLinkText(o);let r=e.push("link_close","a",-1);r.markup="autolink",r.info="auto"}return e.pos+=o.length+2,!0}return!1}],["html_inline",function(e,t){let n;if(!e.md.options.html)return!1;let r=e.posMax,i=e.pos;if(60!==e.src.charCodeAt(i)||i+2>=r)return!1;let o=e.src.charCodeAt(i+1);if(33!==o&&63!==o&&47!==o&&(!((n=32|o)>=97)||!(n<=122)))return!1;let s=e.src.slice(i).match(hl);if(!s)return!1;if(!t){var l,a;let t=e.push("html_inline","",0);t.content=s[0],l=t.content,/^<a[>\s]/i.test(l)&&e.linkLevel++,a=t.content,/^<\/a\s*>/i.test(a)&&e.linkLevel--}return e.pos+=s[0].length,!0}],["entity",function(e,t){let n=e.pos,r=e.posMax;if(38!==e.src.charCodeAt(n)||n+1>=r)return!1;if(35===e.src.charCodeAt(n+1)){let r=e.src.slice(n).match(hb);if(r){if(!t){let t="x"===r[1][0].toLowerCase()?parseInt(r[1].slice(1),16):parseInt(r[1],10),n=e.push("text_special","",0);n.content=uw(t)?uC(t):uC(65533),n.markup=r[0],n.info="entity"}return e.pos+=r[0].length,!0}}else{let r=e.src.slice(n).match(hv);if(r){let n=uf(r[0]);if(n!==r[0]){if(!t){let t=e.push("text_special","",0);t.content=n,t.markup=r[0],t.info="entity"}return e.pos+=r[0].length,!0}}}return!1}]],hC=[["balance_pairs",function(e){let t=e.tokens_meta,n=e.tokens_meta.length;hx(e.delimiters);for(let e=0;e<n;e++)t[e]&&t[e].delimiters&&hx(t[e].delimiters)}],["strikethrough",function(e){let t=e.tokens_meta,n=e.tokens_meta.length;hm(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&hm(e,t[r].delimiters)}],["emphasis",function(e){let t=e.tokens_meta,n=e.tokens_meta.length;hg(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&hg(e,t[r].delimiters)}],["fragments_join",function(e){let t,n,r=0,i=e.tokens,o=e.tokens.length;for(t=n=0;t<o;t++)i[t].nesting<0&&r--,i[t].level=r,i[t].nesting>0&&r++,"text"===i[t].type&&t+1<o&&"text"===i[t+1].type?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}]];function hS(){this.ruler=new uG;for(let e=0;e<hw.length;e++)this.ruler.push(hw[e][0],hw[e][1]);this.ruler2=new uG;for(let e=0;e<hC.length;e++)this.ruler2.push(hC[e][0],hC[e][1])}function hM(e){let t=Array.prototype.slice.call(arguments,1);return t.forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function hE(e){return Object.prototype.toString.call(e)}function hA(e){return"[object Function]"===hE(e)}function hD(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}hS.prototype.skipToken=function(e){let t=e.pos,n=this.ruler.getRules(""),r=n.length,i=e.md.options.maxNesting,o=e.cache;if(void 0!==o[t]){e.pos=o[t];return}let s=!1;if(e.level<i){for(let i=0;i<r;i++)if(e.level++,s=n[i](e,!0),e.level--,s){if(t>=e.pos)throw Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;!s&&e.pos++,o[t]=e.pos},hS.prototype.tokenize=function(e){let t=this.ruler.getRules(""),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos<r;){let o=e.pos,s=!1;if(e.level<i){for(let r=0;r<n;r++)if(s=t[r](e,!1)){if(o>=e.pos)throw Error("inline rule didn't increment state.pos");break}}if(s){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},hS.prototype.parse=function(e,t,n,r){let i=new this.State(e,t,n,r);this.tokenize(i);let o=this.ruler2.getRules(""),s=o.length;for(let e=0;e<s;e++)o[e](i)},hS.prototype.State=hh;let h_={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1},hT={"http:":{validate:function(e,t,n){let r=e.slice(t);return(n.re.http||(n.re.http=RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r))?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){let r=e.slice(t);return(n.re.no_http||(n.re.no_http=RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r))?t>=3&&":"===e[t-3]||t>=3&&"/"===e[t-3]?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){let r=e.slice(t);return(n.re.mailto||(n.re.mailto=RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r))?r.match(n.re.mailto)[0].length:0}}},hN="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function hO(){return function(e,t){t.normalize(e)}}function hR(e){var t;let n,r,i=(t=e.__opts__,t=t||{},(n={}).src_Any=ue.source,n.src_Cc=ut.source,n.src_Z=ui.source,n.src_P=un.source,n.src_ZPCc=[n.src_Z,n.src_P,n.src_Cc].join("|"),n.src_ZCc=[n.src_Z,n.src_Cc].join("|"),n.src_pseudo_letter="(?:(?!"+(r="[><|]")+"|"+n.src_ZPCc+")"+n.src_Any+")",n.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",n.src_auth="(?:(?:(?!"+n.src_ZCc+"|[@/\\[\\]()]).)+@)?",n.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",n.src_host_terminator="(?=$|"+r+"|"+n.src_ZPCc+")(?!"+(t["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+n.src_ZPCc+"))",n.src_path="(?:[/?#](?:(?!"+n.src_ZCc+"|"+r+"|[()[\\]{}.,\"'?!\\-;]).|\\[(?:(?!"+n.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+n.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+n.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+n.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+n.src_ZCc+"|[']).)+\\'|\\'(?="+n.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+n.src_ZCc+"|[.]|$)|"+(t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+n.src_ZCc+"|$)|;(?!"+n.src_ZCc+"|$)|\\!+(?!"+n.src_ZCc+"|[!]|$)|\\?(?!"+n.src_ZCc+"|[?]|$))+|\\/)?",n.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',n.src_xn="xn--[a-z0-9\\-]{1,59}",n.src_domain_root="(?:"+n.src_xn+"|"+n.src_pseudo_letter+"{1,63})",n.src_domain="(?:"+n.src_xn+"|(?:"+n.src_pseudo_letter+")|(?:"+n.src_pseudo_letter+"(?:-|"+n.src_pseudo_letter+"){0,61}"+n.src_pseudo_letter+"))",n.src_host="(?:(?:(?:(?:"+n.src_domain+")\\.)*"+n.src_domain+"))",n.tpl_host_fuzzy="(?:"+n.src_ip4+"|(?:(?:(?:"+n.src_domain+")\\.)+(?:%TLDS%)))",n.tpl_host_no_ip_fuzzy="(?:(?:(?:"+n.src_domain+")\\.)+(?:%TLDS%))",n.src_host_strict=n.src_host+n.src_host_terminator,n.tpl_host_fuzzy_strict=n.tpl_host_fuzzy+n.src_host_terminator,n.src_host_port_strict=n.src_host+n.src_port+n.src_host_terminator,n.tpl_host_port_fuzzy_strict=n.tpl_host_fuzzy+n.src_port+n.src_host_terminator,n.tpl_host_port_no_ip_fuzzy_strict=n.tpl_host_no_ip_fuzzy+n.src_port+n.src_host_terminator,n.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+n.src_ZPCc+"|>|$))",n.tpl_email_fuzzy="(^|"+r+'|"|\\(|'+n.src_ZCc+")("+n.src_email_name+"@"+n.tpl_host_fuzzy_strict+")",n.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+n.src_ZPCc+"))((?![$+<=>^`||])"+n.tpl_host_port_fuzzy_strict+n.src_path+")",n.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+n.src_ZPCc+"))((?![$+<=>^`||])"+n.tpl_host_port_no_ip_fuzzy_strict+n.src_path+")",e.re=n),o=e.__tlds__.slice();function s(e){return e.replace("%TLDS%",i.src_tlds)}e.onCompile(),e.__tlds_replaced__||o.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),o.push(i.src_xn),i.src_tlds=o.join("|"),i.email_fuzzy=RegExp(s(i.tpl_email_fuzzy),"i"),i.link_fuzzy=RegExp(s(i.tpl_link_fuzzy),"i"),i.link_no_ip_fuzzy=RegExp(s(i.tpl_link_no_ip_fuzzy),"i"),i.host_fuzzy_test=RegExp(s(i.tpl_host_fuzzy_test),"i");let l=[];function a(e,t){throw Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}e.__compiled__={},Object.keys(e.__schemas__).forEach(function(t){let n=e.__schemas__[t];if(null===n)return;let r={validate:null,link:null};if(e.__compiled__[t]=r,"[object Object]"===hE(n)){if("[object RegExp]"===hE(n.validate)){var i;i=n.validate,r.validate=function(e,t){let n=e.slice(t);return i.test(n)?n.match(i)[0].length:0}}else hA(n.validate)?r.validate=n.validate:a(t,n);hA(n.normalize)?r.normalize=n.normalize:n.normalize?a(t,n):r.normalize=hO();return}"[object String]"===hE(n)?l.push(t):a(t,n)}),l.forEach(function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)}),e.__compiled__[""]={validate:null,normalize:hO()};let c=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map(hD).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+i.src_ZPCc+"))("+c+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+i.src_ZPCc+"))("+c+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),e.__index__=-1,e.__text_cache__=""}function hF(e,t){let n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function hI(e,t){let n=new hF(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function hL(e,t){if(!(this instanceof hL))return new hL(e,t);!t&&Object.keys(e||{}).reduce(function(e,t){return e||h_.hasOwnProperty(t)},!1)&&(t=e,e={}),this.__opts__=hM({},h_,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=hM({},hT,e),this.__compiled__={},this.__tlds__=hN,this.__tlds_replaced__=!1,this.re={},hR(this)}hL.prototype.add=function(e,t){return this.__schemas__[e]=t,hR(this),this},hL.prototype.set=function(e){return this.__opts__=hM(this.__opts__,e),this},hL.prototype.test=function(e){let t,n,r,i,o,s,l,a;if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;if(this.re.schema_test.test(e)){for((l=this.re.schema_search).lastIndex=0;null!==(t=l.exec(e));)if(i=this.testSchemaAt(e,t[2],l.lastIndex)){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(a=e.search(this.re.host_fuzzy_test))>=0&&(this.__index__<0||a<this.__index__)&&null!==(n=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))&&(o=n.index+n[1].length,(this.__index__<0||o<this.__index__)&&(this.__schema__="",this.__index__=o,this.__last_index__=n.index+n[0].length)),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&e.indexOf("@")>=0&&null!==(r=e.match(this.re.email_fuzzy))&&(o=r.index+r[1].length,s=r.index+r[0].length,(this.__index__<0||o<this.__index__||o===this.__index__&&s>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=s)),this.__index__>=0},hL.prototype.pretest=function(e){return this.re.pretest.test(e)},hL.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},hL.prototype.match=function(e){let t=[],n=0;this.__index__>=0&&this.__text_cache__===e&&(t.push(hI(this,n)),n=this.__last_index__);let r=n?e.slice(n):e;for(;this.test(r);)t.push(hI(this,n)),r=r.slice(this.__last_index__),n+=this.__last_index__;return t.length?t:null},hL.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;let t=this.re.schema_at_start.exec(e);if(!t)return null;let n=this.testSchemaAt(e,t[2],t[0].length);return n?(this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+n,hI(this,0)):null},hL.prototype.tlds=function(e,t){return(e=Array.isArray(e)?e:[e],t)?this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,n){return e!==n[t-1]}).reverse():(this.__tlds__=e.slice(),this.__tlds_replaced__=!0),hR(this),this},hL.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)},hL.prototype.onCompile=function(){};let hz=/^xn--/,hj=/[^\0-\x7F]/,hB=/[\x2E\u3002\uFF0E\uFF61]/g,hP={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h$=Math.floor,hq=String.fromCharCode;function hV(e){throw RangeError(hP[e])}function hH(e,t){let n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+(function(e,t){let n=[],r=e.length;for(;r--;)n[r]=t(e[r]);return n})((e=e.replace(hB,".")).split("."),t).join(".")}let hW=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},hU=function(e,t,n){let r=0;for(e=n?h$(e/700):e>>1,e+=h$(e/t);e>455;r+=36)e=h$(e/35);return h$(r+36*e/(e+38))},hK=function(e){let t=[],n=e.length,r=0,i=128,o=72,s=e.lastIndexOf("-");s<0&&(s=0);for(let n=0;n<s;++n)e.charCodeAt(n)>=128&&hV("not-basic"),t.push(e.charCodeAt(n));for(let a=s>0?s+1:0;a<n;){let s=r;for(let t=1,i=36;;i+=36){var l;a>=n&&hV("invalid-input");let s=(l=e.charCodeAt(a++))>=48&&l<58?26+(l-48):l>=65&&l<91?l-65:l>=97&&l<123?l-97:36;s>=36&&hV("invalid-input"),s>h$((0x7fffffff-r)/t)&&hV("overflow"),r+=s*t;let c=i<=o?1:i>=o+26?26:i-o;if(s<c)break;let d=36-c;t>h$(0x7fffffff/d)&&hV("overflow"),t*=d}let c=t.length+1;o=hU(r-s,c,0==s),h$(r/c)>0x7fffffff-i&&hV("overflow"),i+=h$(r/c),r%=c,t.splice(r++,0,i)}return String.fromCodePoint(...t)},hJ=function(e){let t=[],n=(e=function(e){let t=[],n=0,r=e.length;for(;n<r;){let i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){let r=e.charCodeAt(n++);(64512&r)==56320?t.push(((1023&i)<<10)+(1023&r)+65536):(t.push(i),n--)}else t.push(i)}return t}(e)).length,r=128,i=0,o=72;for(let n of e)n<128&&t.push(hq(n));let s=t.length,l=s;for(s&&t.push("-");l<n;){let n=0x7fffffff;for(let t of e)t>=r&&t<n&&(n=t);let a=l+1;for(let c of(n-r>h$((0x7fffffff-i)/a)&&hV("overflow"),i+=(n-r)*a,r=n,e))if(c<r&&++i>0x7fffffff&&hV("overflow"),c===r){let e=i;for(let n=36;;n+=36){let r=n<=o?1:n>=o+26?26:n-o;if(e<r)break;let i=e-r,s=36-r;t.push(hq(hW(r+i%s,0))),e=h$(i/s)}t.push(hq(hW(e,0))),o=hU(i,a,l===s),i=0,++l}++i,++r}return t.join("")},hG={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},hZ=/^(vbscript|javascript|file|data):/,hX=/^data:image\/(gif|png|jpeg|webp);/;function hQ(e){let t=e.trim().toLowerCase();return!hZ.test(t)||hX.test(t)}let hY=["http:","https:","mailto:"];function h0(e){let t=d8(e,!0);if(t.hostname&&(!t.protocol||hY.indexOf(t.protocol)>=0))try{var n;n=t.hostname,t.hostname=hH(n,function(e){return hj.test(e)?"xn--"+hJ(e):e})}catch(e){}return dZ(dX(t))}function h1(e){let t=d8(e,!0);if(t.hostname&&(!t.protocol||hY.indexOf(t.protocol)>=0))try{var n;n=t.hostname,t.hostname=hH(n,function(e){return hz.test(e)?hK(e.slice(4).toLowerCase()):e})}catch(e){}return dJ(dX(t),dJ.defaultChars+"%")}function h2(e,t){if(!(this instanceof h2))return new h2(e,t);t||uq.isString(e)||(t=e||{},e="default"),this.inline=new hS,this.block=new hu,this.core=new u7,this.renderer=new uJ,this.linkify=new hL,this.validateLink=hQ,this.normalizeLink=h0,this.normalizeLinkText=h1,this.utils=uq,this.helpers=uq.assign({},uU),this.options={},this.configure(e),t&&this.set(t)}h2.prototype.set=function(e){return uq.assign(this.options,e),this},h2.prototype.configure=function(e){let t=this;if(uq.isString(e)){let t=e;if(!(e=hG[t]))throw Error('Wrong `markdown-it` preset "'+t+'", check name')}if(!e)throw Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this},h2.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(t){n=n.concat(this[t].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));let r=e.filter(function(e){return 0>n.indexOf(e)});if(r.length&&!t)throw Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this},h2.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(t){n=n.concat(this[t].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));let r=e.filter(function(e){return 0>n.indexOf(e)});if(r.length&&!t)throw Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this},h2.prototype.use=function(e){let t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},h2.prototype.parse=function(e,t){if("string"!=typeof e)throw Error("Input data should be a String");let n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},h2.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},h2.prototype.parseInline=function(e,t){let n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},h2.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};let h3=new eh({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:()=>["p",0]},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM:()=>["blockquote",0]},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["div",["hr"]]},heading:{attrs:{level:{default:1}},content:"(text | image)*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM:e=>["h"+e.attrs.level,0]},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>({params:e.getAttribute("data-params")||""})}],toDOM:e=>["pre",e.attrs.params?{"data-params":e.attrs.params}:{},["code",0]]},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs:e=>({order:e.hasAttribute("start")?+e.getAttribute("start"):1,tight:e.hasAttribute("data-tight")})}],toDOM:e=>["ol",{start:1==e.attrs.order?null:e.attrs.order,"data-tight":e.attrs.tight?"true":null},0]},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:e=>({tight:e.hasAttribute("data-tight")})}],toDOM:e=>["ul",{"data-tight":e.attrs.tight?"true":null},0]},list_item:{content:"block+",defining:!0,parseDOM:[{tag:"li"}],toDOM:()=>["li",0]},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs:e=>({src:e.getAttribute("src"),title:e.getAttribute("title"),alt:e.getAttribute("alt")})}],toDOM:e=>["img",e.attrs]},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:()=>["br"]}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:e=>"em"==e.type.name}],toDOM:()=>["em"]},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!=e.style.fontWeight&&null},{style:"font-weight=400",clearMark:e=>"strong"==e.type.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM:()=>["strong"]},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:e=>({href:e.getAttribute("href"),title:e.getAttribute("title")})}],toDOM:e=>["a",e.attrs]},code:{code:!0,parseDOM:[{tag:"code"}],toDOM:()=>["code"]}}});class h5{constructor(e,t){this.schema=e,this.tokenHandlers=t,this.stack=[{type:e.topNodeType,attrs:null,content:[],marks:L.none}]}top(){return this.stack[this.stack.length-1]}push(e){this.stack.length&&this.top().content.push(e)}addText(e){if(!e)return;let t=this.top(),n=t.content,r=n[n.length-1],i=this.schema.text(e,t.marks),o;r&&(o=function(e,t){if(e.isText&&t.isText&&L.sameSet(e.marks,t.marks))return e.withText(e.text+t.text)}(r,i))?n[n.length-1]=o:n.push(i)}openMark(e){let t=this.top();t.marks=e.addToSet(t.marks)}closeMark(e){let t=this.top();t.marks=e.removeFromSet(t.marks)}parseTokens(e){for(let t=0;t<e.length;t++){let n=e[t],r=this.tokenHandlers[n.type];if(!r)throw Error("Token type `"+n.type+"` not supported by Markdown parser");r(this,n,e,t)}}addNode(e,t,n){let r=this.top(),i=e.createAndFill(t,n,r?r.marks:[]);return i?(this.push(i),i):null}openNode(e,t){this.stack.push({type:e,attrs:t,content:[],marks:L.none})}closeNode(){let e=this.stack.pop();return this.addNode(e.type,e.attrs,e.content)}}function h4(e,t,n,r){return e.getAttrs?e.getAttrs(t,n,r):e.attrs instanceof Function?e.attrs(t):e.attrs}function h6(e,t){return e.noCloseToken||"code_inline"==t||"code_block"==t||"fence"==t}function h9(e){return"\n"==e[e.length-1]?e.slice(0,e.length-1):e}function h8(){}function h7(e,t){for(;++t<e.length;)if("list_item_open"!=e[t].type)return e[t].hidden;return!1}new class{constructor(e,t,n){this.schema=e,this.tokenizer=t,this.tokens=n,this.tokenHandlers=function(e,t){let n=Object.create(null);for(let r in t){let i=t[r];if(i.block){let t=e.nodeType(i.block);h6(i,r)?n[r]=(e,n,r,o)=>{e.openNode(t,h4(i,n,r,o)),e.addText(h9(n.content)),e.closeNode()}:(n[r+"_open"]=(e,n,r,o)=>e.openNode(t,h4(i,n,r,o)),n[r+"_close"]=e=>e.closeNode())}else if(i.node){let t=e.nodeType(i.node);n[r]=(e,n,r,o)=>e.addNode(t,h4(i,n,r,o))}else if(i.mark){let t=e.marks[i.mark];h6(i,r)?n[r]=(e,n,r,o)=>{e.openMark(t.create(h4(i,n,r,o))),e.addText(h9(n.content)),e.closeMark(t)}:(n[r+"_open"]=(e,n,r,o)=>e.openMark(t.create(h4(i,n,r,o))),n[r+"_close"]=e=>e.closeMark(t))}else if(i.ignore)h6(i,r)?n[r]=h8:(n[r+"_open"]=h8,n[r+"_close"]=h8);else throw RangeError("Unrecognized parsing spec "+JSON.stringify(i))}return n.text=(e,t)=>e.addText(t.content),n.inline=(e,t)=>e.parseTokens(t.children),n.softbreak=n.softbreak||(e=>e.addText(" ")),n}(e,n)}parse(e,t={}){let n=new h5(this.schema,this.tokenHandlers),r;n.parseTokens(this.tokenizer.parse(e,t));do r=n.closeNode();while(n.stack.length)return r||this.schema.topNodeType.createAndFill()}}(h3,h2("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:(e,t,n)=>({tight:h7(t,n)})},ordered_list:{block:"ordered_list",getAttrs:(e,t,n)=>({order:+e.attrGet("start")||1,tight:h7(t,n)})},heading:{block:"heading",getAttrs:e=>({level:+e.tag.slice(1)})},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:e=>({params:e.info||""}),noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:e=>({src:e.attrGet("src"),title:e.attrGet("title")||null,alt:e.children[0]&&e.children[0].content||null})},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:e=>({href:e.attrGet("href"),title:e.attrGet("title")||null})},code_inline:{mark:"code",noCloseToken:!0}});let pe={open:"",close:"",mixable:!0},pt=new class{constructor(e,t,n={}){this.nodes=e,this.marks=t,this.options=n}serialize(e,t={}){t=Object.assign({},this.options,t);let n=new pr(this.nodes,this.marks,t);return n.renderContent(e),n.out}}({blockquote(e,t){e.wrapBlock("> ",null,t,()=>e.renderContent(t))},code_block(e,t){let n=t.textContent.match(/`{3,}/gm),r=n?n.sort().slice(-1)[0]+"`":"```";e.write(r+(t.attrs.params||"")+"\n"),e.text(t.textContent,!1),e.write("\n"),e.write(r),e.closeBlock(t)},heading(e,t){e.write(e.repeat("#",t.attrs.level)+" "),e.renderInline(t,!1),e.closeBlock(t)},horizontal_rule(e,t){e.write(t.attrs.markup||"---"),e.closeBlock(t)},bullet_list(e,t){e.renderList(t," ",()=>(t.attrs.bullet||"*")+" ")},ordered_list(e,t){let n=t.attrs.order||1,r=String(n+t.childCount-1).length,i=e.repeat(" ",r+2);e.renderList(t,i,t=>{let i=String(n+t);return e.repeat(" ",r-i.length)+i+". "})},list_item(e,t){e.renderContent(t)},paragraph(e,t){e.renderInline(t),e.closeBlock(t)},image(e,t){e.write("]/g,"\\$&")+(t.attrs.title?' "'+t.attrs.title.replace(/"/g,'\\"')+'"':"")+")")},hard_break(e,t,n,r){for(let i=r+1;i<n.childCount;i++)if(n.child(i).type!=t.type)return void e.write("\\\n")},text(e,t){e.text(t.text,!e.inAutolink)}},{em:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},strong:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},link:{open:(e,t,n,r)=>(e.inAutolink=function(e,t,n){if(e.attrs.title||!/^\w+:/.test(e.attrs.href))return!1;let r=t.child(n);return!!r.isText&&r.text==e.attrs.href&&r.marks[r.marks.length-1]==e&&(n==t.childCount-1||!e.isInSet(t.child(n+1).marks))}(t,n,r),e.inAutolink?"<":"["),close(e,t,n,r){let{inAutolink:i}=e;return e.inAutolink=void 0,i?">":"]("+t.attrs.href.replace(/[\(\)"]/g,"\\$&")+(t.attrs.title?` "${t.attrs.title.replace(/"/g,'\\"')}"`:"")+")"},mixable:!0},code:{open:(e,t,n,r)=>pn(n.child(r),-1),close:(e,t,n,r)=>pn(n.child(r-1),1),escape:!1}});function pn(e,t){let n=/`+/g,r,i=0;if(e.isText)for(;r=n.exec(e.text);)i=Math.max(i,r[0].length);let o=i>0&&t>0?" `":"`";for(let e=0;e<i;e++)o+="`";return i>0&&t<0&&(o+=" "),o}class pr{constructor(e,t,n){this.nodes=e,this.marks=t,this.options=n,this.delim="",this.out="",this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,void 0===this.options.tightLists&&(this.options.tightLists=!1),void 0===this.options.hardBreakNodeName&&(this.options.hardBreakNodeName="hard_break")}flushClose(e=2){if(this.closed){if(this.atBlank()||(this.out+="\n"),e>1){let t=this.delim,n=/\s+$/.exec(t);n&&(t=t.slice(0,t.length-n[0].length));for(let n=1;n<e;n++)this.out+=t+"\n"}this.closed=null}}getMark(e){let t=this.marks[e];if(!t){if(!1!==this.options.strict)throw Error(`Mark type \`${e}\` not supported by Markdown renderer`);t=pe}return t}wrapBlock(e,t,n,r){let i=this.delim;this.write(null!=t?t:e),this.delim+=e,r(),this.delim=i,this.closeBlock(n)}atBlank(){return/(^|\n)$/.test(this.out)}ensureNewLine(){this.atBlank()||(this.out+="\n")}write(e){this.flushClose(),this.delim&&this.atBlank()&&(this.out+=this.delim),e&&(this.out+=e)}closeBlock(e){this.closed=e}text(e,t=!0){let n=e.split("\n");for(let e=0;e<n.length;e++)this.write(),!t&&"["==n[e][0]&&/(^|[^\\])\!$/.test(this.out)&&(this.out=this.out.slice(0,this.out.length-1)+"\\!"),this.out+=t?this.esc(n[e],this.atBlockStart):n[e],e!=n.length-1&&(this.out+="\n")}render(e,t,n){if(this.nodes[e.type.name])this.nodes[e.type.name](this,e,t,n);else if(!1!==this.options.strict)throw Error("Token type `"+e.type.name+"` not supported by Markdown renderer");else!e.type.isLeaf&&(e.type.inlineContent?this.renderInline(e):this.renderContent(e),e.isBlock&&this.closeBlock(e))}renderContent(e){e.forEach((t,n,r)=>this.render(t,e,r))}renderInline(e,t=!0){this.atBlockStart=t;let n=[],r="",i=(t,i,o)=>{let s=t?t.marks:[];t&&t.type.name===this.options.hardBreakNodeName&&(s=s.filter(t=>{if(o+1==e.childCount)return!1;let n=e.child(o+1);return t.isInSet(n.marks)&&(!n.isText||/\S/.test(n.text))}));let l=r;if(r="",t&&t.isText&&s.some(e=>{let t=this.getMark(e.type.name);return t&&t.expelEnclosingWhitespace&&!e.isInSet(n)})){let[e,r,i]=/^(\s*)(.*)$/m.exec(t.text);r&&(l+=r,(t=i?t.withText(i):null)||(s=n))}if(t&&t.isText&&s.some(t=>{let n=this.getMark(t.type.name);return n&&n.expelEnclosingWhitespace&&!this.isMarkAhead(e,o+1,t)})){let[e,i,o]=/^(.*?)(\s*)$/m.exec(t.text);o&&(r=o,(t=i?t.withText(i):null)||(s=n))}let a=s.length?s[s.length-1]:null,c=a&&!1===this.getMark(a.type.name).escape,d=s.length-!!c;n:for(let e=0;e<d;e++){let t=s[e];if(!this.getMark(t.type.name).mixable)break;for(let r=0;r<n.length;r++){let i=n[r];if(!this.getMark(i.type.name).mixable)break;if(t.eq(i)){e>r?s=s.slice(0,r).concat(t).concat(s.slice(r,e)).concat(s.slice(e+1,d)):r>e&&(s=s.slice(0,e).concat(s.slice(e+1,r)).concat(t).concat(s.slice(r,d)));continue n}}}let u=0;for(;u<Math.min(n.length,d)&&s[u].eq(n[u]);)++u;for(;u<n.length;)this.text(this.markString(n.pop(),!1,e,o),!1);if(l&&this.text(l),t){for(;n.length<d;){let t=s[n.length];n.push(t),this.text(this.markString(t,!0,e,o),!1),this.atBlockStart=!1}c&&t.isText?this.text(this.markString(a,!0,e,o)+t.text+this.markString(a,!1,e,o+1),!1):this.render(t,e,o),this.atBlockStart=!1}(null==t?void 0:t.isText)&&t.nodeSize>0&&(this.atBlockStart=!1)};e.forEach(i),i(null,0,e.childCount),this.atBlockStart=!1}renderList(e,t,n){this.closed&&this.closed.type==e.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let r=void 0!==e.attrs.tight?e.attrs.tight:this.options.tightLists,i=this.inTightList;this.inTightList=r,e.forEach((i,o,s)=>{s&&r&&this.flushClose(1),this.wrapBlock(t,n(s),e,()=>this.render(i,e,s))}),this.inTightList=i}esc(e,t=!1){return e=e.replace(/[`*\\~\[\]_]/g,(t,n)=>"_"==t&&n>0&&n+1<e.length&&e[n-1].match(/\w/)&&e[n+1].match(/\w/)?t:"\\"+t),t&&(e=e.replace(/^(\+[ ]|[\-*>])/,"\\$&").replace(/^(\s*)(#{1,6})(\s|$)/,"$1\\$2$3").replace(/^(\s*\d+)\.\s/,"$1\\. ")),this.options.escapeExtraCharacters&&(e=e.replace(this.options.escapeExtraCharacters,"\\$&")),e}quote(e){let t=-1==e.indexOf('"')?'""':-1==e.indexOf("'")?"''":"()";return t[0]+e+t[1]}repeat(e,t){let n="";for(let r=0;r<t;r++)n+=e;return n}markString(e,t,n,r){let i=this.getMark(e.type.name),o=t?i.open:i.close;return"string"==typeof o?o:o(this,e,n,r)}getEnclosingWhitespace(e){return{leading:(e.match(/^(\s+)/)||[void 0])[0],trailing:(e.match(/(\s+)$/)||[void 0])[0]}}isMarkAhead(e,t,n){for(;;t++){if(t>=e.childCount)return!1;let r=e.child(t);if(r.type.name!=this.options.hardBreakNodeName)return n.isInSet(r.marks);t++}}}var pi=e.i(96736),po=Object.defineProperty,ps=(e,t,n)=>{let r;return(r="symbol"!=typeof t?t+"":t)in e?po(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,n};let pl=sz.create({name:"markdownTightLists",addOptions:()=>({tight:!0,tightClass:"tight",listTypes:["bulletList","orderedList"]}),addGlobalAttributes(){return[{types:this.options.listTypes,attributes:{tight:{default:this.options.tight,parseHTML:e=>"true"===e.getAttribute("data-tight")||!e.querySelector("p"),renderHTML:e=>({class:e.tight?this.options.tightClass:null,"data-tight":e.tight?"true":null})}}}]},addCommands(){var e=this;return{toggleTight:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return n=>{let{editor:r,commands:i}=n;return e.options.listTypes.some(e=>(function(e){if(!r.isActive(e))return!1;let n=r.getAttributes(e);return i.updateAttributes(e,{tight:null!=t?t:!(null!=n&&n.tight)})})(e))}}}}}),pa=h2();function pc(e,t){return pa.inline.State.prototype.scanDelims.call({src:e,posMax:e.length}),new pa.inline.State(e,null,null,[]).scanDelims(t,!0)}function pd(e,t,n,r){let i=e.substring(0,n)+e.substring(n+t.length);return i.substring(0,n+r)+t+i.substring(n+r)}class pu extends pr{constructor(e,t,n){super(e,t,null!=n?n:{}),ps(this,"inTable",!1),this.inlines=[]}render(e,t,n){super.render(e,t,n);let r=this.inlines[this.inlines.length-1];if(null!=r&&r.start&&null!=r&&r.end){var i;let e,{delimiter:t,start:n,end:o}=this.normalizeInline(r);this.out=(i=this.out,(e=function(e,t,n,r){let i=r,o=e;for(;i>n&&!pc(o,i).can_close;)o=pd(o,t,i,-1),i--;return{text:o,from:n,to:i}}((e=function(e,t,n,r){let i=n,o=e;for(;i<r&&!pc(o,i).can_open;)o=pd(o,t,i,1),i++;return{text:o,from:i,to:r}}((e={text:i,from:n,to:o}).text,t,e.from,e.to)).text,t,e.from,e.to)).to-e.from<t.length+1&&(e.text=e.text.substring(0,e.from)+e.text.substring(e.to+t.length)),e.text),this.inlines.pop()}}markString(e,t,n,r){let i=this.marks[e.type.name];if(i.expelEnclosingWhitespace)if(t)this.inlines.push({start:this.out.length,delimiter:i.open});else{let e=this.inlines.pop();this.inlines.push({...e,end:this.out.length})}return super.markString(e,t,n,r)}normalizeInline(e){let{start:t,end:n}=e;for(;this.out.charAt(t).match(/\s/);)t++;return{...e,start:t}}}let ph=sO.create({name:"markdownHTMLMark",addStorage:()=>({markdown:{serialize:{open(e,t){var n,r;return this.editor.storage.markdown.options.html?null!=(n=null==(r=pp(t))?void 0:r[0])?n:"":(console.warn(`Tiptap Markdown: "${t.type.name}" mark is only available in html mode`),"")},close(e,t){var n,r;return this.editor.storage.markdown.options.html&&null!=(n=null==(r=pp(t))?void 0:r[1])?n:""}},parse:{}}})});function pp(e){let t=e.type.schema,n=t.text(" ",[e]),r=oj(O.from(n),t).match(/^(<.*?>) (<\/.*?>)$/);return r?[r[1],r[2]]:null}function pf(e){let t=`<body>${e}</body>`;return new window.DOMParser().parseFromString(t,"text/html").body}let pm=li.create({name:"markdownHTMLNode",addStorage:()=>({markdown:{serialize(e,t,n){var r,i;let o,s,l;this.editor.storage.markdown.options.html?e.write((r=t,i=n,o=r.type.schema,s=oj(O.from(r),o),r.isBlock&&(i instanceof O||i.type.name===o.topNodeType.name)?((l=pf(s).firstElementChild).innerHTML=l.innerHTML.trim()?`
|
|
91
|
+
${l.innerHTML}
|
|
92
|
+
`:`
|
|
93
|
+
`,l.outerHTML):s)):(console.warn(`Tiptap Markdown: "${t.type.name}" node is only available in html mode`),e.write(`[${t.type.name}]`)),t.isBlock&&e.closeBlock(t)},parse:{}}})}),pg=li.create({name:"blockquote"}).extend({addStorage:()=>({markdown:{serialize:pt.nodes.blockquote,parse:{}}})}),py=li.create({name:"bulletList"}).extend({addStorage:()=>({markdown:{serialize(e,t){return e.renderList(t," ",()=>(this.editor.storage.markdown.options.bulletListMarker||"-")+" ")},parse:{}}})}),pk=li.create({name:"codeBlock"}).extend({addStorage:()=>({markdown:{serialize(e,t){e.write("```"+(t.attrs.language||"")+"\n"),e.text(t.textContent,!1),e.ensureNewLine(),e.write("```"),e.closeBlock(t)},parse:{setup(e){var t;e.set({langPrefix:null!=(t=this.options.languageClassPrefix)?t:"language-"})},updateDOM(e){e.innerHTML=e.innerHTML.replace(/\n<\/code><\/pre>/g,"</code></pre>")}}}})}),pb=li.create({name:"hardBreak"}).extend({addStorage:()=>({markdown:{serialize(e,t,n,r){for(let i=r+1;i<n.childCount;i++)if(n.child(i).type!=t.type)return void e.write(e.inTable?pm.storage.markdown.serialize.call(this,e,t,n):"\\\n")},parse:{}}})}),pv=li.create({name:"heading"}).extend({addStorage:()=>({markdown:{serialize:pt.nodes.heading,parse:{}}})}),px=li.create({name:"horizontalRule"}).extend({addStorage:()=>({markdown:{serialize:pt.nodes.horizontal_rule,parse:{}}})}),pw=li.create({name:"image"}).extend({addStorage:()=>({markdown:{serialize:pt.nodes.image,parse:{}}})}),pC=li.create({name:"listItem"}).extend({addStorage:()=>({markdown:{serialize:pt.nodes.list_item,parse:{}}})}),pS=li.create({name:"orderedList"}).extend({addStorage:()=>({markdown:{serialize(e,t,n,r){let i=t.attrs.start||1,o=String(i+t.childCount-1).length,s=e.repeat(" ",o+2),l=function(e,t,n){let r=0;for(;n-r>0&&t.child(n-r-1).type.name===e.type.name;r++);return r}(t,n,r)%2?") ":". ";e.renderList(t,s,t=>{let n=String(i+t);return e.repeat(" ",o-n.length)+n+l})},parse:{}}})}),pM=li.create({name:"paragraph"}).extend({addStorage:()=>({markdown:{serialize:pt.nodes.paragraph,parse:{}}})});function pE(e){var t,n;return null!=(t=null==e||null==(n=e.content)?void 0:n.content)?t:[]}let pA=li.create({name:"table"}).extend({addStorage:()=>({markdown:{serialize(e,t,n){let r,i,o;(i=(r=pE(t))[0],o=r.slice(1),pE(i).some(e=>"tableHeader"!==e.type.name||pD(e)||e.childCount>1)||o.some(e=>pE(e).some(e=>"tableHeader"===e.type.name||pD(e)||e.childCount>1)))?pm.storage.markdown.serialize.call(this,e,t,n):(e.inTable=!0,t.forEach((t,n,r)=>{if(e.write("| "),t.forEach((t,n,r)=>{r&&e.write(" | ");let i=t.firstChild;i.textContent.trim()&&e.renderInline(i)}),e.write(" |"),e.ensureNewLine(),!r){let n=Array.from({length:t.childCount}).map(()=>"---").join(" | ");e.write(`| ${n} |`),e.ensureNewLine()}}),e.closeBlock(t),e.inTable=!1)},parse:{}}})});function pD(e){return e.attrs.colspan>1||e.attrs.rowspan>1}let p_=li.create({name:"taskItem"}).extend({addStorage:()=>({markdown:{serialize(e,t){let n=t.attrs.checked?"[x]":"[ ]";e.write(`${n} `),e.renderContent(t)},parse:{updateDOM(e){[...e.querySelectorAll(".task-list-item")].forEach(e=>{let t=e.querySelector("input");e.setAttribute("data-type","taskItem"),t&&(e.setAttribute("data-checked",t.checked),t.remove())})}}}})}),pT=li.create({name:"taskList"}).extend({addStorage:()=>({markdown:{serialize:py.storage.markdown.serialize,parse:{setup(e){e.use(pi.default)},updateDOM(e){[...e.querySelectorAll(".contains-task-list")].forEach(e=>{e.setAttribute("data-type","taskList")})}}}})}),pN=[pg,py,pk,pb,pv,px,pm,pw,pC,pS,pM,pA,p_,pT,li.create({name:"text"}).extend({addStorage:()=>({markdown:{serialize(e,t){var n;e.text(null==(n=t.text)?void 0:n.replace(/</g,"<").replace(/>/g,">"))},parse:{}}})}),sO.create({name:"bold"}).extend({addStorage:()=>({markdown:{serialize:pt.marks.strong,parse:{}}})}),sO.create({name:"code"}).extend({addStorage:()=>({markdown:{serialize:pt.marks.code,parse:{}}})}),ph,sO.create({name:"italic"}).extend({addStorage:()=>({markdown:{serialize:pt.marks.em,parse:{}}})}),sO.create({name:"link"}).extend({addStorage:()=>({markdown:{serialize:pt.marks.link,parse:{}}})}),sO.create({name:"strike"}).extend({addStorage:()=>({markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}})})];function pO(e){var t,n;let r=null==(t=e.storage)?void 0:t.markdown,i=null==(n=pN.find(t=>t.name===e.name))?void 0:n.storage.markdown;return r||i?{...i,...r}:null}class pR{constructor(e){ps(this,"editor",null),this.editor=e}serialize(e){let t=new pu(this.nodes,this.marks,{hardBreakNodeName:pb.name});return t.renderContent(e),t.out}get nodes(){var e;return{...Object.fromEntries(Object.keys(this.editor.schema.nodes).map(e=>[e,this.serializeNode(pm)])),...Object.fromEntries(null!=(e=this.editor.extensionManager.extensions.filter(e=>"node"===e.type&&this.serializeNode(e)).map(e=>[e.name,this.serializeNode(e)]))?e:[])}}get marks(){var e;return{...Object.fromEntries(Object.keys(this.editor.schema.marks).map(e=>[e,this.serializeMark(ph)])),...Object.fromEntries(null!=(e=this.editor.extensionManager.extensions.filter(e=>"mark"===e.type&&this.serializeMark(e)).map(e=>[e.name,this.serializeMark(e)]))?e:[])}}serializeNode(e){var t;return null==(t=pO(e))||null==(t=t.serialize)?void 0:t.bind({editor:this.editor,options:e.options})}serializeMark(e){var t;let n=null==(t=pO(e))?void 0:t.serialize;return n?{...n,open:"function"==typeof n.open?n.open.bind({editor:this.editor,options:e.options}):n.open,close:"function"==typeof n.close?n.close.bind({editor:this.editor,options:e.options}):n.close}:null}}class pF{constructor(e,t){ps(this,"editor",null),ps(this,"md",null);let{html:n,linkify:r,breaks:i}=t;this.editor=e,this.md=this.withPatchedRenderer(h2({html:n,linkify:r,breaks:i}))}parse(e){let{inline:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof e){this.editor.extensionManager.extensions.forEach(e=>{var t;return null==(t=pO(e))||null==(t=t.parse)||null==(t=t.setup)?void 0:t.call({editor:this.editor,options:e.options},this.md)});let n=pf(this.md.render(e));return this.editor.extensionManager.extensions.forEach(e=>{var t;return null==(t=pO(e))||null==(t=t.parse)||null==(t=t.updateDOM)?void 0:t.call({editor:this.editor,options:e.options},n)}),this.normalizeDOM(n,{inline:t,content:e}),n.innerHTML}return e}normalizeDOM(e,t){let{inline:n,content:r}=t;return this.normalizeBlocks(e),e.querySelectorAll("*").forEach(e=>{var t;(null==(t=e.nextSibling)?void 0:t.nodeType)!==Node.TEXT_NODE||e.closest("pre")||(e.nextSibling.textContent=e.nextSibling.textContent.replace(/^\n/,""))}),n&&this.normalizeInline(e,r),e}normalizeBlocks(e){let t=Object.values(this.editor.schema.nodes).filter(e=>e.isBlock).map(e=>{var t;return null==(t=e.spec.parseDOM)?void 0:t.map(e=>e.tag)}).flat().filter(Boolean).join(",");t&&[...e.querySelectorAll(t)].forEach(e=>{e.parentElement.matches("p")&&function(e){let t=e.parentElement,n=t.cloneNode();for(;t.firstChild&&t.firstChild!==e;)n.appendChild(t.firstChild);n.childNodes.length>0&&t.parentElement.insertBefore(n,t),t.parentElement.insertBefore(e,t),0===t.childNodes.length&&t.remove()}(e)})}normalizeInline(e,t){var n,r,i,o,s;if(null!=(n=e.firstElementChild)&&n.matches("p")){let n=e.firstElementChild,{nextElementSibling:l}=n,a=null!=(r=null==(i=t.match(/^\s+/))?void 0:i[0])?r:"",c=l?"":null!=(o=null==(s=t.match(/\s+$/))?void 0:s[0])?o:"";if(t.match(/^\n\n/)){n.innerHTML=`${n.innerHTML}${c}`;return}let d=n.parentNode;for(;n.firstChild;)d.insertBefore(n.firstChild,n);d.removeChild(n),e.innerHTML=`${a}${e.innerHTML}${c}`}}withPatchedRenderer(e){let t=e=>function(){let t=e(...arguments);return"\n"===t?t:"\n"===t[t.length-1]?t.slice(0,-1):t};return e.renderer.rules.hardbreak=t(e.renderer.rules.hardbreak),e.renderer.rules.softbreak=t(e.renderer.rules.softbreak),e.renderer.rules.fence=t(e.renderer.rules.fence),e.renderer.rules.code_block=t(e.renderer.rules.code_block),e.renderer.renderToken=t(e.renderer.renderToken.bind(e.renderer)),e}}let pI=sz.create({name:"markdownClipboard",addOptions:()=>({transformPastedText:!1,transformCopiedText:!1}),addProseMirrorPlugins(){return[new tv({key:new tC("markdownClipboard"),props:{clipboardTextParser:(e,t,n)=>{if(n||!this.options.transformPastedText)return null;let r=this.editor.storage.markdown.parser.parse(e,{inline:!0});return ef.fromSchema(this.editor.schema).parseSlice(pf(r),{preserveWhitespace:!0,context:t})},clipboardTextSerializer:e=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(e.content):null}})]}}),pL=sz.create({name:"markdown",priority:50,addOptions:()=>({html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}),addCommands(){let e=sL.Commands.config.addCommands();return{setContent:(t,n)=>r=>e.setContent(r.editor.storage.markdown.parser.parse(t),n)(r),insertContentAt:(t,n,r)=>i=>e.insertContentAt(t,i.editor.storage.markdown.parser.parse(n,{inline:!0}),r)(i)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new pF(this.editor,this.options),serializer:new pR(this.editor),getMarkdown:()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc)},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage:()=>({}),addExtensions(){return[pl.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),pI.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}}),pz=({editor:e})=>e?(0,f.jsxs)("div",{className:"flex flex-wrap items-center gap-1 p-2 border-b border-[var(--card-border)] mb-2 sticky top-0 bg-[var(--card-bg)] z-10 opacity-90 backdrop-blur-sm",children:[(0,f.jsx)("button",{onClick:()=>e.chain().focus().toggleBold().run(),disabled:!e.can().chain().focus().toggleBold().run(),className:`p-1.5 rounded hover:bg-[var(--muted)] ${e.isActive("bold")?"bg-[var(--muted)] text-[var(--foreground)]":"text-[var(--muted-foreground)]"}`,title:"Bold",children:(0,f.jsx)("span",{className:"font-bold font-serif",children:"B"})}),(0,f.jsx)("button",{onClick:()=>e.chain().focus().toggleItalic().run(),disabled:!e.can().chain().focus().toggleItalic().run(),className:`p-1.5 rounded hover:bg-[var(--muted)] ${e.isActive("italic")?"bg-[var(--muted)] text-[var(--foreground)]":"text-[var(--muted-foreground)]"}`,title:"Italic",children:(0,f.jsx)("span",{className:"italic font-serif",children:"I"})}),(0,f.jsx)("button",{onClick:()=>e.chain().focus().toggleStrike().run(),disabled:!e.can().chain().focus().toggleStrike().run(),className:`p-1.5 rounded hover:bg-[var(--muted)] ${e.isActive("strike")?"bg-[var(--muted)] text-[var(--foreground)]":"text-[var(--muted-foreground)]"}`,title:"Strike",children:(0,f.jsx)("span",{className:"line-through font-serif",children:"S"})}),(0,f.jsx)("div",{className:"w-px h-4 bg-[var(--card-border)] mx-1"}),(0,f.jsx)("button",{onClick:()=>e.chain().focus().toggleCode().run(),disabled:!e.can().chain().focus().toggleCode().run(),className:`p-1.5 rounded hover:bg-[var(--muted)] ${e.isActive("code")?"bg-[var(--muted)] text-[var(--foreground)]":"text-[var(--muted-foreground)]"}`,title:"Code",children:(0,f.jsx)("span",{className:"font-mono text-xs",children:"<>"})}),(0,f.jsx)("button",{onClick:()=>e.chain().focus().toggleCodeBlock().run(),className:`p-1.5 rounded hover:bg-[var(--muted)] ${e.isActive("codeBlock")?"bg-[var(--muted)] text-[var(--foreground)]":"text-[var(--muted-foreground)]"}`,title:"Code Block",children:(0,f.jsx)("span",{className:"font-mono text-xs",children:"CB"})}),(0,f.jsx)("div",{className:"w-px h-4 bg-[var(--card-border)] mx-1"}),(0,f.jsx)("button",{onClick:()=>e.chain().focus().toggleHeading({level:1}).run(),className:`p-1.5 rounded hover:bg-[var(--muted)] ${e.isActive("heading",{level:1})?"bg-[var(--muted)] text-[var(--foreground)]":"text-[var(--muted-foreground)]"}`,title:"H1",children:(0,f.jsx)("span",{className:"font-bold text-xs",children:"H1"})}),(0,f.jsx)("button",{onClick:()=>e.chain().focus().toggleHeading({level:2}).run(),className:`p-1.5 rounded hover:bg-[var(--muted)] ${e.isActive("heading",{level:2})?"bg-[var(--muted)] text-[var(--foreground)]":"text-[var(--muted-foreground)]"}`,title:"H2",children:(0,f.jsx)("span",{className:"font-bold text-xs",children:"H2"})}),(0,f.jsx)("button",{onClick:()=>e.chain().focus().toggleHeading({level:3}).run(),className:`p-1.5 rounded hover:bg-[var(--muted)] ${e.isActive("heading",{level:3})?"bg-[var(--muted)] text-[var(--foreground)]":"text-[var(--muted-foreground)]"}`,title:"H3",children:(0,f.jsx)("span",{className:"font-bold text-xs",children:"H3"})}),(0,f.jsx)("div",{className:"w-px h-4 bg-[var(--card-border)] mx-1"}),(0,f.jsx)("button",{onClick:()=>e.chain().focus().toggleBulletList().run(),className:`p-1.5 rounded hover:bg-[var(--muted)] ${e.isActive("bulletList")?"bg-[var(--muted)] text-[var(--foreground)]":"text-[var(--muted-foreground)]"}`,title:"Bullet List",children:(0,f.jsx)("span",{className:"text-xs",children:"• List"})}),(0,f.jsx)("button",{onClick:()=>e.chain().focus().toggleOrderedList().run(),className:`p-1.5 rounded hover:bg-[var(--muted)] ${e.isActive("orderedList")?"bg-[var(--muted)] text-[var(--foreground)]":"text-[var(--muted-foreground)]"}`,title:"Ordered List",children:(0,f.jsx)("span",{className:"text-xs",children:"1. List"})}),(0,f.jsx)("button",{onClick:()=>e.chain().focus().toggleBlockquote().run(),className:`p-1.5 rounded hover:bg-[var(--muted)] ${e.isActive("blockquote")?"bg-[var(--muted)] text-[var(--foreground)]":"text-[var(--muted-foreground)]"}`,title:"Quote",children:(0,f.jsx)("span",{className:"text-xs serif italic",children:'""'})})]}):null;function pj({content:e,editable:t=!0,onChange:n,onBlur:r,placeholder:i="Add a description..."}){let o=lU({extensions:[dU,c$.configure({openOnClick:!1}),dq.configure({placeholder:i,emptyEditorClass:"is-editor-empty before:content-[attr(data-placeholder)] before:text-[var(--muted-foreground)] before:float-left before:pointer-events-none before:h-0"}),pL.configure({html:!1,transformPastedText:!0,transformCopiedText:!0})],immediatelyRender:!1,content:e,editable:t,editorProps:{attributes:{class:"prose prose-sm max-w-none focus:outline-none min-h-[100px] text-[var(--foreground)]"}},onUpdate:({editor:e})=>{n?.(e.storage.markdown.getMarkdown())},onBlur:()=>{r?.()}});return(0,m.useEffect)(()=>{o&&e!==o.storage.markdown.getMarkdown()&&!o.isFocused&&o.commands.setContent(e)},[e,o]),(0,f.jsxs)("div",{className:"jsx-cdf669dd826a0677 relative group",children:[t&&(0,f.jsx)(pz,{editor:o}),(0,f.jsx)(lP,{editor:o,className:"rich-text-editor"}),(0,f.jsx)(A.default,{id:"cdf669dd826a0677",children:".rich-text-editor .ProseMirror{outline:none;min-height:100px}.rich-text-editor .ProseMirror p{margin-bottom:.75em;line-height:1.6}.rich-text-editor .ProseMirror h1{margin-top:1em;margin-bottom:.5em;font-size:1.5em;font-weight:700}.rich-text-editor .ProseMirror h2{margin-top:1em;margin-bottom:.5em;font-size:1.25em;font-weight:600}.rich-text-editor .ProseMirror h3{margin-top:1em;margin-bottom:.5em;font-size:1.1em;font-weight:600}.rich-text-editor .ProseMirror ul{margin-bottom:.75em;padding-left:1.5em;list-style-type:disc}.rich-text-editor .ProseMirror ol{margin-bottom:.75em;padding-left:1.5em;list-style-type:decimal}.rich-text-editor .ProseMirror blockquote{border-left:3px solid var(--card-border);color:var(--muted-foreground);padding-left:1em;font-style:italic}.rich-text-editor .ProseMirror pre{background:var(--muted);border-radius:var(--radius-sm);margin-bottom:.75em;padding:.75em;font-family:monospace;overflow-x:auto}.rich-text-editor .ProseMirror code{background:var(--muted);border-radius:var(--radius-sm);padding:.2em .4em;font-family:monospace;font-size:.85em}.rich-text-editor .ProseMirror a{color:var(--primary);text-decoration:underline}"})]})}function pB(e,t=32,n){let r=`https://api.dicebear.com/9.x/bottts-neutral/svg?seed=${encodeURIComponent(e)}&size=${t}`;if(!n)return r;let i=n.replace("#","");return`${r}&backgroundColor=${i}`}e.i(77183),e.i(76590),e.i(7311);let pP=["claude","ollama","gemini","codex","zai"];function p$(e){return(e??[]).map(e=>e.condition?.trim()?`${e.file} | ${e.condition}`:e.file).join("\n")}function pq(e){return e.split("\n").map(e=>e.trim()).filter(Boolean).map(e=>{let[t,...n]=e.split("|");return{file:t.trim(),condition:n.join("|").trim()}}).filter(e=>e.file.length>0)}function pV(e,t){return JSON.stringify({name:e.name,provider:e.provider,model:e.model,identity:e.identity,color:e.color??"#6B7280",skills:e.skills??[],...t?{projectIds:t}:{}},null,2)}function pH({title:e,initial:t,submitLabel:n,onSubmit:r,onCancel:i,projects:o,initialProjectIds:s,agentId:l,projectMemberships:a,onAddToProject:c,onRemoveFromProject:d}){let[u,h]=(0,m.useState)(t.name),[p,A]=(0,m.useState)(t.provider),[D,_]=(0,m.useState)(t.model),[T,N]=(0,m.useState)(t.identity),[O,R]=(0,m.useState)(t.color??"#6B7280"),[F,I]=(0,m.useState)(p$(t.skills)),[L,z]=(0,m.useState)(new Set(s??[])),[j,B]=(0,m.useState)(null),[P,$]=(0,m.useState)([]),[q,V]=(0,m.useState)("form"),[H,W]=(0,m.useState)(()=>pV(t,o?s??[]:void 0)),[U,K]=(0,m.useState)(null),[J,G]=(0,m.useState)(!1),Z=(0,m.useRef)(null);(0,m.useEffect)(()=>{let e=e=>{Z.current&&!Z.current.contains(e.target)&&i()},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[Z,i]),(0,m.useEffect)(()=>{"form"===q&&W(pV({name:u,provider:p,model:D,identity:T,color:O,skills:pq(F)},o?Array.from(L):void 0))},[q,u,p,D,T,O,F,L,o]),(0,m.useEffect)(()=>{if(!J)return;let e=window.setTimeout(()=>G(!1),1200);return()=>window.clearTimeout(e)},[J]),(0,m.useEffect)(()=>{let e=!1;return async function(){if(!l)return B(null);try{let t=await fetch(`/api/agents/${l}/profile`);if(!t.ok)return;let n=await t.json();if(e)return;let r=n?.inspectability?.knowledge?.agent?.learnedMemories??[];B({learnedMemories:r})}catch{e||B(null)}}(),()=>{e=!0}},[l]),(0,m.useEffect)(()=>{let e=!1;return async function(){let t=a?.current?.map(e=>e.id)??o?.map(e=>e.id)??[];if(0===t.length)return $([]);try{let n=await Promise.all(t.map(async e=>{let[t,n,r,i]=await Promise.all([fetch(`/api/projects/${e}`),fetch(`/api/projects/${e}/skills`),fetch(`/api/projects/${e}/memory?producer=human`),fetch(`/api/projects/${e}/memory?producer=system`)]),o=t.ok?await t.json():null,s=n.ok?await n.json():null,l=r.ok?await r.json():null,c=i.ok?await i.json():null,d=o?.project?.repos??[],u=(await Promise.all(d.map(async e=>{let t=await fetch(`/api/repos/${e.id}/knowledge`);return t.ok?((await t.json()).knowledge??[]).map(t=>({...t,repoName:e.name??e.id})):[]}))).flat(),h=u.filter(e=>"system"!==e.producer).length,p=u.filter(e=>"system"===e.producer).length,f=(c?.memory??[]).slice(0,3),m=u.filter(e=>"system"===e.producer).slice(0,3);return{id:e,name:o?.project?.name??a?.current?.find(t=>t.id===e)?.name??e,projectKnowledgeReferences:(s?.skills??[]).length,projectKnowledgeNotes:(l?.memory??[]).length,systemProjectKnowledge:(c?.memory??[]).length,repoKnowledgeNotes:h,systemRepoKnowledge:p,projectGeneratedItems:f,repoGeneratedItems:m}}));e||$(n)}catch{e||$([])}}(),()=>{e=!0}},[a,o]);let X=e=>{let t=function(e,t){let n;try{n=JSON.parse(e)}catch{throw Error("JSON is invalid.")}if(!n||"object"!=typeof n||Array.isArray(n))throw Error("JSON must be an object.");let r=n,i="string"==typeof r.provider?r.provider:t,o=pP.includes(i)?i:t,s=(Array.isArray(r.skills)?r.skills:[]).flatMap(e=>{if("string"==typeof e){let[t,...n]=e.split("|"),r=t.trim();return r?[{file:r,condition:n.join("|").trim()}]:[]}if(!e||"object"!=typeof e||Array.isArray(e))return[];let t="string"==typeof e.file?e.file.trim():"";return t?[{file:t,condition:"string"==typeof e.condition?e.condition.trim():""}]:[]}),l=Array.isArray(r.projectIds)?r.projectIds.filter(e=>"string"==typeof e&&e.trim().length>0):void 0;return{data:{name:"string"==typeof r.name?r.name:"",provider:o,model:"string"==typeof r.model?r.model:"",identity:"string"==typeof r.identity?r.identity:"",color:"string"==typeof r.color&&r.color.trim()?r.color:"#6B7280",skills:s},projectIds:l}}(e,p),n=o?(t.projectIds??[]).filter(e=>o.some(t=>t.id===e)):void 0;return h(t.data.name),A(t.data.provider),_(t.data.model),N(t.data.identity),R(t.data.color??"#6B7280"),I(p$(t.data.skills)),o&&z(new Set(n??[])),W(pV(t.data,o?n??[]:void 0)),K(null),{...t,projectIds:n}},Q=()=>{if("form"!==q)try{X(H),V("form")}catch(e){K(e instanceof Error?e.message:"Unable to parse JSON.")}},Y=async()=>{try{await navigator.clipboard.writeText(H),G(!0)}catch{G(!1)}};return(0,f.jsx)("div",{ref:Z,className:"fixed inset-0 z-[100] flex items-center justify-center p-4 bg-black/30 backdrop-blur-sm",onKeyDown:e=>{"Escape"===e.key&&i()},children:(0,f.jsxs)("div",{className:"bg-[var(--card-bg)] rounded-[32px] shadow-2xl overflow-hidden w-full max-w-2xl max-h-[90vh] flex flex-col animate-in fade-in zoom-in duration-300",children:[(0,f.jsxs)("div",{className:"px-8 pt-8 pb-4 shrink-0 flex items-center justify-between",children:[(0,f.jsxs)("div",{className:"flex items-center gap-4",children:[l&&(0,f.jsxs)("div",{className:"flex flex-col items-center gap-1.5",children:[(0,f.jsx)("img",{src:pB(l,64,O),alt:u,className:"w-14 h-14 rounded-full bg-[var(--muted)]"}),(0,f.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,f.jsx)("label",{className:"text-[10px] text-[var(--muted-foreground)]",children:"Color"}),(0,f.jsx)("input",{type:"color",value:O,onChange:e=>R(e.target.value),className:"w-5 h-5 rounded border border-[var(--border)] cursor-pointer p-0"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h2",{className:"text-[10px] font-bold tracking-widest text-[var(--muted-foreground)] uppercase",children:e}),(0,f.jsx)("h1",{className:"text-2xl font-semibold mt-1",children:u||"Configure Agent"})]})]}),(0,f.jsx)("button",{onClick:i,className:"p-2 text-[var(--muted-foreground)] hover:text-[var(--muted-foreground)] hover:bg-[var(--muted)] rounded-full transition-all",children:(0,f.jsx)(g.X,{size:20})})]}),(0,f.jsxs)("div",{className:"px-8 pb-8 space-y-6 overflow-y-auto",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,f.jsxs)("div",{className:"inline-flex rounded-xl bg-[var(--muted)] p-1",children:[(0,f.jsx)("button",{type:"button",onClick:Q,className:"form"===q?"px-3 py-1.5 text-xs font-semibold rounded-lg bg-[var(--card-bg)] text-[var(--foreground)] shadow-sm":"px-3 py-1.5 text-xs font-semibold rounded-lg text-[var(--muted-foreground)] hover:text-[var(--foreground)]",children:"Form"}),(0,f.jsx)("button",{type:"button",onClick:()=>{W(pV({name:u,provider:p,model:D,identity:T,color:O,skills:pq(F)},o?Array.from(L):void 0)),K(null),V("json")},className:"json"===q?"px-3 py-1.5 text-xs font-semibold rounded-lg bg-[var(--card-bg)] text-[var(--foreground)] shadow-sm":"px-3 py-1.5 text-xs font-semibold rounded-lg text-[var(--muted-foreground)] hover:text-[var(--foreground)]",children:"JSON"})]}),"json"===q&&(0,f.jsxs)("button",{type:"button",onClick:Y,className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-semibold text-[var(--muted-foreground)] hover:text-[var(--foreground)] hover:bg-[var(--muted)] rounded-lg transition-colors",children:[J?(0,f.jsx)(E.Check,{size:14,className:"text-emerald-500"}):(0,f.jsx)(M.Copy,{size:14}),J?"Copied":"Copy"]})]}),"form"===q?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsxs)("label",{className:"flex items-center gap-2 text-sm font-medium text-[var(--muted-foreground)]",children:[(0,f.jsx)(y.User,{size:16})," Name"]}),(0,f.jsx)("input",{type:"text",value:u,onChange:e=>h(e.target.value),className:"w-full px-4 py-3 bg-[var(--app-shell-subtle)] border border-[var(--border)] rounded-xl focus:outline-none focus:ring-2 focus:ring-indigo-500/20 focus:border-indigo-500 transition-all",placeholder:"Enter agent name...",autoFocus:!0})]}),(0,f.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsxs)("label",{className:"flex items-center gap-2 text-sm font-medium text-[var(--muted-foreground)]",children:[(0,f.jsx)(b.Box,{size:16})," Provider"]}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsxs)("select",{value:p,onChange:e=>A(e.target.value),className:"w-full appearance-none px-4 py-3 bg-[var(--app-shell-subtle)] border border-[var(--border)] rounded-xl focus:outline-none focus:ring-2 focus:ring-indigo-500/20 focus:border-indigo-500 transition-all pr-10 cursor-pointer",children:[(0,f.jsx)("option",{value:"claude",children:"Claude"}),(0,f.jsx)("option",{value:"ollama",children:"Ollama"}),(0,f.jsx)("option",{value:"gemini",children:"Gemini"}),(0,f.jsx)("option",{value:"codex",children:"Codex"}),(0,f.jsx)("option",{value:"zai",children:"Z.AI"})]}),(0,f.jsx)(S.ChevronDown,{className:"absolute right-3 top-1/2 -translate-y-1/2 text-[var(--muted-foreground)] pointer-events-none",size:16})]})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsxs)("label",{className:"flex items-center gap-2 text-sm font-medium text-[var(--muted-foreground)]",children:[(0,f.jsx)(k.Cpu,{size:16})," Model"]}),(0,f.jsx)("input",{type:"text",value:D,onChange:e=>_(e.target.value),className:"w-full px-4 py-3 bg-[var(--app-shell-subtle)] border border-[var(--border)] rounded-xl focus:outline-none focus:ring-2 focus:ring-indigo-500/20 focus:border-indigo-500 transition-all font-mono text-sm",placeholder:"e.g. claude-sonnet-4-6"})]})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsxs)("label",{className:"flex items-center gap-2 text-sm font-medium text-[var(--muted-foreground)]",children:[(0,f.jsx)(v.BookOpen,{size:16})," Identity"]}),(0,f.jsx)("div",{className:"border border-[var(--border)] rounded-xl overflow-hidden bg-[var(--app-shell-subtle)] focus-within:ring-2 focus-within:ring-indigo-500/20 focus-within:border-indigo-500 transition-all",children:(0,f.jsx)(pj,{content:T,onChange:e=>N(e),placeholder:"Describe the agent's identity and role..."})}),(0,f.jsx)("p",{className:"text-xs text-[var(--muted-foreground)]",children:"Identity defines who the agent is. Keep portable knowledge separate below; project and repo knowledge belong on their scoped surfaces."})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsxs)("label",{className:"flex items-center gap-2 text-sm font-medium text-[var(--muted-foreground)]",children:[(0,f.jsx)(x.Sparkles,{size:16})," Portable Knowledge"]}),(0,f.jsx)("textarea",{value:F,onChange:e=>I(e.target.value),rows:5,className:"w-full px-4 py-3 bg-[var(--app-shell-subtle)] border border-[var(--border)] rounded-xl focus:outline-none focus:ring-2 focus:ring-indigo-500/20 focus:border-indigo-500 transition-all font-mono text-xs",placeholder:"one/path/to/skill.md\npath/to/skill.md | when coding in TypeScript"}),(0,f.jsxs)("p",{className:"text-xs text-[var(--muted-foreground)]",children:["Portable agent knowledge only. One reference per line. Use ",(0,f.jsx)("code",{children:"|"})," to add an optional condition."]})]}),l&&(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsxs)("label",{className:"flex items-center gap-2 text-sm font-medium text-[var(--muted-foreground)]",children:[(0,f.jsx)(x.Sparkles,{size:16})," System-Generated Agent Knowledge"]}),j?.learnedMemories?.length?(0,f.jsx)("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:j.learnedMemories.map(e=>(0,f.jsxs)("div",{className:"rounded-xl border border-[var(--border)] bg-[var(--app-shell-subtle)] px-3 py-2",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,f.jsx)("span",{className:"text-[10px] font-bold uppercase tracking-wide text-[var(--muted-foreground)]",children:e.type}),(0,f.jsx)("span",{className:"text-[10px] text-[var(--muted-foreground)]",children:new Date(e.createdAt).toLocaleString()})]}),(0,f.jsx)("p",{className:"mt-1 text-xs text-[var(--foreground)] leading-relaxed",children:e.content})]},e.id))}):(0,f.jsx)("p",{className:"text-xs text-[var(--muted-foreground)]",children:"No system-generated agent knowledge yet."})]}),o&&o.length>0&&(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsxs)("label",{className:"flex items-center gap-2 text-sm font-medium text-[var(--muted-foreground)]",children:[(0,f.jsx)(C.FolderOpen,{size:16})," Assign To Projects"]}),(0,f.jsx)("div",{className:"space-y-1 max-h-[160px] overflow-y-auto",children:o.map(e=>{let t=L.has(e.id);return(0,f.jsxs)("button",{type:"button",className:t?"w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-colors bg-indigo-50 text-indigo-700":"w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-colors text-[var(--muted-foreground)] hover:bg-[var(--app-shell-subtle)]",onClick:()=>z(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n}),children:[(0,f.jsx)("div",{className:t?"w-4 h-4 rounded border flex-shrink-0 flex items-center justify-center bg-indigo-600 border-indigo-600":"w-4 h-4 rounded border flex-shrink-0 flex items-center justify-center border-[var(--border)]",children:t&&(0,f.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:(0,f.jsx)("path",{d:"M2 5l2 2 4-4",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,f.jsx)("span",{className:"text-xs font-medium text-left",children:e.label??e.name})]},e.id)})})]}),a&&(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsxs)("label",{className:"flex items-center gap-2 text-sm font-medium text-[var(--muted-foreground)]",children:[(0,f.jsx)(C.FolderOpen,{size:16})," Project Memberships"]}),a.current.length>0?(0,f.jsx)("div",{className:"flex flex-col gap-1",children:a.current.map(e=>(0,f.jsxs)("div",{className:"flex items-center gap-2 text-xs bg-[var(--app-shell-subtle)] rounded-lg px-3 py-2",children:[(0,f.jsx)(C.FolderOpen,{size:12,className:"text-[var(--muted-foreground)] shrink-0"}),(0,f.jsx)("span",{className:"truncate flex-1",children:e.name}),d&&!e.is_default&&(0,f.jsx)("button",{type:"button",className:"text-[var(--muted-foreground)] hover:text-red-500 transition-colors",onClick:()=>d(e.id),title:"Remove from project",children:(0,f.jsx)(g.X,{size:12})})]},e.id))}):(0,f.jsx)("p",{className:"text-xs text-[var(--muted-foreground)] italic",children:"Not assigned to any projects"}),a.available.length>0&&c&&(0,f.jsx)("div",{className:"flex flex-wrap gap-1",children:a.available.map(e=>(0,f.jsxs)("button",{type:"button",className:"inline-flex items-center gap-1 text-[10px] px-2 py-1 rounded-lg border border-dashed border-[var(--border)] text-[var(--muted-foreground)] hover:border-[var(--border)] hover:text-[var(--foreground)] transition-colors",onClick:()=>c(e.id),children:[(0,f.jsx)(w.Plus,{size:10}),e.name]},e.id))})]}),l&&P.length>0&&(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsxs)("label",{className:"flex items-center gap-2 text-sm font-medium text-[var(--muted-foreground)]",children:[(0,f.jsx)(C.FolderOpen,{size:16})," Scoped Knowledge Summary"]}),(0,f.jsx)("div",{className:"space-y-2",children:P.map(e=>(0,f.jsxs)("div",{className:"rounded-xl border border-[var(--border)] bg-[var(--app-shell-subtle)] px-3 py-3",children:[(0,f.jsx)("div",{className:"text-xs font-semibold text-[var(--foreground)]",children:e.name}),(0,f.jsxs)("div",{className:"mt-2 grid grid-cols-2 sm:grid-cols-5 gap-2 text-[10px] text-[var(--muted-foreground)]",children:[(0,f.jsxs)("div",{className:"rounded-lg bg-[var(--card-bg)] px-2 py-2 border border-[var(--border)]",children:[(0,f.jsx)("div",{className:"font-bold text-[var(--foreground)]",children:e.projectKnowledgeReferences}),(0,f.jsx)("div",{children:"Project refs"})]}),(0,f.jsxs)("div",{className:"rounded-lg bg-[var(--card-bg)] px-2 py-2 border border-[var(--border)]",children:[(0,f.jsx)("div",{className:"font-bold text-[var(--foreground)]",children:e.projectKnowledgeNotes}),(0,f.jsx)("div",{children:"Project notes"})]}),(0,f.jsxs)("div",{className:"rounded-lg bg-[var(--card-bg)] px-2 py-2 border border-[var(--border)]",children:[(0,f.jsx)("div",{className:"font-bold text-[var(--foreground)]",children:e.systemProjectKnowledge}),(0,f.jsx)("div",{children:"Project generated"})]}),(0,f.jsxs)("div",{className:"rounded-lg bg-[var(--card-bg)] px-2 py-2 border border-[var(--border)]",children:[(0,f.jsx)("div",{className:"font-bold text-[var(--foreground)]",children:e.repoKnowledgeNotes}),(0,f.jsx)("div",{children:"Repo notes"})]}),(0,f.jsxs)("div",{className:"rounded-lg bg-[var(--card-bg)] px-2 py-2 border border-[var(--border)]",children:[(0,f.jsx)("div",{className:"font-bold text-[var(--foreground)]",children:e.systemRepoKnowledge}),(0,f.jsx)("div",{children:"Repo generated"})]})]}),(e.projectGeneratedItems.length>0||e.repoGeneratedItems.length>0)&&(0,f.jsxs)("div",{className:"mt-3 space-y-2",children:[e.projectGeneratedItems.length>0&&(0,f.jsxs)("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--card-bg)] px-3 py-2",children:[(0,f.jsx)("div",{className:"text-[10px] font-black uppercase tracking-wide text-[var(--muted-foreground)]",children:"Project generated"}),(0,f.jsx)("div",{className:"mt-2 space-y-1",children:e.projectGeneratedItems.map(e=>(0,f.jsx)("div",{className:"text-xs text-[var(--foreground)] leading-relaxed",children:e.content},e.id))})]}),e.repoGeneratedItems.length>0&&(0,f.jsxs)("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--card-bg)] px-3 py-2",children:[(0,f.jsx)("div",{className:"text-[10px] font-black uppercase tracking-wide text-[var(--muted-foreground)]",children:"Repo generated"}),(0,f.jsx)("div",{className:"mt-2 space-y-1",children:e.repoGeneratedItems.map(e=>(0,f.jsxs)("div",{className:"text-xs text-[var(--foreground)] leading-relaxed",children:[e.repoName?`${e.repoName}: `:"",e.content]},e.id))})]})]})]},e.id))}),(0,f.jsx)("p",{className:"text-xs text-[var(--muted-foreground)]",children:"Project and repo knowledge are edited on their scoped project surfaces."})]})]}):(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,f.jsx)("p",{className:"text-xs text-[var(--muted-foreground)]",children:"Paste agent JSON here. Switching back to Form or saving will apply valid JSON to the form state."}),(0,f.jsx)("button",{type:"button",onClick:Q,className:"px-3 py-1.5 text-xs font-semibold text-[var(--muted-foreground)] hover:text-[var(--foreground)] hover:bg-[var(--muted)] rounded-lg transition-colors",children:"Apply to Form"})]}),(0,f.jsx)("textarea",{value:H,onChange:e=>{W(e.target.value),U&&K(null)},rows:22,className:"w-full px-4 py-3 bg-[var(--app-shell-bg)] text-[var(--foreground)] border border-[var(--app-shell-border)] rounded-2xl focus:outline-none focus:ring-2 focus:ring-[var(--ring)] focus:border-[var(--primary)] transition-all font-mono text-xs",spellCheck:!1,autoFocus:!0}),U&&(0,f.jsx)("p",{className:"text-xs text-red-500",children:U})]}),(0,f.jsxs)("div",{className:"flex items-center justify-end gap-3 pt-4 border-t border-[var(--border)]",children:[(0,f.jsx)("button",{onClick:i,className:"px-6 py-2.5 text-sm font-semibold text-[var(--muted-foreground)] hover:text-[var(--foreground)] hover:bg-[var(--app-shell-subtle)] rounded-xl transition-all",children:"Cancel"}),(0,f.jsx)("button",{onClick:()=>{let e=u.trim(),t=p,n=D.trim(),i=T.trim(),s=O,l=pq(F),a=o?Array.from(L):void 0;if("json"===q)try{let r=X(H);e=r.data.name.trim(),t=r.data.provider,n=r.data.model.trim(),i=r.data.identity.trim(),s=r.data.color??"#6B7280",l=r.data.skills??[],a=o?r.projectIds??[]:void 0}catch(e){K(e instanceof Error?e.message:"Unable to parse JSON.");return}e&&n&&r({name:e,provider:t,model:n,identity:i,color:s,skills:l},a)},disabled:"form"===q&&(!u.trim()||!D.trim()),className:"px-8 py-2.5 bg-indigo-600 text-white text-sm font-semibold rounded-xl shadow-[0_4px_12px_rgba(79,70,229,0.3)] hover:bg-indigo-700 active:scale-95 disabled:opacity-50 transition-all font-bold",children:n})]})]})]})})}e.s(["AgentForm",()=>pH,"agentAvatarUrl",()=>pB],25459)}]);
|