@next-bricks/visual-builder 1.39.6 → 1.39.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/bricks.json +1 -1
  2. package/dist/chunks/1120.84e1f4e2.js +2 -0
  3. package/dist/chunks/1120.84e1f4e2.js.map +1 -0
  4. package/dist/chunks/1136.4f0b1e92.js +2 -0
  5. package/dist/chunks/1136.4f0b1e92.js.map +1 -0
  6. package/dist/chunks/1215.08ccbe4b.js +2 -0
  7. package/dist/chunks/1215.08ccbe4b.js.map +1 -0
  8. package/dist/chunks/2449.87bdc3cc.js +2 -0
  9. package/dist/chunks/2449.87bdc3cc.js.map +1 -0
  10. package/dist/chunks/2510.b6d69957.js +2 -0
  11. package/dist/chunks/2510.b6d69957.js.map +1 -0
  12. package/dist/chunks/2593.df61f6b7.js +2 -0
  13. package/dist/chunks/2593.df61f6b7.js.map +1 -0
  14. package/dist/chunks/36.b158228e.js +3 -0
  15. package/dist/chunks/36.b158228e.js.map +1 -0
  16. package/dist/chunks/3623.c6955147.js +2 -0
  17. package/dist/chunks/3623.c6955147.js.map +1 -0
  18. package/dist/chunks/4190.f1eff80b.js +2 -0
  19. package/dist/chunks/4190.f1eff80b.js.map +1 -0
  20. package/dist/chunks/4609.8899c4ff.js +2 -0
  21. package/dist/chunks/4609.8899c4ff.js.map +1 -0
  22. package/dist/chunks/4735.8d0f300f.js +2 -0
  23. package/dist/chunks/4735.8d0f300f.js.map +1 -0
  24. package/dist/chunks/5032.14e135c9.js +2 -0
  25. package/dist/chunks/5032.14e135c9.js.map +1 -0
  26. package/dist/chunks/5065.3f848a74.js +2 -0
  27. package/dist/chunks/5065.3f848a74.js.map +1 -0
  28. package/dist/chunks/5498.80b037e7.js +2 -0
  29. package/dist/chunks/5498.80b037e7.js.map +1 -0
  30. package/dist/chunks/5522.7cc41a07.js +3 -0
  31. package/dist/chunks/5522.7cc41a07.js.map +1 -0
  32. package/dist/chunks/8263.3a99285a.js +2 -0
  33. package/dist/chunks/8263.3a99285a.js.map +1 -0
  34. package/dist/chunks/8311.3484d7d3.js +2 -0
  35. package/dist/chunks/8311.3484d7d3.js.map +1 -0
  36. package/dist/chunks/8757.4deac642.js +2 -0
  37. package/dist/chunks/8757.4deac642.js.map +1 -0
  38. package/dist/chunks/9251.5e3a3027.js +2 -0
  39. package/dist/chunks/9251.5e3a3027.js.map +1 -0
  40. package/dist/chunks/chat-conversation.c0add67d.js +3 -0
  41. package/dist/chunks/chat-conversation.c0add67d.js.map +1 -0
  42. package/dist/chunks/{contract-select.945ac0e3.js → contract-select.fe63ada2.js} +3 -3
  43. package/dist/chunks/contract-select.fe63ada2.js.map +1 -0
  44. package/dist/chunks/main.a8fcb5d6.js +2 -0
  45. package/dist/chunks/main.a8fcb5d6.js.map +1 -0
  46. package/dist/chunks/workbench-history-action.2f710853.js +3 -0
  47. package/dist/chunks/workbench-history-action.2f710853.js.map +1 -0
  48. package/dist/index.c7ed311c.js +2 -0
  49. package/dist/index.c7ed311c.js.map +1 -0
  50. package/package.json +2 -2
  51. package/dist/chunks/1855.79b2c593.js +0 -3
  52. package/dist/chunks/1855.79b2c593.js.map +0 -1
  53. package/dist/chunks/5522.e82b86a6.js +0 -3
  54. package/dist/chunks/5522.e82b86a6.js.map +0 -1
  55. package/dist/chunks/7936.ddd2230a.js +0 -2
  56. package/dist/chunks/7936.ddd2230a.js.map +0 -1
  57. package/dist/chunks/chat-conversation.33ffcf1e.js +0 -3
  58. package/dist/chunks/chat-conversation.33ffcf1e.js.map +0 -1
  59. package/dist/chunks/contract-select.945ac0e3.js.map +0 -1
  60. package/dist/chunks/main.44c8413e.js +0 -2
  61. package/dist/chunks/main.44c8413e.js.map +0 -1
  62. package/dist/chunks/workbench-history-action.61d07ecd.js +0 -3
  63. package/dist/chunks/workbench-history-action.61d07ecd.js.map +0 -1
  64. package/dist/index.37a2f29f.js +0 -2
  65. package/dist/index.37a2f29f.js.map +0 -1
  66. /package/dist/chunks/{1855.79b2c593.js.LICENSE.txt → 36.b158228e.js.LICENSE.txt} +0 -0
  67. /package/dist/chunks/{5522.e82b86a6.js.LICENSE.txt → 5522.7cc41a07.js.LICENSE.txt} +0 -0
  68. /package/dist/chunks/{chat-conversation.33ffcf1e.js.LICENSE.txt → chat-conversation.c0add67d.js.LICENSE.txt} +0 -0
  69. /package/dist/chunks/{contract-select.945ac0e3.js.LICENSE.txt → contract-select.fe63ada2.js.LICENSE.txt} +0 -0
  70. /package/dist/chunks/{workbench-history-action.61d07ecd.js.LICENSE.txt → workbench-history-action.2f710853.js.LICENSE.txt} +0 -0
@@ -1,3 +0,0 @@
1
- /*! For license information please see 5522.e82b86a6.js.LICENSE.txt */
2
- "use strict";(globalThis.webpackChunk_next_bricks_visual_builder=globalThis.webpackChunk_next_bricks_visual_builder||[]).push([[5522],{63:(e,t,n)=>{n.d(t,{LP:()=>i});var r=n(11732),a=n(29475),c=n(41030);function i(e,t,n,s){const u=[],f=[],p=[];let h=0;return e&&e.forEach((e=>{if(e.key=""===s?`${h}`:`${s}.${h}`,function(e){return"group"===e.type}(e)||function(e){return Boolean("subMenu"===e.type||void 0)}(e)){const r=i(e.items,t,n,e.key);u.push(...r.selectedKeys),(r.selectedKeys.length||e.defaultExpanded)&&f.push(e.key),f.push(...r.openedKeys),p.push(...r.matchedKeys)}else if(function(e,t,n){if(!e.to)return!1;const i="object"==typeof e.to?e.to:(0,r.parsePath)(e.to),s=i.pathname.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1");let u=!!(0,a.matchPath)(t,{path:s,exact:e.exact});if(u&&e.activeMatchSearch&&(u=o(n,i.search)),!u&&Array.isArray(e.activeIncludes))for(const i of e.activeIncludes){let e,s=!0;(0,c.isObject)(i)?(e=Array.isArray(i.path)?i.path:[i.path],s=i.exact):e=[i];for(const c of e){var f;let e;const i=c.includes("?");if(i&&(e=(0,r.parsePath)(c)),u=!!(0,a.matchPath)(t,{path:i?e.pathname:c,exact:s}),u&&null!==(f=e)&&void 0!==f&&f.search&&(u=o(n,e.search)),u)break}if(u)break}if(u&&Array.isArray(e.activeExcludes))for(const i of e.activeExcludes){let e,s=!0;(0,c.isObject)(i)?(e=Array.isArray(i.path)?i.path:[i.path],s=i.exact):e=[i];for(const c of e){let e;if(c.includes("?")&&(e=(0,r.parsePath)(c)),u=!((0,a.matchPath)(t,{path:e?e.pathname:c,exact:s})&&(!e||o(n,e.search))),!u)break}if(!u)break}return u}(e,t,n)){u.push(String(e.key));const t=e.key.split(".");for(let e=0;e<t.length;e++)p.push(t.slice(0,e+1).join("."))}h+=1})),u.length&&""!==s&&f.push(s),{selectedKeys:u,openedKeys:f,matchedKeys:p}}function o(e,t){const n=new URLSearchParams(e),r=new URLSearchParams(t);for(const[e,t]of r.entries()){var a;if((null!==(a=n.get(e))&&void 0!==a?a:"")!==t)return!1}return!0}},8406:(e,t,n)=>{n.d(t,{y:()=>c});var r=n(86330),a=n(57372),c=function(){var e=(0,r.A)((function*(e,t,n){return(yield a.http.post("api/gateway/cmdb.instance.PostSearchV3/v3/object/".concat(e,"/instance/_search"),t,n)).data}));return function(t,n,r){return e.apply(this,arguments)}}()},18013:(e,t,n)=>{function r(e){let t;const n=()=>cancelAnimationFrame(t),r=function(){for(var r=arguments.length,a=new Array(r),c=0;c<r;c++)a[c]=arguments[c];t&&n(),t=requestAnimationFrame((()=>{e(...a)}))};return r.cancel=n,r}n.d(t,{G:()=>r})},34107:(e,t,n)=>{n.d(t,{R:()=>i});var r=n(69740),a=n(86330),c=n(57372),i=function(){var e=(0,a.A)((function*(e,t,n){return(yield c.http.get("api/gateway/next_builder.workspace.GetChangeHistory/api/v1/next-builder/workspace/".concat(e,"/changes"),(0,r.A)((0,r.A)({},n),{},{params:t}))).data}));return function(t,n,r){return e.apply(this,arguments)}}()},50264:(e,t,n)=>{function r(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function a(e){return e&&e.sensitive?"":"i"}function c(e,t,n){return function(e,t,n){void 0===n&&(n={});for(var c=n.strict,i=void 0!==c&&c,o=n.start,s=void 0===o||o,u=n.end,f=void 0===u||u,p=n.encode,h=void 0===p?function(e){return e}:p,l=n.delimiter,d=void 0===l?"/#?":l,v=n.endsWith,y="[".concat(r(void 0===v?"":v),"]|$"),x="[".concat(r(d),"]"),m=s?"^":"",g=0,A=e;g<A.length;g++){var E=A[g];if("string"==typeof E)m+=r(h(E));else{var w=r(h(E.prefix)),b=r(h(E.suffix));if(E.pattern)if(t&&t.push(E),w||b)if("+"===E.modifier||"*"===E.modifier){var k="*"===E.modifier?"?":"";m+="(?:".concat(w,"((?:").concat(E.pattern,")(?:").concat(b).concat(w,"(?:").concat(E.pattern,"))*)").concat(b,")").concat(k)}else m+="(?:".concat(w,"(").concat(E.pattern,")").concat(b,")").concat(E.modifier);else{if("+"===E.modifier||"*"===E.modifier)throw new TypeError('Can not repeat "'.concat(E.name,'" without a prefix and suffix'));m+="(".concat(E.pattern,")").concat(E.modifier)}else m+="(?:".concat(w).concat(b,")").concat(E.modifier)}}if(f)i||(m+="".concat(x,"?")),m+=n.endsWith?"(?=".concat(y,")"):"$";else{var C=e[e.length-1],P="string"==typeof C?x.indexOf(C[C.length-1])>-1:void 0===C;i||(m+="(?:".concat(x,"(?=").concat(y,"))?")),P||(m+="(?=".concat(x,"|").concat(y,")"))}return new RegExp(m,a(n))}(function(e,t){void 0===t&&(t={});for(var n=function(e){for(var t=[],n=0;n<e.length;){var r=e[n];if("*"!==r&&"+"!==r&&"?"!==r)if("\\"!==r)if("{"!==r)if("}"!==r)if(":"!==r)if("("!==r)t.push({type:"CHAR",index:n,value:e[n++]});else{var a=1,c="";if("?"===e[o=n+1])throw new TypeError('Pattern cannot start with "?" at '.concat(o));for(;o<e.length;)if("\\"!==e[o]){if(")"===e[o]){if(0==--a){o++;break}}else if("("===e[o]&&(a++,"?"!==e[o+1]))throw new TypeError("Capturing groups are not allowed at ".concat(o));c+=e[o++]}else c+=e[o++]+e[o++];if(a)throw new TypeError("Unbalanced pattern at ".concat(n));if(!c)throw new TypeError("Missing pattern at ".concat(n));t.push({type:"PATTERN",index:n,value:c}),n=o}else{for(var i="",o=n+1;o<e.length;){var s=e.charCodeAt(o);if(!(s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122||95===s))break;i+=e[o++]}if(!i)throw new TypeError("Missing parameter name at ".concat(n));t.push({type:"NAME",index:n,value:i}),n=o}else t.push({type:"CLOSE",index:n,value:e[n++]});else t.push({type:"OPEN",index:n,value:e[n++]});else t.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});else t.push({type:"MODIFIER",index:n,value:e[n++]})}return t.push({type:"END",index:n,value:""}),t}(e),a=t.prefixes,c=void 0===a?"./":a,i=t.delimiter,o=void 0===i?"/#?":i,s=[],u=0,f=0,p="",h=function(e){if(f<n.length&&n[f].type===e)return n[f++].value},l=function(e){var t=h(e);if(void 0!==t)return t;var r=n[f],a=r.type,c=r.index;throw new TypeError("Unexpected ".concat(a," at ").concat(c,", expected ").concat(e))},d=function(){for(var e,t="";e=h("CHAR")||h("ESCAPED_CHAR");)t+=e;return t},v=function(e){var t=s[s.length-1],n=e||(t&&"string"==typeof t?t:"");if(t&&!n)throw new TypeError('Must have text between two parameters, missing text after "'.concat(t.name,'"'));return!n||function(e){for(var t=0,n=o;t<n.length;t++){var r=n[t];if(e.indexOf(r)>-1)return!0}return!1}(n)?"[^".concat(r(o),"]+?"):"(?:(?!".concat(r(n),")[^").concat(r(o),"])+?")};f<n.length;){var y=h("CHAR"),x=h("NAME"),m=h("PATTERN");if(x||m){var g=y||"";-1===c.indexOf(g)&&(p+=g,g=""),p&&(s.push(p),p=""),s.push({name:x||u++,prefix:g,suffix:"",pattern:m||v(g),modifier:h("MODIFIER")||""})}else{var A=y||h("ESCAPED_CHAR");if(A)p+=A;else if(p&&(s.push(p),p=""),h("OPEN")){g=d();var E=h("NAME")||"",w=h("PATTERN")||"",b=d();l("CLOSE"),s.push({name:E||(w?u++:""),pattern:E&&!w?v(g):w,prefix:g,suffix:b,modifier:h("MODIFIER")||""})}else l("END")}}return s}(e,n),t,n)}function i(e,t,n){return e instanceof RegExp?function(e,t){if(!t)return e;for(var n=/\((?:\?<(.*?)>)?(?!\?)/g,r=0,a=n.exec(e.source);a;)t.push({name:a[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),a=n.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,n){var r=e.map((function(e){return i(e,t,n).source}));return new RegExp("(?:".concat(r.join("|"),")"),a(n))}(e,t,n):c(e,t,n)}n.d(t,{MM:()=>i})},74244:(e,t,n)=>{n.d(t,{f:()=>c});var r=n(86330),a=n(57372),c=function(){var e=(0,r.A)((function*(e,t){return(yield a.http.post("api/gateway/next_builder.contract_center.SearchContract/api/v1/contract/search",e,t)).data}));return function(t,n){return e.apply(this,arguments)}}()},80780:(e,t,n)=>{n.d(t,{_:()=>c});var r=n(86330),a=n(57372),c=function(){var e=(0,r.A)((function*(e,t,n){return(yield a.http.post("api/gateway/cmdb.instance.CreateInstance/v2/object/".concat(e,"/instance"),t,n)).data}));return function(t,n,r){return e.apply(this,arguments)}}()},99492:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(12559);function a(e,t,n,a){return t((0,r.A)(e,n),a),a}}}]);
3
- //# sourceMappingURL=5522.e82b86a6.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chunks/5522.e82b86a6.js","mappings":"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","sources":["webpack:///../../node_modules/@next-shared/general/dist/esm/menu.js","webpack:///../../node_modules/@next-api-sdk/cmdb-sdk/dist/esm/api/cmdb/instance/postSearchV3.js","webpack:///../../node_modules/@next-shared/general/dist/esm/debounceByAnimationFrame.js","webpack:///../../node_modules/@next-api-sdk/next-builder-sdk/dist/esm/api/next_builder/workspace/getChangeHistory.js","webpack:///../../node_modules/path-to-regexp/dist.es2015/index.js","webpack:///../../node_modules/@next-api-sdk/next-builder-sdk/dist/esm/api/next_builder/contract_center/searchContract.js","webpack:///../../node_modules/@next-api-sdk/cmdb-sdk/dist/esm/api/cmdb/instance/createInstance.js","webpack:///../../node_modules/@babel/runtime/helpers/esm/classPrivateSetter.js"],"sourcesContent":["import { parsePath } from \"history\";\nimport { matchPath } from \"@next-core/runtime\";\nimport { isObject } from \"lodash\";\nexport function isGroup(item) {\n return item.type === \"group\";\n}\nexport function isSubMenu(item, groupAsSubMenu) {\n return Boolean(item.type === \"subMenu\" || groupAsSubMenu && item.type === \"group\");\n}\nexport function initMenuItemAndMatchCurrentPathKeys(menuItems, pathname, search, parentCursor) {\n const selectedKeys = [];\n const openedKeys = [];\n const matchedKeys = [];\n let cursor = 0;\n menuItems && menuItems.forEach(item => {\n // key的格式最终为0,1,2,0.1,0.2,0.1.1,0.1.2\n item.key = parentCursor === \"\" ? `${cursor}` : `${parentCursor}.${cursor}`;\n if (isGroup(item) || isSubMenu(item)) {\n const tmp = initMenuItemAndMatchCurrentPathKeys(item.items, pathname, search, item.key);\n selectedKeys.push(...tmp.selectedKeys);\n if (tmp.selectedKeys.length || item.defaultExpanded) {\n openedKeys.push(item.key);\n }\n openedKeys.push(...tmp.openedKeys);\n matchedKeys.push(...tmp.matchedKeys);\n } else {\n if (matchMenuItem(item, pathname, search)) {\n selectedKeys.push(String(item.key));\n const keyPath = item.key.split(\".\");\n for (let i = 0; i < keyPath.length; i++) {\n matchedKeys.push(keyPath.slice(0, i + 1).join(\".\"));\n }\n }\n }\n cursor += 1;\n });\n if (selectedKeys.length && parentCursor !== \"\") {\n openedKeys.push(parentCursor);\n }\n return {\n selectedKeys: selectedKeys,\n openedKeys: openedKeys,\n matchedKeys: matchedKeys\n };\n}\nfunction getMatchOfSearch(currentSearch, toSearch) {\n const current = new URLSearchParams(currentSearch);\n const to = new URLSearchParams(toSearch);\n for (const [key, value] of to.entries()) {\n var _current$get;\n // Allow `?k=` to match `?` (when `k` doesn't exist)\n if (((_current$get = current.get(key)) !== null && _current$get !== void 0 ? _current$get : \"\") !== value) {\n return false;\n }\n }\n return true;\n}\nexport function matchMenuItem(item, pathname, search) {\n if (!item.to) return false;\n const to = typeof item.to === \"object\" ? item.to : parsePath(item.to);\n\n // Regex taken from: https://github.com/pillarjs/path-to-regexp/blob/master/index.js#L202\n const escapedPath = to.pathname.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g, \"\\\\$1\");\n let match = !!matchPath(pathname, {\n path: escapedPath,\n exact: item.exact\n });\n if (match && item.activeMatchSearch) {\n match = getMatchOfSearch(search, to.search);\n }\n if (!match && Array.isArray(item.activeIncludes)) {\n for (const include of item.activeIncludes) {\n let paths;\n let exact = true;\n if (isObject(include)) {\n paths = Array.isArray(include.path) ? include.path : [include.path];\n exact = include.exact;\n } else {\n paths = [include];\n }\n for (const path of paths) {\n var _parsedPath;\n let parsedPath;\n const hasSearch = path.includes(\"?\");\n if (hasSearch) {\n parsedPath = parsePath(path);\n }\n match = !!matchPath(pathname, {\n path: hasSearch ? parsedPath.pathname : path,\n exact\n });\n if (match && (_parsedPath = parsedPath) !== null && _parsedPath !== void 0 && _parsedPath.search) {\n match = getMatchOfSearch(search, parsedPath.search);\n }\n if (match) {\n break;\n }\n }\n if (match) {\n break;\n }\n }\n }\n if (match && Array.isArray(item.activeExcludes)) {\n for (const include of item.activeExcludes) {\n let paths;\n let exact = true;\n if (isObject(include)) {\n paths = Array.isArray(include.path) ? include.path : [include.path];\n exact = include.exact;\n } else {\n paths = [include];\n }\n for (const path of paths) {\n let parsedPathWithSearch;\n if (path.includes(\"?\")) {\n parsedPathWithSearch = parsePath(path);\n }\n match = !(matchPath(pathname, {\n path: parsedPathWithSearch ? parsedPathWithSearch.pathname : path,\n exact\n }) && (!parsedPathWithSearch || getMatchOfSearch(search, parsedPathWithSearch.search)));\n if (!match) {\n break;\n }\n }\n if (!match) {\n break;\n }\n }\n }\n return match;\n}\n//# sourceMappingURL=menu.js.map","import _asyncToGenerator from \"@babel/runtime/helpers/asyncToGenerator\";\nimport { http } from \"@next-core/http\";\n/**\n * @description 搜索实例V3 (支持多属性排序)\n * @endpoint POST /v3/object/:objectId/instance/_search\n */\nexport var InstanceApi_postSearchV3 = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator(function* (objectId, data, options) {\n return (/**! @contract easyops.api.cmdb.instance.PostSearchV3@1.1.0 */(yield http.post(\"api/gateway/cmdb.instance.PostSearchV3/v3/object/\".concat(objectId, \"/instance/_search\"), data, options)).data\n );\n });\n return function InstanceApi_postSearchV3(_x, _x2, _x3) {\n return _ref.apply(this, arguments);\n };\n}();\n//# sourceMappingURL=postSearchV3.js.map","// The debounce function receives our function as a parameter\nexport function debounceByAnimationFrame(fn) {\n // This holds the requestAnimationFrame reference, so we can cancel it if we wish\n let frame;\n const cancel = () => cancelAnimationFrame(frame);\n\n // The debounce function returns a new function that can receive a variable number of arguments\n const func = function () {\n for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {\n params[_key] = arguments[_key];\n }\n // If the frame variable has been defined, clear it now, and queue for next frame\n if (frame) {\n cancel();\n }\n\n // Queue our function call for the next frame\n frame = requestAnimationFrame(() => {\n // Call our function and pass any params we received\n fn(...params);\n });\n };\n func.cancel = cancel;\n return func;\n}\n//# sourceMappingURL=debounceByAnimationFrame.js.map","import _objectSpread from \"@babel/runtime/helpers/objectSpread2\";\nimport _asyncToGenerator from \"@babel/runtime/helpers/asyncToGenerator\";\nimport { http } from \"@next-core/http\";\n/**\n * @description 获取变更历史(从上一次commit开始)\n * @endpoint GET /api/v1/next-builder/workspace/:appId/changes\n */\nexport var WorkspaceApi_getChangeHistory = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator(function* (appId, params, options) {\n return (/**! @contract easyops.api.next_builder.workspace.GetChangeHistory@1.0.0 */(yield http.get(\"api/gateway/next_builder.workspace.GetChangeHistory/api/v1/next-builder/workspace/\".concat(appId, \"/changes\"), _objectSpread(_objectSpread({}, options), {}, {\n params\n }))).data\n );\n });\n return function WorkspaceApi_getChangeHistory(_x, _x2, _x3) {\n return _ref.apply(this, arguments);\n };\n}();\n//# sourceMappingURL=getChangeHistory.js.map","/**\n * Tokenize input string.\n */\nfunction lexer(str) {\n var tokens = [];\n var i = 0;\n while (i < str.length) {\n var char = str[i];\n if (char === \"*\" || char === \"+\" || char === \"?\") {\n tokens.push({ type: \"MODIFIER\", index: i, value: str[i++] });\n continue;\n }\n if (char === \"\\\\\") {\n tokens.push({ type: \"ESCAPED_CHAR\", index: i++, value: str[i++] });\n continue;\n }\n if (char === \"{\") {\n tokens.push({ type: \"OPEN\", index: i, value: str[i++] });\n continue;\n }\n if (char === \"}\") {\n tokens.push({ type: \"CLOSE\", index: i, value: str[i++] });\n continue;\n }\n if (char === \":\") {\n var name = \"\";\n var j = i + 1;\n while (j < str.length) {\n var code = str.charCodeAt(j);\n if (\n // `0-9`\n (code >= 48 && code <= 57) ||\n // `A-Z`\n (code >= 65 && code <= 90) ||\n // `a-z`\n (code >= 97 && code <= 122) ||\n // `_`\n code === 95) {\n name += str[j++];\n continue;\n }\n break;\n }\n if (!name)\n throw new TypeError(\"Missing parameter name at \".concat(i));\n tokens.push({ type: \"NAME\", index: i, value: name });\n i = j;\n continue;\n }\n if (char === \"(\") {\n var count = 1;\n var pattern = \"\";\n var j = i + 1;\n if (str[j] === \"?\") {\n throw new TypeError(\"Pattern cannot start with \\\"?\\\" at \".concat(j));\n }\n while (j < str.length) {\n if (str[j] === \"\\\\\") {\n pattern += str[j++] + str[j++];\n continue;\n }\n if (str[j] === \")\") {\n count--;\n if (count === 0) {\n j++;\n break;\n }\n }\n else if (str[j] === \"(\") {\n count++;\n if (str[j + 1] !== \"?\") {\n throw new TypeError(\"Capturing groups are not allowed at \".concat(j));\n }\n }\n pattern += str[j++];\n }\n if (count)\n throw new TypeError(\"Unbalanced pattern at \".concat(i));\n if (!pattern)\n throw new TypeError(\"Missing pattern at \".concat(i));\n tokens.push({ type: \"PATTERN\", index: i, value: pattern });\n i = j;\n continue;\n }\n tokens.push({ type: \"CHAR\", index: i, value: str[i++] });\n }\n tokens.push({ type: \"END\", index: i, value: \"\" });\n return tokens;\n}\n/**\n * Parse a string for the raw tokens.\n */\nexport function parse(str, options) {\n if (options === void 0) { options = {}; }\n var tokens = lexer(str);\n var _a = options.prefixes, prefixes = _a === void 0 ? \"./\" : _a, _b = options.delimiter, delimiter = _b === void 0 ? \"/#?\" : _b;\n var result = [];\n var key = 0;\n var i = 0;\n var path = \"\";\n var tryConsume = function (type) {\n if (i < tokens.length && tokens[i].type === type)\n return tokens[i++].value;\n };\n var mustConsume = function (type) {\n var value = tryConsume(type);\n if (value !== undefined)\n return value;\n var _a = tokens[i], nextType = _a.type, index = _a.index;\n throw new TypeError(\"Unexpected \".concat(nextType, \" at \").concat(index, \", expected \").concat(type));\n };\n var consumeText = function () {\n var result = \"\";\n var value;\n while ((value = tryConsume(\"CHAR\") || tryConsume(\"ESCAPED_CHAR\"))) {\n result += value;\n }\n return result;\n };\n var isSafe = function (value) {\n for (var _i = 0, delimiter_1 = delimiter; _i < delimiter_1.length; _i++) {\n var char = delimiter_1[_i];\n if (value.indexOf(char) > -1)\n return true;\n }\n return false;\n };\n var safePattern = function (prefix) {\n var prev = result[result.length - 1];\n var prevText = prefix || (prev && typeof prev === \"string\" ? prev : \"\");\n if (prev && !prevText) {\n throw new TypeError(\"Must have text between two parameters, missing text after \\\"\".concat(prev.name, \"\\\"\"));\n }\n if (!prevText || isSafe(prevText))\n return \"[^\".concat(escapeString(delimiter), \"]+?\");\n return \"(?:(?!\".concat(escapeString(prevText), \")[^\").concat(escapeString(delimiter), \"])+?\");\n };\n while (i < tokens.length) {\n var char = tryConsume(\"CHAR\");\n var name = tryConsume(\"NAME\");\n var pattern = tryConsume(\"PATTERN\");\n if (name || pattern) {\n var prefix = char || \"\";\n if (prefixes.indexOf(prefix) === -1) {\n path += prefix;\n prefix = \"\";\n }\n if (path) {\n result.push(path);\n path = \"\";\n }\n result.push({\n name: name || key++,\n prefix: prefix,\n suffix: \"\",\n pattern: pattern || safePattern(prefix),\n modifier: tryConsume(\"MODIFIER\") || \"\",\n });\n continue;\n }\n var value = char || tryConsume(\"ESCAPED_CHAR\");\n if (value) {\n path += value;\n continue;\n }\n if (path) {\n result.push(path);\n path = \"\";\n }\n var open = tryConsume(\"OPEN\");\n if (open) {\n var prefix = consumeText();\n var name_1 = tryConsume(\"NAME\") || \"\";\n var pattern_1 = tryConsume(\"PATTERN\") || \"\";\n var suffix = consumeText();\n mustConsume(\"CLOSE\");\n result.push({\n name: name_1 || (pattern_1 ? key++ : \"\"),\n pattern: name_1 && !pattern_1 ? safePattern(prefix) : pattern_1,\n prefix: prefix,\n suffix: suffix,\n modifier: tryConsume(\"MODIFIER\") || \"\",\n });\n continue;\n }\n mustConsume(\"END\");\n }\n return result;\n}\n/**\n * Compile a string to a template function for the path.\n */\nexport function compile(str, options) {\n return tokensToFunction(parse(str, options), options);\n}\n/**\n * Expose a method for transforming tokens into the path function.\n */\nexport function tokensToFunction(tokens, options) {\n if (options === void 0) { options = {}; }\n var reFlags = flags(options);\n var _a = options.encode, encode = _a === void 0 ? function (x) { return x; } : _a, _b = options.validate, validate = _b === void 0 ? true : _b;\n // Compile all the tokens into regexps.\n var matches = tokens.map(function (token) {\n if (typeof token === \"object\") {\n return new RegExp(\"^(?:\".concat(token.pattern, \")$\"), reFlags);\n }\n });\n return function (data) {\n var path = \"\";\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n if (typeof token === \"string\") {\n path += token;\n continue;\n }\n var value = data ? data[token.name] : undefined;\n var optional = token.modifier === \"?\" || token.modifier === \"*\";\n var repeat = token.modifier === \"*\" || token.modifier === \"+\";\n if (Array.isArray(value)) {\n if (!repeat) {\n throw new TypeError(\"Expected \\\"\".concat(token.name, \"\\\" to not repeat, but got an array\"));\n }\n if (value.length === 0) {\n if (optional)\n continue;\n throw new TypeError(\"Expected \\\"\".concat(token.name, \"\\\" to not be empty\"));\n }\n for (var j = 0; j < value.length; j++) {\n var segment = encode(value[j], token);\n if (validate && !matches[i].test(segment)) {\n throw new TypeError(\"Expected all \\\"\".concat(token.name, \"\\\" to match \\\"\").concat(token.pattern, \"\\\", but got \\\"\").concat(segment, \"\\\"\"));\n }\n path += token.prefix + segment + token.suffix;\n }\n continue;\n }\n if (typeof value === \"string\" || typeof value === \"number\") {\n var segment = encode(String(value), token);\n if (validate && !matches[i].test(segment)) {\n throw new TypeError(\"Expected \\\"\".concat(token.name, \"\\\" to match \\\"\").concat(token.pattern, \"\\\", but got \\\"\").concat(segment, \"\\\"\"));\n }\n path += token.prefix + segment + token.suffix;\n continue;\n }\n if (optional)\n continue;\n var typeOfMessage = repeat ? \"an array\" : \"a string\";\n throw new TypeError(\"Expected \\\"\".concat(token.name, \"\\\" to be \").concat(typeOfMessage));\n }\n return path;\n };\n}\n/**\n * Create path match function from `path-to-regexp` spec.\n */\nexport function match(str, options) {\n var keys = [];\n var re = pathToRegexp(str, keys, options);\n return regexpToFunction(re, keys, options);\n}\n/**\n * Create a path match function from `path-to-regexp` output.\n */\nexport function regexpToFunction(re, keys, options) {\n if (options === void 0) { options = {}; }\n var _a = options.decode, decode = _a === void 0 ? function (x) { return x; } : _a;\n return function (pathname) {\n var m = re.exec(pathname);\n if (!m)\n return false;\n var path = m[0], index = m.index;\n var params = Object.create(null);\n var _loop_1 = function (i) {\n if (m[i] === undefined)\n return \"continue\";\n var key = keys[i - 1];\n if (key.modifier === \"*\" || key.modifier === \"+\") {\n params[key.name] = m[i].split(key.prefix + key.suffix).map(function (value) {\n return decode(value, key);\n });\n }\n else {\n params[key.name] = decode(m[i], key);\n }\n };\n for (var i = 1; i < m.length; i++) {\n _loop_1(i);\n }\n return { path: path, index: index, params: params };\n };\n}\n/**\n * Escape a regular expression string.\n */\nfunction escapeString(str) {\n return str.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g, \"\\\\$1\");\n}\n/**\n * Get the flags for a regexp from the options.\n */\nfunction flags(options) {\n return options && options.sensitive ? \"\" : \"i\";\n}\n/**\n * Pull out keys from a regexp.\n */\nfunction regexpToRegexp(path, keys) {\n if (!keys)\n return path;\n var groupsRegex = /\\((?:\\?<(.*?)>)?(?!\\?)/g;\n var index = 0;\n var execResult = groupsRegex.exec(path.source);\n while (execResult) {\n keys.push({\n // Use parenthesized substring match if available, index otherwise\n name: execResult[1] || index++,\n prefix: \"\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\",\n });\n execResult = groupsRegex.exec(path.source);\n }\n return path;\n}\n/**\n * Transform an array into a regexp.\n */\nfunction arrayToRegexp(paths, keys, options) {\n var parts = paths.map(function (path) { return pathToRegexp(path, keys, options).source; });\n return new RegExp(\"(?:\".concat(parts.join(\"|\"), \")\"), flags(options));\n}\n/**\n * Create a path regexp from string input.\n */\nfunction stringToRegexp(path, keys, options) {\n return tokensToRegexp(parse(path, options), keys, options);\n}\n/**\n * Expose a function for taking tokens and returning a RegExp.\n */\nexport function tokensToRegexp(tokens, keys, options) {\n if (options === void 0) { options = {}; }\n var _a = options.strict, strict = _a === void 0 ? false : _a, _b = options.start, start = _b === void 0 ? true : _b, _c = options.end, end = _c === void 0 ? true : _c, _d = options.encode, encode = _d === void 0 ? function (x) { return x; } : _d, _e = options.delimiter, delimiter = _e === void 0 ? \"/#?\" : _e, _f = options.endsWith, endsWith = _f === void 0 ? \"\" : _f;\n var endsWithRe = \"[\".concat(escapeString(endsWith), \"]|$\");\n var delimiterRe = \"[\".concat(escapeString(delimiter), \"]\");\n var route = start ? \"^\" : \"\";\n // Iterate over the tokens and create our regexp string.\n for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {\n var token = tokens_1[_i];\n if (typeof token === \"string\") {\n route += escapeString(encode(token));\n }\n else {\n var prefix = escapeString(encode(token.prefix));\n var suffix = escapeString(encode(token.suffix));\n if (token.pattern) {\n if (keys)\n keys.push(token);\n if (prefix || suffix) {\n if (token.modifier === \"+\" || token.modifier === \"*\") {\n var mod = token.modifier === \"*\" ? \"?\" : \"\";\n route += \"(?:\".concat(prefix, \"((?:\").concat(token.pattern, \")(?:\").concat(suffix).concat(prefix, \"(?:\").concat(token.pattern, \"))*)\").concat(suffix, \")\").concat(mod);\n }\n else {\n route += \"(?:\".concat(prefix, \"(\").concat(token.pattern, \")\").concat(suffix, \")\").concat(token.modifier);\n }\n }\n else {\n if (token.modifier === \"+\" || token.modifier === \"*\") {\n throw new TypeError(\"Can not repeat \\\"\".concat(token.name, \"\\\" without a prefix and suffix\"));\n }\n route += \"(\".concat(token.pattern, \")\").concat(token.modifier);\n }\n }\n else {\n route += \"(?:\".concat(prefix).concat(suffix, \")\").concat(token.modifier);\n }\n }\n }\n if (end) {\n if (!strict)\n route += \"\".concat(delimiterRe, \"?\");\n route += !options.endsWith ? \"$\" : \"(?=\".concat(endsWithRe, \")\");\n }\n else {\n var endToken = tokens[tokens.length - 1];\n var isEndDelimited = typeof endToken === \"string\"\n ? delimiterRe.indexOf(endToken[endToken.length - 1]) > -1\n : endToken === undefined;\n if (!strict) {\n route += \"(?:\".concat(delimiterRe, \"(?=\").concat(endsWithRe, \"))?\");\n }\n if (!isEndDelimited) {\n route += \"(?=\".concat(delimiterRe, \"|\").concat(endsWithRe, \")\");\n }\n }\n return new RegExp(route, flags(options));\n}\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n */\nexport function pathToRegexp(path, keys, options) {\n if (path instanceof RegExp)\n return regexpToRegexp(path, keys);\n if (Array.isArray(path))\n return arrayToRegexp(path, keys, options);\n return stringToRegexp(path, keys, options);\n}\n//# sourceMappingURL=index.js.map","import _asyncToGenerator from \"@babel/runtime/helpers/asyncToGenerator\";\nimport { http } from \"@next-core/http\";\n/**\n * @description 契约搜索\n * @endpoint POST /api/v1/contract/search\n */\nexport var ContractCenterApi_searchContract = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator(function* (data, options) {\n return (/**! @contract easyops.api.next_builder.contract_center.SearchContract@1.0.0 */(yield http.post(\"api/gateway/next_builder.contract_center.SearchContract/api/v1/contract/search\", data, options)).data\n );\n });\n return function ContractCenterApi_searchContract(_x, _x2) {\n return _ref.apply(this, arguments);\n };\n}();\n//# sourceMappingURL=searchContract.js.map","import _asyncToGenerator from \"@babel/runtime/helpers/asyncToGenerator\";\nimport { http } from \"@next-core/http\";\n\n/** 创建实例 */\n\n/**\n * @description 创建实例 (body为实例信息,字段限制参考模型定义,支持关系创建)\n * @endpoint POST /v2/object/:objectId/instance\n */\nexport var InstanceApi_createInstance = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator(function* (objectId, data, options) {\n return (/**! @contract easyops.api.cmdb.instance.CreateInstance@1.1.0 */(yield http.post(\"api/gateway/cmdb.instance.CreateInstance/v2/object/\".concat(objectId, \"/instance\"), data, options)).data\n );\n });\n return function InstanceApi_createInstance(_x, _x2, _x3) {\n return _ref.apply(this, arguments);\n };\n}();\n//# sourceMappingURL=createInstance.js.map","import assertClassBrand from \"./assertClassBrand.js\";\nexport default function _classPrivateSetter(s, r, a, t) {\n return r(assertClassBrand(s, a), t), t;\n}"],"names":["initMenuItemAndMatchCurrentPathKeys","menuItems","pathname","search","parentCursor","selectedKeys","openedKeys","matchedKeys","cursor","forEach","item","key","type","isGroup","Boolean","isSubMenu","tmp","items","push","length","defaultExpanded","to","parsePath","escapedPath","replace","match","matchPath","path","exact","activeMatchSearch","getMatchOfSearch","Array","isArray","activeIncludes","include","paths","isObject","_parsedPath","parsedPath","hasSearch","includes","activeExcludes","parsedPathWithSearch","matchMenuItem","String","keyPath","split","i","slice","join","currentSearch","toSearch","current","URLSearchParams","value","entries","_current$get","get","InstanceApi_postSearchV3","_ref","objectId","data","options","http","post","concat","_x","_x2","_x3","apply","this","arguments","debounceByAnimationFrame","fn","frame","cancel","cancelAnimationFrame","func","_len","params","_key","requestAnimationFrame","WorkspaceApi_getChangeHistory","appId","escapeString","str","flags","sensitive","stringToRegexp","keys","tokens","_a","strict","_b","start","_c","end","_d","encode","x","_e","delimiter","_f","endsWith","endsWithRe","delimiterRe","route","_i","tokens_1","token","prefix","suffix","pattern","modifier","mod","TypeError","name","endToken","isEndDelimited","indexOf","undefined","RegExp","tokensToRegexp","char","index","count","j","code","charCodeAt","lexer","prefixes","result","tryConsume","mustConsume","nextType","consumeText","safePattern","prev","prevText","delimiter_1","isSafe","name_1","pattern_1","parse","pathToRegexp","groupsRegex","execResult","exec","source","regexpToRegexp","parts","map","arrayToRegexp","ContractCenterApi_searchContract","InstanceApi_createInstance","_classPrivateSetter","s","r","a","t"],"sourceRoot":""}
@@ -1,2 +0,0 @@
1
- "use strict";(globalThis.webpackChunk_next_bricks_visual_builder=globalThis.webpackChunk_next_bricks_visual_builder||[]).push([[5238,7936],{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(28247),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(29475),W=n(43995),D=(n(60074),n(41030)),P=n.n(D);let $,B,U,F,V,z,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,Ve=new WeakSet,ze=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,Ve),(0,r.A)(this,Oe,($(this),(0,p.createRef)())),(0,r.A)(this,_e,U(this)),(0,r.A)(this,Re,(F(this),V(this))),(0,r.A)(this,We,(z(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,ze,(re(this),oe(this))),(0,r.A)(this,je,(ce(this),de(this))),(0,r.A)(this,Ke,(he(this),e=>{(0,s.A)(Ve,this,pe).emit(e)})),(0,r.A)(this,Xe,me(this)),(0,r.A)(this,Je,(be(this),e=>{(0,s.A)(Ve,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)(Ve,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)(Ve,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)(Ve,this,ie).emit(null!==(e=(0,c.A)(Ge,this))&&void 0!==e?e:n)}})).catch((e=>{(0,s.A)(Ve,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,V,z,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)(ze,e),(e,t)=>(0,l.A)(ze,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()},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},37936:(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,V=new WeakMap,z=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,V,(x(this),N(this))),(0,r.A)(this,z,(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)(V,this)}set badge(e){(0,l.A)(V,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)(z,e),(e,t)=>(0,l.A)(z,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)(),Ve=(0,m.wrapBrick)("eo-link"),ze=(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(Ve,{className:A()("action",{active:i}),url:n,href:a,target:r},u().createElement(ze,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(29475),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,Vt,zt,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,Vn=new WeakMap,zn=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,Vn,(Pt(this),$t(this))),(0,r.A)(this,zn,(Bt(this),Ut(this))),(0,r.A)(this,jn,(Ft(this),Vt(this))),(0,r.A)(this,Kn,(zt(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)(Vn,this)}set isTransformName(e){(0,l.A)(Vn,this,e)}get searchPlaceholder(){return(0,c.A)(zn,this)}set searchPlaceholder(e){(0,l.A)(zn,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,Vt,zt,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,Vi,zi,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,Vi(this)),(0,r.A)(this,ca,(Ki(this),()=>{(0,s.A)(aa,this,zi).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,Vi,zi,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,Va,za,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,Vr=new WeakMap,zr=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,(za(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,Vr,nr(this)),(0,r.A)(this,zr,(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)(zr,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,Va,za,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)(Vr,e),(e,t)=>(0,l.A)(Vr,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(28247),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,Vo,zo,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,(Vo(this),zo(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,Vo,zo,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(94558);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 Vs=new WeakMap,zs=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,Vs,(bs(this),As(this))),(0,r.A)(this,zs,(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)(Vs,this)}set options(e){(0,l.A)(Vs,this,e)}get active(){return(0,c.A)(zs,this)}set active(e){(0,l.A)(zs,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(60798),sl=n(63869),ll=n(89515);function cl(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 dl(){function e(e,t,n){if(!n||"pre"!==n.tagName||"code"!==e.tagName)return;const i=cl(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)}}ol.L.register(sl.A),ol.L.register(ll.A);var pl=n(53349);let ul;let hl=0;const ml=new DOMParser,gl=new XMLSerializer;function vl(){return async e=>{const t=[];(0,al.YR)(e,"element",(function(e,i,a){a&&"pre"===a.tagName&&"code"===e.tagName&&"mermaid"===cl(e)&&t.push((async()=>{const t="mermaid-"+hl++;let r;try{const i=await(ul||(ul=async function(){const e=(await Promise.all([n.e(6724),n.e(934)]).then(n.bind(n,934))).default;return e.initialize({startOnLoad:!1,theme:"base",themeVariables:{fontSize:"14px",lineColor:"#979797",primaryColor:"#DCD2F3",primaryBorderColor:"#0000001A"}}),e}(),ul));r=(await i.render(t,(0,rl.d)(e))).svg}catch(e){var o;return console.error("Error rendering mermaid diagram:",e),void(null===(o=document.getElementById(t))||void 0===o||o.remove())}const s=ml.parseFromString(r,"text/html"),l=s.querySelector("svg"),c=s.createElementNS("http://www.w3.org/2000/svg","defs");c.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>`,l.prepend(c);const d=s.createElementNS("http://www.w3.org/2000/svg","style");d.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`,l.appendChild(d);const p=gl.serializeToString(l),u=(0,pl.f)(p,{fragment:!0}).children;a.children.splice(i,1,...u),a.properties.className=(a.properties.className||[]).concat("mermaid")})())})),await Promise.all(t)}}const bl={Fragment:Zs.Fragment,jsx:Zs.jsx,jsxs:Zs.jsxs};function fl(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([dl]).use(vl).use(il.A,{...bl,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 Al=(0,m.wrapBrick)("eo-avatar");function yl(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(Al,{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(wl,{key:t,chunk:e}))))))}function wl(e){let{chunk:t}=e;return u().createElement(u().Fragment,null,"markdown"===t.type?u().createElement("div",{className:"markdown"},u().createElement(fl,{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 kl,El=n(87236);let xl,Nl,Ml,Tl,Cl,Ll,Il,Sl,Ol;const{defineElement:_l,property:Rl,event:Wl}=(0,h.createDecorators)();let Dl;var Pl=new WeakMap,$l=new WeakMap,Bl=new WeakMap,Ul=new WeakSet,Fl=new WeakMap;class Vl extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Ul),(0,r.A)(this,Pl,Nl(this)),(0,r.A)(this,$l,(Ml(this),Tl(this))),(0,r.A)(this,Bl,(Cl(this),Ll(this))),(0,r.A)(this,Fl,(Ol(this),e=>{(0,s.A)(Ul,this,Il).emit(e)}))}get messages(){return(0,c.A)(Pl,this)}set messages(e){(0,l.A)(Pl,this,e)}get errorBoundary(){return(0,c.A)($l,this)}set errorBoundary(e){(0,l.A)($l,this,e)}render(){return u().createElement(zl,{host:this,messages:this.messages,errorBoundary:this.errorBoundary,onStoryboardUpdate:(0,c.A)(Fl,this)})}}function zl(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(yl,{key:null!==(n=e.key)&&void 0!==n?n:`index-${t}`,message:e})})))}kl=Vl,({e:[Nl,Ml,Tl,Cl,Ll,Il,Sl,Ol],c:[Dl,xl]}=(0,d.A)(kl,[_l("visual-builder.chat-conversation",{styleTexts:[El.A]})],[[Rl({attribute:!1}),1,"messages"],[Rl({type:Boolean}),1,"errorBoundary"],[Wl({type:"storyboard.update"}),1,"storyboardUpdate",e=>(0,c.A)(Bl,e),(e,t)=>(0,l.A)(Bl,e,t)]],0,(e=>Fl.has((0,o.A)(e))),m.ReactNextElement)),xl();var jl=n(89575),Kl=n(55310);function Xl(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 Jl,Gl=n(81563);let Hl,ql,Yl,Zl,Ql,ec,tc,nc,ic,ac,rc,oc,sc,lc,cc,dc;const{defineElement:pc,property:uc,event:hc,method:mc}=(0,h.createDecorators)();let gc;var vc=new WeakMap,bc=new WeakMap,fc=new WeakMap,Ac=new WeakMap,yc=new WeakMap,wc=new WeakMap,kc=new WeakSet,Ec=new WeakMap;class xc extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,kc),(0,r.A)(this,vc,(Hl(this),Yl(this))),(0,r.A)(this,bc,(Zl(this),Ql(this))),(0,r.A)(this,fc,(ec(this),tc(this))),(0,r.A)(this,Ac,(nc(this),ic(this))),(0,r.A)(this,yc,(ac(this),rc(this))),(0,r.A)(this,wc,(oc(this),sc(this))),(0,r.A)(this,Ec,(dc(this),e=>{(0,s.A)(kc,this,lc).emit(e)}))}get storyboard(){return(0,c.A)(vc,this)}set storyboard(e){(0,l.A)(vc,this,e)}get theme(){return(0,c.A)(bc,this)}set theme(e){(0,l.A)(bc,this,e)}get uiVersion(){return(0,c.A)(fc,this)}set uiVersion(e){(0,l.A)(fc,this,e)}get app(){return(0,c.A)(Ac,this)}set app(e){(0,l.A)(Ac,this,e)}get inspecting(){return(0,c.A)(yc,this)}set inspecting(e){(0,l.A)(yc,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(Nc,{storyboard:this.storyboard,theme:this.theme,uiVersion:this.uiVersion,app:this.app,inspecting:this.inspecting,onActiveTargetChange:(0,c.A)(Ec,this)})}}function Nc(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,Kl.safeDump)(t,{schema:Kl.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(Xl,(0,jl.A)({key:t,variant:"hover"},e)))),E.map(((e,t)=>u().createElement(Xl,(0,jl.A)({key:t,variant:"active"},e)))))}Jl=xc,({e:[Yl,Zl,Ql,ec,tc,nc,ic,ac,rc,oc,sc,lc,cc,dc,Hl],c:[gc,ql]}=(0,d.A)(Jl,[pc("visual-builder.chat-preview",{styleTexts:[Gl.A]})],[[uc({attribute:!1}),1,"storyboard"],[uc(),1,"theme"],[uc(),1,"uiVersion"],[uc(),1,"app"],[uc({type:Boolean}),1,"inspecting"],[hc({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>(0,c.A)(wc,e),(e,t)=>(0,l.A)(wc,e,t)],[mc(),2,"select"]],0,(e=>Ec.has((0,o.A)(e))),m.ReactNextElement)),ql();let Mc=!1;let Tc=null;function Cc(e){e.preventDefault(),e.stopPropagation(),function(e){const t=_c(e.composedPath());window.parent.postMessage({channel:"chat-preview",type:"inspect-active",payload:{outlines:t.map(Rc)}},location.origin)}(e)}function Lc(e){e.preventDefault(),e.stopPropagation()}const Ic=(0,kt.debounce)(((e,t,n)=>{let i=_c(e);if(0===i.length)for(const a of e)if(a instanceof HTMLElement&&a.shadowRoot){i=_c(a.shadowRoot.elementsFromPoint(t,n));break}const a=i.length>0?i[0].element:null;a!==Tc&&(Tc=a,window.parent.postMessage({channel:"chat-preview",type:"inspect-hover",payload:{outlines:i.map(Rc)}},location.origin))}),20,{leading:!0});function Sc(e){Ic(e.composedPath(),e.clientX,e.clientY)}function Oc(e){e.preventDefault(),e.stopPropagation(),Tc=null,window.parent.postMessage({channel:"chat-preview",type:"inspect-hover",payload:{outlines:[]}},location.origin)}function _c(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:Wc(e),element:e})}})),t}function Rc(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 Wc(e){return e.tagName.toLowerCase().split(".").pop()}let Dc=!1;function Pc(e){window.parent.postMessage({channel:"chat-preview",...e},location.origin)}customElements.define("visual-builder.inject-chat-preview-agent",(0,ms.createProviderClass)((async function(){Dc||(Dc=!0,n.e(2201).then(n.bind(n,42201)),Pc({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(Mc===e)return;Mc=e;const t=e?"addEventListener":"removeEventListener";window[t]("click",Cc,!0),window[t]("mousedown",Lc,!0),window[t]("mouseover",Lc,!0),window[t]("mouseup",Lc,!0),window[t]("pointerdown",Lc,!0),window[t]("pointerover",Lc,!0),window[t]("pointerup",Lc,!0),window[t]("pointerleave",Oc,!0),window[t]("pointermove",Sc,!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=>Rc({...e,element:t,label:Wc(t)})))}},location.origin)}(e.data.payload)}})),window.addEventListener("scroll",(()=>{Pc({type:"scroll",payload:{x:window.scrollX,y:window.scrollY}})})))})));var $c,Bc=n(94014),Uc=n(48918);let Fc,Vc,zc,jc,Kc,Xc,Jc,Gc,Hc,qc,Yc;const{defineElement:Zc,property:Qc}=(0,h.createDecorators)();let ed;var td=new WeakMap,nd=new WeakMap,id=new WeakMap,ad=new WeakMap,rd=new WeakMap;class od extends m.ReactNextElement{constructor(){super(...arguments),(0,r.A)(this,td,Vc(this)),(0,r.A)(this,nd,(zc(this),jc(this))),(0,r.A)(this,id,(Kc(this),Xc(this))),(0,r.A)(this,ad,(Jc(this),Gc(this))),(0,r.A)(this,rd,(Hc(this),qc(this))),Yc(this)}get generations(){return(0,c.A)(td,this)}set generations(e){(0,l.A)(td,this,e)}get category(){return(0,c.A)(nd,this)}set category(e){(0,l.A)(nd,this,e)}get theme(){return(0,c.A)(id,this)}set theme(e){(0,l.A)(id,this,e)}get uiVersion(){return(0,c.A)(ad,this)}set uiVersion(e){(0,l.A)(ad,this,e)}get app(){return(0,c.A)(rd,this)}set app(e){(0,l.A)(rd,this,e)}render(){return u().createElement(sd,{generations:this.generations,category:this.category,theme:this.theme,uiVersion:this.uiVersion,app:this.app})}}function sd(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(ld),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,Kl.safeDump)(h,{schema:Kl.JSON_SCHEMA,skipInvalid:!0,noRefs:!0,noCompatMode:!0})},{app:r,theme:i,uiVersion:a,styleText:Uc.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 ld(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)}$c=od,({e:[Vc,zc,jc,Kc,Xc,Jc,Gc,Hc,qc,Yc],c:[ed,Fc]}=(0,d.A)($c,[Zc("visual-builder.pre-generated-preview",{styleTexts:[Bc.A]})],[[Qc({attribute:!1}),1,"generations"],[Qc(),1,"category"],[Qc(),1,"theme"],[Qc(),1,"uiVersion"],[Qc(),1,"app"]],0,void 0,m.ReactNextElement)),Fc();var cd,dd=n(99216);let pd;const{defineElement:ud}=(0,h.createDecorators)();let hd;class md extends m.ReactNextElement{render(){return u().createElement(gd,null)}}function gd(){return u().createElement("slot",null)}var vd;let bd,fd,Ad,yd,wd;cd=md,[hd,pd]=(0,d.A)(cd,[ud("visual-builder.pre-generated-table-view",{styleTexts:[dd.A]})],[],0,void 0,m.ReactNextElement).c,pd();const{defineElement:kd,property:Ed}=(0,h.createDecorators)();let xd;var Nd=new WeakMap,Md=new WeakMap;class Td extends m.ReactNextElement{constructor(){super(...arguments),(0,r.A)(this,Nd,fd(this)),(0,r.A)(this,Md,(Ad(this),yd(this))),wd(this)}get useBrick(){return(0,c.A)(Nd,this)}set useBrick(e){(0,l.A)(Nd,this,e)}get dataSource(){return(0,c.A)(Md,this)}set dataSource(e){(0,l.A)(Md,this,e)}render(){return u().createElement(Cd,{useBrick:this.useBrick,dataSource:this.dataSource})}}function Cd(e){let{useBrick:t,dataSource:n}=e;return t?u().createElement(Zr.ReactUseMultipleBricks,{useBrick:t,data:n,errorBoundary:!0}):null}vd=Td,({e:[fd,Ad,yd,wd],c:[xd,bd]}=(0,d.A)(vd,[kd("visual-builder.pre-generated-container",{shadowOptions:!1})],[[Ed({attribute:!1}),1,"useBrick"],[Ed({attribute:!1}),1,"dataSource"]],0,void 0,m.ReactNextElement)),bd(),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 Ld=n(7e4);function Id(e,t){const n=new Map;for(const i of e){const e=(0,Ld.collectMemberUsage)([i.if,i.value,i.resolve],t);n.set(i,e)}return n}function Sd(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)})),Sd(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)(Id)),customElements.define("visual-builder.get-dependency-tree",(0,ms.createProviderClass)((function(e,t){const n=e,i=Id(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 Sd(n,{result:r,dependencyList:a,parents:[]}),r})));let Od=et.__secret_internals;try{var _d;const e=window.dll;if(e&&null!==(_d=window.BRICK_NEXT_VERSIONS)&&void 0!==_d&&null!==(_d=_d["brick-container"])&&void 0!==_d&&_d.startsWith("2.")){const{developHelper:t}=e("tYg3");Od={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 Rd=Od;var Wd,Dd=n(61304),Pd=n(59034),$d=n(94162);let Bd,Ud,Fd,Vd,zd,jd,Kd,Xd,Jd,Gd,Hd,qd,Yd,Zd,Qd,ep,tp,np,ip,ap,rp,op,sp,lp,cp,dp,pp,up,hp;const{defineElement:mp,property:gp,event:vp}=(0,h.createDecorators)();let bp;var fp=new WeakMap,Ap=new WeakMap,yp=new WeakMap,wp=new WeakMap,kp=new WeakMap,Ep=new WeakMap,xp=new WeakMap,Np=new WeakMap,Mp=new WeakMap,Tp=new WeakSet,Cp=new WeakMap,Lp=new WeakMap,Ip=new WeakMap,Sp=new WeakMap,Op=new WeakMap;class _p extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Tp),(0,r.A)(this,fp,Ud(this)),(0,r.A)(this,Ap,(Fd(this),Vd(this))),(0,r.A)(this,yp,(zd(this),jd(this))),(0,r.A)(this,wp,(Kd(this),Xd(this))),(0,r.A)(this,kp,(Jd(this),Gd(this))),(0,r.A)(this,Ep,(Hd(this),qd(this))),(0,r.A)(this,xp,(Yd(this),Zd(this))),(0,r.A)(this,Np,(Qd(this),ep(this))),(0,r.A)(this,Mp,(tp(this),np(this))),(0,r.A)(this,Cp,(rp(this),e=>{(0,s.A)(Tp,this,ip).emit(e)})),(0,r.A)(this,Lp,op(this)),(0,r.A)(this,Ip,(cp(this),e=>{(0,s.A)(Tp,this,sp).emit(e)})),(0,r.A)(this,Sp,dp(this)),(0,r.A)(this,Op,(hp(this),e=>{(0,s.A)(Tp,this,pp).emit(e)}))}get previewUrl(){return(0,c.A)(fp,this)}set previewUrl(e){(0,l.A)(fp,this,e)}get generations(){return(0,c.A)(Ap,this)}set generations(e){(0,l.A)(Ap,this,e)}get mocks(){return(0,c.A)(yp,this)}set mocks(e){(0,l.A)(yp,this,e)}get busy(){return(0,c.A)(wp,this)}set busy(e){(0,l.A)(wp,this,e)}get category(){return(0,c.A)(kp,this)}set category(e){(0,l.A)(kp,this,e)}get theme(){return(0,c.A)(Ep,this)}set theme(e){(0,l.A)(Ep,this,e)}get uiVersion(){return(0,c.A)(xp,this)}set uiVersion(e){(0,l.A)(xp,this,e)}get app(){return(0,c.A)(Np,this)}set app(e){(0,l.A)(Np,this,e)}render(){return u().createElement(Rp,{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)(Cp,this),onApprove:(0,c.A)(Ip,this),onViewAttrPrompt:(0,c.A)(Op,this)})}}function Rp(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=Rd.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,Dd.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,Kl.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:Kl.JSON_SCHEMA,skipInvalid:!0,noRefs:!0,noCompatMode:!0})},{app:l,theme:o,uiVersion:s,styleText:$d.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}))}Wd=_p,({e:[Ud,Fd,Vd,zd,jd,Kd,Xd,Jd,Gd,Hd,qd,Yd,Zd,Qd,ep,tp,np,ip,ap,rp,op,sp,lp,cp,dp,pp,up,hp],c:[bp,Bd]}=(0,d.A)(Wd,[mp("visual-builder.raw-data-preview",{styleTexts:[Pd.A]})],[[gp(),1,"previewUrl"],[gp({attribute:!1}),1,"generations"],[gp({attribute:!1}),1,"mocks"],[gp({type:Boolean}),1,"busy"],[gp(),1,"category"],[gp(),1,"theme"],[gp(),1,"uiVersion"],[gp(),1,"app"],[vp({type:"comment"}),1,"commentEvent",e=>(0,c.A)(Mp,e),(e,t)=>(0,l.A)(Mp,e,t)],[vp({type:"approve"}),1,"approveEvent",e=>(0,c.A)(Lp,e),(e,t)=>(0,l.A)(Lp,e,t)],[vp({type:"view.attr.prompt"}),1,"viewAttrPromptEvent",e=>(0,c.A)(Sp,e),(e,t)=>(0,l.A)(Sp,e,t)]],0,(e=>Op.has((0,o.A)(e))),m.ReactNextElement)),Bd();var Wp=n(50264);customElements.define("visual-builder.parse-path",(0,ms.createProviderClass)((async function(e,t){const n=[];return{regexp:(0,Wp.MM)(e,n,(0,kt.defaults)(t,{end:!1,strict:!1,sensitive:!0})),keys:n}})));var Dp=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,Dp._)("RAW_DATA_GENERATED_VIEW@EASYOPS",{...n,attr:[t]})})))})));var Pp=n(93084),$p=n(67710),Bp=n(75799),Up=n(84671),Fp=n(28397),Vp=n(83404),zp=n(53287),jp=n(76);customElements.define("visual-builder.get-raw-data-system-prompts",(0,ms.createProviderClass)((function(){return{boolean:Pp,"date-time":$p,enum:Bp,number:Up,others:Fp,"struct-list":Vp,struct:zp,json:jp}})));const Kp="bricks/visual-builder/pre-generated-config";function Xp(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,Kp);var Jp=n(98027);function Gp(e){const{children:t,slots:n,...i}=e;return{...i,slots:Hp(t,n)}}function Hp(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(Gp(i))}}return n}var qp,Yp=n(18488),Zp=n(92120);let Qp,eu,tu,nu,iu,au,ru,ou,su,lu,cu,du,pu,uu,hu;(0,wi.initializeI18n)(Kp,{en:{},zh:{}});const{defineElement:mu,property:gu,event:vu}=(0,h.createDecorators)();let bu;var fu,Au=new WeakMap,yu=new WeakMap,wu=new WeakMap,ku=new WeakMap,Eu=new WeakMap,xu=new WeakMap,Nu=new WeakSet,Mu=new WeakMap;class Tu extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Nu),(0,r.A)(this,Au,eu(this)),(0,r.A)(this,yu,(tu(this),nu(this))),(0,r.A)(this,wu,(iu(this),au(this))),(0,r.A)(this,ku,(ru(this),ou(this))),(0,r.A)(this,Eu,(su(this),lu(this))),(0,r.A)(this,xu,(cu(this),du(this))),(0,r.A)(this,Mu,(hu(this),e=>{(0,s.A)(Nu,this,pu).emit(e)}))}get previewUrl(){return(0,c.A)(Au,this)}set previewUrl(e){(0,l.A)(Au,this,e)}get attrList(){return(0,c.A)(yu,this)}set attrList(e){(0,l.A)(yu,this,e)}get mockList(){return(0,c.A)(wu,this)}set mockList(e){(0,l.A)(wu,this,e)}get metricGroups(){return(0,c.A)(ku,this)}set metricGroups(e){(0,l.A)(ku,this,e)}get containerConfig(){return(0,c.A)(Eu,this)}set containerConfig(e){(0,l.A)(Eu,this,e)}render(){return u().createElement(Cu,{previewUrl:this.previewUrl,attrList:this.attrList,mockList:this.mockList,metricGroups:this.metricGroups,containerConfig:this.containerConfig,onBrickChange:(0,c.A)(Mu,this),root:this})}}function Cu(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,Jp._)(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 Xp({...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,Jp._)(o.fields.title)} %>`:void 0,description:(0,kt.has)(null==o?void 0:o.fields,"description")&&"string"==typeof o.fields.description?`<% ITEM${(0,Jp._)(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,Jp._)(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,Dd.m)(e.candidate,".cellData"):(0,Dd.w)(e.candidate,e.meta.attr.id);t&&d.set(e.meta.attr.id,Gp(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=Lu(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,Kl.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=Lu(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,Dd.w)(t,e.id):Xp({...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:Zp.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 Lu(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 Iu,Su,Ou,_u,Ru,Wu,Du,Pu,$u;qp=Tu,({e:[eu,tu,nu,iu,au,ru,ou,su,lu,cu,du,pu,uu,hu],c:[bu,Qp]}=(0,d.A)(qp,[mu("visual-builder.pre-generated-config",{styleTexts:[Yp.A]})],[[gu(),1,"previewUrl"],[gu({attribute:!1}),1,"attrList"],[gu({attribute:!1}),1,"mockList"],[gu({attribute:!1}),1,"metricGroups"],[gu({attribute:!1}),1,"containerConfig"],[vu({type:"brick.change"}),1,"brickChangeEvent",e=>(0,c.A)(xu,e),(e,t)=>(0,l.A)(xu,e,t)]],0,(e=>Mu.has((0,o.A)(e))),m.ReactNextElement)),Qp();const{defineElement:Bu,property:Uu}=(0,h.createDecorators)();let Fu;var Vu=new WeakMap,zu=new WeakMap,ju=new WeakMap,Ku=new WeakMap;class Xu extends m.ReactNextElement{constructor(){super(...arguments),(0,r.A)(this,Vu,Su(this)),(0,r.A)(this,zu,(Ou(this),_u(this))),(0,r.A)(this,ju,(Ru(this),Wu(this))),(0,r.A)(this,Ku,(Du(this),Pu(this))),$u(this)}get previewUrl(){return(0,c.A)(Vu,this)}set previewUrl(e){(0,l.A)(Vu,this,e)}get container(){return(0,c.A)(zu,this)}set container(e){(0,l.A)(zu,this,e)}get attrList(){return(0,c.A)(ju,this)}set attrList(e){(0,l.A)(ju,this,e)}get mockList(){return(0,c.A)(Ku,this)}set mockList(e){(0,l.A)(Ku,this,e)}render(){return u().createElement(Ju,{root:this,previewUrl:this.previewUrl,container:this.container,attrList:this.attrList,mockList:this.mockList})}}function Ju(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,Dd.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,Dd.m)(e.config,".cellData")),t})),dataSource:{list:r,page:1,pageSize:20}}},n("yaml",{yaml:(0,Kl.safeDump)([l],{skipInvalid:!0})},{theme:"light",uiVersion:"8.2",styleText:Zp.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}))}fu=Xu,({e:[Su,Ou,_u,Ru,Wu,Du,Pu,$u],c:[Fu,Iu]}=(0,d.A)(fu,[Bu("visual-builder.pre-generated-config-preview",{styleTexts:[Yp.A]})],[[Uu(),1,"previewUrl"],[Uu(),1,"container"],[Uu({attribute:!1}),1,"attrList"],[Uu({attribute:!1}),1,"mockList"]],0,void 0,m.ReactNextElement)),Iu();var Gu=n(8406);function Hu(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 qu(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 Yu(e,t,n){const i=[],a=[],[r,o]=e.split("@"),{list:s}=await(0,Gu.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=>Yu(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,Gu.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:Hu(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 Yu(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:qu(a,i,s)}})));var Zu,Qu=n(38350),eh=n(54982);let th,nh,ih,ah,rh,oh,sh,lh,ch,dh,ph,uh,hh,mh,gh;const{defineElement:vh,property:bh}=(0,h.createDecorators)();let fh;var Ah=new WeakMap,yh=new WeakMap,wh=new WeakMap,kh=new WeakMap,Eh=new WeakMap,xh=new WeakMap,Nh=new WeakMap;class Mh extends m.ReactNextElement{constructor(){super(...arguments),(0,r.A)(this,Ah,nh(this)),(0,r.A)(this,yh,(ih(this),ah(this))),(0,r.A)(this,wh,(rh(this),oh(this))),(0,r.A)(this,kh,(sh(this),lh(this))),(0,r.A)(this,Eh,(ch(this),dh(this))),(0,r.A)(this,xh,(ph(this),uh(this))),(0,r.A)(this,Nh,(hh(this),mh(this))),gh(this)}get previewUrl(){return(0,c.A)(Ah,this)}set previewUrl(e){(0,l.A)(Ah,this,e)}get generations(){return(0,c.A)(yh,this)}set generations(e){(0,l.A)(yh,this,e)}get grouped(){return(0,c.A)(wh,this)}set grouped(e){(0,l.A)(wh,this,e)}get busy(){return(0,c.A)(kh,this)}set busy(e){(0,l.A)(kh,this,e)}get theme(){return(0,c.A)(Eh,this)}set theme(e){(0,l.A)(Eh,this,e)}get uiVersion(){return(0,c.A)(xh,this)}set uiVersion(e){(0,l.A)(xh,this,e)}get app(){return(0,c.A)(Nh,this)}set app(e){(0,l.A)(Nh,this,e)}render(){return u().createElement(Th,{root:this,previewUrl:this.previewUrl,generations:this.generations,grouped:this.grouped,busy:this.busy,theme:this.theme,uiVersion:this.uiVersion,app:this.app})}}function Th(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=Rd.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=Hu({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=Xp({...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,Kl.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:Kl.JSON_SCHEMA,skipInvalid:!0,noRefs:!0,noCompatMode:!0})},{app:l,theme:o,uiVersion:s,styleText:[$d.A,eh.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}))}Zu=Mh,({e:[nh,ih,ah,rh,oh,sh,lh,ch,dh,ph,uh,hh,mh,gh],c:[fh,th]}=(0,d.A)(Zu,[vh("visual-builder.raw-metric-preview",{styleTexts:[Qu.A]})],[[bh(),1,"previewUrl"],[bh({attribute:!1}),1,"generations"],[bh({type:Boolean}),1,"grouped"],[bh({type:Boolean}),1,"busy"],[bh(),1,"theme"],[bh(),1,"uiVersion"],[bh(),1,"app"]],0,void 0,m.ReactNextElement)),th(),customElements.define("visual-builder.get-usage-member-statistics",(0,ms.createProviderClass)((async function(e,t){const{includesFnDeps:n=!1,fnList:i}=t||{},a={usedProperties:new Set,hasNonStaticUsage:!1},r={usedArgs:new Set},o=(0,Ld.beforeVisitGlobalMember)(a,"FN");(0,Ld.traverseStoryboardExpressions)(e,((e,t)=>{o(e,t),(0,Ld.collectAppGetMenuUsage)(r,e,t)}),{matchExpressionString:e=>e.includes("FN")||e.includes("APP.getMenu")});const s=new Set(a.usedProperties);if(n){const e=i.filter((e=>a.usedProperties.has(e.name)));for(const t of e){const e=(0,Ld.collectMemberUsageInFunction)(t,"FN",!0);Array.from(e).filter((e=>e!==t.name)).forEach((e=>s.add(e)))}}return{functions:Array.from(s),menus:Array.from(r.usedArgs)}})))},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=7936.ddd2230a.js.map