@kabmo-labs/kabmo 0.53.2 → 0.55.0
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/client/index.html +1 -1
- package/dist/client/index.js +538 -527
- package/dist/client/static/js/{Body-vaa10tcd.js → Body-a4dwe3hh.js} +1 -1
- package/dist/client/static/js/{CsvGrid-wabx4e6w.js → CsvGrid-ppj80brw.js} +1 -1
- package/dist/client/static/js/{DocxView-22b3mhh5.js → DocxView-ef0bd2pg.js} +1 -1
- package/dist/client/static/js/{DrawioView-e02qhkp2.js → DrawioView-44tpkzbd.js} +1 -1
- package/dist/client/static/js/{HtmlPreview-q7hwcf4s.js → HtmlPreview-w654aykz.js} +1 -1
- package/dist/client/static/js/{ImageView-fxb60ge7.js → ImageView-kg0skt5s.js} +1 -1
- package/dist/client/static/js/{LayoutWrapper-cey5agsf.js → LayoutWrapper-qepkrtd8.js} +2 -2
- package/dist/client/static/js/MergeDiffView-n2h8vv0j.js +1 -0
- package/dist/client/static/js/{Modal-e4yq7p5f.js → Modal-8d299emm.js} +17 -17
- package/dist/client/static/js/{PdfView-pf3angsq.js → PdfView-eq7fnqa2.js} +1 -1
- package/dist/client/static/js/{SessionsView-mcvhpx0b.js → SessionsView-tedh2es3.js} +1 -1
- package/dist/client/static/js/{SheetView-5ha5vvsr.js → SheetView-5xm33kgk.js} +1 -1
- package/dist/client/static/js/{SvgPreview-45wqjw0b.js → SvgPreview-tp1m8r4t.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-gnf6krbs.js → abnfDiagram-O67JEVCF-xppr9jf1.js} +1 -1
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-00fd0wsg.js → architectureDiagram-NJMV4G6O-s23e6vtk.js} +1 -1
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-9c2sm96a.js → blockDiagram-BEXU5L5S-7ws8yq9e.js} +1 -1
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-pemygn0s.js → c4Diagram-YGBWAQC7-517yhfzj.js} +1 -1
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-h7r3sx3s.js → classDiagram-v2-NBCMYWYE-tcad3rst.js} +1 -1
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-krx9crwv.js → cose-bilkent-JH36ORCC-a76vf82p.js} +1 -1
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-5rp2btew.js → cynefinDiagram-VND7K2PF-9kety453.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-q57cnz52.js → dagre-6A5THRUB-6g6gsp6b.js} +1 -1
- package/dist/client/static/js/{diagram-22UHCM2B-0bptn06k.js → diagram-22UHCM2B-ngj4fyg3.js} +1 -1
- package/dist/client/static/js/{diagram-3UASUU5V-60snxawz.js → diagram-3UASUU5V-xw2m99qa.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-bb0kewfp.js → diagram-ATOU4E4O-hz3bd083.js} +2 -2
- package/dist/client/static/js/{diagram-CDSNMT55-3cdkns0z.js → diagram-CDSNMT55-vfhtemve.js} +3 -3
- package/dist/client/static/js/{diagram-MLGK6HIB-03mbhzeq.js → diagram-MLGK6HIB-22cjvj5g.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-bcvzqqf4.js → diagram-MPIPVDR6-xv8fsecp.js} +2 -2
- package/dist/client/static/js/{dockerfile-7kqkk4tz.js → dockerfile-491tyqmj.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-sg6kwnbx.js → ebnfDiagram-ZINNZB2B-m6mkn986.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-5b8v0sdv.js → elk-276RUBZZ-jccw706n.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-xbs156j5.js → erDiagram-OPXOYQCR-rxk86jsf.js} +1 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-aegwx04w.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-4p7pfk6c.js → ganttDiagram-FUAMR5RP-veweech7.js} +1 -1
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-3xqwr9pf.js → gitGraphDiagram-X574FWY7-7dyqcj8r.js} +2 -2
- package/dist/client/static/js/{index-p75b7phb.js → index-088gwjbz.js} +1 -1
- package/dist/client/static/js/{index-5qtnmn76.js → index-0ak5wdz1.js} +1 -1
- package/dist/client/static/js/{index-pak6t03c.js → index-0qmpqtp2.js} +1 -1
- package/dist/client/static/js/{index-26a4afcr.js → index-0xh8402w.js} +1 -1
- package/dist/client/static/js/{index-yf5a6t3p.js → index-2asa0faw.js} +1 -1
- package/dist/client/static/js/{index-gzz6snng.js → index-2cfw7wem.js} +1 -1
- package/dist/client/static/js/{index-e2esj214.js → index-39mr4tym.js} +1 -1
- package/dist/client/static/js/{index-hp3s5r3g.js → index-3x88fxzj.js} +1 -1
- package/dist/client/static/js/{index-trrmbq0h.js → index-4m94cbms.js} +1 -1
- package/dist/client/static/js/{index-rtpg4t84.js → index-5701gj1f.js} +1 -1
- package/dist/client/static/js/{index-pdkt3r4r.js → index-60fjqzdw.js} +1 -1
- package/dist/client/static/js/{index-mtjbp5ga.js → index-637my5h0.js} +1 -1
- package/dist/client/static/js/{index-c8ta3k4g.js → index-7ckzdf4r.js} +158 -156
- package/dist/client/static/js/{index-1d8ff4t7.js → index-7ehep28z.js} +2 -2
- package/dist/client/static/js/{index-hwq7zgqd.js → index-bfy437re.js} +1 -1
- package/dist/client/static/js/{index-zc3snsr9.js → index-bhst1c2x.js} +1 -1
- package/dist/client/static/js/{index-nnhs52db.js → index-cz80n8yc.js} +1 -1
- package/dist/client/static/js/{index-ayx3q8t9.js → index-d9dz0wt0.js} +1 -1
- package/dist/client/static/js/{index-3bmn5cc5.js → index-dg714jam.js} +1 -1
- package/dist/client/static/js/{index-z7gd7nvb.js → index-e6tjaccf.js} +1 -1
- package/dist/client/static/js/{index-vwxt5ss9.js → index-gsw1zh30.js} +1 -1
- package/dist/client/static/js/{index-x0y2c61e.js → index-j0qt8gaj.js} +1 -1
- package/dist/client/static/js/{index-45vcpqp9.js → index-kfcpkx7h.js} +1 -1
- package/dist/client/static/js/{index-cy6ceab8.js → index-na95tr1k.js} +1 -1
- package/dist/client/static/js/{index-ng3e6k6x.js → index-nzjc24v9.js} +1 -1
- package/dist/client/static/js/{index-3amzzsdk.js → index-pqmvhqmj.js} +11 -11
- package/dist/client/static/js/{index-0btbxkxf.js → index-r51fqzb5.js} +1 -1
- package/dist/client/static/js/{index-cj8v7b50.js → index-sx5x2q80.js} +1 -1
- package/dist/client/static/js/{index-qj9tcz44.js → index-tk1vr8q2.js} +1 -1
- package/dist/client/static/js/{index-j9t5xc3y.js → index-trpn9gxs.js} +1 -1
- package/dist/client/static/js/{index-1regq9wd.js → index-twjq786a.js} +1 -1
- package/dist/client/static/js/{index-xqkcx4az.js → index-wa234c7k.js} +1 -1
- package/dist/client/static/js/{index-mgs5nscx.js → index-wp7tsava.js} +1 -1
- package/dist/client/static/js/{index-nmhwjwmt.js → index-wvqwzgpx.js} +1 -1
- package/dist/client/static/js/{index-jg6ecfc7.js → index-xbvjpa60.js} +2 -2
- package/dist/client/static/js/{index-jf8zcg99.js → index-xm3691yp.js} +4 -4
- package/dist/client/static/js/{index-cysdvwqw.js → index-xq78fj64.js} +1 -1
- package/dist/client/static/js/{index-ryww3xxj.js → index-zjc8yfbe.js} +1 -1
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-c362sv3t.js → infoDiagram-VRGFBTTK-ksz9cvq3.js} +1 -1
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-yc8ts8wj.js → ishikawaDiagram-OU5B5YK6-g8symmrp.js} +1 -1
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-178c75fy.js → journeyDiagram-ZHPQQLJL-qs2e3hdf.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-w6g3n001.js → kanban-definition-PNTS6WVX-pzef80sz.js} +1 -1
- package/dist/client/static/js/{mermaid.core-vcdgn378.js → mermaid.core-chfcvkkc.js} +3 -3
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-t9e8arca.js → mindmap-definition-NLK3R4M7-sds2e243.js} +1 -1
- package/dist/client/static/js/one-dark-pro-5fvhpb1t.js +1 -0
- package/dist/client/static/js/one-light-pwj40vbr.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-nehn0x9n.js → pegDiagram-GJSIUBJH-m8199cy0.js} +1 -1
- package/dist/client/static/js/{pieDiagram-5QR66LMP-p1t3ctd4.js → pieDiagram-5QR66LMP-wqz5k5w6.js} +2 -2
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-614rtbfe.js → quadrantDiagram-O4NWA36T-rjszd8an.js} +1 -1
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-2vpr6pw8.js → railroadDiagram-XR7U4H2S-qv0be7dh.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-b91s5q3p.js → requirementDiagram-PLB6GJNP-b87kqbr7.js} +1 -1
- package/dist/client/static/js/{rust-jj206pb7.js → rust-m7ma3tq9.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-4101kt9r.js → sankeyDiagram-IPEJSGJF-dh5we479.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-yq0cxg8c.js → sequenceDiagram-PO4LG4MO-e6fg0x45.js} +1 -1
- package/dist/client/static/js/{sizeCapture-INFHLROL-jkvq39vz.js → sizeCapture-INFHLROL-mam6cagq.js} +1 -1
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-y0h7w5rw.js → stateDiagram-v2-GCMORJYK-htwar22v.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-1y073wzx.js → swimlanes-2SLR337P-5g26cnkr.js} +1 -1
- package/dist/client/static/js/{swimlanesDiagram-TC7HE7FX-8ahz3c68.js → swimlanesDiagram-TC7HE7FX-rseba3zs.js} +1 -1
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-yjb0g0ys.js → timeline-definition-EJHVYXUP-5km8n8mj.js} +1 -1
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-8xjkxrkv.js → usecaseDiagram-POWQR4AR-0vt6ms5g.js} +1 -1
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-18wjbwtg.js → vennDiagram-UO4OBE2U-k425105a.js} +2 -2
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-xqrfsrwp.js → wardleyDiagram-VNRHLVJA-s0gd4jg1.js} +2 -2
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-azygghkz.js → xychartDiagram-PMCCYNJV-2nrdzp7p.js} +2 -2
- package/package.json +5 -5
- package/src/client/App.tsx +4 -0
- package/src/client/bootstrap.d.ts +11 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/index.tsx +2 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/AgentAdmin.test.tsx +67 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/AgentAdmin.tsx +89 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Mcp.test.tsx +91 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Mcp.tsx +8 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.test.ts +9 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.tsx +16 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/WebSearch.test.tsx +59 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/WebSearch.tsx +11 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/agent-admin-rows.test.ts +119 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/agent-admin-rows.ts +174 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/task-rows.ts +14 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/card-header.test.ts +22 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/card-header.ts +14 -0
- package/src/client/data/settings/omp-schema.json +455 -165
- package/src/client/hooks/shell/last-opened-session.test.ts +166 -0
- package/src/client/hooks/shell/last-opened-session.ts +74 -0
- package/src/client/lib/router/open-session.test.ts +8 -0
- package/src/client/lib/router/open-session.ts +9 -4
- package/src/client/main.tsx +7 -0
- package/src/server/lib/db/schema.ts +10 -0
- package/src/server/lib/sessions/last-opened-client.server.ts +86 -0
- package/src/server/lib/sessions/last-opened-client.test.ts +91 -0
- package/src/server/lib/sessions/last-opened.server.test.ts +127 -0
- package/src/server/lib/sessions/last-opened.server.ts +129 -0
- package/src/server/plugins/ssr.ts +40 -17
- package/src/server/routes/fs/raw.test.ts +33 -0
- package/src/server/routes/fs/raw.ts +31 -11
- package/src/server/routes/sessions/index.ts +14 -0
- package/src/server/routes/sessions/last-opened.test.ts +139 -0
- package/src/server/routes/sessions/last-opened.ts +66 -0
- package/src/shared/lib/chat/timeline/tool-phrases.test.ts +4 -0
- package/src/shared/lib/chat/timeline/tool-phrases.ts +2 -0
- package/src/shared/lib/models/provider/glyph.test.ts +13 -11
- package/src/shared/lib/models/provider/glyph.ts +1 -0
- package/src/shared/lib/models/provider/label.ts +3 -0
- package/src/shared/lib/omp/config/schema-releases-19-3.test.ts +64 -0
- package/src/shared/lib/omp/config/schema-releases.test.ts +21 -4
- package/src/shared/lib/omp/session/wait-idle.test.ts +12 -2
- package/src/shared/lib/omp/session/wait-idle.ts +11 -6
- package/dist/client/static/js/MergeDiffView-1z9mwf73.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-sasgvf55.js +0 -1
- package/dist/client/static/js/one-dark-pro-17hh3q12.js +0 -1
- package/dist/client/static/js/one-light-cntgvscy.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{t,l,Yt,Y,C,te,ne,M,O,G,z,j,q,H,_o,nr,sl,Ae,
|
|
1
|
+
import{t,l,Yt,Y,C,te,ne,M,O,G,z,j,q,H,_o,nr,sl,Ae,ce,$g}from"./index-pqmvhqmj.js";import{Aa}from"./index-3x88fxzj.js";function Rt(e,i,s){e=+e,i=+i,s=(a=arguments.length)<2?(i=e,e=0,1):a<3?1:+s;var n=-1,a=Math.max(0,Math.ceil((i-e)/s))|0,h=Array(a);while(++n<a)h[n]=e+n*s;return h}function ct(){var e=nr().unknown(void 0),{domain:i,range:s}=e,n=0,a=1,h,c,x=!1,f=0,R=0,D=0.5;delete e.unknown;function _(){var y=i().length,V=a<n,L=V?a:n,E=V?n:a;if(h=(E-L)/Math.max(1,y-f+R*2),x)h=Math.floor(h);if(L+=(E-L-h*(y-f))*D,c=h*(1-f),x)L=Math.round(L),c=Math.round(c);var F=Rt(y).map(function(Z){return L+h*Z});return s(V?F.reverse():F)}return e.domain=function(y){return arguments.length?(i(y),_()):i()},e.range=function(y){return arguments.length?([n,a]=y,n=+n,a=+a,_()):[n,a]},e.rangeRound=function(y){return[n,a]=y,n=+n,a=+a,x=!0,_()},e.bandwidth=function(){return c},e.step=function(){return h},e.round=function(y){return arguments.length?(x=!!y,_()):x},e.padding=function(y){return arguments.length?(f=Math.min(1,R=+y),_()):f},e.paddingInner=function(y){return arguments.length?(f=Math.min(1,y),_()):f},e.paddingOuter=function(y){return arguments.length?(R=+y,_()):R},e.align=function(y){return arguments.length?(D=Math.max(0,Math.min(1,y)),_()):D},e.copy=function(){return ct(i(),[n,a]).round(x).paddingInner(f).paddingOuter(R).align(D)},_o.apply(_(),arguments)}var _t=function(){var e=t(function(U,r,g,d){for(g=g||{},d=U.length;d--;g[U[d]]=r);return g},"o"),i=[1,10,12,14,16,18,19,21,23],s=[2,6],n=[1,3],a=[1,5],h=[1,6],c=[1,7],x=[1,5,10,12,14,16,18,19,21,23,36,37,38],f=[1,25],R=[1,26],D=[1,28],_=[1,29],y=[1,30],V=[1,31],L=[1,32],E=[1,33],F=[1,34],Z=[1,35],tt=[1,36],w=[1,37],X=[1,43],u=[1,42],W=[1,47],N=[1,50],A=[1,10,12,14,16,18,19,21,23,36,37,38],it=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],I=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],rt=[1,65],v=[26,28],k={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:t(function(r,g,d,p,S,o,st){var m=o.length-1;switch(S){case 5:p.setOrientation(o[m]);break;case 9:p.setDiagramTitle(o[m].text.trim());break;case 12:p.setLineData({text:"",type:"text"},o[m]);break;case 13:p.setLineData(o[m-1],o[m]);break;case 14:p.setBarData({text:"",type:"text"},o[m]);break;case 15:p.setBarData(o[m-1],o[m]);break;case 16:this.$=o[m].trim(),p.setAccTitle(this.$);break;case 17:case 18:this.$=o[m].trim(),p.setAccDescription(this.$);break;case 19:this.$=o[m-1];break;case 20:case 30:this.$=[o[m-2],...o[m]];break;case 21:case 31:this.$=[o[m]];break;case 22:this.$={value:Number(o[m-1]),label:o[m]};break;case 23:this.$={value:Number(o[m]),label:""};break;case 24:p.setXAxisTitle(o[m]);break;case 25:p.setXAxisTitle(o[m-1]);break;case 26:p.setXAxisTitle({type:"text",text:""});break;case 27:p.setXAxisBand(o[m]);break;case 28:p.setXAxisRangeData(Number(o[m-2]),Number(o[m]));break;case 29:this.$=o[m-1];break;case 32:p.setYAxisTitle(o[m]);break;case 33:p.setYAxisTitle(o[m-1]);break;case 34:p.setYAxisTitle({type:"text",text:""});break;case 35:p.setYAxisRangeData(Number(o[m-2]),Number(o[m]));break;case 39:this.$={text:o[m],type:"text"};break;case 40:this.$={text:o[m],type:"text"};break;case 41:this.$={text:o[m],type:"markdown"};break;case 42:this.$=o[m];break;case 43:this.$=o[m-1]+""+o[m];break}},"anonymous"),table:[e(i,s,{3:1,4:2,7:4,5:n,36:a,37:h,38:c}),{1:[3]},e(i,s,{4:2,7:4,3:8,5:n,36:a,37:h,38:c}),e(i,s,{4:2,7:4,6:9,3:10,5:n,8:[1,11],36:a,37:h,38:c}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(x,[2,36]),e(x,[2,37]),e(x,[2,38]),{1:[2,1]},e(i,s,{4:2,7:4,3:21,5:n,36:a,37:h,38:c}),{1:[2,3]},e(x,[2,5]),e(i,[2,7],{4:22,36:a,37:h,38:c}),{11:23,30:f,39:24,40:R,41:27,42:D,43:_,44:y,45:V,46:L,47:E,48:F,49:Z,50:tt,51:w},{11:39,13:38,24:X,29:u,30:f,31:40,32:41,39:24,40:R,41:27,42:D,43:_,44:y,45:V,46:L,47:E,48:F,49:Z,50:tt,51:w},{11:45,15:44,29:W,30:f,35:46,39:24,40:R,41:27,42:D,43:_,44:y,45:V,46:L,47:E,48:F,49:Z,50:tt,51:w},{11:49,17:48,24:N,30:f,39:24,40:R,41:27,42:D,43:_,44:y,45:V,46:L,47:E,48:F,49:Z,50:tt,51:w},{11:52,17:51,24:N,30:f,39:24,40:R,41:27,42:D,43:_,44:y,45:V,46:L,47:E,48:F,49:Z,50:tt,51:w},{20:[1,53]},{22:[1,54]},e(A,[2,18]),{1:[2,2]},e(A,[2,8]),e(A,[2,9]),e(it,[2,39],{41:55,42:D,43:_,44:y,45:V,46:L,47:E,48:F,49:Z,50:tt,51:w}),e(it,[2,40]),e(it,[2,41]),e(I,[2,42]),e(I,[2,44]),e(I,[2,45]),e(I,[2,46]),e(I,[2,47]),e(I,[2,48]),e(I,[2,49]),e(I,[2,50]),e(I,[2,51]),e(I,[2,52]),e(I,[2,53]),e(A,[2,10]),e(A,[2,24],{32:41,31:56,24:X,29:u}),e(A,[2,26]),e(A,[2,27]),{33:[1,57]},{11:59,30:f,34:58,39:24,40:R,41:27,42:D,43:_,44:y,45:V,46:L,47:E,48:F,49:Z,50:tt,51:w},e(A,[2,11]),e(A,[2,32],{35:60,29:W}),e(A,[2,34]),{33:[1,61]},e(A,[2,12]),{17:62,24:N},{25:63,27:64,29:rt},e(A,[2,14]),{17:66,24:N},e(A,[2,16]),e(A,[2,17]),e(I,[2,43]),e(A,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(A,[2,33]),{29:[1,70]},e(A,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(v,[2,23],{30:[1,73]}),e(A,[2,15]),e(A,[2,28]),e(A,[2,29]),{11:59,30:f,34:74,39:24,40:R,41:27,42:D,43:_,44:y,45:V,46:L,47:E,48:F,49:Z,50:tt,51:w},e(A,[2,35]),e(A,[2,19]),{25:75,27:64,29:rt},e(v,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:t(function(r,g){if(g.recoverable)this.trace(r);else{var d=Error(r);throw d.hash=g,d}},"parseError"),parse:t(function(r){var g=this,d=[0],p=[],S=[null],o=[],st=this.table,m="",xt=0,Vt=0,Ft=0,de=2,Wt=1,xe=o.slice.call(arguments,1),P=Object.create(this.lexer),nt={yy:{}};for(var wt in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,wt))nt.yy[wt]=this.yy[wt];if(P.setInput(r,nt.yy),nt.yy.lexer=P,nt.yy.parser=this,typeof P.yylloc>"u")P.yylloc={};var kt=P.yylloc;o.push(kt);var fe=P.options&&P.options.ranges;if(typeof nt.yy.parseError==="function")this.parseError=nt.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function pe(K){d.length=d.length-2*K,S.length=S.length-K,o.length=o.length-K}t(pe,"popStack");function Xt(){var K=p.pop()||P.lex()||Wt;if(typeof K!=="number"){if(K instanceof Array)p=K,K=p.pop();K=g.symbols_[K]||K}return K}t(Xt,"lex");var B,At,at,Q,Be,Ct,ht={},ft,et,Nt,pt;while(!0){if(at=d[d.length-1],this.defaultActions[at])Q=this.defaultActions[at];else{if(B===null||typeof B>"u")B=Xt();Q=st[at]&&st[at][B]}if(typeof Q>"u"||!Q.length||!Q[0]){var St="";pt=[];for(ft in st[at])if(this.terminals_[ft]&&ft>de)pt.push("'"+this.terminals_[ft]+"'");if(P.showPosition)St="Parse error on line "+(xt+1)+`:
|
|
2
2
|
`+P.showPosition()+`
|
|
3
3
|
Expecting `+pt.join(", ")+", got '"+(this.terminals_[B]||B)+"'";else St="Parse error on line "+(xt+1)+": Unexpected "+(B==Wt?"end of input":"'"+(this.terminals_[B]||B)+"'");this.parseError(St,{text:P.match,token:this.terminals_[B]||B,line:P.yylineno,loc:kt,expected:pt})}if(Q[0]instanceof Array&&Q.length>1)throw Error("Parse Error: multiple actions possible at state: "+at+", token: "+B);switch(Q[0]){case 1:if(d.push(B),S.push(P.yytext),o.push(P.yylloc),d.push(Q[1]),B=null,!At){if(Vt=P.yyleng,m=P.yytext,xt=P.yylineno,kt=P.yylloc,Ft>0)Ft--}else B=At,At=null;break;case 2:if(et=this.productions_[Q[1]][1],ht.$=S[S.length-et],ht._$={first_line:o[o.length-(et||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(et||1)].first_column,last_column:o[o.length-1].last_column},fe)ht._$.range=[o[o.length-(et||1)].range[0],o[o.length-1].range[1]];if(Ct=this.performAction.apply(ht,[m,Vt,xt,nt.yy,Q[1],S,o].concat(xe)),typeof Ct<"u")return Ct;if(et)d=d.slice(0,-1*et*2),S=S.slice(0,-1*et),o=o.slice(0,-1*et);d.push(this.productions_[Q[1]][0]),S.push(ht.$),o.push(ht._$),Nt=st[d[d.length-2]][d[d.length-1]],d.push(Nt);break;case 3:return!0}}return!0},"parse")},J=function(){var U={EOF:1,parseError:t(function(g,d){if(this.yy.parser)this.yy.parser.parseError(g,d);else throw Error(g)},"parseError"),setInput:t(function(r,g){if(this.yy=g||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:t(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var g=r.match(/(?:\r\n?|\n).*/g);if(g)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),r},"input"),unput:t(function(r){var g=r.length,d=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var p=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),d.length-1)this.yylineno-=d.length-1;var S=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:d?(d.length===p.length?this.yylloc.first_column:0)+p[p.length-d.length].length-d[0].length:this.yylloc.first_column-g},this.options.ranges)this.yylloc.range=[S[0],S[0]+this.yyleng-g];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:t(function(r){this.unput(this.match.slice(r))},"less"),pastInput:t(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var r=this.match;if(r.length<20)r+=this._input.substr(0,20-r.length);return(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var r=this.pastInput(),g=Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
|
5
5
|
`+g+"^"},"showPosition"),test_match:t(function(r,g){var d,p,S;if(this.options.backtrack_lexer){if(S={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges)S.yylloc.range=this.yylloc.range.slice(0)}if(p=r[0].match(/(?:\r\n?|\n).*/g),p)this.yylineno+=p.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:p?p[p.length-1].length-p[p.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],d=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(d)return d;else if(this._backtrack){for(var o in S)this[o]=S[o];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var r,g,d,p;if(!this._more)this.yytext="",this.match="";var S=this._currentRules();for(var o=0;o<S.length;o++)if(d=this._input.match(this.rules[S[o]]),d&&(!g||d[0].length>g[0].length)){if(g=d,p=o,this.options.backtrack_lexer)if(r=this.test_match(d,S[o]),r!==!1)return r;else if(this._backtrack){g=!1;continue}else return!1;else if(!this.options.flex)break}if(g){if(r=this.test_match(g,S[p]),r!==!1)return r;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var g=this.next();if(g)return g;else return this.lex()},"lex"),begin:t(function(g){this.conditionStack.push(g)},"begin"),popState:t(function(){var g=this.conditionStack.length-1;if(g>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(g){if(g=this.conditionStack.length-1-Math.abs(g||0),g>=0)return this.conditionStack[g];else return"INITIAL"},"topState"),pushState:t(function(g){this.begin(g)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(g,d,p,S){var o=S;switch(p){case 0:break;case 1:break;case 2:return this.popState(),36;break;case 3:return this.popState(),36;break;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;break;case 8:return this.popState(),"acc_title_value";break;case 9:return this.pushState("acc_descr"),21;break;case 10:return this.popState(),"acc_descr_value";break;case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";break;case 18:return this.pushState("axis_data"),"Y_AXIS";break;case 19:return this.pushState("axis_band_data"),24;break;case 20:return 33;case 21:return this.pushState("data"),16;break;case 22:return this.pushState("data"),18;break;case 23:return this.pushState("data_inner"),24;break;case 24:return 29;case 25:return this.popState(),26;break;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return U}();k.lexer=J;function T(){this.yy={}}return t(T,"Parser"),T.prototype=k,k.Parser=T,new T}();_t.parser=_t;var me=_t;function mt(e){return e.type==="bar"}t(mt,"isBarPlot");function bt(e){return e.type==="band"}t(bt,"isBandAxisData");function lt(e){return e.type==="linear"}t(lt,"isLinearAxisData");var Pt=class{constructor(e){this.parentGroup=e}static{t(this,"TextDimensionCalculatorWithFont")}getMaxDimension(e,i){if(!this.parentGroup)return{width:e.reduce((a,h)=>Math.max(h.length,a),0)*i,height:i};let s={width:0,height:0},n=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(let a of e){let h=$g(n,1,a),c=h?h.width:a.length*i,x=h?h.height:i;s.width=Math.max(s.width,c),s.height=Math.max(s.height,x)}return n.remove(),s}},Ht=0.7,$t=0.2,Ut=class{constructor(e,i,s,n){this.axisConfig=e,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}static{t(this,"BaseAxis")}setRange(e){if(this.range=e,this.axisPosition==="left"||this.axisPosition==="right")this.boundingRect.height=e[1]-e[0];else this.boundingRect.width=e[1]-e[0];this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){let e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map((e)=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){if(Ht*this.getTickDistance()>this.outerPadding*2)this.outerPadding=Math.floor(Ht*this.getTickDistance()/2);this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let i=e.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth)i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0;if(this.axisConfig.showLabel){let s=this.getLabelDimension(),n=$t*e.width;this.outerPadding=Math.min(s.width/2,n);let a=s.height;if(this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0)a=Math.max(a,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*s.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*s.height));if(a+=this.axisConfig.labelPadding*2,this.labelTextHeight=s.height,a<=i)i-=a,this.showLabel=!0}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength)this.showTick=!0,i-=this.axisConfig.tickLength;if(this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;if(this.titleTextHeight=s.height,n<=i)i-=n,this.showTitle=!0}this.boundingRect.width=e.width,this.boundingRect.height=e.height-i}calculateSpaceIfDrawnVertical(e){let i=e.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth)i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0;if(this.axisConfig.showLabel){let s=this.getLabelDimension(),n=$t*e.height;this.outerPadding=Math.min(s.height/2,n);let a=s.width+this.axisConfig.labelPadding*2;if(a<=i)i-=a,this.showLabel=!0}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength)this.showTick=!0,i-=this.axisConfig.tickLength;if(this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;if(this.titleTextHeight=s.height,n<=i)i-=n,this.showTitle=!0}this.boundingRect.width=e.width-i,this.boundingRect.height=e.height}calculateSpace(e){if(this.axisPosition==="left"||this.axisPosition==="right")this.calculateSpaceIfDrawnVertical(e);else this.calculateSpaceIfDrawnHorizontally(e);return this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){let i=this.normalizedLabelRotationInRad;if(i===0)return 0;return Math.sin(i)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))});if(this.showTick){let i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${i},${this.getScaleValue(s)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(s)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElementsForBottomAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.getScaleValue(i)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))});if(this.showTick){let i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElementsForTopAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))});if(this.showTick){let i=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${this.getScaleValue(s)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(s)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");if(this.axisPosition==="bottom")return this.getDrawableElementsForBottomAxis();if(this.axisPosition==="top")return this.getDrawableElementsForTopAxis();return[]}},be=class extends Ut{static{t(this,"BandAxis")}constructor(e,i,s,n,a){super(e,n,a,i);this.categories=s,this.scale=ct().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=ct().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(0.5),l.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},ye=class extends Ut{static{t(this,"LinearAxis")}constructor(e,i,s,n,a){super(e,n,a,i);this.domain=s,this.scale=Aa().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let e=[...this.domain];if(this.axisPosition==="left")e.reverse();this.scale=Aa().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}};function Tt(e,i,s,n){let a=new Pt(n);if(bt(e))return new be(i,s,e.categories,e.title,a);return new ye(i,s,[e.min,e.max],e.title,a)}t(Tt,"getAxis");var we=class{constructor(e,i,s,n){this.textDimensionCalculator=e,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{t(this,"ChartTitle")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){let i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(i.width,e.width),n=i.height+2*this.chartConfig.titlePadding;if(i.width<=s&&i.height<=n&&this.chartConfig.showTitle&&this.chartData.title)this.boundingRect.width=s,this.boundingRect.height=n,this.showChartTitle=!0;return{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){let e=[];if(this.showChartTitle)e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]});return e}};function qt(e,i,s,n){let a=new Pt(n);return new we(a,e,i,s)}t(qt,"getChartTitleComponent");var ke=0.75,Ce=0.5,Se=0.35;function Dt(e){return{fontSize:e,markerSize:e*ke,markerSpacing:e*Se,itemSpacing:e*Ce}}t(Dt,"getLegendLayout");var Re=class{constructor(e,i,s,n){this.textDimensionCalculator=e,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.visiblePlots=[]}static{t(this,"ChartLegend")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){if(this.visiblePlots=this.chartConfig.showLegend?this.chartData.plots.filter((f)=>f.title):[],this.visiblePlots.length===0)return this.boundingRect.width=0,this.boundingRect.height=0,{width:0,height:0};let{fontSize:i,markerSize:s,markerSpacing:n,itemSpacing:a}=Dt(this.chartConfig.legendFontSize),h=this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map((f)=>f.title),i),c=this.chartConfig.legendPadding*2+s+n+h.width,x=this.chartConfig.legendPadding*2+this.visiblePlots.length*i+(this.visiblePlots.length-1)*a;if(c<=e.width&&x<=e.height)this.boundingRect.width=c,this.boundingRect.height=x;else this.visiblePlots=[],this.boundingRect.width=0,this.boundingRect.height=0;return{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(this.visiblePlots.length===0)return[];let{fontSize:e,markerSize:i,markerSpacing:s,itemSpacing:n}=Dt(this.chartConfig.legendFontSize),a=e+n,h=this.boundingRect.x+this.chartConfig.legendPadding,c=this.boundingRect.y+this.chartConfig.legendPadding,x=[],f=[];for(let[R,D]of this.visiblePlots.entries())if(mt(D))x.push({x:h,y:c+R*a,width:i,height:i,fill:D.fill,strokeFill:D.fill,strokeWidth:0});else{let _=c+R*a+i/2;f.push({path:`M ${h},${_} L ${h+i},${_}`,strokeFill:D.strokeFill,strokeWidth:D.strokeWidth})}return[{groupTexts:["legend","markers"],type:"rect",data:x},{groupTexts:["legend","markers"],type:"path",data:f},{groupTexts:["legend","label"],type:"text",data:this.visiblePlots.map((R,D)=>({text:R.title,x:h+i+s,y:c+D*a+i/2,fill:this.chartThemeConfig.legendTextColor,fontSize:e,rotation:0,verticalPos:"middle",horizontalPos:"left"}))}]}};function Gt(e,i,s,n){let a=new Pt(n);return new Re(a,e,i,s)}t(Gt,"getChartLegendComponent");var _e=class{constructor(e,i,s,n,a){this.plotData=e,this.xAxis=i,this.yAxis=s,this.orientation=n,this.plotIndex=a}static{t(this,"LinePlot")}getDrawableElement(){let e=this.plotData.data.map((n)=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]),i;if(this.orientation==="horizontal")i=sl().y((n)=>n[0]).x((n)=>n[1])(e);else i=sl().x((n)=>n[0]).y((n)=>n[1])(e);if(!i)return[];let s=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){let h=[];for(let[c,[x,f]]of e.entries()){let R=this.plotData.pointLabels[c];if(!R)continue;if(this.orientation==="horizontal")h.push({x:f+10,y:x,text:R,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0});else h.push({x,y:f-10,text:R,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0})}if(h.length>0)s.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:h})}return s}},Te=class{constructor(e,i,s,n,a,h){this.barData=e,this.boundingRect=i,this.xAxis=s,this.yAxis=n,this.orientation=a,this.plotIndex=h}static{t(this,"BarPlot")}getDrawableElement(){let e=this.barData.data.map((a)=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]),i=0.05,s=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*0.95,n=s/2;if(this.orientation==="horizontal")return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map((a)=>({x:this.boundingRect.x,y:a[0]-n,height:s,width:a[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}];return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map((a)=>({x:a[0]-n,y:a[1],width:s,height:this.boundingRect.y+this.boundingRect.height-a[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},De=class{constructor(e,i,s){this.chartConfig=e,this.chartData=i,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}static{t(this,"BasePlot")}setAxes(e,i){this.xAxis=e,this.yAxis=i}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");let e=[];for(let[i,s]of this.chartData.plots.entries())switch(s.type){case"line":{let n=new _e(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);e.push(...n.getDrawableElement())}break;case"bar":{let n=new Te(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);e.push(...n.getDrawableElement())}break}return e}};function jt(e,i,s){return new De(e,i,s)}t(jt,"getPlotComponent");var ve=class{constructor(e,i,s,n){this.chartConfig=e,this.chartData=i,this.componentStore={title:qt(e,i,s,n),plot:jt(e,i,s),legend:Gt(e,i,s,n),xAxis:Tt(i.xAxis,e.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},n),yAxis:Tt(i.yAxis,e.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},n)}}static{t(this,"Orchestrator")}calculateVerticalSpace(){let e=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,a={width:0,height:0},h=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),c=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),x=this.componentStore.plot.calculateSpace({width:h,height:c});if(e-=x.width,i-=x.height,x=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),n=x.height,i-=x.height,this.componentStore.xAxis.setAxisPosition("bottom"),x=this.componentStore.xAxis.calculateSpace({width:e,height:i}),i-=x.height,this.componentStore.yAxis.setAxisPosition("left"),x=this.componentStore.yAxis.calculateSpace({width:e,height:i}),s=x.width,e-=x.width,a=this.componentStore.legend.calculateSpace({width:e,height:c}),e-=a.width,e>0)h+=e,e=0;if(i>0)c+=i,i=0;if(this.componentStore.plot.calculateSpace({width:h,height:c}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.legend.setBoundingBoxXY({x:s+h,y:n+Math.max((c-a.height)/2,0)}),this.componentStore.xAxis.setRange([s,s+h]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:n+c}),this.componentStore.yAxis.setRange([n,n+c]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some((f)=>mt(f)))this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,a=0,h={width:0,height:0},c=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),x=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),f=this.componentStore.plot.calculateSpace({width:c,height:x});if(e-=f.width,i-=f.height,f=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=f.height,i-=f.height,this.componentStore.xAxis.setAxisPosition("left"),f=this.componentStore.xAxis.calculateSpace({width:e,height:i}),e-=f.width,n=f.width,this.componentStore.yAxis.setAxisPosition("top"),f=this.componentStore.yAxis.calculateSpace({width:e,height:i}),i-=f.height,a=s+f.height,h=this.componentStore.legend.calculateSpace({width:e,height:x}),e-=h.width,e>0)c+=e,e=0;if(i>0)x+=i,i=0;if(this.componentStore.plot.calculateSpace({width:c,height:x}),this.componentStore.plot.setBoundingBoxXY({x:n,y:a}),this.componentStore.legend.setBoundingBoxXY({x:n+c,y:a+Math.max((x-h.height)/2,0)}),this.componentStore.yAxis.setRange([n,n+c]),this.componentStore.yAxis.setBoundingBoxXY({x:n,y:s}),this.componentStore.xAxis.setRange([a,a+x]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some((R)=>mt(R)))this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){if(this.chartConfig.chartOrientation==="horizontal")this.calculateHorizontalSpace();else this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let i of Object.values(this.componentStore))e.push(...i.getDrawableElements());return e}},Pe=class{static{t(this,"XYChartBuilder")}static build(e,i,s,n){return new ve(e,i,s,n).getDrawableElement()}},gt=0,Qt,ut=It(),dt=Et(),b=Mt(),vt=dt.plotColorPalette.split(",").map((e)=>e.trim()),yt=!1,Lt=!1;function Et(){let e=Yt(),i=C();return le(e.xyChart,i.themeVariables.xyChart)}t(Et,"getChartDefaultThemeConfig");function It(){let e=C();return le(Y.xyChart,e.xyChart)}t(It,"getChartDefaultConfig");function Mt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}t(Mt,"getChartDefaultData");function ot(e){let i=C();return te(e.trim(),i)}t(ot,"textSanitizer");function Kt(e){Qt=e}t(Kt,"setTmpSVGG");function Zt(e){if(e==="horizontal")ut.chartOrientation="horizontal";else ut.chartOrientation="vertical"}t(Zt,"setOrientation");function Jt(e){b.xAxis.title=ot(e.text)}t(Jt,"setXAxisTitle");function Bt(e,i){b.xAxis={type:"linear",title:b.xAxis.title,min:e,max:i},yt=!0}t(Bt,"setXAxisRangeData");function ee(e){b.xAxis={type:"band",title:b.xAxis.title,categories:e.map((i)=>ot(i.text))},yt=!0}t(ee,"setXAxisBand");function ie(e){b.yAxis.title=ot(e.text)}t(ie,"setYAxisTitle");function se(e,i){b.yAxis={type:"linear",title:b.yAxis.title,min:e,max:i},Lt=!0}t(se,"setYAxisRangeData");function ae(e){let i=Math.min(...e),s=Math.max(...e),n=lt(b.yAxis)?b.yAxis.min:1/0,a=lt(b.yAxis)?b.yAxis.max:-1/0;b.yAxis={type:"linear",title:b.yAxis.title,min:Math.min(n,i),max:Math.max(a,s)}}t(ae,"setYAxisRangeFromPlotData");function zt(e){let i=[];if(e.length===0)return i;if(!yt){let s=lt(b.xAxis)?b.xAxis.min:1/0,n=lt(b.xAxis)?b.xAxis.max:-1/0;Bt(Math.min(s,1),Math.max(n,e.length))}if(bt(b.xAxis)&&e.length>b.xAxis.categories.length)e=e.slice(0,b.xAxis.categories.length);if(!Lt)ae(e);if(bt(b.xAxis))i=b.xAxis.categories.map((s,n)=>[s,e[n]]);if(lt(b.xAxis)){let s=b.xAxis.min,n=b.xAxis.max;if(e.length===1)i=[[`${s}`,e[0]]];else{let a=(n-s)/(e.length-1);i=e.map((h,c)=>[`${s+c*a}`,h])}}return i}t(zt,"transformDataWithoutCategory");function Ot(e){return vt[e===0?0:e%vt.length]}t(Ot,"getPlotColorFromPalette");function oe(e,i){let s=i.map((c)=>c.value),n=i.map((c)=>c.label?ot(c.label):""),a=zt(s),h=n.some((c)=>c!=="");b.plots.push({type:"line",title:ot(e.text),strokeFill:Ot(gt),strokeWidth:2,data:a,...h?{pointLabels:n}:{}}),gt++}t(oe,"setLineData");function re(e,i){let s=i.map((a)=>a.value),n=zt(s);b.plots.push({type:"bar",title:ot(e.text),fill:Ot(gt),data:n}),gt++}t(re,"setBarData");function he(){if(b.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return b.title=H(),Pe.build(ut,b,dt,Qt)}t(he,"getDrawableElem");function ce(){return dt}t(ce,"getChartThemeConfig");function ge(){return ut}t(ge,"getChartConfig");function ue(){return b}t(ue,"getXYChartData");var Le=t(function(){M(),gt=0,ut=It(),b=Mt(),dt=Et(),vt=dt.plotColorPalette.split(",").map((e)=>e.trim()),yt=!1,Lt=!1},"clear"),Ee={getDrawableElem:he,clear:Le,setAccTitle:O,getAccTitle:G,setDiagramTitle:q,getDiagramTitle:H,getAccDescription:j,setAccDescription:z,setOrientation:Zt,setXAxisTitle:Jt,setXAxisRangeData:Bt,setXAxisBand:ee,setYAxisTitle:ie,setYAxisRangeData:se,setLineData:oe,setBarData:re,setTmpSVGG:Kt,getChartThemeConfig:ce,getChartConfig:ge,getXYChartData:ue},Ie=t((e,i,s,n)=>{let a=n.db,h=a.getChartThemeConfig(),c=a.getChartConfig(),x=a.getXYChartData().plots[0].data.map((w)=>w[1]);function f(w){return w==="top"?"text-before-edge":"middle"}t(f,"getDominantBaseLine");function R(w){return w==="left"?"start":w==="right"?"end":"middle"}t(R,"getTextAnchor");function D(w){return`translate(${w.x}, ${w.y}) rotate(${w.rotation||0})`}t(D,"getTextTransformation"),l.debug(`Rendering xychart chart
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var g=this.next();if(g)return g;else return this.lex()},"lex"),begin:t(function(g){this.conditionStack.push(g)},"begin"),popState:t(function(){var g=this.conditionStack.length-1;if(g>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(g){if(g=this.conditionStack.length-1-Math.abs(g||0),g>=0)return this.conditionStack[g];else return"INITIAL"},"topState"),pushState:t(function(g){this.begin(g)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(g,d,p,S){var o=S;switch(p){case 0:break;case 1:break;case 2:return this.popState(),36;break;case 3:return this.popState(),36;break;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;break;case 8:return this.popState(),"acc_title_value";break;case 9:return this.pushState("acc_descr"),21;break;case 10:return this.popState(),"acc_descr_value";break;case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";break;case 18:return this.pushState("axis_data"),"Y_AXIS";break;case 19:return this.pushState("axis_band_data"),24;break;case 20:return 33;case 21:return this.pushState("data"),16;break;case 22:return this.pushState("data"),18;break;case 23:return this.pushState("data_inner"),24;break;case 24:return 29;case 25:return this.popState(),26;break;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return U}();k.lexer=J;function T(){this.yy={}}return t(T,"Parser"),T.prototype=k,k.Parser=T,new T}();_t.parser=_t;var me=_t;function mt(e){return e.type==="bar"}t(mt,"isBarPlot");function bt(e){return e.type==="band"}t(bt,"isBandAxisData");function lt(e){return e.type==="linear"}t(lt,"isLinearAxisData");var Pt=class{constructor(e){this.parentGroup=e}static{t(this,"TextDimensionCalculatorWithFont")}getMaxDimension(e,i){if(!this.parentGroup)return{width:e.reduce((a,h)=>Math.max(h.length,a),0)*i,height:i};let s={width:0,height:0},n=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(let a of e){let h=$g(n,1,a),c=h?h.width:a.length*i,x=h?h.height:i;s.width=Math.max(s.width,c),s.height=Math.max(s.height,x)}return n.remove(),s}},Ht=0.7,$t=0.2,Ut=class{constructor(e,i,s,n){this.axisConfig=e,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}static{t(this,"BaseAxis")}setRange(e){if(this.range=e,this.axisPosition==="left"||this.axisPosition==="right")this.boundingRect.height=e[1]-e[0];else this.boundingRect.width=e[1]-e[0];this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){let e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map((e)=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){if(Ht*this.getTickDistance()>this.outerPadding*2)this.outerPadding=Math.floor(Ht*this.getTickDistance()/2);this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let i=e.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth)i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0;if(this.axisConfig.showLabel){let s=this.getLabelDimension(),n=$t*e.width;this.outerPadding=Math.min(s.width/2,n);let a=s.height;if(this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0)a=Math.max(a,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*s.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*s.height));if(a+=this.axisConfig.labelPadding*2,this.labelTextHeight=s.height,a<=i)i-=a,this.showLabel=!0}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength)this.showTick=!0,i-=this.axisConfig.tickLength;if(this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;if(this.titleTextHeight=s.height,n<=i)i-=n,this.showTitle=!0}this.boundingRect.width=e.width,this.boundingRect.height=e.height-i}calculateSpaceIfDrawnVertical(e){let i=e.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth)i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0;if(this.axisConfig.showLabel){let s=this.getLabelDimension(),n=$t*e.height;this.outerPadding=Math.min(s.height/2,n);let a=s.width+this.axisConfig.labelPadding*2;if(a<=i)i-=a,this.showLabel=!0}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength)this.showTick=!0,i-=this.axisConfig.tickLength;if(this.axisConfig.showTitle&&this.title){let s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;if(this.titleTextHeight=s.height,n<=i)i-=n,this.showTitle=!0}this.boundingRect.width=e.width-i,this.boundingRect.height=e.height}calculateSpace(e){if(this.axisPosition==="left"||this.axisPosition==="right")this.calculateSpaceIfDrawnVertical(e);else this.calculateSpaceIfDrawnHorizontally(e);return this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){let i=this.normalizedLabelRotationInRad;if(i===0)return 0;return Math.sin(i)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))});if(this.showTick){let i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${i},${this.getScaleValue(s)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(s)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElementsForBottomAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.getScaleValue(i)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))});if(this.showTick){let i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElementsForTopAxis(){let e=[];if(this.showAxisLine){let i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel)e.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map((i)=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))});if(this.showTick){let i=this.boundingRect.y;e.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map((s)=>({path:`M ${this.getScaleValue(s)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(s)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}if(this.showTitle)e.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]});return e}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");if(this.axisPosition==="bottom")return this.getDrawableElementsForBottomAxis();if(this.axisPosition==="top")return this.getDrawableElementsForTopAxis();return[]}},be=class extends Ut{static{t(this,"BandAxis")}constructor(e,i,s,n,a){super(e,n,a,i);this.categories=s,this.scale=ct().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=ct().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(0.5),l.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},ye=class extends Ut{static{t(this,"LinearAxis")}constructor(e,i,s,n,a){super(e,n,a,i);this.domain=s,this.scale=Aa().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let e=[...this.domain];if(this.axisPosition==="left")e.reverse();this.scale=Aa().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}};function Tt(e,i,s,n){let a=new Pt(n);if(bt(e))return new be(i,s,e.categories,e.title,a);return new ye(i,s,[e.min,e.max],e.title,a)}t(Tt,"getAxis");var we=class{constructor(e,i,s,n){this.textDimensionCalculator=e,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{t(this,"ChartTitle")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){let i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(i.width,e.width),n=i.height+2*this.chartConfig.titlePadding;if(i.width<=s&&i.height<=n&&this.chartConfig.showTitle&&this.chartData.title)this.boundingRect.width=s,this.boundingRect.height=n,this.showChartTitle=!0;return{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){let e=[];if(this.showChartTitle)e.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]});return e}};function qt(e,i,s,n){let a=new Pt(n);return new we(a,e,i,s)}t(qt,"getChartTitleComponent");var ke=0.75,Ce=0.5,Se=0.35;function Dt(e){return{fontSize:e,markerSize:e*ke,markerSpacing:e*Se,itemSpacing:e*Ce}}t(Dt,"getLegendLayout");var Re=class{constructor(e,i,s,n){this.textDimensionCalculator=e,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.visiblePlots=[]}static{t(this,"ChartLegend")}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){if(this.visiblePlots=this.chartConfig.showLegend?this.chartData.plots.filter((f)=>f.title):[],this.visiblePlots.length===0)return this.boundingRect.width=0,this.boundingRect.height=0,{width:0,height:0};let{fontSize:i,markerSize:s,markerSpacing:n,itemSpacing:a}=Dt(this.chartConfig.legendFontSize),h=this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map((f)=>f.title),i),c=this.chartConfig.legendPadding*2+s+n+h.width,x=this.chartConfig.legendPadding*2+this.visiblePlots.length*i+(this.visiblePlots.length-1)*a;if(c<=e.width&&x<=e.height)this.boundingRect.width=c,this.boundingRect.height=x;else this.visiblePlots=[],this.boundingRect.width=0,this.boundingRect.height=0;return{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(this.visiblePlots.length===0)return[];let{fontSize:e,markerSize:i,markerSpacing:s,itemSpacing:n}=Dt(this.chartConfig.legendFontSize),a=e+n,h=this.boundingRect.x+this.chartConfig.legendPadding,c=this.boundingRect.y+this.chartConfig.legendPadding,x=[],f=[];for(let[R,D]of this.visiblePlots.entries())if(mt(D))x.push({x:h,y:c+R*a,width:i,height:i,fill:D.fill,strokeFill:D.fill,strokeWidth:0});else{let _=c+R*a+i/2;f.push({path:`M ${h},${_} L ${h+i},${_}`,strokeFill:D.strokeFill,strokeWidth:D.strokeWidth})}return[{groupTexts:["legend","markers"],type:"rect",data:x},{groupTexts:["legend","markers"],type:"path",data:f},{groupTexts:["legend","label"],type:"text",data:this.visiblePlots.map((R,D)=>({text:R.title,x:h+i+s,y:c+D*a+i/2,fill:this.chartThemeConfig.legendTextColor,fontSize:e,rotation:0,verticalPos:"middle",horizontalPos:"left"}))}]}};function Gt(e,i,s,n){let a=new Pt(n);return new Re(a,e,i,s)}t(Gt,"getChartLegendComponent");var _e=class{constructor(e,i,s,n,a){this.plotData=e,this.xAxis=i,this.yAxis=s,this.orientation=n,this.plotIndex=a}static{t(this,"LinePlot")}getDrawableElement(){let e=this.plotData.data.map((n)=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]),i;if(this.orientation==="horizontal")i=sl().y((n)=>n[0]).x((n)=>n[1])(e);else i=sl().x((n)=>n[0]).y((n)=>n[1])(e);if(!i)return[];let s=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){let h=[];for(let[c,[x,f]]of e.entries()){let R=this.plotData.pointLabels[c];if(!R)continue;if(this.orientation==="horizontal")h.push({x:f+10,y:x,text:R,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0});else h.push({x,y:f-10,text:R,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0})}if(h.length>0)s.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:h})}return s}},Te=class{constructor(e,i,s,n,a,h){this.barData=e,this.boundingRect=i,this.xAxis=s,this.yAxis=n,this.orientation=a,this.plotIndex=h}static{t(this,"BarPlot")}getDrawableElement(){let e=this.barData.data.map((a)=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]),i=0.05,s=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*0.95,n=s/2;if(this.orientation==="horizontal")return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map((a)=>({x:this.boundingRect.x,y:a[0]-n,height:s,width:a[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}];return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:e.map((a)=>({x:a[0]-n,y:a[1],width:s,height:this.boundingRect.y+this.boundingRect.height-a[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},De=class{constructor(e,i,s){this.chartConfig=e,this.chartData=i,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}static{t(this,"BasePlot")}setAxes(e,i){this.xAxis=e,this.yAxis=i}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");let e=[];for(let[i,s]of this.chartData.plots.entries())switch(s.type){case"line":{let n=new _e(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);e.push(...n.getDrawableElement())}break;case"bar":{let n=new Te(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);e.push(...n.getDrawableElement())}break}return e}};function jt(e,i,s){return new De(e,i,s)}t(jt,"getPlotComponent");var ve=class{constructor(e,i,s,n){this.chartConfig=e,this.chartData=i,this.componentStore={title:qt(e,i,s,n),plot:jt(e,i,s),legend:Gt(e,i,s,n),xAxis:Tt(i.xAxis,e.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},n),yAxis:Tt(i.yAxis,e.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},n)}}static{t(this,"Orchestrator")}calculateVerticalSpace(){let e=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,a={width:0,height:0},h=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),c=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),x=this.componentStore.plot.calculateSpace({width:h,height:c});if(e-=x.width,i-=x.height,x=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),n=x.height,i-=x.height,this.componentStore.xAxis.setAxisPosition("bottom"),x=this.componentStore.xAxis.calculateSpace({width:e,height:i}),i-=x.height,this.componentStore.yAxis.setAxisPosition("left"),x=this.componentStore.yAxis.calculateSpace({width:e,height:i}),s=x.width,e-=x.width,a=this.componentStore.legend.calculateSpace({width:e,height:c}),e-=a.width,e>0)h+=e,e=0;if(i>0)c+=i,i=0;if(this.componentStore.plot.calculateSpace({width:h,height:c}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.legend.setBoundingBoxXY({x:s+h,y:n+Math.max((c-a.height)/2,0)}),this.componentStore.xAxis.setRange([s,s+h]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:n+c}),this.componentStore.yAxis.setRange([n,n+c]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some((f)=>mt(f)))this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,a=0,h={width:0,height:0},c=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),x=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),f=this.componentStore.plot.calculateSpace({width:c,height:x});if(e-=f.width,i-=f.height,f=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=f.height,i-=f.height,this.componentStore.xAxis.setAxisPosition("left"),f=this.componentStore.xAxis.calculateSpace({width:e,height:i}),e-=f.width,n=f.width,this.componentStore.yAxis.setAxisPosition("top"),f=this.componentStore.yAxis.calculateSpace({width:e,height:i}),i-=f.height,a=s+f.height,h=this.componentStore.legend.calculateSpace({width:e,height:x}),e-=h.width,e>0)c+=e,e=0;if(i>0)x+=i,i=0;if(this.componentStore.plot.calculateSpace({width:c,height:x}),this.componentStore.plot.setBoundingBoxXY({x:n,y:a}),this.componentStore.legend.setBoundingBoxXY({x:n+c,y:a+Math.max((x-h.height)/2,0)}),this.componentStore.yAxis.setRange([n,n+c]),this.componentStore.yAxis.setBoundingBoxXY({x:n,y:s}),this.componentStore.xAxis.setRange([a,a+x]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some((R)=>mt(R)))this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){if(this.chartConfig.chartOrientation==="horizontal")this.calculateHorizontalSpace();else this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let i of Object.values(this.componentStore))e.push(...i.getDrawableElements());return e}},Pe=class{static{t(this,"XYChartBuilder")}static build(e,i,s,n){return new ve(e,i,s,n).getDrawableElement()}},gt=0,Qt,ut=It(),dt=Et(),b=Mt(),vt=dt.plotColorPalette.split(",").map((e)=>e.trim()),yt=!1,Lt=!1;function Et(){let e=Yt(),i=C();return ce(e.xyChart,i.themeVariables.xyChart)}t(Et,"getChartDefaultThemeConfig");function It(){let e=C();return ce(Y.xyChart,e.xyChart)}t(It,"getChartDefaultConfig");function Mt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}t(Mt,"getChartDefaultData");function ot(e){let i=C();return te(e.trim(),i)}t(ot,"textSanitizer");function Kt(e){Qt=e}t(Kt,"setTmpSVGG");function Zt(e){if(e==="horizontal")ut.chartOrientation="horizontal";else ut.chartOrientation="vertical"}t(Zt,"setOrientation");function Jt(e){b.xAxis.title=ot(e.text)}t(Jt,"setXAxisTitle");function Bt(e,i){b.xAxis={type:"linear",title:b.xAxis.title,min:e,max:i},yt=!0}t(Bt,"setXAxisRangeData");function ee(e){b.xAxis={type:"band",title:b.xAxis.title,categories:e.map((i)=>ot(i.text))},yt=!0}t(ee,"setXAxisBand");function ie(e){b.yAxis.title=ot(e.text)}t(ie,"setYAxisTitle");function se(e,i){b.yAxis={type:"linear",title:b.yAxis.title,min:e,max:i},Lt=!0}t(se,"setYAxisRangeData");function ae(e){let i=Math.min(...e),s=Math.max(...e),n=lt(b.yAxis)?b.yAxis.min:1/0,a=lt(b.yAxis)?b.yAxis.max:-1/0;b.yAxis={type:"linear",title:b.yAxis.title,min:Math.min(n,i),max:Math.max(a,s)}}t(ae,"setYAxisRangeFromPlotData");function zt(e){let i=[];if(e.length===0)return i;if(!yt){let s=lt(b.xAxis)?b.xAxis.min:1/0,n=lt(b.xAxis)?b.xAxis.max:-1/0;Bt(Math.min(s,1),Math.max(n,e.length))}if(bt(b.xAxis)&&e.length>b.xAxis.categories.length)e=e.slice(0,b.xAxis.categories.length);if(!Lt)ae(e);if(bt(b.xAxis))i=b.xAxis.categories.map((s,n)=>[s,e[n]]);if(lt(b.xAxis)){let s=b.xAxis.min,n=b.xAxis.max;if(e.length===1)i=[[`${s}`,e[0]]];else{let a=(n-s)/(e.length-1);i=e.map((h,c)=>[`${s+c*a}`,h])}}return i}t(zt,"transformDataWithoutCategory");function Ot(e){return vt[e===0?0:e%vt.length]}t(Ot,"getPlotColorFromPalette");function oe(e,i){let s=i.map((c)=>c.value),n=i.map((c)=>c.label?ot(c.label):""),a=zt(s),h=n.some((c)=>c!=="");b.plots.push({type:"line",title:ot(e.text),strokeFill:Ot(gt),strokeWidth:2,data:a,...h?{pointLabels:n}:{}}),gt++}t(oe,"setLineData");function re(e,i){let s=i.map((a)=>a.value),n=zt(s);b.plots.push({type:"bar",title:ot(e.text),fill:Ot(gt),data:n}),gt++}t(re,"setBarData");function he(){if(b.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return b.title=H(),Pe.build(ut,b,dt,Qt)}t(he,"getDrawableElem");function le(){return dt}t(le,"getChartThemeConfig");function ge(){return ut}t(ge,"getChartConfig");function ue(){return b}t(ue,"getXYChartData");var Le=t(function(){M(),gt=0,ut=It(),b=Mt(),dt=Et(),vt=dt.plotColorPalette.split(",").map((e)=>e.trim()),yt=!1,Lt=!1},"clear"),Ee={getDrawableElem:he,clear:Le,setAccTitle:O,getAccTitle:G,setDiagramTitle:q,getDiagramTitle:H,getAccDescription:j,setAccDescription:z,setOrientation:Zt,setXAxisTitle:Jt,setXAxisRangeData:Bt,setXAxisBand:ee,setYAxisTitle:ie,setYAxisRangeData:se,setLineData:oe,setBarData:re,setTmpSVGG:Kt,getChartThemeConfig:le,getChartConfig:ge,getXYChartData:ue},Ie=t((e,i,s,n)=>{let a=n.db,h=a.getChartThemeConfig(),c=a.getChartConfig(),x=a.getXYChartData().plots[0].data.map((w)=>w[1]);function f(w){return w==="top"?"text-before-edge":"middle"}t(f,"getDominantBaseLine");function R(w){return w==="left"?"start":w==="right"?"end":"middle"}t(R,"getTextAnchor");function D(w){return`translate(${w.x}, ${w.y}) rotate(${w.rotation||0})`}t(D,"getTextTransformation"),l.debug(`Rendering xychart chart
|
|
7
7
|
`+e);let _=Ae(i),y=_.append("g").attr("class","main"),V=y.append("rect").attr("width",c.width).attr("height",c.height).attr("class","background");ne(_,c.height,c.width,!0),_.attr("viewBox",`0 0 ${c.width} ${c.height}`),V.attr("fill",h.backgroundColor),a.setTmpSVGG(_.append("g").attr("class","mermaid-tmp-group"));let L=a.getDrawableElem(),E={};function F(w){let X=y,u="";for(let[W]of w.entries()){let N=y;if(W>0&&E[u])N=E[u];if(u+=w[W],X=E[u],!X)X=E[u]=N.append("g").attr("class",w[W])}return X}t(F,"getGroup");for(let w of L){if(w.data.length===0)continue;let X=F(w.groupTexts);switch(w.type){case"rect":if(X.selectAll("rect").data(w.data).enter().append("rect").attr("x",(u)=>u.x).attr("y",(u)=>u.y).attr("width",(u)=>u.width).attr("height",(u)=>u.height).attr("fill",(u)=>u.fill).attr("stroke",(u)=>u.strokeFill).attr("stroke-width",(u)=>u.strokeWidth),c.showDataLabel){let u=c.showDataLabelOutsideBar;if(c.chartOrientation==="horizontal"){let W=function(k,J){let{data:T,label:U}=k;return J*U.length*N<=T.width-A};var Z=W;t(W,"fitsHorizontally");let N=0.7,A=10,it=w.data.map((k,J)=>({data:k,label:x[J].toString()})).filter((k)=>k.data.width>0&&k.data.height>0),I=it.map((k)=>{let{data:J}=k,T=J.height*0.7;while(!W(k,T)&&T>0)T-=1;return T}),rt=Math.floor(Math.min(...I)),v=t((k)=>{if(u)return k.data.x+k.data.width+A;else return k.data.x+k.data.width-A},"determineLabelXPosition");X.selectAll("text").data(it).enter().append("text").attr("x",v).attr("y",(k)=>k.data.y+k.data.height/2).attr("text-anchor",u?"start":"end").attr("dominant-baseline","middle").attr("fill",h.dataLabelColor).attr("font-size",`${rt}px`).text((k)=>k.label)}else{let W=function(v,k,J){let{data:T,label:U}=v,r=0.7,g=k*U.length*0.7,d=T.x+T.width/2,p=d-g/2,S=d+g/2,o=p>=T.x&&S<=T.x+T.width,st=T.y+J+k<=T.y+T.height;return o&&st};var tt=W;t(W,"fitsInBar");let N=10,A=w.data.map((v,k)=>({data:v,label:x[k].toString()})).filter((v)=>v.data.width>0&&v.data.height>0),it=A.map((v)=>{let{data:k,label:J}=v,T=k.width/(J.length*0.7);while(!W(v,T,N)&&T>0)T-=1;return T}),I=Math.floor(Math.min(...it)),rt=t((v)=>{if(u)return v.data.y-N;else return v.data.y+N},"determineLabelYPosition");X.selectAll("text").data(A).enter().append("text").attr("x",(v)=>v.data.x+v.data.width/2).attr("y",rt).attr("text-anchor","middle").attr("dominant-baseline",u?"auto":"hanging").attr("fill",h.dataLabelColor).attr("font-size",`${I}px`).text((v)=>v.label)}}break;case"text":X.selectAll("text").data(w.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",(u)=>u.fill).attr("font-size",(u)=>u.fontSize).attr("dominant-baseline",(u)=>f(u.verticalPos)).attr("text-anchor",(u)=>R(u.horizontalPos)).attr("transform",(u)=>D(u)).text((u)=>u.text);break;case"path":X.selectAll("path").data(w.data).enter().append("path").attr("d",(u)=>u.path).attr("fill",(u)=>u.fill?u.fill:"none").attr("stroke",(u)=>u.strokeFill).attr("stroke-width",(u)=>u.strokeWidth);break}}},"draw"),Me={draw:Ie},Ke={parser:me,db:Ee,renderer:Me};export{Ke as diagram};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kabmo-labs/kabmo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.55.0",
|
|
4
4
|
"description": "Web console and diagnostic workbench for AI coding agents: Elysia + Preact on Bun.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Wijanarko Putra Rajeb <wijanarko.rajeb@gmail.com>",
|
|
@@ -104,11 +104,11 @@
|
|
|
104
104
|
"tailwindcss": "^4.1.14",
|
|
105
105
|
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz",
|
|
106
106
|
"yaml": "^2.9.1",
|
|
107
|
-
"@kabmo-labs/kabmo-acp": "1.0.
|
|
107
|
+
"@kabmo-labs/kabmo-acp": "1.0.1",
|
|
108
108
|
"@kabmo-labs/kabmo-app-contracts": "1.0.0",
|
|
109
109
|
"@kabmo-labs/kabmo-auth": "1.0.0",
|
|
110
110
|
"@kabmo-labs/kabmo-bytes": "1.0.0",
|
|
111
|
-
"@kabmo-labs/kabmo-chat": "1.0.
|
|
111
|
+
"@kabmo-labs/kabmo-chat": "1.0.1",
|
|
112
112
|
"@kabmo-labs/kabmo-db": "1.0.0",
|
|
113
113
|
"@kabmo-labs/kabmo-format": "1.0.0",
|
|
114
114
|
"@kabmo-labs/kabmo-fs": "1.0.0",
|
|
@@ -120,11 +120,11 @@
|
|
|
120
120
|
"@kabmo-labs/kabmo-live-sessions": "1.0.0",
|
|
121
121
|
"@kabmo-labs/kabmo-mcp-contracts": "1.0.0",
|
|
122
122
|
"@kabmo-labs/kabmo-model-contracts": "1.0.0",
|
|
123
|
-
"@kabmo-labs/kabmo-omp": "1.
|
|
123
|
+
"@kabmo-labs/kabmo-omp": "1.1.0",
|
|
124
124
|
"@kabmo-labs/kabmo-paths": "1.0.0",
|
|
125
125
|
"@kabmo-labs/kabmo-platform": "1.0.0",
|
|
126
126
|
"@kabmo-labs/kabmo-process": "1.0.0",
|
|
127
|
-
"@kabmo-labs/kabmo-provider-contracts": "1.
|
|
127
|
+
"@kabmo-labs/kabmo-provider-contracts": "1.1.0",
|
|
128
128
|
"@kabmo-labs/kabmo-realtime-signals": "1.0.0",
|
|
129
129
|
"@kabmo-labs/kabmo-refresh-cadence": "1.0.0",
|
|
130
130
|
"@kabmo-labs/kabmo-rpc-lines": "1.0.0",
|
package/src/client/App.tsx
CHANGED
|
@@ -21,6 +21,7 @@ import { CommandPalette } from '@/client/components/common/command-palette';
|
|
|
21
21
|
import { ChordHint } from '@/client/components/common/command-palette/ChordHint';
|
|
22
22
|
import { KeyBindingCheatsheet } from '@/client/components/common/key-binding-cheatsheet';
|
|
23
23
|
import { closeKeyBindingHelp } from '@/client/lib/commands/overlays';
|
|
24
|
+
import { useSessionOpenRecorder } from '@/client/hooks/shell/last-opened-session';
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
27
|
* The mobile and desktop layouts are mutually exclusive screen trees — exactly
|
|
@@ -60,6 +61,9 @@ export function App({ initialIsMobile = false, production = false, appSettings =
|
|
|
60
61
|
useCommandRuntime();
|
|
61
62
|
usePluginCommands();
|
|
62
63
|
const overlays = useOverlays();
|
|
64
|
+
// What a native shell restores on its next launch. One call per page: an
|
|
65
|
+
// unauthenticated screen has no session to record.
|
|
66
|
+
useSessionOpenRecorder(authState !== 'required');
|
|
63
67
|
|
|
64
68
|
// Initialize with server-detected User-Agent to eliminate SSR flash. The
|
|
65
69
|
// device decides the layout on every load — the manual switch below is
|
|
@@ -50,6 +50,17 @@ export interface KabmoBootstrap {
|
|
|
50
50
|
* tell them from a desktop where an APK is useless.
|
|
51
51
|
*/
|
|
52
52
|
isAndroid?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* The session this install opened last, when it still exists.
|
|
55
|
+
*
|
|
56
|
+
* Keyed by the request's `kabmo_client` cookie, so a phone and a desktop
|
|
57
|
+
* pointed at one console keep separate pointers. The native shells load the
|
|
58
|
+
* console with no query, so this is what lets a cold start select the previous
|
|
59
|
+
* chat in its FIRST render instead of painting the empty workspace and
|
|
60
|
+
* navigating afterwards. A browser ignores it (its landing stays), and an
|
|
61
|
+
* unauthenticated request carries `null`.
|
|
62
|
+
*/
|
|
63
|
+
lastOpenedSessionId?: string | null;
|
|
53
64
|
}
|
|
54
65
|
|
|
55
66
|
declare global {
|
|
@@ -34,6 +34,7 @@ import { Resolve } from '@/client/components/workspace/chat-timeline/tool-render
|
|
|
34
34
|
import { ManageSkill } from '@/client/components/workspace/chat-timeline/tool-renderers/panels/ManageSkill';
|
|
35
35
|
import { SearchFs } from '@/client/components/workspace/chat-timeline/tool-renderers/panels/SearchFs';
|
|
36
36
|
import { AskPanel } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel';
|
|
37
|
+
import { AgentAdmin } from '@/client/components/workspace/chat-timeline/tool-renderers/panels/AgentAdmin';
|
|
37
38
|
import { Think } from '@/client/components/workspace/chat-timeline/tool-renderers/panels/Think';
|
|
38
39
|
import { Read } from '@/client/components/workspace/chat-timeline/tool-renderers/panels/Read';
|
|
39
40
|
import { Edit } from '@/client/components/workspace/chat-timeline/tool-renderers/panels/Edit';
|
|
@@ -77,6 +78,7 @@ const PANELS: Record<ToolPanelKind, (props: { tool: ToolCallData }) => ReactNode
|
|
|
77
78
|
think: Think,
|
|
78
79
|
mcp: Mcp,
|
|
79
80
|
wait: Wait,
|
|
81
|
+
agent_admin: AgentAdmin,
|
|
80
82
|
};
|
|
81
83
|
|
|
82
84
|
/** File a tool call targets: explicit `target`, result details, its arguments
|
package/src/client/components/workspace/chat-timeline/tool-renderers/panels/AgentAdmin.test.tsx
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The agent-control card, mounted with the arguments measured on `agy acp`
|
|
8
|
+
* 1.5.3. The helper's own suite pins the normalization; this one proves the
|
|
9
|
+
* card actually paints it (the body is the only surface these calls have).
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, test } from 'bun:test';
|
|
13
|
+
import { Window } from 'happy-dom';
|
|
14
|
+
import { h, render } from 'preact';
|
|
15
|
+
import { act } from 'preact/test-utils';
|
|
16
|
+
import { AgentAdmin } from '@/client/components/workspace/chat-timeline/tool-renderers/panels/AgentAdmin';
|
|
17
|
+
import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
|
|
18
|
+
import type { ToolCallData } from '@kabmo-labs/kabmo-chat/contracts/chat';
|
|
19
|
+
|
|
20
|
+
let container: HTMLElement;
|
|
21
|
+
|
|
22
|
+
beforeAll(() => installDomGlobals(new Window()));
|
|
23
|
+
afterAll(() => restoreDomGlobals());
|
|
24
|
+
beforeEach(() => {
|
|
25
|
+
container = document.createElement('div');
|
|
26
|
+
document.body.appendChild(container);
|
|
27
|
+
});
|
|
28
|
+
afterEach(() => {
|
|
29
|
+
render(null, container);
|
|
30
|
+
container.remove();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
function paint(tool: ToolCallData): string {
|
|
34
|
+
act(() => { render(h(AgentAdmin, { tool }), container); });
|
|
35
|
+
return container.textContent ?? '';
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function agentTool(partial: Partial<ToolCallData> & Pick<ToolCallData, 'name'>): ToolCallData {
|
|
39
|
+
return { id: 'a1', type: 'other', title: `Run ${partial.name}`, status: 'success', ...partial } as ToolCallData;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
describe('AgentAdmin panel', () => {
|
|
43
|
+
test('draws a background-task call and says the result is missing', () => {
|
|
44
|
+
const text = paint(agentTool({
|
|
45
|
+
name: 'manage_task',
|
|
46
|
+
input: { Action: 'kill', TaskId: '8b46…/task-23' },
|
|
47
|
+
}));
|
|
48
|
+
expect(text).toContain('Background task');
|
|
49
|
+
expect(text).toContain('kill');
|
|
50
|
+
expect(text).toContain('Task id');
|
|
51
|
+
expect(text).toContain('8b46…/task-23');
|
|
52
|
+
expect(text).toContain('did not report a result');
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
test('draws a question read-only with its options and answer channel', () => {
|
|
56
|
+
const text = paint(agentTool({
|
|
57
|
+
name: 'ask_question',
|
|
58
|
+
status: 'running',
|
|
59
|
+
input: { questions: [{ question: 'Probe question?', options: ['A', 'B'] }] },
|
|
60
|
+
}));
|
|
61
|
+
expect(text).toContain('Question');
|
|
62
|
+
expect(text).toContain('Probe question?');
|
|
63
|
+
expect(text).toContain('A');
|
|
64
|
+
expect(text).toContain('B');
|
|
65
|
+
expect(text).toContain('next message as the answer');
|
|
66
|
+
});
|
|
67
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The card for the agent's own control plane.
|
|
8
|
+
*
|
|
9
|
+
* `agent_admin` is the renderer family for tools that manipulate the agent
|
|
10
|
+
* (background tasks, subagents, schedules, messages, its own questions), which
|
|
11
|
+
* antigravity sends with no result payload. The card therefore draws the
|
|
12
|
+
* ARGUMENTS as structure — action, target, brief, question options — and says
|
|
13
|
+
* when a result was not reported, instead of rendering a guessed Bash/Task body
|
|
14
|
+
* or an unreadable JSON document.
|
|
15
|
+
*
|
|
16
|
+
* `ask_question` is not answerable here: ACP sends no dialog frame for it and
|
|
17
|
+
* the adapter takes the next user message as the answer (measured on 1.5.3).
|
|
18
|
+
* The options are shown read-only and the note names the real channel.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import type { ToolCallData } from '@/shared/types';
|
|
22
|
+
import { FallbackOutput } from '@/client/components/workspace/chat-timeline/tool-renderers/shared/FallbackOutput';
|
|
23
|
+
import { agentAdminView } from '@/client/components/workspace/chat-timeline/tool-renderers/panels/agent-admin-rows';
|
|
24
|
+
|
|
25
|
+
export function AgentAdmin({ tool }: { tool: ToolCallData }) {
|
|
26
|
+
const view = agentAdminView(tool);
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<div className="space-y-2">
|
|
30
|
+
<div className="flex flex-wrap items-center gap-1.5">
|
|
31
|
+
<span className="text-[10px] font-semibold uppercase tracking-[0.14em] text-ink/45">
|
|
32
|
+
{view.title}
|
|
33
|
+
</span>
|
|
34
|
+
{view.action && (
|
|
35
|
+
<span className="rounded bg-ink/5 px-1.5 py-0.2 font-mono text-[10px] text-ink/60">
|
|
36
|
+
{view.action}
|
|
37
|
+
</span>
|
|
38
|
+
)}
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
{view.questions.map((question, index) => (
|
|
42
|
+
<div key={index} className="rounded-lg border border-ink/8 bg-paper px-2.5 py-2">
|
|
43
|
+
<div className="text-[11.5px] leading-relaxed text-ink select-text">{question.question}</div>
|
|
44
|
+
{question.options.length > 0 && (
|
|
45
|
+
<div className="mt-1.5 flex flex-wrap gap-1">
|
|
46
|
+
{question.options.map((option) => (
|
|
47
|
+
<span key={option} className="rounded bg-ink/5 px-1.5 py-0.2 font-mono text-[10px] text-ink/60">
|
|
48
|
+
{option}
|
|
49
|
+
</span>
|
|
50
|
+
))}
|
|
51
|
+
</div>
|
|
52
|
+
)}
|
|
53
|
+
</div>
|
|
54
|
+
))}
|
|
55
|
+
|
|
56
|
+
{view.fields.map((field) => (
|
|
57
|
+
field.block ? (
|
|
58
|
+
<div key={field.label} className="space-y-1">
|
|
59
|
+
<div className="text-[10px] font-semibold uppercase tracking-[0.14em] text-ink/40">
|
|
60
|
+
{field.label}
|
|
61
|
+
</div>
|
|
62
|
+
<pre className="max-h-64 overflow-auto rounded-lg border border-ink/8 bg-canvas/40 px-3 py-2 font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-words text-ink/80 select-text">
|
|
63
|
+
{field.value}
|
|
64
|
+
</pre>
|
|
65
|
+
</div>
|
|
66
|
+
) : (
|
|
67
|
+
<div key={field.label} className="flex items-start gap-2 text-[11.5px]">
|
|
68
|
+
<span className="w-24 shrink-0 text-[10px] font-semibold uppercase tracking-[0.14em] text-ink/40">
|
|
69
|
+
{field.label}
|
|
70
|
+
</span>
|
|
71
|
+
<span
|
|
72
|
+
className={field.mono
|
|
73
|
+
? 'min-w-0 flex-1 break-all font-mono text-[11px] text-ink/80 select-text'
|
|
74
|
+
: 'min-w-0 flex-1 whitespace-pre-wrap text-ink/80 select-text'}
|
|
75
|
+
>
|
|
76
|
+
{field.value}
|
|
77
|
+
</span>
|
|
78
|
+
</div>
|
|
79
|
+
)
|
|
80
|
+
))}
|
|
81
|
+
|
|
82
|
+
{view.note && (
|
|
83
|
+
<p className="text-[10.5px] leading-relaxed text-ink/45">{view.note}</p>
|
|
84
|
+
)}
|
|
85
|
+
|
|
86
|
+
{tool.output && <FallbackOutput text={tool.output} />}
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The MCP panel's two argument surfaces.
|
|
8
|
+
*
|
|
9
|
+
* The legacy `write xd://mcp__…` transport carries the call's arguments as a
|
|
10
|
+
* JSON string in `content`; an ACP `mcp__` call carries the same facts as a
|
|
11
|
+
* structured `rawInput` object. The panel read only `content`, so an ACP MCP
|
|
12
|
+
* call drew its header and result but never the arguments it asked with —
|
|
13
|
+
* measured on opencode 2.2.5, whose bare server names (`envsitter_validate`)
|
|
14
|
+
* now resolve to this panel.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { afterAll, beforeAll, describe, expect, test } from 'bun:test';
|
|
18
|
+
import { Window } from 'happy-dom';
|
|
19
|
+
import { h, render } from 'preact';
|
|
20
|
+
import { act } from 'preact/test-utils';
|
|
21
|
+
import { Mcp } from './Mcp';
|
|
22
|
+
import type { ToolCallData } from '@kabmo-labs/kabmo-chat/contracts/chat';
|
|
23
|
+
|
|
24
|
+
const DOM_GLOBALS = ['window', 'document', 'navigator', 'Node', 'Element', 'HTMLElement', 'Event'] as const;
|
|
25
|
+
const nativeGlobals: Partial<Record<(typeof DOM_GLOBALS)[number], unknown>> = {};
|
|
26
|
+
|
|
27
|
+
beforeAll(() => {
|
|
28
|
+
const win = new Window({ url: 'http://localhost' });
|
|
29
|
+
const target = globalThis as unknown as Record<string, unknown>;
|
|
30
|
+
for (const key of DOM_GLOBALS) {
|
|
31
|
+
nativeGlobals[key] = target[key];
|
|
32
|
+
target[key] = (win as unknown as Record<string, unknown>)[key];
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
afterAll(() => {
|
|
37
|
+
const target = globalThis as unknown as Record<string, unknown>;
|
|
38
|
+
for (const key of DOM_GLOBALS) {
|
|
39
|
+
if (nativeGlobals[key] === undefined) delete target[key];
|
|
40
|
+
else target[key] = nativeGlobals[key];
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
async function mount(call: ToolCallData): Promise<HTMLElement> {
|
|
45
|
+
const container = document.createElement('div');
|
|
46
|
+
document.body.appendChild(container);
|
|
47
|
+
await act(async () => {
|
|
48
|
+
render(h(Mcp, { tool: call }), container);
|
|
49
|
+
});
|
|
50
|
+
return container;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function tool(partial: Partial<ToolCallData>): ToolCallData {
|
|
54
|
+
return {
|
|
55
|
+
id: 'm1',
|
|
56
|
+
type: 'other',
|
|
57
|
+
name: 'mcp__sqlite_query',
|
|
58
|
+
title: 'sqlite_query',
|
|
59
|
+
status: 'success',
|
|
60
|
+
...partial,
|
|
61
|
+
} as ToolCallData;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
describe('Mcp panel', () => {
|
|
65
|
+
test('a structured rawInput is drawn per key', async () => {
|
|
66
|
+
const el = await mount(tool({
|
|
67
|
+
name: 'envsitter_validate',
|
|
68
|
+
input: { filePath: '/repo/.env' },
|
|
69
|
+
output: '{"ok":true,"issues":[]}',
|
|
70
|
+
}));
|
|
71
|
+
const text = el.textContent ?? '';
|
|
72
|
+
expect(text).toContain('envsitter_validate');
|
|
73
|
+
expect(text).toContain('filePath');
|
|
74
|
+
expect(text).toContain('/repo/.env');
|
|
75
|
+
expect(text).toContain('ok');
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
test('the legacy write xd:// shape still parses its content JSON', async () => {
|
|
79
|
+
const el = await mount(tool({
|
|
80
|
+
type: 'write',
|
|
81
|
+
name: 'write',
|
|
82
|
+
target: 'xd://mcp__codegraph_explore',
|
|
83
|
+
input: { path: 'xd://mcp__codegraph_explore', content: '{"query":"tool renderers"}' },
|
|
84
|
+
output: '{"items":[]}',
|
|
85
|
+
}));
|
|
86
|
+
const text = el.textContent ?? '';
|
|
87
|
+
expect(text).toContain('codegraph_explore');
|
|
88
|
+
expect(text).toContain('query');
|
|
89
|
+
expect(text).toContain('tool renderers');
|
|
90
|
+
});
|
|
91
|
+
});
|
|
@@ -114,7 +114,13 @@ export function Mcp({ tool }: { tool: ToolCallData }) {
|
|
|
114
114
|
: '';
|
|
115
115
|
|
|
116
116
|
const parsedArgs = useMemo(() => (content ? tryParseJson(content) : { isValid: false }), [content]);
|
|
117
|
-
|
|
117
|
+
// ACP/omp `mcp__` calls carry their arguments as a structured `rawInput`
|
|
118
|
+
// object; only the legacy `write xd://…` transport carries a JSON string in
|
|
119
|
+
// `content`. Reading only `content` left a structured MCP call showing its
|
|
120
|
+
// header and result but never the arguments it asked with.
|
|
121
|
+
const argsData = content
|
|
122
|
+
? (parsedArgs.isValid ? parsedArgs.data : undefined)
|
|
123
|
+
: inputObj;
|
|
118
124
|
const argsStructured = isRecord(argsData) || Array.isArray(argsData);
|
|
119
125
|
|
|
120
126
|
const parsedOutput = useMemo(() => (tool.output ? tryParseJson(tool.output) : { isValid: false }), [tool.output]);
|
|
@@ -131,7 +137,7 @@ export function Mcp({ tool }: { tool: ToolCallData }) {
|
|
|
131
137
|
</span>
|
|
132
138
|
</div>
|
|
133
139
|
|
|
134
|
-
{
|
|
140
|
+
{argsStructured ? (
|
|
135
141
|
<ValueNode value={argsData} />
|
|
136
142
|
) : content ? (
|
|
137
143
|
<div className="prose-content max-h-72 overflow-auto rounded-lg border border-ink/8 bg-paper px-3 py-2.5 text-[12px] leading-relaxed text-ink/85 select-text">
|
|
@@ -53,6 +53,15 @@ describe('Read panel — lazy fallback', () => {
|
|
|
53
53
|
expect(fetchCalls[0]).toContain('/api/fs/read?path=src%2Fx.ts');
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
+
test('an absolute path takes the allow-listed reference route', async () => {
|
|
57
|
+
// `/api/fs/read` strips the leading `/` and resolves the rest UNDER the
|
|
58
|
+
// workspace root, so an ACP `locations[].path` answered 404 even when the
|
|
59
|
+
// file existed (`agy` 1.5.3 sends no tool result, so this is the only body).
|
|
60
|
+
fetchCalls.length = 0;
|
|
61
|
+
await mountRead(readTool({ target: '/Users/me/repo/src/x.ts', input: { Path: '/Users/me/repo/src/x.ts' } }));
|
|
62
|
+
expect(fetchCalls[0]).toContain('/api/fs/read-reference?path=%2FUsers%2Fme%2Frepo%2Fsrc%2Fx.ts');
|
|
63
|
+
});
|
|
64
|
+
|
|
56
65
|
test('a refused read prints the server’s reason, never a fake body', async () => {
|
|
57
66
|
// A binary or oversized file is refused by the route with its own sentence.
|
|
58
67
|
// Printing `// Loaded file: <path>` described contents that were never read.
|
|
@@ -24,6 +24,21 @@ interface ReadPanelProps {
|
|
|
24
24
|
output: string;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
/** Absolute references take the allow-listed route; a workspace-relative one
|
|
28
|
+
* takes the scoped reader.
|
|
29
|
+
*
|
|
30
|
+
* `/api/fs/read` strips the leading `/` and resolves the rest UNDER the
|
|
31
|
+
* workspace root, so an ACP `locations[].path` (`/Users/…/src/a.ts`) became
|
|
32
|
+
* `<root>/Users/…/src/a.ts` and answered 404 — measured with `agy` 1.5.3,
|
|
33
|
+
* whose `read_file` sends no result payload at all, so the lazy fallback is
|
|
34
|
+
* the ONLY body the card has. `/api/fs/read-reference` resolves an absolute
|
|
35
|
+
* path through the same allow-list the drop path uses. */
|
|
36
|
+
function lazyReadUrl(path: string): string {
|
|
37
|
+
const reference = /^(?:[A-Za-z]:[\\/]|\/|file:\/\/)/.test(path);
|
|
38
|
+
const route = reference ? '/api/fs/read-reference' : '/api/fs/read';
|
|
39
|
+
return `${route}?path=${encodeURIComponent(path)}`;
|
|
40
|
+
}
|
|
41
|
+
|
|
27
42
|
/** File & Directory content viewer untuk tool `read` / `view_file` / `read_file`. */
|
|
28
43
|
export function Read({ tool, targetFilePath, output }: ReadPanelProps) {
|
|
29
44
|
const [lazyContent, setLazyContent] = useState<string | null>(null);
|
|
@@ -82,7 +97,7 @@ export function Read({ tool, targetFilePath, output }: ReadPanelProps) {
|
|
|
82
97
|
useEffect(() => {
|
|
83
98
|
if (cleanFetchPath && !virtualPath && !isPictureOnly && !output && lazyContent === null && !loadingFile) {
|
|
84
99
|
setLoadingFile(true);
|
|
85
|
-
fetch(
|
|
100
|
+
fetch(lazyReadUrl(cleanFetchPath))
|
|
86
101
|
.then(async (res) => {
|
|
87
102
|
const data = (await res.json().catch(() => null)) as { content?: unknown; error?: unknown } | null;
|
|
88
103
|
// The route refuses a file it will not hand back as text — a binary
|