@glodon-aiot/agent-cli-ui 3.7.0-alpha.3 → 3.9.0-alpha.5

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.
@@ -1,33 +1,41 @@
1
- import { KB as o, MB as c, GB as s } from "../constant.mjs";
2
- const m = (e) => {
1
+ import { KB as s, MB as a, GB as p } from "../constant.mjs";
2
+ const d = (e) => {
3
3
  if (e)
4
4
  return e.split(".").pop();
5
- }, d = (e) => {
6
- var t = e.match(/^.*\.(jpg|jpeg|png|bmp|JPG|JPEG|PNG|BMP)$/);
7
- return t ? t[1] : null;
8
- }, l = (e) => e < o ? e + " B" : e < c ? (e / o).toFixed(1) + " KB" : e < s ? (e / c).toFixed(1) + " MB" : (e / s).toFixed(1) + " GB", x = (e) => e == null ? void 0 : e.replace(/[\r\n]+/gm, ""), g = (e) => new Promise((t, r) => {
9
- const n = new FileReader();
10
- n.readAsDataURL(e), n.onload = () => t(n.result), n.onerror = (a) => r(a);
11
- }), p = (e) => JSON.parse(window.atob(e.split(".")[1])), w = (e) => {
12
- const t = p(e).exp;
13
- return (/* @__PURE__ */ new Date()).valueOf() / 1e3 >= t;
5
+ }, m = (e) => {
6
+ var n = e.match(/^.*\.(jpg|jpeg|png|bmp|JPG|JPEG|PNG|BMP)$/);
7
+ return n ? n[1] : null;
8
+ }, g = (e) => e < s ? e + " B" : e < a ? (e / s).toFixed(1) + " KB" : e < p ? (e / a).toFixed(1) + " MB" : (e / p).toFixed(1) + " GB", x = (e) => e == null ? void 0 : e.replace(/[\r\n]+/gm, ""), f = (e) => new Promise((n, r) => {
9
+ const t = new FileReader();
10
+ t.readAsDataURL(e), t.onload = () => n(t.result), t.onerror = (o) => r(o);
11
+ }), i = (e) => JSON.parse(window.atob(e.split(".")[1])), w = (e) => {
12
+ const n = i(e).exp;
13
+ return (/* @__PURE__ */ new Date()).valueOf() / 1e3 >= n;
14
14
  };
15
- var i = /* @__PURE__ */ ((e) => (e.NETWORK = "请你优先从网络中搜索", e.DOCUMENT = "请你优先从以上文件中搜索", e))(i || {});
16
- const B = 100, E = (e) => /^https?:\/\/.*?\..+$/.test(e), f = ["application/pdf", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/msword", "application/wps-office.docx"];
17
- function T(e) {
15
+ var u = /* @__PURE__ */ ((e) => (e.NETWORK = "请你优先从网络中搜索", e.DOCUMENT = "请你优先从以上文件中搜索", e))(u || {});
16
+ const B = 100, E = (e) => /^https?:\/\/.*?\..+$/.test(e), T = ["application/pdf", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/msword", "application/wps-office.docx"];
17
+ function F(e) {
18
18
  return e.replace(/([\\])/g, "\\$1");
19
19
  }
20
+ function N(e) {
21
+ return e.reduce((n, r) => {
22
+ var o, c;
23
+ const t = (c = (o = r.fileIds) == null ? void 0 : o.length) != null ? c : 0;
24
+ return n + (t > 0 ? t : 1);
25
+ }, 0);
26
+ }
20
27
  export {
21
28
  B as FILE_NAME_MAX_LENGTH,
22
- p as JWT,
23
- T as escapeSlash,
24
- f as fileTypes,
25
- l as formatFileSize,
26
- g as getBase64,
27
- m as getFileExtension,
28
- d as getImageExtension,
29
+ i as JWT,
30
+ N as calcKnowledgesLeafCount,
31
+ F as escapeSlash,
32
+ T as fileTypes,
33
+ g as formatFileSize,
34
+ f as getBase64,
35
+ d as getFileExtension,
36
+ m as getImageExtension,
29
37
  w as isExpired,
30
38
  E as isValidImageUrlWithAnyExtension,
31
39
  x as removeNewlines,
32
- i as shortCutEnum
40
+ u as shortCutEnum
33
41
  };