@next-bricks/ai-portal 0.22.3 → 0.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bricks.json +21 -20
- package/dist/chunks/3561.4d1372b5.js +3 -0
- package/dist/chunks/3561.4d1372b5.js.map +1 -0
- package/dist/chunks/ai-employees.1c05e0e7.js +3 -0
- package/dist/chunks/ai-employees.1c05e0e7.js.map +1 -0
- package/dist/chunks/{main.1391ad2c.js → main.e79612f9.js} +2 -2
- package/dist/chunks/{main.1391ad2c.js.map → main.e79612f9.js.map} +1 -1
- package/dist/chunks/mcp-tools.169e225f.js +3 -0
- package/dist/chunks/mcp-tools.169e225f.js.LICENSE.txt +5 -0
- package/dist/chunks/mcp-tools.169e225f.js.map +1 -0
- package/dist/examples.json +17 -14
- package/dist/images/0cbe181e.png +0 -0
- package/dist/images/4215203f.png +0 -0
- package/dist/images/5e54ffc5.png +0 -0
- package/dist/images/87c8a33b.png +0 -0
- package/dist/images/8c2cf79e.png +0 -0
- package/dist/images/8e5c445f.png +0 -0
- package/dist/images/dd5fc700.png +0 -0
- package/dist/images/f542faa9.png +0 -0
- package/dist/index.c8ec3237.js +2 -0
- package/dist/index.c8ec3237.js.map +1 -0
- package/dist/manifest.json +119 -99
- package/dist/types.json +230 -145
- package/dist-types/ai-employees/i18n.d.ts +15 -0
- package/dist-types/ai-employees/index.d.ts +21 -0
- package/dist-types/ai-employees/index.spec.d.ts +1 -0
- package/dist-types/bootstrap.d.ts +1 -0
- package/dist-types/mcp-tools/i18n.d.ts +6 -1
- package/docs/ai-employees.md +11 -0
- package/package.json +2 -2
- package/dist/chunks/9543.929397fe.js +0 -3
- package/dist/chunks/9543.929397fe.js.map +0 -1
- package/dist/chunks/mcp-tools.04c1ff64.js +0 -3
- package/dist/chunks/mcp-tools.04c1ff64.js.map +0 -1
- package/dist/index.fbf870e3.js +0 -2
- package/dist/index.fbf870e3.js.map +0 -1
- /package/dist/chunks/{9543.929397fe.js.LICENSE.txt → 3561.4d1372b5.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{mcp-tools.04c1ff64.js.LICENSE.txt → ai-employees.1c05e0e7.js.LICENSE.txt} +0 -0
package/dist/bricks.json
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "bricks/ai-portal",
|
|
3
3
|
"bricks": [
|
|
4
|
-
"ai-portal.
|
|
4
|
+
"ai-portal.home-container",
|
|
5
5
|
"ai-portal.cruise-canvas",
|
|
6
|
-
"ai-portal.chat-history",
|
|
7
|
-
"ai-portal.elevo-logo",
|
|
8
6
|
"ai-portal.stat-with-mini-chart",
|
|
9
|
-
"ai-portal.
|
|
7
|
+
"ai-portal.elevo-logo",
|
|
10
8
|
"ai-portal.elevo-sidebar",
|
|
9
|
+
"ai-portal.icon-button",
|
|
11
10
|
"ai-portal.show-cases",
|
|
11
|
+
"ai-portal.chat-box",
|
|
12
|
+
"ai-portal.chat-stream",
|
|
12
13
|
"ai-portal.mcp-tools",
|
|
13
|
-
"ai-portal.
|
|
14
|
-
"ai-portal.chat-
|
|
14
|
+
"ai-portal.ai-employees",
|
|
15
|
+
"ai-portal.chat-history"
|
|
15
16
|
],
|
|
16
17
|
"elements": [],
|
|
17
18
|
"processors": [],
|
|
18
19
|
"editors": [],
|
|
19
20
|
"dependencies": {
|
|
20
|
-
"ai-portal.chat-box": [
|
|
21
|
-
"eo-icon"
|
|
22
|
-
],
|
|
23
21
|
"ai-portal.cruise-canvas": [
|
|
24
22
|
"eo-icon",
|
|
25
23
|
"eo-button",
|
|
@@ -32,11 +30,6 @@
|
|
|
32
30
|
"basic.copy-to-clipboard",
|
|
33
31
|
"eo-easyops-avatar"
|
|
34
32
|
],
|
|
35
|
-
"ai-portal.chat-history": [
|
|
36
|
-
"eo-icon",
|
|
37
|
-
"eo-link",
|
|
38
|
-
"eo-mini-actions"
|
|
39
|
-
],
|
|
40
33
|
"ai-portal.stat-with-mini-chart": [
|
|
41
34
|
"eo-mini-line-chart"
|
|
42
35
|
],
|
|
@@ -48,16 +41,16 @@
|
|
|
48
41
|
"eo-mini-actions",
|
|
49
42
|
"ai-portal.icon-button"
|
|
50
43
|
],
|
|
44
|
+
"ai-portal.icon-button": [
|
|
45
|
+
"eo-icon",
|
|
46
|
+
"eo-tooltip"
|
|
47
|
+
],
|
|
51
48
|
"ai-portal.show-cases": [
|
|
52
49
|
"eo-link"
|
|
53
50
|
],
|
|
54
|
-
"ai-portal.
|
|
51
|
+
"ai-portal.chat-box": [
|
|
55
52
|
"eo-icon"
|
|
56
53
|
],
|
|
57
|
-
"ai-portal.icon-button": [
|
|
58
|
-
"eo-icon",
|
|
59
|
-
"eo-tooltip"
|
|
60
|
-
],
|
|
61
54
|
"ai-portal.chat-stream": [
|
|
62
55
|
"eo-icon",
|
|
63
56
|
"eo-button",
|
|
@@ -68,7 +61,15 @@
|
|
|
68
61
|
"ai-portal.icon-button",
|
|
69
62
|
"basic.show-dialog",
|
|
70
63
|
"basic.copy-to-clipboard"
|
|
64
|
+
],
|
|
65
|
+
"ai-portal.mcp-tools": [
|
|
66
|
+
"eo-icon"
|
|
67
|
+
],
|
|
68
|
+
"ai-portal.chat-history": [
|
|
69
|
+
"eo-icon",
|
|
70
|
+
"eo-link",
|
|
71
|
+
"eo-mini-actions"
|
|
71
72
|
]
|
|
72
73
|
},
|
|
73
|
-
"filePath": "bricks/ai-portal/dist/index.
|
|
74
|
+
"filePath": "bricks/ai-portal/dist/index.c8ec3237.js"
|
|
74
75
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! For license information please see 3561.4d1372b5.js.LICENSE.txt */
|
|
2
|
+
"use strict";(globalThis.webpackChunk_next_bricks_ai_portal=globalThis.webpackChunk_next_bricks_ai_portal||[]).push([[3561],{24:(e,t,i)=>{i.d(t,{A:()=>l});var n=i(36758),a=i.n(n),s=i(40935),r=i.n(s)()(a());r.push([e.id,':host{display:block;white-space:nowrap}.container{border-radius:var(--elevo-border-radius)}:host([hidden]){display:none}*{box-sizing:border-box}.label{font-weight:500;overflow:hidden;text-overflow:ellipsis}.stat{font-weight:600}.chart{min-width:0}.chart > *{display:block}:host(:not([size="small"])) .container{background:linear-gradient(164deg,rgba(105,153,253,0) 40%,rgba(105,153,253,0.05) 60%,rgba(105,153,253,0.32) 100%),#fff;padding:22px}:host(:not([size="small"])) .label{font-size:14px;height:22px;margin-bottom:16px}:host(:not([size="small"])) .stat-and-chart{display:flex;align-items:center;justify-content:end;position:relative}:host(:not([size="small"])) .stat{font-size:36px;color:#1d212a;position:absolute;left:0}:host(:not([size="small"])) .chart{width:calc(100% - 160px)}:host([size="small"]) .container{padding:11px 15px;display:flex;align-items:center;justify-content:end;position:relative;background:var(--elevo-component-background);-webkit-backdrop-filter:var(--elevo-component-backdrop-filter);backdrop-filter:var(--elevo-component-backdrop-filter)}:host([size="small"]) .label-and-stat{position:absolute;left:15px}:host([size="small"]) .label{font-size:12px;color:#8c8c8c;line-height:17px;height:17px;margin-bottom:7px}:host([size="small"]) .stat{font-size:20px;color:#262626;line-height:24px}:host([size="small"]) .chart{width:calc(100% - 90px)}',""]);const l=r.toString()},15733:(e,t,i)=>{e.exports=i.p+"images/4b299d0b.png"},21411:(e,t,i)=>{i.d(t,{A:()=>l});var n=i(36758),a=i.n(n),s=i(40935),r=i.n(s)()(a());r.push([e.id,":host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}ul{list-style:none;margin:0;padding:0}.loading{display:flex;justify-content:center;padding:8px}.group + .group{margin-top:15px}.group-title{font-weight:500;font-size:12px;color:#000;padding:8px;height:36px;line-height:20px}.item{display:block}.item::part(link){display:flex;align-items:center;padding:0 8px;height:36px;border-radius:8px;color:#000}.item::part(link):hover{background:rgba(0,0,0,0.04)}.item-title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.actions{cursor:auto}.item:not(:hover):not(.active) .actions{display:none}.working{width:8px;height:8px;border-radius:8px;background:var(--elevo-color-brand);margin:0 7px}.item:hover .working,\n.item.active .working{display:none}.load-more{display:flex;justify-content:center;align-items:center;height:36px}",""]);const l=r.toString()},31653:(e,t,i)=>{i.d(t,{A:()=>l});var n=i(36758),a=i.n(n),s=i(40935),r=i.n(s)()(a());r.push([e.id,":host{display:inline-block;padding:3px 0}:host([hidden]){display:none}img{display:block}",""]);const l=r.toString()},31748:(e,t,i)=>{i.d(t,{A:()=>p});var n=i(36758),a=i.n(n),s=i(40935),r=i.n(s),l=i(20062),o=i.n(l),c=new URL(i(15733),i.b),d=r()(a()),u=o()(c);d.push([e.id,`:host{display:block;position:relative;width:100%;height:100%;overflow:hidden;background-color:rgb(205,206,207);background-image:url(${u});background-size:cover;background-repeat:no-repeat;background-position:center;background-attachment:fixed;color:#262626;padding:48px 24px;overflow-y:auto}:host([hidden]){display:none}*{box-sizing:border-box}.container{max-width:1400px;margin:0 auto}h1,\nh2{font-weight:500;margin:0}h1{font-size:20px;line-height:28px}h2{font-size:16px;line-height:22px}.nav,\n.groups,\n.list{list-style:none;margin:0;padding:0}.nav{display:flex;font-size:16px;margin-top:17px}.nav .item + .item{margin-left:32px}.nav .item a{color:rgba(38,38,38,0.65);cursor:pointer}.nav .item a.active{color:#262626;font-weight:500}.nav .item a.active::after{content:"";display:block;width:100%;height:4px;background-color:currentColor;border-radius:2px}.groups{margin-top:27px}.group + .group{margin-top:32px}.list{margin-top:16px;display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:24px}.list .item{background:rgba(255,255,255,0.9);box-shadow:0px 2px 5px 0px rgba(0,0,0,0.08);border-radius:12px;padding:20px 26px}.heading{display:flex;align-items:center}.icon{font-size:24px;color:#333;margin-right:8px}.title{font-size:15px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.description{margin-top:13px;font-size:13px;color:rgba(0,0,0,0.45);line-height:18px;height:54px;display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}`,""]);const p=d.toString()},32360:(e,t,i)=>{e.exports=i.p+"images/6336f999.png"},42873:(e,t,i)=>{i.d(t,{A:()=>p});var n=i(36758),a=i.n(n),s=i(40935),r=i.n(s),l=i(20062),o=i.n(l),c=new URL(i(89518),i.b),d=r()(a()),u=o()(c);d.push([e.id,`:host{display:flex;flex-direction:column;align-items:center;max-width:1200px;width:100%}:host([hidden]){display:none}*{box-sizing:border-box}.nav,\n.cases{list-style:none;padding:0;margin:0}.nav{display:flex;font-size:16px}.nav .item + .item{margin-left:32px}.nav .item a{color:rgba(38,38,38,0.65);cursor:pointer}.nav .item a.active{color:#262626;font-weight:500}.nav .item a.active::after{content:"";display:block;width:100%;height:4px;background-color:currentColor;border-radius:2px}.cases{display:grid;width:100%;grid-template-columns:repeat(auto-fill,minmax(276px,1fr));gap:24px;margin-top:2em}.link{background:#fefefe;border:1px solid #e8e9ec;border-radius:12px;overflow:hidden;display:block}.link::part(link){display:flex;gap:0;flex-direction:column;height:218px}.title{width:100%;height:76px;padding:16px 16px 15px;color:#262626;border-top:1px solid #e8e9ec;font-weight:500;font-size:15px;line-height:22px}.title span{display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.placeholder{width:100%;height:142px;background:linear-gradient(308deg,#dee9fc 0%,#fcfbfd 100%,#fbf9fe 100%);overflow:hidden}.summary{color:rgba(0,0,0,0.65);padding:27px 0 0 24px}.thumbnail span{display:block;width:100%;height:100%;background-size:cover;background-position:center;background-repeat:no-repeat}.link:hover{box-shadow:0px 4px 12px 0px rgba(0,0,0,0.06)}.link:hover .title{color:var(--elevo-color-brand)}.summary-1{display:block;background-image:url(${u});background-size:237px 115px;background-repeat:no-repeat;background-position:0 0;padding:10px 0 0 10px}.summary-2{display:block;background:linear-gradient(90deg,#ffffff 0%,#e4ecfc 100%);padding:12px 15px 5px 15px;border-top-left-radius:12px}.summary-2 span{display:-webkit-box;-webkit-line-clamp:4;line-clamp:4;-webkit-box-orient:vertical;overflow:hidden;font-size:15px;color:#525971;line-height:22px;height:88px}`,""]);const p=d.toString()},47008:(e,t,i)=>{i.d(t,{A:()=>p});var n=i(36758),a=i.n(n),s=i(40935),r=i.n(s),l=i(20062),o=i.n(l),c=new URL(i(91107),i.b),d=r()(a()),u=o()(c);d.push([e.id,`:host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.root{color:#262626;background-color:#e1e3ec;background-image:url(${u});background-size:694px 144px;background-position:top left;background-repeat:no-repeat;box-shadow:inset 0px 2px 5px 1px rgba(42,46,59,0.1);border-radius:20px;padding:12px}.container{position:relative}textarea{display:block;width:100%;padding:10px 16px 52px;color:var(--antd-input-color);background:rgba(255,255,255,0.8);border-radius:14px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border:1px solid rgba(255,255,255,0.5);font-size:14px;line-height:22px;height:130px}textarea::placeholder{color:rgba(0,0,0,0.4)}.btn-send:focus,\ntextarea:focus{outline:none}.btn-send{position:absolute;bottom:14px;right:14px;width:28px;height:28px;display:flex;align-items:center;justify-content:center;background:var(--elevo-color-brand);border:none;border-radius:8px;color:#fff}.btn-send[disabled]{background:rgba(0,0,0,0.15)}.btn-send:not([disabled]){cursor:pointer}.btn-send:not([disabled]):hover{background:#5166ff}.btn-send:not([disabled]):active{background:#1e33cc}.suggestions{margin-top:19px}.heading{display:flex;align-items:center;padding:0 5px;margin-bottom:8px}.icon{margin-right:5px}.carousel{overflow:hidden}.carousel + .carousel{margin-top:7px}.list{display:flex;width:max-content;list-style:none;margin:0;padding:0;font-size:12px}.item{background:rgba(255,255,255,0.4);border-radius:12px;border:1px solid #dcdee6;padding:12px;max-width:330px;cursor:pointer}.item:hover{background:rgba(255,255,255,0.5);border:1px solid rgba(37,64,255,0.3)}.list > li + li{margin-left:7px}.title{margin-bottom:4px}.content{color:rgba(0,0,0,0.45);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tooltip{display:block}`,""]);const p=d.toString()},47338:(e,t,i)=>{i.d(t,{A:()=>l});var n=i(36758),a=i.n(n),s=i(40935),r=i.n(s)()(a());r.push([e.id,':host{display:inline-block}:host([hidden]){display:none}:host,\neo-tooltip{vertical-align:middle}button{width:28px;height:28px;font-size:18px;border-radius:8px;display:flex;align-items:center;justify-content:center;border:none;background:none;color:#333}button:disabled{color:#8c8c8c}button:not(:disabled){cursor:pointer}button:focus{outline:none}button:not(:disabled):hover{background:rgba(0,0,0,0.04)}button:not(:disabled):active{background:rgba(0,0,0,0.08)}:host([variant="light"]) button{color:#595959}:host([variant="mini"]) button{width:24px;height:24px;font-size:16px;border-radius:4px}',""]);const l=r.toString()},50858:(e,t,i)=>{var n,a=i(74635),s=i(70918),r=i(26902),l=i(5536),o=i(86121),c=i(70829),d=i(62740),u=i(18769),p=i.n(u),h=i(7921),m=i(11280),g=i(23081),b=(i(65168),i(90079)),v=i(53373),f=i.n(v),k=i(99126),A=i(67566),x=i(8324),E=i(69445),w=i(2460),y=i(32464),R=i(58231),S=i(36494),N=i(97642),_=i(40369),M=i(59533),T=i(34999),C=i(27954),I=i(24388),W=i(56938),z=i(25718),D=i(39295),V=i(83888),L=i(16854),O=i(97907),Y=i(44394),U=i(85620),P=i(73349),H=i(62601),B=i(57097),j=i(85011),F=i(54163),G=i(65023),J=i(92449),$=i(62897),q=i(82770),K=i(31918),X=i(48680);let Q,Z,ee,te,ie,ne,ae,se,re,le,oe,ce,de,ue,pe,he,me,ge,be,ve,fe,ke,Ae,xe,Ee,we,ye,Re,Se,Ne,_e,Me,Te,Ce,Ie,We,ze,De;(0,b.initializeI18n)(w.NS,w.I);const{defineElement:Ve,property:Le,event:Oe,method:Ye}=(0,h.createDecorators)(),Ue=(0,u.memo)(ut),Pe=(0,u.forwardRef)(dt);let He;var Be=new WeakMap,je=new WeakMap,Fe=new WeakMap,Ge=new WeakMap,Je=new WeakMap,$e=new WeakMap,qe=new WeakMap,Ke=new WeakMap,Xe=new WeakMap,Qe=new WeakSet,Ze=new WeakMap,et=new WeakMap,tt=new WeakMap,it=new WeakMap,nt=new WeakMap,at=new WeakMap,st=new WeakMap,rt=new WeakMap,lt=new WeakMap,ot=new WeakMap;class ct extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Qe),(0,s.A)(this,Be,(Q(this),ee(this))),(0,s.A)(this,je,(te(this),ie(this))),(0,s.A)(this,Fe,(ne(this),ae(this))),(0,s.A)(this,Ge,(se(this),re(this))),(0,s.A)(this,Je,(le(this),oe(this))),(0,s.A)(this,$e,(ce(this),de(this))),(0,s.A)(this,qe,(ue(this),pe(this))),(0,s.A)(this,Ke,(he(this),me(this))),(0,s.A)(this,Xe,(ge(this),be(this))),(0,s.A)(this,Ze,(ke(this),()=>{(0,l.A)(Qe,this,ve).emit()})),(0,s.A)(this,et,Ae(this)),(0,s.A)(this,tt,(we(this),()=>{(0,l.A)(Qe,this,xe).emit()})),(0,s.A)(this,it,ye(this)),(0,s.A)(this,nt,(Ne(this),()=>{(0,l.A)(Qe,this,Re).emit()})),(0,s.A)(this,at,_e(this)),(0,s.A)(this,st,(Ce(this),()=>{(0,l.A)(Qe,this,Me).emit()})),(0,s.A)(this,rt,Ie(this)),(0,s.A)(this,lt,(De(this),e=>{(0,l.A)(Qe,this,We).emit(e)})),(0,s.A)(this,ot,(0,u.createRef)())}get taskId(){return(0,c.A)(Be,this)}set taskId(e){(0,o.A)(Be,this,e)}get task(){return(0,c.A)(je,this)}set task(e){(0,o.A)(je,this,e)}get jobs(){return(0,c.A)(Fe,this)}set jobs(e){(0,o.A)(Fe,this,e)}get replay(){return(0,c.A)(Ge,this)}set replay(e){(0,o.A)(Ge,this,e)}get replayDelay(){return(0,c.A)(Je,this)}set replayDelay(e){(0,o.A)(Je,this,e)}get supports(){return(0,c.A)($e,this)}set supports(e){(0,o.A)($e,this,e)}get showHiddenJobs(){return(0,c.A)(qe,this)}set showHiddenJobs(e){(0,o.A)(qe,this,e)}get showFeedback(){return(0,c.A)(Ke,this)}set showFeedback(e){(0,o.A)(Ke,this,e)}resumed(){var e;null===(e=(0,c.A)(ot,this).current)||void 0===e||e.resumed()}feedbackSubmitDone(){var e;null===(e=(0,c.A)(ot,this).current)||void 0===e||e.feedbackSubmitDone()}feedbackSubmitFailed(){var e;null===(e=(0,c.A)(ot,this).current)||void 0===e||e.feedbackSubmitFailed()}render(){return p().createElement(Pe,{taskId:this.taskId,jobs:this.jobs,task:this.task,replay:this.replay,replayDelay:this.replayDelay,supports:this.supports,showHiddenJobs:this.showHiddenJobs,showFeedback:this.showFeedback,onShare:(0,c.A)(Ze,this),onPause:(0,c.A)(tt,this),onResume:(0,c.A)(nt,this),onCancel:(0,c.A)(st,this),onSubmitFeedback:(0,c.A)(lt,this),ref:(0,c.A)(ot,this)})}}function dt(e,t){var i;let{taskId:n,task:a,jobs:s,replay:r,replayDelay:l,supports:o,showHiddenJobs:c,showFeedback:d,onShare:h,onPause:m,onResume:b,onCancel:v,onSubmitFeedback:k}=e;const w=(0,u.useRef)(null),{task:C,jobs:I,error:W,humanInputRef:z,resumedRef:D,skipToResults:V,watchAgain:q}=(0,_.S)(n,r,l),X=n?C:a,Q=n?I:s,Z=null==X?void 0:X.plan,ee=(0,M.B)(X,Q,{showHiddenJobs:c}),te=null==ee?void 0:ee.nodes,ie=null==ee?void 0:ee.edges,ne=null==ee?void 0:ee.nav,ae=null==ee?void 0:ee.views,se=null==ee?void 0:ee.jobLevels,re=null!==(i=null==X?void 0:X.title)&&void 0!==i?i:"",le=null==X?void 0:X.state,[oe,ce]=(0,u.useState)(null),de=(0,u.useMemo)((()=>{if(oe){const[e,t]=oe.split(":");if("job"===e||"view"===e)return t}return null}),[oe]),[ue,pe]=(0,u.useState)(!1),[he,me]=(0,u.useState)(!1),[ge,be]=(0,u.useState)(!!d);(0,u.useEffect)((()=>{be(!!d)}),[d]);const ve=(0,u.useCallback)((e=>{pe(!0),k(e)}),[k]);(0,u.useImperativeHandle)(t,(()=>({resumed:()=>{var e;return null===(e=D.current)||void 0===e?void 0:e.call(D)},feedbackSubmitDone:()=>{me(!0),setTimeout((()=>{be(!1)}),3e3)},feedbackSubmitFailed:()=>{pe(!1)}})),[D]);const fe=(0,u.useRef)(!1);(0,u.useEffect)((()=>{const e=setTimeout((()=>{fe.current=!0}),3e3);return()=>{clearTimeout(e)}}),[]),(0,u.useEffect)((()=>{(0,g.getRuntime)().applyPageTitle(re)}),[re]),(0,u.useEffect)((()=>{W&&(0,g.handleHttpError)(W)}),[W]);const ke=(0,u.useCallback)(((e,t)=>{var i;null===(i=z.current)||void 0===i||i.call(z,e,t)}),[z]),[Ae,xe]=(0,u.useState)(null),Ee=(0,u.useCallback)(((e,t)=>{xe((i=>{if(!t){if(!i)return null;const t=new Map(i);return t.delete(e)?t:i}return i?new Map(i).set(e,t):new Map([[e,t]])}))}),[]),{sizeReady:we,nodes:ye,edges:Re}=(0,N.g)({rawNodes:te,rawEdges:ie,state:le,sizeMap:Ae,showFeedback:ge}),Se=(0,u.useRef)(!1),Ne=(0,u.useRef)(!1),[_e,Me]=(0,u.useState)(!1),{grabbing:Te,transform:Ce,transformRef:Ie,zoomer:We}=(0,R.f)({rootRef:w,zoomable:we,scrollable:we&&!_e,pannable:we,manualScrolledUpRef:Ne}),ze=(0,u.useRef)(!1),De=(0,u.useMemo)((()=>{let e=null;const t=i=>{const n=Ie.current,a="function"==typeof i?i(n):i;if(!a)return;const{transform:s,translateBy:r}=a;let l=(0,A.A)(w.current);var o,c,d,u,p,h;fe.current&&0!==a.duration&&(ze.current=!0,l=l.transition().duration(null!==(o=a.duration)&&void 0!==o?o:300).ease((e=>e*(2-e))).on("end",(()=>{if(ze.current=!1,e){const i=e;e=null,t(i)}}))),s?We.transform(l,new x.uV(null!==(c=s.k)&&void 0!==c?c:n.k,null!==(d=s.x)&&void 0!==d?d:n.x,null!==(u=s.y)&&void 0!==u?u:n.y)):We.translateBy(l,null!==(p=r[0])&&void 0!==p?p:0,null!==(h=r[1])&&void 0!==h?h:0)};return i=>{ze.current?e=i:t(i)}}),[Ie,We]),{centered:Ve,setCentered:Le,reCenterRef:Oe}=(0,S.E)({nodes:ye,sizeReady:we,zoomer:We,rootRef:w,pushZoomTransition:De}),Ye=O.QB.includes(le),Pe=(0,u.useMemo)((()=>new Set(Re.map((e=>e.source)))),[Re]),He=(0,u.useMemo)((()=>{if(!we)return null;const e=[];for(const t of ye)Pe.has(t.id)||e.push(t);return e.length>0?Math.max(...e.map((e=>e.view.y+e.view.height))):null}),[ye,Pe,we]),Be=(0,u.useRef)(null);(0,u.useEffect)((()=>{Be.current=He}),[He]),(0,u.useEffect)((()=>{const e=w.current;!e||null===He||Se.current&&Ne.current||De((t=>{const{offsetHeight:i}=e,n=He*t.k+t.y,a=i-L.xX-n;return a<0?{transform:{y:t.y+a},duration:a>-100?100:a<-500?300:200}:null}))}),[He,De]),(0,u.useEffect)((()=>{const e=Be.current,t=w.current;if(!t||null===e||ze.current)return;const{offsetHeight:i}=t,n=e*Ce.k+Ce.y,a=i-L.xX-n;Se.current=a<0}),[Ce,We]);const je=(0,u.useCallback)((()=>{Oe.current=!0,Le(!1)}),[Oe,Le]),Fe=(0,u.useCallback)((e=>{We.scaleTo((0,A.A)(w.current),e)}),[We]),Ge=(0,u.useMemo)((()=>we?(0,E.o)(ye.map((e=>e.view))):null),[ye,we]);(0,u.useEffect)((()=>{if(!Ge)return;const e=w.current;if(!e)return;const{offsetWidth:t,offsetHeight:i}=e,n=t/Ce.k,a=i/Ce.k,s=-(n-20-Ge.x),r=n-20+(Ge.x+Ge.width),l=-(a-20-Ge.y),o=a-20+(Ge.y+Ge.height);We.translateExtent([[s,l],[r,o]])}),[We,Ce.k,Ge]);const Je=(0,u.useCallback)((e=>{let{nodeId:t,jobId:i,behavior:n,block:a}=e;const s=w.current,r=ye.filter((e=>{var n;return!(t&&e.id!==t||i&&(null===(n=e.job)||void 0===n?void 0:n.id)!==i)}));if(!s||0===r.length)return;const l=(0,E.o)(r.map((e=>e.view))),{x:o,y:c}=(0,H.D)(l,[s.offsetWidth,s.offsetHeight],[L.RV,L.kq,L.xX,L.bL],Ie.current,a);(o||c)&&De({translateBy:[o,c],duration:"instant"===n?0:void 0})}),[ye,De,Ie]),$e=(0,u.useCallback)(((e,t)=>{const i=w.current;if(!i||!we)return;let n,a=0,s=0,r=300;const l="left"===e||"right"===e;if("line"===t)n=40*("up"===e||"left"===e?1:-1),r=150;else if("page"===t)n=(i.offsetHeight-L.xX)*("up"===e?-1:1);else{const{y:t,height:a}=(0,E.o)(ye.map((e=>e.view)));if("down"===e){const e=t+a-t+L.xX;n=i.offsetHeight-e-Ie.current.y}else n=t+L.RV-Ie.current.y}l?a=n:s=n,(a||s)&&De({translateBy:[a,s],duration:r})}),[ye,De,we,Ie]),[qe,Ke]=(0,u.useState)(null),[Xe,Qe]=(0,u.useState)(null),[Ze,et]=p().useState(null),tt=(0,u.useMemo)((()=>({humanInput:ke,onShare:h,onPause:m,onResume:b,onCancel:v,supports:o,activeExpandedViewJobId:Xe,setActiveExpandedViewJobId:Qe,activeToolCallJobId:qe,setActiveToolCallJobId:Ke})),[ke,v,m,b,h,o,Xe,qe]),it=(0,u.useMemo)((()=>({onNodeResize:Ee,onSubmitFeedback:ve,setActiveNodeId:ce,hoverOnScrollableContent:_e,setHoverOnScrollableContent:Me,setActiveFile:et,setShowFeedback:be,submittingFeedback:ue,submittedFeedback:he})),[_e,Ee,ve,ue,he]),nt=(0,u.useMemo)((()=>qe?null==Q?void 0:Q.find((e=>e.id===qe)):null),[qe,Q]),at=(0,u.useCallback)((e=>{for(const t of e.nativeEvent.composedPath()){if(t instanceof HTMLElement&&t.classList.contains(y.A.node))return;if(t===w.current)break}ce(null)}),[]);return(0,u.useEffect)((()=>{const e=w.current;if(!e||nt||Xe||Ze)return;const t=t=>{if(document.activeElement&&document.activeElement!==document.body&&document.activeElement!==e)return;const i=(0,B.l)(t,{activeNodeId:oe,nodes:ye});if(!i)return;const{action:n,node:a}=i;if("scroll"===n)$e(i.direction,i.range);else if("enter"===n){var s,r;if("job"!==a.type&&"view"!==a.type)return;const e="ask_human"===(null===(s=a.job.toolCall)||void 0===s?void 0:s.name),t="ask_human_confirming_plan"===(null===(r=a.job.toolCall)||void 0===r?void 0:r.name);if(e||t)return}t.preventDefault(),t.stopPropagation(),"enter"===n?"view"===a.type?Qe(a.job.id):Ke(a.job.id):"switch-active-node"===n&&(a?(ce(a.id),"job"===a.type||"view"===a.type?Je({jobId:a.job.id,behavior:"smooth"}):Je({nodeId:a.id,behavior:"smooth"})):ce(null))};return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}}),[oe,nt,Xe,Ze,ye,Je,$e]),p().createElement(K.j.Provider,{value:tt},p().createElement(U.Q.Provider,{value:it},p().createElement("div",{className:f()(y.A.root,{[y.A.loading]:!X}),ref:w,style:{cursor:Te?"grabbing":"grab"},tabIndex:-1,onClick:at},!X&&p().createElement("div",{className:y.A["loading-icon"]},p().createElement(Y.Bj,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0})),p().createElement("div",{className:f()(y.A.canvas,{[y.A.ready]:we&&Ve}),style:{transform:`translate3d(${Ce.x}px, ${Ce.y}px, 0) scale(${Ce.k})`}},p().createElement("svg",{className:y.A.edges},Re.map((e=>e.source===L.Jw||e.target===L.Jw?null:p().createElement("path",{className:y.A.edge,key:`${e.source}-${e.target}`,d:e.points.map(((e,t)=>{let{x:i,y:n}=e;return`${0===t?"M":"L"}${i},${n}`})).join(" ")})))),ye.map((e=>{var t,i;return p().createElement(Ue,{key:e.id,id:e.id,type:e.type,content:e.content,job:e.job,state:e.state,startTime:null==X?void 0:X.startTime,instructionLoading:"instruction"===e.type&&!Pe.has(e.id)&&!O.QB.includes(e.state)&&!O.X4.includes(le),edges:Re,x:null===(t=e.view)||void 0===t?void 0:t.x,y:null===(i=e.view)||void 0===i?void 0:i.y,active:oe===e.id})})))),p().createElement("div",{className:y.A.widgets},p().createElement(F.s,{nav:ne,plan:Z,jobs:Q,jobLevels:se,currentNavId:de,taskState:le,onClick:e=>{ce(`job:${e}`),Je({jobId:e,block:"start"})}}),p().createElement(T.l,{scale:Ce.k,onScaleChange:Fe,onReCenter:je}),r?p().createElement("div",{className:y.A["footer-container"]},p().createElement(G.b,{taskDone:Ye,skipToResults:V,watchAgain:()=>{q(),Le(!1)}})):null!=o&&o.chat?p().createElement("div",{className:y.A["footer-container"]},p().createElement(J.s,{taskState:le,taskDone:Ye})):null),nt&&p().createElement(P.M,{job:nt}),Xe&&p().createElement(j.f,{views:ae}),Ze&&p().createElement($.d,{file:Ze})))}function ut(e){let{id:t,type:i,state:n,job:a,content:s,startTime:r,instructionLoading:l,x:o,y:c,active:d}=e;const h=(0,u.useRef)(null),{onNodeResize:m,setActiveNodeId:g}=(0,u.useContext)(U.Q);(0,u.useEffect)((()=>{const e=h.current;if(!e)return;const i=new k.A((()=>{m(t,[e.offsetWidth,e.offsetHeight])}));return i.observe(e),()=>{i.disconnect(),m(t,null)}}),[t,m]),(0,u.useEffect)((()=>{const e=h.current;if(!e)return;const t=e=>{e.stopPropagation()};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}}),[]);const b=(0,u.useCallback)((()=>{"start"!==i&&"instruction"!==i&&g(t)}),[t,g,i]);return p().createElement("div",{className:f()(y.A.node,{[y.A.ready]:null!=o&&null!=c}),ref:h,style:{left:o,top:c},onClick:b},"start"===i?p().createElement(C.H,null):"end"===i?p().createElement(D.s,null):"feedback"===i?p().createElement(q.k,null):"requirement"===i?p().createElement(I.O,{content:s,startTime:r,active:d}):"loading"===i?p().createElement(X.V,null):"instruction"===i?p().createElement(W.L,{content:a.instruction,loading:l}):"view"===i?p().createElement(V.Y,{job:a,active:d}):p().createElement(z.W,{state:n,job:a,active:d}))}n=ct,({e:[ee,te,ie,ne,ae,se,re,le,oe,ce,de,ue,pe,he,me,ge,be,ve,fe,ke,Ae,xe,Ee,we,ye,Re,Se,Ne,_e,Me,Te,Ce,Ie,We,ze,De,Q],c:[He,Z]}=(0,d.A)(n,[Ve("ai-portal.cruise-canvas",{shadowOptions:!1})],[[Le(),1,"taskId"],[Le({attribute:!1}),1,"task"],[Le({attribute:!1}),1,"jobs"],[Le({type:Boolean}),1,"replay"],[Le({type:Number}),1,"replayDelay"],[Le({attribute:!1}),1,"supports"],[Le({type:Boolean}),1,"showHiddenJobs"],[Le({type:Boolean}),1,"showFeedback"],[Oe({type:"share"}),1,"shareEvent",e=>(0,c.A)(Xe,e),(e,t)=>(0,o.A)(Xe,e,t)],[Oe({type:"pause"}),1,"pauseEvent",e=>(0,c.A)(et,e),(e,t)=>(0,o.A)(et,e,t)],[Oe({type:"resume"}),1,"resumeEvent",e=>(0,c.A)(it,e),(e,t)=>(0,o.A)(it,e,t)],[Oe({type:"cancel"}),1,"cancelEvent",e=>(0,c.A)(at,e),(e,t)=>(0,o.A)(at,e,t)],[Oe({type:"feedback.submit"}),1,"feedbackSubmitEvent",e=>(0,c.A)(rt,e),(e,t)=>(0,o.A)(rt,e,t)],[Ye(),2,"resumed"],[Ye(),2,"feedbackSubmitDone"],[Ye(),2,"feedbackSubmitFailed"]],0,(e=>ot.has((0,r.A)(e))),m.ReactNextElement)),Z();var pt=i(71451),ht=i(41030);let mt=function(e){return e.ASK_ANY_THING="ASK_ANYTHING",e.COMMON_TASKS="COMMON_TASKS",e}({});const gt="bricks/ai-portal/chat-box",bt={en:{[mt.ASK_ANY_THING]:"Ask anything",[mt.COMMON_TASKS]:"Common tasks"},zh:{[mt.ASK_ANY_THING]:"询问任何问题",[mt.COMMON_TASKS]:"常用任务"}},vt=b.i18n.getFixedT(null,gt),ft=i.p+"images/af389fa6.svg";var kt,At=i(47008);let xt,Et,wt,yt,Rt,St,Nt,_t,Mt,Tt,Ct,It,Wt,zt,Dt;(0,b.initializeI18n)(gt,bt);const Vt=(0,m.wrapBrick)("eo-icon"),{defineElement:Lt,property:Ot,event:Yt}=(0,h.createDecorators)();let Ut;var Pt=new WeakMap,Ht=new WeakMap,Bt=new WeakMap,jt=new WeakMap,Ft=new WeakMap,Gt=new WeakMap,Jt=new WeakSet,$t=new WeakMap;class qt extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Jt),(0,s.A)(this,Pt,Et(this)),(0,s.A)(this,Ht,(wt(this),yt(this))),(0,s.A)(this,Bt,(Rt(this),St(this))),(0,s.A)(this,jt,(Nt(this),_t(this))),(0,s.A)(this,Ft,(Mt(this),Tt(this))),(0,s.A)(this,Gt,(Ct(this),It(this))),(0,s.A)(this,$t,(Dt(this),e=>{(0,l.A)(Jt,this,Wt).emit(e)}))}get disabled(){return(0,c.A)(Pt,this)}set disabled(e){(0,o.A)(Pt,this,e)}get placeholder(){return(0,c.A)(Ht,this)}set placeholder(e){(0,o.A)(Ht,this,e)}get autoFocus(){return(0,c.A)(Bt,this)}set autoFocus(e){(0,o.A)(Bt,this,e)}get suggestions(){return(0,c.A)(jt,this)}set suggestions(e){(0,o.A)(jt,this,e)}get suggestionsLabel(){return(0,c.A)(Ft,this)}set suggestionsLabel(e){(0,o.A)(Ft,this,e)}render(){return p().createElement(Kt,{disabled:this.disabled,placeholder:this.placeholder,autoFocus:this.autoFocus,suggestions:this.suggestions,suggestionsLabel:this.suggestionsLabel,onSubmit:(0,c.A)($t,this)})}}function Kt(e){let{disabled:t,placeholder:i,autoFocus:n,suggestions:a,suggestionsLabel:s,onSubmit:r}=e;const l=(0,u.useRef)(null),o=(0,u.useRef)(null),[c,d]=(0,u.useState)(""),h=(0,u.useRef)(""),m=(0,u.useCallback)((e=>{e.currentTarget.value&&(null==r||r(e.currentTarget.value))}),[r]),g=(0,u.useCallback)((e=>{h.current=e.target.value,d(e.target.value)}),[]),b=(0,u.useCallback)((()=>{null==r||r(h.current)}),[r]);(0,u.useEffect)((()=>{n&&Promise.resolve().then((()=>{var e;null===(e=o.current)||void 0===e||e.focus()}))}),[]);const v=(0,u.useMemo)((()=>null!=a&&a.length?(0,ht.chunk)(a,Math.max(2,Math.ceil(a.length/2))):[]),[a]),f=(0,u.useCallback)((e=>{h.current=e.content,d(e.content),setTimeout((()=>{var e;null===(e=o.current)||void 0===e||e.focus()}))}),[]);return p().createElement("div",{className:"root"},p().createElement("div",{className:"container",ref:l},p().createElement(pt.e,{containerRef:l,ref:o,value:c,minRows:3,paddingSize:62,autoResize:!0,disabled:t,placeholder:null!=i?i:vt(mt.ASK_ANY_THING),submitWhen:"enter-without-shift",onSubmit:m,onChange:g}),p().createElement("button",{className:"btn-send",disabled:!c,onClick:b},p().createElement(Vt,{lib:"fa",prefix:"fas",icon:"arrow-up"}))),!(null==v||!v.length)&&p().createElement("div",{className:"suggestions"},p().createElement("div",{className:"heading"},p().createElement("img",{className:"icon",src:ft,width:16,height:16}),p().createElement("span",null,null!=s?s:vt(mt.COMMON_TASKS))),v.map(((e,t)=>p().createElement(Xt,{key:t,suggestions:e,pixelPerSecond:10*(t+2),onSelect:f})))))}function Xt(e){let{suggestions:t,pixelPerSecond:i,onSelect:n}=e;const a=(0,u.useRef)(null),s=(0,u.useRef)(null),[r,l]=(0,u.useState)(0);return(0,u.useEffect)((()=>{const e=a.current,t=s.current;if(!e||!t)return;let n,r,o,c,d=0;const u=(t.offsetWidth-7)/2+7;function p(e){r=e,void 0===o&&(o=e),void 0!==n&&(d+=e-n,n=void 0),l((e-o-d)/1e3*i%u),c=requestAnimationFrame(p)}c=requestAnimationFrame(p);const h=()=>{cancelAnimationFrame(c),n=r},m=()=>{c=requestAnimationFrame(p)};return e.addEventListener("mouseenter",h),e.addEventListener("mouseleave",m),()=>{cancelAnimationFrame(c),e.removeEventListener("mouseenter",h),e.removeEventListener("mouseleave",m)}}),[t,i]),p().createElement("div",{className:"carousel",ref:a},p().createElement("ul",{className:"list",ref:s,style:{transform:`translateX(${-r}px)`}},[...t,...t].map(((e,t)=>p().createElement("li",{key:t},p().createElement("div",{className:"item",onClick:()=>n(e),title:e.content},p().createElement("div",{className:"title"},e.title),p().createElement("div",{className:"content"},e.content)))))))}kt=qt,({e:[Et,wt,yt,Rt,St,Nt,_t,Mt,Tt,Ct,It,Wt,zt,Dt],c:[Ut,xt]}=(0,d.A)(kt,[Lt("ai-portal.chat-box",{styleTexts:[At.A]})],[[Ot({type:Boolean}),1,"disabled"],[Ot(),1,"placeholder"],[Ot({type:Boolean}),1,"autoFocus"],[Ot({attribute:!1}),1,"suggestions"],[Ot(),1,"suggestionsLabel"],[Yt({type:"message.submit"}),1,"messageSubmit",e=>(0,c.A)(Gt,e),(e,t)=>(0,o.A)(Gt,e,t)]],0,(e=>$t.has((0,r.A)(e))),m.ReactNextElement)),xt();var Qt,Zt=i(82165);let ei;const{defineElement:ti}=(0,h.createDecorators)();let ii;class ni extends m.ReactNextElement{render(){return p().createElement(ai,null)}}function ai(){return p().createElement("slot",null)}Qt=ni,[ii,ei]=(0,d.A)(Qt,[ti("ai-portal.home-container",{styleTexts:[Zt.A]})],[],0,void 0,m.ReactNextElement).c,ei();var si=i(21302),ri=i.n(si);let li=function(e){return e.TODAY="TODAY",e.YESTERDAY="YESTERDAY",e.PREVIOUS_7_DAYS="PREVIOUS_7_DAYS",e.PREVIOUS_30_DAYS="PREVIOUS_30_DAYS",e}({});const oi="bricks/ai-portal/chat-history",ci={en:{[li.TODAY]:"Today",[li.YESTERDAY]:"Yesterday",[li.PREVIOUS_7_DAYS]:"Previous 7 days",[li.PREVIOUS_30_DAYS]:"Previous 30 days"},zh:{[li.TODAY]:"今天",[li.YESTERDAY]:"昨天",[li.PREVIOUS_7_DAYS]:"过去7天",[li.PREVIOUS_30_DAYS]:"过去30天"}},di=b.i18n.getFixedT(null,oi);var ui,pi=i(21411);let hi,mi,gi,bi,vi,fi,ki,Ai,xi,Ei,wi,yi,Ri,Si,Ni;(0,b.initializeI18n)(oi,ci);const _i=(0,m.wrapBrick)("eo-icon"),Mi=(0,m.wrapBrick)("eo-link"),Ti=(0,m.wrapBrick)("eo-mini-actions",{onActionClick:"action.click",onVisibleChange:"visible.change"}),{defineElement:Ci,property:Ii,event:Wi}=(0,h.createDecorators)();let zi;var Di=new WeakMap,Vi=new WeakMap,Li=new WeakMap,Oi=new WeakMap,Yi=new WeakSet,Ui=new WeakMap,Pi=new WeakMap,Hi=new WeakMap;class Bi extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,Yi),(0,s.A)(this,Di,mi(this)),(0,s.A)(this,Vi,(gi(this),bi(this))),(0,s.A)(this,Li,(vi(this),fi(this))),(0,s.A)(this,Oi,(ki(this),Ai(this))),(0,s.A)(this,Ui,(wi(this),e=>{(0,l.A)(Yi,this,xi).emit(e)})),(0,s.A)(this,Pi,yi(this)),(0,s.A)(this,Hi,(Ni(this),e=>{(0,l.A)(Yi,this,Ri).emit({nextToken:e})}))}get list(){return(0,c.A)(Di,this)}set list(e){(0,o.A)(Di,this,e)}get actions(){return(0,c.A)(Vi,this)}set actions(e){(0,o.A)(Vi,this,e)}get nextToken(){return(0,c.A)(Li,this)}set nextToken(e){(0,o.A)(Li,this,e)}render(){return p().createElement(ji,{root:this,list:this.list,actions:this.actions,nextToken:this.nextToken,onActionClick:(0,c.A)(Ui,this),onLoadMore:(0,c.A)(Hi,this)})}}function ji(e){let{root:t,list:i,actions:n,nextToken:a,onActionClick:s,onLoadMore:r}=e;const l=(0,u.useMemo)((()=>{const e=new Map,t=ri()(),n=t.clone().startOf("day"),a=n.clone().subtract(1,"day"),s=n.clone().subtract(7,"days"),r=n.clone().subtract(30,"days"),l=+n/1e3,o=+a/1e3,c=+s/1e3,d=+r/1e3,u=+t.clone().startOf("year")/1e3;for(const t of null!=i?i:[]){let i;i=t.startTime>=l?di(li.TODAY):t.startTime>=o?di(li.YESTERDAY):t.startTime>=c?di(li.PREVIOUS_7_DAYS):t.startTime>=d?di(li.PREVIOUS_30_DAYS):t.startTime>=u?ri()(1e3*t.startTime).format("MMMM"):ri()(1e3*t.startTime).format("YYYY");let n=e.get(i);n||e.set(i,n={title:i,items:[]}),n.items.push(t)}return[...e.values()]}),[i]),[o,c]=(0,u.useState)(null),d=(0,u.useRef)(null);return(0,u.useEffect)((()=>{const e=d.current;if(!e||!a)return;const i=new IntersectionObserver((e=>{for(const t of e)t.isIntersecting&&r(a)}),{root:t});return i.observe(e),()=>{i.disconnect()}}),[a,r,t]),i?p().createElement(p().Fragment,null,p().createElement("ul",null,l.map((e=>p().createElement("li",{key:e.title,className:"group"},p().createElement("div",{className:"group-title"},e.title),p().createElement("ul",{className:"items"},e.items.map((e=>p().createElement("li",{key:e.id},p().createElement(Mi,{className:f()("item",{active:o===e.id}),url:e.url},p().createElement("div",{className:"item-title",title:e.title},e.title),p().createElement(Ti,{className:"actions",actions:n,onActionClick:t=>{s({action:t.detail,item:e})},onVisibleChange:t=>{c(t.detail?e.id:null)}}),!O.QB.includes(e.state)&&p().createElement("div",{className:"working"})))))))))),a&&p().createElement("div",{className:"load-more",ref:d},p().createElement(_i,{lib:"antd",icon:"loading-3-quarters",spinning:!0}))):p().createElement("div",{className:"loading"},p().createElement(_i,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0}))}ui=Bi,({e:[mi,gi,bi,vi,fi,ki,Ai,xi,Ei,wi,yi,Ri,Si,Ni],c:[zi,hi]}=(0,d.A)(ui,[Ci("ai-portal.chat-history",{styleTexts:[pi.A]})],[[Ii({attribute:!1}),1,"list"],[Ii({attribute:!1}),1,"actions"],[Ii(),1,"nextToken"],[Wi({type:"action.click"}),1,"actionClick",e=>(0,c.A)(Oi,e),(e,t)=>(0,o.A)(Oi,e,t)],[Wi({type:"load.more"}),1,"loadMore",e=>(0,c.A)(Pi,e),(e,t)=>(0,o.A)(Pi,e,t)]],0,(e=>Hi.has((0,r.A)(e))),m.ReactNextElement)),hi();var Fi,Gi=i(89575),Ji=i(24);let $i,qi,Ki,Xi,Qi,Zi,en,tn,nn,an,sn,rn,ln,on,cn,dn,un,pn,hn,mn,gn;const bn=(0,m.wrapBrick)("eo-mini-line-chart"),{defineElement:vn,property:fn}=(0,h.createDecorators)();let kn;var An=new WeakMap,xn=new WeakMap,En=new WeakMap,wn=new WeakMap,yn=new WeakMap,Rn=new WeakMap,Sn=new WeakMap,Nn=new WeakMap,_n=new WeakMap,Mn=new WeakMap;class Tn extends m.ReactNextElement{constructor(){super(...arguments),(0,s.A)(this,An,qi(this)),(0,s.A)(this,xn,(Ki(this),Xi(this))),(0,s.A)(this,En,(Qi(this),Zi(this))),(0,s.A)(this,wn,(en(this),tn(this))),(0,s.A)(this,yn,(nn(this),an(this))),(0,s.A)(this,Rn,(sn(this),rn(this))),(0,s.A)(this,Sn,(ln(this),on(this))),(0,s.A)(this,Nn,(cn(this),dn(this))),(0,s.A)(this,_n,(un(this),pn(this))),(0,s.A)(this,Mn,(hn(this),mn(this))),gn(this)}get label(){return(0,c.A)(An,this)}set label(e){(0,o.A)(An,this,e)}get value(){return(0,c.A)(xn,this)}set value(e){(0,o.A)(xn,this,e)}get size(){return(0,c.A)(En,this)}set size(e){(0,o.A)(En,this,e)}get lineColor(){return(0,c.A)(wn,this)}set lineColor(e){(0,o.A)(wn,this,e)}get showArea(){return(0,c.A)(yn,this)}set showArea(e){(0,o.A)(yn,this,e)}get min(){return(0,c.A)(Rn,this)}set min(e){(0,o.A)(Rn,this,e)}get max(){return(0,c.A)(Sn,this)}set max(e){(0,o.A)(Sn,this,e)}get xField(){return(0,c.A)(Nn,this)}set xField(e){(0,o.A)(Nn,this,e)}get yField(){return(0,c.A)(_n,this)}set yField(e){(0,o.A)(_n,this,e)}get data(){return(0,c.A)(Mn,this)}set data(e){(0,o.A)(Mn,this,e)}render(){return p().createElement(Cn,{label:this.label,value:this.value,size:this.size,lineColor:this.lineColor,showArea:this.showArea,min:this.min,max:this.max,xField:this.xField,yField:this.yField,data:this.data})}}function Cn(e){let{label:t,value:i,size:n,...a}=e;return"small"===n?p().createElement("div",{className:"container"},p().createElement("div",{className:"label-and-stat"},p().createElement("div",{className:"label"},t),p().createElement("div",{className:"stat"},i)),p().createElement("div",{className:"chart"},p().createElement(bn,(0,Gi.A)({},a,{lineWidth:1.5,width:"auto",height:"55"})))):p().createElement("div",{className:"container"},p().createElement("div",{className:"label"},t),p().createElement("div",{className:"stat-and-chart"},p().createElement("div",{className:"chart"},p().createElement(bn,(0,Gi.A)({},a,{lineWidth:2,width:"auto",height:"92"}))),p().createElement("div",{className:"stat"},i)))}Fi=Tn,({e:[qi,Ki,Xi,Qi,Zi,en,tn,nn,an,sn,rn,ln,on,cn,dn,un,pn,hn,mn,gn],c:[kn,$i]}=(0,d.A)(Fi,[vn("ai-portal.stat-with-mini-chart",{styleTexts:[Ji.A]})],[[fn(),1,"label"],[fn(),1,"value"],[fn(),1,"size"],[fn(),1,"lineColor"],[fn({type:Boolean}),1,"showArea"],[fn({type:Number}),1,"min"],[fn({type:Number}),1,"max"],[fn(),1,"xField"],[fn(),1,"yField"],[fn({attribute:!1}),1,"data"]],0,void 0,m.ReactNextElement)),$i();const In=i.p+"images/7385e5f5.png";var Wn,zn=i(31653);let Dn;const{defineElement:Vn}=(0,h.createDecorators)();let Ln;class On extends m.ReactNextElement{render(){return p().createElement(Yn,null)}}function Yn(){return p().createElement("img",{src:In,alt:"Elevo",width:95,height:26})}Wn=On,[Ln,Dn]=(0,d.A)(Wn,[Vn("ai-portal.elevo-logo",{styleTexts:[zn.A]})],[],0,void 0,m.ReactNextElement).c,Dn();let Un=function(e){return e.NEW_CHAT="NEW_CHAT",e.LOGOUT="LOGOUT",e.TODAY="TODAY",e.YESTERDAY="YESTERDAY",e.PREVIOUS_7_DAYS="PREVIOUS_7_DAYS",e.PREVIOUS_30_DAYS="PREVIOUS_30_DAYS",e.SWITCH_LANGUAGE="SWITCH_LANGUAGE",e}({});const Pn="bricks/ai-portal/elevo-sidebar",Hn={en:{[Un.NEW_CHAT]:"New chat",[Un.LOGOUT]:"Logout",[Un.TODAY]:"Today",[Un.YESTERDAY]:"Yesterday",[Un.PREVIOUS_7_DAYS]:"Previous 7 days",[Un.PREVIOUS_30_DAYS]:"Previous 30 days",[Un.SWITCH_LANGUAGE]:"中文"},zh:{[Un.NEW_CHAT]:"新对话",[Un.LOGOUT]:"登出",[Un.TODAY]:"今天",[Un.YESTERDAY]:"昨天",[Un.PREVIOUS_7_DAYS]:"过去7天",[Un.PREVIOUS_30_DAYS]:"过去30天",[Un.SWITCH_LANGUAGE]:"English"}},Bn=b.i18n.getFixedT(null,Pn);var jn=i(61408);const Fn=(0,m.wrapBrick)("eo-icon"),Gn=(0,m.wrapBrick)("eo-link"),Jn=(0,m.wrapBrick)("eo-dropdown-actions",{onActionClick:"action.click",onVisibleChange:"visible.change"}),$n=(0,m.wrapBrick)("eo-easyops-avatar"),qn=(0,m.wrapBrick)("eo-mini-actions",{onActionClick:"action.click",onVisibleChange:"visible.change"}),Kn=(0,m.wrapBrick)("ai-portal.icon-button");var Xn=i(57372);const Qn=async(e,t)=>(await Xn.http.post("api/gateway/logic.llm.aiops_service/api/v1/llm/agent/flow/search",e,t)).data,Zn=(0,u.forwardRef)(ea);function ea(e,t){let{activeId:i,actions:n,urlTemplate:a,onActionClick:s,onHistoryClick:r}=e;const l=(0,u.useRef)(null),[o,c]=(0,u.useState)(null),[d,h]=(0,u.useState)(),[m,g]=(0,u.useState)();(0,u.useEffect)((()=>{Promise.all([Qn({next_token:m},{interceptorParams:{ignoreLoadingBar:!0}}),new Promise((e=>setTimeout(e,500)))]).then((e=>{let[t]=e;c((e=>[...null!=e?e:[],...t.data])),h(t.next_token)})).catch((e=>{console.error("Error loading chat history:",e)}))}),[m]);const b=(0,u.useMemo)((()=>{const e=new Map,t=ri()(),i=t.clone().startOf("day"),n=i.clone().subtract(1,"day"),a=i.clone().subtract(7,"days"),s=i.clone().subtract(30,"days"),r=+i/1e3,l=+n/1e3,c=+a/1e3,d=+s/1e3,u=+t.clone().startOf("year")/1e3;for(const t of null!=o?o:[]){let i;i=t.startTime>=r?Bn(Un.TODAY):t.startTime>=l?Bn(Un.YESTERDAY):t.startTime>=c?Bn(Un.PREVIOUS_7_DAYS):t.startTime>=d?Bn(Un.PREVIOUS_30_DAYS):t.startTime>=u?ri()(1e3*t.startTime).format("MMMM"):ri()(1e3*t.startTime).format("YYYY");let n=e.get(i);n||e.set(i,n={title:i,items:[]}),n.items.push(t)}return[...e.values()]}),[o]),[v,k]=(0,u.useState)(null),A=(0,u.useRef)(null);(0,u.useEffect)((()=>{const e=A.current,t=l.current;if(!e||!d||!t)return;const i=new IntersectionObserver((e=>{for(const t of e)t.isIntersecting&&g(d)}),{root:t});return i.observe(e),()=>{i.disconnect()}}),[d]);const x=(0,u.useRef)(0),E=(0,u.useCallback)((async()=>{try{const e=++x.current,t=await Qn({},{interceptorParams:{ignoreLoadingBar:!0}});if(e!==x.current)return;c((e=>{const i=null!=e?e:[],n=t.data,a=new Set(n.map((e=>e.id))),s=new Map(n.map((e=>[e.id,e])));let r=!1,l=!1,o=!0;for(const e of i){const t=s.get(e.id);if(!t)break;if(r=!0,l=o&&t!==n[0]||!(0,ht.isEqual)(t,e),l)break;o=!1}return r?l?[...n,...i.filter((e=>!a.has(e.id)))]:e:(h(t.next_token),n)}))}catch(e){console.error("Error pulling chat history:",e)}}),[]);return(0,u.useImperativeHandle)(t,(()=>({pull:E})),[E]),o?p().createElement("div",{className:"history",ref:l},p().createElement("ul",null,b.map((e=>p().createElement("li",{key:e.title,className:"group"},p().createElement("div",{className:"group-title"},e.title),p().createElement("ul",{className:"items"},e.items.map((e=>{return p().createElement("li",{key:e.id},p().createElement(Gn,(0,Gi.A)({className:f()("item",{"actions-active":e.id===v,active:e.id===i}),onClick:r},a?{url:(t=a,l=e,null==t?void 0:t.replace(/{{(.*?)}}/g,((e,t)=>(0,ht.get)(l,t))))}:null),p().createElement("div",{className:"item-title",title:e.title},e.title),p().createElement(qn,{className:"actions",actions:n,onActionClick:t=>{s({action:t.detail,item:e})},onVisibleChange:t=>{k(t.detail?e.id:null)}}),!O.QB.includes(e.state)&&p().createElement("div",{className:"working"})));var t,l}))))))),d&&p().createElement("div",{className:"load-more",ref:A},p().createElement(Fn,{lib:"antd",icon:"loading-3-quarters",spinning:!0}))):p().createElement("div",{className:"history"},p().createElement("div",{className:"loading"},p().createElement(Fn,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0})))}var ta;let ia,na,aa,sa,ra,la,oa,ca,da,ua,pa,ha,ma,ga,ba,va,fa,ka,Aa,xa,Ea,wa,ya,Ra,Sa,Na;(0,b.initializeI18n)(Pn,Hn);const _a={lib:"easyops",icon:"sidebar"},{defineElement:Ma,property:Ta,event:Ca,method:Ia}=(0,h.createDecorators)(),Wa=(0,u.forwardRef)(Ka);let za;var Da=new WeakMap,Va=new WeakMap,La=new WeakMap,Oa=new WeakMap,Ya=new WeakMap,Ua=new WeakMap,Pa=new WeakMap,Ha=new WeakMap,Ba=new WeakMap,ja=new WeakSet,Fa=new WeakMap,Ga=new WeakMap,Ja=new WeakMap,$a=new WeakMap;class qa extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,ja),(0,s.A)(this,Da,(ia(this),aa(this))),(0,s.A)(this,Va,(sa(this),ra(this))),(0,s.A)(this,La,(la(this),oa(this))),(0,s.A)(this,Oa,(ca(this),da(this))),(0,s.A)(this,Ya,(ua(this),pa(this))),(0,s.A)(this,Ua,(ha(this),ma(this))),(0,s.A)(this,Pa,(ga(this),ba(this))),(0,s.A)(this,Ha,(va(this),fa(this))),(0,s.A)(this,Ba,(ka(this),Aa(this))),(0,s.A)(this,Fa,(wa(this),()=>{(0,l.A)(ja,this,xa).emit()})),(0,s.A)(this,Ga,ya(this)),(0,s.A)(this,Ja,(Na(this),e=>{(0,l.A)(ja,this,Ra).emit(e)})),(0,s.A)(this,$a,(0,u.createRef)())}get userInstanceId(){return(0,c.A)(Da,this)}set userInstanceId(e){(0,o.A)(Da,this,e)}get behavior(){return(0,c.A)(Va,this)}set behavior(e){(0,o.A)(Va,this,e)}get logoUrl(){return(0,c.A)(La,this)}set logoUrl(e){(0,o.A)(La,this,e)}get newChatUrl(){return(0,c.A)(Oa,this)}set newChatUrl(e){(0,o.A)(Oa,this,e)}get historyActiveId(){return(0,c.A)(Ya,this)}set historyActiveId(e){(0,o.A)(Ya,this,e)}get historyUrlTemplate(){return(0,c.A)(Ua,this)}set historyUrlTemplate(e){(0,o.A)(Ua,this,e)}get historyActions(){return(0,c.A)(Pa,this)}set historyActions(e){(0,o.A)(Pa,this,e)}get links(){return(0,c.A)(Ha,this)}set links(e){(0,o.A)(Ha,this,e)}pullHistory(e){setTimeout((()=>{var e;null===(e=(0,c.A)($a,this).current)||void 0===e||e.pull()}),e)}render(){return p().createElement(Wa,{ref:(0,c.A)($a,this),userInstanceId:this.userInstanceId,behavior:this.behavior,logoUrl:this.logoUrl,newChatUrl:this.newChatUrl,historyActiveId:this.historyActiveId,historyUrlTemplate:this.historyUrlTemplate,historyActions:this.historyActions,links:this.links,onLogout:(0,c.A)(Fa,this),onActionClick:(0,c.A)(Ja,this)})}}function Ka(e,t){let{userInstanceId:i,behavior:n,logoUrl:a,newChatUrl:s,historyActiveId:r,historyUrlTemplate:l,historyActions:o,links:c,onLogout:d,onActionClick:h}=e;const[m,v]=(0,u.useState)("drawer"===n),k=(0,u.useCallback)((()=>{v(!0)}),[]),A=(0,u.useCallback)((()=>{v(!1)}),[]);(0,u.useEffect)((()=>{"drawer"===n&&v(!0)}),[n]);const x=(0,u.useCallback)((()=>{v(!0)}),[]),E=(0,u.useCallback)((()=>{"drawer"===n&&v(!0)}),[n]),w=(0,u.useMemo)((()=>[{key:"logout",icon:{lib:"fa",prefix:"fas",icon:"arrow-right-from-bracket"},text:Bn(Un.LOGOUT)},{key:"switch-language",icon:{lib:"easyops",icon:"language"},text:Bn(Un.SWITCH_LANGUAGE)}]),[]);return p().createElement("div",{className:f()("container",{collapsed:m})},"drawer"===n&&!m&&p().createElement("div",{className:"mask",onClick:x}),p().createElement("div",{className:"sidebar"},p().createElement("div",{className:"logo-bar"},p().createElement(Gn,{url:a,className:"logo-link"},p().createElement("img",{className:"logo",alt:"Elevo",src:In,width:95,height:26})),p().createElement(Kn,{icon:_a,variant:"light",onClick:k})),p().createElement(Gn,{className:"new-chat",url:s},p().createElement(Fn,{className:"new-chat-icon",lib:"easyops",icon:"new-chat"}),Bn(Un.NEW_CHAT)),null!=c&&c.length?p().createElement("div",{className:"links"},c.map(((e,t)=>p().createElement(Gn,{className:"link",key:t,url:e.url},p().createElement(Fn,(0,Gi.A)({className:"icon"},e.icon)),p().createElement("span",{className:"title"},e.title))))):null,p().createElement(Zn,{ref:t,activeId:r,urlTemplate:l,actions:o,onActionClick:h,onHistoryClick:E}),p().createElement("div",{className:"footer"},p().createElement(Jn,{className:"dropdown",actions:w,onActionClick:async e=>{"logout"===e.detail.key?d():(await b.i18n.changeLanguage(b.i18n.language&&"en"===b.i18n.language.split("-")[0]?"zh":"en"),(0,g.getHistory)().reload())}},p().createElement("button",{className:"account"},p().createElement($n,{nameOrInstanceId:i,showName:!0,size:"xs"}))))),p().createElement("div",{className:"alternative"},p().createElement(Kn,{icon:_a,variant:"light",onClick:A}),p().createElement(Gn,{className:"new-chat",url:s},p().createElement(Fn,{className:"new-chat-icon",lib:"easyops",icon:"new-chat"}),Bn(Un.NEW_CHAT))))}ta=qa,({e:[aa,sa,ra,la,oa,ca,da,ua,pa,ha,ma,ga,ba,va,fa,ka,Aa,xa,Ea,wa,ya,Ra,Sa,Na,ia],c:[za,na]}=(0,d.A)(ta,[Ma("ai-portal.elevo-sidebar",{styleTexts:[jn.A]})],[[Ta(),1,"userInstanceId"],[Ta(),1,"behavior"],[Ta(),1,"logoUrl"],[Ta(),1,"newChatUrl"],[Ta(),1,"historyActiveId"],[Ta(),1,"historyUrlTemplate"],[Ta({attribute:!1}),1,"historyActions"],[Ta({attribute:!1}),1,"links"],[Ca({type:"logout"}),1,"logout",e=>(0,c.A)(Ba,e),(e,t)=>(0,o.A)(Ba,e,t)],[Ca({type:"action.click"}),1,"actionClick",e=>(0,c.A)(Ga,e),(e,t)=>(0,o.A)(Ga,e,t)],[Ia(),2,"pullHistory"]],0,(e=>$a.has((0,r.A)(e))),m.ReactNextElement)),na();var Xa,Qa=i(47338);let Za,es,ts,is,ns,as,ss,rs,ls;const os=(0,m.wrapBrick)("eo-icon"),cs=(0,m.wrapBrick)("eo-tooltip"),{defineElement:ds,property:us}=(0,h.createDecorators)();let ps;var hs=new WeakMap,ms=new WeakMap,gs=new WeakMap,bs=new WeakMap;class vs extends m.ReactNextElement{constructor(){super(...arguments),(0,s.A)(this,hs,es(this)),(0,s.A)(this,ms,(ts(this),is(this))),(0,s.A)(this,gs,(ns(this),as(this))),(0,s.A)(this,bs,(ss(this),rs(this))),ls(this)}get icon(){return(0,c.A)(hs,this)}set icon(e){(0,o.A)(hs,this,e)}get tooltip(){return(0,c.A)(ms,this)}set tooltip(e){(0,o.A)(ms,this,e)}get disabled(){return(0,c.A)(gs,this)}set disabled(e){(0,o.A)(gs,this,e)}get variant(){return(0,c.A)(bs,this)}set variant(e){(0,o.A)(bs,this,e)}render(){return p().createElement(fs,{icon:this.icon,tooltip:this.tooltip,disabled:this.disabled})}}function fs(e){let{icon:t,tooltip:i,disabled:n}=e;const a=p().createElement("button",{disabled:n},p().createElement(os,t));return i?p().createElement(cs,{content:i},a):a}Xa=vs,({e:[es,ts,is,ns,as,ss,rs,ls],c:[ps,Za]}=(0,d.A)(Xa,[ds("ai-portal.icon-button",{styleTexts:[Qa.A]})],[[us({attribute:!1}),1,"icon"],[us(),1,"tooltip"],[us({type:Boolean}),1,"disabled"],[us({render:!1}),1,"variant"]],0,void 0,m.ReactNextElement)),Za();let ks=function(e){return e.ALL="ALL",e}({});const As="bricks/ai-portal/show-cases",xs={en:{[ks.ALL]:"All"},zh:{[ks.ALL]:"全部"}},Es=b.i18n.getFixedT(null,As);var ws,ys=i(42873);let Rs,Ss,Ns,_s,Ms;(0,b.initializeI18n)(As,xs);const Ts=(0,m.wrapBrick)("eo-link"),{defineElement:Cs,property:Is}=(0,h.createDecorators)();let Ws;var zs=new WeakMap,Ds=new WeakMap;class Vs extends m.ReactNextElement{constructor(){super(...arguments),(0,s.A)(this,zs,Ss(this)),(0,s.A)(this,Ds,(Ns(this),_s(this))),Ms(this)}get list(){return(0,c.A)(zs,this)}set list(e){(0,o.A)(zs,this,e)}get taskUrlTemplate(){return(0,c.A)(Ds,this)}set taskUrlTemplate(e){(0,o.A)(Ds,this,e)}render(){return p().createElement(Ls,{list:this.list,taskUrlTemplate:this.taskUrlTemplate})}}function Ls(e){let{list:t,taskUrlTemplate:i}=e;const n=(0,u.useMemo)((()=>[null,...new Set(null==t?void 0:t.map((e=>e.scenario)).filter(Boolean))]),[t]),[a,s]=(0,u.useState)(null),r=(0,u.useMemo)((()=>a?null==t?void 0:t.filter((e=>e.scenario===a)):t),[a,t]);return null!=t&&t.length?p().createElement(p().Fragment,null,p().createElement("ul",{className:"nav"},null==n?void 0:n.map((e=>p().createElement("li",{key:e,className:"item"},p().createElement("a",{className:f()({active:a===e}),onClick:()=>s(e)},null===e?Es(ks.ALL):e))))),p().createElement("ul",{className:"cases"},null==r?void 0:r.map((e=>{return p().createElement("li",{key:e.taskId,className:"item"},p().createElement(Ts,{className:"link",url:(t=i,n=e,null==t?void 0:t.replace(/{{(.*?)}}/g,((e,t)=>(0,ht.get)(n,t))))},p().createElement("span",{className:f()("placeholder",e.thumbUrl?"thumbnail":"summary")},e.thumbUrl?p().createElement("span",{style:{backgroundImage:`url(${(0,g.getBasePath)()}${e.thumbUrl})`}}):p().createElement("span",{className:"summary-1"},p().createElement("span",{className:"summary-2"},p().createElement("span",null,e.summary)))),p().createElement("span",{className:"title"},p().createElement("span",null,e.title))));var t,n})))):null}ws=Vs,({e:[Ss,Ns,_s,Ms],c:[Ws,Rs]}=(0,d.A)(ws,[Cs("ai-portal.show-cases",{styleTexts:[ys.A]})],[[Is({attribute:!1}),1,"list"],[Is(),1,"taskUrlTemplate"]],0,void 0,m.ReactNextElement)),Rs();let Os=function(e){return e.MCP_HUB="MCP_HUB",e.ALL="ALL",e.SERVER_cmdb="SERVER_cmdb",e.SERVER_cmdb_product_helper="SERVER_cmdb_product_helper",e.SERVER_alert="SERVER_alert",e.SERVER_web_builder="SERVER_web_builder",e.SERVER_web_builder2="SERVER_web_builder2",e.SERVER_host_troubleshooting="SERVER_host_troubleshooting",e.SERVER_system_inspection="SERVER_system_inspection",e.SERVER_grafana="SERVER_grafana",e.SERVER_kubernetes="SERVER_kubernetes",e.SERVER_llm="SERVER_llm",e}({});const Ys="bricks/ai-portal/mcp-tools",Us={en:{[Os.MCP_HUB]:"MCP Hub",[Os.ALL]:"All",[Os.SERVER_cmdb]:"CMDB",[Os.SERVER_cmdb_product_helper]:"CMDB",[Os.SERVER_alert]:"Alert",[Os.SERVER_web_builder]:"View",[Os.SERVER_web_builder2]:"View",[Os.SERVER_host_troubleshooting]:"Host Troubleshooting",[Os.SERVER_system_inspection]:"System Inspection",[Os.SERVER_grafana]:"Grafana",[Os.SERVER_kubernetes]:"Kubernetes",[Os.SERVER_llm]:"LLM"},zh:{[Os.MCP_HUB]:"MCP 中心",[Os.ALL]:"全部",[Os.SERVER_cmdb]:"CMDB",[Os.SERVER_cmdb_product_helper]:"CMDB",[Os.SERVER_alert]:"告警",[Os.SERVER_web_builder]:"视图",[Os.SERVER_web_builder2]:"视图",[Os.SERVER_host_troubleshooting]:"主机故障排查",[Os.SERVER_system_inspection]:"系统巡检",[Os.SERVER_grafana]:"Grafana",[Os.SERVER_kubernetes]:"Kubernetes",[Os.SERVER_llm]:"大模型"}},Ps=b.i18n.getFixedT(null,Ys);var Hs,Bs=i(31748);let js,Fs,Gs;(0,b.initializeI18n)(Ys,Us);const Js={lib:"antd",icon:"tool"},$s=new Map([["EasyOps平台",{servers:["cmdb","cmdb_product_helper"]}],["Grafana",{servers:["grafana"]}],["Kubernetes",{servers:["kubernetes"]}],["监控事件",{servers:["alert"]}],["浏览器",{servers:["playwright"]}],["低代码",{servers:["web-builder","web-builder2"]}],["大模型",{servers:["llm"]}],["故障排查",{servers:["host-troubleshooting"]}]]),qs=(0,m.wrapBrick)("eo-icon"),{defineElement:Ks,property:Xs}=(0,h.createDecorators)();let Qs;var Zs=new WeakMap;class er extends m.ReactNextElement{constructor(){super(...arguments),(0,s.A)(this,Zs,Fs(this)),Gs(this)}get list(){return(0,c.A)(Zs,this)}set list(e){(0,o.A)(Zs,this,e)}render(){return p().createElement(tr,{list:this.list})}}function tr(e){let{list:t}=e;const[i,n]=(0,u.useMemo)((()=>{const e=new Map,i=new Map;null==t||t.forEach((t=>{const n=Ps(`SERVER_${t.server.id.replaceAll("-","_")}`,t.server.name);let a=e.get(n);a||e.set(n,a=[]),a.push(t);const s=[...$s.entries()].find((e=>{let[i,{servers:n}]=e;return n.includes(t.server.id)})),r=s?s[0]:"其他";let l=i.get(r);l||i.set(r,l=[]),l.push(n)}));const n=["CMDB"];return[new Map([...e.entries()].sort(((e,t)=>{let[i]=e,[a]=t;const s=n.indexOf(i),r=n.indexOf(a);return(s<0?n.length:s)-(r<0?n.length:r)}))),i]}),[t]),a=(0,u.useMemo)((()=>{const e=[...$s.keys()],t=[...n.keys()];return t.sort(((t,i)=>{const n=e.indexOf(t),a=e.indexOf(i);return(n<0?e.length:n)-(a<0?e.length:a)})),[null,...t]}),[n]),[s,r]=(0,u.useState)(null),l=(0,u.useMemo)((()=>{const e=[...i];if(null===s)return e;const t=n.get(s);return e.filter((e=>{let[i]=e;return null==t?void 0:t.includes(i)}))}),[s,i,n]);return p().createElement("div",{className:"container"},p().createElement("h1",null,Ps(Os.MCP_HUB)),p().createElement("ul",{className:"nav"},null==a?void 0:a.map((e=>p().createElement("li",{key:e,className:"item"},p().createElement("a",{className:f()({active:s===e}),onClick:()=>r(e)},null===e?Ps(Os.ALL):e))))),p().createElement("ul",{className:"groups"},null==l?void 0:l.map((e=>{let[t,i]=e;return p().createElement("li",{key:t,className:"group"},p().createElement("h2",null,t),p().createElement("ul",{className:"list"},i.map(((e,t)=>{var i;return p().createElement("li",{key:t,className:"item"},p().createElement("div",{className:"heading"},p().createElement(qs,(0,Gi.A)({className:"icon"},null!==(i=e.icon)&&void 0!==i?i:Js,{fallback:Js})),p().createElement("div",{className:"title"},e.title)),p().createElement("div",{className:"description"},e.description))}))))}))))}Hs=er,({e:[Fs,Gs],c:[Qs,js]}=(0,d.A)(Hs,[Ks("ai-portal.mcp-tools",{styleTexts:[Bs.A]})],[[Xs({attribute:!1}),1,"list"]],0,void 0,m.ReactNextElement)),js();var ir,nr=i(92914),ar=i(80413),sr=i(22025),rr=i(13183),lr=i(30578),or=i(17911);let cr,dr,ur,pr,hr,mr,gr,br,vr,fr,kr,Ar,xr,Er,wr,yr,Rr,Sr,Nr,_r,Mr,Tr,Cr,Ir,Wr;(0,b.initializeI18n)(nr.NS,nr.I);const zr={lib:"easyops",icon:"share"},{defineElement:Dr,property:Vr,event:Lr}=(0,h.createDecorators)();let Or;var Yr=new WeakMap,Ur=new WeakMap,Pr=new WeakMap,Hr=new WeakMap,Br=new WeakMap,jr=new WeakSet,Fr=new WeakMap,Gr=new WeakMap,Jr=new WeakMap,$r=new WeakMap,qr=new WeakMap,Kr=new WeakMap,Xr=new WeakMap;class Qr extends m.ReactNextElement{constructor(){super(...arguments),(0,a.A)(this,jr),(0,s.A)(this,Yr,dr(this)),(0,s.A)(this,Ur,(ur(this),pr(this))),(0,s.A)(this,Pr,(hr(this),mr(this))),(0,s.A)(this,Hr,(gr(this),br(this))),(0,s.A)(this,Br,(vr(this),fr(this))),(0,s.A)(this,Fr,(xr(this),()=>{(0,l.A)(jr,this,kr).emit()})),(0,s.A)(this,Gr,Er(this)),(0,s.A)(this,Jr,(Rr(this),()=>{(0,l.A)(jr,this,wr).emit()})),(0,s.A)(this,$r,Sr(this)),(0,s.A)(this,qr,(Mr(this),()=>{(0,l.A)(jr,this,Nr).emit()})),(0,s.A)(this,Kr,Tr(this)),(0,s.A)(this,Xr,(Wr(this),()=>{(0,l.A)(jr,this,Cr).emit()}))}get taskId(){return(0,c.A)(Yr,this)}set taskId(e){(0,o.A)(Yr,this,e)}get replay(){return(0,c.A)(Ur,this)}set replay(e){(0,o.A)(Ur,this,e)}get replayDelay(){return(0,c.A)(Pr,this)}set replayDelay(e){(0,o.A)(Pr,this,e)}get supports(){return(0,c.A)(Hr,this)}set supports(e){(0,o.A)(Hr,this,e)}render(){return p().createElement(Zr,{taskId:this.taskId,replay:this.replay,replayDelay:this.replayDelay,supports:this.supports,onShare:(0,c.A)(Fr,this),onPause:(0,c.A)(Jr,this),onResume:(0,c.A)(qr,this),onCancel:(0,c.A)(Xr,this)})}}function Zr(e){var t;let{taskId:i,replay:n,replayDelay:a,supports:s,onShare:r,onPause:l,onResume:o,onCancel:c}=e;const{task:d,jobs:h,error:m,humanInputRef:b,skipToResults:v,watchAgain:A}=(0,_.S)(i,n,a),x=null!==(t=null==d?void 0:d.title)&&void 0!==t?t:"",E=null==d?void 0:d.state,w=O.QB.includes(E),{messages:y,inputRequiredJobId:R}=(0,ar.e)(d,h),S=(0,u.useMemo)((()=>null==h?void 0:h.flatMap((e=>e.generatedView?{id:e.id,view:e.generatedView}:[]))),[h]),[N,M]=(0,u.useState)(null),[T,C]=(0,u.useState)(null);(0,u.useEffect)((()=>{(0,g.getRuntime)().applyPageTitle(x)}),[x]),(0,u.useEffect)((()=>{m&&(0,g.handleHttpError)(m)}),[m]);const I=(0,u.useCallback)(((e,t)=>{var i;null===(i=b.current)||void 0===i||i.call(b,e,t)}),[b]),W=(0,u.useMemo)((()=>({humanInput:I,onShare:r,onPause:l,onResume:o,onCancel:c,supports:s,activeExpandedViewJobId:N,setActiveExpandedViewJobId:M,activeToolCallJobId:T,setActiveToolCallJobId:C})),[I,r,l,o,c,s,N,T]),z=(0,u.useRef)(!1),D=(0,u.useRef)(!1),V=(0,u.useRef)(null),L=!!d;(0,u.useEffect)((()=>{const e=V.current,t=null==e?void 0:e.firstElementChild;if(D.current||!e||!t)return;const i=()=>{z.current&&(D.current=e.scrollTop+e.clientHeight+6<e.scrollHeight)};let n;e.addEventListener("scroll",i);const a=new k.A((()=>{D.current||(z.current=!1,e.scrollTo({top:t.scrollHeight,behavior:"instant"}),clearTimeout(n),n=setTimeout((()=>{z.current=!0}),100))}));return a.observe(t),()=>{a.disconnect(),e.removeEventListener("scroll",i)}}),[L]);const U=(0,u.useMemo)((()=>T?null==h?void 0:h.find((e=>e.id===T)):null),[T,h]);return p().createElement(K.j.Provider,{value:W},p().createElement("div",{className:sr.A.container},p().createElement("div",{className:sr.A.header},p().createElement("div",{className:sr.A.left}),p().createElement("h1",null,x),p().createElement("div",{className:sr.A.right},p().createElement(Y.Py,{icon:zr,variant:"mini",onClick:r}))),L?p().createElement("div",{className:sr.A.main,ref:V},p().createElement("div",{className:sr.A.narrow},null==y?void 0:y.map(((e,t,i)=>p().createElement("div",{className:sr.A.message,key:t},"user"===e.role?p().createElement(rr.R,{content:e.content}):p().createElement(lr.G,{jobs:e.jobs,taskState:E,isLatest:t===i.length-1})))))):p().createElement("div",{className:sr.A["loading-icon"]},p().createElement(Y.Bj,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0})),n||null!=s&&s.chat?p().createElement("div",{className:sr.A.footer},p().createElement("div",{className:sr.A.narrow},n?p().createElement(G.b,{taskDone:w,skipToResults:v,watchAgain:A}):p().createElement(J.s,{taskState:E,taskDone:w,inputRequiredJobId:R}))):null),p().createElement("div",{className:f()(sr.A.aside,{[sr.A.expanded]:!!T})},T&&p().createElement(or.n,{job:U})),N&&p().createElement(j.f,{views:S}))}ir=Qr,({e:[dr,ur,pr,hr,mr,gr,br,vr,fr,kr,Ar,xr,Er,wr,yr,Rr,Sr,Nr,_r,Mr,Tr,Cr,Ir,Wr],c:[Or,cr]}=(0,d.A)(ir,[Dr("ai-portal.chat-stream",{shadowOptions:!1})],[[Vr(),1,"taskId"],[Vr({type:Boolean}),1,"replay"],[Vr({type:Number}),1,"replayDelay"],[Vr({attribute:!1}),1,"supports"],[Lr({type:"share"}),1,"shareEvent",e=>(0,c.A)(Br,e),(e,t)=>(0,o.A)(Br,e,t)],[Lr({type:"pause"}),1,"pauseEvent",e=>(0,c.A)(Gr,e),(e,t)=>(0,o.A)(Gr,e,t)],[Lr({type:"resume"}),1,"resumeEvent",e=>(0,c.A)($r,e),(e,t)=>(0,o.A)($r,e,t)],[Lr({type:"cancel"}),1,"cancelEvent",e=>(0,c.A)(Kr,e),(e,t)=>(0,o.A)(Kr,e,t)]],0,(e=>Xr.has((0,r.A)(e))),m.ReactNextElement)),cr();const el=i.p+"images/8c2cf79e.png",tl=i.p+"images/0cbe181e.png",il=i.p+"images/87c8a33b.png",nl=i.p+"images/f542faa9.png",al=i.p+"images/8e5c445f.png",sl=i.p+"images/dd5fc700.png",rl=i.p+"images/4215203f.png",ll=i.p+"images/5e54ffc5.png";let ol=function(e){return e.AI_EMPLOYEES="AI_EMPLOYEES",e}({});const cl="bricks/ai-portal/ai-employees",dl=b.i18n.getFixedT(null,cl);var ul,pl=i(98036);let hl,ml,gl,bl,vl;(0,b.initializeI18n)(cl,{en:{AI_EMPLOYEES:"AI Employees"},zh:{AI_EMPLOYEES:"Ai 数字人"}});const fl=[el,tl,il,nl,al,sl,rl,ll],{defineElement:kl,property:Al}=(0,h.createDecorators)();let xl;var El=new WeakMap,wl=new WeakMap;class yl extends m.ReactNextElement{constructor(){super(...arguments),(0,s.A)(this,El,ml(this)),(0,s.A)(this,wl,(gl(this),bl(this))),vl(this)}get list(){return(0,c.A)(El,this)}set list(e){(0,o.A)(El,this,e)}get industries(){return(0,c.A)(wl,this)}set industries(e){(0,o.A)(wl,this,e)}render(){return p().createElement(Rl,{list:this.list,industries:this.industries})}}function Rl(e){let{list:t,industries:i}=e;const n=(0,u.useMemo)((()=>[...new Set([...null!=i?i:[],...(null!=t?t:[]).map((e=>e.industry))])]),[i,t]),[a,s]=(0,u.useState)(n[0]),r=(0,u.useMemo)((()=>{const e=new Map;return null==t||t.forEach((t=>{if(t.industry!==a)return;let i=e.get(t.role);i||e.set(t.role,i=[]),i.push(t)})),[...e.entries()]}),[a,t]),l=n.indexOf(a);return p().createElement("div",{className:"container"},p().createElement("h1",null,dl(ol.AI_EMPLOYEES)),p().createElement("ul",{className:"nav"},n.map((e=>p().createElement("li",{key:e,className:"item"},p().createElement("a",{className:f()({active:e===a}),onClick:()=>s(e)},e))))),p().createElement("ul",{className:"groups"},r.map(((e,t)=>{let[i,n]=e;return p().createElement("li",{key:i,className:"group"},p().createElement("h2",null,i),p().createElement("ul",{className:"list"},n.map(((e,i)=>p().createElement("li",{key:i,className:"item"},p().createElement("div",{className:"heading"},p().createElement("div",{className:"avatar"},p().createElement("img",{src:fl[(i+t+l)%fl.length]})),p().createElement("div",{className:"title"},e.name)),p().createElement("div",{className:"description"},e.description))))))}))))}ul=yl,({e:[ml,gl,bl,vl],c:[xl,hl]}=(0,d.A)(ul,[kl("ai-portal.ai-employees",{styleTexts:[pl.A]})],[[Al({attribute:!1}),1,"list"],[Al({attribute:!1}),1,"industries"]],0,void 0,m.ReactNextElement)),hl()},61408:(e,t,i)=>{i.d(t,{A:()=>l});var n=i(36758),a=i.n(n),s=i(40935),r=i.n(s)()(a());r.push([e.id,':host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.sidebar{position:relative;width:261px;height:100%;background:#f6f7f9;border-right:1px solid #e3e5eb;padding:26px 16px 0;display:flex;flex-direction:column;transition:transform 0.3s ease-in-out}.logo-bar{display:flex;align-items:center;justify-content:space-between;margin-bottom:30px}.logo-link::part(link){display:block}.logo{vertical-align:middle}.new-chat::part(link){display:flex;gap:0;align-items:center;color:var(--elevo-color-brand);font-size:14px;text-align:left;cursor:pointer}.sidebar .new-chat::part(link){background:#f0f4ff;border-radius:8px;border:1px solid #c9d7ff;padding:9px 13px;font-weight:500;margin-bottom:16px}.sidebar .new-chat::part(link):hover{background:rgba(201,215,255,0.5)}.new-chat-icon{font-size:16px;margin-right:5px}.footer{border-top:1px solid rgba(0,0,0,0.04);padding:9px 12px;margin:0 -16px}.dropdown{display:block}.account{background:none;border:none;border-radius:8px;padding:6px 10px;display:block;width:100%;text-align:left;cursor:pointer}.account:hover{background:rgba(0,0,0,0.04)}.alternative{position:fixed;top:8px;left:8px;padding:6px 10px 6px 8px;display:flex;align-items:center;opacity:0;z-index:1;transition:opacity 0.2s ease-in-out;background:rgba(255,255,255,0);border-radius:8px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.alternative .new-chat::part(link){padding:4px;margin-left:16px;font-size:12px}.alternative .new-chat::part(link):hover{color:#7891ff}.alternative .new-chat::part(link):active{color:#0911b3}.container{width:261px;height:100%;transition:width 0.3s ease-in-out}.collapsed{width:0;overflow:visible}.collapsed .sidebar{transform:translateX(-100%)}.collapsed .alternative{opacity:1}:host([behavior="drawer"]){z-index:1;width:0}:host(:not([behavior="drawer"])) .alternative .new-chat{display:none}.mask{position:fixed;top:0;right:0;bottom:0;left:0}.links{border-bottom:1px solid rgba(0,0,0,0.06);padding-bottom:16px;margin-bottom:16px}.link{display:block}.link + .link{margin-top:4px}.link::part(link){display:flex;gap:0;align-items:center;padding:7px 13px;border-radius:8px;color:#000}.link::part(link):hover{background:rgba(0,0,0,0.04)}.link .icon{font-size:16px;margin-right:10px}.link .title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.history{flex:1;min-height:0;overflow-y:auto;margin:0 -16px;padding:0 12px}.history ul{list-style:none;margin:0;padding:0}.history .loading{display:flex;justify-content:center;padding:8px}.history .group + .group{margin-top:15px}.history .group-title{font-weight:500;font-size:12px;color:#000;padding:8px;height:36px;line-height:20px}.history .item{display:block}.history .item::part(link){display:flex;align-items:center;padding:0 8px;height:36px;border-radius:8px;color:#000}.history .item.active::part(link){background:rgba(0,0,0,0.06)}.history .item.actions-active::part(link),.history .item::part(link):hover{background:rgba(0,0,0,0.04)}.history .item-title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.history .actions{cursor:auto}.history .item:not(:hover):not(.actions-active) .actions{display:none}.history .working{width:8px;height:8px;border-radius:8px;background:var(--elevo-color-brand);margin:0 7px}.history .item.actions-active .working,.history .item:hover .working,.history .item.active .working{display:none}.history .load-more{display:flex;justify-content:center;align-items:center;height:36px}',""]);const l=r.toString()},82165:(e,t,i)=>{i.d(t,{A:()=>p});var n=i(36758),a=i.n(n),s=i(40935),r=i.n(s),l=i(20062),o=i.n(l),c=new URL(i(32360),i.b),d=r()(a()),u=o()(c);d.push([e.id,`:host{display:block;background-color:#fff;background-image:url(${u});background-position:center;background-size:cover;background-repeat:no-repeat;background-attachment:fixed}:host([hidden]){display:none}`,""]);const p=d.toString()},89518:(e,t,i)=>{e.exports=i.p+"images/f819b04a.png"},91107:(e,t,i)=>{e.exports=i.p+"images/eef4f2bd.png"},98036:(e,t,i)=>{i.d(t,{A:()=>p});var n=i(36758),a=i.n(n),s=i(40935),r=i.n(s),l=i(20062),o=i.n(l),c=new URL(i(15733),i.b),d=r()(a()),u=o()(c);d.push([e.id,`:host{display:block;position:relative;width:100%;height:100%;overflow:hidden;background-color:rgb(205,206,207);background-image:url(${u});background-size:cover;background-repeat:no-repeat;background-position:center;background-attachment:fixed;color:#262626;padding:48px 24px;overflow-y:auto}:host([hidden]){display:none}*{box-sizing:border-box}.container{max-width:1400px;margin:0 auto}h1,\nh2{font-weight:500;margin:0}h1{font-size:20px;line-height:28px}h2{font-size:16px;line-height:22px}.nav,\n.groups,\n.list{list-style:none;margin:0;padding:0}.nav{display:flex;font-size:16px;margin-top:17px}.nav .item + .item{margin-left:32px}.nav .item a{color:rgba(38,38,38,0.65);cursor:pointer}.nav .item a.active{color:#262626;font-weight:500}.nav .item a.active::after{content:"";display:block;width:100%;height:4px;background-color:currentColor;border-radius:2px}.groups{margin-top:27px}.group + .group{margin-top:32px}.list{margin-top:16px;display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:24px}.list .item{background:rgba(255,255,255,0.9);box-shadow:0px 2px 5px 0px rgba(0,0,0,0.08);border-radius:12px;padding:20px 26px}.heading{display:flex;align-items:center}.avatar{width:48px;height:48px;border-radius:12px;margin-right:16px;background-color:#d5d6e6}.title{font-size:16px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.description{margin-top:13px;font-size:13px;color:rgba(0,0,0,0.45);line-height:18px;height:54px;display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}`,""]);const p=d.toString()}}]);
|
|
3
|
+
//# sourceMappingURL=3561.4d1372b5.js.map
|