@kidlat-dakila/flightplan 0.1.5 → 0.1.7
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/README.md +31 -16
- package/backend/configurations/default-configurations/minimal/context.md +9 -54
- package/backend/configurations/default-configurations/minimal/traceDiagram.nodes.blockLabels.label.md +19 -0
- package/backend/configurations/default-configurations/minimal/{journey.nodes.description.md → traceDiagram.nodes.description.md} +1 -1
- package/backend/configurations/default-configurations/minimal/walkthrough.files.waypoints.reading.md +1 -1
- package/backend/configurations/default-configurations/onboardee/context.md +16 -62
- package/backend/configurations/default-configurations/onboardee/traceDiagram.description.md +16 -0
- package/backend/configurations/default-configurations/onboardee/traceDiagram.nodes.blockLabels.label.md +11 -0
- package/backend/configurations/default-configurations/onboardee/{journey.nodes.description.md → traceDiagram.nodes.description.md} +1 -1
- package/backend/configurations/default-configurations/onboardee/walkthrough.files.waypoints.reading.md +1 -1
- package/backend/configurations/default-configurations/standard/context.md +16 -62
- package/backend/configurations/default-configurations/standard/traceDiagram.description.md +16 -0
- package/backend/configurations/default-configurations/standard/traceDiagram.nodes.blockLabels.label.md +11 -0
- package/backend/configurations/default-configurations/standard/{journey.nodes.description.md → traceDiagram.nodes.description.md} +1 -1
- package/backend/configurations/default-configurations/standard/walkthrough.files.waypoints.reading.md +1 -1
- package/backend/configurations/default-configurations/unfamiliar-territory/context.md +16 -62
- package/backend/configurations/default-configurations/unfamiliar-territory/traceDiagram.description.md +16 -0
- package/backend/configurations/default-configurations/unfamiliar-territory/traceDiagram.nodes.blockLabels.label.md +11 -0
- package/backend/configurations/default-configurations/unfamiliar-territory/{journey.nodes.description.md → traceDiagram.nodes.description.md} +1 -1
- package/backend/configurations/default-configurations/unfamiliar-territory/walkthrough.files.waypoints.reading.md +1 -1
- package/backend/configurations/system-instructions/artifactFormat.md +20 -16
- package/backend/configurations/system-instructions/{blast.md → blastDiagram.md} +5 -5
- package/backend/configurations/system-instructions/context.md +18 -9
- package/backend/configurations/system-instructions/title.md +36 -4
- package/backend/configurations/system-instructions/traceDiagram.description.md +14 -0
- package/backend/configurations/system-instructions/{journey.md → traceDiagram.md} +8 -8
- package/backend/configurations/system-instructions/traceDiagram.nodes.blockLabels.label.md +6 -0
- package/backend/configurations/system-instructions/walkthrough.files.md +5 -11
- package/backend/configurations/system-instructions/walkthrough.files.waypoints.coreChange.md +7 -0
- package/backend/configurations/system-instructions/walkthrough.files.waypoints.md +3 -3
- package/backend/configurations/system-instructions/walkthrough.md +6 -8
- package/backend/main.js +56353 -43801
- package/backend/plugin/skills/review/SKILL.md +31 -47
- package/frontend/assets/_branchId-438YLxpk.js +1 -0
- package/frontend/assets/_branchId-PhBseeXo.js +1 -0
- package/frontend/assets/_id-yAHjl11v.js +1 -0
- package/frontend/assets/_id-z15a_Wqg.js +1 -0
- package/frontend/assets/agents-CF_BNYuU.js +1 -0
- package/frontend/assets/agents-CUULznCR.js +1 -0
- package/frontend/assets/create-Byti8N1q.js +1 -0
- package/frontend/assets/create-DHjp2cB6.js +1 -0
- package/frontend/assets/create-DiPNM_Jx.js +1 -0
- package/frontend/assets/{create-CNT_ktA4.js → create-t6MxPYs8.js} +1 -1
- package/frontend/assets/download-kIOYm7yl.js +1 -0
- package/frontend/assets/forges-5NgJFexV.js +1 -0
- package/frontend/assets/forges-Dz31lZmK.js +1 -0
- package/frontend/assets/{index-h6dRc3tV.js → index-9MPLrKh9.js} +75 -62
- package/frontend/assets/index-BDgPH-og.js +1 -0
- package/frontend/assets/{index-CPyhbNqS.js → index-BDhIIxnY.js} +1 -1
- package/frontend/assets/{index-Baaegu29.js → index-BUtsWXGk.js} +1 -1
- package/frontend/assets/{index-BWM8kiQ0.js → index-BrL94etp.js} +1 -1
- package/frontend/assets/index-C8_4U9zA.js +457 -0
- package/frontend/assets/index-CAt5Gv5u.js +1 -0
- package/frontend/assets/{index-C8gx27Rr.js → index-CBObEG9P.js} +1 -1
- package/frontend/assets/index-CRQLJ5uq.js +1 -0
- package/frontend/assets/index-CSy69oc4.js +1 -0
- package/frontend/assets/index-Cjx98rmL.js +1 -0
- package/frontend/assets/index-CmW92SdM.js +1 -0
- package/frontend/assets/index-Cmg8rxUj.css +1 -0
- package/frontend/assets/index-DVMDfdCW.js +1 -0
- package/frontend/assets/index-DYy-kFEi.js +1 -0
- package/frontend/assets/index-Dk3p64fP.js +1 -0
- package/frontend/assets/index-Dq71dq4Z.js +1 -0
- package/frontend/assets/index-Dz-E4Hhc.js +1 -0
- package/frontend/assets/{index-BsRx8Pzi.js → index-EFsgiJx1.js} +1 -1
- package/frontend/assets/index-EItMs0kz.js +1 -0
- package/frontend/assets/index-N0J0txvy.js +1 -0
- package/frontend/assets/index-Qxg2C8CP.js +1 -0
- package/frontend/assets/index-RYSZy-Ra.js +6 -0
- package/frontend/assets/{index-BYtgetD4.js → index-WOMODjD2.js} +1 -1
- package/frontend/assets/repositories-BrbB16PW.js +1 -0
- package/frontend/assets/repositories-VWl6aq7K.js +1 -0
- package/frontend/assets/review-BMO-QDpl.js +1 -0
- package/frontend/assets/review-CXzRf1jk.js +1 -0
- package/frontend/assets/route--z3gnt4z.js +1 -0
- package/frontend/favicon.ico +0 -0
- package/frontend/favicon.svg +5 -0
- package/frontend/index.html +10 -3
- package/frontend/logo.svg +5 -0
- package/frontend/not-found.svg +25 -0
- package/frontend/server-error.svg +32 -0
- package/package.json +5 -1
- package/published-review/app.css +1 -1
- package/published-review/app.js +126 -89
- package/backend/configurations/default-configurations/minimal/journey.nodes.blockLabels.label.md +0 -13
- package/backend/configurations/default-configurations/minimal/walkthrough.files.title.md +0 -7
- package/backend/configurations/default-configurations/minimal/walkthrough.intro.md +0 -4
- package/backend/configurations/default-configurations/onboardee/journey.description.md +0 -10
- package/backend/configurations/default-configurations/onboardee/journey.nodes.blockLabels.label.md +0 -9
- package/backend/configurations/default-configurations/onboardee/walkthrough.files.title.md +0 -7
- package/backend/configurations/default-configurations/onboardee/walkthrough.intro.md +0 -5
- package/backend/configurations/default-configurations/standard/journey.description.md +0 -10
- package/backend/configurations/default-configurations/standard/journey.nodes.blockLabels.label.md +0 -9
- package/backend/configurations/default-configurations/standard/walkthrough.files.title.md +0 -7
- package/backend/configurations/default-configurations/standard/walkthrough.intro.md +0 -5
- package/backend/configurations/default-configurations/unfamiliar-territory/journey.description.md +0 -10
- package/backend/configurations/default-configurations/unfamiliar-territory/journey.nodes.blockLabels.label.md +0 -9
- package/backend/configurations/default-configurations/unfamiliar-territory/walkthrough.files.title.md +0 -7
- package/backend/configurations/default-configurations/unfamiliar-territory/walkthrough.intro.md +0 -5
- package/backend/configurations/system-instructions/journey.description.md +0 -14
- package/backend/configurations/system-instructions/journey.nodes.blockLabels.label.md +0 -6
- package/backend/configurations/system-instructions/walkthrough.files.summary.md +0 -4
- package/backend/configurations/system-instructions/walkthrough.files.title.md +0 -2
- package/backend/configurations/system-instructions/walkthrough.files.waypoints.needsAttention.md +0 -8
- package/backend/configurations/system-instructions/walkthrough.intro.md +0 -3
- package/frontend/assets/_branchId--sAXSZ0Z.js +0 -1
- package/frontend/assets/_branchId-BctD9BVI.js +0 -1
- package/frontend/assets/_id-DS2_k7mD.js +0 -1
- package/frontend/assets/_id-ZvG2tACL.js +0 -1
- package/frontend/assets/agents-Cg-w99VB.js +0 -1
- package/frontend/assets/agents-DbSvvIcf.js +0 -1
- package/frontend/assets/configuration-B1tYKnw1.js +0 -1
- package/frontend/assets/configuration-PLwRj92u.js +0 -1
- package/frontend/assets/create-BXn1thks.js +0 -1
- package/frontend/assets/create-CGIYQfn-.js +0 -1
- package/frontend/assets/create-DQsVrUIP.js +0 -1
- package/frontend/assets/download-BsAZZo3P.js +0 -1
- package/frontend/assets/forges-ChElPpOV.js +0 -1
- package/frontend/assets/forges-D5lw6fYh.js +0 -1
- package/frontend/assets/index-9KbVyMz4.js +0 -1
- package/frontend/assets/index-B7lg0P4V.js +0 -1
- package/frontend/assets/index-BBbL0wfM.js +0 -1
- package/frontend/assets/index-BCEvS2zI.js +0 -1
- package/frontend/assets/index-CIReAhWD.js +0 -1
- package/frontend/assets/index-CX9sF5Fh.js +0 -441
- package/frontend/assets/index-Ccx_zqhL.js +0 -1
- package/frontend/assets/index-D3gI7yfx.js +0 -1
- package/frontend/assets/index-D6S4PGCc.js +0 -1
- package/frontend/assets/index-Dfzoepph.js +0 -1
- package/frontend/assets/index-DgodP5aC.js +0 -1
- package/frontend/assets/index-DvVl2gWR.js +0 -1
- package/frontend/assets/index-DzSYBwXV.js +0 -1
- package/frontend/assets/index-eMdhkBjo.js +0 -1
- package/frontend/assets/index-ec_xLUMF.css +0 -1
- package/frontend/assets/index-xoWXUJLW.js +0 -1
- package/frontend/assets/repositories-DdOEWFoL.js +0 -1
- package/frontend/assets/repositories-Di8qfiyD.js +0 -1
- package/frontend/assets/route-qbVbAxtx.js +0 -1
- package/frontend/logo-small.png +0 -0
- package/frontend/logo.png +0 -0
- /package/backend/configurations/default-configurations/minimal/{blast.nodes.impactReason.md → blastDiagram.nodes.impactReason.md} +0 -0
- /package/backend/configurations/default-configurations/minimal/{blast.nodes.impactType.behaviour-changes.md → blastDiagram.nodes.impactType.behaviour-changes.md} +0 -0
- /package/backend/configurations/default-configurations/minimal/{blast.nodes.impactType.breaks.md → blastDiagram.nodes.impactType.breaks.md} +0 -0
- /package/backend/configurations/default-configurations/minimal/{blast.nodes.impactType.md → blastDiagram.nodes.impactType.md} +0 -0
- /package/backend/configurations/default-configurations/minimal/{blast.nodes.impactType.unaffected.md → blastDiagram.nodes.impactType.unaffected.md} +0 -0
- /package/backend/configurations/default-configurations/minimal/{journey.description.md → traceDiagram.description.md} +0 -0
- /package/backend/configurations/default-configurations/minimal/{journey.nodes.label.md → traceDiagram.nodes.label.md} +0 -0
- /package/backend/configurations/default-configurations/minimal/{journey.nodes.triggerLabels.label.md → traceDiagram.nodes.triggerLabels.label.md} +0 -0
- /package/backend/configurations/default-configurations/minimal/{walkthrough.files.waypoints.needsAttention.md → walkthrough.files.waypoints.coreChange.md} +0 -0
- /package/backend/configurations/default-configurations/onboardee/{blast.nodes.impactReason.md → blastDiagram.nodes.impactReason.md} +0 -0
- /package/backend/configurations/default-configurations/onboardee/{blast.nodes.impactType.behaviour-changes.md → blastDiagram.nodes.impactType.behaviour-changes.md} +0 -0
- /package/backend/configurations/default-configurations/onboardee/{blast.nodes.impactType.breaks.md → blastDiagram.nodes.impactType.breaks.md} +0 -0
- /package/backend/configurations/default-configurations/onboardee/{blast.nodes.impactType.md → blastDiagram.nodes.impactType.md} +0 -0
- /package/backend/configurations/default-configurations/onboardee/{blast.nodes.impactType.unaffected.md → blastDiagram.nodes.impactType.unaffected.md} +0 -0
- /package/backend/configurations/default-configurations/onboardee/{journey.nodes.label.md → traceDiagram.nodes.label.md} +0 -0
- /package/backend/configurations/default-configurations/onboardee/{journey.nodes.triggerLabels.label.md → traceDiagram.nodes.triggerLabels.label.md} +0 -0
- /package/backend/configurations/default-configurations/onboardee/{walkthrough.files.waypoints.needsAttention.md → walkthrough.files.waypoints.coreChange.md} +0 -0
- /package/backend/configurations/default-configurations/standard/{blast.nodes.impactReason.md → blastDiagram.nodes.impactReason.md} +0 -0
- /package/backend/configurations/default-configurations/standard/{blast.nodes.impactType.behaviour-changes.md → blastDiagram.nodes.impactType.behaviour-changes.md} +0 -0
- /package/backend/configurations/default-configurations/standard/{blast.nodes.impactType.breaks.md → blastDiagram.nodes.impactType.breaks.md} +0 -0
- /package/backend/configurations/default-configurations/standard/{blast.nodes.impactType.md → blastDiagram.nodes.impactType.md} +0 -0
- /package/backend/configurations/default-configurations/standard/{blast.nodes.impactType.unaffected.md → blastDiagram.nodes.impactType.unaffected.md} +0 -0
- /package/backend/configurations/default-configurations/standard/{journey.nodes.label.md → traceDiagram.nodes.label.md} +0 -0
- /package/backend/configurations/default-configurations/standard/{journey.nodes.triggerLabels.label.md → traceDiagram.nodes.triggerLabels.label.md} +0 -0
- /package/backend/configurations/default-configurations/standard/{walkthrough.files.waypoints.needsAttention.md → walkthrough.files.waypoints.coreChange.md} +0 -0
- /package/backend/configurations/default-configurations/unfamiliar-territory/{blast.nodes.impactReason.md → blastDiagram.nodes.impactReason.md} +0 -0
- /package/backend/configurations/default-configurations/unfamiliar-territory/{blast.nodes.impactType.behaviour-changes.md → blastDiagram.nodes.impactType.behaviour-changes.md} +0 -0
- /package/backend/configurations/default-configurations/unfamiliar-territory/{blast.nodes.impactType.breaks.md → blastDiagram.nodes.impactType.breaks.md} +0 -0
- /package/backend/configurations/default-configurations/unfamiliar-territory/{blast.nodes.impactType.md → blastDiagram.nodes.impactType.md} +0 -0
- /package/backend/configurations/default-configurations/unfamiliar-territory/{blast.nodes.impactType.unaffected.md → blastDiagram.nodes.impactType.unaffected.md} +0 -0
- /package/backend/configurations/default-configurations/unfamiliar-territory/{journey.nodes.label.md → traceDiagram.nodes.label.md} +0 -0
- /package/backend/configurations/default-configurations/unfamiliar-territory/{journey.nodes.triggerLabels.label.md → traceDiagram.nodes.triggerLabels.label.md} +0 -0
- /package/backend/configurations/default-configurations/unfamiliar-territory/{walkthrough.files.waypoints.needsAttention.md → walkthrough.files.waypoints.coreChange.md} +0 -0
- /package/backend/configurations/system-instructions/{blast.nodes.impactReason.md → blastDiagram.nodes.impactReason.md} +0 -0
- /package/backend/configurations/system-instructions/{blast.nodes.impactType.md → blastDiagram.nodes.impactType.md} +0 -0
- /package/backend/configurations/system-instructions/{journey.nodes.description.md → traceDiagram.nodes.description.md} +0 -0
- /package/backend/configurations/system-instructions/{journey.nodes.label.md → traceDiagram.nodes.label.md} +0 -0
- /package/backend/configurations/system-instructions/{journey.nodes.triggerLabels.label.md → traceDiagram.nodes.triggerLabels.label.md} +0 -0
|
@@ -1,80 +1,90 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Fi=Object.defineProperty;var Wi=(e,t,n)=>t in e?Fi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var M=(e,t,n)=>Wi(e,typeof t!="symbol"?t+"":t,n);import{a2 as F,ah as j,ai as J,aj as Ki,ak as Vi,al as ns,am as pe,an as lr,ao as Gi,ap as Qi,aq as cr,ar as Xi,as as Xe,r as C,at as rs,au as ye,av as Zi,aw as Yi,ax as G,j as w,ay as Ji,az as ss,aA as B,J as eo,aB as to,aC as no,aD as ro,aE as so,aF as D,aG as Le,aH as P,aI as In,aJ as se,aK as Re,aL as ce,aM as be,aN as mn,aO as Ze,aP as io,aQ as oo,aR as is,aS as Nn,aT as ao,aU as lo,aV as co,aW as os,aX as uo,aY as as,aZ as ho,a_ as po,a$ as fo,b0 as ls,b1 as mt,b2 as mo,b3 as Ye,b4 as go,b5 as ko,b6 as yo,b7 as bo,b8 as ur,b9 as xo,ba as wo,bb as ie,bc as nt,bd as vo,be as To,bf as Eo,bg as cs,B as Je,bh as us,bi as Ao,bj as So,bk as ds,bl as Co,bm as Lo,z as hs,bn as ps,Y as Mo,bo as Ro}from"./index-C8_4U9zA.js";/**
|
|
2
2
|
* @license lucide-react v1.49.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const
|
|
6
|
+
*/const fs={name:"bold",size:24,node:[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]};fs.node;const Io=F(fs);/**
|
|
7
7
|
* @license lucide-react v1.49.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const
|
|
11
|
+
*/const ms={name:"code",size:24,node:[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]};ms.node;const No=F(ms);/**
|
|
12
12
|
* @license lucide-react v1.49.0 - ISC
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const
|
|
16
|
+
*/const gs={name:"file-code",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]};gs.node;const Oo=F(gs);/**
|
|
17
17
|
* @license lucide-react v1.49.0 - ISC
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const
|
|
21
|
+
*/const ks={name:"heading",size:24,node:[["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M6 20V4",key:"1w1bmo"}],["path",{d:"M18 20V4",key:"o2hl4u"}]]};ks.node;const _o=F(ks);/**
|
|
22
22
|
* @license lucide-react v1.49.0 - ISC
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the ISC license.
|
|
25
25
|
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const
|
|
26
|
+
*/const ys={name:"italic",size:24,node:[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]};ys.node;const $o=F(ys);/**
|
|
27
27
|
* @license lucide-react v1.49.0 - ISC
|
|
28
28
|
*
|
|
29
29
|
* This source code is licensed under the ISC license.
|
|
30
30
|
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const
|
|
31
|
+
*/const bs={name:"link",size:24,node:[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]};bs.node;const Po=F(bs);/**
|
|
32
32
|
* @license lucide-react v1.49.0 - ISC
|
|
33
33
|
*
|
|
34
34
|
* This source code is licensed under the ISC license.
|
|
35
35
|
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const
|
|
36
|
+
*/const xs={name:"list-collapse",size:24,node:[["path",{d:"M10 5h11",key:"1hkqpe"}],["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 19h11",key:"14g2nv"}],["path",{d:"m3 10 3-3-3-3",key:"i7pm08"}],["path",{d:"m3 20 3-3-3-3",key:"20gx1n"}]]};xs.node;const Do=F(xs);/**
|
|
37
37
|
* @license lucide-react v1.49.0 - ISC
|
|
38
38
|
*
|
|
39
39
|
* This source code is licensed under the ISC license.
|
|
40
40
|
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const
|
|
41
|
+
*/const ws={name:"list-ordered",size:24,node:[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]]};ws.node;const zo=F(ws);/**
|
|
42
42
|
* @license lucide-react v1.49.0 - ISC
|
|
43
43
|
*
|
|
44
44
|
* This source code is licensed under the ISC license.
|
|
45
45
|
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const
|
|
46
|
+
*/const vs={name:"list",size:24,node:[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]};vs.node;const Ho=F(vs);/**
|
|
47
47
|
* @license lucide-react v1.49.0 - ISC
|
|
48
48
|
*
|
|
49
49
|
* This source code is licensed under the ISC license.
|
|
50
50
|
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/const
|
|
52
|
-
|
|
51
|
+
*/const Ts={name:"panels-top-left",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],aliases:["layout"]};Ts.node;const Bo=F(Ts);/**
|
|
52
|
+
* @license lucide-react v1.49.0 - ISC
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the ISC license.
|
|
55
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/const Es={name:"square-code",size:24,node:[["path",{d:"m10 9-3 3 3 3",key:"1oro0q"}],["path",{d:"m14 15 3-3-3-3",key:"bz13h7"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]],aliases:["code-square"]};Es.node;const jo=F(Es);/**
|
|
57
|
+
* @license lucide-react v1.49.0 - ISC
|
|
58
|
+
*
|
|
59
|
+
* This source code is licensed under the ISC license.
|
|
60
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
+
*/const As={name:"text-quote",size:24,node:[["path",{d:"M17 5H3",key:"1cn7zz"}],["path",{d:"M21 12H8",key:"scolzb"}],["path",{d:"M21 19H8",key:"13qgcb"}],["path",{d:"M3 12v7",key:"1ri8j3"}]]};As.node;const qo=F(As);function On(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var we=On();function Ss(e){we=e}var fe={exec:()=>null};function S(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(s,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(z.caret,"$1"),n=n.replace(s,o),r},getRegex:()=>new RegExp(n,t)};return r}var Uo=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),z={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},Fo=/^(?:[ \t]*(?:\n|$))+/,Wo=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ko=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,rt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Vo=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_n=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Cs=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ls=S(Cs).replace(/bull/g,_n).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Go=S(Cs).replace(/bull/g,_n).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),$n=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Qo=/^[^\n]+/,Pn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Xo=S(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Pn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Zo=S(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,_n).getRegex(),Xt="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Dn=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Yo=S("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Dn).replace("tag",Xt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ms=S($n).replace("hr",rt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Xt).getRegex(),Jo=S(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ms).getRegex(),zn={blockquote:Jo,code:Wo,def:Xo,fences:Ko,heading:Vo,hr:rt,html:Yo,lheading:Ls,list:Zo,newline:Fo,paragraph:Ms,table:fe,text:Qo},dr=S("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",rt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Xt).getRegex(),ea={...zn,lheading:Go,table:dr,paragraph:S($n).replace("hr",rt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",dr).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Xt).getRegex()},ta={...zn,html:S(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Dn).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:fe,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:S($n).replace("hr",rt).replace("heading",` *#{1,6} *[^
|
|
62
|
+
]`).replace("lheading",Ls).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},na=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ra=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Rs=/^( {2,}|\\)\n(?!\s*$)/,sa=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ie=/[\p{P}\p{S}]/u,Zt=/[\s\p{P}\p{S}]/u,Hn=/[^\s\p{P}\p{S}]/u,ia=S(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Zt).getRegex(),Is=/(?!~)[\p{P}\p{S}]/u,oa=/(?!~)[\s\p{P}\p{S}]/u,aa=/(?:[^\s\p{P}\p{S}]|~)/u,la=S(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Uo?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ns=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,ca=S(Ns,"u").replace(/punct/g,Ie).getRegex(),ua=S(Ns,"u").replace(/punct/g,Is).getRegex(),Os="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",da=S(Os,"gu").replace(/notPunctSpace/g,Hn).replace(/punctSpace/g,Zt).replace(/punct/g,Ie).getRegex(),ha=S(Os,"gu").replace(/notPunctSpace/g,aa).replace(/punctSpace/g,oa).replace(/punct/g,Is).getRegex(),pa=S("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Hn).replace(/punctSpace/g,Zt).replace(/punct/g,Ie).getRegex(),fa=S(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Ie).getRegex(),ma="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",ga=S(ma,"gu").replace(/notPunctSpace/g,Hn).replace(/punctSpace/g,Zt).replace(/punct/g,Ie).getRegex(),ka=S(/\\(punct)/,"gu").replace(/punct/g,Ie).getRegex(),ya=S(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[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])?)+(?![-_])/).getRegex(),ba=S(Dn).replace("(?:-->|$)","-->").getRegex(),xa=S("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",ba).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),gt=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,wa=S(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",gt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),_s=S(/^!?\[(label)\]\[(ref)\]/).replace("label",gt).replace("ref",Pn).getRegex(),$s=S(/^!?\[(ref)\](?:\[\])?/).replace("ref",Pn).getRegex(),va=S("reflink|nolink(?!\\()","g").replace("reflink",_s).replace("nolink",$s).getRegex(),hr=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Bn={_backpedal:fe,anyPunctuation:ka,autolink:ya,blockSkip:la,br:Rs,code:ra,del:fe,delLDelim:fe,delRDelim:fe,emStrongLDelim:ca,emStrongRDelimAst:da,emStrongRDelimUnd:pa,escape:na,link:wa,nolink:$s,punctuation:ia,reflink:_s,reflinkSearch:va,tag:xa,text:sa,url:fe},Ta={...Bn,link:S(/^!?\[(label)\]\((.*?)\)/).replace("label",gt).getRegex(),reflink:S(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",gt).getRegex()},gn={...Bn,emStrongRDelimAst:ha,emStrongLDelim:ua,delLDelim:fa,delRDelim:ga,url:S(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",hr).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:S(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",hr).getRegex()},Ea={...gn,br:S(Rs).replace("{2,}","*").getRegex(),text:S(gn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},it={normal:zn,gfm:ea,pedantic:ta},Ne={normal:Bn,gfm:gn,breaks:Ea,pedantic:Ta},Aa={"&":"&","<":"<",">":">",'"':""","'":"'"},pr=e=>Aa[e];function X(e,t){if(t){if(z.escapeTest.test(e))return e.replace(z.escapeReplace,pr)}else if(z.escapeTestNoEncode.test(e))return e.replace(z.escapeReplaceNoEncode,pr);return e}function fr(e){try{e=encodeURI(e).replace(z.percentDecode,"%")}catch{return null}return e}function mr(e,t){var i;let n=e.replace(z.findPipe,(o,a,l)=>{let c=!1,u=a;for(;--u>=0&&l[u]==="\\";)c=!c;return c?"|":" |"}),r=n.split(z.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!((i=r.at(-1))!=null&&i.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(z.slashPipe,"|");return r}function Oe(e,t,n){let r=e.length;if(r===0)return"";let s=0;for(;s<r&&e.charAt(r-s-1)===t;)s++;return e.slice(0,r-s)}function Sa(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Ca(e,t=0){let n=t,r="";for(let s of e)if(s===" "){let i=4-n%4;r+=" ".repeat(i),n+=i}else r+=s,n++;return r}function gr(e,t,n,r,s){let i=t.href,o=t.title||null,a=e[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}function La(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let s=r[1];return t.split(`
|
|
53
63
|
`).map(i=>{let o=i.match(n.other.beginningSpace);if(o===null)return i;let[a]=o;return a.length>=s.length?i.slice(s.length):i}).join(`
|
|
54
|
-
`)}var
|
|
55
|
-
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=
|
|
56
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=
|
|
64
|
+
`)}var kt=class{constructor(e){M(this,"options");M(this,"rules");M(this,"lexer");this.options=e||we}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Oe(n,`
|
|
65
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=La(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=Oe(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Oe(t[0],`
|
|
66
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=Oe(t[0],`
|
|
57
67
|
`).split(`
|
|
58
68
|
`),r="",s="",i=[];for(;n.length>0;){let o=!1,a=[],l;for(l=0;l<n.length;l++)if(this.rules.other.blockquoteStart.test(n[l]))a.push(n[l]),o=!0;else if(!o)a.push(n[l]);else break;n=n.slice(l);let c=a.join(`
|
|
59
69
|
`),u=c.replace(this.rules.other.blockquoteSetextReplace,`
|
|
60
70
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
61
71
|
${c}`:c,s=s?`${s}
|
|
62
|
-
${u}`:u;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,i,!0),this.lexer.state.top=d,n.length===0)break;let h=i.at(-1);if((h==null?void 0:h.type)==="code")break;if((h==null?void 0:h.type)==="blockquote"){let p=h,
|
|
72
|
+
${u}`:u;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,i,!0),this.lexer.state.top=d,n.length===0)break;let h=i.at(-1);if((h==null?void 0:h.type)==="code")break;if((h==null?void 0:h.type)==="blockquote"){let p=h,g=p.raw+`
|
|
63
73
|
`+n.join(`
|
|
64
|
-
`),
|
|
74
|
+
`),m=this.blockquote(g);i[i.length-1]=m,r=r.substring(0,r.length-p.raw.length)+m.raw,s=s.substring(0,s.length-p.text.length)+m.text;break}else if((h==null?void 0:h.type)==="list"){let p=h,g=p.raw+`
|
|
65
75
|
`+n.join(`
|
|
66
|
-
`),
|
|
67
|
-
`);continue}}return{type:"blockquote",raw:r,tokens:i,text:s}}}list(e){var n,r;let t=this.rules.block.list.exec(e);if(t){let s=t[1].trim(),i=s.length>1,o={type:"list",raw:"",ordered:i,start:i?+s.slice(0,-1):"",loose:!1,items:[]};s=i?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=i?s:"[*+-]");let a=this.rules.other.listItemRegex(s),l=!1;for(;e;){let u=!1,d="",h="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;d=t[0],e=e.substring(d.length);let p=
|
|
68
|
-
`,1)[0],t[1].length),
|
|
69
|
-
`,1)[0],
|
|
70
|
-
`,e=e.substring(
|
|
71
|
-
`,1)[0]
|
|
72
|
-
|
|
73
|
-
`+m
|
|
74
|
-
`,e=e.substring(
|
|
75
|
-
`):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let a of r)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<n.length;a++)i.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:i.align[a]});for(let a of s)i.rows.push(
|
|
76
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let i=
|
|
77
|
-
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){var s,i,o;for(this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(
|
|
76
|
+
`),m=this.list(g);i[i.length-1]=m,r=r.substring(0,r.length-h.raw.length)+m.raw,s=s.substring(0,s.length-p.raw.length)+m.raw,n=g.substring(i.at(-1).raw.length).split(`
|
|
77
|
+
`);continue}}return{type:"blockquote",raw:r,tokens:i,text:s}}}list(e){var n,r;let t=this.rules.block.list.exec(e);if(t){let s=t[1].trim(),i=s.length>1,o={type:"list",raw:"",ordered:i,start:i?+s.slice(0,-1):"",loose:!1,items:[]};s=i?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=i?s:"[*+-]");let a=this.rules.other.listItemRegex(s),l=!1;for(;e;){let u=!1,d="",h="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;d=t[0],e=e.substring(d.length);let p=Ca(t[2].split(`
|
|
78
|
+
`,1)[0],t[1].length),g=e.split(`
|
|
79
|
+
`,1)[0],m=!p.trim(),f=0;if(this.options.pedantic?(f=2,h=p.trimStart()):m?f=t[1].length+1:(f=p.search(this.rules.other.nonSpaceChar),f=f>4?1:f,h=p.slice(f),f+=t[1].length),m&&this.rules.other.blankLine.test(g)&&(d+=g+`
|
|
80
|
+
`,e=e.substring(g.length+1),u=!0),!u){let y=this.rules.other.nextBulletRegex(f),b=this.rules.other.hrRegex(f),T=this.rules.other.fencesBeginRegex(f),v=this.rules.other.headingBeginRegex(f),A=this.rules.other.htmlBeginRegex(f),x=this.rules.other.blockquoteBeginRegex(f);for(;e;){let R=e.split(`
|
|
81
|
+
`,1)[0],$;if(g=R,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),$=g):$=g.replace(this.rules.other.tabCharGlobal," "),T.test(g)||v.test(g)||A.test(g)||x.test(g)||y.test(g)||b.test(g))break;if($.search(this.rules.other.nonSpaceChar)>=f||!g.trim())h+=`
|
|
82
|
+
`+$.slice(f);else{if(m||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||T.test(p)||v.test(p)||b.test(p))break;h+=`
|
|
83
|
+
`+g}m=!g.trim(),d+=R+`
|
|
84
|
+
`,e=e.substring(R.length+1),p=$.slice(f)}}o.loose||(l?o.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(l=!0)),o.items.push({type:"list_item",raw:d,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),o.raw+=d}let c=o.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let u of o.items){if(this.lexer.state.top=!1,u.tokens=this.lexer.blockTokens(u.text,[]),u.task){if(u.text=u.text.replace(this.rules.other.listReplaceTask,""),((n=u.tokens[0])==null?void 0:n.type)==="text"||((r=u.tokens[0])==null?void 0:r.type)==="paragraph"){u.tokens[0].raw=u.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),u.tokens[0].text=u.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let h=this.lexer.inlineQueue.length-1;h>=0;h--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)){this.lexer.inlineQueue[h].src=this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask,"");break}}let d=this.rules.other.listTaskCheckbox.exec(u.raw);if(d){let h={type:"checkbox",raw:d[0]+" ",checked:d[0]!=="[ ]"};u.checked=h.checked,o.loose?u.tokens[0]&&["paragraph","text"].includes(u.tokens[0].type)&&"tokens"in u.tokens[0]&&u.tokens[0].tokens?(u.tokens[0].raw=h.raw+u.tokens[0].raw,u.tokens[0].text=h.raw+u.tokens[0].text,u.tokens[0].tokens.unshift(h)):u.tokens.unshift({type:"paragraph",raw:h.raw,text:h.raw,tokens:[h]}):u.tokens.unshift(h)}}if(!o.loose){let d=u.tokens.filter(p=>p.type==="space"),h=d.length>0&&d.some(p=>this.rules.other.anyLine.test(p.raw));o.loose=h}}if(o.loose)for(let u of o.items){u.loose=!0;for(let d of u.tokens)d.type==="text"&&(d.type="paragraph")}return o}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:s}}}table(e){var o;let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=mr(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(o=t[3])!=null&&o.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
85
|
+
`):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let a of r)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<n.length;a++)i.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:i.align[a]});for(let a of s)i.rows.push(mr(a,i.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:i.align[c]})));return i}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
|
|
86
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let i=Oe(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{let i=Sa(t[2],"()");if(i===-2)return;if(i>-1){let o=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let r=t[2],s="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(r);i&&(r=i[1],s=i[3])}else s=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),gr(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[r.toLowerCase()];if(!s){let i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return gr(n,s,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,i,o,a=s,l=0,c=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+s);(r=c.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(o=[...i].length,r[3]||r[4]){a+=o;continue}else if((r[5]||r[6])&&s%3&&!((s+o)%3)){l+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a+l);let u=[...r[0]][0].length,d=e.slice(0,s+r.index+u+o);if(Math.min(s,o)%2){let p=d.slice(1,-1);return{type:"em",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}let h=d.slice(2,-2);return{type:"strong",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let s=[...r[0]].length-1,i,o,a=s,l=this.rules.inline.delRDelim;for(l.lastIndex=0,t=t.slice(-1*e.length+s);(r=l.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(o=[...i].length,o!==s))continue;if(r[3]||r[4]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);let c=[...r[0]][0].length,u=e.slice(0,s+r.index+c+o),d=u.slice(s,-s);return{type:"del",raw:u,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let r,s;if(t[2]==="@")r=t[0],s="mailto:"+r;else{let i;do i=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(i!==t[0]);r=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},W=class kn{constructor(t){M(this,"tokens");M(this,"options");M(this,"state");M(this,"inlineQueue");M(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||we,this.options.tokenizer=this.options.tokenizer||new kt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:z,block:it.normal,inline:Ne.normal};this.options.pedantic?(n.block=it.pedantic,n.inline=Ne.pedantic):this.options.gfm&&(n.block=it.gfm,this.options.breaks?n.inline=Ne.breaks:n.inline=Ne.gfm),this.tokenizer.rules=n}static get rules(){return{block:it,inline:Ne}}static lex(t,n){return new kn(n).lex(t)}static lexInline(t,n){return new kn(n).inlineTokens(t)}lex(t){t=t.replace(z.carriageReturn,`
|
|
87
|
+
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){var s,i,o;for(this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(z.tabCharGlobal," ").replace(z.spaceLine,""));t;){let a;if((i=(s=this.options.extensions)==null?void 0:s.block)!=null&&i.some(c=>(a=c.call({lexer:this},t,n))?(t=t.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.space(t)){t=t.substring(a.raw.length);let c=n.at(-1);a.raw.length===1&&c!==void 0?c.raw+=`
|
|
78
88
|
`:n.push(a);continue}if(a=this.tokenizer.code(t)){t=t.substring(a.raw.length);let c=n.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
|
|
79
89
|
`)?"":`
|
|
80
90
|
`)+a.raw,c.text+=`
|
|
@@ -87,9 +97,9 @@ ${u}`:u;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
87
97
|
`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):n.push(a),r=l.length!==t.length,t=t.substring(a.raw.length);continue}if(a=this.tokenizer.text(t)){t=t.substring(a.raw.length);let c=n.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
|
|
88
98
|
`)?"":`
|
|
89
99
|
`)+a.raw,c.text+=`
|
|
90
|
-
`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):n.push(a);continue}if(t){let c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var l,c,u,d,h;this.tokenizer.lexer=this;let r=t,s=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)p.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)i=s[2]?s[2].length:0,r=r.slice(0,s.index+i)+"["+"a".repeat(s[0].length-i-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((c=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:c.call({lexer:this},r))??r;let o=!1,a="";for(;t;){o||(a=""),o=!1;let p;if((d=(u=this.options.extensions)==null?void 0:u.inline)!=null&&d.some(
|
|
91
|
-
`;return r?'<pre><code class="language-'+
|
|
92
|
-
`:"<pre><code>"+(n?s:
|
|
100
|
+
`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):n.push(a);continue}if(t){let c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var l,c,u,d,h;this.tokenizer.lexer=this;let r=t,s=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)p.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)i=s[2]?s[2].length:0,r=r.slice(0,s.index+i)+"["+"a".repeat(s[0].length-i-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((c=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:c.call({lexer:this},r))??r;let o=!1,a="";for(;t;){o||(a=""),o=!1;let p;if((d=(u=this.options.extensions)==null?void 0:u.inline)!=null&&d.some(m=>(p=m.call({lexer:this},t,n))?(t=t.substring(p.raw.length),n.push(p),!0):!1))continue;if(p=this.tokenizer.escape(t)){t=t.substring(p.raw.length),n.push(p);continue}if(p=this.tokenizer.tag(t)){t=t.substring(p.raw.length),n.push(p);continue}if(p=this.tokenizer.link(t)){t=t.substring(p.raw.length),n.push(p);continue}if(p=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(p.raw.length);let m=n.at(-1);p.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):n.push(p);continue}if(p=this.tokenizer.emStrong(t,r,a)){t=t.substring(p.raw.length),n.push(p);continue}if(p=this.tokenizer.codespan(t)){t=t.substring(p.raw.length),n.push(p);continue}if(p=this.tokenizer.br(t)){t=t.substring(p.raw.length),n.push(p);continue}if(p=this.tokenizer.del(t,r,a)){t=t.substring(p.raw.length),n.push(p);continue}if(p=this.tokenizer.autolink(t)){t=t.substring(p.raw.length),n.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(t))){t=t.substring(p.raw.length),n.push(p);continue}let g=t;if((h=this.options.extensions)!=null&&h.startInline){let m=1/0,f=t.slice(1),y;this.options.extensions.startInline.forEach(b=>{y=b.call({lexer:this},f),typeof y=="number"&&y>=0&&(m=Math.min(m,y))}),m<1/0&&m>=0&&(g=t.substring(0,m+1))}if(p=this.tokenizer.inlineText(g)){t=t.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(a=p.raw.slice(-1)),o=!0;let m=n.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=p.raw,m.text+=p.text):n.push(p);continue}if(t){let m="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return n}},yt=class{constructor(e){M(this,"options");M(this,"parser");this.options=e||we}space(e){return""}code({text:e,lang:t,escaped:n}){var i;let r=(i=(t||"").match(z.notSpaceStart))==null?void 0:i[0],s=e.replace(z.endingNewline,"")+`
|
|
101
|
+
`;return r?'<pre><code class="language-'+X(r)+'">'+(n?s:X(s,!0))+`</code></pre>
|
|
102
|
+
`:"<pre><code>"+(n?s:X(s,!0))+`</code></pre>
|
|
93
103
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
94
104
|
${this.parser.parse(e)}</blockquote>
|
|
95
105
|
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
@@ -105,53 +115,56 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
105
115
|
`}tablerow({text:e}){return`<tr>
|
|
106
116
|
${e}</tr>
|
|
107
117
|
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
108
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${
|
|
109
|
-
Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+
|
|
118
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${X(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),s=fr(e);if(s===null)return r;e=s;let i='<a href="'+e+'"';return t&&(i+=' title="'+X(t)+'"'),i+=">"+r+"</a>",i}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let s=fr(e);if(s===null)return X(n);e=s;let i=`<img src="${e}" alt="${X(n)}"`;return t&&(i+=` title="${X(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:X(e.text)}},jn=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},K=class yn{constructor(t){M(this,"options");M(this,"renderer");M(this,"textRenderer");this.options=t||we,this.options.renderer=this.options.renderer||new yt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new jn}static parse(t,n){return new yn(n).parse(t)}static parseInline(t,n){return new yn(n).parseInline(t)}parse(t){var r,s;this.renderer.parser=this;let n="";for(let i=0;i<t.length;i++){let o=t[i];if((s=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&s[o.type]){let l=o,c=this.options.extensions.renderers[l.type].call({parser:this},l);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){n+=c||"";continue}}let a=o;switch(a.type){case"space":{n+=this.renderer.space(a);break}case"hr":{n+=this.renderer.hr(a);break}case"heading":{n+=this.renderer.heading(a);break}case"code":{n+=this.renderer.code(a);break}case"table":{n+=this.renderer.table(a);break}case"blockquote":{n+=this.renderer.blockquote(a);break}case"list":{n+=this.renderer.list(a);break}case"checkbox":{n+=this.renderer.checkbox(a);break}case"html":{n+=this.renderer.html(a);break}case"def":{n+=this.renderer.def(a);break}case"paragraph":{n+=this.renderer.paragraph(a);break}case"text":{n+=this.renderer.text(a);break}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}parseInline(t,n=this.renderer){var s,i;this.renderer.parser=this;let r="";for(let o=0;o<t.length;o++){let a=t[o];if((i=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&i[a.type]){let c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=c||"";continue}}let l=a;switch(l.type){case"escape":{r+=n.text(l);break}case"html":{r+=n.html(l);break}case"link":{r+=n.link(l);break}case"image":{r+=n.image(l);break}case"checkbox":{r+=n.checkbox(l);break}case"strong":{r+=n.strong(l);break}case"em":{r+=n.em(l);break}case"codespan":{r+=n.codespan(l);break}case"br":{r+=n.br(l);break}case"del":{r+=n.del(l);break}case"text":{r+=n.text(l);break}default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return r}},pt,He=(pt=class{constructor(e){M(this,"options");M(this,"block");this.options=e||we}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?W.lex:W.lexInline}provideParser(e=this.block){return e?K.parse:K.parseInline}},M(pt,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),M(pt,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),pt),Ps=class{constructor(...e){M(this,"defaults",On());M(this,"options",this.setOptions);M(this,"parse",this.parseMarkdown(!0));M(this,"parseInline",this.parseMarkdown(!1));M(this,"Parser",K);M(this,"Renderer",yt);M(this,"TextRenderer",jn);M(this,"Lexer",W);M(this,"Tokenizer",kt);M(this,"Hooks",He);this.use(...e)}walkTokens(e,t){var r,s;let n=[];for(let i of e)switch(n=n.concat(t.call(this,i)),i.type){case"table":{let o=i;for(let a of o.header)n=n.concat(this.walkTokens(a.tokens,t));for(let a of o.rows)for(let l of a)n=n.concat(this.walkTokens(l.tokens,t));break}case"list":{let o=i;n=n.concat(this.walkTokens(o.items,t));break}default:{let o=i;(s=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&s[o.type]?this.defaults.extensions.childTokens[o.type].forEach(a=>{let l=o[a].flat(1/0);n=n.concat(this.walkTokens(l,t))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let i=t.renderers[s.name];i?t.renderers[s.name]=function(...o){let a=s.renderer.apply(this,o);return a===!1&&(a=i.apply(this,o)),a}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=t[s.level];i?i.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),r.extensions=t),n.renderer){let s=this.defaults.renderer||new yt(this.defaults);for(let i in n.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let o=i,a=n.renderer[o],l=s[o];s[o]=(...c)=>{let u=a.apply(s,c);return u===!1&&(u=l.apply(s,c)),u||""}}r.renderer=s}if(n.tokenizer){let s=this.defaults.tokenizer||new kt(this.defaults);for(let i in n.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let o=i,a=n.tokenizer[o],l=s[o];s[o]=(...c)=>{let u=a.apply(s,c);return u===!1&&(u=l.apply(s,c)),u}}r.tokenizer=s}if(n.hooks){let s=this.defaults.hooks||new He;for(let i in n.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let o=i,a=n.hooks[o],l=s[o];He.passThroughHooks.has(i)?s[o]=c=>{if(this.defaults.async&&He.passThroughHooksRespectAsync.has(i))return(async()=>{let d=await a.call(s,c);return l.call(s,d)})();let u=a.call(s,c);return l.call(s,u)}:s[o]=(...c)=>{if(this.defaults.async)return(async()=>{let d=await a.apply(s,c);return d===!1&&(d=await l.apply(s,c)),d})();let u=a.apply(s,c);return u===!1&&(u=l.apply(s,c)),u}}r.hooks=s}if(n.walkTokens){let s=this.defaults.walkTokens,i=n.walkTokens;r.walkTokens=function(o){let a=[];return a.push(i.call(this,o)),s&&(a=a.concat(s.call(this,o))),a}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return W.lex(e,t??this.defaults)}parser(e,t){return K.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},s={...this.defaults,...r},i=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(t):t,a=await(s.hooks?await s.hooks.provideLexer(e):e?W.lex:W.lexInline)(o,s),l=s.hooks?await s.hooks.processAllTokens(a):a;s.walkTokens&&await Promise.all(this.walkTokens(l,s.walkTokens));let c=await(s.hooks?await s.hooks.provideParser(e):e?K.parse:K.parseInline)(l,s);return s.hooks?await s.hooks.postprocess(c):c})().catch(i);try{s.hooks&&(t=s.hooks.preprocess(t));let o=(s.hooks?s.hooks.provideLexer(e):e?W.lex:W.lexInline)(t,s);s.hooks&&(o=s.hooks.processAllTokens(o)),s.walkTokens&&this.walkTokens(o,s.walkTokens);let a=(s.hooks?s.hooks.provideParser(e):e?K.parse:K.parseInline)(o,s);return s.hooks&&(a=s.hooks.postprocess(a)),a}catch(o){return i(o)}}}onError(e,t){return n=>{if(n.message+=`
|
|
119
|
+
Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+X(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},xe=new Ps;function L(e,t){return xe.parse(e,t)}L.options=L.setOptions=function(e){return xe.setOptions(e),L.defaults=xe.defaults,Ss(L.defaults),L};L.getDefaults=On;L.defaults=we;L.use=function(...e){return xe.use(...e),L.defaults=xe.defaults,Ss(L.defaults),L};L.walkTokens=function(e,t){return xe.walkTokens(e,t)};L.parseInline=xe.parseInline;L.Parser=K;L.parser=K.parse;L.Renderer=yt;L.TextRenderer=jn;L.Lexer=W;L.lexer=W.lex;L.Tokenizer=kt;L.Hooks=He;L.parse=L;L.options;L.setOptions;L.use;L.walkTokens;L.parseInline;K.parse;W.lex;const Ma=/\n[^\S\n]*(?:\n[^\S\n]*)+$/;function Ra(e){return e.flatMap((t,n)=>{var r;if(t.type==="space"||((r=e[n+1])===null||r===void 0?void 0:r.type)==="space")return[t];const s=(t.raw||"").match(Ma);return s?[{...t,raw:(t.raw||"").slice(0,-s[0].length)},{type:"space",raw:s[0]}]:[t]})}function Ia(e,t){const n=t.split(`
|
|
110
120
|
`).flatMap(r=>[r,""]).map(r=>`${e}${r}`).join(`
|
|
111
|
-
`);return n.slice(0,n.length-1)}function
|
|
112
|
-
`).match(/\n\n/g)||[]).length}parseToken(e,t=!1){if(!e.type)return null;if(e.type==="list")return this.parseListToken(e);const n=this.getHandlersForToken(e.type),r=this.createParseHelpers();if(n.find(s=>{if(!s.parseMarkdown)return!1;const i=s.parseMarkdown(e,r),o=this.normalizeParseResult(i);return o&&(!Array.isArray(o)||o.length>0)?(this.lastParseResult=o,!0):!1})&&this.lastParseResult){const s=this.lastParseResult;return this.lastParseResult=null,s}return this.parseFallbackToken(e,t)}parseListToken(e){if(!e.items||e.items.length===0)return this.parseTokenWithHandlers(e);const t=e.items.some(a=>
|
|
113
|
-
`),g
|
|
114
|
-
`).trim()){const
|
|
115
|
-
`).trim();
|
|
116
|
-
`))}}h={type:"taskItem",raw:"",mainContent:f,indentLevel:d,checked:u??!1,text:f,tokens:this.tokenizeInline(f),nestedTokens:b}}const p=c?"taskList":"list";i!==p?(s.length>0&&r.push({type:i,items:s}),s=[h],i=p):s.push(h)}s.length>0&&r.push({type:i,items:s});const o=[];for(let a=0;a<r.length;a+=1){const l=r[a],c={...e,type:l.type,items:l.items},u=this.parseToken(c);u&&(Array.isArray(u)?o.push(...u):o.push(u))}return o.length>0?o:null}parseTokenWithHandlers(e){if(!e.type)return null;const t=this.getHandlersForToken(e.type),n=this.createParseHelpers();if(t.find(r=>{if(!r.parseMarkdown)return!1;const s=r.parseMarkdown(e,n),i=this.normalizeParseResult(s);return i&&(!Array.isArray(i)||i.length>0)?(this.lastParseResult=i,!0):!1})&&this.lastParseResult){const r=this.lastParseResult;return this.lastParseResult=null,r}return this.parseFallbackToken(e)}createParseHelpers(){return{parseInline:e=>this.parseInlineTokens(e),tokenizeInline:e=>this.tokenizeInline(e),parseChildren:e=>this.parseTokens(e),parseBlockChildren:e=>this.parseTokens(e,!0),createTextNode:(e,t)=>({type:"text",text:e,marks:t||void 0}),createNode:(e,t,n)=>{const r={type:e,attrs:t||void 0,content:n||void 0};return(!t||Object.keys(t).length===0)&&delete r.attrs,r},applyMark:(e,t,n)=>({mark:e,content:t,attrs:n&&Object.keys(n).length>0?n:void 0})}}escapeRegex(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(e){const t=[];for(let o=0;o<e.length;o+=1){const a=e[o];if(a.type==="text")t.push({type:"text",text:Gn(a.text||"")});else if(a.type==="escape")t.push({type:"text",text:a.text||""});else if(a.type==="html"){var n,r;const l=((n=(r=a.raw)!==null&&r!==void 0?r:a.text)!==null&&n!==void 0?n:"").toString(),c=/^<\/[\s]*[\w-]+/i.test(l),u=l.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!c&&u&&!/\/>$/.test(l)){const h=u[1],p=this.escapeRegex(h),m=new RegExp(`^<\\/\\s*${p}\\b`,"i");let g=-1;const f=[l];for(let b=o+1;b<e.length;b+=1){var s,i;const y=e[b],v=((s=(i=y.raw)!==null&&i!==void 0?i:y.text)!==null&&s!==void 0?s:"").toString();if(f.push(v),y.type==="html"&&m.test(v)){g=b;break}}if(g!==-1){const b=f.join(""),y={type:"html",raw:b,text:b,block:!1},v=this.parseHTMLToken(y);if(v){const w=this.normalizeParseResult(v);Array.isArray(w)?t.push(...w):w&&t.push(w)}o=g;continue}}const d=this.parseHTMLToken(a);if(d){const h=this.normalizeParseResult(d);Array.isArray(h)?t.push(...h):h&&t.push(h)}}else if(a.type){const l=this.getHandlerForToken(a.type);if(l&&l.parseMarkdown){const c=this.createParseHelpers(),u=l.parseMarkdown(a,c);if(this.isMarkResult(u)){const d=this.applyMarkToContent(u.mark,u.content,u.attrs);t.push(...d)}else{const d=this.normalizeParseResult(u);Array.isArray(d)?t.push(...d):d&&t.push(d)}}else a.tokens&&t.push(...this.parseInlineTokens(a.tokens))}}for(let o=t.length-1;o>0;o-=1){const a=t[o],l=t[o-1];if(a.type==="text"&&l.type==="text"){const c=a.marks||[],u=l.marks||[];Vs(c,u)&&(l.text=(l.text||"")+(a.text||""),t.splice(o,1))}}return t}applyMarkToContent(e,t,n){return t.map(r=>{if(r.type==="text"){const s=r.marks||[],i=n?{type:e,attrs:n}:{type:e};return{...r,marks:[...s,i]}}return{...r,content:r.content?this.applyMarkToContent(e,r.content,n):void 0}})}isMarkResult(e){return e&&typeof e=="object"&&"mark"in e}normalizeParseResult(e){return e?this.isMarkResult(e)?e.content:e:null}parseFallbackToken(e,t=!1){switch(e.type){case"paragraph":return{type:"paragraph",content:e.tokens?this.parseInlineTokens(e.tokens):[]};case"heading":return{type:"heading",attrs:{level:e.depth||1},content:e.tokens?this.parseInlineTokens(e.tokens):[]};case"text":return{type:"text",text:Gn(e.text||"")};case"html":return this.parseHTMLToken(e);case"escape":return{type:"text",text:e.text||""};case"space":return null;default:return e.tokens?this.parseTokens(e.tokens,t):null}}parseHTMLToken(e){const t=e.text||e.raw||"";if(!t.trim())return null;if(this.isUnrecognizedHtml(t))return this.htmlAsLiteralText(t,!!e.block);if(typeof window>"u"||typeof window.DOMParser>"u")return this.htmlAsLiteralText(t,!!e.block);try{const n=Qs(t,this.baseExtensions);if(n.type==="doc"&&n.content){if(e.block)return n.content;const r=this.toInlineContent(n.content);return r.length>0?r:null}return n}catch(n){throw new Error(`Failed to parse HTML in markdown: ${n}`)}}toInlineContent(e){const t=this.getInlineNodeTypes();return e.flatMap(n=>n.type&&t.has(n.type)?[n]:n.content?this.toInlineContent(n.content):[])}getInlineNodeTypes(){if(this.inlineNodeTypesCache)return this.inlineNodeTypesCache;const e=new Set(["text"]);try{const t=Vn(this.baseExtensions);Object.values(t.nodes).forEach(n=>{n.isInline&&e.add(n.name)})}catch{}return this.inlineNodeTypesCache=e,e}isUnrecognizedHtml(e){return Po(e,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const e=new Set;try{const t=Vn(this.baseExtensions),n=r=>{const s=r==null?void 0:r.parseDOM;Array.isArray(s)&&s.forEach(i=>{if(typeof(i==null?void 0:i.tag)=="string"){const o=i.tag.match(/^[a-zA-Z][\w-]*/);o&&e.add(o[0].toLowerCase())}})};Object.values(t.nodes).forEach(r=>n(r.spec)),Object.values(t.marks).forEach(r=>n(r.spec))}catch{}return this.schemaParseDomTagsCache=e,e}htmlAsLiteralText(e,t){const n=e.replace(/\s+$/,"");return n?t?{type:"paragraph",content:[{type:"text",text:n}]}:{type:"text",text:n}:null}encodeTextForMarkdown(e,t,n){return(n==null?void 0:n.type)!=null&&this.codeTypes.has(n.type)||(t.marks||[]).some(r=>this.codeTypes.has(typeof r=="string"?r:r.type))?e:this.escapeMarkdownSyntax(Xs(e))}escapeMarkdownSyntax(e){return e.replace(/([\\`*_[\]~])/g,"\\$1")}renderNodeToMarkdown(e,t,n=0,r=0,s={}){var i;if(e.type==="text")return this.encodeTextForMarkdown(e.text||"",e,t);if(!e.type)return"";const o=this.getHandlerForToken(e.type);if(!o)return"";const a=Array.isArray(t==null?void 0:t.content)&&n>0?t.content[n-1]:void 0,l={renderChildren:(u,d)=>{const h=o.isIndenting?r+1:r;return!Array.isArray(u)&&u.content?this.renderNodes(u.content,e,d||"",n,h):this.renderNodes(u,e,d||"",n,h)},renderChild:(u,d)=>{const h=o.isIndenting?r+1:r;return this.renderNodeToMarkdown(u,e,d,h)},indent:u=>this.indentString+u,wrapInBlock:Ao},c={index:n,level:r,parentType:t==null?void 0:t.type,previousNode:a,meta:{parentAttrs:t==null?void 0:t.attrs,...s}};return((i=o.renderMarkdown)===null||i===void 0?void 0:i.call(o,e,l,c))||""}renderNodes(e,t,n="",r=0,s=0){return Array.isArray(e)?this.renderNodesWithMarkBoundaries(e,t,n,s):e.type?this.renderNodeToMarkdown(e,t,r,s):""}renderNodesWithMarkBoundaries(e,t,n="",r=0){const s=[],i=new Map,o=new Set,a=new Map,l=Ro(e);return e.forEach((c,u)=>{const d=u<e.length-1?e[u+1]:null;if(c.type)if(c.type==="text"){let h=this.encodeTextForMarkdown(c.text||"",c,t),p=new Map((c.marks||[]).map(x=>[x.type,x])),m=this.getMarksToOpenForSerialization(i,p,d),g=rr(p,d);if(h.length>0&&h.trim().length===0&&p.size>0){const x=new Set(g.filter(S=>!i.has(S)));x.size>0&&(p=new Map(Array.from(p).filter(([S])=>!x.has(S))),m=this.getMarksToOpenForSerialization(i,p,d),g=rr(p,d))}const f=g.filter(x=>i.has(x)),b=f.length>0&&m.length>0;let y="";if(g.length>0&&!b){const x=h.match(/(\s+)$/);x&&(y=x[1],h=h.slice(0,-y.length))}b||g.slice().reverse().forEach(x=>{var S;if(!i.has(x))return;const P=p.get(x),_=this.getMarkClosing(x,P,a.get(x),(S=l[u])===null||S===void 0?void 0:S.get(x));_&&(h+=_),i.has(x)&&(i.delete(x),a.delete(x))});let v="";if(m.length>0){const x=h.match(/^(\s+)/);x&&(v=x[1],h=h.slice(v.length))}m.forEach(({type:x,mark:S})=>{var P;const _=o.has(x)?"html":"markdown",K=this.getMarkOpening(x,S,_,(P=l[u])===null||P===void 0?void 0:P.get(x));K&&(h=K+h),a.set(x,_),o.delete(x)}),b||m.slice().reverse().forEach(({type:x,mark:S})=>{i.set(x,S)}),h=v+h;let w;if(b){const x=new Set(((d==null?void 0:d.marks)||[]).map(_=>_.type));m.forEach(({type:_})=>{x.has(_)&&this.getHtmlReopenTags(_)&&o.add(_)});const S=Array.from(i.keys()),P=f.slice().sort((_,K)=>S.indexOf(K)-S.indexOf(_));w=[...m.map(_=>_.type),...P]}else w=Co(i,p,d,this.markSetsEqual.bind(this));let E="";if(w.length>0){const x=h.match(/(\s+)$/);x&&(E=x[1],h=h.slice(0,-E.length))}w.forEach(x=>{var S,P;const _=(S=i.get(x))!==null&&S!==void 0?S:p.get(x),K=this.getMarkClosing(x,_,a.get(x),(P=l[u])===null||P===void 0?void 0:P.get(x));K&&(h+=K),i.delete(x),a.delete(x)}),h+=E,h+=y,s.push(h)}else{const h=new Set((c.marks||[]).map(y=>y.type)),p=new Map,m=new Map;i.forEach((y,v)=>{if(h.has(v)){var w;p.set(v,y),m.set(v,(w=a.get(v))!==null&&w!==void 0?w:"markdown")}});const g=So(i,(y,v)=>{var w;return this.getMarkClosing(y,v,a.get(y),(w=l[u-1])===null||w===void 0?void 0:w.get(y))});a.clear();const f=this.renderNodeToMarkdown(c,t,u,r),b=c.type==="hardBreak"?"":Mo(p,i,(y,v)=>{var w,E;const x=(w=m.get(y))!==null&&w!==void 0?w:"markdown";return a.set(y,x),this.getMarkOpening(y,v,x,(E=l[u+1])===null||E===void 0?void 0:E.get(y))});s.push(g+f+b)}}),s.join(n)}getMarkOpening(e,t,n="markdown",r){if(n==="html"){var s;return((s=this.getHtmlReopenTags(e))===null||s===void 0?void 0:s.open)||""}const i=this.getHandlersForNodeType(e),o=i.length>0?i[0]:void 0;if(!o||!o.renderMarkdown)return"";const a="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:e,attrs:t.attrs||{},content:[{type:"text",text:a}]};try{const c=o.renderMarkdown(l,{renderChildren:()=>a,renderChild:()=>a,indent:d=>d,wrapInBlock:(d,h)=>d+h},{index:0,level:0,parentType:"text",meta:{markText:r}}),u=c.indexOf(a);return u>=0?c.substring(0,u):""}catch(c){throw new Error(`Failed to get mark opening for ${e}: ${c}`)}}getMarkClosing(e,t,n="markdown",r){if(n==="html"){var s;return((s=this.getHtmlReopenTags(e))===null||s===void 0?void 0:s.close)||""}const i=this.getHandlersForNodeType(e),o=i.length>0?i[0]:void 0;if(!o||!o.renderMarkdown)return"";const a="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:e,attrs:t.attrs||{},content:[{type:"text",text:a}]};try{const c=o.renderMarkdown(l,{renderChildren:()=>a,renderChild:()=>a,indent:h=>h,wrapInBlock:(h,p)=>h+p},{index:0,level:0,parentType:"text",meta:{markText:r}}),u=c.indexOf(a),d=u+33;return u>=0?c.substring(d):""}catch(c){throw new Error(`Failed to get mark closing for ${e}: ${c}`)}}getHtmlReopenTags(e){const t=this.getHandlersForNodeType(e),n=t.length>0?t[0]:void 0;return n==null?void 0:n.htmlReopen}markSetsEqual(e,t){return e.size!==t.size?!1:Array.from(e.entries()).every(([n,r])=>{const s=t.get(n);return s&&Ue(r.attrs,s.attrs)})}getMarksToOpenForSerialization(e,t,n){const r=Lo(e,t);if(r.length<=1)return r;const s=(n==null?void 0:n.marks)||[],i=(c,u)=>s.some(d=>d.type===c&&Ue(d.attrs,u)),o=(c,u)=>{var d,h;const p=(d=this.extensionRanks.get(c.type))!==null&&d!==void 0?d:Number.MAX_SAFE_INTEGER,m=(h=this.extensionRanks.get(u.type))!==null&&h!==void 0?h:Number.MAX_SAFE_INTEGER;return p!==m?m-p:c.type.localeCompare(u.type)},a=r.filter(c=>!i(c.type,c.mark.attrs)).sort(o),l=r.filter(c=>i(c.type,c.mark.attrs)).sort(o);return[...a,...l]}};const No=H.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(e,t)=>{if(!(t!=null&&t.contentType))return Y.setContent(e,t);if(Ze(e,t==null?void 0:t.contentType)!=="markdown"||!this.editor.markdown)return Y.setContent(e,t);const n=this.editor.markdown.parse(e);return Y.setContent(n,t)},insertContent:(e,t)=>{if(!(t!=null&&t.contentType))return Y.insertContent(e,t);if(Ze(e,t==null?void 0:t.contentType)!=="markdown"||!this.editor.markdown)return Y.insertContent(e,t);const n=this.editor.markdown.parse(e);return Y.insertContent(n,t)},insertContentAt:(e,t,n)=>{if(!(n!=null&&n.contentType))return Y.insertContentAt(e,t,n);if(Ze(t,n==null?void 0:n.contentType)!=="markdown"||!this.editor.markdown)return Y.insertContentAt(e,t,n);const r=this.editor.markdown.parse(t);return Y.insertContentAt(e,r,n)}}},addStorage(){return{manager:new sr({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){var e;if(this.editor.markdown){console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");return}if(this.storage.manager=new sr({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||Ze(this.editor.options.content,this.editor.options.contentType)!=="markdown")return;if(!this.editor.markdown)throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(this.editor.options.content===void 0||typeof this.editor.options.content!="string")throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');const t=this.editor.markdown.parse(this.editor.options.content);!((e=t.content)===null||e===void 0)&&e.length&&(this.editor.options.content=t)}}),{getOwnPropertyNames:Do,getOwnPropertySymbols:zo}=Object,{hasOwnProperty:Ho}=Object.prototype;function Re(e,t){return function(r,s,i){return e(r,s,i)&&t(r,s,i)}}function Ie(e){return function(n,r,s){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,s);const{cache:i}=s,o=i.get(n),a=i.get(r);if(o&&a)return o===r&&a===n;i.set(n,r),i.set(r,n);const l=e(n,r,s);return i.delete(n),i.delete(r),l}}function Bo(e){return e!=null?e[Symbol.toStringTag]:void 0}function ir(e){return Do(e).concat(zo(e))}const jo=Object.hasOwn||((e,t)=>Ho.call(e,t));function be(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const qo="__v",Uo="__o",Fo="_owner",{getOwnPropertyDescriptor:dn,keys:or}=Object,Wo=dn(Object.getPrototypeOf(Int8Array.prototype),Symbol.toStringTag).get;function Ko(e,t){return e.byteLength===t.byteLength&&ut(new Uint8Array(e),new Uint8Array(t))}function Go(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 Vo(e,t){return e.byteLength===t.byteLength&&ut(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Qo(e,t){return be(e.getTime(),t.getTime())}function ar(e,t,n){return e.name===t.name&&e.message===t.message&&e.stack===t.stack&&n.equals(e.cause,t.cause,"cause","cause",e,t,n)}function Xo(e,t){return e===t}function lr(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const s=new Array(r),i=e.entries();let o,a,l=0;for(;(o=i.next())&&!o.done;){const c=t.entries();let u=!1,d=0;for(;(a=c.next())&&!a.done;){if(s[d]){d++;continue}const h=o.value,p=a.value;if(n.equals(h[0],p[0],l,d,e,t,n)&&n.equals(h[1],p[1],h[0],p[0],e,t,n)){u=s[d]=!0;break}d++}if(!u)return!1;l++}return!0}const Zo=be;function cr(e,t,n){const r=or(e);let s=r.length;if(or(t).length!==s)return!1;for(;s-- >0;)if(!ss(e,t,n,r[s]))return!1;return!0}function ve(e,t,n){const r=ir(e);let s=r.length;if(ir(t).length!==s)return!1;let i,o,a;for(;s-- >0;)if(i=r[s],!ss(e,t,n,i)||(o=dn(e,i),a=dn(t,i),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function Yo(e,t){return be(e.valueOf(),t.valueOf())}function Jo(e,t){return e.source===t.source&&e.flags===t.flags}function ur(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const s=new Array(r),i=e.values();let o,a;for(;(o=i.next())&&!o.done;){const l=t.values();let c=!1,u=0;for(;(a=l.next())&&!a.done;){if(!s[u]&&n.equals(o.value,a.value,o.value,a.value,e,t,n)){c=s[u]=!0;break}u++}if(!c)return!1}return!0}function ut(e,t){let n=e.length;if(t.length!==n||e.byteOffset!==t.byteOffset)return!1;const r=Wo.call(e);if(r==="Float64Array"||r==="Float32Array"||r==="Float16Array"){for(;n-- >0;)if(e[n]!==t[n]&&(e[n]===e[n]||t[n]===t[n]))return!1;return!0}for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function ea(e,t){return e.href===t.href?!0:e.protocol===t.protocol&&e.username===t.username&&e.password===t.password&&e.host===t.host&&e.pathname===t.pathname&&e.hash===t.hash&&ta(e.searchParams,t.searchParams)}function ta(e,t){const n=e.toString(),r=t.toString();return n===r||dr(n)===dr(r)}function dr(e){return e.split("&").sort().join("&")}function ss(e,t,n,r){return(r===Fo||r===Uo||r===qo)&&(e.$$typeof||t.$$typeof)?!0:jo(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const na="[object ArrayBuffer]",ra="[object Arguments]",sa="[object Boolean]",ia="[object DataView]",oa="[object Date]",aa="[object Error]",la="[object Map]",ca="[object Number]",ua="[object Object]",da="[object RegExp]",ha="[object Set]",pa="[object String]",fa={"[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},ga="[object URL]",ma=Object.prototype.toString;function ka({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:a,areObjectsEqual:l,arePrimitiveWrappersEqual:c,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:h,areUrlsEqual:p,unknownTagComparators:m}){return function(f,b,y){if(f===b)return!0;if(f==null||b==null)return!1;const v=typeof f;if(v!==typeof b)return!1;if(v!=="object")return v==="number"?a(f,b,y):v==="function"?i(f,b,y):!1;const w=f.constructor;if(w!==b.constructor)return!1;if(w===Object)return l(f,b,y);if(Array.isArray(f))return t(f,b,y);if(w===Date)return r(f,b,y);if(w===RegExp)return u(f,b,y);if(w===Map)return o(f,b,y);if(w===Set)return d(f,b,y);if(w==null)return l(f,b,y);const E=ma.call(f);if(E===oa)return r(f,b,y);if(E===da)return u(f,b,y);if(E===la)return o(f,b,y);if(E===ha)return d(f,b,y);if(E===ua)return typeof f.then!="function"&&typeof b.then!="function"&&l(f,b,y);if(E===ga)return p(f,b,y);if(E===aa)return s(f,b,y);if(E===ra)return l(f,b,y);if(fa[E])return h(f,b,y);if(E===na)return e(f,b,y);if(E===ia)return n(f,b,y);if(E===sa||E===ca||E===pa)return c(f,b,y);if(m){let x=m[E];if(!x){const S=Bo(f);S&&(x=m[S])}if(x)return x(f,b,y)}return!1}}function ya({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:Ko,areArraysEqual:n?ve:Go,areDataViewsEqual:Vo,areDatesEqual:Qo,areErrorsEqual:n?Re(ar,ve):Re(ar,cr),areFunctionsEqual:Xo,areMapsEqual:n?Re(lr,ve):lr,areNumbersEqual:Zo,areObjectsEqual:n?ve:cr,arePrimitiveWrappersEqual:Yo,areRegExpsEqual:Jo,areSetsEqual:n?Re(ur,ve):ur,areTypedArraysEqual:n?Re(ut,ve):ut,areUrlsEqual:ea,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const s=Ie(r.areArraysEqual),i=Ie(r.areErrorsEqual),o=Ie(r.areMapsEqual),a=Ie(r.areObjectsEqual),l=Ie(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areErrorsEqual:i,areMapsEqual:o,areObjectsEqual:a,areSetsEqual:l})}return r}function ba(e){return function(t,n,r,s,i,o,a){return e(t,n,a)}}function xa({circular:e,comparator:t,createState:n,equals:r,strict:s}){if(n)return function(a,l){const{cache:c=e?new WeakMap:void 0,meta:u}=n();return t(a,l,{cache:c,equals:r,meta:u,strict:s})};if(e)return function(a,l){return t(a,l,{cache:new WeakMap,equals:r,meta:void 0,strict:s})};const i={cache:void 0,equals:r,meta:void 0,strict:s};return function(a,l){return t(a,l,i)}}const wa=le();le({strict:!0});le({circular:!0});le({circular:!0,strict:!0});le({createInternalComparator:()=>be});le({strict:!0,createInternalComparator:()=>be});le({circular:!0,createInternalComparator:()=>be});le({circular:!0,createInternalComparator:()=>be,strict:!0});function le(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:s=!1}=e,i=ya(e),o=ka(i),a=n?n(o):ba(o);return xa({circular:t,comparator:o,createState:r,equals:a,strict:s})}function va(e,t){var n,r;if(e.isDestroyed||t.defaultPrevented||!t.cancelable||!e.isEditable||t.inputType!=="insertParagraph"&&t.inputType!=="insertLineBreak"||!ei()&&!ti())return;const s=e.view,i=s.root,o=(n=(r=i.getSelection)===null||r===void 0?void 0:r.call(i))!==null&&n!==void 0?n:s.dom.ownerDocument.getSelection(),a=o==null?void 0:o.anchorNode,l=(a==null?void 0:a.nodeType)===1?a:a==null?void 0:a.parentElement,c=l==null?void 0:l.closest("[data-node-view-content-react]");if(!c||!s.dom.contains(c))return;const u=s.input.lastKeyCode;u===13&&(s.input.lastKeyCode=null),s.domObserver.forceFlush(),s.domObserver.flush();const d=new KeyboardEvent("keydown",{key:"Enter",code:"Enter",keyCode:13,shiftKey:t.inputType==="insertLineBreak",bubbles:!0,cancelable:!0});s.someProp("handleKeyDown",h=>h(s,d))?(t.preventDefault(),s.input.lastIOSEnter=0,clearTimeout(s.input.lastIOSEnterFallbackTimeout)):u===13&&(s.input.lastKeyCode=u)}const hr=new Z("reactMobileEnter"),Ta=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},Ea=({contentComponent:e})=>{const t=Ir.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return M.jsx(M.Fragment,{children:Object.values(t)})};function Aa(){const e=new Set;let t={},n=!1;const r=()=>{n||!e.size||(n=!0,queueMicrotask(()=>{n=!1,e.forEach(s=>s())}))};return{subscribe(s){return e.add(s),()=>{e.delete(s)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(s,i){t={...t,[s]:Js.createPortal(i.reactElement,i.element,s)},r()},removeRenderer(s){const i={...t};delete i[s],t=i,r()}}}var La=class extends ge.Component{constructor(e){super(e),this.editorContentRef=ge.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var e;const t=this.props.editor;if(t&&!t.isDestroyed&&(!((e=t.view.dom)===null||e===void 0)&&e.parentNode)){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n}),t.contentComponent=Aa(),t.createNodeViews(),t.registerPlugin(new B({key:hr,props:{handleDOMEvents:{beforeinput:(r,s)=>va(t,s)}}})),t.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){const e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||(e.unregisterPlugin(hr),e.view.setProps({nodeViews:{}})),e.contentComponent=null;try{var t;if(!(!((t=e.view.dom)===null||t===void 0)&&t.parentNode))return;const n=document.createElement("div");n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n})}catch{}}}render(){const{editor:e,innerRef:t,...n}=this.props;return M.jsxs(M.Fragment,{children:[M.jsx("div",{ref:Ta(t,this.editorContentRef),...n}),(e==null?void 0:e.contentComponent)&&M.jsx(Ea,{contentComponent:e.contentComponent})]})}};const Ca=O.forwardRef((e,t)=>{const n=ge.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return ge.createElement(La,{key:n,innerRef:t,...e})}),is=ge.memo(Ca),Sa=typeof window<"u"?O.useLayoutEffect:O.useEffect;var Ma=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.lastSnapshot:(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 t;const n=s=>{(s==null?void 0:s.transaction)!==void 0&&s.transaction===t||(t=s==null?void 0:s.transaction,this.transactionNumber+=1,this.subscribers.forEach(i=>i()))},r=this.editor;return r.on("transaction",n),r.on("update",n),()=>{r.off("transaction",n),r.off("update",n)}}}};function os(e){var t;const[n]=O.useState(()=>new Ma(e.editor)),r=Ys.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,(t=e.equalityFn)!==null&&t!==void 0?t:wa);return Sa(()=>n.watch(e.editor),[e.editor,n]),O.useDebugValue(r),r}const Ra=!1,as=typeof window>"u",Ia=as||!!(typeof window<"u"&&window.next);var $a=class ls{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,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(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){const t=this.options.current.immediatelyRender;let n=t??!0;return as?(n&&Ra&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"),n=!1):Ia&&t===void 0&&(n=!1),n?this.createEditor():null}createEditor(){const t={...this.options.current,onBeforeCreate:(...n)=>{var r,s;return(r=(s=this.options.current).onBeforeCreate)===null||r===void 0?void 0:r.call(s,...n)},onBlur:(...n)=>{var r,s;return(r=(s=this.options.current).onBlur)===null||r===void 0?void 0:r.call(s,...n)},onCreate:(...n)=>{var r,s;return(r=(s=this.options.current).onCreate)===null||r===void 0?void 0:r.call(s,...n)},onDestroy:(...n)=>{var r,s;return(r=(s=this.options.current).onDestroy)===null||r===void 0?void 0:r.call(s,...n)},onFocus:(...n)=>{var r,s;return(r=(s=this.options.current).onFocus)===null||r===void 0?void 0:r.call(s,...n)},onSelectionUpdate:(...n)=>{var r,s;return(r=(s=this.options.current).onSelectionUpdate)===null||r===void 0?void 0:r.call(s,...n)},onTransaction:(...n)=>{var r,s;return(r=(s=this.options.current).onTransaction)===null||r===void 0?void 0:r.call(s,...n)},onUpdate:(...n)=>{var r,s;return(r=(s=this.options.current).onUpdate)===null||r===void 0?void 0:r.call(s,...n)},onContentError:(...n)=>{var r,s;return(r=(s=this.options.current).onContentError)===null||r===void 0?void 0:r.call(s,...n)},onDrop:(...n)=>{var r,s;return(r=(s=this.options.current).onDrop)===null||r===void 0?void 0:r.call(s,...n)},onPaste:(...n)=>{var r,s;return(r=(s=this.options.current).onPaste)===null||r===void 0?void 0:r.call(s,...n)},onDelete:(...n)=>{var r,s;return(r=(s=this.options.current).onDelete)===null||r===void 0?void 0:r.call(s,...n)},onMount:(...n)=>{var r,s;return(r=(s=this.options.current).onMount)===null||r===void 0?void 0:r.call(s,...n)},onUnmount:(...n)=>{var r,s;return(r=(s=this.options.current).onUnmount)===null||r===void 0?void 0:r.call(s,...n)}};return new Zs(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}static compareOptions(t,n){return Object.keys(t).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&t.extensions&&n.extensions?t.extensions.length!==n.extensions.length?!1:t.extensions.every((s,i)=>{var o;return s===((o=n.extensions)===null||o===void 0?void 0:o[i])}):t[r]===n[r])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?ls.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(t){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=t;return}if(this.previousDeps.length===t.length&&this.previousDeps.every((n,r)=>n===t[r]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=t}scheduleDestroy(){const t=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===t){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===t&&this.setEditor(null))},1)}};function _a(e={},t=[]){const n=O.useRef(e);n.current=e;const[r]=O.useState(()=>new $a(n)),s=Ir.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return O.useDebugValue(s),O.useEffect(r.onRender(t)),os({editor:s,selector:({transactionNumber:i})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&i===0?0:i+1}),s}const cs=O.createContext({editor:null});cs.Consumer;const Oa=O.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),Pa=()=>O.useContext(Oa);ge.forwardRef((e,t)=>{const{onDragStart:n}=Pa(),r=e.as||"div";return M.jsx(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});ge.createContext({markViewContentRef:()=>{}});const _n=O.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});_n.displayName="TiptapContext";const Na=()=>O.useContext(_n);function us({children:e,...t}){const n="editor"in t?t.editor:t.instance;if(!n)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const r=O.useMemo(()=>({editor:n}),[n]),s=O.useMemo(()=>({editor:n}),[n]);return M.jsx(cs.Provider,{value:s,children:M.jsx(_n.Provider,{value:r,children:e})})}us.displayName="Tiptap";function ds({...e}){const{editor:t}=Na();return M.jsx(is,{editor:t,...e})}ds.displayName="Tiptap.Content";Object.assign(us,{Content:ds});const hs=new WeakSet,ps=new WeakSet;function ce(e){const t=e;return hs.add(t),t}function hn(e){return Array.isArray(e)&&hs.has(e)}function fs(e){return e.flatMap(t=>t==null?[]:Array.isArray(t)&&ps.has(t)&&!hn(t)?fs(t):[t])}function Da(e,t){if(e==="slot")return 0;if(e instanceof Function){const s=e(t);return Array.isArray(s)&&!hn(s)&&!ps.has(s)?ce(s):s}const{children:n,...r}=t??{};if(e==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");if(Array.isArray(n)){if(hn(n))return ce([e,r,n]);if(n.length===0)return ce([e,r]);const s=fs(n);return s.length===0?ce([e,r]):ce([e,r,...s])}return n!=null?ce([e,r,n]):ce([e,r])}const dt=(e,t)=>Da(e,t),za=(e,t)=>{var n;const{state:r}=e,{selection:s}=r;if(!s.empty)return!1;const{$from:i}=s;if(i.parentOffset!==0)return!1;const o=i.depth-1;if(o<0)return!1;const a=i.node(o),l=i.index(o);if(l===0)return!1;if(a.type===t)return e.commands.lift(t.name);const c=a.child(l-1);if(c.type!==t||!(!((n=c.lastChild)===null||n===void 0)&&n.isTextblock))return!1;const u=i.before()-1-1;return e.commands.command(({tr:d,dispatch:h})=>{if(!h)return!0;const p=i.parent.content,m=new vn(p,0,0);return d.replace(u,i.after(),m),d.setSelection(re.create(d.doc,u+p.size)),d.scrollIntoView(),h(d),!0})},Ha=/^\s*>\s$/,Ba=j.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:e}){return dt("blockquote",{...N(this.options.HTMLAttributes,e),children:dt("slot",{})})},parseMarkdown:(e,t)=>{var n;const r=(n=t.parseBlockChildren)!==null&&n!==void 0?n:t.parseChildren;return t.createNode("blockquote",void 0,r(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return"";const n=">",r=[];return e.content.forEach((s,i)=>{var o,a;const l=((o=(a=t.renderChild)===null||a===void 0?void 0:a.call(t,s,i))!==null&&o!==void 0?o:t.renderChildren([s])).split(`
|
|
121
|
+
`);return n.slice(0,n.length-1)}function kr(e,t){const n=[];return Array.from(e.entries()).forEach(([r,s])=>{if(!t){n.push(r);return}(t.marks||[]).find(i=>i.type===r&&Xe(i.attrs,s.attrs))||n.push(r)}),n}function Na(e,t){const n=[];return Array.from(t.entries()).forEach(([r,s])=>{const i=e.get(r);(!i||!Xe(i.attrs,s.attrs))&&n.push({type:r,mark:s})}),n}function Oa(e,t,n,r){const s=!n,i=n&&(!n.marks||n.marks.length===0),o=n&&n.marks&&!r(t,new Map(n.marks.map(l=>[l.type,l]))),a=[];return(s||i||o)&&(n&&n.marks?Array.from(e.entries()).reverse().forEach(([l,c])=>{n.marks.find(u=>u.type===l&&Xe(u.attrs,c.attrs))||a.push(l)}):(s||i)&&a.push(...Array.from(e.keys()).reverse())),a}function _a(e,t){let n="";return Array.from(e.keys()).reverse().forEach(r=>{const s=t(r,e.get(r));s&&(n=s+n)}),e.clear(),n}function $a(e,t,n){let r="";return Array.from(e.entries()).forEach(([s,i])=>{const o=n(s,i);o&&(r+=o),t.set(s,i)}),r}function on(e){const t=(e.raw||e.text||"").match(/^(\s*)[-+*]\s+\[([ xX])\]\s+/);return t?{isTask:!0,checked:t[2].toLowerCase()==="x",indentLevel:t[1].length}:{isTask:!1,indentLevel:0}}function ot(e,t){return typeof e!="string"?"json":t}function Pa(e){const t=e.map(()=>new Map),n=new Map,r=s=>{const i=n.get(s);i&&(i.indexes.forEach(o=>t[o].set(s,i.text)),n.delete(s))};return e.forEach((s,i)=>{if(s.type!=="text"){Array.from(n.keys()).forEach(r);return}const o=new Set((s.marks||[]).map(a=>a.type));Array.from(n.keys()).filter(a=>!o.has(a)).forEach(r),o.forEach(a=>{const l=n.get(a)||{indexes:[],text:""};l.indexes.push(i),l.text+=s.text||"",n.set(a,l)})}),Array.from(n.keys()).forEach(r),t}const Da=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","circle","clippath","defs","ellipse","foreignobject","g","image","line","lineargradient","mask","path","polygon","polyline","radialgradient","rect","stop","switch","symbol","textpath","tspan","use","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),za=/<\/?([a-zA-Z][\w-]*)/g;function Ha(e){const t=[];let n;for(;(n=za.exec(e))!==null;)t.push(n[1].toLowerCase());return t}function Ba(e){const t=e.toLowerCase();return t.includes("-")?!1:!Da.has(t)}function ja(e,t){return Ha(e).some(n=>Ba(n)?!t.has(n):!1)}var yr=class{constructor(e){var t,n,r,s,i;this.activeParseLexer=null,this.extensionRanks=new Map,this.baseExtensions=[],this.extensions=[],this.codeTypes=new Set,this.schemaParseDomTagsCache=null,this.inlineNodeTypesCache=null,this.lastParseResult=null,this.markedInstance=(t=e==null?void 0:e.marked)!==null&&t!==void 0?t:L,this.indentStyle=(n=e==null||(r=e.indentation)===null||r===void 0?void 0:r.style)!==null&&n!==void 0?n:"space",this.indentSize=(s=e==null||(i=e.indentation)===null||i===void 0?void 0:i.size)!==null&&s!==void 0?s:2,this.baseExtensions=(e==null?void 0:e.extensions)||[],e!=null&&e.markedOptions&&typeof this.markedInstance.setOptions=="function"&&this.markedInstance.setOptions(e.markedOptions),this.registry=new Map,this.nodeTypeRegistry=new Map,e!=null&&e.extensions&&(this.baseExtensions=e.extensions,Ki(Vi(e.extensions)).forEach(o=>this.registerExtension(o)))}get instance(){return this.markedInstance}get indentCharacter(){return this.indentStyle==="space"?" ":" "}get indentString(){return this.indentCharacter.repeat(this.indentSize)}hasMarked(){return!!this.markedInstance}registerExtension(e){var t,n;this.extensions.push(e);const r=ns(pe(e,"code")),s=e.name,i={name:s,options:e.options,storage:e.storage};r&&this.codeTypes.add(s),this.extensionRanks.has(s)||this.extensionRanks.set(s,this.extensionRanks.size);const o=pe(e,"markdownTokenName",i)||s,a=pe(e,"parseMarkdown",i),l=pe(e,"renderMarkdown",i),c=pe(e,"markdownTokenizer",i),u=(t=pe(e,"markdownOptions",i))!==null&&t!==void 0?t:null,d={tokenName:o,nodeName:s,parseMarkdown:a,renderMarkdown:l,isIndenting:(n=u==null?void 0:u.indentsContent)!==null&&n!==void 0?n:!1,htmlReopen:u==null?void 0:u.htmlReopen,tokenizer:c};if(o&&a){const h=this.registry.get(o)||[];h.push(d),this.registry.set(o,h)}if(l){const h=this.nodeTypeRegistry.get(s)||[];h.push(d),this.nodeTypeRegistry.set(s,h)}c&&this.hasMarked()&&this.registerTokenizer(c)}createLexer(){return new this.markedInstance.Lexer(this.markedInstance.defaults)}createTokenizerHelpers(e){return{inlineTokens:t=>e.inlineTokens(t),blockTokens:t=>e.blockTokens(t)}}tokenizeInline(e){var t;return((t=this.activeParseLexer)!==null&&t!==void 0?t:this.createLexer()).inlineTokens(e)}registerTokenizer(e){if(!this.hasMarked())return;const{name:t,start:n,level:r="inline",tokenize:s}=e,i=this.createTokenizerHelpers.bind(this),o=this.createLexer.bind(this);let a;n?a=typeof n=="function"?n:c=>c.indexOf(n):a=c=>{const u=s(c,[],this.createTokenizerHelpers(this.createLexer()));return u&&u.raw?c.indexOf(u.raw):-1};const l={name:t,level:r,start:a,tokenizer(c,u){const d=this.lexer?i(this.lexer):i(o()),h=s(c,u,d);if(h&&h.type)return{...h,type:h.type||t,raw:h.raw||"",tokens:h.tokens||[]}},childTokens:[]};this.markedInstance.use({extensions:[l]})}getHandlersForToken(e){try{return this.registry.get(e)||[]}catch{return[]}}getHandlerForToken(e){const t=this.getHandlersForToken(e);if(t.length>0)return t[0];const n=this.getHandlersForNodeType(e);return n.length>0?n[0]:void 0}getHandlersForNodeType(e){try{return this.nodeTypeRegistry.get(e)||[]}catch{return[]}}serialize(e){if(!e)return"";const t=this.renderNodes(e,e);return this.isEmptyOutput(t)?"":t}isEmptyOutput(e){return!e||e.trim()===""?!0:e.replace(/ /g,"").replace(/\u00A0/g,"").trim()===""}parse(e){if(!this.hasMarked())throw new Error("No marked instance available for parsing");const t=this.activeParseLexer,n=this.createLexer();this.activeParseLexer=n;try{const r=n.lex(e);return{type:"doc",content:this.parseTokens(r,!0)}}finally{this.activeParseLexer=t}}parseTokens(e,t=!1){const n=t?Ra(e):e,r=n.reduce((o,a,l)=>(a.type!=="space"&&o.push(l),o),[]);let s=-1,i=0;return n.flatMap((o,a)=>{for(;i<r.length&&r[i]<a;)s=r[i],i+=1;if(t&&o.type==="space"){var l;const u=(l=r[i])!==null&&l!==void 0?l:-1;return this.createImplicitEmptyParagraphsFromSpace(o,s,u)}const c=this.parseToken(o,t);return c===null?[]:Array.isArray(c)?c:[c]})}createImplicitEmptyParagraphsFromSpace(e,t,n){const r=this.countParagraphSeparators(e.raw||"");if(r===0)return[];const s=Math.max(r-(t===-1||n===-1?0:1),0);return Array.from({length:s},()=>({type:"paragraph",content:[]}))}countParagraphSeparators(e){return(e.replace(/\r\n/g,`
|
|
122
|
+
`).match(/\n\n/g)||[]).length}parseToken(e,t=!1){if(!e.type)return null;if(e.type==="list")return this.parseListToken(e);const n=this.getHandlersForToken(e.type),r=this.createParseHelpers();if(n.find(s=>{if(!s.parseMarkdown)return!1;const i=s.parseMarkdown(e,r),o=this.normalizeParseResult(i);return o&&(!Array.isArray(o)||o.length>0)?(this.lastParseResult=o,!0):!1})&&this.lastParseResult){const s=this.lastParseResult;return this.lastParseResult=null,s}return this.parseFallbackToken(e,t)}parseListToken(e){if(!e.items||e.items.length===0)return this.parseTokenWithHandlers(e);const t=e.items.some(a=>on(a).isTask),n=e.items.some(a=>!on(a).isTask);if(!t||!n||this.getHandlersForToken("taskList").length===0)return this.parseTokenWithHandlers(e);const r=[];let s=[],i=null;for(let a=0;a<e.items.length;a+=1){const l=e.items[a],{isTask:c,checked:u,indentLevel:d}=on(l);let h=l;if(c){const g=(l.raw||l.text||"").split(`
|
|
123
|
+
`),m=g[0].match(/^\s*[-+*]\s+\[([ xX])\]\s+(.*)$/),f=m?m[2]:"";let y=[];if(g.length>1&&g.slice(1).join(`
|
|
124
|
+
`).trim()){const b=g.slice(1),T=b.filter(v=>v.trim());if(T.length>0){const v=Math.min(...T.map(x=>x.length-x.trimStart().length)),A=b.map(x=>x.trim()?x.slice(v):"").join(`
|
|
125
|
+
`).trim();A&&(y=this.markedInstance.lexer(`${A}
|
|
126
|
+
`))}}h={type:"taskItem",raw:"",mainContent:f,indentLevel:d,checked:u??!1,text:f,tokens:this.tokenizeInline(f),nestedTokens:y}}const p=c?"taskList":"list";i!==p?(s.length>0&&r.push({type:i,items:s}),s=[h],i=p):s.push(h)}s.length>0&&r.push({type:i,items:s});const o=[];for(let a=0;a<r.length;a+=1){const l=r[a],c={...e,type:l.type,items:l.items},u=this.parseToken(c);u&&(Array.isArray(u)?o.push(...u):o.push(u))}return o.length>0?o:null}parseTokenWithHandlers(e){if(!e.type)return null;const t=this.getHandlersForToken(e.type),n=this.createParseHelpers();if(t.find(r=>{if(!r.parseMarkdown)return!1;const s=r.parseMarkdown(e,n),i=this.normalizeParseResult(s);return i&&(!Array.isArray(i)||i.length>0)?(this.lastParseResult=i,!0):!1})&&this.lastParseResult){const r=this.lastParseResult;return this.lastParseResult=null,r}return this.parseFallbackToken(e)}createParseHelpers(){return{parseInline:e=>this.parseInlineTokens(e),tokenizeInline:e=>this.tokenizeInline(e),parseChildren:e=>this.parseTokens(e),parseBlockChildren:e=>this.parseTokens(e,!0),createTextNode:(e,t)=>({type:"text",text:e,marks:t||void 0}),createNode:(e,t,n)=>{const r={type:e,attrs:t||void 0,content:n||void 0};return(!t||Object.keys(t).length===0)&&delete r.attrs,r},applyMark:(e,t,n)=>({mark:e,content:t,attrs:n&&Object.keys(n).length>0?n:void 0})}}escapeRegex(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(e){const t=[];for(let o=0;o<e.length;o+=1){const a=e[o];if(a.type==="text")t.push({type:"text",text:lr(a.text||"")});else if(a.type==="escape")t.push({type:"text",text:a.text||""});else if(a.type==="html"){var n,r;const l=((n=(r=a.raw)!==null&&r!==void 0?r:a.text)!==null&&n!==void 0?n:"").toString(),c=/^<\/[\s]*[\w-]+/i.test(l),u=l.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!c&&u&&!/\/>$/.test(l)){const h=u[1],p=this.escapeRegex(h),g=new RegExp(`^<\\/\\s*${p}\\b`,"i");let m=-1;const f=[l];for(let y=o+1;y<e.length;y+=1){var s,i;const b=e[y],T=((s=(i=b.raw)!==null&&i!==void 0?i:b.text)!==null&&s!==void 0?s:"").toString();if(f.push(T),b.type==="html"&&g.test(T)){m=y;break}}if(m!==-1){const y=f.join(""),b={type:"html",raw:y,text:y,block:!1},T=this.parseHTMLToken(b);if(T){const v=this.normalizeParseResult(T);Array.isArray(v)?t.push(...v):v&&t.push(v)}o=m;continue}}const d=this.parseHTMLToken(a);if(d){const h=this.normalizeParseResult(d);Array.isArray(h)?t.push(...h):h&&t.push(h)}}else if(a.type){const l=this.getHandlerForToken(a.type);if(l&&l.parseMarkdown){const c=this.createParseHelpers(),u=l.parseMarkdown(a,c);if(this.isMarkResult(u)){const d=this.applyMarkToContent(u.mark,u.content,u.attrs);t.push(...d)}else{const d=this.normalizeParseResult(u);Array.isArray(d)?t.push(...d):d&&t.push(d)}}else a.tokens&&t.push(...this.parseInlineTokens(a.tokens))}}for(let o=t.length-1;o>0;o-=1){const a=t[o],l=t[o-1];if(a.type==="text"&&l.type==="text"){const c=a.marks||[],u=l.marks||[];Gi(c,u)&&(l.text=(l.text||"")+(a.text||""),t.splice(o,1))}}return t}applyMarkToContent(e,t,n){return t.map(r=>{if(r.type==="text"){const s=r.marks||[],i=n?{type:e,attrs:n}:{type:e};return{...r,marks:[...s,i]}}return{...r,content:r.content?this.applyMarkToContent(e,r.content,n):void 0}})}isMarkResult(e){return e&&typeof e=="object"&&"mark"in e}normalizeParseResult(e){return e?this.isMarkResult(e)?e.content:e:null}parseFallbackToken(e,t=!1){switch(e.type){case"paragraph":return{type:"paragraph",content:e.tokens?this.parseInlineTokens(e.tokens):[]};case"heading":return{type:"heading",attrs:{level:e.depth||1},content:e.tokens?this.parseInlineTokens(e.tokens):[]};case"text":return{type:"text",text:lr(e.text||"")};case"html":return this.parseHTMLToken(e);case"escape":return{type:"text",text:e.text||""};case"space":return null;default:return e.tokens?this.parseTokens(e.tokens,t):null}}parseHTMLToken(e){const t=e.text||e.raw||"";if(!t.trim())return null;if(this.isUnrecognizedHtml(t))return this.htmlAsLiteralText(t,!!e.block);if(typeof window>"u"||typeof window.DOMParser>"u")return this.htmlAsLiteralText(t,!!e.block);try{const n=Qi(t,this.baseExtensions);if(n.type==="doc"&&n.content){if(e.block)return n.content;const r=this.toInlineContent(n.content);return r.length>0?r:null}return n}catch(n){throw new Error(`Failed to parse HTML in markdown: ${n}`)}}toInlineContent(e){const t=this.getInlineNodeTypes();return e.flatMap(n=>n.type&&t.has(n.type)?[n]:n.content?this.toInlineContent(n.content):[])}getInlineNodeTypes(){if(this.inlineNodeTypesCache)return this.inlineNodeTypesCache;const e=new Set(["text"]);try{const t=cr(this.baseExtensions);Object.values(t.nodes).forEach(n=>{n.isInline&&e.add(n.name)})}catch{}return this.inlineNodeTypesCache=e,e}isUnrecognizedHtml(e){return ja(e,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;const e=new Set;try{const t=cr(this.baseExtensions),n=r=>{const s=r==null?void 0:r.parseDOM;Array.isArray(s)&&s.forEach(i=>{if(typeof(i==null?void 0:i.tag)=="string"){const o=i.tag.match(/^[a-zA-Z][\w-]*/);o&&e.add(o[0].toLowerCase())}})};Object.values(t.nodes).forEach(r=>n(r.spec)),Object.values(t.marks).forEach(r=>n(r.spec))}catch{}return this.schemaParseDomTagsCache=e,e}htmlAsLiteralText(e,t){const n=e.replace(/\s+$/,"");return n?t?{type:"paragraph",content:[{type:"text",text:n}]}:{type:"text",text:n}:null}encodeTextForMarkdown(e,t,n){return(n==null?void 0:n.type)!=null&&this.codeTypes.has(n.type)||(t.marks||[]).some(r=>this.codeTypes.has(typeof r=="string"?r:r.type))?e:this.escapeMarkdownSyntax(Xi(e))}escapeMarkdownSyntax(e){return e.replace(/([\\`*_[\]~])/g,"\\$1")}renderNodeToMarkdown(e,t,n=0,r=0,s={}){var i;if(e.type==="text")return this.encodeTextForMarkdown(e.text||"",e,t);if(!e.type)return"";const o=this.getHandlerForToken(e.type);if(!o)return"";const a=Array.isArray(t==null?void 0:t.content)&&n>0?t.content[n-1]:void 0,l={renderChildren:(u,d)=>{const h=o.isIndenting?r+1:r;return!Array.isArray(u)&&u.content?this.renderNodes(u.content,e,d||"",n,h):this.renderNodes(u,e,d||"",n,h)},renderChild:(u,d)=>{const h=o.isIndenting?r+1:r;return this.renderNodeToMarkdown(u,e,d,h)},indent:u=>this.indentString+u,wrapInBlock:Ia},c={index:n,level:r,parentType:t==null?void 0:t.type,previousNode:a,meta:{parentAttrs:t==null?void 0:t.attrs,...s}};return((i=o.renderMarkdown)===null||i===void 0?void 0:i.call(o,e,l,c))||""}renderNodes(e,t,n="",r=0,s=0){return Array.isArray(e)?this.renderNodesWithMarkBoundaries(e,t,n,s):e.type?this.renderNodeToMarkdown(e,t,r,s):""}renderNodesWithMarkBoundaries(e,t,n="",r=0){const s=[],i=new Map,o=new Set,a=new Map,l=Pa(e);return e.forEach((c,u)=>{const d=u<e.length-1?e[u+1]:null;if(c.type)if(c.type==="text"){let h=this.encodeTextForMarkdown(c.text||"",c,t),p=new Map((c.marks||[]).map(x=>[x.type,x])),g=this.getMarksToOpenForSerialization(i,p,d),m=kr(p,d);if(h.length>0&&h.trim().length===0&&p.size>0){const x=new Set(m.filter(R=>!i.has(R)));x.size>0&&(p=new Map(Array.from(p).filter(([R])=>!x.has(R))),g=this.getMarksToOpenForSerialization(i,p,d),m=kr(p,d))}const f=m.filter(x=>i.has(x)),y=f.length>0&&g.length>0;let b="";if(m.length>0&&!y){const x=h.match(/(\s+)$/);x&&(b=x[1],h=h.slice(0,-b.length))}y||m.slice().reverse().forEach(x=>{var R;if(!i.has(x))return;const $=p.get(x),_=this.getMarkClosing(x,$,a.get(x),(R=l[u])===null||R===void 0?void 0:R.get(x));_&&(h+=_),i.has(x)&&(i.delete(x),a.delete(x))});let T="";if(g.length>0){const x=h.match(/^(\s+)/);x&&(T=x[1],h=h.slice(T.length))}g.forEach(({type:x,mark:R})=>{var $;const _=o.has(x)?"html":"markdown",Q=this.getMarkOpening(x,R,_,($=l[u])===null||$===void 0?void 0:$.get(x));Q&&(h=Q+h),a.set(x,_),o.delete(x)}),y||g.slice().reverse().forEach(({type:x,mark:R})=>{i.set(x,R)}),h=T+h;let v;if(y){const x=new Set(((d==null?void 0:d.marks)||[]).map(_=>_.type));g.forEach(({type:_})=>{x.has(_)&&this.getHtmlReopenTags(_)&&o.add(_)});const R=Array.from(i.keys()),$=f.slice().sort((_,Q)=>R.indexOf(Q)-R.indexOf(_));v=[...g.map(_=>_.type),...$]}else v=Oa(i,p,d,this.markSetsEqual.bind(this));let A="";if(v.length>0){const x=h.match(/(\s+)$/);x&&(A=x[1],h=h.slice(0,-A.length))}v.forEach(x=>{var R,$;const _=(R=i.get(x))!==null&&R!==void 0?R:p.get(x),Q=this.getMarkClosing(x,_,a.get(x),($=l[u])===null||$===void 0?void 0:$.get(x));Q&&(h+=Q),i.delete(x),a.delete(x)}),h+=A,h+=b,s.push(h)}else{const h=new Set((c.marks||[]).map(b=>b.type)),p=new Map,g=new Map;i.forEach((b,T)=>{if(h.has(T)){var v;p.set(T,b),g.set(T,(v=a.get(T))!==null&&v!==void 0?v:"markdown")}});const m=_a(i,(b,T)=>{var v;return this.getMarkClosing(b,T,a.get(b),(v=l[u-1])===null||v===void 0?void 0:v.get(b))});a.clear();const f=this.renderNodeToMarkdown(c,t,u,r),y=c.type==="hardBreak"?"":$a(p,i,(b,T)=>{var v,A;const x=(v=g.get(b))!==null&&v!==void 0?v:"markdown";return a.set(b,x),this.getMarkOpening(b,T,x,(A=l[u+1])===null||A===void 0?void 0:A.get(b))});s.push(m+f+y)}}),s.join(n)}getMarkOpening(e,t,n="markdown",r){if(n==="html"){var s;return((s=this.getHtmlReopenTags(e))===null||s===void 0?void 0:s.open)||""}const i=this.getHandlersForNodeType(e),o=i.length>0?i[0]:void 0;if(!o||!o.renderMarkdown)return"";const a="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:e,attrs:t.attrs||{},content:[{type:"text",text:a}]};try{const c=o.renderMarkdown(l,{renderChildren:()=>a,renderChild:()=>a,indent:d=>d,wrapInBlock:(d,h)=>d+h},{index:0,level:0,parentType:"text",meta:{markText:r}}),u=c.indexOf(a);return u>=0?c.substring(0,u):""}catch(c){throw new Error(`Failed to get mark opening for ${e}: ${c}`)}}getMarkClosing(e,t,n="markdown",r){if(n==="html"){var s;return((s=this.getHtmlReopenTags(e))===null||s===void 0?void 0:s.close)||""}const i=this.getHandlersForNodeType(e),o=i.length>0?i[0]:void 0;if(!o||!o.renderMarkdown)return"";const a="__TIPTAP_MARKDOWN_PLACEHOLDER__",l={type:e,attrs:t.attrs||{},content:[{type:"text",text:a}]};try{const c=o.renderMarkdown(l,{renderChildren:()=>a,renderChild:()=>a,indent:h=>h,wrapInBlock:(h,p)=>h+p},{index:0,level:0,parentType:"text",meta:{markText:r}}),u=c.indexOf(a),d=u+33;return u>=0?c.substring(d):""}catch(c){throw new Error(`Failed to get mark closing for ${e}: ${c}`)}}getHtmlReopenTags(e){const t=this.getHandlersForNodeType(e),n=t.length>0?t[0]:void 0;return n==null?void 0:n.htmlReopen}markSetsEqual(e,t){return e.size!==t.size?!1:Array.from(e.entries()).every(([n,r])=>{const s=t.get(n);return s&&Xe(r.attrs,s.attrs)})}getMarksToOpenForSerialization(e,t,n){const r=Na(e,t);if(r.length<=1)return r;const s=(n==null?void 0:n.marks)||[],i=(c,u)=>s.some(d=>d.type===c&&Xe(d.attrs,u)),o=(c,u)=>{var d,h;const p=(d=this.extensionRanks.get(c.type))!==null&&d!==void 0?d:Number.MAX_SAFE_INTEGER,g=(h=this.extensionRanks.get(u.type))!==null&&h!==void 0?h:Number.MAX_SAFE_INTEGER;return p!==g?g-p:c.type.localeCompare(u.type)},a=r.filter(c=>!i(c.type,c.mark.attrs)).sort(o),l=r.filter(c=>i(c.type,c.mark.attrs)).sort(o);return[...a,...l]}};const Ds=j.create({name:"markdown",addOptions(){return{indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(e,t)=>{if(!(t!=null&&t.contentType))return J.setContent(e,t);if(ot(e,t==null?void 0:t.contentType)!=="markdown"||!this.editor.markdown)return J.setContent(e,t);const n=this.editor.markdown.parse(e);return J.setContent(n,t)},insertContent:(e,t)=>{if(!(t!=null&&t.contentType))return J.insertContent(e,t);if(ot(e,t==null?void 0:t.contentType)!=="markdown"||!this.editor.markdown)return J.insertContent(e,t);const n=this.editor.markdown.parse(e);return J.insertContent(n,t)},insertContentAt:(e,t,n)=>{if(!(n!=null&&n.contentType))return J.insertContentAt(e,t,n);if(ot(t,n==null?void 0:n.contentType)!=="markdown"||!this.editor.markdown)return J.insertContentAt(e,t,n);const r=this.editor.markdown.parse(t);return J.insertContentAt(e,r,n)}}},addStorage(){return{manager:new yr({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){var e;if(this.editor.markdown){console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");return}if(this.storage.manager=new yr({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||ot(this.editor.options.content,this.editor.options.contentType)!=="markdown")return;if(!this.editor.markdown)throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(this.editor.options.content===void 0||typeof this.editor.options.content!="string")throw new Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');const t=this.editor.markdown.parse(this.editor.options.content);!((e=t.content)===null||e===void 0)&&e.length&&(this.editor.options.content=t)}}),{getOwnPropertyNames:qa,getOwnPropertySymbols:Ua}=Object,{hasOwnProperty:Fa}=Object.prototype;function _e(e,t){return function(r,s,i){return e(r,s,i)&&t(r,s,i)}}function $e(e){return function(n,r,s){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,s);const{cache:i}=s,o=i.get(n),a=i.get(r);if(o&&a)return o===r&&a===n;i.set(n,r),i.set(r,n);const l=e(n,r,s);return i.delete(n),i.delete(r),l}}function Wa(e){return e!=null?e[Symbol.toStringTag]:void 0}function br(e){return qa(e).concat(Ua(e))}const Ka=Object.hasOwn||((e,t)=>Fa.call(e,t));function ve(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const Va="__v",Ga="__o",Qa="_owner",{getOwnPropertyDescriptor:bn,keys:xr}=Object,Xa=bn(Object.getPrototypeOf(Int8Array.prototype),Symbol.toStringTag).get;function Za(e,t){return e.byteLength===t.byteLength&&bt(new Uint8Array(e),new Uint8Array(t))}function Ya(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 Ja(e,t){return e.byteLength===t.byteLength&&bt(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function el(e,t){return ve(e.getTime(),t.getTime())}function wr(e,t,n){return e.name===t.name&&e.message===t.message&&e.stack===t.stack&&n.equals(e.cause,t.cause,"cause","cause",e,t,n)}function tl(e,t){return e===t}function vr(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const s=new Array(r),i=e.entries();let o,a,l=0;for(;(o=i.next())&&!o.done;){const c=t.entries();let u=!1,d=0;for(;(a=c.next())&&!a.done;){if(s[d]){d++;continue}const h=o.value,p=a.value;if(n.equals(h[0],p[0],l,d,e,t,n)&&n.equals(h[1],p[1],h[0],p[0],e,t,n)){u=s[d]=!0;break}d++}if(!u)return!1;l++}return!0}const nl=ve;function Tr(e,t,n){const r=xr(e);let s=r.length;if(xr(t).length!==s)return!1;for(;s-- >0;)if(!zs(e,t,n,r[s]))return!1;return!0}function Ae(e,t,n){const r=br(e);let s=r.length;if(br(t).length!==s)return!1;let i,o,a;for(;s-- >0;)if(i=r[s],!zs(e,t,n,i)||(o=bn(e,i),a=bn(t,i),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function rl(e,t){return ve(e.valueOf(),t.valueOf())}function sl(e,t){return e.source===t.source&&e.flags===t.flags}function Er(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const s=new Array(r),i=e.values();let o,a;for(;(o=i.next())&&!o.done;){const l=t.values();let c=!1,u=0;for(;(a=l.next())&&!a.done;){if(!s[u]&&n.equals(o.value,a.value,o.value,a.value,e,t,n)){c=s[u]=!0;break}u++}if(!c)return!1}return!0}function bt(e,t){let n=e.length;if(t.length!==n||e.byteOffset!==t.byteOffset)return!1;const r=Xa.call(e);if(r==="Float64Array"||r==="Float32Array"||r==="Float16Array"){for(;n-- >0;)if(e[n]!==t[n]&&(e[n]===e[n]||t[n]===t[n]))return!1;return!0}for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function il(e,t){return e.href===t.href?!0:e.protocol===t.protocol&&e.username===t.username&&e.password===t.password&&e.host===t.host&&e.pathname===t.pathname&&e.hash===t.hash&&ol(e.searchParams,t.searchParams)}function ol(e,t){const n=e.toString(),r=t.toString();return n===r||Ar(n)===Ar(r)}function Ar(e){return e.split("&").sort().join("&")}function zs(e,t,n,r){return(r===Qa||r===Ga||r===Va)&&(e.$$typeof||t.$$typeof)?!0:Ka(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const al="[object ArrayBuffer]",ll="[object Arguments]",cl="[object Boolean]",ul="[object DataView]",dl="[object Date]",hl="[object Error]",pl="[object Map]",fl="[object Number]",ml="[object Object]",gl="[object RegExp]",kl="[object Set]",yl="[object String]",bl={"[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},xl="[object URL]",wl=Object.prototype.toString;function vl({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:a,areObjectsEqual:l,arePrimitiveWrappersEqual:c,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:h,areUrlsEqual:p,unknownTagComparators:g}){return function(f,y,b){if(f===y)return!0;if(f==null||y==null)return!1;const T=typeof f;if(T!==typeof y)return!1;if(T!=="object")return T==="number"?a(f,y,b):T==="function"?i(f,y,b):!1;const v=f.constructor;if(v!==y.constructor)return!1;if(v===Object)return l(f,y,b);if(Array.isArray(f))return t(f,y,b);if(v===Date)return r(f,y,b);if(v===RegExp)return u(f,y,b);if(v===Map)return o(f,y,b);if(v===Set)return d(f,y,b);if(v==null)return l(f,y,b);const A=wl.call(f);if(A===dl)return r(f,y,b);if(A===gl)return u(f,y,b);if(A===pl)return o(f,y,b);if(A===kl)return d(f,y,b);if(A===ml)return typeof f.then!="function"&&typeof y.then!="function"&&l(f,y,b);if(A===xl)return p(f,y,b);if(A===hl)return s(f,y,b);if(A===ll)return l(f,y,b);if(bl[A])return h(f,y,b);if(A===al)return e(f,y,b);if(A===ul)return n(f,y,b);if(A===cl||A===fl||A===yl)return c(f,y,b);if(g){let x=g[A];if(!x){const R=Wa(f);R&&(x=g[R])}if(x)return x(f,y,b)}return!1}}function Tl({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:Za,areArraysEqual:n?Ae:Ya,areDataViewsEqual:Ja,areDatesEqual:el,areErrorsEqual:n?_e(wr,Ae):_e(wr,Tr),areFunctionsEqual:tl,areMapsEqual:n?_e(vr,Ae):vr,areNumbersEqual:nl,areObjectsEqual:n?Ae:Tr,arePrimitiveWrappersEqual:rl,areRegExpsEqual:sl,areSetsEqual:n?_e(Er,Ae):Er,areTypedArraysEqual:n?_e(bt,Ae):bt,areUrlsEqual:il,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const s=$e(r.areArraysEqual),i=$e(r.areErrorsEqual),o=$e(r.areMapsEqual),a=$e(r.areObjectsEqual),l=$e(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areErrorsEqual:i,areMapsEqual:o,areObjectsEqual:a,areSetsEqual:l})}return r}function El(e){return function(t,n,r,s,i,o,a){return e(t,n,a)}}function Al({circular:e,comparator:t,createState:n,equals:r,strict:s}){if(n)return function(a,l){const{cache:c=e?new WeakMap:void 0,meta:u}=n();return t(a,l,{cache:c,equals:r,meta:u,strict:s})};if(e)return function(a,l){return t(a,l,{cache:new WeakMap,equals:r,meta:void 0,strict:s})};const i={cache:void 0,equals:r,meta:void 0,strict:s};return function(a,l){return t(a,l,i)}}const Sl=de();de({strict:!0});de({circular:!0});de({circular:!0,strict:!0});de({createInternalComparator:()=>ve});de({strict:!0,createInternalComparator:()=>ve});de({circular:!0,createInternalComparator:()=>ve});de({circular:!0,createInternalComparator:()=>ve,strict:!0});function de(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:s=!1}=e,i=Tl(e),o=vl(i),a=n?n(o):El(o);return Al({circular:t,comparator:o,createState:r,equals:a,strict:s})}function Cl(e,t){var n,r;if(e.isDestroyed||t.defaultPrevented||!t.cancelable||!e.isEditable||t.inputType!=="insertParagraph"&&t.inputType!=="insertLineBreak"||!ro()&&!so())return;const s=e.view,i=s.root,o=(n=(r=i.getSelection)===null||r===void 0?void 0:r.call(i))!==null&&n!==void 0?n:s.dom.ownerDocument.getSelection(),a=o==null?void 0:o.anchorNode,l=(a==null?void 0:a.nodeType)===1?a:a==null?void 0:a.parentElement,c=l==null?void 0:l.closest("[data-node-view-content-react]");if(!c||!s.dom.contains(c))return;const u=s.input.lastKeyCode;u===13&&(s.input.lastKeyCode=null),s.domObserver.forceFlush(),s.domObserver.flush();const d=new KeyboardEvent("keydown",{key:"Enter",code:"Enter",keyCode:13,shiftKey:t.inputType==="insertLineBreak",bubbles:!0,cancelable:!0});s.someProp("handleKeyDown",h=>h(s,d))?(t.preventDefault(),s.input.lastIOSEnter=0,clearTimeout(s.input.lastIOSEnterFallbackTimeout)):u===13&&(s.input.lastKeyCode=u)}const Sr=new G("reactMobileEnter"),Ll=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},Ml=({contentComponent:e})=>{const t=rs.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return w.jsx(w.Fragment,{children:Object.values(t)})};function Rl(){const e=new Set;let t={},n=!1;const r=()=>{n||!e.size||(n=!0,queueMicrotask(()=>{n=!1,e.forEach(s=>s())}))};return{subscribe(s){return e.add(s),()=>{e.delete(s)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(s,i){t={...t,[s]:no.createPortal(i.reactElement,i.element,s)},r()},removeRenderer(s){const i={...t};delete i[s],t=i,r()}}}var Il=class extends ye.Component{constructor(e){super(e),this.editorContentRef=ye.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var e;const t=this.props.editor;if(t&&!t.isDestroyed&&(!((e=t.view.dom)===null||e===void 0)&&e.parentNode)){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n}),t.contentComponent=Rl(),t.createNodeViews(),t.registerPlugin(new B({key:Sr,props:{handleDOMEvents:{beforeinput:(r,s)=>Cl(t,s)}}})),t.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){const e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||(e.unregisterPlugin(Sr),e.view.setProps({nodeViews:{}})),e.contentComponent=null;try{var t;if(!(!((t=e.view.dom)===null||t===void 0)&&t.parentNode))return;const n=document.createElement("div");n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n})}catch{}}}render(){const{editor:e,innerRef:t,...n}=this.props;return w.jsxs(w.Fragment,{children:[w.jsx("div",{ref:Ll(t,this.editorContentRef),...n}),(e==null?void 0:e.contentComponent)&&w.jsx(Ml,{contentComponent:e.contentComponent})]})}};const Nl=C.forwardRef((e,t)=>{const n=ye.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return ye.createElement(Il,{key:n,innerRef:t,...e})}),Hs=ye.memo(Nl),Ol=typeof window<"u"?C.useLayoutEffect:C.useEffect;var _l=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.lastSnapshot:(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 t;const n=s=>{(s==null?void 0:s.transaction)!==void 0&&s.transaction===t||(t=s==null?void 0:s.transaction,this.transactionNumber+=1,this.subscribers.forEach(i=>i()))},r=this.editor;return r.on("transaction",n),r.on("update",n),()=>{r.off("transaction",n),r.off("update",n)}}}};function Bs(e){var t;const[n]=C.useState(()=>new _l(e.editor)),r=Yi.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,(t=e.equalityFn)!==null&&t!==void 0?t:Sl);return Ol(()=>n.watch(e.editor),[e.editor,n]),C.useDebugValue(r),r}const $l=!1,js=typeof window>"u",Pl=js||!!(typeof window<"u"&&window.next);var Dl=class qs{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,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(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){const t=this.options.current.immediatelyRender;let n=t??!0;return js?(n&&$l&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"),n=!1):Pl&&t===void 0&&(n=!1),n?this.createEditor():null}createEditor(){const t={...this.options.current,onBeforeCreate:(...n)=>{var r,s;return(r=(s=this.options.current).onBeforeCreate)===null||r===void 0?void 0:r.call(s,...n)},onBlur:(...n)=>{var r,s;return(r=(s=this.options.current).onBlur)===null||r===void 0?void 0:r.call(s,...n)},onCreate:(...n)=>{var r,s;return(r=(s=this.options.current).onCreate)===null||r===void 0?void 0:r.call(s,...n)},onDestroy:(...n)=>{var r,s;return(r=(s=this.options.current).onDestroy)===null||r===void 0?void 0:r.call(s,...n)},onFocus:(...n)=>{var r,s;return(r=(s=this.options.current).onFocus)===null||r===void 0?void 0:r.call(s,...n)},onSelectionUpdate:(...n)=>{var r,s;return(r=(s=this.options.current).onSelectionUpdate)===null||r===void 0?void 0:r.call(s,...n)},onTransaction:(...n)=>{var r,s;return(r=(s=this.options.current).onTransaction)===null||r===void 0?void 0:r.call(s,...n)},onUpdate:(...n)=>{var r,s;return(r=(s=this.options.current).onUpdate)===null||r===void 0?void 0:r.call(s,...n)},onContentError:(...n)=>{var r,s;return(r=(s=this.options.current).onContentError)===null||r===void 0?void 0:r.call(s,...n)},onDrop:(...n)=>{var r,s;return(r=(s=this.options.current).onDrop)===null||r===void 0?void 0:r.call(s,...n)},onPaste:(...n)=>{var r,s;return(r=(s=this.options.current).onPaste)===null||r===void 0?void 0:r.call(s,...n)},onDelete:(...n)=>{var r,s;return(r=(s=this.options.current).onDelete)===null||r===void 0?void 0:r.call(s,...n)},onMount:(...n)=>{var r,s;return(r=(s=this.options.current).onMount)===null||r===void 0?void 0:r.call(s,...n)},onUnmount:(...n)=>{var r,s;return(r=(s=this.options.current).onUnmount)===null||r===void 0?void 0:r.call(s,...n)}};return new Zi(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}static compareOptions(t,n){return Object.keys(t).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&t.extensions&&n.extensions?t.extensions.length!==n.extensions.length?!1:t.extensions.every((s,i)=>{var o;return s===((o=n.extensions)===null||o===void 0?void 0:o[i])}):t[r]===n[r])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?qs.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(t){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=t;return}if(this.previousDeps.length===t.length&&this.previousDeps.every((n,r)=>n===t[r]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=t}scheduleDestroy(){const t=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===t){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===t&&this.setEditor(null))},1)}};function zl(e={},t=[]){const n=C.useRef(e);n.current=e;const[r]=C.useState(()=>new Dl(n)),s=rs.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return C.useDebugValue(s),C.useEffect(r.onRender(t)),Bs({editor:s,selector:({transactionNumber:i})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&i===0?0:i+1}),s}const Us=C.createContext({editor:null});Us.Consumer;const Fs=C.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),Ws=()=>C.useContext(Fs);function qn({as:e="div",...t}){const{nodeViewContentRef:n,nodeViewContentChildren:r}=Ws();return w.jsx(e,{...t,ref:n,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...t.style},children:r})}const Un=ye.forwardRef((e,t)=>{const{onDragStart:n}=Ws(),r=e.as||"div";return w.jsx(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});function Cr(e){return!!(typeof e=="function"&&e.prototype&&e.prototype.isReactComponent)}function Lr(e){return!!(typeof e=="object"&&e.$$typeof&&(e.$$typeof.toString()==="Symbol(react.forward_ref)"||e.$$typeof.description==="react.forward_ref"))}function Hl(e){return!!(typeof e=="object"&&e.$$typeof&&(e.$$typeof.toString()==="Symbol(react.memo)"||e.$$typeof.description==="react.memo"))}function Bl(e){if(Cr(e)||Lr(e))return!0;if(Hl(e)){const t=e.type;if(t)return Cr(t)||Lr(t)}return!1}function jl(){try{if(C.version)return parseInt(C.version.split(".")[0],10)>=19}catch{}return!1}var ql=class{constructor(e,{editor:t,props:n={},as:r="div",className:s=""}){this.ref=null,this.destroyed=!1,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(r),this.element.classList.add("react-renderer"),s&&this.element.classList.add(...s.split(" ")),this.editor.isEditorContentInitialized?eo.flushSync(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var e;if(this.destroyed)return;const t=this.component,n=this.props,r=this.editor,s=jl(),i=Bl(t),o={...n};o.ref&&!(s||i)&&delete o.ref,!o.ref&&(s||i)&&(o.ref=a=>{this.ref=a}),this.reactElement=w.jsx(t,{...o}),r==null||(e=r.contentComponent)===null||e===void 0||e.setRenderer(this.id,this)}updateProps(e={}){if(this.destroyed)return;let t=!1;const n=Object.keys(e);for(let r=0;r<n.length;r+=1){const s=n[r];if(e[s]!==this.props[s]){t=!0;break}}t&&(this.props={...this.props,...e},this.render())}destroy(){var e;this.destroyed=!0;const t=this.editor;t==null||(e=t.contentComponent)===null||e===void 0||e.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(e){Object.keys(e).forEach(t=>{this.element.setAttribute(t,e[t])})}};ye.createContext({markViewContentRef:()=>{}});function Ul(e){var t;const n=e.getRootNode(),r=typeof n.getSelection=="function"?n.getSelection():(t=e.ownerDocument)===null||t===void 0||(t=t.defaultView)===null||t===void 0?void 0:t.getSelection();if(!r||r.rangeCount===0)return null;const{anchorNode:s,anchorOffset:i,focusNode:o,focusOffset:a}=r;return!s||!o||!e.contains(s)||!e.contains(o)?null:()=>{try{r.setBaseAndExtent(s,i,o,a)}catch{}}}function Fl(e,t,n){return e.node(n)===t.node(n)&&e.before(n)===t.before(n)}function Ks(e){if(!to(e))return[];const{$from:t,$to:n}=e,r=[],s=Math.min(t.depth,n.depth);for(let i=1;i<=s&&Fl(t,n,i);i+=1)r.push(t.before(i));return r}var Wl=class{constructor(e){this.views=new WeakMap,this.viewCount=0,this.insideViews=new Set,this.syncQueued=!1,this.scheduleSync=()=>{this.syncQueued||(this.syncQueued=!0,queueMicrotask(()=>{this.syncQueued=!1,this.sync()}))},this.handleTransaction=()=>this.scheduleSync(),this.editor=e}register(e){this.viewCount===0&&this.editor.on("transaction",this.handleTransaction),this.views.set(e.dom,e),this.viewCount+=1,this.scheduleSync()}unregister(e){this.views.delete(e.dom),this.viewCount-=1,this.insideViews.delete(e),this.viewCount===0&&this.editor.off("transaction",this.handleTransaction)}sync(){if(this.viewCount===0||this.editor.isDestroyed)return;const e=this.findInsideViews();this.updateViews(this.insideViews,e,!1),this.updateViews(e,this.insideViews,!0),this.insideViews=e}updateViews(e,t,n){for(const r of e)t.has(r)||r.setSelectionInside(n)}findInsideViews(){const e=new Set;for(const t of Ks(this.editor.state.selection)){const n=this.editor.view.nodeDOM(t),r=n?this.views.get(n):void 0;r&&e.add(r)}return e}};const Mr=new WeakMap;function Rr(e){let t=Mr.get(e);return t||(t=new Wl(e),Mr.set(e,t)),t}var Kl=class extends Ji{constructor(e,t,n){if(super(e,t,n),this.nodeSelected=!1,this.handlePositionUpdate=()=>{const r=this.getPos();typeof r!="number"||r===this.currentPos||(this.currentPos=r,this.renderer.updateProps({getPos:()=>this.getPos()}),typeof this.options.attrs=="function"&&this.updateElementAttributes())},this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.dataset.nodeViewWrapper="",this.contentDOMElement.style.whiteSpace="inherit";const r=this.dom.querySelector("[data-node-view-content]");r?r.appendChild(this.contentDOMElement):this.dom.appendChild(this.contentDOMElement)}this.options.trackNodeViewPosition&&this.editor.on("update",this.handlePositionUpdate)}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){const e=this.editor,t=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(t,{get(n,r,s){if(r==="storage"){var i;return(i=e.storage[t.name])!==null&&i!==void 0?i:{}}return Reflect.get(n,r,s)}})}return this.cachedExtensionWithSyncedStorage}mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,selectionInside:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(l={})=>this.updateAttributes(l),deleteNode:()=>this.deleteNode(),ref:C.createRef()};if(!this.component.displayName){const l=c=>c.charAt(0).toUpperCase()+c.substring(1);this.component.displayName=l(this.extension.name)}const r={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:l=>{if(l&&this.contentDOMElement&&l.firstChild!==this.contentDOMElement){l.hasAttribute("data-node-view-wrapper")&&l.removeAttribute("data-node-view-wrapper");const c=Ul(this.contentDOMElement);l.appendChild(this.contentDOMElement),c==null||c()}}},s=this.component,i=C.memo(l=>w.jsx(Fs.Provider,{value:r,children:C.createElement(s,l)}));i.displayName="ReactNodeView";let o=this.node.isInline?"span":"div";this.options.as&&(o=this.options.as);const{className:a=""}=this.options;this.renderer=new ql(i,{editor:this.editor,props:e,as:o,className:`node-${this.node.type.name} ${a}`.trim()}),Rr(this.editor).register(this),this.updateElementAttributes(),this.currentPos=this.getPos()}get dom(){var e;if(this.renderer.element.firstElementChild&&!(!((e=this.renderer.element.firstElementChild)===null||e===void 0)&&e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}update(e,t,n){const r=o=>{this.renderer.updateProps(o),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const o=this.node,a=this.decorations,l=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=this.getPos(),this.options.update({oldNode:o,oldDecorations:a,newNode:e,newDecorations:t,oldInnerDecorations:l,innerDecorations:n,updateProps:()=>r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage})})}if(e===this.node)return this.node=e,this.decorations=t,this.innerDecorations=n,!0;const s=this.getPos();this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=s;const i={node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage};return this.options.trackNodeViewPosition&&(i.getPos=()=>this.getPos()),r(i),!0}selectNode(){this.nodeSelected=!0,this.updateSelectedState(!0)}deselectNode(){this.nodeSelected=!1,this.updateSelectedState(this.options.selectedOnTextSelection===!0&&this.isTextSelectionInside())}setSelectionInside(e){const t=this.nodeSelected||this.options.selectedOnTextSelection===!0&&e;this.renderer.updateProps({selectionInside:e,selected:t}),this.renderer.element.classList.toggle("ProseMirror-selectednode",t)}updateSelectedState(e){this.renderer.updateProps({selected:e}),this.renderer.element.classList.toggle("ProseMirror-selectednode",e)}isTextSelectionInside(){const e=this.getPos();return typeof e=="number"&&Ks(this.editor.state.selection).includes(e)}destroy(){this.renderer.destroy(),Rr(this.editor).unregister(this),this.options.trackNodeViewPosition&&this.editor.off("update",this.handlePositionUpdate),this.contentDOMElement=null}updateElementAttributes(){if(this.options.attrs){let e={};if(typeof this.options.attrs=="function"){const t=this.editor.extensionManager.attributes,n=ss(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:n})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}};function Fn(e,t){return n=>n.editor.contentComponent?new Kl(e,n,t):{dom:document.createElement("span"),contentDOM:null,update:()=>!1,destroy:()=>{},selectNode:()=>{},deselectNode:()=>{},stopEvent:()=>!1,ignoreMutation:()=>!0}}const Wn=C.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});Wn.displayName="TiptapContext";const Vl=()=>C.useContext(Wn);function Vs({children:e,...t}){const n="editor"in t?t.editor:t.instance;if(!n)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const r=C.useMemo(()=>({editor:n}),[n]),s=C.useMemo(()=>({editor:n}),[n]);return w.jsx(Us.Provider,{value:s,children:w.jsx(Wn.Provider,{value:r,children:e})})}Vs.displayName="Tiptap";function Gs({...e}){const{editor:t}=Vl();return w.jsx(Hs,{editor:t,...e})}Gs.displayName="Tiptap.Content";Object.assign(Vs,{Content:Gs});const Qs=new WeakSet,Xs=new WeakSet;function he(e){const t=e;return Qs.add(t),t}function xn(e){return Array.isArray(e)&&Qs.has(e)}function Zs(e){return e.flatMap(t=>t==null?[]:Array.isArray(t)&&Xs.has(t)&&!xn(t)?Zs(t):[t])}function Gl(e,t){if(e==="slot")return 0;if(e instanceof Function){const s=e(t);return Array.isArray(s)&&!xn(s)&&!Xs.has(s)?he(s):s}const{children:n,...r}=t??{};if(e==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");if(Array.isArray(n)){if(xn(n))return he([e,r,n]);if(n.length===0)return he([e,r]);const s=Zs(n);return s.length===0?he([e,r]):he([e,r,...s])}return n!=null?he([e,r,n]):he([e,r])}const xt=(e,t)=>Gl(e,t),Ql=(e,t)=>{var n;const{state:r}=e,{selection:s}=r;if(!s.empty)return!1;const{$from:i}=s;if(i.parentOffset!==0)return!1;const o=i.depth-1;if(o<0)return!1;const a=i.node(o),l=i.index(o);if(l===0)return!1;if(a.type===t)return e.commands.lift(t.name);const c=a.child(l-1);if(c.type!==t||!(!((n=c.lastChild)===null||n===void 0)&&n.isTextblock))return!1;const u=i.before()-1-1;return e.commands.command(({tr:d,dispatch:h})=>{if(!h)return!0;const p=i.parent.content,g=new In(p,0,0);return d.replace(u,i.after(),g),d.setSelection(se.create(d.doc,u+p.size)),d.scrollIntoView(),h(d),!0})},Xl=/^\s*>\s$/,Zl=D.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:e}){return xt("blockquote",{...P(this.options.HTMLAttributes,e),children:xt("slot",{})})},parseMarkdown:(e,t)=>{var n;const r=(n=t.parseBlockChildren)!==null&&n!==void 0?n:t.parseChildren;return t.createNode("blockquote",void 0,r(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return"";const n=">",r=[];return e.content.forEach((s,i)=>{var o,a;const l=((o=(a=t.renderChild)===null||a===void 0?void 0:a.call(t,s,i))!==null&&o!==void 0?o:t.renderChildren([s])).split(`
|
|
117
127
|
`).map(c=>c.trim()===""?n:`${n} ${c}`);r.push(l.join(`
|
|
118
128
|
`))}),r.join(`
|
|
119
129
|
${n}
|
|
120
|
-
`)},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(),Backspace:()=>
|
|
130
|
+
`)},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(),Backspace:()=>Ql(this.editor,this.type)}},addInputRules(){return[Le({find:Xl,type:this.type})]}}),Yl=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Jl=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,ec=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,tc=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,nc=Re.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&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 xt("strong",{...P(this.options.HTMLAttributes,e),children:xt("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},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[be({find:Yl,type:this.type}),be({find:ec,type:this.type})]},addPasteRules(){return[ce({find:Jl,type:this.type}),ce({find:tc,type:this.type})]}}),rc=e=>{const t=/`([^`]+)`(?!`)$/.exec(e);return!t||t.index>0&&e[t.index-1]==="`"?null:{index:t.index,text:t[0],replaceWith:t[1]}},sc=e=>{const t=/`([^`]+)`(?!`)/g,n=[];let r;for(;(r=t.exec(e))!==null;)r.index>0&&e[r.index-1]==="`"||n.push({index:r.index,text:r[0],replaceWith:r[1]});return n};function ic(e){const t=new Set((e.match(/`+/g)||[]).map(r=>r.length));let n=1;for(;t.has(n);)n+=1;return n}const oc=Re.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",P(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t,n)=>{var r;if(!e.content)return"";const s=typeof(n==null||(r=n.meta)===null||r===void 0?void 0:r.markText)=="string"?n.meta.markText:"",i="`".repeat(ic(s)),o=s.startsWith("`")||s.endsWith("`")?" ":"";return`${i}${o}${t.renderChildren(e.content)}${o}${i}`},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[be({find:rc,type:this.type})]},addPasteRules(){return[ce({find:sc,type:this.type})]}}),an=4,ac=/^```([a-z]+)?[\s\n]$/,lc=/^~~~([a-z]+)?[\s\n]$/,cc=D.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:an,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options;if(!n)return null;const r=[...((t=e.firstElementChild)===null||t===void 0?void 0:t.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return r||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",P(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(e,t)=>{var n,r;return((n=e.raw)===null||n===void 0?void 0:n.startsWith("```"))===!1&&((r=e.raw)===null||r===void 0?void 0:r.startsWith("~~~"))===!1&&e.codeBlockStyle!=="indented"?[]:t.createNode("codeBlock",{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[])},renderMarkdown:(e,t)=>{var n;let r="";const s=((n=e.attrs)===null||n===void 0?void 0:n.language)||"";return e.content?r=[`\`\`\`${s}`,t.renderChildren(e.content),"```"].join(`
|
|
121
131
|
`):r=`\`\`\`${s}
|
|
122
132
|
|
|
123
|
-
\`\`\``,r},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:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=(t=this.options.tabSize)!==null&&t!==void 0?t:
|
|
133
|
+
\`\`\``,r},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:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=(t=this.options.tabSize)!==null&&t!==void 0?t:an,{state:r}=e,{selection:s}=r,{$from:i,empty:o}=s;if(i.parent.type!==this.type)return!1;const a=" ".repeat(n);return o?e.commands.insertContent(a):e.commands.command(({tr:l})=>{const{from:c,to:u}=s,d=r.doc.textBetween(c,u,`
|
|
124
134
|
`,`
|
|
125
135
|
`).split(`
|
|
126
136
|
`).map(h=>a+h).join(`
|
|
127
|
-
`);return l.replaceWith(c,u,r.schema.text(d)),!0})},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=(t=this.options.tabSize)!==null&&t!==void 0?t:
|
|
137
|
+
`);return l.replaceWith(c,u,r.schema.text(d)),!0})},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=(t=this.options.tabSize)!==null&&t!==void 0?t:an,{state:r}=e,{selection:s}=r,{$from:i,empty:o}=s;return i.parent.type!==this.type?!1:o?e.commands.command(({tr:a})=>{var l;const{pos:c}=i,u=i.start(),d=i.end(),h=r.doc.textBetween(u,d,`
|
|
128
138
|
`,`
|
|
129
139
|
`).split(`
|
|
130
|
-
`);let p=0,
|
|
140
|
+
`);let p=0,g=0;const m=c-u;for(let T=0;T<h.length;T+=1){if(g+h[T].length>=m){p=T;break}g+=h[T].length+1}const f=((l=h[p].match(/^ */))===null||l===void 0?void 0:l[0])||"",y=Math.min(f.length,n);if(y===0)return!0;let b=u;for(let T=0;T<p;T+=1)b+=h[T].length+1;return a.delete(b,b+y),c-b<=y&&a.setSelection(se.create(a.doc,b)),!0}):e.commands.command(({tr:a})=>{const{from:l,to:c}=s,u=r.doc.textBetween(l,c,`
|
|
131
141
|
`,`
|
|
132
142
|
`).split(`
|
|
133
|
-
`).map(d=>{var h;const p=((h=d.match(/^ */))===null||h===void 0?void 0:h[0])||"",
|
|
143
|
+
`).map(d=>{var h;const p=((h=d.match(/^ */))===null||h===void 0?void 0:h[0])||"",g=Math.min(p.length,n);return d.slice(g)}).join(`
|
|
134
144
|
`);return a.replaceWith(l,c,r.schema.text(u)),!0})},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:s}=n;if(!s||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
|
|
135
145
|
|
|
136
|
-
`);return!i||!o?!1:e.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:e})=>{if(!this.options.exitOnArrowUp)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:s}=n;if(!s||r.parent.type!==this.type||r.parentOffset!==0)return!1;const i=r.before();return i>0?!1:e.commands.insertDefaultBlock({pos:i})},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:s,empty:i}=n;if(!i||s.parent.type!==this.type||s.parentOffset!==s.parent.nodeSize-2)return!1;const o=s.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:a})=>(a.setSelection(
|
|
137
|
-
`));return o.replaceSelectionWith(this.type.create({language:i},l)),o.selection.$from.parent.type!==this.type&&o.setSelection(
|
|
146
|
+
`);return!i||!o?!1:e.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:e})=>{if(!this.options.exitOnArrowUp)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:s}=n;if(!s||r.parent.type!==this.type||r.parentOffset!==0)return!1;const i=r.before();return i>0?!1:e.commands.insertDefaultBlock({pos:i})},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:s,empty:i}=n;if(!i||s.parent.type!==this.type||s.parentOffset!==s.parent.nodeSize-2)return!1;const o=s.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:a})=>(a.setSelection(Ze.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[mn({find:ac,type:this.type,getAttributes:e=>({language:e[1]})}),mn({find:lc,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new B({key:new G("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),s=r?JSON.parse(r):void 0,i=s==null?void 0:s.mode;if(!n||!i)return!1;const{tr:o,schema:a}=e.state,l=a.text(n.replace(/\r\n?/g,`
|
|
147
|
+
`));return o.replaceSelectionWith(this.type.create({language:i},l)),o.selection.$from.parent.type!==this.type&&o.setSelection(se.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),e.dispatch(o),!0}}})]}}),uc=D.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
138
148
|
|
|
139
|
-
`):""}),
|
|
149
|
+
`):""}),dc=D.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",P(this.options.HTMLAttributes,e)]},renderText(){return`
|
|
140
150
|
`},renderMarkdown:()=>`
|
|
141
|
-
`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:s,storedMarks:i}=n;if(s.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:a}=r.extensionManager,l=i||s.$to.parentOffset&&s.$from.marks();return t().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&o){const d=l.filter(h=>a.includes(h.type.name));c.ensureMarks(d)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),tl=j.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,N(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{var n;const r=!((n=e.attrs)===null||n===void 0)&&n.level?parseInt(e.attrs.level,10):1,s="#".repeat(r);return e.content?`${s} ${t.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},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=>an({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),nl=j.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",N(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!ri(t,t.schema.nodes[this.name]))return!1;const{selection:n}=t,{$to:r}=n,s=e();return $r(n)?s.insertContentAt(r.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({state:i,tr:o,dispatch:a})=>{if(a){const{$to:l}=o.selection,c=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?o.setSelection(re.create(o.doc,l.pos+1)):l.nodeAfter.isBlock?o.setSelection(Tn.create(o.doc,l.pos)):o.setSelection(re.create(o.doc,l.pos));else{const u=i.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,d=u==null?void 0:u.create();d&&(o.insert(c,d),o.setSelection(re.create(o.doc,c+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[ni({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),rl=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,sl=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,il=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,ol=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,al=Le.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",N(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||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[me({find:rl,type:this.type}),me({find:il,type:this.type})]},addPasteRules(){return[oe({find:sl,type:this.type}),oe({find:ol,type:this.type})]}}),ll="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",cl="ελ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",pn="numeric",fn="ascii",gn="alpha",Pe="asciinumeric",Oe="alphanumeric",mn="domain",gs="emoji",ul="scheme",dl="slashscheme",Yt="whitespace";function hl(e,t){return e in t||(t[e]=[]),t[e]}function he(e,t,n){t[pn]&&(t[Pe]=!0,t[Oe]=!0),t[fn]&&(t[Pe]=!0,t[gn]=!0),t[Pe]&&(t[Oe]=!0),t[gn]&&(t[Oe]=!0),t[Oe]&&(t[mn]=!0),t[gs]&&(t[mn]=!0);for(const r in t){const s=hl(r,n);s.indexOf(e)<0&&s.push(e)}}function pl(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function z(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}z.groups={};z.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let r=0;r<t.jr.length;r++){const s=t.jr[r][0],i=t.jr[r][1];if(i&&s.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let s=0;s<e.length;s++)this.tt(e[s],t,n,r)},tr(e,t,n,r){r=r||z.groups;let s;return t&&t.j?s=t:(s=new z(t),n&&r&&he(t,n,r)),this.jr.push([e,s]),s},ts(e,t,n,r){let s=this;const i=e.length;if(!i)return s;for(let o=0;o<i-1;o++)s=s.tt(e[o]);return s.tt(e[i-1],t,n,r)},tt(e,t,n,r){r=r||z.groups;const s=this;if(t&&t.j)return s.j[e]=t,t;const i=t;let o,a=s.go(e);if(a?(o=new z,Object.assign(o.j,a.j),o.jr.push.apply(o.jr,a.jr),o.jd=a.jd,o.t=a.t):o=new z,i){if(r)if(o.t&&typeof o.t=="string"){const l=Object.assign(pl(o.t,r),n);he(i,l,r)}else n&&he(i,n,r);o.t=i}return s.j[e]=o,o}};const T=(e,t,n,r,s)=>e.ta(t,n,r,s),I=(e,t,n,r,s)=>e.tr(t,n,r,s),pr=(e,t,n,r,s)=>e.ts(t,n,r,s),k=(e,t,n,r,s)=>e.tt(t,n,r,s),ne="WORD",kn="UWORD",ms="ASCIINUMERICAL",ks="ALPHANUMERICAL",Ke="LOCALHOST",yn="TLD",bn="UTLD",it="SCHEME",Te="SLASH_SCHEME",On="NUM",xn="WS",Pn="NL",Ne="OPENBRACE",De="CLOSEBRACE",ht="OPENBRACKET",pt="CLOSEBRACKET",ft="OPENPAREN",gt="CLOSEPAREN",mt="OPENANGLEBRACKET",kt="CLOSEANGLEBRACKET",yt="FULLWIDTHLEFTPAREN",bt="FULLWIDTHRIGHTPAREN",xt="LEFTCORNERBRACKET",wt="RIGHTCORNERBRACKET",vt="LEFTWHITECORNERBRACKET",Tt="RIGHTWHITECORNERBRACKET",Et="FULLWIDTHLESSTHAN",At="FULLWIDTHGREATERTHAN",Lt="AMPERSAND",Ct="APOSTROPHE",St="ASTERISK",ie="AT",Mt="BACKSLASH",Rt="BACKTICK",It="CARET",pe="COLON",Nn="COMMA",$t="DOLLAR",V="DOT",_t="EQUALS",Dn="EXCLAMATION",U="HYPHEN",ze="PERCENT",Ot="PIPE",Pt="PLUS",Nt="POUND",He="QUERY",zn="QUOTE",ys="FULLWIDTHMIDDLEDOT",Hn="SEMI",Q="SLASH",Be="TILDE",Dt="UNDERSCORE",bs="EMOJI",zt="SYM";var xs=Object.freeze({__proto__:null,ALPHANUMERICAL:ks,AMPERSAND:Lt,APOSTROPHE:Ct,ASCIINUMERICAL:ms,ASTERISK:St,AT:ie,BACKSLASH:Mt,BACKTICK:Rt,CARET:It,CLOSEANGLEBRACKET:kt,CLOSEBRACE:De,CLOSEBRACKET:pt,CLOSEPAREN:gt,COLON:pe,COMMA:Nn,DOLLAR:$t,DOT:V,EMOJI:bs,EQUALS:_t,EXCLAMATION:Dn,FULLWIDTHGREATERTHAN:At,FULLWIDTHLEFTPAREN:yt,FULLWIDTHLESSTHAN:Et,FULLWIDTHMIDDLEDOT:ys,FULLWIDTHRIGHTPAREN:bt,HYPHEN:U,LEFTCORNERBRACKET:xt,LEFTWHITECORNERBRACKET:vt,LOCALHOST:Ke,NL:Pn,NUM:On,OPENANGLEBRACKET:mt,OPENBRACE:Ne,OPENBRACKET:ht,OPENPAREN:ft,PERCENT:ze,PIPE:Ot,PLUS:Pt,POUND:Nt,QUERY:He,QUOTE:zn,RIGHTCORNERBRACKET:wt,RIGHTWHITECORNERBRACKET:Tt,SCHEME:it,SEMI:Hn,SLASH:Q,SLASH_SCHEME:Te,SYM:zt,TILDE:Be,TLD:yn,UNDERSCORE:Dt,UTLD:bn,UWORD:kn,WORD:ne,WS:xn});const J=/[a-z]/,$e=new RegExp("\\p{L}","u"),Jt=new RegExp("\\p{Emoji}","u"),ee=/\d/,en=/\s/,fr="\r",tn=`
|
|
142
|
-
`,
|
|
151
|
+
`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:s,storedMarks:i}=n;if(s.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:a}=r.extensionManager,l=i||s.$to.parentOffset&&s.$from.marks();return t().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&o){const d=l.filter(h=>a.includes(h.type.name));c.ensureMarks(d)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),hc=D.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,P(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{var n;const r=!((n=e.attrs)===null||n===void 0)&&n.level?parseInt(e.attrs.level,10):1,s="#".repeat(r);return e.content?`${s} ${t.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},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=>mn({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),pc=D.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",P(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!oo(t,t.schema.nodes[this.name]))return!1;const{selection:n}=t,{$to:r}=n,s=e();return is(n)?s.insertContentAt(r.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({state:i,tr:o,dispatch:a})=>{if(a){const{$to:l}=o.selection,c=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?o.setSelection(se.create(o.doc,l.pos+1)):l.nodeAfter.isBlock?o.setSelection(Nn.create(o.doc,l.pos)):o.setSelection(se.create(o.doc,l.pos));else{const u=i.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,d=u==null?void 0:u.create();d&&(o.insert(c,d),o.setSelection(se.create(o.doc,c+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[io({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),fc=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,mc=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,gc=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,kc=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,yc=Re.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",P(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||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[be({find:fc,type:this.type}),be({find:gc,type:this.type})]},addPasteRules(){return[ce({find:mc,type:this.type}),ce({find:kc,type:this.type})]}}),bc="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",xc="ελ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",wn="numeric",vn="ascii",Tn="alpha",je="asciinumeric",Be="alphanumeric",En="domain",Ys="emoji",wc="scheme",vc="slashscheme",ln="whitespace";function Tc(e,t){return e in t||(t[e]=[]),t[e]}function me(e,t,n){t[wn]&&(t[je]=!0,t[Be]=!0),t[vn]&&(t[je]=!0,t[Tn]=!0),t[je]&&(t[Be]=!0),t[Tn]&&(t[Be]=!0),t[Be]&&(t[En]=!0),t[Ys]&&(t[En]=!0);for(const r in t){const s=Tc(r,n);s.indexOf(e)<0&&s.push(e)}}function Ec(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function H(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}H.groups={};H.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let r=0;r<t.jr.length;r++){const s=t.jr[r][0],i=t.jr[r][1];if(i&&s.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let s=0;s<e.length;s++)this.tt(e[s],t,n,r)},tr(e,t,n,r){r=r||H.groups;let s;return t&&t.j?s=t:(s=new H(t),n&&r&&me(t,n,r)),this.jr.push([e,s]),s},ts(e,t,n,r){let s=this;const i=e.length;if(!i)return s;for(let o=0;o<i-1;o++)s=s.tt(e[o]);return s.tt(e[i-1],t,n,r)},tt(e,t,n,r){r=r||H.groups;const s=this;if(t&&t.j)return s.j[e]=t,t;const i=t;let o,a=s.go(e);if(a?(o=new H,Object.assign(o.j,a.j),o.jr.push.apply(o.jr,a.jr),o.jd=a.jd,o.t=a.t):o=new H,i){if(r)if(o.t&&typeof o.t=="string"){const l=Object.assign(Ec(o.t,r),n);me(i,l,r)}else n&&me(i,n,r);o.t=i}return s.j[e]=o,o}};const E=(e,t,n,r,s)=>e.ta(t,n,r,s),N=(e,t,n,r,s)=>e.tr(t,n,r,s),Ir=(e,t,n,r,s)=>e.ts(t,n,r,s),k=(e,t,n,r,s)=>e.tt(t,n,r,s),re="WORD",An="UWORD",Js="ASCIINUMERICAL",ei="ALPHANUMERICAL",et="LOCALHOST",Sn="TLD",Cn="UTLD",ft="SCHEME",Se="SLASH_SCHEME",Kn="NUM",Ln="WS",Vn="NL",qe="OPENBRACE",Ue="CLOSEBRACE",wt="OPENBRACKET",vt="CLOSEBRACKET",Tt="OPENPAREN",Et="CLOSEPAREN",At="OPENANGLEBRACKET",St="CLOSEANGLEBRACKET",Ct="FULLWIDTHLEFTPAREN",Lt="FULLWIDTHRIGHTPAREN",Mt="LEFTCORNERBRACKET",Rt="RIGHTCORNERBRACKET",It="LEFTWHITECORNERBRACKET",Nt="RIGHTWHITECORNERBRACKET",Ot="FULLWIDTHLESSTHAN",_t="FULLWIDTHGREATERTHAN",$t="AMPERSAND",Pt="APOSTROPHE",Dt="ASTERISK",ae="AT",zt="BACKSLASH",Ht="BACKTICK",Bt="CARET",ge="COLON",Gn="COMMA",jt="DOLLAR",Z="DOT",qt="EQUALS",Qn="EXCLAMATION",U="HYPHEN",Fe="PERCENT",Ut="PIPE",Ft="PLUS",Wt="POUND",We="QUERY",Xn="QUOTE",ti="FULLWIDTHMIDDLEDOT",Zn="SEMI",Y="SLASH",Ke="TILDE",Kt="UNDERSCORE",ni="EMOJI",Vt="SYM";var ri=Object.freeze({__proto__:null,ALPHANUMERICAL:ei,AMPERSAND:$t,APOSTROPHE:Pt,ASCIINUMERICAL:Js,ASTERISK:Dt,AT:ae,BACKSLASH:zt,BACKTICK:Ht,CARET:Bt,CLOSEANGLEBRACKET:St,CLOSEBRACE:Ue,CLOSEBRACKET:vt,CLOSEPAREN:Et,COLON:ge,COMMA:Gn,DOLLAR:jt,DOT:Z,EMOJI:ni,EQUALS:qt,EXCLAMATION:Qn,FULLWIDTHGREATERTHAN:_t,FULLWIDTHLEFTPAREN:Ct,FULLWIDTHLESSTHAN:Ot,FULLWIDTHMIDDLEDOT:ti,FULLWIDTHRIGHTPAREN:Lt,HYPHEN:U,LEFTCORNERBRACKET:Mt,LEFTWHITECORNERBRACKET:It,LOCALHOST:et,NL:Vn,NUM:Kn,OPENANGLEBRACKET:At,OPENBRACE:qe,OPENBRACKET:wt,OPENPAREN:Tt,PERCENT:Fe,PIPE:Ut,PLUS:Ft,POUND:Wt,QUERY:We,QUOTE:Xn,RIGHTCORNERBRACKET:Rt,RIGHTWHITECORNERBRACKET:Nt,SCHEME:ft,SEMI:Zn,SLASH:Y,SLASH_SCHEME:Se,SYM:Vt,TILDE:Ke,TLD:Sn,UNDERSCORE:Kt,UTLD:Cn,UWORD:An,WORD:re,WS:Ln});const ee=/[a-z]/,Pe=new RegExp("\\p{L}","u"),cn=new RegExp("\\p{Emoji}","u"),te=/\d/,un=/\s/,Nr="\r",dn=`
|
|
152
|
+
`,Ac="️",Sc="",hn="";let at=null,lt=null;function Cc(e=[]){const t={};H.groups=t;const n=new H;at==null&&(at=Or(bc)),lt==null&&(lt=Or(xc)),k(n,"'",Pt),k(n,"{",qe),k(n,"}",Ue),k(n,"[",wt),k(n,"]",vt),k(n,"(",Tt),k(n,")",Et),k(n,"<",At),k(n,">",St),k(n,"(",Ct),k(n,")",Lt),k(n,"「",Mt),k(n,"」",Rt),k(n,"『",It),k(n,"』",Nt),k(n,"<",Ot),k(n,">",_t),k(n,"&",$t),k(n,"*",Dt),k(n,"@",ae),k(n,"`",Ht),k(n,"^",Bt),k(n,":",ge),k(n,",",Gn),k(n,"$",jt),k(n,".",Z),k(n,"=",qt),k(n,"!",Qn),k(n,"-",U),k(n,"%",Fe),k(n,"|",Ut),k(n,"+",Ft),k(n,"#",Wt),k(n,"?",We),k(n,'"',Xn),k(n,"/",Y),k(n,";",Zn),k(n,"~",Ke),k(n,"_",Kt),k(n,"\\",zt),k(n,"・",ti);const r=N(n,te,Kn,{[wn]:!0});N(r,te,r);const s=N(r,ee,Js,{[je]:!0}),i=N(r,Pe,ei,{[Be]:!0}),o=N(n,ee,re,{[vn]:!0});N(o,te,s),N(o,ee,o),N(s,te,s),N(s,ee,s);const a=N(n,Pe,An,{[Tn]:!0});N(a,ee),N(a,te,i),N(a,Pe,a),N(i,te,i),N(i,ee),N(i,Pe,i);const l=k(n,dn,Vn,{[ln]:!0}),c=k(n,Nr,Ln,{[ln]:!0}),u=N(n,un,Ln,{[ln]:!0});k(n,hn,u),k(c,dn,l),k(c,hn,u),N(c,un,u),k(u,Nr),k(u,dn),N(u,un,u),k(u,hn,u);const d=N(n,cn,ni,{[Ys]:!0});k(d,"#"),N(d,cn,d),k(d,Ac,d);const h=k(d,Sc);k(h,"#"),N(h,cn,d);const p=[[ee,o],[te,s]],g=[[ee,null],[Pe,a],[te,i]];for(let m=0;m<at.length;m++)oe(n,at[m],Sn,re,p);for(let m=0;m<lt.length;m++)oe(n,lt[m],Cn,An,g);me(Sn,{tld:!0,ascii:!0},t),me(Cn,{utld:!0,alpha:!0},t),oe(n,"file",ft,re,p),oe(n,"mailto",ft,re,p),oe(n,"http",Se,re,p),oe(n,"https",Se,re,p),oe(n,"ftp",Se,re,p),oe(n,"ftps",Se,re,p),me(ft,{scheme:!0,ascii:!0},t),me(Se,{slashscheme:!0,ascii:!0},t),e=e.sort((m,f)=>m[0]>f[0]?1:-1);for(let m=0;m<e.length;m++){const f=e[m][0],b=e[m][1]?{[wc]:!0}:{[vc]:!0};f.indexOf("-")>=0?b[En]=!0:ee.test(f)?te.test(f)?b[je]=!0:b[vn]=!0:b[wn]=!0,Ir(n,f,f,b)}return Ir(n,"localhost",et,{ascii:!0}),n.jd=new H(Vt),{start:n,tokens:Object.assign({groups:t},ri)}}function si(e,t){const n=Lc(t.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,s=[];let i=0,o=0;for(;o<r;){let a=e,l=null,c=0,u=null,d=-1,h=-1;for(;o<r&&(l=a.go(n[o]));)a=l,a.accepts()?(d=0,h=0,u=a):d>=0&&(d+=n[o].length,h++),c+=n[o].length,i+=n[o].length,o++;i-=d,o-=h,c-=d,s.push({t:u.t,v:t.slice(i-c,i),s:i-c,e:i})}return s}function Lc(e){const t=[],n=e.length;let r=0;for(;r<n;){let s=e.charCodeAt(r),i,o=s<55296||s>56319||r+1===n||(i=e.charCodeAt(r+1))<56320||i>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function oe(e,t,n,r,s){let i;const o=t.length;for(let a=0;a<o-1;a++){const l=t[a];e.j[l]?i=e.j[l]:(i=new H(r),i.jr=s.slice(),e.j[l]=i),e=i}return i=new H(n),i.jr=s.slice(),e.j[t[o-1]]=i,i}function Or(e){const t=[],n=[];let r=0,s="0123456789";for(;r<e.length;){let i=0;for(;s.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(""));for(let o=parseInt(e.substring(r,r+i),10);o>0;o--)n.pop();r+=i}else n.push(e[r]),r++}return t}const tt={defaultProtocol:"http",events:null,format:_r,formatHref:_r,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Yn(e,t=null){let n=Object.assign({},tt);e&&(n=Object.assign(n,e instanceof Yn?e.o:e));const r=n.ignoreTags,s=[];for(let i=0;i<r.length;i++)s.push(r[i].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=s}Yn.prototype={o:tt,ignoreTags:[],defaultRender(e){return e},check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=t!=null;let s=this.o[e];return s&&(typeof s=="object"?(s=n.t in s?s[n.t]:tt[e],typeof s=="function"&&r&&(s=s(t,n))):typeof s=="function"&&r&&(s=s(t,n.t,n)),s)},getObj(e,t,n){let r=this.o[e];return typeof r=="function"&&t!=null&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function _r(e){return e}function ii(e,t){this.t="token",this.v=e,this.tk=t}ii.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const 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=tt.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){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),s=e.get("tagName",n,t),i=this.toFormattedString(e),o={},a=e.get("className",n,t),l=e.get("target",n,t),c=e.get("rel",n,t),u=e.getObj("attributes",n,t),d=e.getObj("events",n,t);return o.href=r,a&&(o.class=a),l&&(o.target=l),c&&(o.rel=c),u&&Object.assign(o,u),{tagName:s,attributes:o,content:i,eventListeners:d}}};function Yt(e,t){class n extends ii{constructor(s,i){super(s,i),this.t=e}}for(const r in t)n.prototype[r]=t[r];return n.t=e,n}const Mc=Yt("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),$r=Yt("text"),Rc=Yt("nl"),ct=Yt("url",{isLink:!0,toHref(e=tt.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==et&&e[1].t===ge}}),q=e=>new H(e);function Ic({groups:e}){const t=e.domain.concat([$t,Dt,ae,zt,Ht,Bt,jt,qt,U,Kn,Fe,Ut,Ft,Wt,Y,Vt,Ke,Kt]),n=[Pt,ge,Gn,Z,Qn,Fe,We,Xn,Zn,At,St,qe,Ue,vt,wt,Tt,Et,Ct,Lt,Mt,Rt,It,Nt,Ot,_t],r=[$t,Pt,Dt,zt,Ht,Bt,jt,qt,U,qe,Ue,Fe,Ut,Ft,Wt,We,Y,Vt,Ke,Kt],s=q(),i=k(s,Ke);E(i,r,i),E(i,e.domain,i);const o=q(),a=q(),l=q();E(s,e.domain,o),E(s,e.scheme,a),E(s,e.slashscheme,l),E(o,r,i),E(o,e.domain,o);const c=k(o,ae);k(i,ae,c),k(a,ae,c),k(l,ae,c);const u=k(i,Z);E(u,r,i),E(u,e.domain,i);const d=q();E(c,e.domain,d),E(d,e.domain,d);const h=k(d,Z);E(h,e.domain,d);const p=q(Mc);E(h,e.tld,p),E(h,e.utld,p),k(c,et,p);const g=k(d,U);k(g,U,g),E(g,e.domain,d),E(p,e.domain,d),k(p,Z,h),k(p,U,g);const m=k(o,U),f=k(o,Z);k(m,U,m),E(m,e.domain,o),E(f,r,i),E(f,e.domain,o);const y=q(ct);E(f,e.tld,y),E(f,e.utld,y),E(y,e.domain,o),E(y,r,i),k(y,Z,f),k(y,U,m),k(y,ae,c);const b=k(y,ge),T=q(ct);E(b,e.numeric,T);const v=q(ct),A=q();E(v,t,v),E(v,n,A),E(A,t,v),E(A,n,A),k(y,Y,v),k(T,Y,v);const x=k(a,ge),R=k(l,ge),$=k(R,Y),_=k($,Y);E(a,e.domain,o),k(a,Z,f),k(a,U,m),E(l,e.domain,o),k(l,Z,f),k(l,U,m),E(x,e.domain,v),k(x,Y,v),k(x,We,v),E(_,e.domain,v),E(_,t,v),k(_,Y,v);const Q=[[qe,Ue],[wt,vt],[Tt,Et],[At,St],[Ct,Lt],[Mt,Rt],[It,Nt],[Ot,_t]];for(let rn=0;rn<Q.length;rn++){const[ar,sn]=Q[rn],st=k(v,ar);k(A,ar,st);const Te=q(ct);E(st,t,Te);const Ee=q();E(st,n,Ee),k(st,sn,v),E(Te,t,Te),E(Te,n,Ee),E(Ee,t,Te),E(Ee,n,Ee),k(Te,sn,v),k(Ee,sn,v)}return k(s,et,y),k(s,Vn,Rc),{start:s,tokens:ri}}function Nc(e,t,n){let r=n.length,s=0,i=[],o=[];for(;s<r;){let a=e,l=null,c=null,u=0,d=null,h=-1;for(;s<r&&!(l=a.go(n[s].t));)o.push(n[s++]);for(;s<r&&(c=l||a.go(n[s].t));)l=null,a=c,a.accepts()?(h=0,d=a):h>=0&&h++,s++,u++;if(h<0)s-=u,s<r&&(o.push(n[s]),s++);else{o.length>0&&(i.push(pn($r,t,o)),o=[]),s-=h,u-=h;const p=d.t,g=n.slice(s-u,s);i.push(pn(p,t,g))}}return o.length>0&&i.push(pn($r,t,o)),i}function pn(e,t,n){const r=n[0].s,s=n[n.length-1].e,i=t.slice(r,s);return new e(i,n)}const Oc=typeof console<"u"&&console&&console.warn||(()=>{}),_c="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",I={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function $c(){return H.groups={},I.scanner=null,I.parser=null,I.tokenQueue=[],I.pluginQueue=[],I.customSchemes=[],I.initialized=!1,I}function Pr(e,t=!1){if(I.initialized&&Oc(`linkifyjs: already initialized - will not register custom scheme "${e}" ${_c}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error(`linkifyjs: incorrect scheme format.
|
|
143
153
|
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
144
154
|
2. Cannot start or end with "-"
|
|
145
|
-
3. "-" cannot repeat`);R.customSchemes.push([e,t])}function Al(){R.scanner=ml(R.customSchemes);for(let e=0;e<R.tokenQueue.length;e++)R.tokenQueue[e][1]({scanner:R.scanner});R.parser=xl(R.scanner.tokens);for(let e=0;e<R.pluginQueue.length;e++)R.pluginQueue[e][1]({scanner:R.scanner,parser:R.parser});return R.initialized=!0,R}function jn(e){return R.initialized||Al(),wl(R.parser.start,e,ws(R.scanner.start,e))}jn.scan=ws;function Ts(e,t=null,n=null){if(t&&typeof t=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new Bn(n),s=jn(e),i=[];for(let o=0;o<s.length;o++){const a=s[o];a.isLink&&(!t||a.t===t)&&r.check(a)&&i.push(a.toFormattedObject(r))}return i}const Wt="[\0- -\u2029 ]",Ll=new RegExp(Wt),Cl=new RegExp(`${Wt}$`),Sl=new RegExp(`${Wt}+$`),Ml=new RegExp(Wt,"g");function Rl(e,t,n){var r,s;const i=e.doc.resolve(t.to);if(!(!((r=i.nodeBefore)===null||r===void 0)&&r.isText))return;const o=(s=e.doc.textBetween(t.from,t.to,"","").match(Sl))===null||s===void 0?void 0:s[0];if(!o)return;const a=t.to-o.length,l=Or(a,t.to,e.doc).filter(d=>d.mark.type===n);if(!l.length)return;const{nodeAfter:c}=i;if(c&&l.some(d=>d.mark.isInSet(c.marks)))return;const u=e.storedMarks;e.removeMark(a,t.to,n),e.setStoredMarks(u),e.selection.empty&&e.selection.from===t.to&&e.removeStoredMark(n)}function Il(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function $l(e){return new B({key:new Z("autolink"),appendTransaction:(t,n,r)=>{const s=t.some(l=>l.docChanged)&&!n.doc.eq(r.doc),i=t.some(l=>l.getMeta("preventAutolink"));if(!s||i)return;const{tr:o}=r,a=si(n.doc,[...t]);if(!t.some(ii)){const l=[];a.steps.forEach((c,u)=>{if(!(c instanceof oi)||!c.slice.size)return;const d=a.mapping.slice(u+1),h=d.map(c.from,1),p=d.map(c.from+c.slice.size,-1);h<p&&l.push({from:h,to:p})}),l.sort((c,u)=>u.to-c.to),l.forEach(c=>Rl(o,c,e.type))}if(_r(a).forEach(({newRange:l})=>{const c=ai(r.doc,l,h=>h.isTextblock);let u,d;if(c.length>1)u=c[0],d=r.doc.textBetween(u.pos,u.pos+u.node.nodeSize,void 0," ");else if(c.length){const h=r.doc.textBetween(l.from,l.to," "," ");if(!Cl.test(h))return;u=c[0],d=r.doc.textBetween(u.pos,l.to,void 0," ")}if(u&&d){const h=d.split(Ll).filter(Boolean);if(h.length<=0)return!1;const p=h[h.length-1],m=u.pos+d.lastIndexOf(p);if(!p)return!1;const g=jn(p).map(f=>f.toObject(e.defaultProtocol));if(!Il(g))return!1;g.filter(f=>f.isLink).map(f=>({...f,from:m+f.start+1,to:m+f.end+1})).filter(f=>r.schema.marks.code?!r.doc.rangeHasMark(f.from,f.to,r.schema.marks.code):!0).filter(f=>e.validate(f.value)).filter(f=>e.shouldAutoLink(f.value)).forEach(f=>{Or(f.from,f.to,r.doc).some(b=>b.mark.type===e.type)||o.addMark(f.from,f.to,e.type.create({href:f.href}))})}}),!!o.steps.length)return o}})}function _l(e){return new B({key:new Z("handleClickLink"),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let s=null;if(r.target instanceof HTMLAnchorElement)s=r.target;else{const l=r.target;if(!l)return!1;const c=e.editor.view.dom;s=l.closest("a"),s&&!c.contains(s)&&(s=null)}if(!s)return!1;let i=!1;if(e.enableClickSelection&&(i=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){var o,a;const l=li(t.state,e.type.name),c=(o=s.href)!==null&&o!==void 0?o:l.href,u=(a=s.target)!==null&&a!==void 0?a:l.target;c&&(window.open(c,u),i=!0)}return i}}})}const Ol=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,Pl=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function Es(e,t){let n=0;for(let r=t-1;r>=0&&e[r]==="\\";r-=1)n+=1;return n%2===1}function Nl(e,t){let n=0,r=0;for(;r<t;){if(e[r]!=="`"){r+=1;continue}if(n===0&&Es(e,r)){r+=1;continue}let s=0;for(;r<t&&e[r]==="`";)s+=1,r+=1;n===0?n=s:s===n&&(n=0)}return n>0}function As(e,t,n){var r,s;const[,i,o]=t;return(t.index?e[t.index-1]:void 0)==="!"||Es(e,(r=t.index)!==null&&r!==void 0?r:0)||Nl(e,(s=t.index)!==null&&s!==void 0?s:0)?!1:!!i.trim()&&n(o)}function Ls(e){var t,n;const[r,s,i,,o,a,l]=e,c=(t=o??a)!==null&&t!==void 0?t:l;return{index:(n=e.index)!==null&&n!==void 0?n:0,text:r,replaceWith:s,data:{href:i,title:c||null,markdown:!0}}}function Dl(e,t){return e.index<t.index+t.text.length&&t.index<e.index+e.text.length}function Cs(e){var t,n,r;return{href:(t=e.data)===null||t===void 0?void 0:t.href,title:(n=(r=e.data)===null||r===void 0?void 0:r.title)!==null&&n!==void 0?n:null}}function zl(e){const t=me({find:n=>{const r=Ol.exec(n);return!r||!As(n,r,e.isAllowedHref)?null:Ls(r)},type:e.type,getAttributes:Cs});return new ui({find:t.find,handler:n=>{const r=t.handler(n);return r!==null&&n.state.tr.steps.length&&n.state.tr.setMeta("preventAutolink",!0),r}})}function Hl(e){const t=oe({find:n=>{var r,s;const i=[];for(const a of n.matchAll(Pl))As(n,a,e.isAllowedHref)&&i.push(Ls(a));const o=((r=(s=e.findPlainUrls)===null||s===void 0?void 0:s.call(e,n))!==null&&r!==void 0?r:[]).filter(a=>!i.some(l=>Dl(l,a)));return[...i,...o]},type:e.type,getAttributes:Cs});return new ci({find:t.find,handler:n=>{var r;const s=t.handler(n);return s!==null&&n.state.tr.steps.length&&(!((r=n.match.data)===null||r===void 0)&&r.markdown)&&n.state.tr.setMeta("preventAutolink",!0),s}})}function Bl(e){return new B({key:new Z("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{shouldAutoLink:s}=e,{state:i}=t,{selection:o}=i,{empty:a}=o;if(a)return!1;let l="";r.content.forEach(u=>{l+=u.textContent});const c=Ts(l,{defaultProtocol:e.defaultProtocol}).find(u=>u.isLink&&u.value===l);return!l||!c||s!==void 0&&!s(c.value)?!1:e.editor.commands.setMark(e.type,{href:c.href})}}})}function te(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(r=>{const s=typeof r=="string"?r:r.scheme;s&&n.push(s)}),!e||e.replace(Ml,"").match(new RegExp(`^(?:(?:${n.map(r=>r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}const jl=Le.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=>{if(typeof e=="string"){yr(e);return}yr(e.scheme,e.optionalSlashes)})},onDestroy(){El()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!te(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{const 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;const r=(e.includes("@")?e.split("@").pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){var e,t,n;return{href:{default:null,parseHTML(r){return r.getAttribute("href")}},target:{default:(e=this.options.HTMLAttributes.target)!==null&&e!==void 0?e:null},rel:{default:(t=this.options.HTMLAttributes.rel)!==null&&t!==void 0?t:null},class:{default:(n=this.options.HTMLAttributes.class)!==null&&n!==void 0?n:null},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:n=>!!te(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!te(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",N(this.options.HTMLAttributes,e),0]:["a",N(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,s,i;const o=(n=(r=e.attrs)===null||r===void 0?void 0:r.href)!==null&&n!==void 0?n:"",a=(s=(i=e.attrs)===null||i===void 0?void 0:i.title)!==null&&s!==void 0?s:"",l=t.renderChildren(e);return a?`[${l}](${o} "${a}")`:`[${l}](${o})`},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:r=>!!te(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta("preventAutolink",!0).run():!1},toggleLink:e=>({chain:t})=>{const{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!te(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addInputRules(){return this.options.markdownLinks?[zl({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:t=>!!te(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){const e=t=>{const n=[];if(t){const{protocols:r,defaultProtocol:s}=this.options;Ts(t).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:o=>!!te(o,r),protocols:r,defaultProtocol:s})).forEach(i=>{this.options.shouldAutoLink(i.value)&&n.push({text:i.value,data:{href:i.href},index:i.start})})}return n};return this.options.markdownLinks?[Hl({type:this.type,isAllowedHref:t=>this.options.isAllowedUri(t,{defaultValidate:n=>!!te(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:e})]:[oe({find:e,type:this.type,getAttributes:t=>{var n;return{href:(n=t.data)===null||n===void 0?void 0:n.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push($l({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:s=>!!te(s,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(_l({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(Bl({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),ql="listItem",br="textStyle",xr=/^\s*([-+*])\s$/,Ss=j.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",N(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>e.type!=="list"||e.ordered?[]:{type:"bulletList",content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
146
|
-
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ql,this.editor.getAttributes(br)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=Ae({find:xr,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Ae({find:xr,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(br),editor:this.editor})),[e]}}),Ul=(e,t,n)=>{const{selection:r}=e;if(!r.empty)return null;const{$from:s}=r;if(!s.parent.isTextblock||s.parentOffset!==s.parent.content.size)return null;let i=-1;for(let p=s.depth;p>0;p-=1)if(s.node(p).type.name===t){i=p;break}if(i<0)return null;const o=s.node(i),a=s.index(i);if(a+1>=o.childCount)return null;const l=o.child(a+1);if(!n.includes(l.type.name))return null;const c=e.schema.nodes[t];let u=!1;if(l.forEach(p=>{p.type===c&&p.childCount>1&&(u=!0)}),!u)return null;const d=e.doc.resolve(s.after()).nodeAfter;if(!d||!n.includes(d.type.name))return null;const h=[];return d.forEach(p=>{h.push(p)}),h.length===0?null:{listItemDepth:i,nestedList:d,nestedListPos:s.after(),insertPos:s.after(i),items:h}},Fl=(e,t,n,r)=>{const s=Ul(e,n,r);if(!s)return!1;const{selection:i}=e,{nestedList:o,nestedListPos:a,insertPos:l,items:c}=s,u=e.tr;u.delete(a,a+o.nodeSize);const d=u.mapping.map(l);return u.insert(d,We.from(c)),u.setSelection(i.map(u.doc,u.mapping)),t&&t(u),!0},Wl=(e,t,n)=>Fl(e.state,e.view.dispatch,t,n),Ms=(e,t)=>H.create({name:`${e}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const n=()=>Wl(this.editor,e,t);return{Delete:n,"Mod-Delete":n}}}),Rs=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],tt="abcdefghijklmnopqrstuvwxyz",Is=String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;function Kt(e){let t=e,n="";for(const[r,s]of Rs)for(;t>=r;)n+=s,t-=r;return n}function qn(e){return Kt(e).toUpperCase()}function $s(e){const t=e.toLowerCase();let n=0,r=0;for(;n<t.length;){let s=!1;for(const[i,o]of Rs)if(t.startsWith(o,n)){r+=i,n+=o.length,s=!0;break}if(!s)return 0}return r}function Kl(e){if(!/^[ivxlcdmIVXLCDM]+$/.test(e))return!1;const t=$s(e);return t<=0?!1:(e===e.toLowerCase()?Kt(t):qn(t))===e}function Gl(e){const t=e.toLowerCase();if(t.length===1)return t.charCodeAt(0)-97+1;if(t.length===2){const n=t.charCodeAt(0)-97,r=t.charCodeAt(1)-97;return(n+1)*26+r+1}return 0}function Ht(e){if(e<=26)return tt[e-1];const t=Math.floor((e-1)/26)-1,n=(e-1)%26;return t<0?tt[n]:tt[t]+tt[n]}function Gt(e){if(!(!e||/^\d+$/.test(e))){if(Kl(e))return e===e.toLowerCase()?"i":"I";if(/^[a-z]{1,2}$/.test(e))return"a";if(/^[A-Z]{1,2}$/.test(e))return"A"}}function Un(e){if(/^\d+$/.test(e))return parseInt(e,10);const t=Gt(e);if(t==="i"||t==="I")return $s(e);if(t==="a"||t==="A"){const r=Gl(e);return r>0?r:1}const n=parseInt(e,10);return Number.isNaN(n)?1:n}function Vl(e,t){if(e==="numeric")return String(t);switch(e){case"a":return Ht(t);case"A":return Ht(t).toUpperCase();case"i":return Kt(t);case"I":return qn(t);default:return String(t)}}function Ql(e){var t;if(e.length===0)return!1;const n=(t=Gt(e[0]))!==null&&t!==void 0?t:"numeric",r=Un(e[0]);if(r<1)return!1;for(let s=0;s<e.length;s++){const i=Vl(n,r+s);if(e[s]!==i)return!1}return!0}function Xl(e){return{type:Gt(e),start:Un(e)}}function Zl(e){const{type:t,start:n}=Xl(e),r={};return t&&(r.type=t),n!==1&&(r.start=n),r}function Yl(e,t,n=". "){const r=t+1;if(!e||e==="1")return`${r}${n}`;switch(e){case"a":return`${Ht(r)}${n}`;case"A":return`${Ht(r).toUpperCase()}${n}`;case"i":return`${Kt(r)}${n}`;case"I":return`${qn(r)}${n}`;default:return`${r}${n}`}}function Jl(e){var t,n;const r=(t=e.tokens)===null||t===void 0?void 0:t[0];return!!(e.text&&((n=e.tokens)===null||n===void 0?void 0:n.length)===1&&(r==null?void 0:r.type)==="list"&&r.ordered&&r.raw===e.text)}function ec(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:"text",raw:e,text:e}])}const _s=j.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",N(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,t)=>{var n;if(e.type!=="list_item")return[];const r=(n=t.parseBlockChildren)!==null&&n!==void 0?n:t.parseChildren;let s=[];if(e.tokens&&e.tokens.length>0){if(Jl(e))return{type:"listItem",content:[{type:"paragraph",content:ec(e.text||"",t)}]};if(e.tokens.some(i=>i.type==="paragraph"))s=r(e.tokens);else{const i=e.tokens[0];if(i&&i.type==="text"&&i.tokens&&i.tokens.length>0){if(s=[{type:"paragraph",content:t.parseInline(i.tokens)}],e.tokens.length>1){const o=r(e.tokens.slice(1));s.push(...o)}}else s=r(e.tokens)}}return s.length===0&&(s=[{type:"paragraph",content:[]}]),{type:"listItem",content:s}},renderMarkdown:(e,t,n)=>Pr(e,t,r=>{if(r.parentType==="bulletList")return"- ";if(r.parentType==="orderedList"){var s,i;const o=((s=r.meta)===null||s===void 0||(s=s.parentAttrs)===null||s===void 0?void 0:s.start)||1;return Yl((i=r.meta)===null||i===void 0||(i=i.parentAttrs)===null||i===void 0?void 0:i.type,o-1+(r.index||0),". ")}return"- "},n,{alignNestedToPrefix:(n==null?void 0:n.parentType)==="orderedList"}),addExtensions(){return[Ms(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Fn=(e,t)=>{const{$from:n}=t.selection,r=gi(e,t.schema);let s=null,i=n.depth,o=n.pos,a=null;for(;i>0&&a===null;)s=n.node(i),s.type===r?a=i:(i-=1,o-=1);return a===null?null:{$pos:t.doc.resolve(o),depth:a}},Os=(e,t)=>{const n=Fn(e,t);if(!n)return!1;const[,r]=fi(t,e,n.$pos.pos+4);return r},tc=(e,t,n)=>{const{$anchor:r}=e.selection,s=Math.max(0,r.pos-2),i=e.doc.resolve(s).node();return!(!i||!n.includes(i.type.name))},wr=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!ot(e.state,t)&&tc(e.state,t,n)){const{$anchor:i}=e.state.selection,o=e.state.doc.resolve(i.before()-1),a=[];o.node().descendants((u,d)=>{u.type.name===t&&a.push({node:u,pos:d})});const l=a.at(-1);if(!l)return!1;const c=e.state.doc.resolve(o.start()+l.pos+1);return e.chain().cut({from:i.start()-1,to:i.end()+1},c.end()).joinForward().run()}if(!ot(e.state,t)||!hi(e.state))return!1;const{$from:r}=e.state.selection,s=r.depth-1;return r.node(s).type!==e.schema.nodes[t]||r.index(s)!==0?!1:e.chain().liftListItem(t).run()},nc=(e,t)=>{const n=Os(e,t),r=Fn(e,t);return!r||!n?!1:n>r.depth},rc=(e,t)=>{const n=Os(e,t),r=Fn(e,t);return!r||!n?!1:n<r.depth},vr=(e,t)=>{if(!ot(e.state,t)||!pi(e.state,t))return!1;const{selection:n}=e.state,{$from:r,$to:s}=n;return!n.empty&&r.sameParent(s)?!1:nc(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():rc(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},sc=(e,t,n)=>{const{state:r}=e,{selection:s}=r;if(!s.empty)return!1;const{$from:i}=s;if(i.parentOffset!==0||!i.parent.isTextblock||ot(r,t))return!1;const o=di(i);if(!o||!n.includes(o.type.name))return!1;const a=o.lastChild;if(!a||a.type.name!==t)return!1;const l=i.parent;if(!a.canReplace(a.childCount,a.childCount,We.from(l)))return!1;const c=i.before(),u=i.after(),d=c-2;return e.commands.command(({tr:h,dispatch:p})=>(p&&(h.delete(c,u).insert(d,We.from(l)),h.setSelection(re.create(h.doc,d+1)),h.scrollIntoView()),!0))},Ps=H.create({name:"listKeymap",addOptions(){return{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})=>{e.state.schema.nodes[n]!==void 0&&vr(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&vr(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&wr(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&wr(e,n,r)&&(t=!0)}),t},Tab:({editor:e})=>{for(const{itemName:t,wrapperNames:n}of this.options.listTypes)if(e.state.schema.nodes[t]!==void 0&&sc(e,t,n))return!0;return!1}}}}),Bt=new RegExp(`^(\\s*)(${Is})([.)])\\s+(.*)$`),ic=/^\s/,Ee={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function oc(e){return Bt.test(e.trimStart())}function ac(e){const t=e.trimStart();return Ee.bulletItem.test(t)||oc(t)||Ee.heading.test(t)||Ee.thematicBreak.test(t)&&!t.startsWith("-")||/^>\s?/.test(t)||Ee.codeFence.test(t)||Ee.blockMath.test(t)}function lc(e){return Object.values(Ee).some(t=>t.test(e))}function cc(e){const t=[],n=[];let r=!1;return e.forEach(s=>{if(r){n.push(s);return}if(s.trim()===""){r=!0,n.push(s);return}if(t.length>0&&ac(s)){r=!0,n.push(s);return}t.push(s)}),{paragraphLines:t,blockLines:n}}function Tr(e){const t=[];let n=0,r=0;for(;n<e.length;){const s=e[n],i=s.match(Bt);if(!i)break;const[,o,a,l,c]=i,u=o.length,d=parseInt(a,10),h=isNaN(d)?Gt(a):void 0,p=isNaN(d)?Un(a):d,m=[c];let g=n+1;const f=[s];let b=!1;for(;g<e.length;){const y=e[g];if(y.match(Bt))break;if(y.trim()==="")f.push(y),m.push(""),b=!0,g+=1;else if(y.match(ic)){const v=y.length-y.trimStart().length,w=u+a.length+1;f.push(y),m.push(y.slice(Math.min(v,w))),g+=1}else{if(b||lc(y))break;f.push(y),m.push(y),g+=1}}t.push({indent:u,number:p,type:h,content:m.join(`
|
|
147
|
-
`).trim(),contentLines:
|
|
148
|
-
`)}),r=
|
|
149
|
-
`).filter(r=>r.trim().length>0);if(t.length===0)return null;const n=[];for(const r of t){const s=r.trim().match(
|
|
155
|
+
3. "-" cannot repeat`);I.customSchemes.push([e,t])}function Pc(){I.scanner=Cc(I.customSchemes);for(let e=0;e<I.tokenQueue.length;e++)I.tokenQueue[e][1]({scanner:I.scanner});I.parser=Ic(I.scanner.tokens);for(let e=0;e<I.pluginQueue.length;e++)I.pluginQueue[e][1]({scanner:I.scanner,parser:I.parser});return I.initialized=!0,I}function Jn(e){return I.initialized||Pc(),Nc(I.parser.start,e,si(I.scanner.start,e))}Jn.scan=si;function oi(e,t=null,n=null){if(t&&typeof t=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new Yn(n),s=Jn(e),i=[];for(let o=0;o<s.length;o++){const a=s[o];a.isLink&&(!t||a.t===t)&&r.check(a)&&i.push(a.toFormattedObject(r))}return i}const Jt="[\0- -\u2029 ]",Dc=new RegExp(Jt),zc=new RegExp(`${Jt}$`),Hc=new RegExp(`${Jt}+$`),Bc=new RegExp(Jt,"g");function jc(e,t,n){var r,s;const i=e.doc.resolve(t.to);if(!(!((r=i.nodeBefore)===null||r===void 0)&&r.isText))return;const o=(s=e.doc.textBetween(t.from,t.to,"","").match(Hc))===null||s===void 0?void 0:s[0];if(!o)return;const a=t.to-o.length,l=as(a,t.to,e.doc).filter(d=>d.mark.type===n);if(!l.length)return;const{nodeAfter:c}=i;if(c&&l.some(d=>d.mark.isInSet(c.marks)))return;const u=e.storedMarks;e.removeMark(a,t.to,n),e.setStoredMarks(u),e.selection.empty&&e.selection.from===t.to&&e.removeStoredMark(n)}function qc(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function Uc(e){return new B({key:new G("autolink"),appendTransaction:(t,n,r)=>{const s=t.some(l=>l.docChanged)&&!n.doc.eq(r.doc),i=t.some(l=>l.getMeta("preventAutolink"));if(!s||i)return;const{tr:o}=r,a=ao(n.doc,[...t]);if(!t.some(lo)){const l=[];a.steps.forEach((c,u)=>{if(!(c instanceof co)||!c.slice.size)return;const d=a.mapping.slice(u+1),h=d.map(c.from,1),p=d.map(c.from+c.slice.size,-1);h<p&&l.push({from:h,to:p})}),l.sort((c,u)=>u.to-c.to),l.forEach(c=>jc(o,c,e.type))}if(os(a).forEach(({newRange:l})=>{const c=uo(r.doc,l,h=>h.isTextblock);let u,d;if(c.length>1)u=c[0],d=r.doc.textBetween(u.pos,u.pos+u.node.nodeSize,void 0," ");else if(c.length){const h=r.doc.textBetween(l.from,l.to," "," ");if(!zc.test(h))return;u=c[0],d=r.doc.textBetween(u.pos,l.to,void 0," ")}if(u&&d){const h=d.split(Dc).filter(Boolean);if(h.length<=0)return!1;const p=h[h.length-1],g=u.pos+d.lastIndexOf(p);if(!p)return!1;const m=Jn(p).map(f=>f.toObject(e.defaultProtocol));if(!qc(m))return!1;m.filter(f=>f.isLink).map(f=>({...f,from:g+f.start+1,to:g+f.end+1})).filter(f=>r.schema.marks.code?!r.doc.rangeHasMark(f.from,f.to,r.schema.marks.code):!0).filter(f=>e.validate(f.value)).filter(f=>e.shouldAutoLink(f.value)).forEach(f=>{as(f.from,f.to,r.doc).some(y=>y.mark.type===e.type)||o.addMark(f.from,f.to,e.type.create({href:f.href}))})}}),!!o.steps.length)return o}})}function Fc(e){return new B({key:new G("handleClickLink"),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let s=null;if(r.target instanceof HTMLAnchorElement)s=r.target;else{const l=r.target;if(!l)return!1;const c=e.editor.view.dom;s=l.closest("a"),s&&!c.contains(s)&&(s=null)}if(!s)return!1;let i=!1;if(e.enableClickSelection&&(i=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){var o,a;const l=ho(t.state,e.type.name),c=(o=s.href)!==null&&o!==void 0?o:l.href,u=(a=s.target)!==null&&a!==void 0?a:l.target;c&&(window.open(c,u),i=!0)}return i}}})}const Wc=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,Kc=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function ai(e,t){let n=0;for(let r=t-1;r>=0&&e[r]==="\\";r-=1)n+=1;return n%2===1}function Vc(e,t){let n=0,r=0;for(;r<t;){if(e[r]!=="`"){r+=1;continue}if(n===0&&ai(e,r)){r+=1;continue}let s=0;for(;r<t&&e[r]==="`";)s+=1,r+=1;n===0?n=s:s===n&&(n=0)}return n>0}function li(e,t,n){var r,s;const[,i,o]=t;return(t.index?e[t.index-1]:void 0)==="!"||ai(e,(r=t.index)!==null&&r!==void 0?r:0)||Vc(e,(s=t.index)!==null&&s!==void 0?s:0)?!1:!!i.trim()&&n(o)}function ci(e){var t,n;const[r,s,i,,o,a,l]=e,c=(t=o??a)!==null&&t!==void 0?t:l;return{index:(n=e.index)!==null&&n!==void 0?n:0,text:r,replaceWith:s,data:{href:i,title:c||null,markdown:!0}}}function Gc(e,t){return e.index<t.index+t.text.length&&t.index<e.index+e.text.length}function ui(e){var t,n,r;return{href:(t=e.data)===null||t===void 0?void 0:t.href,title:(n=(r=e.data)===null||r===void 0?void 0:r.title)!==null&&n!==void 0?n:null}}function Qc(e){const t=be({find:n=>{const r=Wc.exec(n);return!r||!li(n,r,e.isAllowedHref)?null:ci(r)},type:e.type,getAttributes:ui});return new fo({find:t.find,handler:n=>{const r=t.handler(n);return r!==null&&n.state.tr.steps.length&&n.state.tr.setMeta("preventAutolink",!0),r}})}function Xc(e){const t=ce({find:n=>{var r,s;const i=[];for(const a of n.matchAll(Kc))li(n,a,e.isAllowedHref)&&i.push(ci(a));const o=((r=(s=e.findPlainUrls)===null||s===void 0?void 0:s.call(e,n))!==null&&r!==void 0?r:[]).filter(a=>!i.some(l=>Gc(l,a)));return[...i,...o]},type:e.type,getAttributes:ui});return new po({find:t.find,handler:n=>{var r;const s=t.handler(n);return s!==null&&n.state.tr.steps.length&&(!((r=n.match.data)===null||r===void 0)&&r.markdown)&&n.state.tr.setMeta("preventAutolink",!0),s}})}function Zc(e){return new B({key:new G("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{shouldAutoLink:s}=e,{state:i}=t,{selection:o}=i,{empty:a}=o;if(a)return!1;let l="";r.content.forEach(u=>{l+=u.textContent});const c=oi(l,{defaultProtocol:e.defaultProtocol}).find(u=>u.isLink&&u.value===l);return!l||!c||s!==void 0&&!s(c.value)?!1:e.editor.commands.setMark(e.type,{href:c.href})}}})}function ne(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(r=>{const s=typeof r=="string"?r:r.scheme;s&&n.push(s)}),!e||e.replace(Bc,"").match(new RegExp(`^(?:(?:${n.map(r=>r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}const Yc=Re.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=>{if(typeof e=="string"){Pr(e);return}Pr(e.scheme,e.optionalSlashes)})},onDestroy(){$c()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!ne(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{const 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;const r=(e.includes("@")?e.split("@").pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){var e,t,n;return{href:{default:null,parseHTML(r){return r.getAttribute("href")}},target:{default:(e=this.options.HTMLAttributes.target)!==null&&e!==void 0?e:null},rel:{default:(t=this.options.HTMLAttributes.rel)!==null&&t!==void 0?t:null},class:{default:(n=this.options.HTMLAttributes.class)!==null&&n!==void 0?n:null},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:n=>!!ne(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!ne(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",P(this.options.HTMLAttributes,e),0]:["a",P(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,s,i;const o=(n=(r=e.attrs)===null||r===void 0?void 0:r.href)!==null&&n!==void 0?n:"",a=(s=(i=e.attrs)===null||i===void 0?void 0:i.title)!==null&&s!==void 0?s:"",l=t.renderChildren(e);return a?`[${l}](${o} "${a}")`:`[${l}](${o})`},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:r=>!!ne(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta("preventAutolink",!0).run():!1},toggleLink:e=>({chain:t})=>{const{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!ne(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addInputRules(){return this.options.markdownLinks?[Qc({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:t=>!!ne(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){const e=t=>{const n=[];if(t){const{protocols:r,defaultProtocol:s}=this.options;oi(t).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:o=>!!ne(o,r),protocols:r,defaultProtocol:s})).forEach(i=>{this.options.shouldAutoLink(i.value)&&n.push({text:i.value,data:{href:i.href},index:i.start})})}return n};return this.options.markdownLinks?[Xc({type:this.type,isAllowedHref:t=>this.options.isAllowedUri(t,{defaultValidate:n=>!!ne(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:e})]:[ce({find:e,type:this.type,getAttributes:t=>{var n;return{href:(n=t.data)===null||n===void 0?void 0:n.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(Uc({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:s=>!!ne(s,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(Fc({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(Zc({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),Jc="listItem",Dr="textStyle",zr=/^\s*([-+*])\s$/,di=D.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",P(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>e.type!=="list"||e.ordered?[]:{type:"bulletList",content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
156
|
+
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Jc,this.editor.getAttributes(Dr)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=Le({find:zr,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Le({find:zr,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Dr),editor:this.editor})),[e]}}),eu=(e,t,n)=>{const{selection:r}=e;if(!r.empty)return null;const{$from:s}=r;if(!s.parent.isTextblock||s.parentOffset!==s.parent.content.size)return null;let i=-1;for(let p=s.depth;p>0;p-=1)if(s.node(p).type.name===t){i=p;break}if(i<0)return null;const o=s.node(i),a=s.index(i);if(a+1>=o.childCount)return null;const l=o.child(a+1);if(!n.includes(l.type.name))return null;const c=e.schema.nodes[t];let u=!1;if(l.forEach(p=>{p.type===c&&p.childCount>1&&(u=!0)}),!u)return null;const d=e.doc.resolve(s.after()).nodeAfter;if(!d||!n.includes(d.type.name))return null;const h=[];return d.forEach(p=>{h.push(p)}),h.length===0?null:{listItemDepth:i,nestedList:d,nestedListPos:s.after(),insertPos:s.after(i),items:h}},tu=(e,t,n,r)=>{const s=eu(e,n,r);if(!s)return!1;const{selection:i}=e,{nestedList:o,nestedListPos:a,insertPos:l,items:c}=s,u=e.tr;u.delete(a,a+o.nodeSize);const d=u.mapping.map(l);return u.insert(d,Ye.from(c)),u.setSelection(i.map(u.doc,u.mapping)),t&&t(u),!0},nu=(e,t,n)=>tu(e.state,e.view.dispatch,t,n),hi=(e,t)=>j.create({name:`${e}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const n=()=>nu(this.editor,e,t);return{Delete:n,"Mod-Delete":n}}}),pi=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],ut="abcdefghijklmnopqrstuvwxyz",fi=String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;function en(e){let t=e,n="";for(const[r,s]of pi)for(;t>=r;)n+=s,t-=r;return n}function er(e){return en(e).toUpperCase()}function mi(e){const t=e.toLowerCase();let n=0,r=0;for(;n<t.length;){let s=!1;for(const[i,o]of pi)if(t.startsWith(o,n)){r+=i,n+=o.length,s=!0;break}if(!s)return 0}return r}function ru(e){if(!/^[ivxlcdmIVXLCDM]+$/.test(e))return!1;const t=mi(e);return t<=0?!1:(e===e.toLowerCase()?en(t):er(t))===e}function su(e){const t=e.toLowerCase();if(t.length===1)return t.charCodeAt(0)-97+1;if(t.length===2){const n=t.charCodeAt(0)-97,r=t.charCodeAt(1)-97;return(n+1)*26+r+1}return 0}function Gt(e){if(e<=26)return ut[e-1];const t=Math.floor((e-1)/26)-1,n=(e-1)%26;return t<0?ut[n]:ut[t]+ut[n]}function tn(e){if(!(!e||/^\d+$/.test(e))){if(ru(e))return e===e.toLowerCase()?"i":"I";if(/^[a-z]{1,2}$/.test(e))return"a";if(/^[A-Z]{1,2}$/.test(e))return"A"}}function tr(e){if(/^\d+$/.test(e))return parseInt(e,10);const t=tn(e);if(t==="i"||t==="I")return mi(e);if(t==="a"||t==="A"){const r=su(e);return r>0?r:1}const n=parseInt(e,10);return Number.isNaN(n)?1:n}function iu(e,t){if(e==="numeric")return String(t);switch(e){case"a":return Gt(t);case"A":return Gt(t).toUpperCase();case"i":return en(t);case"I":return er(t);default:return String(t)}}function ou(e){var t;if(e.length===0)return!1;const n=(t=tn(e[0]))!==null&&t!==void 0?t:"numeric",r=tr(e[0]);if(r<1)return!1;for(let s=0;s<e.length;s++){const i=iu(n,r+s);if(e[s]!==i)return!1}return!0}function au(e){return{type:tn(e),start:tr(e)}}function lu(e){const{type:t,start:n}=au(e),r={};return t&&(r.type=t),n!==1&&(r.start=n),r}function cu(e,t,n=". "){const r=t+1;if(!e||e==="1")return`${r}${n}`;switch(e){case"a":return`${Gt(r)}${n}`;case"A":return`${Gt(r).toUpperCase()}${n}`;case"i":return`${en(r)}${n}`;case"I":return`${er(r)}${n}`;default:return`${r}${n}`}}function uu(e){var t,n;const r=(t=e.tokens)===null||t===void 0?void 0:t[0];return!!(e.text&&((n=e.tokens)===null||n===void 0?void 0:n.length)===1&&(r==null?void 0:r.type)==="list"&&r.ordered&&r.raw===e.text)}function du(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:"text",raw:e,text:e}])}const gi=D.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",P(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,t)=>{var n;if(e.type!=="list_item")return[];const r=(n=t.parseBlockChildren)!==null&&n!==void 0?n:t.parseChildren;let s=[];if(e.tokens&&e.tokens.length>0){if(uu(e))return{type:"listItem",content:[{type:"paragraph",content:du(e.text||"",t)}]};if(e.tokens.some(i=>i.type==="paragraph"))s=r(e.tokens);else{const i=e.tokens[0];if(i&&i.type==="text"&&i.tokens&&i.tokens.length>0){if(s=[{type:"paragraph",content:t.parseInline(i.tokens)}],e.tokens.length>1){const o=r(e.tokens.slice(1));s.push(...o)}}else s=r(e.tokens)}}return s.length===0&&(s=[{type:"paragraph",content:[]}]),{type:"listItem",content:s}},renderMarkdown:(e,t,n)=>ls(e,t,r=>{if(r.parentType==="bulletList")return"- ";if(r.parentType==="orderedList"){var s,i;const o=((s=r.meta)===null||s===void 0||(s=s.parentAttrs)===null||s===void 0?void 0:s.start)||1;return cu((i=r.meta)===null||i===void 0||(i=i.parentAttrs)===null||i===void 0?void 0:i.type,o-1+(r.index||0),". ")}return"- "},n,{alignNestedToPrefix:(n==null?void 0:n.parentType)==="orderedList"}),addExtensions(){return[hi(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),nr=(e,t)=>{const{$from:n}=t.selection,r=bo(e,t.schema);let s=null,i=n.depth,o=n.pos,a=null;for(;i>0&&a===null;)s=n.node(i),s.type===r?a=i:(i-=1,o-=1);return a===null?null:{$pos:t.doc.resolve(o),depth:a}},ki=(e,t)=>{const n=nr(e,t);if(!n)return!1;const[,r]=yo(t,e,n.$pos.pos+4);return r},hu=(e,t,n)=>{const{$anchor:r}=e.selection,s=Math.max(0,r.pos-2),i=e.doc.resolve(s).node();return!(!i||!n.includes(i.type.name))},Hr=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!mt(e.state,t)&&hu(e.state,t,n)){const{$anchor:i}=e.state.selection,o=e.state.doc.resolve(i.before()-1),a=[];o.node().descendants((u,d)=>{u.type.name===t&&a.push({node:u,pos:d})});const l=a.at(-1);if(!l)return!1;const c=e.state.doc.resolve(o.start()+l.pos+1);return e.chain().cut({from:i.start()-1,to:i.end()+1},c.end()).joinForward().run()}if(!mt(e.state,t)||!go(e.state))return!1;const{$from:r}=e.state.selection,s=r.depth-1;return r.node(s).type!==e.schema.nodes[t]||r.index(s)!==0?!1:e.chain().liftListItem(t).run()},pu=(e,t)=>{const n=ki(e,t),r=nr(e,t);return!r||!n?!1:n>r.depth},fu=(e,t)=>{const n=ki(e,t),r=nr(e,t);return!r||!n?!1:n<r.depth},Br=(e,t)=>{if(!mt(e.state,t)||!ko(e.state,t))return!1;const{selection:n}=e.state,{$from:r,$to:s}=n;return!n.empty&&r.sameParent(s)?!1:pu(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():fu(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},mu=(e,t,n)=>{const{state:r}=e,{selection:s}=r;if(!s.empty)return!1;const{$from:i}=s;if(i.parentOffset!==0||!i.parent.isTextblock||mt(r,t))return!1;const o=mo(i);if(!o||!n.includes(o.type.name))return!1;const a=o.lastChild;if(!a||a.type.name!==t)return!1;const l=i.parent;if(!a.canReplace(a.childCount,a.childCount,Ye.from(l)))return!1;const c=i.before(),u=i.after(),d=c-2;return e.commands.command(({tr:h,dispatch:p})=>(p&&(h.delete(c,u).insert(d,Ye.from(l)),h.setSelection(se.create(h.doc,d+1)),h.scrollIntoView()),!0))},yi=j.create({name:"listKeymap",addOptions(){return{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})=>{e.state.schema.nodes[n]!==void 0&&Br(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&Br(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&Hr(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&Hr(e,n,r)&&(t=!0)}),t},Tab:({editor:e})=>{for(const{itemName:t,wrapperNames:n}of this.options.listTypes)if(e.state.schema.nodes[t]!==void 0&&mu(e,t,n))return!0;return!1}}}}),Qt=new RegExp(`^(\\s*)(${fi})([.)])\\s+(.*)$`),gu=/^\s/,Ce={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function ku(e){return Qt.test(e.trimStart())}function yu(e){const t=e.trimStart();return Ce.bulletItem.test(t)||ku(t)||Ce.heading.test(t)||Ce.thematicBreak.test(t)&&!t.startsWith("-")||/^>\s?/.test(t)||Ce.codeFence.test(t)||Ce.blockMath.test(t)}function bu(e){return Object.values(Ce).some(t=>t.test(e))}function xu(e){const t=[],n=[];let r=!1;return e.forEach(s=>{if(r){n.push(s);return}if(s.trim()===""){r=!0,n.push(s);return}if(t.length>0&&yu(s)){r=!0,n.push(s);return}t.push(s)}),{paragraphLines:t,blockLines:n}}function jr(e){const t=[];let n=0,r=0;for(;n<e.length;){const s=e[n],i=s.match(Qt);if(!i)break;const[,o,a,l,c]=i,u=o.length,d=parseInt(a,10),h=isNaN(d)?tn(a):void 0,p=isNaN(d)?tr(a):d,g=[c];let m=n+1;const f=[s];let y=!1;for(;m<e.length;){const b=e[m];if(b.match(Qt))break;if(b.trim()==="")f.push(b),g.push(""),y=!0,m+=1;else if(b.match(gu)){const T=b.length-b.trimStart().length,v=u+a.length+1;f.push(b),g.push(b.slice(Math.min(T,v))),m+=1}else{if(y||bu(b))break;f.push(b),g.push(b),m+=1}}t.push({indent:u,number:p,type:h,content:g.join(`
|
|
157
|
+
`).trim(),contentLines:g,raw:f.join(`
|
|
158
|
+
`)}),r=m,n=m}return[t,r]}const wu=new RegExp(`^(${fi})([.)])\\s+(.+)$`);function vu(e){const t=e.split(`
|
|
159
|
+
`).filter(r=>r.trim().length>0);if(t.length===0)return null;const n=[];for(const r of t){const s=r.trim().match(wu);if(!s)return null;n.push({marker:s[1],content:s[3]})}return ou(n.map(r=>r.marker))?{type:"orderedList",attrs:lu(n[0].marker),content:n.map(r=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:r.content}]}]}))}:null}function bi(e,t,n){const r=[];let s=0;for(;s<e.length;){const i=e[s];if(i.indent===t){const{paragraphLines:o,blockLines:a}=xu(i.contentLines),l=o.join(`
|
|
150
160
|
`).trim(),c=[];l&&c.push({type:"paragraph",raw:l,tokens:n.inlineTokens(l)});const u=a.join(`
|
|
151
|
-
`).trim();if(u){const p=n.blockTokens(u);c.push(...p)}let d=s+1;const h=[];for(;d<e.length&&e[d].indent>t;)h.push(e[d]),d+=1;if(h.length>0){const p=
|
|
152
|
-
`)})}r.push({type:"list_item",raw:i.raw,tokens:c}),s=d}else s+=1}return r}function
|
|
153
|
-
`,r);if(s===-1)return n.push(e.slice(r)),n;n.push(e.slice(r,s)),r=s+1}return n}function
|
|
154
|
-
`),n=t===-1?e:e.slice(0,t);if(!
|
|
155
|
-
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:()=>-1,tokenize:(e,t,n)=>{var r,s;const[i,o,a]=
|
|
156
|
-
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(
|
|
157
|
-
`):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;const n=(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))===null||t===void 0?void 0:t.index;return n!==void 0?n:-1},tokenize(e,t,n){const r=i=>{const o=Qn(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,l)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:n.inlineTokens(a.mainContent),nestedTokens:l}),customNestedParser:r},n);if(o){const a={type:"taskList",raw:o.raw,items:o.items},l=i.slice(o.raw.length);return l.trim()?[a,...n.blockTokens(l)]:[a]}return n.blockTokens(i)},s=Qn(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()==="x"}),createToken:(i,o)=>({type:"taskItem",raw:"",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:n.inlineTokens(i.mainContent),nestedTokens:o}),customNestedParser:r},n);if(s)return{type:"taskList",raw:s.raw,items:s.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()}}});H.create({name:"listKit",addExtensions(){const e=[];return this.options.bulletList!==!1&&e.push(Ss.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(_s.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(Ps.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(Ds.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(bc.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(xc.configure(this.options.taskList)),e}});const nt=" ",sn=" ",wc=j.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",N(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{const n=e.tokens||[];if(n.length===1&&n[0].type==="image")return t.parseChildren([n[0]]);const r=t.parseInline(n);return n.length===1&&n[0].type==="text"&&(n[0].raw===nt||n[0].text===nt||n[0].raw===sn||n[0].text===sn)&&r.length===1&&r[0].type==="text"&&(r[0].text===nt||r[0].text===sn)?t.createNode("paragraph",void 0,[]):t.createNode("paragraph",void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return"";const r=Array.isArray(e.content)?e.content:[];if(r.length===0){var s,i;const o=Array.isArray(n==null||(s=n.previousNode)===null||s===void 0?void 0:s.content)?n.previousNode.content:[];return(n==null||(i=n.previousNode)===null||i===void 0?void 0:i.type)==="paragraph"&&o.length===0?nt:""}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),vc=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Tc=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Ec=Le.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",N(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[me({find:vc,type:this.type})]},addPasteRules(){return[oe({find:Tc,type:this.type})]}}),Ac=j.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),Lc=Le.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["u",N(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:"underline",level:"inline",start(e){return e.indexOf("++")},tokenize(e,t,n){const r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;const s=r[2].trim();return{type:"underline",raw:r[0],text:s,tokens:n.inlineTokens(s)}}},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()}}});function Cc(e={}){return new B({view(t){return new Sc(t,e)}})}class Sc{constructor(t,n){var r;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(s=>{let i=o=>{this[s](o)};return t.dom.addEventListener(s,i),{name:s,handler:i}})}destroy(){this.setCursor(null),this.handlers.forEach(({name:t,handler:n})=>this.editorView.dom.removeEventListener(t,n))}update(t,n){if(this.cursorPos!=null&&n.doc!=t.state.doc)if(this.lastDragEvent){let r=this.computeTarget(this.lastDragEvent);r==this.cursorPos?this.updateOverlay():this.setCursor(r)}else this.updateOverlay()}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r,s=this.editorView.dom,i=s.getBoundingClientRect(),o=i.width/s.offsetWidth,a=i.height/s.offsetHeight;if(n){let d=t.nodeBefore,h=t.nodeAfter;if(d||h){let p=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(p){let m=p.getBoundingClientRect(),g=d?m.bottom:m.top;d&&h&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let f=this.width/2*a;r={left:m.left,right:m.right,top:g-f,bottom:g+f}}}}if(!r){let d=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*o;r={left:d.left-h,right:d.left+h,top:d.top,bottom:d.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.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",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let c,u;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,u=-pageYOffset;else{let d=l.getBoundingClientRect(),h=d.width/l.offsetWidth,p=d.height/l.offsetHeight;c=d.left-l.scrollLeft*h,u=d.top-l.scrollTop*p}this.element.style.left=(r.left-c)/o+"px",this.element.style.top=(r.top-u)/a+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/a+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}computeTarget(t){let n=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),s=r&&r.type.spec.disableDropCursor,i=typeof s=="function"?s(this.editorView,n,t):s;if(!n||i)return null;let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=ki(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}return o}dragover(t){if(!this.editorView.editable)return;this.lastDragEvent=t;let n=this.computeTarget(t);n!=null&&(this.setCursor(n),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}class $ extends Fe{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return $.valid(r)?new $(r):Fe.near(r)}content(){return vn.empty}eq(t){return t instanceof $&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new $(t.resolve(n.pos))}getBookmark(){return new Wn(this.anchor)}static valid(t){let n=t.parent;if(n.inlineContent||!Mc(t)||!Rc(t))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let s=n.contentMatchAt(t.index()).defaultType;return s&&s.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&$.valid(t))return t;let s=t.pos,i=null;for(let o=t.depth;;o--){let a=t.node(o);if(n>0?t.indexAfter(o)<a.childCount:t.index(o)>0){i=a.child(n>0?t.indexAfter(o):t.index(o)-1);break}else if(o==0)return null;s+=n;let l=t.doc.resolve(s);if($.valid(l))return l}for(;;){let o=n>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!Tn.isSelectable(i)){t=t.doc.resolve(s+i.nodeSize*n),r=!1;continue e}break}i=o,s+=n;let a=t.doc.resolve(s);if($.valid(a))return a}return null}}}$.prototype.visible=!1;$.findFrom=$.findGapCursorFrom;Fe.jsonID("gapcursor",$);class Wn{constructor(t){this.pos=t}map(t){return new Wn(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return $.valid(n)?new $(n):Fe.near(n)}}function zs(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function Mc(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(n-1);;s=s.lastChild){if(s.childCount==0&&!s.inlineContent||zs(s.type))return!0;if(s.inlineContent)return!1}}return!0}function Rc(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 s=r.child(n);;s=s.firstChild){if(s.childCount==0&&!s.inlineContent||zs(s.type))return!0;if(s.inlineContent)return!1}}return!0}function Ic(){return new B({props:{decorations:Pc,createSelectionBetween(e,t,n){return t.pos==n.pos&&$.valid(n)?new $(n):null},handleClick:_c,handleKeyDown:$c,handleDOMEvents:{beforeinput:Oc}}})}const $c=yi({ArrowLeft:rt("horiz",-1),ArrowRight:rt("horiz",1),ArrowUp:rt("vert",-1),ArrowDown:rt("vert",1)});function rt(e,t){const n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(r,s,i){let o=r.selection,a=t>0?o.$to:o.$from,l=o.empty;if(o instanceof re){if(!i.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(t>0?a.after():a.before())}let c=$.findGapCursorFrom(a,t,l);return c?(s&&s(r.tr.setSelection(new $(c))),!0):!1}}function _c(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!$.valid(r))return!1;let s=e.posAtCoords({left:n.clientX,top:n.clientY});return s&&s.inside>-1&&Tn.isSelectable(e.state.doc.nodeAt(s.inside))?!1:(e.dispatch(e.state.tr.setSelection(new $(r))),!0)}function Oc(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof $))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 s=We.empty;for(let o=r.length-1;o>=0;o--)s=We.from(r[o].createAndFill(null,s));let i=e.state.tr.replace(n.pos,n.pos,new vn(s,0,0));return i.setSelection(re.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function Pc(e){if(!(e.selection instanceof $))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",ae.create(e.doc,[jt.widget(e.selection.head,t,{key:"gapcursor"})])}H.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(t=>t!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{const t=(e==null?void 0:e.node)||this.editor.state.doc;if(((e==null?void 0:e.mode)||this.options.mode)==="textSize"){const n=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(n)}return t.nodeSize},this.storage.words=e=>{const t=(e==null?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 B({key:new Z("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;const s=this.options.limit,i=this.options.autoTrim;if(s==null||s===0||i===!1){e=!0;return}const o=this.storage.characters({node:r.doc});if(o>s){const a=o-s,l=0,c=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${s} characters. Content was automatically trimmed.`);const u=r.tr.deleteRange(l,c);return e=!0,u}e=!0},filterTransaction:(t,n)=>{const r=this.options.limit;if(!t.docChanged||r===0||r===null||r===void 0)return!0;const s=this.storage.characters({node:n.doc}),i=this.storage.characters({node:t.doc});if(i<=r||s>r&&i>r&&i<=s)return!0;if(s>r&&i>r&&i>s||!t.getMeta("paste"))return!1;const o=t.selection.$head.pos,a=o-(i-r),l=o;return t.deleteRange(a,l),!(this.storage.characters({node:t.doc})>r)}})]}});const Nc=H.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Cc(this.options)]}});H.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new B({key:new Z("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:s}=t,i=[];if(!n||!r)return ae.create(e,[]);let o=0;this.options.mode==="deepest"&&e.descendants((l,c)=>{if(!l.isText){if(!(s>=c&&s<=c+l.nodeSize-1))return!1;o+=1}});let a=0;return e.descendants((l,c)=>{if(l.isText||!(s>=c&&s<=c+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&o-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";i.push(jt.node(c,c+l.nodeSize,{class:this.options.className}))}),ae.create(e,i)}}})]}});const Dc=H.create({name:"gapCursor",addProseMirrorPlugins(){return[Ic()]},extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=Rr(ue(e,"allowGapCursor",n)))!==null&&t!==void 0?t:null}}}),Hs="placeholder",Sr=new Z("tiptap__placeholder");function Bs(e){const{editor:t,placeholder:n,dataAttribute:r,pos:s,node:i,isEmptyDoc:o,hasAnchor:a,classes:{emptyNode:l,emptyEditor:c}}=e,u=[l];return o&&u.push(c),jt.node(s,s+i.nodeSize,{class:u.join(" "),[r]:typeof n=="function"?n({editor:t,node:i,pos:s,hasAnchor:a}):n})}function js(e,t){return typeof e=="function"?e(t):e}function qs({editor:e,options:t,dataAttribute:n,doc:r,selection:s,from:i,to:o}){const{anchor:a}=s,l=[],c=e.isEmpty;return r.nodesBetween(i,o,(u,d)=>{const h=a>=d&&a<=d+u.nodeSize,p=!u.isLeaf&&Nr(u);return u.type.isTextblock&&(h||!t.showOnlyCurrent)&&p&&l.push(Bs({editor:e,isEmptyDoc:c,dataAttribute:n,hasAnchor:h,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:js(t.emptyNodeClass,{editor:e,node:u,pos:d,hasAnchor:h})},node:u,pos:d})),t.includeChildren}),l}function Us({editor:e,options:t,dataAttribute:n,doc:r,selection:s}){if(!(e.isEditable||!t.showOnlyWhenEditable))return null;const{anchor:i}=s,o=[],a=e.isEmpty;if(t.showOnlyCurrent&&!t.includeChildren){const l=r.resolve(i),c=l.depth>0?l.node(1):l.nodeAfter,u=l.depth>0?l.before(1):i;if(c&&c.type.isTextblock&&Nr(c)){const d=i>=u&&i<=u+c.nodeSize;o.push(Bs({editor:e,isEmptyDoc:a,dataAttribute:n,hasAnchor:d,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:js(t.emptyNodeClass,{editor:e,node:c,pos:u,hasAnchor:d})},node:c,pos:u}))}}else o.push(...qs({editor:e,options:t,dataAttribute:n,doc:r,selection:s,from:0,to:r.content.size}));return ae.create(r,o)}function je(e,t){const n=e.resolve(t);if(n.depth===0){var r;const i=(r=n.nodeAfter)!==null&&r!==void 0?r:n.nodeBefore;if(!i)return{from:t,to:t};const o=n.nodeAfter?t:t-i.nodeSize;return{from:o,to:o+i.nodeSize}}const s=n.before(1);return{from:s,to:s+n.node(1).nodeSize}}function qe(e,t){return{from:Math.max(0,t.from-1),to:Math.min(e.content.size,t.to-1)}}function zc(e,t,n){const r=[];return e.forEach((s,i)=>{const o=i,a=o+s.nodeSize,l=o+1,c=a+1;l<n&&c>t&&r.push({from:o,to:a})}),r}function Hc(e){if(e.length===0)return[];const t=[...e].sort((r,s)=>r.from-s.from),n=[{...t[0]}];for(let r=1;r<t.length;r+=1){const s=n[n.length-1],i=t[r];i.from<=s.to?s.to=Math.max(s.to,i.to):n.push({...i})}return n}function Bc(e,t){const n=zc(e,t.from,t.to);return n.push(qe(e,je(e,t.from))),t.to>t.from?n.push(qe(e,je(e,Math.min(t.to,e.content.size+1)-1))):t.from<e.content.size+1&&n.push(qe(e,je(e,Math.min(t.from+1,e.content.size)))),n}function jc(e,t,n){const r=[];if(e.docChanged){const s=_r(e);for(const i of s)r.push(...Bc(n.doc,i.newRange))}return e.selectionSet&&(r.push(qe(n.doc,je(n.doc,e.mapping.map(t.selection.anchor)))),r.push(qe(n.doc,je(n.doc,n.selection.anchor)))),Hc(r)}function qc(e,t,n){const r=Math.max(0,Math.min(e,n.content.size));return{from:r,to:Math.max(r,Math.min(t,n.content.size))}}function Uc({decorations:e,ranges:t,editor:n,options:r,dataAttribute:s,doc:i,selection:o}){let a=e;for(const l of t){const{from:c,to:u}=qc(l.from,l.to,i),d=a.find(c,u).filter(p=>p.from>=c&&p.to<=u);d.length&&(a=a.remove(d));const h=qs({editor:n,options:r,dataAttribute:s,doc:i,selection:o,from:c,to:u});h.length&&(a=a.add(i,h))}return a}function Fc({editor:e,options:t,dataAttribute:n}){return{init(r,s){const i=Us({editor:e,options:t,dataAttribute:n,doc:s.doc,selection:s.selection});return i??ae.empty},apply(r,s,i,o){return!r.docChanged&&!r.selectionSet?s:Uc({decorations:s.map(r.mapping,r.doc),ranges:jc(r,i,o),editor:e,options:t,dataAttribute:n,doc:o.doc,selection:o.selection})}}}function Wc(e){return e.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function Kc({editor:e,options:t}){const n=t.dataAttribute?`data-${Wc(t.dataAttribute)}`:`data-${Hs}`,r=t.showOnlyCurrent&&!t.includeChildren;return new B({key:Sr,...r?{}:{state:Fc({editor:e,options:t,dataAttribute:n})},props:{decorations:r?({doc:s,selection:i})=>Us({editor:e,options:t,dataAttribute:n,doc:s,selection:i}):s=>{var i;return t.showOnlyWhenEditable&&!e.isEditable?ae.empty:(i=Sr.getState(s))!==null&&i!==void 0?i:ae.empty}}})}H.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:Hs,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[Kc({editor:this.editor,options:this.options})]}});function wn(e,t){return!e.selection.empty&&!$r(e.selection)&&t.isEditable}function Gc(e,t){return wn(e,t)&&!t.isFocused&&!t.view.dragging}function Vc(){var e;(e=window.getSelection())===null||e===void 0||e.removeAllRanges()}function Qc(e){e.focus()}H.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:e,options:t}=this;return[new B({key:new Z("selection"),props:{decorations(n){return Gc(n,e)?ae.create(n.doc,[jt.inline(n.selection.from,n.selection.to,{class:t.className})]):null},handleDOMEvents:{blur(n){return wn(n.state,e)&&Vc(),!1},focus(n){return wn(n.state,e)&&requestAnimationFrame(()=>{!e.isDestroyed&&n.hasFocus()&&Qc(n)}),!1}}}})]}});function Mr({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(t==null?void 0:t.type)===e}const Xc=H.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var e;const t=new Z(this.name),n=this.options.node||((e=this.editor.schema.topNodeType.contentMatch.defaultType)===null||e===void 0?void 0:e.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,s])=>s).filter(s=>(this.options.notAfter||[]).concat(n).includes(s.name));return[new B({key:t,appendTransaction:(s,i,o)=>{const{doc:a,tr:l,schema:c}=o,u=t.getState(o),d=a.content.size,h=c.nodes[n];if(!s.some(p=>p.getMeta("skipTrailingNode"))&&u)return l.insert(d,h.create())},state:{init:(s,i)=>{const o=i.tr.doc.lastChild;return!Mr({node:o,types:r})},apply:(s,i)=>{if(!s.docChanged||s.getMeta("__uniqueIDTransaction"))return i;const o=s.doc.lastChild;return!Mr({node:o,types:r})}}})]}}),Zc=H.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>wi(e,t),redo:()=>({state:e,dispatch:t})=>xi(e,t)}},addProseMirrorPlugins(){return[bi(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()}}}),Yc=H.create({name:"starterKit",addExtensions(){const e=[];if(this.options.bold!==!1&&e.push(Wa.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(Ba.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(Ss.configure(this.options.bulletList)),this.options.code!==!1&&e.push(Qa.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(Ya.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(Ja.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(Nc.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(Dc.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(el.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(tl.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(Zc.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(nl.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(al.configure(this.options.italic)),this.options.listItem!==!1&&e.push(_s.configure(this.options.listItem)),this.options.listKeymap!==!1){var t;e.push(Ps.configure((t=this.options)===null||t===void 0?void 0:t.listKeymap))}if(this.options.link!==!1){var n;e.push(jl.configure((n=this.options)===null||n===void 0?void 0:n.link))}if(this.options.orderedList!==!1&&e.push(Ds.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(wc.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(Ec.configure(this.options.strike)),this.options.text!==!1&&e.push(Ac.configure(this.options.text)),this.options.underline!==!1){var r;e.push(Lc.configure((r=this.options)===null||r===void 0?void 0:r.underline))}if(this.options.trailingNode!==!1){var s;e.push(Xc.configure((s=this.options)===null||s===void 0?void 0:s.trailingNode))}return e}});var Jc=Yc;const eu=3,fe="link",tu="Link",nu="Link address",ru="https://",su="Apply",iu="Remove link",ou="Code link",au=" ",lu=[{name:"bold",label:"Bold",icon:Ai,toggle:e=>{e.chain().focus().toggleBold().run()}},{name:"italic",label:"Italic",icon:Mi,toggle:e=>{e.chain().focus().toggleItalic().run()}},{name:"code",label:"Code",icon:Li,toggle:e=>{e.chain().focus().toggleCode().run()}},{name:"heading",label:"Heading",icon:Si,toggle:e=>{e.chain().focus().toggleHeading({level:eu}).run()}},{name:"bulletList",label:"Bulleted list",icon:$i,toggle:e=>{e.chain().focus().toggleBulletList().run()}},{name:"orderedList",label:"Numbered list",icon:Ii,toggle:e=>{e.chain().focus().toggleOrderedList().run()}},{name:"blockquote",label:"Quote",icon:Oi,toggle:e=>{e.chain().focus().toggleBlockquote().run()}},{name:"codeBlock",label:"Code block",icon:_i,toggle:e=>{e.chain().focus().toggleCodeBlock().run()}}],cu=[Jc.configure({strike:!1,underline:!1,horizontalRule:!1,link:{openOnClick:!1,autolink:!1}}),vi,No],uu=Dr("flex min-h-32 flex-col gap-4 px-3 py-2.5 text-base leading-[1.7] text-pretty outline-none","[&_:is(h1,h2,h3,h4,h5,h6)]:text-[1.1875rem] [&_:is(h1,h2,h3,h4,h5,h6)]:leading-7 [&_:is(h1,h2,h3,h4,h5,h6)]:font-semibold [&_:is(h1,h2,h3,h4,h5,h6)]:tracking-[-0.01em]","[&_ol]:flex [&_ol]:list-decimal [&_ol]:flex-col [&_ol]:gap-2 [&_ol]:pl-5 [&_ul]:flex [&_ul]:list-disc [&_ul]:flex-col [&_ul]:gap-2 [&_ul]:pl-5","[&_ol_ol]:mt-2 [&_ol_ul]:mt-2 [&_ul_ol]:mt-2 [&_ul_ul]:mt-2","[&_code]:rounded-sm [&_code]:bg-muted [&_code]:px-1.5 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[0.875em] [&_strong]:font-bold","[&_a]:underline [&_a]:decoration-1 [&_a]:underline-offset-[0.3em]","[&_blockquote]:flex [&_blockquote]:flex-col [&_blockquote]:gap-4 [&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-4 [&_blockquote]:text-muted-foreground","[&_pre]:overflow-x-auto [&_pre]:rounded-md [&_pre]:bg-code [&_pre]:px-4 [&_pre]:py-3 [&_pre]:font-mono [&_pre]:text-sm [&_pre]:leading-6 [&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_pre_code]:text-[1em]","[&_.ProseMirror-selectednode]:outline-2 [&_.ProseMirror-selectednode]:outline-ring"),du="rounded-lg border border-input bg-card focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/40 aria-invalid:border-destructive",hu="flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring aria-pressed:bg-foreground aria-pressed:text-background",pu=e=>({bold:e.isActive("bold"),italic:e.isActive("italic"),code:e.isActive("code"),heading:e.isActive("heading"),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote"),codeBlock:e.isActive("codeBlock"),link:e.isActive(fe)}),fu=e=>{const{href:t}=e.getAttributes(fe);return typeof t=="string"?t:""},gu=e=>{const{from:t,to:n}=e.state.selection;return e.state.doc.textBetween(t,n,au)},mu=(e,t)=>{if(e.state.selection.empty&&!e.isActive(fe)){e.chain().focus().insertContent({type:"text",text:t,marks:[{type:fe,attrs:{href:t}}]}).run();return}e.chain().focus().extendMarkRange(fe).setLink({href:t}).run()},ku=e=>{e.chain().focus().extendMarkRange(fe).unsetLink().run()},yu=(e,t)=>{e.chain().focus().insertContent({type:Ei,attrs:t}).run()},on=e=>M.jsx("button",{type:"button","aria-label":e.label,title:e.label,"aria-pressed":e.isPressed,className:hu,onMouseDown:t=>{t.preventDefault()},onClick:e.onClick,children:M.jsx(e.icon,{"aria-hidden":"true",className:"size-4"})}),bu=({address:e,canRemove:t,onApply:n,onRemove:r})=>{const[s,i]=O.useState(e),o=s.trim();return M.jsxs("div",{className:"flex items-center gap-2 border-b border-input px-2 py-1.5",children:[M.jsx(Ti,{type:"url",value:s,placeholder:ru,"aria-label":nu,className:"h-7 flex-1",onChange:a=>{i(a.target.value)},onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),o!==""&&n(o))}}),t?M.jsx(Xn,{type:"button",variant:"ghost",size:"sm",onClick:r,children:iu}):null,M.jsx(Xn,{type:"button",size:"sm",disabled:o==="",onClick:()=>{n(o)},children:su})]})},xu=({editor:e,label:t,isLinking:n,canLinkCode:r,onToggleLinking:s,onLinkCode:i})=>{const o=os({editor:e,selector:a=>pu(a.editor)});return M.jsxs("div",{role:"toolbar","aria-label":t,className:"flex flex-wrap items-center gap-1 border-b border-input px-2 py-1.5",children:[lu.map(a=>M.jsx(on,{label:a.label,icon:a.icon,isPressed:o[a.name],onClick:()=>{a.toggle(e)}},a.name)),M.jsx(on,{label:tu,icon:Ri,isPressed:o.link||n,onClick:s}),r?M.jsx(on,{label:ou,icon:Ci,isPressed:!1,onClick:i}):null]})},Tu=({label:e,value:t,errorMessage:n,className:r,shouldFocus:s=!1,renderCodeLinkDialog:i,onChange:o})=>{const a=O.useId(),[l,c]=O.useState(!1),[u,d]=O.useState(!1),h=n!==null,p=_a({extensions:cu,content:t,contentType:"markdown",autofocus:s,editorProps:{attributes:{role:"textbox","aria-multiline":"true","aria-label":e,class:uu}},onUpdate:({editor:m})=>{o(m.getMarkdown())}});return M.jsxs("div",{className:Dr("grid gap-1.5",r),children:[M.jsxs("div",{"aria-invalid":h,className:du,children:[M.jsx(xu,{editor:p,label:`${e} formatting`,isLinking:l,canLinkCode:i!==void 0,onToggleLinking:()=>{c(m=>!m)},onLinkCode:()=>{d(!0)}}),l?M.jsx(bu,{address:fu(p),canRemove:p.isActive(fe),onApply:m=>{mu(p,m),c(!1)},onRemove:()=>{ku(p),c(!1)}}):null,M.jsx(is,{editor:p,"aria-describedby":h?a:void 0})]}),h?M.jsx("p",{id:a,role:"alert",className:"text-sm text-destructive",children:n}):null,u&&i!==void 0?i({selectedText:gu(p),onInsert:m=>{yu(p,m),d(!1)},onClose:()=>{d(!1)}}):null]})};export{Tu as T};
|
|
161
|
+
`).trim();if(u){const p=n.blockTokens(u);c.push(...p)}let d=s+1;const h=[];for(;d<e.length&&e[d].indent>t;)h.push(e[d]),d+=1;if(h.length>0){const p=bi(h,Math.min(...h.map(g=>g.indent)),n);c.push({type:"list",ordered:!0,start:h[0].number,typeMarker:h[0].type,items:p,raw:h.map(g=>g.raw).join(`
|
|
162
|
+
`)})}r.push({type:"list_item",raw:i.raw,tokens:c}),s=d}else s+=1}return r}function Tu(e,t){return e.map(n=>{if(n.type!=="list_item")return t.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(s=>{if(s.type==="paragraph"||s.type==="list"||s.type==="blockquote"||s.type==="code")r.push(...t.parseChildren([s]));else if(s.type==="text"&&s.tokens){const i=t.parseChildren([s]);r.push({type:"paragraph",content:i})}else{const i=t.parseChildren([s]);i.length>0&&r.push(...i)}}),{type:"listItem",content:r}})}const Eu=64;function qr(e,t){const n=[];let r=0;for(;n.length<t;){const s=e.indexOf(`
|
|
163
|
+
`,r);if(s===-1)return n.push(e.slice(r)),n;n.push(e.slice(r,s)),r=s+1}return n}function Au(e){const t=e.indexOf(`
|
|
164
|
+
`),n=t===-1?e:e.slice(0,t);if(!Qt.test(n))return[[],0,[]];let r=Eu,s=qr(e,r),i=jr(s);for(;i[1]===s.length&&s.length===r;)r*=2,s=qr(e,r),i=jr(s);return[i[0],i[1],s]}const Su="listItem",Ur="textStyle",Fr=/^(\d+)\.\s$/;function Wr(e){const t=e.match(/list-style-type\s*:\s*([^;]+)/i);if(!t)return null;switch(t[1].trim().toLowerCase()){case"upper-roman":return"I";case"lower-roman":return"i";case"upper-alpha":case"upper-latin":return"A";case"lower-alpha":case"lower-latin":return"a";default:return null}}const xi=D.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>{const t=e.getAttribute("type");if(t)return t;const n=e.getAttribute("style");if(n){const s=Wr(n);if(s)return s}const r=e.querySelector("li");if(r){const s=r.getAttribute("style");if(s){const i=Wr(s);if(i)return i}}return null}}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,type:n,...r}=e,s=P(this.options.HTMLAttributes,r);return t!==1&&(s.start=t),n&&n!=="1"&&(s.type=n),["ol",s,0]},markdownTokenName:"list",parseMarkdown:(e,t)=>{if(e.type!=="list"||!e.ordered)return[];const n=e.start||1,r=e.typeMarker,s=e.items?Tu(e.items,t):[],i={};return n!==1&&(i.start=n),r&&(i.type=r),Object.keys(i).length>0?{type:"orderedList",attrs:i,content:s}:{type:"orderedList",content:s}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
165
|
+
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:()=>-1,tokenize:(e,t,n)=>{var r,s;const[i,o,a]=Au(e);if(i.length===0)return;const l=bi(i,i[0].indent,n);if(l.length!==0)return{type:"list",ordered:!0,start:((r=i[0])===null||r===void 0?void 0:r.number)||1,typeMarker:(s=i[0])===null||s===void 0?void 0:s.type,items:l,raw:a.slice(0,o).join(`
|
|
166
|
+
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Su,this.editor.getAttributes(Ur)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new B({props:{handlePaste:(e,t)=>{var n,r;const s=(n=t.clipboardData)===null||n===void 0?void 0:n.getData("text/html");if(s!=null&&s.trim())return!1;const i=(r=t.clipboardData)===null||r===void 0?void 0:r.getData("text/plain");if(!i)return!1;const o=vu(i);if(!o)return!1;try{const a=e.state.schema.nodeFromJSON(o),l=e.state.tr.replaceSelectionWith(a);return e.dispatch(l),!0}catch{return!1}}}})]},addInputRules(){const e=(n,r)=>(!r.attrs.type||r.attrs.type==="1")&&r.childCount+r.attrs.start===+n[1];let t=Le({find:Fr,type:this.type,getAttributes:n=>({start:+n[1]}),joinPredicate:e});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Le({find:Fr,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:n=>({start:+n[1],...this.editor.getAttributes(Ur)}),joinPredicate:e,editor:this.editor})),[t]}}),Cu=/^\s*(\[([( |x])?\])\s$/,Lu="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",Mu=(e,t,n)=>{var r;return(n==null||(r=n.checkboxLabel)===null||r===void 0?void 0:r.call(n,e,t))||`Task item checkbox for ${e.textContent||"empty task item"}`},Ru=D.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{const t=e.getAttribute("data-checked");return t===""||t==="true"},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:e=>{var t;return(t=e.querySelector("div"))!==null&&t!==void 0?t:e}}]},renderHTML({node:e,HTMLAttributes:t}){return["li",P(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(e,t)=>{const 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){const r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode("taskItem",{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>{var n;const r=`- [${!((n=e.attrs)===null||n===void 0)&&n.checked?"x":" "}] `;return ls(e,t,r)},addExtensions(){return this.options.nested?[hi(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){const 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})=>{const s=document.createElement("li"),i=document.createElement("label"),o=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div");o.style.cssText=Lu;const c=d=>{const h=Mu(d,d.attrs.checked,this.options.a11y);a.setAttribute("aria-label",h),o.textContent=h};c(e),i.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",d=>d.preventDefault()),a.addEventListener("change",d=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:h}=d.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{const g=n();if(typeof g!="number")return!1;const m=p.doc.nodeAt(g);return p.setNodeMarkup(g,void 0,{...m==null?void 0:m.attrs,checked:h}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,h)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,h])=>{s.setAttribute(d,h)}),s.dataset.checked=e.attrs.checked,a.checked=e.attrs.checked,i.append(a,o),s.append(i,l),Object.entries(t).forEach(([d,h])=>{s.setAttribute(d,h)});let u=new Set(Object.keys(t));return{dom:s,contentDOM:l,update:d=>{if(d.type!==this.type)return!1;s.dataset.checked=d.attrs.checked,a.checked=d.attrs.checked,c(d);const h=r.extensionManager.attributes,p=ss(d,h),g=new Set(Object.keys(p)),m=this.options.HTMLAttributes;return u.forEach(f=>{g.has(f)||(f in m?s.setAttribute(f,m[f]):s.removeAttribute(f))}),Object.entries(p).forEach(([f,y])=>{y==null?f in m?s.setAttribute(f,m[f]):s.removeAttribute(f):s.setAttribute(f,y)}),u=g,!0}}}},addInputRules(){return[Le({find:Cu,type:this.type,getAttributes:e=>({checked:e[e.length-1]==="x"})})]}}),Iu=D.create({name:"taskList",addOptions(){return{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",P(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,`
|
|
167
|
+
`):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;const n=(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))===null||t===void 0?void 0:t.index;return n!==void 0?n:-1},tokenize(e,t,n){const r=i=>{const o=ur(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,l)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:n.inlineTokens(a.mainContent),nestedTokens:l}),customNestedParser:r},n);if(o){const a={type:"taskList",raw:o.raw,items:o.items},l=i.slice(o.raw.length);return l.trim()?[a,...n.blockTokens(l)]:[a]}return n.blockTokens(i)},s=ur(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()==="x"}),createToken:(i,o)=>({type:"taskItem",raw:"",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:n.inlineTokens(i.mainContent),nestedTokens:o}),customNestedParser:r},n);if(s)return{type:"taskList",raw:s.raw,items:s.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()}}});j.create({name:"listKit",addExtensions(){const e=[];return this.options.bulletList!==!1&&e.push(di.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(gi.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(yi.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(xi.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(Ru.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(Iu.configure(this.options.taskList)),e}});const dt=" ",fn=" ",Nu=D.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",P(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{const n=e.tokens||[];if(n.length===1&&n[0].type==="image")return t.parseChildren([n[0]]);const r=t.parseInline(n);return n.length===1&&n[0].type==="text"&&(n[0].raw===dt||n[0].text===dt||n[0].raw===fn||n[0].text===fn)&&r.length===1&&r[0].type==="text"&&(r[0].text===dt||r[0].text===fn)?t.createNode("paragraph",void 0,[]):t.createNode("paragraph",void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return"";const r=Array.isArray(e.content)?e.content:[];if(r.length===0){var s,i;const o=Array.isArray(n==null||(s=n.previousNode)===null||s===void 0?void 0:s.content)?n.previousNode.content:[];return(n==null||(i=n.previousNode)===null||i===void 0?void 0:i.type)==="paragraph"&&o.length===0?dt:""}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Ou=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,_u=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,$u=Re.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",P(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[be({find:Ou,type:this.type})]},addPasteRules(){return[ce({find:_u,type:this.type})]}}),Pu=D.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),Du=Re.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["u",P(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:"underline",level:"inline",start(e){return e.indexOf("++")},tokenize(e,t,n){const r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;const s=r[2].trim();return{type:"underline",raw:r[0],text:s,tokens:n.inlineTokens(s)}}},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()}}});function zu(e={}){return new B({view(t){return new Hu(t,e)}})}class Hu{constructor(t,n){var r;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(s=>{let i=o=>{this[s](o)};return t.dom.addEventListener(s,i),{name:s,handler:i}})}destroy(){this.setCursor(null),this.handlers.forEach(({name:t,handler:n})=>this.editorView.dom.removeEventListener(t,n))}update(t,n){if(this.cursorPos!=null&&n.doc!=t.state.doc)if(this.lastDragEvent){let r=this.computeTarget(this.lastDragEvent);r==this.cursorPos?this.updateOverlay():this.setCursor(r)}else this.updateOverlay()}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r,s=this.editorView.dom,i=s.getBoundingClientRect(),o=i.width/s.offsetWidth,a=i.height/s.offsetHeight;if(n){let d=t.nodeBefore,h=t.nodeAfter;if(d||h){let p=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(p){let g=p.getBoundingClientRect(),m=d?g.bottom:g.top;d&&h&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let f=this.width/2*a;r={left:g.left,right:g.right,top:m-f,bottom:m+f}}}}if(!r){let d=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*o;r={left:d.left-h,right:d.left+h,top:d.top,bottom:d.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.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",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let c,u;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,u=-pageYOffset;else{let d=l.getBoundingClientRect(),h=d.width/l.offsetWidth,p=d.height/l.offsetHeight;c=d.left-l.scrollLeft*h,u=d.top-l.scrollTop*p}this.element.style.left=(r.left-c)/o+"px",this.element.style.top=(r.top-u)/a+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/a+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}computeTarget(t){let n=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),s=r&&r.type.spec.disableDropCursor,i=typeof s=="function"?s(this.editorView,n,t):s;if(!n||i)return null;let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=xo(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}return o}dragover(t){if(!this.editorView.editable)return;this.lastDragEvent=t;let n=this.computeTarget(t);n!=null&&(this.setCursor(n),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}class O extends Ze{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return O.valid(r)?new O(r):Ze.near(r)}content(){return In.empty}eq(t){return t instanceof O&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new O(t.resolve(n.pos))}getBookmark(){return new rr(this.anchor)}static valid(t){let n=t.parent;if(n.inlineContent||!Bu(t)||!ju(t))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let s=n.contentMatchAt(t.index()).defaultType;return s&&s.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&O.valid(t))return t;let s=t.pos,i=null;for(let o=t.depth;;o--){let a=t.node(o);if(n>0?t.indexAfter(o)<a.childCount:t.index(o)>0){i=a.child(n>0?t.indexAfter(o):t.index(o)-1);break}else if(o==0)return null;s+=n;let l=t.doc.resolve(s);if(O.valid(l))return l}for(;;){let o=n>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!Nn.isSelectable(i)){t=t.doc.resolve(s+i.nodeSize*n),r=!1;continue e}break}i=o,s+=n;let a=t.doc.resolve(s);if(O.valid(a))return a}return null}}}O.prototype.visible=!1;O.findFrom=O.findGapCursorFrom;Ze.jsonID("gapcursor",O);class rr{constructor(t){this.pos=t}map(t){return new rr(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return O.valid(n)?new O(n):Ze.near(n)}}function wi(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function Bu(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(n-1);;s=s.lastChild){if(s.childCount==0&&!s.inlineContent||wi(s.type))return!0;if(s.inlineContent)return!1}}return!0}function ju(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 s=r.child(n);;s=s.firstChild){if(s.childCount==0&&!s.inlineContent||wi(s.type))return!0;if(s.inlineContent)return!1}}return!0}function qu(){return new B({props:{decorations:Ku,createSelectionBetween(e,t,n){return t.pos==n.pos&&O.valid(n)?new O(n):null},handleClick:Fu,handleKeyDown:Uu,handleDOMEvents:{beforeinput:Wu}}})}const Uu=wo({ArrowLeft:ht("horiz",-1),ArrowRight:ht("horiz",1),ArrowUp:ht("vert",-1),ArrowDown:ht("vert",1)});function ht(e,t){const n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(r,s,i){let o=r.selection,a=t>0?o.$to:o.$from,l=o.empty;if(o instanceof se){if(!i.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(t>0?a.after():a.before())}let c=O.findGapCursorFrom(a,t,l);return c?(s&&s(r.tr.setSelection(new O(c))),!0):!1}}function Fu(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!O.valid(r))return!1;let s=e.posAtCoords({left:n.clientX,top:n.clientY});return s&&s.inside>-1&&Nn.isSelectable(e.state.doc.nodeAt(s.inside))?!1:(e.dispatch(e.state.tr.setSelection(new O(r))),!0)}function Wu(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof O))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 s=Ye.empty;for(let o=r.length-1;o>=0;o--)s=Ye.from(r[o].createAndFill(null,s));let i=e.state.tr.replace(n.pos,n.pos,new In(s,0,0));return i.setSelection(se.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function Ku(e){if(!(e.selection instanceof O))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",ie.create(e.doc,[nt.widget(e.selection.head,t,{key:"gapcursor"})])}j.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(t=>t!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{const t=(e==null?void 0:e.node)||this.editor.state.doc;if(((e==null?void 0:e.mode)||this.options.mode)==="textSize"){const n=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(n)}return t.nodeSize},this.storage.words=e=>{const t=(e==null?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 B({key:new G("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;const s=this.options.limit,i=this.options.autoTrim;if(s==null||s===0||i===!1){e=!0;return}const o=this.storage.characters({node:r.doc});if(o>s){const a=o-s,l=0,c=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${s} characters. Content was automatically trimmed.`);const u=r.tr.deleteRange(l,c);return e=!0,u}e=!0},filterTransaction:(t,n)=>{const r=this.options.limit;if(!t.docChanged||r===0||r===null||r===void 0)return!0;const s=this.storage.characters({node:n.doc}),i=this.storage.characters({node:t.doc});if(i<=r||s>r&&i>r&&i<=s)return!0;if(s>r&&i>r&&i>s||!t.getMeta("paste"))return!1;const o=t.selection.$head.pos,a=o-(i-r),l=o;return t.deleteRange(a,l),!(this.storage.characters({node:t.doc})>r)}})]}});const Vu=j.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[zu(this.options)]}});j.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new B({key:new G("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:s}=t,i=[];if(!n||!r)return ie.create(e,[]);let o=0;this.options.mode==="deepest"&&e.descendants((l,c)=>{if(!l.isText){if(!(s>=c&&s<=c+l.nodeSize-1))return!1;o+=1}});let a=0;return e.descendants((l,c)=>{if(l.isText||!(s>=c&&s<=c+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&o-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";i.push(nt.node(c,c+l.nodeSize,{class:this.options.className}))}),ie.create(e,i)}}})]}});const Gu=j.create({name:"gapCursor",addProseMirrorPlugins(){return[qu()]},extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=ns(pe(e,"allowGapCursor",n)))!==null&&t!==void 0?t:null}}}),vi="placeholder",Kr=new G("tiptap__placeholder");function Ti(e){const{editor:t,placeholder:n,dataAttribute:r,pos:s,node:i,isEmptyDoc:o,hasAnchor:a,classes:{emptyNode:l,emptyEditor:c}}=e,u=[l];return o&&u.push(c),nt.node(s,s+i.nodeSize,{class:u.join(" "),[r]:typeof n=="function"?n({editor:t,node:i,pos:s,hasAnchor:a}):n})}function Ei(e,t){return typeof e=="function"?e(t):e}function Ai({editor:e,options:t,dataAttribute:n,doc:r,selection:s,from:i,to:o}){const{anchor:a}=s,l=[],c=e.isEmpty;return r.nodesBetween(i,o,(u,d)=>{const h=a>=d&&a<=d+u.nodeSize,p=!u.isLeaf&&cs(u);return u.type.isTextblock&&(h||!t.showOnlyCurrent)&&p&&l.push(Ti({editor:e,isEmptyDoc:c,dataAttribute:n,hasAnchor:h,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:Ei(t.emptyNodeClass,{editor:e,node:u,pos:d,hasAnchor:h})},node:u,pos:d})),t.includeChildren}),l}function Si({editor:e,options:t,dataAttribute:n,doc:r,selection:s}){if(!(e.isEditable||!t.showOnlyWhenEditable))return null;const{anchor:i}=s,o=[],a=e.isEmpty;if(t.showOnlyCurrent&&!t.includeChildren){const l=r.resolve(i),c=l.depth>0?l.node(1):l.nodeAfter,u=l.depth>0?l.before(1):i;if(c&&c.type.isTextblock&&cs(c)){const d=i>=u&&i<=u+c.nodeSize;o.push(Ti({editor:e,isEmptyDoc:a,dataAttribute:n,hasAnchor:d,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:Ei(t.emptyNodeClass,{editor:e,node:c,pos:u,hasAnchor:d})},node:c,pos:u}))}}else o.push(...Ai({editor:e,options:t,dataAttribute:n,doc:r,selection:s,from:0,to:r.content.size}));return ie.create(r,o)}function Ve(e,t){const n=e.resolve(t);if(n.depth===0){var r;const i=(r=n.nodeAfter)!==null&&r!==void 0?r:n.nodeBefore;if(!i)return{from:t,to:t};const o=n.nodeAfter?t:t-i.nodeSize;return{from:o,to:o+i.nodeSize}}const s=n.before(1);return{from:s,to:s+n.node(1).nodeSize}}function Ge(e,t){return{from:Math.max(0,t.from-1),to:Math.min(e.content.size,t.to-1)}}function Qu(e,t,n){const r=[];return e.forEach((s,i)=>{const o=i,a=o+s.nodeSize,l=o+1,c=a+1;l<n&&c>t&&r.push({from:o,to:a})}),r}function Xu(e){if(e.length===0)return[];const t=[...e].sort((r,s)=>r.from-s.from),n=[{...t[0]}];for(let r=1;r<t.length;r+=1){const s=n[n.length-1],i=t[r];i.from<=s.to?s.to=Math.max(s.to,i.to):n.push({...i})}return n}function Zu(e,t){const n=Qu(e,t.from,t.to);return n.push(Ge(e,Ve(e,t.from))),t.to>t.from?n.push(Ge(e,Ve(e,Math.min(t.to,e.content.size+1)-1))):t.from<e.content.size+1&&n.push(Ge(e,Ve(e,Math.min(t.from+1,e.content.size)))),n}function Yu(e,t,n){const r=[];if(e.docChanged){const s=os(e);for(const i of s)r.push(...Zu(n.doc,i.newRange))}return e.selectionSet&&(r.push(Ge(n.doc,Ve(n.doc,e.mapping.map(t.selection.anchor)))),r.push(Ge(n.doc,Ve(n.doc,n.selection.anchor)))),Xu(r)}function Ju(e,t,n){const r=Math.max(0,Math.min(e,n.content.size));return{from:r,to:Math.max(r,Math.min(t,n.content.size))}}function ed({decorations:e,ranges:t,editor:n,options:r,dataAttribute:s,doc:i,selection:o}){let a=e;for(const l of t){const{from:c,to:u}=Ju(l.from,l.to,i),d=a.find(c,u).filter(p=>p.from>=c&&p.to<=u);d.length&&(a=a.remove(d));const h=Ai({editor:n,options:r,dataAttribute:s,doc:i,selection:o,from:c,to:u});h.length&&(a=a.add(i,h))}return a}function td({editor:e,options:t,dataAttribute:n}){return{init(r,s){const i=Si({editor:e,options:t,dataAttribute:n,doc:s.doc,selection:s.selection});return i??ie.empty},apply(r,s,i,o){return!r.docChanged&&!r.selectionSet?s:ed({decorations:s.map(r.mapping,r.doc),ranges:Yu(r,i,o),editor:e,options:t,dataAttribute:n,doc:o.doc,selection:o.selection})}}}function nd(e){return e.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function rd({editor:e,options:t}){const n=t.dataAttribute?`data-${nd(t.dataAttribute)}`:`data-${vi}`,r=t.showOnlyCurrent&&!t.includeChildren;return new B({key:Kr,...r?{}:{state:td({editor:e,options:t,dataAttribute:n})},props:{decorations:r?({doc:s,selection:i})=>Si({editor:e,options:t,dataAttribute:n,doc:s,selection:i}):s=>{var i;return t.showOnlyWhenEditable&&!e.isEditable?ie.empty:(i=Kr.getState(s))!==null&&i!==void 0?i:ie.empty}}})}j.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:vi,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[rd({editor:this.editor,options:this.options})]}});function Mn(e,t){return!e.selection.empty&&!is(e.selection)&&t.isEditable}function sd(e,t){return Mn(e,t)&&!t.isFocused&&!t.view.dragging}function id(){var e;(e=window.getSelection())===null||e===void 0||e.removeAllRanges()}function od(e){e.focus()}j.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:e,options:t}=this;return[new B({key:new G("selection"),props:{decorations(n){return sd(n,e)?ie.create(n.doc,[nt.inline(n.selection.from,n.selection.to,{class:t.className})]):null},handleDOMEvents:{blur(n){return Mn(n.state,e)&&id(),!1},focus(n){return Mn(n.state,e)&&requestAnimationFrame(()=>{!e.isDestroyed&&n.hasFocus()&&od(n)}),!1}}}})]}});function Vr({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(t==null?void 0:t.type)===e}const ad=j.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var e;const t=new G(this.name),n=this.options.node||((e=this.editor.schema.topNodeType.contentMatch.defaultType)===null||e===void 0?void 0:e.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,s])=>s).filter(s=>(this.options.notAfter||[]).concat(n).includes(s.name));return[new B({key:t,appendTransaction:(s,i,o)=>{const{doc:a,tr:l,schema:c}=o,u=t.getState(o),d=a.content.size,h=c.nodes[n];if(!s.some(p=>p.getMeta("skipTrailingNode"))&&u)return l.insert(d,h.create())},state:{init:(s,i)=>{const o=i.tr.doc.lastChild;return!Vr({node:o,types:r})},apply:(s,i)=>{if(!s.docChanged||s.getMeta("__uniqueIDTransaction"))return i;const o=s.doc.lastChild;return!Vr({node:o,types:r})}}})]}}),ld=j.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>Eo(e,t),redo:()=>({state:e,dispatch:t})=>To(e,t)}},addProseMirrorPlugins(){return[vo(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()}}}),cd=j.create({name:"starterKit",addExtensions(){const e=[];if(this.options.bold!==!1&&e.push(nc.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(Zl.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(di.configure(this.options.bulletList)),this.options.code!==!1&&e.push(oc.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(cc.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(uc.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(Vu.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(Gu.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(dc.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(hc.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(ld.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(pc.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(yc.configure(this.options.italic)),this.options.listItem!==!1&&e.push(gi.configure(this.options.listItem)),this.options.listKeymap!==!1){var t;e.push(yi.configure((t=this.options)===null||t===void 0?void 0:t.listKeymap))}if(this.options.link!==!1){var n;e.push(Yc.configure((n=this.options)===null||n===void 0?void 0:n.link))}if(this.options.orderedList!==!1&&e.push(xi.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(Nu.configure(this.options.paragraph)),this.options.strike!==!1&&e.push($u.configure(this.options.strike)),this.options.text!==!1&&e.push(Pu.configure(this.options.text)),this.options.underline!==!1){var r;e.push(Du.configure((r=this.options)===null||r===void 0?void 0:r.underline))}if(this.options.trailingNode!==!1){var s;e.push(ad.configure((s=this.options)===null||s===void 0?void 0:s.trailingNode))}return e}});var ud=cd;const V={name:"tabs",itemName:"tab",newItemLabel:"New tab"},le={name:"accordion",itemName:"section",newItemLabel:"New section"},Me={},dd=3,ue=e=>Array.from({length:e.childCount},(t,n)=>e.child(n)),Ci=e=>typeof e.attrs.label=="string"?e.attrs.label:"",nn=(e,t,n)=>e.type.create({...e.attrs,...n},t),Li=(e,t,n=Me)=>{const{nodes:r}=e.type.schema;return r[t.itemName].create({label:t.newItemLabel,...n},r.paragraph.create())},Mi=(e,t,n=Me)=>nn(e,[...ue(e),t],n),Ri=(e,t,n,r=Me,s=Me)=>{const i=n.trim(),o=ue(e).map((a,l)=>l===t?a.type.create({...a.attrs,...r,...i===""?{}:{label:i}},a.content):a);return nn(e,o,s)},Ii=(e,t,n=Me)=>{const r=ue(e).filter((s,i)=>i!==t);return r.length===0?null:nn(e,r,n)},Ni=(e,t,n,r=Me)=>{const s=ue(e);if(n<0||n>=s.length||t===n)return e;const i=s.filter((o,a)=>a!==t);return nn(e,[...i.slice(0,n),s[t],...i.slice(n)],r)},Oi=e=>{const{schema:t}=e.type;return ue(e).flatMap(n=>[t.nodes.heading.create({level:dd},t.text(Ci(n))),...ue(n)])},_i="data-accordion-controls",hd="Add a section",pd="Remove accordion",fd=({node:e,getPos:t,editor:n})=>{const r=s=>{const i=t();typeof i=="number"&&n.view.dispatch(n.state.tr.replaceWith(i,i+e.nodeSize,s))};return w.jsxs(Un,{className:"flex flex-col border-y border-border",children:[w.jsx(qn,{className:"flex flex-col divide-y divide-border"}),w.jsxs("div",{[_i]:"",contentEditable:!1,className:"flex items-center gap-2 border-t border-border py-2",children:[w.jsxs(Je,{type:"button",variant:"ghost",size:"sm",onClick:()=>{r(Mi(e,Li(e,le,{isNaming:!0})))},children:[w.jsx(us,{"aria-hidden":"true"}),hd]}),w.jsx(Je,{type:"button",variant:"ghost",size:"sm",onClick:()=>{r(Oi(e))},children:pd})]})]})},md={openLine:":::tabs",itemPrefix:"::tab ",startPattern:/^:::tabs[ \t]*$/m,itemPattern:/^::tab[ \t]+(\S.*?)$/},gd={openLine:":::accordion",itemPrefix:"::section ",startPattern:/^:::accordion[ \t]*$/m,itemPattern:/^::section[ \t]+(\S.*?)$/},$i=":::",Qe=`
|
|
168
|
+
`,Pi=(e,t)=>{var n;return((n=e.itemPattern.exec(t))==null?void 0:n[1])??null},kd=(e,t,n)=>n.map((r,s)=>({label:Pi(e,t[r])??"",body:t.slice(r+1,n.at(s+1)??t.length).join(Qe).trim()})),yd=(e,t)=>{const n=e.split(Qe),r=n.map(c=>c.trimEnd());if(r[0]!==t.openLine)return null;const s=r.findIndex((c,u)=>u>0&&c===$i);if(s<0)return null;const i=r.slice(1,s),o=i.findIndex(c=>c!==""),a=i.flatMap((c,u)=>Pi(t,c)===null?[]:[u]);if(o<0||a.at(0)!==o)return null;const l=n.length>s+1;return{raw:`${n.slice(0,s+1).join(Qe)}${l?Qe:""}`,items:kd(t,i,a)}},bd=(e,t)=>[t.openLine,...e.flatMap(({label:n,body:r})=>[`${t.itemPrefix}${n}`,...r===""?[]:[r]]),$i].join(Qe),xd=`
|
|
169
|
+
|
|
170
|
+
`,wd=e=>typeof e=="string"?e:"",vd=e=>typeof e=="object"&&e!==null&&"label"in e&&typeof e.label=="string"&&"tokens"in e&&Array.isArray(e.tokens),Td=e=>{const t=e.items;return Array.isArray(t)?t.filter(vd):[]},Ed=e=>e.length===0?[{type:"paragraph"}]:e,Di=(e,t)=>({markdownTokenizer:{name:e.name,level:"block",start:i=>i.search(t.startPattern),tokenize:(i,o,a)=>{const l=yd(i,t);return l===null?void 0:{type:e.name,raw:l.raw,items:l.items.map(c=>({label:c.label,tokens:a.blockTokens(c.body)}))}}},parseMarkdown:(i,o)=>({type:e.name,content:Td(i).map(a=>({type:e.itemName,attrs:{label:a.label},content:Ed(o.parseChildren(a.tokens))}))}),renderMarkdown:(i,o)=>bd((i.content??[]).map(a=>{var l;return{label:wd((l=a.attrs)==null?void 0:l.label),body:o.renderChildren(a.content??[],xd).trim()}}),t)}),Gr=["dragenter","dragover","dragleave","drop","dragend"],Qr=e=>{e.stopPropagation()},zi=e=>{if(e!==null)return Gr.forEach(t=>{e.addEventListener(t,Qr)}),()=>{Gr.forEach(t=>{e.removeEventListener(t,Qr)})}},sr=(e,t)=>e instanceof Element&&e.closest(t)!==null,Hi="(paragraph | heading | bulletList | orderedList | blockquote | codeBlock)+",Bi=({fieldLabel:e,label:t,className:n,onCommit:r,onCancel:s})=>{const[i,o]=C.useState(t),a=C.useRef(null);return C.useEffect(()=>{var l,c;(l=a.current)==null||l.focus(),(c=a.current)==null||c.select()},[]),w.jsx("input",{ref:a,value:i,"aria-label":e,className:n,onChange:l=>{o(l.target.value)},onBlur:()=>{r(i)},onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),r(i)),l.key==="Escape"&&(l.preventDefault(),s())}})},ji="data-tab-bar",Ad="Tab name",Xr="Add a tab",Sd="Remove tabs",Cd="-mb-px w-36 border-b-2 border-ring bg-transparent pb-2 text-sm font-bold text-foreground outline-none",Rn="flex size-6 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring",Zr={ArrowLeft:-1,ArrowRight:1},Yr=e=>`Delete the tab ${e}`,ir=e=>({openIndex:typeof e.attrs.openIndex=="number"?e.attrs.openIndex:0,namingIndex:typeof e.attrs.namingIndex=="number"?e.attrs.namingIndex:null}),Ld=(e,t,n)=>e>t?e-1:Math.min(e,n-1),Md=({node:e,getPos:t,editor:n})=>{const[r,s]=C.useState(null),i=C.useRef([]),o=ue(e).map(Ci),{openIndex:a,namingIndex:l}=ir(e),c=g=>{const m=t();if(typeof m!="number")return;const f={from:m,to:m+e.nodeSize},y=g===null?n.state.tr.delete(f.from,f.to):n.state.tr.replaceWith(f.from,f.to,g);n.view.dispatch(y)},u=g=>{const m=t();typeof m=="number"&&n.view.dispatch(n.state.tr.setNodeMarkup(m,void 0,{...e.attrs,...g}).setMeta("addToHistory",!1))},d=g=>{requestAnimationFrame(()=>{var m;(m=i.current[g])==null||m.focus()})},h=(g,m)=>{c(Ni(e,g,m,{openIndex:m})),d(m)},p=(g,m)=>{if(g.key==="Enter"){g.preventDefault(),u({namingIndex:m});return}if(g.altKey&&Object.hasOwn(Zr,g.key)){g.preventDefault(),h(m,m+Zr[g.key]);return}const f=Co(g.key,m,o.length);f!==null&&(g.preventDefault(),u({openIndex:f}),d(f))};return w.jsxs(Un,{className:"flex flex-col gap-4",children:[w.jsxs("div",{ref:zi,[ji]:"",contentEditable:!1,className:"flex items-end gap-3",children:[w.jsxs("div",{role:"tablist",className:Ao,children:[o.map((g,m)=>w.jsxs("div",{role:"presentation",className:"flex items-end gap-1",children:[m===l?w.jsx(Bi,{fieldLabel:Ad,label:g,className:Cd,onCommit:f=>{c(Ri(e,m,f,{},{namingIndex:null}))},onCancel:()=>{u({namingIndex:null})}}):w.jsx("button",{ref:f=>{i.current[m]=f},type:"button",role:"tab","aria-selected":m===a,tabIndex:m===a?0:-1,draggable:!0,className:So,onClick:()=>{u({openIndex:m})},onDoubleClick:()=>{u({namingIndex:m})},onKeyDown:f=>{p(f,m)},onDragStart:f=>{f.dataTransfer.setData("text/plain",g),s(m)},onDragOverCapture:f=>{f.preventDefault()},onDropCapture:f=>{f.preventDefault(),r!==null&&h(r,m),s(null)},onDragEndCapture:()=>{s(null)},children:g}),w.jsx("button",{type:"button","aria-label":Yr(g),title:Yr(g),className:`${Rn} mb-1.5`,onClick:()=>{c(Ii(e,m,{openIndex:Ld(a,m,o.length-1),namingIndex:null}))},children:w.jsx(ds,{"aria-hidden":"true",className:"size-3.5"})})]},`${String(m)}-${g}`)),w.jsx("button",{type:"button","aria-label":Xr,title:Xr,className:`${Rn} mb-1.5`,onClick:()=>{c(Mi(e,Li(e,V),{openIndex:o.length,namingIndex:o.length}))},children:w.jsx(us,{"aria-hidden":"true",className:"size-4"})})]}),w.jsx(Je,{type:"button",variant:"ghost",size:"sm",className:"mb-1",onClick:()=>{c(Oi(e))},children:Sd})]}),w.jsx(qn,{className:"flex flex-col gap-4"})]})},or="data-section-header",Rd="Section name",Jr="application/x-flight-plan-section",Id="w-64 border-b-2 border-ring bg-transparent text-sm font-bold text-foreground outline-none",Nd="cursor-grab rounded-sm text-left text-sm font-bold text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",es={ArrowUp:-1,ArrowDown:1},Od=10,ts=e=>`Delete the section ${e}`,De=({editor:e,getPos:t})=>{const n=t();if(typeof n!="number")return null;const r=e.state.doc.resolve(n);return{accordion:r.parent,accordionPosition:r.before(),index:r.index()}},_d=(e,t,n)=>{requestAnimationFrame(()=>{var s;const r=e.view.nodeDOM(t);r instanceof HTMLElement&&((s=Array.from(r.querySelectorAll(`[${or}] button[data-section-name]`)).at(n))==null||s.focus())})},$d=({node:e,getPos:t,editor:n})=>{const r=typeof e.attrs.label=="string"?e.attrs.label:"",s=e.attrs.isNaming===!0,i=u=>{const d=De({editor:n,getPos:t});if(d===null)return;const h=u(d),p={from:d.accordionPosition,to:d.accordionPosition+d.accordion.nodeSize};n.view.dispatch(h===null?n.state.tr.delete(p.from,p.to):n.state.tr.replaceWith(p.from,p.to,h))},o=u=>{const d=t();typeof d=="number"&&n.view.dispatch(n.state.tr.setNodeMarkup(d,void 0,{...e.attrs,isNaming:u}).setMeta("addToHistory",!1))},a=(u,d)=>{const h=De({editor:n,getPos:t});h!==null&&(i(({accordion:p})=>Ni(p,u,d)),_d(n,h.accordionPosition,d))},l=u=>{const d=De({editor:n,getPos:t});if(d!==null){if(u.key==="Enter"){u.preventDefault(),o(!0);return}u.altKey&&Object.hasOwn(es,u.key)&&(u.preventDefault(),a(d.index,d.index+es[u.key]))}},c=u=>{u.preventDefault();const d=De({editor:n,getPos:t}),h=Number.parseInt(u.dataTransfer.getData(Jr),Od);d!==null&&Number.isInteger(h)&&a(h,d.index)};return w.jsxs(Un,{className:"flex flex-col gap-2 py-3",children:[w.jsxs("div",{ref:zi,[or]:"",contentEditable:!1,className:"flex items-center gap-2",children:[s?w.jsx(Bi,{fieldLabel:Rd,label:r,className:Id,onCommit:u=>{i(({accordion:d,index:h})=>Ri(d,h,u,{isNaming:!1}))},onCancel:()=>{o(!1)}}):w.jsx("button",{type:"button","data-section-name":"",draggable:!0,className:Nd,onDoubleClick:()=>{o(!0)},onKeyDown:l,onDragStart:u=>{var d;u.dataTransfer.setData(Jr,String(((d=De({editor:n,getPos:t}))==null?void 0:d.index)??""))},onDragOverCapture:u=>{u.preventDefault()},onDropCapture:c,children:r}),w.jsx("button",{type:"button","aria-label":ts(r),title:ts(r),className:Rn,onClick:()=>{i(({accordion:u,index:d})=>Ii(u,d))},children:w.jsx(ds,{"aria-hidden":"true",className:"size-3.5"})})]}),w.jsx(qn,{className:"flex flex-col gap-4"})]})},Pd=D.create({name:le.itemName,content:Hi,defining:!0,isolating:!0,addAttributes:()=>({label:{default:le.newItemLabel,rendered:!1},isNaming:{default:!1,rendered:!1}}),parseHTML:()=>[{tag:"section[data-accordion-section]"}],renderHTML:()=>["section",{"data-accordion-section":""},0],addNodeView:()=>Fn($d,{stopEvent:({event:e})=>sr(e.target,`[${or}]`)})}),Dd=D.create({name:le.name,group:"block",content:`${le.itemName}+`,defining:!0,isolating:!0,selectable:!1,draggable:!1,parseHTML:()=>[{tag:"div[data-accordion]"}],renderHTML:()=>["div",{"data-accordion":""},0],addNodeView:()=>Fn(fd,{stopEvent:({event:e})=>sr(e.target,`[${_i}]`)}),...Di(le,gd)}),zd=[Dd,Pd],Hd={hidden:"hidden"},Bd=(e,t)=>ue(e).reduce((n,r)=>{var i;const s=((i=n.at(-1))==null?void 0:i.to)??t+1;return[...n,{from:s,to:s+r.nodeSize}]},[]),jd=e=>ie.create(e,Lo(e,t=>t.type.name===V.name).flatMap(({node:t,pos:n})=>Bd(t,n).filter((r,s)=>s!==ir(t).openIndex).map(({from:r,to:s})=>nt.node(r,s,Hd)))),qd=e=>{const{$from:t}=e.selection,n=Array.from({length:t.depth},(o,a)=>t.depth-a).find(o=>t.node(o).type.name===V.itemName);if(n===void 0)return null;const r=n-1,s=t.index(r),i=t.node(r);return ir(i).openIndex===s?null:e.tr.setNodeMarkup(t.before(r),void 0,{...i.attrs,openIndex:s}).setMeta("addToHistory",!1)},Ud=new B({key:new G(V.name),props:{decorations:e=>jd(e.doc)},appendTransaction:(e,t,n)=>e.some(r=>r.selectionSet)?qd(n):null}),Fd=D.create({name:V.itemName,content:Hi,defining:!0,isolating:!0,addAttributes:()=>({label:{default:V.newItemLabel,rendered:!1}}),parseHTML:()=>[{tag:"section[data-tab]"}],renderHTML:()=>["section",{"data-tab":"",class:"flex flex-col gap-4"},0]}),Wd=D.create({name:V.name,group:"block",content:`${V.itemName}+`,defining:!0,isolating:!0,selectable:!1,draggable:!1,addAttributes:()=>({openIndex:{default:0,rendered:!1},namingIndex:{default:null,rendered:!1}}),parseHTML:()=>[{tag:"div[data-tabs]"}],renderHTML:()=>["div",{"data-tabs":""},0],addNodeView:()=>Fn(Md,{stopEvent:({event:e})=>sr(e.target,`[${ji}]`)}),addProseMirrorPlugins:()=>[Ud],...Di(V,md)}),Kd=[Wd,Fd],Vd=[...Kd,...zd],Gd=3,ke="link",Qd="Link",Xd="Link address",Zd="https://",Yd="Apply",Jd="Remove link",eh="Code link",th="Tabs",nh="Accordion",rh=" ",sh=[{name:"bold",label:"Bold",icon:Io,toggle:e=>{e.chain().focus().toggleBold().run()}},{name:"italic",label:"Italic",icon:$o,toggle:e=>{e.chain().focus().toggleItalic().run()}},{name:"code",label:"Code",icon:No,toggle:e=>{e.chain().focus().toggleCode().run()}},{name:"heading",label:"Heading",icon:_o,toggle:e=>{e.chain().focus().toggleHeading({level:Gd}).run()}},{name:"bulletList",label:"Bulleted list",icon:Ho,toggle:e=>{e.chain().focus().toggleBulletList().run()}},{name:"orderedList",label:"Numbered list",icon:zo,toggle:e=>{e.chain().focus().toggleOrderedList().run()}},{name:"blockquote",label:"Quote",icon:qo,toggle:e=>{e.chain().focus().toggleBlockquote().run()}},{name:"codeBlock",label:"Code block",icon:jo,toggle:e=>{e.chain().focus().toggleCodeBlock().run()}}],qi=ud.configure({strike:!1,underline:!1,horizontalRule:!1,link:{openOnClick:!1,autolink:!1}}),ih=[qi,ps,Ds],oh=()=>new Ps,ah=[qi,ps,...Vd,Ds.configure({marked:oh()})],lh=hs("flex min-h-32 flex-col gap-4 px-3 py-2.5 text-base leading-[1.7] text-pretty outline-none","[&_:is(h1,h2,h3,h4,h5,h6)]:text-[1.1875rem] [&_:is(h1,h2,h3,h4,h5,h6)]:leading-7 [&_:is(h1,h2,h3,h4,h5,h6)]:font-semibold [&_:is(h1,h2,h3,h4,h5,h6)]:tracking-[-0.01em]","[&_ol]:flex [&_ol]:list-decimal [&_ol]:flex-col [&_ol]:gap-2 [&_ol]:pl-5 [&_ul]:flex [&_ul]:list-disc [&_ul]:flex-col [&_ul]:gap-2 [&_ul]:pl-5","[&_ol_ol]:mt-2 [&_ol_ul]:mt-2 [&_ul_ol]:mt-2 [&_ul_ul]:mt-2","[&_code]:rounded-sm [&_code]:bg-muted [&_code]:px-1.5 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[0.875em] [&_strong]:font-bold","[&_a]:underline [&_a]:decoration-1 [&_a]:underline-offset-[0.3em]","[&_blockquote]:flex [&_blockquote]:flex-col [&_blockquote]:gap-4 [&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-4 [&_blockquote]:text-muted-foreground","[&_pre]:overflow-x-auto [&_pre]:rounded-md [&_pre]:bg-code [&_pre]:px-4 [&_pre]:py-3 [&_pre]:font-mono [&_pre]:text-sm [&_pre]:leading-6 [&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_pre_code]:text-[1em]","[&_.ProseMirror-selectednode]:outline-2 [&_.ProseMirror-selectednode]:outline-ring"),ch="rounded-lg border border-input bg-card focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/40 aria-invalid:border-destructive",uh="flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 aria-pressed:bg-foreground aria-pressed:text-background",dh=e=>e.isActive(V.itemName)||e.isActive(le.itemName),hh=(e,t)=>({bold:e.isActive("bold"),italic:e.isActive("italic"),code:e.isActive("code"),heading:e.isActive("heading"),bulletList:e.isActive("bulletList"),orderedList:e.isActive("orderedList"),blockquote:e.isActive("blockquote"),codeBlock:e.isActive("codeBlock"),link:e.isActive(ke),insideContainer:t&&dh(e)}),ph=e=>{const{href:t}=e.getAttributes(ke);return typeof t=="string"?t:""},fh=e=>{const{from:t,to:n}=e.state.selection;return e.state.doc.textBetween(t,n,rh)},mh=(e,t)=>{if(e.state.selection.empty&&!e.isActive(ke)){e.chain().focus().insertContent({type:"text",text:t,marks:[{type:ke,attrs:{href:t}}]}).run();return}e.chain().focus().extendMarkRange(ke).setLink({href:t}).run()},gh=e=>{e.chain().focus().extendMarkRange(ke).unsetLink().run()},kh=(e,t)=>{e.chain().focus().insertContent({type:Ro,attrs:t}).run()},Ui=(e,t,n,r)=>{e.chain().insertContent({type:t.name,attrs:n,content:[{type:t.itemName,attrs:{label:t.newItemLabel,...r},content:[{type:"paragraph"}]}]}).run()},yh=e=>{Ui(e,V,{openIndex:0,namingIndex:0},{})},bh=e=>{Ui(e,le,{},{isNaming:!0})},ze=e=>w.jsx("button",{type:"button","aria-label":e.label,title:e.label,"aria-pressed":e.isPressed,disabled:e.isDisabled,className:uh,onMouseDown:t=>{t.preventDefault()},onClick:e.onClick,children:w.jsx(e.icon,{"aria-hidden":"true",className:"size-4"})}),xh=({address:e,canRemove:t,onApply:n,onRemove:r})=>{const[s,i]=C.useState(e),o=s.trim();return w.jsxs("div",{className:"flex items-center gap-2 border-b border-input px-2 py-1.5",children:[w.jsx(Mo,{type:"url",value:s,placeholder:Zd,"aria-label":Xd,className:"h-7 flex-1",onChange:a=>{i(a.target.value)},onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),o!==""&&n(o))}}),t?w.jsx(Je,{type:"button",variant:"ghost",size:"sm",onClick:r,children:Jd}):null,w.jsx(Je,{type:"button",size:"sm",disabled:o==="",onClick:()=>{n(o)},children:Yd})]})},wh=({editor:e,label:t,isLinking:n,canLinkCode:r,canUseSections:s,onToggleLinking:i,onLinkCode:o})=>{const a=Bs({editor:e,selector:l=>hh(l.editor,s)});return w.jsxs("div",{role:"toolbar","aria-label":t,className:"flex flex-wrap items-center gap-1 border-b border-input px-2 py-1.5",children:[sh.map(l=>w.jsx(ze,{label:l.label,icon:l.icon,isPressed:a[l.name],onClick:()=>{l.toggle(e)}},l.name)),w.jsx(ze,{label:Qd,icon:Po,isPressed:a.link||n,onClick:i}),r?w.jsx(ze,{label:eh,icon:Oo,isPressed:!1,onClick:o}):null,s?w.jsxs(w.Fragment,{children:[w.jsx(ze,{label:th,icon:Bo,isPressed:!1,isDisabled:a.insideContainer,onClick:()=>{yh(e)}}),w.jsx(ze,{label:nh,icon:Do,isPressed:!1,isDisabled:a.insideContainer,onClick:()=>{bh(e)}})]}):null]})},Eh=({label:e,value:t,errorMessage:n,className:r,shouldFocus:s=!1,canUseSections:i=!1,renderCodeLinkDialog:o,onChange:a})=>{const l=C.useId(),[c,u]=C.useState(!1),[d,h]=C.useState(!1),p=n!==null,g=zl({extensions:i?ah:ih,content:t,contentType:"markdown",autofocus:s,editorProps:{attributes:{role:"textbox","aria-multiline":"true","aria-label":e,class:lh}},onUpdate:({editor:m})=>{a(m.getMarkdown())}});return w.jsxs("div",{className:hs("grid gap-1.5",r),children:[w.jsxs("div",{"aria-invalid":p,className:ch,children:[w.jsx(wh,{editor:g,label:`${e} formatting`,isLinking:c,canLinkCode:o!==void 0,canUseSections:i,onToggleLinking:()=>{u(m=>!m)},onLinkCode:()=>{h(!0)}}),c?w.jsx(xh,{address:ph(g),canRemove:g.isActive(ke),onApply:m=>{mh(g,m),u(!1)},onRemove:()=>{gh(g),u(!1)}}):null,w.jsx(Hs,{editor:g,"aria-describedby":p?l:void 0})]}),p?w.jsx("p",{id:l,role:"alert",className:"text-sm text-destructive",children:n}):null,d&&o!==void 0?o({selectedText:fh(g),onInsert:m=>{kh(g,m),h(!1)},onClose:()=>{h(!1)}}):null]})};export{Eh as T};
|