@fses/workbench-app 0.2.3 → 0.2.6

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,24 +1,24 @@
1
- import { toRefs as ne, shallowReadonly as W, inject as oe, defineComponent as E, provide as ae, openBlock as b, createElementBlock as I, renderSlot as g, createElementVNode as A, normalizeClass as q, normalizeStyle as R, withModifiers as se, createCommentVNode as P, createVNode as z, Transition as ie, withCtx as w, computed as de, createBlock as K, defineAsyncComponent as ce, unref as le } from "vue";
1
+ import { toRefs as te, shallowReadonly as W, inject as oe, defineComponent as E, provide as ae, openBlock as b, createElementBlock as k, renderSlot as g, createElementVNode as A, normalizeClass as q, normalizeStyle as R, withModifiers as se, createCommentVNode as P, createVNode as z, Transition as ie, withCtx as w, computed as de, createBlock as K, defineAsyncComponent as ce, unref as le } from "vue";
2
2
  import "./canvasFacade-B0oy__da.js";
3
- import "./useWorkbenchRuntime-Ch8lqkjO.js";
3
+ import { b as ue } from "./useWorkbenchRuntime-Ci-QDnAY.js";
4
4
  import "./cardFactory-CoDF-zsR.js";
5
5
  import "./workbenchCustomComponentRegistry-6GHzavdM.js";
6
6
  const G = Symbol("workbench-app-context");
7
- function ue(e) {
8
- const { adapters: r, config: t, extensions: n } = ne(e);
7
+ function fe(e) {
8
+ const { adapters: r, config: n, extensions: t } = te(e);
9
9
  return {
10
10
  adapters: W(r),
11
- config: W(t),
12
- extensions: W(n)
11
+ config: W(n),
12
+ extensions: W(t)
13
13
  };
14
14
  }
15
- function er() {
15
+ function rr() {
16
16
  const e = oe(G);
17
17
  if (!e)
18
18
  throw new Error("useWorkbenchAppContext must be used inside WorkbenchWorkspaceCore");
19
19
  return e;
20
20
  }
21
- const fe = { class: "fses-workbench-app" }, me = /* @__PURE__ */ E({
21
+ const me = { class: "fses-workbench-app" }, he = /* @__PURE__ */ E({
22
22
  __name: "WorkbenchWorkspaceCore",
23
23
  props: {
24
24
  adapters: {},
@@ -26,11 +26,11 @@ const fe = { class: "fses-workbench-app" }, me = /* @__PURE__ */ E({
26
26
  extensions: {}
27
27
  },
28
28
  setup(e) {
29
- return ae(G, ue(e)), (t, n) => (b(), I("div", fe, [
30
- g(t.$slots, "default")
29
+ return ae(G, fe(e)), (n, t) => (b(), k("div", me, [
30
+ g(n.$slots, "default")
31
31
  ]));
32
32
  }
33
- }), he = { class: "workbench-shell" }, pe = ["aria-hidden", "inert"], ge = { class: "workbench-studio-panel__body" }, L = 48, ye = /* @__PURE__ */ E({
33
+ }), pe = { class: "workbench-shell" }, ge = ["aria-hidden", "inert"], ye = { class: "workbench-studio-panel__body" }, L = 48, be = /* @__PURE__ */ E({
34
34
  __name: "WorkbenchShell",
35
35
  props: {
36
36
  studioPanelWidth: {},
@@ -44,8 +44,8 @@ const fe = { class: "fses-workbench-app" }, me = /* @__PURE__ */ E({
44
44
  },
45
45
  emits: ["startDrag"],
46
46
  setup(e, { emit: r }) {
47
- const t = r;
48
- return (n, o) => (b(), I("div", he, [
47
+ const n = r;
48
+ return (t, o) => (b(), k("div", pe, [
49
49
  A("div", {
50
50
  class: q(["workbench-shell__body", { "workbench-shell__body--dragging": e.dragging }])
51
51
  }, [
@@ -55,60 +55,60 @@ const fe = { class: "fses-workbench-app" }, me = /* @__PURE__ */ E({
55
55
  flexBasis: e.drawerOpen ? `calc(100% - ${e.drawerWidth || 392}px)` : e.canvasFocusMode || !e.studioPanelEnabled ? "100%" : e.studioPanelCollapsed ? `calc(100% - ${L}px)` : `calc(100% - ${e.studioPanelWidth}px - 8px)`
56
56
  })
57
57
  }, [
58
- g(n.$slots, "left", {}, void 0, !0)
58
+ g(t.$slots, "left", {}, void 0, !0)
59
59
  ], 4),
60
- e.studioPanelEnabled && !e.studioPanelCollapsed && !e.canvasFocusMode && !e.drawerOpen ? (b(), I("div", {
60
+ e.studioPanelEnabled && !e.studioPanelCollapsed && !e.canvasFocusMode && !e.drawerOpen ? (b(), k("div", {
61
61
  key: 0,
62
62
  "aria-orientation": "vertical",
63
63
  "aria-label": "调整问数栏宽度",
64
64
  class: "workbench-splitter",
65
65
  role: "separator",
66
- onPointerdown: o[0] || (o[0] = (d) => t("startDrag", d)),
66
+ onPointerdown: o[0] || (o[0] = (d) => n("startDrag", d)),
67
67
  onDragstart: o[1] || (o[1] = se(() => {
68
68
  }, ["prevent"]))
69
69
  }, [...o[2] || (o[2] = [
70
70
  A("div", { class: "workbench-splitter__track" }, null, -1)
71
71
  ])], 32)) : P("", !0),
72
- e.studioPanelEnabled && !e.canvasFocusMode && !e.drawerOpen ? (b(), I("div", {
72
+ e.studioPanelEnabled && !e.canvasFocusMode && !e.drawerOpen ? (b(), k("div", {
73
73
  key: 1,
74
74
  class: q(["workbench-studio-panel", { "workbench-studio-panel--collapsed": e.studioPanelCollapsed }]),
75
75
  style: R({ flexBasis: e.studioPanelCollapsed ? "0px" : `${e.studioPanelWidth}px` }),
76
76
  "aria-hidden": e.studioPanelCollapsed ? "true" : void 0,
77
77
  inert: e.studioPanelCollapsed ? !0 : void 0
78
78
  }, [
79
- A("div", ge, [
80
- g(n.$slots, "right", {}, void 0, !0)
79
+ A("div", ye, [
80
+ g(t.$slots, "right", {}, void 0, !0)
81
81
  ])
82
- ], 14, pe)) : P("", !0),
82
+ ], 14, ge)) : P("", !0),
83
83
  z(ie, { name: "workbench-assistant-rail-shell" }, {
84
84
  default: w(() => [
85
- e.studioPanelEnabled && e.studioPanelCollapsed && !e.canvasFocusMode && !e.drawerOpen ? (b(), I("div", {
85
+ e.studioPanelEnabled && e.studioPanelCollapsed && !e.canvasFocusMode && !e.drawerOpen ? (b(), k("div", {
86
86
  key: 0,
87
87
  class: "workbench-assistant-rail-shell",
88
88
  style: R({ flexBasis: `${L}px` }),
89
89
  "aria-label": "收起状态问数助手入口"
90
90
  }, [
91
- g(n.$slots, "collapsed-right", {}, void 0, !0)
91
+ g(t.$slots, "collapsed-right", {}, void 0, !0)
92
92
  ], 4)) : P("", !0)
93
93
  ]),
94
94
  _: 3
95
95
  }),
96
- e.drawerOpen ? (b(), I("div", {
96
+ e.drawerOpen ? (b(), k("div", {
97
97
  key: 2,
98
98
  class: "workbench-shell__drawer",
99
99
  style: R({ flexBasis: `${e.drawerWidth || 392}px` })
100
100
  }, [
101
- g(n.$slots, "drawer", {}, void 0, !0)
101
+ g(t.$slots, "drawer", {}, void 0, !0)
102
102
  ], 4)) : P("", !0)
103
103
  ], 2)
104
104
  ]));
105
105
  }
106
- }), be = (e, r) => {
107
- const t = e.__vccOpts || e;
108
- for (const [n, o] of r)
109
- t[n] = o;
110
- return t;
111
- }, we = /* @__PURE__ */ be(ye, [["__scopeId", "data-v-352c4f8f"]]), rr = /* @__PURE__ */ E({
106
+ }), we = (e, r) => {
107
+ const n = e.__vccOpts || e;
108
+ for (const [t, o] of r)
109
+ n[t] = o;
110
+ return n;
111
+ }, Ie = /* @__PURE__ */ we(be, [["__scopeId", "data-v-352c4f8f"]]), nr = /* @__PURE__ */ E({
112
112
  __name: "WorkbenchAppHost",
113
113
  props: {
114
114
  adapters: {},
@@ -117,7 +117,7 @@ const fe = { class: "fses-workbench-app" }, me = /* @__PURE__ */ E({
117
117
  runtime: {}
118
118
  },
119
119
  setup(e) {
120
- const r = e, t = de(() => ({
120
+ const r = e, n = de(() => ({
121
121
  canvasFocusMode: r.runtime.canvasFocusMode ?? !1,
122
122
  drawerOpen: r.runtime.drawerOpen ?? !1,
123
123
  drawerWidth: r.runtime.drawerWidth,
@@ -127,37 +127,37 @@ const fe = { class: "fses-workbench-app" }, me = /* @__PURE__ */ E({
127
127
  studioPanelEnabled: r.runtime.studioPanelEnabled ?? !0,
128
128
  studioPanelWidth: r.runtime.studioPanelWidth ?? 420
129
129
  }));
130
- return (n, o) => (b(), K(me, {
130
+ return (t, o) => (b(), K(he, {
131
131
  adapters: r.adapters,
132
132
  config: r.config,
133
133
  extensions: r.extensions
134
134
  }, {
135
135
  default: w(() => [
136
- z(we, {
137
- "canvas-focus-mode": t.value.canvasFocusMode,
138
- "drawer-open": t.value.drawerOpen,
139
- "drawer-width": t.value.drawerWidth,
140
- dragging: t.value.dragging,
141
- "image-workbench": t.value.imageWorkbench,
142
- "studio-panel-collapsed": t.value.studioPanelCollapsed,
143
- "studio-panel-enabled": t.value.studioPanelEnabled,
144
- "studio-panel-width": t.value.studioPanelWidth,
136
+ z(Ie, {
137
+ "canvas-focus-mode": n.value.canvasFocusMode,
138
+ "drawer-open": n.value.drawerOpen,
139
+ "drawer-width": n.value.drawerWidth,
140
+ dragging: n.value.dragging,
141
+ "image-workbench": n.value.imageWorkbench,
142
+ "studio-panel-collapsed": n.value.studioPanelCollapsed,
143
+ "studio-panel-enabled": n.value.studioPanelEnabled,
144
+ "studio-panel-width": n.value.studioPanelWidth,
145
145
  onStartDrag: o[0] || (o[0] = (d) => {
146
146
  var h, y;
147
147
  return (y = (h = r.runtime).startStudioPanelDrag) == null ? void 0 : y.call(h, d);
148
148
  })
149
149
  }, {
150
150
  left: w(() => [
151
- g(n.$slots, "left")
151
+ g(t.$slots, "left")
152
152
  ]),
153
153
  right: w(() => [
154
- g(n.$slots, "right")
154
+ g(t.$slots, "right")
155
155
  ]),
156
156
  "collapsed-right": w(() => [
157
- g(n.$slots, "collapsed-right")
157
+ g(t.$slots, "collapsed-right")
158
158
  ]),
159
159
  drawer: w(() => [
160
- g(n.$slots, "drawer")
160
+ g(t.$slots, "drawer")
161
161
  ]),
162
162
  _: 3
163
163
  }, 8, ["canvas-focus-mode", "drawer-open", "drawer-width", "dragging", "image-workbench", "studio-panel-collapsed", "studio-panel-enabled", "studio-panel-width"])
@@ -166,27 +166,27 @@ const fe = { class: "fses-workbench-app" }, me = /* @__PURE__ */ E({
166
166
  }, 8, ["adapters", "config", "extensions"]));
167
167
  }
168
168
  });
169
- let N = {}, Y = {}, J = {};
169
+ let v = {}, Y = {}, J = {};
170
170
  function ke(e) {
171
- N = e;
171
+ v = e;
172
172
  }
173
- function Ie(e, r, t) {
174
- Y = e, J = r, ke(t);
173
+ function Se(e, r, n) {
174
+ Y = e, J = r, ke(n);
175
175
  }
176
176
  function tr() {
177
177
  return Y;
178
178
  }
179
- function nr() {
180
- return J;
181
- }
182
179
  function or() {
183
- return N;
180
+ return J;
184
181
  }
185
182
  function ar() {
183
+ return v;
184
+ }
185
+ function sr() {
186
186
  var e;
187
- return (e = N.fde) == null ? void 0 : e.generatedTemplateShell;
187
+ return (e = v.fde) == null ? void 0 : e.generatedTemplateShell;
188
188
  }
189
- const sr = /* @__PURE__ */ E({
189
+ const ir = /* @__PURE__ */ E({
190
190
  __name: "WorkbenchApplication",
191
191
  props: {
192
192
  adapters: {},
@@ -196,39 +196,39 @@ const sr = /* @__PURE__ */ E({
196
196
  },
197
197
  setup(e) {
198
198
  const r = e;
199
- Ie(r.adapters, r.config, r.extensions);
200
- const t = ce(() => import("./Workspace-fYH2XNdb.js"));
201
- return (n, o) => (b(), K(le(t), {
199
+ Se(r.adapters, r.config, r.extensions);
200
+ const n = ce(() => import("./Workspace-7_3p28OA.js"));
201
+ return (t, o) => (b(), K(le(n), {
202
202
  "embed-in-portal": r.embedInPortal
203
203
  }, {
204
204
  "before-workbench": w(() => [
205
- g(n.$slots, "before-workbench")
205
+ g(t.$slots, "before-workbench")
206
206
  ]),
207
207
  _: 3
208
208
  }, 8, ["embed-in-portal"]));
209
209
  }
210
210
  });
211
- function ir(e) {
211
+ function dr(e) {
212
212
  return {
213
213
  getItem: (r) => e.getItem(r),
214
214
  removeItem: (r) => e.removeItem(r),
215
- setItem: (r, t) => e.setItem(r, t)
215
+ setItem: (r, n) => e.setItem(r, n)
216
216
  };
217
217
  }
218
- const Se = {
218
+ const Ce = {
219
219
  resolveAssetUrl: (e) => e
220
220
  }, S = {
221
221
  debug: (e, r) => console.debug(e, r),
222
222
  error: (e, r) => console.error(e, r),
223
223
  info: (e, r) => console.info(e, r),
224
224
  warn: (e, r) => console.warn(e, r)
225
- }, Ce = {
225
+ }, Ae = {
226
226
  error: (e) => S.error(e),
227
227
  info: (e) => S.info(e),
228
228
  success: (e) => S.info(e),
229
229
  warning: (e) => S.warn(e)
230
230
  };
231
- function dr(e = {}) {
231
+ function cr(e = {}) {
232
232
  const r = /* @__PURE__ */ new Map();
233
233
  return {
234
234
  agentTransportAdapter: {
@@ -236,12 +236,12 @@ function dr(e = {}) {
236
236
  },
237
237
  requestJson: async () => ({})
238
238
  },
239
- assetAdapter: Se,
239
+ assetAdapter: Ce,
240
240
  identityAdapter: {
241
241
  readIdentity: () => ({ appId: "test-app", roleId: "default", tenantId: "test-tenant", userId: "test-user" })
242
242
  },
243
243
  loggerAdapter: S,
244
- messageAdapter: Ce,
244
+ messageAdapter: Ae,
245
245
  platformRequestAdapter: {
246
246
  ensureSessionReady: async () => !0,
247
247
  requestJson: async () => ({})
@@ -254,12 +254,12 @@ function dr(e = {}) {
254
254
  }
255
255
  },
256
256
  storageAdapter: {
257
- getItem: (t) => r.get(t) ?? null,
258
- removeItem: (t) => {
259
- r.delete(t);
257
+ getItem: (n) => r.get(n) ?? null,
258
+ removeItem: (n) => {
259
+ r.delete(n);
260
260
  },
261
- setItem: (t, n) => {
262
- r.set(t, n);
261
+ setItem: (n, t) => {
262
+ r.set(n, t);
263
263
  }
264
264
  },
265
265
  uploadAdapter: {
@@ -268,7 +268,7 @@ function dr(e = {}) {
268
268
  ...e
269
269
  };
270
270
  }
271
- const Ae = [
271
+ const Re = [
272
272
  "attachments",
273
273
  "cards",
274
274
  "cardRecommendationDraft",
@@ -290,21 +290,21 @@ const Ae = [
290
290
  "thinkingProcessMessages",
291
291
  "workbenchTurnId"
292
292
  ];
293
- function cr(e, r) {
294
- for (const t of Ae)
295
- e[t] = r[t];
293
+ function lr(e, r) {
294
+ for (const n of Re)
295
+ e[n] = r[n];
296
296
  }
297
- function Re(e) {
297
+ function Pe(e) {
298
298
  const r = e.cardRecommendationDraft;
299
299
  if (!r || typeof r != "object") return "";
300
- const t = r.sourceTurnId;
301
- return typeof t == "string" && t.trim() ? t.trim() : "";
300
+ const n = r.sourceTurnId;
301
+ return typeof n == "string" && n.trim() ? n.trim() : "";
302
302
  }
303
- function Pe(e) {
303
+ function Te(e) {
304
304
  const r = e.cardRecommendationDraft;
305
305
  if (!r || typeof r != "object") return "";
306
- const t = r.placementTurnId;
307
- return typeof t == "string" && t.trim() ? t.trim() : "";
306
+ const n = r.placementTurnId;
307
+ return typeof n == "string" && n.trim() ? n.trim() : "";
308
308
  }
309
309
  function X(e) {
310
310
  const r = e.workbenchTurnId;
@@ -313,52 +313,52 @@ function X(e) {
313
313
  function Z(e) {
314
314
  if (typeof e != "string" || !e.startsWith("workbench-turn-")) return "";
315
315
  const r = ["-reply", "-conclusion-stream", "-item-", "-process-", "-task-", "-card-mutation-confirmation"];
316
- for (const t of r) {
317
- const n = e.indexOf(t, 15);
318
- if (n > 15) return e.slice(15, n);
316
+ for (const n of r) {
317
+ const t = e.indexOf(n, 15);
318
+ if (t > 15) return e.slice(15, t);
319
319
  }
320
320
  return "";
321
321
  }
322
322
  function _(e, r) {
323
- var n;
324
- if (e.role !== "assistant" || !((n = e.content) != null && n.trim())) return !1;
325
- const t = X(e);
326
- return t ? t === r : Z(e.id) !== r ? !1 : typeof e.id == "string" && (e.id.endsWith("-reply") || e.id.endsWith("-conclusion-stream"));
323
+ var t;
324
+ if (e.role !== "assistant" || !((t = e.content) != null && t.trim())) return !1;
325
+ const n = X(e);
326
+ return n ? n === r : Z(e.id) !== r ? !1 : typeof e.id == "string" && (e.id.endsWith("-reply") || e.id.endsWith("-conclusion-stream"));
327
327
  }
328
328
  function U(e, r) {
329
- return !!(r && e.some((t) => _(t, r)));
329
+ return !!(r && e.some((n) => _(n, r)));
330
330
  }
331
- function Te(e, r) {
332
- const t = Re(r), n = Pe(r);
333
- return U(e, t) ? t : U(e, n) ? n : n || X(r) || t || Z(r.id);
331
+ function Ee(e, r) {
332
+ const n = Pe(r), t = Te(r);
333
+ return U(e, n) ? n : U(e, t) ? t : t || X(r) || n || Z(r.id);
334
334
  }
335
- function lr(e) {
335
+ function ur(e) {
336
336
  for (const r of e.appendedMessages.values()) {
337
337
  if (!r.cardRecommendationDraft) continue;
338
- const t = Te(e.messages, r);
339
- if (!t) continue;
340
- const n = e.messages.indexOf(r);
341
- if (n < 0) continue;
342
- const o = e.messages.findIndex((y) => _(y, t));
343
- if (o < 0 || n === o + 1) continue;
344
- const [d] = e.messages.splice(n, 1), h = e.messages.findIndex((y) => _(y, t));
338
+ const n = Ee(e.messages, r);
339
+ if (!n) continue;
340
+ const t = e.messages.indexOf(r);
341
+ if (t < 0) continue;
342
+ const o = e.messages.findIndex((y) => _(y, n));
343
+ if (o < 0 || t === o + 1) continue;
344
+ const [d] = e.messages.splice(t, 1), h = e.messages.findIndex((y) => _(y, n));
345
345
  if (h < 0) {
346
- e.messages.splice(n, 0, d);
346
+ e.messages.splice(t, 0, d);
347
347
  continue;
348
348
  }
349
349
  e.messages.splice(h + 1, 0, d);
350
350
  }
351
351
  }
352
- function Ee(e) {
352
+ function We(e) {
353
353
  return !e.thinkingProcess;
354
354
  }
355
- function We(e) {
355
+ function _e(e) {
356
356
  const r = e.content.trim();
357
- return Ee(e) ? `${r.replace(/完成(?:,用时 .*)?$/u, "").trim()}完成` : r;
357
+ return We(e) ? `${r.replace(/完成(?:,用时 .*)?$/u, "").trim()}完成` : r;
358
358
  }
359
- function ur(e, r) {
359
+ function fr(e, r) {
360
360
  return {
361
- content: We(e),
361
+ content: _e(e),
362
362
  loading: !1,
363
363
  ...typeof e.startTime == "number" ? { startTime: e.startTime } : {},
364
364
  ...typeof e.endTime == "number" ? { endTime: e.endTime } : typeof r == "number" ? { endTime: r } : {}
@@ -388,18 +388,18 @@ function ee(e) {
388
388
  ].join("|");
389
389
  }
390
390
  function re(e) {
391
- const r = p(e), t = p(r.data);
391
+ const r = p(e), n = p(r.data);
392
392
  return [
393
393
  a(r.resultId),
394
394
  a(r.sourceTurnId),
395
395
  a(r.rowCount),
396
- Q(r.rows || t.rows),
397
- Q(r.columns || t.columns),
398
- ee(r.dataBinding || t.dataBinding)
396
+ Q(r.rows || n.rows),
397
+ Q(r.columns || n.columns),
398
+ ee(r.dataBinding || n.dataBinding)
399
399
  ].join("|");
400
400
  }
401
- function _e(e) {
402
- const r = p(e), t = p(r.blockPlan), n = p(t.data), o = p(t.meta), d = p(o.queryResult);
401
+ function Me(e) {
402
+ const r = p(e), n = p(r.blockPlan), t = p(n.data), o = p(n.meta), d = p(o.queryResult);
403
403
  return [
404
404
  a(r.recommendationId),
405
405
  a(r.capabilityId),
@@ -407,99 +407,104 @@ function _e(e) {
407
407
  a(r.previewStatus),
408
408
  a(r.nextAction),
409
409
  a(r.dataShape),
410
- a(t.id),
411
- a(t.title),
412
- ee(r.dataBinding || n.dataBinding),
410
+ a(n.id),
411
+ a(n.title),
412
+ ee(r.dataBinding || t.dataBinding),
413
413
  re(r.queryResult || d)
414
414
  ].join(":");
415
415
  }
416
- function fr(e) {
417
- const r = p(e), t = typeof r.type == "string" ? r.type : "";
418
- if (t === "card_recommendations_ready") {
419
- const n = Array.isArray(r.recommendations) ? r.recommendations : [];
416
+ function mr(e) {
417
+ const r = p(e), n = typeof r.type == "string" ? r.type : "";
418
+ if (n === "card_recommendations_ready") {
419
+ const t = Array.isArray(r.recommendations) ? r.recommendations : [], o = ue({
420
+ payload: r,
421
+ conversationId: a(r.conversationId),
422
+ groupType: n
423
+ });
420
424
  return [
421
- t,
425
+ n,
426
+ o.renderKey,
422
427
  a(r.sourceTurnId),
423
428
  a(r.placementTurnId),
424
429
  re(r.queryResult),
425
- n.map(_e).join(",")
430
+ t.map(Me).join(",")
426
431
  ].join(":");
427
432
  }
428
- if (t === "query_result_table_ready") {
429
- const n = p(r.queryResult), o = Array.isArray(n.rows) ? n.rows.length : "", d = Array.isArray(n.columns) ? n.columns.length : "";
430
- return `${t}:${o}:${d}:${n.rowCount ?? ""}`;
433
+ if (n === "query_result_table_ready") {
434
+ const t = p(r.queryResult), o = Array.isArray(t.rows) ? t.rows.length : "", d = Array.isArray(t.columns) ? t.columns.length : "";
435
+ return `${n}:${o}:${d}:${t.rowCount ?? ""}`;
431
436
  }
432
- return t;
437
+ return n;
433
438
  }
434
- const Me = /* @__PURE__ */ new Set(["pending", "running"]), Be = "/data-binding-candidate/query", De = "/workbench/v2/documents/", Ne = "/data-bindings/";
435
- function ve(e) {
439
+ const Be = /* @__PURE__ */ new Set(["pending", "running"]), De = "/data-binding-candidate/query", ve = "/workbench/v2/documents/", Ne = "/data-bindings/";
440
+ function $e(e) {
436
441
  return typeof (e == null ? void 0 : e.refreshApi) == "string" ? e.refreshApi.trim() : "";
437
442
  }
438
- function $e(e) {
439
- return e.includes(Be);
443
+ function Oe(e) {
444
+ return e.includes(De);
440
445
  }
441
- function te(e) {
446
+ function ne(e) {
442
447
  let r = e;
443
448
  try {
444
449
  r = new URL(e, "http://localhost").pathname;
445
450
  } catch {
446
451
  r = e;
447
452
  }
448
- return r.includes(De) && r.includes(Ne);
453
+ return r.includes(ve) && r.includes(Ne);
449
454
  }
450
455
  function M(e) {
451
456
  return !!(e && typeof e == "object" && !Array.isArray(e));
452
457
  }
453
458
  function m(e) {
454
459
  if (!M(e)) return !1;
455
- const r = typeof e.source == "string" ? e.source.trim().toLowerCase() : "", t = typeof e.sourceType == "string" ? e.sourceType.trim().toLowerCase() : "", n = typeof e.composeSource == "string" ? e.composeSource.trim().toLowerCase() : "";
456
- return r === "image" || t === "image" || n === "image" || m(e.params);
460
+ const r = typeof e.source == "string" ? e.source.trim().toLowerCase() : "", n = typeof e.sourceType == "string" ? e.sourceType.trim().toLowerCase() : "", t = typeof e.composeSource == "string" ? e.composeSource.trim().toLowerCase() : "";
461
+ return r === "image" || n === "image" || t === "image" || m(e.params);
457
462
  }
458
463
  function C(e) {
459
464
  return M(e) ? m(e) || m(e.recognition) ? !0 : M(e.v2) ? C(e.v2) : !1 : !1;
460
465
  }
461
- function Oe(e, r, t) {
462
- return (r == null ? void 0 : r.suppressImageComposeAutoRefresh) !== !0 || !te(t) ? !1 : m(e == null ? void 0 : e.params) || m(e) || m(r) || m(r == null ? void 0 : r.source) || m(r == null ? void 0 : r.data) || C(r == null ? void 0 : r.recognition) || C(r == null ? void 0 : r.meta);
466
+ function Fe(e, r, n) {
467
+ return (r == null ? void 0 : r.suppressImageComposeAutoRefresh) !== !0 || !ne(n) ? !1 : m(e == null ? void 0 : e.params) || m(e) || m(r) || m(r == null ? void 0 : r.source) || m(r == null ? void 0 : r.data) || C(r == null ? void 0 : r.recognition) || C(r == null ? void 0 : r.meta);
463
468
  }
464
- function Fe(e, r) {
469
+ function He(e, r) {
465
470
  return m(e == null ? void 0 : e.params) || m(e) || m(r) || m(r == null ? void 0 : r.source) || m(r == null ? void 0 : r.data) || C(r == null ? void 0 : r.recognition) || C(r == null ? void 0 : r.meta);
466
471
  }
467
- function mr(e, r) {
472
+ function hr(e, r) {
468
473
  if (!e) return !1;
469
- const t = ve(e);
470
- if (!t || $e(t) || Oe(e, r, t)) return !1;
471
- const n = typeof (e == null ? void 0 : e.status) == "string" ? e.status.trim().toLowerCase() : "";
472
- return !(Me.has(n) || te(t) && Fe(e, r));
474
+ const n = $e(e);
475
+ if (!n || Oe(n) || Fe(e, r, n)) return !1;
476
+ const t = typeof (e == null ? void 0 : e.status) == "string" ? e.status.trim().toLowerCase() : "";
477
+ return !(Be.has(t) || ne(n) && He(e, r));
473
478
  }
474
- function hr(e) {
475
- var n;
476
- const r = (n = e.title) == null ? void 0 : n.trim(), t = r ? He(r) : void 0;
477
- return t || `字段 ${e.index + 1}`;
479
+ function pr(e) {
480
+ var t;
481
+ const r = (t = e.title) == null ? void 0 : t.trim(), n = r ? xe(r) : void 0;
482
+ return n || `字段 ${e.index + 1}`;
478
483
  }
479
- function He(e) {
484
+ function xe(e) {
480
485
  const r = e.replace(/[A-Za-z0-9_./\\()[\]{}::,,;;#%+\-=]+/gu, "").replace(/\s+/gu, "").trim();
481
486
  return r && /[\u3400-\u9fff]/u.test(r) ? r : void 0;
482
487
  }
483
- function B(e, r = {}, t = "-") {
484
- return Number.isFinite(e) ? new Intl.NumberFormat("zh-CN", r).format(e) : t;
488
+ function B(e, r = {}, n = "-") {
489
+ return Number.isFinite(e) ? new Intl.NumberFormat("zh-CN", r).format(e) : n;
485
490
  }
486
- function pr(e, r = "") {
491
+ function gr(e, r = "") {
487
492
  return r === "percent" ? `${(e * 100).toFixed(1)}%` : r === "currency" ? Math.abs(e) >= 1e8 ? `¥${(e / 1e8).toFixed(2)}亿` : Math.abs(e) >= 1e4 ? `¥${(e / 1e4).toFixed(1)}万` : `¥${B(e)}` : B(e);
488
493
  }
489
- function gr(e, r = {}) {
494
+ function yr(e, r = {}) {
490
495
  return e === 0 ? "-" : B(e, r);
491
496
  }
492
497
  function j(e = {}) {
493
- var t, n, o, d, h, y, v, $, O, F, H, x;
498
+ var n, t, o, d, h, y, N, $, O, F, H, x;
494
499
  const r = {
495
500
  workspaceId: l([
496
- s((t = e.routeQuery) == null ? void 0 : t.workspaceId),
501
+ s((n = e.routeQuery) == null ? void 0 : n.workspaceId),
497
502
  c(e.locationSearch, "workspaceId"),
498
503
  u(e.locationHash, "workspaceId"),
499
504
  f(e.locationPathname, "workspaceId")
500
505
  ]),
501
506
  userId: l([
502
- s((n = e.routeQuery) == null ? void 0 : n.userId),
507
+ s((t = e.routeQuery) == null ? void 0 : t.userId),
503
508
  c(e.locationSearch, "userId"),
504
509
  u(e.locationHash, "userId"),
505
510
  f(e.locationPathname, "userId")
@@ -532,7 +537,7 @@ function j(e = {}) {
532
537
  f(e.locationPathname, "conversationId")
533
538
  ]),
534
539
  resourceId: l([
535
- s((v = e.routeQuery) == null ? void 0 : v.resourceId),
540
+ s((N = e.routeQuery) == null ? void 0 : N.resourceId),
536
541
  c(e.locationSearch, "resourceId"),
537
542
  u(e.locationHash, "resourceId"),
538
543
  f(e.locationPathname, "resourceId")
@@ -568,9 +573,9 @@ function j(e = {}) {
568
573
  f(e.locationPathname, "fdeName")
569
574
  ])
570
575
  };
571
- return Le(r);
576
+ return Ue(r);
572
577
  }
573
- function yr(e) {
578
+ function br(e) {
574
579
  if (typeof window > "u")
575
580
  return j({ routeQuery: e });
576
581
  const r = j({
@@ -581,55 +586,55 @@ function yr(e) {
581
586
  });
582
587
  return {
583
588
  ...r,
584
- userId: r.userId || xe(window)
589
+ userId: r.userId || qe(window)
585
590
  };
586
591
  }
587
592
  function s(e) {
588
593
  return Array.isArray(e) ? s(e[0]) : typeof e == "string" ? e.trim() : "";
589
594
  }
590
595
  function c(e, r) {
591
- var t;
592
- return e && ((t = new URLSearchParams(e.startsWith("?") ? e.slice(1) : e).get(r)) == null ? void 0 : t.trim()) || "";
596
+ var n;
597
+ return e && ((n = new URLSearchParams(e.startsWith("?") ? e.slice(1) : e).get(r)) == null ? void 0 : n.trim()) || "";
593
598
  }
594
599
  function u(e, r) {
595
600
  if (!e) return "";
596
- const t = e.indexOf("?");
597
- if (t < 0) return "";
598
- const n = e.indexOf("#", t + 1), o = n >= 0 ? e.slice(t + 1, n) : e.slice(t + 1);
601
+ const n = e.indexOf("?");
602
+ if (n < 0) return "";
603
+ const t = e.indexOf("#", n + 1), o = t >= 0 ? e.slice(n + 1, t) : e.slice(n + 1);
599
604
  return c(o, r);
600
605
  }
601
606
  function f(e, r) {
602
607
  if (!e || !e.includes("=")) return "";
603
- const t = e.split("/").filter(Boolean).find((n) => n.includes("="));
604
- return t ? c(t, r) : "";
608
+ const n = e.split("/").filter(Boolean).find((t) => t.includes("="));
609
+ return n ? c(n, r) : "";
605
610
  }
606
611
  function V(e, r) {
607
- return l(r.flatMap((t) => {
608
- var n;
612
+ return l(r.flatMap((n) => {
613
+ var t;
609
614
  return [
610
- s((n = e.routeQuery) == null ? void 0 : n[t]),
611
- c(e.locationSearch, t),
612
- u(e.locationHash, t),
613
- f(e.locationPathname, t)
615
+ s((t = e.routeQuery) == null ? void 0 : t[n]),
616
+ c(e.locationSearch, n),
617
+ u(e.locationHash, n),
618
+ f(e.locationPathname, n)
614
619
  ];
615
620
  }));
616
621
  }
617
622
  function l(e) {
618
623
  return e.find((r) => r.trim()) || "";
619
624
  }
620
- function xe(e) {
625
+ function qe(e) {
621
626
  const r = [
622
627
  e.__BT_WORKBENCH_USER__,
623
628
  e.__BT_RUNTIME_IDENTITY__,
624
629
  e.__BT_RUNTIME_CONTEXT__
625
630
  ];
626
- for (const t of r) {
627
- const n = qe(t);
628
- if (n) return n;
631
+ for (const n of r) {
632
+ const t = Le(n);
633
+ if (t) return t;
629
634
  }
630
635
  return "";
631
636
  }
632
- function qe(e) {
637
+ function Le(e) {
633
638
  if (!e || typeof e != "object" || Array.isArray(e)) return "";
634
639
  const r = e;
635
640
  return l([
@@ -640,8 +645,8 @@ function qe(e) {
640
645
  s(r["ego-userinfo"])
641
646
  ]);
642
647
  }
643
- function Le(e) {
644
- if (!Ue(e)) return e;
648
+ function Ue(e) {
649
+ if (!Qe(e)) return e;
645
650
  const r = e.fdeResourceId || e.resourceId;
646
651
  return {
647
652
  ...e,
@@ -651,9 +656,9 @@ function Le(e) {
651
656
  fdeResourceId: r
652
657
  };
653
658
  }
654
- function Ue(e) {
655
- const r = e.mode.trim().toLowerCase(), t = e.fdeMode.trim().toLowerCase();
656
- return r === "fde" || t === "true" || t === "1" || t === "yes";
659
+ function Qe(e) {
660
+ const r = e.mode.trim().toLowerCase(), n = e.fdeMode.trim().toLowerCase();
661
+ return r === "fde" || n === "true" || n === "1" || n === "yes";
657
662
  }
658
663
  const i = {
659
664
  radius: "standard",
@@ -663,7 +668,7 @@ const i = {
663
668
  textureColor: "#ffffff",
664
669
  motion: "none",
665
670
  density: "standard"
666
- }, br = [
671
+ }, wr = [
667
672
  {
668
673
  key: "radius",
669
674
  label: "圆角",
@@ -720,7 +725,7 @@ const i = {
720
725
  { value: "compact", label: "高密度紧凑版" }
721
726
  ]
722
727
  }
723
- ], Qe = {
728
+ ], je = {
724
729
  radius: ["square", "small", "standard", "large"],
725
730
  border: ["none", "light", "strong"],
726
731
  shadow: ["none", "soft", "strong"],
@@ -731,40 +736,40 @@ const i = {
731
736
  function D(e) {
732
737
  return e && typeof e == "object" && !Array.isArray(e) ? e : {};
733
738
  }
734
- function k(e, r) {
735
- const t = i[e];
736
- return typeof r == "string" && Qe[e].includes(r) ? r : t;
739
+ function I(e, r) {
740
+ const n = i[e];
741
+ return typeof r == "string" && je[e].includes(r) ? r : n;
737
742
  }
738
- function je(e) {
743
+ function Ve(e) {
739
744
  return typeof e == "string" && /^#[0-9a-fA-F]{6}$/.test(e) ? e.toLowerCase() : i.textureColor;
740
745
  }
741
746
  function T(e) {
742
747
  const r = D(e);
743
748
  return {
744
- radius: k("radius", r.radius),
745
- border: k("border", r.border),
746
- shadow: k("shadow", r.shadow),
747
- texture: k("texture", r.texture),
748
- textureColor: je(r.textureColor),
749
- motion: k("motion", r.motion),
750
- density: k("density", r.density)
749
+ radius: I("radius", r.radius),
750
+ border: I("border", r.border),
751
+ shadow: I("shadow", r.shadow),
752
+ texture: I("texture", r.texture),
753
+ textureColor: Ve(r.textureColor),
754
+ motion: I("motion", r.motion),
755
+ density: I("density", r.density)
751
756
  };
752
757
  }
753
- function wr(e) {
758
+ function Ir(e) {
754
759
  const r = T(e);
755
760
  return r.radius === i.radius && r.border === i.border && r.shadow === i.shadow && r.texture === i.texture && r.textureColor === i.textureColor && r.motion === i.motion && r.density === i.density;
756
761
  }
757
- const Ve = {
762
+ const ze = {
758
763
  square: 0,
759
764
  small: 4,
760
765
  standard: 8,
761
766
  large: 16
762
- }, ze = {
767
+ }, Ke = {
763
768
  none: "none",
764
769
  soft: "soft",
765
770
  standard: "soft",
766
771
  strong: "strong"
767
- }, Ke = {
772
+ }, Ge = {
768
773
  thumbnail: "compact",
769
774
  compact: "compact",
770
775
  standard: "standard",
@@ -774,7 +779,7 @@ function kr(e) {
774
779
  const r = T(e);
775
780
  return {
776
781
  cardStyle: {
777
- cardRadius: Ve[r.radius],
782
+ cardRadius: ze[r.radius],
778
783
  cardShadow: r.shadow === "strong" ? "strong" : r.shadow,
779
784
  density: r.density === "loose" ? "expanded" : r.density,
780
785
  ...r.texture === "color" ? { backgroundColor: r.textureColor } : {},
@@ -782,13 +787,13 @@ function kr(e) {
782
787
  }
783
788
  };
784
789
  }
785
- function Ir(e) {
786
- const r = D(e == null ? void 0 : e.cardStyle), t = D(r.shell);
787
- if (Object.keys(t).length > 0)
788
- return T(t);
789
- const n = typeof r.cardRadius == "number" ? r.cardRadius <= 0 ? "square" : r.cardRadius <= 4 ? "small" : r.cardRadius >= 16 ? "large" : "standard" : i.radius, o = typeof r.cardShadow == "string" && ze[r.cardShadow] || i.shadow, d = typeof r.density == "string" && Ke[r.density] || i.density, h = typeof r.backgroundColor == "string" ? r.backgroundColor : void 0;
790
+ function Sr(e) {
791
+ const r = D(e == null ? void 0 : e.cardStyle), n = D(r.shell);
792
+ if (Object.keys(n).length > 0)
793
+ return T(n);
794
+ const t = typeof r.cardRadius == "number" ? r.cardRadius <= 0 ? "square" : r.cardRadius <= 4 ? "small" : r.cardRadius >= 16 ? "large" : "standard" : i.radius, o = typeof r.cardShadow == "string" && Ke[r.cardShadow] || i.shadow, d = typeof r.density == "string" && Ge[r.density] || i.density, h = typeof r.backgroundColor == "string" ? r.backgroundColor : void 0;
790
795
  return T({
791
- radius: n,
796
+ radius: t,
792
797
  border: i.border,
793
798
  shadow: o,
794
799
  texture: h ? "color" : i.texture,
@@ -797,41 +802,41 @@ function Ir(e) {
797
802
  density: d
798
803
  });
799
804
  }
800
- const Sr = "@fses/workbench-app";
805
+ const Cr = "@fses/workbench-app";
801
806
  export {
802
- dr as A,
803
- Se as B,
807
+ cr as A,
808
+ Ce as B,
804
809
  S as C,
805
810
  i as D,
806
- Ce as E,
807
- gr as F,
808
- er as G,
809
- br as W,
810
- be as _,
811
- hr as a,
812
- ar as b,
813
- We as c,
814
- cr as d,
815
- ur as e,
816
- pr as f,
817
- fr as g,
811
+ Ae as E,
812
+ yr as F,
813
+ rr as G,
814
+ wr as W,
815
+ we as _,
816
+ pr as a,
817
+ sr as b,
818
+ _e as c,
819
+ lr as d,
820
+ fr as e,
821
+ gr as f,
822
+ mr as g,
818
823
  tr as h,
819
- nr as i,
820
- yr as j,
821
- rr as k,
822
- Ir as l,
823
- wr as m,
824
+ or as i,
825
+ br as j,
826
+ nr as k,
827
+ Sr as l,
828
+ Ir as m,
824
829
  T as n,
825
830
  kr as o,
826
- lr as p,
831
+ ur as p,
827
832
  G as q,
828
- or as r,
829
- mr as s,
830
- Sr as t,
831
- sr as u,
832
- we as v,
833
- ve as w,
834
- me as x,
835
- ir as y,
836
- ue as z
833
+ ar as r,
834
+ hr as s,
835
+ Cr as t,
836
+ ir as u,
837
+ Ie as v,
838
+ $e as w,
839
+ he as x,
840
+ dr as y,
841
+ fe as z
837
842
  };