@next-bricks/visual-builder 1.38.10 → 1.38.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bricks.json +4 -4
- package/dist/chunks/220.eefe3b35.js +2 -0
- package/dist/chunks/220.eefe3b35.js.map +1 -0
- package/dist/chunks/{chat-conversation.7d376617.js → chat-conversation.8ad5042f.js} +3 -3
- package/dist/chunks/chat-conversation.8ad5042f.js.map +1 -0
- package/dist/chunks/{main.2e011325.js → main.3b84e717.js} +2 -2
- package/dist/chunks/{main.2e011325.js.map → main.3b84e717.js.map} +1 -1
- package/dist/{index.a0d86ca8.js → index.e514930b.js} +2 -2
- package/dist/{index.a0d86ca8.js.map → index.e514930b.js.map} +1 -1
- package/dist/manifest.json +38 -38
- package/dist/types.json +5 -5
- package/package.json +2 -2
- package/dist/chunks/220.44996a0f.js +0 -2
- package/dist/chunks/220.44996a0f.js.map +0 -1
- package/dist/chunks/chat-conversation.7d376617.js.map +0 -1
- /package/dist/chunks/{chat-conversation.7d376617.js.LICENSE.txt → chat-conversation.8ad5042f.js.LICENSE.txt} +0 -0
package/dist/bricks.json
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"visual-builder.workbench-pane",
|
|
5
5
|
"visual-builder.workbench-action",
|
|
6
6
|
"visual-builder.workbench-action-list",
|
|
7
|
-
"visual-builder.workbench-tree",
|
|
8
7
|
"visual-builder.workbench-sidebar",
|
|
8
|
+
"visual-builder.workbench-tree",
|
|
9
9
|
"visual-builder.workbench-history-action",
|
|
10
10
|
"visual-builder.page-arch-node",
|
|
11
11
|
"visual-builder.contract-select",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"visual-builder.get-raw-data-system-prompts",
|
|
21
21
|
"visual-builder.inject-chat-preview-agent",
|
|
22
22
|
"visual-builder.parse-path",
|
|
23
|
-
"visual-builder.pre-generated-preview",
|
|
24
23
|
"visual-builder.pre-generated-table-view",
|
|
24
|
+
"visual-builder.pre-generated-preview",
|
|
25
|
+
"visual-builder.pre-generated-container",
|
|
25
26
|
"visual-builder.property-editor",
|
|
26
27
|
"visual-builder.raw-data-preview",
|
|
27
28
|
"visual-builder.pre-generated-config",
|
|
28
|
-
"visual-builder.pre-generated-container",
|
|
29
29
|
"visual-builder.pre-generated-config-preview",
|
|
30
30
|
"visual-builder.raw-metric-preview"
|
|
31
31
|
],
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"eo-tooltip"
|
|
84
84
|
]
|
|
85
85
|
},
|
|
86
|
-
"filePath": "bricks/visual-builder/dist/index.
|
|
86
|
+
"filePath": "bricks/visual-builder/dist/index.e514930b.js"
|
|
87
87
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunk_next_bricks_visual_builder=globalThis.webpackChunk_next_bricks_visual_builder||[]).push([[220,5238],{220:(e,t,i)=>{var n,a=i(4635),r=i(918),o=i(6902),s=i(5536),l=i(6121),c=i(829),d=i(2740),p=i(8769),u=i.n(p),h=i(7921),m=i(1280),g=i(7180),v=i(9765),b=i(8013),f=i(3373),A=i.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:i,badge:n,onActiveChange:a,onFirstActivated:r}=e;const[o,s]=(0,p.useState)(i),[l,c]=(0,p.useState)(!1);(0,p.useEffect)((()=>{s(i)}),[i]),(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"}),n&&u().createElement("div",{className:"badge"},n),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"))))}n=G,({e:[w,k,E,x,N,M,T,C,L,I,S,O,_,R],c:[B,y]}=(0,d.A)(n,[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=i(4586),Z=i(2150);let Q,ee,te;const{defineElement:ie,property:ne}=(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 i of e){var t;i.active?i.style.flex=String(null!==(t=i.activeFlex)&&void 0!==t?t:"1"):i.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:i}=e;return u().createElement("div",{className:"sidebar",ref:i},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,[ie("visual-builder.workbench-sidebar",{styleTexts:[Z.A]})],[[ne(),1,"titleLabel"]],0,void 0,m.ReactNextElement)),Q();var pe=i(2591),ue=i.n(pe),he=i(1740),me=i.n(he),ge=i(8128),ve=i.n(ge),be=i(855),fe=i.n(be),Ae=i(3051),ye=i.n(Ae),we=i(3656),ke=i.n(we),Ee=i(2984),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=i(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:i,active:n,href:a,target:r,tooltip:o}=e;return u().createElement(je,{content:o,placement:"right"},u().createElement(Ve,{className:A()("action",{active:n}),url:i,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=i(3081),tt=i(63),it=i(607),nt={};nt.styleTagTransform=ke(),nt.setAttributes=fe(),nt.insert=ve().bind(null,"head"),nt.domAPI=me(),nt.insertStyleElement=ye(),ue()(it.A,nt),it.A&&it.A.locals&&it.A.locals;var at,rt=i(3430);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:i,menu:n}=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=i),ft!==i&&(At.clear(),ft=i)}),[i]),(0,p.useEffect)((()=>{var e;const{pathname:t,search:i}=s,{selectedKeys:a}=(0,tt.LP)(null!==(e=null==n?void 0:n.menuItems)&&void 0!==e?e:[],t,i,"");o(Number(a[0]))}),[n,s]),u().createElement(u().Fragment,null,null==n||null===(t=n.menuItems)||void 0===t?void 0:t.map(((e,t)=>{if((e=>"default"===e.type||!e.type)(e)){let i=e.to;return r!==t&&At.has(t)&&(i=At.get(t)),u().createElement(pt,{key:t,icon:e.icon,to:i,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=i(1030),Et=i(4940),xt=i(7758),Nt=i(9406),Mt=i(675),Tt=i(7995),Ct=i(6275);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,ei,ti,ii,ni,ai,ri,oi,si,li,ci,di,pi,ui,hi,mi,gi,vi,bi,fi,Ai,yi,wi,ki,Ei,xi,Ni,Mi,Ti,Ci,Li,Ii,Si;function Oi(e){return e.key}i(5168);const{defineElement:_i,property:Ri,event:Wi}=(0,h.createDecorators)();let Di;var Pi=new WeakMap,$i=new WeakMap,Bi=new WeakMap,Ui=new WeakMap,Fi=new WeakMap,Vi=new WeakMap,zi=new WeakMap,ji=new WeakMap,Ki=new WeakMap,Xi=new WeakMap,Ji=new WeakMap,Gi=new WeakMap,Hi=new WeakMap,qi=new WeakMap,Yi=new WeakMap,Zi=new WeakMap,Qi=new WeakMap,en=new WeakMap,tn=new WeakMap,nn=new WeakSet,an=new WeakMap,rn=new WeakMap,on=new WeakMap,sn=new WeakMap,ln=new WeakMap,cn=new WeakMap,dn=new WeakMap,pn=new WeakMap,un=new WeakMap;class hn extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,nn),(0,r.A)(this,Pi,It(this)),(0,r.A)(this,$i,(St(this),Ot(this))),(0,r.A)(this,Bi,(_t(this),Rt(this))),(0,r.A)(this,Ui,(Wt(this),Dt(this))),(0,r.A)(this,Fi,(Pt(this),$t(this))),(0,r.A)(this,Vi,(Bt(this),Ut(this))),(0,r.A)(this,zi,(Ft(this),Vt(this))),(0,r.A)(this,ji,(zt(this),jt(this))),(0,r.A)(this,Ki,(Kt(this),Xt(this))),(0,r.A)(this,Xi,(Jt(this),Gt(this))),(0,r.A)(this,Ji,(Ht(this),qt(this))),(0,r.A)(this,Gi,(Yt(this),Zt(this))),(0,r.A)(this,Hi,(Qt(this),ei(this))),(0,r.A)(this,qi,(ti(this),ii(this))),(0,r.A)(this,Yi,(ni(this),ai(this))),(0,r.A)(this,Zi,(ri(this),oi(this))),(0,r.A)(this,Qi,(si(this),li(this))),(0,r.A)(this,en,(ci(this),di(this))),(0,r.A)(this,tn,(pi(this),ui(this))),(0,r.A)(this,an,(gi(this),e=>{(0,s.A)(nn,this,hi).emit(e)})),(0,r.A)(this,rn,vi(this)),(0,r.A)(this,on,(Ai(this),e=>()=>{(0,s.A)(nn,this,bi).emit(e.data)})),(0,r.A)(this,sn,yi(this)),(0,r.A)(this,ln,(Ei(this),e=>{(0,s.A)(nn,this,wi).emit(e)})),(0,r.A)(this,cn,xi(this)),(0,r.A)(this,dn,(Ti(this),e=>t=>{t.preventDefault(),(0,s.A)(nn,this,Ni).emit({active:!0,node:null==e?void 0:e.data,x:t.clientX,y:t.clientY})})),(0,r.A)(this,pn,Ci(this)),(0,r.A)(this,un,(Si(this),(e,t)=>{(0,s.A)(nn,this,Li).emit({nodeId:e,collapsed:t})}))}get nodes(){return(0,c.A)(Pi,this)}set nodes(e){(0,l.A)(Pi,this,e)}get actions(){return(0,c.A)($i,this)}set actions(e){(0,l.A)($i,this,e)}get actionsHidden(){return(0,c.A)(Bi,this)}set actionsHidden(e){(0,l.A)(Bi,this,e)}get placeholder(){return(0,c.A)(Ui,this)}set placeholder(e){(0,l.A)(Ui,this,e)}get isTransformName(){return(0,c.A)(Fi,this)}set isTransformName(e){(0,l.A)(Fi,this,e)}get searchPlaceholder(){return(0,c.A)(Vi,this)}set searchPlaceholder(e){(0,l.A)(Vi,this,e)}get noSearch(){return(0,c.A)(zi,this)}set noSearch(e){(0,l.A)(zi,this,e)}get activeKey(){return(0,c.A)(ji,this)}set activeKey(e){(0,l.A)(ji,this,e)}get showMatchedNodeOnly(){return(0,c.A)(Ki,this)}set showMatchedNodeOnly(e){(0,l.A)(Ki,this,e)}get matchNodeDataFields(){return(0,c.A)(Xi,this)}set matchNodeDataFields(e){(0,l.A)(Xi,this,e)}get fixedActionsFor(){return(0,c.A)(Ji,this)}set fixedActionsFor(e){(0,l.A)(Ji,this,e)}get collapsible(){return(0,c.A)(Gi,this)}set collapsible(e){(0,l.A)(Gi,this,e)}get collapsedNodes(){return(0,c.A)(Hi,this)}set collapsedNodes(e){(0,l.A)(Hi,this,e)}get allowDrag(){return(0,c.A)(qi,this)}set allowDrag(e){(0,l.A)(qi,this,e)}get allowDragToRoot(){return(0,c.A)(Yi,this)}set allowDragToRoot(e){(0,l.A)(Yi,this,e)}get allowDragToInside(){return(0,c.A)(Zi,this)}set allowDragToInside(e){(0,l.A)(Zi,this,e)}get nodeKey(){return(0,c.A)(Qi,this)}set nodeKey(e){(0,l.A)(Qi,this,e)}get skipNotify(){return(0,c.A)(en,this)}set skipNotify(e){(0,l.A)(en,this,e)}render(){return u().createElement(Et.e.Provider,{value:{actions:this.actions,actionsHidden:this.actionsHidden,onActionClick:(0,c.A)(an,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:Oi,onNodeToggle:(0,c.A)(un,this),skipNotify:this.skipNotify,clickFactory:(0,c.A)(on,this),contextMenuFactory:(0,c.A)(dn,this),matchNode:(e,t)=>{var i;return(0,Mt.U)(e.name,t)||!(null===(i=this.matchNodeDataFields)||void 0===i||!i.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)(ln,this),allowDrag:this.allowDrag,allowDragToInside:this.allowDragToInside,allowDragToRoot:this.allowDragToRoot})))}}wt=hn,({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,ei,ti,ii,ni,ai,ri,oi,si,li,ci,di,pi,ui,hi,mi,gi,vi,bi,fi,Ai,yi,wi,ki,Ei,xi,Ni,Mi,Ti,Ci,Li,Ii,Si],c:[Di,Lt]}=(0,d.A)(wt,[_i("visual-builder.workbench-tree",{styleTexts:[Tt.A,Ct.A]})],[[Ri({attribute:!1}),1,"nodes"],[Ri({attribute:!1}),1,"actions"],[Ri({type:Boolean}),1,"actionsHidden"],[Ri(),1,"placeholder"],[Ri({type:Boolean}),1,"isTransformName"],[Ri(),1,"searchPlaceholder"],[Ri({type:Boolean}),1,"noSearch"],[Ri({attribute:!1}),1,"activeKey"],[Ri({type:Boolean}),1,"showMatchedNodeOnly"],[Ri({attribute:!1}),1,"matchNodeDataFields"],[Ri({attribute:!1}),1,"fixedActionsFor"],[Ri({type:Boolean}),1,"collapsible"],[Ri({attribute:!1}),1,"collapsedNodes"],[Ri({type:Boolean}),1,"allowDrag"],[Ri({type:Boolean}),1,"allowDragToRoot"],[Ri({type:Boolean}),1,"allowDragToInside"],[Ri({type:String}),1,"nodeKey"],[Ri({type:Boolean}),1,"skipNotify"],[Wi({type:"action.click"}),1,"actionClickEvent",e=>(0,c.A)(tn,e),(e,t)=>(0,l.A)(tn,e,t)],[Wi({type:"node.click"}),1,"nodeClickEvent",e=>(0,c.A)(rn,e),(e,t)=>(0,l.A)(rn,e,t)],[Wi({type:"node.drop"}),1,"nodeDropEvent",e=>(0,c.A)(sn,e),(e,t)=>(0,l.A)(sn,e,t)],[Wi({type:"context.menu"}),1,"nodeContextMenuEvent",e=>(0,c.A)(cn,e),(e,t)=>(0,l.A)(cn,e,t)],[Wi({type:"node.toggle"}),1,"nodeToggleEvent",e=>(0,c.A)(pn,e),(e,t)=>(0,l.A)(pn,e,t)]],0,(e=>un.has((0,o.A)(e))),m.ReactNextElement)),Lt();var mn=i(155),gn=i.n(mn),vn=i(1361),bn=i(9704);let fn=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 An="bricks/visual-builder/workbench-history-action";var yn=i(4107),wn=i(9733);const kn={add:`${An}:${fn.ADD}`,edit:`${An}:${fn.EDIT}`,delete:`${An}:${fn.DELETE}`,batch_delete:`${An}:${fn.DELETE}`,import:`${An}:${fn.IMPORT}`,clone:`${An}:${fn.CLONE}`,append_relation:`${An}:${fn.APPEND_RELATION}`,update_relation:`${An}:${fn.UPDATE_RELATION}`,remove_relation:`${An}:${fn.REMOVE_RELATION}`,rollback:`${An}:${fn.ROLLBACK}`,rollback_all:`${An}:${fn.ROLLBACK_ALL}`},En={add:`${An}:${fn.ADD_FULL}`,edit:`${An}:${fn.EDIT_FULL}`,delete:`${An}:${fn.DELETE_FULL}`,batch_delete:`${An}:${fn.DELETE_FULL}`,import:`${An}:${fn.IMPORT_FULL}`,clone:`${An}:${fn.CLONE_FULL}`,append_relation:`${An}:${fn.APPEND_RELATION_FULL}`,update_relation:`${An}:${fn.UPDATE_RELATION_FULL}`,remove_relation:`${An}:${fn.REMOVE_RELATION_FULL}`,rollback:`${An}:${fn.ROLLBACK_FULL}`,rollback_all:`${An}:${fn.ROLLBACK_ALL_FULL}`},xn={project:`${An}:${fn.PROJECT}`,userGroup:`${An}:${fn.USER}`,permission:`${An}:${fn.PERMISSION}`,brick:`${An}:${fn.BRICK}`,route:`${An}:${fn.ROUTE}`,template:`${An}:${fn.TEMPLATE}`,snippet:`${An}:${fn.SNIPPET}`,i18n:`${An}:${fn.I18N}`,image:`${An}:${fn.IMAGE}`,function:`${An}:${fn.FUNCTION}`,menu:`${An}:${fn.MENU}`,menuItem:`${An}:${fn.MENU_ITEM}`,workflow:`${An}:${fn.WORKFLOW}`},Nn={PROJECT_MICRO_APP:`${An}:${fn.PROJECT}`,"MICRO_APP_USER_GROUP@EASYOPS":`${An}:${fn.USER}`,MICRO_APP_RESOURCE_PERMISSION:`${An}:${fn.PERMISSION}`,STORYBOARD_BRICK:`${An}:${fn.BRICK}`,STORYBOARD_ROUTE:`${An}:${fn.ROUTE}`,STORYBOARD_TEMPLATE:`${An}:${fn.TEMPLATE}`,STORYBOARD_SNIPPET:`${An}:${fn.SNIPPET}`,STORYBOARD_I18N:`${An}:${fn.I18N}`,MICRO_APP_RESOURCE_IMAGE:`${An}:${fn.IMAGE}`,STORYBOARD_FUNCTION:`${An}:${fn.FUNCTION}`,MICRO_APP_RESOURCE_MENU:`${An}:${fn.MENU}`,MICRO_APP_RESOURCE_MENU_ITEM:`${An}:${fn.MENU_ITEM}`,"WORKFLOW_DEF@EASYOPS":`${An}:${fn.WORKFLOW}`};function Mn(e){var t,i,n,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=wn.i18n.t(null!==(t=xn[e.category])&&void 0!==t?t:e.category),y=wn.i18n.t(null!==(i=kn[f])&&void 0!==i?i:f),w=wn.i18n.t(null!==(n=Nn[null===(a=e.abstract)||void 0===a?void 0:a.leftObjectId])&&void 0!==n?n:null===(r=e.abstract)||void 0===r?void 0:r.leftObjectId),k=wn.i18n.t(null!==(o=Nn[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=Tn(null===(c=e.abstract)||void 0===c?void 0:c.nodes,null===(d=e.abstract)||void 0===d?void 0:d.nodesCount),x=Tn(null===(p=e.abstract)||void 0===p?void 0:p.leftNodes,null===(u=e.abstract)||void 0===u?void 0:u.leftNodesCount),N=Tn(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?Mn(e.rollBackIdInfo).abstract:null;return{category:A,action:y,leftObjectId:w,rightObjectId:k,nodes:E,leftNodes:x,rightNodes:N,abstract:wn.i18n.t(null!==(g=En[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 Tn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:", ";return wn.i18n.t(`${An}:${fn.NODE}`,{nodes:e.join(i),context:t>e.length?"ellipsis":void 0,count:t})}var Cn;let Ln,In,Sn,On,_n,Rn,Wn,Dn,Pn,$n,Bn,Un,Fn,Vn,zn,jn,Kn;(0,bn.initializeReactI18n)(An,{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:Xn,property:Jn,event:Gn}=(0,h.createDecorators)(),Hn=(0,m.wrapBrick)("eo-button"),qn=(0,m.wrapBrick)("eo-link"),Yn=(0,m.wrapBrick)("eo-icon"),Zn=(0,m.wrapBrick)("eo-easyops-avatar"),Qn=(0,m.wrapBrick)("eo-popover",{onVisibleChange:"visible.change",onBeforeVisibleChange:"before.visible.change"});let ea;var ta=new WeakMap,ia=new WeakMap,na=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,In(this)),(0,r.A)(this,ia,(Sn(this),On(this))),(0,r.A)(this,na,(_n(this),Rn(this))),(0,r.A)(this,ra,(Pn(this),e=>{(0,s.A)(aa,this,Wn).emit(e)})),(0,r.A)(this,oa,$n(this)),(0,r.A)(this,sa,(Fn(this),e=>{(0,s.A)(aa,this,Bn).emit(e)})),(0,r.A)(this,la,Vn(this)),(0,r.A)(this,ca,(Kn(this),()=>{(0,s.A)(aa,this,zn).emit()}))}get appId(){return(0,c.A)(ta,this)}set appId(e){(0,l.A)(ta,this,e)}get projectId(){return(0,c.A)(ia,this)}set projectId(e){(0,l.A)(ia,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:i,onRollback:n,onRollbackAll:a}=e,{t:r}=(0,bn.useTranslation)(An),[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,yn.R)(t,{ts:v.current,limit:20}).then((t=>{g((i=>{const n=t.list.map((e=>({...e,translation:Mn(e)})));return e?n:i.concat(n)})),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(Qn,{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(Hn,{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:i,onRollback:n}))),!l&&u().createElement("span",{className:"load-more-container"},u().createElement(qn,{className:"load-more",disabled:o,onClick:()=>b()},r(fn.LOAD_MORE))),d&&u().createElement("span",{className:"end-container"},"The End",u().createElement(Yn,{className:"rollback-all",lib:"antd",icon:"rollback",theme:"outlined",onClick:()=>a()}))):u().createElement("div",{className:"empty"},r(o?fn.LOADING:fn.NO_DATA))),u().createElement("slot",null)))}function ua(e){const{data:t,enableRollback:i,current:n,onHistoryItemClick:a,onRollback:r}=e,o=gn()(Number(t.ts)/1e6),s=gn().duration(o.diff(gn()())),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:i})},u().createElement("div",{className:"topic",title:t.translation.abstract},t.translation.abstract),n&&u().createElement("div",{className:"branch"},"(current)")),u().createElement("div",{className:"title-right"},i&&u().createElement(Yn,{className:"rollback",lib:"antd",icon:"rollback",theme:"outlined",onClick:()=>r(t)}))),u().createElement("div",{className:"item-info"},u().createElement(Zn,{className:"avatar",nameOrInstanceId:t.user,size:"xs"}),u().createElement("div",{className:"time"},l),u().createElement("div",{className:"operator"},t.user)))}Cn=da,({e:[In,Sn,On,_n,Rn,Wn,Dn,Pn,$n,Bn,Un,Fn,Vn,zn,jn,Kn],c:[ea,Ln]}=(0,d.A)(Cn,[Xn("visual-builder.workbench-history-action",{styleTexts:[vn.A]})],[[Jn(),1,"appId"],[Jn(),1,"projectId"],[Gn({type:"history.item.click"}),1,"historyItemClickEvent",e=>(0,c.A)(na,e),(e,t)=>(0,l.A)(na,e,t)],[Gn({type:"rollback"}),1,"rollbackEvent",e=>(0,c.A)(oa,e),(e,t)=>(0,l.A)(oa,e,t)],[Gn({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)),Ln();var ha,ma=i(2381);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,ir,nr,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,ir(this)),(0,r.A)(this,zr,(rr(this),e=>{(0,s.A)(Ir,this,nr).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:i,type:n,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"===n?"board":"page",[y,w]=(0,p.useState)(i),[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(i)}),[i]);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 i;"Enter"!==t&&13!==t||null===(i=T.current)||void 0===i||i.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:i,onSubNodeContextMenu:n}=e;return u().createElement(fr,{key:t.id,content:t.label},u().createElement("div",{className:"sub-node",onDoubleClick:e=>{e.stopPropagation(),null==i||i(t)},onContextMenu:e=>{e.stopPropagation(),e.preventDefault(),null==n||n({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,ir,nr,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=i(4273),Qr=i(6213),eo=i(9492);let to,io,no,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,io(this)),(0,r.A)(this,fo,(no(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,[io,no,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=i(4244);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,bn.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:i}=e,[n,a]=(0,p.useState)(t),{t:r}=(0,bn.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(n),onBlur:()=>{s(!1),null==i||i(n)},onChange:e=>{a(Number(e.detail))}}):u().createElement("span",null,n," ",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,bn.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 is;var ns=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,i]=e.split(":");return{name:t,version:i}}function ps(e){return/.*@.*:\d+\.\d+\.\d+/.test(e)}function us(e){return(0,kt.isNil)(e)||ps(e)?"":wn.i18n.t(`${Io}:${Lo.CONTRACT_VALIDATE_MESSAGE}`)}function hs(e){let{value:t,inputStyle:i,validateState:n,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:i=""}=e;const[n,a]=(0,p.useState)([]),[r,o]=(0,p.useState)(i),[s,l]=(0,p.useState)(t);return(0,p.useEffect)((()=>{o(i)}),[i]),(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]),n}({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:i,validateState:n,onChange:e=>{const t=e.detail;if(ps(t))m(ds(t)),null==r||r(t);else{var i,n;const e=null===(i=d.find((e=>e.fullContractName===t)))||void 0===i?void 0:i.version,a=null!==(n=null==e?void 0:e[0])&&void 0!==n?n:"";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:n,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,ns,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)(ns,this)}set name(e){(0,l.A)(ns,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:[is,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=i(7732);var gs,vs=i(7540);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,bn.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,i;let{element:n,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==n||n.close()}),[n]),b=(0,p.useCallback)(((e,t)=>{var i;d(!0),t.dragConf&&(null===(i=e.dataTransfer)||void 0===i||i.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==n||n.close(),null==r||r(t)}),[n,r]);return(0,p.useEffect)((()=>{Ds(n,a)}),[a,n]),(0,p.useEffect)((()=>{if(a&&h.current&&l){const e=h.current.getBoundingClientRect(),t=e.width+8,i=e.height+8,{clientWidth:n,clientHeight:a}=document.documentElement,r=[...l];n>t&&l[0]+t>n&&(r[0]=l[0]-t),a>i&&l[1]+i>a&&(r[1]=a-i),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===(i=null!=m?m:l)||void 0===i?void 0:i[1],visibility:m?"visible":"hidden"}},null==s?void 0:s.map(((e,t)=>{var i,n;return u().createElement("div",{key:t},u().createElement("div",{className:"title"},e.title),(null===(i=e.children)||void 0===i?void 0:i.length)&&u().createElement(_s,null,null===(n=e.children)||void 0===n?void 0:n.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=i(1085),Qs=i(3091),el=i(7447),tl=i(6025),il=i(3640),nl=i(4360),al=i(4269),rl=i(4650),ol=i(9830);function sl(){function e(e,t,i){if(!i||"pre"!==i.tagName||"code"!==e.tagName)return;const n=function(e){const t=e.properties.className||[];for(const e of t)if("language-"===e.slice(0,9))return e.slice(9).toLowerCase();return null}(e);if(null===n)return;let a;try{i.properties.className=(i.properties.className||[]).concat("language-"+n),a=ol.L.highlight((0,rl.d)(e),n)}catch{return}e.children=a.children}return t=>{(0,al.YR)(t,"element",e)}}const ll={Fragment:Zs.Fragment,jsx:Zs.jsx,jsxs:Zs.jsxs};function cl(e){let{content:t,components:i}=e;const[n,a]=(0,p.useState)(null);return(0,p.useEffect)((()=>{let e=!1;return(0,Qs.l)().use(el.A).use(tl.A).use(il.A).use([sl]).use(nl.A,{...ll,passNode:!0,components:i}).process(t).then((t=>{e||a(t.result)})).catch((t=>{e||(console.error("Convert markdown failed:",t),a(null))})),()=>{e=!0}}),[i,t]),n}const dl=(0,m.wrapBrick)("eo-avatar");function pl(e){let{message:t}=e;const i=(0,p.useMemo)((()=>{const e=[];if("assistant"===t.role){const i=/(?:^|\n)```(easy_cmd_\S+)\n([\s\S]*?)\n```(?:$|\n)/gm;let n,a=0;for(;n=i.exec(t.content);){const[r,o,s]=n,l=n.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=i.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]),n=(0,p.useRef)(null);return(0,p.useEffect)((()=>{const e=n.current;e&&setTimeout((()=>{const i=e.parentElement.querySelectorAll(".texting");for(const e of i)e.classList.remove("texting");if(!t.partial)return;let n=e;for(;n;){const e=n.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;n=e.previousSibling}else n=e}n.classList.add("texting")}),1)}),[t.partial,t.content]),u().createElement("div",{className:A()("message",{failed:t.failed})},u().createElement("div",{className:"avatar"},u().createElement(dl,{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:n},i.map(((e,t)=>u().createElement(ul,{key:t,chunk:e}))))))}function ul(e){let{chunk:t}=e;return u().createElement(u().Fragment,null,"markdown"===t.type?u().createElement("div",{className:"markdown"},u().createElement(cl,{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 hl,ml=i(7236);let gl,vl,bl,fl,Al,yl,wl,kl,El;const{defineElement:xl,property:Nl,event:Ml}=(0,h.createDecorators)();let Tl;var Cl=new WeakMap,Ll=new WeakMap,Il=new WeakMap,Sl=new WeakSet,Ol=new WeakMap;class _l extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Sl),(0,r.A)(this,Cl,vl(this)),(0,r.A)(this,Ll,(bl(this),fl(this))),(0,r.A)(this,Il,(Al(this),yl(this))),(0,r.A)(this,Ol,(El(this),e=>{(0,s.A)(Sl,this,wl).emit(e)}))}get messages(){return(0,c.A)(Cl,this)}set messages(e){(0,l.A)(Cl,this,e)}get errorBoundary(){return(0,c.A)(Ll,this)}set errorBoundary(e){(0,l.A)(Ll,this,e)}render(){return u().createElement(Rl,{host:this,messages:this.messages,errorBoundary:this.errorBoundary,onStoryboardUpdate:(0,c.A)(Ol,this)})}}function Rl(e){let{messages:t,host:i,errorBoundary:n,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 i of null!=t?t:[]){var e;if("assistant"!==i.role)continue;let t;r.lastIndex=null!==(e=o.current.get(i.key))&&void 0!==e?e:0;const n=[];let a=!1;for(;t=r.exec(i.content);){o.current.set(i.key,r.lastIndex);const[,e,s]=t;try{const t=JSON.parse(s);"page"===e?(a=!0,n.push(...t)):n.push({...t,type:"item"})}catch(e){console.error("parse storyboard failed:",e)}}a?l(n):n.length>0&&l((e=>[...e,...n]))}}),[r,t]);const[d,h]=(0,p.useState)([]);(0,p.useEffect)((()=>{const e=[],t=new Map;for(const i of s)"block"===i.type?e.push(i):i.storyboard&&t.set(i.uuid,i.storyboard);e.sort(((e,t)=>e.seq-t.seq));const i={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 i=t.get(e);i&&(a.children.push({...i,properties:{...i.properties,slot:void 0},errorBoundary:n,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:n,iid:`block:${o.uuid}`,meta:{type:"block",uuid:o.uuid,name:o.name}};r=!0,i.children.push(a);for(const e of o.children){const i=t.get(e);i&&a.children.push({...i,errorBoundary:n,iid:`item:${e}`,meta:{type:"item",uuid:e}})}}else if(!o.hasContainer)for(const e of o.children){const a=t.get(e);a&&(i.children.push({...a,errorBoundary:n,iid:`item:${e}`,meta:{type:"item",uuid:e}}),r=!0)}}a.children.push(i),h((e=>r?[a]:0===e.length?e:[]))}),[s,n]),(0,p.useEffect)((()=>{null==a||a(d)}),[a,d]);const m=(0,p.useMemo)((()=>{let e=i;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}),[i]);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 i;return u().createElement(pl,{key:null!==(i=e.key)&&void 0!==i?i:`index-${t}`,message:e})})))}hl=_l,({e:[vl,bl,fl,Al,yl,wl,kl,El],c:[Tl,gl]}=(0,d.A)(hl,[xl("visual-builder.chat-conversation",{styleTexts:[ml.A]})],[[Nl({attribute:!1}),1,"messages"],[Nl({type:Boolean}),1,"errorBoundary"],[Ml({type:"storyboard.update"}),1,"storyboardUpdate",e=>(0,c.A)(Il,e),(e,t)=>(0,l.A)(Il,e,t)]],0,(e=>Ol.has((0,o.A)(e))),m.ReactNextElement)),gl();var Wl=i(9575),Dl=i(5310);function Pl(e){let{variant:t,width:i,height:n,left:a,top:r,label:o}=e;return u().createElement("div",{className:"outline "+t,style:{width:i+8,height:n+8,left:a-4,top:r-4}},u().createElement("div",{className:"label"},o))}var $l,Bl=i(1563);let Ul,Fl,Vl,zl,jl,Kl,Xl,Jl,Gl,Hl,ql,Yl,Zl,Ql,ec,tc;const{defineElement:ic,property:nc,event:ac,method:rc}=(0,h.createDecorators)();let oc;var sc=new WeakMap,lc=new WeakMap,cc=new WeakMap,dc=new WeakMap,pc=new WeakMap,uc=new WeakMap,hc=new WeakSet,mc=new WeakMap;class gc extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,hc),(0,r.A)(this,sc,(Ul(this),Vl(this))),(0,r.A)(this,lc,(zl(this),jl(this))),(0,r.A)(this,cc,(Kl(this),Xl(this))),(0,r.A)(this,dc,(Jl(this),Gl(this))),(0,r.A)(this,pc,(Hl(this),ql(this))),(0,r.A)(this,uc,(Yl(this),Zl(this))),(0,r.A)(this,mc,(tc(this),e=>{(0,s.A)(hc,this,Ql).emit(e)}))}get storyboard(){return(0,c.A)(sc,this)}set storyboard(e){(0,l.A)(sc,this,e)}get theme(){return(0,c.A)(lc,this)}set theme(e){(0,l.A)(lc,this,e)}get uiVersion(){return(0,c.A)(cc,this)}set uiVersion(e){(0,l.A)(cc,this,e)}get app(){return(0,c.A)(dc,this)}set app(e){(0,l.A)(dc,this,e)}get inspecting(){return(0,c.A)(pc,this)}set inspecting(e){(0,l.A)(pc,this,e)}select(e){var t;const i=null===(t=this.shadowRoot)||void 0===t||null===(t=t.querySelector("iframe"))||void 0===t?void 0:t.contentWindow;null==i||i.postMessage({channel:"chat-preview",type:"select",payload:e},location.origin)}render(){return u().createElement(vc,{storyboard:this.storyboard,theme:this.theme,uiVersion:this.uiVersion,app:this.app,inspecting:this.inspecting,onActiveTargetChange:(0,c.A)(mc,this)})}}function vc(e){let{storyboard:t,theme:i,uiVersion:n,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 i=null===(t=s.current)||void 0===t?void 0:t.contentWindow;null!=i&&i._preview_only_render?c(!0):setTimeout(e,100)};e()}),[]);(0,p.useEffect)((()=>{var e,t;if(!l)return;const i=et.__secret_internals.getBrickPackagesById("bricks/visual-builder");if(!i)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",{...i,filePath:`${location.origin}${(0,et.getBasePath)()}${null!==(t=window.PUBLIC_ROOT)&&void 0!==t?t:""}${i.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,Dl.safeDump)(t,{schema:Dl.JSON_SCHEMA,skipInvalid:!0,noRefs:!0,noCompatMode:!0})},{app:a,theme:i,uiVersion:n})}),[a,l,t,i,n]);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,i,n,a;const r=null!==(t=null==s||null===(i=s.current)||void 0===i?void 0:i.offsetLeft)&&void 0!==t?t:0,o=null!==(n=null==s||null===(a=s.current)||void 0===a?void 0:a.offsetTop)&&void 0!==n?n: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(Pl,(0,Wl.A)({key:t,variant:"hover"},e)))),E.map(((e,t)=>u().createElement(Pl,(0,Wl.A)({key:t,variant:"active"},e)))))}$l=gc,({e:[Vl,zl,jl,Kl,Xl,Jl,Gl,Hl,ql,Yl,Zl,Ql,ec,tc,Ul],c:[oc,Fl]}=(0,d.A)($l,[ic("visual-builder.chat-preview",{styleTexts:[Bl.A]})],[[nc({attribute:!1}),1,"storyboard"],[nc(),1,"theme"],[nc(),1,"uiVersion"],[nc(),1,"app"],[nc({type:Boolean}),1,"inspecting"],[ac({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>(0,c.A)(uc,e),(e,t)=>(0,l.A)(uc,e,t)],[rc(),2,"select"]],0,(e=>mc.has((0,o.A)(e))),m.ReactNextElement)),Fl();let bc=!1;let fc=null;function Ac(e){e.preventDefault(),e.stopPropagation(),function(e){const t=xc(e.composedPath());window.parent.postMessage({channel:"chat-preview",type:"inspect-active",payload:{outlines:t.map(Nc)}},location.origin)}(e)}function yc(e){e.preventDefault(),e.stopPropagation()}const wc=(0,kt.debounce)(((e,t,i)=>{let n=xc(e);if(0===n.length)for(const a of e)if(a instanceof HTMLElement&&a.shadowRoot){n=xc(a.shadowRoot.elementsFromPoint(t,i));break}const a=n.length>0?n[0].element:null;a!==fc&&(fc=a,window.parent.postMessage({channel:"chat-preview",type:"inspect-hover",payload:{outlines:n.map(Nc)}},location.origin))}),20,{leading:!0});function kc(e){wc(e.composedPath(),e.clientX,e.clientY)}function Ec(e){e.preventDefault(),e.stopPropagation(),fc=null,window.parent.postMessage({channel:"chat-preview",type:"inspect-hover",payload:{outlines:[]}},location.origin)}function xc(e){const t=[];return e.forEach((e=>{let i;if(e.nodeType===Node.ELEMENT_NODE&&e instanceof HTMLElement&&(i=e.dataset.iid)&&i.startsWith("item:")){const n=i.substring(5);t.push({type:"item",uuid:n,label:Mc(e),element:e})}})),t}function Nc(e){const{element:t,type:i,uuid:n,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:i,uuid:n,label:a}}function Mc(e){return e.tagName.toLowerCase().split(".").pop()}let Tc=!1;function Cc(e){window.parent.postMessage({channel:"chat-preview",...e},location.origin)}customElements.define("visual-builder.inject-chat-preview-agent",(0,ms.createProviderClass)((async function(){Tc||(Tc=!0,i.e(2201).then(i.bind(i,2201)),Cc({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(bc===e)return;bc=e;const t=e?"addEventListener":"removeEventListener";window[t]("click",Ac,!0),window[t]("mousedown",yc,!0),window[t]("mouseover",yc,!0),window[t]("mouseup",yc,!0),window[t]("pointerdown",yc,!0),window[t]("pointerover",yc,!0),window[t]("pointerup",yc,!0),window[t]("pointerleave",Ec,!0),window[t]("pointermove",kc,!0)}(e.data.payload.inspecting);break;case"select":!function(e){const t=function(e){const t=[];return function i(n){const a=n.querySelectorAll(`[data-iid="${e}"]`);if(t.push(...a),!(n===document&&a.length>0))for(const e of n.querySelectorAll("*"))e.shadowRoot&&i(e.shadowRoot)}(document),t}(`${e.type}:${e.uuid}`);window.parent.postMessage({channel:"chat-preview",type:"inspect-active",payload:{outlines:t.map((t=>Nc({...e,element:t,label:Mc(t)})))}},location.origin)}(e.data.payload)}})),window.addEventListener("scroll",(()=>{Cc({type:"scroll",payload:{x:window.scrollX,y:window.scrollY}})})))})));var Lc,Ic=i(4014),Sc=i(8918);let Oc,_c,Rc,Wc,Dc,Pc,$c,Bc,Uc,Fc,Vc;const{defineElement:zc,property:jc}=(0,h.createDecorators)();let Kc;var Xc=new WeakMap,Jc=new WeakMap,Gc=new WeakMap,Hc=new WeakMap,qc=new WeakMap;class Yc extends m.ReactNextElement{constructor(){super(...arguments),(0,r.A)(this,Xc,_c(this)),(0,r.A)(this,Jc,(Rc(this),Wc(this))),(0,r.A)(this,Gc,(Dc(this),Pc(this))),(0,r.A)(this,Hc,($c(this),Bc(this))),(0,r.A)(this,qc,(Uc(this),Fc(this))),Vc(this)}get generations(){return(0,c.A)(Xc,this)}set generations(e){(0,l.A)(Xc,this,e)}get category(){return(0,c.A)(Jc,this)}set category(e){(0,l.A)(Jc,this,e)}get theme(){return(0,c.A)(Gc,this)}set theme(e){(0,l.A)(Gc,this,e)}get uiVersion(){return(0,c.A)(Hc,this)}set uiVersion(e){(0,l.A)(Hc,this,e)}get app(){return(0,c.A)(qc,this)}set app(e){(0,l.A)(qc,this,e)}render(){return u().createElement(Zc,{generations:this.generations,category:this.category,theme:this.theme,uiVersion:this.uiVersion,app:this.app})}}function Zc(e){let{generations:t,category:i,theme:n,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 i=null===(t=o.current)||void 0===t?void 0:t.contentWindow;null!=i&&i._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 i=o.current.contentWindow._preview_only_inject,n={...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=>i(e,n,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 i=t.get(e.rwType);i||t.set(e.rwType,i=new Map),i.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 n=0;const a=m===l.size-1;for(const[r,o]of t){if(0===n){let i;for(const t of o.values()){var g;i=null!==(g=t.propertyName)&&void 0!==g?g:e;break}u.push({brick:"div",properties:{textContent:i,className:A()("body-cell",{"last-row-cell":a}),style:{gridRow:`span ${t.size}`}}})}const s=a&&n===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 n=o.get(t),a=null!==(v=null==n?void 0:n.category)&&void 0!==v?v:i;let r;if(null!=n&&null!==(b=n.mockData)&&void 0!==b&&b.length){const t=n.mockData[Math.floor(Math.random()*n.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==n?void 0:n.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(Qc),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}]})}n++}m++}s("yaml",{yaml:(0,Dl.safeDump)(h,{schema:Dl.JSON_SCHEMA,skipInvalid:!0,noRefs:!0,noCompatMode:!0})},{app:r,theme:n,uiVersion:a,styleText:Sc.A})}),[r,c,t,n,a,i]),u().createElement("div",{className:A()("container")},u().createElement("iframe",{ref:o,src:`${(0,et.getBasePath)()}_brick-preview-v3_/preview/`,loading:"lazy",onLoad:h}))}function Qc(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)}Lc=Yc,({e:[_c,Rc,Wc,Dc,Pc,$c,Bc,Uc,Fc,Vc],c:[Kc,Oc]}=(0,d.A)(Lc,[zc("visual-builder.pre-generated-preview",{styleTexts:[Ic.A]})],[[jc({attribute:!1}),1,"generations"],[jc(),1,"category"],[jc(),1,"theme"],[jc(),1,"uiVersion"],[jc(),1,"app"]],0,void 0,m.ReactNextElement)),Oc();var ed,td=i(9216);let id;const{defineElement:nd}=(0,h.createDecorators)();let ad;class rd extends m.ReactNextElement{render(){return u().createElement(od,null)}}function od(){return u().createElement("slot",null)}var sd;let ld,cd,dd,pd,ud;ed=rd,[ad,id]=(0,d.A)(ed,[nd("visual-builder.pre-generated-table-view",{styleTexts:[td.A]})],[],0,void 0,m.ReactNextElement).c,id();const{defineElement:hd,property:md}=(0,h.createDecorators)();let gd;var vd=new WeakMap,bd=new WeakMap;class fd extends m.ReactNextElement{constructor(){super(...arguments),(0,r.A)(this,vd,cd(this)),(0,r.A)(this,bd,(dd(this),pd(this))),ud(this)}get useBrick(){return(0,c.A)(vd,this)}set useBrick(e){(0,l.A)(vd,this,e)}get dataSource(){return(0,c.A)(bd,this)}set dataSource(e){(0,l.A)(bd,this,e)}render(){return u().createElement(Ad,{useBrick:this.useBrick,dataSource:this.dataSource})}}function Ad(e){let{useBrick:t,dataSource:i}=e;return t?u().createElement(Zr.ReactUseMultipleBricks,{useBrick:t,data:i,errorBoundary:!0}):null}sd=fd,({e:[cd,dd,pd,ud],c:[gd,ld]}=(0,d.A)(sd,[hd("visual-builder.pre-generated-container",{shadowOptions:!1})],[[md({attribute:!1}),1,"useBrick"],[md({attribute:!1}),1,"dataSource"]],0,void 0,m.ReactNextElement)),ld(),i(2080),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 yd=i(102);function wd(e,t){const i=new Map;for(const n of e){const e=(0,yd.collectMemberUsage)([n.if,n.value,n.resolve],t);i.set(n,e)}return i}function kd(e,t){e.forEach((i=>{!function(e,t){var i;const{dependencyList:n,nodeList:a,parents:r,result:o}=t,s=(0,kt.cloneDeep)(e);o.push(s);const l=n.find((e=>e.node.key===s.key));if(null!==(i=l.deps)&&void 0!==i&&i.length&&!r.some((e=>e.key===s.key))){const e=s.children=[];!function(e,t){const i=[];e.deps.forEach((e=>{const n=t.nodeList.filter((t=>t.name===e));i.push(...n)})),kd(i,t)}(l,{dependencyList:n,nodeList:a,parents:[...r,s],result:e})}}(i,{...t,nodeList:e})}))}customElements.define("visual-builder.get-data-deps",(0,ms.createProviderClass)(wd)),customElements.define("visual-builder.get-dependency-tree",(0,ms.createProviderClass)((function(e,t){const i=e,n=wd(i.map((e=>e.data)),t.dataType),a=[];for(const[e,t]of n)a.push({deps:Array.from(t.usedProperties),node:i.find((t=>t.data===e))});const r=[];return kd(i,{result:r,dependencyList:a,parents:[]}),r})));let Ed=et.__secret_internals;try{var xd;const e=window.dll;if(e&&null!==(xd=window.BRICK_NEXT_VERSIONS)&&void 0!==xd&&null!==(xd=xd["brick-container"])&&void 0!==xd&&xd.startsWith("2.")){const{developHelper:t}=e("tYg3");Ed={getBrickPackagesById(e){var i;return null===(i=t.getBrickPackages)||void 0===i?void 0:i.call(t).find((t=>t.id===e))}}}}catch(e){console.error("Try to use v2 runtime APIs failed:",e)}const Nd=Ed;var Md,Td=i(1304),Cd=i(9034),Ld=i(4162);let Id,Sd,Od,_d,Rd,Wd,Dd,Pd,$d,Bd,Ud,Fd,Vd,zd,jd,Kd,Xd,Jd,Gd,Hd,qd,Yd,Zd,Qd,ep,tp,ip,np,ap;const{defineElement:rp,property:op,event:sp}=(0,h.createDecorators)();let lp;var cp=new WeakMap,dp=new WeakMap,pp=new WeakMap,up=new WeakMap,hp=new WeakMap,mp=new WeakMap,gp=new WeakMap,vp=new WeakMap,bp=new WeakMap,fp=new WeakSet,Ap=new WeakMap,yp=new WeakMap,wp=new WeakMap,kp=new WeakMap,Ep=new WeakMap;class xp extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,fp),(0,r.A)(this,cp,Sd(this)),(0,r.A)(this,dp,(Od(this),_d(this))),(0,r.A)(this,pp,(Rd(this),Wd(this))),(0,r.A)(this,up,(Dd(this),Pd(this))),(0,r.A)(this,hp,($d(this),Bd(this))),(0,r.A)(this,mp,(Ud(this),Fd(this))),(0,r.A)(this,gp,(Vd(this),zd(this))),(0,r.A)(this,vp,(jd(this),Kd(this))),(0,r.A)(this,bp,(Xd(this),Jd(this))),(0,r.A)(this,Ap,(qd(this),e=>{(0,s.A)(fp,this,Gd).emit(e)})),(0,r.A)(this,yp,Yd(this)),(0,r.A)(this,wp,(ep(this),e=>{(0,s.A)(fp,this,Zd).emit(e)})),(0,r.A)(this,kp,tp(this)),(0,r.A)(this,Ep,(ap(this),e=>{(0,s.A)(fp,this,ip).emit(e)}))}get previewUrl(){return(0,c.A)(cp,this)}set previewUrl(e){(0,l.A)(cp,this,e)}get generations(){return(0,c.A)(dp,this)}set generations(e){(0,l.A)(dp,this,e)}get mocks(){return(0,c.A)(pp,this)}set mocks(e){(0,l.A)(pp,this,e)}get busy(){return(0,c.A)(up,this)}set busy(e){(0,l.A)(up,this,e)}get category(){return(0,c.A)(hp,this)}set category(e){(0,l.A)(hp,this,e)}get theme(){return(0,c.A)(mp,this)}set theme(e){(0,l.A)(mp,this,e)}get uiVersion(){return(0,c.A)(gp,this)}set uiVersion(e){(0,l.A)(gp,this,e)}get app(){return(0,c.A)(vp,this)}set app(e){(0,l.A)(vp,this,e)}render(){return u().createElement(Np,{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)(Ap,this),onApprove:(0,c.A)(wp,this),onViewAttrPrompt:(0,c.A)(Ep,this)})}}function Np(e){let{previewUrl:t,generations:i,mocks:n,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==i?void 0:i.filter((e=>e.approved)).map((e=>e.propertyId)))&&void 0!==e?e:[]}),[i]);const E=(0,p.useCallback)((()=>{const e=()=>{var t;const i=null===(t=m.current)||void 0===t?void 0:t.contentWindow;null!=i&&i._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 i=Nd.getBrickPackagesById("bricks/visual-builder");if(!i)throw new Error("Cannot find preview agent package: bricks/visual-builder");const n=m.current.contentWindow._preview_only_inject,a={...i,filePath:t?new URL(i.filePath,new URL(t,location.origin)).toString():`${location.origin}${(0,et.getBasePath)()}${null!==(e=window.PUBLIC_ROOT)&&void 0!==e?e:""}${i.filePath}`};Promise.allSettled(["visual-builder.pre-generated-table-view","visual-builder.pre-generated-container"].map((e=>n(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=i.length;e<t;e++){var c,d;const r=i[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:n)&&void 0!==h?h:[]).slice();e.sort(((e,t)=>{const i=null==e?void 0:e[r.propertyId],n=null==t?void 0:t[r.propertyId],a=Array.isArray(i),o=Array.isArray(n);if(a||o)return(o?n.length:-1)-(a?i.length:-1);const s=null==i,l=null==n;if(s||l)return(l?0:1)-(s?0:1);const c="string"==typeof i&&0===i.length,d="string"==typeof n&&0===n.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 i;t&&(i=(0,Td.w)(t,r.propertyId)),a.push({brick:"div",properties:{className:A()("body-cell",{"last-row-cell":o})},children:[{brick:"div",properties:{className:"list"},children:i?l.map(((e,t)=>({brick:"visual-builder.pre-generated-container",if:0===t||`<%= CTX.propertyToggleState.includes(${JSON.stringify(r.propertyId)}) %>`,properties:{useBrick:[i],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,Dl.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:Dl.JSON_SCHEMA,skipInvalid:!0,noRefs:!0,noCompatMode:!0})},{app:l,theme:o,uiVersion:s,styleText:Ld.A})}),[l,b,i,o,s,r,n]),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}))}Md=xp,({e:[Sd,Od,_d,Rd,Wd,Dd,Pd,$d,Bd,Ud,Fd,Vd,zd,jd,Kd,Xd,Jd,Gd,Hd,qd,Yd,Zd,Qd,ep,tp,ip,np,ap],c:[lp,Id]}=(0,d.A)(Md,[rp("visual-builder.raw-data-preview",{styleTexts:[Cd.A]})],[[op(),1,"previewUrl"],[op({attribute:!1}),1,"generations"],[op({attribute:!1}),1,"mocks"],[op({type:Boolean}),1,"busy"],[op(),1,"category"],[op(),1,"theme"],[op(),1,"uiVersion"],[op(),1,"app"],[sp({type:"comment"}),1,"commentEvent",e=>(0,c.A)(bp,e),(e,t)=>(0,l.A)(bp,e,t)],[sp({type:"approve"}),1,"approveEvent",e=>(0,c.A)(yp,e),(e,t)=>(0,l.A)(yp,e,t)],[sp({type:"view.attr.prompt"}),1,"viewAttrPromptEvent",e=>(0,c.A)(kp,e),(e,t)=>(0,l.A)(kp,e,t)]],0,(e=>Ep.has((0,o.A)(e))),m.ReactNextElement)),Id();var Mp=i(264);customElements.define("visual-builder.parse-path",(0,ms.createProviderClass)((async function(e,t){const i=[];return{regexp:(0,Mp.MM)(e,i,(0,kt.defaults)(t,{end:!1,strict:!1,sensitive:!0})),keys:i}})));var Tp=i(780);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,...i}=e;return(0,Tp._)("RAW_DATA_GENERATED_VIEW@EASYOPS",{...i,attr:[t]})})))})));var Cp=i(3084),Lp=i(7710),Ip=i(5799),Sp=i(4671),Op=i(8397),_p=i(3404),Rp=i(3287),Wp=i(76);customElements.define("visual-builder.get-raw-data-system-prompts",(0,ms.createProviderClass)((function(){return{boolean:Cp,"date-time":Lp,enum:Ip,number:Sp,others:Op,"struct-list":_p,struct:Rp,json:Wp}})));const Dp="bricks/visual-builder/pre-generated-config";function Pp(e,t,i,n,a,r){let o=null;const s="bibytes"===n.unit?"bytes":n.unit;if("small"===e.size)switch(e.chartType){case"line":o={brick:"eo-mini-line-chart",properties:{data:t,xField:"time",yField:i,width:"auto",showArea:!0}};break;case"gauge":{var l;const a="percent(1)"===n.unit,r="percent(100)"===n.unit||"%"===n.unit;o={brick:"chart-v2.gauge-chart",properties:{data:t,xField:"time",yField:i,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:i}=e;return{value:r?t:t/100,color:`<% THEME.getCssPropertyValue(${JSON.stringify(`--palette-${i}-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:[i],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}wn.i18n.getFixedT(null,Dp);var $p=i(8027);function Bp(e){const{children:t,slots:i,...n}=e;return{...n,slots:Up(t,i)}}function Up(e,t){let i=t;if(Array.isArray(e)&&!i){i={};for(const{slot:t,...n}of e){const e=null!=t?t:"";(0,ms.hasOwnProperty)(i,e)||(i[e]={type:"bricks",bricks:[]}),i[e].bricks.push(Bp(n))}}return i}var Fp,Vp=i(8488),zp=i(2120);let jp,Kp,Xp,Jp,Gp,Hp,qp,Yp,Zp,Qp,eu,tu,iu,nu,au;(0,wn.initializeI18n)(Dp,{en:{},zh:{}});const{defineElement:ru,property:ou,event:su}=(0,h.createDecorators)();let lu;var cu,du=new WeakMap,pu=new WeakMap,uu=new WeakMap,hu=new WeakMap,mu=new WeakMap,gu=new WeakMap,vu=new WeakSet,bu=new WeakMap;class fu extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,vu),(0,r.A)(this,du,Kp(this)),(0,r.A)(this,pu,(Xp(this),Jp(this))),(0,r.A)(this,uu,(Gp(this),Hp(this))),(0,r.A)(this,hu,(qp(this),Yp(this))),(0,r.A)(this,mu,(Zp(this),Qp(this))),(0,r.A)(this,gu,(eu(this),tu(this))),(0,r.A)(this,bu,(au(this),e=>{(0,s.A)(vu,this,iu).emit(e)}))}get previewUrl(){return(0,c.A)(du,this)}set previewUrl(e){(0,l.A)(du,this,e)}get attrList(){return(0,c.A)(pu,this)}set attrList(e){(0,l.A)(pu,this,e)}get mockList(){return(0,c.A)(uu,this)}set mockList(e){(0,l.A)(uu,this,e)}get metricGroups(){return(0,c.A)(hu,this)}set metricGroups(e){(0,l.A)(hu,this,e)}get containerConfig(){return(0,c.A)(mu,this)}set containerConfig(e){(0,l.A)(mu,this,e)}render(){return u().createElement(Au,{previewUrl:this.previewUrl,attrList:this.attrList,mockList:this.mockList,metricGroups:this.metricGroups,containerConfig:this.containerConfig,onBrickChange:(0,c.A)(bu,this),root:this})}}function Au(e){let{previewUrl:t,attrList:i,mockList:n,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?i:null==i?void 0:i.filter((e=>e.metricKey))),[i,k]),x=(0,p.useMemo)((()=>"grouped-chart"===k?function(e,t){var i,n;const a=new Map(e.map((e=>[e.id,e]))),r=[];t.forEach(((e,t)=>{const i=[];for(const t of e.metrics){const e=a.get(t);e&&(a.delete(t),i.push(e))}i.length&&r.push({id:t,group:e.group,metrics:i,counter:e.counter})}));const o=(null!==(i=null===(n=r[r.length-1])||void 0===n?void 0:n.id)&&void 0!==i?i:-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),i=new Map(g.groupMapLiteral),n=function(e,t){var i;let{type:n,dataName:a,dataType:r,settings:o}=t;if(!n||!a||0===e.length)return null;const s=`${"state"===r?"STATE":"CTX"}${(0,$p._)(a)}`;if("chart"===n||"grouped-chart"===n){const t=e,i=`<%= ${s}${null!=o&&o.pagination||null!=o&&o.wrapper?".list":""} %>`,n=t.map((e=>{let{candidate:t,meta:n}=e;return Pp({...t,min:n.counterMetricKey?void 0:t.min},i,n.metric.metricKey,{unit:n.metric.unit},n.groupedMetricKeys,n.counterMetricKey)}));return 1===n.length?n[0]:{brick:"eo-grid-layout",properties:{templateColumns:"repeat(auto-fill, minmax(500px, 1fr))",gap:"var(--card-content-gap)"},slots:{"":{type:"bricks",bricks:n}}}}const l=e;if("cards"===n)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,$p._)(o.fields.title)} %>`:void 0,description:(0,kt.has)(null==o?void 0:o.fields,"description")&&"string"==typeof o.fields.description?`<% ITEM${(0,$p._)(o.fields.description)} %>`:void 0}}]}}}]}}};const c=`<%= ${null!=o&&o.pagination?null!=o&&null!==(i=o.fields)&&void 0!==i&&i.pageSize?`{...${s},pageSize: ${s}${(0,$p._)(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"===n?(0,Td.m)(e.candidate,".cellData"):(0,Td.w)(e.candidate,e.meta.attr.id);t&&d.set(e.meta.attr.id,Bp(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(n){case"table":return{brick:"eo-next-table",properties:{rowKey:"instanceId",columns:l.map((e=>{let{meta:{attr:t}}=e;const i={title:t.name,dataIndex:t.id,key:t.id};return d.has(t.id)&&(i.useChildren=`[${t.id}]`),i})),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:i}}=e;const n={label:i.name};return t&&(n.useChildren=`[${i.id}]`),n})),dataSource:c},slots:p}}return null}(e.map((e=>{var n;const r=yu(k,E,a,e,i),o="grouped-chart"===r.viewType?null===(n=r.metric.candidates)||void 0===n?void 0:n.filter((e=>"small"!==e.size)):e.candidates;return{candidate:null==o?void 0:o.find((i=>i.visualWeight===t.get(e.id))),meta:r}})),r);s(n)}}),[g,r,x,a,s,E,k]);const N=(0,p.useCallback)((()=>{const e=()=>{var t;const i=null===(t=l.current)||void 0===t?void 0:t.contentWindow;null!=i&&i._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 i=new ResizeObserver((()=>{o.style.height=`${t.document.body.scrollHeight}px`}));return i.observe(t.document.body),()=>i.disconnect()}),[c,o]),(0,p.useEffect)((()=>{var e;if(!c)return;const t=null===(e=l.current)||void 0===e?void 0:e.contentWindow,i=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",i),()=>{t.removeEventListener("message",i)}}),[c]),(0,p.useEffect)((()=>{var e;if(!c)return;const i=et.__secret_internals.getBrickPackagesById("bricks/visual-builder");if(!i)throw new Error("Cannot find preview agent package: bricks/visual-builder");const n=l.current.contentWindow._preview_only_inject,a={...i,filePath:t?new URL(i.filePath,new URL(t,location.origin)).toString():`${location.origin}${(0,et.getBasePath)()}${null!==(e=window.PUBLIC_ROOT)&&void 0!==e?e:""}${i.filePath}`};Promise.allSettled([n("visual-builder.pre-generated-container",a,void 0,!0)]).then((()=>{m(!0)}))}),[t,c]),(0,p.useEffect)((()=>{var e,t,i,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,Dl.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,i,r;const o=yu(k,E,a,e,b);let s,l;var c,d;"grouped-chart"===o.viewType?(l=null==n?void 0:n.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==n?void 0:n.map((e=>(0,kt.pick)(e,["time",o.metric.metricKey]))):null!==(d=null==n?void 0:n[0])&&void 0!==d?d:{});const p=null===(t=s)||void 0===t?void 0:t.map((t=>{const i=`<%=\n DATA.rowData.id === ${JSON.stringify(e.id)} &&\n ${JSON.stringify(t.visualWeight)} === CTX.weightMap.get(${JSON.stringify(e.id)})\n %>`,n="default"===o.viewType?(0,Td.w)(t,e.id):Pp({...t,min:o.counterMetricKey?void 0:t.min},"<% DATA %>",o.metric.metricKey,{unit:o.metric.unit},o.groupedMetricKeys,o.counterMetricKey);if(n)return{if:i,brick:"visual-builder.pre-generated-container",properties:{useBrick:n,dataSource:l}}})).filter(Boolean);return null!=p&&p.length?p:{if:`<% DATA.rowData.id === ${JSON.stringify(e.id)} %>`,brick:"span",properties:{textContent:null!==(i=null==n||null===(r=n[0])||void 0===r?void 0:r[e.id])&&void 0!==i?i:""}}}))}},{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!==(i=null==E?void 0:E.map((e=>e.id)))&&void 0!==i?i:[],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,i;return[e.id,null!==(t=null===(i=("grouped-chart"===k?e.metrics[0]:e).candidates)||void 0===i?void 0:i.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,i,n,a;return[e.id,null===(n=null===(i=("grouped-chart"===k?e.metrics[0]:e).candidates)||void 0===i?void 0:i.filter((e=>"grouped-chart"!==k||"small"!==e.size)),a="grouped-chart"===k?2:0,t=null==n?void 0:n.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 "}]})}),[i,r,h,a,n,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 yu(e,t,i,n,a){if("grouped-chart"===e){var r;const o=n,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 i)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:n}:{viewType:e,attr:n}}let wu,ku,Eu,xu,Nu,Mu,Tu,Cu,Lu;Fp=fu,({e:[Kp,Xp,Jp,Gp,Hp,qp,Yp,Zp,Qp,eu,tu,iu,nu,au],c:[lu,jp]}=(0,d.A)(Fp,[ru("visual-builder.pre-generated-config",{styleTexts:[Vp.A]})],[[ou(),1,"previewUrl"],[ou({attribute:!1}),1,"attrList"],[ou({attribute:!1}),1,"mockList"],[ou({attribute:!1}),1,"metricGroups"],[ou({attribute:!1}),1,"containerConfig"],[su({type:"brick.change"}),1,"brickChangeEvent",e=>(0,c.A)(gu,e),(e,t)=>(0,l.A)(gu,e,t)]],0,(e=>bu.has((0,o.A)(e))),m.ReactNextElement)),jp();const{defineElement:Iu,property:Su}=(0,h.createDecorators)();let Ou;var _u=new WeakMap,Ru=new WeakMap,Wu=new WeakMap,Du=new WeakMap;class Pu extends m.ReactNextElement{constructor(){super(...arguments),(0,r.A)(this,_u,ku(this)),(0,r.A)(this,Ru,(Eu(this),xu(this))),(0,r.A)(this,Wu,(Nu(this),Mu(this))),(0,r.A)(this,Du,(Tu(this),Cu(this))),Lu(this)}get previewUrl(){return(0,c.A)(_u,this)}set previewUrl(e){(0,l.A)(_u,this,e)}get container(){return(0,c.A)(Ru,this)}set container(e){(0,l.A)(Ru,this,e)}get attrList(){return(0,c.A)(Wu,this)}set attrList(e){(0,l.A)(Wu,this,e)}get mockList(){return(0,c.A)(Du,this)}set mockList(e){(0,l.A)(Du,this,e)}render(){return u().createElement($u,{root:this,previewUrl:this.previewUrl,container:this.container,attrList:this.attrList,mockList:this.mockList})}}function $u(e){let{root:t,previewUrl:i,container:n,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 i=null===(t=o.current)||void 0===t?void 0:t.contentWindow;null!=i&&i._preview_only_render?l(!0):setTimeout(e,100)};e()}),[]);return(0,p.useEffect)((()=>{var e;const i=null===(e=o.current)||void 0===e?void 0:e.contentWindow;if(!s||!i)return;const n=new ResizeObserver((()=>{t.style.height=`${i.document.body.scrollHeight}px`}));return n.observe(i.document.body),()=>n.disconnect()}),[s,t]),(0,p.useEffect)((()=>{var e,t;const i=null===(e=o.current)||void 0===e||null===(e=e.contentWindow)||void 0===e?void 0:e._preview_only_render;if(!s||!i||!a)return;let l;l="descriptions"===n?{brick:"eo-descriptions",errorBoundary:!0,properties:{column:2,list:a.map((e=>{const t={label:e.name};return e.config&&(t.useBrick=(0,Td.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,Td.m)(e.config,".cellData")),t})),dataSource:{list:r,page:1,pageSize:20}}},i("yaml",{yaml:(0,Dl.safeDump)([l],{skipInvalid:!0})},{theme:"light",uiVersion:"8.2",styleText:zp.A})}),[s,a,r,n]),u().createElement("div",{className:"container"},u().createElement("iframe",{ref:o,src:null!=i?i:`${(0,et.getBasePath)()}_brick-preview-v3_/preview/`,loading:"lazy",onLoad:c}))}cu=Pu,({e:[ku,Eu,xu,Nu,Mu,Tu,Cu,Lu],c:[Ou,wu]}=(0,d.A)(cu,[Iu("visual-builder.pre-generated-config-preview",{styleTexts:[Vp.A]})],[[Su(),1,"previewUrl"],[Su(),1,"container"],[Su({attribute:!1}),1,"attrList"],[Su({attribute:!1}),1,"mockList"]],0,void 0,m.ReactNextElement)),wu();var Bu=i(8406);function Uu(e){const t=[];for(let i=-1;i<3;i++){const n="percent(1)"===e.unit,a="percent(100)"===e.unit||"%"===e.unit,r=i<=0?"small":1===i?"medium":"large";if(n||a||i>=0){const o=-1===i?"gauge":2===i?"area":"line";t.push({visualWeight:i,chartType:o,size:r,min:0,precision:n||a?1:"double"===e.dataType?2:0})}}return t}function Fu(e,t,i){let n=[];switch(e){case"list":n=[{label:"表格",value:"table"},{label:"卡片列表",value:"cards"}];break;case"list-with-pagination":n=[{label:"表格",value:"table",settings:{pagination:!0,fields:t}},{label:"卡片列表",value:"cards",settings:{pagination:!0,fields:t}}];break;case"list-with-wrapper":n=[{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 i)e.metricKey?a++:r++;const o="list-with-pagination"===e?{pagination:!0}:"list-with-wrapper"===e?{wrapper:!0}:void 0;return a>0&&n.push({label:"图表",value:"chart",settings:o,prefer:a>r&&a<6}),a>1&&n.push({label:"组合图表",value:"grouped-chart",settings:o,prefer:a>r&&a>=6}),n}async function Vu(e,t,i){const n=[],a=[],[r,o]=e.split("@"),{list:s}=await(0,Bu.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=>Vu(e,t,i))));for(const t of e)n.push(...t.attrList),a.push(...t.metricGroups)}if(n.push(...r.map((e=>{var i;return t.has(e.id)?{id:e.id,name:e.name,candidates:null===(i=e.generatedView)||void 0===i||null===(i=i[0])||void 0===i?void 0:i.list}:null})).filter(Boolean)),null!=l&&l.length&&a.push(...l),i){const{list:i}=await(0,Bu.y)("_COLLECTOR_ALIAS_METRIC",{fields:["name","displayName","unit","dataType"],page_size:3e3,query:{dataType:{$ne:"string"},objectId:e},sort:[{key:"name",order:1}]});n.push(...i.map((e=>{const i=e.displayName&&t.has(e.displayName);return i||t.has(e.name)?{id:e.name,name:e.displayName,metricKey:i?e.displayName:e.name,unit:e.unit,candidates:Uu(e)}:null})).filter(Boolean))}}return{attrList:n,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 i,n,a="unknown",r=[];if(Array.isArray(t))t.length>0&&(a="list",i=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",i=e.list[0],r=e.list),"list-with-pagination"===a&&"number"==typeof e.page_size&&"number"!=typeof e.pageSize&&(n={pageSize:"page_size"})):(a="object",i=t,r=[i])}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)(i)&&(0,ms.hasOwnProperty)(i,"_object_id")&&"string"==typeof i._object_id){const e=i._object_id,t="object"!==a&&(0,ms.hasOwnProperty)(i,"time")&&"number"==typeof i.time;({attrList:s,metricGroups:l}=await Vu(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:Fu(a,n,s)}})));var zu,ju=i(8350),Ku=i(4982);let Xu,Ju,Gu,Hu,qu,Yu,Zu,Qu,eh,th,ih,nh,ah,rh,oh;const{defineElement:sh,property:lh}=(0,h.createDecorators)();let ch;var dh=new WeakMap,ph=new WeakMap,uh=new WeakMap,hh=new WeakMap,mh=new WeakMap,gh=new WeakMap,vh=new WeakMap;class bh extends m.ReactNextElement{constructor(){super(...arguments),(0,r.A)(this,dh,Ju(this)),(0,r.A)(this,ph,(Gu(this),Hu(this))),(0,r.A)(this,uh,(qu(this),Yu(this))),(0,r.A)(this,hh,(Zu(this),Qu(this))),(0,r.A)(this,mh,(eh(this),th(this))),(0,r.A)(this,gh,(ih(this),nh(this))),(0,r.A)(this,vh,(ah(this),rh(this))),oh(this)}get previewUrl(){return(0,c.A)(dh,this)}set previewUrl(e){(0,l.A)(dh,this,e)}get generations(){return(0,c.A)(ph,this)}set generations(e){(0,l.A)(ph,this,e)}get grouped(){return(0,c.A)(uh,this)}set grouped(e){(0,l.A)(uh,this,e)}get busy(){return(0,c.A)(hh,this)}set busy(e){(0,l.A)(hh,this,e)}get theme(){return(0,c.A)(mh,this)}set theme(e){(0,l.A)(mh,this,e)}get uiVersion(){return(0,c.A)(gh,this)}set uiVersion(e){(0,l.A)(gh,this,e)}get app(){return(0,c.A)(vh,this)}set app(e){(0,l.A)(vh,this,e)}render(){return u().createElement(fh,{root:this,previewUrl:this.previewUrl,generations:this.generations,grouped:this.grouped,busy:this.busy,theme:this.theme,uiVersion:this.uiVersion,app:this.app})}}function fh(e){let{root:t,previewUrl:i,generations:n,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 i=null===(t=c.current)||void 0===t?void 0:t.contentWindow;null!=i&&i._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,i=e=>{let{data:i}=e;"raw-metric-preview"===(null==i?void 0:i.channel)&&"resize"===i.type&&(t.style.height=`${i.payload.height+2}px`)};return e.addEventListener("message",i),()=>{e.removeEventListener("message",i)}}}),[d,t]),(0,p.useEffect)((()=>{var e;if(!d)return;const t=Nd.getBrickPackagesById("bricks/visual-builder");if(!t)throw new Error("Cannot find preview agent package: bricks/visual-builder");const n=c.current.contentWindow._preview_only_inject,a={...t,filePath:i?new URL(t.filePath,new URL(i,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=>n(e,a,void 0,!0)))).then((()=>{g(!0)}))}),[i,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 i=[...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:i},d=new Set,p=new Map;for(const e of n){const t=e.groupIndex;if(null!=t){var u;const i=null!==(u=p.get(t))&&void 0!==u?u:[];p.set(t,i.concat(e))}}for(let e=0,t=n.length;e<t;e++){var h,g,v;const r=n[e],o=e===t-1;let s,l=!1,c=!1;if(a){const{groupIndex:n}=r;if(null==n)i.push({brick:"div",properties:{textContent:"",className:A()("body-cell",{"last-row-cell":o})}});else if(d.has(n))c=!0;else{d.add(n),s=p.get(n);const a=s.length;l=e+a-1==t-1,i.push({brick:"div",properties:{textContent:r.group,className:A()("body-cell",{"last-row-cell":l}),style:{gridRow:`span ${a}`}}})}}i.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=Uu({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)),n="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&&(n||a||e>=0)&&(d=Pp({...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)),i.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 i;return[e.propertyName||e.propertyId,null===(i=e.mockData)||void 0===i?void 0:i[t]]}))):{[u]:e}})))},errorBoundary:!0}]:void 0}]})}}t("yaml",{yaml:(0,Dl.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:Dl.JSON_SCHEMA,skipInvalid:!0,noRefs:!0,noCompatMode:!0})},{app:l,theme:o,uiVersion:s,styleText:[Ld.A,Ku.A].join("\n")})}),[l,m,n,o,s,a]),u().createElement("div",{className:A()("container")},u().createElement("iframe",{ref:c,src:null!=i?i:`${(0,et.getBasePath)()}_brick-preview-v3_/preview/`,loading:"lazy",onLoad:v}))}zu=bh,({e:[Ju,Gu,Hu,qu,Yu,Zu,Qu,eh,th,ih,nh,ah,rh,oh],c:[ch,Xu]}=(0,d.A)(zu,[sh("visual-builder.raw-metric-preview",{styleTexts:[ju.A]})],[[lh(),1,"previewUrl"],[lh({attribute:!1}),1,"generations"],[lh({type:Boolean}),1,"grouped"],[lh({type:Boolean}),1,"busy"],[lh(),1,"theme"],[lh(),1,"uiVersion"],[lh(),1,"app"]],0,void 0,m.ReactNextElement)),Xu()},607:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(6758),a=i.n(n),r=i(935),o=i.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},1361:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(6758),a=i.n(n),r=i(935),o=i.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()},1563:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(6758),a=i.n(n),r=i(935),o=i.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()},2080:(e,t,i)=>{i.d(t,{ADVANCED_CHANGE_KEY:()=>Ce,SchemaField:()=>Le});var n,a=i(4635),r=i(918),o=i(6902),s=i(5536),l=i(6121),c=i(829),d=i(2740),p=i(8769),u=i.n(p),h=i(7921),m=i(1280),g=(i(5168),i(5908)),v=i(7091),b=i(7428),f=i(6768),A=i(5694),y=i(9708),w=i(4273),k=i(3768),E=i(2803),x=i(3824),N=i(2513),M=i(5067),T=i(1477),C=i(4287),L=i(966),I=i(5768),S=i(6110),O=i(5944),_=i(8409),R=i(3081),W=i(3995),D=(i(74),i(1030)),P=i.n(D);let $,B,U,F,V,z,j,K,X,J,G,H,q,Y,Z,Q,ee,te,ie,ne,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),ie(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)=>i=>{(0,l.A)(Ge,this,i(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"]),i=[];(0,D.isEmpty)(null==t?void 0:t.dataset)&&i.push("dataset"),(0,D.isEmpty)(null==t?void 0:t.style)&&i.push("style");const n=(0,D.omit)(t,i);if(!(0,D.isEmpty)(n))return n}))}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,ne).emit(t.values[W.qZ]);else{var e;const i=P().omit(t.values,[W.qZ]);t.notify(Te,i),(0,s.A)(Ve,this,ne).emit(null!==(e=(0,c.A)(Ge,this))&&void 0!==e?e:i)}})).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:i,values:n,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)=>i=>{const n=!e&&t.values[W.qZ]?t.values[W.qZ]:t.values;T.current=i(e,t,n)}))),[]);(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 i;if(t){const t=P().omit(e,[W.qZ]);return{[W.qZ]:P().isEmpty(t)?"":t}}return null!==(i=e[W.qZ])&&void 0!==i?i:e}),[]);return(0,p.useEffect)((()=>{I()}),[I]),(0,p.useEffect)((()=>{k&&M.setInitialValues(n,"overwrite")}),[k,M]),(0,p.useEffect)((()=>{var e;C.current=!0,T.current=null,M.notify(Ce,i),M.query(W.N4).take((e=>{e.display=i?"hidden":"visible"})),M.query(W.qZ).take((e=>{e.display=i?"visible":"hidden"}));const t=M.getState().values,n=S(null!==(e=T.current)&&void 0!==e?e:t,i);M.setValues(n,"overwrite"),C.current=!1}),[i,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:i,SchemaFieldComponent:Le,form:M,scope:{dataList:r,advancedMode:i,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}n=Qe,({e:[U,F,V,z,j,K,X,J,G,H,q,Y,Z,Q,ee,te,ie,ne,ae,re,oe,se,le,ce,de,pe,ue,he,me,ge,ve,be,fe,Ae,ye,we,$],c:[Se,B]}=(0,d.A)(n,[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()},2120:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(6758),a=i.n(n),r=i(935),o=i.n(r)()(a());o.push([e.id,"#preview-root{padding:0}",""]);const s=o.toString()},2150:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(6758),a=i.n(n),r=i(935),o=i.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()},2381:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(6758),a=i.n(n),r=i(935),o=i.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()},2984:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(6758),a=i.n(n),r=i(935),o=i.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},3430:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(6758),a=i.n(n),r=i(935),o=i.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()},4014:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(6758),a=i.n(n),r=i(935),o=i.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()},4162:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(6758),a=i.n(n),r=i(935),o=i.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()},4982:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(6758),a=i.n(n),r=i(935),o=i.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()},5292:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(6758),a=i.n(n),r=i(935),o=i.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()},6131:(e,t,i)=>{i.d(t,{A:()=>c});var n=i(6758),a=i.n(n),r=i(935),o=i.n(r),s=i(7745),l=o()(a());l.i(s.A),l.push([e.id,"",""]);const c=l.toString()},6213:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(6758),a=i.n(n),r=i(935),o=i.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()},7180:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(6758),a=i.n(n),r=i(935),o=i.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()},7236:(e,t,i)=>{i.d(t,{A:()=>c});var n=i(6758),a=i.n(n),r=i(935),o=i.n(r),s=i(6131),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()},7540:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(6758),a=i.n(n),r=i(935),o=i.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()},8350:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(6758),a=i.n(n),r=i(935),o=i.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()},8488:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(6758),a=i.n(n),r=i(935),o=i.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()},8918:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(6758),a=i.n(n),r=i(935),o=i.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()},9034:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(6758),a=i.n(n),r=i(935),o=i.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()},9216:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(6758),a=i.n(n),r=i(935),o=i.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()},9765:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(6758),a=i.n(n),r=i(935),o=i.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()}}]);
|
|
2
|
+
//# sourceMappingURL=220.eefe3b35.js.map
|