@fses/workbench-app 0.2.15 → 0.2.17

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 (61) hide show
  1. package/WORKBENCH-CLOSURE.json +18 -12
  2. package/dist/Workspace-r8ayksVF.js +23176 -0
  3. package/dist/canvas/api/index.js +1 -1
  4. package/dist/{canvasFacade-B2EHgdqA.js → canvasFacade-B8jYm_aO.js} +748 -748
  5. package/dist/cardFactory-DmEBcCf4.js +1460 -0
  6. package/dist/extensions/index.js +1 -1
  7. package/dist/fses-workbench-app.js +5 -5
  8. package/dist/{index-C0L5xASu.js → index-DEOR_GPc.js} +350 -346
  9. package/dist/internal/personal-workbench/fde-skill-cards/runtime/fdeSkillProtocolChartDisplayData.d.ts +0 -5
  10. package/dist/internal/personal-workbench/lib/assistantPersonaProfiles.d.ts +6 -6
  11. package/dist/internal/personal-workbench/lib/cardStyleConfig.d.ts +26 -26
  12. package/dist/internal/personal-workbench/lib/echartsOptionEditorBridge.d.ts +0 -5
  13. package/dist/internal/personal-workbench/lib/historyCardBindingRestore.fixture.d.ts +0 -5
  14. package/dist/internal/personal-workbench/lib/runtimePrimitiveRegistry.d.ts +1 -1
  15. package/dist/internal/personal-workbench/lib/vueRuntimeAdapters.d.ts +0 -5
  16. package/dist/internal/personal-workbench/lib/workbenchCanvasBusinessGapChecklist.d.ts +1 -1
  17. package/dist/internal/personal-workbench/lib/workbenchCardRecommendationFallback.d.ts +1 -1
  18. package/dist/internal/personal-workbench/lib/workbenchCardRecommendationReturnItemUpsert.d.ts +0 -5
  19. package/dist/internal/personal-workbench/lib/workbenchDataBindingBadge.d.ts +0 -5
  20. package/dist/internal/personal-workbench/lib/workbenchImageComposeEntry.d.ts +1 -1
  21. package/dist/internal/personal-workbench/lib/workbenchLayout.d.ts +0 -5
  22. package/dist/runtime/index.js +1 -1
  23. package/dist/style.css +1 -1
  24. package/dist/{useWorkbenchRuntime-DLf_FgC7.js → useWorkbenchRuntime-DDD22mdF.js} +7817 -7813
  25. package/dist/version.d.ts +1 -1
  26. package/dist/{workbenchCustomComponentRegistry-Bt94Lgko.js → workbenchCustomComponentRegistry-CWUPjCnJ.js} +74 -74
  27. package/node_modules/@byteluck-fe/locale-message/README.md +2 -0
  28. package/node_modules/@byteluck-fe/locale-message/dist/index.d.ts +37 -0
  29. package/node_modules/@byteluck-fe/locale-message/dist/locale-message.js +55 -0
  30. package/node_modules/@byteluck-fe/locale-message/package.json +37 -0
  31. package/node_modules/@fses/ai-chat/dist/components/ContextUsageRing.vue.d.ts +5 -0
  32. package/node_modules/@fses/ai-chat/dist/components/FsesAiChat.vue.d.ts +5 -0
  33. package/node_modules/@fses/ai-chat/dist/fses-ai-chat.js +6225 -6075
  34. package/node_modules/@fses/ai-chat/dist/fses-ai-chat.umd.cjs +17 -19
  35. package/node_modules/@fses/ai-chat/dist/style.css +1 -1
  36. package/node_modules/@fses/ai-chat/dist/utils/attachment-upload.d.ts +0 -5
  37. package/node_modules/@fses/ai-chat/package.json +4 -3
  38. package/node_modules/@fses/workbench-card/dist/fses-workbench-card-renderers.js +10144 -9914
  39. package/node_modules/@fses/workbench-card/dist/fses-workbench-card.js +1517 -1503
  40. package/node_modules/@fses/workbench-card/dist/fses-workbench-card.umd.cjs +1 -1
  41. package/node_modules/@fses/workbench-card/dist/renderers/chart/chartRendererRegistry.d.ts +97 -97
  42. package/node_modules/@fses/workbench-card/dist/renderers/style.css +1 -1
  43. package/node_modules/@fses/workbench-card/package.json +4 -1
  44. package/node_modules/@fses/workbench-card/src/registry/cardRegistry.ts +99 -98
  45. package/node_modules/@fses/workbench-card/src/registry/compositeCardPatterns.ts +31 -30
  46. package/node_modules/@fses/workbench-card/src/registry/echartsTemplateCategories.ts +24 -23
  47. package/node_modules/@fses/workbench-card/src/registry/echartsTemplateRegistry.generated.js +765 -764
  48. package/node_modules/@fses/workbench-card/src/registry/echartsTemplateRegistry.generated.ts +765 -764
  49. package/node_modules/@fses/workbench-card/src/renderers/WorkbenchBlockRenderer.vue +143 -129
  50. package/node_modules/@fses/workbench-card/src/renderers/chart/ChartRegistry.vue +4 -3
  51. package/node_modules/@fses/workbench-card/src/renderers/chart/EChartsProtocolRenderer.vue +2 -1
  52. package/node_modules/@fses/workbench-card/src/renderers/chart/chartRendererRegistry.ts +99 -98
  53. package/node_modules/@fses/workbench-card/src/renderers/chart/useEchart.ts +30 -29
  54. package/node_modules/@fses/workbench-card/src/renderers/native/nativeBindings.ts +11 -10
  55. package/node_modules/@fses/workbench-card/src/renderers/nested/nestedBlockBindings.ts +102 -101
  56. package/node_modules/@fses/workbench-card/src/renderers/reference-composite/referenceCompositeBindings.ts +364 -363
  57. package/node_modules/@fses/workbench-card/src/renderers/reference-composite/referenceRiskAndStrategyBindings.ts +90 -89
  58. package/node_modules/@fses/workbench-card/src/renderers/useWorkbenchBlockRendererBindings.ts +33 -32
  59. package/package.json +4 -3
  60. package/dist/Workspace-_r17G1XR.js +0 -22895
  61. package/dist/cardFactory-BK3CA-Gn.js +0 -1443
@@ -1,58 +1,58 @@
1
- import { L as Ft, a as it, r as Kt, l as zt, b as Vt } from "./cardFactory-BK3CA-Gn.js";
2
- const bt = [
3
- { id: "card.header.left", kind: "slot", status: "active", displayName: "Card header left slot", userFacingName: "卡片标题左侧位置", description: "在卡片标题左侧挂载状态、图标或标签。", riskLevel: "low", sideEffects: [] },
4
- { id: "card.header.right", kind: "slot", status: "active", displayName: "Card header right slot", userFacingName: "卡片标题右侧位置", description: "在卡片标题右侧挂载按钮、菜单或搜索入口。", riskLevel: "low", sideEffects: [] },
5
- { id: "card.body.toolbar", kind: "slot", status: "active", displayName: "Card body toolbar slot", userFacingName: "卡片内容工具条位置", description: "在卡片内容顶部挂载筛选、排序或视图切换。", riskLevel: "low", sideEffects: [] },
6
- { id: "card.body.inline", kind: "slot", status: "active", displayName: "Card body inline slot", userFacingName: "卡片内容内嵌位置", description: "在卡片内容区域内嵌搜索框、表单或结果列表。", riskLevel: "low", sideEffects: [] },
7
- { id: "card.body.emptyState", kind: "slot", status: "active", displayName: "Card empty state slot", userFacingName: "卡片空态位置", description: "在卡片空态区域挂载创建、导入或引导动作。", riskLevel: "low", sideEffects: [] },
8
- { id: "card.footer.actions", kind: "slot", status: "active", displayName: "Card footer action slot", userFacingName: "卡片底部动作位置", description: "在卡片底部挂载提交、打开页面或批量处理动作。", riskLevel: "low", sideEffects: [] },
9
- { id: "card.detail.panel", kind: "slot", status: "active", displayName: "Card detail panel slot", userFacingName: "卡片详情面板位置", description: "在卡片详情面板中挂载扩展能力。", riskLevel: "low", sideEffects: [] },
10
- { id: "workspace.banner.topRight", kind: "slot", status: "active", displayName: "Workspace banner top right slot", userFacingName: "欢迎横幅右上角位置", description: "在欢迎横幅右上角挂载全局入口。", riskLevel: "low", sideEffects: [] },
11
- { id: "iconButton+popover", kind: "ui", status: "active", displayName: "Icon button with popover", userFacingName: "图标按钮和弹出面板", description: "点击图标按钮后打开一个小面板。", riskLevel: "low", sideEffects: [] },
12
- { id: "inlinePanel", kind: "ui", status: "active", displayName: "Inline panel", userFacingName: "卡片内嵌面板", description: "在卡片内容中直接展示输入和结果区域。", riskLevel: "low", sideEffects: [] },
13
- { id: "filterBar", kind: "ui", status: "active", displayName: "Filter bar", userFacingName: "筛选条", description: "用于组合多个筛选条件。", riskLevel: "low", sideEffects: [] },
14
- { id: "dropdownMenu", kind: "ui", status: "planned", displayName: "Dropdown menu", userFacingName: "更多菜单", description: "用于承载一组次级操作。", riskLevel: "low", sideEffects: [] },
15
- { id: "drawerPanel", kind: "ui", status: "active", displayName: "Drawer panel", userFacingName: "详情抽屉", description: "从页面侧边打开详情或操作面板。", riskLevel: "medium", sideEffects: [] },
16
- { id: "cardSearchIndex", kind: "data", status: "active", displayName: "Card search index", userFacingName: "当前工作台卡片索引", description: "搜索当前工作台内的卡片名称、说明和摘要。", riskLevel: "low", sideEffects: [] },
17
- { id: "routeTargetRegistry", kind: "data", status: "active", displayName: "Route target registry", userFacingName: "可打开页面目录", description: "读取系统中允许跳转的页面和参数。", riskLevel: "low", sideEffects: [] },
18
- { id: "businessObjectQuery", kind: "data", status: "active", displayName: "Business object query", userFacingName: "业务数据查询", description: "读取销售明细、客户、流程等业务对象数据。", riskLevel: "medium", sideEffects: [] },
19
- { id: "metricQuery", kind: "data", status: "planned", displayName: "Metric query", userFacingName: "指标数据查询", description: "读取企业指标、口径和趋势数据。", riskLevel: "medium", sideEffects: [] },
20
- { id: "focusCard", kind: "action", status: "active", displayName: "Focus card", userFacingName: "定位到卡片", description: "把画布定位到指定卡片。", riskLevel: "low", sideEffects: [] },
21
- { id: "openRoute", kind: "action", status: "active", displayName: "Open route", userFacingName: "打开页面", description: "打开已注册的系统页面并传递允许参数。", riskLevel: "medium", sideEffects: ["navigate"] },
22
- { id: "refreshData", kind: "action", status: "active", displayName: "Refresh data", userFacingName: "刷新数据", description: "重新读取卡片或数据源内容。", riskLevel: "low", sideEffects: [] },
23
- { id: "toggleFavorite", kind: "action", status: "active", displayName: "Toggle favorite", userFacingName: "收藏或取消收藏", description: "把卡片、记录或视图加入个人收藏。", riskLevel: "low", sideEffects: ["workspace_mutation"] },
24
- { id: "exportData", kind: "action", status: "active", displayName: "Export data", userFacingName: "导出文件", description: "把查询结果导出为 Excel、CSV 或其他文件。", riskLevel: "medium", sideEffects: ["export"] },
25
- { id: "tableSelection", kind: "action", status: "active", displayName: "Table selection", userFacingName: "选择表格行", description: "在表格卡片中选择一行或多行数据。", riskLevel: "low", sideEffects: [] },
26
- { id: "openDrawer", kind: "action", status: "active", displayName: "Open drawer", userFacingName: "打开详情抽屉", description: "打开侧边详情面板展示记录详情。", riskLevel: "low", sideEffects: [] },
27
- { id: "callApiAction", kind: "action", status: "active", displayName: "Call API action", userFacingName: "调用受控业务动作", description: "调用平台允许的业务动作接口,并记录审计。", riskLevel: "high", sideEffects: ["business_mutation"] },
28
- { id: "submitForm", kind: "action", status: "planned", displayName: "Submit form", userFacingName: "提交表单", description: "提交业务表单并进入确认和审计链路。", riskLevel: "high", sideEffects: ["business_mutation"] },
29
- { id: "approveTask", kind: "action", status: "planned", displayName: "Approve task", userFacingName: "审批通过", description: "对审批任务执行通过动作。", riskLevel: "high", sideEffects: ["workflow"] },
30
- { id: "onSelectResult", kind: "trigger", status: "active", displayName: "On select result", userFacingName: "选择结果时", description: "用户选择搜索或查询结果时触发。", riskLevel: "low", sideEffects: [] },
31
- { id: "onSubmit", kind: "trigger", status: "active", displayName: "On submit", userFacingName: "提交时", description: "用户点击查询、提交或确认按钮时触发。", riskLevel: "low", sideEffects: [] },
32
- { id: "onClick", kind: "trigger", status: "active", displayName: "On click", userFacingName: "点击时", description: "用户点击按钮或菜单项时触发。", riskLevel: "low", sideEffects: [] },
33
- { id: "onChange", kind: "trigger", status: "active", displayName: "On change", userFacingName: "内容变化时", description: "用户修改输入、筛选或选择时触发。", riskLevel: "low", sideEffects: [] },
34
- { id: "processCenter", kind: "routeTarget", status: "active", displayName: "Process center", userFacingName: "流程中心", description: "打开流程中心并传递查询参数。", riskLevel: "medium", sideEffects: ["navigate"] }
35
- ], ya = {
1
+ import { d as u, L as Kt, a as rt, r as zt, l as Vt, b as qt } from "./cardFactory-DmEBcCf4.js";
2
+ const Et = [
3
+ { id: "card.header.left", kind: "slot", status: "active", displayName: "Card header left slot", userFacingName: u("FWA.ff101787571029524"), description: u("FWA.cc9c1787570656561"), riskLevel: "low", sideEffects: [] },
4
+ { id: "card.header.right", kind: "slot", status: "active", displayName: "Card header right slot", userFacingName: u("FWA.28db1787571030051"), description: u("FWA.eed41787570610595"), riskLevel: "low", sideEffects: [] },
5
+ { id: "card.body.toolbar", kind: "slot", status: "active", displayName: "Card body toolbar slot", userFacingName: u("FWA.c8551787570987280"), description: u("FWA.42af1787570612169"), riskLevel: "low", sideEffects: [] },
6
+ { id: "card.body.inline", kind: "slot", status: "active", displayName: "Card body inline slot", userFacingName: u("FWA.aabe1787571030593"), description: u("FWA.fd1c1787570583904"), riskLevel: "low", sideEffects: [] },
7
+ { id: "card.body.emptyState", kind: "slot", status: "active", displayName: "Card empty state slot", userFacingName: u("FWA.cf1a1787571147147"), description: u("FWA.44c31787570613219"), riskLevel: "low", sideEffects: [] },
8
+ { id: "card.footer.actions", kind: "slot", status: "active", displayName: "Card footer action slot", userFacingName: u("FWA.72861787571031177"), description: u("FWA.60331787570569176"), riskLevel: "low", sideEffects: [] },
9
+ { id: "card.detail.panel", kind: "slot", status: "active", displayName: "Card detail panel slot", userFacingName: u("FWA.11401787571031677"), description: u("FWA.c1211787570755497"), riskLevel: "low", sideEffects: [] },
10
+ { id: "workspace.banner.topRight", kind: "slot", status: "active", displayName: "Workspace banner top right slot", userFacingName: u("FWA.05c81787570988100"), description: u("FWA.8b3e1787570756878"), riskLevel: "low", sideEffects: [] },
11
+ { id: "iconButton+popover", kind: "ui", status: "active", displayName: "Icon button with popover", userFacingName: u("FWA.1ce81787570988765"), description: u("FWA.f24e1787570757634"), riskLevel: "low", sideEffects: [] },
12
+ { id: "inlinePanel", kind: "ui", status: "active", displayName: "Inline panel", userFacingName: u("FWA.f5d51787571147564"), description: u("FWA.ab861787570657262"), riskLevel: "low", sideEffects: [] },
13
+ { id: "filterBar", kind: "ui", status: "active", displayName: "Filter bar", userFacingName: u("FWA.7b391787571592730"), description: u("FWA.10621787570910009"), riskLevel: "low", sideEffects: [] },
14
+ { id: "dropdownMenu", kind: "ui", status: "planned", displayName: "Dropdown menu", userFacingName: u("FWA.3c3f1787571438794"), description: u("FWA.a9b71787570911026"), riskLevel: "low", sideEffects: [] },
15
+ { id: "drawerPanel", kind: "ui", status: "active", displayName: "Drawer panel", userFacingName: u("FWA.72271787571438804"), description: u("FWA.a4871787570758551"), riskLevel: "medium", sideEffects: [] },
16
+ { id: "cardSearchIndex", kind: "data", status: "active", displayName: "Card search index", userFacingName: u("FWA.94161787570989176"), description: u("FWA.d79e1787570614267"), riskLevel: "low", sideEffects: [] },
17
+ { id: "routeTargetRegistry", kind: "data", status: "active", displayName: "Route target registry", userFacingName: u("FWA.52841787571083554"), description: u("FWA.ace01787570722798"), riskLevel: "low", sideEffects: [] },
18
+ { id: "businessObjectQuery", kind: "data", status: "active", displayName: "Business object query", userFacingName: u("FWA.beee1787571148023"), description: u("FWA.2f801787570615313"), riskLevel: "medium", sideEffects: [] },
19
+ { id: "metricQuery", kind: "data", status: "planned", displayName: "Metric query", userFacingName: u("FWA.dfd31787571148548"), description: u("FWA.d3e61787570759500"), riskLevel: "medium", sideEffects: [] },
20
+ { id: "focusCard", kind: "action", status: "active", displayName: "Focus card", userFacingName: u("FWA.29f51787571263364"), description: u("FWA.56901787570911552"), riskLevel: "low", sideEffects: [] },
21
+ { id: "openRoute", kind: "action", status: "active", displayName: "Open route", userFacingName: u("FWA.f7ac1787571438829"), description: u("FWA.45491787570658308"), riskLevel: "medium", sideEffects: ["navigate"] },
22
+ { id: "refreshData", kind: "action", status: "active", displayName: "Refresh data", userFacingName: u("FWA.c7c41787571438840"), description: u("FWA.38231787570840924"), riskLevel: "low", sideEffects: [] },
23
+ { id: "toggleFavorite", kind: "action", status: "active", displayName: "Toggle favorite", userFacingName: u("FWA.1f621787571084077"), description: u("FWA.fccb1787570723406"), riskLevel: "low", sideEffects: ["workspace_mutation"] },
24
+ { id: "exportData", kind: "action", status: "active", displayName: "Export data", userFacingName: u("FWA.a4cc1787571438861"), description: u("FWA.e4421787570512024"), riskLevel: "medium", sideEffects: ["export"] },
25
+ { id: "tableSelection", kind: "action", status: "active", displayName: "Table selection", userFacingName: u("FWA.cb0d1787571263547"), description: u("FWA.65981787570724371"), riskLevel: "low", sideEffects: [] },
26
+ { id: "openDrawer", kind: "action", status: "active", displayName: "Open drawer", userFacingName: u("FWA.437b1787571149072"), description: u("FWA.98d41787570760241"), riskLevel: "low", sideEffects: [] },
27
+ { id: "callApiAction", kind: "action", status: "active", displayName: "Call API action", userFacingName: u("FWA.81b21787571032674"), description: u("FWA.5ea41787570616361"), riskLevel: "high", sideEffects: ["business_mutation"] },
28
+ { id: "submitForm", kind: "action", status: "planned", displayName: "Submit form", userFacingName: u("FWA.39961787571438890"), description: u("FWA.7e7a1787570684524"), riskLevel: "high", sideEffects: ["business_mutation"] },
29
+ { id: "approveTask", kind: "action", status: "planned", displayName: "Approve task", userFacingName: u("FWA.8b921787571438910"), description: u("FWA.3a2e1787570875998"), riskLevel: "high", sideEffects: ["workflow"] },
30
+ { id: "onSelectResult", kind: "trigger", status: "active", displayName: "On select result", userFacingName: u("FWA.673b1787571264412"), description: u("FWA.a7ef1787570761195"), riskLevel: "low", sideEffects: [] },
31
+ { id: "onSubmit", kind: "trigger", status: "active", displayName: "On submit", userFacingName: u("FWA.a80b1787571593140"), description: u("FWA.3d7d1787570659358"), riskLevel: "low", sideEffects: [] },
32
+ { id: "onClick", kind: "trigger", status: "active", displayName: "On click", userFacingName: u("FWA.cf321787571593665"), description: u("FWA.2a5a1787570792007"), riskLevel: "low", sideEffects: [] },
33
+ { id: "onChange", kind: "trigger", status: "active", displayName: "On change", userFacingName: u("FWA.96471787571264938"), description: u("FWA.93d81787570725419"), riskLevel: "low", sideEffects: [] },
34
+ { id: "processCenter", kind: "routeTarget", status: "active", displayName: "Process center", userFacingName: u("FWA.18201787571438929"), description: u("FWA.09ce1787570792529"), riskLevel: "medium", sideEffects: ["navigate"] }
35
+ ], ga = {
36
36
  processCenter: {
37
37
  id: "processCenter",
38
- name: "流程中心",
38
+ name: u("FWA.18201787571438929"),
39
39
  route: "/process-center",
40
40
  acceptedParams: ["keyword", "source"]
41
41
  }
42
42
  };
43
- function Lt(t, e) {
44
- return bt.find(
43
+ function Rt(t, e) {
44
+ return Et.find(
45
45
  (a) => a.id === t && (!e || a.kind === e)
46
46
  );
47
47
  }
48
- function ga(t) {
49
- return bt.filter((e) => e.kind === t && e.status === "active").map((e) => e.id);
48
+ function xa(t) {
49
+ return Et.filter((e) => e.kind === t && e.status === "active").map((e) => e.id);
50
50
  }
51
- function $(t, e) {
51
+ function j(t, e) {
52
52
  var a;
53
- return ((a = Lt(t, e)) == null ? void 0 : a.status) === "active";
53
+ return ((a = Rt(t, e)) == null ? void 0 : a.status) === "active";
54
54
  }
55
- function $t(t) {
55
+ function jt(t) {
56
56
  return {
57
57
  slot: t.slot,
58
58
  ui: t.ui.kind,
@@ -63,137 +63,137 @@ function $t(t) {
63
63
  routeTargets: t.actions.filter((e) => e.type === "openRoute").map((e) => e.target).filter((e) => !!e)
64
64
  };
65
65
  }
66
- function qt(t) {
67
- const e = $t(t), a = [];
68
- return $(e.slot, "slot") || a.push(e.slot), $(e.ui, "ui") || a.push(e.ui), $(e.data, "data") || a.push(e.data), e.actions.forEach((n) => {
69
- $(n, "action") || a.push(n);
66
+ function Yt(t) {
67
+ const e = jt(t), a = [];
68
+ return j(e.slot, "slot") || a.push(e.slot), j(e.ui, "ui") || a.push(e.ui), j(e.data, "data") || a.push(e.data), e.actions.forEach((n) => {
69
+ j(n, "action") || a.push(n);
70
70
  }), e.triggers.forEach((n) => {
71
- $(n, "trigger") || a.push(n);
71
+ j(n, "trigger") || a.push(n);
72
72
  }), e.routeTargets.forEach((n) => {
73
- $(n, "routeTarget") || a.push(n);
73
+ j(n, "routeTarget") || a.push(n);
74
74
  }), [...new Set(a)];
75
75
  }
76
- function jt(t) {
76
+ function Ut(t) {
77
77
  return [...new Set(t)].map((e) => {
78
- const a = Lt(e);
78
+ const a = Rt(e);
79
79
  return {
80
80
  id: e,
81
- userFacingName: (a == null ? void 0 : a.userFacingName) || pt(e),
82
- description: (a == null ? void 0 : a.description) || `系统还没有开放“${pt(e)}”这项基础能力。`,
81
+ userFacingName: (a == null ? void 0 : a.userFacingName) || ht(e),
82
+ description: (a == null ? void 0 : a.description) || u("FWA.84421787570528428", { p0: ht(e) }),
83
83
  status: (a == null ? void 0 : a.status) === "disabled" ? "disabled" : (a == null ? void 0 : a.status) === "planned" ? "planned" : "unknown"
84
84
  };
85
85
  });
86
86
  }
87
- function pt(t) {
87
+ function ht(t) {
88
88
  const e = {
89
- exportData: "导出文件",
90
- exportFile: "导出文件",
91
- tableSelection: "选择表格行",
92
- businessObjectQuery: "业务数据查询",
93
- metricQuery: "指标数据查询",
94
- refreshData: "刷新数据",
95
- toggleFavorite: "收藏或取消收藏",
96
- submitForm: "提交表单",
97
- approveTask: "审批通过",
98
- drawerPanel: "详情抽屉",
99
- filterBar: "筛选条"
89
+ exportData: u("FWA.a4cc1787571438861"),
90
+ exportFile: u("FWA.a4cc1787571438861"),
91
+ tableSelection: u("FWA.cb0d1787571263547"),
92
+ businessObjectQuery: u("FWA.beee1787571148023"),
93
+ metricQuery: u("FWA.dfd31787571148548"),
94
+ refreshData: u("FWA.c7c41787571438840"),
95
+ toggleFavorite: u("FWA.1f621787571084077"),
96
+ submitForm: u("FWA.39961787571438890"),
97
+ approveTask: u("FWA.8b921787571438910"),
98
+ drawerPanel: u("FWA.72271787571438804"),
99
+ filterBar: u("FWA.7b391787571592730")
100
100
  };
101
- return e[t] ? e[t] : t.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[._-]+/g, " ").trim() || "未知基础能力";
101
+ return e[t] ? e[t] : t.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[._-]+/g, " ").trim() || u("FWA.fd9f1787571149593");
102
102
  }
103
- function Yt(t, e = "") {
103
+ function $t(t, e = "") {
104
104
  return {
105
105
  missingPrimitives: [...new Set(t)],
106
106
  gapType: "runtime_capability_primitives",
107
107
  userNeed: e,
108
- missingCapabilities: jt(t)
108
+ missingCapabilities: Ut(t)
109
109
  };
110
110
  }
111
- const Ut = /* @__PURE__ */ new Set(["callApiAction", "submitForm", "approveTask"]);
112
- function Xt(t) {
111
+ const Xt = /* @__PURE__ */ new Set(["callApiAction", "submitForm", "approveTask"]);
112
+ function Jt(t) {
113
113
  return !!(t && typeof t == "object" && !Array.isArray(t));
114
114
  }
115
- function et(t, e) {
116
- return Yt(t, e);
115
+ function at(t, e) {
116
+ return $t(t, e);
117
117
  }
118
- function Jt(t, e = "挂载卡片内部能力") {
119
- if (!Xt(t))
118
+ function Qt(t, e = u("FWA.096d1787571020642")) {
119
+ if (!Jt(t))
120
120
  return {
121
121
  allowed: !1,
122
122
  error: {
123
123
  code: "INVALID_PARAMS",
124
- message: "Runtime capability 必须是结构化对象。"
124
+ message: u("FWA.7a4a1787570431480")
125
125
  }
126
126
  };
127
- const a = t, n = Array.isArray(a.actions) ? a.actions.map((s) => s.type).filter((s) => Ut.has(s)) : [];
127
+ const a = t, n = Array.isArray(a.actions) ? a.actions.map((s) => s.type).filter((s) => Xt.has(s)) : [];
128
128
  if (n.length > 0)
129
129
  return {
130
130
  allowed: !1,
131
- gap: et(n, e),
131
+ gap: at(n, e),
132
132
  error: {
133
133
  code: "POLICY_REJECTED",
134
- message: `左画布默认禁用高风险业务动作:${n.join("、")}`,
134
+ message: u("FWA.9e4b1787570536667", { p0: n.join("、") }),
135
135
  details: { highRisk: n }
136
136
  }
137
137
  };
138
- const i = qt(a);
138
+ const i = Yt(a);
139
139
  return i.length > 0 ? {
140
140
  allowed: !1,
141
- gap: et(i, e),
141
+ gap: at(i, e),
142
142
  error: {
143
143
  code: "PRIMITIVE_GAP",
144
- message: "缺少或禁用了必要的 Runtime Primitive,已拒绝写入半成品能力。",
145
- details: et(i, e)
144
+ message: u("FWA.d1b41787570265678"),
145
+ details: at(i, e)
146
146
  }
147
147
  } : {
148
148
  allowed: !0,
149
149
  capability: a
150
150
  };
151
151
  }
152
- const U = 4, N = Ft, S = 12, Ot = 8, Wt = 6, xa = 4, ht = "card.custom.nestedContainer", Qt = "nested-card-container", Zt = 240, Tt = 16, Ht = 0.35, ft = 8, rt = 2, ct = 1, te = 1, ee = 12, j = 12, ae = 3;
153
- function H(t) {
152
+ const X = 4, w = Kt, S = 12, Lt = 8, Ot = 6, Ia = 4, ft = "card.custom.nestedContainer", Zt = "nested-card-container", te = 240, Ht = 16, Tt = 0.35, yt = 8, st = 2, dt = 1, ee = 1, ae = 12, U = 12, ne = 3;
153
+ function T(t) {
154
154
  return Math.round(t * 1e3) / 1e3;
155
155
  }
156
- function z(t, e, a) {
156
+ function V(t, e, a) {
157
157
  return Math.min(a, Math.max(e, t));
158
158
  }
159
- function h(t) {
159
+ function f(t) {
160
160
  return Math.max(0, Math.round(Number.isFinite(t) ? t : 0));
161
161
  }
162
- function yt(t) {
162
+ function gt(t) {
163
163
  return Math.max(0, Math.round(Number.isFinite(t) ? t : 0));
164
164
  }
165
- function p(t) {
165
+ function h(t) {
166
166
  return Math.max(1, Math.round(Number.isFinite(t) ? t : 1));
167
167
  }
168
- function ne(t, e) {
169
- const a = p(e), n = p(t);
170
- return n > S ? n : p(n / S * a);
168
+ function ie(t, e) {
169
+ const a = h(e), n = h(t);
170
+ return n > S ? n : h(n / S * a);
171
171
  }
172
- function ie(t, e, a) {
173
- const n = p(t.w), s = e && a && n <= p(a.w) && n <= S ? ne(t.w, e.w) : n;
172
+ function re(t, e, a) {
173
+ const n = h(t.w), s = e && a && n <= h(a.w) && n <= S ? ie(t.w, e.w) : n;
174
174
  return {
175
175
  i: t.i,
176
- x: z(h(t.x), 0, Math.max(0, N - s)),
177
- y: h(t.y),
176
+ x: V(f(t.x), 0, Math.max(0, w - s)),
177
+ y: f(t.y),
178
178
  w: s,
179
- h: p(t.h),
179
+ h: h(t.h),
180
180
  static: t.static
181
181
  };
182
182
  }
183
- function J(t, e, a) {
183
+ function Q(t, e, a) {
184
184
  const n = e > 0 ? e : a;
185
- return H(t / n * a);
185
+ return T(t / n * a);
186
186
  }
187
187
  function B(t, e, a) {
188
188
  a !== void 0 && (t[e] = a);
189
189
  }
190
- function E(t, e) {
190
+ function C(t, e) {
191
191
  const a = t.y - e.y;
192
192
  if (a !== 0) return a;
193
193
  const n = t.x - e.x;
194
194
  return n !== 0 ? n : t.i.localeCompare(e.i);
195
195
  }
196
- function re(t) {
196
+ function se(t) {
197
197
  const e = /* @__PURE__ */ new Map();
198
198
  t.forEach((n) => {
199
199
  e.set(n.y, [...e.get(n.y) || [], n]);
@@ -201,89 +201,89 @@ function re(t) {
201
201
  const a = /* @__PURE__ */ new Map();
202
202
  return e.forEach((n) => {
203
203
  var d;
204
- const i = n.slice().sort(E), s = i[i.length - 1];
205
- !s || (d = s.children) != null && d.length || Math.max(...i.map((r) => r.x + r.w)) !== N - 1 || a.set(s.i, {
204
+ const i = n.slice().sort(C), s = i[i.length - 1];
205
+ !s || (d = s.children) != null && d.length || Math.max(...i.map((r) => r.x + r.w)) !== w - 1 || a.set(s.i, {
206
206
  ...s,
207
- w: N - s.x
207
+ w: w - s.x
208
208
  });
209
209
  }), t.map((n) => a.get(n.i) || n);
210
210
  }
211
- function dt(t, e) {
211
+ function ut(t, e) {
212
212
  return t.x < e.x + e.w && t.x + t.w > e.x;
213
213
  }
214
214
  function _t(t, e) {
215
215
  return Math.max(0, Math.min(t.x + t.w, e.x + e.w) - Math.max(t.x, e.x));
216
216
  }
217
- function q(t, e) {
218
- if (!dt(t, e)) return !1;
217
+ function Y(t, e) {
218
+ if (!ut(t, e)) return !1;
219
219
  const a = _t(t, e);
220
220
  return a <= 0 ? !1 : a / Math.max(1, Math.min(t.w, e.w)) >= 0.25;
221
221
  }
222
- function gt(t, e) {
223
- return q(t, e) && t.y < e.y + e.h;
222
+ function xt(t, e) {
223
+ return Y(t, e) && t.y < e.y + e.h;
224
224
  }
225
- function se(t, e) {
226
- if (_t(t, e) <= 0 || q(t, e) || !(t.y < e.y + e.h && e.y < t.y + t.h) || t.x <= e.x || t.x >= e.x + e.w) return null;
225
+ function oe(t, e) {
226
+ if (_t(t, e) <= 0 || Y(t, e) || !(t.y < e.y + e.h && e.y < t.y + t.h) || t.x <= e.x || t.x >= e.x + e.w) return null;
227
227
  const i = Math.max(1, t.x - e.x);
228
228
  return i < e.w ? { ...e, w: i } : null;
229
229
  }
230
- function X(t) {
230
+ function J(t) {
231
231
  const e = [];
232
- return t.slice().sort(E).forEach((a) => {
232
+ return t.slice().sort(C).forEach((a) => {
233
233
  const n = e.find((i) => {
234
234
  const s = Math.min(...i.map((r) => r.y)), c = Math.max(...i.map((r) => r.y + r.h)), d = Math.max(0, Math.min(a.y + a.h, c) - Math.max(a.y, s));
235
235
  return Math.abs(a.y - s) <= 1 || d / Math.max(1, Math.min(a.h, c - s)) >= 0.7;
236
236
  });
237
- n ? (n.push(a), n.sort(E)) : e.push([a]);
237
+ n ? (n.push(a), n.sort(C)) : e.push([a]);
238
238
  }), e;
239
239
  }
240
- function oe(t) {
241
- if (t.length < 3 || t.some((l) => {
242
- var f;
243
- return (f = l.children) == null ? void 0 : f.length;
240
+ function ce(t) {
241
+ if (t.length < 3 || t.some((p) => {
242
+ var y;
243
+ return (y = p.children) == null ? void 0 : y.length;
244
244
  })) return t;
245
- const e = t.slice().sort(E), a = e[0], n = e[e.length - 1];
245
+ const e = t.slice().sort(C), a = e[0], n = e[e.length - 1];
246
246
  if (!a || !n) return t;
247
- const i = n.x + n.w - a.x, s = e.reduce((l, f) => l + f.w, 0), c = e.slice(1).map((l, f) => l.x - (e[f].x + e[f].w));
247
+ const i = n.x + n.w - a.x, s = e.reduce((p, y) => p + y.w, 0), c = e.slice(1).map((p, y) => p.x - (e[y].x + e[y].w));
248
248
  if (c.length < 2) return t;
249
249
  const d = Math.max(...c), r = Math.min(...c);
250
250
  if (d - r <= 0) return t;
251
251
  const o = i - s;
252
252
  if (o < 0) return t;
253
- const m = Math.max(0, Math.round(o / Math.max(1, e.length - 1)));
254
- let u = a.x;
255
- return e.map((l, f) => {
256
- const x = z(u, 0, Math.max(0, N - l.w));
257
- return u = x + l.w + m, f === e.length - 1 && x + l.w > N ? l : { ...l, x };
253
+ const l = Math.max(0, Math.round(o / Math.max(1, e.length - 1)));
254
+ let m = a.x;
255
+ return e.map((p, y) => {
256
+ const I = V(m, 0, Math.max(0, w - p.w));
257
+ return m = I + p.w + l, y === e.length - 1 && I + p.w > w ? p : { ...p, x: I };
258
258
  });
259
259
  }
260
- function ce(t) {
260
+ function de(t) {
261
261
  const e = /* @__PURE__ */ new Map();
262
- return X(t).forEach((a) => {
263
- oe(a).forEach((n) => e.set(n.i, n));
262
+ return J(t).forEach((a) => {
263
+ ce(a).forEach((n) => e.set(n.i, n));
264
264
  }), t.map((a) => e.get(a.i) || a);
265
265
  }
266
- function Ia(t, e) {
267
- const a = Math.max(1, e.maxGapRows ?? 4), n = Math.max(0, e.targetGapRows ?? 0), i = t.filter((g) => !g.parentId).slice().sort(E), s = i.find(e.isHeader);
266
+ function va(t, e) {
267
+ const a = Math.max(1, e.maxGapRows ?? 4), n = Math.max(0, e.targetGapRows ?? 0), i = t.filter((x) => !x.parentId).slice().sort(C), s = i.find(e.isHeader);
268
268
  if (!s) return t;
269
- const c = h(s.y), d = c + p(s.h), o = X(i).map((g) => g.slice().sort(E)).filter((g) => Math.min(...g.map((y) => h(y.y))) > c && g.some(e.isSuccessorStrip)).sort((g, C) => {
270
- const y = Math.min(...g.map((R) => h(R.y))), w = Math.min(...C.map((R) => h(R.y)));
271
- return y - w;
269
+ const c = f(s.y), d = c + h(s.h), o = J(i).map((x) => x.slice().sort(C)).filter((x) => Math.min(...x.map((g) => f(g.y))) > c && x.some(e.isSuccessorStrip)).sort((x, F) => {
270
+ const g = Math.min(...x.map((N) => f(N.y))), W = Math.min(...F.map((N) => f(N.y)));
271
+ return g - W;
272
272
  })[0];
273
273
  if (!o || o.length < 2) return t;
274
- const m = Math.min(...o.map((g) => h(g.y)));
275
- if (m - d <= a) return t;
276
- const l = d + n, f = m - l;
277
- if (f <= 0) return t;
278
- const x = new Set(
279
- i.filter((g) => h(g.y) >= m).map((g) => String(g.i))
274
+ const l = Math.min(...o.map((x) => f(x.y)));
275
+ if (l - d <= a) return t;
276
+ const p = d + n, y = l - p;
277
+ if (y <= 0) return t;
278
+ const I = new Set(
279
+ i.filter((x) => f(x.y) >= l).map((x) => String(x.i))
280
280
  );
281
- return t.map((g) => x.has(String(g.i)) ? { ...g, y: Math.max(0, h(g.y) - f) } : g);
281
+ return t.map((x) => I.has(String(x.i)) ? { ...x, y: Math.max(0, f(x.y) - y) } : x);
282
282
  }
283
- function de(t, e) {
283
+ function ue(t, e) {
284
284
  if (t.length < 3) return;
285
- const a = t.slice().sort(E), n = a[0];
286
- if (!n || Math.abs(e.x - n.x) > ct) return;
285
+ const a = t.slice().sort(C), n = a[0];
286
+ if (!n || Math.abs(e.x - n.x) > dt) return;
287
287
  const i = e.x + e.w;
288
288
  let s = n.x + n.w, c = 1;
289
289
  for (let d = 1; d < a.length; d += 1) {
@@ -294,56 +294,56 @@ function de(t, e) {
294
294
  if (!(c < 2 || c >= a.length))
295
295
  return s;
296
296
  }
297
- function ue(t) {
297
+ function me(t) {
298
298
  var a, n;
299
299
  const e = [];
300
300
  for (let i = 1; i < t.length; i += 1) {
301
- const s = (t[i - 1] || []).slice().sort(E), c = (t[i] || []).slice().sort(E);
301
+ const s = (t[i - 1] || []).slice().sort(C), c = (t[i] || []).slice().sort(C);
302
302
  if (s.length < 3 || c.length !== 2) continue;
303
303
  const d = c[0], r = c[1];
304
304
  if (!d || !r || (a = d.children) != null && a.length || (n = r.children) != null && n.length || d.w < r.w * 1.35) continue;
305
- const o = de(s, d);
305
+ const o = ue(s, d);
306
306
  if (o === void 0) continue;
307
- const u = Math.min(o, r.x - ct) - d.x;
308
- !Number.isFinite(u) || u <= d.w || e.push({
307
+ const m = Math.min(o, r.x - dt) - d.x;
308
+ !Number.isFinite(m) || m <= d.w || e.push({
309
309
  ...d,
310
- w: z(u, 1, N - d.x)
310
+ w: V(m, 1, w - d.x)
311
311
  });
312
312
  }
313
313
  return e;
314
314
  }
315
- function me(t) {
316
- const e = X(t), a = new Map(ue(e).map((n) => [n.i, n]));
315
+ function le(t) {
316
+ const e = J(t), a = new Map(me(e).map((n) => [n.i, n]));
317
317
  return a.size === 0 ? t : t.map((n) => a.get(n.i) || n);
318
318
  }
319
319
  function k(t) {
320
320
  return /(?:recognized|image-fallback)-\d+/.test(t.i);
321
321
  }
322
- function le(t) {
322
+ function pe(t) {
323
323
  return new Set(t.filter((e) => {
324
324
  var a, n, i, s;
325
325
  return k({ i: e.id }) && (((a = e.meta) == null ? void 0 : a.imageLayoutManualOverride) === !0 && ((n = e.meta) == null ? void 0 : n.imageLayoutManualOverrideSource) === "gridstack" || ((i = e.meta) == null ? void 0 : i.manualCanvasLayout) === !0 && ((s = e.meta) == null ? void 0 : s.layoutManualOverrideSource) === "gridstack");
326
326
  }).map((e) => e.id));
327
327
  }
328
- function Q(t) {
328
+ function Z(t) {
329
329
  const e = t.i.match(/(?:recognized|image-fallback)-(\d+)/), a = e ? Number(e[1]) : Number.POSITIVE_INFINITY;
330
330
  return Number.isFinite(a) ? a : Number.POSITIVE_INFINITY;
331
331
  }
332
- function pe(t, e) {
333
- const a = Q(t) - Q(e);
334
- return a !== 0 ? a : E(t, e);
335
- }
336
332
  function he(t, e) {
337
- const a = Q(t);
338
- return e.some((n) => Q(n) > a && q(t, n) && n.y < t.y);
333
+ const a = Z(t) - Z(e);
334
+ return a !== 0 ? a : C(t, e);
339
335
  }
340
336
  function fe(t, e) {
341
- const a = e.filter((n) => q(t, n)).map((n) => n.y + n.h);
337
+ const a = Z(t);
338
+ return e.some((n) => Z(n) > a && Y(t, n) && n.y < t.y);
339
+ }
340
+ function ye(t, e) {
341
+ const a = e.filter((n) => Y(t, n)).map((n) => n.y + n.h);
342
342
  if (a.length !== 0)
343
343
  return Math.max(...a);
344
344
  }
345
- function ut(t, e = /* @__PURE__ */ new Set()) {
346
- const a = t.filter((d) => !d.parentId && k(d) && !e.has(String(d.i))).sort(pe);
345
+ function mt(t, e = /* @__PURE__ */ new Set()) {
346
+ const a = t.filter((d) => !d.parentId && k(d) && !e.has(String(d.i))).sort(he);
347
347
  if (a.length < 2) return t;
348
348
  const n = /* @__PURE__ */ new Map(), i = Math.min(...a.map((d) => d.y));
349
349
  a.forEach((d) => {
@@ -351,180 +351,180 @@ function ut(t, e = /* @__PURE__ */ new Set()) {
351
351
  ...d,
352
352
  y: n.size === 0 ? i : d.y
353
353
  }, o = [...n.values()];
354
- if (he(r, a)) {
355
- const m = fe(r, o);
356
- m !== void 0 && r.y > m && (r.y = m);
354
+ if (fe(r, a)) {
355
+ const l = ye(r, o);
356
+ l !== void 0 && r.y > l && (r.y = l);
357
357
  }
358
- for (; o.some((m) => gt(r, m)); ) {
359
- const m = Math.max(
360
- ...o.filter((u) => gt(r, u)).map((u) => u.y + u.h)
358
+ for (; o.some((l) => xt(r, l)); ) {
359
+ const l = Math.max(
360
+ ...o.filter((m) => xt(r, m)).map((m) => m.y + m.h)
361
361
  );
362
- r.y = m;
362
+ r.y = l;
363
363
  }
364
- o.forEach((m) => {
365
- const u = se(r, m);
366
- u && n.set(u.i, u);
364
+ o.forEach((l) => {
365
+ const m = oe(r, l);
366
+ m && n.set(m.i, m);
367
367
  }), n.set(d.i, r);
368
368
  });
369
- const s = me(
370
- ce([...n.values()])
369
+ const s = le(
370
+ de([...n.values()])
371
371
  ), c = new Map(s.map((d) => [d.i, d]));
372
372
  return [...c.entries()].some(([d, r]) => {
373
- const o = a.find((m) => m.i === d);
373
+ const o = a.find((l) => l.i === d);
374
374
  return r.y !== (o == null ? void 0 : o.y) || r.x !== (o == null ? void 0 : o.x) || r.w !== (o == null ? void 0 : o.w);
375
375
  }) ? t.map((d) => c.get(d.i) || d) : t;
376
376
  }
377
- function ye(t, e) {
377
+ function ge(t, e) {
378
378
  if (!e || t.parentId || e.parentId || !k(t)) return !1;
379
- const a = h(t.x), n = h(e.x), i = h(t.y), s = h(e.y), c = p(t.w), d = p(e.w), r = p(t.h), o = p(e.h), m = n >= N * 0.15 && n + d >= N * 0.85, u = n >= N * 0.15 && d >= N * 0.45, l = a < Math.max(0, n - 4), f = c < Math.max(d * 0.7, d - 12), x = c > Math.max(d * 1.25, d + 12), g = a < Math.max(0, n - 4) && Math.abs(a + c - (n + d)) <= Math.max(6, d * 0.25), C = Math.abs(i - s) <= Math.max(2, Math.round(o * 0.15)), y = Math.max(0, Math.min(i + r, s + o) - Math.max(i, s)), w = C || y / Math.max(1, Math.min(r, o)) >= 0.65 || i > s && i < s + o, R = Array.isArray(t.children) && t.children.length > 0 && o > r && o >= Math.max(r + 4, r * 1.8);
380
- return (m || u) && w && l && (f || g || x) || R;
379
+ const a = f(t.x), n = f(e.x), i = f(t.y), s = f(e.y), c = h(t.w), d = h(e.w), r = h(t.h), o = h(e.h), l = n >= w * 0.15 && n + d >= w * 0.85, m = n >= w * 0.15 && d >= w * 0.45, p = a < Math.max(0, n - 4), y = c < Math.max(d * 0.7, d - 12), I = c > Math.max(d * 1.25, d + 12), x = a < Math.max(0, n - 4) && Math.abs(a + c - (n + d)) <= Math.max(6, d * 0.25), F = Math.abs(i - s) <= Math.max(2, Math.round(o * 0.15)), g = Math.max(0, Math.min(i + r, s + o) - Math.max(i, s)), W = F || g / Math.max(1, Math.min(r, o)) >= 0.65 || i > s && i < s + o, N = Array.isArray(t.children) && t.children.length > 0 && o > r && o >= Math.max(r + 4, r * 1.8);
380
+ return (l || m) && W && p && (y || x || I) || N;
381
381
  }
382
- function ge(t, e) {
383
- const a = h(t.y), n = h(e.y), i = p(t.h), s = p(e.h), c = Math.max(0, Math.min(a + i, n + s) - Math.max(a, n));
382
+ function xe(t, e) {
383
+ const a = f(t.y), n = f(e.y), i = h(t.h), s = h(e.h), c = Math.max(0, Math.min(a + i, n + s) - Math.max(a, n));
384
384
  return Math.abs(a - n) <= Math.max(2, Math.round(Math.min(i, s) * 0.25)) || c / Math.max(1, Math.min(i, s)) >= 0.7;
385
385
  }
386
- function xe(t, e) {
387
- if (!q(t, e)) return !1;
388
- const a = h(t.y) <= h(e.y) ? t : e, n = a === t ? e : t, i = h(a.y) + p(a.h), s = h(n.y), c = Math.max(2, Math.min(p(a.h), p(n.h)));
386
+ function Ie(t, e) {
387
+ if (!Y(t, e)) return !1;
388
+ const a = f(t.y) <= f(e.y) ? t : e, n = a === t ? e : t, i = f(a.y) + h(a.h), s = f(n.y), c = Math.max(2, Math.min(h(a.h), h(n.h)));
389
389
  return s >= i - 1 && s <= i + c;
390
390
  }
391
- function Ie(t, e) {
391
+ function ve(t, e) {
392
392
  if (t.length < 2) return !1;
393
- const a = t.slice().sort(E), n = Math.min(...a.map((s) => h(s.x)));
394
- if (Math.max(...a.map((s) => h(s.x) + p(s.w))) - n < N * 0.75) return !1;
393
+ const a = t.slice().sort(C), n = Math.min(...a.map((s) => f(s.x)));
394
+ if (Math.max(...a.map((s) => f(s.x) + h(s.w))) - n < w * 0.75) return !1;
395
395
  for (let s = 0; s < a.length; s += 1)
396
396
  for (let c = s + 1; c < a.length; c += 1) {
397
397
  const d = a[s], r = a[c];
398
- if (!d || !r || !ge(d, r) || dt(d, r)) continue;
399
- const o = e.get(String(d.i)), m = e.get(String(r.i));
400
- if (!(!o || !m) && xe(o, m))
398
+ if (!d || !r || !xe(d, r) || ut(d, r)) continue;
399
+ const o = e.get(String(d.i)), l = e.get(String(r.i));
400
+ if (!(!o || !l) && Ie(o, l))
401
401
  return !0;
402
402
  }
403
403
  return !1;
404
404
  }
405
- function ve(t, e) {
406
- const a = p(t.h), n = p(e.h), i = Array.isArray(t.children) ? t.children : [];
405
+ function Ae(t, e) {
406
+ const a = h(t.h), n = h(e.h), i = Array.isArray(t.children) ? t.children : [];
407
407
  if (i.length === 0) return Math.max(a, n);
408
- const s = i.reduce((r, o) => Math.max(r, h(o.y) + p(o.h)), 0), c = Math.max(10, s + 6), d = a <= 8 && i.length <= 2 ? 18 : Number.POSITIVE_INFINITY;
408
+ const s = i.reduce((r, o) => Math.max(r, f(o.y) + h(o.h)), 0), c = Math.max(10, s + 6), d = a <= 8 && i.length <= 2 ? 18 : Number.POSITIVE_INFINITY;
409
409
  return Math.min(
410
410
  Math.max(a, n, c),
411
411
  d
412
412
  );
413
413
  }
414
414
  function Me(t) {
415
- return k(t) && !t.parentId && h(t.x) <= ct && p(t.w) >= N * 0.45 && p(t.h) >= 36 && h(t.y) > 20 && h(t.x) + p(t.w) < N * 0.85;
415
+ return k(t) && !t.parentId && f(t.x) <= dt && h(t.w) >= w * 0.45 && h(t.h) >= 36 && f(t.y) > 20 && f(t.x) + h(t.w) < w * 0.85;
416
416
  }
417
417
  function Se(t, e) {
418
- const a = h(t.x), n = h(t.y), i = p(t.w), s = p(t.h);
418
+ const a = f(t.x), n = f(t.y), i = h(t.w), s = h(t.h);
419
419
  return e.some((c) => {
420
420
  if (String(c.i) === String(t.i) || c.parentId || !k(c)) return !1;
421
- const d = h(c.x), r = h(c.y), o = p(c.h);
422
- return !(d >= a + Math.min(i, N * 0.45) - 1) || o < s * 0.55 ? !1 : Math.max(0, Math.min(n + s, r + o) - Math.max(n, r)) / Math.max(1, Math.min(s, o)) >= 0.35;
421
+ const d = f(c.x), r = f(c.y), o = h(c.h);
422
+ return !(d >= a + Math.min(i, w * 0.45) - 1) || o < s * 0.55 ? !1 : Math.max(0, Math.min(n + s, r + o) - Math.max(n, r)) / Math.max(1, Math.min(s, o)) >= 0.35;
423
423
  });
424
424
  }
425
- function we(t) {
426
- const e = X(t.filter((n) => !n.parentId && k(n))), a = /* @__PURE__ */ new Set();
425
+ function We(t) {
426
+ const e = J(t.filter((n) => !n.parentId && k(n))), a = /* @__PURE__ */ new Set();
427
427
  return e.forEach((n) => {
428
- const i = n.slice().sort(E);
428
+ const i = n.slice().sort(C);
429
429
  i.filter(Me).forEach((c) => {
430
- const d = p(c.h);
431
- i.filter((m) => String(m.i) !== String(c.i)).some((m) => p(m.h) >= d * 0.55) || Se(c, t) || a.add(String(c.i));
430
+ const d = h(c.h);
431
+ i.filter((l) => String(l.i) !== String(c.i)).some((l) => h(l.h) >= d * 0.55) || Se(c, t) || a.add(String(c.i));
432
432
  });
433
433
  }), a.size === 0 ? t : t.map((n) => {
434
434
  if (!a.has(String(n.i))) return n;
435
- const i = h(n.x), s = Math.max(p(n.w), N - i);
435
+ const i = f(n.x), s = Math.max(h(n.w), w - i);
436
436
  return {
437
437
  ...n,
438
438
  x: i,
439
439
  w: s,
440
- minW: Math.min(s, p(n.minW ?? s)),
441
- maxW: Math.max(s, p(n.maxW ?? s))
440
+ minW: Math.min(s, h(n.minW ?? s)),
441
+ maxW: Math.max(s, h(n.maxW ?? s))
442
442
  };
443
443
  });
444
444
  }
445
- function va(t, e) {
446
- if ((e == null ? void 0 : e.version) !== U) return t;
445
+ function Aa(t, e) {
446
+ if ((e == null ? void 0 : e.version) !== X) return t;
447
447
  const a = new Map(e.nodes.filter((r) => !r.parentId).map((r) => [String(r.i), r])), n = new Map(t.nodes.filter((r) => !r.parentId && k(r)).map((r) => [String(r.i), r])), i = /* @__PURE__ */ new Set();
448
448
  if (t.nodes.forEach((r) => {
449
- ye(r, a.get(String(r.i))) && i.add(String(r.i));
450
- }), X([...a.values()].filter((r) => k(r))).forEach((r) => {
451
- Ie(r, n) && r.forEach((o) => i.add(String(o.i)));
449
+ ge(r, a.get(String(r.i))) && i.add(String(r.i));
450
+ }), J([...a.values()].filter((r) => k(r))).forEach((r) => {
451
+ ve(r, n) && r.forEach((o) => i.add(String(o.i)));
452
452
  }), i.size === 0) return t;
453
453
  const s = new Set(i);
454
454
  t.nodes.filter((r) => !r.parentId && k(r)).forEach((r) => {
455
455
  if (s.has(String(r.i))) return;
456
456
  const o = a.get(String(r.i));
457
457
  if (!o) return;
458
- [...i].some((u) => {
459
- const l = a.get(u);
460
- if (!l) return !1;
461
- const f = Math.abs(h(o.y) - h(l.y)) <= Math.max(
458
+ [...i].some((m) => {
459
+ const p = a.get(m);
460
+ if (!p) return !1;
461
+ const y = Math.abs(f(o.y) - f(p.y)) <= Math.max(
462
462
  1,
463
- Math.round(Math.min(p(o.h), p(l.h)) * 0.2)
464
- ), x = !dt(o, l);
465
- return f && x && q(r, l);
463
+ Math.round(Math.min(h(o.h), h(p.h)) * 0.2)
464
+ ), I = !ut(o, p);
465
+ return y && I && Y(r, p);
466
466
  }) && s.add(String(r.i));
467
467
  });
468
468
  const c = t.nodes.map((r) => {
469
469
  const o = a.get(String(r.i));
470
470
  if (!s.has(String(r.i)) || !o) return r;
471
- const m = ve(r, o), u = {
471
+ const l = Ae(r, o), m = {
472
472
  ...r,
473
473
  x: o.x,
474
474
  y: o.y,
475
475
  w: o.w,
476
- h: m
477
- }, l = o.minW ?? r.minW, f = o.maxW ?? r.maxW, x = o.maxH ?? r.maxH;
478
- return l !== void 0 && (u.minW = l), u.minH = Math.min(
479
- Math.max(1, p(o.minH ?? o.h), Array.isArray(r.children) ? m : 1),
480
- m
481
- ), f !== void 0 && (u.maxW = f), x !== void 0 && (u.maxH = x), u;
482
- }), d = we(c);
483
- return mt({
476
+ h: l
477
+ }, p = o.minW ?? r.minW, y = o.maxW ?? r.maxW, I = o.maxH ?? r.maxH;
478
+ return p !== void 0 && (m.minW = p), m.minH = Math.min(
479
+ Math.max(1, h(o.minH ?? o.h), Array.isArray(r.children) ? l : 1),
480
+ l
481
+ ), y !== void 0 && (m.maxW = y), I !== void 0 && (m.maxH = I), m;
482
+ }), d = We(c);
483
+ return lt({
484
484
  ...t,
485
- nodes: ut(d).sort(E)
485
+ nodes: mt(d).sort(C)
486
486
  });
487
487
  }
488
- function Z(t, e, a = N, n) {
489
- const i = J(t.x, e, a), s = J(t.x + t.w, e, a), c = z(
490
- yt(i),
488
+ function tt(t, e, a = w, n) {
489
+ const i = Q(t.x, e, a), s = Q(t.x + t.w, e, a), c = V(
490
+ gt(i),
491
491
  0,
492
492
  Math.max(0, a - 1)
493
- ), r = z(yt(s), c + 1, a) - c, o = {
493
+ ), r = V(gt(s), c + 1, a) - c, o = {
494
494
  i: t.i,
495
495
  x: c,
496
- y: h(t.y),
496
+ y: f(t.y),
497
497
  w: r,
498
- h: p(t.h)
498
+ h: h(t.h)
499
499
  };
500
- return B(o, "minW", t.minW === void 0 ? void 0 : z(p(J(t.minW, e, a)), 1, a)), B(o, "maxW", t.maxW === void 0 ? void 0 : z(p(J(t.maxW, e, a)), 1, a)), B(o, "minH", t.minH === void 0 ? void 0 : p(t.minH)), B(o, "maxH", t.maxH === void 0 ? void 0 : p(t.maxH)), B(o, "static", t.static), n && (o.parentId = n), o;
500
+ return B(o, "minW", t.minW === void 0 ? void 0 : V(h(Q(t.minW, e, a)), 1, a)), B(o, "maxW", t.maxW === void 0 ? void 0 : V(h(Q(t.maxW, e, a)), 1, a)), B(o, "minH", t.minH === void 0 ? void 0 : h(t.minH)), B(o, "maxH", t.maxH === void 0 ? void 0 : h(t.maxH)), B(o, "static", t.static), n && (o.parentId = n), o;
501
501
  }
502
502
  function Ma(t, e) {
503
- const a = e.cols || e.maxCols || N, n = re(t.map((i) => {
504
- const s = Z({ ...i.layout, i: i.id }, a, N), c = Dt(i);
503
+ const a = e.cols || e.maxCols || w, n = se(t.map((i) => {
504
+ const s = tt({ ...i.layout, i: i.id }, a, w), c = Dt(i);
505
505
  return c.length > 0 ? { ...s, children: c } : s;
506
- }).sort(E));
506
+ }).sort(C));
507
507
  return {
508
- version: U,
509
- cols: N,
510
- rowHeight: Ot,
511
- gap: Wt,
512
- nodes: ut(n, le(t)).sort(E)
508
+ version: X,
509
+ cols: w,
510
+ rowHeight: Lt,
511
+ gap: Ot,
512
+ nodes: mt(n, pe(t)).sort(C)
513
513
  };
514
514
  }
515
- function xt(t, e, a) {
515
+ function It(t, e, a) {
516
516
  if (!Number.isFinite(t.x) || !Number.isFinite(t.y) || !Number.isFinite(t.w) || !Number.isFinite(t.h) || t.w < 1 || t.h < 1) return !0;
517
517
  if (!e) return t.h > a || t.y > a;
518
518
  const n = Math.max(1, e.h), i = Math.max(0, e.y), s = Math.max(a, n * 4 + 20);
519
519
  return t.h > Math.max(a, n * 4 + 20) || Math.abs(t.y - i) > s;
520
520
  }
521
- function Ne(t, e) {
521
+ function we(t, e) {
522
522
  if (!e || !/(?:recognized|image-fallback)-\d+/.test(t.i)) return !1;
523
523
  const a = Math.abs(t.y - e.y), n = Math.max(t.h, e.h) / Math.max(1, Math.min(t.h, e.h)), i = Math.max(t.w, e.w) / Math.max(1, Math.min(t.w, e.w));
524
524
  return a > Math.max(6, e.h * 0.5) || n > 1.65 || i > 1.45;
525
525
  }
526
- function at(t, e, a, n, i, s) {
527
- const c = Z({
526
+ function nt(t, e, a, n, i, s) {
527
+ const c = tt({
528
528
  i: t.i,
529
529
  x: t.x,
530
530
  y: t.y,
@@ -535,7 +535,7 @@ function at(t, e, a, n, i, s) {
535
535
  maxW: t.maxW,
536
536
  maxH: t.maxH,
537
537
  static: t.static
538
- }, e, a, t.parentId), d = n ? Z({
538
+ }, e, a, t.parentId), d = n ? tt({
539
539
  i: n.i,
540
540
  x: n.x,
541
541
  y: n.y,
@@ -546,7 +546,7 @@ function at(t, e, a, n, i, s) {
546
546
  maxW: n.maxW,
547
547
  maxH: n.maxH,
548
548
  static: n.static
549
- }, a, a, n.parentId) : void 0, r = d && xt(d, void 0, i) ? { ...d, h: Math.min(d.h, i) } : d, o = xt(c, r, i) || s && Ne(c, r) ? r || { ...c, h: Math.min(c.h, i) } : c;
549
+ }, a, a, n.parentId) : void 0, r = d && It(d, void 0, i) ? { ...d, h: Math.min(d.h, i) } : d, o = It(c, r, i) || s && we(c, r) ? r || { ...c, h: Math.min(c.h, i) } : c;
550
550
  return {
551
551
  ...t,
552
552
  ...o,
@@ -555,54 +555,54 @@ function at(t, e, a, n, i, s) {
555
555
  };
556
556
  }
557
557
  function Sa(t, e = {}) {
558
- var C;
559
- const a = t.cols || N, n = e.maxItemRows || Zt, i = e.repairStaleImageFallback !== !1, s = e.preserveManualImageNodeIds || /* @__PURE__ */ new Set(), c = e.preserveManualNestedImageParentIds || /* @__PURE__ */ new Set(), d = new Map(
560
- (((C = e.fallbackTree) == null ? void 0 : C.nodes) || []).filter((y) => !y.parentId).map((y) => [y.i, y])
561
- ), r = t.nodes.map((y) => {
562
- const w = !y.parentId, R = w ? N : S, A = w ? a : S, _ = w ? d.get(y.i) : void 0, P = at(
563
- y,
564
- A,
565
- R,
558
+ var F;
559
+ const a = t.cols || w, n = e.maxItemRows || te, i = e.repairStaleImageFallback !== !1, s = e.preserveManualImageNodeIds || /* @__PURE__ */ new Set(), c = e.preserveManualNestedImageParentIds || /* @__PURE__ */ new Set(), d = new Map(
560
+ (((F = e.fallbackTree) == null ? void 0 : F.nodes) || []).filter((g) => !g.parentId).map((g) => [g.i, g])
561
+ ), r = t.nodes.map((g) => {
562
+ const W = !g.parentId, N = W ? w : S, b = W ? a : S, _ = W ? d.get(g.i) : void 0, P = nt(
563
+ g,
564
+ b,
565
+ N,
566
566
  _,
567
567
  n,
568
- i && !s.has(String(y.i))
569
- ), D = new Map(((_ == null ? void 0 : _.children) || []).map((I) => [I.i, I])), G = Array.isArray(y.children) ? y.children.map((I) => at(
570
- { ...I, parentId: I.parentId || y.i },
568
+ i && !s.has(String(g.i))
569
+ ), D = new Map(((_ == null ? void 0 : _.children) || []).map((v) => [v.i, v])), G = Array.isArray(g.children) ? g.children.map((v) => nt(
570
+ { ...v, parentId: v.parentId || g.i },
571
571
  S,
572
572
  S,
573
- D.get(I.i),
573
+ D.get(v.i),
574
574
  n,
575
- i && !c.has(String(y.i))
576
- )) : y.children;
575
+ i && !c.has(String(g.i))
576
+ )) : g.children;
577
577
  return G === void 0 ? P : { ...P, children: G };
578
- }), o = new Set(r.filter((y) => !y.parentId).map((y) => y.i)), m = e.missingNodeFallbackTree || e.fallbackTree, u = ((m == null ? void 0 : m.nodes) || []).filter((y) => !y.parentId && !o.has(y.i)).map((y) => at(
579
- y,
580
- N,
581
- N,
578
+ }), o = new Set(r.filter((g) => !g.parentId).map((g) => g.i)), l = e.missingNodeFallbackTree || e.fallbackTree, m = ((l == null ? void 0 : l.nodes) || []).filter((g) => !g.parentId && !o.has(g.i)).map((g) => nt(
579
+ g,
580
+ w,
581
+ w,
582
582
  void 0,
583
583
  n,
584
584
  i
585
- )), l = new Set(u.map((y) => y.i)), x = [
586
- ...l.size === 0 ? r : r.map((y) => {
587
- if (!Array.isArray(y.children)) return y;
588
- const w = y.children.filter((R) => !l.has(R.i));
589
- return w.length === y.children.length ? y : { ...y, children: w };
585
+ )), p = new Set(m.map((g) => g.i)), I = [
586
+ ...p.size === 0 ? r : r.map((g) => {
587
+ if (!Array.isArray(g.children)) return g;
588
+ const W = g.children.filter((N) => !p.has(N.i));
589
+ return W.length === g.children.length ? g : { ...g, children: W };
590
590
  }),
591
- ...u
592
- ], g = i ? ut(x, /* @__PURE__ */ new Set([
591
+ ...m
592
+ ], x = i ? mt(I, /* @__PURE__ */ new Set([
593
593
  ...s,
594
- ...[...c].filter((y) => !s.has(y))
595
- ])) : x;
596
- return mt({
594
+ ...[...c].filter((g) => !s.has(g))
595
+ ])) : I;
596
+ return lt({
597
597
  ...t,
598
- version: U,
599
- cols: N,
600
- rowHeight: Ot,
601
- gap: Wt,
602
- nodes: g.sort(E)
598
+ version: X,
599
+ cols: w,
600
+ rowHeight: Lt,
601
+ gap: Ot,
602
+ nodes: x.sort(C)
603
603
  });
604
604
  }
605
- function wa(t) {
605
+ function Wa(t) {
606
606
  const e = (a) => {
607
607
  const n = {
608
608
  ...a,
@@ -618,7 +618,7 @@ function wa(t) {
618
618
  }))
619
619
  };
620
620
  }
621
- function Na(t) {
621
+ function wa(t) {
622
622
  const e = {
623
623
  id: t.i,
624
624
  x: t.x,
@@ -632,39 +632,39 @@ function Na(t) {
632
632
  };
633
633
  return t.static ? (e.noMove = !0, e.noResize = !0, e.locked = !0) : t.static === !1 && (e.noMove = !1, e.noResize = !1, e.locked = !1), e;
634
634
  }
635
- function Ce(t) {
635
+ function Fe(t) {
636
636
  return {
637
637
  id: String(t.i),
638
- x: h(t.x),
639
- y: h(t.y),
640
- w: p(t.w),
641
- h: p(t.h)
638
+ x: f(t.x),
639
+ y: f(t.y),
640
+ w: h(t.w),
641
+ h: h(t.h)
642
642
  };
643
643
  }
644
- function Re(t, e) {
644
+ function Ne(t, e) {
645
645
  return {
646
646
  id: String(t.id || (e == null ? void 0 : e.i) || ""),
647
- x: h(t.x ?? (e == null ? void 0 : e.x) ?? 0),
648
- y: h(t.y ?? (e == null ? void 0 : e.y) ?? 0),
649
- w: p(t.w ?? (e == null ? void 0 : e.w) ?? 1),
650
- h: p(t.h ?? (e == null ? void 0 : e.h) ?? 1)
647
+ x: f(t.x ?? (e == null ? void 0 : e.x) ?? 0),
648
+ y: f(t.y ?? (e == null ? void 0 : e.y) ?? 0),
649
+ w: h(t.w ?? (e == null ? void 0 : e.w) ?? 1),
650
+ h: h(t.h ?? (e == null ? void 0 : e.h) ?? 1)
651
651
  };
652
652
  }
653
- function Ee(t, e) {
653
+ function Ce(t, e) {
654
654
  return t.x < e.x + e.w && t.x + t.w > e.x && t.y < e.y + e.h && t.y + t.h > e.y;
655
655
  }
656
- function Ae(t, e) {
656
+ function be(t, e) {
657
657
  return e.y > t.y && e.x === t.x && e.w === t.w && e.h === t.h;
658
658
  }
659
- function be(t, e, a) {
660
- return Ae(t, e) ? a.some((n) => Ee(t, n) && e.y >= n.y + n.h - 1) : !1;
659
+ function Ee(t, e, a) {
660
+ return be(t, e) ? a.some((n) => Ce(t, n) && e.y >= n.y + n.h - 1) : !1;
661
661
  }
662
- function Le(t, e, a) {
662
+ function Re(t, e, a) {
663
663
  if (!a || a.size === 0) return /* @__PURE__ */ new Set();
664
664
  const n = new Map(
665
665
  t.filter((c) => typeof c.id == "string" && c.id.length > 0).map((c) => {
666
666
  const d = String(c.id);
667
- return [d, Re(c, e.get(d))];
667
+ return [d, Ne(c, e.get(d))];
668
668
  })
669
669
  ), i = /* @__PURE__ */ new Map();
670
670
  a.forEach((c) => {
@@ -677,40 +677,40 @@ function Le(t, e, a) {
677
677
  if (i.has(d)) return;
678
678
  const r = e.get(d);
679
679
  if (!r) return;
680
- const o = Ce(r);
681
- be(o, c, [...i.values()]) && (i.set(d, c), s = !0);
680
+ const o = Fe(r);
681
+ Ee(o, c, [...i.values()]) && (i.set(d, c), s = !0);
682
682
  });
683
683
  return new Set([...i.keys()].filter((c) => !a.has(c)));
684
684
  }
685
- function Ca(t, e, a = {}) {
686
- const n = new Map(e.nodes.map((d) => [String(d.i), d])), i = a.editedWidgetIds, s = Le(t, n, i), c = t.filter((d) => typeof d.id == "string" && d.id.length > 0).map((d) => {
687
- const r = d.id, o = n.get(r), m = !i || i.has(r) || s.has(r) || !o, u = {
685
+ function Fa(t, e, a = {}) {
686
+ const n = new Map(e.nodes.map((d) => [String(d.i), d])), i = a.editedWidgetIds, s = Re(t, n, i), c = t.filter((d) => typeof d.id == "string" && d.id.length > 0).map((d) => {
687
+ const r = d.id, o = n.get(r), l = !i || i.has(r) || s.has(r) || !o, m = {
688
688
  ...o || { i: r, x: 0, y: 0, w: 1, h: 1 },
689
689
  i: r,
690
- x: H(m ? d.x ?? (o == null ? void 0 : o.x) ?? 0 : o.x),
691
- y: H(m ? d.y ?? (o == null ? void 0 : o.y) ?? 0 : o.y),
692
- w: H(m ? d.w ?? (o == null ? void 0 : o.w) ?? 1 : o.w),
693
- h: H(m ? d.h ?? (o == null ? void 0 : o.h) ?? 1 : o.h)
690
+ x: T(l ? d.x ?? (o == null ? void 0 : o.x) ?? 0 : o.x),
691
+ y: T(l ? d.y ?? (o == null ? void 0 : o.y) ?? 0 : o.y),
692
+ w: T(l ? d.w ?? (o == null ? void 0 : o.w) ?? 1 : o.w),
693
+ h: T(l ? d.h ?? (o == null ? void 0 : o.h) ?? 1 : o.h)
694
694
  };
695
- return B(u, "minW", d.minW ?? (o == null ? void 0 : o.minW)), B(u, "maxW", d.maxW ?? (o == null ? void 0 : o.maxW)), B(u, "minH", d.minH ?? (o == null ? void 0 : o.minH)), B(u, "maxH", d.maxH ?? (o == null ? void 0 : o.maxH)), B(u, "static", o == null ? void 0 : o.static), u;
695
+ return B(m, "minW", d.minW ?? (o == null ? void 0 : o.minW)), B(m, "maxW", d.maxW ?? (o == null ? void 0 : o.maxW)), B(m, "minH", d.minH ?? (o == null ? void 0 : o.minH)), B(m, "maxH", d.maxH ?? (o == null ? void 0 : o.maxH)), B(m, "static", o == null ? void 0 : o.static), m;
696
696
  });
697
- return mt({
697
+ return lt({
698
698
  ...e,
699
- version: U,
700
- cols: N,
701
- nodes: c.sort(E)
699
+ version: X,
700
+ cols: w,
701
+ nodes: c.sort(C)
702
702
  });
703
703
  }
704
- function Ra(t) {
704
+ function Na(t) {
705
705
  return {
706
706
  ...t,
707
- cols: N,
708
- maxCols: N,
707
+ cols: w,
708
+ maxCols: w,
709
709
  isSquareCell: !1,
710
- layoutVersion: U
710
+ layoutVersion: X
711
711
  };
712
712
  }
713
- function Ea(t, e) {
713
+ function Ca(t, e) {
714
714
  return {
715
715
  ...t || {},
716
716
  layoutTree: e
@@ -719,11 +719,11 @@ function Ea(t, e) {
719
719
  function M(t) {
720
720
  return t && typeof t == "object" && !Array.isArray(t) ? t : {};
721
721
  }
722
- function Oe(t) {
722
+ function Le(t) {
723
723
  const e = M(t.data), a = M(t.meta), n = M(t.source);
724
- return a.capabilityId === ht || e.containerRole === Qt || n.resourceKey === ht;
724
+ return a.capabilityId === ft || e.containerRole === Zt || n.resourceKey === ft;
725
725
  }
726
- function mt(t) {
726
+ function lt(t) {
727
727
  const e = /* @__PURE__ */ new Set();
728
728
  if (t.nodes.forEach((n) => {
729
729
  n.parentId && e.add(String(n.i)), (n.children || []).forEach((i) => {
@@ -733,7 +733,7 @@ function mt(t) {
733
733
  const a = t.nodes.filter((n) => n.parentId || !e.has(String(n.i)));
734
734
  return a.length === t.nodes.length ? t : { ...t, nodes: a };
735
735
  }
736
- function W(t) {
736
+ function O(t) {
737
737
  return M(t).shape === "customCanvas";
738
738
  }
739
739
  function Bt(t) {
@@ -741,97 +741,97 @@ function Bt(t) {
741
741
  const e = M(t.data), a = M(t.renderer), n = typeof t.title == "string" ? t.title.trim() : "", i = !t.data && !t.dataShape && !t.visualKind && !a.rendererKey, s = !n || n === t.id || /(?:recognized|image-fallback)-\d+/.test(n);
742
742
  return i || s || Object.keys(e).length === 0 && !t.capabilityId;
743
743
  }
744
- function It(t) {
744
+ function vt(t) {
745
745
  var a;
746
746
  if (!t) return -1;
747
747
  let e = 0;
748
748
  return t.title && t.title !== t.id && !/(?:recognized|image-fallback)-\d+/.test(t.title) && (e += 3), t.data && (e += 4), t.dataShape && (e += 2), t.visualKind && (e += 2), (a = t.renderer) != null && a.rendererKey && (e += 2), t.capabilityId && (e += 2), (t.dataBinding || t.dataBindingId) && (e += 2), t.dataBindingStatus && t.dataBindingStatus !== "ready" && (e += 1), t.humanIntervention && (e += 1), Bt(t) && (e -= 4), e;
749
749
  }
750
- function We(t, e, a) {
751
- return [t, e, a].filter((i) => !!i).sort((i, s) => It(s) - It(i))[0] || a;
750
+ function Oe(t, e, a) {
751
+ return [t, e, a].filter((i) => !!i).sort((i, s) => vt(s) - vt(i))[0] || a;
752
752
  }
753
- function Te(t) {
753
+ function He(t) {
754
754
  return {
755
- columns: ["事项", "状态"],
755
+ columns: [u("FWA.53ad1787571628618"), u("FWA.bce71787571626973")],
756
756
  rows: t.map((e, a) => ({
757
757
  id: `fallback-row-${a + 1}`,
758
758
  cells: [
759
- typeof e.label == "string" && e.label.trim() ? e.label.trim() : `事项 ${a + 1}`,
760
- typeof e.value == "string" && e.value.trim() ? e.value.trim() : "待问数"
759
+ typeof e.label == "string" && e.label.trim() ? e.label.trim() : u("FWA.b8e61787570918490", { p0: a + 1 }),
760
+ typeof e.value == "string" && e.value.trim() ? e.value.trim() : u("FWA.681d1787571548904")
761
761
  ]
762
762
  }))
763
763
  };
764
764
  }
765
- function He(t, e) {
765
+ function Te(t, e) {
766
766
  var n;
767
767
  const a = `${t.id} ${t.title || ""} ${e.title || ""} ${((n = e.meta) == null ? void 0 : n.capabilityId) || ""}`;
768
768
  return /image-fallback-16|asset|资产台账|资产 & 成本|资产&成本/i.test(a) ? {
769
- title: "全域 IT 资产台账",
769
+ title: u("FWA.2a2a1787570955592"),
770
770
  visualKind: "todoGrid",
771
771
  dataShape: "rows",
772
772
  rendererKey: "metricTiles",
773
773
  capabilityId: "card.metric.combo",
774
774
  items: [
775
- { label: "终端与办公设备", value: "待问数", tone: "warning" },
776
- { label: "服务器与机房设备", value: "待问数", tone: "warning" },
777
- { label: "商业软件 License", value: "待问数", tone: "warning" },
778
- { label: "云主机与存储资源", value: "待问数", tone: "warning" }
775
+ { label: u("FWA.78241787571088778"), value: u("FWA.681d1787571548904"), tone: "warning" },
776
+ { label: u("FWA.34591787571035365"), value: u("FWA.681d1787571548904"), tone: "warning" },
777
+ { label: u("FWA.b1891787570879762"), value: u("FWA.681d1787571548904"), tone: "warning" },
778
+ { label: u("FWA.22281787571036340"), value: u("FWA.681d1787571548904"), tone: "warning" }
779
779
  ]
780
780
  } : /image-fallback-18|成本分析|费用分析|donut/i.test(a) ? {
781
- title: "IT 成本分析",
781
+ title: u("FWA.55a41787571088690"),
782
782
  visualKind: "donut",
783
783
  dataShape: "rows",
784
784
  rendererKey: "donut",
785
785
  capabilityId: "card.chart.donut",
786
786
  items: [
787
- { label: "云资源费用", value: "待问数", share: 42, tone: "info" },
788
- { label: "软件采购", value: "待问数", share: 25, tone: "violet" },
789
- { label: "外包服务", value: "待问数", share: 17, tone: "warning" },
790
- { label: "维保与机房", value: "待问数", share: 16, tone: "neutral" }
787
+ { label: u("FWA.8b221787571282306"), value: u("FWA.681d1787571548904"), share: 42, tone: "info" },
788
+ { label: u("FWA.84f11787571487274"), value: u("FWA.681d1787571548904"), share: 25, tone: "violet" },
789
+ { label: u("FWA.2c2c1787571487772"), value: u("FWA.681d1787571548904"), share: 17, tone: "warning" },
790
+ { label: u("FWA.17521787571282866"), value: u("FWA.681d1787571548904"), share: 16, tone: "neutral" }
791
791
  ]
792
792
  } : /image-fallback-19|image-fallback-21|成本优化|预算执行|cost/i.test(a) ? {
793
- title: "成本优化",
793
+ title: u("FWA.a1571787571337994"),
794
794
  visualKind: "simpleList",
795
795
  dataShape: "rows",
796
796
  rendererKey: "simpleList",
797
797
  capabilityId: "card.analysis.businessSuggestion",
798
798
  items: [
799
- { label: "本月云费用环比", value: "待问数", tone: "warning" },
800
- { label: "可释放资源降本空间", value: "待问数", tone: "healthy" },
801
- { label: "预算执行偏差", value: "待问数", tone: "healthy" }
799
+ { label: u("FWA.e8861787571089301"), value: u("FWA.681d1787571548904"), tone: "warning" },
800
+ { label: u("FWA.7a591787570997769"), value: u("FWA.681d1787571548904"), tone: "healthy" },
801
+ { label: u("FWA.34b61787571162352"), value: u("FWA.681d1787571548904"), tone: "healthy" }
802
802
  ]
803
803
  } : /image-fallback-17|资产异常|异常/i.test(a) ? {
804
- title: "资产异常",
804
+ title: u("FWA.35b91787571337857"),
805
805
  visualKind: "simpleList",
806
806
  dataShape: "rows",
807
807
  rendererKey: "simpleList",
808
808
  capabilityId: "card.table.list",
809
809
  items: [
810
- { label: "闲置云主机待回收", value: "待问数", tone: "warning" },
811
- { label: "License 即将到期", value: "待问数", tone: "critical" },
812
- { label: "资产盘点完成率", value: "待问数", tone: "healthy" }
810
+ { label: u("FWA.24fb1787571036986"), value: u("FWA.681d1787571548904"), tone: "warning" },
811
+ { label: u("FWA.6b841787570880093"), value: u("FWA.681d1787571548904"), tone: "critical" },
812
+ { label: u("FWA.9b5b1787571090349"), value: u("FWA.681d1787571548904"), tone: "healthy" }
813
813
  ]
814
814
  } : {
815
- title: e.title ? `${e.title}子卡` : "待补口径子卡",
815
+ title: e.title ? u("FWA.83381787570958739", { p0: e.title }) : u("FWA.f4261787571163224"),
816
816
  visualKind: "simpleList",
817
817
  dataShape: "rows",
818
818
  rendererKey: "simpleList",
819
819
  capabilityId: "card.table.list",
820
820
  items: [
821
- { label: "待补充业务口径", value: "待问数", tone: "warning" },
822
- { label: "补充指标、表或字段后重试", value: "需补口径", tone: "info" }
821
+ { label: u("FWA.6f771787571090873"), value: u("FWA.681d1787571548904"), tone: "warning" },
822
+ { label: u("FWA.73f11787570880755"), value: u("FWA.6fec1787571387310"), tone: "info" }
823
823
  ]
824
824
  };
825
825
  }
826
826
  function _e(t, e) {
827
- var r, o, m, u, l;
827
+ var r, o, l, m, p;
828
828
  const a = `${((r = e.meta) == null ? void 0 : r.composeSource) || ""} ${String(M(e.data).source || "")}`;
829
829
  if (!/image/i.test(a) || !Bt(t)) return t;
830
- const n = He(t, e), i = t.dataBindingId || st(t.dataBinding) || `${t.id}-binding`, s = t.humanIntervention || {
830
+ const n = Te(t, e), i = t.dataBindingId || ot(t.dataBinding) || `${t.id}-binding`, s = t.humanIntervention || {
831
831
  required: !0,
832
832
  reason: "missing_business_context",
833
- message: `${n.title} 需要补充指标、表、字段或系统口径后再问数`
834
- }, c = Array.isArray((o = t.data) == null ? void 0 : o.items) ? t.data.items : n.items, d = Te(c);
833
+ message: u("FWA.a0df1787570419279", { p0: n.title })
834
+ }, c = Array.isArray((o = t.data) == null ? void 0 : o.items) ? t.data.items : n.items, d = He(c);
835
835
  return {
836
836
  ...t,
837
837
  title: n.title,
@@ -846,12 +846,12 @@ function _e(t, e) {
846
846
  ...t.dataBinding || {},
847
847
  bindingId: i,
848
848
  status: "error",
849
- queryIntent: t.queryIntent || `查询${n.title}`,
849
+ queryIntent: t.queryIntent || u("FWA.b9df1787570936049", { p0: n.title }),
850
850
  humanIntervention: s
851
851
  },
852
- dataBindingError: t.dataBindingError || "需要补充业务口径后再问数",
852
+ dataBindingError: t.dataBindingError || u("FWA.ca871787570878538"),
853
853
  humanIntervention: s,
854
- queryIntent: t.queryIntent || `查询${n.title}`,
854
+ queryIntent: t.queryIntent || u("FWA.b9df1787570936049", { p0: n.title }),
855
855
  renderer: t.renderer || { engine: "custom", rendererKey: n.rendererKey },
856
856
  state: t.state || {
857
857
  mode: "final",
@@ -863,27 +863,27 @@ function _e(t, e) {
863
863
  ...t.data || {},
864
864
  shape: n.dataShape,
865
865
  items: c,
866
- columns: Array.isArray((m = t.data) == null ? void 0 : m.columns) ? t.data.columns : d.columns,
867
- rows: Array.isArray((u = t.data) == null ? void 0 : u.rows) ? t.data.rows : d.rows,
866
+ columns: Array.isArray((l = t.data) == null ? void 0 : l.columns) ? t.data.columns : d.columns,
867
+ rows: Array.isArray((m = t.data) == null ? void 0 : m.rows) ? t.data.rows : d.rows,
868
868
  dataBindingId: i,
869
869
  dataBindingStatus: "error",
870
- dataBindingError: t.dataBindingError || "需要补充业务口径后再问数",
870
+ dataBindingError: t.dataBindingError || u("FWA.ca871787570878538"),
871
871
  humanIntervention: s,
872
872
  dataBindingHumanIntervention: s,
873
873
  capabilityId: t.capabilityId || n.capabilityId,
874
874
  dataShape: t.dataShape || n.dataShape,
875
875
  visualKind: t.visualKind || n.visualKind,
876
- rendererKey: ((l = t.renderer) == null ? void 0 : l.rendererKey) || n.rendererKey,
877
- queryIntent: t.queryIntent || `查询${n.title}`
876
+ rendererKey: ((p = t.renderer) == null ? void 0 : p.rendererKey) || n.rendererKey,
877
+ queryIntent: t.queryIntent || u("FWA.b9df1787570936049", { p0: n.title })
878
878
  }
879
879
  };
880
880
  }
881
881
  function Be(t) {
882
882
  const e = M(t.meta), a = M(t.data), n = M(e.visual), i = M(t.renderer), s = M(e.v2), c = Array.isArray(a.nestedBlocks) ? a.nestedBlocks : [], d = `${t.title} ${t.subtitle || ""} ${JSON.stringify(a.elements || [])}`;
883
- return c.length === 0 && !Oe(t) || e.organizationKind === "welcome_banner" || e.imageCanvasChromeOnly === !0 || n.businessSummaryBand === "risk" || a.nestedLayoutMode === "absolute" || i.rendererKey === "customCanvas" && /GLOBAL RISK POSTURE|risk posture|风险总览|经营健康综合得分/i.test(d) || s.referenceCompositeKind !== void 0;
883
+ return c.length === 0 && !Le(t) || e.organizationKind === "welcome_banner" || e.imageCanvasChromeOnly === !0 || n.businessSummaryBand === "risk" || a.nestedLayoutMode === "absolute" || i.rendererKey === "customCanvas" && /GLOBAL RISK POSTURE|risk posture|风险总览|经营健康综合得分/i.test(d) || s.referenceCompositeKind !== void 0;
884
884
  }
885
- function Aa(t) {
886
- return W(t.data) ? !Be(t) : !1;
885
+ function ba(t) {
886
+ return O(t.data) ? !Be(t) : !1;
887
887
  }
888
888
  function kt(t, e) {
889
889
  const a = _e(t, e), n = a.layout ? { ...a.layout, i: a.id } : Pt(a, 0), i = M(a.meta), s = a.renderer || {
@@ -943,26 +943,26 @@ function kt(t, e) {
943
943
  }
944
944
  };
945
945
  }
946
- function st(t) {
946
+ function ot(t) {
947
947
  const e = M(t), a = e.bindingId || e.id;
948
948
  return typeof a == "string" && a.trim() ? a : void 0;
949
949
  }
950
- function lt(t, e = {}) {
951
- var y, w, R, A;
950
+ function pt(t, e = {}) {
951
+ var g, W, N, b;
952
952
  const a = M(t.data), n = M(t.meta), i = t.renderer || {
953
953
  engine: "custom",
954
954
  rendererKey: typeof n.rendererKey == "string" ? n.rendererKey : "customCanvas"
955
- }, s = typeof n.capabilityId == "string" ? n.capabilityId : typeof a.capabilityId == "string" ? a.capabilityId : typeof ((w = (y = t.source) == null ? void 0 : y.params) == null ? void 0 : w.capabilityId) == "string" ? t.source.params.capabilityId : void 0, c = typeof n.dataShape == "string" ? n.dataShape : typeof a.dataShape == "string" ? a.dataShape : typeof a.shape == "string" ? a.shape : i.rendererKey, d = typeof n.visualKind == "string" ? n.visualKind : typeof a.visualKind == "string" ? a.visualKind : void 0, r = M(a.dataBinding), o = M(n.dataBinding), m = typeof a.dataBindingId == "string" ? a.dataBindingId : typeof n.dataBindingId == "string" ? n.dataBindingId : st(r) ?? st(o), u = typeof a.dataBindingStatus == "string" ? a.dataBindingStatus : typeof n.dataBindingStatus == "string" ? n.dataBindingStatus : typeof r.status == "string" ? r.status : ((R = t.state) == null ? void 0 : R.status) || "ready", l = M(a.humanIntervention), f = M(n.humanIntervention), x = typeof a.queryIntent == "string" ? a.queryIntent : typeof n.queryIntent == "string" ? n.queryIntent : typeof r.queryIntent == "string" ? r.queryIntent : void 0, g = e.layout || t.layout, C = {
955
+ }, s = typeof n.capabilityId == "string" ? n.capabilityId : typeof a.capabilityId == "string" ? a.capabilityId : typeof ((W = (g = t.source) == null ? void 0 : g.params) == null ? void 0 : W.capabilityId) == "string" ? t.source.params.capabilityId : void 0, c = typeof n.dataShape == "string" ? n.dataShape : typeof a.dataShape == "string" ? a.dataShape : typeof a.shape == "string" ? a.shape : i.rendererKey, d = typeof n.visualKind == "string" ? n.visualKind : typeof a.visualKind == "string" ? a.visualKind : void 0, r = M(a.dataBinding), o = M(n.dataBinding), l = typeof a.dataBindingId == "string" ? a.dataBindingId : typeof n.dataBindingId == "string" ? n.dataBindingId : ot(r) ?? ot(o), m = typeof a.dataBindingStatus == "string" ? a.dataBindingStatus : typeof n.dataBindingStatus == "string" ? n.dataBindingStatus : typeof r.status == "string" ? r.status : ((N = t.state) == null ? void 0 : N.status) || "ready", p = M(a.humanIntervention), y = M(n.humanIntervention), I = typeof a.queryIntent == "string" ? a.queryIntent : typeof n.queryIntent == "string" ? n.queryIntent : typeof r.queryIntent == "string" ? r.queryIntent : void 0, x = e.layout || t.layout, F = {
956
956
  i: t.id,
957
- x: g.x,
958
- y: g.y,
959
- w: g.w,
960
- h: g.h,
961
- minW: g.minW,
962
- minH: g.minH,
963
- maxW: g.maxW,
964
- maxH: g.maxH,
965
- static: g.static,
957
+ x: x.x,
958
+ y: x.y,
959
+ w: x.w,
960
+ h: x.h,
961
+ minW: x.minW,
962
+ minH: x.minH,
963
+ maxW: x.maxW,
964
+ maxH: x.maxH,
965
+ static: x.static,
966
966
  ...e.parentId ? { parentId: e.parentId } : {}
967
967
  };
968
968
  return {
@@ -980,24 +980,24 @@ function lt(t, e = {}) {
980
980
  },
981
981
  slot: "main",
982
982
  composeSource: typeof a.composeSource == "string" ? a.composeSource : void 0,
983
- dataBindingId: m,
983
+ dataBindingId: l,
984
984
  ...Object.keys(r).length > 0 ? { dataBinding: r } : {},
985
- dataBindingStatus: u,
985
+ dataBindingStatus: m,
986
986
  dataBindingError: typeof a.dataBindingError == "string" ? a.dataBindingError : typeof n.dataBindingError == "string" ? n.dataBindingError : void 0,
987
- humanIntervention: Object.keys(l).length > 0 ? l : Object.keys(f).length > 0 ? f : void 0,
988
- queryIntent: x,
987
+ humanIntervention: Object.keys(p).length > 0 ? p : Object.keys(y).length > 0 ? y : void 0,
988
+ queryIntent: I,
989
989
  subType: t.subType,
990
990
  renderer: i,
991
991
  state: t.state,
992
- layout: C,
993
- visual: (A = t.meta) == null ? void 0 : A.visual,
992
+ layout: F,
993
+ visual: (b = t.meta) == null ? void 0 : b.visual,
994
994
  data: {
995
995
  ...a,
996
- dataBindingStatus: u,
997
- ...m ? { dataBindingId: m } : {},
996
+ dataBindingStatus: m,
997
+ ...l ? { dataBindingId: l } : {},
998
998
  ...Object.keys(r).length > 0 ? { dataBinding: r } : {},
999
- ...Object.keys(l).length > 0 ? { humanIntervention: l } : {},
1000
- ...x ? { queryIntent: x } : {},
999
+ ...Object.keys(p).length > 0 ? { humanIntervention: p } : {},
1000
+ ...I ? { queryIntent: I } : {},
1001
1001
  capabilityId: s,
1002
1002
  dataShape: c,
1003
1003
  visualKind: d,
@@ -1026,7 +1026,7 @@ function Pt(t, e) {
1026
1026
  h: 5
1027
1027
  };
1028
1028
  }
1029
- function O(t) {
1029
+ function L(t) {
1030
1030
  const e = Number(t);
1031
1031
  return Number.isFinite(e) ? e : void 0;
1032
1032
  }
@@ -1037,205 +1037,205 @@ function Pe(t) {
1037
1037
  function De(t) {
1038
1038
  var n, i;
1039
1039
  const e = M(t.data), a = `${((n = t.meta) == null ? void 0 : n.composeSource) || ""} ${typeof e.source == "string" ? e.source : ""} ${((i = t.source) == null ? void 0 : i.service) || ""}`;
1040
- return W(t.data) && /image/i.test(a) && Array.isArray(t.data.nestedBlocks) && t.data.nestedBlocks.length > 0;
1040
+ return O(t.data) && /image/i.test(a) && Array.isArray(t.data.nestedBlocks) && t.data.nestedBlocks.length > 0;
1041
1041
  }
1042
1042
  function Ge(t) {
1043
- return !W(t.data) || !Array.isArray(t.data.nestedBlocks) ? [] : De(t) ? t.data.nestedBlocks : t.data.nestedBlocks.filter((e) => {
1043
+ return !O(t.data) || !Array.isArray(t.data.nestedBlocks) ? [] : De(t) ? t.data.nestedBlocks : t.data.nestedBlocks.filter((e) => {
1044
1044
  const a = Pe(e);
1045
1045
  return !a || a === t.id;
1046
1046
  });
1047
1047
  }
1048
- function tt(t, e, a, n) {
1048
+ function et(t, e, a, n) {
1049
1049
  return a > 0 && t >= a && t < a + n ? Math.max(0, t - a) : t;
1050
1050
  }
1051
- function Fe(t, e, a, n) {
1052
- var K;
1053
- if (!W(e.data) || e.data.nestedLayoutMode === "grid") return null;
1054
- const i = M(e.data.nestedLayoutBasis), s = O(i.w), c = O(i.h);
1051
+ function Ke(t, e, a, n) {
1052
+ var z;
1053
+ if (!O(e.data) || e.data.nestedLayoutMode === "grid") return null;
1054
+ const i = M(e.data.nestedLayoutBasis), s = L(i.w), c = L(i.h);
1055
1055
  if (s === void 0 || c === void 0) return null;
1056
- const d = O(i.x) ?? 0, r = O(i.y) ?? 0, o = Math.max(1, s), m = Math.max(1, c), u = O(t.x), l = O(t.y), f = O(t.w), x = O(t.h);
1057
- if (u === void 0 || l === void 0 || f === void 0 || x === void 0) return null;
1058
- const g = Math.max(
1056
+ const d = L(i.x) ?? 0, r = L(i.y) ?? 0, o = Math.max(1, s), l = Math.max(1, c), m = L(t.x), p = L(t.y), y = L(t.w), I = L(t.h);
1057
+ if (m === void 0 || p === void 0 || y === void 0 || I === void 0) return null;
1058
+ const x = Math.max(
1059
1059
  S,
1060
- p(O((K = e.layout) == null ? void 0 : K.h) ?? S)
1061
- ), C = tt(u, f, d, o), y = tt(l, x, r, m), w = Math.max(1, n ?? o), R = Math.max(1, a ?? m), A = S / w, _ = g / R, P = H(y * _), D = Math.max(1, g - P), G = D > ft ? ft : 0, I = Math.max(1, x * _), T = Math.max(1, D - G), v = H(Math.min(I, T)), b = t.minH === void 0 ? void 0 : p(t.minH), F = b === void 0 ? Math.max(2, Math.min(v, Math.ceil(v * 0.4))) : Math.min(v, b);
1060
+ h(L((z = e.layout) == null ? void 0 : z.h) ?? S)
1061
+ ), F = et(m, y, d, o), g = et(p, I, r, l), W = Math.max(1, n ?? o), N = Math.max(1, a ?? l), b = S / W, _ = x / N, P = T(g * _), D = Math.max(1, x - P), G = D > yt ? yt : 0, v = Math.max(1, I * _), H = Math.max(1, D - G), A = T(Math.min(v, H)), E = t.minH === void 0 ? void 0 : h(t.minH), K = E === void 0 ? Math.max(2, Math.min(A, Math.ceil(A * 0.4))) : Math.min(A, E);
1062
1062
  return {
1063
1063
  ...t,
1064
- x: h(C * A),
1064
+ x: f(F * b),
1065
1065
  y: P,
1066
- w: H(Math.max(1, f * A)),
1067
- h: v,
1068
- minW: t.minW === void 0 ? void 0 : H(Math.max(1, t.minW * A)),
1069
- minH: H(F),
1070
- maxW: t.maxW === void 0 ? void 0 : H(Math.max(1, t.maxW * A)),
1071
- maxH: t.maxH === void 0 ? void 0 : H(Math.max(1, t.maxH * _))
1066
+ w: T(Math.max(1, y * b)),
1067
+ h: A,
1068
+ minW: t.minW === void 0 ? void 0 : T(Math.max(1, t.minW * b)),
1069
+ minH: T(K),
1070
+ maxW: t.maxW === void 0 ? void 0 : T(Math.max(1, t.maxW * b)),
1071
+ maxH: t.maxH === void 0 ? void 0 : T(Math.max(1, t.maxH * _))
1072
1072
  };
1073
1073
  }
1074
- function Ke(t, e) {
1075
- if (!W(e.data) || e.data.nestedLayoutMode === "grid") return null;
1076
- const a = M(e.data.nestedLayoutBasis), n = O(a.w), i = O(a.h);
1074
+ function ze(t, e) {
1075
+ if (!O(e.data) || e.data.nestedLayoutMode === "grid") return null;
1076
+ const a = M(e.data.nestedLayoutBasis), n = L(a.w), i = L(a.h);
1077
1077
  if (n === void 0 || i === void 0) return null;
1078
- const s = O(a.x) ?? 0, c = O(a.y) ?? 0, d = Math.max(1, n), r = Math.max(1, i), o = t.flatMap((f) => {
1079
- const x = O(f.x), g = O(f.y), C = O(f.w), y = O(f.h);
1080
- if (x === void 0 || g === void 0 || C === void 0 || y === void 0) return [];
1081
- const w = tt(x, C, s, d), R = tt(g, y, c, r);
1082
- return [{ right: w + C, bottom: R + y }];
1078
+ const s = L(a.x) ?? 0, c = L(a.y) ?? 0, d = Math.max(1, n), r = Math.max(1, i), o = t.flatMap((y) => {
1079
+ const I = L(y.x), x = L(y.y), F = L(y.w), g = L(y.h);
1080
+ if (I === void 0 || x === void 0 || F === void 0 || g === void 0) return [];
1081
+ const W = et(I, F, s, d), N = et(x, g, c, r);
1082
+ return [{ right: W + F, bottom: N + g }];
1083
1083
  });
1084
1084
  if (o.length === 0) return null;
1085
- const m = Math.max(...o.map((f) => f.right)), u = Math.max(...o.map((f) => f.bottom)), l = m <= d && u <= r;
1085
+ const l = Math.max(...o.map((y) => y.right)), m = Math.max(...o.map((y) => y.bottom)), p = l <= d && m <= r;
1086
1086
  return {
1087
- cols: l ? d : Math.max(d, m),
1088
- rows: l ? r : Math.max(r, u)
1087
+ cols: p ? d : Math.max(d, l),
1088
+ rows: p ? r : Math.max(r, m)
1089
1089
  };
1090
1090
  }
1091
- function ze(t, e) {
1091
+ function Ve(t, e) {
1092
1092
  var i, s;
1093
- if (!W(t.data)) return !1;
1093
+ if (!O(t.data)) return !1;
1094
1094
  const a = M(t.data), n = `${((i = t.meta) == null ? void 0 : i.composeSource) || ""} ${typeof a.source == "string" ? a.source : ""} ${((s = t.source) == null ? void 0 : s.service) || ""}`;
1095
- return !/image/i.test(n) || t.data.nestedLayoutMode === "stack" || t.data.nestedLayoutMode === "grid" ? !1 : e.length > rt;
1095
+ return !/image/i.test(n) || t.data.nestedLayoutMode === "stack" || t.data.nestedLayoutMode === "grid" ? !1 : e.length > st;
1096
1096
  }
1097
- function Ve(t, e) {
1097
+ function qe(t, e) {
1098
1098
  var r;
1099
1099
  if (t.length === 0) return [];
1100
- const a = [...t].sort(E), n = Math.min(2, Math.max(1, a.length)), i = Math.max(1, Math.ceil(a.length / n)), s = Math.max(i, p(((r = e.layout) == null ? void 0 : r.h) ?? i)), c = Math.max(1, Math.floor(s / i)), d = Math.floor(S / n);
1101
- return a.map((o, m) => {
1102
- const u = m % n, l = Math.floor(m / n), f = u === n - 1 ? S - d : u * d, x = u === n - 1 ? S - f : d, g = l * c, C = l === i - 1 ? s : (l + 1) * c, y = Math.max(1, C - g);
1100
+ const a = [...t].sort(C), n = Math.min(2, Math.max(1, a.length)), i = Math.max(1, Math.ceil(a.length / n)), s = Math.max(i, h(((r = e.layout) == null ? void 0 : r.h) ?? i)), c = Math.max(1, Math.floor(s / i)), d = Math.floor(S / n);
1101
+ return a.map((o, l) => {
1102
+ const m = l % n, p = Math.floor(l / n), y = m === n - 1 ? S - d : m * d, I = m === n - 1 ? S - y : d, x = p * c, F = p === i - 1 ? s : (p + 1) * c, g = Math.max(1, F - x);
1103
1103
  return {
1104
1104
  ...o,
1105
- x: f,
1106
- y: g,
1107
- w: x,
1108
- h: y,
1109
- minW: o.minW === void 0 ? void 0 : Math.min(x, p(o.minW)),
1110
- minH: o.minH === void 0 ? void 0 : Math.min(y, p(o.minH)),
1111
- maxW: o.maxW === void 0 ? void 0 : Math.max(x, p(o.maxW)),
1112
- maxH: o.maxH === void 0 ? void 0 : Math.max(y, p(o.maxH))
1105
+ x: y,
1106
+ y: x,
1107
+ w: I,
1108
+ h: g,
1109
+ minW: o.minW === void 0 ? void 0 : Math.min(I, h(o.minW)),
1110
+ minH: o.minH === void 0 ? void 0 : Math.min(g, h(o.minH)),
1111
+ maxW: o.maxW === void 0 ? void 0 : Math.max(I, h(o.maxW)),
1112
+ maxH: o.maxH === void 0 ? void 0 : Math.max(g, h(o.maxH))
1113
1113
  };
1114
1114
  });
1115
1115
  }
1116
- function $e(t, e) {
1116
+ function je(t, e) {
1117
1117
  const a = Math.max(
1118
1118
  0,
1119
- Math.min(h(t.x) + p(t.w), h(e.x) + p(e.w)) - Math.max(h(t.x), h(e.x))
1119
+ Math.min(f(t.x) + h(t.w), f(e.x) + h(e.w)) - Math.max(f(t.x), f(e.x))
1120
1120
  ), n = Math.max(
1121
1121
  0,
1122
- Math.min(h(t.y) + p(t.h), h(e.y) + p(e.h)) - Math.max(h(t.y), h(e.y))
1122
+ Math.min(f(t.y) + h(t.h), f(e.y) + h(e.h)) - Math.max(f(t.y), f(e.y))
1123
1123
  );
1124
1124
  return a * n;
1125
1125
  }
1126
- function qe(t) {
1126
+ function Ye(t) {
1127
1127
  for (let e = 0; e < t.length; e += 1) {
1128
1128
  const a = t[e];
1129
1129
  if (a)
1130
1130
  for (let n = e + 1; n < t.length; n += 1) {
1131
1131
  const i = t[n];
1132
1132
  if (!i) continue;
1133
- const s = $e(a, i);
1133
+ const s = je(a, i);
1134
1134
  if (s <= 0) continue;
1135
- const c = p(a.w) * p(a.h), d = p(i.w) * p(i.h);
1135
+ const c = h(a.w) * h(a.h), d = h(i.w) * h(i.h);
1136
1136
  if (s / Math.max(1, Math.min(c, d)) >= 0.6) return !0;
1137
1137
  }
1138
1138
  }
1139
1139
  return !1;
1140
1140
  }
1141
- function ba(t, e = {}) {
1142
- if (t.length < 2 || !qe(t))
1141
+ function Ea(t, e = {}) {
1142
+ if (t.length < 2 || !Ye(t))
1143
1143
  return t.map((o) => ({ ...o }));
1144
- const a = t.map((o, m) => ({ child: o, index: m })).sort((o, m) => h(o.child.y) - h(m.child.y) || h(o.child.x) - h(m.child.x) || o.index - m.index).map((o) => o.child), n = Math.min(2, Math.max(1, a.length)), i = Math.max(1, Math.ceil(a.length / n)), s = a.reduce((o, m) => Math.max(
1144
+ const a = t.map((o, l) => ({ child: o, index: l })).sort((o, l) => f(o.child.y) - f(l.child.y) || f(o.child.x) - f(l.child.x) || o.index - l.index).map((o) => o.child), n = Math.min(2, Math.max(1, a.length)), i = Math.max(1, Math.ceil(a.length / n)), s = a.reduce((o, l) => Math.max(
1145
1145
  o,
1146
- h(m.y) + p(m.h)
1146
+ f(l.y) + h(l.h)
1147
1147
  ), 0), c = Math.max(
1148
1148
  S,
1149
1149
  i,
1150
- p(e.parentRows ?? 0),
1150
+ h(e.parentRows ?? 0),
1151
1151
  s
1152
1152
  ), d = Math.max(1, Math.floor(c / i)), r = Math.floor(S / n);
1153
- return a.map((o, m) => {
1154
- const u = m % n, l = Math.floor(m / n), f = u === n - 1 ? S - r : u * r, x = u === n - 1 ? S - f : r, g = l * d, C = l === i - 1 ? c : (l + 1) * d, y = Math.max(1, C - g);
1153
+ return a.map((o, l) => {
1154
+ const m = l % n, p = Math.floor(l / n), y = m === n - 1 ? S - r : m * r, I = m === n - 1 ? S - y : r, x = p * d, F = p === i - 1 ? c : (p + 1) * d, g = Math.max(1, F - x);
1155
1155
  return {
1156
1156
  ...o,
1157
- x: f,
1158
- y: g,
1159
- w: x,
1160
- h: y,
1161
- minW: o.minW === void 0 ? void 0 : Math.min(x, p(o.minW)),
1162
- minH: o.minH === void 0 ? void 0 : Math.min(y, p(o.minH)),
1163
- maxW: o.maxW === void 0 ? void 0 : Math.max(x, p(o.maxW)),
1164
- maxH: o.maxH === void 0 ? void 0 : Math.max(y, p(o.maxH))
1157
+ x: y,
1158
+ y: x,
1159
+ w: I,
1160
+ h: g,
1161
+ minW: o.minW === void 0 ? void 0 : Math.min(I, h(o.minW)),
1162
+ minH: o.minH === void 0 ? void 0 : Math.min(g, h(o.minH)),
1163
+ maxW: o.maxW === void 0 ? void 0 : Math.max(I, h(o.maxW)),
1164
+ maxH: o.maxH === void 0 ? void 0 : Math.max(g, h(o.maxH))
1165
1165
  };
1166
1166
  });
1167
1167
  }
1168
- function je(t, e) {
1169
- if (t.length < te || t.length > ee) return !1;
1170
- const a = Math.min(...t.map((o) => h(o.y))), n = Math.max(...t.map((o) => h(o.y) + p(o.h))), i = Math.max(1, n - a), s = Math.max(...t.map((o) => p(o.h))), c = t.length === 1 ? 1 : t.length >= 7 ? 3 : 2, d = Math.ceil(t.length / c) * j, r = e >= d + j;
1171
- return i >= d + j || s > j * 1.5 || r;
1168
+ function Ue(t, e) {
1169
+ if (t.length < ee || t.length > ae) return !1;
1170
+ const a = Math.min(...t.map((o) => f(o.y))), n = Math.max(...t.map((o) => f(o.y) + h(o.h))), i = Math.max(1, n - a), s = Math.max(...t.map((o) => h(o.h))), c = t.length === 1 ? 1 : t.length >= 7 ? 3 : 2, d = Math.ceil(t.length / c) * U, r = e >= d + U;
1171
+ return i >= d + U || s > U * 1.5 || r;
1172
1172
  }
1173
- function La(t, e = {}) {
1174
- const a = p(e.parentRows ?? 0);
1175
- if (!je(t, a))
1173
+ function Ra(t, e = {}) {
1174
+ const a = h(e.parentRows ?? 0);
1175
+ if (!Ue(t, a))
1176
1176
  return t.map((c) => ({ ...c }));
1177
- const n = t.map((c, d) => ({ child: c, index: d })).sort((c, d) => h(c.child.y) - h(d.child.y) || h(c.child.x) - h(d.child.x) || c.index - d.index).map((c) => c.child), i = n.length === 1 ? 1 : n.length >= 7 ? 3 : 2, s = Math.floor(S / i);
1177
+ const n = t.map((c, d) => ({ child: c, index: d })).sort((c, d) => f(c.child.y) - f(d.child.y) || f(c.child.x) - f(d.child.x) || c.index - d.index).map((c) => c.child), i = n.length === 1 ? 1 : n.length >= 7 ? 3 : 2, s = Math.floor(S / i);
1178
1178
  return n.map((c, d) => {
1179
- const r = d % i, o = Math.floor(d / i), m = r === i - 1 ? S - s : r * s, u = r === i - 1 ? S - m : s, l = j;
1179
+ const r = d % i, o = Math.floor(d / i), l = r === i - 1 ? S - s : r * s, m = r === i - 1 ? S - l : s, p = U;
1180
1180
  return {
1181
1181
  ...c,
1182
- x: m,
1183
- y: o * l,
1184
- w: u,
1185
- h: l,
1186
- minW: c.minW === void 0 ? void 0 : Math.min(u, p(c.minW)),
1187
- minH: c.minH === void 0 ? void 0 : Math.min(l, p(c.minH)),
1188
- maxW: c.maxW === void 0 ? void 0 : Math.max(u, p(c.maxW)),
1189
- maxH: c.maxH === void 0 ? void 0 : Math.max(l, p(c.maxH))
1182
+ x: l,
1183
+ y: o * p,
1184
+ w: m,
1185
+ h: p,
1186
+ minW: c.minW === void 0 ? void 0 : Math.min(m, h(c.minW)),
1187
+ minH: c.minH === void 0 ? void 0 : Math.min(p, h(c.minH)),
1188
+ maxW: c.maxW === void 0 ? void 0 : Math.max(m, h(c.maxW)),
1189
+ maxH: c.maxH === void 0 ? void 0 : Math.max(p, h(c.maxH))
1190
1190
  };
1191
1191
  });
1192
1192
  }
1193
- function Oa(t) {
1193
+ function La(t) {
1194
1194
  const e = t.reduce((a, n) => Math.max(
1195
1195
  a,
1196
- h(n.y) + p(n.h)
1196
+ f(n.y) + h(n.h)
1197
1197
  ), 0);
1198
- return e > 0 ? e + ae : 0;
1198
+ return e > 0 ? e + ne : 0;
1199
1199
  }
1200
- function Ye(t, e) {
1200
+ function $e(t, e) {
1201
1201
  if (t.length === 0 || e < 12) return !1;
1202
- const a = Math.min(...t.map((s) => h(s.y))), n = Math.max(...t.map((s) => h(s.y) + p(s.h))), i = Math.max(1, n - a);
1203
- return i <= Tt || i / Math.max(1, e) < Ht;
1202
+ const a = Math.min(...t.map((s) => f(s.y))), n = Math.max(...t.map((s) => f(s.y) + h(s.h))), i = Math.max(1, n - a);
1203
+ return i <= Ht || i / Math.max(1, e) < Tt;
1204
1204
  }
1205
- function Ue(t) {
1205
+ function Xe(t) {
1206
1206
  const e = /* @__PURE__ */ new Map();
1207
1207
  return t.forEach((a) => {
1208
- const n = h(a.x), i = Math.min(S - 1, Math.max(0, n));
1208
+ const n = f(a.x), i = Math.min(S - 1, Math.max(0, n));
1209
1209
  e.set(i, [...e.get(i) || [], a]);
1210
- }), [...e.entries()].sort(([a], [n]) => a - n).map(([, a]) => a.sort((n, i) => h(n.y) - h(i.y) || h(n.x) - h(i.x) || String(n.i).localeCompare(String(i.i))));
1210
+ }), [...e.entries()].sort(([a], [n]) => a - n).map(([, a]) => a.sort((n, i) => f(n.y) - f(i.y) || f(n.x) - f(i.x) || String(n.i).localeCompare(String(i.i))));
1211
1211
  }
1212
- function Xe(t, e, a, n, i) {
1213
- const s = Math.max(S, i), c = Math.max(1, Math.floor(S / Math.max(1, a))), d = e === a - 1 ? S - c : e * c, r = Math.min(...n.map((x) => h(x.y))), o = Math.max(...n.map((x) => h(x.y) + p(x.h))), m = Math.max(1, o - r), u = s / m, l = Math.max(0, Math.round((h(t.y) - r) * u)), f = Math.max(
1214
- p(t.minH ?? 1),
1215
- Math.round(p(t.h) * u)
1212
+ function Je(t, e, a, n, i) {
1213
+ const s = Math.max(S, i), c = Math.max(1, Math.floor(S / Math.max(1, a))), d = e === a - 1 ? S - c : e * c, r = Math.min(...n.map((I) => f(I.y))), o = Math.max(...n.map((I) => f(I.y) + h(I.h))), l = Math.max(1, o - r), m = s / l, p = Math.max(0, Math.round((f(t.y) - r) * m)), y = Math.max(
1214
+ h(t.minH ?? 1),
1215
+ Math.round(h(t.h) * m)
1216
1216
  );
1217
1217
  return {
1218
1218
  ...t,
1219
1219
  x: d,
1220
1220
  w: e === a - 1 ? S - d : c,
1221
- y: l,
1222
- h: f,
1223
- minW: Math.min(c, p(t.minW ?? Math.min(3, c))),
1224
- minH: Math.min(f, p(t.minH ?? 2))
1221
+ y: p,
1222
+ h: y,
1223
+ minW: Math.min(c, h(t.minW ?? Math.min(3, c))),
1224
+ minH: Math.min(y, h(t.minH ?? 2))
1225
1225
  };
1226
1226
  }
1227
- function Je(t, e) {
1227
+ function Qe(t, e) {
1228
1228
  var d, r;
1229
1229
  const a = M(e.data), n = `${((d = e.meta) == null ? void 0 : d.composeSource) || ""} ${typeof a.source == "string" ? a.source : ""}`;
1230
1230
  if (!/image/i.test(n)) return [...t];
1231
- const i = p(((r = e.layout) == null ? void 0 : r.h) ?? 0);
1232
- if (!Ye(t, i)) return [...t];
1233
- const s = Ue(t).slice(0, S), c = /* @__PURE__ */ new Map();
1234
- return s.forEach((o, m) => {
1235
- o.forEach((u) => {
1236
- c.set(String(u.i), Xe(
1237
- u,
1231
+ const i = h(((r = e.layout) == null ? void 0 : r.h) ?? 0);
1232
+ if (!$e(t, i)) return [...t];
1233
+ const s = Xe(t).slice(0, S), c = /* @__PURE__ */ new Map();
1234
+ return s.forEach((o, l) => {
1235
+ o.forEach((m) => {
1236
+ c.set(String(m.i), Je(
1238
1237
  m,
1238
+ l,
1239
1239
  s.length,
1240
1240
  o,
1241
1241
  i
@@ -1243,58 +1243,58 @@ function Je(t, e) {
1243
1243
  });
1244
1244
  }), t.map((o) => c.get(String(o.i)) || o);
1245
1245
  }
1246
- function vt(t) {
1246
+ function At(t) {
1247
1247
  return !t || t.length === 0 ? 0 : t.reduce((e, a) => Math.max(
1248
1248
  e,
1249
- h(a.y) + p(a.h)
1249
+ f(a.y) + h(a.h)
1250
1250
  ), 0);
1251
1251
  }
1252
1252
  function Mt(t) {
1253
1253
  return t.map((e) => e.i).sort().join("|");
1254
1254
  }
1255
- function Qe(t, e) {
1256
- return h(t.x) === h(e.x) && h(t.y) === h(e.y) && p(t.w) === p(e.w) && p(t.h) === p(e.h);
1255
+ function Ze(t, e) {
1256
+ return f(t.x) === f(e.x) && f(t.y) === f(e.y) && h(t.w) === h(e.w) && h(t.h) === h(e.h);
1257
1257
  }
1258
1258
  function St(t) {
1259
- return t.length === 0 ? 0 : Math.min(...t.map((e) => h(e.y)));
1259
+ return t.length === 0 ? 0 : Math.min(...t.map((e) => f(e.y)));
1260
1260
  }
1261
- function Wa(t, e) {
1261
+ function Oa(t, e) {
1262
1262
  if (!t || t.length === 0 || e.length === 0 || Mt(t) !== Mt(e)) return !1;
1263
- const a = new Map(e.map((l) => [l.i, l])), n = t.filter((l) => {
1264
- const f = a.get(l.i);
1265
- return f ? !Qe(l, f) : !0;
1263
+ const a = new Map(e.map((p) => [p.i, p])), n = t.filter((p) => {
1264
+ const y = a.get(p.i);
1265
+ return y ? !Ze(p, y) : !0;
1266
1266
  }).length;
1267
1267
  if (n === 0) return !1;
1268
- const i = vt(t), s = vt(e);
1268
+ const i = At(t), s = At(e);
1269
1269
  if (s < 12) return !1;
1270
- const c = St(t), d = St(e), r = t.reduce((l, f) => Math.max(l, p(f.h)), 0), o = e.reduce((l, f) => Math.max(l, p(f.h)), 0), m = r / Math.max(1, i), u = o / Math.max(1, s);
1271
- return i <= Tt || i / Math.max(1, s) < Ht || o >= 16 && r <= 8 || t.length > rt && c >= Math.max(4, d + 6) && n >= Math.max(1, Math.ceil(t.length * 0.5)) || t.length > rt && n >= Math.max(1, Math.ceil(t.length * 0.5)) && r > o * 1.5 && m > u * 1.4;
1270
+ const c = St(t), d = St(e), r = t.reduce((p, y) => Math.max(p, h(y.h)), 0), o = e.reduce((p, y) => Math.max(p, h(y.h)), 0), l = r / Math.max(1, i), m = o / Math.max(1, s);
1271
+ return i <= Ht || i / Math.max(1, s) < Tt || o >= 16 && r <= 8 || t.length > st && c >= Math.max(4, d + 6) && n >= Math.max(1, Math.ceil(t.length * 0.5)) || t.length > st && n >= Math.max(1, Math.ceil(t.length * 0.5)) && r > o * 1.5 && l > m * 1.4;
1272
1272
  }
1273
1273
  function Dt(t) {
1274
1274
  const e = Ge(t);
1275
1275
  if (e.length === 0) return [];
1276
- const a = e.map((c, d) => Pt(c, d)), n = ze(t, e), i = n ? null : Ke(a, t);
1277
- return (n ? Ve(a, t) : i ? a : Je(a, t)).map((c) => Z(
1278
- i && Fe(c, t, i.rows, i.cols) || c,
1276
+ const a = e.map((c, d) => Pt(c, d)), n = Ve(t, e), i = n ? null : ze(a, t);
1277
+ return (n ? qe(a, t) : i ? a : Qe(a, t)).map((c) => tt(
1278
+ i && Ke(c, t, i.rows, i.cols) || c,
1279
1279
  S,
1280
1280
  S,
1281
1281
  t.id
1282
- )).sort(E);
1282
+ )).sort(C);
1283
1283
  }
1284
- function Ze(t, e, a = /* @__PURE__ */ new Map()) {
1285
- const n = W(t.data) && Array.isArray(t.data.nestedBlocks) ? t.data.nestedBlocks : [], i = new Map(n.map((s) => [s.id, s]));
1286
- return [...e].sort(E).map((s) => {
1284
+ function ta(t, e, a = /* @__PURE__ */ new Map()) {
1285
+ const n = O(t.data) && Array.isArray(t.data.nestedBlocks) ? t.data.nestedBlocks : [], i = new Map(n.map((s) => [s.id, s]));
1286
+ return [...e].sort(C).map((s) => {
1287
1287
  const c = {
1288
1288
  id: s.i,
1289
1289
  title: s.i,
1290
1290
  kind: "display",
1291
1291
  slot: "main",
1292
1292
  dataBindingStatus: "error",
1293
- dataBindingError: "需要补充业务口径后再问数",
1293
+ dataBindingError: u("FWA.ca871787570878538"),
1294
1294
  humanIntervention: { required: !0, reason: "missing_nested_payload" }
1295
1295
  };
1296
1296
  return {
1297
- ...We(i.get(s.i), a.get(s.i), c),
1297
+ ...Oe(i.get(s.i), a.get(s.i), c),
1298
1298
  id: s.i,
1299
1299
  layout: {
1300
1300
  i: s.i,
@@ -1312,20 +1312,20 @@ function Ze(t, e, a = /* @__PURE__ */ new Map()) {
1312
1312
  };
1313
1313
  });
1314
1314
  }
1315
- function ta(t) {
1315
+ function ea(t) {
1316
1316
  const e = /* @__PURE__ */ new Map();
1317
1317
  return t.forEach((a) => {
1318
- !W(a.data) || !Array.isArray(a.data.nestedBlocks) || a.data.nestedBlocks.forEach((n) => {
1318
+ !O(a.data) || !Array.isArray(a.data.nestedBlocks) || a.data.nestedBlocks.forEach((n) => {
1319
1319
  e.set(n.id, n);
1320
1320
  });
1321
1321
  }), e;
1322
1322
  }
1323
- function ea(t, e, a) {
1323
+ function aa(t, e, a) {
1324
1324
  const n = new Map(e.map((i) => [i.id, i]));
1325
1325
  a.forEach(({ node: i }) => {
1326
1326
  if (t.has(i.i) || !i.parentId) return;
1327
1327
  const s = n.get(i.i);
1328
- s && t.set(i.i, lt(s, {
1328
+ s && t.set(i.i, pt(s, {
1329
1329
  parentId: i.parentId,
1330
1330
  layout: {
1331
1331
  ...s.layout,
@@ -1335,27 +1335,27 @@ function ea(t, e, a) {
1335
1335
  }));
1336
1336
  });
1337
1337
  }
1338
- function aa(t) {
1338
+ function na(t) {
1339
1339
  const e = /* @__PURE__ */ new Map();
1340
1340
  return t.forEach((a) => {
1341
- !W(a.data) || !Array.isArray(a.data.nestedBlocks) || a.data.nestedBlocks.forEach((n) => {
1341
+ !O(a.data) || !Array.isArray(a.data.nestedBlocks) || a.data.nestedBlocks.forEach((n) => {
1342
1342
  e.set(n.id, a.id);
1343
1343
  });
1344
1344
  }), e;
1345
1345
  }
1346
- function na(t, e, a, n, i) {
1346
+ function ia(t, e, a, n, i) {
1347
1347
  const s = new Map(t.map((d) => [d.id, d])), c = [];
1348
1348
  return e.forEach((d, r) => {
1349
1349
  if (s.has(r) || i.has(r)) return;
1350
- const o = n.get(r), m = o ? s.get(o) : void 0, u = a.get(r);
1351
- !m || !u || c.push(ke(u, m, {
1352
- layout: ie(
1350
+ const o = n.get(r), l = o ? s.get(o) : void 0, m = a.get(r);
1351
+ !l || !m || c.push(ke(m, l, {
1352
+ layout: re(
1353
1353
  { ...d, i: r },
1354
1354
  o ? e.get(o) : void 0,
1355
- u.layout ? { ...u.layout } : void 0
1355
+ m.layout ? { ...m.layout } : void 0
1356
1356
  )
1357
1357
  }));
1358
- }), c.sort((d, r) => E({
1358
+ }), c.sort((d, r) => C({
1359
1359
  i: d.id,
1360
1360
  x: d.layout.x,
1361
1361
  y: d.layout.y,
@@ -1369,17 +1369,17 @@ function na(t, e, a, n, i) {
1369
1369
  h: r.layout.h
1370
1370
  }));
1371
1371
  }
1372
- function ia(t) {
1372
+ function ra(t) {
1373
1373
  return Object.prototype.hasOwnProperty.call(t, "children");
1374
1374
  }
1375
- function wt(t, e) {
1375
+ function Wt(t, e) {
1376
1376
  return (e == null ? void 0 : e.origin) === "replacement" && e.listingParentId === t && e.node.parentId === t;
1377
1377
  }
1378
- function Nt(t, e) {
1378
+ function wt(t, e) {
1379
1379
  const a = t.get(e.node.i);
1380
1380
  (a == null ? void 0 : a.parentSource) === "explicitParentId" && e.parentSource === "inferredParent" || t.set(e.node.i, e);
1381
1381
  }
1382
- function ra(t) {
1382
+ function sa(t) {
1383
1383
  const e = /* @__PURE__ */ new Map();
1384
1384
  return t.forEach(({ node: a }) => {
1385
1385
  const n = a.parentId;
@@ -1388,7 +1388,7 @@ function ra(t) {
1388
1388
  i.push(a), e.set(n, i);
1389
1389
  }), e;
1390
1390
  }
1391
- function sa(t, e, a) {
1391
+ function oa(t, e, a) {
1392
1392
  const n = /* @__PURE__ */ new Map();
1393
1393
  return Dt(t).forEach((i) => {
1394
1394
  var c;
@@ -1396,88 +1396,88 @@ function sa(t, e, a) {
1396
1396
  s && s.parentId !== t.id || n.set(i.i, i);
1397
1397
  }), (a.get(t.id) || []).forEach((i) => {
1398
1398
  n.set(i.i, i);
1399
- }), [...n.values()].sort(E);
1400
- }
1401
- function Ta(t, e) {
1402
- const a = new Map(e.nodes.filter((u) => !u.parentId).map((u) => [u.i, u])), n = ta(t), i = aa(t), s = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Map();
1403
- e.nodes.forEach((u) => {
1404
- ia(u) && s.add(u.i);
1405
- }), e.nodes.forEach((u) => {
1406
- u.parentId && (s.has(u.parentId) || Nt(d, {
1407
- node: u,
1399
+ }), [...n.values()].sort(C);
1400
+ }
1401
+ function Ha(t, e) {
1402
+ const a = new Map(e.nodes.filter((m) => !m.parentId).map((m) => [m.i, m])), n = ea(t), i = na(t), s = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Map();
1403
+ e.nodes.forEach((m) => {
1404
+ ra(m) && s.add(m.i);
1405
+ }), e.nodes.forEach((m) => {
1406
+ m.parentId && (s.has(m.parentId) || wt(d, {
1407
+ node: m,
1408
1408
  parentSource: "explicitParentId",
1409
1409
  origin: "flat"
1410
- })), (Array.isArray(u.children) ? u.children : []).forEach((f) => {
1411
- const x = f.parentId || u.i, g = f.parentId ? "explicitParentId" : "inferredParent";
1412
- Nt(d, {
1413
- node: { ...f, parentId: x },
1414
- parentSource: g,
1410
+ })), (Array.isArray(m.children) ? m.children : []).forEach((y) => {
1411
+ const I = y.parentId || m.i, x = y.parentId ? "explicitParentId" : "inferredParent";
1412
+ wt(d, {
1413
+ node: { ...y, parentId: I },
1414
+ parentSource: x,
1415
1415
  origin: "replacement",
1416
- listingParentId: u.i
1416
+ listingParentId: m.i
1417
1417
  });
1418
1418
  });
1419
1419
  });
1420
- const r = ra(d);
1421
- ea(n, t, d), d.forEach(({ node: u }) => {
1422
- const l = u.parentId;
1423
- if (!l) return;
1424
- const f = i.get(u.i);
1425
- f && f !== l && c.add(f);
1420
+ const r = sa(d);
1421
+ aa(n, t, d), d.forEach(({ node: m }) => {
1422
+ const p = m.parentId;
1423
+ if (!p) return;
1424
+ const y = i.get(m.i);
1425
+ y && y !== p && c.add(y);
1426
1426
  });
1427
- const o = na(
1427
+ const o = ia(
1428
1428
  t,
1429
1429
  a,
1430
1430
  n,
1431
1431
  i,
1432
1432
  d
1433
1433
  );
1434
- return o.forEach((u) => {
1435
- const l = i.get(u.id);
1436
- l && c.add(l);
1437
- }), [...t.filter((u) => !d.has(u.id)).map((u) => {
1438
- const l = a.get(u.id), f = l ? {
1439
- ...u.layout,
1440
- i: u.id,
1441
- x: l.x,
1442
- y: l.y,
1443
- w: l.w,
1444
- h: l.h,
1445
- minW: l.minW,
1446
- minH: l.minH,
1447
- maxW: l.maxW,
1448
- maxH: l.maxH,
1449
- static: l.static
1450
- } : u.layout;
1451
- if (!W(u.data))
1452
- return { ...u, layout: f };
1453
- const x = s.has(u.id), g = r.get(u.id) || [], C = g.some((R) => {
1454
- const A = d.get(R.i);
1455
- return A ? x ? wt(u.id, A) : A.origin === "flat" || A.parentSource === "explicitParentId" : !1;
1434
+ return o.forEach((m) => {
1435
+ const p = i.get(m.id);
1436
+ p && c.add(p);
1437
+ }), [...t.filter((m) => !d.has(m.id)).map((m) => {
1438
+ const p = a.get(m.id), y = p ? {
1439
+ ...m.layout,
1440
+ i: m.id,
1441
+ x: p.x,
1442
+ y: p.y,
1443
+ w: p.w,
1444
+ h: p.h,
1445
+ minW: p.minW,
1446
+ minH: p.minH,
1447
+ maxW: p.maxW,
1448
+ maxH: p.maxH,
1449
+ static: p.static
1450
+ } : m.layout;
1451
+ if (!O(m.data))
1452
+ return { ...m, layout: y };
1453
+ const I = s.has(m.id), x = r.get(m.id) || [], F = x.some((N) => {
1454
+ const b = d.get(N.i);
1455
+ return b ? I ? Wt(m.id, b) : b.origin === "flat" || b.parentSource === "explicitParentId" : !1;
1456
1456
  });
1457
- if (!(x || C || c.has(u.id)))
1458
- return { ...u, layout: f };
1459
- const w = x ? g.filter((R) => {
1460
- const A = d.get(R.i);
1461
- return wt(u.id, A);
1462
- }) : sa(u, d, r);
1457
+ if (!(I || F || c.has(m.id)))
1458
+ return { ...m, layout: y };
1459
+ const W = I ? x.filter((N) => {
1460
+ const b = d.get(N.i);
1461
+ return Wt(m.id, b);
1462
+ }) : oa(m, d, r);
1463
1463
  return {
1464
- ...u,
1465
- layout: f,
1464
+ ...m,
1465
+ layout: y,
1466
1466
  meta: {
1467
- ...u.meta,
1467
+ ...m.meta,
1468
1468
  manualCanvasLayout: !0,
1469
1469
  layoutManualOverride: !0,
1470
1470
  layoutManualOverrideSource: "gridstack"
1471
1471
  },
1472
1472
  data: {
1473
- ...u.data,
1473
+ ...m.data,
1474
1474
  nestedLayoutMode: "grid",
1475
- nestedBlocks: Ze(u, w, n)
1475
+ nestedBlocks: ta(m, W, n)
1476
1476
  }
1477
1477
  };
1478
1478
  }), ...o];
1479
1479
  }
1480
- const Ct = {
1480
+ const Ft = {
1481
1481
  patch: "modifyCard",
1482
1482
  updateData: "changeDataSource",
1483
1483
  updateStyle: "modifyCard",
@@ -1486,40 +1486,40 @@ const Ct = {
1486
1486
  updatePosition: "adjustLayout",
1487
1487
  replaceRenderer: "changeChart"
1488
1488
  };
1489
- function oa(t) {
1489
+ function ca(t) {
1490
1490
  return {
1491
1491
  ...t,
1492
1492
  blocks: t.blocks.map((e) => ({
1493
1493
  ...e,
1494
1494
  layout: { ...e.layout },
1495
- data: ot(e.data),
1496
- meta: ot(e.meta),
1495
+ data: ct(e.data),
1496
+ meta: ct(e.meta),
1497
1497
  renderer: e.renderer ? { ...e.renderer } : void 0,
1498
1498
  state: { ...e.state }
1499
1499
  }))
1500
1500
  };
1501
1501
  }
1502
- function ot(t) {
1502
+ function ct(t) {
1503
1503
  return !t || typeof t != "object" ? t : JSON.parse(JSON.stringify(t));
1504
1504
  }
1505
- function L(t, e, a) {
1505
+ function R(t, e, a) {
1506
1506
  return {
1507
1507
  status: "failed",
1508
1508
  affectedCardIds: [],
1509
1509
  error: { code: t, message: e, details: a }
1510
1510
  };
1511
1511
  }
1512
- function ca(t) {
1512
+ function da(t) {
1513
1513
  return (t == null ? void 0 : t.scope) || "card";
1514
1514
  }
1515
- function da(t, e) {
1515
+ function ua(t, e) {
1516
1516
  return e ? t.blocks.findIndex((a) => a.id === e) : -1;
1517
1517
  }
1518
- function ua(t, e) {
1518
+ function ma(t, e) {
1519
1519
  if (!e) return null;
1520
1520
  for (let a = 0; a < t.blocks.length; a += 1) {
1521
1521
  const n = t.blocks[a];
1522
- if (!W(n.data) || !Array.isArray(n.data.nestedBlocks)) continue;
1522
+ if (!O(n.data) || !Array.isArray(n.data.nestedBlocks)) continue;
1523
1523
  const i = n.data.nestedBlocks.findIndex((c) => c.id === e);
1524
1524
  if (i < 0) continue;
1525
1525
  const s = n.data.nestedBlocks[i];
@@ -1533,11 +1533,11 @@ function ua(t, e) {
1533
1533
  }
1534
1534
  return null;
1535
1535
  }
1536
- function ma(t, e, a) {
1536
+ function la(t, e, a) {
1537
1537
  const n = t.blocks[e.parentIndex];
1538
- if (!W(n.data)) return;
1538
+ if (!O(n.data)) return;
1539
1539
  const i = n.data, s = Array.isArray(i.nestedBlocks) ? [...i.nestedBlocks] : [];
1540
- s[e.childIndex] = lt(a, {
1540
+ s[e.childIndex] = pt(a, {
1541
1541
  parentId: n.id,
1542
1542
  layout: {
1543
1543
  ...a.layout,
@@ -1553,9 +1553,9 @@ function ma(t, e, a) {
1553
1553
  }
1554
1554
  };
1555
1555
  }
1556
- function la(t, e) {
1556
+ function pa(t, e) {
1557
1557
  const a = t.blocks[e.parentIndex];
1558
- if (!W(a.data)) return;
1558
+ if (!O(a.data)) return;
1559
1559
  const n = a.data, i = Array.isArray(n.nestedBlocks) ? [...n.nestedBlocks] : [];
1560
1560
  i.splice(e.childIndex, 1), t.blocks[e.parentIndex] = {
1561
1561
  ...a,
@@ -1566,20 +1566,20 @@ function la(t, e) {
1566
1566
  }
1567
1567
  };
1568
1568
  }
1569
- function Rt(t, e) {
1569
+ function Nt(t, e) {
1570
1570
  const a = { ...t };
1571
- return typeof e.title == "string" && (a.title = e.title), typeof e.subtitle == "string" && (a.subtitle = e.subtitle), e.data && typeof e.data == "object" && (a.data = ot(e.data)), e.meta && typeof e.meta == "object" && (a.meta = { ...a.meta || {}, ...e.meta }), e.renderer && typeof e.renderer == "object" && (a.renderer = { ...a.renderer || { engine: "echarts", rendererKey: "customCanvas" }, ...e.renderer }), e.layout && typeof e.layout == "object" && (a.layout = { ...a.layout, ...e.layout }), a;
1571
+ return typeof e.title == "string" && (a.title = e.title), typeof e.subtitle == "string" && (a.subtitle = e.subtitle), e.data && typeof e.data == "object" && (a.data = ct(e.data)), e.meta && typeof e.meta == "object" && (a.meta = { ...a.meta || {}, ...e.meta }), e.renderer && typeof e.renderer == "object" && (a.renderer = { ...a.renderer || { engine: "echarts", rendererKey: "customCanvas" }, ...e.renderer }), e.layout && typeof e.layout == "object" && (a.layout = { ...a.layout, ...e.layout }), a;
1572
1572
  }
1573
- function nt(t) {
1573
+ function it(t) {
1574
1574
  var a, n, i, s;
1575
1575
  const e = String(((a = t.meta) == null ? void 0 : a.capabilityId) || ((n = t.source) == null ? void 0 : n.resourceKey) || "");
1576
1576
  return ((i = t.meta) == null ? void 0 : i.workbenchOrganizationCard) === !0 || String(((s = t.meta) == null ? void 0 : s.macroCapabilityId) || "").includes("workbench") || e.startsWith("card.workbench.") || t.id.startsWith("workbench-org-");
1577
1577
  }
1578
- function pa(t) {
1578
+ function ha(t) {
1579
1579
  return `canvas-tx-${t}-${Date.now()}-${Math.random().toString(36).slice(2)}`;
1580
1580
  }
1581
- function ha(t) {
1582
- return t in Ct ? Ct[t] : [
1581
+ function fa(t) {
1582
+ return t in Ft ? Ft[t] : [
1583
1583
  "freeModify",
1584
1584
  "renameTitle",
1585
1585
  "editBodyText",
@@ -1598,70 +1598,70 @@ function ha(t) {
1598
1598
  ].includes(t) ? t : null;
1599
1599
  }
1600
1600
  async function Gt(t, e) {
1601
- var l, f, x, g, C, y, w, R, A, _, P, D, G;
1602
- const a = ha(e.operation);
1603
- if (!a) return L("UNSUPPORTED_OPERATION", `不支持的改卡操作:${e.operation}`);
1601
+ var p, y, I, x, F, g, W, N, b, _, P, D, G;
1602
+ const a = fa(e.operation);
1603
+ if (!a) return R("UNSUPPORTED_OPERATION", u("FWA.56c81787570677852", { p0: e.operation }));
1604
1604
  if (e.baseSnapshotVersion !== void 0 && e.baseSnapshotVersion !== t.version)
1605
- return L("VERSION_CONFLICT", "画布快照版本已变化,请基于最新快照重试。", {
1605
+ return R("VERSION_CONFLICT", u("FWA.54f41787570602213"), {
1606
1606
  expected: e.baseSnapshotVersion,
1607
1607
  actual: t.version
1608
1608
  });
1609
- const n = oa(t), i = e.payload || {}, s = ca(e.target), c = da(n, (l = e.target) == null ? void 0 : l.cardId), d = c >= 0 ? null : ua(n, (f = e.target) == null ? void 0 : f.cardId), r = c >= 0 ? n.blocks[c] : d == null ? void 0 : d.materializedBlock, o = (I) => {
1609
+ const n = ca(t), i = e.payload || {}, s = da(e.target), c = ua(n, (p = e.target) == null ? void 0 : p.cardId), d = c >= 0 ? null : ma(n, (y = e.target) == null ? void 0 : y.cardId), r = c >= 0 ? n.blocks[c] : d == null ? void 0 : d.materializedBlock, o = (v) => {
1610
1610
  if (c >= 0) {
1611
- n.blocks[c] = I;
1611
+ n.blocks[c] = v;
1612
1612
  return;
1613
1613
  }
1614
- d && ma(n, d, I);
1614
+ d && la(n, d, v);
1615
1615
  };
1616
1616
  if (!["clearCanvas", "overwriteCanvas", "rollback"].includes(a) && !r)
1617
- return L("CARD_NOT_FOUND", "改卡目标不存在或缺少 cardId。", e.target);
1618
- const m = [], u = pa(a);
1617
+ return R("CARD_NOT_FOUND", u("FWA.8a571787570651078"), e.target);
1618
+ const l = [], m = ha(a);
1619
1619
  if (a === "locateCard")
1620
1620
  return r ? {
1621
1621
  status: "success",
1622
1622
  snapshot: t,
1623
1623
  affectedCardIds: [r.id],
1624
1624
  locatedCardId: r.id,
1625
- transactionId: u
1626
- } : L("CARD_NOT_FOUND", "定位目标不存在。", e.target);
1625
+ transactionId: m
1626
+ } : R("CARD_NOT_FOUND", u("FWA.61061787571020611"), e.target);
1627
1627
  if (a === "clearCanvas") {
1628
- const I = i.includeSystemCards === !0, T = n.blocks.length;
1629
- return n.blocks = I ? [] : n.blocks.filter(nt), m.push(...t.blocks.filter((v) => I || !nt(v)).map((v) => v.id)), {
1628
+ const v = i.includeSystemCards === !0, H = n.blocks.length;
1629
+ return n.blocks = v ? [] : n.blocks.filter(it), l.push(...t.blocks.filter((A) => v || !it(A)).map((A) => A.id)), {
1630
1630
  status: "success",
1631
1631
  snapshot: { ...n, version: t.version + 1, updatedAt: (/* @__PURE__ */ new Date()).toISOString() },
1632
- affectedCardIds: m,
1633
- transactionId: u,
1634
- error: T === n.blocks.length ? { code: "OBJECT_NOT_FOUND", message: "画布中没有可清空的业务卡片。" } : void 0
1632
+ affectedCardIds: l,
1633
+ transactionId: m,
1634
+ error: H === n.blocks.length ? { code: "OBJECT_NOT_FOUND", message: u("FWA.dcb71787570784860") } : void 0
1635
1635
  };
1636
1636
  }
1637
1637
  if (a === "overwriteCanvas") {
1638
- const I = Array.isArray(i.blocks) ? i.blocks : [];
1639
- if (I.length === 0) return L("INVALID_PARAMS", "overwriteCanvas 需要 payload.blocks。");
1640
- const v = i.keepSystemCards !== !1 ? n.blocks.filter(nt) : [], b = [];
1641
- for (const F of I) {
1642
- const K = await it(F, [
1643
- ...v.map((V) => V.layout),
1644
- ...b.map((V) => V.layout)
1638
+ const v = Array.isArray(i.blocks) ? i.blocks : [];
1639
+ if (v.length === 0) return R("INVALID_PARAMS", u("FWA.11e71787570342151"));
1640
+ const A = i.keepSystemCards !== !1 ? n.blocks.filter(it) : [], E = [];
1641
+ for (const K of v) {
1642
+ const z = await rt(K, [
1643
+ ...A.map((q) => q.layout),
1644
+ ...E.map((q) => q.layout)
1645
1645
  ]);
1646
- K.block && b.push(K.block);
1646
+ z.block && E.push(z.block);
1647
1647
  }
1648
- return n.blocks = [...v, ...b], m.push(...b.map((F) => F.id)), {
1648
+ return n.blocks = [...A, ...E], l.push(...E.map((K) => K.id)), {
1649
1649
  status: "success",
1650
1650
  snapshot: { ...n, version: t.version + 1, updatedAt: (/* @__PURE__ */ new Date()).toISOString() },
1651
- affectedCardIds: m,
1652
- transactionId: u
1651
+ affectedCardIds: l,
1652
+ transactionId: m
1653
1653
  };
1654
1654
  }
1655
1655
  if (a === "rollback") {
1656
- const I = i.snapshot;
1657
- return !I || typeof I != "object" ? L("INVALID_PARAMS", "rollback 需要 payload.snapshot。") : {
1656
+ const v = i.snapshot;
1657
+ return !v || typeof v != "object" ? R("INVALID_PARAMS", u("FWA.ed301787570410944")) : {
1658
1658
  status: "success",
1659
- snapshot: { ...I, version: t.version + 1, updatedAt: (/* @__PURE__ */ new Date()).toISOString() },
1660
- affectedCardIds: ((x = I.blocks) == null ? void 0 : x.map((T) => T.id)) || [],
1661
- transactionId: u
1659
+ snapshot: { ...v, version: t.version + 1, updatedAt: (/* @__PURE__ */ new Date()).toISOString() },
1660
+ affectedCardIds: ((I = v.blocks) == null ? void 0 : I.map((H) => H.id)) || [],
1661
+ transactionId: m
1662
1662
  };
1663
1663
  }
1664
- if (!r) return L("CARD_NOT_FOUND", "改卡目标不存在。", e.target);
1664
+ if (!r) return R("CARD_NOT_FOUND", u("FWA.88a31787571020621"), e.target);
1665
1665
  if (a === "deleteCard") {
1666
1666
  if (s === "canvas") return await Gt(t, { ...e, operation: "clearCanvas" });
1667
1667
  s === "cardObject" ? (o({
@@ -1669,77 +1669,77 @@ async function Gt(t, e) {
1669
1669
  meta: {
1670
1670
  ...r.meta || {},
1671
1671
  removedObjects: [
1672
- ...Array.isArray((g = r.meta) == null ? void 0 : g.removedObjects) ? r.meta.removedObjects : [],
1673
- ((C = e.target) == null ? void 0 : C.objectSelector) || i.objectSelector || { deletedAt: (/* @__PURE__ */ new Date()).toISOString() }
1672
+ ...Array.isArray((x = r.meta) == null ? void 0 : x.removedObjects) ? r.meta.removedObjects : [],
1673
+ ((F = e.target) == null ? void 0 : F.objectSelector) || i.objectSelector || { deletedAt: (/* @__PURE__ */ new Date()).toISOString() }
1674
1674
  ]
1675
1675
  }
1676
- }), m.push(r.id)) : (d ? la(n, d) : n.blocks.splice(c, 1), m.push(r.id));
1676
+ }), l.push(r.id)) : (d ? pa(n, d) : n.blocks.splice(c, 1), l.push(r.id));
1677
1677
  }
1678
1678
  if (a === "replaceCard") {
1679
- const I = i.insertCard || i.card || i, T = i.keepLayout !== !1, v = await it({
1680
- ...I,
1681
- layout: T ? r.layout : I.layout
1682
- }, n.blocks.filter((b) => b.id !== r.id).map((b) => b.layout));
1683
- if (!v.block) return L("CAPABILITY_NOT_FOUND", v.reason || "替换卡片能力不存在。", v);
1684
- o(v.block), m.push(r.id, v.block.id);
1679
+ const v = i.insertCard || i.card || i, H = i.keepLayout !== !1, A = await rt({
1680
+ ...v,
1681
+ layout: H ? r.layout : v.layout
1682
+ }, n.blocks.filter((E) => E.id !== r.id).map((E) => E.layout));
1683
+ if (!A.block) return R("CAPABILITY_NOT_FOUND", A.reason || u("FWA.4ccc1787570941093"), A);
1684
+ o(A.block), l.push(r.id, A.block.id);
1685
1685
  }
1686
1686
  if (a === "renameTitle") {
1687
- const I = typeof i.title == "string" ? i.title : typeof i.text == "string" ? i.text : "";
1688
- if (!I.trim()) return L("INVALID_PARAMS", "renameTitle 需要 payload.title。");
1689
- o({ ...r, title: I }), m.push(r.id);
1687
+ const v = typeof i.title == "string" ? i.title : typeof i.text == "string" ? i.text : "";
1688
+ if (!v.trim()) return R("INVALID_PARAMS", u("FWA.351d1787570411451"));
1689
+ o({ ...r, title: v }), l.push(r.id);
1690
1690
  }
1691
1691
  if (a === "editBodyText" || a === "editText") {
1692
- const I = typeof i.text == "string" ? i.text : typeof i.bodyText == "string" ? i.bodyText : "";
1693
- if (!I.trim()) return L("INVALID_PARAMS", `${a} 需要 payload.text。`);
1692
+ const v = typeof i.text == "string" ? i.text : typeof i.bodyText == "string" ? i.bodyText : "";
1693
+ if (!v.trim()) return R("INVALID_PARAMS", u("FWA.583c1787570503113", { p0: a }));
1694
1694
  o({
1695
1695
  ...r,
1696
1696
  meta: {
1697
1697
  ...r.meta || {},
1698
- bodyText: a === "editBodyText" ? I : (y = r.meta) == null ? void 0 : y.bodyText,
1699
- editedText: a === "editText" ? I : (w = r.meta) == null ? void 0 : w.editedText
1698
+ bodyText: a === "editBodyText" ? v : (g = r.meta) == null ? void 0 : g.bodyText,
1699
+ editedText: a === "editText" ? v : (W = r.meta) == null ? void 0 : W.editedText
1700
1700
  }
1701
- }), m.push(r.id);
1701
+ }), l.push(r.id);
1702
1702
  }
1703
1703
  if (a === "changeChart") {
1704
- const I = typeof i.rendererKey == "string" ? i.rendererKey : "";
1705
- if (!I.trim()) return L("INVALID_PARAMS", "changeChart 需要 payload.rendererKey。");
1704
+ const v = typeof i.rendererKey == "string" ? i.rendererKey : "";
1705
+ if (!v.trim()) return R("INVALID_PARAMS", u("FWA.e2121787570322856"));
1706
1706
  o({
1707
1707
  ...r,
1708
- renderer: { ...r.renderer || { engine: "echarts", rendererKey: I }, rendererKey: I },
1708
+ renderer: { ...r.renderer || { engine: "echarts", rendererKey: v }, rendererKey: v },
1709
1709
  meta: { ...r.meta || {}, chartChangedAt: (/* @__PURE__ */ new Date()).toISOString() }
1710
- }), m.push(r.id);
1710
+ }), l.push(r.id);
1711
1711
  }
1712
1712
  if (a === "changeDataSource") {
1713
- if (!i.data && !i.source) return L("INVALID_PARAMS", "changeDataSource 需要 payload.data 或 payload.source。");
1714
- o(Rt(r, i)), m.push(r.id);
1713
+ if (!i.data && !i.source) return R("INVALID_PARAMS", u("FWA.8c001787570199538"));
1714
+ o(Nt(r, i)), l.push(r.id);
1715
1715
  }
1716
1716
  if (a === "adjustLayout") {
1717
- const I = i.layout;
1718
- if (!I) return L("INVALID_PARAMS", "adjustLayout 需要 payload.layout。");
1719
- const T = n.blocks.filter((b) => b.id !== r.id).map((b) => b.layout), v = Kt({
1717
+ const v = i.layout;
1718
+ if (!v) return R("INVALID_PARAMS", u("FWA.e9f01787570385143"));
1719
+ const H = n.blocks.filter((E) => E.id !== r.id).map((E) => E.layout), A = zt({
1720
1720
  preset: "medium",
1721
- layout: { ...r.layout, ...I },
1722
- placed: T
1721
+ layout: { ...r.layout, ...v },
1722
+ placed: H
1723
1723
  });
1724
- o({ ...r, layout: zt(r.id, v) }), m.push(r.id);
1724
+ o({ ...r, layout: Vt(r.id, A) }), l.push(r.id);
1725
1725
  }
1726
1726
  if (a === "modifyCard" || a === "freeModify") {
1727
- if (a === "freeModify" && !(((R = e.target) == null ? void 0 : R.cardId) && i.scope && i.content && i.expectedResult))
1728
- return L("INVALID_PARAMS", "freeModify 缺目标、修改范围、修改内容或预期结果,已拒绝模糊写入。");
1729
- o(Rt(r, i)), m.push(r.id);
1727
+ if (a === "freeModify" && !(((N = e.target) == null ? void 0 : N.cardId) && i.scope && i.content && i.expectedResult))
1728
+ return R("INVALID_PARAMS", u("FWA.7ddd1787570282904"));
1729
+ o(Nt(r, i)), l.push(r.id);
1730
1730
  }
1731
1731
  if (a === "mutateCapability") {
1732
- const I = i.mutation;
1733
- if (!I || typeof I != "object") return L("INVALID_PARAMS", "mutateCapability 需要 payload.mutation。");
1734
- const T = I.capabilitySpec;
1735
- if (I.action === "mount" || I.action === "replace") {
1736
- const v = Jt(T, String(i.userNeed || "修改卡片内部能力"));
1737
- if (!v.allowed || !v.capability) return L(((A = v.error) == null ? void 0 : A.code) || "POLICY_REJECTED", ((_ = v.error) == null ? void 0 : _.message) || "Primitive Policy 拒绝。", v.gap || ((P = v.error) == null ? void 0 : P.details));
1738
- const b = Array.isArray((D = r.meta) == null ? void 0 : D.capabilityMounts) ? r.meta.capabilityMounts : [], F = I.action === "replace" ? [...b.filter((K) => {
1739
- var V;
1740
- return K.id !== ((V = v.capability) == null ? void 0 : V.id);
1741
- }), v.capability] : [...b, v.capability];
1742
- o({ ...r, meta: { ...r.meta || {}, capabilityMounts: F } }), m.push(r.id);
1732
+ const v = i.mutation;
1733
+ if (!v || typeof v != "object") return R("INVALID_PARAMS", u("FWA.6f5b1787570300729"));
1734
+ const H = v.capabilitySpec;
1735
+ if (v.action === "mount" || v.action === "replace") {
1736
+ const A = Qt(H, String(i.userNeed || u("FWA.b7411787571020631")));
1737
+ if (!A.allowed || !A.capability) return R(((b = A.error) == null ? void 0 : b.code) || "POLICY_REJECTED", ((_ = A.error) == null ? void 0 : _.message) || u("FWA.03c11787570602730"), A.gap || ((P = A.error) == null ? void 0 : P.details));
1738
+ const E = Array.isArray((D = r.meta) == null ? void 0 : D.capabilityMounts) ? r.meta.capabilityMounts : [], K = v.action === "replace" ? [...E.filter((z) => {
1739
+ var q;
1740
+ return z.id !== ((q = A.capability) == null ? void 0 : q.id);
1741
+ }), A.capability] : [...E, A.capability];
1742
+ o({ ...r, meta: { ...r.meta || {}, capabilityMounts: K } }), l.push(r.id);
1743
1743
  } else
1744
1744
  o({
1745
1745
  ...r,
@@ -1747,26 +1747,26 @@ async function Gt(t, e) {
1747
1747
  ...r.meta || {},
1748
1748
  capabilityMutationLog: [
1749
1749
  ...Array.isArray((G = r.meta) == null ? void 0 : G.capabilityMutationLog) ? r.meta.capabilityMutationLog : [],
1750
- I
1750
+ v
1751
1751
  ]
1752
1752
  }
1753
- }), m.push(r.id);
1753
+ }), l.push(r.id);
1754
1754
  }
1755
- return m.length === 0 ? L("UNSUPPORTED_OPERATION", `生命周期操作未产生修改:${a}`) : {
1755
+ return l.length === 0 ? R("UNSUPPORTED_OPERATION", u("FWA.67921787570603779", { p0: a })) : {
1756
1756
  status: "success",
1757
1757
  snapshot: {
1758
1758
  ...n,
1759
1759
  version: t.version + 1,
1760
1760
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
1761
1761
  },
1762
- affectedCardIds: [...new Set(m)],
1763
- transactionId: u
1762
+ affectedCardIds: [...new Set(l)],
1763
+ transactionId: m
1764
1764
  };
1765
1765
  }
1766
- function Et(t) {
1766
+ function Ct(t) {
1767
1767
  return t || `canvas-req-${Date.now()}-${Math.random().toString(36).slice(2)}`;
1768
1768
  }
1769
- function Y(t, e, a) {
1769
+ function $(t, e, a) {
1770
1770
  return {
1771
1771
  success: !1,
1772
1772
  requestId: e,
@@ -1775,59 +1775,59 @@ function Y(t, e, a) {
1775
1775
  error: a
1776
1776
  };
1777
1777
  }
1778
- function At(t, e, a) {
1779
- return t ? null : Y(e, a, {
1778
+ function bt(t, e, a) {
1779
+ return t ? null : $(e, a, {
1780
1780
  code: "INVALID_PARAMS",
1781
- message: "画布快照尚未初始化,不能执行出卡或改卡。"
1781
+ message: u("FWA.30af1787570601160")
1782
1782
  });
1783
1783
  }
1784
- function Ha(t) {
1784
+ function Ta(t) {
1785
1785
  return {
1786
1786
  async insertCard(e) {
1787
- const a = Et(e.requestId), n = t.getSnapshot(), i = At(n, "insertCard", a);
1787
+ const a = Ct(e.requestId), n = t.getSnapshot(), i = bt(n, "insertCard", a);
1788
1788
  if (i || !n) return i;
1789
1789
  if (e.baseSnapshotVersion !== void 0 && e.baseSnapshotVersion !== n.version)
1790
- return Y("insertCard", a, {
1790
+ return $("insertCard", a, {
1791
1791
  code: "VERSION_CONFLICT",
1792
- message: "画布快照版本已变化,请基于最新快照重试。",
1792
+ message: u("FWA.1a961787570602208"),
1793
1793
  details: { expected: e.baseSnapshotVersion, actual: n.version }
1794
1794
  });
1795
- const s = await it(e, n.blocks.map((o) => o.layout));
1795
+ const s = await rt(e, n.blocks.map((o) => o.layout));
1796
1796
  if (!s.block)
1797
- return Y("insertCard", a, {
1797
+ return $("insertCard", a, {
1798
1798
  code: "CAPABILITY_NOT_FOUND",
1799
- message: s.reason || "卡片能力不存在或不可创建。",
1799
+ message: s.reason || u("FWA.f9461787570820908"),
1800
1800
  details: s
1801
1801
  });
1802
1802
  const c = n.version;
1803
1803
  if (e.targetScope === "nested" || e.targetParentId) {
1804
- const o = e.targetParentId, m = n.blocks.findIndex((w) => w.id === o), u = m >= 0 ? n.blocks[m] : void 0;
1805
- if (!o || !u || !W(u.data))
1806
- return Y("insertCard", a, {
1804
+ const o = e.targetParentId, l = n.blocks.findIndex((W) => W.id === o), m = l >= 0 ? n.blocks[l] : void 0;
1805
+ if (!o || !m || !O(m.data))
1806
+ return $("insertCard", a, {
1807
1807
  code: "CARD_NOT_FOUND",
1808
- message: "未找到可插入嵌套卡片的父卡。",
1808
+ message: u("FWA.cd5e1787570783618"),
1809
1809
  details: { targetParentId: o }
1810
1810
  });
1811
- const l = lt(s.block, {
1811
+ const p = pt(s.block, {
1812
1812
  parentId: o,
1813
1813
  layout: {
1814
1814
  ...s.block.layout,
1815
1815
  ...e.layout,
1816
1816
  i: s.block.id
1817
1817
  }
1818
- }), f = u.data, x = Array.isArray(f.nestedBlocks) ? f.nestedBlocks : [], g = n.blocks.map((w, R) => R === m ? {
1819
- ...w,
1818
+ }), y = m.data, I = Array.isArray(y.nestedBlocks) ? y.nestedBlocks : [], x = n.blocks.map((W, N) => N === l ? {
1819
+ ...W,
1820
1820
  data: {
1821
- ...f,
1821
+ ...y,
1822
1822
  nestedLayoutMode: "grid",
1823
- nestedBlocks: [...x, l]
1823
+ nestedBlocks: [...I, p]
1824
1824
  }
1825
- } : w), C = {
1825
+ } : W), F = {
1826
1826
  ...n,
1827
1827
  version: n.version + 1,
1828
1828
  updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
1829
- blocks: g
1830
- }, y = await t.commitSnapshot(C, {
1829
+ blocks: x
1830
+ }, g = await t.commitSnapshot(F, {
1831
1831
  ...e.persistence || {},
1832
1832
  baseSnapshotVersion: c
1833
1833
  });
@@ -1836,10 +1836,10 @@ function Ha(t) {
1836
1836
  requestId: a,
1837
1837
  operation: "insertCard",
1838
1838
  affectedCardIds: [s.block.id],
1839
- snapshotVersion: y.version,
1839
+ snapshotVersion: g.version,
1840
1840
  data: {
1841
1841
  card: s.block,
1842
- snapshot: y
1842
+ snapshot: g
1843
1843
  }
1844
1844
  };
1845
1845
  }
@@ -1848,7 +1848,7 @@ function Ha(t) {
1848
1848
  version: n.version + 1,
1849
1849
  layoutVersion: 3,
1850
1850
  updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
1851
- blocks: Vt([...n.blocks, s.block])
1851
+ blocks: qt([...n.blocks, s.block])
1852
1852
  }, r = await t.commitSnapshot(d, {
1853
1853
  ...e.persistence || {},
1854
1854
  baseSnapshotVersion: c
@@ -1867,13 +1867,13 @@ function Ha(t) {
1867
1867
  },
1868
1868
  async updateCard(e) {
1869
1869
  var o;
1870
- const a = Et(e.requestId), n = t.getSnapshot(), i = At(n, "updateCard", a);
1870
+ const a = Ct(e.requestId), n = t.getSnapshot(), i = bt(n, "updateCard", a);
1871
1871
  if (i || !n) return i;
1872
1872
  const s = n.version, c = await Gt(n, e);
1873
1873
  if (c.status !== "success" || !c.snapshot)
1874
- return Y("updateCard", a, c.error || {
1874
+ return $("updateCard", a, c.error || {
1875
1875
  code: "UNSUPPORTED_OPERATION",
1876
- message: "改卡操作失败。",
1876
+ message: u("FWA.68701787571066464"),
1877
1877
  details: c
1878
1878
  });
1879
1879
  c.locatedCardId && ((o = t.locateCard) == null || o.call(t, c.locatedCardId));
@@ -1898,35 +1898,35 @@ function Ha(t) {
1898
1898
  }
1899
1899
  export {
1900
1900
  Sa as A,
1901
- Wa as B,
1902
- va as C,
1903
- N as D,
1904
- ya as R,
1905
- U as W,
1901
+ Oa as B,
1902
+ Aa as C,
1903
+ w as D,
1904
+ ga as R,
1905
+ X as W,
1906
1906
  Ma as a,
1907
- Ot as b,
1908
- Ha as c,
1909
- ga as d,
1910
- qt as e,
1911
- Ze as f,
1912
- Ra as g,
1907
+ Lt as b,
1908
+ Ta as c,
1909
+ xa as d,
1910
+ Yt as e,
1911
+ ta as f,
1912
+ Na as g,
1913
1913
  Dt as h,
1914
- $ as i,
1915
- xa as j,
1914
+ j as i,
1915
+ Ia as j,
1916
1916
  S as k,
1917
- Na as l,
1918
- Ta as m,
1917
+ wa as l,
1918
+ Ha as m,
1919
1919
  kt as n,
1920
- La as o,
1921
- jt as p,
1922
- Ca as q,
1923
- ba as r,
1924
- ut as s,
1925
- Ia as t,
1926
- wa as u,
1927
- Ea as v,
1928
- Wt as w,
1929
- Oa as x,
1930
- Aa as y,
1931
- ie as z
1920
+ Ra as o,
1921
+ Ut as p,
1922
+ Fa as q,
1923
+ Ea as r,
1924
+ mt as s,
1925
+ va as t,
1926
+ Wa as u,
1927
+ Ca as v,
1928
+ Ot as w,
1929
+ La as x,
1930
+ ba as y,
1931
+ re as z
1932
1932
  };