filecat 7.8.0 → 7.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +182 -182
  3. package/build/dist/{4967.3fd3bd40a2b5a3b52428.js → 1060.198d91e2dfc174317c3a.js} +1 -1
  4. package/build/dist/1075.05eed88707339ca32044.js +1 -0
  5. package/build/dist/{1142.121454b1de53689b7367.js → 1142.bc43fae2e5e38d9359df.js} +1 -1
  6. package/build/dist/1384.edbad9c24d883a59724d.js +1 -0
  7. package/build/dist/1417.d390b18dd58ff5c28160.js +1 -0
  8. package/build/dist/1448.4db495e1389c0c8445b3.js +1 -0
  9. package/build/dist/{3324.22efcb1c431177b1cf5f.js → 1455.26a021eb94e5bdd5bec2.js} +1 -1
  10. package/build/dist/{1636.b6a17252dfd0d22f09a7.js → 1636.b80b1883358e132d3424.js} +1 -1
  11. package/build/dist/{1832.8ea5c3e8288df0b7fd5c.js → 1832.a01933ba5df99576ecc2.js} +1 -1
  12. package/build/dist/2300.c99b1dd4e752cdfd5e32.js +2 -0
  13. package/build/dist/{2300.9e1baa1c0368abe53d96.js.LICENSE.txt → 2300.c99b1dd4e752cdfd5e32.js.LICENSE.txt} +1 -1
  14. package/build/dist/239.f570f06d4b9c020f1013.js +1 -0
  15. package/build/dist/2479.294792ef5d360ad64abc.js +1 -0
  16. package/build/dist/2542.26cb302b60de23166227.js +1 -0
  17. package/build/dist/{259.81bb9e049e5ef587a96f.js → 259.3c0eb22e9b43ffb63c9c.js} +1 -1
  18. package/build/dist/2626.3bcfe1f26d9cb796a925.js +1 -0
  19. package/build/dist/2674.15ca3c6ac911cf6e6e2f.js +1 -0
  20. package/build/dist/3233.43bdd7c12ca829d56116.js +1 -0
  21. package/build/dist/3299.6ab0d94f02171cd762cc.js +1 -0
  22. package/build/dist/{6992.f6a07311a638794c24f7.js → 3471.ef3b5dcfe37963034187.js} +1 -1
  23. package/build/dist/{3528.56eeefab6fca5884e2a6.js → 3528.0f8f34028d92fa87c518.js} +1 -1
  24. package/build/dist/{3659.8a31495bb8f38c0ffa7c.js → 3659.dd03dc2ac52a3ff19105.js} +1 -1
  25. package/build/dist/4004.f0193c43fb891fdfb0e4.js +1 -0
  26. package/build/dist/{4560.8ef2e4b60cc86d019dd6.js → 4560.fd9f8cf2d6022b1d3a94.js} +1 -1
  27. package/build/dist/{4903.407cafe944a297471f5a.js → 4903.070aaa53a243baf05133.js} +1 -1
  28. package/build/dist/{4946.c95d4f426146e0180172.js → 4946.d578f6ba367a742d80bf.js} +2 -2
  29. package/build/dist/4986.f244efce9cf6be21f846.js +1 -0
  30. package/build/dist/5272.1f0dfac07ba202e7d323.js +1 -0
  31. package/build/dist/{5308.052f45c15785487b3766.js → 5308.d1e5ccb49396fc1b026d.js} +1 -1
  32. package/build/dist/{5516.645e4a900df9bdc1806c.js → 5516.88521f3a3c7101c46df3.js} +1 -1
  33. package/build/dist/5614.43bdd7c12ca829d56116.js +1 -0
  34. package/build/dist/{5139.adf9574d9b54a216e041.js → 5709.81f43e3c021fafdfe36f.js} +1 -1
  35. package/build/dist/{5744.e9f1efb88a617b05b709.js → 5744.0f8a0432b73b2eb0a7ff.js} +1 -1
  36. package/build/dist/{5877.ca081c4798194230243c.js → 5877.98d0475aaf4058b9a715.js} +1 -1
  37. package/build/dist/6010.5400c344149450c83284.js +1 -0
  38. package/build/dist/{6247.917e3fbef5dc5fbaf937.js → 6247.525b0b68872036ac2fa6.js} +1 -1
  39. package/build/dist/{7520.fbb0bc2a05cf94e15418.js → 6322.552511b5cb12cd0c821c.js} +1 -1
  40. package/build/dist/6492.17ecd8515fa512ce9306.js +1 -0
  41. package/build/dist/{676.a75318a8b598d8daadf0.js → 676.356039ef6f28f96b8c8b.js} +1 -1
  42. package/build/dist/{6805.bf0c964ab84f0fcc78be.js → 6805.373ac0e7d6555e4a6459.js} +1 -1
  43. package/build/dist/{6919.8cf13c01184b7148b28e.js → 6919.c7cc8617b658198d4924.js} +1 -1
  44. package/build/dist/{7038.4e4fc8e405c56d3080e2.js → 7038.166f915547d27e4dc5e4.js} +1 -1
  45. package/build/dist/{7759.0b68912ff9ef10869f59.js → 7759.7cd3fe8e5d37df25804c.js} +1 -1
  46. package/build/dist/7873.e3098bc6f510e5bea55f.js +1 -0
  47. package/build/dist/7923.d44556578af4d3d7cea3.js +2 -0
  48. package/build/dist/7943.acf25a5e98dd13290985.js +1 -0
  49. package/build/dist/8090.8977224618a14ae42159.js +2 -0
  50. package/build/dist/8302.ce97557b7cf7c8387942.js +1 -0
  51. package/build/dist/8319.6a6b9651c87a1bb4cbb9.js +1 -0
  52. package/build/dist/{8603.4142ce42c1635f493eca.js → 8603.f1cbcfd64cde885f9809.js} +1 -1
  53. package/build/dist/8649.d6055ad75975b803bbc1.js +1 -0
  54. package/build/dist/{8727.3628c746061aed7a4077.js → 8727.8658835acb7e0b6e5acc.js} +1 -1
  55. package/build/dist/{8765.a5633d054abb67142fc3.js → 8765.8758c290a6b132f2ce7f.js} +1 -1
  56. package/build/dist/8772.2c35012c25ac9eb5f74d.js +2 -0
  57. package/build/dist/{8772.e8f9731c1c061f1cdf56.js.LICENSE.txt → 8772.2c35012c25ac9eb5f74d.js.LICENSE.txt} +1 -1
  58. package/build/dist/8781.6bd14487d172e004e3d3.js +1 -0
  59. package/build/dist/9299.7358ccf05b1415ed7959.js +1 -0
  60. package/build/dist/9334.a25983aafdcbde63ae5e.js +1 -0
  61. package/build/dist/{9546.e7206c968e92371ae2b1.js → 9546.2cecad04cf676a6616cd.js} +1 -1
  62. package/build/dist/dark.css +839 -839
  63. package/build/dist/filerobot-image-editor.min.js +42445 -42445
  64. package/build/dist/google-dark.css +2032 -2032
  65. package/build/dist/google.css +1719 -1719
  66. package/build/dist/index.html +1 -1
  67. package/build/dist/main.ab3398f34c41e61310ae.js +2 -0
  68. package/build/dist/{main.98bb29605335d9b2219f.js.LICENSE.txt → main.ab3398f34c41e61310ae.js.LICENSE.txt} +1 -1
  69. package/build/dist/rle.js +17867 -17867
  70. package/build/main.js +1 -1
  71. package/build/plugin/core.type.d.ts +62 -0
  72. package/build/threads.work.filecat.js +1 -1
  73. package/env +26 -26
  74. package/package.json +211 -211
  75. package/shell/build.js +161 -161
  76. package/shell/config/.babelrc +14 -14
  77. package/shell/config/base.webpack.config.js +78 -78
  78. package/shell/config/common-bin.config.js +44 -44
  79. package/shell/config/env.js +10 -10
  80. package/shell/config/prebuild-file-path.js +17 -17
  81. package/shell/config/webpack.exe.config.js +36 -36
  82. package/shell/config/webpack.npm.config.js +44 -44
  83. package/shell/config/webpack.web.config.js +152 -152
  84. package/shell/dev.js +51 -51
  85. package/shell/docker-build.sh +2 -2
  86. package/shell/filecat +1 -1
  87. package/shell/filecat-watch +1 -1
  88. package/shell/install.js +48 -48
  89. package/shell/net-agent/git-clone.bat +23 -23
  90. package/shell/net-agent/git-pull.bat +17 -17
  91. package/shell/net-agent/git-push.bat +17 -17
  92. package/shell/pkg.ts +50 -50
  93. package/shell/postinstall-optional.js +29 -29
  94. package/shell/start/filecat-install.sh +22 -22
  95. package/shell/start/filecat-run.sh +2 -2
  96. package/shell/start/windows-install.js +178 -178
  97. package/shell/start/windows-uninstall.js +131 -131
  98. package/shell/util/file.js +46 -46
  99. package/build/dist/1075.493acb74297c1e753de2.js +0 -1
  100. package/build/dist/1384.0d0fc5faa899c9eddcbe.js +0 -1
  101. package/build/dist/1448.0710f04bed1c52e6a5db.js +0 -1
  102. package/build/dist/2300.9e1baa1c0368abe53d96.js +0 -2
  103. package/build/dist/2479.15722ac55b05c521f4f7.js +0 -1
  104. package/build/dist/2542.23fb13b1623c9f7c3fc1.js +0 -1
  105. package/build/dist/2626.05d1faa293e0a3318b9b.js +0 -1
  106. package/build/dist/2674.0c822a9c458f923a4eff.js +0 -1
  107. package/build/dist/2851.2195b5906b2c224c7bf7.js +0 -1
  108. package/build/dist/3140.794a212da633caf38b3a.js +0 -2
  109. package/build/dist/3233.fb6bffd5e097e4ac9423.js +0 -1
  110. package/build/dist/3299.d01f5a742d80f4e6e25b.js +0 -1
  111. package/build/dist/4004.de90f1192487a24a0a9a.js +0 -1
  112. package/build/dist/4437.4d5a0965043471411a00.js +0 -1
  113. package/build/dist/4986.78047106f3a0d2d71199.js +0 -1
  114. package/build/dist/5272.0b70ee8ec5f083fb9f5b.js +0 -1
  115. package/build/dist/5614.fb6bffd5e097e4ac9423.js +0 -1
  116. package/build/dist/6010.2da6f8c2fce5292557cb.js +0 -1
  117. package/build/dist/6492.3ee4060598de873d8e8f.js +0 -1
  118. package/build/dist/7756.2f851693ba030c42dde8.js +0 -1
  119. package/build/dist/7873.11d04b741d2b499d9cb9.js +0 -1
  120. package/build/dist/7923.861345fd55941e8089a1.js +0 -2
  121. package/build/dist/7943.54c702542d55f576a576.js +0 -1
  122. package/build/dist/7954.6ce241a8ed27cb26efc6.js +0 -1
  123. package/build/dist/8302.c1c381630b4ec76bf8ab.js +0 -1
  124. package/build/dist/8319.c15a3674ec7abc493595.js +0 -1
  125. package/build/dist/8772.e8f9731c1c061f1cdf56.js +0 -2
  126. package/build/dist/9299.ed4de6cd4f4bfa0a966a.js +0 -1
  127. package/build/dist/main.98bb29605335d9b2219f.js +0 -2
  128. /package/build/dist/{4946.c95d4f426146e0180172.js.LICENSE.txt → 4946.d578f6ba367a742d80bf.js.LICENSE.txt} +0 -0
  129. /package/build/dist/{7923.861345fd55941e8089a1.js.LICENSE.txt → 7923.d44556578af4d3d7cea3.js.LICENSE.txt} +0 -0
  130. /package/build/dist/{3140.794a212da633caf38b3a.js.LICENSE.txt → 8090.8977224618a14ae42159.js.LICENSE.txt} +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[4986],{94986(e,a,s){s.r(a),s.d(a,{WorkerUrl:()=>r});var t=s(35450),r=(s(22130),new URL("file:///Users/xiaobaidadada/code-projects/filecat/node_modules/@excalidraw/excalidraw/dist/prod/subset-worker.chunk.js"));typeof window>"u"&&typeof self<"u"&&(self.onmessage=async e=>{if(e.data.command===t.a.Subset){let a=await(0,t.c)(e.data.arrayBuffer,e.data.codePoints);self.postMessage(a,{transfer:[a]})}})}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[4091,5272],{48890(e,n,t){t.d(n,{Kw:()=>i,Tt:()=>o});var i=t(80952),o=(t(82327),t(1766),t(24854),t(90008),t(90846),t(40975),t(44286),t(30766),t(14973),t(69687),t(1234),t(47507),t(87268),t(34678),t(24522));const d=`https://gcore.jsdelivr.net/npm/ace-builds@${i.version}/src-min-noconflict/`;i.config.set("basePath",d),i.config.set("modePath",d),i.config.set("themePath",d),i.config.set("workerPath",d)},84091(e,n,t){t.r(n),t.d(n,{default:()=>m});var i=t(96540),o=(t(80952),t(48890)),d=t(34843),r=t(82893),a=t(78247),s=t(74848);function m(e){const n=(0,i.useRef)(null),[t,m]=(0,d.fp)(r.AG.user_base_info),l=t.user_data.theme?.includes("dark")?"cloud_editor_dark":"cloud9_day";return(0,i.useEffect)(()=>{const t=o.Kw.edit(n.current,{value:a.xK.get_value_temp(e.editor_id),showPrintMargin:!1,theme:`ace/theme/${l}`,mode:e.model??o.Tt.getModeForPath(e.name??"").mode,wrap:!1,highlightActiveLine:!1,fontSize:14,...e.options});return t.setOptions({}),t.container.addEventListener("wheel",function(e){e.preventDefault()}),t.focus(),t.on("change",function(n){e.on_change&&e.on_change()}),n.current=t,t.formatCode=()=>{const e=o.Kw.require("ace/ext/beautify"),t=n.current;t&&e.beautify(t.session)},a.xK.set_editor_temp(t,e.editor_id),()=>{a.xK.delete_editor_temp(e.editor_id),t.destroy()}},[]),(0,s.jsx)("div",{ref:n,style:{height:"100%",width:"100%"}})}},26559(e,n,t){t.d(n,{A:()=>l});var i=t(96540),o=t(34843),d=t(82893),r=t(76118),a=t(69918),s=t(8332),m=t(74848);const l=i.memo(function(e){const[n]=(0,o.fp)(d.AG.md_editor_last_context),[t]=(0,i.useState)(n?.trim()?n:s.$);return(0,m.jsx)("div",{className:e.className,ref:n=>e.setting&&(0,a.Ce)(n,e.setting),children:(0,m.jsx)("div",{className:"md-editor-scroll",children:(0,m.jsx)("div",{className:"md-editor-sheet",children:(0,m.jsx)(r.A,{value:t})})})})})},8332(e,n,t){t.d(n,{$:()=>o,V:()=>i});const i='/* ===== md 主题 =====\n 选择器请从 .md-editor-sheet 开始写 —— 它是正文容器的类名,\n 编辑器与右侧预览用的是同一个类名,一处书写、两处生效。\n\n 注意:css 原样注入页面,不做任何改写。\n 写成 body、h1 这种全局选择器会真的作用到整个后台界面,不要这么写。\n\n 下面每一组都可以直接改,不需要的整段删掉即可。\n ============================================ */\n\n/* ---------- 正文 ---------- */\n.md-editor-sheet {\n font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; /* 字体 */\n font-size: 16px; /* 字号 */\n line-height: 1.7; /* 行高:1.7 约为字号的 1.7 倍 */\n color: #333333; /* 文字颜色 */\n}\n\n/* ---------- 整页底色 ----------\n 底色必须写在 .md-editor-scroll(滚动容器)上,不要写在 .md-editor-sheet。\n 纸张高度只有一屏,写在纸张上的底色长文档一滚就露底(上半截有色、下半截变回灰)。\n 深色主题尤其要注意:这一条不写,滚动时就会白一半黑一半。 */\n.md-editor-scroll {\n background: #ffffff;\n}\n\n/* ---------- 标题 h1 ~ h6 ---------- */\n.md-editor-sheet h1 {\n font-size: 2em; /* 相对正文字号的倍数 */\n font-weight: 600; /* 字重:400 常规 / 600 半粗 / 700 粗 */\n color: #1a1a1a;\n margin-top: 1.4em;\n margin-bottom: 0.6em;\n padding-bottom: 0.3em;\n border-bottom: 1px solid #eaecef; /* 标题下划线,不需要就删掉这行 */\n}\n.md-editor-sheet h2 { font-size: 1.5em; font-weight: 600; margin-top: 1.3em; margin-bottom: 0.6em; }\n.md-editor-sheet h3 { font-size: 1.25em; font-weight: 600; margin-top: 1.2em; margin-bottom: 0.5em; }\n.md-editor-sheet h4 { font-size: 1em; font-weight: 600; margin-top: 1.1em; margin-bottom: 0.5em; }\n.md-editor-sheet h5 { font-size: 0.9em; font-weight: 600; margin-top: 1em; margin-bottom: 0.5em; }\n.md-editor-sheet h6 { font-size: 0.85em; font-weight: 600; color: #6a737d; margin-top: 1em; margin-bottom: 0.5em; }\n\n/* ---------- 段落与行内元素 ---------- */\n.md-editor-sheet p {\n margin: 0 0 1em; /* 段落间距:上 右 下 左,下边距控制段与段的距离 */\n}\n.md-editor-sheet strong { font-weight: 600; } /* 加粗文字 */\n.md-editor-sheet em { font-style: italic; } /* 斜体文字 */\n.md-editor-sheet a { color: #0366d6; text-decoration: none; } /* 链接颜色;加下划线写 underline */\n.md-editor-sheet a:hover { text-decoration: underline; } /* 鼠标悬停时的链接样式 */\n.md-editor-sheet del { color: #999999; } /* 删除线文字 */\n\n/* ---------- 引用 ---------- */\n.md-editor-sheet blockquote {\n margin: 0 0 1em;\n padding: 0.4em 1em;\n color: #6a737d; /* 引用文字颜色 */\n border-left: 4px solid #dfe2e5; /* 左侧竖线,这是引用最明显的特征 */\n background: #f6f8fa; /* 引用底色,不需要就删掉 */\n}\n\n/* ---------- 代码 ---------- */\n.md-editor-sheet code {\n font-family: Consolas, Monaco, "Courier New", monospace; /* 等宽字体 */\n font-size: 0.88em;\n color: #476582; /* 行内代码文字色 */\n background: rgba(27, 31, 35, 0.05); /* 行内代码底色 */\n padding: 0.2em 0.4em;\n border-radius: 3px; /* 圆角 */\n}\n.md-editor-sheet pre {\n padding: 1em;\n overflow: auto; /* 内容太宽时出现横向滚动条 */\n background: #f6f8fa; /* 代码块底色 */\n border-radius: 6px;\n margin: 0 0 1em;\n}\n.md-editor-sheet pre code {\n background: transparent; /* 代码块里的 code 不要再叠一层底色 */\n padding: 0;\n}\n\n/* ---------- 列表 ---------- */\n.md-editor-sheet ul, .md-editor-sheet ol {\n padding-left: 2em; /* 缩进 */\n margin: 0 0 1em;\n}\n.md-editor-sheet li { margin: 0.25em 0; } /* 列表项之间的间距 */\n\n/* ---------- 表格 ---------- */\n.md-editor-sheet table {\n width: 100%;\n border-collapse: collapse; /* 相邻边框合并成一条线 */\n margin: 0 0 1em;\n}\n.md-editor-sheet table th, .md-editor-sheet table td {\n padding: 6px 13px;\n border: 1px solid #dfe2e5; /* 单元格边框 */\n}\n.md-editor-sheet table th {\n font-weight: 600;\n background: #f6f8fa; /* 表头底色 */\n}\n\n/* ---------- 分割线 ---------- */\n.md-editor-sheet hr {\n height: 1px; /* 线的粗细 */\n border: 0;\n background: #e1e4e8; /* 线的颜色 */\n margin: 1.6em 0;\n}\n\n/* ---------- 图片 ---------- */\n.md-editor-sheet img {\n max-width: 100%; /* 防止大图撑破版面 */\n border-radius: 4px;\n}\n',o='# 一级标题 Heading 1\n\n## 二级标题 Heading 2\n\n### 三级标题 Heading 3\n\n#### 四级标题 Heading 4\n\n##### 五级标题 Heading 5\n\n###### 六级标题 Heading 6\n\n这是一段普通正文,用来观察字体、字号、行高和文字颜色。中间可以包含 **加粗文字**、*斜体文字*、~~删除线~~、`行内代码` 以及 [一个链接](https://github.com/xiaobaidadada/filecat)。\n\n> 这是一段引用文字。\n> 引用通常用来强调摘录的内容,左侧一般会有一条竖线。\n\n- 无序列表第一项\n- 无序列表第二项\n - 嵌套的子项\n- 无序列表第三项\n\n1. 有序列表第一项\n2. 有序列表第二项\n3. 有序列表第三项\n\n```javascript\n// 代码块\nfunction greet(name) {\n console.log(`Hello, ${name}!`);\n}\ngreet("filecat");\n```\n\n| 列一 | 列二 | 列三 |\n| --- | --- | --- |\n| 内容 A | 内容 B | 内容 C |\n| 内容 D | 内容 E | 内容 F |\n\n---\n\n最后一段正文,用于观察段落之间的间距。\n'},35272(e,n,t){t.r(n),t.d(n,{default:()=>b});var i=t(96540),o=t(22022),d=t(52671),r=t(85997),a=t(4412),s=t(70447),m=t(75725),l=t(61443),c=t(62042),h=t(23430),f=t(78247),g=t(84091),u=t(26559),p=t(96763),x=t(8332),_=t(74848);function b(){const{t:e}=(0,o.Bd)(),n=(0,d.Zp)(),[t]=(0,d.ok)(),{check_user_auth:b}=(0,f.MH)(),v=b(h.oV.md_theme),w=t.get("id")??"",j=!w,[k,N]=(0,i.useState)(""),[y,C]=(0,i.useState)(x.V),[K,z]=(0,i.useState)(!0),[P,S]=(0,i.useState)(!1),A=88;(0,i.useEffect)(()=>{if(!w){const e=x.V;return f.xK.set_value_temp(e,A),N(""),C(e),void z(!1)}Promise.all([(0,p.Kz)(),(0,p.P7)(w)]).then(([e,n])=>{const t=e.find(e=>e.id===w),i=n||x.V;f.xK.set_value_temp(i,A),N(t?.id??""),C(i)}).finally(()=>z(!1))},[w]),(0,i.useEffect)(()=>{if(K)return;const e=f.xK.get_editor(A);e&&(e.setValue(f.xK.get_value_temp(A)??"",-1),e.clearSelection())},[K]),(0,i.useEffect)(()=>{K||(0,p.bN)("theme_preview",y)},[y,K]);return(0,_.jsxs)("div",{children:[(0,_.jsx)(a.aZ,{position:"right",children:(0,_.jsx)(r.rA,{icon:"arrow_back",title:e("上一页"),onClick:()=>n(-1)})}),(0,_.jsx)(m.jW,{isFull:!0,more:!0,children:(0,_.jsx)(m.NN,{children:(0,_.jsxs)("div",{className:"md-theme-editor",children:[(0,_.jsx)("div",{className:"md-theme-editor__left",children:(0,_.jsxs)(s.Zp,{title:e(j?"新建主题":"编辑主题"),titleCom:(0,_.jsx)(_.Fragment,{children:v&&(0,_.jsx)(r.C3,{text:e(P?"保存中":"保存"),clickFun:()=>{P||(async()=>{const t=k.trim();if(t){S(!0);try{await(0,p._D)({id:j?void 0:w,name:t,css:f.xK.get_editor_value(A)??y})?((0,c.SK)(e("保存成功")),n(-1)):(0,c.zN)(e("保存失败"))}finally{S(!1)}}else(0,c.zN)(e("请输入主题名称"))})()}})}),children:[(0,_.jsx)(l.BC,{label:e("主题名称"),label_width:"6rem",children:(0,_.jsx)(l.Sm,{value:k,disabled:!v,placeholder:e("请输入主题名称"),handleInputChange:e=>N(e)})}),(0,_.jsx)("div",{className:"md-theme-editor__ace",children:(0,_.jsx)(g.default,{name:"theme.css",editor_id:A,model:"ace/mode/css",on_change:()=>{const e=f.xK.get_editor_value(A);void 0!==e&&C(e)},options:{showPrintMargin:!1,highlightActiveLine:!0,wrap:!0}})})]})}),(0,_.jsx)("div",{className:"md-theme-editor__right",children:(0,_.jsx)(s.Zp,{title:e("预览"),titleCom:(0,_.jsx)("span",{className:"md-theme-editor__tip",children:e("主题实时预览")}),children:(0,_.jsx)(u.A,{className:"md-theme-preview"})})})]})})})]})}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[3233,5614],{33616(e){var n;self,n=()=>(()=>{"use strict";var e,n={};return e=n,Object.defineProperty(e,"__esModule",{value:!0}),e.FitAddon=void 0,e.FitAddon=class{activate(e){this._terminal=e}dispose(){}fit(){const e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;const n=this._terminal._core;this._terminal.rows===e.rows&&this._terminal.cols===e.cols||(n._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal)return;if(!this._terminal.element||!this._terminal.element.parentElement)return;const e=this._terminal._core,n=e._renderService.dimensions;if(0===n.css.cell.width||0===n.css.cell.height)return;const t=0===this._terminal.options.scrollback?0:e.viewport.scrollBarWidth,r=window.getComputedStyle(this._terminal.element.parentElement),o=parseInt(r.getPropertyValue("height")),i=Math.max(0,parseInt(r.getPropertyValue("width"))),s=window.getComputedStyle(this._terminal.element),l=o-(parseInt(s.getPropertyValue("padding-top"))+parseInt(s.getPropertyValue("padding-bottom"))),a=i-(parseInt(s.getPropertyValue("padding-right"))+parseInt(s.getPropertyValue("padding-left")))-t;return{cols:Math.max(2,Math.floor(a/n.css.cell.width)),rows:Math.max(1,Math.floor(l/n.css.cell.height))}}},n})(),e.exports=n()},40654(e,n,t){"use strict";t.r(n),t.d(n,{default:()=>E});var r=t(96540),o=t(33616),i=(t(97856),t(85072)),s=t.n(i),l=t(97825),a=t.n(l),c=t(77659),d=t.n(c),u=t(55056),m=t.n(u),p=t(10540),h=t.n(p),x=t(41113),f=t.n(x),g=t(86739),v={};v.styleTagTransform=f(),v.setAttributes=m(),v.insert=d().bind(null,"head"),v.domAPI=a(),v.insertStyleElement=h();s()(g.A,v);g.A&&g.A.locals&&g.A.locals;var y=t(40505),_=t(62042),b=t(84369),w=t(74848);function E(e){const[n,t]=(0,r.useState)(25),i=(0,r.useRef)(null),s=(0,r.useCallback)(new o.FitAddon,[]),l=(0,r.useRef)(null),a=(0,r.useRef)(null),{dragging:c,on_pointer_down:d,on_pointer_up:u}=(0,b.y)({direction:"vertical",target_ref:l,get_start_size:()=>n,px_to_unit:e=>e/parseFloat(getComputedStyle(l.current).fontSize),min:()=>{const e=parseFloat(getComputedStyle(l.current).fontSize);return 2.25+i.current.offsetHeight/e},max:()=>{const e=parseFloat(getComputedStyle(l.current).fontSize);return window.innerHeight/e-4},throttle:32,on_change:e=>{s.fit(),t(parseFloat(e.toFixed(2)))}});if((0,r.useEffect)(()=>{e.terminal&&(e.terminal.options.convertEol=!0,e.terminal.open(a.current),e.terminal.loadAddon(s),s.fit(),e.init&&e.init(e.terminal.rows,e.terminal.cols),e.terminal.attachCustomKeyEventHandler(n=>{if(n.ctrlKey&&"c"===n.key){const t=e.terminal.getSelection();if(t)return(0,y.lW)(t),(0,_.SK)("已复制"),n.preventDefault(),e.terminal.focus(),!1}else if("keydown"===n.type&&"v"===n.key&&n.ctrlKey)return!1;return!0}))},[e.terminal]),(0,r.useEffect)(()=>()=>{e.terminal&&e.terminal.dispose()},[]),e.show)return e.get_simple?(0,w.jsx)("div",{className:"pty",style:{height:"100%"},ref:a}):(0,w.jsxs)("div",{className:"shell",style:{height:`${n}em`,display:""+(e.file_shell_hidden?"none":"block")},ref:l,children:[(0,w.jsx)("div",{className:"shell__divider",ref:i,onPointerDown:d,onPointerUp:u}),(0,w.jsx)("div",{className:"pty",style:{height:n-1+"em"},ref:a}),c&&(0,w.jsx)("div",{className:"shell__overlay",onPointerUp:u})]})}},85614(e,n,t){"use strict";t.r(n),t.d(n,{default:()=>s});var r=t(96540),o=(t(40654),t(74848));const i=r.lazy(()=>Promise.resolve().then(t.bind(t,40654)));function s(e){return(0,o.jsx)(r.Fragment,{children:(0,o.jsx)(i,{...e})})}},84369(e,n,t){"use strict";t.d(n,{y:()=>s});var r=t(96540),o=t(2543);function i(e){if(void 0!==e)return"function"==typeof e?e():e}function s(e){const{direction:n="vertical",target_ref:t,get_start_size:s,px_to_unit:l,min:a,max:c,throttle:d,on_change:u,on_drag_end:m}=e,[p,h]=(0,r.useState)(!1),x=(0,r.useRef)(null),f=(0,r.useRef)(u);f.current=u;const g=e=>"vertical"===n?e.clientY:e.clientX,v=(0,r.useRef)({direction:n,get_start_size:s,px_to_unit:l,min:a,max:c,get_pos:g});v.current={direction:n,get_start_size:s,px_to_unit:l,min:a,max:c,get_pos:g};const y=(0,r.useCallback)(e=>{const n=x.current;if(!n)return;const{px_to_unit:t,min:r,max:o,get_pos:s}=v.current,l=n.pos-s(e);let a=n.size+t(l);const c=i(r),d=i(o);void 0!==c&&(a=Math.max(c,a)),void 0!==d&&(a=Math.min(d,a)),f.current(a)},[]),_=r.useMemo(()=>void 0===d?y:o.throttle(e=>y(e),d),[d,y]),b=(0,r.useCallback)(()=>{x.current=null,h(!1);const e=_;"function"==typeof e.cancel&&e.cancel(),m?.()},[_,m]),w=(0,r.useCallback)(e=>{const{get_start_size:n,get_pos:t}=v.current;x.current={pos:t(e),size:n()},h(!0)},[]);return(0,r.useEffect)(()=>{if(!p)return;const e=t?.current??window;return e.addEventListener("pointermove",_),e.addEventListener("pointerup",b),()=>{e.removeEventListener("pointermove",_),e.removeEventListener("pointerup",b)}},[p,_,b,t]),(0,r.useEffect)(()=>{const e=_;return()=>{"function"==typeof e.cancel&&e.cancel()}},[_]),{dragging:p,on_pointer_down:w,on_pointer_up:b}}},86739(e,n,t){"use strict";t.d(n,{A:()=>l});var r=t(31601),o=t.n(r),i=t(76314),s=t.n(i)()(o());s.push([e.id,'/**\n * Copyright (c) 2014 The xterm.js authors. All rights reserved.\n * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)\n * https://github.com/chjj/term.js\n * @license MIT\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the "Software"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n * Originally forked from (with the author\'s permission):\n * Fabrice Bellard\'s javascript vt100 for jslinux:\n * http://bellard.org/jslinux/\n * Copyright (c) 2011 Fabrice Bellard\n * The original design remains. The terminal itself\n * has been extended to include xterm CSI codes, among\n * other features.\n */\n\n/**\n * Default styles for xterm.js\n */\n\n.xterm {\n cursor: text;\n position: relative;\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n}\n\n.xterm.focus,\n.xterm:focus {\n outline: none;\n}\n\n.xterm .xterm-helpers {\n position: absolute;\n top: 0;\n /**\n * The z-index of the helpers must be higher than the canvases in order for\n * IMEs to appear on top.\n */\n z-index: 5;\n}\n\n.xterm .xterm-helper-textarea {\n padding: 0;\n border: 0;\n margin: 0;\n /* Move textarea out of the screen to the far left, so that the cursor is not visible */\n position: absolute;\n opacity: 0;\n left: -9999em;\n top: 0;\n width: 0;\n height: 0;\n z-index: -5;\n /** Prevent wrapping so the IME appears against the textarea at the correct position */\n white-space: nowrap;\n overflow: hidden;\n resize: none;\n}\n\n.xterm .composition-view {\n /* TODO: Composition position got messed up somewhere */\n background: #000;\n color: #FFF;\n display: none;\n position: absolute;\n white-space: nowrap;\n z-index: 1;\n}\n\n.xterm .composition-view.active {\n display: block;\n}\n\n.xterm .xterm-viewport {\n /* On OS X this is required in order for the scroll bar to appear fully opaque */\n background-color: #000;\n overflow-y: scroll;\n cursor: default;\n position: absolute;\n right: 0;\n left: 0;\n top: 0;\n bottom: 0;\n}\n\n.xterm .xterm-screen {\n position: relative;\n}\n\n.xterm .xterm-screen canvas {\n position: absolute;\n left: 0;\n top: 0;\n}\n\n.xterm .xterm-scroll-area {\n visibility: hidden;\n}\n\n.xterm-char-measure-element {\n display: inline-block;\n visibility: hidden;\n position: absolute;\n top: 0;\n left: -9999em;\n line-height: normal;\n}\n\n.xterm.enable-mouse-events {\n /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */\n cursor: default;\n}\n\n.xterm.xterm-cursor-pointer,\n.xterm .xterm-cursor-pointer {\n cursor: pointer;\n}\n\n.xterm.column-select.focus {\n /* Column selection mode */\n cursor: crosshair;\n}\n\n.xterm .xterm-accessibility:not(.debug),\n.xterm .xterm-message {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n z-index: 10;\n color: transparent;\n pointer-events: none;\n}\n\n.xterm .xterm-accessibility-tree:not(.debug) *::selection {\n color: transparent;\n}\n\n.xterm .xterm-accessibility-tree {\n user-select: text;\n white-space: pre;\n}\n\n.xterm .live-region {\n position: absolute;\n left: -9999px;\n width: 1px;\n height: 1px;\n overflow: hidden;\n}\n\n.xterm-dim {\n /* Dim should not apply to background, so the opacity of the foreground color is applied\n * explicitly in the generated class and reset to 1 here */\n opacity: 1 !important;\n}\n\n.xterm-underline-1 { text-decoration: underline; }\n.xterm-underline-2 { text-decoration: double underline; }\n.xterm-underline-3 { text-decoration: wavy underline; }\n.xterm-underline-4 { text-decoration: dotted underline; }\n.xterm-underline-5 { text-decoration: dashed underline; }\n\n.xterm-overline {\n text-decoration: overline;\n}\n\n.xterm-overline.xterm-underline-1 { text-decoration: overline underline; }\n.xterm-overline.xterm-underline-2 { text-decoration: overline double underline; }\n.xterm-overline.xterm-underline-3 { text-decoration: overline wavy underline; }\n.xterm-overline.xterm-underline-4 { text-decoration: overline dotted underline; }\n.xterm-overline.xterm-underline-5 { text-decoration: overline dashed underline; }\n\n.xterm-strikethrough {\n text-decoration: line-through;\n}\n\n.xterm-screen .xterm-decoration-container .xterm-decoration {\n\tz-index: 6;\n\tposition: absolute;\n}\n\n.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer {\n\tz-index: 7;\n}\n\n.xterm-decoration-overview-ruler {\n z-index: 8;\n position: absolute;\n top: 0;\n right: 0;\n pointer-events: none;\n}\n\n.xterm-decoration-top {\n z-index: 2;\n position: relative;\n}\n',""]);const l=s}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6010],{34299(e,t,n){n.r(t),n.d(t,{default:()=>k});var r=n(96540),c=n(23802),a=n(53995),s=n(18569),l=n(77979),o=n(8263),u=n(69428),i=n.n(u),d=(n(3775),n(21499)),h=n(99214),g=n(89117),p=n(89334),f=n(41105),m=n(52388),v=n(19878),w=(n(72411),n(74848));const A=new c.A({html:!0,highlight:function(e,t){if(t&&v.A.getLanguage(t))try{return`<pre class="hljs code-block-with-copy"><code class="hljs language-${t}">${v.A.highlight(e,{language:t}).value}</code></pre>`}catch(e){}try{return`<pre class="hljs code-block-with-copy"><code class="hljs">${v.A.highlightAuto(e).value}</code></pre>`}catch(e){}return`<pre class="hljs code-block-with-copy"><code>${A.utils.escapeHtml(e)}</code></pre>`}});function y(e){const t=e.className.match(/language-([\w-]+)/);return t?t[1]:""}function k(e){const t=(0,r.useRef)(null);return(0,h.VD)(),(0,r.useEffect)(()=>{t.current&&(!async function(e){const t=e.querySelectorAll("pre > code[class*='language-']");for(const e of Array.from(t)){const t=y(e);if(!(0,g.Hm)(t))continue;const n=e.closest(".code-block-with-copy")??e.parentElement;if(!n)continue;const r=e.textContent??"",c=document.createElement("div");c.className="md-graph md-graph--loading",c.textContent=m.A.t("rendering"),n.replaceWith(c);const a=await(0,g.U6)(t,r);c.isConnected&&(a.error?(c.className="md-graph md-graph--error",c.textContent=a.error):(c.className="md-graph",c.innerHTML=a.svg))}}(t.current),(0,p.rg)(t.current))},[e.context]),(0,w.jsx)("div",{ref:t,dangerouslySetInnerHTML:{__html:A.render(e.context)}})}A.use(a.A).use(s.A).use(l.A).use(o.A).use(i()).use(e=>{e.renderer.rules.fence;e.renderer.rules.fence=(t,n,r,c,a)=>{const s=t[n],l=s.content.trim(),o=s.info.trim();let u="";if(o&&v.A.getLanguage(o))try{u=v.A.highlight(l,{language:o}).value}catch(t){u=e.utils.escapeHtml(l)}else try{u=v.A.highlightAuto(l).value}catch(t){u=e.utils.escapeHtml(l)}return`\n <div class="code-block-with-copy">\n <div class="code-header">\n <span class="code-language">${o||"code"}</span>\n <button class="copy-btn" data-code="${e.utils.escapeHtml(l)}">复制</button>\n </div>\n <pre><code class="hljs ${o?`language-${o}`:""}">${u}</code></pre>\n </div>`}}).use(e=>{const t=e.renderer.rules.link_open||function(e,t,n,r,c){return c.renderToken(e,t,n)};e.renderer.rules.link_open=(e,n,r,c,a)=>{const s=e[n],l=s.attrIndex("href");if(l>=0){const e=s.attrs[l][1];s.attrs[l][1]=(0,d.bi)(window.location.href,e)}return t(e,n,r,c,a)}}),(0,p.Rh)(A,f.pC)},60840(e){e.exports="data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27 version=%271.1%27 aria-hidden=%27true%27><path fill-rule=%27evenodd%27 d=%27M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z%27></path></svg>"}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6492],{11356(t,e){e.k=void 0;e.k=function(t,e){void 0===e&&(e={listUnicodeChar:""}),(e=e||{}).listUnicodeChar=!!e.hasOwnProperty("listUnicodeChar")&&e.listUnicodeChar,e.stripListLeaders=!e.hasOwnProperty("stripListLeaders")||e.stripListLeaders,e.gfm=!e.hasOwnProperty("gfm")||e.gfm,e.useImgAltText=!e.hasOwnProperty("useImgAltText")||e.useImgAltText,e.preserveLinks=!!e.hasOwnProperty("preserveLinks")&&e.preserveLinks;var r=t||"";r=r.replace(/^(-\s*?|\*\s*?|_\s*?){3,}\s*$/gm,"");try{e.stripListLeaders&&(r=e.listUnicodeChar?r.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm,e.listUnicodeChar+" $1"):r.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm,"$1")),e.gfm&&(r=r.replace(/\n={2,}/g,"\n").replace(/~{3}.*\n/g,"").replace(/~~/g,"").replace(/`{3}.*\n/g,"")),e.preserveLinks&&(r=r.replace(/\[(.*?)\][\[\(](.*?)[\]\)]/g,"$1 ($2)")),r=r.replace(/<[^>]*>/g,"").replace(/^[=\-]{2,}\s*$/g,"").replace(/\[\^.+?\](\: .*?$)?/g,"").replace(/\s{0,2}\[.*?\]: .*?$/g,"").replace(/\!\[(.*?)\][\[\(].*?[\]\)]/g,e.useImgAltText?"$1":"").replace(/\[(.*?)\][\[\(].*?[\]\)]/g,"$1").replace(/^\s{0,3}>\s?/g,"").replace(/(^|\n)\s{0,3}>\s?/g,"\n\n").replace(/^\s{1,2}\[(.*?)\]: (\S+)( ".*?")?\s*$/g,"").replace(/^(\n)?\s{0,}#{1,6}\s+| {0,}(\n)?\s{0,}#{0,} {0,}(\n)?\s{0,}$/gm,"$1$2$3").replace(/([\*_]{1,3})(\S.*?\S{0,1})\1/g,"$2").replace(/([\*_]{1,3})(\S.*?\S{0,1})\1/g,"$2").replace(/(`{3,})(.*?)\1/gm,"$2").replace(/`(.+?)`/g,"$1").replace(/\n{2,}/g,"\n\n")}catch(e){return console.error(e),t}return r}},6492(t,e,r){r.r(e),r.d(e,{parseMermaidToExcalidraw:()=>Ie});const o={rect:"rectangle",circle:"ellipse"},n={startOnLoad:!1,flowchart:{curve:"linear"},themeVariables:{fontSize:"20px"},maxEdges:500,maxTextSize:5e4};class s{constructor({converter:t}){this.convert=(t,e)=>this.converter(t,{...e,fontSize:e.fontSize||20}),this.converter=t}}var i,a,l;!function(t){t.ROUND="round",t.STADIUM="stadium",t.DOUBLECIRCLE="doublecircle",t.CIRCLE="circle",t.DIAMOND="diamond",t.CYLINDER="cylinder"}(i||(i={})),function(t){t.COLOR="color"}(a||(a={})),function(t){t.FILL="fill",t.STROKE="stroke",t.STROKE_WIDTH="stroke-width",t.STROKE_DASHARRAY="stroke-dasharray"}(l||(l={}));var c=r(11356);const d={arrow_circle:{endArrowhead:"circle"},arrow_cross:{endArrowhead:"bar"},arrow_open:{endArrowhead:null,startArrowhead:null},double_arrow_circle:{endArrowhead:"circle",startArrowhead:"circle"},double_arrow_cross:{endArrowhead:"bar",startArrowhead:"bar"},double_arrow_point:{endArrowhead:"arrow",startArrowhead:"arrow"}},u=t=>{let e=t.text;return"markdown"===t.labelType&&(e=(0,c.k)(t.text)),h(e)},h=t=>t.replace(/\s?(fa|fab):[a-zA-Z0-9-]+/g,""),p=t=>{const e={};return Object.keys(t).forEach(r=>{switch(r){case l.FILL:e.backgroundColor=t[r],e.fillStyle="solid";break;case l.STROKE:e.strokeColor=t[r];break;case l.STROKE_WIDTH:e.strokeWidth=Number(t[r]?.split("px")[0]);break;case l.STROKE_DASHARRAY:e.strokeStyle="dashed"}}),e},g=t=>{const e={};return Object.keys(t).forEach(r=>{if(r===a.COLOR)e.strokeColor=t[r]}),e},y=(t,e)=>Math.max(20,Math.ceil(t.length*e*.62)),f=new s({converter:(t,e)=>{const r=[],o=e.fontSize,{getGroupIds:n,getParentId:s}=(t=>{const e={};t.subGraphs.map(r=>{r.nodeIds.forEach(o=>{e[r.id]={id:r.id,parent:null,isLeaf:!1},e[o]={id:o,parent:r.id,isLeaf:void 0!==t.vertices[o]}})});const r={};return[...Object.keys(t.vertices),...t.subGraphs.map(t=>t.id)].forEach(t=>{if(!e[t])return;let o=e[t];const n=[];for(o.isLeaf||n.push(`subgraph_group_${o.id}`);o.parent;)n.push(`subgraph_group_${o.parent}`),o=e[o.parent];r[t]=n}),{getGroupIds:t=>r[t]||[],getParentId:t=>e[t]?e[t].parent:null}})(t);return t.subGraphs.reverse().forEach(t=>{const e=n(t.id),s=u(t),i=y(s,o||16)+64,a=Math.max(t.width,i),l=t.x-(a-t.width)/2,c=p(t.containerStyle),d=g(t.labelStyle),h={id:t.id,type:"rectangle",groupIds:e,x:l,y:t.y,width:a,height:t.height,label:{groupIds:e,text:s,fontSize:o,verticalAlign:"top",...d},...c};r.push(h)}),Object.values(t.vertices).forEach(t=>{if(!t)return;const e=n(t.id),s=u(t),a=((t,e,r,o)=>{const n=o||20;if(t!==i.CYLINDER||!e||e.includes("\n"))return n;const s=Math.max(20,r-12);return y(e,n)<=s?n:Math.max(12,Math.floor(s/(.62*e.length)))})(t.type,s,t.width,o),l=p(t.containerStyle),c=g(t.labelStyle);let d={id:t.id,type:"rectangle",groupIds:e,x:t.x,y:t.y,width:t.width,height:t.height,strokeWidth:2,label:{groupIds:e,text:s,fontSize:a,...c},link:t.link||null,...l};switch(t.type){case i.STADIUM:case i.ROUND:d={...d,roundness:{type:3}};break;case i.DOUBLECIRCLE:{const o=5;e.push(`doublecircle_${t.id}}`);const n={type:"ellipse",groupIds:e,x:t.x+o,y:t.y+o,width:t.width-2*o,height:t.height-2*o,strokeWidth:2,roundness:{type:3},label:{groupIds:e,text:s,fontSize:a,...c}};d={...d,groupIds:e,type:"ellipse"},r.push(n);break}case i.CIRCLE:d.type="ellipse";break;case i.DIAMOND:d.type="diamond"}r.push(d)}),t.edges.forEach(t=>{let e=[];const i=s(t.start),a=s(t.end);i&&i===a&&(e=n(i));const{startX:l,startY:c,reflectionPoints:h}=t,p=h.map(t=>{return e=t.x-h[0].x,r=t.y-h[0].y,[e,r];var e,r}),g=(y=t.type||"arrow_point",d[y]);var y;const f=r.find(e=>e.id===t.start),b=r.find(e=>e.id===t.end);if(!f||!b)return;const m={id:`${t.start}_${t.end}`,type:"arrow",groupIds:e,x:l,y:c,strokeWidth:"thick"===t.stroke?4:2,strokeStyle:"dotted"===t.stroke?"dashed":void 0,points:p,...t.text?{label:{text:u(t),fontSize:o,groupIds:e}}:{},roundness:{type:2},...g,start:{id:f.id||""},end:{id:b.id||""}};r.push(m)}),{elements:r}}});let b=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((t,e)=>t+=(e&=63)<36?e.toString(36):e<62?(e-26).toString(36).toUpperCase():e>62?"-":"_","");const m=new s({converter:t=>{const e=b(),{width:r,height:o}=t,n={type:"image",x:0,y:0,width:r,height:o,status:"saved",fileId:e};return{files:{[e]:{id:e,mimeType:t.mimeType,dataURL:t.dataURL}},elements:[n]}}}),x=(t,e)=>[t,e],w=t=>t.replace(/\\n/g,"\n"),S=t=>{const e={type:"line",x:t.startX,y:t.startY,points:[x(0,0),x(t.endX-t.startX,t.endY-t.startY)],width:t.endX-t.startX,height:t.endY-t.startY,strokeStyle:t.strokeStyle||"solid",strokeColor:t.strokeColor||"#000",strokeWidth:t.strokeWidth||1};return t.groupId&&Object.assign(e,{groupIds:[t.groupId]}),t.id&&Object.assign(e,{id:t.id}),e},A=t=>{const e={type:"text",x:t.x,y:t.y,width:t.width,height:t.height,text:w(t.text)||"",fontSize:t.fontSize,verticalAlign:"top",strokeColor:t.color};return t.groupId&&Object.assign(e,{groupIds:[t.groupId]}),t.id&&Object.assign(e,{id:t.id}),e},k=t=>{const e={text:w(t?.label?.text||""),fontSize:t?.label?.fontSize,textAlign:t.label?.textAlign,verticalAlign:t.label?.verticalAlign||"middle",strokeColor:t.label?.color||"#000",...t.groupId?{groupIds:[t.groupId]}:{}};let r={};"rectangle"===t.type&&"activation"===t.subtype&&(r={backgroundColor:"#e9ecef",fillStyle:"solid"});const o={id:t.id,type:t.type,x:t.x,y:t.y,width:t.width,height:t.height,label:e,strokeStyle:t?.strokeStyle,strokeWidth:t?.strokeWidth,strokeColor:t?.strokeColor,backgroundColor:t?.bgColor,fillStyle:"solid",...r};return t.groupId&&Object.assign(o,{groupIds:[t.groupId]}),o},E=t=>{const e={type:"arrow",x:t.startX,y:t.startY,points:t.points?.map(([t,e])=>x(t,e))||[x(0,0),x(t.endX-t.startX,t.endY-t.startY)],width:t.endX-t.startX,height:t.endY-t.startY,strokeStyle:t?.strokeStyle||"solid",endArrowhead:t?.endArrowhead||null,startArrowhead:t?.startArrowhead||null,label:{text:w(t?.label?.text||""),fontSize:16,textAlign:t?.label?.textAlign,verticalAlign:t?.label?.verticalAlign},roundness:{type:2},start:t.start,end:t.end};return t.groupId&&Object.assign(e,{groupIds:[t.groupId]}),e},v=t=>{if(!t)return!0;const e=t.trim().toLowerCase();return"transparent"===e||"none"===e||"rgba(0,0,0,0)"===e||"rgba(0, 0, 0, 0)"===e},C=(t,e,r=!0)=>{const o=t,n=o.groupIds??[];if(n.includes(e)||(o.groupIds=[...n,e]),!r||!o.label)return;const s=o.label.groupIds??[];s.includes(e)||(o.label.groupIds=[...s,e])},I=new s({converter:t=>{const e=[],r=[];if(Object.values(t.nodes).forEach(t=>{t&&t.length&&t.forEach(t=>{let o;switch(t.type){case"line":o=S(t);break;case"rectangle":case"ellipse":o=k(t);break;case"text":o=A(t);break;default:throw`unknown type ${t.type}`}"rectangle"===t.type&&"activation"===t?.subtype?r.push(o):e.push(o)})}),Object.values(t.lines).forEach(t=>{t&&e.push(S(t))}),Object.values(t.arrows).forEach(t=>{t&&(e.push(E(t)),t.sequenceNumber&&e.push(k(t.sequenceNumber)))}),e.push(...r),t.loops){const{lines:r,texts:o,nodes:n}=t.loops;r.forEach(t=>{e.push(S(t))}),o.forEach(t=>{e.push(A(t))}),n.forEach(t=>{e.push(k(t))})}return t.groups&&t.groups.forEach(t=>{const{actorKeys:r,name:o}=t;let n=1/0,s=1/0,i=0,a=0;if(!r.length)return;const l=e.filter(t=>{if(t.id){const e=t.id.indexOf("-"),o=t.id.substring(0,e);return r.includes(o)}return!1});if(!l.length)return;if(l.forEach(t=>{void 0!==t.x&&void 0!==t.y&&void 0!==t.width&&void 0!==t.height&&(n=Math.min(n,t.x),s=Math.min(s,t.y),i=Math.max(i,t.x+t.width),a=Math.max(a,t.y+t.height))}),!(Number.isFinite(n)&&Number.isFinite(s)&&Number.isFinite(i)&&Number.isFinite(a)))return;const c=n-10,d=s-10,u=i-n+20,h=a-s+20,p=b(),g=b(),y=k({type:"rectangle",x:c,y:d,width:u,height:h,bgColor:v(t.fill)?void 0:t.fill,strokeColor:"#1f1f1f",strokeWidth:1,id:p,groupId:g});if(e.unshift(y),e.forEach(t=>{t.id!==p&&void 0!==t.x&&void 0!==t.y&&void 0!==t.width&&void 0!==t.height&&t.x>=n&&t.x+t.width<=i&&t.y>=s&&t.y+t.height<=a&&C(t,g)}),o){const t=A({type:"text",id:b(),text:o,x:c+4,y:d-24,width:(f=o,m=16,Math.max(20,Math.round(f.length*m*.6))),height:24,fontSize:16,color:"#1f1f1f",groupId:g});C(t,g,!1),e.push(t)}var f,m}),{elements:e}}}),O=new s({converter:t=>{const e=[];return t.nodes.forEach(t=>{t&&t.length&&t.forEach(t=>{let r;switch(t.type){case"line":r=S(t);break;case"rectangle":case"ellipse":r=k(t);break;case"text":r=A(t);break;default:throw`unknown type ${t.type}`}e.push(r)})}),Object.values(t.lines).forEach(t=>{t&&e.push(S(t))}),Object.values(t.arrows).forEach(t=>{if(!t)return;const r=E(t);e.push(r)}),Object.values(t.text).forEach(t=>{const r=A(t);e.push(r)}),Object.values(t.namespaces).forEach(r=>{const o=Object.keys(r.classes),n=[...o],s=[...t.lines,...t.arrows,...t.text];o.forEach(t=>{const e=s.filter(e=>e.metadata&&e.metadata.classId===t).map(t=>t.id);e.length&&n.push(...e)});const i={type:"frame",id:b(),name:r.id,children:n};e.push(i)}),{elements:e}}}),L=new s({converter:t=>{const e=[];return t.nodes.forEach(t=>{t&&t.length&&t.forEach(t=>{let r;switch(t.type){case"line":r=S(t);break;case"rectangle":case"ellipse":r=k(t);break;case"text":r=A(t);break;default:throw`unknown type ${t.type}`}e.push(r)})}),t.lines.forEach(t=>{e.push(S(t))}),t.arrows.forEach(t=>{e.push(E(t))}),t.text.forEach(t=>{e.push(A(t))}),{elements:e}}}),N=(t,e)=>[t,e],$="#000000",T=new Set(["choice","fork","join","stateStart","stateEnd","divider"]),Y=t=>"stateEnd"===t.shape?[`state_end_group_${t.id}`]:void 0,R=t=>"rectWithTitle"===t.shape&&t.description.length?[t.text,...t.description].join("\n"):t.text;let X;const _=(t,e)=>{const r=(()=>{if(void 0!==X)return X;if("undefined"==typeof document)return X=null,X;try{X=document.createElement("canvas").getContext("2d")}catch{X=null}return X})();return r?(r.font=`${e}px Excalifont, sans-serif`,r.measureText(t).width):t.length*e*.6},q=(t,e,r)=>{if(_(t,e)<=r)return[t];const o=[];let n="";for(const s of t){const t=`${n}${s}`;n&&_(t,e)>r?(o.push(n),n=s):n=t}return n&&o.push(n),o},M=(t,e,r)=>{const o=t.map(t=>((t,e,r)=>{if(!t.trim())return t;if(_(t,e)<=r)return t;const o=t.split(/\s+/).filter(Boolean),n=[];let s="";for(const t of o){const o=q(t,e,r);for(const[t,i]of o.entries()){const o=s?`${s}${s&&0===t?" ":""}${i}`:i;_(o,e)<=r?s=o:(s&&n.push(s),s=i)}o.length}return n.push(s),n.join("\n")})(t,e,r)).join("\n"),n=o.split("\n");return{width:Math.max(...n.map(t=>_(t,e))),height:n.length*e*1.25}},z=t=>{const e=R(t);if(!e||T.has(t.shape))return 16;const r=Math.max(1,t.width-10),o=Math.max(1,t.height-10),n=e.split("\n");if(n.length>1){if(Math.max(...n.map(t=>_(t,16)))<=r)return 16}return((t,e,r,o)=>{const n=t.split("\n");for(let t=16;t>=14;t-=1){const{height:o}=M(n,t,e);if(o<=r)return t}return o})(e,r,o,1===n.length?16:14)},D=t=>{const e=p(t.containerStyle),r=(t=>{if(T.has(t.shape))return;const e=R(t);return e?{text:e,fontSize:z(t),verticalAlign:"rectWithTitle"===t.shape||"roundedWithTitle"===t.shape?"top":"middle",...g(t.labelStyle)}:void 0})(t),o="choice"===t.shape?"diamond":"stateStart"===t.shape||"stateEnd"===t.shape?"ellipse":"rectangle",n="rect"===t.shape||"rectWithTitle"===t.shape||"roundedWithTitle"===t.shape,s="stateStart"===t.shape||"fork"===t.shape||"join"===t.shape,i=e.backgroundColor||e.strokeColor||$,a=e.strokeColor||e.backgroundColor||$;return{id:t.id,type:o,...Y(t)?{groupIds:Y(t)}:{},x:t.x,y:t.y,width:t.width,height:t.height,...r?{label:r}:{},...e,...n?{roundness:{type:3}}:{},...s?{backgroundColor:i,strokeColor:a,fillStyle:"solid"}:{}}},W=new s({converter:t=>{const e=[];return t.nodes.forEach(t=>{if(!t.isRenderable)return;const r=D(t);e.push(r);const o=(t=>{if(!t.dividerLine)return null;const e=p(t.containerStyle);return{id:`${t.id}__divider`,type:"line",x:t.dividerLine.startX,y:t.dividerLine.startY,width:t.dividerLine.endX-t.dividerLine.startX,height:t.dividerLine.endY-t.dividerLine.startY,points:[N(0,0),N(t.dividerLine.endX-t.dividerLine.startX,t.dividerLine.endY-t.dividerLine.startY)],strokeColor:e.strokeColor||"#000",strokeWidth:e.strokeWidth||1}})(t);o&&e.push(o),"stateEnd"===t.shape&&e.push((t=>{const e=p(t.containerStyle),r=Math.max(2,.32*Math.min(t.width,t.height)),o=t.endInnerColor||e.strokeColor||e.backgroundColor||$;return{id:`${t.id}__inner`,type:"ellipse",groupIds:Y(t),x:t.x+r,y:t.y+r,width:Math.max(1,t.width-2*r),height:Math.max(1,t.height-2*r),backgroundColor:o,strokeColor:o,fillStyle:"solid",strokeWidth:1}})(t))}),t.edges.forEach(t=>{e.push((t=>{const e=t.reflectionPoints.map((t,e,r)=>{const o=r[0];return 0===e?N(0,0):N(t.x-o.x,t.y-o.y)});return{id:t.id,type:"arrow",x:t.startX,y:t.startY,width:t.endX-t.startX,height:t.endY-t.startY,points:e,strokeColor:t.strokeColor||"#000",strokeWidth:t.strokeWidth||2,strokeStyle:t.strokeStyle||"solid",endArrowhead:t.isNoteEdge?null:"triangle",roundness:{type:2},start:{id:t.start},end:{id:t.end},...t.text?{label:{text:t.text,fontSize:16}}:{}}})(t))}),{elements:e}}}),F=t=>{const e=(t=j(t)).replace(/#(\d+);/g,"&#$1;").replace(/#([a-z]+);/g,"&$1;"),r=document.createElement("textarea");return r.innerHTML=e,r.value},B=t=>{const e=t.getAttribute("transform"),r=e?.match(/translate\(([ \d.-]+),\s*([\d.-]+)\)/);let o=0,n=0;return r&&(o=Number(r[1]),n=Number(r[2])),{transformX:o,transformY:n}},j=function(t){return t.replace(/fl°°/g,"#").replace(/fl°/g,"&").replace(/¶ß/g,";")},K=(t,e=.5)=>{const r=[];return t.forEach(t=>{const o=r[r.length-1];if(!o)return void r.push(t);Math.hypot(t[0]-o[0],t[1]-o[1])<=e||r.push(t)}),r},P=t=>{const e=t.getAttribute("d");if(!e)return null;const r=Array.from(e.matchAll(/-?\d*\.?\d+(?:e[-+]?\d+)?/gi),t=>Number(t[0]));return r.length<4?null:{startX:r[0],startY:r[1],endX:r[r.length-2],endY:r[r.length-1]}},U=t=>{const e=t.getAttribute("data-points");if(!e){const e=P(t);return e?[{x:e.startX,y:e.startY},{x:e.endX,y:e.endY}]:[]}try{const t=atob(e),r=JSON.parse(t);return Array.isArray(r)?r.filter(t=>t&&"number"==typeof t.x&&"number"==typeof t.y&&Number.isFinite(t.x)&&Number.isFinite(t.y)):[]}catch{return[]}},H=(t,e={x:0,y:0},r="LM")=>{if("path"!==t.tagName.toLowerCase())throw new Error(`Invalid input: Expected an HTMLElement of tag "path", got ${t.tagName}`);const o=t.getAttribute("d");if(!o)throw new Error('Path element does not contain a "d" attribute');const n=o.split(new RegExp(`(?=[${r}])`)),s=n[0].substring(1).split(",").map(t=>parseFloat(t)),i=n[n.length-1].substring(1).split(",").map(t=>parseFloat(t)),a=n.map(t=>{const e=t[0],r=t.substring(1).split(",").map(t=>parseFloat(t));return"C"===e?{x:r[4],y:r[5],command:e}:{x:r[0],y:r[1],command:e}}).filter((t,e,r)=>{if(0===e||e===r.length-1)return!0;if(t.x===r[e-1].x&&t.y===r[e-1].y)return!1;if(e===r.length-2&&"C"===t.command)return!1;if(e===r.length-2&&(r[e-1].x===t.x||r[e-1].y===t.y)){const e=r[r.length-1];return Math.hypot(e.x-t.x,e.y-t.y)>20}return t.x!==r[e-1].x||t.y!==r[e-1].y}).map(t=>({x:t.x+e.x,y:t.y+e.y}));return{startX:s[0]+e.x,startY:s[1]+e.y,endX:i[0]+e.x,endY:i[1]+e.y,reflectionPoints:a}},V=(t,e={})=>(t=>({...t,elements:t.elements.map(t=>{if(!("points"in t)||!Array.isArray(t.points))return t;const e=t.points;if(e.length<2)return t;const r=K(e);return r.length===e.length?t:{...t,points:r}})}))((()=>{switch(t.type){case"graphImage":return m.convert(t,e);case"flowchart":return f.convert(t,e);case"sequence":return I.convert(t,e);case"class":return O.convert(t,e);case"erd":return L.convert(t,e);case"state":return W.convert(t,e);default:throw new Error(`graphToExcalidraw: unknown graph type "${t.type}, only flowcharts are supported!"`)}})());var G=r(62300);const J=t=>t.replace(/\s*!important\s*$/i,"").trim(),Z=(t,e)=>{let r=e;for(;r<t.length&&/\s/.test(t[r]);)r+=1;const o=r;for(;r<t.length&&/[a-z-]/i.test(t[r]);)r+=1;if(r===o)return!1;for(;r<t.length&&/\s/.test(t[r]);)r+=1;return":"===t[r]},Q=t=>{const e=[];let r=0;for(;r<t.length;){for(;r<t.length&&/[\s;,]/.test(t[r]);)r+=1;if(r>=t.length)break;const o=r;for(;r<t.length&&":"!==t[r]&&";"!==t[r]&&","!==t[r];)r+=1;if(r>=t.length||":"!==t[r])break;const n=t.substring(o,r).trim().toLowerCase();r+=1;const s=r;let i=0,a=null;for(;r<t.length;){const e=t[r];if(a)e===a&&"\\"!==t[r-1]&&(a=null),r+=1;else if('"'!==e&&"'"!==e)if("("!==e)if(")"!==e){if(0===i){if(";"===e||","===e)break;if(/\s/.test(e)&&Z(t,r))break}r+=1}else i=Math.max(0,i-1),r+=1;else i+=1,r+=1;else a=e,r+=1}const l=J(t.substring(s,r));n&&l&&e.push({property:n,value:l}),r<t.length&&(";"===t[r]||","===t[r])&&(r+=1)}return e},tt=t=>{const e=J(t);if(!e)return!1;if("undefined"!=typeof CSS&&"function"==typeof CSS.supports)return CSS.supports("color",e);if("undefined"!=typeof document){const t=document.createElement("div");return t.style.color="",t.style.color=e,""!==t.style.color}return!1},et=(t,e)=>{const r=t.getAttribute("style");return r&&Q(r).find(t=>t.property===e)?.value||""},rt=(...t)=>{for(const e of t){const t=J(e||"");if(tt(t))return t}},ot=(t,e)=>{const r=t.querySelector("text, foreignObject, div, span, p")||t,o=rt(r.getAttribute?.("fill"),et(r,"fill"),r.style?.fill);if(o)return o;const n=rt(r.getAttribute?.("color"),et(r,"color"),r.style?.color);if(n)return n;const s=rt(e);return s||void 0},nt=(t,e,r)=>{switch(e){case l.FILL:case l.STROKE:tt(r)&&(t[e]=r);break;case l.STROKE_WIDTH:case l.STROKE_DASHARRAY:t[e]=r}},st=(t,e,r)=>{e===a.COLOR&&tt(r)&&(t[a.COLOR]=r)},it=(t,e,r)=>{t&&Q(t).forEach(({property:t,value:o})=>{nt(e,t,o),st(r,t,o)})},at=(t,e)=>{t&&Q(t).forEach(({property:t,value:r})=>{"fill"===t&&tt(r)?e[a.COLOR]=r:st(e,t,r)})},lt=(t,e)=>{if(!t)return;[[l.FILL,t.getAttribute("fill")],[l.STROKE,t.getAttribute("stroke")],[l.STROKE_WIDTH,t.getAttribute("stroke-width")],[l.STROKE_DASHARRAY,t.getAttribute("stroke-dasharray")]].forEach(([t,r])=>{const o=J(r||"");o&&nt(e,t,o)})},ct=(t,e)=>{if(!t)return;const r=t.getAttribute("fill")||t.getAttribute("color"),o=J(r||"");tt(o)&&(e[a.COLOR]=o)},dt=(t,e,r,o)=>{if(!(e instanceof Map))return;const n=e.get(t);n&&(n.styles?.forEach(t=>{Q(t).forEach(({property:t,value:e})=>{nt(r,t,e),st(o,t,e)})}),n.textStyles?.forEach(t=>{Q(t).forEach(({property:t,value:e})=>{st(o,t,e)})}))},ut=(t,e,r)=>{const o=e.querySelector(`[id*="${t.domId}"]`);if(!o)return;let n;"a"===o.parentElement?.tagName.toLowerCase()&&(n=o.parentElement.getAttribute("xlink:href"));const s=ht(n?o.parentElement:o,e),i=o.getBBox(),a={width:i.width,height:i.height},l={},c={};t.classes&&r instanceof Map&&(Array.isArray(t.classes)?t.classes:[t.classes]).forEach(t=>{dt(t,r,l,c)}),t.styles?.forEach(t=>{it(t,l,c)});const d=o.querySelector(".label-container");it(d?.getAttribute("style"),l,c),lt(d,l);return Array.from(o.querySelectorAll(".label, .nodeLabel, .label text, .label tspan, .label span, .label div")).forEach(t=>{at(t.getAttribute("style"),c),ct(t,c)}),{id:t.id,labelType:t.labelType,text:F(t.text||""),type:t.type,link:n||void 0,...s,...a,containerStyle:l,labelStyle:c}},ht=(t,e)=>{if(!t)throw new Error("Element not found");let r=t.parentElement?.parentElement;const o=t.childNodes[0];let n={x:0,y:0};if(o){const{transformX:t,transformY:e}=B(o),r=o.getBBox();n={x:Number(o.getAttribute("x"))||t+r.x||0,y:Number(o.getAttribute("y"))||e+r.y||0}}const{transformX:s,transformY:i}=B(t),a={x:s+n.x,y:i+n.y};for(;r&&r.id!==e.id;){if("root"===r.classList.value&&r.hasAttribute("transform")){const{transformX:t,transformY:e}=B(r);a.x+=t,a.y+=e}r=r.parentElement}return a},pt=(t,e)=>{const r=t.getVertices(),o=t.getEdges(),n=t.getSubGraphs(),s=t.getClasses(),i={},a=s instanceof Map?s:{};r instanceof Map?r.forEach((t,r)=>{i[r]=ut(t,e,a)}):"object"==typeof r&&null!==r&&Object.entries(r).forEach(([t,r])=>{i[t]=ut(r,e,a)});const l=new Map,c=(Array.isArray(o)?o:[]).map(t=>{if(!e.querySelector(`[id*="${t.id}"]`))return null;const r=`${t.start}-${t.end}`,o=l.get(r)||0;return l.set(r,o+1),((t,e,r)=>{const o=r.querySelector(`[id*="${t.id}"]`);if(!o)throw new Error("Edge element not found");const n=ht(o,r),s=H(o,n);return t.length=void 0,{...t,...s,text:F(t.text)}})(t,0,e)}).filter(t=>null!==t&&t.reflectionPoints.length>1),d=(Array.isArray(n)?n:[]).map(t=>((t,e,r)=>{const o=t.nodes.map(t=>t.startsWith("flowchart-")?t.split("-")[1]:t),n=e.querySelector(`[id='${t.id}']`);if(!n)throw new Error("SubGraph element not found");const s=ht(n,e),i=n.getBBox(),a={width:i.width,height:i.height},l={},c={},d=n.querySelector(":scope > rect, :scope > path, :scope > polygon, :scope > ellipse")||n.querySelector(".cluster > rect, .cluster > path, .cluster > polygon, .cluster > ellipse")||n.querySelector("rect, path, polygon, ellipse");it(n.getAttribute("style"),l,c),it(d?.getAttribute("style"),l,c),lt(d,l);const u=n.querySelector(".cluster-label text, .cluster-label tspan")||n.querySelector("text");return at(u?.getAttribute("style"),c),ct(u,c),dt(t.id,r,l,c),t.classes?.forEach(t=>{dt(t,r,l,c)}),{id:t.id,nodeIds:o,text:F(t.title),labelType:"text",...s,...a,containerStyle:l,labelStyle:c}})(t,e,a));return{type:"flowchart",subGraphs:d,vertices:i,edges:c}},gt=(t,e,r,o,n)=>{const s={type:"arrow"};return s.startX=t,s.startY=e,s.endX=r,s.endY=o,Object.assign(s,{...n}),s},yt=(t,e,r,o)=>({type:"text",x:t,y:e,text:r,width:o?.width||20,height:o?.height||20,fontSize:o?.fontSize||20,id:o?.id,color:o?.color,groupId:o?.groupId,metadata:o?.metadata}),ft=(t,e,r)=>{const o={},n=Number(t.getAttribute("x")),s=Number(t.getAttribute("y"));o.type="text",o.text=F(e),r?.id&&(o.id=r.id),r?.groupId&&(o.groupId=r.groupId);const i=t.getBBox();o.width=i.width,o.height=i.height,o.x=n-i.width/2,o.y=s;const a=parseInt(getComputedStyle(t).fontSize);return o.fontSize=a,o.color=ot(t),o},bt=(t,e,r={})=>{const o={};o.type=e;const{label:n,subtype:s,id:i,groupId:a}=r;o.id=i,a&&(o.groupId=a),n&&(o.label={text:F(n.text),fontSize:16,textAlign:n?.textAlign,verticalAlign:n?.verticalAlign});const l=t.getBBox();switch(o.x=l.x,o.y=l.y,o.width=l.width,o.height=l.height,o.subtype=s,s){case"highlight":const e=t.getAttribute("fill");e&&(o.bgColor=J(e));break;case"note":o.strokeStyle="dashed"}return o},mt=(t,e,r,o,n,s)=>{const i={};i.startX=e,i.startY=r,i.endX=o,s?.groupId&&(i.groupId=s.groupId),s?.id&&(i.id=s.id),i.endY=n;const a=t.getAttribute("stroke");return i.strokeColor=a?J(a):null,i.strokeWidth=Number(t.getAttribute("stroke-width")),i.type="line",i},xt={0:"SOLID",1:"DOTTED",3:"SOLID_CROSS",4:"DOTTED_CROSS",5:"SOLID_OPEN",6:"DOTTED_OPEN",24:"SOLID_POINT",25:"DOTTED_POINT"},wt=0,St=1,At=2,kt=3,Et=4,vt=5,Ct=6,It=24,Ot=25,Lt=27,Nt=t=>{let e;switch(t){case wt:case kt:case vt:case It:e="solid";break;case St:case Et:case Ct:case Ot:e="dotted";break;default:e="solid"}return e},$t=(t,e,r)=>{if(!t)throw"root node not found";const n=b(),s=Array.from(t.children),i=[];return s.forEach((t,s)=>{const a=`${r?.id}-${s}`;let l;switch(t.tagName){case"line":const r=Number(t.getAttribute("x1")),s=Number(t.getAttribute("y1")),i=Number(t.getAttribute("x2")),c=Number(t.getAttribute("y2"));l=mt(t,r,s,i,c,{groupId:n,id:a});break;case"text":l=ft(t,e,{groupId:n,id:a});break;case"circle":l=bt(t,"ellipse",{label:t.textContent?{text:t.textContent}:void 0,groupId:n,id:a});default:l=bt(t,o[t.tagName],{label:t.textContent?{text:t.textContent}:void 0,groupId:n,id:a})}i.push(l)}),i},Tt=(t,e)=>{const r=e.getAttribute("fill"),o=e.getAttribute("stroke"),n=e.getAttribute("stroke-width"),s=e.getAttribute("stroke-dasharray");r&&"none"!==r&&(t.bgColor=J(r)),o&&"none"!==o&&(t.strokeColor=J(o)),n&&(t.strokeWidth=Number(n)),s&&s.trim()&&(t.strokeStyle="dashed")},Yt=(t,e,r)=>{const o=[],n=Array.from(e.querySelectorAll('[class*="messageLine"]')),s=Object.keys(xt),i=t.filter(t=>s.includes(t.type.toString()));return n.forEach((t,e)=>{const n=i[e],s=xt[n.type],a=((t,e)=>{const r={};e?.label&&(r.label={text:F(e.label),fontSize:16});const o=t.tagName;if("line"===o)r.startX=Number(t.getAttribute("x1")),r.startY=Number(t.getAttribute("y1")),r.endX=Number(t.getAttribute("x2")),r.endY=Number(t.getAttribute("y2"));else if("path"===o){const e=t.getAttribute("d");if(!e)throw new Error('Path element does not contain a "d" attribute');const o=e.split(/(?=[LC])/),n=o[0].substring(1).split(",").map(t=>parseFloat(t)),s=[];o.forEach(t=>{const e=t.substring(1).trim().split(" ").map(t=>{const[e,r]=t.split(",");return[parseFloat(e)-n[0],parseFloat(r)-n[1]]});s.push(...e)});const i=s[s.length-1];r.startX=n[0],r.startY=n[1],r.endX=i[0],r.endY=i[1],r.points=s}if(e?.label){const t=10;r.startY=r.startY-t,r.endY=r.endY-t}const n=t.getAttribute("stroke"),s=(n&&"none"!==n?n:"")||getComputedStyle(t).stroke||"";return r.strokeColor=s?J(s):null,r.strokeWidth=Number(t.getAttribute("stroke-width")),r.type="arrow",r.strokeStyle=e?.strokeStyle||"solid",r.startArrowhead=e?.startArrowhead||null,r.endArrowhead=e?.endArrowhead||null,r})(t,{label:n?.message,strokeStyle:Nt(n.type),endArrowhead:"SOLID_OPEN"===s||"DOTTED_OPEN"===s?null:"arrow"}),l=r[n.from],c=r[n.to];l?.topId&&c?.topId&&(a.start={type:l.bindType||"rectangle",id:l.topId},a.end={type:c.bindType||"rectangle",id:c.topId}),((t,e)=>{if(t.nextElementSibling?.classList.contains("sequenceNumber")){const r=t.nextElementSibling?.textContent;if(!r)throw new Error("sequence number not present");const o=30,n=o/2,s=10,i={type:"rectangle",x:e.startX-s,y:e.startY-n,label:{text:r,fontSize:14},bgColor:"#e9ecef",height:o,subtype:"sequence"};Object.assign(e,{sequenceNumber:i})}})(t,a),o.push(a)}),o},Rt=(t,e)=>{const r=t.db,o=[],n=r.getBoxes().map(t=>({...t,fill:J(t.fill||"")})),s=(t=>{const e=Array.from(t.querySelectorAll(".rect")).filter(t=>"g"!==t.parentElement?.tagName),r=[];return e.forEach(t=>{const e=bt(t,"rectangle",{label:{text:""},subtype:"highlight"});r.push(e)}),r})(e),i=r.getActors(),{nodes:a,lines:l,actorMap:c}=((t,e)=>{const r=Array.from(e.querySelectorAll(".actor-top")),o=Array.from(e.querySelectorAll(".actor-bottom")),n=[],s=[],i={},a=t instanceof Map?Array.from(t.values()):Object.values(t),l=Array.from(e.querySelectorAll(".actor-line")),c=(t,e)=>{const r=t.name,o=l.find(t=>t.getAttribute("name")===r);if(o)return o;const n="participant"===t.type?e.parentElement?.previousElementSibling:e.previousElementSibling;return n?"line"===n.tagName?n:n.querySelector("line"):null};return a.forEach(t=>{const e=r.find(e=>e.getAttribute("name")===t.name),a=o.find(e=>e.getAttribute("name")===t.name);if(!e||!a)throw"root not found";const l=t.description;if("participant"===t.type){const r=bt(e,"rectangle",{id:`${t.name}-top`,label:{text:l},subtype:"actor"});if(Tt(r,e),!r)throw"Top Node element not found!";n.push([r]);const o=bt(a,"rectangle",{id:`${t.name}-bottom`,label:{text:l},subtype:"actor"});i[t.name]={topId:`${t.name}-top`,bottomId:`${t.name}-bottom`,bindType:"rectangle"},Tt(o,a),n.push([o]);const d=c(t,e);if("line"!==d?.tagName)throw"Line not found";const u=Number(d.getAttribute("x1"));if(!r.height)throw"Top node element height is null";const h=r.y+r.height,p=o.y,g=Number(d.getAttribute("x2")),y=mt(d,u,h,g,p);s.push(y)}else if("actor"===t.type){const r=$t(e,l,{id:`${t.name}-top`});n.push(r);const o=$t(a,l,{id:`${t.name}-bottom`});n.push(o);const d=c(t,e);if("line"!==d?.tagName)throw"Line not found";const u=Number(d.getAttribute("x1")),h=Number(d.getAttribute("y1")),p=Number(d.getAttribute("x2")),g=o.find(t=>"ellipse"===t.type);if(g){const t=g.y,e=mt(d,u,h,p,t);s.push(e)}const y=r.find(t=>"ellipse"===t.type),f=o.find(t=>"ellipse"===t.type);y?.id&&f?.id&&(i[t.name]={topId:y.id,bottomId:f.id,bindType:"ellipse"})}}),{nodes:n,lines:s,actorMap:i}})(i,e),d=r.getMessages(),u=Yt(d,e,c),h=((t,e)=>{const r=Array.from(e.querySelectorAll(".note")).map(t=>t.parentElement),o=t.filter(t=>t.type===At),n=[];return r.forEach((t,e)=>{if(!t)return;const r=t.firstChild,s=o[e].message,i=bt(r,"rectangle",{label:{text:s},subtype:"note"}),a=r.getAttribute("fill"),l=r.getAttribute("stroke"),c=r.getAttribute("stroke-width"),d=r.getAttribute("stroke-dasharray");a&&"none"!==a&&(i.bgColor=J(a)),l&&"none"!==l&&(i.strokeColor=J(l)),c&&(i.strokeWidth=Number(c)),d&&d.trim()&&(i.strokeStyle="dashed"),n.push(i)}),n})(d,e),p=(t=>{const e=Array.from(t.querySelectorAll("[class*=activation]")),r=[];return e.forEach(t=>{const e=bt(t,"rectangle",{label:{text:""},subtype:"activation"});(()=>{const r=t.getAttribute("fill"),o=t.getAttribute("stroke"),n=t.getAttribute("stroke-width"),s=t.getAttribute("stroke-dasharray");r&&"none"!==r&&(e.bgColor=J(r)),o&&"none"!==o&&(e.strokeColor=J(o)),n&&(e.strokeWidth=Number(n)),s&&s.trim()&&(e.strokeStyle="dashed")})(),r.push(e)}),r})(e),g=((t,e)=>{const r=Array.from(e.querySelectorAll(".loopLine")),o=[],n=[],s=[];r.forEach(t=>{const e=Number(t.getAttribute("x1")),r=Number(t.getAttribute("y1")),n=Number(t.getAttribute("x2")),s=Number(t.getAttribute("y2")),i=mt(t,e,r,n,s);i.strokeStyle="dotted",i.strokeColor="#adb5bd",i.strokeWidth=2,o.push(i)});const i=Array.from(e.querySelectorAll(".loopText")),a=t.filter(t=>t.type===Lt).map(t=>t.message);i.forEach(t=>{const e=t.textContent||"",r=ft(t,e),o=e.match(/\[(.*?)\]/)?.[1]||"";a.includes(o)&&(r.x+=16),n.push(r)});const l=Array.from(e?.querySelectorAll(".labelBox")),c=Array.from(e?.querySelectorAll(".labelText"));return l.forEach((t,e)=>{const r=c[e]?.textContent||"",o=bt(t,"rectangle",{label:{text:r}});o.strokeColor="#adb5bd",o.bgColor="#e9ecef",o.width=void 0,s.push(o)}),{lines:o,texts:n,nodes:s}})(d,e);return o.push(s),o.push(...a),o.push(h),o.push(p),{type:"sequence",lines:l,arrows:u,nodes:o,loops:g,groups:n}},Xt=0,_t=1,qt=2,Mt=0,zt=1,Dt=t=>{let e;switch(t){case Xt:e="diamond_outline";break;case qt:e="diamond";break;case _t:e="triangle_outline";break;case"none":e=null;break;default:e="arrow"}return e},Wt=(t,e)=>{let r=0,o=0,n=t;for(;n&&n!==e;){const{transformX:t,transformY:e}=B(n);r+=t,o+=e,n=n.parentElement}return{tx:r,ty:o}},Ft=new Set(["triangle_outline","diamond","diamond_outline"]),Bt=(t,e=.5)=>{if(t.length<=2)return[...t];const r=[t[0]];for(let o=1;o<t.length-1;o++){const n=r[r.length-1],s=t[o],i=t[o+1],a=i.x-n.x,l=i.y-n.y,c=Math.hypot(a,l);if(!c)continue;const d=Math.abs(a*(s.y-n.y)-l*(s.x-n.x))/c,u=((s.x-n.x)*a+(s.y-n.y)*l)/(c*c);d<=e&&u>=-e&&u<=1+e||r.push(s)}return r.push(t[t.length-1]),r},jt=t=>{const e=K(U(t).map(t=>[t.x,t.y])).map(([t,e])=>({x:t,y:e})),r=P(t);return r&&e.length>=2&&(e[0]={x:r.startX,y:r.startY},e[e.length-1]={x:r.endX,y:r.endY}),Bt(e)},Kt=(t,e,r)=>{const o=t.x-e.x,n=t.y-e.y,s=Math.hypot(o,n);return s?{x:t.x+o/s*r,y:t.y+n/s*r}:t},Pt=t=>{const e=t.points?.map(([e,r])=>({x:t.startX+e,y:t.startY+r})).filter(t=>Number.isFinite(t.x)&&Number.isFinite(t.y));if(!e||e.length<2)return t;const r=[...e],o=!!t.startArrowhead&&Ft.has(t.startArrowhead),n=!!t.endArrowhead&&Ft.has(t.endArrowhead);if(!o&&!n)return t;if(o&&(r[0]=Kt(r[0],r[1],16)),n){const t=r.length-1;r[t]=Kt(r[t],r[t-1],16)}return((t,e)=>{const r=K(e.map(t=>[t.x,t.y])).map(([t,e])=>({x:t,y:e}));if(r.length<2)throw new Error("Arrow route must contain at least two points");const o=r[0],n=r[r.length-1];t.startX=o.x,t.startY=o.y,t.endX=n.x,t.endY=n.y,t.points=r.map(t=>[t.x-o.x,t.y-o.y])})(t,r),t},Ut=(t,e,r)=>{if(t.length<2)throw new Error(`Class diagram edge ${e?.id||"<unknown>"} is missing usable path points`);const o=t[0],n=t[t.length-1],s=gt(o.x,o.y,n.x,n.y,{id:e?.getAttribute("data-id")||e?.id||void 0,...r,points:t.map(t=>[t.x-o.x,t.y-o.y])});return e&&((t,e)=>{const r=J(t.getAttribute("stroke")||getComputedStyle(t).stroke||""),o=parseFloat(t.getAttribute("stroke-width")||getComputedStyle(t).strokeWidth||"1");tt(r)&&"none"!==r&&(e.strokeColor=r),Number.isFinite(o)&&o>0&&(e.strokeWidth=o)})(e,s),Pt(s)},Ht=(t,e)=>Ut((t=>{const e=[];return t.forEach(t=>{jt(t).forEach(t=>{const r=e[e.length-1];r&&r.x===t.x&&r.y===t.y||e.push(t)})}),Bt(e)})(t),t[0],e),Vt=(t,e)=>{const r=(t=>t.points?.map(([e,r])=>({x:t.startX+e,y:t.startY+r})).filter(t=>Number.isFinite(t.x)&&Number.isFinite(t.y))||[])(t);if(r.length<2)return null;const o="start"===e,n=o?r[0]:r[r.length-1],s=o?r[1]:r[r.length-2],i=s.x===n.x?o?-1:1:Math.sign(s.x-n.x),a=s.y===n.y?1:Math.sign(s.y-n.y);return{x:n.x+20*i,y:n.y+(a>=0?12:-28)}},Gt=(t,e)=>{let r=t;for(;r&&r!==e;){if(r.classList.contains("annotation-group"))return"header";if(r.classList.contains("label-group"))return"header";if(r.classList.contains("members-group"))return"members";if(r.classList.contains("methods-group"))return"methods";r=r.parentElement}return"other"},Jt=(t,e,r)=>{const o=[],n=[],s=[];return Object.values(t).forEach(t=>{const{domId:i,id:a}=t,l=b(),c=(t=>{const e={};return t?(t.forEach(t=>{Q(t).forEach(({property:t,value:r})=>{t&&r&&(e[t]=J(r))})}),e):e})(t.styles||t.cssStyles);let d;try{d=r?r(a):void 0}catch{d=void 0}const u=d&&e.querySelector(`#${d}`)||e.querySelector(`#${i}`)||e.querySelector(`[data-id='${a}']`)||(t=>{const r=new RegExp(`^classId-${t}(?:-|$)`);return Array.from(e.querySelectorAll("[id]")).filter(t=>r.test(t.id))[0]})(a);if(!u)throw Error(`DOM Node with id ${i} not found`);const h=u.querySelector("rect")||u,p=h.getBBox(),{tx:g,ty:y}=Wt(h,e),f={type:"rectangle",id:a,groupId:l,x:p.x+g,y:p.y+y,width:p.width,height:p.height,metadata:{classId:a}},m=h.getAttribute("fill"),x=h.getAttribute("stroke"),w=h.getAttribute("stroke-width"),S=h.getAttribute("stroke-dasharray"),A=getComputedStyle(h),k=J(m||c.fill||(m?A.fill:"")),E=J(x||c.stroke||(x?A.stroke:"")),v=w||c["stroke-width"]||(w?A.strokeWidth:""),C=S||c["stroke-dasharray"]||(S?"none"===A.strokeDasharray?"":A.strokeDasharray:""),I=t=>{if(!t)return!1;if(!tt(t))return!1;const e=t.toLowerCase();return!("none"===e||"transparent"===e||"rgba(0, 0, 0, 0)"===e||"black"===e||"#000"===e||"#000000"===e||"rgb(0, 0, 0)"===e||"rgba(0, 0, 0, 1)"===e)};I(k)?f.bgColor=k:f.bgColor=void 0,I(E)?f.strokeColor=E:f.strokeColor=void 0,f.strokeWidth=v?Number(v):void 0,C&&C.trim().length>0?f.strokeStyle="dashed":f.strokeStyle=void 0,o.push(f);[...Array.from(u.querySelectorAll("line")),...Array.from(u.querySelectorAll("g.divider path"))].forEach(t=>{const{tx:r,ty:o}=Wt(t,e);let s,i,c,d;if("line"===t.tagName.toLowerCase())s=Number(t.getAttribute("x1"))+r,i=Number(t.getAttribute("y1"))+o,c=Number(t.getAttribute("x2"))+r,d=Number(t.getAttribute("y2"))+o;else{const e=t.getBBox();s=e.x+r,c=e.x+e.width+r;const n=e.y+e.height/2+o;i=n,d=n}if(s===c&&i===d)return;const u=mt(t,s,i,c,d,{groupId:l,id:b()});f.strokeColor?u.strokeColor=f.strokeColor:u.strokeColor=void 0,void 0!==f.strokeWidth?u.strokeWidth=f.strokeWidth:u.strokeWidth=void 0,f.strokeStyle?u.strokeStyle=f.strokeStyle:u.strokeStyle=void 0,u.metadata={classId:a},n.push(u)});const O=Array.from(u.querySelectorAll("text, foreignObject")),L=[];O.forEach(t=>{const r="foreignobject"===t.tagName.toLowerCase(),o=r?[]:Array.from(t.querySelectorAll("tspan")),n=o.length?o.map(t=>t.textContent?.trim()).filter(Boolean).join("\n"):t.textContent?.trim()||"";if(!n)return;const s=t.getBBox(),{ty:i}=Wt(t,e);let a=parseFloat(getComputedStyle(t).fontSize||"");if(r&&(!Number.isFinite(a)||!a)){const e=t.querySelector("div, span, p");e&&(a=parseFloat(getComputedStyle(e).fontSize||""))}(!Number.isFinite(a)||a<=0)&&(a=Math.max(12,.6*s.height)),a*=.9;const l=ot(t,c.color);L.push({section:Gt(t,u),text:F(n),x:s.x,y:s.y+i,width:f&&f.width?Math.max(f.width-8,s.width):s.width,height:s.height,fontSize:a,color:l})});const N=L.filter(t=>"header"===t.section).sort((t,e)=>t.y-e.y||t.x-e.x);if(!f.label){const t=0===N.length&&1===L.length?L:N;t.length>0&&(f.label={text:t.map(t=>t.text).join("\n"),fontSize:Math.max(...t.map(t=>t.fontSize)),color:t.find(t=>t.color)?.color,verticalAlign:"top"})}L.filter(t=>N.length>0?"header"!==t.section:!(f.label&&1===L.length)).forEach(t=>{const e=yt((f?.x||0)+4,t.y,t.text,{width:t.width,height:t.height,fontSize:t.fontSize,color:t.color,id:b(),groupId:l,metadata:{classId:a}});s.push(e)})}),{nodes:o,lines:n,text:s}},Zt=(t,e,r,o)=>{const n=Array.from(r.querySelectorAll('.edgePaths path[data-edge="true"]:not([id^="edgeNote"]):not([id*="-cyclic-special-"])'));if(0===t.length)return{arrows:[],text:[]};const s=[],i=[];let a=0;return t.forEach(t=>{const{id1:l,id2:c,relation:d}=t,u=e.find(t=>t.id===l),h=e.find(t=>t.id===c);if(!u)throw new Error(`parseRelations: Cannot find node with id ${l}`);if(!h)throw new Error(`parseRelations: Cannot find node with id ${c}`);const p=(t=>{let e;switch(t){case Mt:e="solid";break;case zt:e="dotted";break;default:e="solid"}return e})(d.lineType),g=Dt(d.type1),y=Dt(d.type2);let f;if(l===c){const e=((t,e)=>[`${t}-cyclic-special-1`,`${t}-cyclic-special-mid`,`${t}-cyclic-special-2`].map(t=>e.querySelector(`path[id="${t}"][data-edge="true"]`)).filter(t=>null!==t))(l,r);if(!e.length)throw new Error(`parseRelations: Cannot find rendered SVG edge for relation ${l} -> ${c}`);f=Ht(e,{strokeStyle:p,startArrowhead:g,endArrowhead:y,label:t.title?{text:t.title}:void 0,start:{type:"rectangle",id:u.id},end:{type:"rectangle",id:h.id}})}else{const e=n[a];if(!e)throw new Error(`parseRelations: Cannot find rendered SVG edge for relation ${l} -> ${c}`);a+=1,f=((t,e)=>{const r=jt(t);return Ut([r[0],r[r.length-1]],t,e)})(e,{strokeStyle:p,startArrowhead:g,endArrowhead:y,label:t.title?{text:t.title}:void 0,start:{type:"rectangle",id:u.id},end:{type:"rectangle",id:h.id}})}s.push(f);const{relationTitle1:b,relationTitle2:m}=t,x=l===c,w=20,S=15,A=15;let k,E;if(b&&"none"!==b){if(x){const t=Vt(f,"start");t&&(k=t.x,E=t.y)}else switch(o){case"TB":k=f.startX-w,f.endX<f.startX&&(k-=A),E=f.startY+S;break;case"BT":k=f.startX+w,f.endX>f.startX&&(k+=A),E=f.startY-S;break;case"LR":k=f.startX+w,E=f.startY+S,f.endY>f.startY&&(E+=A);break;case"RL":k=f.startX-w,E=f.startY-S,f.startY>f.endY&&(E-=A);break;default:k=f.startX-w,E=f.startY+S}k??=f.startX-w,E??=f.startY+S;const t=yt(k,E,b,{fontSize:16});i.push(t)}if(m&&"none"!==m){if(x){const t=Vt(f,"end");t&&(k=t.x,E=t.y)}else switch(o){case"TB":k=f.endX+w,f.endX<f.startX&&(k+=A),E=f.endY-S;break;case"BT":k=f.endX-w,f.endX>f.startX&&(k-=A),E=f.endY+S;break;case"LR":k=f.endX-w,E=f.endY-S,f.endY>f.startY&&(E-=A);break;case"RL":k=f.endX+w,E=f.endY+S,f.startY>f.endY&&(E+=A);break;default:k=f.endX+w,E=f.endY-S}k??=f.endX+w,E??=f.endY+S;const t=yt(k,E,m,{fontSize:16});i.push(t)}}),{arrows:s,text:i}},Qt=(t,e,r)=>{const o=[],n=[];return t.forEach((t,s)=>{const{id:i,text:a,class:l}=t,c=e.querySelector(`#${i}`);if(!c)throw new Error(`Node with id ${i} not found!`);const{transformX:d,transformY:u}=B(c),h=c.firstChild,p=bt(h,"rectangle",{id:i,subtype:"note",label:{text:a}});if(Object.assign(p,{x:p.x+d,y:p.y+u}),o.push(p),l){const t=r.find(t=>t.id===l);if(!t)throw new Error(`class node with id ${l} not found!`);const o=e.querySelector(`path[id="edgeNote${s+1}"][data-edge="true"]`);if(o)return void n.push(((t,e)=>Ht([t],e))(o,{strokeStyle:"dotted",startArrowhead:null,endArrowhead:null,start:{id:p.id,type:"rectangle"},end:{id:t.id,type:"rectangle"}}));const i=p.x+(p.width||0)/2,a=p.y+(p.height||0),c=i,d=t.y,u=gt(i,a,c,d,{strokeStyle:"dotted",startArrowhead:null,endArrowhead:null,start:{id:p.id,type:"rectangle"},end:{id:t.id,type:"rectangle"}});n.push(u)}}),{notes:o,connectors:n}},te=(t,e)=>{let r=0,o=0,n=t;for(;n&&n!==e;){const{transformX:t,transformY:e}=B(n);r+=t,o+=e,n=n.parentElement}return{tx:r,ty:o}},ee=t=>{const e=t.querySelector("text, foreignObject, div, span, p")||t;let r=parseFloat(getComputedStyle(e).fontSize||"");return(!Number.isFinite(r)||r<=0)&&(r=Math.max(12,.75*t.getBBox().height)),r},re=(t,e,r)=>{const o=(t=>{const e=Array.from(t.querySelectorAll("tspan")),r=e.length?e.map(t=>t.textContent?.trim()).filter(Boolean).join("\n"):t.textContent?.trim()||"";return F(r)})(t);if(!o)return null;const n=t.getBBox(),{tx:s,ty:i}=te(t,e);return{className:t.getAttribute("class")||"",text:o,x:n.x+s,y:n.y+i,width:n.width,height:n.height,fontSize:ee(t),color:ot(t,r)}},oe=t=>{switch(t?.toLowerCase()){case"one":return"cardinality_one";case"many":return"cardinality_many";case"only_one":return"cardinality_exactly_one";case"one_or_more":return"cardinality_one_or_many";case"zero_or_one":return"cardinality_zero_or_one";case"zero_or_more":return"cardinality_zero_or_many";default:return null}},ne=t=>{switch(t){case"dotted":return"dotted";case"dashed":return"dashed";default:return"solid"}},se=(t,e)=>{const r=e.querySelector(`[id="${t.id}"]`);if(!r)throw new Error(`ER entity ${t.id} not found in rendered SVG`);const o=t.attributes.length?b():void 0,n=r.getBBox(),{tx:s,ty:i}=te(r,e),a=(t=>{const e={};return t?(t.forEach(t=>{Q(t).forEach(({property:t,value:r})=>{t&&r&&(e[t]=J(r))})}),e):e})([...t.cssStyles||[],...t.cssCompiledStyles||[]]),l=J(a.fill||""),c=J(a.stroke||""),d=(t=>{if(null==t||""===t)return;const e="number"==typeof t?t:parseFloat(J(t));return!Number.isFinite(e)||e<=0?void 0:e})(a["stroke-width"]),u=J(a["stroke-dasharray"]||""),h=Array.from(r.querySelectorAll("g.label")).map(t=>re(t,e,a.color)).filter(t=>null!==t),p=h.find(t=>t.className.includes("name"))||h[0],g=h.filter(t=>t!==p),y=p?.text||F(t.alias||t.label||""),f={type:"rectangle",id:t.id,groupId:o,x:n.x+s,y:n.y+i,width:n.width,height:n.height,label:{text:y,fontSize:t.attributes.length?18:p?.fontSize||16,color:p?.color,textAlign:"center",verticalAlign:t.attributes.length?"top":"middle"},metadata:{entityId:t.id,entityLabel:t.label,entityAlias:t.alias}};tt(l)&&"none"!==l&&(f.bgColor=l),tt(c)&&"none"!==c&&(f.strokeColor=c),d&&Number.isFinite(d)&&d>0&&(f.strokeWidth=d),u&&"none"!==u&&(f.strokeStyle="dashed");const m=Array.from(r.querySelectorAll(".divider path, path.divider, line.divider")).map(r=>((t,e,r,o,n,s,i)=>{const{tx:a,ty:l}=te(t,e);let c=0,d=0,u=0,h=0;if("line"===t.tagName.toLowerCase())c=Number(t.getAttribute("x1"))+a,d=Number(t.getAttribute("y1"))+l,u=Number(t.getAttribute("x2"))+a,h=Number(t.getAttribute("y2"))+l;else{const e=P(t);if(!e)return null;c=e.startX+a,d=e.startY+l,u=e.endX+a,h=e.endY+l}const p={type:"line",id:b(),groupId:r,startX:c,startY:d,endX:u,endY:h,metadata:{entityId:o}};return n&&tt(n)&&"none"!==n&&(p.strokeColor=n),void 0!==s&&(p.strokeWidth=s),i&&(p.strokeStyle=i),p})(r,e,o,t.id,f.strokeColor,f.strokeWidth,f.strokeStyle)).filter(t=>null!==t),x=g.map(e=>yt(e.x,e.y,e.text,{id:b(),groupId:o,width:e.width,height:e.height,fontSize:18,color:e.color,metadata:{entityId:t.id}}));return{container:f,lines:m,text:x}},ie=(t,e)=>{const r=((t,e)=>{const r=e.querySelector(`path[id="${t.id}"][data-edge="true"]`);return r?[r]:t.start!==t.end?[]:[`${t.start}-cyclic-special-1`,`${t.start}-cyclic-special-mid`,`${t.start}-cyclic-special-2`].map(t=>e.querySelector(`path[id="${t}"][data-edge="true"]`)).filter(t=>null!==t)})(t,e);if(!r.length)throw new Error(`ER relationship ${t.id} not found in rendered SVG`);const o=(t=>{const e=[];return t.forEach(t=>{U(t).forEach(t=>{const r=e[e.length-1];r&&r.x===t.x&&r.y===t.y||e.push(t)})}),e})(r);if(o.length<2)throw new Error(`ER relationship ${t.id} is missing usable path points`);const n=o[0],s=o[o.length-1],i=r[0],a=J(i.getAttribute("stroke")||getComputedStyle(i).stroke||""),l=Number(i.getAttribute("stroke-width")||getComputedStyle(i).strokeWidth||1),c=gt(n.x,n.y,s.x,s.y,{id:t.id,label:t.label?{text:F(t.label),fontSize:16,textAlign:"center"}:void 0,strokeStyle:ne(t.pattern),startArrowhead:oe(t.arrowTypeStart),endArrowhead:oe(t.arrowTypeEnd),start:{type:"rectangle",id:t.start},end:{type:"rectangle",id:t.end},points:o.map(t=>[t.x-n.x,t.y-n.y])});return tt(a)&&"none"!==a&&(c.strokeColor=a),Number.isFinite(l)&&l>0&&(c.strokeWidth=l),c},ae=t=>{const e=J(t||"");return!!e&&("none"!==e&&"transparent"!==e&&"rgba(0, 0, 0, 0)"!==e&&"rgba(0,0,0,0)"!==e&&tt(e))},le=(t,e,r)=>{switch(e){case l.FILL:case l.STROKE:ae(r)&&(t[e]=J(r));break;case l.STROKE_WIDTH:case l.STROKE_DASHARRAY:J(r)&&(t[e]=J(r))}},ce=(t,e,r)=>{e===a.COLOR&&ae(r)&&(t[a.COLOR]=J(r))},de=(t,e)=>{t&&Q(t).forEach(({property:t,value:r})=>{t===l.FILL&&ae(r)?e[a.COLOR]=J(r):ce(e,t,r)})},ue=(t,e)=>{let r=0,o=0,n=t;for(;n&&n!==e;){const{transformX:t,transformY:e}=B(n);r+=t,o+=e,n=n.parentElement}return{tx:r,ty:o}},he=(t,e)=>{const r=t.querySelector("line.divider");if(!r)return;const{tx:o,ty:n}=ue(r,e);return{startX:Number(r.getAttribute("x1"))+o,startY:Number(r.getAttribute("y1"))+n,endX:Number(r.getAttribute("x2"))+o,endY:Number(r.getAttribute("y2"))+n}},pe=t=>{const e=t.getBBox();return Math.abs(e.width*e.height)},ge=(t,e)=>{const r=t.getAttribute("style");if(!r)return;const o=Q(r).find(t=>t.property===e);return o?J(o.value):void 0},ye=(t,e)=>{const r=t.map(t=>({element:t,area:pe(t)})).filter(({area:t})=>Number.isFinite(t)&&t>0);if(0===r.length)return null;return r.sort((t,r)=>"largest"===e?r.area-t.area:t.area-r.area)[0].element},fe=(t,e)=>{const r=Array.from(t.querySelectorAll("circle, ellipse, path"));return((t,e)=>{if(!t)return;if(!e.has(l.FILL)&&!e.has(l.STROKE))return;const r=J(t.getAttribute("fill")||ge(t,l.FILL)||""),o=J(t.getAttribute("stroke")||ge(t,l.STROKE)||"");return ae(r)?r:ae(o)?o:void 0})(ye(r,"smallest"),e)},be=t=>(t=>{if(t.length<2)return t;const e=t.slice(1),r=e.filter(t=>t.trim().length>0).reduce((t,e)=>{const r=e.match(/^\s*/)?.[0].length??0;return Math.min(t,r)},Number.POSITIVE_INFINITY);return!Number.isFinite(r)||r<=0?t.map(t=>t.trimEnd()):[t[0].trimEnd(),...e.map(t=>t.replace(new RegExp(`^\\s{0,${r}}`),"").trimEnd())]})(Array.isArray(t.label)?t.label.map(t=>F(t)):F(t.label||"").split("\n")).join("\n"),me=t=>{if(!t.description)return[];return(Array.isArray(t.description)?t.description:[t.description]).map(t=>F(t)).filter(t=>t.length>0)},xe=(t,e,r)=>{const o=r(t);if(!o)throw new Error(`State node element not found for "${t.id}"`);const n=((t,e)=>{switch(e){case"roundedWithTitle":case"rectWithTitle":return t.querySelector("rect.outer")||t.querySelector("rect")||t;case"divider":return t.querySelector("rect.divider")||t.querySelector("rect")||t;case"stateStart":case"stateEnd":return ye(Array.from(t.querySelectorAll("circle, ellipse, path")),"largest")||t;default:return t.querySelector("rect, path, circle, ellipse, polygon")||t}})(o,t.shape),s={},i={},c=[t.labelStyle,...t.cssCompiledStyles||[],...t.cssStyles||[]],d=(t=>{const e=new Set;return t.filter(Boolean).forEach(t=>{Q(t||"").forEach(({property:t})=>{e.add(t)})}),e})(c);c.filter(Boolean).forEach(t=>{((t,e,r)=>{t&&Q(t).forEach(({property:t,value:o})=>{le(e,t,o),ce(r,t,o)})})(t,s,i)}),((t,e,r)=>{if(!t)return;[[l.FILL,t.getAttribute("fill")],[l.STROKE,t.getAttribute("stroke")],[l.STROKE_WIDTH,t.getAttribute("stroke-width")],[l.STROKE_DASHARRAY,t.getAttribute("stroke-dasharray")]].forEach(([t,o])=>{if(!r.has(t))return;if(e[t])return;const n=J(o||"");n&&le(e,t,n)})})(n,s,d),((t,e,r)=>{if(!t)return;const o=[t,...Array.from(t.querySelectorAll("text, foreignObject, div, span, p"))];for(const t of o){if(e[a.COLOR])break;if((r.has(a.COLOR)||r.has(l.FILL))&&(de(t.getAttribute("style"),e),e[a.COLOR]))break;const o=J(t.getAttribute("fill")||t.getAttribute("color")||"");(r.has(a.COLOR)||r.has(l.FILL))&&ae(o)&&(e[a.COLOR]=o)}})(o,i,d);const u=((t,e)=>{const r=t.getBBox(),{tx:o,ty:n}=ue(t,e);return{x:r.x+o,y:r.y+n,width:r.width,height:r.height}})(n,e);return{id:t.id,shape:t.shape,text:be(t),description:me(t),x:u.x,y:u.y,width:u.width,height:u.height,parentId:t.parentId,position:t.position,containerStyle:s,labelStyle:i,dividerLine:"rectWithTitle"===t.shape?he(o,e):void 0,endInnerColor:"stateEnd"===t.shape?fe(o,d):void 0,isRenderable:"noteGroup"!==t.shape}},we=(t,e)=>{const r=e.querySelector(`[id='${t.id}']`);if(!r)return null;const{tx:o,ty:n}=ue(r,e),s=H(r,{x:o,y:n},"MCL");if(s.reflectionPoints.length<2)return null;const i={};[t.style].filter(Boolean).forEach(t=>{Q(t||"").forEach(({property:t,value:e})=>{((t,e)=>{switch(t){case l.STROKE:ae(e)&&(i.strokeColor=J(e));break;case l.STROKE_WIDTH:{const t=parseFloat(J(e));Number.isFinite(t)&&t>0&&(i.strokeWidth=t);break}case l.STROKE_DASHARRAY:J(e)&&(i.strokeStyle="dashed")}})(t,e)})});const a="none"===t.arrowhead||t.classes?.includes("note-edge");return{id:t.id,start:t.start,end:t.end,text:F(t.label||""),...s,strokeColor:i.strokeColor,strokeWidth:i.strokeWidth,strokeStyle:a?"dashed":i.strokeStyle,isNoteEdge:a}},Se=(t,e)=>{const{nodes:r,edges:o}=t.getData(),n=(t=>{const e=new Set,r=t=>(t&&e.add(t),t),o=t=>{const o=t.find(t=>!e.has(t));return r(o||null)};return e=>{const n=[`[id='${e.domId}']`,`[id='${e.id}']`,`[data-id='${e.id}']`];for(const e of n){const o=t.querySelector(e);if(o)return r(o)}switch(e.shape){case"divider":return o(Array.from(t.querySelectorAll("g.statediagram-cluster-alt")));case"stateStart":return o(Array.from(t.querySelectorAll("g.node.default")).filter(t=>t.querySelector("circle.state-start")));case"stateEnd":return o(Array.from(t.querySelectorAll("g.node.default")).filter(t=>!t.querySelector("circle.state-start")));default:return null}}})(e);return{type:"state",nodes:r.map(t=>xe(t,e,n)),edges:o.map(t=>we(t,e)).filter(t=>null!==t)}};let Ae=Promise.resolve();let ke=null,Ee=0;const ve=t=>{const e=t.querySelector("svg");if(!e)throw new Error("SVG element not found");const r=e.getBoundingClientRect(),o=r.width,n=r.height;e.setAttribute("width",`${o}`),e.setAttribute("height",`${n}`);const s=unescape(encodeURIComponent(e.outerHTML));return{type:"graphImage",mimeType:"image/svg+xml",dataURL:`data:image/svg+xml;base64,${btoa(s)}`,width:o,height:n}},Ce=async(t,e=n)=>(t=>{const e=Ae.then(t,t);return Ae=e.then(()=>{},()=>{}),e})(async()=>{const r=e.themeVariables?.fontSize??n.themeVariables.fontSize,o={...n,...e,fontSize:r,themeVariables:{...n.themeVariables,...e.themeVariables,fontSize:r}},s=(t=>JSON.stringify(t))(o);s!==ke&&(G.default.initialize(o),ke=s);const i=await G.default.mermaidAPI.getDiagramFromText((t=>{let e=t;return e=e.replace(/style.*:\S*#.*;/g,t=>t.substring(0,t.length-1)),e=e.replace(/classDef.*:\S*#.*;/g,t=>t.substring(0,t.length-1)),e=e.replace(/#\w+;/g,t=>{const e=t.substring(1,t.length-1);return/^\+?\d+$/.test(e)?`fl°°${e}¶ß`:`fl°${e}¶ß`}),e})(t)),a="mermaid-to-excalidraw-"+Ee++,l=document.createElement("div");l.setAttribute("style","opacity: 0; position: fixed; z-index: -1; left: -99999px; top: -99999px;");const c=`${a}-container`;l.id=c,document.getElementById(c)?.remove(),document.body.appendChild(l);try{const{svg:e}=await G.default.render(a,t,l);let r;l.innerHTML=e;try{switch(i.type){case"flowchart-v2":case"graph":r=pt(i.db,l);break;case"sequence":r=Rt(i,l);break;case"class":case"classDiagram":r=((t,e)=>{const r=t.db,o=r.getDirection?.()||"TB",n=[],s=[],i=[],a=[],l=r.getNamespaces?.()||[],c=r.getClasses?.()||{},d=c instanceof Map?Object.fromEntries(c):c;if(d&&Object.keys(d).length){const t="function"==typeof r.lookUpDomId?r.lookUpDomId.bind(r):void 0,o=Jt(d,e,t);n.push(o.nodes),s.push(...o.lines),i.push(...o.text),a.push(...o.nodes)}const u=r.getRelations?.()||[],{arrows:h,text:p}=Zt(u,a,e,o),g=r.getNotes?.()||[],{notes:y,connectors:f}=Qt(g,e,a);return n.push(y),h.push(...f),i.push(...p),{type:"class",nodes:n,lines:s,arrows:h,text:i,namespaces:l}})(i,l);break;case"er":r=((t,e)=>{const r=t.getData(),o=r.nodes,n=r.edges,s=[],i=[],a=[];o.forEach(t=>{const r=se(t,e);s.push(r.container),i.push(...r.lines),a.push(...r.text)});const l=n.map(t=>ie(t,e));return{type:"erd",nodes:[s],lines:i,arrows:l,text:a}})(i.db,l);break;case"state":case"stateDiagram":r=Se(i.db,l);break;default:r=ve(l)}}catch(t){console.error("Error processing Mermaid diagram:",t),r=ve(l)}return r}finally{l.remove()}}),Ie=async(t,e)=>{const r=e||{},o=parseInt(r.themeVariables?.fontSize??"")||20,n=await Ce(t,{...r,themeVariables:{...r.themeVariables}});return V(n,{fontSize:o})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[7756],{57756(e,t,a){a.r(t),a.d(t,{default:()=>i});var i=async(e,t=[{}],a=null,i=!1,s=null)=>{Array.isArray(t)||(t=[t]),t[0].fileName=t[0].fileName||"Untitled";const c=[];let n=null;if(e instanceof Blob&&e.type?n=e.type:e.headers&&e.headers.get("content-type")&&(n=e.headers.get("content-type")),t.forEach((e,t)=>{c[t]={description:e.description||"",accept:{}},e.mimeTypes?(0===t&&n&&e.mimeTypes.push(n),e.mimeTypes.map(a=>{c[t].accept[a]=e.extensions||[]})):n&&(c[t].accept[n]=e.extensions||[])}),a)try{await a.getFile()}catch(e){if(a=null,i)throw e}const l=a||await window.showSaveFilePicker({suggestedName:t[0].fileName,id:t[0].id,startIn:t[0].startIn,types:c,excludeAcceptAllOption:t[0].excludeAcceptAllOption||!1});!a&&s&&s();const r=await l.createWritable();if("stream"in e){const t=e.stream();return await t.pipeTo(r),l}return"body"in e?(await e.body.pipeTo(r),l):(await r.write(await e),await r.close(),l)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[7873],{26559(e,n,t){t.d(n,{A:()=>l});var i=t(96540),o=t(34843),d=t(82893),r=t(76118),s=t(69918),a=t(8332),m=t(74848);const l=i.memo(function(e){const[n]=(0,o.fp)(d.AG.md_editor_last_context),[t]=(0,i.useState)(n?.trim()?n:a.$);return(0,m.jsx)("div",{className:e.className,ref:n=>e.setting&&(0,s.Ce)(n,e.setting),children:(0,m.jsx)("div",{className:"md-editor-scroll",children:(0,m.jsx)("div",{className:"md-editor-sheet",children:(0,m.jsx)(r.A,{value:t})})})})})},8332(e,n,t){t.d(n,{$:()=>o,V:()=>i});const i='/* ===== md 主题 =====\n 选择器请从 .md-editor-sheet 开始写 —— 它是正文容器的类名,\n 编辑器与右侧预览用的是同一个类名,一处书写、两处生效。\n\n 注意:css 原样注入页面,不做任何改写。\n 写成 body、h1 这种全局选择器会真的作用到整个后台界面,不要这么写。\n\n 下面每一组都可以直接改,不需要的整段删掉即可。\n ============================================ */\n\n/* ---------- 正文 ---------- */\n.md-editor-sheet {\n font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; /* 字体 */\n font-size: 16px; /* 字号 */\n line-height: 1.7; /* 行高:1.7 约为字号的 1.7 倍 */\n color: #333333; /* 文字颜色 */\n}\n\n/* ---------- 整页底色 ----------\n 底色必须写在 .md-editor-scroll(滚动容器)上,不要写在 .md-editor-sheet。\n 纸张高度只有一屏,写在纸张上的底色长文档一滚就露底(上半截有色、下半截变回灰)。\n 深色主题尤其要注意:这一条不写,滚动时就会白一半黑一半。 */\n.md-editor-scroll {\n background: #ffffff;\n}\n\n/* ---------- 标题 h1 ~ h6 ---------- */\n.md-editor-sheet h1 {\n font-size: 2em; /* 相对正文字号的倍数 */\n font-weight: 600; /* 字重:400 常规 / 600 半粗 / 700 粗 */\n color: #1a1a1a;\n margin-top: 1.4em;\n margin-bottom: 0.6em;\n padding-bottom: 0.3em;\n border-bottom: 1px solid #eaecef; /* 标题下划线,不需要就删掉这行 */\n}\n.md-editor-sheet h2 { font-size: 1.5em; font-weight: 600; margin-top: 1.3em; margin-bottom: 0.6em; }\n.md-editor-sheet h3 { font-size: 1.25em; font-weight: 600; margin-top: 1.2em; margin-bottom: 0.5em; }\n.md-editor-sheet h4 { font-size: 1em; font-weight: 600; margin-top: 1.1em; margin-bottom: 0.5em; }\n.md-editor-sheet h5 { font-size: 0.9em; font-weight: 600; margin-top: 1em; margin-bottom: 0.5em; }\n.md-editor-sheet h6 { font-size: 0.85em; font-weight: 600; color: #6a737d; margin-top: 1em; margin-bottom: 0.5em; }\n\n/* ---------- 段落与行内元素 ---------- */\n.md-editor-sheet p {\n margin: 0 0 1em; /* 段落间距:上 右 下 左,下边距控制段与段的距离 */\n}\n.md-editor-sheet strong { font-weight: 600; } /* 加粗文字 */\n.md-editor-sheet em { font-style: italic; } /* 斜体文字 */\n.md-editor-sheet a { color: #0366d6; text-decoration: none; } /* 链接颜色;加下划线写 underline */\n.md-editor-sheet a:hover { text-decoration: underline; } /* 鼠标悬停时的链接样式 */\n.md-editor-sheet del { color: #999999; } /* 删除线文字 */\n\n/* ---------- 引用 ---------- */\n.md-editor-sheet blockquote {\n margin: 0 0 1em;\n padding: 0.4em 1em;\n color: #6a737d; /* 引用文字颜色 */\n border-left: 4px solid #dfe2e5; /* 左侧竖线,这是引用最明显的特征 */\n background: #f6f8fa; /* 引用底色,不需要就删掉 */\n}\n\n/* ---------- 代码 ---------- */\n.md-editor-sheet code {\n font-family: Consolas, Monaco, "Courier New", monospace; /* 等宽字体 */\n font-size: 0.88em;\n color: #476582; /* 行内代码文字色 */\n background: rgba(27, 31, 35, 0.05); /* 行内代码底色 */\n padding: 0.2em 0.4em;\n border-radius: 3px; /* 圆角 */\n}\n.md-editor-sheet pre {\n padding: 1em;\n overflow: auto; /* 内容太宽时出现横向滚动条 */\n background: #f6f8fa; /* 代码块底色 */\n border-radius: 6px;\n margin: 0 0 1em;\n}\n.md-editor-sheet pre code {\n background: transparent; /* 代码块里的 code 不要再叠一层底色 */\n padding: 0;\n}\n\n/* ---------- 列表 ---------- */\n.md-editor-sheet ul, .md-editor-sheet ol {\n padding-left: 2em; /* 缩进 */\n margin: 0 0 1em;\n}\n.md-editor-sheet li { margin: 0.25em 0; } /* 列表项之间的间距 */\n\n/* ---------- 表格 ---------- */\n.md-editor-sheet table {\n width: 100%;\n border-collapse: collapse; /* 相邻边框合并成一条线 */\n margin: 0 0 1em;\n}\n.md-editor-sheet table th, .md-editor-sheet table td {\n padding: 6px 13px;\n border: 1px solid #dfe2e5; /* 单元格边框 */\n}\n.md-editor-sheet table th {\n font-weight: 600;\n background: #f6f8fa; /* 表头底色 */\n}\n\n/* ---------- 分割线 ---------- */\n.md-editor-sheet hr {\n height: 1px; /* 线的粗细 */\n border: 0;\n background: #e1e4e8; /* 线的颜色 */\n margin: 1.6em 0;\n}\n\n/* ---------- 图片 ---------- */\n.md-editor-sheet img {\n max-width: 100%; /* 防止大图撑破版面 */\n border-radius: 4px;\n}\n',o='# 一级标题 Heading 1\n\n## 二级标题 Heading 2\n\n### 三级标题 Heading 3\n\n#### 四级标题 Heading 4\n\n##### 五级标题 Heading 5\n\n###### 六级标题 Heading 6\n\n这是一段普通正文,用来观察字体、字号、行高和文字颜色。中间可以包含 **加粗文字**、*斜体文字*、~~删除线~~、`行内代码` 以及 [一个链接](https://github.com/xiaobaidadada/filecat)。\n\n> 这是一段引用文字。\n> 引用通常用来强调摘录的内容,左侧一般会有一条竖线。\n\n- 无序列表第一项\n- 无序列表第二项\n - 嵌套的子项\n- 无序列表第三项\n\n1. 有序列表第一项\n2. 有序列表第二项\n3. 有序列表第三项\n\n```javascript\n// 代码块\nfunction greet(name) {\n console.log(`Hello, ${name}!`);\n}\ngreet("filecat");\n```\n\n| 列一 | 列二 | 列三 |\n| --- | --- | --- |\n| 内容 A | 内容 B | 内容 C |\n| 内容 D | 内容 E | 内容 F |\n\n---\n\n最后一段正文,用于观察段落之间的间距。\n'},57873(e,n,t){t.r(n),t.d(n,{default:()=>F});var i=t(96540),o=t(22022),d=t(52671),r=t(85997),s=t(4412),a=t(75725),m=t(70447),l=t(61443),c=t(62042),h=t(78247),g=t(23430);const f=/^(\d+(?:\.\d+)?)(px|%|rem|em|vw|vh|ch)$/,u=/^\d+(\.\d+)?$/,p=/^\d+$/,x=/[\\/:*?"<>|\u0000-\u001f]/,_={size(e,n=!1){const t=String(e??"").trim();if(!t)return null;let i;if(n&&u.test(t))i=t;else{const e=f.exec(t);if(!e)return null;i=e[1]}const o=Number(i);return Number.isFinite(o)&&o>0&&o<=1e4?t:null},uint(e){const n=String(e??"").trim();return p.test(n)?Number(n):null},filename(e,n=!0){const t=String(e??"").trim();return""===t?n?"":null:"."===t||".."===t||x.test(t)||t.length>64?null:t}},b={content_max_width:_.size,content_padding:_.size,font_size:_.size,line_height:e=>_.size(e,!0),theme:_.filename,auto_save_interval:_.uint};var k=t(87361),v=t(69918),y=t(26559),j=t(96763),w=t(45907),z=t(34843),C=t(82893),S=t(74848);const N=[{key:"content_max_width",label:"正文最大宽度"},{key:"content_padding",label:"正文左右边距"},{key:"font_size",label:"正文字号"},{key:"line_height",label:"行高"},{key:"auto_save_interval",label:"as_iv"}];function F(){const{t:e}=(0,o.Bd)(),n=(0,d.Zp)(),{check_user_auth:t}=(0,h.MH)(),f=(0,w.y)(),u=t(g.oV.md_editor_setting),[,p]=(0,z.fp)(C.AG.md_editor_setting),[,x]=(0,z.fp)(C.AG.md_theme_css),[_,F]=(0,i.useState)({}),[A,$]=(0,i.useState)(!0),[G,H]=(0,i.useState)(!1),[P,E]=(0,i.useState)([]),[B,I]=(0,i.useState)(v.FG.theme);(0,i.useEffect)(()=>{Promise.all([(0,v.gC)(),(0,j.Kz)()]).then(([e,n])=>{const t={};N.forEach(n=>t[n.key]=String(e[n.key]??"")),F(t),I(e.theme??v.FG.theme),E(n)}).finally(()=>$(!1))},[]);const K=P.find(e=>e.id===B),V=e=>{const n=b[e]((_[e]??"").trim());return null===n?v.FG[e]:n};return(0,S.jsxs)("div",{children:[(0,S.jsx)(s.aZ,{position:"right",children:(0,S.jsx)(r.rA,{icon:"arrow_back",title:e("上一页"),onClick:()=>n(-1)})}),(0,S.jsx)(a.jW,{isFull:!0,more:!0,children:(0,S.jsx)(a.NN,{children:(0,S.jsx)(a.xh,{children:(0,S.jsxs)(a.fI,{children:[(0,S.jsx)(a.VP,{widthPer:33,maxWidth:"30rem",children:(0,S.jsx)(m.Zp,{title:e("编辑器设置"),titleCom:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(r.C3,{text:e("恢复默认"),clickFun:()=>{const e={};N.forEach(n=>e[n.key]=String(v.FG[n.key])),F(e)}}),u&&(0,S.jsx)(r.$n,{text:e(G?"保存中":"保存"),clickFun:()=>{G||(async()=>{const n={theme:B};for(const t of N){const i=(_[t.key]??"").trim(),o=b[t.key](i);if(null===o)return void(0,c.zN)(`${e(t.label)}: ${e("auto_save_interval"===t.key?"as_num":"请输入合法的 CSS 值,例如 10px、3rem、80%")}`);n[t.key]=o}H(!0);try{const t=await(0,v.fy)(n);if(t){(0,c.SK)(e("保存成功"));const n={};N.forEach(e=>n[e.key]=String(t[e.key]??"")),F(n),I(t.theme??v.FG.theme),p({...t}),(0,j.sO)().then(x)}else(0,c.zN)(e("保存失败"))}finally{H(!1)}})()}})]}),children:A?(0,S.jsxs)("div",{className:"common-box common-box-center",children:[e("加载中"),"..."]}):(0,S.jsxs)("div",{className:"md-setting-form",children:[(0,S.jsx)(l.BC,{vertical:!0,label:e("主题"),children:(0,S.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.4rem"},children:[(0,S.jsx)(l.l6,{value:B,onChange:e=>I(e),disabled:!u,options:[{title:e("不使用主题"),value:""},...P.map(e=>({title:e.id,value:e.id}))]}),(0,S.jsx)(r.rA,{icon:"add",title:e("新建主题"),onClick:()=>n(k.o.md_theme_editor_page)}),(0,S.jsx)(r.rA,{icon:"edit",title:e("编辑主题"),onClick:()=>n(`${k.o.md_theme_editor_page}?id=${encodeURIComponent(B)}`)}),K&&(0,S.jsx)(r.rA,{icon:"delete",title:e("删除主题"),onClick:()=>{return n=K,void f({sub_title:e("确认删除这个主题吗?"),confirm_fun:async()=>{await(0,j._8)(n.id)?((0,c.SK)(e("删除成功")),E(await(0,j.Kz)()),B===n.id&&I(v.FG.theme)):(0,c.zN)(e("删除失败"))}});var n}})]})}),N.map(n=>(0,S.jsx)(l.BC,{vertical:!0,label:e(n.label),children:(0,S.jsx)(l.Sm,{disabled:!u,placeholder:String(v.FG[n.key]),value:_[n.key]??"",handleInputChange:e=>F(t=>({...t,[n.key]:e}))})},n.key)),!u&&(0,S.jsx)("p",{className:"md-editor-setting-page__desc",children:e("nprmtp")})]})})}),(0,S.jsx)(a.VP,{widthPer:50,maxWidth:"60rem",children:(0,S.jsx)(m.Zp,{title:e("预览"),children:(0,S.jsx)(y.A,{className:"md-editor-setting-page__preview",setting:{content_max_width:V("content_max_width"),content_padding:V("content_padding"),font_size:V("font_size"),line_height:V("line_height")}})})})]})})})})]})}}}]);
@@ -1,2 +0,0 @@
1
- /*! For license information please see 7923.861345fd55941e8089a1.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[7923],{77923(t,e,r){r.d(e,{default:()=>g});function n(t,e){var r={};return e.forEach(function(e){Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=t[e])}),r}var i={assign:function(t){for(var e,r=1;r<arguments.length;r++)for(var n in e=Object(arguments[r]))Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},pick:n,pick_pica_resize_options:function(t){return n(t,["alpha","unsharpAmount","unsharpRadius","unsharpThreshold","cancelToken"])}};function a(t){var e={exports:{}};return t(e,e.exports),e.exports}function o(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets option of @rollup/plugin-commonjs appropriately for this require call to behave properly.')}var s=a(function(t,e){t.exports=function(){function t(e,r,n){function i(s,A){if(!r[s]){if(!e[s]){if(!A&&o)return o(s);if(a)return a(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var h=r[s]={exports:{}};e[s][0].call(h.exports,function(t){return i(e[s][1][t]||t)},h,h.exports,t,e,r,n)}return r[s].exports}for(var a=o,s=0;s<n.length;s++)i(n[s]);return i}return t}()({1:[function(t,e,r){var n=t("inherits"),i=t("multimath"),a=t("./mm_unsharp_mask"),o=t("./mm_resize");function s(t){var e=t||[],r={js:e.indexOf("js")>=0,wasm:e.indexOf("wasm")>=0};i.call(this,r),this.features={js:r.js,wasm:r.wasm&&this.has_wasm()},this.use(a),this.use(o)}n(s,i),s.prototype.resizeAndUnsharp=function(t,e){var r=this.resize(t,e);return t.unsharpAmount&&this.unsharp_mask(r,t.toWidth,t.toHeight,t.unsharpAmount,t.unsharpRadius,t.unsharpThreshold),r},e.exports=s},{"./mm_resize":4,"./mm_unsharp_mask":9,inherits:19,multimath:20}],2:[function(t,e,r){function n(t){return t<0?0:t>255?255:t}function i(t,e,r,i,a,o){var s,A,u,h,f,c,l,g,p,d,m,_=0,w=0;for(p=0;p<i;p++){for(f=0,d=0;d<a;d++){for(c=o[f++],l=o[f++],g=_+4*c|0,s=A=u=h=0;l>0;l--)h=h+(m=o[f++])*t[g+3]|0,u=u+m*t[g+2]|0,A=A+m*t[g+1]|0,s=s+m*t[g]|0,g=g+4|0;e[w+3]=n(h+8192>>14),e[w+2]=n(u+8192>>14),e[w+1]=n(A+8192>>14),e[w]=n(s+8192>>14),w=w+4*i|0}w=4*(p+1)|0,_=(p+1)*r*4|0}}function a(t,e,r,i,a,o){var s,A,u,h,f,c,l,g,p,d,m,_=0,w=0;for(p=0;p<i;p++){for(f=0,d=0;d<a;d++){for(c=o[f++],l=o[f++],g=_+4*c|0,s=A=u=h=0;l>0;l--)h=h+(m=o[f++])*t[g+3]|0,u=u+m*t[g+2]|0,A=A+m*t[g+1]|0,s=s+m*t[g]|0,g=g+4|0;e[w+3]=n(h+8192>>14),e[w+2]=n(u+8192>>14),e[w+1]=n(A+8192>>14),e[w]=n(s+8192>>14),w=w+4*i|0}w=4*(p+1)|0,_=(p+1)*r*4|0}}e.exports={convolveHorizontally:i,convolveVertically:a}},{}],3:[function(t,e,r){e.exports="AGFzbQEAAAAADAZkeWxpbmsAAAAAAAEXA2AAAGAGf39/f39/AGAHf39/f39/fwACDwEDZW52Bm1lbW9yeQIAAAMEAwABAgYGAX8AQQALB1cFEV9fd2FzbV9jYWxsX2N0b3JzAAAIY29udm9sdmUAAQpjb252b2x2ZUhWAAIMX19kc29faGFuZGxlAwAYX193YXNtX2FwcGx5X2RhdGFfcmVsb2NzAAAK7AMDAwABC8YDAQ9/AkAgA0UNACAERQ0AA0AgDCENQQAhE0EAIQcDQCAHQQJqIQYCfyAHQQF0IAVqIgcuAQIiFEUEQEGAwAAhCEGAwAAhCUGAwAAhCkGAwAAhCyAGDAELIBIgBy4BAGohCEEAIQsgFCEHQQAhDiAGIQlBACEPQQAhEANAIAUgCUEBdGouAQAiESAAIAhBAnRqKAIAIgpBGHZsIBBqIRAgCkH/AXEgEWwgC2ohCyAKQRB2Qf8BcSARbCAPaiEPIApBCHZB/wFxIBFsIA5qIQ4gCEEBaiEIIAlBAWohCSAHQQFrIgcNAAsgC0GAQGshCCAOQYBAayEJIA9BgEBrIQogEEGAQGshCyAGIBRqCyEHIAEgDUECdGogCUEOdSIGQf8BIAZB/wFIGyIGQQAgBkEAShtBCHRBgP4DcSAKQQ51IgZB/wEgBkH/AUgbIgZBACAGQQBKG0EQdEGAgPwHcSALQQ51IgZB/wEgBkH/AUgbIgZBACAGQQBKG0EYdHJyIAhBDnUiBkH/ASAGQf8BSBsiBkEAIAZBAEobcjYCACADIA1qIQ0gE0EBaiITIARHDQALIAxBAWoiDCACbCESIAMgDEcNAAsLCx4AQQAgAiADIAQgBSAAEAEgAkEAIAQgBSAGIAEQAQs="},{}],4:[function(t,e,r){e.exports={name:"resize",fn:t("./resize"),wasm_fn:t("./resize_wasm"),wasm_src:t("./convolve_wasm_base64")}},{"./convolve_wasm_base64":3,"./resize":5,"./resize_wasm":8}],5:[function(t,e,r){var n=t("./resize_filter_gen"),i=t("./convolve").convolveHorizontally,a=t("./convolve").convolveVertically;function o(t,e,r){for(var n=3,i=e*r*4|0;n<i;)t[n]=255,n=n+4|0}e.exports=function(t){var e=t.src,r=t.width,s=t.height,A=t.toWidth,u=t.toHeight,h=t.scaleX||t.toWidth/t.width,f=t.scaleY||t.toHeight/t.height,c=t.offsetX||0,l=t.offsetY||0,g=t.dest||new Uint8Array(A*u*4),p=void 0===t.quality?3:t.quality,d=t.alpha||!1,m=n(p,r,A,h,c),_=n(p,s,u,f,l),w=new Uint8Array(A*s*4);return i(e,w,r,s,A,m),a(w,g,s,A,u,_),d||o(g,A,u),g}},{"./convolve":2,"./resize_filter_gen":6}],6:[function(t,e,r){var n=t("./resize_filter_info"),i=14;function a(t){return Math.round(t*((1<<i)-1))}e.exports=function(t,e,r,i,o){var s,A,u,h,f,c,l,g,p,d,m,_,w,I,b,v,y,B=n[t].filter,E=1/i,C=Math.min(1,i),Q=n[t].win/C,x=Math.floor(2*(Q+1)),M=new Int16Array((x+2)*r),D=0,j=!M.subarray||!M.set;for(s=0;s<r;s++){for(A=(s+.5)*E+o,u=Math.max(0,Math.floor(A-Q)),f=(h=Math.min(e-1,Math.ceil(A+Q)))-u+1,c=new Float32Array(f),l=new Int16Array(f),g=0,p=u,d=0;p<=h;p++,d++)g+=m=B((p+.5-A)*C),c[d]=m;for(_=0,d=0;d<c.length;d++)_+=w=c[d]/g,l[d]=a(w);for(l[r>>1]+=a(1-_),I=0;I<l.length&&0===l[I];)I++;if(I<l.length){for(b=l.length-1;b>0&&0===l[b];)b--;if(v=u+I,y=b-I+1,M[D++]=v,M[D++]=y,j)for(d=I;d<=b;d++)M[D++]=l[d];else M.set(l.subarray(I,b+1),D),D+=y}else M[D++]=0,M[D++]=0}return M}},{"./resize_filter_info":7}],7:[function(t,e,r){e.exports=[{win:.5,filter:function(t){return t>=-.5&&t<.5?1:0}},{win:1,filter:function(t){if(t<=-1||t>=1)return 0;if(t>-1.1920929e-7&&t<1.1920929e-7)return 1;var e=t*Math.PI;return Math.sin(e)/e*(.54+.46*Math.cos(e/1))}},{win:2,filter:function(t){if(t<=-2||t>=2)return 0;if(t>-1.1920929e-7&&t<1.1920929e-7)return 1;var e=t*Math.PI;return Math.sin(e)/e*Math.sin(e/2)/(e/2)}},{win:3,filter:function(t){if(t<=-3||t>=3)return 0;if(t>-1.1920929e-7&&t<1.1920929e-7)return 1;var e=t*Math.PI;return Math.sin(e)/e*Math.sin(e/3)/(e/3)}}]},{}],8:[function(t,e,r){var n=t("./resize_filter_gen");function i(t,e,r){for(var n=3,i=e*r*4|0;n<i;)t[n]=255,n=n+4|0}function a(t){return new Uint8Array(t.buffer,0,t.byteLength)}var o=!0;try{o=1===new Uint32Array(new Uint8Array([1,0,0,0]).buffer)[0]}catch(t){}function s(t,e,r){if(o)e.set(a(t),r);else for(var n=r,i=0;i<t.length;i++){var s=t[i];e[n++]=255&s,e[n++]=s>>8&255}}e.exports=function(t){var e=t.src,r=t.width,a=t.height,o=t.toWidth,A=t.toHeight,u=t.scaleX||t.toWidth/t.width,h=t.scaleY||t.toHeight/t.height,f=t.offsetX||0,c=t.offsetY||0,l=t.dest||new Uint8Array(o*A*4),g=void 0===t.quality?3:t.quality,p=t.alpha||!1,d=n(g,r,o,u,f),m=n(g,a,A,h,c),_=0,w=this.__align(_+Math.max(e.byteLength,l.byteLength)),I=this.__align(w+a*o*4),b=this.__align(I+d.byteLength),v=b+m.byteLength,y=this.__instance("resize",v),B=new Uint8Array(this.__memory.buffer),E=new Uint32Array(this.__memory.buffer),C=new Uint32Array(e.buffer);return E.set(C),s(d,B,I),s(m,B,b),(y.exports.convolveHV||y.exports._convolveHV)(I,b,w,r,a,o,A),new Uint32Array(l.buffer).set(new Uint32Array(this.__memory.buffer,0,A*o)),p||i(l,o,A),l}},{"./resize_filter_gen":6}],9:[function(t,e,r){e.exports={name:"unsharp_mask",fn:t("./unsharp_mask"),wasm_fn:t("./unsharp_mask_wasm"),wasm_src:t("./unsharp_mask_wasm_base64")}},{"./unsharp_mask":10,"./unsharp_mask_wasm":11,"./unsharp_mask_wasm_base64":12}],10:[function(t,e,r){var n=t("glur/mono16");function i(t,e,r){for(var n,i,a,o,s=e*r,A=new Uint16Array(s),u=0;u<s;u++)n=t[4*u],i=t[4*u+1],a=t[4*u+2],o=n>=i&&n>=a?n:i>=a&&i>=n?i:a,A[u]=o<<8;return A}e.exports=function(t,e,r,a,o,s){var A,u,h,f,c;if(!(0===a||o<.5)){o>2&&(o=2);var l=i(t,e,r),g=new Uint16Array(l);n(g,e,r,o);for(var p=a/100*4096+.5|0,d=s<<8,m=e*r,_=0;_<m;_++)f=(A=l[_])-g[_],Math.abs(f)>=d&&(h=((u=(u=(u=A+(p*f+2048>>12))>65280?65280:u)<0?0:u)<<12)/(A=0!==A?A:1)|0,t[c=4*_]=t[c]*h+2048>>12,t[c+1]=t[c+1]*h+2048>>12,t[c+2]=t[c+2]*h+2048>>12)}}},{"glur/mono16":18}],11:[function(t,e,r){e.exports=function(t,e,r,n,i,a){if(!(0===n||i<.5)){i>2&&(i=2);var o=e*r,s=4*o,A=2*o,u=2*o,h=4*Math.max(e,r),f=32,c=0,l=s,g=l+A,p=g+u,d=p+u,m=d+h,_=this.__instance("unsharp_mask",s+A+2*u+h+f,{exp:Math.exp}),w=new Uint32Array(t.buffer);new Uint32Array(this.__memory.buffer).set(w);var I=_.exports.hsv_v16||_.exports._hsv_v16;I(c,l,e,r),(I=_.exports.blurMono16||_.exports._blurMono16)(l,g,p,d,m,e,r,i),(I=_.exports.unsharp||_.exports._unsharp)(c,c,l,g,e,r,n,a),w.set(new Uint32Array(this.__memory.buffer,0,o))}}},{}],12:[function(t,e,r){e.exports="AGFzbQEAAAAADAZkeWxpbmsAAAAAAAE0B2AAAGAEf39/fwBgBn9/f39/fwBgCH9/f39/f39/AGAIf39/f39/f30AYAJ9fwBgAXwBfAIZAgNlbnYDZXhwAAYDZW52Bm1lbW9yeQIAAAMHBgAFAgQBAwYGAX8AQQALB4oBCBFfX3dhc21fY2FsbF9jdG9ycwABFl9fYnVpbGRfZ2F1c3NpYW5fY29lZnMAAg5fX2dhdXNzMTZfbGluZQADCmJsdXJNb25vMTYABAdoc3ZfdjE2AAUHdW5zaGFycAAGDF9fZHNvX2hhbmRsZQMAGF9fd2FzbV9hcHBseV9kYXRhX3JlbG9jcwABCsUMBgMAAQvWAQEHfCABRNuGukOCGvs/IAC7oyICRAAAAAAAAADAohAAIgW2jDgCFCABIAKaEAAiAyADoCIGtjgCECABRAAAAAAAAPA/IAOhIgQgBKIgAyACIAKgokQAAAAAAADwP6AgBaGjIgS2OAIAIAEgBSAEmqIiB7Y4AgwgASADIAJEAAAAAAAA8D+gIASioiIItjgCCCABIAMgAkQAAAAAAADwv6AgBKKiIgK2OAIEIAEgByAIoCAFRAAAAAAAAPA/IAahoCIDo7Y4AhwgASAEIAKgIAOjtjgCGAuGBQMGfwl8An0gAyoCDCEVIAMqAgghFiADKgIUuyERIAMqAhC7IRACQCAEQQFrIghBAEgiCQRAIAIhByAAIQYMAQsgAiAALwEAuCIPIAMqAhi7oiIMIBGiIg0gDCAQoiAPIAMqAgS7IhOiIhQgAyoCALsiEiAPoqCgoCIOtjgCACACQQRqIQcgAEECaiEGIAhFDQAgCEEBIAhBAUgbIgpBf3MhCwJ/IAQgCmtBAXFFBEAgDiENIAgMAQsgAiANIA4gEKIgFCASIAAvAQK4Ig+ioKCgIg22OAIEIAJBCGohByAAQQRqIQYgDiEMIARBAmsLIQIgC0EAIARrRg0AA0AgByAMIBGiIA0gEKIgDyAToiASIAYvAQC4Ig6ioKCgIgy2OAIAIAcgDSARoiAMIBCiIA4gE6IgEiAGLwECuCIPoqCgoCINtjgCBCAHQQhqIQcgBkEEaiEGIAJBAkohACACQQJrIQIgAA0ACwsCQCAJDQAgASAFIAhsQQF0aiIAAn8gBkECay8BACICuCINIBW7IhKiIA0gFrsiE6KgIA0gAyoCHLuiIgwgEKKgIAwgEaKgIg8gB0EEayIHKgIAu6AiDkQAAAAAAADwQWMgDkQAAAAAAAAAAGZxBEAgDqsMAQtBAAs7AQAgCEUNACAGQQRrIQZBACAFa0EBdCEBA0ACfyANIBKiIAJB//8DcbgiDSAToqAgDyIOIBCioCAMIBGioCIPIAdBBGsiByoCALugIgxEAAAAAAAA8EFjIAxEAAAAAAAAAABmcQRAIAyrDAELQQALIQMgBi8BACECIAAgAWoiACADOwEAIAZBAmshBiAIQQFKIQMgDiEMIAhBAWshCCADDQALCwvRAgIBfwd8AkAgB0MAAAAAWw0AIARE24a6Q4Ia+z8gB0MAAAA/l7ujIglEAAAAAAAAAMCiEAAiDLaMOAIUIAQgCZoQACIKIAqgIg22OAIQIAREAAAAAAAA8D8gCqEiCyALoiAKIAkgCaCiRAAAAAAAAPA/oCAMoaMiC7Y4AgAgBCAMIAuaoiIOtjgCDCAEIAogCUQAAAAAAADwP6AgC6KiIg+2OAIIIAQgCiAJRAAAAAAAAPC/oCALoqIiCbY4AgQgBCAOIA+gIAxEAAAAAAAA8D8gDaGgIgqjtjgCHCAEIAsgCaAgCqO2OAIYIAYEQANAIAAgBSAIbEEBdGogAiAIQQF0aiADIAQgBSAGEAMgCEEBaiIIIAZHDQALCyAFRQ0AQQAhCANAIAIgBiAIbEEBdGogASAIQQF0aiADIAQgBiAFEAMgCEEBaiIIIAVHDQALCwtxAQN/IAIgA2wiBQRAA0AgASAAKAIAIgRBEHZB/wFxIgIgAiAEQQh2Qf8BcSIDIAMgBEH/AXEiBEkbIAIgA0sbIgYgBiAEIAIgBEsbIAMgBEsbQQh0OwEAIAFBAmohASAAQQRqIQAgBUEBayIFDQALCwuZAgIDfwF8IAQgBWwhBAJ/IAazQwAAgEWUQwAAyEKVu0QAAAAAAADgP6AiC5lEAAAAAAAA4EFjBEAgC6oMAQtBgICAgHgLIQUgBARAIAdBCHQhCUEAIQYDQCAJIAIgBkEBdCIHai8BACIBIAMgB2ovAQBrIgcgB0EfdSIIaiAIc00EQCAAIAZBAnQiCGoiCiAFIAdsQYAQakEMdSABaiIHQYD+AyAHQYD+A0gbIgdBACAHQQBKG0EMdCABQQEgARtuIgEgCi0AAGxBgBBqQQx2OgAAIAAgCEEBcmoiByABIActAABsQYAQakEMdjoAACAAIAhBAnJqIgcgASAHLQAAbEGAEGpBDHY6AAALIAZBAWoiBiAERw0ACwsL"},{}],13:[function(t,e,r){var n=100;function i(t,e){this.create=t,this.available=[],this.acquired={},this.lastId=1,this.timeoutId=0,this.idle=e||2e3}i.prototype.acquire=function(){var t,e=this;return 0!==this.available.length?t=this.available.pop():((t=this.create()).id=this.lastId++,t.release=function(){return e.release(t)}),this.acquired[t.id]=t,t},i.prototype.release=function(t){var e=this;delete this.acquired[t.id],t.lastUsed=Date.now(),this.available.push(t),0===this.timeoutId&&(this.timeoutId=setTimeout(function(){return e.gc()},n))},i.prototype.gc=function(){var t=this,e=Date.now();this.available=this.available.filter(function(r){return!(e-r.lastUsed>t.idle&&(r.destroy(),1))}),0!==this.available.length?this.timeoutId=setTimeout(function(){return t.gc()},n):this.timeoutId=0},e.exports=i},{}],14:[function(t,e,r){var n=2;e.exports=function(t,e,r,i,a,o){var s=r/t,A=i/e,u=(2*o+n+1)/a;if(u>.5)return[[r,i]];var h=Math.ceil(Math.log(Math.min(s,A))/Math.log(u));if(h<=1)return[[r,i]];for(var f=[],c=0;c<h;c++){var l=Math.round(Math.pow(Math.pow(t,h-c-1)*Math.pow(r,c+1),1/h)),g=Math.round(Math.pow(Math.pow(e,h-c-1)*Math.pow(i,c+1),1/h));f.push([l,g])}return f}},{}],15:[function(t,e,r){var n=1e-5;function i(t){var e=Math.round(t);return Math.abs(t-e)<n?e:Math.floor(t)}function a(t){var e=Math.round(t);return Math.abs(t-e)<n?e:Math.ceil(t)}e.exports=function(t){var e,r,n,o,s,A,u=t.toWidth/t.width,h=t.toHeight/t.height,f=i(t.srcTileSize*u)-2*t.destTileBorder,c=i(t.srcTileSize*h)-2*t.destTileBorder;if(f<1||c<1)throw new Error("Internal error in pica: target tile width/height is too small.");var l,g=[];for(o=0;o<t.toHeight;o+=c)for(n=0;n<t.toWidth;n+=f)(e=n-t.destTileBorder)<0&&(e=0),e+(s=n+f+t.destTileBorder-e)>=t.toWidth&&(s=t.toWidth-e),(r=o-t.destTileBorder)<0&&(r=0),r+(A=o+c+t.destTileBorder-r)>=t.toHeight&&(A=t.toHeight-r),l={toX:e,toY:r,toWidth:s,toHeight:A,toInnerX:n,toInnerY:o,toInnerWidth:f,toInnerHeight:c,offsetX:e/u-i(e/u),offsetY:r/h-i(r/h),scaleX:u,scaleY:h,x:i(e/u),y:i(r/h),width:a(s/u),height:a(A/h)},g.push(l);return g}},{}],16:[function(t,e,r){function n(t){return Object.prototype.toString.call(t)}e.exports.isCanvas=function(t){var e=n(t);return"[object HTMLCanvasElement]"===e||"[object OffscreenCanvas]"===e||"[object Canvas]"===e},e.exports.isImage=function(t){return"[object HTMLImageElement]"===n(t)},e.exports.isImageBitmap=function(t){return"[object ImageBitmap]"===n(t)},e.exports.limiter=function(t){var e=0,r=[];function n(){e<t&&r.length&&(e++,r.shift()())}return function(t){return new Promise(function(i,a){r.push(function(){t().then(function(t){i(t),e--,n()},function(t){a(t),e--,n()})}),n()})}},e.exports.cib_quality_name=function(t){switch(t){case 0:return"pixelated";case 1:return"low";case 2:return"medium"}return"high"},e.exports.cib_support=function(t){return Promise.resolve().then(function(){if("undefined"==typeof createImageBitmap)return!1;var e=t(100,100);return createImageBitmap(e,0,0,100,100,{resizeWidth:10,resizeHeight:10,resizeQuality:"high"}).then(function(t){var r=10===t.width;return t.close(),e=null,r})}).catch(function(){return!1})},e.exports.worker_offscreen_canvas_support=function(){return new Promise(function(t,e){if("undefined"!=typeof OffscreenCanvas){var r=btoa("(".concat(i.toString(),")(self);")),n=new Worker("data:text/javascript;base64,".concat(r));n.onmessage=function(e){return t(e.data)},n.onerror=e}else t(!1);function i(t){"undefined"!=typeof createImageBitmap?Promise.resolve().then(function(){var t=new OffscreenCanvas(10,10);return t.getContext("2d").rect(0,0,1,1),createImageBitmap(t,0,0,1,1)}).then(function(){return t.postMessage(!0)},function(){return t.postMessage(!1)}):t.postMessage(!1)}}).then(function(t){return t},function(){return!1})},e.exports.can_use_canvas=function(t){var e=!1;try{var r=t(2,1).getContext("2d"),n=r.createImageData(2,1);n.data[0]=12,n.data[1]=23,n.data[2]=34,n.data[3]=255,n.data[4]=45,n.data[5]=56,n.data[6]=67,n.data[7]=255,r.putImageData(n,0,0),n=null,12===(n=r.getImageData(0,0,2,1)).data[0]&&23===n.data[1]&&34===n.data[2]&&255===n.data[3]&&45===n.data[4]&&56===n.data[5]&&67===n.data[6]&&255===n.data[7]&&(e=!0)}catch(t){}return e},e.exports.cib_can_use_region=function(){return new Promise(function(t){if("undefined"!=typeof createImageBitmap){var e=new Image;e.src="data:image/jpeg;base64,/9j/4QBiRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAYAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAAAAABIAAAAAQAAAEgAAAAB/9sAQwAEAwMEAwMEBAMEBQQEBQYKBwYGBgYNCQoICg8NEBAPDQ8OERMYFBESFxIODxUcFRcZGRsbGxAUHR8dGh8YGhsa/9sAQwEEBQUGBQYMBwcMGhEPERoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoa/8IAEQgAAQACAwERAAIRAQMRAf/EABQAAQAAAAAAAAAAAAAAAAAAAAf/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIQAxAAAAF/P//EABQQAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQEAAQUCf//EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQMBAT8Bf//EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQIBAT8Bf//EABQQAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQEABj8Cf//EABQQAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQEAAT8hf//aAAwDAQACAAMAAAAQH//EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQMBAT8Qf//EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQIBAT8Qf//EABQQAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQEAAT8Qf//Z",e.onload=function(){createImageBitmap(e,0,0,e.width,e.height).then(function(r){r.width===e.width&&r.height===e.height?t(!0):t(!1)},function(){return t(!1)})},e.onerror=function(){return t(!1)}}else t(!1)})}},{}],17:[function(t,e,r){e.exports=function(){var e,r=t("./mathlib");onmessage=function(t){var n=t.data.opts,i=!1;if(!n.src&&n.srcBitmap){var a=new OffscreenCanvas(n.width,n.height),o=a.getContext("2d",{alpha:Boolean(n.alpha)});o.drawImage(n.srcBitmap,0,0),n.src=o.getImageData(0,0,n.width,n.height).data,a.width=a.height=0,a=null,n.srcBitmap.close(),n.srcBitmap=null,i=!0}e||(e=new r(t.data.features));var s=e.resizeAndUnsharp(n);if(i){var A=new ImageData(new Uint8ClampedArray(s),n.toWidth,n.toHeight),u=new OffscreenCanvas(n.toWidth,n.toHeight);u.getContext("2d",{alpha:Boolean(n.alpha)}).putImageData(A,0,0),createImageBitmap(u).then(function(t){postMessage({bitmap:t},[t])})}else postMessage({data:s},[s.buffer])}}},{"./mathlib":1}],18:[function(t,e,r){var n,i,a,o,s,A;function u(t){t<.5&&(t=.5);var e=Math.exp(.527076)/t,r=Math.exp(-e),u=Math.exp(-2*e),h=(1-r)*(1-r)/(1+2*e*r-u);return n=h,i=h*(e-1)*r,a=h*(e+1)*r,o=-h*u,s=2*r,A=-u,new Float32Array([n,i,a,o,s,A,(n+i)/(1-s-A),(a+o)/(1-s-A)])}function h(t,e,r,n,i,a){var o,s,A,u,h,f,c,l,g,p,d,m,_,w;for(g=0;g<a;g++){for(c=g,l=0,u=h=(o=t[f=g*i])*n[6],d=n[0],m=n[1],_=n[4],w=n[5],p=0;p<i;p++)A=(s=t[f])*d+o*m+u*_+h*w,h=u,u=A,o=s,r[l]=u,l++,f++;for(l--,c+=a*(i-1),u=h=(o=t[--f])*n[7],s=o,d=n[2],m=n[3],p=i-1;p>=0;p--)A=s*d+o*m+u*_+h*w,h=u,u=A,o=s,s=t[f],e[c]=r[l]+u,f--,l--,c-=a}}function f(t,e,r,n){if(n){var i=new Uint16Array(t.length),a=new Float32Array(Math.max(e,r)),o=u(n);h(t,i,a,o,e,r),h(i,t,a,o,r,e)}}e.exports=f},{}],19:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},{}],20:[function(t,e,r){var n=t("object-assign"),i=t("./lib/base64decode"),a=t("./lib/wa_detect"),o={js:!0,wasm:!0};function s(t){if(!(this instanceof s))return new s(t);var e=n({},o,t||{});if(this.options=e,this.__cache={},this.__init_promise=null,this.__modules=e.modules||{},this.__memory=null,this.__wasm={},this.__isLE=1===new Uint32Array(new Uint8Array([1,0,0,0]).buffer)[0],!this.options.js&&!this.options.wasm)throw new Error('mathlib: at least "js" or "wasm" should be enabled')}s.prototype.has_wasm=a,s.prototype.use=function(t){return this.__modules[t.name]=t,this.options.wasm&&this.has_wasm()&&t.wasm_fn?this[t.name]=t.wasm_fn:this[t.name]=t.fn,this},s.prototype.init=function(){if(this.__init_promise)return this.__init_promise;if(!this.options.js&&this.options.wasm&&!this.has_wasm())return Promise.reject(new Error('mathlib: only "wasm" was enabled, but it\'s not supported'));var t=this;return this.__init_promise=Promise.all(Object.keys(t.__modules).map(function(e){var r=t.__modules[e];return t.options.wasm&&t.has_wasm()&&r.wasm_fn?t.__wasm[e]?null:WebAssembly.compile(t.__base64decode(r.wasm_src)).then(function(r){t.__wasm[e]=r}):null})).then(function(){return t}),this.__init_promise},s.prototype.__base64decode=i,s.prototype.__reallocate=function(t){if(!this.__memory)return this.__memory=new WebAssembly.Memory({initial:Math.ceil(t/65536)}),this.__memory;var e=this.__memory.buffer.byteLength;return e<t&&this.__memory.grow(Math.ceil((t-e)/65536)),this.__memory},s.prototype.__instance=function(t,e,r){if(e&&this.__reallocate(e),!this.__wasm[t]){var i=this.__modules[t];this.__wasm[t]=new WebAssembly.Module(this.__base64decode(i.wasm_src))}if(!this.__cache[t]){var a={memoryBase:0,memory:this.__memory,tableBase:0,table:new WebAssembly.Table({initial:0,element:"anyfunc"})};this.__cache[t]=new WebAssembly.Instance(this.__wasm[t],{env:n(a,r||{})})}return this.__cache[t]},s.prototype.__align=function(t,e){var r=t%(e=e||8);return t+(r?e-r:0)},e.exports=s},{"./lib/base64decode":21,"./lib/wa_detect":22,"object-assign":23}],21:[function(t,e,r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";e.exports=function(t){for(var e=t.replace(/[\r\n=]/g,""),r=e.length,i=new Uint8Array(3*r>>2),a=0,o=0,s=0;s<r;s++)s%4==0&&s&&(i[o++]=a>>16&255,i[o++]=a>>8&255,i[o++]=255&a),a=a<<6|n.indexOf(e.charAt(s));var A=r%4*6;return 0===A?(i[o++]=a>>16&255,i[o++]=a>>8&255,i[o++]=255&a):18===A?(i[o++]=a>>10&255,i[o++]=a>>2&255):12===A&&(i[o++]=a>>4&255),i}},{}],22:[function(t,e,r){var n;e.exports=function(){if(void 0!==n)return n;if(n=!1,"undefined"==typeof WebAssembly)return n;try{var t=new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,127,1,127,3,2,1,0,5,3,1,0,1,7,8,1,4,116,101,115,116,0,0,10,16,1,14,0,32,0,65,1,54,2,0,32,0,40,2,0,11]),e=new WebAssembly.Module(t);return 0!==new WebAssembly.Instance(e,{}).exports.test(4)&&(n=!0),n}catch(t){}return n}},{}],23:[function(t,e,r){var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function o(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function s(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}e.exports=s()?Object.assign:function(t,e){for(var r,s,A=o(t),u=1;u<arguments.length;u++){for(var h in r=Object(arguments[u]))i.call(r,h)&&(A[h]=r[h]);if(n){s=n(r);for(var f=0;f<s.length;f++)a.call(r,s[f])&&(A[s[f]]=r[s[f]])}}return A}},{}],24:[function(t,e,r){var n=arguments[3],i=arguments[4],a=arguments[5],o=JSON.stringify;e.exports=function(t,e){for(var r,s=Object.keys(a),A=0,u=s.length;A<u;A++){var h=s[A],f=a[h].exports;if(f===t||f&&f.default===t){r=h;break}}if(!r){r=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var c={};for(A=0,u=s.length;A<u;A++)c[h=s[A]]=h;i[r]=["function(require,module,exports){"+t+"(self); }",c]}var l=Math.floor(Math.pow(16,8)*Math.random()).toString(16),g={};g[r]=r,i[l]=["function(require,module,exports){var f = require("+o(r)+");(f.default ? f.default : f)(self);}",g];var p={};function d(t){for(var e in p[t]=!0,i[t][1]){var r=i[t][1][e];p[r]||d(r)}}d(l);var m="("+n+")({"+Object.keys(p).map(function(t){return o(t)+":["+i[t][0]+","+o(i[t][1])+"]"}).join(",")+"},{},["+o(l)+"])",_=window.URL||window.webkitURL||window.mozURL||window.msURL,w=new Blob([m],{type:"text/javascript"});if(e&&e.bare)return w;var I=_.createObjectURL(w),b=new Worker(I);return b.objectURL=I,b}},{}],"/index.js":[function(t,e,r){function n(t,e){return A(t)||s(t,e)||a(t,e)||i()}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(t,e){if(t){if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function s(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a=[],o=!0,s=!1;try{for(r=r.call(t);!(o=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);o=!0);}catch(t){s=!0,i=t}finally{try{o||null==r.return||r.return()}finally{if(s)throw i}}return a}}function A(t){if(Array.isArray(t))return t}var u=t("object-assign"),h=t("webworkify"),f=t("./lib/mathlib"),c=t("./lib/pool"),l=t("./lib/utils"),g=t("./lib/worker"),p=t("./lib/stepper"),d=t("./lib/tiler"),m={},_=!1;try{"undefined"!=typeof navigator&&navigator.userAgent&&(_=navigator.userAgent.indexOf("Safari")>=0)}catch(t){}var w=1;"undefined"!=typeof navigator&&(w=Math.min(navigator.hardwareConcurrency||1,4));var I={tile:1024,concurrency:w,features:["js","wasm","ww"],idle:2e3,createCanvas:function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,r}},b={quality:3,alpha:!1,unsharpAmount:0,unsharpRadius:0,unsharpThreshold:0},v=!1,y=!1,B=!1,E=!1,C=!1;function Q(){return{value:h(g),destroy:function(){if(this.value.terminate(),"undefined"!=typeof window){var t=window.URL||window.webkitURL||window.mozURL||window.msURL;t&&t.revokeObjectURL&&this.value.objectURL&&t.revokeObjectURL(this.value.objectURL)}}}}function x(t){if(!(this instanceof x))return new x(t);this.options=u({},I,t||{});var e="lk_".concat(this.options.concurrency);this.__limit=m[e]||l.limiter(this.options.concurrency),m[e]||(m[e]=this.__limit),this.features={js:!1,wasm:!1,cib:!1,ww:!1},this.__workersPool=null,this.__requested_features=[],this.__mathlib=null}x.prototype.init=function(){var e=this;if(this.__initPromise)return this.__initPromise;if("undefined"!=typeof ImageData&&"undefined"!=typeof Uint8ClampedArray)try{new ImageData(new Uint8ClampedArray(400),10,10),v=!0}catch(t){}"undefined"!=typeof ImageBitmap&&(ImageBitmap.prototype&&ImageBitmap.prototype.close?y=!0:this.debug("ImageBitmap does not support .close(), disabled"));var r=this.options.features.slice();if(r.indexOf("all")>=0&&(r=["cib","wasm","js","ww"]),this.__requested_features=r,this.__mathlib=new f(r),r.indexOf("ww")>=0&&"undefined"!=typeof window&&"Worker"in window)try{t("webworkify")(function(){}).terminate(),this.features.ww=!0;var n="wp_".concat(JSON.stringify(this.options));m[n]?this.__workersPool=m[n]:(this.__workersPool=new c(Q,this.options.idle),m[n]=this.__workersPool)}catch(t){}var i,a,o=this.__mathlib.init().then(function(t){u(e.features,t.features)});i=y?l.cib_support(this.options.createCanvas).then(function(t){e.features.cib&&r.indexOf("cib")<0?e.debug("createImageBitmap() resize supported, but disabled by config"):r.indexOf("cib")>=0&&(e.features.cib=t)}):Promise.resolve(!1),B=l.can_use_canvas(this.options.createCanvas),a=(a=y&&v&&-1!==r.indexOf("ww")?l.worker_offscreen_canvas_support():Promise.resolve(!1)).then(function(t){E=t});var s=l.cib_can_use_region().then(function(t){C=t});return this.__initPromise=Promise.all([o,i,a,s]).then(function(){return e}),this.__initPromise},x.prototype.__invokeResize=function(t,e){var r=this;return e.__mathCache=e.__mathCache||{},Promise.resolve().then(function(){return r.features.ww?new Promise(function(n,i){var a=r.__workersPool.acquire();e.cancelToken&&e.cancelToken.catch(function(t){return i(t)}),a.value.onmessage=function(t){a.release(),t.data.err?i(t.data.err):n(t.data)};var o=[];t.src&&o.push(t.src.buffer),t.srcBitmap&&o.push(t.srcBitmap),a.value.postMessage({opts:t,features:r.__requested_features,preload:{wasm_nodule:r.__mathlib.__}},o)}):{data:r.__mathlib.resizeAndUnsharp(t,e.__mathCache)}})},x.prototype.__extractTileData=function(t,e,r,n,i){if(this.features.ww&&E&&(l.isCanvas(e)||C))return this.debug("Create tile for OffscreenCanvas"),createImageBitmap(n.srcImageBitmap||e,t.x,t.y,t.width,t.height).then(function(t){return i.srcBitmap=t,i});if(l.isCanvas(e))return n.srcCtx||(n.srcCtx=e.getContext("2d",{alpha:Boolean(r.alpha)})),this.debug("Get tile pixel data"),i.src=n.srcCtx.getImageData(t.x,t.y,t.width,t.height).data,i;this.debug("Draw tile imageBitmap/image to temporary canvas");var a=this.options.createCanvas(t.width,t.height),o=a.getContext("2d",{alpha:Boolean(r.alpha)});return o.globalCompositeOperation="copy",o.drawImage(n.srcImageBitmap||e,t.x,t.y,t.width,t.height,0,0,t.width,t.height),this.debug("Get tile pixel data"),i.src=o.getImageData(0,0,t.width,t.height).data,a.width=a.height=0,i},x.prototype.__landTileData=function(t,e,r){var n;if(this.debug("Convert raw rgba tile result to ImageData"),e.bitmap)return r.toCtx.drawImage(e.bitmap,t.toX,t.toY),null;if(v)n=new ImageData(new Uint8ClampedArray(e.data),t.toWidth,t.toHeight);else if((n=r.toCtx.createImageData(t.toWidth,t.toHeight)).data.set)n.data.set(e.data);else for(var i=n.data.length-1;i>=0;i--)n.data[i]=e.data[i];return this.debug("Draw tile"),_?r.toCtx.putImageData(n,t.toX,t.toY,t.toInnerX-t.toX,t.toInnerY-t.toY,t.toInnerWidth+1e-5,t.toInnerHeight+1e-5):r.toCtx.putImageData(n,t.toX,t.toY,t.toInnerX-t.toX,t.toInnerY-t.toY,t.toInnerWidth,t.toInnerHeight),null},x.prototype.__tileAndResize=function(t,e,r){var n=this,i={srcCtx:null,srcImageBitmap:null,isImageBitmapReused:!1,toCtx:null},a=function(e){return n.__limit(function(){if(r.canceled)return r.cancelToken;var a={width:e.width,height:e.height,toWidth:e.toWidth,toHeight:e.toHeight,scaleX:e.scaleX,scaleY:e.scaleY,offsetX:e.offsetX,offsetY:e.offsetY,quality:r.quality,alpha:r.alpha,unsharpAmount:r.unsharpAmount,unsharpRadius:r.unsharpRadius,unsharpThreshold:r.unsharpThreshold};return n.debug("Invoke resize math"),Promise.resolve(a).then(function(a){return n.__extractTileData(e,t,r,i,a)}).then(function(t){return n.debug("Invoke resize math"),n.__invokeResize(t,r)}).then(function(t){return r.canceled?r.cancelToken:(i.srcImageData=null,n.__landTileData(e,t,i))})})};return Promise.resolve().then(function(){if(i.toCtx=e.getContext("2d",{alpha:Boolean(r.alpha)}),l.isCanvas(t))return null;if(l.isImageBitmap(t))return i.srcImageBitmap=t,i.isImageBitmapReused=!0,null;if(l.isImage(t))return y?(n.debug("Decode image via createImageBitmap"),createImageBitmap(t).then(function(t){i.srcImageBitmap=t}).catch(function(t){return null})):null;throw new Error('Pica: ".from" should be Image, Canvas or ImageBitmap')}).then(function(){if(r.canceled)return r.cancelToken;n.debug("Calculate tiles");var t=d({width:r.width,height:r.height,srcTileSize:n.options.tile,toWidth:r.toWidth,toHeight:r.toHeight,destTileBorder:r.__destTileBorder}).map(function(t){return a(t)});function o(t){t.srcImageBitmap&&(t.isImageBitmapReused||t.srcImageBitmap.close(),t.srcImageBitmap=null)}return n.debug("Process tiles"),Promise.all(t).then(function(){return n.debug("Finished!"),o(i),e},function(t){throw o(i),t})})},x.prototype.__processStages=function(t,e,r,i){var a=this;if(i.canceled)return i.cancelToken;var o,s=n(t.shift(),2),A=s[0],h=s[1],f=0===t.length;return i=u({},i,{toWidth:A,toHeight:h,quality:f?i.quality:Math.min(1,i.quality)}),f||(o=this.options.createCanvas(A,h)),this.__tileAndResize(e,f?r:o,i).then(function(){return f?r:(i.width=A,i.height=h,a.__processStages(t,o,r,i))}).then(function(t){return o&&(o.width=o.height=0),t})},x.prototype.__resizeViaCreateImageBitmap=function(t,e,r){var n=this,i=e.getContext("2d",{alpha:Boolean(r.alpha)});return this.debug("Resize via createImageBitmap()"),createImageBitmap(t,{resizeWidth:r.toWidth,resizeHeight:r.toHeight,resizeQuality:l.cib_quality_name(r.quality)}).then(function(t){if(r.canceled)return r.cancelToken;if(!r.unsharpAmount)return i.drawImage(t,0,0),t.close(),i=null,n.debug("Finished!"),e;n.debug("Unsharp result");var a=n.options.createCanvas(r.toWidth,r.toHeight),o=a.getContext("2d",{alpha:Boolean(r.alpha)});o.drawImage(t,0,0),t.close();var s=o.getImageData(0,0,r.toWidth,r.toHeight);return n.__mathlib.unsharp_mask(s.data,r.toWidth,r.toHeight,r.unsharpAmount,r.unsharpRadius,r.unsharpThreshold),i.putImageData(s,0,0),a.width=a.height=0,s=o=a=i=null,n.debug("Finished!"),e})},x.prototype.resize=function(t,e,r){var n=this;this.debug("Start resize...");var i=u({},b);if(isNaN(r)?r&&(i=u(i,r)):i=u(i,{quality:r}),i.toWidth=e.width,i.toHeight=e.height,i.width=t.naturalWidth||t.width,i.height=t.naturalHeight||t.height,0===e.width||0===e.height)return Promise.reject(new Error("Invalid output size: ".concat(e.width,"x").concat(e.height)));i.unsharpRadius>2&&(i.unsharpRadius=2),i.canceled=!1,i.cancelToken&&(i.cancelToken=i.cancelToken.then(function(t){throw i.canceled=!0,t},function(t){throw i.canceled=!0,t}));var a=3;return i.__destTileBorder=Math.ceil(Math.max(a,2.5*i.unsharpRadius|0)),this.init().then(function(){if(i.canceled)return i.cancelToken;if(n.features.cib)return n.__resizeViaCreateImageBitmap(t,e,i);if(!B){var r=new Error("Pica: cannot use getImageData on canvas, make sure fingerprinting protection isn't enabled");throw r.code="ERR_GET_IMAGE_DATA",r}var a=p(i.width,i.height,i.toWidth,i.toHeight,n.options.tile,i.__destTileBorder);return n.__processStages(a,t,e,i)})},x.prototype.resizeBuffer=function(t){var e=this,r=u({},b,t);return this.init().then(function(){return e.__mathlib.resizeAndUnsharp(r)})},x.prototype.toBlob=function(t,e,r){return e=e||"image/png",new Promise(function(n){if(t.toBlob)t.toBlob(function(t){return n(t)},e,r);else if(t.convertToBlob)n(t.convertToBlob({type:e,quality:r}));else{for(var i=atob(t.toDataURL(e,r).split(",")[1]),a=i.length,o=new Uint8Array(a),s=0;s<a;s++)o[s]=i.charCodeAt(s);n(new Blob([o],{type:e}))}})},x.prototype.debug=function(){},e.exports=x},{"./lib/mathlib":1,"./lib/pool":13,"./lib/stepper":14,"./lib/tiler":15,"./lib/utils":16,"./lib/worker":17,"object-assign":23,webworkify:24}]},{},[])("/index.js")}),A=a(function(t){function e(t,e){var r=new Error(t);return r.code=e,r}function r(t){for(var e=t.toString(16).toUpperCase(),r=2-e.length;r>0;r--)e="0"+e;return"0x"+e}function n(t){try{return decodeURIComponent(escape(t))}catch(e){return t}}function i(t){return"[object Uint8Array]"===Object.prototype.toString.call(t)}function a(t,r,n){this.input=t.subarray(r,n),this.start=r;var i=String.fromCharCode.apply(null,this.input.subarray(0,4));if("II*\0"!==i&&"MM\0*"!==i)throw e("invalid TIFF signature","EBADDATA");this.big_endian="M"===i[0]}a.prototype.each=function(t){this.aborted=!1;var e=this.read_uint32(4);for(this.ifds_to_read=[{id:0,offset:e}];this.ifds_to_read.length>0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,t)}},a.prototype.filter=function(t){var r={ifd0:{id:0,entries:[]}};this.each(function(e){(!1!==t(e)||e.is_subifd_link)&&(e.is_subifd_link&&1!==e.count&&4!==e.format||(r["ifd"+e.ifd]||(r["ifd"+e.ifd]={id:e.ifd,entries:[]}),r["ifd"+e.ifd].entries.push(e)))}),delete r.ifd1;var n=8;Object.keys(r).forEach(function(t){n+=2,r[t].entries.forEach(function(t){n+=12+(t.data_length>4?2*Math.ceil(t.data_length/2):0)}),n+=4}),this.output=new Uint8Array(n),this.output[0]=this.output[1]=(this.big_endian?"M":"I").charCodeAt(0),this.write_uint16(2,42);var i=8,a=this;if(this.write_uint32(4,i),Object.keys(r).forEach(function(t){r[t].written_offset=i;var e=i,n=e+2+12*r[t].entries.length+4;i=n,a.write_uint16(e,r[t].entries.length),r[t].entries.sort(function(t,e){return t.tag-e.tag}).forEach(function(t,n){var o=e+2+12*n;a.write_uint16(o,t.tag),a.write_uint16(o+2,t.format),a.write_uint32(o+4,t.count),t.is_subifd_link?r["ifd"+t.tag]&&(r["ifd"+t.tag].link_offset=o+8):t.data_length<=4?a.output.set(a.input.subarray(t.data_offset-a.start,t.data_offset-a.start+4),o+8):(a.write_uint32(o+8,i),a.output.set(a.input.subarray(t.data_offset-a.start,t.data_offset-a.start+t.data_length),i),i+=2*Math.ceil(t.data_length/2))});var o=r["ifd"+(r[t].id+1)];o&&(o.link_offset=n-4)}),Object.keys(r).forEach(function(t){r[t].written_offset&&r[t].link_offset&&a.write_uint32(r[t].link_offset,r[t].written_offset)}),this.output.length!==i)throw e("internal error: incorrect buffer size allocated");return this.output},a.prototype.read_uint16=function(t){var r=this.input;if(t+2>r.length)throw e("unexpected EOF","EBADDATA");return this.big_endian?256*r[t]+r[t+1]:r[t]+256*r[t+1]},a.prototype.read_uint32=function(t){var r=this.input;if(t+4>r.length)throw e("unexpected EOF","EBADDATA");return this.big_endian?16777216*r[t]+65536*r[t+1]+256*r[t+2]+r[t+3]:r[t]+256*r[t+1]+65536*r[t+2]+16777216*r[t+3]},a.prototype.write_uint16=function(t,e){var r=this.output;this.big_endian?(r[t]=e>>>8&255,r[t+1]=255&e):(r[t]=255&e,r[t+1]=e>>>8&255)},a.prototype.write_uint32=function(t,e){var r=this.output;this.big_endian?(r[t]=e>>>24&255,r[t+1]=e>>>16&255,r[t+2]=e>>>8&255,r[t+3]=255&e):(r[t]=255&e,r[t+1]=e>>>8&255,r[t+2]=e>>>16&255,r[t+3]=e>>>24&255)},a.prototype.is_subifd_link=function(t,e){return 0===t&&34665===e||0===t&&34853===e||34665===t&&40965===e},a.prototype.exif_format_length=function(t){switch(t){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},a.prototype.exif_format_read=function(t,e){var r;switch(t){case 1:case 2:return r=this.input[e];case 6:return(r=this.input[e])|33554430*(128&r);case 3:return r=this.read_uint16(e);case 8:return(r=this.read_uint16(e))|131070*(32768&r);case 4:return r=this.read_uint32(e);case 9:return 0|(r=this.read_uint32(e));default:return null}},a.prototype.scan_ifd=function(t,r,i){var a=this.read_uint16(r);r+=2;for(var o=0;o<a;o++){var s=this.read_uint16(r),A=this.read_uint16(r+2),u=this.read_uint32(r+4),h=this.exif_format_length(A),f=u*h,c=f<=4?r+8:this.read_uint32(r+8),l=!1;if(c+f>this.input.length)throw e("unexpected EOF","EBADDATA");for(var g=[],p=c,d=0;d<u;d++,p+=h){var m=this.exif_format_read(A,p);if(null===m){g=null;break}g.push(m)}if(Array.isArray(g)&&2===A){try{g=n(String.fromCharCode.apply(null,g))}catch(t){g=null}g&&"\0"===g[g.length-1]&&(g=g.slice(0,-1))}if(this.is_subifd_link(t,s)&&Array.isArray(g)&&Number.isInteger(g[0])&&g[0]>0&&(this.ifds_to_read.push({id:s,offset:g[0]}),l=!0),!1===i({is_big_endian:this.big_endian,ifd:t,tag:s,format:A,count:u,entry_offset:r+this.start,data_length:f,data_offset:c+this.start,value:g,is_subifd_link:l}))return void(this.aborted=!0);r+=12}0===t&&this.ifds_to_read.push({id:1,offset:this.read_uint32(r)})},t.exports.is_jpeg=function(t){return t.length>=4&&255===t[0]&&216===t[1]&&255===t[2]},t.exports.jpeg_segments_each=function(n,a){if(!i(n))throw e("Invalid argument (jpeg_bin), Uint8Array expected","EINVAL");if("function"!=typeof a)throw e("Invalid argument (on_segment), Function expected","EINVAL");if(!t.exports.is_jpeg(n))throw e("Unknown file format","ENOTJPEG");for(var o=0,s=n.length,A=!1;;){var u,h;if(o+1>=s)throw e("Unexpected EOF","EBADDATA");var f=n[o],c=n[o+1];if(255===f&&255===c)u=255,h=1;else if(255===f&&0!==c){if(h=2,208<=(u=c)&&u<=217||1===u);else{if(o+3>=s)throw e("Unexpected EOF","EBADDATA");if((h+=256*n[o+2]+n[o+3])<2)throw e("Invalid segment length","EBADDATA");if(o+h-1>=s)throw e("Unexpected EOF","EBADDATA")}A&&(u>=208&&u<=215||(A=!1)),218===u&&(A=!0)}else{if(!A)throw e("Unexpected byte at segment start: "+r(f)+" (offset "+r(o)+")","EBADDATA");for(var l=o+1;;l++){if(l>=s)throw e("Unexpected EOF","EBADDATA");if(255===n[l]){if(l+1>=s)throw e("Unexpected EOF","EBADDATA");if(0!==n[l+1]){u=0,h=l-o;break}}}}if(!1===a({code:u,offset:o,length:h}))break;if(217===u)break;o+=h}},t.exports.jpeg_segments_filter=function(r,n){if(!i(r))throw e("Invalid argument (jpeg_bin), Uint8Array expected","EINVAL");if("function"!=typeof n)throw e("Invalid argument (on_segment), Function expected","EINVAL");var a=[],o=0;t.exports.jpeg_segments_each(r,function(t){var e=n(t);if(i(e))a.push({data:e}),o+=e.length;else if(Array.isArray(e))e.filter(i).forEach(function(t){a.push({data:t}),o+=t.length});else if(!1!==e){var r={start:t.offset,end:t.offset+t.length};a.length>0&&a[a.length-1].end===r.start?a[a.length-1].end=r.end:a.push(r),o+=t.length}});var s=new Uint8Array(o),A=0;return a.forEach(function(t){var e=t.data||r.subarray(t.start,t.end);s.set(e,A),A+=e.length}),s},t.exports.jpeg_exif_tags_each=function(r,n){if(!i(r))throw e("Invalid argument (jpeg_bin), Uint8Array expected","EINVAL");if("function"!=typeof n)throw e("Invalid argument (on_exif_entry), Function expected","EINVAL");t.exports.jpeg_segments_each(r,function(t){return 218!==t.code&&(225===t.code&&t.length>=10&&69===r[t.offset+4]&&120===r[t.offset+5]&&105===r[t.offset+6]&&102===r[t.offset+7]&&0===r[t.offset+8]&&0===r[t.offset+9]?(new a(r,t.offset+10,t.offset+t.length).each(n),!1):void 0)})},t.exports.jpeg_exif_tags_filter=function(r,n){if(!i(r))throw e("Invalid argument (jpeg_bin), Uint8Array expected","EINVAL");if("function"!=typeof n)throw e("Invalid argument (on_exif_entry), Function expected","EINVAL");var o=!1;return t.exports.jpeg_segments_filter(r,function(t){if(!o&&(218===t.code&&(o=!0),225===t.code&&t.length>=10&&69===r[t.offset+4]&&120===r[t.offset+5]&&105===r[t.offset+6]&&102===r[t.offset+7]&&0===r[t.offset+8]&&0===r[t.offset+9])){var e=new a(r,t.offset+10,t.offset+t.length).filter(n);if(!e)return!1;var i=new Uint8Array(10);return i.set(r.slice(t.offset,t.offset+10)),i[2]=e.length+8>>>8&255,i[3]=e.length+8&255,o=!0,[i,e]}})},t.exports.jpeg_add_comment=function(e,r){var n=!1,i=0;return t.exports.jpeg_segments_filter(e,function(t){if(!(1===++i&&216===t.code||2===i&&224===t.code||n)){r=function(t){try{return unescape(encodeURIComponent(t))}catch(e){return t}}(r);var a=new Uint8Array(5+r.length),o=0;return a[o++]=255,a[o++]=254,a[o++]=r.length+3>>>8&255,a[o++]=r.length+3&255,r.split("").forEach(function(t){a[o++]=255&t.charCodeAt(0)}),a[o++]=0,n=!0,[a,e.subarray(t.offset,t.offset+t.length)]}})}});function u(t){return this._getUint8Array(t.blob).then(function(e){if(t.is_jpeg=A.is_jpeg(e),!t.is_jpeg)return Promise.resolve(t);t.orig_blob=t.blob;try{var r,n;if(A.jpeg_exif_tags_each(e,function(e){if(0===e.ifd&&274===e.tag&&Array.isArray(e.value))return t.orientation=e.value[0]||1,r=e.is_big_endian,n=e.data_offset,!1}),n){var i=r?new Uint8Array([0,1]):new Uint8Array([1,0]);t.blob=new Blob([e.slice(0,n),i,e.slice(n+2)],{type:"image/jpeg"})}}catch(t){}return t})}function h(t){if(!t.is_jpeg)return Promise.resolve(t);var e,r=t.orientation-1;if(!r)return Promise.resolve(t);var n=(e=4&r?this.pica.options.createCanvas(t.out_canvas.height,t.out_canvas.width):this.pica.options.createCanvas(t.out_canvas.width,t.out_canvas.height)).getContext("2d");return n.save(),1&r&&n.transform(-1,0,0,1,e.width,0),2&r&&n.transform(-1,0,0,-1,e.width,e.height),4&r&&n.transform(0,1,1,0,0,0),n.drawImage(t.out_canvas,0,0),n.restore(),t.out_canvas.width=t.out_canvas.height=0,t.out_canvas=e,Promise.resolve(t)}function f(t){return t.is_jpeg?Promise.all([this._getUint8Array(t.blob),this._getUint8Array(t.out_blob)]).then(function(e){var r=e[0],n=e[1];if(!A.is_jpeg(r))return Promise.resolve(t);var i=[];return A.jpeg_segments_each(r,function(t){if(218===t.code)return!1;i.push(t)}),i=i.filter(function(t){return 226!==t.code&&(t.code>=224&&t.code<240||254===t.code)}).map(function(t){return r.slice(t.offset,t.offset+t.length)}),t.out_blob=new Blob([n.slice(0,2)].concat(i).concat([n.slice(20)]),{type:"image/jpeg"}),t}):Promise.resolve(t)}var c={jpeg_patch_exif:u,jpeg_rotate_canvas:h,jpeg_attach_orig_segments:f,assign:function(t){t.before("_blob_to_image",u),t.after("_transform",h),t.after("_create_blob",f)}};function l(t){if(!(this instanceof l))return new l(t);t=t||{},this.pica=t.pica||s({}),this.initialized=!1,this.utils=i}l.prototype.use=function(t){var e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this},l.prototype.init=function(){this.use(c.assign)},l.prototype.toBlob=function(t,e){var r={blob:t,opts:i.assign({max:1/0},e)};return this.initialized||(this.init(),this.initialized=!0),Promise.resolve(r).then(this._blob_to_image).then(this._calculate_size).then(this._transform).then(this._cleanup).then(this._create_blob).then(function(t){return t.out_canvas.width=t.out_canvas.height=0,t.out_blob})},l.prototype.toCanvas=function(t,e){var r={blob:t,opts:i.assign({max:1/0},e)};return this.initialized||(this.init(),this.initialized=!0),Promise.resolve(r).then(this._blob_to_image).then(this._calculate_size).then(this._transform).then(this._cleanup).then(function(t){return t.out_canvas})},l.prototype.before=function(t,e){if(!this[t])throw new Error('Method "'+t+'" does not exist');if("function"!=typeof e)throw new Error('Invalid argument "fn", function expected');var r=this[t],n=this;return this[t]=function(t){return e.call(n,t).then(function(t){return r.call(n,t)})},this},l.prototype.after=function(t,e){if(!this[t])throw new Error('Method "'+t+'" does not exist');if("function"!=typeof e)throw new Error('Invalid argument "fn", function expected');var r=this[t],n=this;return this[t]=function(t){return r.call(n,t).then(function(t){return e.call(n,t)})},this},l.prototype._blob_to_image=function(t){var e=window.URL||window.webkitURL||window.mozURL||window.msURL;return t.image=document.createElement("img"),t.image_url=e.createObjectURL(t.blob),t.image.src=t.image_url,new Promise(function(e,r){t.image.onerror=function(){r(new Error("ImageBlobReduce: failed to create Image() from blob"))},t.image.onload=function(){e(t)}})},l.prototype._calculate_size=function(t){var e=t.opts.max/Math.max(t.image.width,t.image.height);return e>1&&(e=1),t.transform_width=Math.max(Math.round(t.image.width*e),1),t.transform_height=Math.max(Math.round(t.image.height*e),1),t.scale_factor=e,Promise.resolve(t)},l.prototype._transform=function(t){t.out_canvas=this.pica.options.createCanvas(t.transform_width,t.transform_height),t.transform_width=null,t.transform_height=null;var e={alpha:"image/png"===t.blob.type};return this.utils.assign(e,this.utils.pick_pica_resize_options(t.opts)),this.pica.resize(t.image,t.out_canvas,e).then(function(){return t})},l.prototype._cleanup=function(t){t.image.src="",t.image=null;var e=window.URL||window.webkitURL||window.mozURL||window.msURL;return e.revokeObjectURL&&e.revokeObjectURL(t.image_url),t.image_url=null,Promise.resolve(t)},l.prototype._create_blob=function(t){return this.pica.toBlob(t.out_canvas,t.blob.type).then(function(e){return t.out_blob=e,t})},l.prototype._getUint8Array=function(t){return t.arrayBuffer?t.arrayBuffer().then(function(t){return new Uint8Array(t)}):new Promise(function(e,r){var n=new FileReader;n.readAsArrayBuffer(t),n.onload=function(){e(new Uint8Array(n.result))},n.onerror=function(){r(new Error("ImageBlobReduce: failed to load data from input blob")),n.abort()},n.onabort=function(){r(new Error("ImageBlobReduce: failed to load data from input blob (aborted)"))}})},l.pica=s;const g=l}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2479,7943],{87943(e,t,n){n.r(t),n.d(t,{default:()=>p});var r=n(96540),s=n(34843),a=n(82893),c=n(14284),i=n(62042),o=n(53459),l=n(34289),d=n(22022),u=n(12479),m=n(74848);function p(){const[e,t]=(0,s.fp)(a.AG.mind_editor),[n,p]=(0,r.useState)(!1),{t:f}=(0,d.Bd)(),h=(0,r.useRef)(null);return void 0===e.url?null:(0,m.jsx)("div",{id:"mind-container",children:(0,m.jsx)("div",{className:"mind-context",children:(0,m.jsx)(u.default,{fullscreen:!0,reset_key:e.url,url:e.url,on_dirty:p,register:e=>{h.current=e},header:(0,m.jsxs)("div",{className:"mind-topbar",children:[(0,m.jsx)("span",{className:"material-icons mind-topbar__icon",children:"account_tree"}),(0,m.jsx)("span",{className:"mind-topbar__name",children:e.name}),(0,m.jsx)("span",{style:{flex:1}}),(0,m.jsx)("button",{type:"button",className:"mind-btn",title:f("保存")+" (Ctrl+S)",onClick:async()=>{await(h.current?.save())},children:(0,m.jsx)("span",{className:"material-icons",children:"save"})}),(0,m.jsx)("button",{type:"button",className:"mind-btn",title:f("关闭"),onClick:()=>{n&&!window.confirm(f("有未保存的修改,确定要关闭吗?"))||(t({}),e?.close?.())},children:(0,m.jsx)("span",{className:"material-icons",children:"close"})})]}),on_save:async t=>(await c.$M.post(`save/${encodeURIComponent((0,l.GG)("file",(0,l.vX)()))}${e.name}`,{context:t})).code===o.m.Success&&((0,i.SK)(f("保存成功")),!0)})})})}},12479(e,t,n){n.r(t),n.d(t,{default:()=>l});var r=n(96540),s=n(57889),a=(n(14284),n(62042)),c=n(22022),i=n(21417),o=(n(88781),n(74848));function l(e){const{t}=(0,c.Bd)(),[n,l]=(0,r.useState)(!0),[m,p]=(0,r.useState)(""),[f,h]=(0,r.useState)(100),x=(0,r.useRef)(null),y=(0,r.useRef)(null),b=(0,r.useRef)(!1),N=(0,r.useRef)({props:e});N.current={props:e};const j=async()=>{if(!y.current)return(0,a.zN)(t("编辑器尚未就绪")),!1;const e=await N.current.props.on_save((()=>{const e=y.current;return e?JSON.stringify(e.getData(!0)):""})());return e&&(b.current=!1,N.current.props.on_dirty?.(!1),N.current.props.on_saved?.()),e};(0,r.useEffect)(()=>{e.register?.({save:j,is_dirty:()=>b.current})},[e.register]),(0,r.useEffect)(()=>{if(!x.current||!e.url)return;let n=!1;const r=[];y.current?.destroy?.(),y.current=null,b.current=!1,l(!0),p("");const c=async e=>{if(n||!x.current)return;const s=new i.A({el:x.current,data:e??{data:{text:t("中心主题")}},fit:!0,enableFreeDrag:!1});y.current=s,l(!1);const a=()=>{let e=!1;const t=window.setTimeout(()=>{n||(e=!0)},400);r.push(t),s.on("data_change",()=>{e&&(b.current||(b.current=!0,N.current.props.on_dirty?.(!0)),h(d(s)))}),s.on("view_data_change",()=>{h(d(s))}),s.on("error",(e,t)=>{console.error("[mind]",e,t)}),h(d(s))};window.requestAnimationFrame(()=>{n||a()})};return(async()=>{try{const t=await s.l.get(e.url);if(n)return;let r=null;if("string"==typeof t&&t.trim())try{r=JSON.parse(t)}catch{r=null}r=function(e){if(!e||"object"!=typeof e)return null;if(e.root&&"object"==typeof e.root)return e.root.data?e.root:u(e.root);if(e.data&&"object"==typeof e.data)return e;return u(e)}(r),await c(r)}catch(e){n||(l(!1),p(t("加载思维导图失败")),(0,a.zN)(t("加载思维导图失败")))}})(),()=>{n=!0,r.forEach(e=>window.clearTimeout(e)),y.current?.destroy?.(),y.current=null}},[e.url]),(0,r.useEffect)(()=>{const e=e=>{(e.ctrlKey||e.metaKey)&&("s"===e.key||"S"===e.key||83===e.keyCode)&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),j())};return window.addEventListener("keydown",e,!0),document.addEventListener("keydown",e,!0),()=>{window.removeEventListener("keydown",e,!0),document.removeEventListener("keydown",e,!0)}},[]);const v=e=>{const t=y.current;if(!t)return;const n=Math.min(4,Math.max(.25,e));t.view.setScale(n),h(Math.round(100*n))};return(0,o.jsxs)("div",{className:"mind-wrap"+(e.fullscreen?" mind-wrap--full":""),children:[e.header,(0,o.jsxs)("div",{className:"mind-toolbar",children:[(0,o.jsx)("button",{type:"button",className:"mind-btn",title:t("添加子节点")+" (Tab)",onClick:()=>y.current?.execCommand?.("INSERT_CHILD_NODE"),children:(0,o.jsx)("span",{className:"material-icons",children:"account_tree"})}),(0,o.jsx)("button",{type:"button",className:"mind-btn",title:t("添加同级节点")+" (Enter)",onClick:()=>y.current?.execCommand?.("INSERT_NODE"),children:(0,o.jsx)("span",{className:"material-icons",children:"subdirectory_arrow_right"})}),(0,o.jsx)("button",{type:"button",className:"mind-btn",title:t("删除节点")+" (Delete)",onClick:()=>y.current?.execCommand?.("REMOVE_NODE"),children:(0,o.jsx)("span",{className:"material-icons",children:"delete"})}),(0,o.jsx)("span",{className:"mind-toolbar__gap"}),(0,o.jsxs)("span",{className:"mind-toolbar__zoom",children:[f,"%"]}),(0,o.jsx)("button",{type:"button",className:"mind-btn",title:t("缩小"),onClick:()=>v(d(y.current)/100-.2),children:(0,o.jsx)("span",{className:"material-icons",children:"remove"})}),(0,o.jsx)("button",{type:"button",className:"mind-btn",title:t("放大"),onClick:()=>v(d(y.current)/100+.2),children:(0,o.jsx)("span",{className:"material-icons",children:"add"})}),(0,o.jsx)("button",{type:"button",className:"mind-btn",title:t("适应窗口"),onClick:()=>y.current?.view?.fit?.(),children:(0,o.jsx)("span",{className:"material-icons",children:"fit_screen"})})]}),(0,o.jsxs)("div",{className:"mind-canvas",children:[(0,o.jsx)("div",{className:"mind-mount",ref:x}),n&&(0,o.jsx)("div",{className:"mind-mask",children:"Loading..."}),m&&(0,o.jsx)("div",{className:"mind-mask",children:m})]})]})}function d(e){const t=e?.view?.getTransformData?.()?.state?.scale;return"number"==typeof t&&t>0?Math.round(100*t):100}function u(e){return{data:{text:"string"==typeof e?.text?e.text:"",...e?.note?{note:e.note}:{}},children:Array.isArray(e?.children)?e.children.map(u):[]}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[7954],{89117(t,e,n){n.d(e,{Hm:()=>s,U6:()=>c});const r=["mermaid","svg"];function s(t){return r.includes(t)}let o=null;let i=0;async function a(t){const e=t.trim();if(!e)return{svg:"",error:null};const r=await(o||(o=n.e(2300).then(n.bind(n,62300)).then(t=>{const e=t.default;return e.initialize({startOnLoad:!1,securityLevel:"loose",theme:"default",fontFamily:"inherit",suppressErrorRendering:!0}),e})),o),s="md-mermaid-"+ ++i;try{const{svg:t}=await r.render(s,e);return{svg:t,error:null}}catch(t){return document.getElementById(s)?.remove(),document.getElementById(`d${s}`)?.remove(),{svg:"",error:t?.message??String(t)}}}async function c(t,e){return"svg"===t?function(t){const e=t.trim();if(!e)return{svg:"",error:null};const n=(new DOMParser).parseFromString(e,"image/svg+xml").querySelector("parsererror");return n?{svg:"",error:n.textContent?.trim()||"SVG 解析失败"}:{svg:e,error:null}}(e):a(e)}},41105(t,e,n){n.d(e,{KR:()=>l,Ne:()=>i,op:()=>f,pC:()=>o,sL:()=>c});var r=n(14284),s=n(19878);function o(t){return btoa(unescape(encodeURIComponent(t)))}function i(t){return decodeURIComponent(escape(atob(t)))}let a="";function c(t){a=t||""}function l(t){if(/^(https?:|data:|blob:|\/\/|\/)/i.test(t))return t;const e=t.replace(/^\.\//,"");return r.$M.getDownloadUrl(a+e)}const u=new Set(["a","abbr","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","pre","q","s","samp","small","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","u","ul","var","wbr"]),h=new Set(["align","alt","border","cellpadding","cellspacing","class","colspan","height","href","id","rowspan","src","style","target","title","valign","width"]);function d(t){const e=(new DOMParser).parseFromString(`<div>${t}</div>`,"text/html").body.firstElementChild,n=document.createDocumentFragment();if(!e)return n;const r=(t,e)=>{t.childNodes.forEach(t=>{if(t.nodeType===Node.TEXT_NODE)return void e.appendChild(document.createTextNode(t.textContent??""));if(t.nodeType!==Node.ELEMENT_NODE)return;const n=t;if(!u.has(n.tagName.toLowerCase()))return void r(n,e);const s=document.createElement(n.tagName.toLowerCase());for(const t of Array.from(n.attributes)){const e=t.name.toLowerCase();e.startsWith("on")||(h.has(e)||e.startsWith("data-"))&&("href"!==e&&"src"!==e||!/^\s*javascript:/i.test(t.value))&&("src"!==e?s.setAttribute(e,t.value):s.setAttribute(e,l(t.value)))}r(n,s),e.appendChild(s)})};return r(e,n),n}class m{dom;node;view;get_pos;render_box;source_box;source_input;source_hl;source_hl_code;mode="preview";draft=null;constructor(t,e,n){this.node=t,this.view=e,this.get_pos=n,this.dom=document.createElement("div"),this.dom.className="md-html-block",this.dom.setAttribute("data-mode","preview"),this.render_box=document.createElement("div"),this.render_box.className="md-html-block__render",this.source_box=document.createElement("div"),this.source_box.className="md-html-block__source",this.source_input=document.createElement("textarea"),this.source_input.className="md-html-block__input",this.source_input.setAttribute("spellcheck","false"),this.source_input.setAttribute("wrap","off"),this.source_hl=document.createElement("pre"),this.source_hl.className="md-html-block__highlight",this.source_hl.setAttribute("aria-hidden","true");const r=document.createElement("code");this.source_hl.appendChild(r),this.source_hl_code=r,this.source_box.append(this.source_hl,this.source_input);const s=document.createElement("span");s.className="md-html-block__toggle",s.setAttribute("contenteditable","false"),s.textContent="HTML",s.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation(),this.toggle_mode()}),this.source_input.addEventListener("blur",()=>this.commit()),this.source_input.addEventListener("keydown",t=>{"Escape"===t.key&&(t.preventDefault(),this.draft=null,this.toggle_mode()),t.stopPropagation()}),this.source_input.addEventListener("input",()=>{this.draft=this.source_input.value,this.paint_highlight(),this.source_hl.scrollLeft=this.source_input.scrollLeft}),this.source_hl.addEventListener("scroll",()=>{this.source_input.scrollLeft=this.source_hl.scrollLeft});for(const t of["beforeinput","paste","input","keyup","keypress"])this.source_input.addEventListener(t,t=>t.stopPropagation());this.dom.append(this.render_box,this.source_box,s),this.render_box.replaceChildren(d(t.attrs.value)),this.set_source_value(t.attrs.value)}set_source_value(t){this.source_input.value=t,this.paint_highlight()}paint_highlight(){const t=this.source_input.value;this.source_hl_code.innerHTML=s.A.highlight(t+"\n",{language:"xml",ignoreIllegals:!0}).value}toggle_mode(){if("source"===this.mode)return this.commit(),this.mode="preview",void this.dom.setAttribute("data-mode","preview");this.mode="source",this.dom.setAttribute("data-mode","source"),this.set_source_value(this.node.attrs.value),this.draft=null,this.source_input.focus()}commit(){if(null===this.draft)return;const t=this.draft;if(this.draft=null,t===this.node.attrs.value)return;const e=this.get_pos(),n=this.view.state.doc.nodeAt(e);n&&this.view.dispatch(this.view.state.tr.setNodeMarkup(e,void 0,{...n.attrs,value:t}))}update(t){return t.type===this.node.type&&(this.node=t,null===this.draft&&(this.render_box.replaceChildren(d(t.attrs.value)),"preview"===this.mode&&this.set_source_value(t.attrs.value)),!0)}stopEvent(t){return this.dom.contains(t.target)}ignoreMutation(){return!0}}class p{dom;node;view;get_pos;constructor(t,e,n){this.node=t,this.view=e,this.get_pos=n,this.dom=document.createElement("span"),this.dom.className="md-html-inline",this.dom.setAttribute("contenteditable","true"),this.dom.textContent=t.attrs.value,this.dom.addEventListener("blur",()=>this.commit());for(const t of["beforeinput","paste","input"])this.dom.addEventListener(t,t=>t.stopPropagation())}commit(){const t=this.dom.textContent??"";if(t===this.node.attrs.value)return;const e=this.get_pos(),n=this.view.state.doc.nodeAt(e);n&&this.view.dispatch(this.view.state.tr.setNodeMarkup(e,void 0,{...n.attrs,value:t}))}update(t){return t.type===this.node.type&&(this.node=t,!0)}stopEvent(t){return this.dom.contains(t.target)}ignoreMutation(){return!0}}function f(){return{html_block:(t,e,n)=>new m(t,e,n),html_inline:(t,e,n)=>new p(t,e,n)}}},89334(t,e,n){n.d(e,{Rh:()=>p,V:()=>a,lG:()=>o,rg:()=>f,z$:()=>h});var r=n(41105);n(6704);const s=["math","latex","katex"];function o(t){return s.includes(t.toLowerCase())}const i=[{open:"$$",close:"$$",mode:"block"},{open:"\\[",close:"\\]",mode:"block"},{open:"\\(",close:"\\)",mode:"inline"},{open:"$",close:"$",mode:"inline"}];function a(t){const e=t.trim();if(!e)return null;for(const t of i){if(e.length<=t.open.length+t.close.length)continue;if(!e.startsWith(t.open)||!e.endsWith(t.close))continue;const n=e.slice(t.open.length,e.length-t.close.length);if(("$"!==t.open||!e.startsWith("$$"))&&n.trim())return{tex:n,mode:t.mode,raw:e}}return null}let c=null;const l=new Map;async function u(t,e){const r=t.trim();if(!r)return{html:"",error:null};const s=`${e}\0${r}`,o=l.get(s);if(o)return o;let i;try{const{renderToString:t}=await(c||(c=n.e(2130).then(n.bind(n,99749))),c);i={html:t(r,{displayMode:"block"===e,throwOnError:!1,strict:!1,trust:!1,output:"html"}),error:null}}catch(t){i={html:"",error:t?.message??String(t)}}return l.size>=500&&l.clear(),l.set(s,i),i}async function h(t,e,n,r){const s=await u(e,n);if(t.isConnected){if(t.classList.remove("md-math--loading","md-math--error"),s.error)return t.classList.add("md-math--error"),t.textContent=r,void(t.title=s.error);t.innerHTML=s.html}}function d(t,e){const n=t.pos,r=t.src;if(r.startsWith("$$",n))return!1;const s=[{open:"\\(",close:"\\)"},{open:"$",close:"$"}];for(const o of s){if(!r.startsWith(o.open,n))continue;const s=n+o.open.length,i=r.indexOf(o.close,s);if(i<0)continue;const a=r.slice(s,i);if(a.trim()){if("$"===o.open){const t=r[i+1];if(void 0!==t&&/\d/.test(t))continue}if(!e){const e=t.push("math_inline","span",0);e.content=a,e.markup=o.open,e.meta={raw:r.slice(n,i+o.close.length)}}return t.pos=i+o.close.length,!0}}return!1}function m(t,e,n,r){const s=t.bMarks[e]+t.tShift[e],o=t.eMarks[e],i=t.src.slice(s,o).trim(),a=[{open:"\\[",close:"\\]"},{open:"$$",close:"$$"}];for(const o of a){if(!i.startsWith(o.open))continue;if(i.endsWith(o.close)&&i.length>o.open.length+o.close.length){if(r)return!0;const n=t.push("math_block","div",0);return n.content=i.slice(o.open.length,i.length-o.close.length),n.markup=o.open,n.meta={raw:i},n.map=[e,e+1],t.line=e+1,!0}const a=i.slice(o.open.length);for(let i=e+1;i<n;i++){const n=t.bMarks[i]+t.tShift[i],c=t.eMarks[i],l=t.src.slice(n,c);if(!l.trimEnd().endsWith(o.close))continue;if(r)return!0;const u=[];a.trim()&&u.push(a),t.getLines(e+1,i,t.tShift[e],!1).split("\n").forEach(t=>u.push(t)),u.push(l.trimEnd().slice(0,-o.close.length));const h=t.push("math_block","div",0);return h.content=u.join("\n").trim(),h.markup=o.open,h.meta={raw:t.src.slice(s,t.eMarks[i]).trimEnd()},h.map=[e,i+1],t.line=i+1,!0}}return!1}function p(t,e){t.inline.ruler.before("escape","math_inline",d),t.block.ruler.before("fence","math_block",m,{alt:["paragraph","reference","blockquote","list"]}),t.renderer.rules.math_inline=(t,n)=>`<span data-math-inline="${e(t[n].meta.raw)}"></span>`,t.renderer.rules.math_block=(t,n)=>`<div data-math-block="${e(t[n].meta.raw)}"></div>`;const n=t.renderer.rules.fence||function(t,e,n,r,s){return s.renderToken(t,e,n)};t.renderer.rules.fence=(t,r,s,i,a)=>o(t[r].info.trim())?`<div data-math-block="${e(`$$\n${t[r].content.trim()}\n$$`)}"></div>`:n(t,r,s,i,a)}async function f(t){const e=t.querySelectorAll("[data-math-inline], [data-math-block]");for(const t of Array.from(e)){const e=t.getAttribute("data-math-inline"),n=t.getAttribute("data-math-block"),s=e??n;if(null===s)continue;const o=a((0,r.Ne)(s));if(!o)continue;const i=null!==e?"inline":"block";t.classList.add("md-math","block"===i?"md-math--block":"md-math--inline"),await h(t,o.tex,i,o.raw)}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6010,8302],{83277(e,t,n){n.d(t,{$j:()=>r,CP:()=>o,Lv:()=>s,cL:()=>a});class s{token;open=!1;note;index;url;model;request_type;json_params;sys_prompt;dotenv="";tool_mode=!1;show_options;static get_label_by_v(e,t){if(!e||!t?.length)return e;for(const n of t)if(n.value===e)return n.label;return e}static have_label_by_v(e,t){if(!e||!t?.length)return!1;for(const n of t)if(n.value===e)return!0;return!1}}const o='\n\n\n\n# 聊天循环最大次数\ntool_call_max=500\n# 是否允许AI直接执行命令而不需要用户确认,默认为false,需要用户手动确认,如果使用 workflow 这里等价于为 true\nallow_exec_cmd_directly=false\n\n# 可选的代理 url,如果指定了所有访问大模型的请求将会走代理\n#proxy_url=\n\n# 可选的多个url 以数组分割\n# options_agent_url_list=[{"value":"http://..","label":"openai"}]\n\n# 可选的多个 key\n# options_agent_key_list=[{"value":"sh-aaa","label":"option1"}]\n\n# 可选的多个 model\n# options_agent_model_list=[{"value":"gpt-5.5","label":"gpt"}]\n\n# 存放本地的 prompt 文件 用于每次聊天的时候自动读取并加载\n# options_local_file_path_prompt_list=["/prompt/a.txt"]\n\n# 开启切换模型 ,开启以后,你可以自己写 prompt 提供多个模型让 ai 自己根据每次聊天切换下一步调用其他模型的次数\n# open_pick_model=false\n\n# 压缩后仍然完整保留的最近消息数\nmax_recent_messages=12\n# 当单个会话累计消息条数超过该值时,触发历史消息裁剪\ncompress_message_count=16\n# 历史消息中 tool 输出的最大字符数,只保留调用形式让 AI 知道调用了就行\nmax_tool_content_chars=200\n\n# ===== 模型类型(request_type)=====\n# 必填项,不同类型的 model 接口格式不同,默认 completions。\n# 可选值:\n# completions 标准对话/聊天补全 (chat/completions)\n# images 图片生成 (images/generations)\n# audio_speech 文本转语音 (audio/speech)\n# audio_transcription 语音转文字 (audio/transcriptions)\n# audio_translation 语音翻译 (audio/translations)\n# embeddings 向量嵌入 (embeddings)\n#request_type=completions\n\n# ===== 成为 tool(tool_mode)=====\n# 开启后该模型会作为一个工具被加载,可实现不同模型担任不同角色/能力,供 AI agent 在对话中动态调用。\n# 注意:不能与「是否开启」(open) 同时为 true。\n#tool_mode=false\n\n# ===== 是否支持图片(support_image)=====\n# 开启后:1) 注册 read_image 工具,让 AI 能读取本地图片;\n# 2) 工具读到的图片会以 OpenAI 多模态格式 image_url 随消息发给模型,模型就能真正"看图"。\n# 关闭后:AI 看不到图片,read_image 只会返回一句文字说明。\n# 主流模型(gpt-4o、豆包、qwen-vl、deepseek-vl 等)都支持,默认开启。\nsupport_image=true\n';const a=JSON.stringify({stream:!0,thinking:{type:"disabled"}});function r(e){return"string"==typeof e?e:Array.isArray(e)?e.map(e=>"text"===e.type?e.text:"[图片]").join("\n"):""}},77481(e,t,n){n.d(t,{S:()=>i,X:()=>r});var s=n(96540),o=n(61443),a=n(74848);function r(e){const[t,n]=s.useState([]),r=(0,s.useRef)(-1),[i,l]=(0,s.useState)(-1),[c,d]=(0,s.useState)(-1);(0,s.useEffect)(()=>{e.children?n(Array.isArray(e.children)?e.children:[e.children]):n(e.rows)},[e.rows,e.children]);const p=()=>{r.current=-1,l(-1),d(-1)};return(0,a.jsxs)("table",{children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{children:e.headers?.map((t,n)=>{const s=!!e.filter&&(e.filter.column??0)===n;let r=t;if(s){const n=e.filter,s=n.options.find(e=>e.value===n.value);null!=n.value&&s&&(r=`${t} (${s.label})`)}return(0,a.jsx)("th",{className:s?"table-filter-col":"",children:s?(0,a.jsx)(o.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:r}):t},n)})})}),(0,a.jsx)("tbody",{children:t.map((t,n)=>{const s=!!e.onRowDrag;return(0,a.jsx)("tr",{className:s?(i===n?"row-dragging":"")+(c===n?" row-drop-target":""):"",draggable:s,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{s&&(r.current=n,l(n),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!s||r.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(n))},onDrop:t=>{s&&(t.preventDefault(),(()=>{const t=r.current,n=c;p(),t<0||n<0||t===n||e.onRowDrag?.(t,n)})())},onDragEnd:p,children:t.map((n,s)=>{const o=s===t.length-1?"small":"";return(0,a.jsx)("td",{className:o,style:{width:e.width??"auto"},children:n},s)})},n)})})]})}function i(e){return(0,a.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,a.jsx)("div",{children:e},t))})}},29591(e,t,n){n.r(t),n.d(t,{default:()=>N});var s=n(22022),o=n(96540),a=n(85997),r=n(4412),i=n(34843),l=n(82893),c=n(75725),d=n(77481),p=n(61443),m=n(70447),u=n(34299),h=n(74848);var _=n(14284),x=n(53459),g=n(62042),v=n(7523),j=n(78247),f=n(23430),y=n(52671),w=n(14944),b=n(92275),C=n(88815),A=n(64694),k=n(45907),S=n(12721),I=n(24659),$=n(83277);function N(){const{t:e}=(0,s.Bd)(),{initUserInfo:t}=(0,o.useContext)(v.F),n=[e("编号"),e("url"),e("是否开启"),e("key"),"model",e("更多属性"),e("备注")],N=[e("编号"),e("本地目录"),e("自动加载"),e("备注")],[K,O]=(0,o.useState)([]),[L,M]=(0,o.useState)([]),[P,X]=(0,o.useState)([]),[D,T]=(0,o.useState)(null),R=(0,o.useRef)(),q=(0,o.useRef)(!1),H=(0,o.useRef)(!1),[F,V]=(0,o.useState)([]),[E,Y]=(0,o.useState)(!1),[B,G]=(0,o.useState)({}),[J,W]=(0,i.fp)(l.AG.prompt_card),[z,U]=(0,i.fp)(l.AG.user_base_info),[Z,Q]=(0,o.useState)(!1),ee=P.filter(e=>"http"!==(e.transport??"stdio")),te=P.filter(e=>"http"===e.transport),ne=[e("编号"),e("名称"),e("是否开启"),e("状态"),"command","args","cwd",e("tools|env"),e("备注")],se=[e("编号"),e("名称"),e("是否开启"),e("状态"),e("endpoint"),e("tools|headers"),e("备注")],oe=[e("编号"),e("提示词"),e("LLM编辑开关"),e("llm_pmt"),e("编辑规则"),e("备注")],[ae,re]=(0,o.useState)([]),[ie,le]=(0,o.useState)(!1),ce=function(){const[e,t]=(0,i.fp)(l.AG.prompt_card);return e=>{t({open:!0,title:"信息",context_div:(0,h.jsx)("div",{children:(0,h.jsx)(u.default,{context:e})})})}}(),{check_user_auth:de}=(0,j.MH)(),[pe,me]=(0,i.fp)(l.AG.editorSetting),ue=(0,y.Zp)(),he=(0,k.y)(),_e=(0,I.K)(),xe=async()=>{const e=await _.jV.get("docs_on_get");e.code===x.m.Success&&Q(e.data)};(0,o.useEffect)(()=>{(async()=>{const e=await _.XO.get("ai_agent_setting");e.code===x.m.Success&&O(e.data.models),await w.ws.addMsg(b.HK.ai_load_info,e=>{T(e.context)});const t=await w.ws.sendData(b.HK.ai_load_info,{});t?.context&&T(t.context);const n=await _.XO.get("ai_docs_setting");n.code===x.m.Success&&(R.current=n.data.param,n.data.list?.length&&M(n.data.list));const s=await _.XO.get("ai_mcp_setting");s.code===x.m.Success&&X(s.data.list??[]),await we(),xe();const o=await _.XO.get("ai_system_prompts");o.code===x.m.Success&&re(o.data??[]);const a=await _.XO.get("ai_long_term_memory_setting");a.code===x.m.Success&&le(a.data?.open??!1)})()},[]),(0,o.useEffect)(()=>{w.ws.addMsg(b.HK.mcp_status,e=>{const t=e.context??{},n={};for(const e of t.status??[])n[e.index]={state:e.state,error:e.error,tool_count:e.tool_count};G(n),t.done&&we()})},[]);const ge=(e="stdio")=>{const t="http"===e?{name:"",open:!1,note:"",transport:"http",endpoint:"",headers:"",stream:!1,timeout_ms:1e4}:{name:"",open:!1,command:"",args:"",cwd:"",env:"",note:"",transport:"stdio",timeout_ms:1e4};X([...P,t]),q.current=!0},ve=e=>{const t=P.indexOf(e);t<0||(P.splice(t,1),X([...P]),q.current=!0)},je=e=>{X([...P,{...e,open:!1}]),q.current=!0},fe=async e=>{for(let e=0;e<K.length;e++)K[e].index=e;(await _.XO.post("ai_agent_setting/save",{models:e??K})).code===x.m.Success&&(0,g.SK)("保存成功")},ye=async e=>{for(let e=0;e<P.length;e++)P[e].index=e;(await _.XO.post("ai_mcp_setting/save",{list:e??P})).code===x.m.Success&&((0,g.SK)("保存成功"),q.current=!1,w.ws.sendData(b.HK.mcp_reload,{}))},we=async()=>{const e=await _.XO.get("ai_mcp_tools");return e.code===x.m.Success?(V(e.data??[]),e.data??[]):[]},be=async e=>{Y(!0);try{const t=await _.XO.post("ai_mcp_tools/reload",{index:e});if(t.code===x.m.Success)return await we(),(0,g.SK)("MCP工具加载成功"),t.data??null}finally{Y(!1)}return null},Ce=async(t,n,s,o)=>{const a=o??F.find(e=>e.index===n)??{index:n,key:`${n}`,name:t.name??"",note:t.note,transport:t.transport??"stdio",open:!!t.open,loaded:!1,tool_count:0,tools:[]},r=(a.tools??[]).map(t=>({id:t.runtime_name,title:t.tool_name,subtitle:t.description||e("无描述"),detail:t.display_name,meta:t.runtime_name}));W({open:!0,title:`${t.name||t.note||n} MCP工具`,context_div:(0,h.jsx)(S.O,{title:`${t.name||t.note||n} MCP工具`,subtitle:`${a.transport??"stdio"} | ${a.open?e("是"):e("否")} | ${a.loaded?"loaded":"idle"} | ${a.tool_count} tools`,pages:r,initialPageId:s,onRefresh:async()=>{const e=await be(n);e&&await Ce(t,n,s,e)},renderPage:t=>{if(!t)return(0,h.jsx)("div",{className:"prompt-switch-page__empty",children:e("暂无工具")});const n=a.tools?.find(e=>e.runtime_name===t.id);return n?(0,h.jsxs)("div",{className:"prompt-switch-page__detail",children:[(0,h.jsx)("div",{className:"prompt-switch-page__detail-title",children:n.display_name}),(0,h.jsx)("div",{className:"prompt-switch-page__detail-desc",children:n.description||e("无描述")}),(0,h.jsxs)("div",{className:"prompt-switch-page__detail-row",children:[(0,h.jsx)("strong",{children:"runtime:"})," ",n.runtime_name]}),(0,h.jsxs)("div",{children:[(0,h.jsx)("strong",{children:"schema:"}),(0,h.jsx)("pre",{className:"prompt-switch-page__schema",children:JSON.stringify(n.input_schema??{},null,2)})]})]}):(0,h.jsx)("div",{className:"prompt-switch-page__empty",children:e("暂无工具")})}}),cancel:()=>W({open:!1})})},Ae=t=>{const n=B[t];let s=n?.state,o=n?.error,a=n?.tool_count;if(!s){const e=F.find(e=>e.index===t);s=e?.state,o=e?.error,a=e?.tool_count}switch(s){case"loading":return(0,h.jsx)(m.fq,{loading:!0,text:e("加载中")});case"success":return(0,h.jsx)(m.fq,{success:!0,text:`${a??0} ${e("个工具")}`});case"failed":return(0,h.jsx)("span",{title:o??e("加载失败"),children:(0,h.jsx)(m.fq,{success:!1,text:e("加载失败")})});default:return(0,h.jsx)(m.fq,{text:e("未加载")})}},ke=async e=>{for(let e=0;e<K.length;e++)K[e].index=e;let t={list:L,docs_update_tag:H.current};null!=e&&(t={param:e}),H.current=!1;(await _.XO.post("ai_docs_setting_save",t)).code===x.m.Success&&(0,g.SK)("保存成功")},Se=async()=>{for(let e=0;e<ae.length;e++)ae[e].index=e;(await _.XO.post("ai_system_prompts/save",{list:ae})).code===x.m.Success&&(0,g.SK)("保存成功")};return(0,h.jsxs)("div",{children:[(0,h.jsx)(r.aZ,{position:"right",children:de(f.oV.ai_agent_setting)&&(0,h.jsx)(a.rA,{icon:"arrow_back",title:e("上一页"),onClick:()=>{ue(-1)}})}),(0,h.jsx)(c.jW,{isFull:!0,more:!0,children:(0,h.jsx)(c.NN,{children:(0,h.jsxs)(c.xh,{children:[(0,h.jsx)(c.fI,{children:(0,h.jsx)(c.VP,{widthPer:100,children:(0,h.jsx)(m.uF,{self_title:(0,h.jsxs)("span",{className:" div-row ",children:[(0,h.jsx)("h2",{children:e("Model")+" "+e("设置")})," ",(0,h.jsx)(a.rA,{icon:"info",onClick:()=>{ce('\n1. Only OpenAI-style AI APIs are supported. Fill in the FULL endpoint path (not just the domain), e.g. https://ark.cn-beijing.volces.com/api/v3/chat/completions\n2. The longer the conversation history, the more expensive the LLM token cost. Currently, there is no long-term memory simplification capability. You can set the system prompt to make the AI answer more concisely to save tokens\n3. When writing the model request parameter JSON, you can only write JSON in it, to configure the attributes supported by OpenAI-style AI, such as temperature, thinking (Doubao\'s deep thinking toggle), etc.\n4. You can enable "stream": true in the model request parameters to improve response speed.\n5. Deep thinking currently affects output speed. It is recommended to set { "thinking" : { "type":"disabled" } } to disable it (Doubao example).\n6. To use the AI feature to query server information, the AI needs to be able to know some commands. You need to first set command permissions for the user in user settings. It is recommended to set * to allow all commands, and then set the dangerous commands that are not allowed to be executed in the settings\n7. The model type and Become Tool are now both configured in "More Attributes → Extra Parameter Settings" using request_type / tool_mode (comments are already provided in the editor).\n8. After becoming a tool, the model will be loaded as a tool, enabling different models to serve as different roles; please do not set both it and "Enabled" to true at the same time.\n')},title:"信息"})]}),titleCom:(0,h.jsxs)("div",{children:[(0,h.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{O([...K,{note:"",open:!1,path:"",dotenv:$.CP,json_params:$.cL}])}}),(0,h.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{await fe()}})]}),children:(0,h.jsx)(d.X,{headers:n,onRowDrag:(e,t)=>{O((0,A.TI)(K,e,t))},rows:K.map((t,n)=>{const s=[(0,h.jsx)("div",{children:n}),(0,h.jsx)(p.Sm,{value:$.Lv.get_label_by_v(t.url,t.show_options?.options_agent_url_list),options:t.show_options?.options_agent_url_list,handleInputChange:e=>{t.url=e},no_border:!0}),(0,h.jsx)(p.l6,{value:t.open,onChange:e=>{((e,t,n)=>{const s=[];for(let e=0;e<K.length;e++)K[e].open=e===n&&t,s.push(K[e]);O(s)})(0,e,n)},options:_e,no_border:!0}),(0,h.jsx)(p.Sm,{type:$.Lv.have_label_by_v(t.token,t.show_options?.options_agent_key_list)?null:"password",value:$.Lv.get_label_by_v(t.token,t.show_options?.options_agent_key_list),options:t.show_options?.options_agent_key_list,handleInputChange:e=>{t.token=e},no_border:!0}),(0,h.jsx)(p.Sm,{value:$.Lv.get_label_by_v(t.model,t.show_options?.options_agent_model_list),options:t.show_options?.options_agent_model_list,handleInputChange:e=>{t.model=e},no_border:!0}),(0,h.jsxs)("div",{children:[(0,h.jsx)(a.rA,{icon:"short_text",title:"prompt",onClick:()=>{j.xK.set_value_temp(K[n].sys_prompt??""),me({model:"ace/mode/text",open:!0,fileName:"",save:async e=>{K[n].sys_prompt=e,O(K),j.xK.set_value_temp(""),fe(K)}})}}),(0,h.jsx)(a.rA,{icon:"edit_attributes",title:"model请求参数json编写",onClick:()=>{j.xK.set_value_temp(K[n].json_params),me({model:"ace/mode/json",open:!0,fileName:"",save:async e=>{K[n].json_params=e,O(K),j.xK.set_value_temp(""),fe(K)},can_format:!0})}}),(0,h.jsx)(a.rA,{icon:"settings",title:"额外参数设置",onClick:()=>{j.xK.set_value_temp(K[n].dotenv),me({model:"ace/mode/ini",open:!0,fileName:"",save:async e=>{K[n].dotenv=e,O(K),j.xK.set_value_temp(""),fe(K)}})}})]}),(0,h.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,h.jsxs)("div",{children:[(0,h.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{K.splice(e,1),O([...K])})(n)}),(0,h.jsx)(a.rA,{icon:"copy_all",title:e("复制"),onClick:()=>(e=>{O([...K,{...K[e],open:!1}])})(n)})]})];return s}),width:"10rem"})})})}),(0,h.jsx)(c.fI,{children:(0,h.jsx)(c.VP,{widthPer:70,children:(0,h.jsx)(m.uF,{self_title:(0,h.jsxs)("span",{className:" div-row ",children:[(0,h.jsxs)("h2",{children:[e("MCP")+" "+e("设置")," - stdio"]})," ",(0,h.jsx)(a.rA,{icon:"info",onClick:()=>{ce("\n1. 这里配置的是 MCP Client 启动参数,当前实现的是 stdio 模式,也就是通过 command + args 启动本地 MCP Server\n2. 例如可以填 npx / uvx / python 等命令,再配合对应的 MCP server 包参数\n3. 保存后会自动重新加载 MCP 工具,agent 聊天时会把这些工具一起带给模型\n4. 建议把 cwd 配到具体项目目录,避免 server 在错误目录里运行\n")},title:"信息"})]}),titleCom:(0,h.jsxs)("div",{children:[(0,h.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>ge("stdio")}),(0,h.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:()=>{ye()}})]}),children:(0,h.jsx)(d.X,{headers:ne,onRowDrag:(e,t)=>{X((0,A.TI)(P,P.indexOf(ee[e]),P.indexOf(ee[t]))),q.current=!0},rows:ee.map((t,n)=>{const s=P.indexOf(t);return[(0,h.jsx)("div",{children:n}),(0,h.jsx)(p.Sm,{value:t.name,handleInputChange:e=>{t.name=e,q.current=!0},no_border:!0}),(0,h.jsx)(p.l6,{value:t.open,onChange:e=>{t.open=e,X([...P]),q.current=!0},options:_e,no_border:!0}),Ae(P.indexOf(t)),(0,h.jsx)(p.Sm,{value:t.command,handleInputChange:e=>{t.command=e,q.current=!0},no_border:!0}),(0,h.jsx)(p.Sm,{value:t.args,handleInputChange:e=>{t.args=e,q.current=!0},no_border:!0}),(0,h.jsx)(p.Sm,{value:t.cwd,handleInputChange:e=>{t.cwd=e,q.current=!0},no_border:!0}),(0,h.jsxs)("div",{children:[(0,h.jsx)(a.rA,{icon:"visibility",title:"查看工具",onClick:()=>{Ce(t,s)}}),(0,h.jsx)(a.rA,{icon:"settings",title:"env",onClick:()=>{j.xK.set_value_temp(t.env??""),me({model:"ace/mode/ini",open:!0,fileName:"",save:async e=>{t.env=e,X([...P]),j.xK.set_value_temp(""),q.current=!0,ye()}})}})]}),(0,h.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e,q.current=!0},no_border:!0}),(0,h.jsxs)("div",{children:[(0,h.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>ve(t)}),(0,h.jsx)(a.rA,{icon:"copy_all",title:e("复制"),onClick:()=>je(t)})]})]}),width:"10rem"})})})}),(0,h.jsx)(c.fI,{children:(0,h.jsxs)(c.VP,{widthPer:70,children:[(0,h.jsx)(m.uF,{self_title:(0,h.jsxs)("span",{className:" div-row ",children:[(0,h.jsxs)("h2",{children:[e("MCP")+" "+e("设置")," - HTTP"]})," "]}),titleCom:(0,h.jsxs)("div",{children:[(0,h.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>ge("http")}),(0,h.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:()=>{ye()}})]}),children:(0,h.jsx)(d.X,{headers:se,onRowDrag:(e,t)=>{X((0,A.TI)(P,P.indexOf(te[e]),P.indexOf(te[t]))),q.current=!0},rows:te.map((t,n)=>{const s=P.indexOf(t);return[(0,h.jsx)("div",{children:n}),(0,h.jsx)(p.Sm,{value:t.name,handleInputChange:e=>{t.name=e,q.current=!0},no_border:!0}),(0,h.jsx)(p.l6,{value:t.open,onChange:e=>{t.open=e,X([...P]),q.current=!0},options:_e,no_border:!0}),Ae(P.indexOf(t)),(0,h.jsx)(p.Sm,{value:t.endpoint,handleInputChange:e=>{t.endpoint=e,q.current=!0},no_border:!0}),(0,h.jsxs)("div",{children:[(0,h.jsx)(a.rA,{icon:"visibility",title:"查看工具",onClick:()=>{Ce(t,s)}}),(0,h.jsx)(a.rA,{icon:"settings",title:"headers",onClick:()=>{j.xK.set_value_temp(t.headers??""),me({model:"ace/mode/ini",open:!0,fileName:"",save:async e=>{t.headers=e,X([...P]),j.xK.set_value_temp(""),q.current=!0,ye()}})}})]}),(0,h.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e,q.current=!0},no_border:!0}),(0,h.jsxs)("div",{children:[(0,h.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>ve(t)}),(0,h.jsx)(a.rA,{icon:"copy_all",title:e("复制"),onClick:()=>je(t)})]})]}),width:"10rem"})}),(0,h.jsx)(m.uF,{self_title:(0,h.jsxs)("span",{className:" div-row ",children:[(0,h.jsx)("h2",{children:e("系统会话提示词")})," ",(0,h.jsx)(a.rA,{icon:"info",onClick:()=>{ce('\n1. 系统会话提示词,在 AI 聊天页创建会话时可以选择,选中的提示词会自动填入聊天框作为第一条系统消息\n2. 适用于预先设定常用的会话场景模板,如"代码审查"、"翻译助手"、"运维诊断"等\n3. "LLM编辑开关":开启后,当用户选择了该系统提示词发起对话时,AI 将会获得一个"更新会话提示词"工具,允许 AI 在对话中对当前会话进行总结,并写入到本提示词的"LLM编辑提示词"字段(全局保存,供之后的新会话沿用),使 AI 能自我维护长期上下文。\n4. "LLM编辑提示词":可选。AI 编辑后写回的内容(可预填初始方向)。仅在"LLM编辑开关"开启时生效。\n5. "编辑规则":可选。给 LLM 的编辑要求,例如"总结时不要超过 300 token"、"用简洁的项目要点记录"等。仅在"LLM编辑开关"开启时生效。\n')},title:"信息"})]}),titleCom:(0,h.jsxs)("div",{children:[(0,h.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{re([...ae,{prompt:"",note:"",llm_prompt_enable:!1}])}}),(0,h.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:()=>{Se()}})]}),children:(0,h.jsx)(d.X,{headers:oe,onRowDrag:(e,t)=>{re((0,A.TI)(ae,e,t))},rows:ae.map((t,n)=>{const s=[(0,h.jsx)("div",{children:n}),(0,h.jsx)("div",{children:(0,h.jsx)(a.rA,{icon:"short_text",title:e("提示词"),onClick:()=>{j.xK.set_value_temp(t.prompt??""),me({model:"ace/mode/text",open:!0,fileName:"",save:async e=>{t.prompt=e,re([...ae]),j.xK.set_value_temp(""),Se()}})}})}),(0,h.jsx)(a.Ay,{checked:!!t.llm_prompt_enable,onChange:e=>{t.llm_prompt_enable=e,re([...ae])},title:e("LLM编辑开关")}),(0,h.jsx)("div",{children:(0,h.jsx)(a.rA,{icon:"edit_note",title:e("llm_pmt"),onClick:()=>{j.xK.set_value_temp(t.llm_prompt??""),me({model:"ace/mode/text",open:!0,fileName:"",save:async e=>{t.llm_prompt=e,re([...ae]),j.xK.set_value_temp(""),Se()}})}})}),(0,h.jsx)("div",{children:(0,h.jsx)(a.rA,{icon:"rule",title:e("编辑规则"),onClick:()=>{j.xK.set_value_temp(t.llm_prompt_tip??""),me({model:"ace/mode/text",open:!0,fileName:"",save:async e=>{t.llm_prompt_tip=e,re([...ae]),j.xK.set_value_temp(""),Se()}})}})}),(0,h.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,h.jsx)("div",{children:(0,h.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{ae.splice(e,1),re([...ae])})(n)})})];return s}),width:"10rem"})}),(0,h.jsx)(m.uF,{self_title:(0,h.jsxs)("span",{className:" div-row ",children:[(0,h.jsx)("h2",{children:e("长期记忆")})," ",(0,h.jsx)(a.rA,{icon:"info",onClick:()=>{ce(e("开启后跨会话保存记忆。四个固定文件:周/月/年/永久。每周结束自动压缩周→月,每月结束自动压缩月→年,每年结束自动压缩年→永久。编辑按钮可手动查看和修改。"))},title:"信息"})]}),titleCom:(0,h.jsx)("div",{children:(0,h.jsx)(a.Ay,{checked:ie,onChange:async t=>{le(t),await _.XO.post("ai_long_term_memory_setting/save",{open:t}),(0,g.SK)(e("长期记忆设置已保存"))},title:e("开关")})}),children:(0,h.jsx)("div",{style:{display:"flex",gap:"0.5rem",padding:"0.5rem 0",flexWrap:"wrap"},children:[{type:"week",label:e("周记忆"),tip:e("上限3000字")},{type:"month",label:e("月记忆"),tip:e("上限6000字")},{type:"year",label:e("年记忆"),tip:e("上限9000字")},{type:"forever",label:e("永久记忆"),tip:e("上限12000字")}].map(({type:t,label:n,tip:s})=>(0,h.jsx)(a.rA,{icon:"edit",title:`${e("编辑")} ${n} (${s})`,onClick:async()=>{const s=await _.XO.get(`ai_long_term_memory_bucket/${t}`),o=s.code===x.m.Success?s.data??"":"";j.xK.set_value_temp(o),me({model:"ace/mode/text",open:!0,fileName:`long_term_memory_${t}.txt`,save:async s=>{await _.XO.post(`ai_long_term_memory_bucket/${t}/save`,{data:s}),j.xK.set_value_temp(""),(0,g.SK)(`${n} ${e("已保存")}`)}})}},t))})})]})}),(0,h.jsxs)(c.fI,{children:[(0,h.jsx)(c.VP,{widthPer:50,children:(0,h.jsx)(m.uF,{self_title:(0,h.jsxs)("span",{className:" div-row ",children:[(0,h.jsx)("h2",{children:e("本地知识库")})," ",(0,h.jsx)(a.rA,{icon:"info",onClick:()=>{ce("\n1. 本地知识库用于为AI增强理解能力,或者分析本地文件,原理读取本地的文件,对文件在内存中建立全文索引,为AI提供额外数据(需要有模型开启才能使用)\n2. 该功能只能用于小型知识库,作为本地小型或者公司内部资料使用还是没有问题的\n3. 每次保存都会重新加载知识库中的文件,不会全部重新加载,而是检测哪些文件有变更\n")},title:"信息"})]}),titleCom:(0,h.jsxs)("div",{children:[(0,h.jsx)(a.Ay,{checked:Z,onChange:async e=>{await _.jV.post("docs_on_set",{status:e}),xe(),t()},title:e("知识库开关")}),(0,h.jsx)(a.rA,{icon:"settings",title:"额外参数设置",onClick:()=>{j.xK.set_value_temp(R.current),me({model:"ace/mode/ini",open:!0,fileName:"",save:async e=>{R.current=e,j.xK.set_value_temp(""),ke(R.current)}})}}),(0,h.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{M([...L,{note:"",auto_load:!1,dir:""}]),H.current=!0}}),(0,h.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:()=>{ke()}})]}),children:(0,h.jsx)(d.X,{headers:N,onRowDrag:(e,t)=>{M((0,A.TI)(L,e,t)),H.current=!0},rows:L.map((t,n)=>{const s=[(0,h.jsx)("div",{children:n}),(0,h.jsx)(p.Sm,{value:t.dir,handleInputChange:e=>{t.dir=e,H.current=!0},no_border:!0}),(0,h.jsx)(p.l6,{value:t.auto_load,onChange:e=>{t.auto_load=e,M([...L]),H.current=!0},options:_e,no_border:!0}),(0,h.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,h.jsxs)("div",{children:[(0,h.jsx)(a.rA,{icon:"delete",title:e("删除记录"),onClick:()=>(e=>{L.splice(e,1),M([...L]),H.current=!0})(n)}),(0,h.jsx)(a.rA,{icon:"restore",title:e("手动加载"),onClick:()=>{he({sub_title:"手动加载",confirm_fun:()=>{_.jV.post("ai_load_one_file",{param_path:t.dir}),(0,g.SK)("ok")}})}}),(0,h.jsx)(a.rA,{icon:"delete_forever",title:e("从索引删除"),onClick:()=>{he({sub_title:"从索引删除",confirm_fun:()=>{_.jV.post("ai_del",{param_path:t.dir}),(0,g.SK)("ok")}})}})]})];return s}),width:"10rem"})})}),D&&(0,h.jsx)(c.VP,{widthPer:50,children:(0,h.jsxs)(m.Zp,{title:e("知识库加载信息"),children:[(0,h.jsx)(c.Yh,{left:e("最近一次加载")+","+e("加载进度"),right:D?.progress}),(0,h.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总文件数量")}`,right:D?.num}),(0,h.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总文件字符数量")}`,right:D?.char_num}),(0,h.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总文件大小")}`,right:(0,C.v7)(D?.size)}),(0,h.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总耗时")}`,right:(0,C.a3)(D?.consume_time_ms_len)}),(0,h.jsx)(c.Yh,{left:`${e("总文件数量")}`,right:D?.total_num})]})})]})]})})})]})}},34299(e,t,n){n.r(t),n.d(t,{default:()=>y});var s=n(96540),o=n(23802),a=n(53995),r=n(18569),i=n(77979),l=n(8263),c=n(69428),d=n.n(c),p=(n(3775),n(21499)),m=n(99214),u=n(89117),h=n(89334),_=n(41105),x=n(52388),g=n(19878),v=(n(72411),n(74848));const j=new o.A({html:!0,highlight:function(e,t){if(t&&g.A.getLanguage(t))try{return`<pre class="hljs code-block-with-copy"><code class="hljs language-${t}">${g.A.highlight(e,{language:t}).value}</code></pre>`}catch(e){}try{return`<pre class="hljs code-block-with-copy"><code class="hljs">${g.A.highlightAuto(e).value}</code></pre>`}catch(e){}return`<pre class="hljs code-block-with-copy"><code>${j.utils.escapeHtml(e)}</code></pre>`}});function f(e){const t=e.className.match(/language-([\w-]+)/);return t?t[1]:""}function y(e){const t=(0,s.useRef)(null);return(0,m.VD)(),(0,s.useEffect)(()=>{t.current&&(!async function(e){const t=e.querySelectorAll("pre > code[class*='language-']");for(const e of Array.from(t)){const t=f(e);if(!(0,u.Hm)(t))continue;const n=e.closest(".code-block-with-copy")??e.parentElement;if(!n)continue;const s=e.textContent??"",o=document.createElement("div");o.className="md-graph md-graph--loading",o.textContent=x.A.t("rendering"),n.replaceWith(o);const a=await(0,u.U6)(t,s);o.isConnected&&(a.error?(o.className="md-graph md-graph--error",o.textContent=a.error):(o.className="md-graph",o.innerHTML=a.svg))}}(t.current),(0,h.rg)(t.current))},[e.context]),(0,v.jsx)("div",{ref:t,dangerouslySetInnerHTML:{__html:j.render(e.context)}})}j.use(a.A).use(r.A).use(i.A).use(l.A).use(d()).use(e=>{e.renderer.rules.fence;e.renderer.rules.fence=(t,n,s,o,a)=>{const r=t[n],i=r.content.trim(),l=r.info.trim();let c="";if(l&&g.A.getLanguage(l))try{c=g.A.highlight(i,{language:l}).value}catch(t){c=e.utils.escapeHtml(i)}else try{c=g.A.highlightAuto(i).value}catch(t){c=e.utils.escapeHtml(i)}return`\n <div class="code-block-with-copy">\n <div class="code-header">\n <span class="code-language">${l||"code"}</span>\n <button class="copy-btn" data-code="${e.utils.escapeHtml(i)}">复制</button>\n </div>\n <pre><code class="hljs ${l?`language-${l}`:""}">${c}</code></pre>\n </div>`}}).use(e=>{const t=e.renderer.rules.link_open||function(e,t,n,s,o){return o.renderToken(e,t,n)};e.renderer.rules.link_open=(e,n,s,o,a)=>{const r=e[n],i=r.attrIndex("href");if(i>=0){const e=r.attrs[i][1];r.attrs[i][1]=(0,p.bi)(window.location.href,e)}return t(e,n,s,o,a)}}),(0,h.Rh)(j,_.pC)},24659(e,t,n){n.d(t,{K:()=>o});var s=n(22022);const o=()=>{const{t:e}=(0,s.Bd)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}},60840(e){e.exports="data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27 version=%271.1%27 aria-hidden=%27true%27><path fill-rule=%27evenodd%27 d=%27M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z%27></path></svg>"}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[8319],{77481(e,t,n){n.d(t,{S:()=>a,X:()=>i});var s=n(96540),r=n(61443),l=n(74848);function i(e){const[t,n]=s.useState([]),i=(0,s.useRef)(-1),[a,c]=(0,s.useState)(-1),[o,d]=(0,s.useState)(-1);(0,s.useEffect)(()=>{e.children?n(Array.isArray(e.children)?e.children:[e.children]):n(e.rows)},[e.rows,e.children]);const u=()=>{i.current=-1,c(-1),d(-1)};return(0,l.jsxs)("table",{children:[(0,l.jsx)("thead",{children:(0,l.jsx)("tr",{children:e.headers?.map((t,n)=>{const s=!!e.filter&&(e.filter.column??0)===n;let i=t;if(s){const n=e.filter,s=n.options.find(e=>e.value===n.value);null!=n.value&&s&&(i=`${t} (${s.label})`)}return(0,l.jsx)("th",{className:s?"table-filter-col":"",children:s?(0,l.jsx)(r.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:i}):t},n)})})}),(0,l.jsx)("tbody",{children:t.map((t,n)=>{const s=!!e.onRowDrag;return(0,l.jsx)("tr",{className:s?(a===n?"row-dragging":"")+(o===n?" row-drop-target":""):"",draggable:s,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{s&&(i.current=n,c(n),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!s||i.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(n))},onDrop:t=>{s&&(t.preventDefault(),(()=>{const t=i.current,n=o;u(),t<0||n<0||t===n||e.onRowDrag?.(t,n)})())},onDragEnd:u,children:t.map((n,s)=>{const r=s===t.length-1?"small":"";return(0,l.jsx)("td",{className:r,style:{width:e.width??"auto"},children:n},s)})},n)})})]})}function a(e){return(0,l.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,l.jsx)("div",{children:e},t))})}},28319(e,t,n){n.r(t),n.d(t,{default:()=>C,defaultSqlPreset:()=>w,sqlEnvDefault:()=>S});var s=n(96540),r=n(22022),l=n(4412),i=n(85997),a=n(75725),c=n(77481),o=n(70447),d=n(61443),u=n(34843),h=n(82893),x=n(14284),f=n(23496),p=n(53459),j=n(62042),v=n(7523),m=n(78247),_=n(52671),g=n(74848);function w(e){return{index:0,note:e("查询全部表"),sql:"SELECT name, type FROM sqlite_master WHERE type='table';"}}const S='# 可选:设置 SQL 中的"替换词"(在查询页选中该预设后,会显示输入框)\n# 例子:SQL 为 SELECT * FROM t WHERE id = 123456 ,请填写下面的 find=123456\n# 这样查询页输入新值即可把 SQL 中的 123456 替换掉后再查询\nfind=';function C(){const{t:e}=(0,r.Bd)(),{initUserInfo:t}=(0,s.useContext)(v.F),[,n]=(0,u.fp)(h.AG.editorSetting),[C]=(0,u.fp)(h.AG.user_base_info),b=(0,_.Zp)(),q=s.useRef(-1),[E,k]=(0,s.useState)([]);(0,s.useEffect)(()=>{const t=C?.user_data?.sql_preset_list;k(t?.length?[...t]:[w(e)])},[e,C?.user_data?.sql_preset_list]);const y=async()=>{const n=E.map((e,t)=>({...e,index:t})),s=await x.wm.post(f.s.user_save_private_attr,{is_sql_preset:!0,sql_preset_list:n});s?.code===p.m.Success&&(await t(),(0,j.SK)(e("保存成功")))},A=(e,t)=>{q.current=e;const s=E[e][t]??"";m.xK.set_value_temp(s),n({model:"sql"===t?"ace/mode/sql":"ace/mode/ini",open:!0,fileName:"",save:async e=>{E[q.current][t]=e,k([...E]),m.xK.set_value_temp(""),y()}})},D=[e("编号"),e("备注"),e("SQL代码"),e("env编辑"),e("操作")];return(0,g.jsxs)("div",{children:[(0,g.jsx)(l.aZ,{position:"right",children:(0,g.jsx)(i.rA,{icon:"arrow_back",title:e("返回"),onClick:()=>b(-1)})}),(0,g.jsx)(a.jW,{isFull:!0,more:!0,children:(0,g.jsx)(a.NN,{children:(0,g.jsx)(a.xh,{children:(0,g.jsx)(a.fI,{children:(0,g.jsx)(a.VP,{widthPer:60,children:(0,g.jsx)(o.uF,{self_title:(0,g.jsx)("span",{className:"div-row",children:(0,g.jsx)("h2",{children:e("SQL 预设")})}),titleCom:(0,g.jsxs)("div",{className:"db-query-setting__toolbar",children:[(0,g.jsx)(i.rA,{icon:"add",title:e("添加"),onClick:()=>k([...E,{note:"",sql:"",env:S}])}),(0,g.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:()=>y()})]}),children:(0,g.jsx)(c.X,{headers:D,rows:E.map((t,n)=>[(0,g.jsx)("div",{children:n+1}),(0,g.jsx)(d.Sm,{value:t.note,no_border:!0,placeholder:e("备注"),handleInputChange:e=>{t.note=e,k([...E])}}),(0,g.jsx)("div",{children:(0,g.jsx)(i.rA,{icon:"short_text",title:e("编辑SQL"),onClick:()=>A(n,"sql")})}),(0,g.jsx)("div",{children:(0,g.jsx)(i.rA,{icon:"settings",title:e("env编辑"),onClick:()=>A(n,"env")})}),(0,g.jsx)("div",{children:(0,g.jsx)(i.rA,{icon:"delete",title:e("删除"),onClick:()=>{E.splice(n,1),k([...E])}})})]),width:"8rem"})})})})})})})]})}}}]);