hexo-dashboard 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/README.md +133 -0
  2. package/bin/hexo-dashboard +217 -0
  3. package/client/dist/assets/ArticleEditorComponent-BNtYfsit.css +1 -0
  4. package/client/dist/assets/ArticleEditorComponent-DM84zeTX.js +1 -0
  5. package/client/dist/assets/ArticleListComponent-CFyUxUGw.css +1 -0
  6. package/client/dist/assets/ArticleListComponent-KQh4CUN-.js +1 -0
  7. package/client/dist/assets/ConfigEditorComponent-CVEAF7yT.css +1 -0
  8. package/client/dist/assets/ConfigEditorComponent-kwRiMzrZ.js +1 -0
  9. package/client/dist/assets/MainConfigView-IFjwYCwE.js +1 -0
  10. package/client/dist/assets/PageEditorView-B19MWwlA.js +2 -0
  11. package/client/dist/assets/PagesView-ytYxxHpK.js +1 -0
  12. package/client/dist/assets/PostEditorView-BzOl_nAC.js +4 -0
  13. package/client/dist/assets/PostsView-CEq9xxs-.js +1 -0
  14. package/client/dist/assets/ThemeConfigView-DXGK_6a7.js +1 -0
  15. package/client/dist/assets/base16-dark-Bv11q3dD.js +84 -0
  16. package/client/dist/assets/base16-dark-CSajNCSC.css +1 -0
  17. package/client/dist/assets/index-CPpQGkhS.js +30 -0
  18. package/client/dist/assets/index-CdMTwo1E.css +1 -0
  19. package/client/dist/assets/page-CHW6FyZR.js +1 -0
  20. package/client/dist/assets/post-Cnm9xIIP.js +1 -0
  21. package/client/dist/index.html +15 -0
  22. package/package.json +76 -0
  23. package/server/dist/controllers/ArticleController.d.ts +14 -0
  24. package/server/dist/controllers/ArticleController.d.ts.map +1 -0
  25. package/server/dist/controllers/ArticleController.js +162 -0
  26. package/server/dist/controllers/ArticleController.js.map +1 -0
  27. package/server/dist/controllers/AuthController.d.ts +8 -0
  28. package/server/dist/controllers/AuthController.d.ts.map +1 -0
  29. package/server/dist/controllers/AuthController.js +33 -0
  30. package/server/dist/controllers/AuthController.js.map +1 -0
  31. package/server/dist/controllers/ConfigController.d.ts +9 -0
  32. package/server/dist/controllers/ConfigController.d.ts.map +1 -0
  33. package/server/dist/controllers/ConfigController.js +46 -0
  34. package/server/dist/controllers/ConfigController.js.map +1 -0
  35. package/server/dist/controllers/TaxonomyController.d.ts +8 -0
  36. package/server/dist/controllers/TaxonomyController.d.ts.map +1 -0
  37. package/server/dist/controllers/TaxonomyController.js +28 -0
  38. package/server/dist/controllers/TaxonomyController.js.map +1 -0
  39. package/server/dist/errors/BadRequestError.d.ts +5 -0
  40. package/server/dist/errors/BadRequestError.d.ts.map +1 -0
  41. package/server/dist/errors/BadRequestError.js +13 -0
  42. package/server/dist/errors/BadRequestError.js.map +1 -0
  43. package/server/dist/errors/HttpError.d.ts +5 -0
  44. package/server/dist/errors/HttpError.d.ts.map +1 -0
  45. package/server/dist/errors/HttpError.js +11 -0
  46. package/server/dist/errors/HttpError.js.map +1 -0
  47. package/server/dist/errors/InternalServerError.d.ts +5 -0
  48. package/server/dist/errors/InternalServerError.d.ts.map +1 -0
  49. package/server/dist/errors/InternalServerError.js +13 -0
  50. package/server/dist/errors/InternalServerError.js.map +1 -0
  51. package/server/dist/errors/NotFoundError.d.ts +5 -0
  52. package/server/dist/errors/NotFoundError.d.ts.map +1 -0
  53. package/server/dist/errors/NotFoundError.js +13 -0
  54. package/server/dist/errors/NotFoundError.js.map +1 -0
  55. package/server/dist/errors/UnauthorizedError.d.ts +5 -0
  56. package/server/dist/errors/UnauthorizedError.d.ts.map +1 -0
  57. package/server/dist/errors/UnauthorizedError.js +13 -0
  58. package/server/dist/errors/UnauthorizedError.js.map +1 -0
  59. package/server/dist/index.d.ts +2 -0
  60. package/server/dist/index.d.ts.map +1 -0
  61. package/server/dist/index.js +46 -0
  62. package/server/dist/index.js.map +1 -0
  63. package/server/dist/middlewares/auth.d.ts +4 -0
  64. package/server/dist/middlewares/auth.d.ts.map +1 -0
  65. package/server/dist/middlewares/auth.js +15 -0
  66. package/server/dist/middlewares/auth.js.map +1 -0
  67. package/server/dist/middlewares/errorHandler.d.ts +4 -0
  68. package/server/dist/middlewares/errorHandler.d.ts.map +1 -0
  69. package/server/dist/middlewares/errorHandler.js +16 -0
  70. package/server/dist/middlewares/errorHandler.js.map +1 -0
  71. package/server/dist/routes/article.d.ts +4 -0
  72. package/server/dist/routes/article.d.ts.map +1 -0
  73. package/server/dist/routes/article.js +20 -0
  74. package/server/dist/routes/article.js.map +1 -0
  75. package/server/dist/routes/auth.d.ts +4 -0
  76. package/server/dist/routes/auth.d.ts.map +1 -0
  77. package/server/dist/routes/auth.js +15 -0
  78. package/server/dist/routes/auth.js.map +1 -0
  79. package/server/dist/routes/config.d.ts +4 -0
  80. package/server/dist/routes/config.d.ts.map +1 -0
  81. package/server/dist/routes/config.js +16 -0
  82. package/server/dist/routes/config.js.map +1 -0
  83. package/server/dist/routes/taxonomy.d.ts +4 -0
  84. package/server/dist/routes/taxonomy.d.ts.map +1 -0
  85. package/server/dist/routes/taxonomy.js +15 -0
  86. package/server/dist/routes/taxonomy.js.map +1 -0
  87. package/server/dist/services/ArticleService.d.ts +31 -0
  88. package/server/dist/services/ArticleService.d.ts.map +1 -0
  89. package/server/dist/services/ArticleService.js +109 -0
  90. package/server/dist/services/ArticleService.js.map +1 -0
  91. package/server/dist/services/AuthService.d.ts +7 -0
  92. package/server/dist/services/AuthService.d.ts.map +1 -0
  93. package/server/dist/services/AuthService.js +16 -0
  94. package/server/dist/services/AuthService.js.map +1 -0
  95. package/server/dist/services/ConfigService.d.ts +10 -0
  96. package/server/dist/services/ConfigService.d.ts.map +1 -0
  97. package/server/dist/services/ConfigService.js +57 -0
  98. package/server/dist/services/ConfigService.js.map +1 -0
  99. package/server/dist/services/TaxonomyService.d.ts +8 -0
  100. package/server/dist/services/TaxonomyService.d.ts.map +1 -0
  101. package/server/dist/services/TaxonomyService.js +14 -0
  102. package/server/dist/services/TaxonomyService.js.map +1 -0
package/README.md ADDED
@@ -0,0 +1,133 @@
1
+ # Hexo Dashboard
2
+
3
+ A Vue-based dashboard for managing your Hexo blog. Edit posts, pages, and configurations directly from the browser.
4
+
5
+ 一个基于 Vue 的 Hexo 博客管理面板。在浏览器中直接编辑文章、页面和配置。
6
+
7
+ ## Features | 功能特点
8
+
9
+ - 📝 **Post & Page Management** - Create, edit, and delete posts and pages
10
+ 文章与页面管理 - 创建、编辑和删除文章或页面
11
+
12
+ - ⚙️ **Configuration Editor** - Edit `_config.yml` and theme config
13
+ 配置编辑器 - 编辑站点配置和主题配置
14
+
15
+ - 🔐 **Password Protection** - Secure access with bcrypt authentication
16
+ 密码保护 - 使用 bcrypt 加密的安全认证
17
+
18
+ - 🌓 **Dark Mode** - Light and dark theme support
19
+ 深色模式 - 支持明暗主题切换
20
+
21
+ - 🌍 **Multi-language** - English, 中文, 日本語, 한국어, Français...
22
+ 多语言支持
23
+
24
+ ## Installation | 安装
25
+
26
+ **Requirements | 环境要求:** Node.js >= 20.19.0
27
+
28
+ ```bash
29
+ # Install | 安装
30
+ npm install hexo-dashboard --save
31
+
32
+ # Or using pnpm | 或使用 pnpm
33
+ pnpm add hexo-dashboard
34
+ ```
35
+
36
+ ## Usage | 使用方法
37
+
38
+ ### Start Server | 启动服务器
39
+
40
+ ```bash
41
+ hexo server
42
+ ```
43
+
44
+ Then visit | 然后访问: `http://localhost:4000/dashboard`
45
+
46
+ ## User Management CLI | 用户管理命令
47
+
48
+ Manage dashboard users from the command line.
49
+ 通过命令行管理面板用户。
50
+
51
+ ### Commands | 命令列表
52
+
53
+ | Command | Description |
54
+ |---------|-------------|
55
+ | `register <user> <pass>` | Add a new user 添加新用户 |
56
+ | `passwd <user> <pass>` | Change user password 修改用户密码 |
57
+ | `delete <user>` | Delete a user 删除用户 |
58
+ | `list` | List all users 列出所有用户 |
59
+ | `help` | Show help message 显示帮助信息 |
60
+
61
+ ### Command Aliases | 命令别名
62
+
63
+ | Command | Aliases |
64
+ |---------|---------|
65
+ | `register` | `reg` |
66
+ | `delete` | `del`, `rm`, `remove` |
67
+ | `list` | `ls` |
68
+
69
+ ### Examples | 使用示例
70
+
71
+ ```bash
72
+ # Show help | 显示帮助
73
+ npx hexo-dashboard help
74
+
75
+ # Register a new user | 注册新用户
76
+ npx hexo-dashboard register admin mypassword123
77
+
78
+ # Change password | 修改密码
79
+ npx hexo-dashboard passwd admin newpassword456
80
+
81
+ # Delete a user | 删除用户
82
+ npx hexo-dashboard delete admin
83
+
84
+ # List all users | 列出所有用户
85
+ npx hexo-dashboard list
86
+ ```
87
+
88
+ ### Configuration | 配置说明
89
+
90
+ After registration, your `_config.yml` will contain:
91
+ 注册后,`_config.yml` 会包含:
92
+
93
+ ```yaml
94
+ dashboard:
95
+ admin: $2b$12$ABC...xyz # bcrypt hashed password
96
+ ```
97
+
98
+ ## Troubleshooting | 常见问题
99
+
100
+ ### "hexo-dashboard" command not found | 命令未找到
101
+
102
+ Use `npx` to run the command:
103
+ 使用 `npx` 运行命令:
104
+
105
+ ```bash
106
+ npx hexo-dashboard register admin password
107
+ ```
108
+
109
+ ### "_config.yml" not found | 配置文件未找到
110
+
111
+ Make sure you run the command in your Hexo project directory:
112
+ 确保在 Hexo 项目目录中运行命令:
113
+
114
+ ```bash
115
+ cd /path/to/your/hexo
116
+ npx hexo-dashboard register admin password
117
+ ```
118
+
119
+ ## Security Notes | 安全提示
120
+
121
+ - ⚠️ Passwords are hashed with bcrypt (cost factor: 12)
122
+ 密码使用 bcrypt 加密(成本因子:12)
123
+
124
+ - ⚠️ Never commit plaintext passwords to version control
125
+ 不要将明文密码提交到版本控制
126
+
127
+ - ⚠️ Keep your `_config.yml` secure
128
+ 妥善保管你的配置文件
129
+
130
+ ## Credits | 致谢
131
+
132
+ - [hexo-admin](https://github.com/jaredly/hexo-admin)
133
+ - [hexo-myadmin](https://github.com/xjpin/hexo-myadmin)
@@ -0,0 +1,217 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { join, resolve } = require('path');
4
+ const { readFileSync, writeFileSync, existsSync } = require('fs');
5
+ const { hashSync } = require('bcryptjs');
6
+
7
+ // ============================================================================
8
+ // Help
9
+ // ============================================================================
10
+
11
+ const showHelp = () => {
12
+ console.log(`
13
+ hexo-dashboard - User management CLI
14
+
15
+ Usage:
16
+ hexo-dashboard <command> [options]
17
+
18
+ Commands:
19
+ register <username> <password> Add a new user (alias: reg)
20
+ passwd <username> <password> Change user password
21
+ delete <username> Delete a user (alias: del, rm, remove)
22
+ list List all users (alias: ls)
23
+ help Show this help message
24
+
25
+ Examples:
26
+ hexo-dashboard register admin mypassword123
27
+ hexo-dashboard passwd admin newpassword456
28
+ hexo-dashboard delete admin
29
+ hexo-dashboard list
30
+ `);
31
+ };
32
+
33
+ // ============================================================================
34
+ // Config file operations
35
+ // ============================================================================
36
+
37
+ /**
38
+ * Find hexo project directory by looking for _config.yml
39
+ */
40
+ const findConfigPath = () => {
41
+ let dir = process.cwd();
42
+ for (let i = 0; i < 5; i++) {
43
+ const configPath = join(dir, '_config.yml');
44
+ if (existsSync(configPath)) return configPath;
45
+ const parent = resolve(dir, '..');
46
+ if (parent === dir) break;
47
+ dir = parent;
48
+ }
49
+ return null;
50
+ };
51
+
52
+ /**
53
+ * Parse dashboard users from config content
54
+ */
55
+ const parseUsers = (content) => {
56
+ const users = {};
57
+ const match = content.match(/^dashboard:\s*\n((?:[ \t]+.+\n?)*)/m);
58
+ if (!match) return users;
59
+
60
+ const lines = match[1].split('\n');
61
+ for (const line of lines) {
62
+ const userMatch = line.match(/^\s+(\w+):\s*(.+?)\s*$/);
63
+ if (userMatch) {
64
+ users[userMatch[1]] = userMatch[2];
65
+ }
66
+ }
67
+ return users;
68
+ };
69
+
70
+ /**
71
+ * Serialize users object to YAML format
72
+ */
73
+ const serializeUsers = (users) => {
74
+ const lines = ['dashboard:'];
75
+ for (const [name, hash] of Object.entries(users)) {
76
+ lines.push(` ${name}: ${hash}`);
77
+ }
78
+ return lines.join('\n');
79
+ };
80
+
81
+ /**
82
+ * Write users to config file, preserving other content
83
+ */
84
+ const writeUsers = (configPath, content, users) => {
85
+ const hasUsers = Object.keys(users).length > 0;
86
+ const hasDashboard = /^dashboard:\s*$/m.test(content) || /^dashboard:\s*\n/m.test(content);
87
+
88
+ let newContent;
89
+
90
+ if (hasDashboard) {
91
+ // Replace existing dashboard section
92
+ const pattern = /^dashboard:\s*\n(?:[ \t]+.+\n?)*/m;
93
+ if (hasUsers) {
94
+ newContent = content.replace(pattern, serializeUsers(users) + '\n');
95
+ } else {
96
+ // Remove dashboard section
97
+ newContent = content.replace(pattern, '').replace(/\n{3,}/g, '\n\n').trimEnd() + '\n';
98
+ }
99
+ } else if (hasUsers) {
100
+ // Append new dashboard section
101
+ const ending = content.endsWith('\n') ? '\n' : '\n\n';
102
+ newContent = content + ending + '# Hexo-dashboard authentication\n' + serializeUsers(users) + '\n';
103
+ } else {
104
+ return; // Nothing to do
105
+ }
106
+
107
+ writeFileSync(configPath, newContent, 'utf-8');
108
+ };
109
+
110
+ // ============================================================================
111
+ // Commands
112
+ // ============================================================================
113
+
114
+ const commands = {
115
+ register(users, args, configPath, content) {
116
+ const [username, password] = args;
117
+ if (!username || !password) {
118
+ console.error('Usage: hexo-dashboard register <username> <password>');
119
+ process.exit(1);
120
+ }
121
+ if (users[username]) {
122
+ console.error(`Error: User '${username}' already exists. Use 'passwd' to change password.`);
123
+ process.exit(1);
124
+ }
125
+ users[username] = hashSync(password, 12);
126
+ writeUsers(configPath, content, users);
127
+ console.log(`✓ User '${username}' registered successfully!`);
128
+ console.log(` Config: ${configPath}`);
129
+ },
130
+
131
+ passwd(users, args, configPath, content) {
132
+ const [username, password] = args;
133
+ if (!username || !password) {
134
+ console.error('Usage: hexo-dashboard passwd <username> <password>');
135
+ process.exit(1);
136
+ }
137
+ if (!users[username]) {
138
+ console.error(`Error: User '${username}' not found.`);
139
+ process.exit(1);
140
+ }
141
+ users[username] = hashSync(password, 12);
142
+ writeUsers(configPath, content, users);
143
+ console.log(`✓ Password for '${username}' changed successfully!`);
144
+ console.log(` Config: ${configPath}`);
145
+ },
146
+
147
+ delete(users, args, configPath, content) {
148
+ const [username] = args;
149
+ if (!username) {
150
+ console.error('Usage: hexo-dashboard delete <username>');
151
+ process.exit(1);
152
+ }
153
+ if (!users[username]) {
154
+ console.error(`Error: User '${username}' not found.`);
155
+ process.exit(1);
156
+ }
157
+ delete users[username];
158
+ writeUsers(configPath, content, users);
159
+ console.log(`✓ User '${username}' deleted successfully!`);
160
+ console.log(` Config: ${configPath}`);
161
+ },
162
+
163
+ list(users) {
164
+ const names = Object.keys(users);
165
+ if (names.length === 0) {
166
+ console.log('No users registered.');
167
+ } else {
168
+ console.log(`Registered users (${names.length}):`);
169
+ names.forEach(name => console.log(` - ${name}`));
170
+ }
171
+ }
172
+ };
173
+
174
+ // Command aliases
175
+ commands.reg = commands.register;
176
+ commands.del = commands.delete;
177
+ commands.rm = commands.delete;
178
+ commands.remove = commands.delete;
179
+ commands.ls = commands.list;
180
+
181
+ // ============================================================================
182
+ // Main
183
+ // ============================================================================
184
+
185
+ const args = process.argv.slice(2);
186
+ const command = args[0];
187
+
188
+ // Help
189
+ if (!command || command === 'help' || command === '-h' || command === '--help') {
190
+ showHelp();
191
+ process.exit(0);
192
+ }
193
+
194
+ // Validate command
195
+ if (!commands[command]) {
196
+ console.error(`Unknown command: ${command}`);
197
+ showHelp();
198
+ process.exit(1);
199
+ }
200
+
201
+ // Find config
202
+ const configPath = findConfigPath();
203
+ if (!configPath) {
204
+ console.error('Error: _config.yml not found.');
205
+ console.error('Please run this command in your Hexo project directory.');
206
+ process.exit(1);
207
+ }
208
+
209
+ // Execute
210
+ try {
211
+ const content = readFileSync(configPath, 'utf-8');
212
+ const users = parseUsers(content);
213
+ commands[command](users, args.slice(1), configPath, content);
214
+ } catch (err) {
215
+ console.error(`Error: ${err.message}`);
216
+ process.exit(1);
217
+ }
@@ -0,0 +1 @@
1
+ .article-editor[data-v-9ad5e17a]{height:100%;display:flex;flex-direction:column}.editor-header[data-v-9ad5e17a]{display:flex;align-items:center;gap:16px;padding:16px 24px;border-bottom:1px solid var(--hd-border);background-color:var(--hd-bg-secondary)}.editor-title[data-v-9ad5e17a]{flex:1;font-size:18px;font-weight:600;color:var(--hd-text);margin:0}.editor-content[data-v-9ad5e17a]{flex:1;display:flex;flex-direction:column;overflow:hidden;padding:16px;gap:16px}.editor-section[data-v-9ad5e17a]{display:flex;flex-direction:column;border:1px solid var(--hd-border);border-radius:8px;overflow:hidden}.content-section[data-v-9ad5e17a]{flex:1;min-height:0}.section-header[data-v-9ad5e17a]{display:flex;align-items:center;gap:8px;padding:12px 16px;background-color:var(--hd-bg-secondary);border-bottom:1px solid var(--hd-border);font-weight:500;color:var(--hd-text-secondary)}.meta-editor[data-v-9ad5e17a]{height:150px}.content-editor[data-v-9ad5e17a]{flex:1;min-height:300px}.code-editor[data-v-9ad5e17a]{height:100%}.code-editor[data-v-9ad5e17a] .CodeMirror{height:100%;font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-size:14px}html.dark .code-editor[data-v-9ad5e17a] .CodeMirror{background-color:var(--hd-bg-tertiary);color:var(--hd-text)}html.dark .code-editor[data-v-9ad5e17a] .CodeMirror-gutters{background-color:var(--hd-bg-secondary);border-right:1px solid var(--hd-border)}html.dark .code-editor[data-v-9ad5e17a] .CodeMirror-linenumber{color:var(--hd-text-tertiary)}@media(max-width:768px){.editor-header[data-v-9ad5e17a]{padding:12px 16px}.editor-title[data-v-9ad5e17a]{font-size:16px}.editor-content[data-v-9ad5e17a]{padding:12px}.meta-editor[data-v-9ad5e17a]{height:120px}}
@@ -0,0 +1 @@
1
+ import{d as Te,e as oe,r as me,B as Le,h as je,i as de,j as B,v as qe,k as _,w as ae,u as I,C as Be,l as fe,t as Z,D as Ie,x as Me,b as _e,n as se,G as he,y as pe,H as Ne,I as Ce,o as ge,A as ke,_ as ze}from"./index-CPpQGkhS.js";import{r as ce,R as ve}from"./base16-dark-Bv11q3dD.js";var De={exports:{}},Fe={exports:{}},Se;function Pe(){return Se||(Se=1,(function(V,ee){(function(a){a(ce())})(function(a){var L={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},r={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};a.defineMode("xml",function(d,s){var f=d.indentUnit,l={},v=s.htmlMode?L:r;for(var F in v)l[F]=v[F];for(var F in s)l[F]=s[F];var w,p;function A(t,o){function n(H){return o.tokenize=H,H(t,o)}var c=t.next();if(c=="<")return t.eat("!")?t.eat("[")?t.match("CDATA[")?n(b("atom","]]>")):null:t.match("--")?n(b("comment","-->")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),n(y(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),o.tokenize=b("meta","?>"),"meta"):(w=t.eat("/")?"closeTag":"openTag",o.tokenize=N,"tag bracket");if(c=="&"){var S;return t.eat("#")?t.eat("x")?S=t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):S=t.eatWhile(/[\d]/)&&t.eat(";"):S=t.eatWhile(/[\w\.\-:]/)&&t.eat(";"),S?"atom":"error"}else return t.eatWhile(/[^&<]/),null}A.isInText=!0;function N(t,o){var n=t.next();if(n==">"||n=="/"&&t.eat(">"))return o.tokenize=A,w=n==">"?"endTag":"selfcloseTag","tag bracket";if(n=="=")return w="equals",null;if(n=="<"){o.tokenize=A,o.state=z,o.tagName=o.tagStart=null;var c=o.tokenize(t,o);return c?c+" tag error":"tag error"}else return/[\'\"]/.test(n)?(o.tokenize=C(n),o.stringStartCol=t.column(),o.tokenize(t,o)):(t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function C(t){var o=function(n,c){for(;!n.eol();)if(n.next()==t){c.tokenize=N;break}return"string"};return o.isInAttribute=!0,o}function b(t,o){return function(n,c){for(;!n.eol();){if(n.match(o)){c.tokenize=A;break}n.next()}return t}}function y(t){return function(o,n){for(var c;(c=o.next())!=null;){if(c=="<")return n.tokenize=y(t+1),n.tokenize(o,n);if(c==">")if(t==1){n.tokenize=A;break}else return n.tokenize=y(t-1),n.tokenize(o,n)}return"meta"}}function g(t){return t&&t.toLowerCase()}function G(t,o,n){this.prev=t.context,this.tagName=o||"",this.indent=t.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(o)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}function M(t){t.context&&(t.context=t.context.prev)}function j(t,o){for(var n;;){if(!t.context||(n=t.context.tagName,!l.contextGrabbers.hasOwnProperty(g(n))||!l.contextGrabbers[g(n)].hasOwnProperty(g(o))))return;M(t)}}function z(t,o,n){return t=="openTag"?(n.tagStart=o.column(),X):t=="closeTag"?P:z}function X(t,o,n){return t=="word"?(n.tagName=o.current(),p="tag",u):l.allowMissingTagName&&t=="endTag"?(p="tag bracket",u(t,o,n)):(p="error",X)}function P(t,o,n){if(t=="word"){var c=o.current();return n.context&&n.context.tagName!=c&&l.implicitlyClosed.hasOwnProperty(g(n.context.tagName))&&M(n),n.context&&n.context.tagName==c||l.matchClosing===!1?(p="tag",q):(p="tag error",ie)}else return l.allowMissingTagName&&t=="endTag"?(p="tag bracket",q(t,o,n)):(p="error",ie)}function q(t,o,n){return t!="endTag"?(p="error",q):(M(n),z)}function ie(t,o,n){return p="error",q(t,o,n)}function u(t,o,n){if(t=="word")return p="attribute",ue;if(t=="endTag"||t=="selfcloseTag"){var c=n.tagName,S=n.tagStart;return n.tagName=n.tagStart=null,t=="selfcloseTag"||l.autoSelfClosers.hasOwnProperty(g(c))?j(n,c):(j(n,c),n.context=new G(n,c,S==n.indented)),z}return p="error",u}function ue(t,o,n){return t=="equals"?E:(l.allowMissing||(p="error"),u(t,o,n))}function E(t,o,n){return t=="string"?K:t=="word"&&l.allowUnquoted?(p="string",u):(p="error",u(t,o,n))}function K(t,o,n){return t=="string"?K:u(t,o,n)}return{startState:function(t){var o={tokenize:A,state:z,indented:t||0,tagName:null,tagStart:null,context:null};return t!=null&&(o.baseIndent=t),o},token:function(t,o){if(!o.tagName&&t.sol()&&(o.indented=t.indentation()),t.eatSpace())return null;w=null;var n=o.tokenize(t,o);return(n||w)&&n!="comment"&&(p=null,o.state=o.state(w||n,t,o),p&&(n=p=="error"?n+" error":p)),n},indent:function(t,o,n){var c=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+f;if(c&&c.noIndent)return a.Pass;if(t.tokenize!=N&&t.tokenize!=A)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return l.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+f*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(o))return 0;var S=o&&/^<(\/)?([\w_:\.-]*)/.exec(o);if(S&&S[1])for(;c;)if(c.tagName==S[2]){c=c.prev;break}else if(l.implicitlyClosed.hasOwnProperty(g(c.tagName)))c=c.prev;else break;else if(S)for(;c;){var H=l.contextGrabbers[g(c.tagName)];if(H&&H.hasOwnProperty(g(S[2])))c=c.prev;else break}for(;c&&c.prev&&!c.startOfLine;)c=c.prev;return c?c.indent+f:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(t){t.state==E&&(t.state=u)},xmlCurrentTag:function(t){return t.tagName?{name:t.tagName,close:t.type=="closeTag"}:null},xmlCurrentContext:function(t){for(var o=[],n=t.context;n;n=n.prev)o.push(n.tagName);return o.reverse()}}}),a.defineMIME("text/xml","xml"),a.defineMIME("application/xml","xml"),a.mimeModes.hasOwnProperty("text/html")||a.defineMIME("text/html",{name:"xml",htmlMode:!0})})})()),Fe.exports}var be={exports:{}},ye;function He(){return ye||(ye=1,(function(V,ee){(function(a){a(ce())})(function(a){a.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy","cbl"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded JavaScript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"],alias:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var L=0;L<a.modeInfo.length;L++){var r=a.modeInfo[L];r.mimes&&(r.mime=r.mimes[0])}a.findModeByMIME=function(d){d=d.toLowerCase();for(var s=0;s<a.modeInfo.length;s++){var f=a.modeInfo[s];if(f.mime==d)return f;if(f.mimes){for(var l=0;l<f.mimes.length;l++)if(f.mimes[l]==d)return f}}if(/\+xml$/.test(d))return a.findModeByMIME("application/xml");if(/\+json$/.test(d))return a.findModeByMIME("application/json")},a.findModeByExtension=function(d){d=d.toLowerCase();for(var s=0;s<a.modeInfo.length;s++){var f=a.modeInfo[s];if(f.ext){for(var l=0;l<f.ext.length;l++)if(f.ext[l]==d)return f}}},a.findModeByFileName=function(d){for(var s=0;s<a.modeInfo.length;s++){var f=a.modeInfo[s];if(f.file&&f.file.test(d))return f}var l=d.lastIndexOf("."),v=l>-1&&d.substring(l+1,d.length);if(v)return a.findModeByExtension(v)},a.findModeByName=function(d){d=d.toLowerCase();for(var s=0;s<a.modeInfo.length;s++){var f=a.modeInfo[s];if(f.name.toLowerCase()==d)return f;if(f.alias){for(var l=0;l<f.alias.length;l++)if(f.alias[l].toLowerCase()==d)return f}}}})})()),be.exports}var Ee;function Oe(){return Ee||(Ee=1,(function(V,ee){(function(a){a(ce(),Pe(),He())})(function(a){a.defineMode("markdown",function(L,r){var d=a.getMode(L,"text/html"),s=d.name=="null";function f(i){if(a.findModeByName){var e=a.findModeByName(i);e&&(i=e.mime||e.mimes[0])}var m=a.getMode(L,i);return m.name=="null"?null:m}r.highlightFormatting===void 0&&(r.highlightFormatting=!1),r.maxBlockquoteDepth===void 0&&(r.maxBlockquoteDepth=0),r.taskLists===void 0&&(r.taskLists=!1),r.strikethrough===void 0&&(r.strikethrough=!1),r.emoji===void 0&&(r.emoji=!1),r.fencedCodeBlockHighlighting===void 0&&(r.fencedCodeBlockHighlighting=!0),r.fencedCodeBlockDefaultMode===void 0&&(r.fencedCodeBlockDefaultMode="text/plain"),r.xml===void 0&&(r.xml=!0),r.tokenTypeOverrides===void 0&&(r.tokenTypeOverrides={});var l={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var v in l)l.hasOwnProperty(v)&&r.tokenTypeOverrides[v]&&(l[v]=r.tokenTypeOverrides[v]);var F=/^([*\-_])(?:\s*\1){2,}\s*$/,w=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,p=/^\[(x| )\](?=\s)/i,A=r.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,N=/^ {0,3}(?:\={1,}|-{2,})\s*$/,C=/^[^#!\[\]*_\\<>` "'(~:]+/,b=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,y=/^\s*\[[^\]]+?\]:.*$/,g=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,G=" ";function M(i,e,m){return e.f=e.inline=m,m(i,e)}function j(i,e,m){return e.f=e.block=m,m(i,e)}function z(i){return!i||!/\S/.test(i.string)}function X(i){if(i.linkTitle=!1,i.linkHref=!1,i.linkText=!1,i.em=!1,i.strong=!1,i.strikethrough=!1,i.quote=0,i.indentedCode=!1,i.f==q){var e=s;if(!e){var m=a.innerMode(d,i.htmlState);e=m.mode.name=="xml"&&m.state.tagStart===null&&!m.state.context&&m.state.tokenize.isInText}e&&(i.f=E,i.block=P,i.htmlState=null)}return i.trailingSpace=0,i.trailingSpaceNewLine=!1,i.prevLine=i.thisLine,i.thisLine={stream:null},null}function P(i,e){var m=i.column()===e.indentation,h=z(e.prevLine.stream),x=e.indentedCode,T=e.prevLine.hr,Y=e.list!==!1,O=(e.listStack[e.listStack.length-1]||0)+3;e.indentedCode=!1;var R=e.indentation;if(e.indentationDiff===null&&(e.indentationDiff=e.indentation,Y)){for(e.list=null;R<e.listStack[e.listStack.length-1];)e.listStack.pop(),e.listStack.length?e.indentation=e.listStack[e.listStack.length-1]:e.list=!1;e.list!==!1&&(e.indentationDiff=R-e.listStack[e.listStack.length-1])}var $=!h&&!T&&!e.prevLine.header&&(!Y||!x)&&!e.prevLine.fencedCodeEnd,k=(e.list===!1||T||h)&&e.indentation<=O&&i.match(F),D=null;if(e.indentationDiff>=4&&(x||e.prevLine.fencedCodeEnd||e.prevLine.header||h))return i.skipToEnd(),e.indentedCode=!0,l.code;if(i.eatSpace())return null;if(m&&e.indentation<=O&&(D=i.match(A))&&D[1].length<=6)return e.quote=0,e.header=D[1].length,e.thisLine.header=!0,r.highlightFormatting&&(e.formatting="header"),e.f=e.inline,u(e);if(e.indentation<=O&&i.eat(">"))return e.quote=m?1:e.quote+1,r.highlightFormatting&&(e.formatting="quote"),i.eatSpace(),u(e);if(!k&&!e.setext&&m&&e.indentation<=O&&(D=i.match(w))){var te=D[1]?"ol":"ul";return e.indentation=R+i.current().length,e.list=!0,e.quote=0,e.listStack.push(e.indentation),e.em=!1,e.strong=!1,e.code=!1,e.strikethrough=!1,r.taskLists&&i.match(p,!1)&&(e.taskList=!0),e.f=e.inline,r.highlightFormatting&&(e.formatting=["list","list-"+te]),u(e)}else{if(m&&e.indentation<=O&&(D=i.match(b,!0)))return e.quote=0,e.fencedEndRE=new RegExp(D[1]+"+ *$"),e.localMode=r.fencedCodeBlockHighlighting&&f(D[2]||r.fencedCodeBlockDefaultMode),e.localMode&&(e.localState=a.startState(e.localMode)),e.f=e.block=ie,r.highlightFormatting&&(e.formatting="code-block"),e.code=-1,u(e);if(e.setext||(!$||!Y)&&!e.quote&&e.list===!1&&!e.code&&!k&&!y.test(i.string)&&(D=i.lookAhead(1))&&(D=D.match(N)))return e.setext?(e.header=e.setext,e.setext=0,i.skipToEnd(),r.highlightFormatting&&(e.formatting="header")):(e.header=D[0].charAt(0)=="="?1:2,e.setext=e.header),e.thisLine.header=!0,e.f=e.inline,u(e);if(k)return i.skipToEnd(),e.hr=!0,e.thisLine.hr=!0,l.hr;if(i.peek()==="[")return M(i,e,c)}return M(i,e,e.inline)}function q(i,e){var m=d.token(i,e.htmlState);if(!s){var h=a.innerMode(d,e.htmlState);(h.mode.name=="xml"&&h.state.tagStart===null&&!h.state.context&&h.state.tokenize.isInText||e.md_inside&&i.current().indexOf(">")>-1)&&(e.f=E,e.block=P,e.htmlState=null)}return m}function ie(i,e){var m=e.listStack[e.listStack.length-1]||0,h=e.indentation<m,x=m+3;if(e.fencedEndRE&&e.indentation<=x&&(h||i.match(e.fencedEndRE))){r.highlightFormatting&&(e.formatting="code-block");var T;return h||(T=u(e)),e.localMode=e.localState=null,e.block=P,e.f=E,e.fencedEndRE=null,e.code=0,e.thisLine.fencedCodeEnd=!0,h?j(i,e,e.block):T}else return e.localMode?e.localMode.token(i,e.localState):(i.skipToEnd(),l.code)}function u(i){var e=[];if(i.formatting){e.push(l.formatting),typeof i.formatting=="string"&&(i.formatting=[i.formatting]);for(var m=0;m<i.formatting.length;m++)e.push(l.formatting+"-"+i.formatting[m]),i.formatting[m]==="header"&&e.push(l.formatting+"-"+i.formatting[m]+"-"+i.header),i.formatting[m]==="quote"&&(!r.maxBlockquoteDepth||r.maxBlockquoteDepth>=i.quote?e.push(l.formatting+"-"+i.formatting[m]+"-"+i.quote):e.push("error"))}if(i.taskOpen)return e.push("meta"),e.length?e.join(" "):null;if(i.taskClosed)return e.push("property"),e.length?e.join(" "):null;if(i.linkHref?e.push(l.linkHref,"url"):(i.strong&&e.push(l.strong),i.em&&e.push(l.em),i.strikethrough&&e.push(l.strikethrough),i.emoji&&e.push(l.emoji),i.linkText&&e.push(l.linkText),i.code&&e.push(l.code),i.image&&e.push(l.image),i.imageAltText&&e.push(l.imageAltText,"link"),i.imageMarker&&e.push(l.imageMarker)),i.header&&e.push(l.header,l.header+"-"+i.header),i.quote&&(e.push(l.quote),!r.maxBlockquoteDepth||r.maxBlockquoteDepth>=i.quote?e.push(l.quote+"-"+i.quote):e.push(l.quote+"-"+r.maxBlockquoteDepth)),i.list!==!1){var h=(i.listStack.length-1)%3;h?h===1?e.push(l.list2):e.push(l.list3):e.push(l.list1)}return i.trailingSpaceNewLine?e.push("trailing-space-new-line"):i.trailingSpace&&e.push("trailing-space-"+(i.trailingSpace%2?"a":"b")),e.length?e.join(" "):null}function ue(i,e){if(i.match(C,!0))return u(e)}function E(i,e){var m=e.text(i,e);if(typeof m<"u")return m;if(e.list)return e.list=null,u(e);if(e.taskList){var h=i.match(p,!0)[1]===" ";return h?e.taskOpen=!0:e.taskClosed=!0,r.highlightFormatting&&(e.formatting="task"),e.taskList=!1,u(e)}if(e.taskOpen=!1,e.taskClosed=!1,e.header&&i.match(/^#+$/,!0))return r.highlightFormatting&&(e.formatting="header"),u(e);var x=i.next();if(e.linkTitle){e.linkTitle=!1;var T=x;x==="("&&(T=")"),T=(T+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Y="^\\s*(?:[^"+T+"\\\\]+|\\\\\\\\|\\\\.)"+T;if(i.match(new RegExp(Y),!0))return l.linkHref}if(x==="`"){var O=e.formatting;r.highlightFormatting&&(e.formatting="code"),i.eatWhile("`");var R=i.current().length;if(e.code==0&&(!e.quote||R==1))return e.code=R,u(e);if(R==e.code){var $=u(e);return e.code=0,$}else return e.formatting=O,u(e)}else if(e.code)return u(e);if(x==="\\"&&(i.next(),r.highlightFormatting)){var k=u(e),D=l.formatting+"-escape";return k?k+" "+D:D}if(x==="!"&&i.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return e.imageMarker=!0,e.image=!0,r.highlightFormatting&&(e.formatting="image"),u(e);if(x==="["&&e.imageMarker&&i.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return e.imageMarker=!1,e.imageAltText=!0,r.highlightFormatting&&(e.formatting="image"),u(e);if(x==="]"&&e.imageAltText){r.highlightFormatting&&(e.formatting="image");var k=u(e);return e.imageAltText=!1,e.image=!1,e.inline=e.f=t,k}if(x==="["&&!e.image)return e.linkText&&i.match(/^.*?\]/)||(e.linkText=!0,r.highlightFormatting&&(e.formatting="link")),u(e);if(x==="]"&&e.linkText){r.highlightFormatting&&(e.formatting="link");var k=u(e);return e.linkText=!1,e.inline=e.f=i.match(/\(.*?\)| ?\[.*?\]/,!1)?t:E,k}if(x==="<"&&i.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){e.f=e.inline=K,r.highlightFormatting&&(e.formatting="link");var k=u(e);return k?k+=" ":k="",k+l.linkInline}if(x==="<"&&i.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){e.f=e.inline=K,r.highlightFormatting&&(e.formatting="link");var k=u(e);return k?k+=" ":k="",k+l.linkEmail}if(r.xml&&x==="<"&&i.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var te=i.string.indexOf(">",i.pos);if(te!=-1){var we=i.string.substring(i.start,te);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(we)&&(e.md_inside=!0)}return i.backUp(1),e.htmlState=a.startState(d),j(i,e,q)}if(r.xml&&x==="<"&&i.match(/^\/\w*?>/))return e.md_inside=!1,"tag";if(x==="*"||x==="_"){for(var ne=1,U=i.pos==1?" ":i.string.charAt(i.pos-2);ne<3&&i.eat(x);)ne++;var W=i.peek()||" ",le=!/\s/.test(W)&&(!g.test(W)||/\s/.test(U)||g.test(U)),re=!/\s/.test(U)&&(!g.test(U)||/\s/.test(W)||g.test(W)),J=null,Q=null;if(ne%2&&(!e.em&&le&&(x==="*"||!re||g.test(U))?J=!0:e.em==x&&re&&(x==="*"||!le||g.test(W))&&(J=!1)),ne>1&&(!e.strong&&le&&(x==="*"||!re||g.test(U))?Q=!0:e.strong==x&&re&&(x==="*"||!le||g.test(W))&&(Q=!1)),Q!=null||J!=null){r.highlightFormatting&&(e.formatting=J==null?"strong":Q==null?"em":"strong em"),J===!0&&(e.em=x),Q===!0&&(e.strong=x);var $=u(e);return J===!1&&(e.em=!1),Q===!1&&(e.strong=!1),$}}else if(x===" "&&(i.eat("*")||i.eat("_"))){if(i.peek()===" ")return u(e);i.backUp(1)}if(r.strikethrough){if(x==="~"&&i.eatWhile(x)){if(e.strikethrough){r.highlightFormatting&&(e.formatting="strikethrough");var $=u(e);return e.strikethrough=!1,$}else if(i.match(/^[^\s]/,!1))return e.strikethrough=!0,r.highlightFormatting&&(e.formatting="strikethrough"),u(e)}else if(x===" "&&i.match("~~",!0)){if(i.peek()===" ")return u(e);i.backUp(2)}}if(r.emoji&&x===":"&&i.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){e.emoji=!0,r.highlightFormatting&&(e.formatting="emoji");var Ae=u(e);return e.emoji=!1,Ae}return x===" "&&(i.match(/^ +$/,!1)?e.trailingSpace++:e.trailingSpace&&(e.trailingSpaceNewLine=!0)),u(e)}function K(i,e){var m=i.next();if(m===">"){e.f=e.inline=E,r.highlightFormatting&&(e.formatting="link");var h=u(e);return h?h+=" ":h="",h+l.linkInline}return i.match(/^[^>]+/,!0),l.linkInline}function t(i,e){if(i.eatSpace())return null;var m=i.next();return m==="("||m==="["?(e.f=e.inline=n(m==="("?")":"]"),r.highlightFormatting&&(e.formatting="link-string"),e.linkHref=!0,u(e)):"error"}var o={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function n(i){return function(e,m){var h=e.next();if(h===i){m.f=m.inline=E,r.highlightFormatting&&(m.formatting="link-string");var x=u(m);return m.linkHref=!1,x}return e.match(o[i]),m.linkHref=!0,u(m)}}function c(i,e){return i.match(/^([^\]\\]|\\.)*\]:/,!1)?(e.f=S,i.next(),r.highlightFormatting&&(e.formatting="link"),e.linkText=!0,u(e)):M(i,e,E)}function S(i,e){if(i.match("]:",!0)){e.f=e.inline=H,r.highlightFormatting&&(e.formatting="link");var m=u(e);return e.linkText=!1,m}return i.match(/^([^\]\\]|\\.)+/,!0),l.linkText}function H(i,e){return i.eatSpace()?null:(i.match(/^[^\s]+/,!0),i.peek()===void 0?e.linkTitle=!0:i.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),e.f=e.inline=E,l.linkHref+" url")}var xe={startState:function(){return{f:P,prevLine:{stream:null},thisLine:{stream:null},block:P,htmlState:null,indentation:0,inline:E,text:ue,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(i){return{f:i.f,prevLine:i.prevLine,thisLine:i.thisLine,block:i.block,htmlState:i.htmlState&&a.copyState(d,i.htmlState),indentation:i.indentation,localMode:i.localMode,localState:i.localMode?a.copyState(i.localMode,i.localState):null,inline:i.inline,text:i.text,formatting:!1,linkText:i.linkText,linkTitle:i.linkTitle,linkHref:i.linkHref,code:i.code,em:i.em,strong:i.strong,strikethrough:i.strikethrough,emoji:i.emoji,header:i.header,setext:i.setext,hr:i.hr,taskList:i.taskList,list:i.list,listStack:i.listStack.slice(0),quote:i.quote,indentedCode:i.indentedCode,trailingSpace:i.trailingSpace,trailingSpaceNewLine:i.trailingSpaceNewLine,md_inside:i.md_inside,fencedEndRE:i.fencedEndRE}},token:function(i,e){if(e.formatting=!1,i!=e.thisLine.stream){if(e.header=0,e.hr=!1,i.match(/^\s*$/,!0))return X(e),null;if(e.prevLine=e.thisLine,e.thisLine={stream:i},e.taskList=!1,e.trailingSpace=0,e.trailingSpaceNewLine=!1,!e.localState&&(e.f=e.block,e.f!=q)){var m=i.match(/^\s*/,!0)[0].replace(/\t/g,G).length;if(e.indentation=m,e.indentationDiff=null,m>0)return null}}return e.f(i,e)},innerMode:function(i){return i.block==q?{state:i.htmlState,mode:d}:i.localState?{state:i.localState,mode:i.localMode}:{state:i,mode:xe}},indent:function(i,e,m){return i.block==q&&d.indent?d.indent(i.htmlState,e,m):i.localState&&i.localMode.indent?i.localMode.indent(i.localState,e,m):a.Pass},blankLine:X,getType:u,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return xe},"xml"),a.defineMIME("text/markdown","markdown"),a.defineMIME("text/x-markdown","markdown")})})()),De.exports}Oe();const Re=["onKeydown"],$e={class:"editor-header"},Ge={class:"editor-title"},Ue={class:"editor-content"},We={class:"editor-section"},Je={class:"section-header"},Qe={class:"meta-editor"},Ve={class:"editor-section content-section"},Xe={class:"section-header"},Ke={class:"content-editor"},Ye=Te({__name:"ArticleEditorComponent",props:{articleId:{},title:{},defaultMeta:{},api:{}},emits:["back","saved"],setup(V,{emit:ee}){const a=V,L=ee,{t:r}=_e(),{currentTheme:d}=Le(),s=oe(()=>a.articleId==="new"),f=me(!1),l=me(!1),v=me(""),F=me(""),w=oe(()=>d.value==="dark"?"base16-dark":"default"),p=oe(()=>({mode:"yaml",theme:w.value,lineNumbers:!0,lineWrapping:!0,tabSize:2})),A=oe(()=>({mode:"markdown",theme:w.value,lineNumbers:!0,lineWrapping:!0,tabSize:2})),N=async()=>{if(s.value){v.value=a.defaultMeta,F.value="";return}f.value=!0;try{const b=await a.api.getData(a.articleId);v.value=b.meta,F.value=b.content}finally{f.value=!1}},C=async()=>{l.value=!0;try{if(s.value){const b=await a.api.create(v.value,F.value);ke.success(r("common.success")),L("saved",b.id)}else await a.api.update(a.articleId,v.value,F.value),ke.success(r("common.success"))}finally{l.value=!1}};return je(()=>{N()}),(b,y)=>{const g=fe("el-button"),G=fe("el-icon"),M=Me("loading");return ge(),de("div",{class:"article-editor",tabindex:"0",onKeydown:[se(he(C,["ctrl","prevent","stop"]),["s"]),se(he(C,["meta","prevent","stop"]),["s"])]},[B("div",$e,[_(g,{text:"",icon:I(Be),onClick:y[0]||(y[0]=j=>b.$emit("back"))},{default:ae(()=>[pe(Z(I(r)("common.back")),1)]),_:1},8,["icon"]),B("h2",Ge,Z(V.title),1),_(g,{type:"primary",icon:I(Ie),onClick:C,loading:l.value},{default:ae(()=>[pe(Z(I(r)("common.save")),1)]),_:1},8,["icon","loading"])]),qe((ge(),de("div",Ue,[B("div",We,[B("div",Je,[_(G,null,{default:ae(()=>[_(I(Ne))]),_:1}),B("span",null,Z(I(r)("editor.meta")),1)]),B("div",Qe,[_(I(ve),{value:v.value,"onUpdate:value":y[1]||(y[1]=j=>v.value=j),options:p.value,class:"code-editor"},null,8,["value","options"])])]),B("div",Ve,[B("div",Xe,[_(G,null,{default:ae(()=>[_(I(Ce))]),_:1}),B("span",null,Z(I(r)("editor.content")),1)]),B("div",Ke,[_(I(ve),{value:F.value,"onUpdate:value":y[2]||(y[2]=j=>F.value=j),options:A.value,class:"code-editor"},null,8,["value","options"])])])])),[[M,f.value]])],40,Re)}}}),ii=ze(Ye,[["__scopeId","data-v-9ad5e17a"]]);export{ii as A};
@@ -0,0 +1 @@
1
+ .article-list[data-v-822cef85]{padding:24px;max-width:1400px;margin:0 auto}.page-header[data-v-822cef85]{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}.page-title[data-v-822cef85]{font-size:24px;font-weight:600;color:var(--hd-text);margin:0}.filters-bar[data-v-822cef85]{display:flex;gap:12px;margin-bottom:20px;flex-wrap:wrap}.filter-input[data-v-822cef85]{width:240px}.filter-select[data-v-822cef85]{width:180px}.table-container[data-v-822cef85]{background-color:var(--hd-bg);border:1px solid var(--hd-border);border-radius:8px;overflow:hidden}.row-title[data-v-822cef85]{color:var(--hd-text);font-size:15px;cursor:pointer;transition:color .2s}.row-title[data-v-822cef85]:hover{color:var(--hd-accent);text-decoration:underline}.text-muted[data-v-822cef85]{color:var(--hd-text-tertiary);font-size:15px}.action-buttons[data-v-822cef85]{display:flex;padding-right:12px}.action-buttons[data-v-822cef85] .el-button-group{display:flex}.action-buttons[data-v-822cef85] .el-button-group .el-button.el-button{padding:5px 10px;border-color:var(--hd-border)}.pagination-container[data-v-822cef85]{display:flex;justify-content:center;margin-top:20px}@media(max-width:768px){.article-list[data-v-822cef85]{padding:16px}.page-header[data-v-822cef85]{flex-direction:column;gap:16px;align-items:flex-start}.filters-bar[data-v-822cef85]{flex-direction:column}.filter-input[data-v-822cef85],.filter-select[data-v-822cef85]{width:100%}[data-v-822cef85] .hide-on-mobile{display:none!important}.action-buttons[data-v-822cef85]{flex-direction:column;gap:0}}
@@ -0,0 +1 @@
1
+ import{d as W,r as y,g as X,h as Y,i as C,j as d,k as l,t as c,w as a,u as o,p as Z,l as f,m as v,n as ee,q as te,b as oe,F as B,v as ae,x as ne,c as g,y as h,z as L,E as V,A,o as s,_ as le}from"./index-CPpQGkhS.js";const se={class:"article-list",tabindex:"0"},ie={class:"page-header"},ce={class:"page-title"},me={class:"filters-bar"},ue={class:"table-container"},re=["onClick"],de={class:"text-muted"},pe={class:"text-muted"},fe={class:"text-muted"},ge={class:"action-buttons"},he={class:"pagination-container"},_e=W({__name:"ArticleListComponent",props:{title:{},createText:{},deleteConfirmText:{},api:{},taxonomyApi:{},showStatusColumn:{type:Boolean},showCategoryColumn:{type:Boolean},showTagColumn:{type:Boolean},showUpdatedColumn:{type:Boolean},showPublishActions:{type:Boolean},showTaxonomyFilters:{type:Boolean}},emits:["create","edit"],setup(p,{emit:E}){const u=p,N=E,{t}=oe(),T=y(!1),D=y([]),U=y(0),x=y(1),$=y([]),P=y([]),i=X({title:"",category:"",tag:""}),j=n=>n?new Date(n).toLocaleString(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"-",r=async()=>{T.value=!0;try{const n=await u.api.getList(x.value,i.title,i.category,i.tag);D.value=n.list,U.value=n.total}finally{T.value=!1}},M=async()=>{if(!u.taxonomyApi)return;const[n,m]=await Promise.all([u.taxonomyApi.getCategories(),u.taxonomyApi.getTags()]);$.value=n.taxonomies,P.value=m.taxonomies},S=()=>{i.title="",i.category="",i.tag="",x.value=1,r()},z=()=>{N("create")},I=async n=>{u.api.publish&&(await V.confirm(t("posts.publishConfirm"),t("common.confirm"),{confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel")}),await u.api.publish(n.id),A.success(t("common.success")),r())},K=async n=>{u.api.unpublish&&(await V.confirm(t("posts.unpublishConfirm"),t("common.confirm"),{confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),type:"warning"}),await u.api.unpublish(n.id),A.success(t("common.success")),r())},R=async n=>{await V.confirm(u.deleteConfirmText,t("common.confirm"),{confirmButtonText:t("common.confirm"),cancelButtonText:t("common.cancel"),type:"warning"}),await u.api.remove(n.id),A.success(t("common.success")),r()};return Y(()=>{r(),M()}),(n,m)=>{const _=f("el-button"),q=f("el-input"),w=f("el-option"),F=f("el-select"),b=f("el-table-column"),G=f("el-tag"),H=f("el-button-group"),J=f("el-table"),O=f("el-pagination"),Q=ne("loading");return s(),C("div",se,[d("div",ie,[d("h2",ce,c(p.title),1),l(_,{type:"primary",icon:o(Z),onClick:z},{default:a(()=>[h(c(p.createText),1)]),_:1},8,["icon"])]),d("div",me,[l(q,{modelValue:i.title,"onUpdate:modelValue":m[0]||(m[0]=e=>i.title=e),placeholder:o(t)("common.search"),"prefix-icon":o(te),clearable:"",class:"filter-input",onKeyup:ee(r,["enter"]),onClear:r},null,8,["modelValue","placeholder","prefix-icon"]),p.showTaxonomyFilters?(s(),C(B,{key:0},[l(F,{modelValue:i.category,"onUpdate:modelValue":m[1]||(m[1]=e=>i.category=e),placeholder:o(t)("common.category"),clearable:"",filterable:"",class:"filter-select",onChange:r},{default:a(()=>[l(w,{label:o(t)("common.all"),value:""},null,8,["label"]),(s(!0),C(B,null,L($.value,e=>(s(),g(w,{key:e,label:e,value:e},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"]),l(F,{modelValue:i.tag,"onUpdate:modelValue":m[2]||(m[2]=e=>i.tag=e),placeholder:o(t)("common.tag"),clearable:"",filterable:"",class:"filter-select",onChange:r},{default:a(()=>[l(w,{label:o(t)("common.all"),value:""},null,8,["label"]),(s(!0),C(B,null,L(P.value,e=>(s(),g(w,{key:e,label:e,value:e},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])],64)):v("",!0),l(_,{onClick:S},{default:a(()=>[h(c(o(t)("common.reset")),1)]),_:1})]),d("div",ue,[ae((s(),g(J,{data:D.value,stripe:""},{default:a(()=>[l(b,{label:o(t)("common.title"),"min-width":"300"},{default:a(({row:e})=>[d("span",{class:"row-title",onClick:k=>n.$emit("edit",e.id)},c(e.title),9,re)]),_:1},8,["label"]),p.showStatusColumn?(s(),g(b,{key:0,label:o(t)("common.status"),"min-width":"100"},{default:a(({row:e})=>[l(G,{type:e.isDraft?"info":"success"},{default:a(()=>[h(c(e.isDraft?o(t)("common.draft"):o(t)("common.published")),1)]),_:2},1032,["type"])]),_:1},8,["label"])):v("",!0),p.showCategoryColumn?(s(),g(b,{key:1,label:o(t)("common.category"),"min-width":"150","class-name":"hide-on-mobile"},{default:a(({row:e})=>[d("span",de,c(e.categories?.join(", ")||"-"),1)]),_:1},8,["label"])):v("",!0),p.showTagColumn?(s(),g(b,{key:2,label:o(t)("common.tag"),"min-width":"150","class-name":"hide-on-mobile"},{default:a(({row:e})=>[d("span",pe,c(e.tags?.join(", ")||"-"),1)]),_:1},8,["label"])):v("",!0),p.showUpdatedColumn?(s(),g(b,{key:3,label:o(t)("common.updated"),"min-width":"150","class-name":"hide-on-mobile"},{default:a(({row:e})=>[d("span",fe,c(j(e.updated)),1)]),_:1},8,["label"])):v("",!0),l(b,{label:o(t)("common.actions"),"min-width":"200"},{default:a(({row:e})=>[d("div",ge,[l(H,null,{default:a(()=>[l(_,{plain:"",onClick:k=>n.$emit("edit",e.id)},{default:a(()=>[h(c(o(t)("common.edit")),1)]),_:1},8,["onClick"]),p.showPublishActions?(s(),C(B,{key:0},[e.isDraft?(s(),g(_,{key:0,type:"success",plain:"",onClick:k=>I(e)},{default:a(()=>[h(c(o(t)("common.publish")),1)]),_:1},8,["onClick"])):(s(),g(_,{key:1,type:"warning",plain:"",onClick:k=>K(e)},{default:a(()=>[h(c(o(t)("common.unpublish")),1)]),_:1},8,["onClick"]))],64)):v("",!0),l(_,{type:"danger",plain:"",onClick:k=>R(e)},{default:a(()=>[h(c(o(t)("common.delete")),1)]),_:1},8,["onClick"])]),_:2},1024)])]),_:1},8,["label"])]),_:1},8,["data"])),[[Q,T.value]])]),d("div",he,[l(O,{"current-page":x.value,"onUpdate:currentPage":m[3]||(m[3]=e=>x.value=e),"page-size":10,total:U.value,"hide-on-single-page":"",layout:"prev, pager, next",onCurrentChange:r},null,8,["current-page","total"])])])}}}),ye=le(_e,[["__scopeId","data-v-822cef85"]]);export{ye as A};
@@ -0,0 +1 @@
1
+ .config-editor[data-v-5cef13aa]{height:100%;display:flex;flex-direction:column}.page-header[data-v-5cef13aa]{display:flex;justify-content:space-between;align-items:center;padding:16px 24px;border-bottom:1px solid var(--hd-border);background-color:var(--hd-bg-secondary)}.page-title[data-v-5cef13aa]{font-size:20px;font-weight:600;color:var(--hd-text);margin:0}.config-content[data-v-5cef13aa]{flex:1;padding:20px;overflow:hidden;display:flex;flex-direction:column}.config-card[data-v-5cef13aa]{flex:1;display:flex;flex-direction:column;border:1px solid var(--hd-border);border-radius:8px;overflow:hidden}.editor-area[data-v-5cef13aa]{flex:1;min-height:0}.code-editor[data-v-5cef13aa]{height:100%}.code-editor[data-v-5cef13aa] .CodeMirror{height:100%;font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-size:14px}html.dark .code-editor[data-v-5cef13aa] .CodeMirror{background-color:var(--hd-bg-tertiary);color:var(--hd-text)}html.dark .code-editor[data-v-5cef13aa] .CodeMirror-gutters{background-color:var(--hd-bg-secondary);border-right:1px solid var(--hd-border)}html.dark .code-editor[data-v-5cef13aa] .CodeMirror-linenumber{color:var(--hd-text-tertiary)}@media(max-width:768px){.page-header[data-v-5cef13aa]{padding:12px 16px}.page-title[data-v-5cef13aa]{font-size:18px}.config-content[data-v-5cef13aa]{padding:12px}}
@@ -0,0 +1 @@
1
+ import{d as D,r as n,e as p,B as E,h as N,i as v,j as t,v as S,k as f,t as _,w as T,u as i,D as K,l as M,x as V,n as m,G as g,y as I,b as j,A as z,o as h,_ as A}from"./index-CPpQGkhS.js";import{R as G}from"./base16-dark-Bv11q3dD.js";const O=["onKeydown"],R={class:"page-header"},U={class:"page-title"},W={class:"config-content"},q={class:"config-card"},F={class:"editor-area"},H=D({__name:"ConfigEditorComponent",props:{title:{},api:{}},setup(c){const l=c,{t:r}=j(),{currentTheme:y}=E(),a=n(!1),o=n(!1),e=n(""),C=p(()=>y.value==="dark"?"base16-dark":"default"),w=p(()=>({mode:"yaml",theme:C.value,lineNumbers:!0,lineWrapping:!0,tabSize:2})),b=async()=>{a.value=!0;try{const d=await l.api.getConfig();e.value=d.config}finally{a.value=!1}},s=async()=>{o.value=!0;try{await l.api.updateConfig(e.value),z.success(r("config.saveSuccess"))}finally{o.value=!1}};return N(()=>{b()}),(d,u)=>{const k=M("el-button"),x=V("loading");return h(),v("div",{class:"config-editor",tabindex:"0",onKeydown:[m(g(s,["ctrl","prevent","stop"]),["s"]),m(g(s,["meta","prevent","stop"]),["s"])]},[t("div",R,[t("h2",U,_(c.title),1),f(k,{type:"primary",icon:i(K),onClick:s,loading:o.value},{default:T(()=>[I(_(i(r)("common.save")),1)]),_:1},8,["icon","loading"])]),S((h(),v("div",W,[t("div",q,[t("div",F,[f(i(G),{value:e.value,"onUpdate:value":u[0]||(u[0]=B=>e.value=B),options:w.value,class:"code-editor"},null,8,["value","options"])])])])),[[x,a.value]])],40,O)}}}),P=A(H,[["__scopeId","data-v-5cef13aa"]]);export{P as C};
@@ -0,0 +1 @@
1
+ import{C as a}from"./ConfigEditorComponent-kwRiMzrZ.js";import{s as o,d as r,c as s,u as f,b as p,o as c}from"./index-CPpQGkhS.js";import"./base16-dark-Bv11q3dD.js";const t={getConfig(){return o.get("config",{params:{type:"mainconfig"}})},updateConfig(n){return o.post("config",{config:n},{params:{type:"mainconfig"}})}},d=r({__name:"MainConfigView",setup(n){const{t:e}=p(),i={getConfig:t.getConfig,updateConfig:t.updateConfig};return(g,m)=>(c(),s(a,{title:f(e)("config.main"),api:i},null,8,["title"]))}});export{d as default};
@@ -0,0 +1,2 @@
1
+ import{d,e as p,f as m,c as g,u as t,a as f,b as w,o as v}from"./index-CPpQGkhS.js";import{A as P}from"./ArticleEditorComponent-DM84zeTX.js";import{p as a}from"./page-CHW6FyZR.js";import"./base16-dark-Bv11q3dD.js";const x=d({__name:"PageEditorView",setup(_){const i=m(),o=f(),{t:s}=w(),r=p(()=>i.params.id),u=p(()=>r.value==="new"),l=`title: New Page
2
+ date: ${new Date().toLocaleString()}`,c={getData:a.getData,create:a.create,update:a.update};return(k,e)=>(v(),g(P,{"article-id":r.value,title:u.value?t(s)("pages.newPage"):t(s)("pages.editPage"),"default-meta":l,api:c,onBack:e[0]||(e[0]=n=>t(o).push("/pages")),onSaved:e[1]||(e[1]=n=>t(o).replace(`/pages/${n}`))},null,8,["article-id","title"]))}});export{x as default};
@@ -0,0 +1 @@
1
+ import{d as p,c as i,u as e,a as m,b as u,o as l}from"./index-CPpQGkhS.js";import{A as g}from"./ArticleListComponent-KQh4CUN-.js";import{p as n}from"./page-CHW6FyZR.js";const C=p({__name:"PagesView",setup(c){const s=m(),{t:o}=u(),a={getList:n.getPages,remove:n.remove};return(f,t)=>(l(),i(g,{title:e(o)("pages.title"),"create-text":e(o)("pages.newPage"),"delete-confirm-text":e(o)("pages.deleteConfirm"),api:a,"show-updated-column":!0,onCreate:t[0]||(t[0]=r=>e(s).push("/pages/new")),onEdit:t[1]||(t[1]=r=>e(s).push(`/pages/${r}`))},null,8,["title","create-text","delete-confirm-text"]))}});export{C as default};
@@ -0,0 +1,4 @@
1
+ import{d,e as i,f as m,c as f,u as e,a as w,b as g,o as v}from"./index-CPpQGkhS.js";import{A as P}from"./ArticleEditorComponent-DM84zeTX.js";import{p as o}from"./post-Cnm9xIIP.js";import"./base16-dark-Bv11q3dD.js";const x=d({__name:"PostEditorView",setup(_){const p=m(),s=w(),{t:a}=g(),r=i(()=>p.params.id),u=i(()=>r.value==="new"),c=`title: New Post
2
+ categories:
3
+ tags:
4
+ date: ${new Date().toLocaleString()}`,l={getData:o.getData,create:o.create,update:o.update};return(k,t)=>(v(),f(P,{"article-id":r.value,title:u.value?e(a)("posts.newPost"):e(a)("posts.editPost"),"default-meta":c,api:l,onBack:t[0]||(t[0]=n=>e(s).push("/posts")),onSaved:t[1]||(t[1]=n=>e(s).replace(`/posts/${n}`))},null,8,["article-id","title"]))}});export{x as default};
@@ -0,0 +1 @@
1
+ import{s as a,d as u,c as m,u as t,a as g,b as l,o as c}from"./index-CPpQGkhS.js";import{A as f}from"./ArticleListComponent-KQh4CUN-.js";import{p as s}from"./post-Cnm9xIIP.js";const x={getCategories(){return a.get("taxonomies",{params:{type:"category"}})}},h={getTags(){return a.get("taxonomies",{params:{type:"tag"}})}},A=u({__name:"PostsView",setup(d){const r=g(),{t:o}=l(),i={getList:s.getPosts,remove:s.remove,publish:s.publish,unpublish:s.unpublish},p={getCategories:x.getCategories,getTags:h.getTags};return(w,e)=>(c(),m(f,{title:t(o)("posts.title"),"create-text":t(o)("posts.newPost"),"delete-confirm-text":t(o)("posts.deleteConfirm"),api:i,"taxonomy-api":p,"show-status-column":!0,"show-category-column":!0,"show-tag-column":!0,"show-updated-column":!0,"show-publish-actions":!0,"show-taxonomy-filters":!0,onCreate:e[0]||(e[0]=n=>t(r).push("/posts/new")),onEdit:e[1]||(e[1]=n=>t(r).push(`/posts/${n}`))},null,8,["title","create-text","delete-confirm-text"]))}});export{A as default};
@@ -0,0 +1 @@
1
+ import{C as a}from"./ConfigEditorComponent-kwRiMzrZ.js";import{s as t,d as r,c as s,u as f,b as p,o as c}from"./index-CPpQGkhS.js";import"./base16-dark-Bv11q3dD.js";const o={getConfig(){return t.get("config",{params:{type:"themeconfig"}})},updateConfig(e){return t.post("config",{config:e},{params:{type:"themeconfig"}})}},d=r({__name:"ThemeConfigView",setup(e){const{t:n}=p(),i={getConfig:o.getConfig,updateConfig:o.updateConfig};return(g,m)=>(c(),s(a,{title:f(n)("config.theme"),api:i},null,8,["title"]))}});export{d as default};