@next-bricks/visual-builder 1.38.12 → 1.39.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bricks.json +12 -12
- package/dist/chunks/{1940.0dd01dd4.js → 1940.83be4317.js} +2 -2
- package/dist/chunks/{9559.4e223669.js.map → 1940.83be4317.js.map} +1 -1
- package/dist/chunks/3831.d86abb48.js +2 -0
- package/dist/chunks/3831.d86abb48.js.map +1 -0
- package/dist/chunks/{4291.f0245838.js → 4291.28fadd65.js} +2 -2
- package/dist/chunks/{4291.f0245838.js.map → 4291.28fadd65.js.map} +1 -1
- package/dist/chunks/5247.e1dcd513.js +3 -0
- package/dist/chunks/{5247.869172ba.js.map → 5247.e1dcd513.js.map} +1 -1
- package/dist/chunks/{8595.7f5079c6.js → 8595.c2633081.js} +3 -3
- package/dist/chunks/8595.c2633081.js.map +1 -0
- package/dist/chunks/{9080.09a7e610.js → 9080.e8687386.js} +2 -2
- package/dist/chunks/{9080.09a7e610.js.map → 9080.e8687386.js.map} +1 -1
- package/dist/chunks/{9559.4e223669.js → 9559.040c34a4.js} +2 -2
- package/dist/chunks/{1940.0dd01dd4.js.map → 9559.040c34a4.js.map} +1 -1
- package/dist/chunks/chat-conversation.4f9551df.js +2 -0
- package/dist/chunks/chat-conversation.4f9551df.js.map +1 -0
- package/dist/chunks/main.a6dc2bdf.js +2 -0
- package/dist/chunks/{main.56ac3be7.js.map → main.a6dc2bdf.js.map} +1 -1
- package/dist/chunks/{property-editor.3ced3a84.js → property-editor.37a0c94a.js} +2 -2
- package/dist/chunks/{property-editor.3ced3a84.js.map → property-editor.37a0c94a.js.map} +1 -1
- package/dist/chunks/{workbench-history-action.2114495b.js → workbench-history-action.3c741fb6.js} +3 -3
- package/dist/chunks/{workbench-history-action.2114495b.js.map → workbench-history-action.3c741fb6.js.map} +1 -1
- package/dist/index.110efd7c.js +2 -0
- package/dist/index.110efd7c.js.map +1 -0
- package/dist/manifest.json +72 -72
- package/dist/types.json +309 -309
- package/package.json +2 -2
- package/dist/chunks/3831.d8ad73ce.js +0 -2
- package/dist/chunks/3831.d8ad73ce.js.map +0 -1
- package/dist/chunks/5247.869172ba.js +0 -3
- package/dist/chunks/8595.7f5079c6.js.map +0 -1
- package/dist/chunks/chat-conversation.e84ad258.js +0 -2
- package/dist/chunks/chat-conversation.e84ad258.js.map +0 -1
- package/dist/chunks/main.56ac3be7.js +0 -2
- package/dist/index.1de70298.js +0 -2
- package/dist/index.1de70298.js.map +0 -1
- /package/dist/chunks/{5247.869172ba.js.LICENSE.txt → 5247.e1dcd513.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{8595.7f5079c6.js.LICENSE.txt → 8595.c2633081.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{workbench-history-action.2114495b.js.LICENSE.txt → workbench-history-action.3c741fb6.js.LICENSE.txt} +0 -0
package/dist/bricks.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "bricks/visual-builder",
|
|
3
3
|
"bricks": [
|
|
4
|
+
"visual-builder.workbench-pane",
|
|
4
5
|
"visual-builder.workbench-sidebar",
|
|
6
|
+
"visual-builder.workbench-action",
|
|
5
7
|
"visual-builder.workbench-action-list",
|
|
6
8
|
"visual-builder.workbench-tree",
|
|
7
9
|
"visual-builder.workbench-history-action",
|
|
8
|
-
"visual-builder.workbench-action",
|
|
9
10
|
"visual-builder.page-arch-node",
|
|
10
11
|
"visual-builder.contract-select",
|
|
11
12
|
"visual-builder.generate-snippets-context-menu",
|
|
12
13
|
"visual-builder.chat-conversation",
|
|
13
14
|
"visual-builder.chat-preview",
|
|
14
|
-
"visual-builder.pre-generated-preview",
|
|
15
15
|
"visual-builder.batch-update-raw-data-generated-view",
|
|
16
16
|
"visual-builder.check-editor-by-name",
|
|
17
17
|
"visual-builder.get-config-by-data-for-ai",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"visual-builder.get-raw-data-system-prompts",
|
|
21
21
|
"visual-builder.inject-chat-preview-agent",
|
|
22
22
|
"visual-builder.parse-path",
|
|
23
|
+
"visual-builder.pre-generated-preview",
|
|
23
24
|
"visual-builder.pre-generated-table-view",
|
|
24
25
|
"visual-builder.pre-generated-container",
|
|
25
26
|
"visual-builder.property-editor",
|
|
26
|
-
"visual-builder.workbench-pane",
|
|
27
27
|
"visual-builder.raw-data-preview",
|
|
28
28
|
"visual-builder.pre-generated-config",
|
|
29
29
|
"visual-builder.pre-generated-config-preview",
|
|
@@ -33,6 +33,14 @@
|
|
|
33
33
|
"processors": [],
|
|
34
34
|
"editors": [],
|
|
35
35
|
"dependencies": {
|
|
36
|
+
"visual-builder.workbench-pane": [
|
|
37
|
+
"eo-icon"
|
|
38
|
+
],
|
|
39
|
+
"visual-builder.workbench-action": [
|
|
40
|
+
"eo-link",
|
|
41
|
+
"eo-icon",
|
|
42
|
+
"eo-tooltip"
|
|
43
|
+
],
|
|
36
44
|
"visual-builder.workbench-action-list": [
|
|
37
45
|
"visual-builder.workbench-action",
|
|
38
46
|
"eo-link",
|
|
@@ -50,11 +58,6 @@
|
|
|
50
58
|
"eo-easyops-avatar",
|
|
51
59
|
"eo-popover"
|
|
52
60
|
],
|
|
53
|
-
"visual-builder.workbench-action": [
|
|
54
|
-
"eo-link",
|
|
55
|
-
"eo-icon",
|
|
56
|
-
"eo-tooltip"
|
|
57
|
-
],
|
|
58
61
|
"visual-builder.page-arch-node": [
|
|
59
62
|
"eo-icon",
|
|
60
63
|
"eo-tooltip"
|
|
@@ -78,10 +81,7 @@
|
|
|
78
81
|
"eo-icon-select",
|
|
79
82
|
"vs.code-editor",
|
|
80
83
|
"eo-tooltip"
|
|
81
|
-
],
|
|
82
|
-
"visual-builder.workbench-pane": [
|
|
83
|
-
"eo-icon"
|
|
84
84
|
]
|
|
85
85
|
},
|
|
86
|
-
"filePath": "bricks/visual-builder/dist/index.
|
|
86
|
+
"filePath": "bricks/visual-builder/dist/index.110efd7c.js"
|
|
87
87
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_next_bricks_visual_builder=globalThis.webpackChunk_next_bricks_visual_builder||[]).push([[1940,9559],{49559:(e,t,r)=>{r.r(t),r.d(t,{supply:()=>s});var n=r(41030),a=r(
|
|
2
|
-
//# sourceMappingURL=1940.
|
|
1
|
+
"use strict";(globalThis.webpackChunk_next_bricks_visual_builder=globalThis.webpackChunk_next_bricks_visual_builder||[]).push([[1940,9559],{49559:(e,t,r)=>{r.r(t),r.d(t,{supply:()=>s});var n=r(41030),a=r(21302),i=r(59933);function s(e,t,r){const n={};for(const a of e)if(!Object.prototype.hasOwnProperty.call(n,a))if("undefined"===a)n[a]=void 0;else if(t&&Object.prototype.hasOwnProperty.call(t,a))n[a]=t[a];else{const e=u(a,r);void 0!==e&&(n[a]=e)}return n}const o=new Set(["fill","pull","pullAll","pullAllBy","pullAllWith","pullAt","remove","reverse","assign","assignIn","assignInWith","assignWith","defaults","defaultsDeep","merge","mergeWith","set","setWith","unset","update","updateWith","after","ary","before","bind","bindKey","curry","curryRight","debounce","defer","delay","flip","memoize","negate","once","overArgs","partial","partialRight","rearg","rest","spread","throttle","unary","wrap"]),l=new Set(["lang","langData","locale","localeData","defineLocale","updateLocale","updateOffset"]),c=new Set(["Array","Boolean","Date","Infinity","JSON","Math","NaN","Number","String","RegExp","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","isFinite","isNaN","parseFloat","parseInt","Map","Set","URL","URLSearchParams","WeakMap","WeakSet","atob","btoa"]);function u(e,t){switch(e){case"Object":return r=Object,s=["entries","fromEntries","keys","values"],Object.fromEntries(s.map((e=>[e,function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return r[e].apply(r,n)}])));case"_":return Object.fromEntries(Object.entries(n).filter((e=>!o.has(e[0]))).concat(t?[["uniqueId",e=>`${null!=e?e:""}42`]]:[]));case"moment":return Object.assign((function(){return a(...arguments)}),Object.fromEntries(Object.entries(a).filter((e=>!l.has(e[0])))));case"PIPES":return i.pipes;case"TAG_URL":return p(!0);case"SAFE_TAG_URL":return p();default:if(c.has(e))return window[e]}var r,s}function p(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];const i=[];return t.forEach(((t,r)=>{i.push(t),r<n.length&&i.push(e?String(n[r]).replace(/[^/]+/g,(e=>encodeURIComponent(e))):encodeURIComponent(String(n[r])))})),i.join("")}}}}]);
|
|
2
|
+
//# sourceMappingURL=1940.83be4317.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunks/
|
|
1
|
+
{"version":3,"file":"chunks/1940.83be4317.js","mappings":"8NAGO,SAASA,EAAOC,EAAuBC,EAAyBC,GACrE,MAAMC,EAAkB,CAAC,EAEzB,IAAK,MAAMC,KAAgBJ,EACzB,IAAKK,OAAOC,UAAUC,eAAeC,KAAKL,EAAiBC,GACzD,GAAqB,cAAjBA,EACFD,EAAgBC,QAAgBK,OAC3B,GAAIR,GAA2BI,OAAOC,UAAUC,eAAeC,KAAKP,EAAyBG,GAClGD,EAAgBC,GAAgBH,EAAwBG,OACnD,CACL,MAAMM,EAAWC,EAAiBP,EAAcF,QAC/BO,IAAbC,IACFP,EAAgBC,GAAgBM,EAEpC,CAGJ,OAAOP,CACT,CACA,MAAMS,EAAqB,IAAIC,IAAI,CAGnC,OAAQ,OAAQ,UAAW,YAAa,cAAe,SAAU,SAAU,UAAW,SAAU,WAAY,eAAgB,aAAc,WAAY,eAAgB,QAAS,YAAa,MAAO,UAAW,QAAS,SAAU,aAWjO,QAAS,MAAO,SAAU,OAAQ,UAAW,QAAS,aAAc,WAAY,QAAS,QAAS,OAAQ,UAAW,SAAU,OAAQ,WAAY,UAAW,eAAgB,QAAS,OAAQ,SAAU,WAAY,QAAS,SAGxNC,EAAqB,IAAID,IAAI,CAAC,OAAQ,WAAY,SAAU,aAAc,eAAgB,eAAgB,iBAC1GE,EAAuB,IAAIF,IAAI,CAAC,QAAS,UAAW,OAAQ,WAAY,OAAQ,OAAQ,MAAO,SAAU,SAAU,SAAU,YAAa,qBAAsB,YAAa,qBAAsB,WAAY,QAAS,aAAc,WAAY,MAAO,MAAO,MAAO,kBAAmB,UAAW,UAAW,OAAQ,SAC9T,SAASF,EAAiBP,EAAcF,GACtC,OAAQE,GACN,IAAK,SAEH,OAmBmBY,EAnBIX,OAmBIY,EAnBI,CAAC,UAAW,cAAe,OAAQ,UAoB/DZ,OAAOa,YAAYD,EAAQE,KAAIC,GAAU,CAACA,EAAQ,WACvD,IAAK,IAAIC,EAAOC,UAAUC,OAAQC,EAAO,IAAIC,MAAMJ,GAAOK,EAAO,EAAGA,EAAOL,EAAMK,IAC/EF,EAAKE,GAAQJ,UAAUI,GAEzB,OAAOV,EAAOI,GAAQO,MAAMX,EAAQQ,EACtC,MAxBE,IAAK,IACH,OAAOnB,OAAOa,YAAYb,OAAOuB,QAAQ,GAAQC,QAAOC,IAAUlB,EAAmBmB,IAAID,EAAM,MAAKE,OAAO9B,EAAO,CAAC,CAAC,WAAY+B,GAAU,GAAGA,QAAuCA,EAAS,SAAW,KAC1M,IAAK,SACH,OAAO5B,OAAO6B,QAAO,WACnB,OAAO,KAAUZ,UACnB,GAAGjB,OAAOa,YAAYb,OAAOuB,QAAQ,GAAQC,QAAOC,IAAUhB,EAAmBiB,IAAID,EAAM,QAC7F,IAAK,QACH,OAAO,EAAAK,MACT,IAAK,UACH,OAAOC,GAAc,GACvB,IAAK,eACH,OAAOA,IACT,QACE,GAAIrB,EAAqBgB,IAAI3B,GAC3B,OAAOiC,OAAOjC,GAItB,IAAyBY,EAAQC,CADjC,CAiCA,SAASmB,EAAcE,GACrB,OAAO,SAAUC,GACf,IAAK,IAAIC,EAAQlB,UAAUC,OAAQkB,EAAW,IAAIhB,MAAMe,EAAQ,EAAIA,EAAQ,EAAI,GAAIE,EAAQ,EAAGA,EAAQF,EAAOE,IAC5GD,EAASC,EAAQ,GAAKpB,UAAUoB,GAElC,MAAMC,EAAS,GAOf,OANAJ,EAAQK,SAAQ,CAACC,EAAKC,KACpBH,EAAOI,KAAKF,GACRC,EAAQL,EAASlB,QACnBoB,EAAOI,KAAKT,EAAgBU,OAAOP,EAASK,IAAQG,QAAQ,UAAUC,GAAKC,mBAAmBD,KAAMC,mBAAmBH,OAAOP,EAASK,KACzI,IAEKH,EAAOS,KAAK,GACrB,CACF,C","sources":["webpack:///../../node_modules/@next-core/supply/dist/esm/index.js"],"sourcesContent":["import lodash from \"lodash\";\nimport moment from \"moment\";\nimport { pipes } from \"@next-core/pipes\";\nexport function supply(attemptToVisitGlobals, providedGlobalVariables, mock) {\n const globalVariables = {};\n // Allow limited browser builtin values.\n for (const variableName of attemptToVisitGlobals) {\n if (!Object.prototype.hasOwnProperty.call(globalVariables, variableName)) {\n if (variableName === \"undefined\") {\n globalVariables[variableName] = undefined;\n } else if (providedGlobalVariables && Object.prototype.hasOwnProperty.call(providedGlobalVariables, variableName)) {\n globalVariables[variableName] = providedGlobalVariables[variableName];\n } else {\n const variable = supplyIndividual(variableName, mock);\n if (variable !== undefined) {\n globalVariables[variableName] = variable;\n }\n }\n }\n }\n return globalVariables;\n}\nconst shouldOmitInLodash = new Set([\n// Omit all mutable methods from lodash.\n// But allow sequence methods like `_.chain`.\n\"fill\", \"pull\", \"pullAll\", \"pullAllBy\", \"pullAllWith\", \"pullAt\", \"remove\", \"reverse\", \"assign\", \"assignIn\", \"assignInWith\", \"assignWith\", \"defaults\", \"defaultsDeep\", \"merge\", \"mergeWith\", \"set\", \"setWith\", \"unset\", \"update\", \"updateWith\",\n/**\n * Ignore `Function` methods from lodash, too.\n * There are chances to invoke `Object.assign`, etc.\n *\n * E.g.:\n *\n * ```\n * _.wrap(_.method('constructor.assign',{b:2},{b:3}),(func,...a) => func(...a))({})\n * ```\n */\n\"after\", \"ary\", \"before\", \"bind\", \"bindKey\", \"curry\", \"curryRight\", \"debounce\", \"defer\", \"delay\", \"flip\", \"memoize\", \"negate\", \"once\", \"overArgs\", \"partial\", \"partialRight\", \"rearg\", \"rest\", \"spread\", \"throttle\", \"unary\", \"wrap\"]);\n\n// Omit all mutable methods from moment.\nconst shouldOmitInMoment = new Set([\"lang\", \"langData\", \"locale\", \"localeData\", \"defineLocale\", \"updateLocale\", \"updateOffset\"]);\nconst allowedGlobalObjects = new Set([\"Array\", \"Boolean\", \"Date\", \"Infinity\", \"JSON\", \"Math\", \"NaN\", \"Number\", \"String\", \"RegExp\", \"decodeURI\", \"decodeURIComponent\", \"encodeURI\", \"encodeURIComponent\", \"isFinite\", \"isNaN\", \"parseFloat\", \"parseInt\", \"Map\", \"Set\", \"URL\", \"URLSearchParams\", \"WeakMap\", \"WeakSet\", \"atob\", \"btoa\"]);\nfunction supplyIndividual(variableName, mock) {\n switch (variableName) {\n case \"Object\":\n // Do not allow mutable methods like `Object.assign`.\n return delegateMethods(Object, [\"entries\", \"fromEntries\", \"keys\", \"values\"]);\n case \"_\":\n return Object.fromEntries(Object.entries(lodash).filter(entry => !shouldOmitInLodash.has(entry[0])).concat(mock ? [[\"uniqueId\", prefix => `${prefix !== null && prefix !== void 0 ? prefix : \"\"}42`]] : []));\n case \"moment\":\n return Object.assign(function () {\n return moment(...arguments);\n }, Object.fromEntries(Object.entries(moment).filter(entry => !shouldOmitInMoment.has(entry[0]))));\n case \"PIPES\":\n return pipes;\n case \"TAG_URL\":\n return tagUrlFactory(true);\n case \"SAFE_TAG_URL\":\n return tagUrlFactory();\n default:\n if (allowedGlobalObjects.has(variableName)) {\n return window[variableName];\n }\n }\n}\nfunction delegateMethods(target, methods) {\n return Object.fromEntries(methods.map(method => [method, function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return target[method].apply(target, args);\n }]));\n}\n/**\n * Pass `ignoreSlashes` as `true` to encode all tagged expressions\n * as URL components, except for `/` which maybe used in `APP.homepage`.\n *\n * Otherwise encode all tagged expressions as URL components.\n * This will encode `/` as `%2F`. So do not use it directly\n * with `APP.homepage` as in template expressions.\n *\n * @example\n *\n * ```js\n * TAG_URL`${APP.homepage}/list?q=${q}&redirect=${redirect}`\n * ```\n *\n * ```js\n * SAFE_TAG_URL`file/${path}?q=${q}`\n * // `path` will be fully transformed by `encodeURIComponent`.\n * ```\n *\n * ```js\n * // Wrap `APP.homepage` outside of `SAFE_TAG_URL`.\n * `${APP.homepage}/${SAFE_TAG_URL`file/${path}?q=${q}`}`\n * ```\n */\nfunction tagUrlFactory(ignoreSlashes) {\n return function (strings) {\n for (var _len2 = arguments.length, partials = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n partials[_key2 - 1] = arguments[_key2];\n }\n const result = [];\n strings.forEach((str, index) => {\n result.push(str);\n if (index < partials.length) {\n result.push(ignoreSlashes ? String(partials[index]).replace(/[^/]+/g, p => encodeURIComponent(p)) : encodeURIComponent(String(partials[index])));\n }\n });\n return result.join(\"\");\n };\n}\n//# sourceMappingURL=index.js.map"],"names":["supply","attemptToVisitGlobals","providedGlobalVariables","mock","globalVariables","variableName","Object","prototype","hasOwnProperty","call","undefined","variable","supplyIndividual","shouldOmitInLodash","Set","shouldOmitInMoment","allowedGlobalObjects","target","methods","fromEntries","map","method","_len","arguments","length","args","Array","_key","apply","entries","filter","entry","has","concat","prefix","assign","pipes","tagUrlFactory","window","ignoreSlashes","strings","_len2","partials","_key2","result","forEach","str","index","push","String","replace","p","encodeURIComponent","join"],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_next_bricks_visual_builder=globalThis.webpackChunk_next_bricks_visual_builder||[]).push([[3831,5238],{5292:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(36758),a=n.n(i),r=n(40935),o=n.n(r)()(a());o.push([e.id,'.action::part(link){display:flex;justify-content:center;align-items:center;width:48px;height:48px;font-size:24px;color:var(--vb-workbench-action-color);position:relative;transition:none}.action.active::part(link)::before{content:"";position:absolute;top:0;bottom:0;left:0;width:2px;background-color:var(--vb-workbench-action-active-border-color)}.action.active::part(link),\n.action::part(link):hover{color:var(--vb-workbench-active-color)}',""]);const s=o.toString()},17180:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(36758),a=n.n(i),r=n(40935),o=n.n(r)()(a());o.push([e.id,':host{display:block;--pane-color:#595959}:host-context(html[data-theme="dark-v2"]),\n:host-context([data-override-theme="dark-v2"]){--pane-color:#ccc}:host([hidden]){display:none}*,\n*::before,\n*::after{box-sizing:border-box}.pane{display:flex;flex-direction:column;color:var(--pane-color);height:100%}.pane-header{display:flex;align-items:center;cursor:pointer;border-top:1px solid transparent;position:relative}.pane-header:focus{outline-width:1px;outline-style:solid;outline-offset:-1px;outline-color:#007fd4}:host(:not(:first-child)) .pane-header{border-top-color:rgba(204,204,204,0.2)}.pane-scroll-shadow{display:none;position:absolute;bottom:-3px;left:0;right:0;height:3px;box-shadow:#000000 0 6px 6px -6px inset;z-index:1}.scrolled .pane-scroll-shadow{display:block}.pane-title{display:flex;align-items:center;font-size:13px;line-height:24px;height:25px;min-width:0;flex:1}.title-icon{display:flex;justify-content:center;align-items:center;width:24px;padding-right:2px;line-height:1;flex-shrink:0}.title-label{text-transform:uppercase;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pane-body{flex-grow:1;min-height:0;display:none;overflow:hidden;overflow-y:auto;overflow-y:overlay}:host([active]) .pane-body{display:initial}:host(:not(:hover)) ::slotted([slot="actions"]){display:none}.badge{background-color:rgb(77,77,77);color:rgb(255,255,255);border-radius:11px;height:18px;padding:3px 6px;line-height:13px;margin:0 3px;font-size:12px}',""]);const s=o.toString()},18488:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(36758),a=n.n(i),r=n(40935),o=n.n(r)()(a());o.push([e.id,":host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.container,\niframe{width:100%;height:100%}.container{position:relative}iframe{display:block;border:none;margin:0;padding:0;transform-origin:0% 0%;-webkit-user-select:none;user-select:none}",""]);const s=o.toString()},22080:(e,t,n)=>{n.d(t,{ADVANCED_CHANGE_KEY:()=>Ce,SchemaField:()=>Le});var i,a=n(74635),r=n(70918),o=n(26902),s=n(5536),l=n(86121),c=n(70829),d=n(62740),p=n(18769),u=n.n(p),h=n(7921),m=n(11280),g=(n(65168),n(25908)),v=n(37091),b=n(7428),f=n(16768),A=n(81034),y=n(69708),w=n(4273),k=n(33768),E=n(42803),x=n(93824),N=n(72513),M=n(75067),T=n(21477),C=n(74287),L=n(40966),I=n(45768),S=n(26110),O=n(55944),_=n(68409),R=n(23081),W=n(43995),D=(n(60074),n(41030)),P=n.n(D);let $,B,U,F,z,V,j,K,X,J,G,H,q,Y,Z,Q,ee,te,ne,ie,ae,re,oe,se,le,ce,de,pe,ue,he,me,ge,ve,be,fe,Ae,ye,we;const{defineElement:ke,property:Ee,method:xe,event:Ne}=(0,h.createDecorators)(),Me=u().forwardRef(et),Te="before_submit",Ce="on_advanced_change",Le=(0,v.Uy)({components:{FormLayout:y.Hb,Input:y.pd,FormItem:E.M,FormItemWithoutAdvanced:y.eI,FormCollapse:y.w9,NumberPicker:y.Y_,Radio:y.sx,Select:y.l6,Switch:y.dO,CategoryTitle:k.H,CodeEditor:x.S,IconSelect:N.r,ColorPicker:M.h,UseChildrenSelect:I._,InputWithUrl:T.r,InputWithUnit:L.U,TextAlignRadio:C.p,CustomOptions:O.F,BoxSize:S.i,CustomTab:_.v}});let Ie,Se;var Oe=new WeakMap,_e=new WeakMap,Re=new WeakMap,We=new WeakMap,De=new WeakMap,Pe=new WeakMap,$e=new WeakMap,Be=new WeakMap,Ue=new WeakMap,Fe=new WeakMap,ze=new WeakSet,Ve=new WeakMap,je=new WeakMap,Ke=new WeakMap,Xe=new WeakMap,Je=new WeakMap,Ge=new WeakMap,He=new WeakMap,qe=new WeakMap,Ye=new WeakMap,Ze=new WeakMap;class Qe extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,ze),(0,r.A)(this,Oe,($(this),(0,p.createRef)())),(0,r.A)(this,_e,U(this)),(0,r.A)(this,Re,(F(this),z(this))),(0,r.A)(this,We,(V(this),j(this))),(0,r.A)(this,De,(K(this),X(this))),(0,r.A)(this,Pe,(J(this),G(this))),(0,r.A)(this,$e,(H(this),q(this))),(0,r.A)(this,Be,(Y(this),Z(this))),(0,r.A)(this,Ue,(Q(this),ee(this))),(0,r.A)(this,Fe,(te(this),ne(this))),(0,r.A)(this,Ve,(re(this),oe(this))),(0,r.A)(this,je,(ce(this),de(this))),(0,r.A)(this,Ke,(he(this),e=>{(0,s.A)(ze,this,pe).emit(e)})),(0,r.A)(this,Xe,me(this)),(0,r.A)(this,Je,(be(this),e=>{(0,s.A)(ze,this,ge).emit(e)})),(0,r.A)(this,Ge,void 0),(0,r.A)(this,He,(0,g.fA)(Te,((e,t)=>n=>{(0,l.A)(Ge,this,n(e,t))}))),(0,r.A)(this,qe,fe(this)),(0,r.A)(this,Ye,(we(this),e=>{(0,s.A)(ze,this,Ae).emit(e)})),(0,r.A)(this,Ze,(e=>{const t="string"==typeof e&&"undefined"===e?void 0:(0,D.omit)(e,["dataset.testid"]),n=[];(0,D.isEmpty)(null==t?void 0:t.dataset)&&n.push("dataset"),(0,D.isEmpty)(null==t?void 0:t.style)&&n.push("style");const i=(0,D.omit)(t,n);if(!(0,D.isEmpty)(i))return i}))}get editorName(){return(0,c.A)(_e,this)}set editorName(e){(0,l.A)(_e,this,e)}get values(){return(0,c.A)(Re,this)}set values(e){(0,l.A)(Re,this,e)}get advancedMode(){return(0,c.A)(We,this)}set advancedMode(e){(0,l.A)(We,this,e)}get dataList(){return(0,c.A)(De,this)}set dataList(e){(0,l.A)(De,this,e)}get editorPackages(){return(0,c.A)(Pe,this)}set editorPackages(e){(0,l.A)(Pe,this,e)}get links(){return(0,c.A)($e,this)}set links(e){(0,l.A)($e,this,e)}get extraLibs(){return(0,c.A)(Be,this)}set extraLibs(e){(0,l.A)(Be,this,e)}get childSlots(){return(0,c.A)(Ue,this)}set childSlots(e){(0,l.A)(Ue,this,e)}validate(){var e;const t=null===(e=(0,c.A)(Oe,this).current)||void 0===e?void 0:e.getFormInstance();(0,l.A)(Ge,this,null),t.validate().then((()=>{if(this.advancedMode)(0,s.A)(ze,this,ie).emit(t.values[W.qZ]);else{var e;const n=P().omit(t.values,[W.qZ]);t.notify(Te,n),(0,s.A)(ze,this,ie).emit(null!==(e=(0,c.A)(Ge,this))&&void 0!==e?e:n)}})).catch((e=>{(0,s.A)(ze,this,se).emit(e)}))}render(){return u().createElement(Me,{ref:(0,c.A)(Oe,this),editorName:this.editorName,values:(0,c.A)(Ze,this).call(this,this.values),advancedMode:this.advancedMode,dataList:this.dataList,extraLibs:this.extraLibs,links:this.links,childSlots:this.childSlots,editorPackages:this.editorPackages,handleValuesChange:(0,c.A)(Ke,this),handleTokenClick:(0,c.A)(Je,this),handleTriggerAction:(0,c.A)(Ye,this),onSubmitEffect:(0,c.A)(He,this)})}}function et(e,t){let{advancedMode:n,values:i,editorName:a,dataList:r,editorPackages:o,extraLibs:s,childSlots:l,links:c,handleValuesChange:d,handleTokenClick:h,handleTriggerAction:m,onSubmitEffect:y}=e;const[k,E]=(0,p.useState)(Ie),x=(0,w.useCurrentTheme)(),N=(0,p.useMemo)((()=>(0,A.VC)()),[]),M=(0,p.useMemo)((()=>(0,g.DG)()),[k]),T=(0,p.useRef)(null),C=(0,p.useRef)(!1),L=(0,p.useMemo)((()=>(0,g.fA)(Ce,((e,t)=>n=>{const i=!e&&t.values[W.qZ]?t.values[W.qZ]:t.values;T.current=n(e,t,i)}))),[]);(0,p.useImperativeHandle)(t,(()=>({getFormInstance:()=>M})));const I=(0,p.useCallback)((async()=>{R.customEditors.get(a)?E((()=>{var e;return null===(e=R.customEditors.get(a))||void 0===e?void 0:e(u())})):(await R.__secret_internals.loadEditors([a],o),Ie=()=>{var e;return null===(e=R.customEditors.get(a))||void 0===e?void 0:e(u())},E(Ie))}),[a,o]),S=(0,p.useCallback)(((e,t)=>{var n;if(t){const t=P().omit(e,[W.qZ]);return{[W.qZ]:P().isEmpty(t)?"":t}}return null!==(n=e[W.qZ])&&void 0!==n?n:e}),[]);return(0,p.useEffect)((()=>{I()}),[I]),(0,p.useEffect)((()=>{k&&M.setInitialValues(i,"overwrite")}),[k,M]),(0,p.useEffect)((()=>{var e;C.current=!0,T.current=null,M.notify(Ce,n),M.query(W.N4).take((e=>{e.display=n?"hidden":"visible"})),M.query(W.qZ).take((e=>{e.display=n?"visible":"hidden"}));const t=M.getState().values,i=S(null!==(e=T.current)&&void 0!==e?e:t,n);M.setValues(i,"overwrite"),C.current=!1}),[n,M,S,k]),(0,p.useEffect)((()=>{M.addEffects("onValueChange",(()=>{(0,g.A$)((e=>{C.current||d(e.values)}))}))}),[M,d]),k?u().createElement("div",{className:"property-form-wrapper"},u().createElement(b.Ay,{prefixCls:"antdV5",theme:{algorithm:"dark-v2"===x?f.A.darkAlgorithm:f.A.defaultAlgorithm,components:{InputNumber:{handleVisible:!0}}},getPopupContainer:e=>e},u().createElement(A.N7,{cache:N},u().createElement(v.Op,{form:M},u().createElement(k,{advancedMode:n,SchemaFieldComponent:Le,form:M,scope:{dataList:r,advancedMode:n,childSlots:l,extraLibs:s,links:c,tokenClick:e=>h(e.detail),triggerAction:m},effects:{onFieldInit:g.yd,onFieldValueChange:g.$l,onFieldInitialValueChange:g.J4,onFormInitialValuesChange:g.oJ,onFormValidateSuccess:g.zu,onFormValuesChange:g.A$,onSubmit:y,onAdvancedChange:L},formilySchemaFormatter:W.cV}))))):null}i=Qe,({e:[U,F,z,V,j,K,X,J,G,H,q,Y,Z,Q,ee,te,ne,ie,ae,re,oe,se,le,ce,de,pe,ue,he,me,ge,ve,be,fe,Ae,ye,we,$],c:[Se,B]}=(0,d.A)(i,[ke("visual-builder.property-editor",{shadowOptions:!1,dependencies:["eo-icon-select","vs.code-editor","eo-tooltip"]})],[[Ee(),1,"editorName"],[Ee({attribute:!1}),1,"values"],[Ee({type:Boolean}),1,"advancedMode"],[Ee({attribute:!1}),1,"dataList"],[Ee({attribute:!1}),1,"editorPackages"],[Ee({attribute:!1}),1,"links"],[Ee({attribute:!1}),1,"extraLibs"],[Ee({attribute:!1}),1,"childSlots"],[Ne({type:"validate.success"}),1,"successEvent",e=>(0,c.A)(Fe,e),(e,t)=>(0,l.A)(Fe,e,t)],[Ne({type:"validate.error"}),1,"errorEvent",e=>(0,c.A)(Ve,e),(e,t)=>(0,l.A)(Ve,e,t)],[xe(),2,"validate"],[Ne({type:"values.change"}),1,"valuesChangeEvent",e=>(0,c.A)(je,e),(e,t)=>(0,l.A)(je,e,t)],[Ne({type:"token.click"}),1,"tokenClick",e=>(0,c.A)(Xe,e),(e,t)=>(0,l.A)(Xe,e,t)],[Ne({type:"trigger.action"}),1,"triggerActionEvent",e=>(0,c.A)(qe,e),(e,t)=>(0,l.A)(qe,e,t)]],0,(e=>Ze.has((0,o.A)(e))),m.ReactNextElement)),B()},23831:(e,t,n)=>{var i,a=n(74635),r=n(70918),o=n(26902),s=n(5536),l=n(86121),c=n(70829),d=n(62740),p=n(18769),u=n.n(p),h=n(7921),m=n(11280),g=n(17180),v=n(69765),b=n(18013),f=n(53373),A=n.n(f);let y,w,k,E,x,N,M,T,C,L,I,S,O,_,R;const W=(0,m.wrapBrick)("eo-icon"),{defineElement:D,property:P,event:$}=(0,h.createDecorators)();let B;var U=new WeakMap,F=new WeakMap,z=new WeakMap,V=new WeakMap,j=new WeakSet,K=new WeakMap,X=new WeakMap,J=new WeakMap;class G extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,j),(0,r.A)(this,U,w(this)),(0,r.A)(this,F,(k(this),E(this))),(0,r.A)(this,z,(x(this),N(this))),(0,r.A)(this,V,(M(this),T(this))),(0,r.A)(this,K,(I(this),e=>{e!==this.active&&(this.active=e,(0,s.A)(j,this,C).emit(e))})),(0,r.A)(this,X,S(this)),(0,r.A)(this,J,(R(this),()=>{(0,s.A)(j,this,O).emit()}))}get titleLabel(){return(0,c.A)(U,this)}set titleLabel(e){(0,l.A)(U,this,e)}get active(){return(0,c.A)(F,this)}set active(e){(0,l.A)(F,this,e)}get badge(){return(0,c.A)(z,this)}set badge(e){(0,l.A)(z,this,e)}render(){return u().createElement(H,{titleLabel:this.titleLabel,active:this.active,badge:this.badge,onActiveChange:(0,c.A)(K,this),onFirstActivated:(0,c.A)(J,this)})}}function H(e){let{titleLabel:t,active:n,badge:i,onActiveChange:a,onFirstActivated:r}=e;const[o,s]=(0,p.useState)(n),[l,c]=(0,p.useState)(!1);(0,p.useEffect)((()=>{s(n)}),[n]),(0,p.useEffect)((()=>{null==a||a(o)}),[o,a]);const d=(0,p.useCallback)((()=>{s((e=>!e)),l||o||(c(!0),null==r||r())}),[l,o,r]),h=(0,p.useRef)(),[m,g]=(0,p.useState)(!1),v=(0,p.useMemo)((()=>(0,b.G)((()=>{g(h.current.scrollTop>0)}))),[]);return u().createElement("div",{className:A()("pane",{scrolled:m})},u().createElement("div",{className:"pane-header",tabIndex:0,onClick:d},u().createElement("div",{className:"pane-title"},u().createElement("span",{className:"title-icon"},o?u().createElement(W,{lib:"antd",theme:"outlined",icon:"down"}):u().createElement(W,{lib:"antd",theme:"outlined",icon:"right"})),u().createElement("div",{className:"title-label"},t),u().createElement("slot",{name:"title"})),u().createElement("slot",{name:"actions"}),i&&u().createElement("div",{className:"badge"},i),u().createElement("div",{className:"pane-scroll-shadow"})),u().createElement("div",{className:"pane-body custom-scrollbar-container",onScroll:v,ref:h},u().createElement("slot",null,u().createElement("div",{style:{padding:"10px 20px",color:"var(--text-color-secondary)"}},"No content"))))}i=G,({e:[w,k,E,x,N,M,T,C,L,I,S,O,_,R],c:[B,y]}=(0,d.A)(i,[D("visual-builder.workbench-pane",{styleTexts:[g.A,v.A]})],[[P(),1,"titleLabel"],[P({type:Boolean}),1,"active"],[P({type:Number}),1,"badge"],[$({type:"active.change"}),1,"activeChangeEvent",e=>(0,c.A)(V,e),(e,t)=>(0,l.A)(V,e,t)],[$({type:"active.firstActivated"}),1,"activeFirstActivatedEvent",e=>(0,c.A)(X,e),(e,t)=>(0,l.A)(X,e,t)]],0,(e=>J.has((0,o.A)(e))),m.ReactNextElement)),y();var q,Y=n(24586),Z=n(92150);let Q,ee,te;const{defineElement:ne,property:ie}=(0,h.createDecorators)();let ae;var re=new WeakMap,oe=new WeakMap,se=new WeakMap,le=new WeakMap;class ce extends m.ReactNextElement{constructor(){super(...arguments),(0,r.A)(this,re,ee(this)),(0,r.A)(this,oe,(te(this),()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("slot:not([name])")})),(0,r.A)(this,se,(()=>{const e=(0,c.A)(oe,this).call(this).assignedNodes();for(const n of e){var t;n.active?n.style.flex=String(null!==(t=n.activeFlex)&&void 0!==t?t:"1"):n.style.flex="initial"}})),(0,r.A)(this,le,(e=>{const t=e.target.assignedNodes();for(const e of t)e.addEventListener("active.change",(0,c.A)(se,this))})),(0,Y.A)(this,"refCallback",(()=>{(0,c.A)(se,this).call(this);const e=(0,c.A)(oe,this).call(this);null==e||e.addEventListener("slotchange",(e=>{(0,c.A)(le,this).call(this,e)}))}))}get titleLabel(){return(0,c.A)(re,this)}set titleLabel(e){(0,l.A)(re,this,e)}render(){return u().createElement(de,{titleLabel:this.titleLabel,refCallback:this.refCallback})}}function de(e){let{titleLabel:t,refCallback:n}=e;return u().createElement("div",{className:"sidebar",ref:n},u().createElement("div",{className:"title-container"},u().createElement("div",{className:"title-label"},t),u().createElement("slot",{name:"titleToolbar"})),u().createElement("div",{className:"pane-container"},u().createElement("slot",null)))}q=ce,({e:[ee,te],c:[ae,Q]}=(0,d.A)(q,[ne("visual-builder.workbench-sidebar",{styleTexts:[Z.A]})],[[ie(),1,"titleLabel"]],0,void 0,m.ReactNextElement)),Q();var pe=n(72591),ue=n.n(pe),he=n(1740),me=n.n(he),ge=n(88128),ve=n.n(ge),be=n(30855),fe=n.n(be),Ae=n(93051),ye=n.n(Ae),we=n(73656),ke=n.n(we),Ee=n(32984),xe={};xe.styleTagTransform=ke(),xe.setAttributes=fe(),xe.insert=ve().bind(null,"head"),xe.domAPI=me(),xe.insertStyleElement=ye(),ue()(Ee.A,xe),Ee.A&&Ee.A.locals&&Ee.A.locals;var Ne,Me=n(5292);let Te,Ce,Le,Ie,Se,Oe,_e,Re,We,De,Pe,$e,Be;const{defineElement:Ue,property:Fe}=(0,h.createDecorators)(),ze=(0,m.wrapBrick)("eo-link"),Ve=(0,m.wrapBrick)("eo-icon"),je=(0,m.wrapBrick)("eo-tooltip");let Ke;var Xe=new WeakMap,Je=new WeakMap,Ge=new WeakMap,He=new WeakMap,qe=new WeakMap,Ye=new WeakMap;class Ze extends m.ReactNextElement{constructor(){super(...arguments),(0,r.A)(this,Xe,Ce(this)),(0,r.A)(this,Je,(Le(this),Ie(this))),(0,r.A)(this,Ge,(Se(this),Oe(this))),(0,r.A)(this,He,(_e(this),Re(this))),(0,r.A)(this,qe,(We(this),De(this))),(0,r.A)(this,Ye,(Pe(this),$e(this))),Be(this)}get icon(){return(0,c.A)(Xe,this)}set icon(e){(0,l.A)(Xe,this,e)}get to(){return(0,c.A)(Je,this)}set to(e){(0,l.A)(Je,this,e)}get active(){return(0,c.A)(Ge,this)}set active(e){(0,l.A)(Ge,this,e)}get href(){return(0,c.A)(He,this)}set href(e){(0,l.A)(He,this,e)}get target(){return(0,c.A)(qe,this)}set target(e){(0,l.A)(qe,this,e)}get tooltip(){return(0,c.A)(Ye,this)}set tooltip(e){(0,l.A)(Ye,this,e)}render(){return u().createElement(Qe,{to:this.to,icon:this.icon,active:this.active,href:this.href,target:this.target,tooltip:this.tooltip})}}function Qe(e){let{icon:t,to:n,active:i,href:a,target:r,tooltip:o}=e;return u().createElement(je,{content:o,placement:"right"},u().createElement(ze,{className:A()("action",{active:i}),url:n,href:a,target:r},u().createElement(Ve,t)))}Ne=Ze,({e:[Ce,Le,Ie,Se,Oe,_e,Re,We,De,Pe,$e,Be],c:[Ke,Te]}=(0,d.A)(Ne,[Ue("visual-builder.workbench-action",{styleTexts:[Me.A]})],[[Fe({attribute:!1}),1,"icon"],[Fe(),1,"to"],[Fe({type:Boolean}),1,"active"],[Fe(),1,"href"],[Fe(),1,"target"],[Fe(),1,"tooltip"]],0,void 0,m.ReactNextElement)),Te();var et=n(23081),tt=n(63),nt=n(70607),it={};it.styleTagTransform=ke(),it.setAttributes=fe(),it.insert=ve().bind(null,"head"),it.domAPI=me(),it.insertStyleElement=ye(),ue()(nt.A,it),nt.A&&nt.A.locals&&nt.A.locals;var at,rt=n(73430);let ot,st,lt,ct,dt;const pt=(0,m.wrapBrick)("visual-builder.workbench-action"),{defineElement:ut,property:ht}=(0,h.createDecorators)();let mt;var gt=new WeakMap,vt=new WeakMap;class bt extends m.ReactNextElement{constructor(){super(...arguments),(0,r.A)(this,gt,st(this)),(0,r.A)(this,vt,(lt(this),ct(this))),dt(this)}get appId(){return(0,c.A)(gt,this)}set appId(e){(0,l.A)(gt,this,e)}get menu(){return(0,c.A)(vt,this)}set menu(e){(0,l.A)(vt,this,e)}render(){return u().createElement(yt,{appId:this.appId,menu:this.menu})}}let ft;at=bt,({e:[st,lt,ct,dt],c:[mt,ot]}=(0,d.A)(at,[ut("visual-builder.workbench-action-list",{styleTexts:[rt.A]})],[[ht(),1,"appId"],[ht({attribute:!1}),1,"menu"]],0,void 0,m.ReactNextElement)),ot();const At=new Map;function yt(e){var t;let{appId:n,menu:i}=e;const a=(0,et.getHistory)(),[r,o]=(0,p.useState)(),[s,l]=(0,p.useState)(a.location);return(0,p.useEffect)((()=>{const e=a.listen((e=>{l(e)}));return e}),[a]),(0,p.useEffect)((()=>{ft||(ft=n),ft!==n&&(At.clear(),ft=n)}),[n]),(0,p.useEffect)((()=>{var e;const{pathname:t,search:n}=s,{selectedKeys:a}=(0,tt.LP)(null!==(e=null==i?void 0:i.menuItems)&&void 0!==e?e:[],t,n,"");o(Number(a[0]))}),[i,s]),u().createElement(u().Fragment,null,null==i||null===(t=i.menuItems)||void 0===t?void 0:t.map(((e,t)=>{if((e=>"default"===e.type||!e.type)(e)){let n=e.to;return r!==t&&At.has(t)&&(n=At.get(t)),u().createElement(pt,{key:t,icon:e.icon,to:n,href:e.href,target:e.target,tooltip:e.text,active:r===t,onClick:()=>(e=>{e.href||At.set(r,`${s.pathname}${s.search}`)})(e)})}})).filter(Boolean))}var wt,kt=n(41030),Et=n(62559),xt=n(67758),Nt=n(9406),Mt=n(70675),Tt=n(47995),Ct=n(96275);let Lt,It,St,Ot,_t,Rt,Wt,Dt,Pt,$t,Bt,Ut,Ft,zt,Vt,jt,Kt,Xt,Jt,Gt,Ht,qt,Yt,Zt,Qt,en,tn,nn,an,rn,on,sn,ln,cn,dn,pn,un,hn,mn,gn,vn,bn,fn,An,yn,wn,kn,En,xn,Nn,Mn,Tn,Cn,Ln,In,Sn,On;function _n(e){return e.key}n(65168);const{defineElement:Rn,property:Wn,event:Dn}=(0,h.createDecorators)();let Pn;var $n=new WeakMap,Bn=new WeakMap,Un=new WeakMap,Fn=new WeakMap,zn=new WeakMap,Vn=new WeakMap,jn=new WeakMap,Kn=new WeakMap,Xn=new WeakMap,Jn=new WeakMap,Gn=new WeakMap,Hn=new WeakMap,qn=new WeakMap,Yn=new WeakMap,Zn=new WeakMap,Qn=new WeakMap,ei=new WeakMap,ti=new WeakMap,ni=new WeakMap,ii=new WeakSet,ai=new WeakMap,ri=new WeakMap,oi=new WeakMap,si=new WeakMap,li=new WeakMap,ci=new WeakMap,di=new WeakMap,pi=new WeakMap,ui=new WeakMap;class hi extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,ii),(0,r.A)(this,$n,It(this)),(0,r.A)(this,Bn,(St(this),Ot(this))),(0,r.A)(this,Un,(_t(this),Rt(this))),(0,r.A)(this,Fn,(Wt(this),Dt(this))),(0,r.A)(this,zn,(Pt(this),$t(this))),(0,r.A)(this,Vn,(Bt(this),Ut(this))),(0,r.A)(this,jn,(Ft(this),zt(this))),(0,r.A)(this,Kn,(Vt(this),jt(this))),(0,r.A)(this,Xn,(Kt(this),Xt(this))),(0,r.A)(this,Jn,(Jt(this),Gt(this))),(0,r.A)(this,Gn,(Ht(this),qt(this))),(0,r.A)(this,Hn,(Yt(this),Zt(this))),(0,r.A)(this,qn,(Qt(this),en(this))),(0,r.A)(this,Yn,(tn(this),nn(this))),(0,r.A)(this,Zn,(an(this),rn(this))),(0,r.A)(this,Qn,(on(this),sn(this))),(0,r.A)(this,ei,(ln(this),cn(this))),(0,r.A)(this,ti,(dn(this),pn(this))),(0,r.A)(this,ni,(un(this),hn(this))),(0,r.A)(this,ai,(vn(this),e=>{(0,s.A)(ii,this,mn).emit(e)})),(0,r.A)(this,ri,bn(this)),(0,r.A)(this,oi,(yn(this),e=>()=>{(0,s.A)(ii,this,fn).emit(e.data)})),(0,r.A)(this,si,wn(this)),(0,r.A)(this,li,(xn(this),e=>{(0,s.A)(ii,this,kn).emit(e)})),(0,r.A)(this,ci,Nn(this)),(0,r.A)(this,di,(Cn(this),e=>t=>{t.preventDefault(),(0,s.A)(ii,this,Mn).emit({active:!0,node:null==e?void 0:e.data,x:t.clientX,y:t.clientY})})),(0,r.A)(this,pi,Ln(this)),(0,r.A)(this,ui,(On(this),(e,t)=>{(0,s.A)(ii,this,In).emit({nodeId:e,collapsed:t})}))}get nodes(){return(0,c.A)($n,this)}set nodes(e){(0,l.A)($n,this,e)}get actions(){return(0,c.A)(Bn,this)}set actions(e){(0,l.A)(Bn,this,e)}get actionsHidden(){return(0,c.A)(Un,this)}set actionsHidden(e){(0,l.A)(Un,this,e)}get placeholder(){return(0,c.A)(Fn,this)}set placeholder(e){(0,l.A)(Fn,this,e)}get isTransformName(){return(0,c.A)(zn,this)}set isTransformName(e){(0,l.A)(zn,this,e)}get searchPlaceholder(){return(0,c.A)(Vn,this)}set searchPlaceholder(e){(0,l.A)(Vn,this,e)}get noSearch(){return(0,c.A)(jn,this)}set noSearch(e){(0,l.A)(jn,this,e)}get activeKey(){return(0,c.A)(Kn,this)}set activeKey(e){(0,l.A)(Kn,this,e)}get showMatchedNodeOnly(){return(0,c.A)(Xn,this)}set showMatchedNodeOnly(e){(0,l.A)(Xn,this,e)}get matchNodeDataFields(){return(0,c.A)(Jn,this)}set matchNodeDataFields(e){(0,l.A)(Jn,this,e)}get fixedActionsFor(){return(0,c.A)(Gn,this)}set fixedActionsFor(e){(0,l.A)(Gn,this,e)}get collapsible(){return(0,c.A)(Hn,this)}set collapsible(e){(0,l.A)(Hn,this,e)}get collapsedNodes(){return(0,c.A)(qn,this)}set collapsedNodes(e){(0,l.A)(qn,this,e)}get allowDrag(){return(0,c.A)(Yn,this)}set allowDrag(e){(0,l.A)(Yn,this,e)}get allowDragToRoot(){return(0,c.A)(Zn,this)}set allowDragToRoot(e){(0,l.A)(Zn,this,e)}get allowDragToInside(){return(0,c.A)(Qn,this)}set allowDragToInside(e){(0,l.A)(Qn,this,e)}get nodeKey(){return(0,c.A)(ei,this)}set nodeKey(e){(0,l.A)(ei,this,e)}get skipNotify(){return(0,c.A)(ti,this)}set skipNotify(e){(0,l.A)(ti,this,e)}render(){return u().createElement(Et.e.Provider,{value:{actions:this.actions,actionsHidden:this.actionsHidden,onActionClick:(0,c.A)(ai,this)}},u().createElement(Nt.N.Provider,{value:{activeKey:this.activeKey,basePaddingLeft:5,showMatchedNodeOnly:this.showMatchedNodeOnly,isTransformName:this.isTransformName,fixedActionsFor:this.fixedActionsFor,nodeKey:this.nodeKey,collapsible:this.collapsible,collapsedNodes:this.collapsedNodes,getCollapsedId:_n,onNodeToggle:(0,c.A)(ui,this),skipNotify:this.skipNotify,clickFactory:(0,c.A)(oi,this),contextMenuFactory:(0,c.A)(di,this),matchNode:(e,t)=>{var n;return(0,Mt.U)(e.name,t)||!(null===(n=this.matchNodeDataFields)||void 0===n||!n.length)&&(0,Mt.U)("*"===this.matchNodeDataFields?e.data:(0,kt.pick)(e.data,this.matchNodeDataFields),t)}}},u().createElement(xt.cU,{nodes:this.nodes,placeholder:this.placeholder,searchPlaceholder:this.searchPlaceholder,noSearch:this.noSearch,dropEmit:(0,c.A)(li,this),allowDrag:this.allowDrag,allowDragToInside:this.allowDragToInside,allowDragToRoot:this.allowDragToRoot})))}}wt=hi,({e:[It,St,Ot,_t,Rt,Wt,Dt,Pt,$t,Bt,Ut,Ft,zt,Vt,jt,Kt,Xt,Jt,Gt,Ht,qt,Yt,Zt,Qt,en,tn,nn,an,rn,on,sn,ln,cn,dn,pn,un,hn,mn,gn,vn,bn,fn,An,yn,wn,kn,En,xn,Nn,Mn,Tn,Cn,Ln,In,Sn,On],c:[Pn,Lt]}=(0,d.A)(wt,[Rn("visual-builder.workbench-tree",{styleTexts:[Tt.A,Ct.A]})],[[Wn({attribute:!1}),1,"nodes"],[Wn({attribute:!1}),1,"actions"],[Wn({type:Boolean}),1,"actionsHidden"],[Wn(),1,"placeholder"],[Wn({type:Boolean}),1,"isTransformName"],[Wn(),1,"searchPlaceholder"],[Wn({type:Boolean}),1,"noSearch"],[Wn({attribute:!1}),1,"activeKey"],[Wn({type:Boolean}),1,"showMatchedNodeOnly"],[Wn({attribute:!1}),1,"matchNodeDataFields"],[Wn({attribute:!1}),1,"fixedActionsFor"],[Wn({type:Boolean}),1,"collapsible"],[Wn({attribute:!1}),1,"collapsedNodes"],[Wn({type:Boolean}),1,"allowDrag"],[Wn({type:Boolean}),1,"allowDragToRoot"],[Wn({type:Boolean}),1,"allowDragToInside"],[Wn({type:String}),1,"nodeKey"],[Wn({type:Boolean}),1,"skipNotify"],[Dn({type:"action.click"}),1,"actionClickEvent",e=>(0,c.A)(ni,e),(e,t)=>(0,l.A)(ni,e,t)],[Dn({type:"node.click"}),1,"nodeClickEvent",e=>(0,c.A)(ri,e),(e,t)=>(0,l.A)(ri,e,t)],[Dn({type:"node.drop"}),1,"nodeDropEvent",e=>(0,c.A)(si,e),(e,t)=>(0,l.A)(si,e,t)],[Dn({type:"context.menu"}),1,"nodeContextMenuEvent",e=>(0,c.A)(ci,e),(e,t)=>(0,l.A)(ci,e,t)],[Dn({type:"node.toggle"}),1,"nodeToggleEvent",e=>(0,c.A)(pi,e),(e,t)=>(0,l.A)(pi,e,t)]],0,(e=>ui.has((0,o.A)(e))),m.ReactNextElement)),Lt();var mi=n(21302),gi=n.n(mi),vi=n(91361),bi=n(69704);let fi=function(e){return e.LOAD_MORE="LOAD_MORE",e.LOADING="LOADING",e.NO_DATA="NO_DATA",e.NODE="NODE",e.ADD="ADD",e.EDIT="EDIT",e.DELETE="DELETE",e.IMPORT="IMPORT",e.CLONE="CLONE",e.APPEND_RELATION="APPEND_RELATION",e.UPDATE_RELATION="UPDATE_RELATION",e.REMOVE_RELATION="REMOVE_RELATION",e.ROLLBACK="ROLLBACK",e.ROLLBACK_ALL="ROLLBACK_ALL",e.ADD_FULL="ADD_FULL",e.EDIT_FULL="EDIT_FULL",e.DELETE_FULL="DELETE_FULL",e.IMPORT_FULL="IMPORT_FULL",e.CLONE_FULL="CLONE_FULL",e.APPEND_RELATION_FULL="APPEND_RELATION_FULL",e.UPDATE_RELATION_FULL="UPDATE_RELATION_FULL",e.REMOVE_RELATION_FULL="REMOVE_RELATION_FULL",e.ROLLBACK_FULL="ROLLBACK_FULL",e.ROLLBACK_ALL_FULL="ROLLBACK_ALL_FULL",e.PROJECT="PROJECT",e.USER="USER",e.PERMISSION="PERMISSION",e.BRICK="BRICK",e.ROUTE="ROUTE",e.TEMPLATE="TEMPLATE",e.SNIPPET="SNIPPET",e.I18N="I18N",e.IMAGE="IMAGE",e.FUNCTION="FUNCTION",e.MENU="MENU",e.MENU_ITEM="MENU_ITEM",e.WORKFLOW="WORKFLOW",e}({});const Ai="bricks/visual-builder/workbench-history-action";var yi=n(34107),wi=n(99733);const ki={add:`${Ai}:${fi.ADD}`,edit:`${Ai}:${fi.EDIT}`,delete:`${Ai}:${fi.DELETE}`,batch_delete:`${Ai}:${fi.DELETE}`,import:`${Ai}:${fi.IMPORT}`,clone:`${Ai}:${fi.CLONE}`,append_relation:`${Ai}:${fi.APPEND_RELATION}`,update_relation:`${Ai}:${fi.UPDATE_RELATION}`,remove_relation:`${Ai}:${fi.REMOVE_RELATION}`,rollback:`${Ai}:${fi.ROLLBACK}`,rollback_all:`${Ai}:${fi.ROLLBACK_ALL}`},Ei={add:`${Ai}:${fi.ADD_FULL}`,edit:`${Ai}:${fi.EDIT_FULL}`,delete:`${Ai}:${fi.DELETE_FULL}`,batch_delete:`${Ai}:${fi.DELETE_FULL}`,import:`${Ai}:${fi.IMPORT_FULL}`,clone:`${Ai}:${fi.CLONE_FULL}`,append_relation:`${Ai}:${fi.APPEND_RELATION_FULL}`,update_relation:`${Ai}:${fi.UPDATE_RELATION_FULL}`,remove_relation:`${Ai}:${fi.REMOVE_RELATION_FULL}`,rollback:`${Ai}:${fi.ROLLBACK_FULL}`,rollback_all:`${Ai}:${fi.ROLLBACK_ALL_FULL}`},xi={project:`${Ai}:${fi.PROJECT}`,userGroup:`${Ai}:${fi.USER}`,permission:`${Ai}:${fi.PERMISSION}`,brick:`${Ai}:${fi.BRICK}`,route:`${Ai}:${fi.ROUTE}`,template:`${Ai}:${fi.TEMPLATE}`,snippet:`${Ai}:${fi.SNIPPET}`,i18n:`${Ai}:${fi.I18N}`,image:`${Ai}:${fi.IMAGE}`,function:`${Ai}:${fi.FUNCTION}`,menu:`${Ai}:${fi.MENU}`,menuItem:`${Ai}:${fi.MENU_ITEM}`,workflow:`${Ai}:${fi.WORKFLOW}`},Ni={PROJECT_MICRO_APP:`${Ai}:${fi.PROJECT}`,"MICRO_APP_USER_GROUP@EASYOPS":`${Ai}:${fi.USER}`,MICRO_APP_RESOURCE_PERMISSION:`${Ai}:${fi.PERMISSION}`,STORYBOARD_BRICK:`${Ai}:${fi.BRICK}`,STORYBOARD_ROUTE:`${Ai}:${fi.ROUTE}`,STORYBOARD_TEMPLATE:`${Ai}:${fi.TEMPLATE}`,STORYBOARD_SNIPPET:`${Ai}:${fi.SNIPPET}`,STORYBOARD_I18N:`${Ai}:${fi.I18N}`,MICRO_APP_RESOURCE_IMAGE:`${Ai}:${fi.IMAGE}`,STORYBOARD_FUNCTION:`${Ai}:${fi.FUNCTION}`,MICRO_APP_RESOURCE_MENU:`${Ai}:${fi.MENU}`,MICRO_APP_RESOURCE_MENU_ITEM:`${Ai}:${fi.MENU_ITEM}`,"WORKFLOW_DEF@EASYOPS":`${Ai}:${fi.WORKFLOW}`};function Mi(e){var t,n,i,a,r,o,s,l,c,d,p,u,h,m,g,v,b;const f="rollback"!==e.action||e.rollBackIdInfo?e.action:"rollback_all",A=wi.i18n.t(null!==(t=xi[e.category])&&void 0!==t?t:e.category),y=wi.i18n.t(null!==(n=ki[f])&&void 0!==n?n:f),w=wi.i18n.t(null!==(i=Ni[null===(a=e.abstract)||void 0===a?void 0:a.leftObjectId])&&void 0!==i?i:null===(r=e.abstract)||void 0===r?void 0:r.leftObjectId),k=wi.i18n.t(null!==(o=Ni[null===(s=e.abstract)||void 0===s?void 0:s.rightObjectId])&&void 0!==o?o:null===(l=e.abstract)||void 0===l?void 0:l.rightObjectId),E=Ti(null===(c=e.abstract)||void 0===c?void 0:c.nodes,null===(d=e.abstract)||void 0===d?void 0:d.nodesCount),x=Ti(null===(p=e.abstract)||void 0===p?void 0:p.leftNodes,null===(u=e.abstract)||void 0===u?void 0:u.leftNodesCount),N=Ti(null===(h=e.abstract)||void 0===h?void 0:h.rightNodes,null===(m=e.abstract)||void 0===m?void 0:m.rightNodesCount),M="rollback"===f?Mi(e.rollBackIdInfo).abstract:null;return{category:A,action:y,leftObjectId:w,rightObjectId:k,nodes:E,leftNodes:x,rightNodes:N,abstract:wi.i18n.t(null!==(g=Ei[f])&&void 0!==g?g:f,{category:A,nodes:E,leftNodes:x,rightNodes:N,nodeChanges:null===(v=e.abstract)||void 0===v||null===(v=v.nodeChanges)||void 0===v?void 0:v.join(", "),relationChanges:null===(b=e.abstract)||void 0===b||null===(b=b.relationChanges)||void 0===b?void 0:b.join(", "),leftObjectId:w,rightObjectId:k,rollbackAbstract:M}),rollbackAbstract:M}}function Ti(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:", ";return wi.i18n.t(`${Ai}:${fi.NODE}`,{nodes:e.join(n),context:t>e.length?"ellipsis":void 0,count:t})}var Ci;let Li,Ii,Si,Oi,_i,Ri,Wi,Di,Pi,$i,Bi,Ui,Fi,zi,Vi,ji,Ki;(0,bi.initializeReactI18n)(Ai,{en:{LOAD_MORE:"Load more",LOADING:"Loading",NO_DATA:"No data",NODE:"{{ nodes }}",NODE_ellipsis:"{{ nodes }} etc., a total of {{ count }} items",ADD:"Add node",EDIT:"Edit node",DELETE:"Delete node",IMPORT:"Batch import node",CLONE:"Clone node",APPEND_RELATION:"Append Relation",UPDATE_RELATION:"Update Relation",REMOVE_RELATION:"Remove Relation",ROLLBACK:"Rollback",ROLLBACK_ALL:"Rollback all operations",ADD_FULL:"Add {{ category }} ({{ nodes }})",EDIT_FULL:"Edit {{ nodeChanges }} of {{ category }} ({{ nodes }})",DELETE_FULL:"Delete {{ category }} ({{ nodes }})",IMPORT_FULL:"Batch Import {{ category }} ({{ nodes }})",CLONE_FULL:"Clone {{ category }} ({{ nodes }})",APPEND_RELATION_FULL:"Append the relation between {{ leftObjectId }} ({{ leftNodes }}) and {{ rightObjectId }} ({{ rightNodes }})",UPDATE_RELATION_FULL:"Update the relation between {{ leftObjectId }} ({{ leftNodes }}) and {{ rightObjectId }} ({{ rightNodes }})",REMOVE_RELATION_FULL:"Remove the relation between {{ leftObjectId }} ({{ leftNodes }}) and {{ rightObjectId }} ({{ rightNodes }})",ROLLBACK_FULL:"Rollback to [{{ rollbackAbstract }}]",ROLLBACK_ALL_FULL:"Rollback all operations",PROJECT:"Project",USER:"User Group",PERMISSION:"Permission",BRICK:"Brick",ROUTE:"Route",TEMPLATE:"Template",SNIPPET:"Snippet",I18N:"I18N",IMAGE:"Image",FUNCTION:"Function",MENU:"Menu",MENU_ITEM:"Menu item",WORKFLOW:"Workflow"},zh:{LOAD_MORE:"加载更多",LOADING:"加载中",NO_DATA:"没有数据",NODE:"{{ nodes }}",NODE_ellipsis:"{{ nodes }}等共{{ count }}项",ADD:"新增节点",EDIT:"编辑节点",DELETE:"删除节点",IMPORT:"批量导入节点",CLONE:"克隆节点",APPEND_RELATION:"添加关系",UPDATE_RELATION:"更新关系",REMOVE_RELATION:"移除关系",ROLLBACK:"回滚",ROLLBACK_ALL:"回滚全部操作",ADD_FULL:"新增{{ category }}({{ nodes }})",EDIT_FULL:"编辑{{ category }}({{ nodes }})的 {{ nodeChanges }}",DELETE_FULL:"删除{{ category }}({{ nodes }})",IMPORT_FULL:"批量导入{{ category }}({{ nodes }})",CLONE_FULL:"克隆{{ category }}({{ nodes }})",APPEND_RELATION_FULL:"添加{{ leftObjectId }}({{ leftNodes }})和{{ rightObjectId }}({{ rightNodes }})的关系",UPDATE_RELATION_FULL:"更新{{ leftObjectId }}({{ leftNodes }})和{{ rightObjectId }}({{ rightNodes }})的关系",REMOVE_RELATION_FULL:"移除{{ leftObjectId }}({{ leftNodes }})和{{ rightObjectId }}({{ rightNodes }})的关系",ROLLBACK_FULL:"回滚到【{{ rollbackAbstract }}】",ROLLBACK_ALL_FULL:"回滚全部操作",PROJECT:"项目",USER:"用户组",PERMISSION:"权限点",BRICK:"构件",ROUTE:"路由",TEMPLATE:"模版",SNIPPET:"片段",I18N:"国际化",IMAGE:"图片",FUNCTION:"函数",MENU:"菜单",MENU_ITEM:"菜单项",WORKFLOW:"工作流"}});const{defineElement:Xi,property:Ji,event:Gi}=(0,h.createDecorators)(),Hi=(0,m.wrapBrick)("eo-button"),qi=(0,m.wrapBrick)("eo-link"),Yi=(0,m.wrapBrick)("eo-icon"),Zi=(0,m.wrapBrick)("eo-easyops-avatar"),Qi=(0,m.wrapBrick)("eo-popover",{onVisibleChange:"visible.change",onBeforeVisibleChange:"before.visible.change"});let ea;var ta=new WeakMap,na=new WeakMap,ia=new WeakMap,aa=new WeakSet,ra=new WeakMap,oa=new WeakMap,sa=new WeakMap,la=new WeakMap,ca=new WeakMap;class da extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,aa),(0,r.A)(this,ta,Ii(this)),(0,r.A)(this,na,(Si(this),Oi(this))),(0,r.A)(this,ia,(_i(this),Ri(this))),(0,r.A)(this,ra,(Pi(this),e=>{(0,s.A)(aa,this,Wi).emit(e)})),(0,r.A)(this,oa,$i(this)),(0,r.A)(this,sa,(Fi(this),e=>{(0,s.A)(aa,this,Bi).emit(e)})),(0,r.A)(this,la,zi(this)),(0,r.A)(this,ca,(Ki(this),()=>{(0,s.A)(aa,this,Vi).emit()}))}get appId(){return(0,c.A)(ta,this)}set appId(e){(0,l.A)(ta,this,e)}get projectId(){return(0,c.A)(na,this)}set projectId(e){(0,l.A)(na,this,e)}render(){return u().createElement(pa,{appId:this.appId,projectId:this.projectId,onHistoryItemClick:(0,c.A)(ra,this),onRollback:(0,c.A)(sa,this),onRollbackAll:(0,c.A)(ca,this)})}}function pa(e){const{appId:t,onHistoryItemClick:n,onRollback:i,onRollbackAll:a}=e,{t:r}=(0,bi.useTranslation)(Ai),[o,s]=(0,p.useState)(!1),[l,c]=(0,p.useState)(!0),[d,h]=(0,p.useState)(!1),[m,g]=(0,p.useState)([]),v=(0,p.useRef)(""),b=e=>{s(!0),(0,yi.R)(t,{ts:v.current,limit:20}).then((t=>{g((n=>{const i=t.list.map((e=>({...e,translation:Mi(e)})));return e?i:n.concat(i)})),v.current=t.ts,h(t.list.length<20),c(t.list.length<20)})).catch((e=>{(0,et.handleHttpError)(e)})).finally((()=>{s(!1)}))};return u().createElement(Qi,{placement:"bottom",trigger:"click",arrow:!0,arrowColor:"var(--color-fill-bg-container-4)",onBeforeVisibleChange:e=>{e.detail&&(c(!0),h(!1),g([]),v.current="",b(!0))}},u().createElement(Hi,{slot:"anchor",shape:"circle",className:"history-action",icon:{lib:"antd",icon:"history",theme:"outlined"}}),u().createElement("div",null,u().createElement("div",{className:"history-title"},"History"),u().createElement("div",{className:"history-list"},m.length?u().createElement(u().Fragment,null,m.map(((e,t)=>u().createElement(ua,{key:`${e.uniqueKey}-${e.ts}`,data:e,enableRollback:0!==t&&"rollback"!==e.action,current:0===t,onHistoryItemClick:n,onRollback:i}))),!l&&u().createElement("span",{className:"load-more-container"},u().createElement(qi,{className:"load-more",disabled:o,onClick:()=>b()},r(fi.LOAD_MORE))),d&&u().createElement("span",{className:"end-container"},"The End",u().createElement(Yi,{className:"rollback-all",lib:"antd",icon:"rollback",theme:"outlined",onClick:()=>a()}))):u().createElement("div",{className:"empty"},r(o?fi.LOADING:fi.NO_DATA))),u().createElement("slot",null)))}function ua(e){const{data:t,enableRollback:n,current:i,onHistoryItemClick:a,onRollback:r}=e,o=gi()(Number(t.ts)/1e6),s=gi().duration(o.diff(gi()())),l=s.days()<=-1?o.format("YYYY-MM-DD HH:mm:ss"):s.humanize(!0,{ss:0,s:60,m:60,h:24});return u().createElement("div",{className:"item-container"},u().createElement("div",{className:"item-title"},u().createElement("div",{className:"title-left",onClick:()=>a({...t,enableRollback:n})},u().createElement("div",{className:"topic",title:t.translation.abstract},t.translation.abstract),i&&u().createElement("div",{className:"branch"},"(current)")),u().createElement("div",{className:"title-right"},n&&u().createElement(Yi,{className:"rollback",lib:"antd",icon:"rollback",theme:"outlined",onClick:()=>r(t)}))),u().createElement("div",{className:"item-info"},u().createElement(Zi,{className:"avatar",nameOrInstanceId:t.user,size:"xs"}),u().createElement("div",{className:"time"},l),u().createElement("div",{className:"operator"},t.user)))}Ci=da,({e:[Ii,Si,Oi,_i,Ri,Wi,Di,Pi,$i,Bi,Ui,Fi,zi,Vi,ji,Ki],c:[ea,Li]}=(0,d.A)(Ci,[Xi("visual-builder.workbench-history-action",{styleTexts:[vi.A]})],[[Ji(),1,"appId"],[Ji(),1,"projectId"],[Gi({type:"history.item.click"}),1,"historyItemClickEvent",e=>(0,c.A)(ia,e),(e,t)=>(0,l.A)(ia,e,t)],[Gi({type:"rollback"}),1,"rollbackEvent",e=>(0,c.A)(oa,e),(e,t)=>(0,l.A)(oa,e,t)],[Gi({type:"rollback.all"}),1,"rollbackAllEvent",e=>(0,c.A)(la,e),(e,t)=>(0,l.A)(la,e,t)]],0,(e=>ca.has((0,o.A)(e))),m.ReactNextElement)),Li();var ha,ma=n(62381);let ga,va,ba,fa,Aa,ya,wa,ka,Ea,xa,Na,Ma,Ta,Ca,La,Ia,Sa,Oa,_a,Ra,Wa,Da,Pa,$a,Ba,Ua,Fa,za,Va,ja,Ka,Xa,Ja,Ga,Ha,qa,Ya,Za,Qa,er,tr,nr,ir,ar,rr,or,sr,lr,cr,dr,pr,ur,hr;const{defineElement:mr,property:gr,event:vr}=(0,h.createDecorators)(),br=(0,m.wrapBrick)("eo-icon"),fr=(0,m.wrapBrick)("eo-tooltip"),Ar=new Set;let yr;var wr=new WeakMap,kr=new WeakMap,Er=new WeakMap,xr=new WeakMap,Nr=new WeakMap,Mr=new WeakMap,Tr=new WeakMap,Cr=new WeakMap,Lr=new WeakMap,Ir=new WeakSet,Sr=new WeakMap,Or=new WeakMap,_r=new WeakMap,Rr=new WeakMap,Wr=new WeakMap,Dr=new WeakMap,Pr=new WeakMap,$r=new WeakMap,Br=new WeakMap,Ur=new WeakMap,Fr=new WeakMap,zr=new WeakMap,Vr=new WeakMap,jr=new WeakMap,Kr=new WeakMap,Xr=new WeakMap,Jr=new WeakMap;class Gr extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Ir),(0,r.A)(this,wr,va(this)),(0,r.A)(this,kr,(ba(this),fa(this))),(0,r.A)(this,Er,(Aa(this),ya(this))),(0,r.A)(this,xr,(wa(this),ka(this))),(0,r.A)(this,Nr,(Ea(this),xa(this))),(0,r.A)(this,Mr,(Na(this),Ma(this))),(0,r.A)(this,Tr,(Ta(this),Ca(this))),(0,r.A)(this,Cr,(La(this),Ia(this))),(0,r.A)(this,Lr,(Sa(this),Oa(this))),(0,r.A)(this,Sr,(Wa(this),e=>{(0,s.A)(Ir,this,_a).emit(e)})),(0,r.A)(this,Or,Da(this)),(0,r.A)(this,_r,(Ba(this),e=>{(0,s.A)(Ir,this,Pa).emit(e)})),(0,r.A)(this,Rr,Ua(this)),(0,r.A)(this,Wr,(Va(this),()=>{(0,s.A)(Ir,this,Fa).emit()})),(0,r.A)(this,Dr,ja(this)),(0,r.A)(this,Pr,(Ja(this),()=>{(0,s.A)(Ir,this,Ka).emit()})),(0,r.A)(this,$r,Ga(this)),(0,r.A)(this,Br,(Ya(this),e=>{(0,s.A)(Ir,this,Ha).emit(e)})),(0,r.A)(this,Ur,Za(this)),(0,r.A)(this,Fr,(tr(this),()=>{(0,s.A)(Ir,this,Qa).emit()})),(0,r.A)(this,zr,nr(this)),(0,r.A)(this,Vr,(rr(this),e=>{(0,s.A)(Ir,this,ir).emit(e)})),(0,r.A)(this,jr,or(this)),(0,r.A)(this,Kr,(cr(this),e=>{(0,s.A)(Ir,this,sr).emit(e)})),(0,r.A)(this,Xr,dr(this)),(0,r.A)(this,Jr,(hr(this),e=>{(0,s.A)(Ir,this,pr).emit(e)}))}get label(){return(0,c.A)(wr,this)}set label(e){(0,l.A)(wr,this,e)}get type(){return(0,c.A)(kr,this)}set type(e){(0,l.A)(kr,this,e)}get external(){return(0,c.A)(Er,this)}set external(e){(0,l.A)(Er,this,e)}get subNodes(){return(0,c.A)(xr,this)}set subNodes(e){(0,l.A)(xr,this,e)}get active(){return(0,c.A)(Nr,this)}set active(e){(0,l.A)(Nr,this,e)}get notSynced(){return(0,c.A)(Mr,this)}set notSynced(e){(0,l.A)(Mr,this,e)}get disableChildAppend(){return(0,c.A)(Tr,this)}set disableChildAppend(e){(0,l.A)(Tr,this,e)}get autoFocusOnce(){return(0,c.A)(Cr,this)}set autoFocusOnce(e){(0,l.A)(Cr,this,e)}render(){return u().createElement(Hr,{label:this.label,type:this.type,external:this.external,subNodes:this.subNodes,autoFocusOnce:this.autoFocusOnce,onLabelEditingChange:(0,c.A)(Sr,this),onLabelChange:(0,c.A)(_r,this),onNodeClick:(0,c.A)(Wr,this),onNodeDoubleClick:(0,c.A)(Pr,this),onNodeContextMenu:(0,c.A)(Br,this),onChildAppend:(0,c.A)(Fr,this),onExternalClick:(0,c.A)(Vr,this),onSubNodeDoubleClick:(0,c.A)(Kr,this),onSubNodeContextMenu:(0,c.A)(Jr,this)})}}function Hr(e){var t;let{label:n,type:i,external:a,subNodes:r,autoFocusOnce:o,onLabelEditingChange:s,onLabelChange:l,onNodeClick:c,onNodeDoubleClick:d,onNodeContextMenu:h,onChildAppend:m,onExternalClick:g,onSubNodeDoubleClick:v,onSubNodeContextMenu:b}=e;const f="board"===i?"board":"page",[y,w]=(0,p.useState)(n),[k,E]=(0,p.useState)(!1),x=(0,p.useRef)(!1),[N,M]=(0,p.useState)(!1),T=(0,p.useRef)(null);(0,p.useEffect)((()=>{w(n)}),[n]);const C=(0,p.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),E(!0)}),[]);(0,p.useEffect)((()=>{o&&!Ar.has(o)&&(Ar.add(o),setTimeout((()=>{E(!0)}),1))}),[o]),(0,p.useEffect)((()=>{var e,t;k&&(null===(e=T.current)||void 0===e||e.focus({preventScroll:!0}),null===(t=T.current)||void 0===t||t.select())}),[k]),(0,p.useEffect)((()=>{x.current?null==s||s(k):x.current=!0}),[k,s]);const L=(0,p.useCallback)((e=>{w(e.target.value)}),[]),I=(0,p.useCallback)((e=>{const t=e.key||e.keyCode||e.which;var n;"Enter"!==t&&13!==t||null===(n=T.current)||void 0===n||n.blur()}),[]),S=(0,p.useCallback)((()=>{E(!1),M(!0)}),[]);(0,p.useEffect)((()=>{N&&(null==l||l(y),M(!1))}),[y,l,N]);const O=(0,p.useCallback)((e=>{e.stopPropagation(),null==m||m()}),[m]),_=(0,p.useCallback)((e=>{e.stopPropagation(),null==g||g(a)}),[a,g]),R=(0,p.useCallback)((e=>{e.stopPropagation()}),[]),W=38*Math.max(0,Math.floor((null!==(t=null==r?void 0:r.length)&&void 0!==t?t:0)-3));return u().createElement(u().Fragment,null,u().createElement("div",{className:A()("node",f,{"editing-label":k}),style:{height:"board"===f?70:130+W},onClick:c,onDoubleClick:d,onContextMenu:e=>{e.stopPropagation(),e.preventDefault(),null==h||h({clientX:e.clientX,clientY:e.clientY})}},u().createElement("input",{className:"label-input",value:y,ref:T,onChange:L,onKeyDown:I,onBlur:S,onDoubleClick:R,onContextMenu:R,onMouseDown:R}),u().createElement("div",{className:"label",onDoubleClick:C,onMouseDown:R},y),"board"===f?u().createElement("div",{className:"icon-container"},u().createElement(br,{lib:"antd",icon:"unordered-list"})):u().createElement("div",{className:"thumbnail-container",style:{height:98+W}},u().createElement("div",{className:"thumbnail-placeholder"},u().createElement(br,{lib:"antd",icon:"ellipsis"})),a&&u().createElement("div",{className:"external",onClick:_,onDoubleClick:R,onMouseDown:R},u().createElement(br,{lib:"antd",icon:"desktop"}),u().createElement("span",{className:"external-label"},a.label)),null!=r&&r.length?u().createElement("div",{className:"sub-nodes"},r.map((e=>u().createElement(qr,{key:e.id,subNode:e,onSubNodeDoubleClick:v,onSubNodeContextMenu:b})))):null)),u().createElement("div",{className:"add-button",role:"button",onClick:O,onMouseDown:R},u().createElement(br,{lib:"fa",icon:"plus"})))}function qr(e){let{subNode:t,onSubNodeDoubleClick:n,onSubNodeContextMenu:i}=e;return u().createElement(fr,{key:t.id,content:t.label},u().createElement("div",{className:"sub-node",onDoubleClick:e=>{e.stopPropagation(),null==n||n(t)},onContextMenu:e=>{e.stopPropagation(),e.preventDefault(),null==i||i({node:t,clientX:e.clientX,clientY:e.clientY})}},u().createElement("div",{className:"sub-node-skeleton-title"}),u().createElement("div",{className:"sub-node-skeleton-content"}),u().createElement("div",{className:"sub-node-skeleton-button"})))}ha=Gr,({e:[va,ba,fa,Aa,ya,wa,ka,Ea,xa,Na,Ma,Ta,Ca,La,Ia,Sa,Oa,_a,Ra,Wa,Da,Pa,$a,Ba,Ua,Fa,za,Va,ja,Ka,Xa,Ja,Ga,Ha,qa,Ya,Za,Qa,er,tr,nr,ir,ar,rr,or,sr,lr,cr,dr,pr,ur,hr],c:[yr,ga]}=(0,d.A)(ha,[mr("visual-builder.page-arch-node",{styleTexts:[ma.A]})],[[gr(),1,"label"],[gr(),1,"type"],[gr({attribute:!1}),1,"external"],[gr({attribute:!1}),1,"subNodes"],[gr({type:Boolean,render:!1}),1,"active"],[gr({type:Boolean,render:!1}),1,"notSynced"],[gr({type:Boolean,render:!1}),1,"disableChildAppend"],[gr(),1,"autoFocusOnce"],[vr({type:"label.editing.change"}),1,"labelEditingChange",e=>(0,c.A)(Lr,e),(e,t)=>(0,l.A)(Lr,e,t)],[vr({type:"label.change"}),1,"labelChange",e=>(0,c.A)(Or,e),(e,t)=>(0,l.A)(Or,e,t)],[vr({type:"node.click"}),1,"nodeClick",e=>(0,c.A)(Rr,e),(e,t)=>(0,l.A)(Rr,e,t)],[vr({type:"node.dblclick"}),1,"nodeDoubleClick",e=>(0,c.A)(Dr,e),(e,t)=>(0,l.A)(Dr,e,t)],[vr({type:"node.contextmenu"}),1,"nodeContextMenu",e=>(0,c.A)($r,e),(e,t)=>(0,l.A)($r,e,t)],[vr({type:"child.append"}),1,"childAppend",e=>(0,c.A)(Ur,e),(e,t)=>(0,l.A)(Ur,e,t)],[vr({type:"external.click"}),1,"externalClick",e=>(0,c.A)(zr,e),(e,t)=>(0,l.A)(zr,e,t)],[vr({type:"subNode.dblclick"}),1,"subNodeDoubleClick",e=>(0,c.A)(jr,e),(e,t)=>(0,l.A)(jr,e,t)],[vr({type:"subNode.contextmenu"}),1,"subNodeContextMenu",e=>(0,c.A)(Xr,e),(e,t)=>(0,l.A)(Xr,e,t)]],0,(e=>Jr.has((0,o.A)(e))),m.ReactNextElement)),ga();var Yr,Zr=n(4273),Qr=n(66213),eo=n(99492);let to,no,io,ao,ro,oo,so,lo,co;const{method:po,property:uo}=(0,h.createDecorators)();var ho=new WeakMap,mo=new WeakSet,go=new WeakMap,vo=new WeakMap,bo=new WeakMap,fo=new WeakMap,Ao=new WeakMap,yo=new WeakMap;class wo extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,mo),(0,r.A)(this,ho,(to(this),!1)),(0,r.A)(this,go,"normal"),(0,r.A)(this,vo,!1),(0,r.A)(this,bo,no(this)),(0,r.A)(this,fo,(io(this),ao(this))),(0,r.A)(this,Ao,(ro(this),oo(this))),(0,r.A)(this,yo,(so(this),lo(this))),co(this)}get isFormItemElement(){return!0}set validateState(e){(0,eo.A)(mo,No,this,e),this._render()}get validateState(){return(0,s.A)(mo,this,xo)}set notRender(e){this.hidden=e,(0,eo.A)(mo,Eo,this,e),this._render()}get notRender(){return(0,s.A)(mo,this,ko)}get $bindFormItem(){return(0,s.A)(mo,this,Mo)}set $bindFormItem(e){(0,eo.A)(mo,To,this,e),this._render()}get helpBrick(){return(0,c.A)(bo,this)}set helpBrick(e){(0,l.A)(bo,this,e)}get labelBrick(){return(0,c.A)(fo,this)}set labelBrick(e){(0,l.A)(fo,this,e)}get labelCol(){return(0,c.A)(Ao,this)}set labelCol(e){(0,l.A)(Ao,this,e)}get wrapperCol(){return(0,c.A)(yo,this)}set wrapperCol(e){(0,l.A)(yo,this,e)}setNotRender(e){this.notRender=e}getFormElement(){let e=this;for(;(e=e.parentNode)&&e&&!e.isFormElement;);return e}}function ko(e){return(0,c.A)(ho,e)}function Eo(e,t){(0,l.A)(ho,e,t)}function xo(e){return(0,c.A)(go,e)}function No(e,t){(0,l.A)(go,e,t)}function Mo(e){return(0,c.A)(vo,e)}function To(e,t){(0,l.A)(vo,e,t)}Yr=wo,[no,io,ao,ro,oo,so,lo,co,to]=(0,d.A)(Yr,[],[[uo({attribute:!1}),1,"helpBrick"],[uo({attribute:!1}),1,"labelBrick"],[uo({attribute:!1}),1,"labelCol"],[uo({attribute:!1}),1,"wrapperCol"],[po(),2,"setNotRender"],[po(),2,"getFormElement"]],0,void 0,m.ReactNextElement).e;var Co=n(74244);let Lo=function(e){return e.CONTRACT_OPTIONS_TIPS_PREFIX="CONTRACT_OPTIONS_TIPS_PREFIX",e.CONTRACT_OPTIONS_TIPS_SUFFIX="CONTRACT_OPTIONS_TIPS_SUFFIX",e.CONTRACT_VALIDATE_MESSAGE="CONTRACT_VALIDATE_MESSAGE",e}({});const Io="bricks/visual-builder/contract-select",So={en:{CONTRACT_OPTIONS_TIPS_PREFIX:"Only the first",CONTRACT_OPTIONS_TIPS_SUFFIX:"items are displayed, please search for more results",CONTRACT_VALIDATE_MESSAGE:"Please fill in the correct contract name "},zh:{CONTRACT_OPTIONS_TIPS_PREFIX:"仅展示前",CONTRACT_OPTIONS_TIPS_SUFFIX:"项,更多结果请搜索",CONTRACT_VALIDATE_MESSAGE:"请填写正确的契约名称"}};(0,bi.initializeReactI18n)(Io,So);const Oo=(0,m.wrapBrick)("eo-icon"),_o=(0,m.wrapBrick)("eo-input",{onChange:"change"});function Ro(e){const{itemsCount:t=20,onBlur:n}=e,[i,a]=(0,p.useState)(t),{t:r}=(0,bi.useTranslation)(Io),[o,s]=(0,p.useState)(!1);return u().createElement("div",{className:"options-tips",slot:e.slot},r(Lo.CONTRACT_OPTIONS_TIPS_PREFIX)," ",o?u().createElement(_o,{autoFocus:!0,inputStyle:{width:65},value:String(i),onBlur:()=>{s(!1),null==n||n(i)},onChange:e=>{a(Number(e.detail))}}):u().createElement("span",null,i," ",u().createElement(Oo,{icon:"edit",lib:"antd",onClick:()=>{s(!0)}}))," ",r(Lo.CONTRACT_OPTIONS_TIPS_SUFFIX))}var Wo;let Do,Po,$o,Bo,Uo,Fo,zo,Vo,jo,Ko,Xo,Jo,Go,Ho,qo;(0,bi.initializeReactI18n)(Io,So);const{defineElement:Yo,property:Zo,event:Qo}=(0,h.createDecorators)(),es=(0,m.wrapBrick)("eo-form-item"),ts=(0,m.wrapBrick)("eo-auto-complete",{onChange:"change"});let ns;var is=new WeakMap,as=new WeakMap,rs=new WeakMap,os=new WeakMap,ss=new WeakMap,ls=new WeakMap,cs=new WeakSet;function ds(e){if("string"!=typeof e)return{name:"",version:""};const[t,n]=e.split(":");return{name:t,version:n}}function ps(e){return/.*@.*:\d+\.\d+\.\d+/.test(e)}function us(e){return(0,kt.isNil)(e)||ps(e)?"":wi.i18n.t(`${Io}:${Lo.CONTRACT_VALIDATE_MESSAGE}`)}function hs(e){let{value:t,inputStyle:n,validateState:i,suffix:a,onChange:r}=e;const[o,s]=(0,p.useState)(),[l,c]=(0,p.useState)(20),d=function(e){let{pageSize:t=20,q:n=""}=e;const[i,a]=(0,p.useState)([]),[r,o]=(0,p.useState)(n),[s,l]=(0,p.useState)(t);return(0,p.useEffect)((()=>{o(n)}),[n]),(0,p.useEffect)((()=>{l(t)}),[t]),(0,p.useEffect)((()=>{(async()=>{try{const{list:e}=await(0,Co.f)({page:1,pageSize:s,fullContractName:r},{interceptorParams:{ignoreLoadingBar:!0}});a(e)}catch(e){console.error(e),a([])}})()}),[r,s]),i}({q:o,pageSize:l}),[h,m]=(0,p.useState)(ds(t)),[g,v]=(0,p.useState)([]);(0,p.useEffect)((()=>{m(ds(t))}),[t]);const b=(0,p.useMemo)((()=>(0,kt.debounce)((e=>{s(e)}),200)),[]);return u().createElement("div",{className:"contract-wrapper"},u().createElement(ts,{className:"contract-selector",options:null==d?void 0:d.map((e=>({value:e.fullContractName,label:e.fullContractName}))),value:h.name,inputStyle:n,validateState:i,onChange:e=>{const t=e.detail;if(ps(t))m(ds(t)),null==r||r(t);else{var n,i;const e=null===(n=d.find((e=>e.fullContractName===t)))||void 0===n?void 0:n.version,a=null!==(i=null==e?void 0:e[0])&&void 0!==i?i:"";v(e),m({name:t,version:a}),null==r||r(`${t}:${a}`)}b(t)}},u().createElement(Ro,{onBlur:e=>c(e),slot:"options-toolbar"})),u().createElement(ts,{className:"version-selector",value:h.version,validateState:i,options:null==g?void 0:g.map((e=>({value:e,label:e}))),onChange:e=>{const t=e.detail;m({name:h.name,version:t}),null==r||r(`${h.name}:${t}`)}}),null!=a&&a.useBrick?u().createElement(Zr.ReactUseMultipleBricks,a):null)}Wo=class extends wo{constructor(){super(...arguments),(0,a.A)(this,cs),(0,r.A)(this,is,Po(this)),(0,r.A)(this,as,($o(this),Bo(this))),(0,r.A)(this,rs,(Uo(this),Fo(this))),(0,r.A)(this,os,(zo(this),Vo(this))),(0,r.A)(this,ss,(jo(this),Ko(this))),(0,r.A)(this,ls,(Xo(this),Jo(this))),(0,Y.A)(this,"handleChange",(qo(this),e=>{(0,s.A)(cs,this,Go).emit(e)}))}get name(){return(0,c.A)(is,this)}set name(e){(0,l.A)(is,this,e)}get required(){return(0,c.A)(as,this)}set required(e){(0,l.A)(as,this,e)}get label(){return(0,c.A)(rs,this)}set label(e){(0,l.A)(rs,this,e)}get value(){return(0,c.A)(os,this)}set value(e){(0,l.A)(os,this,e)}get suffix(){return(0,c.A)(ss,this)}set suffix(e){(0,l.A)(ss,this,e)}render(){return u().createElement(es,{exportparts:"message",curElement:this,formElement:this.getFormElement(),name:this.name,label:this.label,required:this.required,labelBrick:this.labelBrick,helpBrick:this.helpBrick,notRender:this.notRender,trigger:"handleChange",validator:us},u().createElement(hs,{value:this.value,suffix:this.suffix,validateState:this.validateState,onChange:this.handleChange}))}},({e:[Po,$o,Bo,Uo,Fo,zo,Vo,jo,Ko,Xo,Jo,Go,Ho,qo],c:[ns,Do]}=(0,d.A)(Wo,[Yo("visual-builder.contract-select",{styleTexts:[Qr.A]})],[[Zo(),1,"name"],[Zo({type:Boolean}),1,"required"],[Zo(),1,"label"],[Zo({attribute:!1}),1,"value"],[Zo({attribute:!1}),1,"suffix"],[Qo({type:"change"}),1,"changeEvent",e=>(0,c.A)(ls,e),(e,t)=>(0,l.A)(ls,e,t)]],0,(e=>cs.has((0,o.A)(e))),wo)),Do();var ms=n(37732);var gs,vs=n(47540);let bs,fs,As,ys,ws,ks,Es,xs,Ns,Ms,Ts,Cs,Ls,Is,Ss,Os;const _s=(0,m.wrapBrick)("eo-menu"),Rs=(0,m.wrapBrick)("eo-menu-item"),Ws=(0,m.wrapBrick)("eo-tooltip"),Ds=(0,ms.unwrapProvider)("basic.lock-body-scroll");(0,bi.initializeReactI18n)("bricks/visual-builder/generate-snippets-context-menu",{en:{},zh:{}});const{defineElement:Ps,property:$s,event:Bs,method:Us}=(0,h.createDecorators)();let Fs;var zs=new WeakMap,Vs=new WeakMap,js=new WeakMap,Ks=new WeakMap,Xs=new WeakSet,Js=new WeakMap,Gs=new WeakMap,Hs=new WeakMap;class qs extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Xs),(0,r.A)(this,zs,(bs(this),As(this))),(0,r.A)(this,Vs,(ys(this),ws(this))),(0,r.A)(this,js,(ks(this),Es(this))),(0,r.A)(this,Ks,(xs(this),Ns(this))),(0,r.A)(this,Js,(Cs(this),Ls(this))),(0,r.A)(this,Gs,(Os(this),e=>{(0,s.A)(Xs,this,Ms).emit(e)})),(0,r.A)(this,Hs,(e=>{(0,s.A)(Xs,this,Is).emit(e)}))}get options(){return(0,c.A)(zs,this)}set options(e){(0,l.A)(zs,this,e)}get active(){return(0,c.A)(Vs,this)}set active(e){(0,l.A)(Vs,this,e)}get position(){return(0,c.A)(js,this)}set position(e){(0,l.A)(js,this,e)}open(e){let{position:t}=e;this.active=!0,this.position=t}close(){this.active=!1,this.position=void 0}disconnectedCallback(){super.disconnectedCallback(),Ds(this,!1)}render(){return u().createElement(Ys,{active:this.active,element:this,position:this.position,onItemDragStart:(0,c.A)(Gs,this),onItemDragEnd:(0,c.A)(Hs,this),options:this.options})}}function Ys(e){var t,n;let{element:i,active:a,onItemDragEnd:r,onItemDragStart:o,options:s,position:l}=e;const[c,d]=(0,p.useState)(!1),h=(0,p.useRef)(null),[m,g]=(0,p.useState)(null),v=(0,p.useCallback)((e=>{e.preventDefault(),null==i||i.close()}),[i]),b=(0,p.useCallback)(((e,t)=>{var n;d(!0),t.dragConf&&(null===(n=e.dataTransfer)||void 0===n||n.setData(t.dragConf.format,JSON.stringify(t.dragConf.data))),e.target.classList.add("dragging"),null==o||o(t)}),[o]),f=(0,p.useCallback)(((e,t)=>{d(!1),e.target.classList.remove("dragging"),null==i||i.close(),null==r||r(t)}),[i,r]);return(0,p.useEffect)((()=>{Ds(i,a)}),[a,i]),(0,p.useEffect)((()=>{if(a&&h.current&&l){const e=h.current.getBoundingClientRect(),t=e.width+8,n=e.height+8,{clientWidth:i,clientHeight:a}=document.documentElement,r=[...l];i>t&&l[0]+t>i&&(r[0]=l[0]-t),a>n&&l[1]+n>a&&(r[1]=a-n),g(r)}else g(null)}),[a,l]),u().createElement(u().Fragment,null,!c&&u().createElement("div",{className:"mask",onClick:v,onContextMenu:v}),u().createElement("div",{className:"container",ref:h,style:{left:null===(t=null!=m?m:l)||void 0===t?void 0:t[0],top:null===(n=null!=m?m:l)||void 0===n?void 0:n[1],visibility:m?"visible":"hidden"}},null==s?void 0:s.map(((e,t)=>{var n,i;return u().createElement("div",{key:t},u().createElement("div",{className:"title"},e.title),(null===(n=e.children)||void 0===n?void 0:n.length)&&u().createElement(_s,null,null===(i=e.children)||void 0===i?void 0:i.map(((e,t)=>u().createElement(Ws,{content:e.tooltip,hoist:!0,placement:"left",key:t},u().createElement(Rs,{disabled:e.disabled,icon:e.icon,draggable:!e.disabled,onDragStart:t=>b(t,e),onDragEnd:t=>f(t,e)},e.text))))))}))))}gs=qs,({e:[As,ys,ws,ks,Es,xs,Ns,Ms,Ts,Cs,Ls,Is,Ss,Os,bs],c:[Fs,fs]}=(0,d.A)(gs,[Ps("visual-builder.generate-snippets-context-menu",{styleTexts:[vs.A]})],[[$s({attribute:!1}),1,"options"],[$s({type:Boolean}),1,"active"],[$s({attribute:!1}),1,"position"],[Bs({type:"item.drag.start"}),1,"itemDragStartEvent",e=>(0,c.A)(Ks,e),(e,t)=>(0,l.A)(Ks,e,t)],[Bs({type:"item.drag.end"}),1,"itemDragEndEvent",e=>(0,c.A)(Js,e),(e,t)=>(0,l.A)(Js,e,t)],[Us(),2,"open"],[Us(),2,"close"]],0,(e=>Hs.has((0,o.A)(e))),m.ReactNextElement)),fs();var Zs=n(31085),Qs=n(83091),el=n(97447),tl=n(46025),nl=n(23640),il=n(24360),al=n(74269),rl=n(74650),ol=n(6602);function sl(e){const t=e.properties.className||[];for(const e of t)if("language-"===e.slice(0,9))return e.slice(9).toLowerCase();return null}function ll(){function e(e,t,n){if(!n||"pre"!==n.tagName||"code"!==e.tagName)return;const i=sl(e);if(null===i||"mermaid"===i)return;let a;try{n.properties.className=(n.properties.className||[]).concat("language-"+i),a=ol.L.highlight((0,rl.d)(e),i)}catch{return}e.children=a.children}return t=>{(0,al.YR)(t,"element",e)}}var cl=n(934),dl=n(53349);let pl=0;cl.A.initialize({startOnLoad:!1,theme:"base",themeVariables:{fontSize:"14px",lineColor:"#979797",primaryColor:"#DCD2F3",primaryBorderColor:"#0000001A"}});const ul=new DOMParser,hl=new XMLSerializer;function ml(){return async e=>{const t=[];(0,al.YR)(e,"element",(function(e,n,i){i&&"pre"===i.tagName&&"code"===e.tagName&&"mermaid"===sl(e)&&t.push((async()=>{const t="mermaid-"+pl++,{svg:a}=await cl.A.render(t,(0,rl.d)(e)),r=ul.parseFromString(a,"text/html"),o=r.querySelector("svg"),s=r.createElementNS("http://www.w3.org/2000/svg","defs");s.innerHTML=`<linearGradient id="linear-gradient-${t}" x1="0%" y1="0%" x2="0%" y2="100%">\n <stop offset="0%" stop-color="#F0EBFA" />\n <stop offset="75%" stop-color="#DED4F4" />\n <stop offset="100%" stop-color="#C5C7FA" />\n</linearGradient>`,o.prepend(s);const l=r.createElementNS("http://www.w3.org/2000/svg","style");l.textContent=`\n#${t} .node rect,\n#${t} .node circle,\n#${t} .node ellipse,\n#${t} .node polygon,\n#${t} .node path {\n fill: url(#linear-gradient-${t});\n}\n#${t} .node rect {\n rx: 4;\n ry: 4;\n}\n#${t} .labelBkg {\n background-color: #f5f8ff;\n}\n#${t} .edgeLabel,\n#${t} .edgeLabel p {\n background-color: transparent;\n}\n#${t} .edgeLabel {\n color: #8c8c8c;\n font-size: 12px;\n}\n`,o.appendChild(l);const c=hl.serializeToString(o),d=(0,dl.f)(c,{fragment:!0}).children;i.children.splice(n,1,...d),i.properties.className=(i.properties.className||[]).concat("mermaid")})())})),await Promise.all(t)}}const gl={Fragment:Zs.Fragment,jsx:Zs.jsx,jsxs:Zs.jsxs};function vl(e){let{content:t,components:n}=e;const[i,a]=(0,p.useState)(null);return(0,p.useEffect)((()=>{let e=!1;return(0,Qs.l)().use(el.A).use(tl.A).use(nl.A).use([ll]).use(ml).use(il.A,{...gl,passNode:!0,components:n}).process(t).then((t=>{e||a(t.result)})).catch((t=>{e||(console.error("Convert markdown failed:",t),a(null))})),()=>{e=!0}}),[n,t]),i}const bl=(0,m.wrapBrick)("eo-avatar");function fl(e){let{message:t}=e;const n=(0,p.useMemo)((()=>{const e=[];if("assistant"===t.role){const n=/(?:^|\n)```(easy_cmd_\S+)\n([\s\S]*?)\n```(?:$|\n)/gm;let i,a=0;for(;i=n.exec(t.content);){const[r,o,s]=i,l=i.index,c=t.content.slice(a,l).trim();c.length>0&&e.push({type:"markdown",content:c}),e.push({type:"command",command:o,content:s.trim(),raw:r}),a=n.lastIndex}const r=t.content.slice(a).trim();r.length>0&&e.push({type:"markdown",content:r})}else e.push({type:"plain",content:t.content});return e}),[t.content,t.role]),i=(0,p.useRef)(null);return(0,p.useEffect)((()=>{const e=i.current;e&&setTimeout((()=>{const n=e.parentElement.querySelectorAll(".texting");for(const e of n)e.classList.remove("texting");if(!t.partial)return;let i=e;for(;i;){const e=i.lastChild;if((null==e?void 0:e.nodeType)!==Node.ELEMENT_NODE||"DETAILS"===(null==e?void 0:e.tagName)&&!e.open){var a;if((null==e?void 0:e.nodeType)!==Node.TEXT_NODE||0!==e.textContent.trim().length||(null===(a=e.previousSibling)||void 0===a?void 0:a.nodeType)!==Node.ELEMENT_NODE)break;i=e.previousSibling}else i=e}i.classList.add("texting")}),1)}),[t.partial,t.content]),u().createElement("div",{className:A()("message",{failed:t.failed})},u().createElement("div",{className:"avatar"},u().createElement(bl,{icon:{lib:"easyops",icon:"assistant"===t.role?"robot":"account"},size:"small",className:`role-${t.role}`})),u().createElement("div",{className:"main"},u().createElement("div",{className:"label"},"assistant"===t.role?"Assistant":"You"),u().createElement("div",{className:"content",ref:i},n.map(((e,t)=>u().createElement(Al,{key:t,chunk:e}))))))}function Al(e){let{chunk:t}=e;return u().createElement(u().Fragment,null,"markdown"===t.type?u().createElement("div",{className:"markdown"},u().createElement(vl,{content:t.content})):"command"===t.type?u().createElement(u().Fragment,null,u().createElement("details",{className:"command"},u().createElement("summary",null,"```",t.command),u().createElement("pre",null,u().createElement("code",null,t.content)))):u().createElement("div",{className:"plain"},t.content))}var yl,wl=n(87236);let kl,El,xl,Nl,Ml,Tl,Cl,Ll,Il;const{defineElement:Sl,property:Ol,event:_l}=(0,h.createDecorators)();let Rl;var Wl=new WeakMap,Dl=new WeakMap,Pl=new WeakMap,$l=new WeakSet,Bl=new WeakMap;class Ul extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,$l),(0,r.A)(this,Wl,El(this)),(0,r.A)(this,Dl,(xl(this),Nl(this))),(0,r.A)(this,Pl,(Ml(this),Tl(this))),(0,r.A)(this,Bl,(Il(this),e=>{(0,s.A)($l,this,Cl).emit(e)}))}get messages(){return(0,c.A)(Wl,this)}set messages(e){(0,l.A)(Wl,this,e)}get errorBoundary(){return(0,c.A)(Dl,this)}set errorBoundary(e){(0,l.A)(Dl,this,e)}render(){return u().createElement(Fl,{host:this,messages:this.messages,errorBoundary:this.errorBoundary,onStoryboardUpdate:(0,c.A)(Bl,this)})}}function Fl(e){let{messages:t,host:n,errorBoundary:i,onStoryboardUpdate:a}=e;const r=(0,p.useMemo)((()=>/(?:^|\n)```easy_cmd_vb_block_(page|storyboard)\n([\s\S]*?)\n```(?:$|\n)/gm),[]),o=(0,p.useRef)(new Map),[s,l]=(0,p.useState)([]),c=(0,p.useRef)(!1);(0,p.useEffect)((()=>{for(const n of null!=t?t:[]){var e;if("assistant"!==n.role)continue;let t;r.lastIndex=null!==(e=o.current.get(n.key))&&void 0!==e?e:0;const i=[];let a=!1;for(;t=r.exec(n.content);){o.current.set(n.key,r.lastIndex);const[,e,s]=t;try{const t=JSON.parse(s);"page"===e?(a=!0,i.push(...t)):i.push({...t,type:"item"})}catch(e){console.error("parse storyboard failed:",e)}}a?l(i):i.length>0&&l((e=>[...e,...i]))}}),[r,t]);const[d,h]=(0,p.useState)([]);(0,p.useEffect)((()=>{const e=[],t=new Map;for(const n of s)"block"===n.type?e.push(n):n.storyboard&&t.set(n.uuid,n.storyboard);e.sort(((e,t)=>e.seq-t.seq));const n={brick:"eo-content-layout",children:[]},a={brick:"eo-main-view",children:[{brick:"eo-page-title",slot:"pageTitle",properties:{pageTitle:"测试页面"}}]};let r=!1;for(const o of e)if("全局操作区"===o.name)for(const e of o.children){const n=t.get(e);n&&(a.children.push({...n,properties:{...n.properties,slot:void 0},errorBoundary:i,slot:"toolbar",iid:`item:${e}`,meta:{type:"item",uuid:e,block:{uuid:o.uuid,name:o.name}}}),r=!0)}else{const e=t.get(o.uuid);if(e){const a={...e,children:[],errorBoundary:i,iid:`block:${o.uuid}`,meta:{type:"block",uuid:o.uuid,name:o.name}};r=!0,n.children.push(a);for(const e of o.children){const n=t.get(e);n&&a.children.push({...n,errorBoundary:i,iid:`item:${e}`,meta:{type:"item",uuid:e}})}}else if(!o.hasContainer)for(const e of o.children){const a=t.get(e);a&&(n.children.push({...a,errorBoundary:i,iid:`item:${e}`,meta:{type:"item",uuid:e}}),r=!0)}}a.children.push(n),h((e=>r?[a]:0===e.length?e:[]))}),[s,i]),(0,p.useEffect)((()=>{null==a||a(d)}),[a,d]);const m=(0,p.useMemo)((()=>{let e=n;for(;e;){const t=getComputedStyle(e,null).getPropertyValue("overflow-y");if("auto"===t||"scroll"===t)return e;if(e.parentNode instanceof ShadowRoot)e=e.parentNode.host;else{if(!(e.parentNode instanceof Element))break;e=e.parentNode}}return document.scrollingElement||document.documentElement}),[n]);return(0,p.useEffect)((()=>{c.current||setTimeout((()=>{m.scrollTo(0,m.scrollHeight)}),1)}),[t,m]),(0,p.useEffect)((()=>{const e=()=>{c.current=m.scrollTop+m.clientHeight+6<m.scrollHeight};return m.addEventListener("scroll",e),()=>{m.removeEventListener("scroll",e)}}),[m]),u().createElement(u().Fragment,null,null==t?void 0:t.map(((e,t)=>{var n;return u().createElement(fl,{key:null!==(n=e.key)&&void 0!==n?n:`index-${t}`,message:e})})))}yl=Ul,({e:[El,xl,Nl,Ml,Tl,Cl,Ll,Il],c:[Rl,kl]}=(0,d.A)(yl,[Sl("visual-builder.chat-conversation",{styleTexts:[wl.A]})],[[Ol({attribute:!1}),1,"messages"],[Ol({type:Boolean}),1,"errorBoundary"],[_l({type:"storyboard.update"}),1,"storyboardUpdate",e=>(0,c.A)(Pl,e),(e,t)=>(0,l.A)(Pl,e,t)]],0,(e=>Bl.has((0,o.A)(e))),m.ReactNextElement)),kl();var zl=n(89575),Vl=n(55310);function jl(e){let{variant:t,width:n,height:i,left:a,top:r,label:o}=e;return u().createElement("div",{className:"outline "+t,style:{width:n+8,height:i+8,left:a-4,top:r-4}},u().createElement("div",{className:"label"},o))}var Kl,Xl=n(81563);let Jl,Gl,Hl,ql,Yl,Zl,Ql,ec,tc,nc,ic,ac,rc,oc,sc,lc;const{defineElement:cc,property:dc,event:pc,method:uc}=(0,h.createDecorators)();let hc;var mc=new WeakMap,gc=new WeakMap,vc=new WeakMap,bc=new WeakMap,fc=new WeakMap,Ac=new WeakMap,yc=new WeakSet,wc=new WeakMap;class kc extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,yc),(0,r.A)(this,mc,(Jl(this),Hl(this))),(0,r.A)(this,gc,(ql(this),Yl(this))),(0,r.A)(this,vc,(Zl(this),Ql(this))),(0,r.A)(this,bc,(ec(this),tc(this))),(0,r.A)(this,fc,(nc(this),ic(this))),(0,r.A)(this,Ac,(ac(this),rc(this))),(0,r.A)(this,wc,(lc(this),e=>{(0,s.A)(yc,this,oc).emit(e)}))}get storyboard(){return(0,c.A)(mc,this)}set storyboard(e){(0,l.A)(mc,this,e)}get theme(){return(0,c.A)(gc,this)}set theme(e){(0,l.A)(gc,this,e)}get uiVersion(){return(0,c.A)(vc,this)}set uiVersion(e){(0,l.A)(vc,this,e)}get app(){return(0,c.A)(bc,this)}set app(e){(0,l.A)(bc,this,e)}get inspecting(){return(0,c.A)(fc,this)}set inspecting(e){(0,l.A)(fc,this,e)}select(e){var t;const n=null===(t=this.shadowRoot)||void 0===t||null===(t=t.querySelector("iframe"))||void 0===t?void 0:t.contentWindow;null==n||n.postMessage({channel:"chat-preview",type:"select",payload:e},location.origin)}render(){return u().createElement(Ec,{storyboard:this.storyboard,theme:this.theme,uiVersion:this.uiVersion,app:this.app,inspecting:this.inspecting,onActiveTargetChange:(0,c.A)(wc,this)})}}function Ec(e){let{storyboard:t,theme:n,uiVersion:i,app:a,inspecting:r,onActiveTargetChange:o}=e;const s=(0,p.useRef)(),[l,c]=(0,p.useState)(!1),[d,h]=(0,p.useState)(!1),[m,g]=(0,p.useState)({x:0,y:0}),[v,b]=(0,p.useState)([]),[f,y]=(0,p.useState)([]),[w,k]=(0,p.useState)([]),[E,x]=(0,p.useState)([]),N=(0,p.useCallback)((()=>{const e=()=>{var t;const n=null===(t=s.current)||void 0===t?void 0:t.contentWindow;null!=n&&n._preview_only_render?c(!0):setTimeout(e,100)};e()}),[]);(0,p.useEffect)((()=>{var e,t;if(!l)return;const n=et.__secret_internals.getBrickPackagesById("bricks/visual-builder");if(!n)throw new Error("Cannot find preview agent package: bricks/visual-builder");(null===(e=s.current)||void 0===e||null===(e=e.contentWindow)||void 0===e?void 0:e._preview_only_inject)("visual-builder.inject-chat-preview-agent",{...n,filePath:`${location.origin}${(0,et.getBasePath)()}${null!==(t=window.PUBLIC_ROOT)&&void 0!==t?t:""}${n.filePath}`})}),[l]),(0,p.useEffect)((()=>{var e;if(!l)return;const r=null===(e=s.current)||void 0===e||null===(e=e.contentWindow)||void 0===e?void 0:e._preview_only_render;r&&r("yaml",{yaml:(0,Vl.safeDump)(t,{schema:Vl.JSON_SCHEMA,skipInvalid:!0,noRefs:!0,noCompatMode:!0})},{app:a,theme:n,uiVersion:i})}),[a,l,t,n,i]);const M=(0,p.useMemo)((()=>{if(d)return()=>{setTimeout((()=>{window.postMessage({channel:"chat-preview",type:"inspect-hover",payload:{outlines:[]}})}),100)}}),[d]);(0,p.useEffect)((()=>{const e=e=>{var t;if("chat-preview"===(null===(t=e.data)||void 0===t?void 0:t.channel))switch(e.data.type){case"initialized":h(!0);break;case"inspect-hover":b(e.data.payload.outlines);break;case"scroll":g(e.data.payload);break;case"inspect-active":y(e.data.payload.outlines)}};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}}),[]),(0,p.useEffect)((()=>{var e;d&&(null===(e=s.current)||void 0===e||null===(e=e.contentWindow)||void 0===e||e.postMessage({channel:"chat-preview",type:"toggle-inspecting",payload:{inspecting:r}},location.origin))}),[d,r]);const T=(0,p.useCallback)((e=>e.map((e=>{var t,n,i,a;const r=null!==(t=null==s||null===(n=s.current)||void 0===n?void 0:n.offsetLeft)&&void 0!==t?t:0,o=null!==(i=null==s||null===(a=s.current)||void 0===a?void 0:a.offsetTop)&&void 0!==i?i:0,{width:l,height:c,left:d,top:p,...u}=e;return{width:1*l,height:1*c,left:1*(d-m.x)+r,top:1*(p-m.y)+o,...u}}))),[m.x,m.y]);return(0,p.useEffect)((()=>{o(f[0])}),[f,o]),(0,p.useEffect)((()=>{x(T(f))}),[f,T]),(0,p.useEffect)((()=>{k(T(v))}),[v,T]),u().createElement("div",{className:A()("container",{inspecting:r})},u().createElement("iframe",{ref:s,src:`${(0,et.getBasePath)()}_brick-preview-v3_/preview/`,loading:"lazy",onLoad:N,onMouseOut:M}),w.map(((e,t)=>u().createElement(jl,(0,zl.A)({key:t,variant:"hover"},e)))),E.map(((e,t)=>u().createElement(jl,(0,zl.A)({key:t,variant:"active"},e)))))}Kl=kc,({e:[Hl,ql,Yl,Zl,Ql,ec,tc,nc,ic,ac,rc,oc,sc,lc,Jl],c:[hc,Gl]}=(0,d.A)(Kl,[cc("visual-builder.chat-preview",{styleTexts:[Xl.A]})],[[dc({attribute:!1}),1,"storyboard"],[dc(),1,"theme"],[dc(),1,"uiVersion"],[dc(),1,"app"],[dc({type:Boolean}),1,"inspecting"],[pc({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>(0,c.A)(Ac,e),(e,t)=>(0,l.A)(Ac,e,t)],[uc(),2,"select"]],0,(e=>wc.has((0,o.A)(e))),m.ReactNextElement)),Gl();let xc=!1;let Nc=null;function Mc(e){e.preventDefault(),e.stopPropagation(),function(e){const t=Sc(e.composedPath());window.parent.postMessage({channel:"chat-preview",type:"inspect-active",payload:{outlines:t.map(Oc)}},location.origin)}(e)}function Tc(e){e.preventDefault(),e.stopPropagation()}const Cc=(0,kt.debounce)(((e,t,n)=>{let i=Sc(e);if(0===i.length)for(const a of e)if(a instanceof HTMLElement&&a.shadowRoot){i=Sc(a.shadowRoot.elementsFromPoint(t,n));break}const a=i.length>0?i[0].element:null;a!==Nc&&(Nc=a,window.parent.postMessage({channel:"chat-preview",type:"inspect-hover",payload:{outlines:i.map(Oc)}},location.origin))}),20,{leading:!0});function Lc(e){Cc(e.composedPath(),e.clientX,e.clientY)}function Ic(e){e.preventDefault(),e.stopPropagation(),Nc=null,window.parent.postMessage({channel:"chat-preview",type:"inspect-hover",payload:{outlines:[]}},location.origin)}function Sc(e){const t=[];return e.forEach((e=>{let n;if(e.nodeType===Node.ELEMENT_NODE&&e instanceof HTMLElement&&(n=e.dataset.iid)&&n.startsWith("item:")){const i=n.substring(5);t.push({type:"item",uuid:i,label:_c(e),element:e})}})),t}function Oc(e){const{element:t,type:n,uuid:i,label:a}=e,{width:r,height:o,left:s,top:l}=t.getBoundingClientRect();return{width:r,height:o,left:s+window.scrollX,top:l+window.scrollY,type:n,uuid:i,label:a}}function _c(e){return e.tagName.toLowerCase().split(".").pop()}let Rc=!1;function Wc(e){window.parent.postMessage({channel:"chat-preview",...e},location.origin)}customElements.define("visual-builder.inject-chat-preview-agent",(0,ms.createProviderClass)((async function(){Rc||(Rc=!0,n.e(2201).then(n.bind(n,42201)),Wc({type:"initialized"}),window.addEventListener("message",(e=>{var t;if("chat-preview"===(null===(t=e.data)||void 0===t?void 0:t.channel))switch(e.data.type){case"toggle-inspecting":!function(e){if(xc===e)return;xc=e;const t=e?"addEventListener":"removeEventListener";window[t]("click",Mc,!0),window[t]("mousedown",Tc,!0),window[t]("mouseover",Tc,!0),window[t]("mouseup",Tc,!0),window[t]("pointerdown",Tc,!0),window[t]("pointerover",Tc,!0),window[t]("pointerup",Tc,!0),window[t]("pointerleave",Ic,!0),window[t]("pointermove",Lc,!0)}(e.data.payload.inspecting);break;case"select":!function(e){const t=function(e){const t=[];return function n(i){const a=i.querySelectorAll(`[data-iid="${e}"]`);if(t.push(...a),!(i===document&&a.length>0))for(const e of i.querySelectorAll("*"))e.shadowRoot&&n(e.shadowRoot)}(document),t}(`${e.type}:${e.uuid}`);window.parent.postMessage({channel:"chat-preview",type:"inspect-active",payload:{outlines:t.map((t=>Oc({...e,element:t,label:_c(t)})))}},location.origin)}(e.data.payload)}})),window.addEventListener("scroll",(()=>{Wc({type:"scroll",payload:{x:window.scrollX,y:window.scrollY}})})))})));var Dc,Pc=n(94014),$c=n(48918);let Bc,Uc,Fc,zc,Vc,jc,Kc,Xc,Jc,Gc,Hc;const{defineElement:qc,property:Yc}=(0,h.createDecorators)();let Zc;var Qc=new WeakMap,ed=new WeakMap,td=new WeakMap,nd=new WeakMap,id=new WeakMap;class ad extends m.ReactNextElement{constructor(){super(...arguments),(0,r.A)(this,Qc,Uc(this)),(0,r.A)(this,ed,(Fc(this),zc(this))),(0,r.A)(this,td,(Vc(this),jc(this))),(0,r.A)(this,nd,(Kc(this),Xc(this))),(0,r.A)(this,id,(Jc(this),Gc(this))),Hc(this)}get generations(){return(0,c.A)(Qc,this)}set generations(e){(0,l.A)(Qc,this,e)}get category(){return(0,c.A)(ed,this)}set category(e){(0,l.A)(ed,this,e)}get theme(){return(0,c.A)(td,this)}set theme(e){(0,l.A)(td,this,e)}get uiVersion(){return(0,c.A)(nd,this)}set uiVersion(e){(0,l.A)(nd,this,e)}get app(){return(0,c.A)(id,this)}set app(e){(0,l.A)(id,this,e)}render(){return u().createElement(rd,{generations:this.generations,category:this.category,theme:this.theme,uiVersion:this.uiVersion,app:this.app})}}function rd(e){let{generations:t,category:n,theme:i,uiVersion:a,app:r}=e;const o=(0,p.useRef)(),[s,l]=(0,p.useState)(!1),[c,d]=(0,p.useState)(!1),h=(0,p.useCallback)((()=>{const e=()=>{var t;const n=null===(t=o.current)||void 0===t?void 0:t.contentWindow;null!=n&&n._preview_only_render?l(!0):setTimeout(e,100)};e()}),[]);return(0,p.useEffect)((()=>{var e;if(!s)return;const t=et.__secret_internals.getBrickPackagesById("bricks/visual-builder");if(!t)throw new Error("Cannot find preview agent package: bricks/visual-builder");const n=o.current.contentWindow._preview_only_inject,i={...t,filePath:`${location.origin}${(0,et.getBasePath)()}${null!==(e=window.PUBLIC_ROOT)&&void 0!==e?e:""}${t.filePath}`};Promise.allSettled(["visual-builder.pre-generated-table-view","visual-builder.pre-generated-container"].map((e=>n(e,i,void 0,!0)))).then((()=>{d(!0)}))}),[s]),(0,p.useEffect)((()=>{var e;if(!c)return;const s=null===(e=o.current)||void 0===e||null===(e=e.contentWindow)||void 0===e?void 0:e._preview_only_render;if(!s)return;const l=new Map,d=new Map;for(const e of t){var p;let t=l.get(e.propertyId);t||l.set(e.propertyId,t=new Map);let n=t.get(e.rwType);n||t.set(e.rwType,n=new Map),n.set(null!==(p=e.displayLevel)&&void 0!==p?p:0,e),d.set(e.propertyId,e.mockData)}const u=[{brick:"div",properties:{textContent:"属性",className:"head-cell"}},{brick:"div",properties:{textContent:"类别",className:"head-cell"}},{brick:"div",properties:{textContent:"展示等级",className:"head-cell last-col-cell",style:{gridColumn:"span 5",textAlign:"center"}}}],h={brick:"visual-builder.pre-generated-table-view",properties:{style:{gridTemplateColumns:"120px 80px repeat(5, 1fr)"}},children:u};let m=0;for(const[e,t]of l){let i=0;const a=m===l.size-1;for(const[r,o]of t){if(0===i){let n;for(const t of o.values()){var g;n=null!==(g=t.propertyName)&&void 0!==g?g:e;break}u.push({brick:"div",properties:{textContent:n,className:A()("body-cell",{"last-row-cell":a}),style:{gridRow:`span ${t.size}`}}})}const s=a&&i===t.size-1;u.push({brick:"div",properties:{textContent:r,className:A()("body-cell",{"last-row-cell":s})}});for(let t=-2;t<3;t++){var v,b,f;const i=o.get(t),a=null!==(v=null==i?void 0:i.category)&&void 0!==v?v:n;let r;if(null!=i&&null!==(b=i.mockData)&&void 0!==b&&b.length){const t=i.mockData[Math.floor(Math.random()*i.mockData.length)];switch(a){case"detail-item":case"form-item":case"card-item":r={[e]:t};break;case"table-column":r={cellData:t}}}const l=[].concat(null!==(f=null==i?void 0:i.storyboard)&&void 0!==f?f:[]).filter((e=>!!(0,ms.isObject)(e)||(console.error("Unexpected type of storyboard:",typeof e),!1)));let c;switch(l.forEach(od),a){case"form-item":c={brick:"eo-form",properties:{layout:"inline",values:r,className:"form-container"},children:l.map((e=>({...e,errorBoundary:!0})))};break;case"card-item":c={brick:":forEach",dataSource:[r],children:l.map((e=>({...e,errorBoundary:!0})))};break;default:c={brick:"visual-builder.pre-generated-container",properties:{useBrick:l,dataSource:r},errorBoundary:!0}}u.push({brick:"div",properties:{className:A()("body-cell",{"last-col-cell":2===t,"last-row-cell":s})},children:[{...c,errorBoundary:!0}]})}i++}m++}s("yaml",{yaml:(0,Vl.safeDump)(h,{schema:Vl.JSON_SCHEMA,skipInvalid:!0,noRefs:!0,noCompatMode:!0})},{app:r,theme:i,uiVersion:a,styleText:$c.A})}),[r,c,t,i,a,n]),u().createElement("div",{className:A()("container")},u().createElement("iframe",{ref:o,src:`${(0,et.getBasePath)()}_brick-preview-v3_/preview/`,loading:"lazy",onLoad:h}))}function od(e){var t;null!==(t=e.properties)&&void 0!==t&&t.prefix&&(console.error("Unexpected readonly property of 'prefix' in:",e),delete e.properties.prefix)}Dc=ad,({e:[Uc,Fc,zc,Vc,jc,Kc,Xc,Jc,Gc,Hc],c:[Zc,Bc]}=(0,d.A)(Dc,[qc("visual-builder.pre-generated-preview",{styleTexts:[Pc.A]})],[[Yc({attribute:!1}),1,"generations"],[Yc(),1,"category"],[Yc(),1,"theme"],[Yc(),1,"uiVersion"],[Yc(),1,"app"]],0,void 0,m.ReactNextElement)),Bc();var sd,ld=n(99216);let cd;const{defineElement:dd}=(0,h.createDecorators)();let pd;class ud extends m.ReactNextElement{render(){return u().createElement(hd,null)}}function hd(){return u().createElement("slot",null)}var md;let gd,vd,bd,fd,Ad;sd=ud,[pd,cd]=(0,d.A)(sd,[dd("visual-builder.pre-generated-table-view",{styleTexts:[ld.A]})],[],0,void 0,m.ReactNextElement).c,cd();const{defineElement:yd,property:wd}=(0,h.createDecorators)();let kd;var Ed=new WeakMap,xd=new WeakMap;class Nd extends m.ReactNextElement{constructor(){super(...arguments),(0,r.A)(this,Ed,vd(this)),(0,r.A)(this,xd,(bd(this),fd(this))),Ad(this)}get useBrick(){return(0,c.A)(Ed,this)}set useBrick(e){(0,l.A)(Ed,this,e)}get dataSource(){return(0,c.A)(xd,this)}set dataSource(e){(0,l.A)(xd,this,e)}render(){return u().createElement(Md,{useBrick:this.useBrick,dataSource:this.dataSource})}}function Md(e){let{useBrick:t,dataSource:n}=e;return t?u().createElement(Zr.ReactUseMultipleBricks,{useBrick:t,data:n,errorBoundary:!0}):null}md=Nd,({e:[vd,bd,fd,Ad],c:[kd,gd]}=(0,d.A)(md,[yd("visual-builder.pre-generated-container",{shadowOptions:!1})],[[wd({attribute:!1}),1,"useBrick"],[wd({attribute:!1}),1,"dataSource"]],0,void 0,m.ReactNextElement)),gd(),n(22080),customElements.define("visual-builder.check-editor-by-name",(0,ms.createProviderClass)((async function(e){try{await et.__secret_internals.loadEditors([e])}catch{return!1}return!!et.customEditors.get(e)})));var Td=n(10102);function Cd(e,t){const n=new Map;for(const i of e){const e=(0,Td.collectMemberUsage)([i.if,i.value,i.resolve],t);n.set(i,e)}return n}function Ld(e,t){e.forEach((n=>{!function(e,t){var n;const{dependencyList:i,nodeList:a,parents:r,result:o}=t,s=(0,kt.cloneDeep)(e);o.push(s);const l=i.find((e=>e.node.key===s.key));if(null!==(n=l.deps)&&void 0!==n&&n.length&&!r.some((e=>e.key===s.key))){const e=s.children=[];!function(e,t){const n=[];e.deps.forEach((e=>{const i=t.nodeList.filter((t=>t.name===e));n.push(...i)})),Ld(n,t)}(l,{dependencyList:i,nodeList:a,parents:[...r,s],result:e})}}(n,{...t,nodeList:e})}))}customElements.define("visual-builder.get-data-deps",(0,ms.createProviderClass)(Cd)),customElements.define("visual-builder.get-dependency-tree",(0,ms.createProviderClass)((function(e,t){const n=e,i=Cd(n.map((e=>e.data)),t.dataType),a=[];for(const[e,t]of i)a.push({deps:Array.from(t.usedProperties),node:n.find((t=>t.data===e))});const r=[];return Ld(n,{result:r,dependencyList:a,parents:[]}),r})));let Id=et.__secret_internals;try{var Sd;const e=window.dll;if(e&&null!==(Sd=window.BRICK_NEXT_VERSIONS)&&void 0!==Sd&&null!==(Sd=Sd["brick-container"])&&void 0!==Sd&&Sd.startsWith("2.")){const{developHelper:t}=e("tYg3");Id={getBrickPackagesById(e){var n;return null===(n=t.getBrickPackages)||void 0===n?void 0:n.call(t).find((t=>t.id===e))}}}}catch(e){console.error("Try to use v2 runtime APIs failed:",e)}const Od=Id;var _d,Rd=n(61304),Wd=n(59034),Dd=n(94162);let Pd,$d,Bd,Ud,Fd,zd,Vd,jd,Kd,Xd,Jd,Gd,Hd,qd,Yd,Zd,Qd,ep,tp,np,ip,ap,rp,op,sp,lp,cp,dp,pp;const{defineElement:up,property:hp,event:mp}=(0,h.createDecorators)();let gp;var vp=new WeakMap,bp=new WeakMap,fp=new WeakMap,Ap=new WeakMap,yp=new WeakMap,wp=new WeakMap,kp=new WeakMap,Ep=new WeakMap,xp=new WeakMap,Np=new WeakSet,Mp=new WeakMap,Tp=new WeakMap,Cp=new WeakMap,Lp=new WeakMap,Ip=new WeakMap;class Sp extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Np),(0,r.A)(this,vp,$d(this)),(0,r.A)(this,bp,(Bd(this),Ud(this))),(0,r.A)(this,fp,(Fd(this),zd(this))),(0,r.A)(this,Ap,(Vd(this),jd(this))),(0,r.A)(this,yp,(Kd(this),Xd(this))),(0,r.A)(this,wp,(Jd(this),Gd(this))),(0,r.A)(this,kp,(Hd(this),qd(this))),(0,r.A)(this,Ep,(Yd(this),Zd(this))),(0,r.A)(this,xp,(Qd(this),ep(this))),(0,r.A)(this,Mp,(ip(this),e=>{(0,s.A)(Np,this,tp).emit(e)})),(0,r.A)(this,Tp,ap(this)),(0,r.A)(this,Cp,(sp(this),e=>{(0,s.A)(Np,this,rp).emit(e)})),(0,r.A)(this,Lp,lp(this)),(0,r.A)(this,Ip,(pp(this),e=>{(0,s.A)(Np,this,cp).emit(e)}))}get previewUrl(){return(0,c.A)(vp,this)}set previewUrl(e){(0,l.A)(vp,this,e)}get generations(){return(0,c.A)(bp,this)}set generations(e){(0,l.A)(bp,this,e)}get mocks(){return(0,c.A)(fp,this)}set mocks(e){(0,l.A)(fp,this,e)}get busy(){return(0,c.A)(Ap,this)}set busy(e){(0,l.A)(Ap,this,e)}get category(){return(0,c.A)(yp,this)}set category(e){(0,l.A)(yp,this,e)}get theme(){return(0,c.A)(wp,this)}set theme(e){(0,l.A)(wp,this,e)}get uiVersion(){return(0,c.A)(kp,this)}set uiVersion(e){(0,l.A)(kp,this,e)}get app(){return(0,c.A)(Ep,this)}set app(e){(0,l.A)(Ep,this,e)}render(){return u().createElement(Op,{previewUrl:this.previewUrl,generations:this.generations,mocks:this.mocks,busy:this.busy,category:this.category,theme:this.theme,uiVersion:this.uiVersion,app:this.app,onComment:(0,c.A)(Mp,this),onApprove:(0,c.A)(Cp,this),onViewAttrPrompt:(0,c.A)(Ip,this)})}}function Op(e){let{previewUrl:t,generations:n,mocks:i,busy:a,category:r,theme:o,uiVersion:s,app:l,onComment:c,onApprove:d,onViewAttrPrompt:h}=e;const m=(0,p.useRef)(),[g,v]=(0,p.useState)(!1),[b,f]=(0,p.useState)(!1),y=(0,p.useRef)([]),w=(0,p.useRef)([]),k=(0,p.useRef)([]);(0,p.useEffect)((()=>{var e;k.current=null!==(e=null==n?void 0:n.filter((e=>e.approved)).map((e=>e.propertyId)))&&void 0!==e?e:[]}),[n]);const E=(0,p.useCallback)((()=>{const e=()=>{var t;const n=null===(t=m.current)||void 0===t?void 0:t.contentWindow;null!=n&&n._preview_only_render?v(!0):setTimeout(e,100)};e()}),[]);return(0,p.useEffect)((()=>{g&&m.current.contentWindow.postMessage({channel:"raw-data-preview",type:"busy",payload:a},location.origin)}),[a,g]),(0,p.useEffect)((()=>{if(g){const e=m.current.contentWindow,t=e=>{let{data:t}=e;if("raw-data-preview"===(null==t?void 0:t.channel))switch(t.type){case"comment":c(t.payload);break;case"approve":d(t.payload);break;case"viewAttrPrompt":h(t.payload);break;case"updatePropertyToggleState":y.current=t.payload;break;case"updatePropertyExpandState":w.current=t.payload;break;case"updatePropertyApproveState":k.current=t.payload}};return e.addEventListener("message",t),()=>{e.removeEventListener("message",t)}}}),[d,c,h,g]),(0,p.useEffect)((()=>{var e;if(!g)return;const n=Od.getBrickPackagesById("bricks/visual-builder");if(!n)throw new Error("Cannot find preview agent package: bricks/visual-builder");const i=m.current.contentWindow._preview_only_inject,a={...n,filePath:t?new URL(n.filePath,new URL(t,location.origin)).toString():`${location.origin}${(0,et.getBasePath)()}${null!==(e=window.PUBLIC_ROOT)&&void 0!==e?e:""}${n.filePath}`};Promise.allSettled(["visual-builder.pre-generated-table-view","visual-builder.pre-generated-container"].map((e=>i(e,a,void 0,!0)))).then((()=>{f(!0)}))}),[t,g]),(0,p.useEffect)((()=>{var e;if(!b)return;const t=null===(e=m.current)||void 0===e||null===(e=e.contentWindow)||void 0===e?void 0:e._preview_only_render;if(!t)return;const a=[{brick:"div",properties:{textContent:"属性",className:"head-cell"}},{brick:"div",properties:{textContent:"",className:"head-cell"}},{brick:"div",properties:{textContent:"类型",className:"head-cell"}},{brick:"div",properties:{textContent:"原始数据",className:"head-cell"}},{brick:"div",properties:{textContent:"视觉重量 (由低至高)",className:"head-cell",style:{gridColumn:"span 4",textAlign:"center"}}},{brick:"div",properties:{textContent:"确认",className:"head-cell"}},{brick:"div",properties:{className:"head-cell last-col-cell"},children:[{brick:"span",properties:{textContent:"批注"}},{brick:"span",properties:{className:"tips",textContent:"(补充提示词,按住 ⌘ 或 ctrl + 回车提交)"}}]}],r={brick:"visual-builder.pre-generated-table-view",context:[{name:"propertyToggleState",value:y.current,onChange:{action:"window.postMessage",args:[{channel:"raw-data-preview",type:"updatePropertyToggleState",payload:"<% CTX.propertyToggleState %>"}]}},{name:"propertyExpandState",value:w.current,onChange:{action:"window.postMessage",args:[{channel:"raw-data-preview",type:"updatePropertyExpandState",payload:"<% CTX.propertyExpandState %>"}]}},{name:"propertyApproveState",value:k.current,onChange:{action:"window.postMessage",args:[{channel:"raw-data-preview",type:"updatePropertyApproveState",payload:"<% CTX.propertyApproveState %>"}]}},{name:"busy"}],properties:{style:{gridTemplateColumns:"minmax(120px, 0.5fr) 32px auto repeat(5, 1fr) auto 1fr"}},children:a};for(let e=0,t=n.length;e<t;e++){var c,d;const r=n[e],o=e===t-1,s=new Map;for(const e of null!==(p=r.candidates)&&void 0!==p?p:[]){var p,u;s.set(null!==(u=e.visualWeight)&&void 0!==u?u:0,e)}a.push({brick:"div",properties:{className:A()("body-cell",{"last-row-cell":o})},children:[{brick:"span",properties:{textContent:`${null!==(c=r.propertyName)&&void 0!==c?c:r.propertyId}`}},{brick:"eo-button",properties:{className:"btn-toggle",type:"text",icon:`<%=\n {\n lib: "fa",\n prefix: "fas",\n icon: CTX.propertyToggleState.includes(${JSON.stringify(r.propertyId)}) ? "chevron-up" : "chevron-down",\n }\n %>`},events:{click:{action:"context.replace",args:["propertyToggleState",`<%\n CTX.propertyToggleState.includes(${JSON.stringify(r.propertyId)})\n ? CTX.propertyToggleState.filter((id) => id !== ${JSON.stringify(r.propertyId)})\n : CTX.propertyToggleState.concat(${JSON.stringify(r.propertyId)})\n %>`]}}}]},{brick:"div",properties:{className:A()("body-cell",{"last-row-cell":o})},children:null!==(d=r.candidates)&&void 0!==d&&d.length?[{brick:"eo-icon",properties:{lib:"fa",prefix:"fas",icon:"circle",style:{color:r.generationId?"var(--palette-green-6)":"var(--palette-gray-6)",transformOrigin:"center center",transform:"scale(0.5)"}}}]:void 0},{brick:"div",properties:{className:A()("body-cell",{"last-row-cell":o})},children:[{brick:"eo-link",properties:{type:"text",textContent:r.propertyType},events:{click:{action:"window.postMessage",args:[{channel:"raw-data-preview",type:"viewAttrPrompt",payload:r}]}}}]});let l=r.propertyValues;if(!l){var h,g;const e=(null!==(h=null!==(g=r.mockData)&&void 0!==g?g:i)&&void 0!==h?h:[]).slice();e.sort(((e,t)=>{const n=null==e?void 0:e[r.propertyId],i=null==t?void 0:t[r.propertyId],a=Array.isArray(n),o=Array.isArray(i);if(a||o)return(o?i.length:-1)-(a?n.length:-1);const s=null==n,l=null==i;if(s||l)return(l?0:1)-(s?0:1);const c="string"==typeof n&&0===n.length,d="string"==typeof i&&0===i.length;return c||d?(d?0:1)-(c?0:1):0})),l=e.map((e=>e[r.propertyId]))}a.push({brick:"div",properties:{className:A()("body-cell",{"last-row-cell":o})},children:[{brick:"div",properties:{className:"list"},children:l.map(((e,t)=>({brick:"div",if:0===t||`<%= CTX.propertyToggleState.includes(${JSON.stringify(r.propertyId)}) %>`,properties:{className:`<%= \`raw-content\${ CTX.propertyExpandState.includes(${JSON.stringify(r.propertyId)}) ? " expand" : "" }\` %>`,textContent:void 0===e?"":"string"==typeof e?e:JSON.stringify(e,null,2)}})))},{brick:"eo-button",properties:{className:"btn-toggle",type:"text",icon:`<%=\n {\n lib: "fa",\n prefix: "fas",\n icon: CTX.propertyExpandState.includes(${JSON.stringify(r.propertyId)}) ? "chevron-up" : "chevron-down",\n }\n %>`},events:{click:{action:"context.replace",args:["propertyExpandState",`<%\n CTX.propertyExpandState.includes(${JSON.stringify(r.propertyId)})\n ? CTX.propertyExpandState.filter((id) => id !== ${JSON.stringify(r.propertyId)})\n : CTX.propertyExpandState.concat(${JSON.stringify(r.propertyId)})\n %>`]}}}]});for(let e=-1;e<3;e++){const t=s.get(e);let n;t&&(n=(0,Rd.w)(t,r.propertyId)),a.push({brick:"div",properties:{className:A()("body-cell",{"last-row-cell":o})},children:[{brick:"div",properties:{className:"list"},children:n?l.map(((e,t)=>({brick:"visual-builder.pre-generated-container",if:0===t||`<%= CTX.propertyToggleState.includes(${JSON.stringify(r.propertyId)}) %>`,properties:{useBrick:[n],dataSource:{[r.propertyId]:e}},errorBoundary:!0}))):void 0}]})}a.push({brick:"div",properties:{className:A()("body-cell",{"last-row-cell":o})},children:r.candidates?[{brick:"eo-checkbox",properties:{value:`<%= CTX.propertyApproveState.includes(${JSON.stringify(r.propertyId)}) ? ["approved"] : [] %>`,options:[{label:"",value:"approved"}],disabled:`<%= CTX.busy || ${JSON.stringify(!r.generationId)} %>`},events:{change:[{action:"window.postMessage",args:[{channel:"raw-data-preview",type:"approve",payload:{approved:"<% EVENT.detail.length > 0 %>",propertyInstanceId:r.propertyInstanceId}}]},{action:"context.replace",args:["propertyApproveState",`<%\n EVENT.detail.length > 0\n ? CTX.propertyApproveState.concat(${JSON.stringify(r.propertyId)})\n : CTX.propertyApproveState.filter((id) => id !== ${JSON.stringify(r.propertyId)})\n %>`]}]}}]:void 0},{brick:"div",properties:{className:A()("body-cell",{"last-col-cell":!0,"last-row-cell":o})},children:r.candidates?[{brick:"eo-textarea",properties:{value:r.comment?`<% ${JSON.stringify(r.comment)} %>`:void 0,autoSize:!0,style:{width:"100%"},disabled:`<%= CTX.busy || ${JSON.stringify(!r.generationId)} || CTX.propertyApproveState.includes(${JSON.stringify(r.propertyId)}) %>`},events:{keydown:{if:"<% EVENT.code === 'Enter' && (EVENT.metaKey || EVENT.ctrlKey) %>",action:"window.postMessage",args:[{channel:"raw-data-preview",type:"comment",payload:{comment:"<% EVENT.target.value %>",propertyInstanceId:r.propertyInstanceId}}]}}}]:void 0})}t("yaml",{yaml:(0,Vl.safeDump)([r,{brick:"eo-message-listener",properties:{sameOrigin:!0},events:{message:{if:"<% EVENT.detail.data?.channel === 'raw-data-preview' && EVENT.detail.data.type === 'busy' %>",action:"context.replace",args:["busy","<% EVENT.detail.data.payload %>"]}},portal:!0,errorBoundary:!0}],{schema:Vl.JSON_SCHEMA,skipInvalid:!0,noRefs:!0,noCompatMode:!0})},{app:l,theme:o,uiVersion:s,styleText:Dd.A})}),[l,b,n,o,s,r,i]),u().createElement("div",{className:A()("container")},u().createElement("iframe",{ref:m,src:null!=t?t:`${(0,et.getBasePath)()}_brick-preview-v3_/preview/`,loading:"lazy",onLoad:E}))}_d=Sp,({e:[$d,Bd,Ud,Fd,zd,Vd,jd,Kd,Xd,Jd,Gd,Hd,qd,Yd,Zd,Qd,ep,tp,np,ip,ap,rp,op,sp,lp,cp,dp,pp],c:[gp,Pd]}=(0,d.A)(_d,[up("visual-builder.raw-data-preview",{styleTexts:[Wd.A]})],[[hp(),1,"previewUrl"],[hp({attribute:!1}),1,"generations"],[hp({attribute:!1}),1,"mocks"],[hp({type:Boolean}),1,"busy"],[hp(),1,"category"],[hp(),1,"theme"],[hp(),1,"uiVersion"],[hp(),1,"app"],[mp({type:"comment"}),1,"commentEvent",e=>(0,c.A)(xp,e),(e,t)=>(0,l.A)(xp,e,t)],[mp({type:"approve"}),1,"approveEvent",e=>(0,c.A)(Tp,e),(e,t)=>(0,l.A)(Tp,e,t)],[mp({type:"view.attr.prompt"}),1,"viewAttrPromptEvent",e=>(0,c.A)(Lp,e),(e,t)=>(0,l.A)(Lp,e,t)]],0,(e=>Ip.has((0,o.A)(e))),m.ReactNextElement)),Pd();var _p=n(50264);customElements.define("visual-builder.parse-path",(0,ms.createProviderClass)((async function(e,t){const n=[];return{regexp:(0,_p.MM)(e,n,(0,kt.defaults)(t,{end:!1,strict:!1,sensitive:!0})),keys:n}})));var Rp=n(80780);customElements.define("visual-builder.batch-update-raw-data-generated-view",(0,ms.createProviderClass)((async function(e){return Promise.allSettled(e.map((e=>{let{attrInstanceId:t,...n}=e;return(0,Rp._)("RAW_DATA_GENERATED_VIEW@EASYOPS",{...n,attr:[t]})})))})));var Wp=n(93084),Dp=n(67710),Pp=n(75799),$p=n(84671),Bp=n(28397),Up=n(83404),Fp=n(53287),zp=n(76);customElements.define("visual-builder.get-raw-data-system-prompts",(0,ms.createProviderClass)((function(){return{boolean:Wp,"date-time":Dp,enum:Pp,number:$p,others:Bp,"struct-list":Up,struct:Fp,json:zp}})));const Vp="bricks/visual-builder/pre-generated-config";function jp(e,t,n,i,a,r){let o=null;const s="bibytes"===i.unit?"bytes":i.unit;if("small"===e.size)switch(e.chartType){case"line":o={brick:"eo-mini-line-chart",properties:{data:t,xField:"time",yField:n,width:"auto",showArea:!0}};break;case"gauge":{var l;const a="percent(1)"===i.unit,r="percent(100)"===i.unit||"%"===i.unit;o={brick:"chart-v2.gauge-chart",properties:{data:t,xField:"time",yField:n,height:100,axis:{yAxis:{unit:s,precision:e.precision,min:e.min,max:null!==(l=e.max)&&void 0!==l?l:a?1:r?100:void 0}},thresholdColors:a||r?[{value:20,color:"cyan"},{value:90,color:"yellow"},{value:100,color:"red"}].map((e=>{let{value:t,color:n}=e;return{value:r?t:t/100,color:`<% THEME.getCssPropertyValue(${JSON.stringify(`--palette-${n}-5`)}) %>`}})):void 0}};break}}else switch(e.chartType){case"line":case"area":o={brick:"chart-v2.time-series-chart",properties:{data:t,xField:"time",yFields:null!=a?a:[n],height:"large"===e.size?230:200,timeFormat:"HH:mm",areaOpacity:"line"===e.chartType?0:void 0,axis:{yAxis:{unit:s,precision:e.precision,min:e.min,max:e.max,shape:"smooth"}},...r?{forceAbsoluteNumbers:!0,series:{[r]:{isNegative:!0}}}:null,areaShape:"smooth",legends:"large"===e.size}}}return o}wi.i18n.getFixedT(null,Vp);var Kp=n(98027);function Xp(e){const{children:t,slots:n,...i}=e;return{...i,slots:Jp(t,n)}}function Jp(e,t){let n=t;if(Array.isArray(e)&&!n){n={};for(const{slot:t,...i}of e){const e=null!=t?t:"";(0,ms.hasOwnProperty)(n,e)||(n[e]={type:"bricks",bricks:[]}),n[e].bricks.push(Xp(i))}}return n}var Gp,Hp=n(18488),qp=n(92120);let Yp,Zp,Qp,eu,tu,nu,iu,au,ru,ou,su,lu,cu,du,pu;(0,wi.initializeI18n)(Vp,{en:{},zh:{}});const{defineElement:uu,property:hu,event:mu}=(0,h.createDecorators)();let gu;var vu,bu=new WeakMap,fu=new WeakMap,Au=new WeakMap,yu=new WeakMap,wu=new WeakMap,ku=new WeakMap,Eu=new WeakSet,xu=new WeakMap;class Nu extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Eu),(0,r.A)(this,bu,Zp(this)),(0,r.A)(this,fu,(Qp(this),eu(this))),(0,r.A)(this,Au,(tu(this),nu(this))),(0,r.A)(this,yu,(iu(this),au(this))),(0,r.A)(this,wu,(ru(this),ou(this))),(0,r.A)(this,ku,(su(this),lu(this))),(0,r.A)(this,xu,(pu(this),e=>{(0,s.A)(Eu,this,cu).emit(e)}))}get previewUrl(){return(0,c.A)(bu,this)}set previewUrl(e){(0,l.A)(bu,this,e)}get attrList(){return(0,c.A)(fu,this)}set attrList(e){(0,l.A)(fu,this,e)}get mockList(){return(0,c.A)(Au,this)}set mockList(e){(0,l.A)(Au,this,e)}get metricGroups(){return(0,c.A)(yu,this)}set metricGroups(e){(0,l.A)(yu,this,e)}get containerConfig(){return(0,c.A)(wu,this)}set containerConfig(e){(0,l.A)(wu,this,e)}render(){return u().createElement(Mu,{previewUrl:this.previewUrl,attrList:this.attrList,mockList:this.mockList,metricGroups:this.metricGroups,containerConfig:this.containerConfig,onBrickChange:(0,c.A)(xu,this),root:this})}}function Mu(e){let{previewUrl:t,attrList:n,mockList:i,metricGroups:a,containerConfig:r,root:o,onBrickChange:s}=e;const l=(0,p.useRef)(),[c,d]=(0,p.useState)(!1),[h,m]=(0,p.useState)(!1),[g,v]=(0,p.useState)(null),[b,f]=(0,p.useState)(null),A=(0,p.useRef)(null),y=(0,p.useRef)(null),w=(0,p.useMemo)((()=>(0,kt.uniqueId)("event-agent-")),[]),k="chart"===(null==r?void 0:r.type)?"chart":"grouped-chart"===(null==r?void 0:r.type)?"grouped-chart":"default",E=(0,p.useMemo)((()=>"default"===k?n:null==n?void 0:n.filter((e=>e.metricKey))),[n,k]),x=(0,p.useMemo)((()=>"grouped-chart"===k?function(e,t){var n,i;const a=new Map(e.map((e=>[e.id,e]))),r=[];t.forEach(((e,t)=>{const n=[];for(const t of e.metrics){const e=a.get(t);e&&(a.delete(t),n.push(e))}n.length&&r.push({id:t,group:e.group,metrics:n,counter:e.counter})}));const o=(null!==(n=null===(i=r[r.length-1])||void 0===i?void 0:i.id)&&void 0!==n?n:-1)+1;return r.push(...[...a.values()].map(((e,t)=>({id:o+t,group:"",metrics:[e]})))),r}(E,a):E),[a,E,k]);(0,p.useEffect)((()=>{f(null),A.current=null,y.current=null}),[x]),(0,p.useEffect)((()=>{if(g){const e=g.selectedIds.sort(((e,t)=>g.orderedIds.indexOf(e)-g.orderedIds.indexOf(t))).map((e=>x.find((t=>t.id===e)))).filter(Boolean),t=new Map(g.weightMapLiteral),n=new Map(g.groupMapLiteral),i=function(e,t){var n;let{type:i,dataName:a,dataType:r,settings:o}=t;if(!i||!a||0===e.length)return null;const s=`${"state"===r?"STATE":"CTX"}${(0,Kp._)(a)}`;if("chart"===i||"grouped-chart"===i){const t=e,n=`<%= ${s}${null!=o&&o.pagination||null!=o&&o.wrapper?".list":""} %>`,i=t.map((e=>{let{candidate:t,meta:i}=e;return jp({...t,min:i.counterMetricKey?void 0:t.min},n,i.metric.metricKey,{unit:i.metric.unit},i.groupedMetricKeys,i.counterMetricKey)}));return 1===i.length?i[0]:{brick:"eo-grid-layout",properties:{templateColumns:"repeat(auto-fill, minmax(500px, 1fr))",gap:"var(--card-content-gap)"},slots:{"":{type:"bricks",bricks:i}}}}const l=e;if("cards"===i)return{brick:"eo-grid-layout",properties:{templateColumns:"repeat(auto-fill, minmax(260px, 1fr))",gap:"var(--card-content-gap)"},slots:{"":{type:"bricks",bricks:[{brick:":forEach",dataSource:`<%= ${s}${null!=o&&o.pagination||null!=o&&o.wrapper?".list":""} %>`,slots:{"":{type:"bricks",bricks:[{brick:"eo-card-item",properties:{cardTitle:(0,kt.has)(null==o?void 0:o.fields,"title")&&"string"==typeof o.fields.title?`<% ITEM${(0,Kp._)(o.fields.title)} %>`:void 0,description:(0,kt.has)(null==o?void 0:o.fields,"description")&&"string"==typeof o.fields.description?`<% ITEM${(0,Kp._)(o.fields.description)} %>`:void 0}}]}}}]}}};const c=`<%= ${null!=o&&o.pagination?null!=o&&null!==(n=o.fields)&&void 0!==n&&n.pageSize?`{...${s},pageSize: ${s}${(0,Kp._)(o.fields.pageSize)}}`:s:null!=o&&o.wrapper?s:`{ list: ${s} }`} %>`,d=new Map;for(const e of l)if(e.candidate){const t="table"===i?(0,Rd.m)(e.candidate,".cellData"):(0,Rd.w)(e.candidate,e.meta.attr.id);t&&d.set(e.meta.attr.id,Xp(t))}const p=Object.fromEntries(l.map((e=>{const t=d.get(e.meta.attr.id);return t?[`[${e.meta.attr.id}]`,{type:"bricks",bricks:[t]}]:null})).filter(Boolean));switch(i){case"table":return{brick:"eo-next-table",properties:{rowKey:"instanceId",columns:l.map((e=>{let{meta:{attr:t}}=e;const n={title:t.name,dataIndex:t.id,key:t.id};return d.has(t.id)&&(n.useChildren=`[${t.id}]`),n})),dataSource:c,...null!=o&&o.pagination?null:{pagination:!1}},slots:p};case"descriptions":return{brick:"eo-descriptions",properties:{column:2,list:l.map((e=>{let{candidate:t,meta:{attr:n}}=e;const i={label:n.name};return t&&(i.useChildren=`[${n.id}]`),i})),dataSource:c},slots:p}}return null}(e.map((e=>{var i;const r=Tu(k,E,a,e,n),o="grouped-chart"===r.viewType?null===(i=r.metric.candidates)||void 0===i?void 0:i.filter((e=>"small"!==e.size)):e.candidates;return{candidate:null==o?void 0:o.find((n=>n.visualWeight===t.get(e.id))),meta:r}})),r);s(i)}}),[g,r,x,a,s,E,k]);const N=(0,p.useCallback)((()=>{const e=()=>{var t;const n=null===(t=l.current)||void 0===t?void 0:t.contentWindow;null!=n&&n._preview_only_render?d(!0):setTimeout(e,100)};e()}),[]);return(0,p.useEffect)((()=>{var e;const t=null===(e=l.current)||void 0===e?void 0:e.contentWindow;if(!c||!t)return;const n=new ResizeObserver((()=>{o.style.height=`${t.document.body.scrollHeight}px`}));return n.observe(t.document.body),()=>n.disconnect()}),[c,o]),(0,p.useEffect)((()=>{var e;if(!c)return;const t=null===(e=l.current)||void 0===e?void 0:e.contentWindow,n=e=>{let{data:t}=e;if("pre-generated-config"===(null==t?void 0:t.channel))switch(t.type){case"config-change":v(t.payload);break;case"group-change":f((e=>new Map([...null!=e?e:[],[t.payload.id,t.payload.metrics]])));break;case"order-change":y.current=t.payload.orderedIds;break;case"selection-change":A.current=t.payload.selectedIds}};return t.addEventListener("message",n),()=>{t.removeEventListener("message",n)}}),[c]),(0,p.useEffect)((()=>{var e;if(!c)return;const n=et.__secret_internals.getBrickPackagesById("bricks/visual-builder");if(!n)throw new Error("Cannot find preview agent package: bricks/visual-builder");const i=l.current.contentWindow._preview_only_inject,a={...n,filePath:t?new URL(n.filePath,new URL(t,location.origin)).toString():`${location.origin}${(0,et.getBasePath)()}${null!==(e=window.PUBLIC_ROOT)&&void 0!==e?e:""}${n.filePath}`};Promise.allSettled([i("visual-builder.pre-generated-container",a,void 0,!0)]).then((()=>{m(!0)}))}),[t,c]),(0,p.useEffect)((()=>{var e,t,n,r,o;if(!h)return;const s=null===(e=l.current)||void 0===e||null===(e=e.contentWindow)||void 0===e?void 0:e._preview_only_render;if(!s)return;const c=y.current,d=A.current,p=c?c.map((e=>x.find((t=>t.id===e)))).filter(Boolean):x,u=d?p.filter((e=>d.includes(e.id))):null!==(t=null==p?void 0:p.slice(0,5))&&void 0!==t?t:[],m=null!=d?d:u.map((e=>e.id));s("yaml",{yaml:(0,Vl.safeDump)([{brick:"eo-next-table",errorBoundary:!0,properties:{injectChartV2Styles:!0,pagination:!1,rowSelection:!0,rowKey:"id",rowDraggable:!0,bordered:!0,dataSource:{list:p},selectedRowKeys:m,columns:[..."chart"===k?[{title:"指标名",dataIndex:"id",key:"id",width:"20%"},{title:"指标别名",dataIndex:"name",key:"name",width:"20%"}]:"grouped-chart"===k?[{title:"指标组",dataIndex:"id",key:"id",width:"40%",useBrick:{brick:"eo-select",properties:{options:"<% CTX.metricOptions %>",mode:"multiple",value:"<% CTX.groupMap.get(DATA.cellData) ?? DATA.rowData.metrics.map((metric) => metric.id) %>",dropdownHoist:!0},events:{change:{action:"window.postMessage",args:[{channel:"pre-generated-config",type:"group-change",payload:"<% { id: DATA.cellData, metrics: EVENT.detail.value } %>"}]}}}}]:[{title:"ID",dataIndex:"id",key:"id",width:"20%"},{title:"名称",dataIndex:"name",key:"name",width:"20%"}],{title:"预览",dataIndex:"preview",key:"preview",useBrick:{brick:"div",children:null==x?void 0:x.flatMap((e=>{var t,n,r;const o=Tu(k,E,a,e,b);let s,l;var c,d;"grouped-chart"===o.viewType?(l=null==i?void 0:i.map((e=>(0,kt.pick)(e,["time",...o.groupedMetricKeys]))),s=null===(c=o.metric.candidates)||void 0===c?void 0:c.filter((e=>"small"!==e.size))):(s=e.candidates,l="chart"===o.viewType?null==i?void 0:i.map((e=>(0,kt.pick)(e,["time",o.metric.metricKey]))):null!==(d=null==i?void 0:i[0])&&void 0!==d?d:{});const p=null===(t=s)||void 0===t?void 0:t.map((t=>{const n=`<%=\n DATA.rowData.id === ${JSON.stringify(e.id)} &&\n ${JSON.stringify(t.visualWeight)} === CTX.weightMap.get(${JSON.stringify(e.id)})\n %>`,i="default"===o.viewType?(0,Rd.w)(t,e.id):jp({...t,min:o.counterMetricKey?void 0:t.min},"<% DATA %>",o.metric.metricKey,{unit:o.metric.unit},o.groupedMetricKeys,o.counterMetricKey);if(i)return{if:n,brick:"visual-builder.pre-generated-container",properties:{useBrick:i,dataSource:l}}})).filter(Boolean);return null!=p&&p.length?p:{if:`<% DATA.rowData.id === ${JSON.stringify(e.id)} %>`,brick:"span",properties:{textContent:null!==(n=null==i||null===(r=i[0])||void 0===r?void 0:r[e.id])&&void 0!==n?n:""}}}))}},{dataIndex:"operations",key:"operations",width:81,headerBrick:{useBrick:{brick:"eo-mini-actions",properties:{actions:'<%=\n [\n {\n icon: {\n lib: "antd",\n icon: "minus",\n },\n event: "minus",\n disabled: [...CTX.weightMap].every(([id, v]) => v <= CTX.availableWeights.get(id)[0]),\n },\n {\n icon: {\n lib: "antd",\n icon: "plus",\n },\n event: "plus",\n disabled: [...CTX.weightMap].every(([id, v]) => v >= CTX.availableWeights.get(id).slice(-1)[0]),\n },\n ]\n %>'},events:{minus:{action:"context.replace",args:["weightMap","<% FN.updateWeightMap(CTX.weightMap, CTX.availableWeights, null, -1) %>"]},plus:{action:"context.replace",args:["weightMap","<% FN.updateWeightMap(CTX.weightMap, CTX.availableWeights, null, 1) %>"]}}}},useBrick:{if:"<% CTX.availableWeights.get(DATA.rowData.id)?.length %>",brick:"eo-mini-actions",properties:{actions:'<%=\n [\n {\n icon: {\n lib: "antd",\n icon: "minus",\n },\n event: "minus",\n disabled: CTX.weightMap.get(DATA.rowData.id) <= CTX.availableWeights.get(DATA.rowData.id)[0],\n },\n {\n icon: {\n lib: "antd",\n icon: "plus",\n },\n event: "plus",\n disabled: CTX.weightMap.get(DATA.rowData.id) >= CTX.availableWeights.get(DATA.rowData.id).slice(-1)[0],\n },\n ]\n %>'},events:{minus:{action:"context.replace",args:["weightMap","<% FN.updateWeightMap(CTX.weightMap, CTX.availableWeights, DATA.rowData.id, -1) %>"]},plus:{action:"context.replace",args:["weightMap","<% FN.updateWeightMap(CTX.weightMap, CTX.availableWeights, DATA.rowData.id, 1) %>"]}}}}]},events:{"row.select":{action:"context.replace",args:["selectedItems","<%= EVENT.detail.rows %>"]},"row.drag":{action:"context.replace",args:["orderedIds","<%= EVENT.detail.list.map((attr) => attr.id) %>"]}}},{brick:"eo-event-agent",properties:{id:w},events:{trigger:{action:"window.postMessage",args:[{channel:"pre-generated-config",type:"config-change",payload:"<% FN.getPreConfig(CTX.selectedItems, CTX.orderedIds, CTX.weightMap, CTX.groupMap) %>"}]}},lifeCycle:{onPageLoad:{target:`#${w}`,method:"trigger"}},portal:!0,errorBoundary:!0}],{skipInvalid:!0})},{theme:"light",uiVersion:"8.2",styleText:qp.A,context:[{name:"orderedIds",value:null!==(n=null==E?void 0:E.map((e=>e.id)))&&void 0!==n?n:[],onChange:[{target:`#${w}`,method:"trigger"},..."grouped-chart"===k?[{action:"window.postMessage",args:[{channel:"pre-generated-config",type:"order-change",payload:{orderedIds:"<% EVENT.detail %>"}}]}]:[]]},{name:"selectedItems",value:u,onChange:[{target:`#${w}`,method:"trigger"},..."grouped-chart"===k?[{action:"window.postMessage",args:[{channel:"pre-generated-config",type:"selection-change",payload:{selectedIds:"<% EVENT.detail.map((item) => item.id) %>"}}]}]:[]]},{name:"availableWeights",value:`<% new Map(${JSON.stringify(null!==(r=null==x?void 0:x.map((e=>{var t,n;return[e.id,null!==(t=null===(n=("grouped-chart"===k?e.metrics[0]:e).candidates)||void 0===n?void 0:n.filter((e=>"grouped-chart"!==k||"small"!==e.size)).map((e=>e.visualWeight)).sort(((e,t)=>e-t)))&&void 0!==t?t:[]]})))&&void 0!==r?r:[])}) %>`},{name:"weightMap",value:`<% new Map(${JSON.stringify(null!==(o=null==x?void 0:x.map((e=>{var t,n,i,a;return[e.id,null===(i=null===(n=("grouped-chart"===k?e.metrics[0]:e).candidates)||void 0===n?void 0:n.filter((e=>"grouped-chart"!==k||"small"!==e.size)),a="grouped-chart"===k?2:0,t=null==i?void 0:i.reduce(((e,t)=>!e||Math.abs(t.visualWeight-a)<Math.abs(e.visualWeight-a)?t:e)))||void 0===t?void 0:t.visualWeight]})))&&void 0!==o?o:[])}) %>`,onChange:{target:`#${w}`,method:"trigger"}},{name:"groupMap",value:`<% new Map(${JSON.stringify([...null!=b?b:[]])}) %>`},..."grouped-chart"===k?[{name:"metricOptions",value:null==E?void 0:E.map((e=>({label:e.metricKey,value:e.id})))}]:[]],functions:[{name:"updateWeightMap",source:"/**\n * @param {Map<string, number>} weightMap\n * @param {Map<string, number[]>} availableWeights\n * @param {string | null} key\n * @param {1 | -1} direction\n * @returns {Map<string, number>}\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction updateWeightMap(weightMap, availableWeights, key, direction) {\n return new Map([...weightMap].map(_ref => {\n let [k, v] = _ref;\n if (key === null || k === key) {\n const weights = availableWeights.get(k);\n const index = weights.indexOf(v);\n const nextIndex = Math.max(0, Math.min(index + direction, weights.length - 1));\n return [k, weights[nextIndex]];\n }\n return [k, v];\n }));\n}"},{name:"getPreConfig",source:"\n function getPreConfig(selectedItems, orderedIds, weightMap, groupMap) {\n return {\n selectedIds: selectedItems.map((item) => item.id),\n orderedIds,\n weightMapLiteral: [...weightMap],\n groupMapLiteral: [...groupMap],\n };\n }\n "}]})}),[n,r,h,a,i,w,x,k,E,b]),u().createElement("div",{className:"container"},u().createElement("iframe",{ref:l,src:null!=t?t:`${(0,et.getBasePath)()}_brick-preview-v3_/preview/`,loading:"lazy",onLoad:N}))}function Tu(e,t,n,i,a){if("grouped-chart"===e){var r;const o=i,s=null==a?void 0:a.get(o.id);let l;l=s?t.filter((e=>s.includes(e.id))):o.metrics;const c=l[0],d=l.map((e=>e.metricKey));let p;if(o.counter&&2===l.length)for(const e of n)if(2===e.metrics.length&&e.counter===o.counter&&l.every((t=>e.metrics.includes(t.id)))){p=l.find((e=>e.id===o.counter));break}return{viewType:e,metric:c,groupedMetricKeys:d,counterMetricKey:null===(r=p)||void 0===r?void 0:r.metricKey}}return"chart"===e?{viewType:e,metric:i}:{viewType:e,attr:i}}let Cu,Lu,Iu,Su,Ou,_u,Ru,Wu,Du;Gp=Nu,({e:[Zp,Qp,eu,tu,nu,iu,au,ru,ou,su,lu,cu,du,pu],c:[gu,Yp]}=(0,d.A)(Gp,[uu("visual-builder.pre-generated-config",{styleTexts:[Hp.A]})],[[hu(),1,"previewUrl"],[hu({attribute:!1}),1,"attrList"],[hu({attribute:!1}),1,"mockList"],[hu({attribute:!1}),1,"metricGroups"],[hu({attribute:!1}),1,"containerConfig"],[mu({type:"brick.change"}),1,"brickChangeEvent",e=>(0,c.A)(ku,e),(e,t)=>(0,l.A)(ku,e,t)]],0,(e=>xu.has((0,o.A)(e))),m.ReactNextElement)),Yp();const{defineElement:Pu,property:$u}=(0,h.createDecorators)();let Bu;var Uu=new WeakMap,Fu=new WeakMap,zu=new WeakMap,Vu=new WeakMap;class ju extends m.ReactNextElement{constructor(){super(...arguments),(0,r.A)(this,Uu,Lu(this)),(0,r.A)(this,Fu,(Iu(this),Su(this))),(0,r.A)(this,zu,(Ou(this),_u(this))),(0,r.A)(this,Vu,(Ru(this),Wu(this))),Du(this)}get previewUrl(){return(0,c.A)(Uu,this)}set previewUrl(e){(0,l.A)(Uu,this,e)}get container(){return(0,c.A)(Fu,this)}set container(e){(0,l.A)(Fu,this,e)}get attrList(){return(0,c.A)(zu,this)}set attrList(e){(0,l.A)(zu,this,e)}get mockList(){return(0,c.A)(Vu,this)}set mockList(e){(0,l.A)(Vu,this,e)}render(){return u().createElement(Ku,{root:this,previewUrl:this.previewUrl,container:this.container,attrList:this.attrList,mockList:this.mockList})}}function Ku(e){let{root:t,previewUrl:n,container:i,attrList:a,mockList:r}=e;const o=(0,p.useRef)(),[s,l]=(0,p.useState)(!1),c=(0,p.useCallback)((()=>{const e=()=>{var t;const n=null===(t=o.current)||void 0===t?void 0:t.contentWindow;null!=n&&n._preview_only_render?l(!0):setTimeout(e,100)};e()}),[]);return(0,p.useEffect)((()=>{var e;const n=null===(e=o.current)||void 0===e?void 0:e.contentWindow;if(!s||!n)return;const i=new ResizeObserver((()=>{t.style.height=`${n.document.body.scrollHeight}px`}));return i.observe(n.document.body),()=>i.disconnect()}),[s,t]),(0,p.useEffect)((()=>{var e,t;const n=null===(e=o.current)||void 0===e||null===(e=e.contentWindow)||void 0===e?void 0:e._preview_only_render;if(!s||!n||!a)return;let l;l="descriptions"===i?{brick:"eo-descriptions",errorBoundary:!0,properties:{column:2,list:a.map((e=>{const t={label:e.name};return e.config&&(t.useBrick=(0,Rd.w)(e.config,e.id)),t})),dataSource:null==r?void 0:r[0]}}:{brick:"eo-next-table",errorBoundary:!0,properties:{rowKey:null===(t=a[0])||void 0===t?void 0:t.id,columns:a.map((e=>{const t={title:e.name,dataIndex:e.id,key:e.id};return e.config&&(t.useBrick=(0,Rd.m)(e.config,".cellData")),t})),dataSource:{list:r,page:1,pageSize:20}}},n("yaml",{yaml:(0,Vl.safeDump)([l],{skipInvalid:!0})},{theme:"light",uiVersion:"8.2",styleText:qp.A})}),[s,a,r,i]),u().createElement("div",{className:"container"},u().createElement("iframe",{ref:o,src:null!=n?n:`${(0,et.getBasePath)()}_brick-preview-v3_/preview/`,loading:"lazy",onLoad:c}))}vu=ju,({e:[Lu,Iu,Su,Ou,_u,Ru,Wu,Du],c:[Bu,Cu]}=(0,d.A)(vu,[Pu("visual-builder.pre-generated-config-preview",{styleTexts:[Hp.A]})],[[$u(),1,"previewUrl"],[$u(),1,"container"],[$u({attribute:!1}),1,"attrList"],[$u({attribute:!1}),1,"mockList"]],0,void 0,m.ReactNextElement)),Cu();var Xu=n(8406);function Ju(e){const t=[];for(let n=-1;n<3;n++){const i="percent(1)"===e.unit,a="percent(100)"===e.unit||"%"===e.unit,r=n<=0?"small":1===n?"medium":"large";if(i||a||n>=0){const o=-1===n?"gauge":2===n?"area":"line";t.push({visualWeight:n,chartType:o,size:r,min:0,precision:i||a?1:"double"===e.dataType?2:0})}}return t}function Gu(e,t,n){let i=[];switch(e){case"list":i=[{label:"表格",value:"table"},{label:"卡片列表",value:"cards"}];break;case"list-with-pagination":i=[{label:"表格",value:"table",settings:{pagination:!0,fields:t}},{label:"卡片列表",value:"cards",settings:{pagination:!0,fields:t}}];break;case"list-with-wrapper":i=[{label:"属性详情",value:"descriptions"},{label:"表格",value:"table",settings:{wrapper:!0,fields:t}},{label:"卡片列表",value:"cards",settings:{wrapper:!0}}];break;case"object":return[{label:"属性详情",value:"descriptions"}];default:return[]}let a=0,r=0;for(const e of n)e.metricKey?a++:r++;const o="list-with-pagination"===e?{pagination:!0}:"list-with-wrapper"===e?{wrapper:!0}:void 0;return a>0&&i.push({label:"图表",value:"chart",settings:o,prefer:a>r&&a<6}),a>1&&i.push({label:"组合图表",value:"grouped-chart",settings:o,prefer:a>r&&a>=6}),i}async function Hu(e,t,n){const i=[],a=[],[r,o]=e.split("@"),{list:s}=await(0,Xu.y)("MODEL_OBJECT",{fields:["name","objectId","attrList.id","attrList.name","attrList.generatedView.list","parentObjectIds","metricGroups"],query:{objectId:r,ignore:{$ne:!0},...o?{"space.name":o}:{space:{$exists:!1}}},page:1});if(0===s.length)console.warn("Can not find object by objectId:",e);else{const{attrList:r,parentObjectIds:o,metricGroups:l}=s[0];if(null!=o&&o.length){const e=await Promise.all(o.map((e=>Hu(e,t,n))));for(const t of e)i.push(...t.attrList),a.push(...t.metricGroups)}if(i.push(...r.map((e=>{var n;return t.has(e.id)?{id:e.id,name:e.name,candidates:null===(n=e.generatedView)||void 0===n||null===(n=n[0])||void 0===n?void 0:n.list}:null})).filter(Boolean)),null!=l&&l.length&&a.push(...l),n){const{list:n}=await(0,Xu.y)("_COLLECTOR_ALIAS_METRIC",{fields:["name","displayName","unit","dataType"],page_size:3e3,query:{dataType:{$ne:"string"},objectId:e},sort:[{key:"name",order:1}]});i.push(...n.map((e=>{const n=e.displayName&&t.has(e.displayName);return n||t.has(e.name)?{id:e.name,name:e.displayName,metricKey:n?e.displayName:e.name,unit:e.unit,candidates:Ju(e)}:null})).filter(Boolean))}}return{attrList:i,metricGroups:a}}customElements.define("visual-builder.get-config-by-data-for-ai",(0,ms.createProviderClass)((async function(e){if(null==(null==e?void 0:e.value))return null;const{value:t}=e;let n,i,a="unknown",r=[];if(Array.isArray(t))t.length>0&&(a="list",n=t[0],r=t);else if((0,kt.isObject)(t)){const e=t;(0,ms.hasOwnProperty)(e,"list")&&Array.isArray(e.list)?(e.list.length>0&&(a=(0,ms.hasOwnProperty)(e,"page")&&"number"==typeof e.page&&(0,ms.hasOwnProperty)(e,"total")&&"number"==typeof e.total?"list-with-pagination":"list-with-wrapper",n=e.list[0],r=e.list),"list-with-pagination"===a&&"number"==typeof e.page_size&&"number"!=typeof e.pageSize&&(i={pageSize:"page_size"})):(a="object",n=t,r=[n])}const o=new Set;for(const e of r){if(!(0,kt.isObject)(e)){a="unknown";break}for(const t of Object.keys(e))o.add(t)}let s=[],l=[];if("unknown"!==a&&(0,kt.isObject)(n)&&(0,ms.hasOwnProperty)(n,"_object_id")&&"string"==typeof n._object_id){const e=n._object_id,t="object"!==a&&(0,ms.hasOwnProperty)(n,"time")&&"number"==typeof n.time;({attrList:s,metricGroups:l}=await Hu(e,o,t))}else console.warn("Can not detect objectId with data:",e),s=[...o].map((e=>({id:e,name:e})));return 0===s.length&&(a="unknown"),{type:a,attrList:s,metricGroups:l,dataList:r,containerOptions:Gu(a,i,s)}})));var qu,Yu=n(38350),Zu=n(54982);let Qu,eh,th,nh,ih,ah,rh,oh,sh,lh,ch,dh,ph,uh,hh;const{defineElement:mh,property:gh}=(0,h.createDecorators)();let vh;var bh=new WeakMap,fh=new WeakMap,Ah=new WeakMap,yh=new WeakMap,wh=new WeakMap,kh=new WeakMap,Eh=new WeakMap;class xh extends m.ReactNextElement{constructor(){super(...arguments),(0,r.A)(this,bh,eh(this)),(0,r.A)(this,fh,(th(this),nh(this))),(0,r.A)(this,Ah,(ih(this),ah(this))),(0,r.A)(this,yh,(rh(this),oh(this))),(0,r.A)(this,wh,(sh(this),lh(this))),(0,r.A)(this,kh,(ch(this),dh(this))),(0,r.A)(this,Eh,(ph(this),uh(this))),hh(this)}get previewUrl(){return(0,c.A)(bh,this)}set previewUrl(e){(0,l.A)(bh,this,e)}get generations(){return(0,c.A)(fh,this)}set generations(e){(0,l.A)(fh,this,e)}get grouped(){return(0,c.A)(Ah,this)}set grouped(e){(0,l.A)(Ah,this,e)}get busy(){return(0,c.A)(yh,this)}set busy(e){(0,l.A)(yh,this,e)}get theme(){return(0,c.A)(wh,this)}set theme(e){(0,l.A)(wh,this,e)}get uiVersion(){return(0,c.A)(kh,this)}set uiVersion(e){(0,l.A)(kh,this,e)}get app(){return(0,c.A)(Eh,this)}set app(e){(0,l.A)(Eh,this,e)}render(){return u().createElement(Nh,{root:this,previewUrl:this.previewUrl,generations:this.generations,grouped:this.grouped,busy:this.busy,theme:this.theme,uiVersion:this.uiVersion,app:this.app})}}function Nh(e){let{root:t,previewUrl:n,generations:i,grouped:a,busy:r,theme:o,uiVersion:s,app:l}=e;const c=(0,p.useRef)(),[d,h]=(0,p.useState)(!1),[m,g]=(0,p.useState)(!1),v=(0,p.useCallback)((()=>{const e=()=>{var t;const n=null===(t=c.current)||void 0===t?void 0:t.contentWindow;null!=n&&n._preview_only_render?h(!0):setTimeout(e,100)};e()}),[]);return(0,p.useEffect)((()=>{d&&c.current.contentWindow.postMessage({channel:"raw-metric-preview",type:"busy",payload:r},location.origin)}),[r,d]),(0,p.useEffect)((()=>{if(d){const e=c.current.contentWindow,n=e=>{let{data:n}=e;"raw-metric-preview"===(null==n?void 0:n.channel)&&"resize"===n.type&&(t.style.height=`${n.payload.height+2}px`)};return e.addEventListener("message",n),()=>{e.removeEventListener("message",n)}}}),[d,t]),(0,p.useEffect)((()=>{var e;if(!d)return;const t=Od.getBrickPackagesById("bricks/visual-builder");if(!t)throw new Error("Cannot find preview agent package: bricks/visual-builder");const i=c.current.contentWindow._preview_only_inject,a={...t,filePath:n?new URL(t.filePath,new URL(n,location.origin)).toString():`${location.origin}${(0,et.getBasePath)()}${null!==(e=window.PUBLIC_ROOT)&&void 0!==e?e:""}${t.filePath}`};Promise.allSettled(["visual-builder.pre-generated-table-view","visual-builder.pre-generated-container"].map((e=>i(e,a,void 0,!0)))).then((()=>{g(!0)}))}),[n,d]),(0,p.useEffect)((()=>{var e;if(!m)return;const t=null===(e=c.current)||void 0===e||null===(e=e.contentWindow)||void 0===e?void 0:e._preview_only_render;if(!t)return;const n=[...a?[{brick:"div",properties:{textContent:"分组",className:"head-cell"}}]:[],{brick:"div",properties:{textContent:"指标",className:"head-cell"}},{brick:"div",properties:{textContent:"别名",className:"head-cell"}},{brick:"div",properties:{textContent:"",className:"head-cell"}},{brick:"div",properties:{textContent:"视觉重量 (由低至高)",className:"head-cell",style:{gridColumn:"span 4",textAlign:"center"}}}],r={brick:"visual-builder.pre-generated-table-view",context:[{name:"busy"}],properties:{style:{gridTemplateColumns:(a?"minmax(129px, 0.5fr) ":"")+"minmax(120px, 0.8fr) minmax(120px, 0.5fr) 32px repeat(2, 0.6fr) repeat(2, 1fr)"}},children:n},d=new Set,p=new Map;for(const e of i){const t=e.groupIndex;if(null!=t){var u;const n=null!==(u=p.get(t))&&void 0!==u?u:[];p.set(t,n.concat(e))}}for(let e=0,t=i.length;e<t;e++){var h,g,v;const r=i[e],o=e===t-1;let s,l=!1,c=!1;if(a){const{groupIndex:i}=r;if(null==i)n.push({brick:"div",properties:{textContent:"",className:A()("body-cell",{"last-row-cell":o})}});else if(d.has(i))c=!0;else{d.add(i),s=p.get(i);const a=s.length;l=e+a-1==t-1,n.push({brick:"div",properties:{textContent:r.group,className:A()("body-cell",{"last-row-cell":l}),style:{gridRow:`span ${a}`}}})}}n.push({brick:"div",properties:{className:A()("body-cell",{"last-row-cell":o})},children:[{brick:"span",properties:{textContent:`${r.propertyId}`}}]},{brick:"div",properties:{className:A()("body-cell",{"last-row-cell":o})},children:[{brick:"span",properties:{textContent:`${r.propertyName||""}`}}]},{brick:"div",properties:{className:A()("body-cell",{"last-row-cell":o})},children:null!==(h=r.candidates)&&void 0!==h&&h.length||r.mockData?[{brick:"eo-icon",properties:{lib:"fa",prefix:null!==(g=r.candidates)&&void 0!==g&&g.length?"fas":"far",icon:"circle",style:{color:r.generationId&&null!==(v=r.candidates)&&void 0!==v&&v.length?"var(--palette-green-6)":"var(--palette-gray-6)",transformOrigin:"center center",transform:"scale(0.5)"}}}]:void 0});const u=r.propertyName||r.propertyId,m=Ju({name:r.propertyId,displayName:r.propertyName,unit:r.propertyUnit,dataType:r.propertyDataType});for(let e=-1;e<3;e++){var b;const t=m.find((t=>t.visualWeight===e)),i="percent(1)"===r.propertyUnit,a="percent(100)"===r.propertyUnit||"%"===r.propertyUnit;let d;const p=e<=0?"small":1===e?"medium":"large",h="small"!==p&&c,g=r.counter?null===(b=s)||void 0===b?void 0:b.find((e=>e.propertyId===r.counter)):void 0,v=(null==g?void 0:g.propertyName)||(null==g?void 0:g.propertyId);if(h)continue;const y="small"!==p&&s;var f;r.mockData&&(i||a||e>=0)&&(d=jp({...t,min:v?void 0:t.min},"<% DATA %>",u,{unit:r.propertyUnit},null===(f=s)||void 0===f?void 0:f.map((e=>e.propertyName||e.propertyId)),v)),n.push({brick:"div",properties:{className:A()("body-cell",{"last-row-cell":o||l,"large-chart-cell":"small"!==p}),style:{justifyContent:"center",...y?{gridRow:`span ${s.length}`}:null}},children:[{brick:"div",properties:{className:"list"},children:d?[{brick:"visual-builder.pre-generated-container",properties:{useBrick:[d],dataSource:r.mockData.map(((e,t)=>({time:Math.round(+new Date/1e3)-86400+300*t,...y?Object.fromEntries(s.map((e=>{var n;return[e.propertyName||e.propertyId,null===(n=e.mockData)||void 0===n?void 0:n[t]]}))):{[u]:e}})))},errorBoundary:!0}]:void 0}]})}}t("yaml",{yaml:(0,Vl.safeDump)([{brick:"sl-resize-observer",children:[r],events:{"sl-resize":{action:"window.postMessage",args:[{channel:"raw-metric-preview",type:"resize",payload:"<%\n EVENT.detail.entries[0].borderBoxSize\n ? { width: EVENT.detail.entries[0].borderBoxSize[0].inlineSize, height: EVENT.detail.entries[0].borderBoxSize[0].blockSize }\n : { width: EVENT.detail.entries[0].contentRect.width, height: EVENT.detail.entries[0].contentRect.height }\n %>"}]}}},{brick:"eo-message-listener",properties:{sameOrigin:!0},events:{message:{if:"<% EVENT.detail.data?.channel === 'raw-metric-preview' && EVENT.detail.data.type === 'busy' %>",action:"context.replace",args:["busy","<% EVENT.detail.data.payload %>"]}},portal:!0,errorBoundary:!0}],{schema:Vl.JSON_SCHEMA,skipInvalid:!0,noRefs:!0,noCompatMode:!0})},{app:l,theme:o,uiVersion:s,styleText:[Dd.A,Zu.A].join("\n")})}),[l,m,i,o,s,a]),u().createElement("div",{className:A()("container")},u().createElement("iframe",{ref:c,src:null!=n?n:`${(0,et.getBasePath)()}_brick-preview-v3_/preview/`,loading:"lazy",onLoad:v}))}qu=xh,({e:[eh,th,nh,ih,ah,rh,oh,sh,lh,ch,dh,ph,uh,hh],c:[vh,Qu]}=(0,d.A)(qu,[mh("visual-builder.raw-metric-preview",{styleTexts:[Yu.A]})],[[gh(),1,"previewUrl"],[gh({attribute:!1}),1,"generations"],[gh({type:Boolean}),1,"grouped"],[gh({type:Boolean}),1,"busy"],[gh(),1,"theme"],[gh(),1,"uiVersion"],[gh(),1,"app"]],0,void 0,m.ReactNextElement)),Qu()},32984:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(36758),a=n.n(i),r=n(40935),o=n.n(r)()(a());o.push([e.id,':root{--vb-workbench-action-color:#616161;--vb-workbench-action-active-color:#1f1f1f;--vb-workbench-action-active-border-color:#005fb8}html[data-theme="dark"],\nhtml[data-theme="dark-v2"]{--vb-workbench-action-color:rgba(255,255,255,0.4);--vb-workbench-action-active-color:#fff;--vb-workbench-action-active-border-color:#fff}',""]);const s=o},38350:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(36758),a=n.n(i),r=n(40935),o=n.n(r)()(a());o.push([e.id,":host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.container,\niframe{width:100%;height:100%;border-radius:4px}.container{position:relative}iframe{display:block;border:none;margin:0;padding:0;transform-origin:0% 0%;-webkit-user-select:none;user-select:none}",""]);const s=o.toString()},47540:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(36758),a=n.n(i),r=n(40935),o=n.n(r)()(a());o.push([e.id,":host{display:inline-block}:host([hidden]){display:none}.mask,\n.container{display:none;position:fixed;z-index:1}.mask{top:0;bottom:0;left:0;right:0;z-index:1}:host([active]) .mask,\n:host([active]) .container{display:block}.container{background:var(--antd-dropdown-menu-bg);border-radius:var(--medius-border-radius);padding:5px}.container .title{padding:5px 12px;cursor:default;color:var(--color-secondary-text);border-bottom:1px solid var(--color-text-divider-line)}.container eo-menu{border:none;padding:5px 0}.container eo-menu eo-menu-item:not([disabled]):hover::part(menu-item){background-color:var(--left-sidebar-item-hover-bg)}.container eo-menu eo-menu-item[disabled]::part(menu-item){cursor:not-allowed}.container eo-menu eo-menu-item::part(menu-item){cursor:grab;padding:5px 12px;border-radius:var(--medius-border-radius);min-width:max-content}.container eo-menu eo-menu-item.dragging{opacity:0.5}.container eo-menu eo-tooltip{display:block}",""]);const s=o.toString()},48918:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(36758),a=n.n(i),r=n(40935),o=n.n(r)()(a());o.push([e.id,"body{background-color:transparent}#preview-root{padding:0;height:auto;max-height:100vh;overflow-y:auto;border:1px solid var(--theme-gray-border-color);border-radius:4px;background:var(--body-background)}.head-cell{position:sticky;top:0;z-index:1;font-weight:bold}.head-cell,\n.body-cell{background:var(--body-background)}.last-col-cell{border-right-color:transparent}.last-row-cell{border-bottom-color:transparent}.form-container > ::part(message){display:none}",""]);const s=o.toString()},54982:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(36758),a=n.n(i),r=n(40935),o=n.n(r)()(a());o.push([e.id,"#preview-root{overflow-y:initial;max-height:initial}.body-cell.large-chart-cell{padding:16px}",""]);const s=o.toString()},59034:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(36758),a=n.n(i),r=n(40935),o=n.n(r)()(a());o.push([e.id,":host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.container,\niframe{width:100%;height:100%;border-radius:4px}.container{position:relative}iframe{display:block;border:none;margin:0;padding:0;transform-origin:0% 0%;-webkit-user-select:none;user-select:none}",""]);const s=o.toString()},62381:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(36758),a=n.n(i),r=n(40935),o=n.n(r)()(a());o.push([e.id,":host{--local-node-outline-style:solid;display:block}:host([hidden]){display:none}:host([not-synced]){--local-node-outline-style:dashed}*{box-sizing:border-box}.node{width:168px;max-width:none;height:130px;position:relative;display:flex;flex-direction:column;justify-content:space-between;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none}.node.board{height:70px;max-width:168px;width:-moz-fit-content;width:fit-content;padding-bottom:4px}.label,\n.label-input{width:100%;height:24px;padding:3px;border:none;line-height:18px;font-size:var(--sub-title-font-size-small);color:var(--color-header-text);font-weight:var(--font-weight-500);text-align:center;font-family:inherit;cursor:text;-webkit-user-select:text;user-select:text}.label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.node.editing-label .label{height:0}.node:not(.editing-label) .label-input{display:none}.add-button,\n.icon-container,\n.thumbnail-container,\n.thumbnail-placeholder{display:flex;align-items:center;justify-content:center}.thumbnail-container{height:98px;outline:1px var(--local-node-outline-style) var(--palette-gray-4);opacity:1;border:4px solid transparent;border-radius:4px;width:100%;position:relative;flex-direction:column}.thumbnail-placeholder{color:var(--palette-gray-5);font-size:36px;flex:1}.icon-container{font-size:20px;background-color:var(--palette-teal-6);color:var(--palette-gray-4);width:36px;height:36px;border-radius:50%;outline-offset:4px}:host([active]) .thumbnail-container,\n:host([active]) .icon-container{outline:2px var(--local-node-outline-style) var(--palette-blue-3)}:host(:not([active])) .node:hover .thumbnail-container,\n:host(:not([active])) .node:hover .icon-container{outline:1px var(--local-node-outline-style) var(--palette-blue-3)}.add-button{position:absolute;bottom:-26px;left:calc(50% - 12px);width:24px;height:24px;background:var(--palette-gray-3);color:var(--palette-gray-6);border-radius:50%;cursor:pointer}:host([not-synced]) .add-button,\n:host([disable-child-append]) .add-button,\n:host(:not([active])) .add-button{display:none}.add-button:hover{background:var(--palette-blue-5);color:var(--palette-gray-2)}.external{position:absolute;top:4px;left:4px;padding:0 10px;display:flex;align-items:center;gap:6px;background:var(--palette-purple-4);font-size:12px;line-height:20px;height:22px;cursor:pointer;color:var(--palette-gray-1);border-radius:9999px;right:4px;max-width:-moz-fit-content;max-width:fit-content}.external-label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.external:hover{background:var(--palette-purple-5)}.sub-nodes{display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px;width:100%}.sub-node{background-color:var(--palette-gray-2);border-radius:4px;padding:6px;display:flex;flex-direction:column;justify-content:space-between;height:32px}.sub-node-skeleton-title{width:18px;height:4px;border-radius:2px;align-self:flex-start;background-color:var(--palette-gray-4)}.sub-node-skeleton-content{width:100%;height:4px;border-radius:2px;background-color:var(--palette-gray-4)}.sub-node-skeleton-button{width:18px;height:4px;border-radius:2px;align-self:flex-end;background-color:var(--palette-blue-3)}.sub-node:hover{background-color:var(--palette-gray-3)}.sub-node:hover .sub-node-skeleton-title,\n.sub-node:hover .sub-node-skeleton-content{background-color:var(--palette-gray-5)}.sub-node:hover .sub-node-skeleton-button{background-color:var(--palette-blue-4)}",""]);const s=o.toString()},66213:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(36758),a=n.n(i),r=n(40935),o=n.n(r)()(a());o.push([e.id,":host{display:inline-block}:host([hidden]){display:none}.contract-wrapper{display:flex;gap:4px}.contract-selector{flex:1}.version-selector{width:100px}.options-tips{padding:0px 10px;font-weight:400;color:#999;white-space:nowrap;font-style:italic}",""]);const s=o.toString()},69765:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(36758),a=n.n(i),r=n(40935),o=n.n(r)()(a());o.push([e.id,".custom-scrollbar-container{scrollbar-width:thin;scrollbar-color:rgba(255,255,255,0.15) rgba(255,255,255,0.03)}.custom-scrollbar-container::-webkit-scrollbar{width:8px;height:8px;background-color:transparent;position:absolute}.custom-scrollbar-container::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,0);border-radius:4px}.custom-scrollbar-container:hover::-webkit-scrollbar-track{background-color:rgba(255,255,255,0.03)}.custom-scrollbar-container:hover::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,0.15)}",""]);const s=o.toString()},70607:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(36758),a=n.n(i),r=n(40935),o=n.n(r)()(a());o.push([e.id,':root{--vb-workbench-action-list-background:#f8f8f8}html[data-theme="dark"],\nhtml[data-theme="dark-v2"]{--vb-workbench-action-list-background:#323237}',""]);const s=o},73430:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(36758),a=n.n(i),r=n(40935),o=n.n(r)()(a());o.push([e.id,":host{display:flex;flex-direction:column;height:100%;overflow-y:auto;scrollbar-width:none;background-color:var(--vb-workbench-action-list-background)}:host([hidden]){display:none}",""]);const s=o.toString()},76131:(e,t,n)=>{n.d(t,{A:()=>c});var i=n(36758),a=n.n(i),r=n(40935),o=n.n(r),s=n(97745),l=o()(a());l.i(s.A),l.push([e.id,"",""]);const c=l.toString()},81563:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(36758),a=n.n(i),r=n(40935),o=n.n(r)()(a());o.push([e.id,":host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.container,\niframe{width:100%;height:100%;border-radius:4px}.container{position:relative;box-shadow:rgba(204,204,204,0.2) 0px 0px 0px 1px}iframe{display:block;border:none;margin:0;padding:0;transform-origin:0% 0%;-webkit-user-select:none;user-select:none}.outline{position:absolute;border-style:solid;border-width:2px;border-radius:0 4px 4px;pointer-events:none}.label{position:absolute;left:-2px;top:-20px;height:18px;line-height:16px;padding:2px 5px 0;font-size:12px;border-radius:4px 4px 0 0;white-space:nowrap}.outline.hover{border-color:rgba(var(--palette-blue-6-channel),0.3)}.outline.hover .label{background:rgba(var(--palette-blue-6-channel),0.3)}.outline.active{border-color:var(--palette-blue-6)}.outline.active .label{background:var(--palette-blue-6)}.container:not(.inspecting) .outline{display:none}",""]);const s=o.toString()},87236:(e,t,n)=>{n.d(t,{A:()=>c});var i=n(36758),a=n.n(i),r=n(40935),o=n.n(r),s=n(76131),l=o()(a());l.i(s.A),l.push([e.id,':host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.message{display:flex;gap:8px}.main{flex:1;min-width:0}.label{font-weight:bold;line-height:28px}.message:not(:last-child){margin-bottom:2em}.invisible-dots{opacity:0}.failed .content{color:var(--color-error)}.command:not(:first-child){margin-top:1em}.command:not(:last-child){margin-bottom:1em}pre{white-space:pre-wrap;background-color:var(--palette-gray-3);border-radius:6px;padding:1em}.markdown > :first-child{margin-top:0}.markdown > :last-child{margin-bottom:0}.avatar{align-self:flex-start;display:flex;align-items:center;justify-content:center}.texting::after{content:" ";animation:texting 2s infinite;white-space:pre}@keyframes texting{0%{content:" "}25%{content:". "}50%{content:".. "}75%{content:"..."}100%{content:" "}}pre[class*="language-"]{overflow:visible}pre[class*="language-"],\ncode[class*="language-"]{white-space:pre-wrap}eo-avatar.role-assistant::part(avatar-icon){background-color:var(--palette-blue-5)}.content{word-wrap:break-word}.plain{white-space:pre-wrap}',""]);const c=l.toString()},91361:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(36758),a=n.n(i),r=n(40935),o=n.n(r)()(a());o.push([e.id,":host{display:inline-block}:host([hidden]){display:none}eo-popover::part(popup){width:800px;max-width:60vw;padding:10px;background:var(--color-fill-bg-container-4);border-radius:var(--medius-border-radius);box-shadow:var(--feedback-container-shadow);z-index:1000}.history-title{font-size:var(--title-font-size);font-weight:var(--font-weight-500);color:var(--color-strong-text);margin-bottom:5px}.history-list{max-height:500px;overflow-y:auto}.item-container{padding:10px 0;display:flex;flex-direction:column;gap:5px}.empty{padding:5px 0 10px 0;font-size:14px;color:var(--text-color-secondary);text-align:center}.item-container:not(:last-of-type){border-bottom:1px solid var(--color-border-divider-line)}.item-title{display:flex;align-items:center;justify-content:space-between;gap:5px}.title-left,\n.title-right{display:flex;align-items:center}.title-left{cursor:pointer;overflow:hidden;gap:5px}.topic{font-size:14px;color:var(--text-color-title);font-weight:var(--font-weight-500);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.branch{font-size:14px;color:var(--text-color-secondary)}.rollback{margin-right:5px;font-size:14px;color:var(--text-color-secondary);cursor:pointer}.rollback:hover{color:var(--color-brand)}.item-info{display:flex;align-items:center;gap:5px}.time,\n.operator{font-size:14px;color:var(--text-color-secondary)}.load-more-container{display:block;text-align:center}.end-container{display:flex;align-items:center;justify-content:center;gap:10px;font-size:16px;color:var(--color-brand)}.rollback-all{cursor:pointer}",""]);const s=o.toString()},92120:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(36758),a=n.n(i),r=n(40935),o=n.n(r)()(a());o.push([e.id,"#preview-root{padding:0}",""]);const s=o.toString()},92150:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(36758),a=n.n(i),r=n(40935),o=n.n(r)()(a());o.push([e.id,':host{--sidebar-background:#fff;--title-container-background:#fff;--title-container-color:#595959;display:block;outline-color:rgba(83,89,93,0.5);background-color:var(--sidebar-background);height:100%}:host-context(html[data-theme="dark-v2"]),\n:host-context([data-override-theme="dark-v2"]){--sidebar-background:#181818;--title-container-background:#181818;--title-container-color:rgb(187,187,187);background-color:var(--sidebar-background)}:host([hidden]){display:none}*,\n*::before,\n*::after{box-sizing:border-box}.sidebar{display:flex;flex-direction:column;height:100%}.title-container{display:flex;padding:0 8px 8px 8px;color:var(--title-container-color);background:var(--title-container-background)}.title-label{font-weight:300;line-height:44px;padding-left:12px;text-transform:uppercase;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pane-container{flex-grow:1;min-height:0;display:flex;flex-direction:column}::slotted([slot="panes"]){transition:flex 0.2s;min-height:25px}',""]);const s=o.toString()},94014:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(36758),a=n.n(i),r=n(40935),o=n.n(r)()(a());o.push([e.id,":host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.container,\niframe{width:100%;height:100%;border-radius:4px}.container{position:relative}iframe{display:block;border:none;margin:0;padding:0;transform-origin:0% 0%;-webkit-user-select:none;user-select:none}",""]);const s=o.toString()},94162:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(36758),a=n.n(i),r=n(40935),o=n.n(r)()(a());o.push([e.id,"body{background-color:transparent}#preview-root{padding:0;height:auto;max-height:100vh;overflow-y:auto;border:1px solid var(--theme-gray-border-color);border-radius:4px;background:var(--body-background)}.head-cell{position:sticky;top:0;z-index:1;font-weight:bold;align-content:center}.head-cell,\n.body-cell{background:var(--body-background)}.body-cell{display:flex;align-items:center;justify-content:space-between}.last-col-cell{border-right-color:transparent}.last-row-cell{border-bottom-color:transparent}.form-container > ::part(message){display:none}.list{display:flex;flex-direction:column;gap:8px;width:100%}.raw-content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text-color-secondary)}.raw-content.expand{white-space:pre-wrap}.tips{color:var(--text-color-secondary);font-weight:normal}.body-cell:not(:hover) .btn-toggle{visibility:hidden}",""]);const s=o.toString()},99216:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(36758),a=n.n(i),r=n(40935),o=n.n(r)()(a());o.push([e.id,":host{display:grid;width:100%}:host([hidden]){display:none}::slotted(*){padding:4px 8px;border:1px solid var(--theme-gray-border-color);border-left-color:transparent;border-top-color:transparent;min-width:0;word-break:break-word}",""]);const s=o.toString()}}]);
|
|
2
|
+
//# sourceMappingURL=3831.d86abb48.js.map
|