@fses/workbench-app 0.2.17 → 0.2.20

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 (127) hide show
  1. package/WORKBENCH-CLOSURE.json +14 -14
  2. package/dist/WorkbenchCardCenterDrawer-CWBuBD04.js +421 -0
  3. package/dist/WorkbenchDiagnosticsFooter-BxpwRNMe.js +22 -0
  4. package/dist/WorkbenchDiagnosticsPage-D0mWFNWS.js +72 -0
  5. package/dist/Workspace-DwnUU7_7.js +22678 -0
  6. package/dist/adapters/defaultAgentTransportAdapter.d.ts +6 -0
  7. package/dist/adapters/defaultBrowserAdapters.d.ts +22 -0
  8. package/dist/adapters/defaultPlatformRequestAdapter.d.ts +6 -0
  9. package/dist/adapters/defaultRealtimeAdapter.d.ts +6 -0
  10. package/dist/adapters/endpointResolver.d.ts +16 -0
  11. package/dist/adapters/index.d.ts +7 -1
  12. package/dist/adapters/servicePorts.d.ts +20 -0
  13. package/dist/adapters/types.d.ts +27 -1
  14. package/dist/canvas/api/index.js +1 -1
  15. package/dist/canvas/bridge/workbenchCanvasBus.d.ts +13 -1
  16. package/dist/canvas/persistence/canvasSnapshotStorage.d.ts +3 -2
  17. package/dist/{canvasFacade-B8jYm_aO.js → canvasFacade-ZFqB_i7z.js} +1 -1
  18. package/dist/{cardFactory-DmEBcCf4.js → cardFactory-D5dyYSC3.js} +197 -161
  19. package/dist/components/WorkbenchAppHost.vue.d.ts +5 -5
  20. package/dist/components/WorkbenchApplication.vue.d.ts +2 -2
  21. package/dist/components/WorkbenchCardCenterDrawer.vue.d.ts +2 -0
  22. package/dist/components/WorkbenchDiagnosticsFooter.vue.d.ts +2 -0
  23. package/dist/components/WorkbenchDiagnosticsPage.vue.d.ts +2 -0
  24. package/dist/components/WorkbenchDrawerOutlet.vue.d.ts +6 -0
  25. package/dist/components/WorkbenchFeatureOutlet.vue.d.ts +2 -0
  26. package/dist/components/WorkbenchSlotOutlet.vue.d.ts +5 -0
  27. package/dist/config/workbenchAppConfig.d.ts +4 -0
  28. package/dist/customCardCatalog-DcoxF7gK.js +512 -0
  29. package/dist/extensions/index.d.ts +3 -54
  30. package/dist/extensions/index.js +7 -5
  31. package/dist/extensions/manifest.d.ts +27 -0
  32. package/dist/extensions/normalizeWorkbenchExtensions.d.ts +19 -0
  33. package/dist/extensions/types.d.ts +62 -0
  34. package/dist/fses-workbench-app.js +106 -89
  35. package/dist/index-CytMrt6f.js +1771 -0
  36. package/dist/index-DkGYPLLJ.js +34 -0
  37. package/dist/index.d.ts +10 -1
  38. package/dist/internal/personal-workbench/components/workbench/WorkbenchCanvas.vue.d.ts +4 -4
  39. package/dist/internal/personal-workbench/components/workbench/WorkbenchCanvasSettingsMenu.vue.d.ts +4 -4
  40. package/dist/internal/personal-workbench/components/workbench/WorkbenchFdeImageComposeDrawer.vue.d.ts +19 -0
  41. package/dist/internal/personal-workbench/components/workbench/WorkbenchFdeToolbar.vue.d.ts +36 -0
  42. package/dist/internal/personal-workbench/components/workbench/WorkbenchStudio.vue.d.ts +5 -4
  43. package/dist/internal/personal-workbench/components/workbench/controllers/canvasConfigController.d.ts +23 -0
  44. package/dist/internal/personal-workbench/components/workbench/controllers/canvasLayoutController.d.ts +12 -0
  45. package/dist/internal/personal-workbench/components/workbench/controllers/canvasRefreshController.d.ts +11 -0
  46. package/dist/internal/personal-workbench/components/workbench/controllers/canvasSelectionController.d.ts +11 -0
  47. package/dist/internal/personal-workbench/components/workbench/showcase/WorkbenchShowcase.vue.d.ts +4 -4
  48. package/dist/internal/personal-workbench/controllers/workbenchBuiltinPluginBridge.d.ts +32 -0
  49. package/dist/internal/personal-workbench/controllers/workbenchChartConfigModel.d.ts +68 -0
  50. package/dist/internal/personal-workbench/controllers/workbenchChartDataSourceController.d.ts +100 -0
  51. package/dist/internal/personal-workbench/controllers/workbenchChartDrilldownController.d.ts +96 -0
  52. package/dist/internal/personal-workbench/controllers/workbenchChartDrilldownTable.d.ts +34 -0
  53. package/dist/internal/personal-workbench/controllers/workbenchFdeVersionController.d.ts +107 -0
  54. package/dist/internal/personal-workbench/controllers/workbenchRecommendationConfigModel.d.ts +82 -0
  55. package/dist/internal/personal-workbench/lib/deepAgentApi.d.ts +13 -9
  56. package/dist/internal/personal-workbench/lib/deepAgentQueueState.d.ts +3 -1
  57. package/dist/internal/personal-workbench/lib/fdeWorkbenchConfigClient.d.ts +6 -5
  58. package/dist/internal/personal-workbench/lib/runtimeIdentity.d.ts +5 -0
  59. package/dist/internal/personal-workbench/lib/runtimePrimitiveRegistry.d.ts +1 -1
  60. package/dist/internal/personal-workbench/lib/vueRuntimeAdapters.d.ts +22 -5
  61. package/dist/internal/personal-workbench/lib/workbenchApi.d.ts +61 -47
  62. package/dist/internal/personal-workbench/lib/workbenchMetricDetailApi.d.ts +2 -1
  63. package/dist/internal/personal-workbench/lib/workbenchRemoteClient.d.ts +3 -1
  64. package/dist/internal/personal-workbench/lib/workbenchRequestTransport.d.ts +24 -0
  65. package/dist/internal/personal-workbench/lib/workbenchStorage.d.ts +8 -7
  66. package/dist/internal/personal-workbench/pages/Workspace.vue.d.ts +2 -2
  67. package/dist/internal/personal-workbench/stores/domains/actionsRuntime.d.ts +35 -0
  68. package/dist/internal/personal-workbench/stores/domains/canvasRuntime.d.ts +44 -0
  69. package/dist/internal/personal-workbench/stores/domains/conversationRuntime.d.ts +29 -0
  70. package/dist/internal/personal-workbench/stores/domains/dataBindingRuntime.d.ts +27 -0
  71. package/dist/internal/personal-workbench/stores/domains/fdeRuntime.d.ts +38 -0
  72. package/dist/internal/personal-workbench/stores/domains/memoryRuntime.d.ts +53 -0
  73. package/dist/internal/personal-workbench/stores/workbenchRuntime.d.ts +28 -1
  74. package/dist/kernel/command/createCommandRegistry.d.ts +19 -0
  75. package/dist/kernel/createWorkbenchHostContext.d.ts +43 -0
  76. package/dist/kernel/createWorkbenchKernel.d.ts +7 -0
  77. package/dist/kernel/diagnostics/createWorkbenchDiagnostics.d.ts +35 -0
  78. package/dist/kernel/event/createEventBus.d.ts +16 -0
  79. package/dist/kernel/plugin/createPluginManager.d.ts +7 -0
  80. package/dist/kernel/plugin/registrationScope.d.ts +15 -0
  81. package/dist/kernel/plugin/types.d.ts +30 -0
  82. package/dist/kernel/registry/createRegistry.d.ts +42 -0
  83. package/dist/kernel/registry/resolveSlotContributions.d.ts +14 -0
  84. package/dist/kernel/types.d.ts +52 -0
  85. package/dist/kernel/workbenchHostContext.d.ts +14 -0
  86. package/dist/normalizeWorkbenchExtensions-Ccv3n3fC.js +425 -0
  87. package/dist/plugin/index.d.ts +7 -0
  88. package/dist/plugin/index.js +8 -0
  89. package/dist/plugin/types.d.ts +106 -0
  90. package/dist/plugins/defaultWorkbenchPlugins.d.ts +11 -0
  91. package/dist/plugins/workbenchCardCenterPlugin.d.ts +13 -0
  92. package/dist/plugins/workbenchDiagnosticsPlugin.d.ts +15 -0
  93. package/dist/plugins/workbenchDrawerCommands.d.ts +16 -0
  94. package/dist/plugins/workbenchSettingsPlugin.d.ts +19 -0
  95. package/dist/plugins/workbenchThemePlugin.d.ts +15 -0
  96. package/dist/routing/createWorkbenchFeatureRoute.d.ts +11 -0
  97. package/dist/routing/resolveWorkbenchFeatureRoute.d.ts +23 -0
  98. package/dist/runtime/index.d.ts +6 -1
  99. package/dist/runtime/index.js +6 -3
  100. package/dist/runtime/scope/createWorkbenchRuntimeScope.d.ts +10 -0
  101. package/dist/runtime/store/workbenchRuntimeContext.d.ts +12 -0
  102. package/dist/runtime/store/workbenchRuntimeFacade.d.ts +3 -0
  103. package/dist/style.css +1 -1
  104. package/dist/types/index.d.ts +2 -0
  105. package/dist/useWorkbenchRuntime-CJLqEtgU.js +24062 -0
  106. package/dist/version.d.ts +1 -1
  107. package/node_modules/@fses/ai-chat/dist/components/FsesAiChat.vue.d.ts +9 -1
  108. package/node_modules/@fses/ai-chat/dist/composables/types.d.ts +9 -0
  109. package/node_modules/@fses/ai-chat/dist/fses-ai-chat.js +28238 -7473
  110. package/node_modules/@fses/ai-chat/dist/fses-ai-chat.umd.cjs +17 -17
  111. package/node_modules/@fses/ai-chat/dist/index.d.ts +1 -1
  112. package/node_modules/@fses/ai-chat/dist/style.css +1 -1
  113. package/node_modules/@fses/ai-chat/package.json +3 -3
  114. package/node_modules/@fses/workbench-card/dist/fses-workbench-card-renderers.js +5 -5
  115. package/node_modules/@fses/workbench-card/dist/fses-workbench-card.js +5 -5
  116. package/node_modules/@fses/workbench-card/dist/fses-workbench-card.umd.cjs +1 -1
  117. package/node_modules/@fses/workbench-card/dist/types/block.d.ts +4 -1
  118. package/node_modules/@fses/workbench-card/package.json +1 -1
  119. package/node_modules/@fses/workbench-card/src/registry/cardRegistry.ts +4 -4
  120. package/node_modules/@fses/workbench-card/src/registry/echartsTemplateRegistry.generated.js +1 -1
  121. package/node_modules/@fses/workbench-card/src/registry/echartsTemplateRegistry.generated.ts +1 -1
  122. package/node_modules/@fses/workbench-card/src/types/block.ts +4 -12
  123. package/package.json +7 -3
  124. package/dist/Workspace-r8ayksVF.js +0 -23176
  125. package/dist/index-DEOR_GPc.js +0 -829
  126. package/dist/useWorkbenchRuntime-DDD22mdF.js +0 -23831
  127. package/dist/workbenchCustomComponentRegistry-CWUPjCnJ.js +0 -267
@@ -0,0 +1,1771 @@
1
+ import { toRefs as Fe, shallowReadonly as Y, inject as ye, defineComponent as M, provide as G, openBlock as k, createElementBlock as W, renderSlot as O, createElementVNode as D, normalizeClass as ie, normalizeStyle as q, withModifiers as He, unref as J, createCommentVNode as U, createVNode as T, Transition as $e, withCtx as H, shallowRef as re, onMounted as ke, watch as Ee, onBeforeUnmount as L, toDisplayString as Ke, createBlock as V, resolveDynamicComponent as ne, Fragment as qe, renderList as Ue, computed as Ie, defineAsyncComponent as Q, ref as xe, h as Le } from "vue";
2
+ import { d as u, f as Ae, g as _e, h as Re, i as Ve } from "./cardFactory-D5dyYSC3.js";
3
+ import { n as Ge, w as ze } from "./normalizeWorkbenchExtensions-Ccv3n3fC.js";
4
+ import { W as Ce, a as Qe, c as je } from "./index-DkGYPLLJ.js";
5
+ import { fetchEventSource as Ye } from "@microsoft/fetch-event-source";
6
+ import { r as Je, e as Xe, d as Ze, f as et, g as tt, c as rt, a as nt, W as ot, h as st } from "./useWorkbenchRuntime-CJLqEtgU.js";
7
+ import "./canvasFacade-ZFqB_i7z.js";
8
+ import { useRoute as at } from "vue-router";
9
+ const it = "0.2.20", ce = "workbench-app-version";
10
+ function ct() {
11
+ if (typeof document > "u" || document.querySelector(`meta[name="${ce}"]`)) return !1;
12
+ const e = document.createElement("meta");
13
+ return e.name = ce, e.content = it, document.head.appendChild(e), !0;
14
+ }
15
+ ct();
16
+ const We = Symbol("workbench-app-context");
17
+ function dt(e) {
18
+ const { adapters: t, config: r, extensions: n } = Fe(e);
19
+ return {
20
+ adapters: Y(t),
21
+ config: Y(r),
22
+ extensions: Y(n)
23
+ };
24
+ }
25
+ function sn() {
26
+ const e = ye(We);
27
+ if (!e)
28
+ throw new Error("useWorkbenchAppContext must be used inside WorkbenchWorkspaceCore");
29
+ return e;
30
+ }
31
+ const lt = { class: "fses-workbench-app" }, ut = /* @__PURE__ */ M({
32
+ __name: "WorkbenchWorkspaceCore",
33
+ props: {
34
+ adapters: {},
35
+ config: {},
36
+ extensions: {}
37
+ },
38
+ setup(e) {
39
+ return G(We, dt(e)), (r, n) => (k(), W("div", lt, [
40
+ O(r.$slots, "default")
41
+ ]));
42
+ }
43
+ }), oe = Symbol("workbench-host-context");
44
+ function j() {
45
+ const e = ye(oe);
46
+ if (!e) throw new Error("useWorkbenchHostContext must be used inside a workbench host root");
47
+ return e;
48
+ }
49
+ const ft = { class: "workbench-shell" }, ht = ["aria-label"], mt = ["aria-hidden", "inert"], pt = { class: "workbench-studio-panel__body" }, gt = ["aria-label"], de = 48, bt = /* @__PURE__ */ M({
50
+ __name: "WorkbenchShell",
51
+ props: {
52
+ studioPanelWidth: {},
53
+ studioPanelCollapsed: { type: Boolean },
54
+ studioPanelEnabled: { type: Boolean },
55
+ drawerOpen: { type: Boolean },
56
+ drawerWidth: {},
57
+ dragging: { type: Boolean },
58
+ canvasFocusMode: { type: Boolean },
59
+ imageWorkbench: { type: Boolean }
60
+ },
61
+ emits: ["startDrag"],
62
+ setup(e, { emit: t }) {
63
+ const r = t;
64
+ return (n, o) => (k(), W("div", ft, [
65
+ D("div", {
66
+ class: ie(["workbench-shell__body", { "workbench-shell__body--dragging": e.dragging }])
67
+ }, [
68
+ D("div", {
69
+ class: "workbench-shell__canvas-pane",
70
+ style: q({
71
+ flexBasis: e.drawerOpen ? `calc(100% - ${e.drawerWidth || 392}px)` : e.canvasFocusMode || !e.studioPanelEnabled ? "100%" : e.studioPanelCollapsed ? `calc(100% - ${de}px)` : `calc(100% - ${e.studioPanelWidth}px - 8px)`
72
+ })
73
+ }, [
74
+ O(n.$slots, "left", {}, void 0, !0)
75
+ ], 4),
76
+ e.studioPanelEnabled && !e.studioPanelCollapsed && !e.canvasFocusMode && !e.drawerOpen ? (k(), W("div", {
77
+ key: 0,
78
+ "aria-orientation": "vertical",
79
+ "data-i18n-aria-label": "FWA.8cb91787571066462",
80
+ "aria-label": J(u)("FWA.8cb91787571066462"),
81
+ class: "workbench-splitter",
82
+ role: "separator",
83
+ onPointerdown: o[0] || (o[0] = (s) => r("startDrag", s)),
84
+ onDragstart: o[1] || (o[1] = He(() => {
85
+ }, ["prevent"]))
86
+ }, [...o[2] || (o[2] = [
87
+ D("div", { class: "workbench-splitter__track" }, null, -1)
88
+ ])], 40, ht)) : U("", !0),
89
+ e.studioPanelEnabled && !e.canvasFocusMode && !e.drawerOpen ? (k(), W("div", {
90
+ key: 1,
91
+ class: ie(["workbench-studio-panel", { "workbench-studio-panel--collapsed": e.studioPanelCollapsed }]),
92
+ style: q({ flexBasis: e.studioPanelCollapsed ? "0px" : `${e.studioPanelWidth}px` }),
93
+ "aria-hidden": e.studioPanelCollapsed ? "true" : void 0,
94
+ inert: e.studioPanelCollapsed ? !0 : void 0
95
+ }, [
96
+ D("div", pt, [
97
+ O(n.$slots, "right", {}, void 0, !0)
98
+ ])
99
+ ], 14, mt)) : U("", !0),
100
+ T($e, { name: "workbench-assistant-rail-shell" }, {
101
+ default: H(() => [
102
+ e.studioPanelEnabled && e.studioPanelCollapsed && !e.canvasFocusMode && !e.drawerOpen ? (k(), W("div", {
103
+ key: 0,
104
+ class: "workbench-assistant-rail-shell",
105
+ style: q({ flexBasis: `${de}px` }),
106
+ "data-i18n-aria-label": "FWA.f0e91787570935726",
107
+ "aria-label": J(u)("FWA.f0e91787570935726")
108
+ }, [
109
+ O(n.$slots, "collapsed-right", {}, void 0, !0)
110
+ ], 12, gt)) : U("", !0)
111
+ ]),
112
+ _: 3
113
+ }),
114
+ e.drawerOpen ? (k(), W("div", {
115
+ key: 2,
116
+ class: "workbench-shell__drawer",
117
+ style: q({ flexBasis: `${e.drawerWidth || 392}px` })
118
+ }, [
119
+ O(n.$slots, "drawer", {}, void 0, !0)
120
+ ], 4)) : U("", !0)
121
+ ], 2)
122
+ ]));
123
+ }
124
+ }), se = (e, t) => {
125
+ const r = e.__vccOpts || e;
126
+ for (const [n, o] of t)
127
+ r[n] = o;
128
+ return r;
129
+ }, wt = /* @__PURE__ */ se(bt, [["__scopeId", "data-v-1cfa390d"]]), yt = ["aria-label"], kt = { class: "workbench-extension-drawer__header" }, Et = { class: "workbench-extension-drawer__title" }, It = { class: "workbench-extension-drawer__body" }, At = /* @__PURE__ */ M({
130
+ __name: "WorkbenchDrawerOutlet",
131
+ props: {
132
+ drawerId: {},
133
+ onClose: { type: Function }
134
+ },
135
+ setup(e) {
136
+ const t = e, r = j(), n = re(null);
137
+ let o = !1;
138
+ async function s() {
139
+ var a;
140
+ await r.ready, !o && (n.value = t.drawerId && ((a = r.kernel.drawers.get(t.drawerId)) == null ? void 0 : a.contribution) || null);
141
+ }
142
+ return ke(() => {
143
+ s().catch((a) => {
144
+ r.services.loggerAdapter.error("Workbench drawer contribution failed to load", {
145
+ drawerId: t.drawerId,
146
+ message: a instanceof Error ? a.message : String(a)
147
+ });
148
+ });
149
+ }), Ee(() => t.drawerId, () => {
150
+ s();
151
+ }), L(() => {
152
+ o = !0, n.value = null;
153
+ }), (a, i) => n.value ? (k(), W("aside", {
154
+ key: 0,
155
+ class: "workbench-extension-drawer",
156
+ style: q({ width: `${n.value.defaultWidth || 392}px` }),
157
+ "aria-label": n.value.title
158
+ }, [
159
+ D("header", kt, [
160
+ D("h2", Et, Ke(n.value.title), 1),
161
+ D("button", {
162
+ type: "button",
163
+ class: "workbench-extension-drawer__close",
164
+ "aria-label": "Close",
165
+ onClick: i[0] || (i[0] = (d) => {
166
+ var c;
167
+ return (c = t.onClose) == null ? void 0 : c.call(t);
168
+ })
169
+ }, " × ")
170
+ ]),
171
+ D("div", It, [
172
+ (k(), V(ne(n.value.component)))
173
+ ])
174
+ ], 12, yt)) : U("", !0);
175
+ }
176
+ }), _t = /* @__PURE__ */ se(At, [["__scopeId", "data-v-5f390de6"]]);
177
+ function Rt(e, t, r) {
178
+ return e.filter((n) => {
179
+ var o;
180
+ if (n.slot !== t) return !1;
181
+ try {
182
+ return ((o = n.when) == null ? void 0 : o.call(n)) !== !1;
183
+ } catch (s) {
184
+ return r == null || r(n.id, s), !1;
185
+ }
186
+ });
187
+ }
188
+ const F = /* @__PURE__ */ M({
189
+ __name: "WorkbenchSlotOutlet",
190
+ props: {
191
+ slotName: {}
192
+ },
193
+ setup(e) {
194
+ const t = e, r = j(), n = re([]);
195
+ async function o() {
196
+ await r.ready, n.value = Rt(
197
+ r.kernel.slots.list().map((s) => s.contribution),
198
+ t.slotName,
199
+ (s, a) => {
200
+ r.services.loggerAdapter.warn("Workbench slot condition failed", {
201
+ contributionId: s,
202
+ message: a instanceof Error ? a.message : String(a),
203
+ slotName: t.slotName
204
+ });
205
+ }
206
+ );
207
+ }
208
+ return ke(() => {
209
+ o().catch((s) => {
210
+ var a;
211
+ (a = r.services.loggerAdapter) == null || a.error("Workbench slot contributions failed to load", {
212
+ message: s instanceof Error ? s.message : String(s),
213
+ slotName: t.slotName
214
+ });
215
+ });
216
+ }), (s, a) => (k(!0), W(qe, null, Ue(n.value, (i) => (k(), V(ne(i.component), {
217
+ key: i.id
218
+ }))), 128));
219
+ }
220
+ }), an = /* @__PURE__ */ M({
221
+ __name: "WorkbenchAppHost",
222
+ props: {
223
+ adapters: {},
224
+ config: {},
225
+ extensions: {},
226
+ runtime: {}
227
+ },
228
+ setup(e) {
229
+ const t = e, r = j();
230
+ function n(i) {
231
+ if (!i || typeof i != "object") return "";
232
+ const d = i.drawerId;
233
+ return typeof d == "string" ? d.trim() : "";
234
+ }
235
+ const o = r.kernel.events.on("workbench.drawer.open", (i) => {
236
+ var c, l;
237
+ const d = n(i);
238
+ d && ((l = (c = t.runtime).openDrawer) == null || l.call(c, d));
239
+ }), s = r.kernel.events.on("workbench.drawer.close", () => {
240
+ var i, d;
241
+ (d = (i = t.runtime).closeDrawer) == null || d.call(i);
242
+ });
243
+ L(() => {
244
+ o.dispose(), s.dispose();
245
+ });
246
+ const a = Ie(() => ({
247
+ canvasFocusMode: t.runtime.canvasFocusMode ?? !1,
248
+ drawerOpen: t.runtime.drawerOpen ?? !1,
249
+ drawerWidth: t.runtime.drawerWidth,
250
+ dragging: t.runtime.dragging ?? !1,
251
+ imageWorkbench: t.runtime.imageWorkbench ?? !1,
252
+ studioPanelCollapsed: t.runtime.studioPanelCollapsed ?? !1,
253
+ studioPanelEnabled: t.runtime.studioPanelEnabled ?? !0,
254
+ studioPanelWidth: t.runtime.studioPanelWidth ?? 420
255
+ }));
256
+ return (i, d) => (k(), V(ut, {
257
+ adapters: t.adapters,
258
+ config: t.config,
259
+ extensions: t.extensions
260
+ }, {
261
+ default: H(() => [
262
+ T(wt, {
263
+ "canvas-focus-mode": a.value.canvasFocusMode,
264
+ "drawer-open": a.value.drawerOpen,
265
+ "drawer-width": a.value.drawerWidth,
266
+ dragging: a.value.dragging,
267
+ "image-workbench": a.value.imageWorkbench,
268
+ "studio-panel-collapsed": a.value.studioPanelCollapsed,
269
+ "studio-panel-enabled": a.value.studioPanelEnabled,
270
+ "studio-panel-width": a.value.studioPanelWidth,
271
+ onStartDrag: d[0] || (d[0] = (c) => {
272
+ var l, b;
273
+ return (b = (l = t.runtime).startStudioPanelDrag) == null ? void 0 : b.call(l, c);
274
+ })
275
+ }, {
276
+ left: H(() => [
277
+ T(F, { "slot-name": "workspace.header.actions" }),
278
+ T(F, { "slot-name": "canvas.toolbar" }),
279
+ O(i.$slots, "left")
280
+ ]),
281
+ right: H(() => [
282
+ T(F, { "slot-name": "studio.toolbar" }),
283
+ T(F, { "slot-name": "studio.settings" }),
284
+ O(i.$slots, "right"),
285
+ T(F, { "slot-name": "studio.footer" })
286
+ ]),
287
+ "collapsed-right": H(() => [
288
+ O(i.$slots, "collapsed-right")
289
+ ]),
290
+ drawer: H(() => [
291
+ T(_t, {
292
+ "drawer-id": t.runtime.drawerId,
293
+ "on-close": t.runtime.closeDrawer
294
+ }, null, 8, ["drawer-id", "on-close"]),
295
+ O(i.$slots, "drawer"),
296
+ T(F, { "slot-name": "drawer.footer" })
297
+ ]),
298
+ _: 3
299
+ }, 8, ["canvas-focus-mode", "drawer-open", "drawer-width", "dragging", "image-workbench", "studio-panel-collapsed", "studio-panel-enabled", "studio-panel-width"])
300
+ ]),
301
+ _: 3
302
+ }, 8, ["adapters", "config", "extensions"]));
303
+ }
304
+ }), Ct = "workbench.builtin.card-center", Wt = "workbench.card-center", le = "workbench.card-center.drawer", vt = "workbench.card-center.open", cn = "workbench.card-center.insert-system-card", dn = "workbench.card-center.insert-custom-card", ln = "workbench.card-center.config-dialog-change", St = Q(
305
+ () => import("./WorkbenchCardCenterDrawer-CWBuBD04.js")
306
+ );
307
+ function Pt() {
308
+ return {
309
+ id: Ct,
310
+ kernelApiVersion: 1,
311
+ requires: {
312
+ plugins: ["workbench.core.drawer-commands"]
313
+ },
314
+ setup(e) {
315
+ e.capabilities.register({
316
+ id: Wt,
317
+ version: 1
318
+ }), e.drawers.register({
319
+ component: St,
320
+ defaultWidth: 400,
321
+ id: le,
322
+ title: u("FWA.3ade1787571500868")
323
+ }), e.commands.register({
324
+ id: vt,
325
+ execute: () => e.commands.execute(Ce, {
326
+ drawerId: le
327
+ })
328
+ });
329
+ },
330
+ version: "1.0.0"
331
+ };
332
+ }
333
+ const Tt = "workbench.optional.diagnostics", Nt = "workbench.diagnostics.route", Ot = "workbench.diagnostics.refresh", Dt = "workbench.diagnostics.refreshed", ue = Q(() => import("./WorkbenchDiagnosticsPage-D0mWFNWS.js")), Mt = Q(() => import("./WorkbenchDiagnosticsFooter-BxpwRNMe.js"));
334
+ function Bt() {
335
+ return {
336
+ id: Tt,
337
+ kernelApiVersion: 1,
338
+ /**
339
+ * 释放诊断插件资源;当前贡献均由注册作用域托管,无额外资源需要清理。
340
+ * @returns Nothing.
341
+ */
342
+ dispose() {
343
+ },
344
+ setup(e) {
345
+ var t;
346
+ if (((t = e.config.features) == null ? void 0 : t.debugRoutes) === !0 && (e.routes.register({
347
+ id: Nt,
348
+ loadComponent: async () => ue,
349
+ path: "diagnostics"
350
+ }), e.slots.register({
351
+ component: Mt,
352
+ id: "workbench.diagnostics.footer",
353
+ slot: "studio.footer"
354
+ }), e.drawers.register({
355
+ component: ue,
356
+ defaultWidth: 480,
357
+ id: Qe,
358
+ title: "运行态诊断"
359
+ }), e.commands.register({
360
+ id: Ot,
361
+ execute: async (r, n) => (n.services.loggerAdapter.info("Workbench diagnostics refreshed", {
362
+ instanceId: n.instanceId
363
+ }), await e.events.emit(Dt, {
364
+ instanceId: n.instanceId
365
+ }), e.instanceId)
366
+ }), !e.commands.has(Ce)))
367
+ throw new Error("WORKBENCH_DRAWER_OPEN_COMMAND_UNAVAILABLE");
368
+ },
369
+ version: "1.0.0"
370
+ };
371
+ }
372
+ const Ft = "workbench.builtin.settings", Ht = "workbench.settings", $t = "workbench.settings.open", Kt = "workbench.settings.close", qt = "workbench.settings.save", Ut = "workbench.settings.open-requested", xt = "workbench.settings.close-requested", Lt = "workbench.settings.save-requested";
373
+ function Vt() {
374
+ return {
375
+ id: Ft,
376
+ kernelApiVersion: 1,
377
+ setup(e) {
378
+ e.capabilities.register({ id: Ht, version: 1 }), e.commands.register({
379
+ id: $t,
380
+ execute: async () => (await e.events.emit(Ut), { opened: !0 })
381
+ }), e.commands.register({
382
+ id: Kt,
383
+ execute: async () => (await e.events.emit(xt), { closed: !0 })
384
+ }), e.commands.register({
385
+ id: qt,
386
+ execute: async (t) => (await e.events.emit(Lt, t), { requested: !0 })
387
+ });
388
+ },
389
+ version: "1.0.0"
390
+ };
391
+ }
392
+ const Gt = "workbench.builtin.theme", zt = "workbench.theme", Qt = "workbench.theme.apply", jt = "workbench.theme.apply-requested";
393
+ function Yt(e) {
394
+ const t = e && typeof e == "object" ? e.themeKey : void 0;
395
+ if (typeof t != "string" || !t.trim())
396
+ throw new Error("WORKBENCH_THEME_KEY_REQUIRED");
397
+ return t.trim();
398
+ }
399
+ function Jt() {
400
+ return {
401
+ id: Gt,
402
+ kernelApiVersion: 1,
403
+ setup(e) {
404
+ e.capabilities.register({ id: zt, version: 1 }), e.commands.register({
405
+ id: Qt,
406
+ execute: async (t) => {
407
+ const n = { themeKey: Yt(t) };
408
+ return await e.events.emit(jt, n), n;
409
+ }
410
+ });
411
+ },
412
+ version: "1.0.0"
413
+ };
414
+ }
415
+ const Xt = [
416
+ {
417
+ criticality: "core",
418
+ plugin: je()
419
+ },
420
+ {
421
+ criticality: "optional",
422
+ plugin: Pt()
423
+ },
424
+ {
425
+ criticality: "optional",
426
+ plugin: Jt()
427
+ },
428
+ {
429
+ criticality: "optional",
430
+ plugin: Vt()
431
+ },
432
+ {
433
+ criticality: "optional",
434
+ plugin: Bt()
435
+ }
436
+ ];
437
+ function Zt(e) {
438
+ if (e !== void 0)
439
+ return typeof e == "string" ? e : JSON.stringify(e);
440
+ }
441
+ function er(e) {
442
+ try {
443
+ return JSON.parse(e);
444
+ } catch {
445
+ return e;
446
+ }
447
+ }
448
+ const tr = {
449
+ async openEventStream(e) {
450
+ await Ye(e.url, {
451
+ body: Zt(e.body),
452
+ headers: {
453
+ ...e.headers,
454
+ ...e.lastEventId ? { "Last-Event-ID": e.lastEventId } : {}
455
+ },
456
+ method: e.method || "POST",
457
+ onmessage(t) {
458
+ t.data && e.onEvent(er(t.data), { id: t.id });
459
+ },
460
+ async onopen(t) {
461
+ var r;
462
+ if (!t.ok) throw new Error(`HTTP ${t.status}`);
463
+ (r = e.onOpen) == null || r.call(e);
464
+ },
465
+ onerror(t) {
466
+ var r;
467
+ throw (r = e.onError) == null || r.call(e, t instanceof Error ? t : new Error(String(t))), t;
468
+ },
469
+ openWhenHidden: e.openWhenHidden,
470
+ signal: e.signal
471
+ });
472
+ },
473
+ requestJson(e) {
474
+ return Je({
475
+ headers: e.headers,
476
+ method: e.method,
477
+ payload: e.body,
478
+ signal: e.signal,
479
+ url: e.url
480
+ });
481
+ }
482
+ }, ve = {
483
+ ensureSessionReady: Xe,
484
+ requestJson(e) {
485
+ return Ze({
486
+ headers: e.headers,
487
+ method: e.method,
488
+ params: e.params,
489
+ payload: e.payload,
490
+ signal: e.signal,
491
+ url: e.url
492
+ });
493
+ }
494
+ };
495
+ function rr(e) {
496
+ const t = {}, r = new URLSearchParams(e.replace(/^\?/, ""));
497
+ for (const [n, o] of r.entries()) {
498
+ const s = t[n];
499
+ t[n] = s === void 0 ? o : Array.isArray(s) ? [...s, o] : [s, o];
500
+ }
501
+ return t;
502
+ }
503
+ function nr() {
504
+ return {
505
+ push(e) {
506
+ typeof window > "u" || window.history.pushState({}, "", e);
507
+ },
508
+ readQuery() {
509
+ return typeof window > "u" ? {} : rr(window.location.search);
510
+ },
511
+ replaceQuery(e) {
512
+ if (typeof window > "u") return;
513
+ const t = new URL(window.location.href);
514
+ t.search = "";
515
+ for (const [r, n] of Object.entries(e))
516
+ n !== void 0 && t.searchParams.set(r, n);
517
+ window.history.replaceState({}, "", t);
518
+ }
519
+ };
520
+ }
521
+ function or() {
522
+ const e = /* @__PURE__ */ new Map(), t = (() => {
523
+ try {
524
+ return globalThis.localStorage;
525
+ } catch {
526
+ return;
527
+ }
528
+ })();
529
+ return {
530
+ getItem(r) {
531
+ return (t == null ? void 0 : t.getItem(r)) ?? e.get(r) ?? null;
532
+ },
533
+ removeItem(r) {
534
+ t == null || t.removeItem(r), e.delete(r);
535
+ },
536
+ setItem(r, n) {
537
+ t == null || t.setItem(r, n), e.set(r, n);
538
+ }
539
+ };
540
+ }
541
+ function sr(e) {
542
+ return {
543
+ readIdentity: () => ve.requestJson({
544
+ headers: { "Content-Type": "application/json" },
545
+ method: "GET",
546
+ url: e.resolve("workbench.identity")
547
+ })
548
+ };
549
+ }
550
+ const ar = {
551
+ uploadFile(e, t) {
552
+ if (!(t != null && t.url)) throw new Error("WORKBENCH_UPLOAD_URL_REQUIRED");
553
+ return et({
554
+ file: e,
555
+ filename: t.fileName,
556
+ url: t.url
557
+ });
558
+ }
559
+ };
560
+ function fe(e, t) {
561
+ var n;
562
+ const r = (n = e == null ? void 0 : e[t]) == null ? void 0 : n.trim();
563
+ if (!r) throw new Error(`WORKBENCH_REALTIME_PARAM_REQUIRED:${t}`);
564
+ return r;
565
+ }
566
+ const ir = {
567
+ connect(e) {
568
+ const t = fe(e.params, "workspaceId"), r = fe(e.params, "userId"), n = tt({
569
+ baseUrl: e.channel,
570
+ onEvent: (o) => e.onEvent(o),
571
+ socketPath: e.socketPath,
572
+ userId: r,
573
+ workspaceId: t
574
+ });
575
+ return n.connect(), {
576
+ disconnect: () => n.disconnect(),
577
+ requestSnapshot: () => n.requestSnapshot()
578
+ };
579
+ }
580
+ };
581
+ function Se(e = {}) {
582
+ return {
583
+ resolve(t, r) {
584
+ var s;
585
+ const n = ((s = e.endpoints) == null ? void 0 : s[t]) || t, o = Object.entries(r || {}).filter(([, a]) => a !== void 0).map(([a, i]) => `${encodeURIComponent(a)}=${encodeURIComponent(String(i))}`).join("&");
586
+ return o ? `${n}${n.includes("?") ? "&" : "?"}${o}` : n;
587
+ }
588
+ };
589
+ }
590
+ const un = Se();
591
+ function cr(e, t = {}) {
592
+ const r = e.endpointResolver ?? Se(t);
593
+ return {
594
+ ...e,
595
+ agentTransportAdapter: e.agentTransportAdapter ?? tr,
596
+ assetAdapter: e.assetAdapter ?? Re,
597
+ endpointResolver: r,
598
+ loggerAdapter: e.loggerAdapter ?? _e,
599
+ messageAdapter: e.messageAdapter ?? Ae,
600
+ platformRequestAdapter: e.platformRequestAdapter ?? ve,
601
+ realtimeAdapter: e.realtimeAdapter ?? ir,
602
+ identityAdapter: e.identityAdapter ?? sr(r),
603
+ routerAdapter: e.routerAdapter ?? nr(),
604
+ storageAdapter: e.storageAdapter ?? or(),
605
+ uploadAdapter: e.uploadAdapter ?? ar,
606
+ transportMode: t.transportMode ?? "adapter"
607
+ };
608
+ }
609
+ function Pe(e = {}) {
610
+ const t = /* @__PURE__ */ new Map(), r = e.duplicatePolicy ?? "preserve-first";
611
+ return {
612
+ clear() {
613
+ t.clear();
614
+ },
615
+ get(n) {
616
+ return t.get(n);
617
+ },
618
+ has(n) {
619
+ return t.has(n);
620
+ },
621
+ list() {
622
+ return [...t.values()].sort((n, o) => (n.contribution.order ?? 0) - (o.contribution.order ?? 0) || n.contribution.id.localeCompare(o.contribution.id));
623
+ },
624
+ register(n, o) {
625
+ var d;
626
+ const s = t.get(o.id);
627
+ if (s && s.contribution.overridable !== !0) {
628
+ const c = {
629
+ id: o.id,
630
+ existingOwnerId: s.ownerId,
631
+ existingContribution: s.contribution,
632
+ incomingOwnerId: n,
633
+ incomingContribution: o
634
+ };
635
+ if ((d = e.onConflict) == null || d.call(e, c), r === "throw")
636
+ throw new Error(`Duplicate workbench contribution: ${o.id}`);
637
+ return { active: !1, dispose: () => {
638
+ } };
639
+ }
640
+ const a = { contribution: o, ownerId: n };
641
+ t.set(o.id, a);
642
+ let i = !0;
643
+ return {
644
+ active: !0,
645
+ dispose() {
646
+ i && (i = !1, t.get(o.id) === a && (s ? t.set(o.id, s) : t.delete(o.id)));
647
+ }
648
+ };
649
+ }
650
+ };
651
+ }
652
+ function dr(e, t = Pe()) {
653
+ return {
654
+ async execute(r, n) {
655
+ var s;
656
+ const o = (s = t.get(r)) == null ? void 0 : s.contribution;
657
+ if (!o) throw new Error(`Workbench command not found: ${r}`);
658
+ return await o.execute(n, e);
659
+ },
660
+ has(r) {
661
+ return t.has(r);
662
+ },
663
+ register(r, n) {
664
+ return t.register(r, n);
665
+ }
666
+ };
667
+ }
668
+ function lr() {
669
+ const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), r = [];
670
+ return {
671
+ recordContribution(n) {
672
+ t.set(`${n.type}:${n.id}:${n.ownerId}`, { ...n });
673
+ },
674
+ recordPlugin(n) {
675
+ e.set(n.id, { ...n });
676
+ },
677
+ snapshot() {
678
+ return {
679
+ contributions: [...t.values()].sort((n, o) => `${n.type}:${n.id}:${n.ownerId}`.localeCompare(`${o.type}:${o.id}:${o.ownerId}`)),
680
+ plugins: [...e.values()].sort((n, o) => n.id.localeCompare(o.id)),
681
+ warnings: [...r]
682
+ };
683
+ },
684
+ warn(n) {
685
+ r.push(n);
686
+ }
687
+ };
688
+ }
689
+ function ur(e) {
690
+ const t = /* @__PURE__ */ new Map();
691
+ return {
692
+ async emit(r, n) {
693
+ const o = [...t.get(r) ?? []];
694
+ await Promise.all(o.map(async (s) => {
695
+ try {
696
+ await s(n);
697
+ } catch (a) {
698
+ e == null || e(r, a);
699
+ }
700
+ }));
701
+ },
702
+ on(r, n) {
703
+ const o = t.get(r) ?? /* @__PURE__ */ new Set();
704
+ o.add(n), t.set(r, o);
705
+ let s = !0;
706
+ return {
707
+ active: !0,
708
+ dispose() {
709
+ s && (s = !1, o.delete(n), o.size === 0 && t.delete(r));
710
+ }
711
+ };
712
+ }
713
+ };
714
+ }
715
+ function fr() {
716
+ const e = [];
717
+ let t = !1;
718
+ return {
719
+ dispose() {
720
+ if (!t) {
721
+ t = !0;
722
+ for (const r of [...e].reverse())
723
+ r.dispose();
724
+ e.length = 0;
725
+ }
726
+ },
727
+ track(r) {
728
+ return t ? (r.dispose(), { active: !1, dispose: () => {
729
+ } }) : (e.push(r), r);
730
+ }
731
+ };
732
+ }
733
+ function he(e) {
734
+ return e instanceof Error ? e.message : String(e);
735
+ }
736
+ function hr(e) {
737
+ const t = [], r = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
738
+ function o(s) {
739
+ var i;
740
+ if (n.has(s)) return;
741
+ if (r.has(s)) throw new Error(`Circular workbench plugin dependency: ${s}`);
742
+ const a = e.get(s);
743
+ if (a) {
744
+ r.add(s);
745
+ for (const d of [...((i = a.plugin.requires) == null ? void 0 : i.plugins) ?? []].sort())
746
+ o(d);
747
+ r.delete(s), n.add(s), t.push(a);
748
+ }
749
+ }
750
+ for (const s of [...e.keys()].sort()) o(s);
751
+ return t;
752
+ }
753
+ function mr(e) {
754
+ const t = /* @__PURE__ */ new Map(), r = [];
755
+ let n = !1, o = !1;
756
+ function s(i) {
757
+ if (n || o) throw new Error("Workbench plugins must be registered before initialization");
758
+ if (t.has(i.plugin.id))
759
+ throw new Error(`Duplicate workbench plugin: ${i.plugin.id}`);
760
+ t.set(i.plugin.id, i), e.diagnostics.recordPlugin({
761
+ id: i.plugin.id,
762
+ status: "registered",
763
+ version: i.plugin.version
764
+ });
765
+ }
766
+ async function a() {
767
+ var i, d;
768
+ for (const c of [...r].reverse())
769
+ try {
770
+ await ((d = (i = c.registration.plugin).dispose) == null ? void 0 : d.call(i));
771
+ } catch (l) {
772
+ e.diagnostics.warn(
773
+ `Plugin dispose failed: ${c.registration.plugin.id}: ${he(l)}`
774
+ );
775
+ } finally {
776
+ c.scope.dispose();
777
+ }
778
+ r.length = 0;
779
+ }
780
+ return {
781
+ async dispose() {
782
+ o || (o = !0, await a());
783
+ },
784
+ async initialize(i = {}) {
785
+ var l, b, A, P;
786
+ if (o) throw new Error("Workbench plugin manager is disposed");
787
+ if (n) return;
788
+ n = !0;
789
+ const d = new Set(i.disabledPluginIds ?? []), c = /* @__PURE__ */ new Set();
790
+ for (const S of hr(t)) {
791
+ const { plugin: h } = S;
792
+ if (S.criticality === "optional" && h.remoteConfigurable === !0 && d.has(h.id)) {
793
+ e.diagnostics.recordPlugin({
794
+ id: h.id,
795
+ reason: "disabled by remote capability config",
796
+ status: "disabled",
797
+ version: h.version
798
+ });
799
+ continue;
800
+ }
801
+ const B = (b = (l = h.requires) == null ? void 0 : l.plugins) == null ? void 0 : b.find((y) => !c.has(y));
802
+ if (B) {
803
+ const y = new Error(`Missing active workbench plugin dependency: ${h.id} -> ${B}`);
804
+ if (e.diagnostics.recordPlugin({
805
+ id: h.id,
806
+ reason: y.message,
807
+ status: S.criticality === "core" ? "failed" : "disabled",
808
+ version: h.version
809
+ }), S.criticality === "core")
810
+ throw await a(), y;
811
+ continue;
812
+ }
813
+ const p = fr(), g = e.createContext(h.id, p), f = (P = (A = h.requires) == null ? void 0 : A.capabilities) == null ? void 0 : P.find(
814
+ (y) => !g.capabilities.isEnabled(y)
815
+ );
816
+ if (f) {
817
+ p.dispose();
818
+ const y = new Error(`Missing workbench capability dependency: ${h.id} -> ${f}`);
819
+ if (e.diagnostics.recordPlugin({
820
+ id: h.id,
821
+ reason: y.message,
822
+ status: S.criticality === "core" ? "failed" : "disabled",
823
+ version: h.version
824
+ }), S.criticality === "core")
825
+ throw await a(), y;
826
+ continue;
827
+ }
828
+ try {
829
+ await h.setup(g), r.push({ registration: S, scope: p }), c.add(h.id), e.diagnostics.recordPlugin({ id: h.id, status: "active", version: h.version });
830
+ } catch (y) {
831
+ if (p.dispose(), e.diagnostics.recordPlugin({
832
+ id: h.id,
833
+ reason: he(y),
834
+ status: "failed",
835
+ version: h.version
836
+ }), S.criticality === "core")
837
+ throw await a(), y;
838
+ }
839
+ }
840
+ },
841
+ registerBuiltIn(i, d) {
842
+ s({
843
+ criticality: d.criticality,
844
+ plugin: i,
845
+ source: "built-in"
846
+ });
847
+ },
848
+ registerHost(i) {
849
+ s({ criticality: "optional", plugin: i, source: "host" });
850
+ }
851
+ };
852
+ }
853
+ function $(e, t, r) {
854
+ const n = Pe({
855
+ duplicatePolicy: t ? "throw" : "preserve-first",
856
+ onConflict(o) {
857
+ r.recordContribution({
858
+ id: o.id,
859
+ ownerId: o.incomingOwnerId,
860
+ reason: `conflicts with ${o.existingOwnerId}`,
861
+ status: "conflict",
862
+ type: e
863
+ });
864
+ }
865
+ });
866
+ return {
867
+ raw: n,
868
+ owned: {
869
+ get: (o) => n.get(o),
870
+ has: (o) => n.has(o),
871
+ list: () => n.list(),
872
+ register(o, s) {
873
+ const a = n.register(o, s);
874
+ return a.active && r.recordContribution({
875
+ id: s.id,
876
+ ownerId: o,
877
+ status: "active",
878
+ type: e
879
+ }), a;
880
+ }
881
+ }
882
+ };
883
+ }
884
+ function pr(e = {}) {
885
+ const t = lr(), r = e.strictRegistrations === !0, n = e.config ?? {}, o = cr(e.services ?? {}, {
886
+ endpoints: n.endpoints,
887
+ transportMode: n.transportMode
888
+ }), s = e.instanceId ?? "workbench-kernel", a = rt(s), i = $("route", r, t), d = $("slot", r, t), c = $("drawer", r, t), l = $("card", r, t), b = $("capability", r, t), A = $("command", r, t), P = dr(
889
+ { config: n, instanceId: s, services: o },
890
+ A.raw
891
+ ), S = ur((p, g) => {
892
+ const f = g instanceof Error ? g.message : String(g);
893
+ t.warn(`Event listener failed: ${p}: ${f}`);
894
+ }), h = {
895
+ ...b.owned,
896
+ isEnabled(p) {
897
+ var f;
898
+ const g = (f = b.raw.get(p)) == null ? void 0 : f.contribution;
899
+ return g ? typeof g.enabled == "function" ? g.enabled() : g.enabled !== !1 : !1;
900
+ }
901
+ };
902
+ function ae(p, g) {
903
+ return {
904
+ capabilities: {
905
+ has: (f) => h.has(f),
906
+ isEnabled: (f) => h.isEnabled(f),
907
+ register: (f) => g.track(h.register(p, f))
908
+ },
909
+ cards: {
910
+ register: (f) => g.track(l.owned.register(p, f))
911
+ },
912
+ commands: {
913
+ execute: (f, y) => P.execute(f, y),
914
+ has: (f) => P.has(f),
915
+ register: (f) => g.track(P.register(p, f))
916
+ },
917
+ config: n,
918
+ drawers: {
919
+ register: (f) => g.track(c.owned.register(p, f))
920
+ },
921
+ events: {
922
+ emit: (f, y) => S.emit(f, y),
923
+ on: (f, y) => g.track(S.on(f, y))
924
+ },
925
+ instanceId: s,
926
+ routes: {
927
+ register: (f) => g.track(i.owned.register(p, f))
928
+ },
929
+ runtime: a,
930
+ services: o,
931
+ slots: {
932
+ register: (f) => g.track(d.owned.register(p, f))
933
+ }
934
+ };
935
+ }
936
+ const B = mr({ createContext: ae, diagnostics: t });
937
+ return {
938
+ capabilities: h,
939
+ cards: l.owned,
940
+ commands: P,
941
+ diagnostics: t,
942
+ async dispose() {
943
+ await B.dispose(), i.raw.clear(), d.raw.clear(), c.raw.clear(), l.raw.clear(), b.raw.clear(), A.raw.clear(), a.dispose();
944
+ },
945
+ drawers: c.owned,
946
+ events: S,
947
+ initialize: (p) => B.initialize(p),
948
+ registerBuiltInPlugin: (p, g) => B.registerBuiltIn(p, g),
949
+ registerHostPlugin: (p) => B.registerHost(p),
950
+ routes: i.owned,
951
+ runtime: a,
952
+ services: o,
953
+ slots: d.owned
954
+ };
955
+ }
956
+ function gr() {
957
+ var t, r;
958
+ const e = (r = (t = globalThis.crypto) == null ? void 0 : t.randomUUID) == null ? void 0 : r.call(t);
959
+ return e ? `workbench-${e}` : `workbench-${Date.now()}-${Math.random().toString(36).slice(2, 10)}`;
960
+ }
961
+ function br(e, t) {
962
+ var d;
963
+ const r = t.featureRoutes ?? [], n = t.slots ?? [], o = t.commands ?? [], s = t.capabilities ?? [], a = t.drawers ?? [], i = [
964
+ ...t.cardContributions ?? [],
965
+ ...(((d = t.cards) == null ? void 0 : d.customCardCatalog) ?? []).map((c, l) => ({
966
+ capabilityId: c.capabilityId,
967
+ id: `legacy.card.${c.capabilityId}`,
968
+ order: l
969
+ }))
970
+ ];
971
+ return r.length === 0 && n.length === 0 && o.length === 0 && s.length === 0 && a.length === 0 && i.length === 0 ? null : {
972
+ id: `host.manifest.${e}`,
973
+ kernelApiVersion: 1,
974
+ setup(c) {
975
+ for (const l of s) c.capabilities.register(l);
976
+ for (const l of i) c.cards.register(l);
977
+ for (const l of o) c.commands.register(l);
978
+ for (const l of a) c.drawers.register(l);
979
+ for (const l of r) c.routes.register(l);
980
+ for (const l of n) c.slots.register(l);
981
+ },
982
+ version: "1.0.0"
983
+ };
984
+ }
985
+ function Te(e, t = {}) {
986
+ const r = t.instanceId ?? gr(), n = Ge(e.extensions), o = pr({
987
+ config: e.config,
988
+ instanceId: r,
989
+ services: e.adapters,
990
+ strictRegistrations: t.strictRegistrations
991
+ });
992
+ for (const i of n.warnings) o.diagnostics.warn(i);
993
+ for (const i of t.builtInPlugins ?? Xt)
994
+ o.registerBuiltInPlugin(i.plugin, { criticality: i.criticality });
995
+ for (const i of n.manifest.plugins ?? []) o.registerHostPlugin(i);
996
+ const s = br(r, n.manifest);
997
+ s && o.registerHostPlugin(s);
998
+ const a = o.initialize({ disabledPluginIds: t.disabledPluginIds });
999
+ return {
1000
+ config: e.config,
1001
+ dispose: () => o.dispose(),
1002
+ extensions: n.manifest,
1003
+ instanceId: r,
1004
+ kernel: o,
1005
+ ready: a,
1006
+ runtime: o.runtime,
1007
+ services: o.services
1008
+ };
1009
+ }
1010
+ const fn = /* @__PURE__ */ M({
1011
+ __name: "WorkbenchApplication",
1012
+ props: {
1013
+ adapters: {},
1014
+ config: {},
1015
+ embedInPortal: { type: Boolean, default: !1 },
1016
+ extensions: {}
1017
+ },
1018
+ setup(e) {
1019
+ const t = e, r = Te({
1020
+ adapters: t.adapters,
1021
+ config: t.config,
1022
+ extensions: t.extensions
1023
+ });
1024
+ G(oe, r);
1025
+ const n = nt(
1026
+ `workbench-runtime-${r.instanceId}`,
1027
+ {
1028
+ agentTransportAdapter: r.services.agentTransportAdapter,
1029
+ canvasBus: r.runtime.canvasBus,
1030
+ endpointResolver: r.services.endpointResolver,
1031
+ platformRequestAdapter: r.services.platformRequestAdapter,
1032
+ realtimeAdapter: r.services.realtimeAdapter,
1033
+ storageAdapter: r.services.storageAdapter,
1034
+ transportMode: r.services.transportMode
1035
+ }
1036
+ );
1037
+ G(ot, n), r.ready.catch((a) => {
1038
+ var i;
1039
+ (i = t.adapters.loggerAdapter) == null || i.error("Workbench host context initialization failed", {
1040
+ message: a instanceof Error ? a.message : String(a)
1041
+ });
1042
+ }), L(() => {
1043
+ var i;
1044
+ const a = n();
1045
+ (i = a.disposeRuntimeResources) == null || i.call(a), r.dispose();
1046
+ });
1047
+ const o = ze(r.extensions);
1048
+ Ve(t.adapters, t.config, o);
1049
+ const s = Q(() => import("./Workspace-DwnUU7_7.js"));
1050
+ return (a, i) => (k(), V(J(s), {
1051
+ "embed-in-portal": t.embedInPortal
1052
+ }, {
1053
+ "before-workbench": H(() => [
1054
+ O(a.$slots, "before-workbench"),
1055
+ T(F, { "slot-name": "workspace.before" })
1056
+ ]),
1057
+ _: 3
1058
+ }, 8, ["embed-in-portal"]));
1059
+ }
1060
+ });
1061
+ function hn(e = {}) {
1062
+ const t = /* @__PURE__ */ new Map();
1063
+ return {
1064
+ agentTransportAdapter: {
1065
+ openEventStream: async () => {
1066
+ },
1067
+ requestJson: async () => ({})
1068
+ },
1069
+ assetAdapter: Re,
1070
+ identityAdapter: {
1071
+ readIdentity: () => ({ appId: "test-app", roleId: "default", tenantId: "test-tenant", userId: "test-user" })
1072
+ },
1073
+ loggerAdapter: _e,
1074
+ messageAdapter: Ae,
1075
+ platformRequestAdapter: {
1076
+ ensureSessionReady: async () => !0,
1077
+ requestJson: async () => ({})
1078
+ },
1079
+ routerAdapter: {
1080
+ push: () => {
1081
+ },
1082
+ readQuery: () => ({}),
1083
+ replaceQuery: () => {
1084
+ }
1085
+ },
1086
+ storageAdapter: {
1087
+ getItem: (r) => t.get(r) ?? null,
1088
+ removeItem: (r) => {
1089
+ t.delete(r);
1090
+ },
1091
+ setItem: (r, n) => {
1092
+ t.set(r, n);
1093
+ }
1094
+ },
1095
+ uploadAdapter: {
1096
+ uploadFile: async () => ({})
1097
+ },
1098
+ ...e
1099
+ };
1100
+ }
1101
+ const wr = [
1102
+ "attachments",
1103
+ "cards",
1104
+ "cardRecommendationDraft",
1105
+ "defaultExpanded",
1106
+ "detail",
1107
+ "error",
1108
+ "initialEventsPending",
1109
+ "markThinking",
1110
+ "memoryCaptureDraft",
1111
+ "planDraft",
1112
+ "processInvocations",
1113
+ "processPreamble",
1114
+ "queryResultTable",
1115
+ "queryResultTables",
1116
+ "registeredCardInsertDraft",
1117
+ "removeThinking",
1118
+ "taskStateDraft",
1119
+ "thinkingProcess",
1120
+ "thinkingProcessMessages",
1121
+ "workbenchTurnId"
1122
+ ];
1123
+ function mn(e, t) {
1124
+ for (const r of wr)
1125
+ e[r] = t[r];
1126
+ }
1127
+ function yr(e) {
1128
+ const t = e.cardRecommendationDraft;
1129
+ if (!t || typeof t != "object") return "";
1130
+ const r = t.sourceTurnId;
1131
+ return typeof r == "string" && r.trim() ? r.trim() : "";
1132
+ }
1133
+ function kr(e) {
1134
+ const t = e.cardRecommendationDraft;
1135
+ if (!t || typeof t != "object") return "";
1136
+ const r = t.placementTurnId;
1137
+ return typeof r == "string" && r.trim() ? r.trim() : "";
1138
+ }
1139
+ function Ne(e) {
1140
+ const t = e.workbenchTurnId;
1141
+ return typeof t == "string" && t.trim() ? t.trim() : "";
1142
+ }
1143
+ function Oe(e) {
1144
+ if (typeof e != "string" || !e.startsWith("workbench-turn-")) return "";
1145
+ const t = ["-reply", "-conclusion-stream", "-item-", "-process-", "-task-", "-card-mutation-confirmation"];
1146
+ for (const r of t) {
1147
+ const n = e.indexOf(r, 15);
1148
+ if (n > 15) return e.slice(15, n);
1149
+ }
1150
+ return "";
1151
+ }
1152
+ function X(e, t) {
1153
+ var n;
1154
+ if (e.role !== "assistant" || !((n = e.content) != null && n.trim())) return !1;
1155
+ const r = Ne(e);
1156
+ return r ? r === t : Oe(e.id) !== t ? !1 : typeof e.id == "string" && (e.id.endsWith("-reply") || e.id.endsWith("-conclusion-stream"));
1157
+ }
1158
+ function me(e, t) {
1159
+ return !!(t && e.some((r) => X(r, t)));
1160
+ }
1161
+ function Er(e, t) {
1162
+ const r = yr(t), n = kr(t);
1163
+ return me(e, r) ? r : me(e, n) ? n : n || Ne(t) || r || Oe(t.id);
1164
+ }
1165
+ function pn(e) {
1166
+ for (const t of e.appendedMessages.values()) {
1167
+ if (!t.cardRecommendationDraft) continue;
1168
+ const r = Er(e.messages, t);
1169
+ if (!r) continue;
1170
+ const n = e.messages.indexOf(t);
1171
+ if (n < 0) continue;
1172
+ const o = e.messages.findIndex((i) => X(i, r));
1173
+ if (o < 0 || n === o + 1) continue;
1174
+ const [s] = e.messages.splice(n, 1), a = e.messages.findIndex((i) => X(i, r));
1175
+ if (a < 0) {
1176
+ e.messages.splice(n, 0, s);
1177
+ continue;
1178
+ }
1179
+ e.messages.splice(a + 1, 0, s);
1180
+ }
1181
+ }
1182
+ function Ir(e) {
1183
+ return !e.thinkingProcess;
1184
+ }
1185
+ function Ar(e) {
1186
+ const t = e.content.trim();
1187
+ if (!Ir(e)) return t;
1188
+ const r = t.replace(/完成(?:,用时 .*)?$/u, "").trim();
1189
+ return u("FWA.cc001787570980831", { p0: r });
1190
+ }
1191
+ function gn(e, t) {
1192
+ return {
1193
+ content: Ar(e),
1194
+ loading: !1,
1195
+ ...typeof e.startTime == "number" ? { startTime: e.startTime } : {},
1196
+ ...typeof e.endTime == "number" ? { endTime: e.endTime } : typeof t == "number" ? { endTime: t } : {}
1197
+ };
1198
+ }
1199
+ function N(e) {
1200
+ return e && typeof e == "object" && !Array.isArray(e) ? e : {};
1201
+ }
1202
+ function m(e) {
1203
+ return typeof e == "string" ? e.trim() : typeof e == "number" || typeof e == "boolean" ? String(e) : "";
1204
+ }
1205
+ function pe(e) {
1206
+ return Array.isArray(e) ? String(e.length) : "";
1207
+ }
1208
+ function De(e) {
1209
+ const t = N(e);
1210
+ return [
1211
+ m(t.bindingId),
1212
+ m(t.id),
1213
+ m(t.metricId),
1214
+ m(t.metricCode),
1215
+ m(t.source),
1216
+ m(t.bindingKind),
1217
+ m(t.serviceOperation),
1218
+ m(t.refreshApi),
1219
+ m(t.contractHash)
1220
+ ].join("|");
1221
+ }
1222
+ function Me(e) {
1223
+ const t = N(e), r = N(t.data);
1224
+ return [
1225
+ m(t.resultId),
1226
+ m(t.sourceTurnId),
1227
+ m(t.rowCount),
1228
+ pe(t.rows || r.rows),
1229
+ pe(t.columns || r.columns),
1230
+ De(t.dataBinding || r.dataBinding)
1231
+ ].join("|");
1232
+ }
1233
+ function _r(e) {
1234
+ const t = N(e), r = N(t.blockPlan), n = N(r.data), o = N(r.meta), s = N(o.queryResult);
1235
+ return [
1236
+ m(t.recommendationId),
1237
+ m(t.capabilityId),
1238
+ m(t.title),
1239
+ m(t.previewStatus),
1240
+ m(t.nextAction),
1241
+ m(t.dataShape),
1242
+ m(r.id),
1243
+ m(r.title),
1244
+ De(t.dataBinding || n.dataBinding),
1245
+ Me(t.queryResult || s)
1246
+ ].join(":");
1247
+ }
1248
+ function bn(e) {
1249
+ const t = N(e), r = typeof t.type == "string" ? t.type : "";
1250
+ if (r === "card_recommendations_ready") {
1251
+ const n = Array.isArray(t.recommendations) ? t.recommendations : [], o = st({
1252
+ payload: t,
1253
+ conversationId: m(t.conversationId),
1254
+ groupType: r
1255
+ });
1256
+ return [
1257
+ r,
1258
+ o.renderKey,
1259
+ m(t.sourceTurnId),
1260
+ m(t.placementTurnId),
1261
+ Me(t.queryResult),
1262
+ n.map(_r).join(",")
1263
+ ].join(":");
1264
+ }
1265
+ if (r === "query_result_table_ready") {
1266
+ const n = N(t.queryResult), o = Array.isArray(n.rows) ? n.rows.length : "", s = Array.isArray(n.columns) ? n.columns.length : "";
1267
+ return `${r}:${o}:${s}:${n.rowCount ?? ""}`;
1268
+ }
1269
+ return r;
1270
+ }
1271
+ const Rr = /* @__PURE__ */ new Set(["pending", "running"]), Cr = "/data-binding-candidate/query", Wr = "/workbench/v2/documents/", vr = "/data-bindings/";
1272
+ function Sr(e) {
1273
+ return typeof (e == null ? void 0 : e.refreshApi) == "string" ? e.refreshApi.trim() : "";
1274
+ }
1275
+ function Pr(e) {
1276
+ return e.includes(Cr);
1277
+ }
1278
+ function Be(e) {
1279
+ let t = e;
1280
+ try {
1281
+ t = new URL(e, "http://localhost").pathname;
1282
+ } catch {
1283
+ t = e;
1284
+ }
1285
+ return t.includes(Wr) && t.includes(vr);
1286
+ }
1287
+ function Z(e) {
1288
+ return !!(e && typeof e == "object" && !Array.isArray(e));
1289
+ }
1290
+ function v(e) {
1291
+ if (!Z(e)) return !1;
1292
+ const t = typeof e.source == "string" ? e.source.trim().toLowerCase() : "", r = typeof e.sourceType == "string" ? e.sourceType.trim().toLowerCase() : "", n = typeof e.composeSource == "string" ? e.composeSource.trim().toLowerCase() : "";
1293
+ return t === "image" || r === "image" || n === "image" || v(e.params);
1294
+ }
1295
+ function x(e) {
1296
+ return Z(e) ? v(e) || v(e.recognition) ? !0 : Z(e.v2) ? x(e.v2) : !1 : !1;
1297
+ }
1298
+ function Tr(e, t, r) {
1299
+ return (t == null ? void 0 : t.suppressImageComposeAutoRefresh) !== !0 || !Be(r) ? !1 : v(e == null ? void 0 : e.params) || v(e) || v(t) || v(t == null ? void 0 : t.source) || v(t == null ? void 0 : t.data) || x(t == null ? void 0 : t.recognition) || x(t == null ? void 0 : t.meta);
1300
+ }
1301
+ function Nr(e, t) {
1302
+ return v(e == null ? void 0 : e.params) || v(e) || v(t) || v(t == null ? void 0 : t.source) || v(t == null ? void 0 : t.data) || x(t == null ? void 0 : t.recognition) || x(t == null ? void 0 : t.meta);
1303
+ }
1304
+ function wn(e, t) {
1305
+ if (!e) return !1;
1306
+ const r = Sr(e);
1307
+ if (!r || Pr(r) || Tr(e, t, r)) return !1;
1308
+ const n = typeof (e == null ? void 0 : e.status) == "string" ? e.status.trim().toLowerCase() : "";
1309
+ return !(Rr.has(n) || Be(r) && Nr(e, t));
1310
+ }
1311
+ function yn(e) {
1312
+ var n;
1313
+ const t = (n = e.title) == null ? void 0 : n.trim(), r = t ? Or(t) : void 0;
1314
+ return r || u("FWA.56db1787570894461", { p0: e.index + 1 });
1315
+ }
1316
+ function Or(e) {
1317
+ const t = e.replace(/[A-Za-z0-9_./\\()[\]{}::,,;;#%+\-=]+/gu, "").replace(/\s+/gu, "").trim();
1318
+ return t && /[\u3400-\u9fff]/u.test(t) ? t : void 0;
1319
+ }
1320
+ function ge(e) {
1321
+ return e.trim().replace(/^\/+|\/+$/g, "");
1322
+ }
1323
+ function Dr(e, t) {
1324
+ const r = ge(t), n = e.routes.list().map((s) => s.contribution).find((s) => ge(s.path) === r);
1325
+ if (!n) return { status: "not-found" };
1326
+ const o = (n.requiredCapabilities ?? []).filter((s) => !e.capabilities.isEnabled(s));
1327
+ return o.length > 0 ? { missingCapabilities: o, status: "forbidden" } : { route: n, status: "ready" };
1328
+ }
1329
+ const Mr = ["data-workbench-feature-state"], Br = { key: 0 }, Fr = { key: 1 }, Hr = { key: 2 }, $r = { key: 3 }, Kr = /* @__PURE__ */ M({
1330
+ __name: "WorkbenchFeatureOutlet",
1331
+ setup(e) {
1332
+ const t = at(), r = j(), n = xe("loading"), o = re(null);
1333
+ let s = 0;
1334
+ function a() {
1335
+ const c = t.params.featurePath;
1336
+ return Array.isArray(c) ? c.join("/") : String(c ?? "");
1337
+ }
1338
+ const i = Ie(a);
1339
+ async function d() {
1340
+ var l;
1341
+ const c = ++s;
1342
+ n.value = "loading", o.value = null;
1343
+ try {
1344
+ if (await r.ready, c !== s) return;
1345
+ const b = Dr(r.kernel, i.value);
1346
+ if (b.status !== "ready") {
1347
+ n.value = b.status;
1348
+ return;
1349
+ }
1350
+ const A = await b.route.loadComponent();
1351
+ if (c !== s) return;
1352
+ o.value = typeof A == "object" && A !== null && "default" in A ? A.default : A, n.value = "ready";
1353
+ } catch (b) {
1354
+ if (c !== s) return;
1355
+ n.value = "error", (l = r.services.loggerAdapter) == null || l.error("Workbench feature route failed to load", {
1356
+ featurePath: i.value,
1357
+ message: b instanceof Error ? b.message : String(b)
1358
+ });
1359
+ }
1360
+ }
1361
+ return Ee(i, () => {
1362
+ d();
1363
+ }, { immediate: !0 }), L(() => {
1364
+ s += 1;
1365
+ }), (c, l) => n.value === "ready" && o.value ? (k(), V(ne(o.value), { key: 0 })) : (k(), W("main", {
1366
+ key: 1,
1367
+ class: "workbench-feature-outlet-state",
1368
+ "data-workbench-feature-state": n.value,
1369
+ "aria-live": "polite"
1370
+ }, [
1371
+ n.value === "loading" ? (k(), W("p", Br, "工作台功能加载中")) : n.value === "forbidden" ? (k(), W("p", Fr, "当前账号无权访问该工作台功能")) : n.value === "error" ? (k(), W("p", Hr, "工作台功能加载失败,请稍后重试")) : (k(), W("p", $r, "当前版本不支持该工作台功能"))
1372
+ ], 8, Mr));
1373
+ }
1374
+ }), qr = /* @__PURE__ */ se(Kr, [["__scopeId", "data-v-6723ad51"]]);
1375
+ function kn(e) {
1376
+ return {
1377
+ component: M({
1378
+ name: "WorkbenchFeatureRouteHost",
1379
+ setup() {
1380
+ const r = Te(e.host);
1381
+ return G(oe, r), r.ready.catch((n) => {
1382
+ var o;
1383
+ (o = e.host.adapters.loggerAdapter) == null || o.error("Workbench feature host initialization failed", {
1384
+ message: n instanceof Error ? n.message : String(n)
1385
+ });
1386
+ }), L(() => {
1387
+ r.dispose();
1388
+ }), () => Le(qr);
1389
+ }
1390
+ }),
1391
+ meta: { workbenchFeatureOutlet: !0 },
1392
+ name: "workbench-app-feature-outlet",
1393
+ path: "/workbench-app/:featurePath(.*)*"
1394
+ };
1395
+ }
1396
+ function ee(e, t = {}, r = "-") {
1397
+ return Number.isFinite(e) ? new Intl.NumberFormat("zh-CN", t).format(e) : r;
1398
+ }
1399
+ function En(e, t = "") {
1400
+ return t === "percent" ? `${(e * 100).toFixed(1)}%` : t === "currency" ? Math.abs(e) >= 1e8 ? u("FWA.15b51787570950350", { p0: (e / 1e8).toFixed(2) }) : Math.abs(e) >= 1e4 ? u("FWA.e1c91787570950875", { p0: (e / 1e4).toFixed(1) }) : `¥${ee(e)}` : ee(e);
1401
+ }
1402
+ function In(e, t = {}) {
1403
+ return e === 0 ? "-" : ee(e, t);
1404
+ }
1405
+ function be(e = {}) {
1406
+ var r, n, o, s, a, i, d, c, l, b, A, P;
1407
+ const t = {
1408
+ workspaceId: _([
1409
+ w((r = e.routeQuery) == null ? void 0 : r.workspaceId),
1410
+ I(e.locationSearch, "workspaceId"),
1411
+ R(e.locationHash, "workspaceId"),
1412
+ C(e.locationPathname, "workspaceId")
1413
+ ]),
1414
+ userId: _([
1415
+ w((n = e.routeQuery) == null ? void 0 : n.userId),
1416
+ I(e.locationSearch, "userId"),
1417
+ R(e.locationHash, "userId"),
1418
+ C(e.locationPathname, "userId")
1419
+ ]),
1420
+ tenantId: we(e, ["tenantId", "tenant_id", "tenant-id"]),
1421
+ appId: we(e, ["appId", "app_id", "app-id"]),
1422
+ roleId: "",
1423
+ mode: _([
1424
+ w((o = e.routeQuery) == null ? void 0 : o.mode),
1425
+ I(e.locationSearch, "mode"),
1426
+ R(e.locationHash, "mode"),
1427
+ C(e.locationPathname, "mode")
1428
+ ]),
1429
+ fdeMode: _([
1430
+ w((s = e.routeQuery) == null ? void 0 : s.fdeMode),
1431
+ I(e.locationSearch, "fdeMode"),
1432
+ R(e.locationHash, "fdeMode"),
1433
+ C(e.locationPathname, "fdeMode")
1434
+ ]),
1435
+ workbenchEditable: _([
1436
+ w((a = e.routeQuery) == null ? void 0 : a.workbenchEditable),
1437
+ I(e.locationSearch, "workbenchEditable"),
1438
+ R(e.locationHash, "workbenchEditable"),
1439
+ C(e.locationPathname, "workbenchEditable")
1440
+ ]),
1441
+ conversationId: _([
1442
+ w((i = e.routeQuery) == null ? void 0 : i.conversationId),
1443
+ I(e.locationSearch, "conversationId"),
1444
+ R(e.locationHash, "conversationId"),
1445
+ C(e.locationPathname, "conversationId")
1446
+ ]),
1447
+ resourceId: _([
1448
+ w((d = e.routeQuery) == null ? void 0 : d.resourceId),
1449
+ I(e.locationSearch, "resourceId"),
1450
+ R(e.locationHash, "resourceId"),
1451
+ C(e.locationPathname, "resourceId")
1452
+ ]),
1453
+ fdeResourceId: _([
1454
+ w((c = e.routeQuery) == null ? void 0 : c.fdeResourceId),
1455
+ I(e.locationSearch, "fdeResourceId"),
1456
+ R(e.locationHash, "fdeResourceId"),
1457
+ C(e.locationPathname, "fdeResourceId")
1458
+ ]),
1459
+ path: _([
1460
+ w((l = e.routeQuery) == null ? void 0 : l.path),
1461
+ I(e.locationSearch, "path"),
1462
+ R(e.locationHash, "path"),
1463
+ C(e.locationPathname, "path")
1464
+ ]),
1465
+ fdePath: _([
1466
+ w((b = e.routeQuery) == null ? void 0 : b.fdePath),
1467
+ I(e.locationSearch, "fdePath"),
1468
+ R(e.locationHash, "fdePath"),
1469
+ C(e.locationPathname, "fdePath")
1470
+ ]),
1471
+ name: _([
1472
+ w((A = e.routeQuery) == null ? void 0 : A.name),
1473
+ I(e.locationSearch, "name"),
1474
+ R(e.locationHash, "name"),
1475
+ C(e.locationPathname, "name")
1476
+ ]),
1477
+ fdeName: _([
1478
+ w((P = e.routeQuery) == null ? void 0 : P.fdeName),
1479
+ I(e.locationSearch, "fdeName"),
1480
+ R(e.locationHash, "fdeName"),
1481
+ C(e.locationPathname, "fdeName")
1482
+ ])
1483
+ };
1484
+ return Lr(t);
1485
+ }
1486
+ function An(e) {
1487
+ if (typeof window > "u")
1488
+ return be({ routeQuery: e });
1489
+ const t = be({
1490
+ routeQuery: e,
1491
+ locationPathname: window.location.pathname,
1492
+ locationSearch: window.location.search,
1493
+ locationHash: window.location.hash
1494
+ });
1495
+ return {
1496
+ ...t,
1497
+ userId: t.userId || Ur(window)
1498
+ };
1499
+ }
1500
+ function w(e) {
1501
+ return Array.isArray(e) ? w(e[0]) : typeof e == "string" ? e.trim() : "";
1502
+ }
1503
+ function I(e, t) {
1504
+ var r;
1505
+ return e && ((r = new URLSearchParams(e.startsWith("?") ? e.slice(1) : e).get(t)) == null ? void 0 : r.trim()) || "";
1506
+ }
1507
+ function R(e, t) {
1508
+ if (!e) return "";
1509
+ const r = e.indexOf("?");
1510
+ if (r < 0) return "";
1511
+ const n = e.indexOf("#", r + 1), o = n >= 0 ? e.slice(r + 1, n) : e.slice(r + 1);
1512
+ return I(o, t);
1513
+ }
1514
+ function C(e, t) {
1515
+ if (!e || !e.includes("=")) return "";
1516
+ const r = e.split("/").filter(Boolean).find((n) => n.includes("="));
1517
+ return r ? I(r, t) : "";
1518
+ }
1519
+ function we(e, t) {
1520
+ return _(t.flatMap((r) => {
1521
+ var n;
1522
+ return [
1523
+ w((n = e.routeQuery) == null ? void 0 : n[r]),
1524
+ I(e.locationSearch, r),
1525
+ R(e.locationHash, r),
1526
+ C(e.locationPathname, r)
1527
+ ];
1528
+ }));
1529
+ }
1530
+ function _(e) {
1531
+ return e.find((t) => t.trim()) || "";
1532
+ }
1533
+ function Ur(e) {
1534
+ const t = [
1535
+ e.__BT_WORKBENCH_USER__,
1536
+ e.__BT_RUNTIME_IDENTITY__,
1537
+ e.__BT_RUNTIME_CONTEXT__
1538
+ ];
1539
+ for (const r of t) {
1540
+ const n = xr(r);
1541
+ if (n) return n;
1542
+ }
1543
+ return "";
1544
+ }
1545
+ function xr(e) {
1546
+ if (!e || typeof e != "object" || Array.isArray(e)) return "";
1547
+ const t = e;
1548
+ return _([
1549
+ w(t.userId),
1550
+ w(t.user_id),
1551
+ w(t.egoUserinfo),
1552
+ w(t.egoUserInfo),
1553
+ w(t["ego-userinfo"])
1554
+ ]);
1555
+ }
1556
+ function Lr(e) {
1557
+ if (!Vr(e)) return e;
1558
+ const t = e.fdeResourceId || e.resourceId;
1559
+ return {
1560
+ ...e,
1561
+ workspaceId: e.workspaceId || t,
1562
+ userId: e.userId || "fdeadmin",
1563
+ roleId: e.roleId || "fde",
1564
+ fdeResourceId: t
1565
+ };
1566
+ }
1567
+ function Vr(e) {
1568
+ const t = e.mode.trim().toLowerCase(), r = e.fdeMode.trim().toLowerCase();
1569
+ return t === "fde" || r === "true" || r === "1" || r === "yes";
1570
+ }
1571
+ const E = {
1572
+ radius: "standard",
1573
+ border: "light",
1574
+ shadow: "soft",
1575
+ texture: "white",
1576
+ textureColor: "#ffffff",
1577
+ motion: "none",
1578
+ density: "standard"
1579
+ }, _n = [
1580
+ {
1581
+ key: "radius",
1582
+ label: u("FWA.71e11787571689316"),
1583
+ options: [
1584
+ { value: "square", label: u("FWA.fbad1787571689609") },
1585
+ { value: "small", label: u("FWA.50721787571587373") },
1586
+ { value: "standard", label: u("FWA.e83b1787571408644") },
1587
+ { value: "large", label: u("FWA.c0491787571587595") }
1588
+ ]
1589
+ },
1590
+ {
1591
+ key: "border",
1592
+ label: u("FWA.49d21787571689615"),
1593
+ options: [
1594
+ { value: "none", label: u("FWA.f0961787571587988") },
1595
+ { value: "light", label: u("FWA.36d41787571258647") },
1596
+ { value: "strong", label: u("FWA.35961787571588423") }
1597
+ ]
1598
+ },
1599
+ {
1600
+ key: "shadow",
1601
+ label: u("FWA.30c71787571689687"),
1602
+ options: [
1603
+ { value: "none", label: u("FWA.6e7c1787571588944") },
1604
+ { value: "soft", label: u("FWA.db821787571589152") },
1605
+ { value: "strong", label: u("FWA.7fbe1787571589516") }
1606
+ ]
1607
+ },
1608
+ {
1609
+ key: "texture",
1610
+ label: u("FWA.e4e81787571690132"),
1611
+ options: [
1612
+ { value: "white", label: u("FWA.3e791787571690179") },
1613
+ { value: "muted", label: u("FWA.2b471787571590077") },
1614
+ { value: "glass", label: u("FWA.c3e41787571409224") },
1615
+ { value: "texture", label: u("FWA.6b941787571590518") }
1616
+ ]
1617
+ },
1618
+ {
1619
+ key: "motion",
1620
+ label: u("FWA.f1801787571690658"),
1621
+ options: [
1622
+ { value: "none", label: u("FWA.252a1787571591043") },
1623
+ { value: "lift", label: u("FWA.f1bf1787571410166") },
1624
+ { value: "glow", label: u("FWA.8a811787571410691") }
1625
+ ]
1626
+ },
1627
+ {
1628
+ key: "density",
1629
+ label: u("FWA.b02d1787571690666"),
1630
+ options: [
1631
+ { value: "loose", label: u("FWA.2d611787571591242") },
1632
+ { value: "standard", label: u("FWA.780f1787571591588") },
1633
+ { value: "compact", label: u("FWA.6a711787571146025") }
1634
+ ]
1635
+ }
1636
+ ], Gr = {
1637
+ radius: ["square", "small", "standard", "large"],
1638
+ border: ["none", "light", "strong"],
1639
+ shadow: ["none", "soft", "strong"],
1640
+ texture: ["white", "muted", "glass", "texture", "color"],
1641
+ motion: ["none", "lift", "glow"],
1642
+ density: ["loose", "standard", "compact"]
1643
+ };
1644
+ function te(e) {
1645
+ return e && typeof e == "object" && !Array.isArray(e) ? e : {};
1646
+ }
1647
+ function K(e, t) {
1648
+ const r = E[e];
1649
+ return typeof t == "string" && Gr[e].includes(t) ? t : r;
1650
+ }
1651
+ function zr(e) {
1652
+ return typeof e == "string" && /^#[0-9a-fA-F]{6}$/.test(e) ? e.toLowerCase() : E.textureColor;
1653
+ }
1654
+ function z(e) {
1655
+ const t = te(e);
1656
+ return {
1657
+ radius: K("radius", t.radius),
1658
+ border: K("border", t.border),
1659
+ shadow: K("shadow", t.shadow),
1660
+ texture: K("texture", t.texture),
1661
+ textureColor: zr(t.textureColor),
1662
+ motion: K("motion", t.motion),
1663
+ density: K("density", t.density)
1664
+ };
1665
+ }
1666
+ function Rn(e) {
1667
+ const t = z(e);
1668
+ return t.radius === E.radius && t.border === E.border && t.shadow === E.shadow && t.texture === E.texture && t.textureColor === E.textureColor && t.motion === E.motion && t.density === E.density;
1669
+ }
1670
+ const Qr = {
1671
+ square: 0,
1672
+ small: 4,
1673
+ standard: 8,
1674
+ large: 16
1675
+ }, jr = {
1676
+ none: "none",
1677
+ soft: "soft",
1678
+ standard: "soft",
1679
+ strong: "strong"
1680
+ }, Yr = {
1681
+ thumbnail: "compact",
1682
+ compact: "compact",
1683
+ standard: "standard",
1684
+ expanded: "loose"
1685
+ };
1686
+ function Cn(e) {
1687
+ const t = z(e);
1688
+ return {
1689
+ cardStyle: {
1690
+ cardRadius: Qr[t.radius],
1691
+ cardShadow: t.shadow === "strong" ? "strong" : t.shadow,
1692
+ density: t.density === "loose" ? "expanded" : t.density,
1693
+ ...t.texture === "color" ? { backgroundColor: t.textureColor } : {},
1694
+ shell: { ...t }
1695
+ }
1696
+ };
1697
+ }
1698
+ function Wn(e) {
1699
+ const t = te(e == null ? void 0 : e.cardStyle), r = te(t.shell);
1700
+ if (Object.keys(r).length > 0)
1701
+ return z(r);
1702
+ const n = typeof t.cardRadius == "number" ? t.cardRadius <= 0 ? "square" : t.cardRadius <= 4 ? "small" : t.cardRadius >= 16 ? "large" : "standard" : E.radius, o = typeof t.cardShadow == "string" && jr[t.cardShadow] || E.shadow, s = typeof t.density == "string" && Yr[t.density] || E.density, a = typeof t.backgroundColor == "string" ? t.backgroundColor : void 0;
1703
+ return z({
1704
+ radius: n,
1705
+ border: E.border,
1706
+ shadow: o,
1707
+ texture: a ? "color" : E.texture,
1708
+ textureColor: a,
1709
+ motion: E.motion,
1710
+ density: s
1711
+ });
1712
+ }
1713
+ const vn = "@fses/workbench-app";
1714
+ export {
1715
+ ar as $,
1716
+ an as A,
1717
+ Wn as B,
1718
+ Rn as C,
1719
+ E as D,
1720
+ Cn as E,
1721
+ We as F,
1722
+ vn as G,
1723
+ it as H,
1724
+ oe as I,
1725
+ fn as J,
1726
+ wt as K,
1727
+ ut as L,
1728
+ sr as M,
1729
+ nr as N,
1730
+ or as O,
1731
+ dt as P,
1732
+ hn as Q,
1733
+ Se as R,
1734
+ kn as S,
1735
+ Te as T,
1736
+ cr as U,
1737
+ tr as V,
1738
+ Ot as W,
1739
+ un as X,
1740
+ ve as Y,
1741
+ ir as Z,
1742
+ se as _,
1743
+ cn as a,
1744
+ In as a0,
1745
+ sn as a1,
1746
+ dn as b,
1747
+ ln as c,
1748
+ _n as d,
1749
+ Ar as e,
1750
+ En as f,
1751
+ mn as g,
1752
+ gn as h,
1753
+ bn as i,
1754
+ jt as j,
1755
+ Ut as k,
1756
+ xt as l,
1757
+ Lt as m,
1758
+ z as n,
1759
+ Qt as o,
1760
+ pn as p,
1761
+ qt as q,
1762
+ yn as r,
1763
+ wn as s,
1764
+ $t as t,
1765
+ j as u,
1766
+ Kt as v,
1767
+ Sr as w,
1768
+ vt as x,
1769
+ An as y,
1770
+ le as z
1771
+ };