@mongoosejs/studio 0.0.74 → 0.0.76

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.
@@ -56,6 +56,25 @@ if (window.MONGOOSE_STUDIO_CONFIG.isLambda) {
56
56
  return client.post('', { action: 'Dashboard.updateDashboard', ...params}).then(res => res.data);
57
57
  }
58
58
  }
59
+ exports.ChatThread = {
60
+ createChatMessage(params) {
61
+ return client.post('', { action: 'ChatThread.createChatMessage', ...params }).then(res => res.data);
62
+ },
63
+ createChatThread(params) {
64
+ return client.post('', { action: 'ChatThread.createChatThread', ...params }).then(res => res.data);
65
+ },
66
+ getChatThread(params) {
67
+ return client.post('', { action: 'ChatThread.getChatThread', ...params }).then(res => res.data);
68
+ },
69
+ listChatThreads(params) {
70
+ return client.post('', { action: 'ChatThread.listChatThreads', ...params }).then(res => res.data);
71
+ }
72
+ }
73
+ exports.ChatMessage = {
74
+ executeScript(params) {
75
+ return client.post('', { action: 'ChatMessage.executeScript', ...params }).then(res => res.data);
76
+ }
77
+ }
59
78
  exports.Model = {
60
79
  createChart(params) {
61
80
  return client.post('', { action: 'Model.createChart', ...params}).then(res => res.data);
@@ -127,6 +146,25 @@ if (window.MONGOOSE_STUDIO_CONFIG.isLambda) {
127
146
  return client.post('/Dashboard/updateDashboard', params).then(res => res.data);
128
147
  }
129
148
  }
149
+ exports.ChatThread = {
150
+ createChatMessage: function createChatMessage(params) {
151
+ return client.post('/ChatThread/createChatMessage', params).then(res => res.data);
152
+ },
153
+ createChatThread: function createChatThread(params) {
154
+ return client.post('/ChatThread/createChatThread', params).then(res => res.data);
155
+ },
156
+ getChatThread: function getChatThread(params) {
157
+ return client.post('/ChatThread/getChatThread', params).then(res => res.data);
158
+ },
159
+ listChatThreads: function listChatThreads(params) {
160
+ return client.post('/ChatThread/listChatThreads', params).then(res => res.data);
161
+ }
162
+ };
163
+ exports.ChatMessage = {
164
+ executeScript: function executeScript(params) {
165
+ return client.post('/ChatMessage/executeScript', params).then(res => res.data);
166
+ }
167
+ };
130
168
  exports.Model = {
131
169
  createChart: function (params) {
132
170
  return client.post('/Model/createChart', params).then(res => res.data);
@@ -180,9 +218,6 @@ if (window.MONGOOSE_STUDIO_CONFIG.isLambda) {
180
218
  return client.post('/Model/updateDocument', params).then(res => res.data);
181
219
  }
182
220
  };
183
- exports.Script = {
184
-
185
- };
186
221
  }
187
222
 
188
223
 
@@ -256,6 +291,230 @@ module.exports = app => app.component('async-button', {
256
291
  template: template
257
292
  });
258
293
 
294
+ /***/ }),
295
+
296
+ /***/ "./frontend/src/chat/chat-message-script/chat-message-script.js":
297
+ /*!**********************************************************************!*\
298
+ !*** ./frontend/src/chat/chat-message-script/chat-message-script.js ***!
299
+ \**********************************************************************/
300
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
301
+
302
+ "use strict";
303
+
304
+
305
+ const api = __webpack_require__(/*! ../../api */ "./frontend/src/api.js");
306
+ const marked = (__webpack_require__(/*! marked */ "./node_modules/marked/lib/marked.cjs").marked);
307
+ const template = __webpack_require__(/*! ./chat-message-script.html */ "./frontend/src/chat/chat-message-script/chat-message-script.html");
308
+
309
+ module.exports = app => app.component('chat-message-script', {
310
+ template: template,
311
+ props: ['message', 'script', 'language'],
312
+ data: () => ({ activeTab: 'code', showDetailModal: false }),
313
+ computed: {
314
+ styleForMessage() {
315
+ return this.message.role === 'user' ? 'bg-gray-100' : '';
316
+ }
317
+ },
318
+ methods: {
319
+ async executeScript(message, script) {
320
+ const { chatMessage } = await api.ChatMessage.executeScript({
321
+ chatMessageId: message._id,
322
+ script
323
+ });
324
+ message.executionResult = chatMessage.executionResult;
325
+ this.activeTab = 'output';
326
+ },
327
+ openDetailModal() {
328
+ this.showDetailModal = true;
329
+ }
330
+ },
331
+ mounted() {
332
+ Prism.highlightElement(this.$refs.code);
333
+ if (this.message.executionResult?.output) {
334
+ this.activeTab = 'output';
335
+ }
336
+ }
337
+ });
338
+
339
+
340
+ /***/ }),
341
+
342
+ /***/ "./frontend/src/chat/chat-message/chat-message.js":
343
+ /*!********************************************************!*\
344
+ !*** ./frontend/src/chat/chat-message/chat-message.js ***!
345
+ \********************************************************/
346
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
347
+
348
+ "use strict";
349
+
350
+
351
+ const api = __webpack_require__(/*! ../../api */ "./frontend/src/api.js");
352
+ const marked = (__webpack_require__(/*! marked */ "./node_modules/marked/lib/marked.cjs").marked);
353
+ const template = __webpack_require__(/*! ./chat-message.html */ "./frontend/src/chat/chat-message/chat-message.html");
354
+
355
+ module.exports = app => app.component('chat-message', {
356
+ template: template,
357
+ props: ['message'],
358
+ computed: {
359
+ styleForMessage() {
360
+ return this.message.role === 'user' ? 'bg-gray-100' : '';
361
+ },
362
+ contentSplitByScripts() {
363
+ const content = this.message.content;
364
+ const parts = [];
365
+ let currentIndex = 0;
366
+ let codeBlockMatch;
367
+
368
+ // Regular expression to match markdown code blocks
369
+ const codeBlockRegex = /```(\w*)\n([\s\S]*?)\n```/g;
370
+
371
+ while ((codeBlockMatch = codeBlockRegex.exec(content)) !== null) {
372
+ // Add text before the code block
373
+ if (codeBlockMatch.index > currentIndex) {
374
+ parts.push({
375
+ type: 'text',
376
+ content: content.substring(currentIndex, codeBlockMatch.index)
377
+ });
378
+ }
379
+
380
+ // Add the code block
381
+ parts.push({
382
+ type: 'code',
383
+ language: codeBlockMatch[1] || '',
384
+ content: codeBlockMatch[2]
385
+ });
386
+
387
+ currentIndex = codeBlockMatch.index + codeBlockMatch[0].length;
388
+ }
389
+
390
+ // Add any remaining text after the last code block
391
+ if (currentIndex < content.length) {
392
+ parts.push({
393
+ type: 'text',
394
+ content: content.substring(currentIndex)
395
+ });
396
+ }
397
+
398
+ return parts;
399
+ }
400
+ },
401
+ methods: {
402
+ marked(text) {
403
+ return marked(text);
404
+ },
405
+ async executeScript(message, script) {
406
+ const { chatMessage } = await api.ChatMessage.executeScript({
407
+ chatMessageId: message._id,
408
+ script
409
+ });
410
+ message.executionResult = chatMessage.executionResult;
411
+ console.log(message);
412
+ },
413
+ }
414
+ });
415
+
416
+
417
+ /***/ }),
418
+
419
+ /***/ "./frontend/src/chat/chat.js":
420
+ /*!***********************************!*\
421
+ !*** ./frontend/src/chat/chat.js ***!
422
+ \***********************************/
423
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
424
+
425
+ "use strict";
426
+
427
+
428
+ const api = __webpack_require__(/*! ../api */ "./frontend/src/api.js");
429
+ const template = __webpack_require__(/*! ./chat.html */ "./frontend/src/chat/chat.html");
430
+
431
+ module.exports = app => app.component('chat', {
432
+ template: template,
433
+ props: ['threadId'],
434
+ data: () => ({
435
+ status: 'loading',
436
+ sendingMessage: false,
437
+ newMessage: '',
438
+ chatThreadId: null,
439
+ chatThreads: [],
440
+ chatMessages: []
441
+ }),
442
+ methods: {
443
+ async sendMessage() {
444
+ this.sendingMessage = true;
445
+ try {
446
+ if (!this.chatThreadId) {
447
+ const { chatThread } = await api.ChatThread.createChatThread();
448
+ this.chatThreads.unshift(chatThread);
449
+ this.chatThreadId = chatThread._id;
450
+ this.chatMessages = [];
451
+ }
452
+
453
+ this.chatMessages.push({
454
+ content: this.newMessage,
455
+ role: 'user'
456
+ });
457
+
458
+ this.$nextTick(() => {
459
+ if (this.$refs.messagesContainer) {
460
+ this.$refs.messagesContainer.scrollTop = this.$refs.messagesContainer.scrollHeight;
461
+ }
462
+ });
463
+
464
+ const { chatMessages } = await api.ChatThread.createChatMessage({
465
+ chatThreadId: this.chatThreadId,
466
+ content: this.newMessage
467
+ });
468
+ this.chatMessages.push(chatMessages[1]);
469
+
470
+ this.newMessage = '';
471
+
472
+ this.$nextTick(() => {
473
+ if (this.$refs.messagesContainer) {
474
+ this.$refs.messagesContainer.scrollTop = this.$refs.messagesContainer.scrollHeight;
475
+ }
476
+ });
477
+ } finally {
478
+ this.sendingMessage = false;
479
+ }
480
+ },
481
+ selectThread(threadId) {
482
+ this.$router.push('/chat/' + threadId);
483
+ },
484
+ styleForMessage(message) {
485
+ return message.role === 'user' ? 'bg-gray-100' : '';
486
+ },
487
+ async createNewThread() {
488
+ const { chatThread } = await api.ChatThread.createChatThread();
489
+ this.$router.push('/chat/' + chatThread._id);
490
+ }
491
+ },
492
+ async mounted() {
493
+ this.chatThreadId = this.threadId;
494
+ const { chatThreads } = await api.ChatThread.listChatThreads();
495
+ this.chatThreads = chatThreads;
496
+ if (this.chatThreadId) {
497
+ const { chatMessages } = await api.ChatThread.getChatThread({ chatThreadId: this.chatThreadId });
498
+ this.chatMessages = chatMessages;
499
+ }
500
+ this.status = 'loaded';
501
+
502
+ if (this.chatThreadId) {
503
+ // Scroll to bottom of messages container after messages are loaded
504
+ this.$nextTick(() => {
505
+ if (this.$refs.messagesContainer) {
506
+ this.$refs.messagesContainer.scrollTop = this.$refs.messagesContainer.scrollHeight;
507
+ }
508
+
509
+ this.$refs.messagesContainer.querySelectorAll('code').forEach(el => {
510
+ Prism.highlightElement(el);
511
+ });
512
+ });
513
+ }
514
+ },
515
+ });
516
+
517
+
259
518
  /***/ }),
260
519
 
261
520
  /***/ "./frontend/src/clone-document/clone-document.js":
@@ -1443,6 +1702,151 @@ module.exports = app => app.component('export-query-results', {
1443
1702
  }
1444
1703
  });
1445
1704
 
1705
+ /***/ }),
1706
+
1707
+ /***/ "./frontend/src/index.js":
1708
+ /*!*******************************!*\
1709
+ !*** ./frontend/src/index.js ***!
1710
+ \*******************************/
1711
+ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
1712
+
1713
+ "use strict";
1714
+
1715
+
1716
+ if (typeof process === 'undefined') {
1717
+ __webpack_require__.g.process = { env: {} }; // To make `util` package work
1718
+ }
1719
+
1720
+ const api = __webpack_require__(/*! ./api */ "./frontend/src/api.js");
1721
+ const mothership = __webpack_require__(/*! ./mothership */ "./frontend/src/mothership.js");
1722
+ const vanillatoasts = __webpack_require__(/*! vanillatoasts */ "./node_modules/vanillatoasts/vanillatoasts.js");
1723
+
1724
+ const app = Vue.createApp({
1725
+ template: '<app-component />'
1726
+ });
1727
+
1728
+ // Import all components
1729
+ const requireComponents = __webpack_require__("./frontend/src sync recursive ^\\.\\/.*$");
1730
+ // Object to store the imported modules
1731
+ const components = {};
1732
+ // Iterate over the matched keys (file paths)
1733
+ requireComponents.keys().forEach((filePath) => {
1734
+ // Extract directory name and file name from the path
1735
+ const pieces = filePath.split('/');
1736
+ const directoryName = pieces[pieces.length - 2];
1737
+ const fileName = pieces[pieces.length - 1].replace('.js', '');
1738
+
1739
+ // Check if the file name matches the directory name
1740
+ if (directoryName === fileName) {
1741
+ components[directoryName] = requireComponents(filePath);
1742
+ components[directoryName](app);
1743
+ }
1744
+ });
1745
+
1746
+ console.log('Loaded components', Object.keys(components).sort());
1747
+
1748
+ app.component('app-component', {
1749
+ template: `
1750
+ <div>
1751
+ <div v-if="hasAPIKey && (user == null || status === 'init')">
1752
+ <splash :loading="status === 'init'" />
1753
+ </div>
1754
+ <div v-else-if="!hasAPIKey || user">
1755
+ <navbar :user="user" :roles="roles" />
1756
+ <div class="view">
1757
+ <router-view :key="$route.fullPath" :user="user" :roles="roles" :hasAPIKey="hasAPIKey" />
1758
+ </div>
1759
+ </div>
1760
+ </div>
1761
+ `,
1762
+ errorCaptured(err) {
1763
+ vanillatoasts.create({
1764
+ title: `Error: ${err?.response?.data?.message || err.message}`,
1765
+ icon: 'images/failure.jpg',
1766
+ timeout: 10000,
1767
+ positionClass: 'bottomRight'
1768
+ });
1769
+ },
1770
+ computed: {
1771
+ hasAPIKey() {
1772
+ return mothership.hasAPIKey;
1773
+ }
1774
+ },
1775
+ async mounted() {
1776
+ window.$router = this.$router;
1777
+ window.state = this;
1778
+
1779
+ if (mothership.hasAPIKey) {
1780
+ const href = window.location.href;
1781
+ if (href.match(/\?code=([a-zA-Z0-9]+)$/)) {
1782
+ const code = href.match(/\?code=([a-zA-Z0-9]+)$/)[1];
1783
+ try {
1784
+ const { accessToken, user, roles } = await mothership.github(code);
1785
+ if (roles == null) {
1786
+ this.authError = 'You are not authorized to access this workspace';
1787
+ return;
1788
+ }
1789
+ this.user = user;
1790
+ this.roles = roles;
1791
+ window.localStorage.setItem('_mongooseStudioAccessToken', accessToken._id);
1792
+ } catch (err) {
1793
+ this.authError = 'An error occurred while logging in. Please try again.';
1794
+ this.status = 'loaded';
1795
+ return;
1796
+ } finally {
1797
+ setTimeout(() => {
1798
+ this.$router.replace(this.$router.currentRoute.value.path);
1799
+ }, 0);
1800
+ }
1801
+
1802
+ const { nodeEnv } = await api.status();
1803
+ this.nodeEnv = nodeEnv;
1804
+ } else {
1805
+ const token = window.localStorage.getItem('_mongooseStudioAccessToken');
1806
+ if (token) {
1807
+ const { user, roles } = await mothership.me();
1808
+ this.user = user;
1809
+ this.roles = roles;
1810
+
1811
+ const { nodeEnv } = await api.status();
1812
+ this.nodeEnv = nodeEnv;
1813
+ }
1814
+ }
1815
+ } else {
1816
+ const { nodeEnv } = await api.status();
1817
+ this.nodeEnv = nodeEnv;
1818
+ }
1819
+ this.status = 'loaded';
1820
+ },
1821
+ setup() {
1822
+ const user = Vue.ref(null);
1823
+ const roles = Vue.ref(null);
1824
+ const status = Vue.ref('init');
1825
+ const nodeEnv = Vue.ref(null);
1826
+ const authError = Vue.ref(null);
1827
+
1828
+ const state = Vue.reactive({ user, roles, status, nodeEnv, authError });
1829
+ Vue.provide('state', state);
1830
+
1831
+ return state;
1832
+ }
1833
+ });
1834
+
1835
+ const { routes } = __webpack_require__(/*! ./routes */ "./frontend/src/routes.js");
1836
+ const router = VueRouter.createRouter({
1837
+ history: VueRouter.createWebHashHistory(),
1838
+ routes: routes.map(route => ({
1839
+ ...route,
1840
+ component: app.component(route.component),
1841
+ props: (route) => route.params
1842
+ }))
1843
+ });
1844
+
1845
+ app.use(router);
1846
+
1847
+ app.mount('#content');
1848
+
1849
+
1446
1850
  /***/ }),
1447
1851
 
1448
1852
  /***/ "./frontend/src/list-array/list-array.js":
@@ -1755,9 +2159,11 @@ const template = __webpack_require__(/*! ./modal.html */ "./frontend/src/modal/m
1755
2159
  appendCSS(__webpack_require__(/*! ./modal.css */ "./frontend/src/modal/modal.css"));
1756
2160
 
1757
2161
  module.exports = app => app.component('modal', {
1758
- template
2162
+ template,
2163
+ props: ['containerClass']
1759
2164
  });
1760
2165
 
2166
+
1761
2167
  /***/ }),
1762
2168
 
1763
2169
  /***/ "./frontend/src/models/models.js":
@@ -2194,6 +2600,9 @@ module.exports = app => app.component('navbar', {
2194
2600
  documentView() {
2195
2601
  return ['root', 'model', 'document'].includes(this.$route.name);
2196
2602
  },
2603
+ chatView() {
2604
+ return ['chat index', 'chat'].includes(this.$route.name);
2605
+ },
2197
2606
  routeName() {
2198
2607
  return this.$route.name;
2199
2608
  },
@@ -2264,9 +2673,9 @@ module.exports = app => app.component('navbar', {
2264
2673
 
2265
2674
  // Role-based access control configuration
2266
2675
  const roleAccess = {
2267
- owner: ['root', 'model', 'document', 'dashboards', 'dashboard', 'team'],
2268
- admin: ['root', 'model', 'document', 'dashboards', 'dashboard', 'team'],
2269
- member: ['root', 'model', 'document', 'dashboards', 'dashboard'],
2676
+ owner: ['root', 'model', 'document', 'dashboards', 'dashboard', 'team', 'chat'],
2677
+ admin: ['root', 'model', 'document', 'dashboards', 'dashboard', 'team', 'chat'],
2678
+ member: ['root', 'model', 'document', 'dashboards', 'dashboard', 'chat'],
2270
2679
  readonly: ['root', 'model', 'document'],
2271
2680
  dashboards: ['dashboards', 'dashboard']
2272
2681
  };
@@ -2327,11 +2736,27 @@ module.exports = {
2327
2736
  meta: {
2328
2737
  authorized: true
2329
2738
  }
2330
- }
2331
- ],
2332
- roleAccess,
2333
- hasAccess
2334
- };
2739
+ },
2740
+ {
2741
+ path: '/chat',
2742
+ name: 'chat index',
2743
+ component: 'chat',
2744
+ meta: {
2745
+ authorized: true
2746
+ }
2747
+ },
2748
+ {
2749
+ path: '/chat/:threadId',
2750
+ name: 'chat',
2751
+ component: 'chat',
2752
+ meta: {
2753
+ authorized: true
2754
+ }
2755
+ }
2756
+ ],
2757
+ roleAccess,
2758
+ hasAccess
2759
+ };
2335
2760
 
2336
2761
 
2337
2762
  /***/ }),
@@ -2456,6 +2881,184 @@ module.exports = app => app.component('team', {
2456
2881
  });
2457
2882
 
2458
2883
 
2884
+ /***/ }),
2885
+
2886
+ /***/ "./frontend/src sync recursive ^\\.\\/.*$":
2887
+ /*!*************************************!*\
2888
+ !*** ./frontend/src/ sync ^\.\/.*$ ***!
2889
+ \*************************************/
2890
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2891
+
2892
+ var map = {
2893
+ "./": "./frontend/src/index.js",
2894
+ "./api": "./frontend/src/api.js",
2895
+ "./api.js": "./frontend/src/api.js",
2896
+ "./appendCSS": "./frontend/src/appendCSS.js",
2897
+ "./appendCSS.js": "./frontend/src/appendCSS.js",
2898
+ "./async-button/async-button": "./frontend/src/async-button/async-button.js",
2899
+ "./async-button/async-button.html": "./frontend/src/async-button/async-button.html",
2900
+ "./async-button/async-button.js": "./frontend/src/async-button/async-button.js",
2901
+ "./chat/chat": "./frontend/src/chat/chat.js",
2902
+ "./chat/chat-message-script/chat-message-script": "./frontend/src/chat/chat-message-script/chat-message-script.js",
2903
+ "./chat/chat-message-script/chat-message-script.html": "./frontend/src/chat/chat-message-script/chat-message-script.html",
2904
+ "./chat/chat-message-script/chat-message-script.js": "./frontend/src/chat/chat-message-script/chat-message-script.js",
2905
+ "./chat/chat-message/chat-message": "./frontend/src/chat/chat-message/chat-message.js",
2906
+ "./chat/chat-message/chat-message.html": "./frontend/src/chat/chat-message/chat-message.html",
2907
+ "./chat/chat-message/chat-message.js": "./frontend/src/chat/chat-message/chat-message.js",
2908
+ "./chat/chat.html": "./frontend/src/chat/chat.html",
2909
+ "./chat/chat.js": "./frontend/src/chat/chat.js",
2910
+ "./clone-document/clone-document": "./frontend/src/clone-document/clone-document.js",
2911
+ "./clone-document/clone-document.css": "./frontend/src/clone-document/clone-document.css",
2912
+ "./clone-document/clone-document.html": "./frontend/src/clone-document/clone-document.html",
2913
+ "./clone-document/clone-document.js": "./frontend/src/clone-document/clone-document.js",
2914
+ "./create-dashboard/create-dashboard": "./frontend/src/create-dashboard/create-dashboard.js",
2915
+ "./create-dashboard/create-dashboard.html": "./frontend/src/create-dashboard/create-dashboard.html",
2916
+ "./create-dashboard/create-dashboard.js": "./frontend/src/create-dashboard/create-dashboard.js",
2917
+ "./create-document/create-document": "./frontend/src/create-document/create-document.js",
2918
+ "./create-document/create-document.css": "./frontend/src/create-document/create-document.css",
2919
+ "./create-document/create-document.html": "./frontend/src/create-document/create-document.html",
2920
+ "./create-document/create-document.js": "./frontend/src/create-document/create-document.js",
2921
+ "./dashboard-result/dashboard-chart/dashboard-chart": "./frontend/src/dashboard-result/dashboard-chart/dashboard-chart.js",
2922
+ "./dashboard-result/dashboard-chart/dashboard-chart.html": "./frontend/src/dashboard-result/dashboard-chart/dashboard-chart.html",
2923
+ "./dashboard-result/dashboard-chart/dashboard-chart.js": "./frontend/src/dashboard-result/dashboard-chart/dashboard-chart.js",
2924
+ "./dashboard-result/dashboard-document/dashboard-document": "./frontend/src/dashboard-result/dashboard-document/dashboard-document.js",
2925
+ "./dashboard-result/dashboard-document/dashboard-document.html": "./frontend/src/dashboard-result/dashboard-document/dashboard-document.html",
2926
+ "./dashboard-result/dashboard-document/dashboard-document.js": "./frontend/src/dashboard-result/dashboard-document/dashboard-document.js",
2927
+ "./dashboard-result/dashboard-primitive/dashboard-primitive": "./frontend/src/dashboard-result/dashboard-primitive/dashboard-primitive.js",
2928
+ "./dashboard-result/dashboard-primitive/dashboard-primitive.html": "./frontend/src/dashboard-result/dashboard-primitive/dashboard-primitive.html",
2929
+ "./dashboard-result/dashboard-primitive/dashboard-primitive.js": "./frontend/src/dashboard-result/dashboard-primitive/dashboard-primitive.js",
2930
+ "./dashboard-result/dashboard-result": "./frontend/src/dashboard-result/dashboard-result.js",
2931
+ "./dashboard-result/dashboard-result.html": "./frontend/src/dashboard-result/dashboard-result.html",
2932
+ "./dashboard-result/dashboard-result.js": "./frontend/src/dashboard-result/dashboard-result.js",
2933
+ "./dashboard-result/dashboard-text/dashboard-text": "./frontend/src/dashboard-result/dashboard-text/dashboard-text.js",
2934
+ "./dashboard-result/dashboard-text/dashboard-text.html": "./frontend/src/dashboard-result/dashboard-text/dashboard-text.html",
2935
+ "./dashboard-result/dashboard-text/dashboard-text.js": "./frontend/src/dashboard-result/dashboard-text/dashboard-text.js",
2936
+ "./dashboard/dashboard": "./frontend/src/dashboard/dashboard.js",
2937
+ "./dashboard/dashboard.html": "./frontend/src/dashboard/dashboard.html",
2938
+ "./dashboard/dashboard.js": "./frontend/src/dashboard/dashboard.js",
2939
+ "./dashboard/edit-dashboard/edit-dashboard": "./frontend/src/dashboard/edit-dashboard/edit-dashboard.js",
2940
+ "./dashboard/edit-dashboard/edit-dashboard.html": "./frontend/src/dashboard/edit-dashboard/edit-dashboard.html",
2941
+ "./dashboard/edit-dashboard/edit-dashboard.js": "./frontend/src/dashboard/edit-dashboard/edit-dashboard.js",
2942
+ "./dashboards/dashboards": "./frontend/src/dashboards/dashboards.js",
2943
+ "./dashboards/dashboards.html": "./frontend/src/dashboards/dashboards.html",
2944
+ "./dashboards/dashboards.js": "./frontend/src/dashboards/dashboards.js",
2945
+ "./detail-array/detail-array": "./frontend/src/detail-array/detail-array.js",
2946
+ "./detail-array/detail-array.html": "./frontend/src/detail-array/detail-array.html",
2947
+ "./detail-array/detail-array.js": "./frontend/src/detail-array/detail-array.js",
2948
+ "./detail-default/detail-default": "./frontend/src/detail-default/detail-default.js",
2949
+ "./detail-default/detail-default.html": "./frontend/src/detail-default/detail-default.html",
2950
+ "./detail-default/detail-default.js": "./frontend/src/detail-default/detail-default.js",
2951
+ "./document-details/document-details": "./frontend/src/document-details/document-details.js",
2952
+ "./document-details/document-details.css": "./frontend/src/document-details/document-details.css",
2953
+ "./document-details/document-details.html": "./frontend/src/document-details/document-details.html",
2954
+ "./document-details/document-details.js": "./frontend/src/document-details/document-details.js",
2955
+ "./document-details/document-property/document-property": "./frontend/src/document-details/document-property/document-property.js",
2956
+ "./document-details/document-property/document-property.css": "./frontend/src/document-details/document-property/document-property.css",
2957
+ "./document-details/document-property/document-property.html": "./frontend/src/document-details/document-property/document-property.html",
2958
+ "./document-details/document-property/document-property.js": "./frontend/src/document-details/document-property/document-property.js",
2959
+ "./document/confirm-changes/confirm-changes": "./frontend/src/document/confirm-changes/confirm-changes.js",
2960
+ "./document/confirm-changes/confirm-changes.html": "./frontend/src/document/confirm-changes/confirm-changes.html",
2961
+ "./document/confirm-changes/confirm-changes.js": "./frontend/src/document/confirm-changes/confirm-changes.js",
2962
+ "./document/confirm-delete/confirm-delete": "./frontend/src/document/confirm-delete/confirm-delete.js",
2963
+ "./document/confirm-delete/confirm-delete.html": "./frontend/src/document/confirm-delete/confirm-delete.html",
2964
+ "./document/confirm-delete/confirm-delete.js": "./frontend/src/document/confirm-delete/confirm-delete.js",
2965
+ "./document/document": "./frontend/src/document/document.js",
2966
+ "./document/document.css": "./frontend/src/document/document.css",
2967
+ "./document/document.html": "./frontend/src/document/document.html",
2968
+ "./document/document.js": "./frontend/src/document/document.js",
2969
+ "./edit-array/edit-array": "./frontend/src/edit-array/edit-array.js",
2970
+ "./edit-array/edit-array.css": "./frontend/src/edit-array/edit-array.css",
2971
+ "./edit-array/edit-array.html": "./frontend/src/edit-array/edit-array.html",
2972
+ "./edit-array/edit-array.js": "./frontend/src/edit-array/edit-array.js",
2973
+ "./edit-date/edit-date": "./frontend/src/edit-date/edit-date.js",
2974
+ "./edit-date/edit-date.html": "./frontend/src/edit-date/edit-date.html",
2975
+ "./edit-date/edit-date.js": "./frontend/src/edit-date/edit-date.js",
2976
+ "./edit-default/edit-default": "./frontend/src/edit-default/edit-default.js",
2977
+ "./edit-default/edit-default.html": "./frontend/src/edit-default/edit-default.html",
2978
+ "./edit-default/edit-default.js": "./frontend/src/edit-default/edit-default.js",
2979
+ "./edit-number/edit-number": "./frontend/src/edit-number/edit-number.js",
2980
+ "./edit-number/edit-number.html": "./frontend/src/edit-number/edit-number.html",
2981
+ "./edit-number/edit-number.js": "./frontend/src/edit-number/edit-number.js",
2982
+ "./edit-subdocument/edit-subdocument": "./frontend/src/edit-subdocument/edit-subdocument.js",
2983
+ "./edit-subdocument/edit-subdocument.html": "./frontend/src/edit-subdocument/edit-subdocument.html",
2984
+ "./edit-subdocument/edit-subdocument.js": "./frontend/src/edit-subdocument/edit-subdocument.js",
2985
+ "./export-query-results/export-query-results": "./frontend/src/export-query-results/export-query-results.js",
2986
+ "./export-query-results/export-query-results.css": "./frontend/src/export-query-results/export-query-results.css",
2987
+ "./export-query-results/export-query-results.html": "./frontend/src/export-query-results/export-query-results.html",
2988
+ "./export-query-results/export-query-results.js": "./frontend/src/export-query-results/export-query-results.js",
2989
+ "./index": "./frontend/src/index.js",
2990
+ "./index.js": "./frontend/src/index.js",
2991
+ "./list-array/list-array": "./frontend/src/list-array/list-array.js",
2992
+ "./list-array/list-array.css": "./frontend/src/list-array/list-array.css",
2993
+ "./list-array/list-array.html": "./frontend/src/list-array/list-array.html",
2994
+ "./list-array/list-array.js": "./frontend/src/list-array/list-array.js",
2995
+ "./list-default/list-default": "./frontend/src/list-default/list-default.js",
2996
+ "./list-default/list-default.css": "./frontend/src/list-default/list-default.css",
2997
+ "./list-default/list-default.html": "./frontend/src/list-default/list-default.html",
2998
+ "./list-default/list-default.js": "./frontend/src/list-default/list-default.js",
2999
+ "./list-json/list-json": "./frontend/src/list-json/list-json.js",
3000
+ "./list-json/list-json.css": "./frontend/src/list-json/list-json.css",
3001
+ "./list-json/list-json.html": "./frontend/src/list-json/list-json.html",
3002
+ "./list-json/list-json.js": "./frontend/src/list-json/list-json.js",
3003
+ "./list-mixed/list-mixed": "./frontend/src/list-mixed/list-mixed.js",
3004
+ "./list-mixed/list-mixed.css": "./frontend/src/list-mixed/list-mixed.css",
3005
+ "./list-mixed/list-mixed.html": "./frontend/src/list-mixed/list-mixed.html",
3006
+ "./list-mixed/list-mixed.js": "./frontend/src/list-mixed/list-mixed.js",
3007
+ "./list-string/list-string": "./frontend/src/list-string/list-string.js",
3008
+ "./list-string/list-string.css": "./frontend/src/list-string/list-string.css",
3009
+ "./list-string/list-string.html": "./frontend/src/list-string/list-string.html",
3010
+ "./list-string/list-string.js": "./frontend/src/list-string/list-string.js",
3011
+ "./list-subdocument/list-subdocument": "./frontend/src/list-subdocument/list-subdocument.js",
3012
+ "./list-subdocument/list-subdocument.css": "./frontend/src/list-subdocument/list-subdocument.css",
3013
+ "./list-subdocument/list-subdocument.html": "./frontend/src/list-subdocument/list-subdocument.html",
3014
+ "./list-subdocument/list-subdocument.js": "./frontend/src/list-subdocument/list-subdocument.js",
3015
+ "./modal/modal": "./frontend/src/modal/modal.js",
3016
+ "./modal/modal.css": "./frontend/src/modal/modal.css",
3017
+ "./modal/modal.html": "./frontend/src/modal/modal.html",
3018
+ "./modal/modal.js": "./frontend/src/modal/modal.js",
3019
+ "./models/models": "./frontend/src/models/models.js",
3020
+ "./models/models.css": "./frontend/src/models/models.css",
3021
+ "./models/models.html": "./frontend/src/models/models.html",
3022
+ "./models/models.js": "./frontend/src/models/models.js",
3023
+ "./mothership": "./frontend/src/mothership.js",
3024
+ "./mothership.js": "./frontend/src/mothership.js",
3025
+ "./navbar/navbar": "./frontend/src/navbar/navbar.js",
3026
+ "./navbar/navbar.css": "./frontend/src/navbar/navbar.css",
3027
+ "./navbar/navbar.html": "./frontend/src/navbar/navbar.html",
3028
+ "./navbar/navbar.js": "./frontend/src/navbar/navbar.js",
3029
+ "./routes": "./frontend/src/routes.js",
3030
+ "./routes.js": "./frontend/src/routes.js",
3031
+ "./splash/splash": "./frontend/src/splash/splash.js",
3032
+ "./splash/splash.html": "./frontend/src/splash/splash.html",
3033
+ "./splash/splash.js": "./frontend/src/splash/splash.js",
3034
+ "./team/new-invitation/new-invitation": "./frontend/src/team/new-invitation/new-invitation.js",
3035
+ "./team/new-invitation/new-invitation.html": "./frontend/src/team/new-invitation/new-invitation.html",
3036
+ "./team/new-invitation/new-invitation.js": "./frontend/src/team/new-invitation/new-invitation.js",
3037
+ "./team/team": "./frontend/src/team/team.js",
3038
+ "./team/team.html": "./frontend/src/team/team.html",
3039
+ "./team/team.js": "./frontend/src/team/team.js"
3040
+ };
3041
+
3042
+
3043
+ function webpackContext(req) {
3044
+ var id = webpackContextResolve(req);
3045
+ return __webpack_require__(id);
3046
+ }
3047
+ function webpackContextResolve(req) {
3048
+ if(!__webpack_require__.o(map, req)) {
3049
+ var e = new Error("Cannot find module '" + req + "'");
3050
+ e.code = 'MODULE_NOT_FOUND';
3051
+ throw e;
3052
+ }
3053
+ return map[req];
3054
+ }
3055
+ webpackContext.keys = function webpackContextKeys() {
3056
+ return Object.keys(map);
3057
+ };
3058
+ webpackContext.resolve = webpackContextResolve;
3059
+ module.exports = webpackContext;
3060
+ webpackContext.id = "./frontend/src sync recursive ^\\.\\/.*$";
3061
+
2459
3062
  /***/ }),
2460
3063
 
2461
3064
  /***/ "./node_modules/mpath/index.js":
@@ -3065,7 +3668,40 @@ module.exports = function stringToParts(str) {
3065
3668
  /***/ ((module) => {
3066
3669
 
3067
3670
  "use strict";
3068
- module.exports = "<button v-bind=\"attrsToBind\" :disabled=\"isDisabled\" @click=\"handleClick\">\n <slot></slot>\n</button>";
3671
+ module.exports = "<button v-bind=\"attrsToBind\" :disabled=\"isDisabled\" @click=\"handleClick\">\n <div v-if=\"status === 'in_progress'\" style=\"text-align: center\">\n <svg style=\"height: 1em\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <g>\n <circle cx=\"12\" cy=\"12\" r=\"10\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" opacity=\"0.3\" />\n <path d=\"M12 2a10 10 0 0 1 10 10\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\">\n <animateTransform attributeName=\"transform\" type=\"rotate\" from=\"0 12 12\" to=\"360 12 12\" dur=\"1s\" repeatCount=\"indefinite\" />\n </path>\n </g>\n </svg>\n </div>\n <slot v-if=\"status == 'success' || status == 'init'\"></slot>\n</button>\n";
3672
+
3673
+ /***/ }),
3674
+
3675
+ /***/ "./frontend/src/chat/chat-message-script/chat-message-script.html":
3676
+ /*!************************************************************************!*\
3677
+ !*** ./frontend/src/chat/chat-message-script/chat-message-script.html ***!
3678
+ \************************************************************************/
3679
+ /***/ ((module) => {
3680
+
3681
+ "use strict";
3682
+ module.exports = "<div class=\"relative border rounded bg-gray-100 text-black text-sm overflow-hidden\">\n <div class=\"flex border-b pt-[1px] text-xs font-medium bg-gray-200\">\n <button\n class=\"px-3 py-1 border-r border-gray-300 hover:bg-green-300\"\n :class=\"{'bg-gray-300': activeTab === 'code', 'bg-green-300': activeTab === 'code'}\"\n @click=\"activeTab = 'code'\">\n Code\n </button>\n <button\n class=\"px-3 py-1 hover:bg-green-300\"\n :class=\"{'bg-green-300': activeTab === 'output'}\"\n @click=\"activeTab = 'output'\">\n Output\n </button>\n <div class=\"ml-auto mr-1 flex\">\n <button\n v-if=\"activeTab === 'output'\"\n class=\"px-2 py-1 mr-1 text-xs bg-blue-500 text-white border-none rounded cursor-pointer hover:bg-blue-600 transition-colors flex items-center\"\n @click=\"openDetailModal\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"h-3 w-3\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 1v4m0 0h-4m4 0l-5-5\" />\n </svg>\n </button>\n <async-button\n class=\"px-2 py-1 text-xs bg-green-500 text-white border-none rounded cursor-pointer hover:bg-green-600 transition-colors disabled:bg-gray-400\"\n @click=\"executeScript(message, script)\">\n Execute\n </async-button>\n </div>\n </div>\n\n <pre class=\"p-3 whitespace-pre-wrap max-h-[30vh] overflow-y-auto\" v-show=\"activeTab === 'code'\"><code v-text=\"script\" ref=\"code\" :class=\"'language-' + language\"></code></pre>\n\n <pre class=\"p-3 whitespace-pre-wrap max-h-[30vh] overflow-y-auto bg-white border-t\" v-show=\"activeTab === 'output'\">\n <dashboard-chart v-if=\"message.executionResult?.output?.$chart\" :value=\"message.executionResult?.output\" />\n <div v-else>{{ message.executionResult?.output ? JSON.stringify(message.executionResult.output, null, 2) : 'No output' }}</div>\n </pre>\n\n <modal ref=\"outputModal\" v-if=\"showDetailModal\" containerClass=\"!h-[90vh] !w-[90vw]\">\n <template #body>\n <div class=\"absolute font-mono right-1 top-1 cursor-pointer text-xl\" @click=\"showDetailModal = false;\">&times;</div>\n <div class=\"h-full overflow-auto\">\n <dashboard-chart v-if=\"message.executionResult?.output?.$chart\" :value=\"message.executionResult?.output\" />\n <pre v-else class=\"whitespace-pre-wrap\">\n {{ message.executionResult?.output ? JSON.stringify(message.executionResult.output, null, 2) : 'No output' }}\n </pre>\n </div>\n </template>\n </modal>\n</div>\n";
3683
+
3684
+ /***/ }),
3685
+
3686
+ /***/ "./frontend/src/chat/chat-message/chat-message.html":
3687
+ /*!**********************************************************!*\
3688
+ !*** ./frontend/src/chat/chat-message/chat-message.html ***!
3689
+ \**********************************************************/
3690
+ /***/ ((module) => {
3691
+
3692
+ "use strict";
3693
+ module.exports = "<div class=\"relative flex items-start space-x-3\" :class=\"{'justify-end': message.role === 'user'}\">\n <div\n class=\"min-w-0 max-w-[calc(100%-6.5rem)]\"\n :class=\"{'text-right': message.role === 'user'}\">\n\n <div class=\"text-sm text-gray-900 p-3 rounded-md inline-block\" :class=\"styleForMessage\">\n <div v-for=\"part in contentSplitByScripts\">\n <div v-if=\"part.type === 'text'\" v-html=\"marked(part.content)\">\n </div>\n <div v-else-if=\"part.type === 'code'\">\n <chat-message-script :message=\"message\" :script=\"part.content\" :language=\"part.language\"></chat-message-script>\n </div>\n </div>\n </div>\n </div>\n</div>\n";
3694
+
3695
+ /***/ }),
3696
+
3697
+ /***/ "./frontend/src/chat/chat.html":
3698
+ /*!*************************************!*\
3699
+ !*** ./frontend/src/chat/chat.html ***!
3700
+ \*************************************/
3701
+ /***/ ((module) => {
3702
+
3703
+ "use strict";
3704
+ module.exports = "<div class=\"flex\" style=\"height: calc(100vh - 55px)\">\n <!-- Sidebar: Chat Threads -->\n <aside class=\"w-64 bg-gray-100 border-r overflow-y-auto h-full\">\n <div class=\"p-4 font-bold text-lg border-b\">Chat Threads</div>\n <div class=\"p-4\">\n <async-button\n @click=\"createNewThread\"\n class=\"w-full bg-blue-600 text-white px-4 py-2 rounded hover:bg-blue-700\"\n >\n Create New Thread\n </async-button>\n </div>\n <div v-if=\"status === 'loaded' && chatThreads.length === 0\" class=\"p-4 text-sm text-gray-700\">\n No threads yet\n </div>\n <ul vif=\"status === 'loaded'\">\n <li\n v-for=\"thread in chatThreads\"\n :key=\"thread._id\"\n @click=\"selectThread(thread._id)\"\n class=\"p-4 hover:bg-gray-200 cursor-pointer\"\n :class=\"{ 'bg-gray-300': thread._id === chatThreadId }\"\n >\n {{ thread.title || 'Untitled Thread' }}\n </li>\n </ul>\n </aside>\n\n <!-- Main Chat Area -->\n <main class=\"flex-1 flex flex-col\">\n <div class=\"flex-1 overflow-y-auto p-6 space-y-4\" ref=\"messagesContainer\">\n <ul role=\"list\" class=\"space-y-4\">\n <div v-if=\"true\">\n <div class=\"flex items-center justify-center py-3 mb-4\">\n <div class=\"bg-gray-300 h-px flex-grow max-w-xs\"></div>\n <p class=\"mx-4 text-sm font-medium text-gray-500\">This is the beginning of the message thread</p>\n <div class=\"bg-gray-300 h-px flex-grow max-w-xs\"></div>\n </div>\n </div>\n <li v-for=\"message in chatMessages\" :key=\"message._id\">\n <chat-message :message=\"message\"></chat-message>\n </li>\n </ul>\n </div>\n\n\n <!-- Input Area -->\n <div class=\"border-t p-4\">\n <form @submit.prevent=\"sendMessage\" :disabled=\"sendingMessage\" class=\"flex gap-2\">\n <input\n v-model=\"newMessage\"\n placeholder=\"Ask something...\"\n class=\"flex-1 border rounded px-4 py-2\"\n />\n <button class=\"bg-blue-600 text-white px-4 py-2 rounded disabled:bg-gray-600\" :disabled=\"sendingMessage\">\n <svg v-if=\"sendingMessage\" style=\"height: 1em\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <g>\n <circle cx=\"12\" cy=\"12\" r=\"10\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" opacity=\"0.3\" />\n <path d=\"M12 2a10 10 0 0 1 10 10\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\">\n <animateTransform attributeName=\"transform\" type=\"rotate\" from=\"0 12 12\" to=\"360 12 12\" dur=\"1s\" repeatCount=\"indefinite\" />\n </path>\n </g>\n </svg>\n <span v-else>Send</span>\n </button>\n </form>\n </div>\n </main>\n</div>\n";
3069
3705
 
3070
3706
  /***/ }),
3071
3707
 
@@ -3560,7 +4196,7 @@ module.exports = "/** Vue modal */\n\n.modal-mask {\n position: fixed;\n z-ind
3560
4196
  /***/ ((module) => {
3561
4197
 
3562
4198
  "use strict";
3563
- module.exports = "<transition name=\"modal\">\n <div class=\"modal-mask\">\n <div class=\"modal-wrapper\">\n <div class=\"modal-container\">\n <div class=\"modal-body\">\n <slot name=\"body\">\n </slot>\n </div>\n </div>\n </div>\n </div>\n</transition>";
4199
+ module.exports = "<transition name=\"modal\">\n <div class=\"modal-mask\">\n <div class=\"modal-wrapper\">\n <div class=\"modal-container\" :class=\"containerClass\">\n <div class=\"modal-body\">\n <slot name=\"body\">\n </slot>\n </div>\n </div>\n </div>\n </div>\n</transition>\n";
3564
4200
 
3565
4201
  /***/ }),
3566
4202
 
@@ -3604,7 +4240,7 @@ module.exports = ".navbar {\n width: 100%;\n background-color: #eee;\n}\n\n.ac
3604
4240
  /***/ ((module) => {
3605
4241
 
3606
4242
  "use strict";
3607
- module.exports = "<div class=\"navbar\">\n <div class=\"nav-left flex items-center gap-4 h-full\">\n <router-link :to=\"{ name: defaultRoute }\">\n <img src=\"images/logo.svg\" alt=\"Mongoose Studio Logo\" />\n </router-link>\n <div v-if=\"!!state.nodeEnv\" class=\"inline-flex items-center rounded-md px-2 py-1 text-sm font-medium text-gray-900\" :class=\"warnEnv ? 'bg-red-300' : 'bg-yellow-300'\">\n {{state.nodeEnv}}\n </div>\n </div>\n <div class=\"nav-right h-full\">\n <div class=\"sm:ml-6 sm:flex sm:space-x-8 h-full\">\n <a v-if=\"hasAccess(roles, 'root')\"\n href=\"#/\"\n class=\"inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium\"\n :class=\"documentView ? 'text-gray-900 border-ultramarine-500' : 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700'\">Documents</a>\n <a v-if=\"hasAccess(roles, 'dashboards')\"\n href=\"#/dashboards\"\n class=\"inline-flex items-center border-b-2 px-1 pt-1 text-sm font-medium\"\n :class=\"dashboardView ? 'text-gray-900 border-ultramarine-500' : 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700'\">Dashboards</a>\n\n <div class=\"h-full flex items-center\" v-if=\"!user && hasAPIKey\">\n <button\n type=\"button\"\n @click=\"loginWithGithub\"\n class=\"rounded bg-ultramarine-600 px-2 py-2 text-sm font-semibold text-white shadow-sm hover:bg-ultramarine-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ultramarine-600\">\n Login\n </button>\n </div>\n <div v-if=\"user && hasAPIKey\" class=\"h-full flex items-center relative\" v-clickOutside=\"hideFlyout\">\n <div>\n <button type=\"button\" @click=\"showFlyout = !showFlyout\" class=\"relative flex rounded-full bg-gray-800 text-sm focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-gray-800\" id=\"user-menu-button\" aria-expanded=\"false\" aria-haspopup=\"true\">\n <span class=\"absolute -inset-1.5\"></span>\n <span class=\"sr-only\">Open user menu</span>\n <img class=\"size-8 rounded-full\" :src=\"user.picture\" alt=\"\">\n </button>\n </div>\n\n <div v-if=\"showFlyout\" class=\"absolute right-0 z-10 top-[90%] w-48 origin-top-right rounded-md bg-white py-1 shadow-lg ring-1 ring-black/5 focus:outline-none\" role=\"menu\" aria-orientation=\"vertical\" aria-labelledby=\"user-menu-button\" tabindex=\"-1\">\n <router-link to=\"/team\" v-if=\"hasAccess(roles, 'team')\" @click=\"showFlyout = false\" class=\"cursor-pointer block px-4 py-2 text-sm text-gray-700 hover:bg-ultramarine-200\" role=\"menuitem\" tabindex=\"-1\" id=\"user-menu-item-2\">Team</router-link>\n <span @click=\"logout\" class=\"cursor-pointer block px-4 py-2 text-sm text-gray-700 hover:bg-ultramarine-200\" role=\"menuitem\" tabindex=\"-1\" id=\"user-menu-item-2\">Sign out</span>\n </div>\n </div>\n\n </div>\n </div>\n <div style=\"clear: both\"></div>\n</div>\n";
4243
+ module.exports = "<div class=\"navbar\">\n <div class=\"nav-left flex items-center gap-4 h-full\">\n <router-link :to=\"{ name: defaultRoute }\">\n <img src=\"images/logo.svg\" alt=\"Mongoose Studio Logo\" />\n </router-link>\n <div v-if=\"!!state.nodeEnv\" class=\"inline-flex items-center rounded-md px-2 py-1 text-sm font-medium text-gray-900\" :class=\"warnEnv ? 'bg-red-300' : 'bg-yellow-300'\">\n {{state.nodeEnv}}\n </div>\n </div>\n <div class=\"nav-right h-full\">\n <div class=\"sm:ml-6 sm:flex sm:space-x-8 h-full\">\n <a v-if=\"hasAccess(roles, 'root')\"\n href=\"#/\"\n class=\"inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium\"\n :class=\"documentView ? 'text-gray-900 border-ultramarine-500' : 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700'\">Documents</a>\n <a v-if=\"hasAccess(roles, 'dashboards')\"\n href=\"#/dashboards\"\n class=\"inline-flex items-center border-b-2 px-1 pt-1 text-sm font-medium\"\n :class=\"dashboardView ? 'text-gray-900 border-ultramarine-500' : 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700'\">Dashboards</a>\n <a v-if=\"hasAccess(roles, 'chat')\"\n href=\"#/chat\"\n class=\"inline-flex items-center border-b-2 px-1 pt-1 text-sm font-medium\"\n :class=\"chatView ? 'text-gray-900 border-ultramarine-500' : 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700'\">Chat</a>\n\n <div class=\"h-full flex items-center\" v-if=\"!user && hasAPIKey\">\n <button\n type=\"button\"\n @click=\"loginWithGithub\"\n class=\"rounded bg-ultramarine-600 px-2 py-2 text-sm font-semibold text-white shadow-sm hover:bg-ultramarine-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ultramarine-600\">\n Login\n </button>\n </div>\n <div v-if=\"user && hasAPIKey\" class=\"h-full flex items-center relative\" v-clickOutside=\"hideFlyout\">\n <div>\n <button type=\"button\" @click=\"showFlyout = !showFlyout\" class=\"relative flex rounded-full bg-gray-800 text-sm focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-gray-800\" id=\"user-menu-button\" aria-expanded=\"false\" aria-haspopup=\"true\">\n <span class=\"absolute -inset-1.5\"></span>\n <span class=\"sr-only\">Open user menu</span>\n <img class=\"size-8 rounded-full\" :src=\"user.picture\" alt=\"\">\n </button>\n </div>\n\n <div v-if=\"showFlyout\" class=\"absolute right-0 z-10 top-[90%] w-48 origin-top-right rounded-md bg-white py-1 shadow-lg ring-1 ring-black/5 focus:outline-none\" role=\"menu\" aria-orientation=\"vertical\" aria-labelledby=\"user-menu-button\" tabindex=\"-1\">\n <router-link to=\"/team\" v-if=\"hasAccess(roles, 'team')\" @click=\"showFlyout = false\" class=\"cursor-pointer block px-4 py-2 text-sm text-gray-700 hover:bg-ultramarine-200\" role=\"menuitem\" tabindex=\"-1\" id=\"user-menu-item-2\">Team</router-link>\n <span @click=\"logout\" class=\"cursor-pointer block px-4 py-2 text-sm text-gray-700 hover:bg-ultramarine-200\" role=\"menuitem\" tabindex=\"-1\" id=\"user-menu-item-2\">Sign out</span>\n </div>\n </div>\n\n </div>\n </div>\n <div style=\"clear: both\"></div>\n</div>\n";
3608
4244
 
3609
4245
  /***/ }),
3610
4246
 
@@ -11403,209 +12039,2280 @@ exports.setInternalBufferSize = setInternalBufferSize;
11403
12039
  //# sourceMappingURL=bson.cjs.map
11404
12040
 
11405
12041
 
11406
- /***/ })
12042
+ /***/ }),
11407
12043
 
11408
- /******/ });
11409
- /************************************************************************/
11410
- /******/ // The module cache
11411
- /******/ var __webpack_module_cache__ = {};
11412
- /******/
11413
- /******/ // The require function
11414
- /******/ function __webpack_require__(moduleId) {
11415
- /******/ // Check if module is in cache
11416
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
11417
- /******/ if (cachedModule !== undefined) {
11418
- /******/ return cachedModule.exports;
11419
- /******/ }
11420
- /******/ // Create a new module (and put it into the cache)
11421
- /******/ var module = __webpack_module_cache__[moduleId] = {
11422
- /******/ // no module.id needed
11423
- /******/ // no module.loaded needed
11424
- /******/ exports: {}
11425
- /******/ };
11426
- /******/
11427
- /******/ // Execute the module function
11428
- /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
11429
- /******/
11430
- /******/ // Return the exports of the module
11431
- /******/ return module.exports;
11432
- /******/ }
11433
- /******/
11434
- /************************************************************************/
11435
- /******/ /* webpack/runtime/global */
11436
- /******/ (() => {
11437
- /******/ __webpack_require__.g = (function() {
11438
- /******/ if (typeof globalThis === 'object') return globalThis;
11439
- /******/ try {
11440
- /******/ return this || new Function('return this')();
11441
- /******/ } catch (e) {
11442
- /******/ if (typeof window === 'object') return window;
11443
- /******/ }
11444
- /******/ })();
11445
- /******/ })();
11446
- /******/
11447
- /************************************************************************/
11448
- var __webpack_exports__ = {};
11449
- // This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
11450
- (() => {
11451
- "use strict";
11452
- /*!*******************************!*\
11453
- !*** ./frontend/src/index.js ***!
11454
- \*******************************/
12044
+ /***/ "./node_modules/marked/lib/marked.cjs":
12045
+ /*!********************************************!*\
12046
+ !*** ./node_modules/marked/lib/marked.cjs ***!
12047
+ \********************************************/
12048
+ /***/ ((module) => {
11455
12049
 
12050
+ "use strict";
12051
+ /**
12052
+ * marked v15.0.12 - a markdown parser
12053
+ * Copyright (c) 2011-2025, Christopher Jeffrey. (MIT Licensed)
12054
+ * https://github.com/markedjs/marked
12055
+ */
11456
12056
 
11457
- if (typeof process === 'undefined') {
11458
- __webpack_require__.g.process = { env: {} }; // To make `util` package work
11459
- }
12057
+ /**
12058
+ * DO NOT EDIT THIS FILE
12059
+ * The code in this file is generated from files in ./src/
12060
+ */
11460
12061
 
11461
- const api = __webpack_require__(/*! ./api */ "./frontend/src/api.js");
11462
- const mothership = __webpack_require__(/*! ./mothership */ "./frontend/src/mothership.js");
11463
- const vanillatoasts = __webpack_require__(/*! vanillatoasts */ "./node_modules/vanillatoasts/vanillatoasts.js");
11464
12062
 
11465
- const app = Vue.createApp({
11466
- template: '<app-component />'
12063
+ var __defProp = Object.defineProperty;
12064
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12065
+ var __getOwnPropNames = Object.getOwnPropertyNames;
12066
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
12067
+ var __export = (target, all) => {
12068
+ for (var name in all)
12069
+ __defProp(target, name, { get: all[name], enumerable: true });
12070
+ };
12071
+ var __copyProps = (to, from, except, desc) => {
12072
+ if (from && typeof from === "object" || typeof from === "function") {
12073
+ for (let key of __getOwnPropNames(from))
12074
+ if (!__hasOwnProp.call(to, key) && key !== except)
12075
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12076
+ }
12077
+ return to;
12078
+ };
12079
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
12080
+
12081
+ // src/marked.ts
12082
+ var marked_exports = {};
12083
+ __export(marked_exports, {
12084
+ Hooks: () => _Hooks,
12085
+ Lexer: () => _Lexer,
12086
+ Marked: () => Marked,
12087
+ Parser: () => _Parser,
12088
+ Renderer: () => _Renderer,
12089
+ TextRenderer: () => _TextRenderer,
12090
+ Tokenizer: () => _Tokenizer,
12091
+ defaults: () => _defaults,
12092
+ getDefaults: () => _getDefaults,
12093
+ lexer: () => lexer,
12094
+ marked: () => marked,
12095
+ options: () => options,
12096
+ parse: () => parse,
12097
+ parseInline: () => parseInline,
12098
+ parser: () => parser,
12099
+ setOptions: () => setOptions,
12100
+ use: () => use,
12101
+ walkTokens: () => walkTokens
11467
12102
  });
12103
+ module.exports = __toCommonJS(marked_exports);
12104
+
12105
+ // src/defaults.ts
12106
+ function _getDefaults() {
12107
+ return {
12108
+ async: false,
12109
+ breaks: false,
12110
+ extensions: null,
12111
+ gfm: true,
12112
+ hooks: null,
12113
+ pedantic: false,
12114
+ renderer: null,
12115
+ silent: false,
12116
+ tokenizer: null,
12117
+ walkTokens: null
12118
+ };
12119
+ }
12120
+ var _defaults = _getDefaults();
12121
+ function changeDefaults(newDefaults) {
12122
+ _defaults = newDefaults;
12123
+ }
12124
+
12125
+ // src/rules.ts
12126
+ var noopTest = { exec: () => null };
12127
+ function edit(regex, opt = "") {
12128
+ let source = typeof regex === "string" ? regex : regex.source;
12129
+ const obj = {
12130
+ replace: (name, val) => {
12131
+ let valSource = typeof val === "string" ? val : val.source;
12132
+ valSource = valSource.replace(other.caret, "$1");
12133
+ source = source.replace(name, valSource);
12134
+ return obj;
12135
+ },
12136
+ getRegex: () => {
12137
+ return new RegExp(source, opt);
12138
+ }
12139
+ };
12140
+ return obj;
12141
+ }
12142
+ var other = {
12143
+ codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
12144
+ outputLinkReplace: /\\([\[\]])/g,
12145
+ indentCodeCompensation: /^(\s+)(?:```)/,
12146
+ beginningSpace: /^\s+/,
12147
+ endingHash: /#$/,
12148
+ startingSpaceChar: /^ /,
12149
+ endingSpaceChar: / $/,
12150
+ nonSpaceChar: /[^ ]/,
12151
+ newLineCharGlobal: /\n/g,
12152
+ tabCharGlobal: /\t/g,
12153
+ multipleSpaceGlobal: /\s+/g,
12154
+ blankLine: /^[ \t]*$/,
12155
+ doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
12156
+ blockquoteStart: /^ {0,3}>/,
12157
+ blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
12158
+ blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
12159
+ listReplaceTabs: /^\t+/,
12160
+ listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
12161
+ listIsTask: /^\[[ xX]\] /,
12162
+ listReplaceTask: /^\[[ xX]\] +/,
12163
+ anyLine: /\n.*\n/,
12164
+ hrefBrackets: /^<(.*)>$/,
12165
+ tableDelimiter: /[:|]/,
12166
+ tableAlignChars: /^\||\| *$/g,
12167
+ tableRowBlankLine: /\n[ \t]*$/,
12168
+ tableAlignRight: /^ *-+: *$/,
12169
+ tableAlignCenter: /^ *:-+: *$/,
12170
+ tableAlignLeft: /^ *:-+ *$/,
12171
+ startATag: /^<a /i,
12172
+ endATag: /^<\/a>/i,
12173
+ startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
12174
+ endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
12175
+ startAngleBracket: /^</,
12176
+ endAngleBracket: />$/,
12177
+ pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
12178
+ unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
12179
+ escapeTest: /[&<>"']/,
12180
+ escapeReplace: /[&<>"']/g,
12181
+ escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
12182
+ escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
12183
+ unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,
12184
+ caret: /(^|[^\[])\^/g,
12185
+ percentDecode: /%25/g,
12186
+ findPipe: /\|/g,
12187
+ splitPipe: / \|/,
12188
+ slashPipe: /\\\|/g,
12189
+ carriageReturn: /\r\n|\r/g,
12190
+ spaceLine: /^ +$/gm,
12191
+ notSpaceStart: /^\S*/,
12192
+ endingNewline: /\n$/,
12193
+ listItemRegex: (bull) => new RegExp(`^( {0,3}${bull})((?:[ ][^\\n]*)?(?:\\n|$))`),
12194
+ nextBulletRegex: (indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),
12195
+ hrRegex: (indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),
12196
+ fencesBeginRegex: (indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\`\`\`|~~~)`),
12197
+ headingBeginRegex: (indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`),
12198
+ htmlBeginRegex: (indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}<(?:[a-z].*>|!--)`, "i")
12199
+ };
12200
+ var newline = /^(?:[ \t]*(?:\n|$))+/;
12201
+ var blockCode = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
12202
+ var fences = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
12203
+ var hr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
12204
+ var heading = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
12205
+ var bullet = /(?:[*+-]|\d{1,9}[.)])/;
12206
+ var lheadingCore = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
12207
+ var lheading = edit(lheadingCore).replace(/bull/g, bullet).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();
12208
+ var lheadingGfm = edit(lheadingCore).replace(/bull/g, bullet).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();
12209
+ var _paragraph = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
12210
+ var blockText = /^[^\n]+/;
12211
+ var _blockLabel = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
12212
+ var def = edit(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", _blockLabel).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
12213
+ var list = edit(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, bullet).getRegex();
12214
+ var _tag = "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";
12215
+ var _comment = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
12216
+ var html = edit(
12217
+ "^ {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|$))",
12218
+ "i"
12219
+ ).replace("comment", _comment).replace("tag", _tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
12220
+ var paragraph = edit(_paragraph).replace("hr", hr).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[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex();
12221
+ var blockquote = edit(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", paragraph).getRegex();
12222
+ var blockNormal = {
12223
+ blockquote,
12224
+ code: blockCode,
12225
+ def,
12226
+ fences,
12227
+ heading,
12228
+ hr,
12229
+ html,
12230
+ lheading,
12231
+ list,
12232
+ newline,
12233
+ paragraph,
12234
+ table: noopTest,
12235
+ text: blockText
12236
+ };
12237
+ var gfmTable = edit(
12238
+ "^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
12239
+ ).replace("hr", hr).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[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex();
12240
+ var blockGfm = {
12241
+ ...blockNormal,
12242
+ lheading: lheadingGfm,
12243
+ table: gfmTable,
12244
+ paragraph: edit(_paragraph).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", gfmTable).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex()
12245
+ };
12246
+ var blockPedantic = {
12247
+ ...blockNormal,
12248
+ html: edit(
12249
+ `^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`
12250
+ ).replace("comment", _comment).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(),
12251
+ def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
12252
+ heading: /^(#{1,6})(.*)(?:\n+|$)/,
12253
+ fences: noopTest,
12254
+ // fences not supported
12255
+ lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
12256
+ paragraph: edit(_paragraph).replace("hr", hr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", lheading).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
12257
+ };
12258
+ var escape = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
12259
+ var inlineCode = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
12260
+ var br = /^( {2,}|\\)\n(?!\s*$)/;
12261
+ var inlineText = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
12262
+ var _punctuation = /[\p{P}\p{S}]/u;
12263
+ var _punctuationOrSpace = /[\s\p{P}\p{S}]/u;
12264
+ var _notPunctuationOrSpace = /[^\s\p{P}\p{S}]/u;
12265
+ var punctuation = edit(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, _punctuationOrSpace).getRegex();
12266
+ var _punctuationGfmStrongEm = /(?!~)[\p{P}\p{S}]/u;
12267
+ var _punctuationOrSpaceGfmStrongEm = /(?!~)[\s\p{P}\p{S}]/u;
12268
+ var _notPunctuationOrSpaceGfmStrongEm = /(?:[^\s\p{P}\p{S}]|~)/u;
12269
+ var blockSkip = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g;
12270
+ var emStrongLDelimCore = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/;
12271
+ var emStrongLDelim = edit(emStrongLDelimCore, "u").replace(/punct/g, _punctuation).getRegex();
12272
+ var emStrongLDelimGfm = edit(emStrongLDelimCore, "u").replace(/punct/g, _punctuationGfmStrongEm).getRegex();
12273
+ var emStrongRDelimAstCore = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
12274
+ var emStrongRDelimAst = edit(emStrongRDelimAstCore, "gu").replace(/notPunctSpace/g, _notPunctuationOrSpace).replace(/punctSpace/g, _punctuationOrSpace).replace(/punct/g, _punctuation).getRegex();
12275
+ var emStrongRDelimAstGfm = edit(emStrongRDelimAstCore, "gu").replace(/notPunctSpace/g, _notPunctuationOrSpaceGfmStrongEm).replace(/punctSpace/g, _punctuationOrSpaceGfmStrongEm).replace(/punct/g, _punctuationGfmStrongEm).getRegex();
12276
+ var emStrongRDelimUnd = edit(
12277
+ "^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)",
12278
+ "gu"
12279
+ ).replace(/notPunctSpace/g, _notPunctuationOrSpace).replace(/punctSpace/g, _punctuationOrSpace).replace(/punct/g, _punctuation).getRegex();
12280
+ var anyPunctuation = edit(/\\(punct)/, "gu").replace(/punct/g, _punctuation).getRegex();
12281
+ var autolink = edit(/^<(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();
12282
+ var _inlineComment = edit(_comment).replace("(?:-->|$)", "-->").getRegex();
12283
+ var tag = edit(
12284
+ "^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>"
12285
+ ).replace("comment", _inlineComment).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
12286
+ var _inlineLabel = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
12287
+ var link = edit(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", _inlineLabel).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
12288
+ var reflink = edit(/^!?\[(label)\]\[(ref)\]/).replace("label", _inlineLabel).replace("ref", _blockLabel).getRegex();
12289
+ var nolink = edit(/^!?\[(ref)\](?:\[\])?/).replace("ref", _blockLabel).getRegex();
12290
+ var reflinkSearch = edit("reflink|nolink(?!\\()", "g").replace("reflink", reflink).replace("nolink", nolink).getRegex();
12291
+ var inlineNormal = {
12292
+ _backpedal: noopTest,
12293
+ // only used for GFM url
12294
+ anyPunctuation,
12295
+ autolink,
12296
+ blockSkip,
12297
+ br,
12298
+ code: inlineCode,
12299
+ del: noopTest,
12300
+ emStrongLDelim,
12301
+ emStrongRDelimAst,
12302
+ emStrongRDelimUnd,
12303
+ escape,
12304
+ link,
12305
+ nolink,
12306
+ punctuation,
12307
+ reflink,
12308
+ reflinkSearch,
12309
+ tag,
12310
+ text: inlineText,
12311
+ url: noopTest
12312
+ };
12313
+ var inlinePedantic = {
12314
+ ...inlineNormal,
12315
+ link: edit(/^!?\[(label)\]\((.*?)\)/).replace("label", _inlineLabel).getRegex(),
12316
+ reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", _inlineLabel).getRegex()
12317
+ };
12318
+ var inlineGfm = {
12319
+ ...inlineNormal,
12320
+ emStrongRDelimAst: emStrongRDelimAstGfm,
12321
+ emStrongLDelim: emStrongLDelimGfm,
12322
+ url: edit(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
12323
+ _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
12324
+ del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,
12325
+ text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
12326
+ };
12327
+ var inlineBreaks = {
12328
+ ...inlineGfm,
12329
+ br: edit(br).replace("{2,}", "*").getRegex(),
12330
+ text: edit(inlineGfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
12331
+ };
12332
+ var block = {
12333
+ normal: blockNormal,
12334
+ gfm: blockGfm,
12335
+ pedantic: blockPedantic
12336
+ };
12337
+ var inline = {
12338
+ normal: inlineNormal,
12339
+ gfm: inlineGfm,
12340
+ breaks: inlineBreaks,
12341
+ pedantic: inlinePedantic
12342
+ };
11468
12343
 
11469
- __webpack_require__(/*! ./async-button/async-button */ "./frontend/src/async-button/async-button.js")(app);
11470
- __webpack_require__(/*! ./clone-document/clone-document */ "./frontend/src/clone-document/clone-document.js")(app);
11471
- __webpack_require__(/*! ./create-dashboard/create-dashboard */ "./frontend/src/create-dashboard/create-dashboard.js")(app);
11472
- __webpack_require__(/*! ./create-document/create-document */ "./frontend/src/create-document/create-document.js")(app);
11473
- __webpack_require__(/*! ./dashboards/dashboards */ "./frontend/src/dashboards/dashboards.js")(app);
11474
- __webpack_require__(/*! ./dashboard/dashboard */ "./frontend/src/dashboard/dashboard.js")(app);
11475
- __webpack_require__(/*! ./dashboard-result/dashboard-result */ "./frontend/src/dashboard-result/dashboard-result.js")(app);
11476
- __webpack_require__(/*! ./dashboard-result/dashboard-chart/dashboard-chart */ "./frontend/src/dashboard-result/dashboard-chart/dashboard-chart.js")(app);
11477
- __webpack_require__(/*! ./dashboard-result/dashboard-document/dashboard-document */ "./frontend/src/dashboard-result/dashboard-document/dashboard-document.js")(app);
11478
- __webpack_require__(/*! ./dashboard-result/dashboard-primitive/dashboard-primitive */ "./frontend/src/dashboard-result/dashboard-primitive/dashboard-primitive.js")(app);
11479
- __webpack_require__(/*! ./dashboard-result/dashboard-text/dashboard-text */ "./frontend/src/dashboard-result/dashboard-text/dashboard-text.js")(app);
11480
- __webpack_require__(/*! ./dashboard/edit-dashboard/edit-dashboard */ "./frontend/src/dashboard/edit-dashboard/edit-dashboard.js")(app)
11481
- __webpack_require__(/*! ./detail-array/detail-array */ "./frontend/src/detail-array/detail-array.js")(app);
11482
- __webpack_require__(/*! ./detail-default/detail-default */ "./frontend/src/detail-default/detail-default.js")(app);
11483
- __webpack_require__(/*! ./document/document */ "./frontend/src/document/document.js")(app);
11484
- __webpack_require__(/*! ./document/confirm-changes/confirm-changes */ "./frontend/src/document/confirm-changes/confirm-changes.js")(app);
11485
- __webpack_require__(/*! ./document/confirm-delete/confirm-delete */ "./frontend/src/document/confirm-delete/confirm-delete.js")(app);
11486
- __webpack_require__(/*! ./document-details/document-details */ "./frontend/src/document-details/document-details.js")(app);
11487
- __webpack_require__(/*! ./document-details/document-property/document-property */ "./frontend/src/document-details/document-property/document-property.js")(app);
11488
- __webpack_require__(/*! ./edit-array/edit-array */ "./frontend/src/edit-array/edit-array.js")(app);
11489
- __webpack_require__(/*! ./edit-default/edit-default */ "./frontend/src/edit-default/edit-default.js")(app);
11490
- __webpack_require__(/*! ./edit-number/edit-number */ "./frontend/src/edit-number/edit-number.js")(app);
11491
- __webpack_require__(/*! ./edit-date/edit-date */ "./frontend/src/edit-date/edit-date.js")(app);
11492
- __webpack_require__(/*! ./edit-subdocument/edit-subdocument */ "./frontend/src/edit-subdocument/edit-subdocument.js")(app);
11493
- __webpack_require__(/*! ./export-query-results/export-query-results */ "./frontend/src/export-query-results/export-query-results.js")(app);
11494
- __webpack_require__(/*! ./list-array/list-array */ "./frontend/src/list-array/list-array.js")(app);
11495
- __webpack_require__(/*! ./list-default/list-default */ "./frontend/src/list-default/list-default.js")(app);
11496
- __webpack_require__(/*! ./list-json/list-json */ "./frontend/src/list-json/list-json.js")(app)
11497
- __webpack_require__(/*! ./list-mixed/list-mixed */ "./frontend/src/list-mixed/list-mixed.js")(app);
11498
- __webpack_require__(/*! ./list-string/list-string */ "./frontend/src/list-string/list-string.js")(app);
11499
- __webpack_require__(/*! ./list-subdocument/list-subdocument */ "./frontend/src/list-subdocument/list-subdocument.js")(app);
11500
- __webpack_require__(/*! ./modal/modal */ "./frontend/src/modal/modal.js")(app);
11501
- __webpack_require__(/*! ./models/models */ "./frontend/src/models/models.js")(app);
11502
- __webpack_require__(/*! ./navbar/navbar */ "./frontend/src/navbar/navbar.js")(app);
11503
- __webpack_require__(/*! ./splash/splash */ "./frontend/src/splash/splash.js")(app);
11504
- __webpack_require__(/*! ./team/team */ "./frontend/src/team/team.js")(app);
11505
- __webpack_require__(/*! ./team/new-invitation/new-invitation */ "./frontend/src/team/new-invitation/new-invitation.js")(app);
11506
-
11507
- app.component('app-component', {
11508
- template: `
11509
- <div>
11510
- <div v-if="hasAPIKey && (user == null || status === 'init')">
11511
- <splash :loading="status === 'init'" />
11512
- </div>
11513
- <div v-else-if="!hasAPIKey || user">
11514
- <navbar :user="user" :roles="roles" />
11515
- <div class="view">
11516
- <router-view :key="$route.fullPath" :user="user" :roles="roles" :hasAPIKey="hasAPIKey" />
11517
- </div>
11518
- </div>
11519
- </div>
11520
- `,
11521
- errorCaptured(err) {
11522
- vanillatoasts.create({
11523
- title: `Error: ${err?.response?.data?.message || err.message}`,
11524
- icon: 'images/failure.jpg',
11525
- timeout: 10000,
11526
- positionClass: 'bottomRight'
11527
- });
11528
- },
11529
- computed: {
11530
- hasAPIKey() {
11531
- return mothership.hasAPIKey;
12344
+ // src/helpers.ts
12345
+ var escapeReplacements = {
12346
+ "&": "&amp;",
12347
+ "<": "&lt;",
12348
+ ">": "&gt;",
12349
+ '"': "&quot;",
12350
+ "'": "&#39;"
12351
+ };
12352
+ var getEscapeReplacement = (ch) => escapeReplacements[ch];
12353
+ function escape2(html2, encode) {
12354
+ if (encode) {
12355
+ if (other.escapeTest.test(html2)) {
12356
+ return html2.replace(other.escapeReplace, getEscapeReplacement);
11532
12357
  }
11533
- },
11534
- async mounted() {
11535
- window.$router = this.$router;
11536
- window.state = this;
12358
+ } else {
12359
+ if (other.escapeTestNoEncode.test(html2)) {
12360
+ return html2.replace(other.escapeReplaceNoEncode, getEscapeReplacement);
12361
+ }
12362
+ }
12363
+ return html2;
12364
+ }
12365
+ function cleanUrl(href) {
12366
+ try {
12367
+ href = encodeURI(href).replace(other.percentDecode, "%");
12368
+ } catch {
12369
+ return null;
12370
+ }
12371
+ return href;
12372
+ }
12373
+ function splitCells(tableRow, count) {
12374
+ const row = tableRow.replace(other.findPipe, (match, offset, str) => {
12375
+ let escaped = false;
12376
+ let curr = offset;
12377
+ while (--curr >= 0 && str[curr] === "\\") escaped = !escaped;
12378
+ if (escaped) {
12379
+ return "|";
12380
+ } else {
12381
+ return " |";
12382
+ }
12383
+ }), cells = row.split(other.splitPipe);
12384
+ let i = 0;
12385
+ if (!cells[0].trim()) {
12386
+ cells.shift();
12387
+ }
12388
+ if (cells.length > 0 && !cells.at(-1)?.trim()) {
12389
+ cells.pop();
12390
+ }
12391
+ if (count) {
12392
+ if (cells.length > count) {
12393
+ cells.splice(count);
12394
+ } else {
12395
+ while (cells.length < count) cells.push("");
12396
+ }
12397
+ }
12398
+ for (; i < cells.length; i++) {
12399
+ cells[i] = cells[i].trim().replace(other.slashPipe, "|");
12400
+ }
12401
+ return cells;
12402
+ }
12403
+ function rtrim(str, c, invert) {
12404
+ const l = str.length;
12405
+ if (l === 0) {
12406
+ return "";
12407
+ }
12408
+ let suffLen = 0;
12409
+ while (suffLen < l) {
12410
+ const currChar = str.charAt(l - suffLen - 1);
12411
+ if (currChar === c && !invert) {
12412
+ suffLen++;
12413
+ } else if (currChar !== c && invert) {
12414
+ suffLen++;
12415
+ } else {
12416
+ break;
12417
+ }
12418
+ }
12419
+ return str.slice(0, l - suffLen);
12420
+ }
12421
+ function findClosingBracket(str, b) {
12422
+ if (str.indexOf(b[1]) === -1) {
12423
+ return -1;
12424
+ }
12425
+ let level = 0;
12426
+ for (let i = 0; i < str.length; i++) {
12427
+ if (str[i] === "\\") {
12428
+ i++;
12429
+ } else if (str[i] === b[0]) {
12430
+ level++;
12431
+ } else if (str[i] === b[1]) {
12432
+ level--;
12433
+ if (level < 0) {
12434
+ return i;
12435
+ }
12436
+ }
12437
+ }
12438
+ if (level > 0) {
12439
+ return -2;
12440
+ }
12441
+ return -1;
12442
+ }
11537
12443
 
11538
- if (mothership.hasAPIKey) {
11539
- const href = window.location.href;
11540
- if (href.match(/\?code=([a-zA-Z0-9]+)$/)) {
11541
- const code = href.match(/\?code=([a-zA-Z0-9]+)$/)[1];
11542
- try {
11543
- const { accessToken, user, roles } = await mothership.github(code);
11544
- if (roles == null) {
11545
- this.authError = 'You are not authorized to access this workspace';
11546
- return;
12444
+ // src/Tokenizer.ts
12445
+ function outputLink(cap, link2, raw, lexer2, rules) {
12446
+ const href = link2.href;
12447
+ const title = link2.title || null;
12448
+ const text = cap[1].replace(rules.other.outputLinkReplace, "$1");
12449
+ lexer2.state.inLink = true;
12450
+ const token = {
12451
+ type: cap[0].charAt(0) === "!" ? "image" : "link",
12452
+ raw,
12453
+ href,
12454
+ title,
12455
+ text,
12456
+ tokens: lexer2.inlineTokens(text)
12457
+ };
12458
+ lexer2.state.inLink = false;
12459
+ return token;
12460
+ }
12461
+ function indentCodeCompensation(raw, text, rules) {
12462
+ const matchIndentToCode = raw.match(rules.other.indentCodeCompensation);
12463
+ if (matchIndentToCode === null) {
12464
+ return text;
12465
+ }
12466
+ const indentToCode = matchIndentToCode[1];
12467
+ return text.split("\n").map((node) => {
12468
+ const matchIndentInNode = node.match(rules.other.beginningSpace);
12469
+ if (matchIndentInNode === null) {
12470
+ return node;
12471
+ }
12472
+ const [indentInNode] = matchIndentInNode;
12473
+ if (indentInNode.length >= indentToCode.length) {
12474
+ return node.slice(indentToCode.length);
12475
+ }
12476
+ return node;
12477
+ }).join("\n");
12478
+ }
12479
+ var _Tokenizer = class {
12480
+ options;
12481
+ rules;
12482
+ // set by the lexer
12483
+ lexer;
12484
+ // set by the lexer
12485
+ constructor(options2) {
12486
+ this.options = options2 || _defaults;
12487
+ }
12488
+ space(src) {
12489
+ const cap = this.rules.block.newline.exec(src);
12490
+ if (cap && cap[0].length > 0) {
12491
+ return {
12492
+ type: "space",
12493
+ raw: cap[0]
12494
+ };
12495
+ }
12496
+ }
12497
+ code(src) {
12498
+ const cap = this.rules.block.code.exec(src);
12499
+ if (cap) {
12500
+ const text = cap[0].replace(this.rules.other.codeRemoveIndent, "");
12501
+ return {
12502
+ type: "code",
12503
+ raw: cap[0],
12504
+ codeBlockStyle: "indented",
12505
+ text: !this.options.pedantic ? rtrim(text, "\n") : text
12506
+ };
12507
+ }
12508
+ }
12509
+ fences(src) {
12510
+ const cap = this.rules.block.fences.exec(src);
12511
+ if (cap) {
12512
+ const raw = cap[0];
12513
+ const text = indentCodeCompensation(raw, cap[3] || "", this.rules);
12514
+ return {
12515
+ type: "code",
12516
+ raw,
12517
+ lang: cap[2] ? cap[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : cap[2],
12518
+ text
12519
+ };
12520
+ }
12521
+ }
12522
+ heading(src) {
12523
+ const cap = this.rules.block.heading.exec(src);
12524
+ if (cap) {
12525
+ let text = cap[2].trim();
12526
+ if (this.rules.other.endingHash.test(text)) {
12527
+ const trimmed = rtrim(text, "#");
12528
+ if (this.options.pedantic) {
12529
+ text = trimmed.trim();
12530
+ } else if (!trimmed || this.rules.other.endingSpaceChar.test(trimmed)) {
12531
+ text = trimmed.trim();
12532
+ }
12533
+ }
12534
+ return {
12535
+ type: "heading",
12536
+ raw: cap[0],
12537
+ depth: cap[1].length,
12538
+ text,
12539
+ tokens: this.lexer.inline(text)
12540
+ };
12541
+ }
12542
+ }
12543
+ hr(src) {
12544
+ const cap = this.rules.block.hr.exec(src);
12545
+ if (cap) {
12546
+ return {
12547
+ type: "hr",
12548
+ raw: rtrim(cap[0], "\n")
12549
+ };
12550
+ }
12551
+ }
12552
+ blockquote(src) {
12553
+ const cap = this.rules.block.blockquote.exec(src);
12554
+ if (cap) {
12555
+ let lines = rtrim(cap[0], "\n").split("\n");
12556
+ let raw = "";
12557
+ let text = "";
12558
+ const tokens = [];
12559
+ while (lines.length > 0) {
12560
+ let inBlockquote = false;
12561
+ const currentLines = [];
12562
+ let i;
12563
+ for (i = 0; i < lines.length; i++) {
12564
+ if (this.rules.other.blockquoteStart.test(lines[i])) {
12565
+ currentLines.push(lines[i]);
12566
+ inBlockquote = true;
12567
+ } else if (!inBlockquote) {
12568
+ currentLines.push(lines[i]);
12569
+ } else {
12570
+ break;
11547
12571
  }
11548
- this.user = user;
11549
- this.roles = roles;
11550
- window.localStorage.setItem('_mongooseStudioAccessToken', accessToken._id);
11551
- } catch (err) {
11552
- this.authError = 'An error occurred while logging in. Please try again.';
11553
- this.status = 'loaded';
11554
- return;
11555
- } finally {
11556
- setTimeout(() => {
11557
- this.$router.replace(this.$router.currentRoute.value.path);
11558
- }, 0);
11559
12572
  }
11560
-
11561
- const { nodeEnv } = await api.status();
11562
- this.nodeEnv = nodeEnv;
11563
- } else {
11564
- const token = window.localStorage.getItem('_mongooseStudioAccessToken');
11565
- if (token) {
11566
- const { user, roles } = await mothership.me();
11567
- this.user = user;
11568
- this.roles = roles;
11569
-
11570
- const { nodeEnv } = await api.status();
11571
- this.nodeEnv = nodeEnv;
12573
+ lines = lines.slice(i);
12574
+ const currentRaw = currentLines.join("\n");
12575
+ const currentText = currentRaw.replace(this.rules.other.blockquoteSetextReplace, "\n $1").replace(this.rules.other.blockquoteSetextReplace2, "");
12576
+ raw = raw ? `${raw}
12577
+ ${currentRaw}` : currentRaw;
12578
+ text = text ? `${text}
12579
+ ${currentText}` : currentText;
12580
+ const top = this.lexer.state.top;
12581
+ this.lexer.state.top = true;
12582
+ this.lexer.blockTokens(currentText, tokens, true);
12583
+ this.lexer.state.top = top;
12584
+ if (lines.length === 0) {
12585
+ break;
12586
+ }
12587
+ const lastToken = tokens.at(-1);
12588
+ if (lastToken?.type === "code") {
12589
+ break;
12590
+ } else if (lastToken?.type === "blockquote") {
12591
+ const oldToken = lastToken;
12592
+ const newText = oldToken.raw + "\n" + lines.join("\n");
12593
+ const newToken = this.blockquote(newText);
12594
+ tokens[tokens.length - 1] = newToken;
12595
+ raw = raw.substring(0, raw.length - oldToken.raw.length) + newToken.raw;
12596
+ text = text.substring(0, text.length - oldToken.text.length) + newToken.text;
12597
+ break;
12598
+ } else if (lastToken?.type === "list") {
12599
+ const oldToken = lastToken;
12600
+ const newText = oldToken.raw + "\n" + lines.join("\n");
12601
+ const newToken = this.list(newText);
12602
+ tokens[tokens.length - 1] = newToken;
12603
+ raw = raw.substring(0, raw.length - lastToken.raw.length) + newToken.raw;
12604
+ text = text.substring(0, text.length - oldToken.raw.length) + newToken.raw;
12605
+ lines = newText.substring(tokens.at(-1).raw.length).split("\n");
12606
+ continue;
11572
12607
  }
11573
12608
  }
11574
- } else {
11575
- const { nodeEnv } = await api.status();
11576
- this.nodeEnv = nodeEnv;
12609
+ return {
12610
+ type: "blockquote",
12611
+ raw,
12612
+ tokens,
12613
+ text
12614
+ };
11577
12615
  }
11578
- this.status = 'loaded';
11579
- },
11580
- setup() {
11581
- const user = Vue.ref(null);
11582
- const roles = Vue.ref(null);
11583
- const status = Vue.ref('init');
11584
- const nodeEnv = Vue.ref(null);
11585
- const authError = Vue.ref(null);
12616
+ }
12617
+ list(src) {
12618
+ let cap = this.rules.block.list.exec(src);
12619
+ if (cap) {
12620
+ let bull = cap[1].trim();
12621
+ const isordered = bull.length > 1;
12622
+ const list2 = {
12623
+ type: "list",
12624
+ raw: "",
12625
+ ordered: isordered,
12626
+ start: isordered ? +bull.slice(0, -1) : "",
12627
+ loose: false,
12628
+ items: []
12629
+ };
12630
+ bull = isordered ? `\\d{1,9}\\${bull.slice(-1)}` : `\\${bull}`;
12631
+ if (this.options.pedantic) {
12632
+ bull = isordered ? bull : "[*+-]";
12633
+ }
12634
+ const itemRegex = this.rules.other.listItemRegex(bull);
12635
+ let endsWithBlankLine = false;
12636
+ while (src) {
12637
+ let endEarly = false;
12638
+ let raw = "";
12639
+ let itemContents = "";
12640
+ if (!(cap = itemRegex.exec(src))) {
12641
+ break;
12642
+ }
12643
+ if (this.rules.block.hr.test(src)) {
12644
+ break;
12645
+ }
12646
+ raw = cap[0];
12647
+ src = src.substring(raw.length);
12648
+ let line = cap[2].split("\n", 1)[0].replace(this.rules.other.listReplaceTabs, (t) => " ".repeat(3 * t.length));
12649
+ let nextLine = src.split("\n", 1)[0];
12650
+ let blankLine = !line.trim();
12651
+ let indent = 0;
12652
+ if (this.options.pedantic) {
12653
+ indent = 2;
12654
+ itemContents = line.trimStart();
12655
+ } else if (blankLine) {
12656
+ indent = cap[1].length + 1;
12657
+ } else {
12658
+ indent = cap[2].search(this.rules.other.nonSpaceChar);
12659
+ indent = indent > 4 ? 1 : indent;
12660
+ itemContents = line.slice(indent);
12661
+ indent += cap[1].length;
12662
+ }
12663
+ if (blankLine && this.rules.other.blankLine.test(nextLine)) {
12664
+ raw += nextLine + "\n";
12665
+ src = src.substring(nextLine.length + 1);
12666
+ endEarly = true;
12667
+ }
12668
+ if (!endEarly) {
12669
+ const nextBulletRegex = this.rules.other.nextBulletRegex(indent);
12670
+ const hrRegex = this.rules.other.hrRegex(indent);
12671
+ const fencesBeginRegex = this.rules.other.fencesBeginRegex(indent);
12672
+ const headingBeginRegex = this.rules.other.headingBeginRegex(indent);
12673
+ const htmlBeginRegex = this.rules.other.htmlBeginRegex(indent);
12674
+ while (src) {
12675
+ const rawLine = src.split("\n", 1)[0];
12676
+ let nextLineWithoutTabs;
12677
+ nextLine = rawLine;
12678
+ if (this.options.pedantic) {
12679
+ nextLine = nextLine.replace(this.rules.other.listReplaceNesting, " ");
12680
+ nextLineWithoutTabs = nextLine;
12681
+ } else {
12682
+ nextLineWithoutTabs = nextLine.replace(this.rules.other.tabCharGlobal, " ");
12683
+ }
12684
+ if (fencesBeginRegex.test(nextLine)) {
12685
+ break;
12686
+ }
12687
+ if (headingBeginRegex.test(nextLine)) {
12688
+ break;
12689
+ }
12690
+ if (htmlBeginRegex.test(nextLine)) {
12691
+ break;
12692
+ }
12693
+ if (nextBulletRegex.test(nextLine)) {
12694
+ break;
12695
+ }
12696
+ if (hrRegex.test(nextLine)) {
12697
+ break;
12698
+ }
12699
+ if (nextLineWithoutTabs.search(this.rules.other.nonSpaceChar) >= indent || !nextLine.trim()) {
12700
+ itemContents += "\n" + nextLineWithoutTabs.slice(indent);
12701
+ } else {
12702
+ if (blankLine) {
12703
+ break;
12704
+ }
12705
+ if (line.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4) {
12706
+ break;
12707
+ }
12708
+ if (fencesBeginRegex.test(line)) {
12709
+ break;
12710
+ }
12711
+ if (headingBeginRegex.test(line)) {
12712
+ break;
12713
+ }
12714
+ if (hrRegex.test(line)) {
12715
+ break;
12716
+ }
12717
+ itemContents += "\n" + nextLine;
12718
+ }
12719
+ if (!blankLine && !nextLine.trim()) {
12720
+ blankLine = true;
12721
+ }
12722
+ raw += rawLine + "\n";
12723
+ src = src.substring(rawLine.length + 1);
12724
+ line = nextLineWithoutTabs.slice(indent);
12725
+ }
12726
+ }
12727
+ if (!list2.loose) {
12728
+ if (endsWithBlankLine) {
12729
+ list2.loose = true;
12730
+ } else if (this.rules.other.doubleBlankLine.test(raw)) {
12731
+ endsWithBlankLine = true;
12732
+ }
12733
+ }
12734
+ let istask = null;
12735
+ let ischecked;
12736
+ if (this.options.gfm) {
12737
+ istask = this.rules.other.listIsTask.exec(itemContents);
12738
+ if (istask) {
12739
+ ischecked = istask[0] !== "[ ] ";
12740
+ itemContents = itemContents.replace(this.rules.other.listReplaceTask, "");
12741
+ }
12742
+ }
12743
+ list2.items.push({
12744
+ type: "list_item",
12745
+ raw,
12746
+ task: !!istask,
12747
+ checked: ischecked,
12748
+ loose: false,
12749
+ text: itemContents,
12750
+ tokens: []
12751
+ });
12752
+ list2.raw += raw;
12753
+ }
12754
+ const lastItem = list2.items.at(-1);
12755
+ if (lastItem) {
12756
+ lastItem.raw = lastItem.raw.trimEnd();
12757
+ lastItem.text = lastItem.text.trimEnd();
12758
+ } else {
12759
+ return;
12760
+ }
12761
+ list2.raw = list2.raw.trimEnd();
12762
+ for (let i = 0; i < list2.items.length; i++) {
12763
+ this.lexer.state.top = false;
12764
+ list2.items[i].tokens = this.lexer.blockTokens(list2.items[i].text, []);
12765
+ if (!list2.loose) {
12766
+ const spacers = list2.items[i].tokens.filter((t) => t.type === "space");
12767
+ const hasMultipleLineBreaks = spacers.length > 0 && spacers.some((t) => this.rules.other.anyLine.test(t.raw));
12768
+ list2.loose = hasMultipleLineBreaks;
12769
+ }
12770
+ }
12771
+ if (list2.loose) {
12772
+ for (let i = 0; i < list2.items.length; i++) {
12773
+ list2.items[i].loose = true;
12774
+ }
12775
+ }
12776
+ return list2;
12777
+ }
12778
+ }
12779
+ html(src) {
12780
+ const cap = this.rules.block.html.exec(src);
12781
+ if (cap) {
12782
+ const token = {
12783
+ type: "html",
12784
+ block: true,
12785
+ raw: cap[0],
12786
+ pre: cap[1] === "pre" || cap[1] === "script" || cap[1] === "style",
12787
+ text: cap[0]
12788
+ };
12789
+ return token;
12790
+ }
12791
+ }
12792
+ def(src) {
12793
+ const cap = this.rules.block.def.exec(src);
12794
+ if (cap) {
12795
+ const tag2 = cap[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " ");
12796
+ const href = cap[2] ? cap[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "";
12797
+ const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : cap[3];
12798
+ return {
12799
+ type: "def",
12800
+ tag: tag2,
12801
+ raw: cap[0],
12802
+ href,
12803
+ title
12804
+ };
12805
+ }
12806
+ }
12807
+ table(src) {
12808
+ const cap = this.rules.block.table.exec(src);
12809
+ if (!cap) {
12810
+ return;
12811
+ }
12812
+ if (!this.rules.other.tableDelimiter.test(cap[2])) {
12813
+ return;
12814
+ }
12815
+ const headers = splitCells(cap[1]);
12816
+ const aligns = cap[2].replace(this.rules.other.tableAlignChars, "").split("|");
12817
+ const rows = cap[3]?.trim() ? cap[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [];
12818
+ const item = {
12819
+ type: "table",
12820
+ raw: cap[0],
12821
+ header: [],
12822
+ align: [],
12823
+ rows: []
12824
+ };
12825
+ if (headers.length !== aligns.length) {
12826
+ return;
12827
+ }
12828
+ for (const align of aligns) {
12829
+ if (this.rules.other.tableAlignRight.test(align)) {
12830
+ item.align.push("right");
12831
+ } else if (this.rules.other.tableAlignCenter.test(align)) {
12832
+ item.align.push("center");
12833
+ } else if (this.rules.other.tableAlignLeft.test(align)) {
12834
+ item.align.push("left");
12835
+ } else {
12836
+ item.align.push(null);
12837
+ }
12838
+ }
12839
+ for (let i = 0; i < headers.length; i++) {
12840
+ item.header.push({
12841
+ text: headers[i],
12842
+ tokens: this.lexer.inline(headers[i]),
12843
+ header: true,
12844
+ align: item.align[i]
12845
+ });
12846
+ }
12847
+ for (const row of rows) {
12848
+ item.rows.push(splitCells(row, item.header.length).map((cell, i) => {
12849
+ return {
12850
+ text: cell,
12851
+ tokens: this.lexer.inline(cell),
12852
+ header: false,
12853
+ align: item.align[i]
12854
+ };
12855
+ }));
12856
+ }
12857
+ return item;
12858
+ }
12859
+ lheading(src) {
12860
+ const cap = this.rules.block.lheading.exec(src);
12861
+ if (cap) {
12862
+ return {
12863
+ type: "heading",
12864
+ raw: cap[0],
12865
+ depth: cap[2].charAt(0) === "=" ? 1 : 2,
12866
+ text: cap[1],
12867
+ tokens: this.lexer.inline(cap[1])
12868
+ };
12869
+ }
12870
+ }
12871
+ paragraph(src) {
12872
+ const cap = this.rules.block.paragraph.exec(src);
12873
+ if (cap) {
12874
+ const text = cap[1].charAt(cap[1].length - 1) === "\n" ? cap[1].slice(0, -1) : cap[1];
12875
+ return {
12876
+ type: "paragraph",
12877
+ raw: cap[0],
12878
+ text,
12879
+ tokens: this.lexer.inline(text)
12880
+ };
12881
+ }
12882
+ }
12883
+ text(src) {
12884
+ const cap = this.rules.block.text.exec(src);
12885
+ if (cap) {
12886
+ return {
12887
+ type: "text",
12888
+ raw: cap[0],
12889
+ text: cap[0],
12890
+ tokens: this.lexer.inline(cap[0])
12891
+ };
12892
+ }
12893
+ }
12894
+ escape(src) {
12895
+ const cap = this.rules.inline.escape.exec(src);
12896
+ if (cap) {
12897
+ return {
12898
+ type: "escape",
12899
+ raw: cap[0],
12900
+ text: cap[1]
12901
+ };
12902
+ }
12903
+ }
12904
+ tag(src) {
12905
+ const cap = this.rules.inline.tag.exec(src);
12906
+ if (cap) {
12907
+ if (!this.lexer.state.inLink && this.rules.other.startATag.test(cap[0])) {
12908
+ this.lexer.state.inLink = true;
12909
+ } else if (this.lexer.state.inLink && this.rules.other.endATag.test(cap[0])) {
12910
+ this.lexer.state.inLink = false;
12911
+ }
12912
+ if (!this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(cap[0])) {
12913
+ this.lexer.state.inRawBlock = true;
12914
+ } else if (this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(cap[0])) {
12915
+ this.lexer.state.inRawBlock = false;
12916
+ }
12917
+ return {
12918
+ type: "html",
12919
+ raw: cap[0],
12920
+ inLink: this.lexer.state.inLink,
12921
+ inRawBlock: this.lexer.state.inRawBlock,
12922
+ block: false,
12923
+ text: cap[0]
12924
+ };
12925
+ }
12926
+ }
12927
+ link(src) {
12928
+ const cap = this.rules.inline.link.exec(src);
12929
+ if (cap) {
12930
+ const trimmedUrl = cap[2].trim();
12931
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(trimmedUrl)) {
12932
+ if (!this.rules.other.endAngleBracket.test(trimmedUrl)) {
12933
+ return;
12934
+ }
12935
+ const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), "\\");
12936
+ if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {
12937
+ return;
12938
+ }
12939
+ } else {
12940
+ const lastParenIndex = findClosingBracket(cap[2], "()");
12941
+ if (lastParenIndex === -2) {
12942
+ return;
12943
+ }
12944
+ if (lastParenIndex > -1) {
12945
+ const start = cap[0].indexOf("!") === 0 ? 5 : 4;
12946
+ const linkLen = start + cap[1].length + lastParenIndex;
12947
+ cap[2] = cap[2].substring(0, lastParenIndex);
12948
+ cap[0] = cap[0].substring(0, linkLen).trim();
12949
+ cap[3] = "";
12950
+ }
12951
+ }
12952
+ let href = cap[2];
12953
+ let title = "";
12954
+ if (this.options.pedantic) {
12955
+ const link2 = this.rules.other.pedanticHrefTitle.exec(href);
12956
+ if (link2) {
12957
+ href = link2[1];
12958
+ title = link2[3];
12959
+ }
12960
+ } else {
12961
+ title = cap[3] ? cap[3].slice(1, -1) : "";
12962
+ }
12963
+ href = href.trim();
12964
+ if (this.rules.other.startAngleBracket.test(href)) {
12965
+ if (this.options.pedantic && !this.rules.other.endAngleBracket.test(trimmedUrl)) {
12966
+ href = href.slice(1);
12967
+ } else {
12968
+ href = href.slice(1, -1);
12969
+ }
12970
+ }
12971
+ return outputLink(cap, {
12972
+ href: href ? href.replace(this.rules.inline.anyPunctuation, "$1") : href,
12973
+ title: title ? title.replace(this.rules.inline.anyPunctuation, "$1") : title
12974
+ }, cap[0], this.lexer, this.rules);
12975
+ }
12976
+ }
12977
+ reflink(src, links) {
12978
+ let cap;
12979
+ if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) {
12980
+ const linkString = (cap[2] || cap[1]).replace(this.rules.other.multipleSpaceGlobal, " ");
12981
+ const link2 = links[linkString.toLowerCase()];
12982
+ if (!link2) {
12983
+ const text = cap[0].charAt(0);
12984
+ return {
12985
+ type: "text",
12986
+ raw: text,
12987
+ text
12988
+ };
12989
+ }
12990
+ return outputLink(cap, link2, cap[0], this.lexer, this.rules);
12991
+ }
12992
+ }
12993
+ emStrong(src, maskedSrc, prevChar = "") {
12994
+ let match = this.rules.inline.emStrongLDelim.exec(src);
12995
+ if (!match) return;
12996
+ if (match[3] && prevChar.match(this.rules.other.unicodeAlphaNumeric)) return;
12997
+ const nextChar = match[1] || match[2] || "";
12998
+ if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) {
12999
+ const lLength = [...match[0]].length - 1;
13000
+ let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;
13001
+ const endReg = match[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
13002
+ endReg.lastIndex = 0;
13003
+ maskedSrc = maskedSrc.slice(-1 * src.length + lLength);
13004
+ while ((match = endReg.exec(maskedSrc)) != null) {
13005
+ rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];
13006
+ if (!rDelim) continue;
13007
+ rLength = [...rDelim].length;
13008
+ if (match[3] || match[4]) {
13009
+ delimTotal += rLength;
13010
+ continue;
13011
+ } else if (match[5] || match[6]) {
13012
+ if (lLength % 3 && !((lLength + rLength) % 3)) {
13013
+ midDelimTotal += rLength;
13014
+ continue;
13015
+ }
13016
+ }
13017
+ delimTotal -= rLength;
13018
+ if (delimTotal > 0) continue;
13019
+ rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);
13020
+ const lastCharLength = [...match[0]][0].length;
13021
+ const raw = src.slice(0, lLength + match.index + lastCharLength + rLength);
13022
+ if (Math.min(lLength, rLength) % 2) {
13023
+ const text2 = raw.slice(1, -1);
13024
+ return {
13025
+ type: "em",
13026
+ raw,
13027
+ text: text2,
13028
+ tokens: this.lexer.inlineTokens(text2)
13029
+ };
13030
+ }
13031
+ const text = raw.slice(2, -2);
13032
+ return {
13033
+ type: "strong",
13034
+ raw,
13035
+ text,
13036
+ tokens: this.lexer.inlineTokens(text)
13037
+ };
13038
+ }
13039
+ }
13040
+ }
13041
+ codespan(src) {
13042
+ const cap = this.rules.inline.code.exec(src);
13043
+ if (cap) {
13044
+ let text = cap[2].replace(this.rules.other.newLineCharGlobal, " ");
13045
+ const hasNonSpaceChars = this.rules.other.nonSpaceChar.test(text);
13046
+ const hasSpaceCharsOnBothEnds = this.rules.other.startingSpaceChar.test(text) && this.rules.other.endingSpaceChar.test(text);
13047
+ if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {
13048
+ text = text.substring(1, text.length - 1);
13049
+ }
13050
+ return {
13051
+ type: "codespan",
13052
+ raw: cap[0],
13053
+ text
13054
+ };
13055
+ }
13056
+ }
13057
+ br(src) {
13058
+ const cap = this.rules.inline.br.exec(src);
13059
+ if (cap) {
13060
+ return {
13061
+ type: "br",
13062
+ raw: cap[0]
13063
+ };
13064
+ }
13065
+ }
13066
+ del(src) {
13067
+ const cap = this.rules.inline.del.exec(src);
13068
+ if (cap) {
13069
+ return {
13070
+ type: "del",
13071
+ raw: cap[0],
13072
+ text: cap[2],
13073
+ tokens: this.lexer.inlineTokens(cap[2])
13074
+ };
13075
+ }
13076
+ }
13077
+ autolink(src) {
13078
+ const cap = this.rules.inline.autolink.exec(src);
13079
+ if (cap) {
13080
+ let text, href;
13081
+ if (cap[2] === "@") {
13082
+ text = cap[1];
13083
+ href = "mailto:" + text;
13084
+ } else {
13085
+ text = cap[1];
13086
+ href = text;
13087
+ }
13088
+ return {
13089
+ type: "link",
13090
+ raw: cap[0],
13091
+ text,
13092
+ href,
13093
+ tokens: [
13094
+ {
13095
+ type: "text",
13096
+ raw: text,
13097
+ text
13098
+ }
13099
+ ]
13100
+ };
13101
+ }
13102
+ }
13103
+ url(src) {
13104
+ let cap;
13105
+ if (cap = this.rules.inline.url.exec(src)) {
13106
+ let text, href;
13107
+ if (cap[2] === "@") {
13108
+ text = cap[0];
13109
+ href = "mailto:" + text;
13110
+ } else {
13111
+ let prevCapZero;
13112
+ do {
13113
+ prevCapZero = cap[0];
13114
+ cap[0] = this.rules.inline._backpedal.exec(cap[0])?.[0] ?? "";
13115
+ } while (prevCapZero !== cap[0]);
13116
+ text = cap[0];
13117
+ if (cap[1] === "www.") {
13118
+ href = "http://" + cap[0];
13119
+ } else {
13120
+ href = cap[0];
13121
+ }
13122
+ }
13123
+ return {
13124
+ type: "link",
13125
+ raw: cap[0],
13126
+ text,
13127
+ href,
13128
+ tokens: [
13129
+ {
13130
+ type: "text",
13131
+ raw: text,
13132
+ text
13133
+ }
13134
+ ]
13135
+ };
13136
+ }
13137
+ }
13138
+ inlineText(src) {
13139
+ const cap = this.rules.inline.text.exec(src);
13140
+ if (cap) {
13141
+ const escaped = this.lexer.state.inRawBlock;
13142
+ return {
13143
+ type: "text",
13144
+ raw: cap[0],
13145
+ text: cap[0],
13146
+ escaped
13147
+ };
13148
+ }
13149
+ }
13150
+ };
11586
13151
 
11587
- const state = Vue.reactive({ user, roles, status, nodeEnv, authError });
11588
- Vue.provide('state', state);
13152
+ // src/Lexer.ts
13153
+ var _Lexer = class __Lexer {
13154
+ tokens;
13155
+ options;
13156
+ state;
13157
+ tokenizer;
13158
+ inlineQueue;
13159
+ constructor(options2) {
13160
+ this.tokens = [];
13161
+ this.tokens.links = /* @__PURE__ */ Object.create(null);
13162
+ this.options = options2 || _defaults;
13163
+ this.options.tokenizer = this.options.tokenizer || new _Tokenizer();
13164
+ this.tokenizer = this.options.tokenizer;
13165
+ this.tokenizer.options = this.options;
13166
+ this.tokenizer.lexer = this;
13167
+ this.inlineQueue = [];
13168
+ this.state = {
13169
+ inLink: false,
13170
+ inRawBlock: false,
13171
+ top: true
13172
+ };
13173
+ const rules = {
13174
+ other,
13175
+ block: block.normal,
13176
+ inline: inline.normal
13177
+ };
13178
+ if (this.options.pedantic) {
13179
+ rules.block = block.pedantic;
13180
+ rules.inline = inline.pedantic;
13181
+ } else if (this.options.gfm) {
13182
+ rules.block = block.gfm;
13183
+ if (this.options.breaks) {
13184
+ rules.inline = inline.breaks;
13185
+ } else {
13186
+ rules.inline = inline.gfm;
13187
+ }
13188
+ }
13189
+ this.tokenizer.rules = rules;
13190
+ }
13191
+ /**
13192
+ * Expose Rules
13193
+ */
13194
+ static get rules() {
13195
+ return {
13196
+ block,
13197
+ inline
13198
+ };
13199
+ }
13200
+ /**
13201
+ * Static Lex Method
13202
+ */
13203
+ static lex(src, options2) {
13204
+ const lexer2 = new __Lexer(options2);
13205
+ return lexer2.lex(src);
13206
+ }
13207
+ /**
13208
+ * Static Lex Inline Method
13209
+ */
13210
+ static lexInline(src, options2) {
13211
+ const lexer2 = new __Lexer(options2);
13212
+ return lexer2.inlineTokens(src);
13213
+ }
13214
+ /**
13215
+ * Preprocessing
13216
+ */
13217
+ lex(src) {
13218
+ src = src.replace(other.carriageReturn, "\n");
13219
+ this.blockTokens(src, this.tokens);
13220
+ for (let i = 0; i < this.inlineQueue.length; i++) {
13221
+ const next = this.inlineQueue[i];
13222
+ this.inlineTokens(next.src, next.tokens);
13223
+ }
13224
+ this.inlineQueue = [];
13225
+ return this.tokens;
13226
+ }
13227
+ blockTokens(src, tokens = [], lastParagraphClipped = false) {
13228
+ if (this.options.pedantic) {
13229
+ src = src.replace(other.tabCharGlobal, " ").replace(other.spaceLine, "");
13230
+ }
13231
+ while (src) {
13232
+ let token;
13233
+ if (this.options.extensions?.block?.some((extTokenizer) => {
13234
+ if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
13235
+ src = src.substring(token.raw.length);
13236
+ tokens.push(token);
13237
+ return true;
13238
+ }
13239
+ return false;
13240
+ })) {
13241
+ continue;
13242
+ }
13243
+ if (token = this.tokenizer.space(src)) {
13244
+ src = src.substring(token.raw.length);
13245
+ const lastToken = tokens.at(-1);
13246
+ if (token.raw.length === 1 && lastToken !== void 0) {
13247
+ lastToken.raw += "\n";
13248
+ } else {
13249
+ tokens.push(token);
13250
+ }
13251
+ continue;
13252
+ }
13253
+ if (token = this.tokenizer.code(src)) {
13254
+ src = src.substring(token.raw.length);
13255
+ const lastToken = tokens.at(-1);
13256
+ if (lastToken?.type === "paragraph" || lastToken?.type === "text") {
13257
+ lastToken.raw += "\n" + token.raw;
13258
+ lastToken.text += "\n" + token.text;
13259
+ this.inlineQueue.at(-1).src = lastToken.text;
13260
+ } else {
13261
+ tokens.push(token);
13262
+ }
13263
+ continue;
13264
+ }
13265
+ if (token = this.tokenizer.fences(src)) {
13266
+ src = src.substring(token.raw.length);
13267
+ tokens.push(token);
13268
+ continue;
13269
+ }
13270
+ if (token = this.tokenizer.heading(src)) {
13271
+ src = src.substring(token.raw.length);
13272
+ tokens.push(token);
13273
+ continue;
13274
+ }
13275
+ if (token = this.tokenizer.hr(src)) {
13276
+ src = src.substring(token.raw.length);
13277
+ tokens.push(token);
13278
+ continue;
13279
+ }
13280
+ if (token = this.tokenizer.blockquote(src)) {
13281
+ src = src.substring(token.raw.length);
13282
+ tokens.push(token);
13283
+ continue;
13284
+ }
13285
+ if (token = this.tokenizer.list(src)) {
13286
+ src = src.substring(token.raw.length);
13287
+ tokens.push(token);
13288
+ continue;
13289
+ }
13290
+ if (token = this.tokenizer.html(src)) {
13291
+ src = src.substring(token.raw.length);
13292
+ tokens.push(token);
13293
+ continue;
13294
+ }
13295
+ if (token = this.tokenizer.def(src)) {
13296
+ src = src.substring(token.raw.length);
13297
+ const lastToken = tokens.at(-1);
13298
+ if (lastToken?.type === "paragraph" || lastToken?.type === "text") {
13299
+ lastToken.raw += "\n" + token.raw;
13300
+ lastToken.text += "\n" + token.raw;
13301
+ this.inlineQueue.at(-1).src = lastToken.text;
13302
+ } else if (!this.tokens.links[token.tag]) {
13303
+ this.tokens.links[token.tag] = {
13304
+ href: token.href,
13305
+ title: token.title
13306
+ };
13307
+ }
13308
+ continue;
13309
+ }
13310
+ if (token = this.tokenizer.table(src)) {
13311
+ src = src.substring(token.raw.length);
13312
+ tokens.push(token);
13313
+ continue;
13314
+ }
13315
+ if (token = this.tokenizer.lheading(src)) {
13316
+ src = src.substring(token.raw.length);
13317
+ tokens.push(token);
13318
+ continue;
13319
+ }
13320
+ let cutSrc = src;
13321
+ if (this.options.extensions?.startBlock) {
13322
+ let startIndex = Infinity;
13323
+ const tempSrc = src.slice(1);
13324
+ let tempStart;
13325
+ this.options.extensions.startBlock.forEach((getStartIndex) => {
13326
+ tempStart = getStartIndex.call({ lexer: this }, tempSrc);
13327
+ if (typeof tempStart === "number" && tempStart >= 0) {
13328
+ startIndex = Math.min(startIndex, tempStart);
13329
+ }
13330
+ });
13331
+ if (startIndex < Infinity && startIndex >= 0) {
13332
+ cutSrc = src.substring(0, startIndex + 1);
13333
+ }
13334
+ }
13335
+ if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {
13336
+ const lastToken = tokens.at(-1);
13337
+ if (lastParagraphClipped && lastToken?.type === "paragraph") {
13338
+ lastToken.raw += "\n" + token.raw;
13339
+ lastToken.text += "\n" + token.text;
13340
+ this.inlineQueue.pop();
13341
+ this.inlineQueue.at(-1).src = lastToken.text;
13342
+ } else {
13343
+ tokens.push(token);
13344
+ }
13345
+ lastParagraphClipped = cutSrc.length !== src.length;
13346
+ src = src.substring(token.raw.length);
13347
+ continue;
13348
+ }
13349
+ if (token = this.tokenizer.text(src)) {
13350
+ src = src.substring(token.raw.length);
13351
+ const lastToken = tokens.at(-1);
13352
+ if (lastToken?.type === "text") {
13353
+ lastToken.raw += "\n" + token.raw;
13354
+ lastToken.text += "\n" + token.text;
13355
+ this.inlineQueue.pop();
13356
+ this.inlineQueue.at(-1).src = lastToken.text;
13357
+ } else {
13358
+ tokens.push(token);
13359
+ }
13360
+ continue;
13361
+ }
13362
+ if (src) {
13363
+ const errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
13364
+ if (this.options.silent) {
13365
+ console.error(errMsg);
13366
+ break;
13367
+ } else {
13368
+ throw new Error(errMsg);
13369
+ }
13370
+ }
13371
+ }
13372
+ this.state.top = true;
13373
+ return tokens;
13374
+ }
13375
+ inline(src, tokens = []) {
13376
+ this.inlineQueue.push({ src, tokens });
13377
+ return tokens;
13378
+ }
13379
+ /**
13380
+ * Lexing/Compiling
13381
+ */
13382
+ inlineTokens(src, tokens = []) {
13383
+ let maskedSrc = src;
13384
+ let match = null;
13385
+ if (this.tokens.links) {
13386
+ const links = Object.keys(this.tokens.links);
13387
+ if (links.length > 0) {
13388
+ while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {
13389
+ if (links.includes(match[0].slice(match[0].lastIndexOf("[") + 1, -1))) {
13390
+ maskedSrc = maskedSrc.slice(0, match.index) + "[" + "a".repeat(match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);
13391
+ }
13392
+ }
13393
+ }
13394
+ }
13395
+ while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) {
13396
+ maskedSrc = maskedSrc.slice(0, match.index) + "++" + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
13397
+ }
13398
+ while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
13399
+ maskedSrc = maskedSrc.slice(0, match.index) + "[" + "a".repeat(match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
13400
+ }
13401
+ let keepPrevChar = false;
13402
+ let prevChar = "";
13403
+ while (src) {
13404
+ if (!keepPrevChar) {
13405
+ prevChar = "";
13406
+ }
13407
+ keepPrevChar = false;
13408
+ let token;
13409
+ if (this.options.extensions?.inline?.some((extTokenizer) => {
13410
+ if (token = extTokenizer.call({ lexer: this }, src, tokens)) {
13411
+ src = src.substring(token.raw.length);
13412
+ tokens.push(token);
13413
+ return true;
13414
+ }
13415
+ return false;
13416
+ })) {
13417
+ continue;
13418
+ }
13419
+ if (token = this.tokenizer.escape(src)) {
13420
+ src = src.substring(token.raw.length);
13421
+ tokens.push(token);
13422
+ continue;
13423
+ }
13424
+ if (token = this.tokenizer.tag(src)) {
13425
+ src = src.substring(token.raw.length);
13426
+ tokens.push(token);
13427
+ continue;
13428
+ }
13429
+ if (token = this.tokenizer.link(src)) {
13430
+ src = src.substring(token.raw.length);
13431
+ tokens.push(token);
13432
+ continue;
13433
+ }
13434
+ if (token = this.tokenizer.reflink(src, this.tokens.links)) {
13435
+ src = src.substring(token.raw.length);
13436
+ const lastToken = tokens.at(-1);
13437
+ if (token.type === "text" && lastToken?.type === "text") {
13438
+ lastToken.raw += token.raw;
13439
+ lastToken.text += token.text;
13440
+ } else {
13441
+ tokens.push(token);
13442
+ }
13443
+ continue;
13444
+ }
13445
+ if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {
13446
+ src = src.substring(token.raw.length);
13447
+ tokens.push(token);
13448
+ continue;
13449
+ }
13450
+ if (token = this.tokenizer.codespan(src)) {
13451
+ src = src.substring(token.raw.length);
13452
+ tokens.push(token);
13453
+ continue;
13454
+ }
13455
+ if (token = this.tokenizer.br(src)) {
13456
+ src = src.substring(token.raw.length);
13457
+ tokens.push(token);
13458
+ continue;
13459
+ }
13460
+ if (token = this.tokenizer.del(src)) {
13461
+ src = src.substring(token.raw.length);
13462
+ tokens.push(token);
13463
+ continue;
13464
+ }
13465
+ if (token = this.tokenizer.autolink(src)) {
13466
+ src = src.substring(token.raw.length);
13467
+ tokens.push(token);
13468
+ continue;
13469
+ }
13470
+ if (!this.state.inLink && (token = this.tokenizer.url(src))) {
13471
+ src = src.substring(token.raw.length);
13472
+ tokens.push(token);
13473
+ continue;
13474
+ }
13475
+ let cutSrc = src;
13476
+ if (this.options.extensions?.startInline) {
13477
+ let startIndex = Infinity;
13478
+ const tempSrc = src.slice(1);
13479
+ let tempStart;
13480
+ this.options.extensions.startInline.forEach((getStartIndex) => {
13481
+ tempStart = getStartIndex.call({ lexer: this }, tempSrc);
13482
+ if (typeof tempStart === "number" && tempStart >= 0) {
13483
+ startIndex = Math.min(startIndex, tempStart);
13484
+ }
13485
+ });
13486
+ if (startIndex < Infinity && startIndex >= 0) {
13487
+ cutSrc = src.substring(0, startIndex + 1);
13488
+ }
13489
+ }
13490
+ if (token = this.tokenizer.inlineText(cutSrc)) {
13491
+ src = src.substring(token.raw.length);
13492
+ if (token.raw.slice(-1) !== "_") {
13493
+ prevChar = token.raw.slice(-1);
13494
+ }
13495
+ keepPrevChar = true;
13496
+ const lastToken = tokens.at(-1);
13497
+ if (lastToken?.type === "text") {
13498
+ lastToken.raw += token.raw;
13499
+ lastToken.text += token.text;
13500
+ } else {
13501
+ tokens.push(token);
13502
+ }
13503
+ continue;
13504
+ }
13505
+ if (src) {
13506
+ const errMsg = "Infinite loop on byte: " + src.charCodeAt(0);
13507
+ if (this.options.silent) {
13508
+ console.error(errMsg);
13509
+ break;
13510
+ } else {
13511
+ throw new Error(errMsg);
13512
+ }
13513
+ }
13514
+ }
13515
+ return tokens;
13516
+ }
13517
+ };
11589
13518
 
11590
- return state;
13519
+ // src/Renderer.ts
13520
+ var _Renderer = class {
13521
+ options;
13522
+ parser;
13523
+ // set by the parser
13524
+ constructor(options2) {
13525
+ this.options = options2 || _defaults;
13526
+ }
13527
+ space(token) {
13528
+ return "";
13529
+ }
13530
+ code({ text, lang, escaped }) {
13531
+ const langString = (lang || "").match(other.notSpaceStart)?.[0];
13532
+ const code = text.replace(other.endingNewline, "") + "\n";
13533
+ if (!langString) {
13534
+ return "<pre><code>" + (escaped ? code : escape2(code, true)) + "</code></pre>\n";
13535
+ }
13536
+ return '<pre><code class="language-' + escape2(langString) + '">' + (escaped ? code : escape2(code, true)) + "</code></pre>\n";
13537
+ }
13538
+ blockquote({ tokens }) {
13539
+ const body = this.parser.parse(tokens);
13540
+ return `<blockquote>
13541
+ ${body}</blockquote>
13542
+ `;
13543
+ }
13544
+ html({ text }) {
13545
+ return text;
13546
+ }
13547
+ heading({ tokens, depth }) {
13548
+ return `<h${depth}>${this.parser.parseInline(tokens)}</h${depth}>
13549
+ `;
13550
+ }
13551
+ hr(token) {
13552
+ return "<hr>\n";
13553
+ }
13554
+ list(token) {
13555
+ const ordered = token.ordered;
13556
+ const start = token.start;
13557
+ let body = "";
13558
+ for (let j = 0; j < token.items.length; j++) {
13559
+ const item = token.items[j];
13560
+ body += this.listitem(item);
13561
+ }
13562
+ const type = ordered ? "ol" : "ul";
13563
+ const startAttr = ordered && start !== 1 ? ' start="' + start + '"' : "";
13564
+ return "<" + type + startAttr + ">\n" + body + "</" + type + ">\n";
13565
+ }
13566
+ listitem(item) {
13567
+ let itemBody = "";
13568
+ if (item.task) {
13569
+ const checkbox = this.checkbox({ checked: !!item.checked });
13570
+ if (item.loose) {
13571
+ if (item.tokens[0]?.type === "paragraph") {
13572
+ item.tokens[0].text = checkbox + " " + item.tokens[0].text;
13573
+ if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === "text") {
13574
+ item.tokens[0].tokens[0].text = checkbox + " " + escape2(item.tokens[0].tokens[0].text);
13575
+ item.tokens[0].tokens[0].escaped = true;
13576
+ }
13577
+ } else {
13578
+ item.tokens.unshift({
13579
+ type: "text",
13580
+ raw: checkbox + " ",
13581
+ text: checkbox + " ",
13582
+ escaped: true
13583
+ });
13584
+ }
13585
+ } else {
13586
+ itemBody += checkbox + " ";
13587
+ }
13588
+ }
13589
+ itemBody += this.parser.parse(item.tokens, !!item.loose);
13590
+ return `<li>${itemBody}</li>
13591
+ `;
11591
13592
  }
11592
- });
13593
+ checkbox({ checked }) {
13594
+ return "<input " + (checked ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
13595
+ }
13596
+ paragraph({ tokens }) {
13597
+ return `<p>${this.parser.parseInline(tokens)}</p>
13598
+ `;
13599
+ }
13600
+ table(token) {
13601
+ let header = "";
13602
+ let cell = "";
13603
+ for (let j = 0; j < token.header.length; j++) {
13604
+ cell += this.tablecell(token.header[j]);
13605
+ }
13606
+ header += this.tablerow({ text: cell });
13607
+ let body = "";
13608
+ for (let j = 0; j < token.rows.length; j++) {
13609
+ const row = token.rows[j];
13610
+ cell = "";
13611
+ for (let k = 0; k < row.length; k++) {
13612
+ cell += this.tablecell(row[k]);
13613
+ }
13614
+ body += this.tablerow({ text: cell });
13615
+ }
13616
+ if (body) body = `<tbody>${body}</tbody>`;
13617
+ return "<table>\n<thead>\n" + header + "</thead>\n" + body + "</table>\n";
13618
+ }
13619
+ tablerow({ text }) {
13620
+ return `<tr>
13621
+ ${text}</tr>
13622
+ `;
13623
+ }
13624
+ tablecell(token) {
13625
+ const content = this.parser.parseInline(token.tokens);
13626
+ const type = token.header ? "th" : "td";
13627
+ const tag2 = token.align ? `<${type} align="${token.align}">` : `<${type}>`;
13628
+ return tag2 + content + `</${type}>
13629
+ `;
13630
+ }
13631
+ /**
13632
+ * span level renderer
13633
+ */
13634
+ strong({ tokens }) {
13635
+ return `<strong>${this.parser.parseInline(tokens)}</strong>`;
13636
+ }
13637
+ em({ tokens }) {
13638
+ return `<em>${this.parser.parseInline(tokens)}</em>`;
13639
+ }
13640
+ codespan({ text }) {
13641
+ return `<code>${escape2(text, true)}</code>`;
13642
+ }
13643
+ br(token) {
13644
+ return "<br>";
13645
+ }
13646
+ del({ tokens }) {
13647
+ return `<del>${this.parser.parseInline(tokens)}</del>`;
13648
+ }
13649
+ link({ href, title, tokens }) {
13650
+ const text = this.parser.parseInline(tokens);
13651
+ const cleanHref = cleanUrl(href);
13652
+ if (cleanHref === null) {
13653
+ return text;
13654
+ }
13655
+ href = cleanHref;
13656
+ let out = '<a href="' + href + '"';
13657
+ if (title) {
13658
+ out += ' title="' + escape2(title) + '"';
13659
+ }
13660
+ out += ">" + text + "</a>";
13661
+ return out;
13662
+ }
13663
+ image({ href, title, text, tokens }) {
13664
+ if (tokens) {
13665
+ text = this.parser.parseInline(tokens, this.parser.textRenderer);
13666
+ }
13667
+ const cleanHref = cleanUrl(href);
13668
+ if (cleanHref === null) {
13669
+ return escape2(text);
13670
+ }
13671
+ href = cleanHref;
13672
+ let out = `<img src="${href}" alt="${text}"`;
13673
+ if (title) {
13674
+ out += ` title="${escape2(title)}"`;
13675
+ }
13676
+ out += ">";
13677
+ return out;
13678
+ }
13679
+ text(token) {
13680
+ return "tokens" in token && token.tokens ? this.parser.parseInline(token.tokens) : "escaped" in token && token.escaped ? token.text : escape2(token.text);
13681
+ }
13682
+ };
11593
13683
 
11594
- const { routes } = __webpack_require__(/*! ./routes */ "./frontend/src/routes.js");
11595
- const router = VueRouter.createRouter({
11596
- history: VueRouter.createWebHashHistory(),
11597
- routes: routes.map(route => ({
11598
- ...route,
11599
- component: app.component(route.component),
11600
- props: (route) => route.params
11601
- }))
11602
- });
13684
+ // src/TextRenderer.ts
13685
+ var _TextRenderer = class {
13686
+ // no need for block level renderers
13687
+ strong({ text }) {
13688
+ return text;
13689
+ }
13690
+ em({ text }) {
13691
+ return text;
13692
+ }
13693
+ codespan({ text }) {
13694
+ return text;
13695
+ }
13696
+ del({ text }) {
13697
+ return text;
13698
+ }
13699
+ html({ text }) {
13700
+ return text;
13701
+ }
13702
+ text({ text }) {
13703
+ return text;
13704
+ }
13705
+ link({ text }) {
13706
+ return "" + text;
13707
+ }
13708
+ image({ text }) {
13709
+ return "" + text;
13710
+ }
13711
+ br() {
13712
+ return "";
13713
+ }
13714
+ };
11603
13715
 
11604
- app.use(router);
13716
+ // src/Parser.ts
13717
+ var _Parser = class __Parser {
13718
+ options;
13719
+ renderer;
13720
+ textRenderer;
13721
+ constructor(options2) {
13722
+ this.options = options2 || _defaults;
13723
+ this.options.renderer = this.options.renderer || new _Renderer();
13724
+ this.renderer = this.options.renderer;
13725
+ this.renderer.options = this.options;
13726
+ this.renderer.parser = this;
13727
+ this.textRenderer = new _TextRenderer();
13728
+ }
13729
+ /**
13730
+ * Static Parse Method
13731
+ */
13732
+ static parse(tokens, options2) {
13733
+ const parser2 = new __Parser(options2);
13734
+ return parser2.parse(tokens);
13735
+ }
13736
+ /**
13737
+ * Static Parse Inline Method
13738
+ */
13739
+ static parseInline(tokens, options2) {
13740
+ const parser2 = new __Parser(options2);
13741
+ return parser2.parseInline(tokens);
13742
+ }
13743
+ /**
13744
+ * Parse Loop
13745
+ */
13746
+ parse(tokens, top = true) {
13747
+ let out = "";
13748
+ for (let i = 0; i < tokens.length; i++) {
13749
+ const anyToken = tokens[i];
13750
+ if (this.options.extensions?.renderers?.[anyToken.type]) {
13751
+ const genericToken = anyToken;
13752
+ const ret = this.options.extensions.renderers[genericToken.type].call({ parser: this }, genericToken);
13753
+ if (ret !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(genericToken.type)) {
13754
+ out += ret || "";
13755
+ continue;
13756
+ }
13757
+ }
13758
+ const token = anyToken;
13759
+ switch (token.type) {
13760
+ case "space": {
13761
+ out += this.renderer.space(token);
13762
+ continue;
13763
+ }
13764
+ case "hr": {
13765
+ out += this.renderer.hr(token);
13766
+ continue;
13767
+ }
13768
+ case "heading": {
13769
+ out += this.renderer.heading(token);
13770
+ continue;
13771
+ }
13772
+ case "code": {
13773
+ out += this.renderer.code(token);
13774
+ continue;
13775
+ }
13776
+ case "table": {
13777
+ out += this.renderer.table(token);
13778
+ continue;
13779
+ }
13780
+ case "blockquote": {
13781
+ out += this.renderer.blockquote(token);
13782
+ continue;
13783
+ }
13784
+ case "list": {
13785
+ out += this.renderer.list(token);
13786
+ continue;
13787
+ }
13788
+ case "html": {
13789
+ out += this.renderer.html(token);
13790
+ continue;
13791
+ }
13792
+ case "paragraph": {
13793
+ out += this.renderer.paragraph(token);
13794
+ continue;
13795
+ }
13796
+ case "text": {
13797
+ let textToken = token;
13798
+ let body = this.renderer.text(textToken);
13799
+ while (i + 1 < tokens.length && tokens[i + 1].type === "text") {
13800
+ textToken = tokens[++i];
13801
+ body += "\n" + this.renderer.text(textToken);
13802
+ }
13803
+ if (top) {
13804
+ out += this.renderer.paragraph({
13805
+ type: "paragraph",
13806
+ raw: body,
13807
+ text: body,
13808
+ tokens: [{ type: "text", raw: body, text: body, escaped: true }]
13809
+ });
13810
+ } else {
13811
+ out += body;
13812
+ }
13813
+ continue;
13814
+ }
13815
+ default: {
13816
+ const errMsg = 'Token with "' + token.type + '" type was not found.';
13817
+ if (this.options.silent) {
13818
+ console.error(errMsg);
13819
+ return "";
13820
+ } else {
13821
+ throw new Error(errMsg);
13822
+ }
13823
+ }
13824
+ }
13825
+ }
13826
+ return out;
13827
+ }
13828
+ /**
13829
+ * Parse Inline Tokens
13830
+ */
13831
+ parseInline(tokens, renderer = this.renderer) {
13832
+ let out = "";
13833
+ for (let i = 0; i < tokens.length; i++) {
13834
+ const anyToken = tokens[i];
13835
+ if (this.options.extensions?.renderers?.[anyToken.type]) {
13836
+ const ret = this.options.extensions.renderers[anyToken.type].call({ parser: this }, anyToken);
13837
+ if (ret !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(anyToken.type)) {
13838
+ out += ret || "";
13839
+ continue;
13840
+ }
13841
+ }
13842
+ const token = anyToken;
13843
+ switch (token.type) {
13844
+ case "escape": {
13845
+ out += renderer.text(token);
13846
+ break;
13847
+ }
13848
+ case "html": {
13849
+ out += renderer.html(token);
13850
+ break;
13851
+ }
13852
+ case "link": {
13853
+ out += renderer.link(token);
13854
+ break;
13855
+ }
13856
+ case "image": {
13857
+ out += renderer.image(token);
13858
+ break;
13859
+ }
13860
+ case "strong": {
13861
+ out += renderer.strong(token);
13862
+ break;
13863
+ }
13864
+ case "em": {
13865
+ out += renderer.em(token);
13866
+ break;
13867
+ }
13868
+ case "codespan": {
13869
+ out += renderer.codespan(token);
13870
+ break;
13871
+ }
13872
+ case "br": {
13873
+ out += renderer.br(token);
13874
+ break;
13875
+ }
13876
+ case "del": {
13877
+ out += renderer.del(token);
13878
+ break;
13879
+ }
13880
+ case "text": {
13881
+ out += renderer.text(token);
13882
+ break;
13883
+ }
13884
+ default: {
13885
+ const errMsg = 'Token with "' + token.type + '" type was not found.';
13886
+ if (this.options.silent) {
13887
+ console.error(errMsg);
13888
+ return "";
13889
+ } else {
13890
+ throw new Error(errMsg);
13891
+ }
13892
+ }
13893
+ }
13894
+ }
13895
+ return out;
13896
+ }
13897
+ };
11605
13898
 
11606
- app.mount('#content');
13899
+ // src/Hooks.ts
13900
+ var _Hooks = class {
13901
+ options;
13902
+ block;
13903
+ constructor(options2) {
13904
+ this.options = options2 || _defaults;
13905
+ }
13906
+ static passThroughHooks = /* @__PURE__ */ new Set([
13907
+ "preprocess",
13908
+ "postprocess",
13909
+ "processAllTokens"
13910
+ ]);
13911
+ /**
13912
+ * Process markdown before marked
13913
+ */
13914
+ preprocess(markdown) {
13915
+ return markdown;
13916
+ }
13917
+ /**
13918
+ * Process HTML after marked is finished
13919
+ */
13920
+ postprocess(html2) {
13921
+ return html2;
13922
+ }
13923
+ /**
13924
+ * Process all tokens before walk tokens
13925
+ */
13926
+ processAllTokens(tokens) {
13927
+ return tokens;
13928
+ }
13929
+ /**
13930
+ * Provide function to tokenize markdown
13931
+ */
13932
+ provideLexer() {
13933
+ return this.block ? _Lexer.lex : _Lexer.lexInline;
13934
+ }
13935
+ /**
13936
+ * Provide function to parse tokens
13937
+ */
13938
+ provideParser() {
13939
+ return this.block ? _Parser.parse : _Parser.parseInline;
13940
+ }
13941
+ };
13942
+
13943
+ // src/Instance.ts
13944
+ var Marked = class {
13945
+ defaults = _getDefaults();
13946
+ options = this.setOptions;
13947
+ parse = this.parseMarkdown(true);
13948
+ parseInline = this.parseMarkdown(false);
13949
+ Parser = _Parser;
13950
+ Renderer = _Renderer;
13951
+ TextRenderer = _TextRenderer;
13952
+ Lexer = _Lexer;
13953
+ Tokenizer = _Tokenizer;
13954
+ Hooks = _Hooks;
13955
+ constructor(...args) {
13956
+ this.use(...args);
13957
+ }
13958
+ /**
13959
+ * Run callback for every token
13960
+ */
13961
+ walkTokens(tokens, callback) {
13962
+ let values = [];
13963
+ for (const token of tokens) {
13964
+ values = values.concat(callback.call(this, token));
13965
+ switch (token.type) {
13966
+ case "table": {
13967
+ const tableToken = token;
13968
+ for (const cell of tableToken.header) {
13969
+ values = values.concat(this.walkTokens(cell.tokens, callback));
13970
+ }
13971
+ for (const row of tableToken.rows) {
13972
+ for (const cell of row) {
13973
+ values = values.concat(this.walkTokens(cell.tokens, callback));
13974
+ }
13975
+ }
13976
+ break;
13977
+ }
13978
+ case "list": {
13979
+ const listToken = token;
13980
+ values = values.concat(this.walkTokens(listToken.items, callback));
13981
+ break;
13982
+ }
13983
+ default: {
13984
+ const genericToken = token;
13985
+ if (this.defaults.extensions?.childTokens?.[genericToken.type]) {
13986
+ this.defaults.extensions.childTokens[genericToken.type].forEach((childTokens) => {
13987
+ const tokens2 = genericToken[childTokens].flat(Infinity);
13988
+ values = values.concat(this.walkTokens(tokens2, callback));
13989
+ });
13990
+ } else if (genericToken.tokens) {
13991
+ values = values.concat(this.walkTokens(genericToken.tokens, callback));
13992
+ }
13993
+ }
13994
+ }
13995
+ }
13996
+ return values;
13997
+ }
13998
+ use(...args) {
13999
+ const extensions = this.defaults.extensions || { renderers: {}, childTokens: {} };
14000
+ args.forEach((pack) => {
14001
+ const opts = { ...pack };
14002
+ opts.async = this.defaults.async || opts.async || false;
14003
+ if (pack.extensions) {
14004
+ pack.extensions.forEach((ext) => {
14005
+ if (!ext.name) {
14006
+ throw new Error("extension name required");
14007
+ }
14008
+ if ("renderer" in ext) {
14009
+ const prevRenderer = extensions.renderers[ext.name];
14010
+ if (prevRenderer) {
14011
+ extensions.renderers[ext.name] = function(...args2) {
14012
+ let ret = ext.renderer.apply(this, args2);
14013
+ if (ret === false) {
14014
+ ret = prevRenderer.apply(this, args2);
14015
+ }
14016
+ return ret;
14017
+ };
14018
+ } else {
14019
+ extensions.renderers[ext.name] = ext.renderer;
14020
+ }
14021
+ }
14022
+ if ("tokenizer" in ext) {
14023
+ if (!ext.level || ext.level !== "block" && ext.level !== "inline") {
14024
+ throw new Error("extension level must be 'block' or 'inline'");
14025
+ }
14026
+ const extLevel = extensions[ext.level];
14027
+ if (extLevel) {
14028
+ extLevel.unshift(ext.tokenizer);
14029
+ } else {
14030
+ extensions[ext.level] = [ext.tokenizer];
14031
+ }
14032
+ if (ext.start) {
14033
+ if (ext.level === "block") {
14034
+ if (extensions.startBlock) {
14035
+ extensions.startBlock.push(ext.start);
14036
+ } else {
14037
+ extensions.startBlock = [ext.start];
14038
+ }
14039
+ } else if (ext.level === "inline") {
14040
+ if (extensions.startInline) {
14041
+ extensions.startInline.push(ext.start);
14042
+ } else {
14043
+ extensions.startInline = [ext.start];
14044
+ }
14045
+ }
14046
+ }
14047
+ }
14048
+ if ("childTokens" in ext && ext.childTokens) {
14049
+ extensions.childTokens[ext.name] = ext.childTokens;
14050
+ }
14051
+ });
14052
+ opts.extensions = extensions;
14053
+ }
14054
+ if (pack.renderer) {
14055
+ const renderer = this.defaults.renderer || new _Renderer(this.defaults);
14056
+ for (const prop in pack.renderer) {
14057
+ if (!(prop in renderer)) {
14058
+ throw new Error(`renderer '${prop}' does not exist`);
14059
+ }
14060
+ if (["options", "parser"].includes(prop)) {
14061
+ continue;
14062
+ }
14063
+ const rendererProp = prop;
14064
+ const rendererFunc = pack.renderer[rendererProp];
14065
+ const prevRenderer = renderer[rendererProp];
14066
+ renderer[rendererProp] = (...args2) => {
14067
+ let ret = rendererFunc.apply(renderer, args2);
14068
+ if (ret === false) {
14069
+ ret = prevRenderer.apply(renderer, args2);
14070
+ }
14071
+ return ret || "";
14072
+ };
14073
+ }
14074
+ opts.renderer = renderer;
14075
+ }
14076
+ if (pack.tokenizer) {
14077
+ const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults);
14078
+ for (const prop in pack.tokenizer) {
14079
+ if (!(prop in tokenizer)) {
14080
+ throw new Error(`tokenizer '${prop}' does not exist`);
14081
+ }
14082
+ if (["options", "rules", "lexer"].includes(prop)) {
14083
+ continue;
14084
+ }
14085
+ const tokenizerProp = prop;
14086
+ const tokenizerFunc = pack.tokenizer[tokenizerProp];
14087
+ const prevTokenizer = tokenizer[tokenizerProp];
14088
+ tokenizer[tokenizerProp] = (...args2) => {
14089
+ let ret = tokenizerFunc.apply(tokenizer, args2);
14090
+ if (ret === false) {
14091
+ ret = prevTokenizer.apply(tokenizer, args2);
14092
+ }
14093
+ return ret;
14094
+ };
14095
+ }
14096
+ opts.tokenizer = tokenizer;
14097
+ }
14098
+ if (pack.hooks) {
14099
+ const hooks = this.defaults.hooks || new _Hooks();
14100
+ for (const prop in pack.hooks) {
14101
+ if (!(prop in hooks)) {
14102
+ throw new Error(`hook '${prop}' does not exist`);
14103
+ }
14104
+ if (["options", "block"].includes(prop)) {
14105
+ continue;
14106
+ }
14107
+ const hooksProp = prop;
14108
+ const hooksFunc = pack.hooks[hooksProp];
14109
+ const prevHook = hooks[hooksProp];
14110
+ if (_Hooks.passThroughHooks.has(prop)) {
14111
+ hooks[hooksProp] = (arg) => {
14112
+ if (this.defaults.async) {
14113
+ return Promise.resolve(hooksFunc.call(hooks, arg)).then((ret2) => {
14114
+ return prevHook.call(hooks, ret2);
14115
+ });
14116
+ }
14117
+ const ret = hooksFunc.call(hooks, arg);
14118
+ return prevHook.call(hooks, ret);
14119
+ };
14120
+ } else {
14121
+ hooks[hooksProp] = (...args2) => {
14122
+ let ret = hooksFunc.apply(hooks, args2);
14123
+ if (ret === false) {
14124
+ ret = prevHook.apply(hooks, args2);
14125
+ }
14126
+ return ret;
14127
+ };
14128
+ }
14129
+ }
14130
+ opts.hooks = hooks;
14131
+ }
14132
+ if (pack.walkTokens) {
14133
+ const walkTokens2 = this.defaults.walkTokens;
14134
+ const packWalktokens = pack.walkTokens;
14135
+ opts.walkTokens = function(token) {
14136
+ let values = [];
14137
+ values.push(packWalktokens.call(this, token));
14138
+ if (walkTokens2) {
14139
+ values = values.concat(walkTokens2.call(this, token));
14140
+ }
14141
+ return values;
14142
+ };
14143
+ }
14144
+ this.defaults = { ...this.defaults, ...opts };
14145
+ });
14146
+ return this;
14147
+ }
14148
+ setOptions(opt) {
14149
+ this.defaults = { ...this.defaults, ...opt };
14150
+ return this;
14151
+ }
14152
+ lexer(src, options2) {
14153
+ return _Lexer.lex(src, options2 ?? this.defaults);
14154
+ }
14155
+ parser(tokens, options2) {
14156
+ return _Parser.parse(tokens, options2 ?? this.defaults);
14157
+ }
14158
+ parseMarkdown(blockType) {
14159
+ const parse2 = (src, options2) => {
14160
+ const origOpt = { ...options2 };
14161
+ const opt = { ...this.defaults, ...origOpt };
14162
+ const throwError = this.onError(!!opt.silent, !!opt.async);
14163
+ if (this.defaults.async === true && origOpt.async === false) {
14164
+ return throwError(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."));
14165
+ }
14166
+ if (typeof src === "undefined" || src === null) {
14167
+ return throwError(new Error("marked(): input parameter is undefined or null"));
14168
+ }
14169
+ if (typeof src !== "string") {
14170
+ return throwError(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(src) + ", string expected"));
14171
+ }
14172
+ if (opt.hooks) {
14173
+ opt.hooks.options = opt;
14174
+ opt.hooks.block = blockType;
14175
+ }
14176
+ const lexer2 = opt.hooks ? opt.hooks.provideLexer() : blockType ? _Lexer.lex : _Lexer.lexInline;
14177
+ const parser2 = opt.hooks ? opt.hooks.provideParser() : blockType ? _Parser.parse : _Parser.parseInline;
14178
+ if (opt.async) {
14179
+ return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src).then((src2) => lexer2(src2, opt)).then((tokens) => opt.hooks ? opt.hooks.processAllTokens(tokens) : tokens).then((tokens) => opt.walkTokens ? Promise.all(this.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens).then((tokens) => parser2(tokens, opt)).then((html2) => opt.hooks ? opt.hooks.postprocess(html2) : html2).catch(throwError);
14180
+ }
14181
+ try {
14182
+ if (opt.hooks) {
14183
+ src = opt.hooks.preprocess(src);
14184
+ }
14185
+ let tokens = lexer2(src, opt);
14186
+ if (opt.hooks) {
14187
+ tokens = opt.hooks.processAllTokens(tokens);
14188
+ }
14189
+ if (opt.walkTokens) {
14190
+ this.walkTokens(tokens, opt.walkTokens);
14191
+ }
14192
+ let html2 = parser2(tokens, opt);
14193
+ if (opt.hooks) {
14194
+ html2 = opt.hooks.postprocess(html2);
14195
+ }
14196
+ return html2;
14197
+ } catch (e) {
14198
+ return throwError(e);
14199
+ }
14200
+ };
14201
+ return parse2;
14202
+ }
14203
+ onError(silent, async) {
14204
+ return (e) => {
14205
+ e.message += "\nPlease report this to https://github.com/markedjs/marked.";
14206
+ if (silent) {
14207
+ const msg = "<p>An error occurred:</p><pre>" + escape2(e.message + "", true) + "</pre>";
14208
+ if (async) {
14209
+ return Promise.resolve(msg);
14210
+ }
14211
+ return msg;
14212
+ }
14213
+ if (async) {
14214
+ return Promise.reject(e);
14215
+ }
14216
+ throw e;
14217
+ };
14218
+ }
14219
+ };
14220
+
14221
+ // src/marked.ts
14222
+ var markedInstance = new Marked();
14223
+ function marked(src, opt) {
14224
+ return markedInstance.parse(src, opt);
14225
+ }
14226
+ marked.options = marked.setOptions = function(options2) {
14227
+ markedInstance.setOptions(options2);
14228
+ marked.defaults = markedInstance.defaults;
14229
+ changeDefaults(marked.defaults);
14230
+ return marked;
14231
+ };
14232
+ marked.getDefaults = _getDefaults;
14233
+ marked.defaults = _defaults;
14234
+ marked.use = function(...args) {
14235
+ markedInstance.use(...args);
14236
+ marked.defaults = markedInstance.defaults;
14237
+ changeDefaults(marked.defaults);
14238
+ return marked;
14239
+ };
14240
+ marked.walkTokens = function(tokens, callback) {
14241
+ return markedInstance.walkTokens(tokens, callback);
14242
+ };
14243
+ marked.parseInline = markedInstance.parseInline;
14244
+ marked.Parser = _Parser;
14245
+ marked.parser = _Parser.parse;
14246
+ marked.Renderer = _Renderer;
14247
+ marked.TextRenderer = _TextRenderer;
14248
+ marked.Lexer = _Lexer;
14249
+ marked.lexer = _Lexer.lex;
14250
+ marked.Tokenizer = _Tokenizer;
14251
+ marked.Hooks = _Hooks;
14252
+ marked.parse = marked;
14253
+ var options = marked.options;
14254
+ var setOptions = marked.setOptions;
14255
+ var use = marked.use;
14256
+ var walkTokens = marked.walkTokens;
14257
+ var parseInline = marked.parseInline;
14258
+ var parse = marked;
14259
+ var parser = _Parser.parse;
14260
+ var lexer = _Lexer.lex;
14261
+ //# sourceMappingURL=marked.cjs.map
11607
14262
 
11608
- })();
11609
14263
 
14264
+ /***/ })
14265
+
14266
+ /******/ });
14267
+ /************************************************************************/
14268
+ /******/ // The module cache
14269
+ /******/ var __webpack_module_cache__ = {};
14270
+ /******/
14271
+ /******/ // The require function
14272
+ /******/ function __webpack_require__(moduleId) {
14273
+ /******/ // Check if module is in cache
14274
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
14275
+ /******/ if (cachedModule !== undefined) {
14276
+ /******/ return cachedModule.exports;
14277
+ /******/ }
14278
+ /******/ // Create a new module (and put it into the cache)
14279
+ /******/ var module = __webpack_module_cache__[moduleId] = {
14280
+ /******/ // no module.id needed
14281
+ /******/ // no module.loaded needed
14282
+ /******/ exports: {}
14283
+ /******/ };
14284
+ /******/
14285
+ /******/ // Execute the module function
14286
+ /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
14287
+ /******/
14288
+ /******/ // Return the exports of the module
14289
+ /******/ return module.exports;
14290
+ /******/ }
14291
+ /******/
14292
+ /************************************************************************/
14293
+ /******/ /* webpack/runtime/global */
14294
+ /******/ (() => {
14295
+ /******/ __webpack_require__.g = (function() {
14296
+ /******/ if (typeof globalThis === 'object') return globalThis;
14297
+ /******/ try {
14298
+ /******/ return this || new Function('return this')();
14299
+ /******/ } catch (e) {
14300
+ /******/ if (typeof window === 'object') return window;
14301
+ /******/ }
14302
+ /******/ })();
14303
+ /******/ })();
14304
+ /******/
14305
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
14306
+ /******/ (() => {
14307
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
14308
+ /******/ })();
14309
+ /******/
14310
+ /************************************************************************/
14311
+ /******/
14312
+ /******/ // startup
14313
+ /******/ // Load entry module and return exports
14314
+ /******/ // This entry module is referenced by other modules so it can't be inlined
14315
+ /******/ var __webpack_exports__ = __webpack_require__("./frontend/src/index.js");
14316
+ /******/
11610
14317
  /******/ })()
11611
14318
  ;