omni-context-cli 0.0.75 → 0.0.77
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/README.md +68 -112
- package/README.zh-CN.md +68 -112
- package/dist/agents/explore.md +26 -19
- package/dist/agents/glance.md +7 -22
- package/dist/agents/{slice.md → search.md} +4 -4
- package/dist/assets/cone-bw-white.svg +24 -7
- package/dist/assets/cone-bw.svg +24 -7
- package/dist/assets/cone-mac@256.png +0 -0
- package/dist/assets/cone-mac@512.png +0 -0
- package/dist/assets/cone.svg +24 -2
- package/dist/assets/cone@128.png +0 -0
- package/dist/assets/cone@16.png +0 -0
- package/dist/assets/cone@24.png +0 -0
- package/dist/assets/cone@256.png +0 -0
- package/dist/assets/cone@32.png +0 -0
- package/dist/assets/cone@512.png +0 -0
- package/dist/assets/cone@64.png +0 -0
- package/dist/assets/icon.ico +0 -0
- package/dist/assets/omnicontext-cli-logo-white.svg +24 -7
- package/dist/assets/omnicontext-cli-logo.svg +24 -7
- package/dist/cli.js +7 -7
- package/dist/clients/extension.vsix +0 -0
- package/dist/clients/web/assets/{_baseUniq-CXChR-Be.js → _baseUniq-BbAI5D6T.js} +1 -1
- package/dist/clients/web/assets/{arc-WV1VudUl.js → arc-C01cHi_J.js} +1 -1
- package/dist/clients/web/assets/{architectureDiagram-VXUJARFQ-BEoMuSjf.js → architectureDiagram-VXUJARFQ-C4SW9geU.js} +1 -1
- package/dist/clients/web/assets/{blockDiagram-VD42YOAC-DTPwy75e.js → blockDiagram-VD42YOAC-BJBjUKKm.js} +1 -1
- package/dist/clients/web/assets/{c4Diagram-YG6GDRKO-DdfESKAK.js → c4Diagram-YG6GDRKO-DRMS2exe.js} +1 -1
- package/dist/clients/web/assets/channel-BFxt5Aug.js +1 -0
- package/dist/clients/web/assets/{chunk-4BX2VUAB-Dr-OEq2r.js → chunk-4BX2VUAB-DdM_Xgvz.js} +1 -1
- package/dist/clients/web/assets/{chunk-55IACEB6-DpCIiurx.js → chunk-55IACEB6-sCGtW4jw.js} +1 -1
- package/dist/clients/web/assets/{chunk-B4BG7PRW-BdDzny4H.js → chunk-B4BG7PRW-CrTfpFlk.js} +1 -1
- package/dist/clients/web/assets/{chunk-DI55MBZ5-BXFCxBaP.js → chunk-DI55MBZ5-BJxcEBin.js} +1 -1
- package/dist/clients/web/assets/{chunk-FMBD7UC4-DtZ_HF1F.js → chunk-FMBD7UC4-ZCzWQMnr.js} +1 -1
- package/dist/clients/web/assets/{chunk-QN33PNHL-hci333uu.js → chunk-QN33PNHL-7lsjOUTT.js} +1 -1
- package/dist/clients/web/assets/{chunk-QZHKN3VN-BtwjKZ4c.js → chunk-QZHKN3VN-DM6taDix.js} +1 -1
- package/dist/clients/web/assets/{chunk-TZMSLE5B-BLxgQ0Xd.js → chunk-TZMSLE5B-Dc2DN3ii.js} +1 -1
- package/dist/clients/web/assets/classDiagram-2ON5EDUG-CMfvUA3j.js +1 -0
- package/dist/clients/web/assets/classDiagram-v2-WZHVMYZB-CMfvUA3j.js +1 -0
- package/dist/clients/web/assets/clone-BWI7Baa7.js +1 -0
- package/dist/clients/web/assets/{cose-bilkent-S5V4N54A-CcJiBM1b.js → cose-bilkent-S5V4N54A-r8T3f5yK.js} +1 -1
- package/dist/clients/web/assets/{dagre-6UL2VRFP-OUA53tCY.js → dagre-6UL2VRFP-UnxnSeQH.js} +1 -1
- package/dist/clients/web/assets/{diagram-PSM6KHXK-BlE6A0IQ.js → diagram-PSM6KHXK-D2ENZ6qS.js} +1 -1
- package/dist/clients/web/assets/{diagram-QEK2KX5R-CdcQqp9s.js → diagram-QEK2KX5R-Eye3JgZm.js} +1 -1
- package/dist/clients/web/assets/{diagram-S2PKOQOG-DKA1jmkl.js → diagram-S2PKOQOG-Blf5P9RJ.js} +1 -1
- package/dist/clients/web/assets/{erDiagram-Q2GNP2WA-BHLuIHgp.js → erDiagram-Q2GNP2WA-wyIeLoVZ.js} +1 -1
- package/dist/clients/web/assets/{flowDiagram-NV44I4VS-D9KGcf3l.js → flowDiagram-NV44I4VS-D99ef0t0.js} +1 -1
- package/dist/clients/web/assets/{ganttDiagram-JELNMOA3-BCMaZhwk.js → ganttDiagram-JELNMOA3-CvsjeBuE.js} +1 -1
- package/dist/clients/web/assets/{gitGraphDiagram-NY62KEGX-WlgIxLrb.js → gitGraphDiagram-NY62KEGX-B2ylogok.js} +1 -1
- package/dist/clients/web/assets/{graph-CPhZB3Fo.js → graph-BEwCLq4h.js} +1 -1
- package/dist/clients/web/assets/index-30onxp6I.js +2 -0
- package/dist/clients/web/assets/index-pGSHhaP9.css +1 -0
- package/dist/clients/web/assets/{infoDiagram-WHAUD3N6-UqSDhFGn.js → infoDiagram-WHAUD3N6-C9HLlPj3.js} +1 -1
- package/dist/clients/web/assets/{journeyDiagram-XKPGCS4Q-CUjYeGgD.js → journeyDiagram-XKPGCS4Q-BGMoCoGu.js} +1 -1
- package/dist/clients/web/assets/{kanban-definition-3W4ZIXB7-DYydM8Jp.js → kanban-definition-3W4ZIXB7-Z1B1b4dY.js} +1 -1
- package/dist/clients/web/assets/{layout-BDwW8zhf.js → layout-KBr90mM8.js} +1 -1
- package/dist/clients/web/assets/{linear-BIj42DI9.js → linear-VOTetRqU.js} +1 -1
- package/dist/clients/web/assets/{min-CHx_75Vz.js → min-BcFr1Xgw.js} +1 -1
- package/dist/clients/web/assets/{mindmap-definition-VGOIOE7T-B6SXeTkp.js → mindmap-definition-VGOIOE7T-Bf9fJD2v.js} +1 -1
- package/dist/clients/web/assets/{pieDiagram-ADFJNKIX-Pzf-c9Kg.js → pieDiagram-ADFJNKIX-DITjn_1i.js} +1 -1
- package/dist/clients/web/assets/{quadrantDiagram-AYHSOK5B-BTLrn6ti.js → quadrantDiagram-AYHSOK5B-CG8qEQsc.js} +1 -1
- package/dist/clients/web/assets/{requirementDiagram-UZGBJVZJ-Dq78WfGf.js → requirementDiagram-UZGBJVZJ-_fiifEP6.js} +1 -1
- package/dist/clients/web/assets/{sankeyDiagram-TZEHDZUN-CjaNw3ep.js → sankeyDiagram-TZEHDZUN-dGOtogtu.js} +1 -1
- package/dist/clients/web/assets/{sequenceDiagram-WL72ISMW-CQsd3qPQ.js → sequenceDiagram-WL72ISMW-BPWg-aZ3.js} +1 -1
- package/dist/clients/web/assets/{stateDiagram-FKZM4ZOC-q2zDUOHK.js → stateDiagram-FKZM4ZOC-XlU9RkKz.js} +1 -1
- package/dist/clients/web/assets/stateDiagram-v2-4FDKWEC3-Rsaa7fF9.js +1 -0
- package/dist/clients/web/assets/{timeline-definition-IT6M3QCI-C59DIyEZ.js → timeline-definition-IT6M3QCI-CQGxtqhi.js} +1 -1
- package/dist/clients/web/assets/{treemap-KMMF4GRG-D-ZBoKfd.js → treemap-KMMF4GRG-Do7kW41s.js} +1 -1
- package/dist/clients/web/assets/{xychartDiagram-PRI3JC2R-BYsVEiv2.js → xychartDiagram-PRI3JC2R-C_QymW0P.js} +1 -1
- package/dist/clients/web/favicon.png +0 -0
- package/dist/clients/web/index.html +2 -2
- package/dist/skills/simplify/SKILL.md +53 -0
- package/dist/workflows/general.md +19 -0
- package/dist/workflows/programming.md +33 -0
- package/package.json +2 -3
- package/scripts/bump-version.mjs +0 -3
- package/scripts/clean.mjs +17 -0
- package/scripts/release-build.mjs +8 -129
- package/dist/agents/pluck.md +0 -49
- package/dist/agents/quest.md +0 -47
- package/dist/agents/ripple.md +0 -58
- package/dist/agents/sculpt.md +0 -63
- package/dist/agents/spark.md +0 -53
- package/dist/agents/sweep.md +0 -44
- package/dist/agents/weave.md +0 -54
- package/dist/clients/web/assets/channel-z5tzrb8m.js +0 -1
- package/dist/clients/web/assets/classDiagram-2ON5EDUG-k9WrxKyC.js +0 -1
- package/dist/clients/web/assets/classDiagram-v2-WZHVMYZB-k9WrxKyC.js +0 -1
- package/dist/clients/web/assets/clone-CJRPdeVb.js +0 -1
- package/dist/clients/web/assets/index-CtRRqvG-.css +0 -1
- package/dist/clients/web/assets/index-DUe3XB6o.js +0 -27
- package/dist/clients/web/assets/stateDiagram-v2-4FDKWEC3-JAzYV-t8.js +0 -1
- package/dist/slash/ping.md +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
var t,i,s,e,h,r,a,n,o,c;import{s as l,g as u,q as f,p as x,a as p,b as d,_ as g,l as m,H as b,e as _,y,F as A,i as k,D as w,E as T,K as v,aA as S,R as M}from"./index-DUe3XB6o.js";import{i as D}from"./init-C9Lo50Hz.js";import{o as E}from"./ordinal-2upbOM02.js";import{l as R}from"./linear-BIj42DI9.js";import"./defaultLocale-DK_abR1s.js";function C(){var t,i,s=E().unknown(void 0),e=s.domain,h=s.range,r=0,a=1,n=!1,o=0,c=0,l=.5;function u(){var s=e().length,u=a<r,f=u?a:r,x=u?r:a;t=(x-f)/Math.max(1,s-o+2*c),n&&(t=Math.floor(t)),f+=(x-f-t*(s-o))*l,i=t*(1-o),n&&(f=Math.round(f),i=Math.round(i));var p=function(t,i,s){t=+t,i=+i,s=(h=arguments.length)<2?(i=t,t=0,1):h<3?1:+s;for(var e=-1,h=0|Math.max(0,Math.ceil((i-t)/s)),r=new Array(h);++e<h;)r[e]=t+e*s;return r}(s).map(function(i){return f+t*i});return h(u?p.reverse():p)}return delete s.unknown,s.domain=function(t){return arguments.length?(e(t),u()):e()},s.range=function(t){return arguments.length?([r,a]=t,r=+r,a=+a,u()):[r,a]},s.rangeRound=function(t){return[r,a]=t,r=+r,a=+a,n=!0,u()},s.bandwidth=function(){return i},s.step=function(){return t},s.round=function(t){return arguments.length?(n=!!t,u()):n},s.padding=function(t){return arguments.length?(o=Math.min(1,c=+t),u()):o},s.paddingInner=function(t){return arguments.length?(o=Math.min(1,t),u()):o},s.paddingOuter=function(t){return arguments.length?(c=+t,u()):c},s.align=function(t){return arguments.length?(l=Math.max(0,Math.min(1,t)),u()):l},s.copy=function(){return C(e(),[r,a]).round(n).paddingInner(o).paddingOuter(c).align(l)},D.apply(u(),arguments)}var I=function(){var t=g(function(t,i,s,e){for(s=s||{},e=t.length;e--;s[t[e]]=i);return s},"o"),i=[1,10,12,14,16,18,19,21,23],s=[2,6],e=[1,3],h=[1,5],r=[1,6],a=[1,7],n=[1,5,10,12,14,16,18,19,21,23,34,35,36],o=[1,25],c=[1,26],l=[1,28],u=[1,29],f=[1,30],x=[1,31],p=[1,32],d=[1,33],m=[1,34],b=[1,35],_=[1,36],y=[1,37],A=[1,43],k=[1,42],w=[1,47],T=[1,50],v=[1,10,12,14,16,18,19,21,23,34,35,36],S=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],M=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],D=[1,64],E={trace:g(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,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$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",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"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],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:g(function(t,i,s,e,h,r,a){var n=r.length-1;switch(h){case 5:e.setOrientation(r[n]);break;case 9:e.setDiagramTitle(r[n].text.trim());break;case 12:e.setLineData({text:"",type:"text"},r[n]);break;case 13:e.setLineData(r[n-1],r[n]);break;case 14:e.setBarData({text:"",type:"text"},r[n]);break;case 15:e.setBarData(r[n-1],r[n]);break;case 16:this.$=r[n].trim(),e.setAccTitle(this.$);break;case 17:case 18:this.$=r[n].trim(),e.setAccDescription(this.$);break;case 19:case 27:this.$=r[n-1];break;case 20:this.$=[Number(r[n-2]),...r[n]];break;case 21:this.$=[Number(r[n])];break;case 22:e.setXAxisTitle(r[n]);break;case 23:e.setXAxisTitle(r[n-1]);break;case 24:e.setXAxisTitle({type:"text",text:""});break;case 25:e.setXAxisBand(r[n]);break;case 26:e.setXAxisRangeData(Number(r[n-2]),Number(r[n]));break;case 28:this.$=[r[n-2],...r[n]];break;case 29:this.$=[r[n]];break;case 30:e.setYAxisTitle(r[n]);break;case 31:e.setYAxisTitle(r[n-1]);break;case 32:e.setYAxisTitle({type:"text",text:""});break;case 33:e.setYAxisRangeData(Number(r[n-2]),Number(r[n]));break;case 37:case 38:this.$={text:r[n],type:"text"};break;case 39:this.$={text:r[n],type:"markdown"};break;case 40:this.$=r[n];break;case 41:this.$=r[n-1]+""+r[n]}},"anonymous"),table:[t(i,s,{3:1,4:2,7:4,5:e,34:h,35:r,36:a}),{1:[3]},t(i,s,{4:2,7:4,3:8,5:e,34:h,35:r,36:a}),t(i,s,{4:2,7:4,6:9,3:10,5:e,8:[1,11],34:h,35:r,36:a}),{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]},t(n,[2,34]),t(n,[2,35]),t(n,[2,36]),{1:[2,1]},t(i,s,{4:2,7:4,3:21,5:e,34:h,35:r,36:a}),{1:[2,3]},t(n,[2,5]),t(i,[2,7],{4:22,34:h,35:r,36:a}),{11:23,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:39,13:38,24:A,27:k,29:40,30:41,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:45,15:44,27:w,33:46,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:49,17:48,24:T,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:52,17:51,24:T,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{20:[1,53]},{22:[1,54]},t(v,[2,18]),{1:[2,2]},t(v,[2,8]),t(v,[2,9]),t(S,[2,37],{40:55,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y}),t(S,[2,38]),t(S,[2,39]),t(M,[2,40]),t(M,[2,42]),t(M,[2,43]),t(M,[2,44]),t(M,[2,45]),t(M,[2,46]),t(M,[2,47]),t(M,[2,48]),t(M,[2,49]),t(M,[2,50]),t(M,[2,51]),t(v,[2,10]),t(v,[2,22],{30:41,29:56,24:A,27:k}),t(v,[2,24]),t(v,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},t(v,[2,11]),t(v,[2,30],{33:60,27:w}),t(v,[2,32]),{31:[1,61]},t(v,[2,12]),{17:62,24:T},{25:63,27:D},t(v,[2,14]),{17:65,24:T},t(v,[2,16]),t(v,[2,17]),t(M,[2,41]),t(v,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(v,[2,31]),{27:[1,69]},t(v,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(v,[2,15]),t(v,[2,26]),t(v,[2,27]),{11:59,32:72,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},t(v,[2,33]),t(v,[2,19]),{25:73,27:D},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:g(function(t,i){if(!i.recoverable){var s=new Error(t);throw s.hash=i,s}this.trace(t)},"parseError"),parse:g(function(t){var i=this,s=[0],e=[],h=[null],r=[],a=this.table,n="",o=0,c=0,l=r.slice.call(arguments,1),u=Object.create(this.lexer),f={yy:{}};for(var x in this.yy)Object.prototype.hasOwnProperty.call(this.yy,x)&&(f.yy[x]=this.yy[x]);u.setInput(t,f.yy),f.yy.lexer=u,f.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var p=u.yylloc;r.push(p);var d=u.options&&u.options.ranges;function m(){var t;return"number"!=typeof(t=e.pop()||u.lex()||1)&&(t instanceof Array&&(t=(e=t).pop()),t=i.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,g(function(t){s.length=s.length-2*t,h.length=h.length-t,r.length=r.length-t},"popStack"),g(m,"lex");for(var b,_,y,A,k,w,T,v,S={};;){if(_=s[s.length-1],this.defaultActions[_]?y=this.defaultActions[_]:(null==b&&(b=m()),y=a[_]&&a[_][b]),void 0===y||!y.length||!y[0]){var M="";for(k in v=[],a[_])this.terminals_[k]&&k>2&&v.push("'"+this.terminals_[k]+"'");M=u.showPosition?"Parse error on line "+(o+1)+":\n"+u.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(M,{text:u.match,token:this.terminals_[b]||b,line:u.yylineno,loc:p,expected:v})}if(y[0]instanceof Array&&y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(y[0]){case 1:s.push(b),h.push(u.yytext),r.push(u.yylloc),s.push(y[1]),b=null,c=u.yyleng,n=u.yytext,o=u.yylineno,p=u.yylloc;break;case 2:if(w=this.productions_[y[1]][1],S.$=h[h.length-w],S._$={first_line:r[r.length-(w||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(w||1)].first_column,last_column:r[r.length-1].last_column},d&&(S._$.range=[r[r.length-(w||1)].range[0],r[r.length-1].range[1]]),void 0!==(A=this.performAction.apply(S,[n,c,o,f.yy,y[1],h,r].concat(l))))return A;w&&(s=s.slice(0,-1*w*2),h=h.slice(0,-1*w),r=r.slice(0,-1*w)),s.push(this.productions_[y[1]][0]),h.push(S.$),r.push(S._$),T=a[s[s.length-2]][s[s.length-1]],s.push(T);break;case 3:return!0}}return!0},"parse")},R=function(){return{EOF:1,parseError:g(function(t,i){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,i)},"parseError"),setInput:g(function(t,i){return this.yy=i||this.yy||{},this._input=t,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]),this.offset=0,this},"setInput"),input:g(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:g(function(t){var i=t.length,s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var e=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1&&(this.yylineno-=s.length-1);var h=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===e.length?this.yylloc.first_column:0)+e[e.length-s.length].length-s[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[h[0],h[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:g(function(t){this.unput(this.match.slice(t))},"less"),pastInput:g(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:g(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:g(function(){var t=this.pastInput(),i=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+i+"^"},"showPosition"),test_match:g(function(t,i){var s,e,h;if(this.options.backtrack_lexer&&(h={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&&(h.yylloc.range=this.yylloc.range.slice(0))),(e=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var r in h)this[r]=h[r];return!1}return!1},"test_match"),next:g(function(){if(this.done)return this.EOF;var t,i,s,e;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var h=this._currentRules(),r=0;r<h.length;r++)if((s=this._input.match(this.rules[h[r]]))&&(!i||s[0].length>i[0].length)){if(i=s,e=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,h[r])))return t;if(this._backtrack){i=!1;continue}return!1}if(!this.options.flex)break}return i?!1!==(t=this.test_match(i,h[e]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:g(function(){var t=this.next();return t||this.lex()},"lex"),begin:g(function(t){this.conditionStack.push(t)},"begin"),popState:g(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:g(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:g(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:g(function(t){this.begin(t)},"pushState"),stateStackSize:g(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:g(function(t,i,s,e){switch(s){case 0:case 1:case 5:case 44:break;case 2:case 3:return this.popState(),34;case 4:return 34;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:case 26:case 28:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 31;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 27;case 25:return this.popState(),26;case 27:this.pushState("string");break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 43;case 33:return"COLON";case 34:return 44;case 35:return 28;case 36:return 45;case 37:return 46;case 38:return 48;case 39:return 50;case 40:return 47;case 41:return 41;case 42:return 49;case 43:return 42;case 45:return 35;case 46:return 36}},"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}}}}();function C(){this.yy={}}return E.lexer=R,g(C,"Parser"),C.prototype=E,E.Parser=C,new C}();I.parser=I;var L=I;function P(t){return"bar"===t.type}function $(t){return"band"===t.type}function N(t){return"linear"===t.type}g(P,"isBarPlot"),g($,"isBandAxisData"),g(N,"isLinearAxisData");var z=(g(t=class{constructor(t){this.parentGroup=t}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((t,i)=>Math.max(i.length,t),0)*i,height:i};const s={width:0,height:0},e=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const h of t){const t=S(e,1,h),r=t?t.width:h.length*i,a=t?t.height:i;s.width=Math.max(s.width,r),s.height=Math.max(s.height,a)}return e.remove(),s}},"TextDimensionCalculatorWithFont"),t),B=(g(i=class{constructor(t,i,s,e){this.axisConfig=t,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=e,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.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}setRange(t){this.range=t,"left"===this.axisPosition||"right"===this.axisPosition?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){.7*this.getTickDistance()>2*this.outerPadding&&(this.outerPadding=Math.floor(.7*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),e=.2*t.width;this.outerPadding=Math.min(s.width/2,e);const h=s.height+2*this.axisConfig.labelPadding;this.labelTextHeight=s.height,h<=i&&(i-=h,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),s=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,s<=i&&(i-=s,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),e=.2*t.height;this.outerPadding=Math.min(s.height/2,e);const h=s.width+2*this.axisConfig.labelPadding;h<=i&&(i-=h,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),s=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,s<=i&&(i-=s,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return"left"===this.axisPosition||"right"===this.axisPosition?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.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&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(t=>({text:t.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(t),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(t=>({path:`M ${i},${this.getScaleValue(t)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(t)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.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"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.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&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(t=>({path:`M ${this.getScaleValue(t)},${i} L ${this.getScaleValue(t)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.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"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.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&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+2*this.axisConfig.titlePadding:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(t=>({path:`M ${this.getScaleValue(t)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(t)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.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"}]}),t}getDrawableElements(){if("left"===this.axisPosition)return this.getDrawableElementsForLeftAxis();if("right"===this.axisPosition)throw Error("Drawing of right axis is not implemented");return"bottom"===this.axisPosition?this.getDrawableElementsForBottomAxis():"top"===this.axisPosition?this.getDrawableElementsForTopAxis():[]}},"BaseAxis"),i),O=(g(s=class extends B{constructor(t,i,s,e,h){super(t,e,h,i),this.categories=s,this.scale=C().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=C().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),m.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},"BandAxis"),s),X=(g(e=class extends B{constructor(t,i,s,e,h){super(t,e,h,i),this.domain=s,this.scale=R().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];"left"===this.axisPosition&&t.reverse(),this.scale=R().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}},"LinearAxis"),e);function F(t,i,s,e){const h=new z(e);return $(t)?new O(i,s,t.categories,t.title,h):new X(i,s,[t.min,t.max],t.title,h)}g(F,"getAxis");var U=(g(h=class{constructor(t,i,s,e){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=e,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(i.width,t.width),e=i.height+2*this.chartConfig.titlePadding;return i.width<=s&&i.height<=e&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=s,this.boundingRect.height=e,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const t=[];return this.showChartTitle&&t.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}]}),t}},"ChartTitle"),h);function W(t,i,s,e){const h=new z(e);return new U(h,t,i,s)}g(W,"getChartTitleComponent");var Y=(g(r=class{constructor(t,i,s,e,h){this.plotData=t,this.xAxis=i,this.yAxis=s,this.orientation=e,this.plotIndex=h}getDrawableElement(){const t=this.plotData.data.map(t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]);let i;return i="horizontal"===this.orientation?M().y(t=>t[0]).x(t=>t[1])(t):M().x(t=>t[0]).y(t=>t[1])(t),i?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},"LinePlot"),r),j=(g(a=class{constructor(t,i,s,e,h,r){this.barData=t,this.boundingRect=i,this.xAxis=s,this.yAxis=e,this.orientation=h,this.plotIndex=r}getDrawableElement(){const t=this.barData.data.map(t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]),i=.95*Math.min(2*this.xAxis.getAxisOuterPadding(),this.xAxis.getTickDistance()),s=i/2;return"horizontal"===this.orientation?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(t=>({x:this.boundingRect.x,y:t[0]-s,height:i,width:t[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(t=>({x:t[0]-s,y:t[1],width:i,height:this.boundingRect.y+this.boundingRect.height-t[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},"BarPlot"),a),H=(g(n=class{constructor(t,i,s){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(t,i){this.xAxis=t,this.yAxis=i}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!this.xAxis||!this.yAxis)throw Error("Axes must be passed to render Plots");const t=[];for(const[i,s]of this.chartData.plots.entries())switch(s.type){case"line":{const e=new Y(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...e.getDrawableElement())}break;case"bar":{const e=new j(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...e.getDrawableElement())}}return t}},"BasePlot"),n);function V(t,i,s){return new H(t,i,s)}g(V,"getPlotComponent");var Q,G=(g(o=class{constructor(t,i,s,e){this.chartConfig=t,this.chartData=i,this.componentStore={title:W(t,i,s,e),plot:V(t,i,s),xAxis:F(i.xAxis,t.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},e),yAxis:F(i.yAxis,t.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},e)}}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,e=0,h=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),r=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),a=this.componentStore.plot.calculateSpace({width:h,height:r});t-=a.width,i-=a.height,a=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),e=a.height,i-=a.height,this.componentStore.xAxis.setAxisPosition("bottom"),a=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=a.height,this.componentStore.yAxis.setAxisPosition("left"),a=this.componentStore.yAxis.calculateSpace({width:t,height:i}),s=a.width,t-=a.width,t>0&&(h+=t,t=0),i>0&&(r+=i,i=0),this.componentStore.plot.calculateSpace({width:h,height:r}),this.componentStore.plot.setBoundingBoxXY({x:s,y:e}),this.componentStore.xAxis.setRange([s,s+h]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:e+r}),this.componentStore.yAxis.setRange([e,e+r]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:e}),this.chartData.plots.some(t=>P(t))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,e=0,h=0,r=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),a=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),n=this.componentStore.plot.calculateSpace({width:r,height:a});t-=n.width,i-=n.height,n=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=n.height,i-=n.height,this.componentStore.xAxis.setAxisPosition("left"),n=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=n.width,e=n.width,this.componentStore.yAxis.setAxisPosition("top"),n=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=n.height,h=s+n.height,t>0&&(r+=t,t=0),i>0&&(a+=i,i=0),this.componentStore.plot.calculateSpace({width:r,height:a}),this.componentStore.plot.setBoundingBoxXY({x:e,y:h}),this.componentStore.yAxis.setRange([e,e+r]),this.componentStore.yAxis.setBoundingBoxXY({x:e,y:s}),this.componentStore.xAxis.setRange([h,h+a]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:h}),this.chartData.plots.some(t=>P(t))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){"horizontal"===this.chartConfig.chartOrientation?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const i of Object.values(this.componentStore))t.push(...i.getDrawableElements());return t}},"Orchestrator"),o),K=(g(c=class{static build(t,i,s,e){return new G(t,i,s,e).getDrawableElement()}},"XYChartBuilder"),c),q=0,Z=rt(),J=ht(),tt=at(),it=J.plotColorPalette.split(",").map(t=>t.trim()),st=!1,et=!1;function ht(){const t=v(),i=A();return w(t.xyChart,i.themeVariables.xyChart)}function rt(){const t=A();return w(T.xyChart,t.xyChart)}function at(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function nt(t){const i=A();return k(t.trim(),i)}function ot(t){Q=t}function ct(t){Z.chartOrientation="horizontal"===t?"horizontal":"vertical"}function lt(t){tt.xAxis.title=nt(t.text)}function ut(t,i){tt.xAxis={type:"linear",title:tt.xAxis.title,min:t,max:i},st=!0}function ft(t){tt.xAxis={type:"band",title:tt.xAxis.title,categories:t.map(t=>nt(t.text))},st=!0}function xt(t){tt.yAxis.title=nt(t.text)}function pt(t,i){tt.yAxis={type:"linear",title:tt.yAxis.title,min:t,max:i},et=!0}function dt(t){const i=Math.min(...t),s=Math.max(...t),e=N(tt.yAxis)?tt.yAxis.min:1/0,h=N(tt.yAxis)?tt.yAxis.max:-1/0;tt.yAxis={type:"linear",title:tt.yAxis.title,min:Math.min(e,i),max:Math.max(h,s)}}function gt(t){let i=[];if(0===t.length)return i;if(!st){const i=N(tt.xAxis)?tt.xAxis.min:1/0,s=N(tt.xAxis)?tt.xAxis.max:-1/0;ut(Math.min(i,1),Math.max(s,t.length))}if(et||dt(t),$(tt.xAxis)&&(i=tt.xAxis.categories.map((i,s)=>[i,t[s]])),N(tt.xAxis)){const s=tt.xAxis.min,e=tt.xAxis.max,h=(e-s)/(t.length-1),r=[];for(let t=s;t<=e;t+=h)r.push(`${t}`);i=r.map((i,s)=>[i,t[s]])}return i}function mt(t){return it[0===t?0:t%it.length]}function bt(t,i){const s=gt(i);tt.plots.push({type:"line",strokeFill:mt(q),strokeWidth:2,data:s}),q++}function _t(t,i){const s=gt(i);tt.plots.push({type:"bar",fill:mt(q),data:s}),q++}function yt(){if(0===tt.plots.length)throw Error("No Plot to render, please provide a plot with some data");return tt.title=f(),K.build(Z,tt,J,Q)}function At(){return J}function kt(){return Z}function wt(){return tt}g(ht,"getChartDefaultThemeConfig"),g(rt,"getChartDefaultConfig"),g(at,"getChartDefaultData"),g(nt,"textSanitizer"),g(ot,"setTmpSVGG"),g(ct,"setOrientation"),g(lt,"setXAxisTitle"),g(ut,"setXAxisRangeData"),g(ft,"setXAxisBand"),g(xt,"setYAxisTitle"),g(pt,"setYAxisRangeData"),g(dt,"setYAxisRangeFromPlotData"),g(gt,"transformDataWithoutCategory"),g(mt,"getPlotColorFromPalette"),g(bt,"setLineData"),g(_t,"setBarData"),g(yt,"getDrawableElem"),g(At,"getChartThemeConfig"),g(kt,"getChartConfig"),g(wt,"getXYChartData");var Tt={parser:L,db:{getDrawableElem:yt,clear:g(function(){y(),q=0,Z=rt(),tt={yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]},J=ht(),it=J.plotColorPalette.split(",").map(t=>t.trim()),st=!1,et=!1},"clear"),setAccTitle:d,getAccTitle:p,setDiagramTitle:x,getDiagramTitle:f,getAccDescription:u,setAccDescription:l,setOrientation:ct,setXAxisTitle:lt,setXAxisRangeData:ut,setXAxisBand:ft,setYAxisTitle:xt,setYAxisRangeData:pt,setLineData:bt,setBarData:_t,setTmpSVGG:ot,getChartThemeConfig:At,getChartConfig:kt,getXYChartData:wt},renderer:{draw:g((t,i,s,e)=>{const h=e.db,r=h.getChartThemeConfig(),a=h.getChartConfig(),n=h.getXYChartData().plots[0].data.map(t=>t[1]);function o(t){return"top"===t?"text-before-edge":"middle"}function c(t){return"left"===t?"start":"right"===t?"end":"middle"}function l(t){return`translate(${t.x}, ${t.y}) rotate(${t.rotation||0})`}g(o,"getDominantBaseLine"),g(c,"getTextAnchor"),g(l,"getTextTransformation"),m.debug("Rendering xychart chart\n"+t);const u=b(i),f=u.append("g").attr("class","main"),x=f.append("rect").attr("width",a.width).attr("height",a.height).attr("class","background");_(u,a.height,a.width,!0),u.attr("viewBox",`0 0 ${a.width} ${a.height}`),x.attr("fill",r.backgroundColor),h.setTmpSVGG(u.append("g").attr("class","mermaid-tmp-group"));const p=h.getDrawableElem(),d={};function y(t){let i=f,s="";for(const[e]of t.entries()){let h=f;e>0&&d[s]&&(h=d[s]),s+=t[e],i=d[s],i||(i=d[s]=h.append("g").attr("class",t[e]))}return i}g(y,"getGroup");for(const m of p){if(0===m.data.length)continue;const t=y(m.groupTexts);switch(m.type){case"rect":if(t.selectAll("rect").data(m.data).enter().append("rect").attr("x",t=>t.x).attr("y",t=>t.y).attr("width",t=>t.width).attr("height",t=>t.height).attr("fill",t=>t.fill).attr("stroke",t=>t.strokeFill).attr("stroke-width",t=>t.strokeWidth),a.showDataLabel)if("horizontal"===a.chartOrientation){let i=function(t,i){const{data:e,label:h}=t;return i*h.length*s<=e.width-10};g(i,"fitsHorizontally");const s=.7,e=m.data.map((t,i)=>({data:t,label:n[i].toString()})).filter(t=>t.data.width>0&&t.data.height>0),h=e.map(t=>{const{data:s}=t;let e=.7*s.height;for(;!i(t,e)&&e>0;)e-=1;return e}),r=Math.floor(Math.min(...h));t.selectAll("text").data(e).enter().append("text").attr("x",t=>t.data.x+t.data.width-10).attr("y",t=>t.data.y+t.data.height/2).attr("text-anchor","end").attr("dominant-baseline","middle").attr("fill","black").attr("font-size",`${r}px`).text(t=>t.label)}else{let i=function(t,i,s){const{data:e,label:h}=t,r=i*h.length*.7,a=e.x+e.width/2,n=a+r/2,o=a-r/2>=e.x&&n<=e.x+e.width,c=e.y+s+i<=e.y+e.height;return o&&c};g(i,"fitsInBar");const s=10,e=m.data.map((t,i)=>({data:t,label:n[i].toString()})).filter(t=>t.data.width>0&&t.data.height>0),h=e.map(t=>{const{data:e,label:h}=t;let r=e.width/(.7*h.length);for(;!i(t,r,s)&&r>0;)r-=1;return r}),r=Math.floor(Math.min(...h));t.selectAll("text").data(e).enter().append("text").attr("x",t=>t.data.x+t.data.width/2).attr("y",t=>t.data.y+s).attr("text-anchor","middle").attr("dominant-baseline","hanging").attr("fill","black").attr("font-size",`${r}px`).text(t=>t.label)}break;case"text":t.selectAll("text").data(m.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",t=>t.fill).attr("font-size",t=>t.fontSize).attr("dominant-baseline",t=>o(t.verticalPos)).attr("text-anchor",t=>c(t.horizontalPos)).attr("transform",t=>l(t)).text(t=>t.text);break;case"path":t.selectAll("path").data(m.data).enter().append("path").attr("d",t=>t.path).attr("fill",t=>t.fill?t.fill:"none").attr("stroke",t=>t.strokeFill).attr("stroke-width",t=>t.strokeWidth)}}},"draw")}};export{Tt as diagram};
|
|
1
|
+
var t,i,s,e,h,r,a,n,o,c;import{s as l,g as u,q as f,p as x,a as p,b as d,_ as g,l as m,H as b,e as _,y,F as A,i as k,D as w,E as T,K as v,aA as S,R as M}from"./index-30onxp6I.js";import{i as D}from"./init-C9Lo50Hz.js";import{o as E}from"./ordinal-2upbOM02.js";import{l as R}from"./linear-VOTetRqU.js";import"./defaultLocale-DK_abR1s.js";function C(){var t,i,s=E().unknown(void 0),e=s.domain,h=s.range,r=0,a=1,n=!1,o=0,c=0,l=.5;function u(){var s=e().length,u=a<r,f=u?a:r,x=u?r:a;t=(x-f)/Math.max(1,s-o+2*c),n&&(t=Math.floor(t)),f+=(x-f-t*(s-o))*l,i=t*(1-o),n&&(f=Math.round(f),i=Math.round(i));var p=function(t,i,s){t=+t,i=+i,s=(h=arguments.length)<2?(i=t,t=0,1):h<3?1:+s;for(var e=-1,h=0|Math.max(0,Math.ceil((i-t)/s)),r=new Array(h);++e<h;)r[e]=t+e*s;return r}(s).map(function(i){return f+t*i});return h(u?p.reverse():p)}return delete s.unknown,s.domain=function(t){return arguments.length?(e(t),u()):e()},s.range=function(t){return arguments.length?([r,a]=t,r=+r,a=+a,u()):[r,a]},s.rangeRound=function(t){return[r,a]=t,r=+r,a=+a,n=!0,u()},s.bandwidth=function(){return i},s.step=function(){return t},s.round=function(t){return arguments.length?(n=!!t,u()):n},s.padding=function(t){return arguments.length?(o=Math.min(1,c=+t),u()):o},s.paddingInner=function(t){return arguments.length?(o=Math.min(1,t),u()):o},s.paddingOuter=function(t){return arguments.length?(c=+t,u()):c},s.align=function(t){return arguments.length?(l=Math.max(0,Math.min(1,t)),u()):l},s.copy=function(){return C(e(),[r,a]).round(n).paddingInner(o).paddingOuter(c).align(l)},D.apply(u(),arguments)}var I=function(){var t=g(function(t,i,s,e){for(s=s||{},e=t.length;e--;s[t[e]]=i);return s},"o"),i=[1,10,12,14,16,18,19,21,23],s=[2,6],e=[1,3],h=[1,5],r=[1,6],a=[1,7],n=[1,5,10,12,14,16,18,19,21,23,34,35,36],o=[1,25],c=[1,26],l=[1,28],u=[1,29],f=[1,30],x=[1,31],p=[1,32],d=[1,33],m=[1,34],b=[1,35],_=[1,36],y=[1,37],A=[1,43],k=[1,42],w=[1,47],T=[1,50],v=[1,10,12,14,16,18,19,21,23,34,35,36],S=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],M=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],D=[1,64],E={trace:g(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,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$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",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"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],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:g(function(t,i,s,e,h,r,a){var n=r.length-1;switch(h){case 5:e.setOrientation(r[n]);break;case 9:e.setDiagramTitle(r[n].text.trim());break;case 12:e.setLineData({text:"",type:"text"},r[n]);break;case 13:e.setLineData(r[n-1],r[n]);break;case 14:e.setBarData({text:"",type:"text"},r[n]);break;case 15:e.setBarData(r[n-1],r[n]);break;case 16:this.$=r[n].trim(),e.setAccTitle(this.$);break;case 17:case 18:this.$=r[n].trim(),e.setAccDescription(this.$);break;case 19:case 27:this.$=r[n-1];break;case 20:this.$=[Number(r[n-2]),...r[n]];break;case 21:this.$=[Number(r[n])];break;case 22:e.setXAxisTitle(r[n]);break;case 23:e.setXAxisTitle(r[n-1]);break;case 24:e.setXAxisTitle({type:"text",text:""});break;case 25:e.setXAxisBand(r[n]);break;case 26:e.setXAxisRangeData(Number(r[n-2]),Number(r[n]));break;case 28:this.$=[r[n-2],...r[n]];break;case 29:this.$=[r[n]];break;case 30:e.setYAxisTitle(r[n]);break;case 31:e.setYAxisTitle(r[n-1]);break;case 32:e.setYAxisTitle({type:"text",text:""});break;case 33:e.setYAxisRangeData(Number(r[n-2]),Number(r[n]));break;case 37:case 38:this.$={text:r[n],type:"text"};break;case 39:this.$={text:r[n],type:"markdown"};break;case 40:this.$=r[n];break;case 41:this.$=r[n-1]+""+r[n]}},"anonymous"),table:[t(i,s,{3:1,4:2,7:4,5:e,34:h,35:r,36:a}),{1:[3]},t(i,s,{4:2,7:4,3:8,5:e,34:h,35:r,36:a}),t(i,s,{4:2,7:4,6:9,3:10,5:e,8:[1,11],34:h,35:r,36:a}),{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]},t(n,[2,34]),t(n,[2,35]),t(n,[2,36]),{1:[2,1]},t(i,s,{4:2,7:4,3:21,5:e,34:h,35:r,36:a}),{1:[2,3]},t(n,[2,5]),t(i,[2,7],{4:22,34:h,35:r,36:a}),{11:23,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:39,13:38,24:A,27:k,29:40,30:41,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:45,15:44,27:w,33:46,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:49,17:48,24:T,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:52,17:51,24:T,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{20:[1,53]},{22:[1,54]},t(v,[2,18]),{1:[2,2]},t(v,[2,8]),t(v,[2,9]),t(S,[2,37],{40:55,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y}),t(S,[2,38]),t(S,[2,39]),t(M,[2,40]),t(M,[2,42]),t(M,[2,43]),t(M,[2,44]),t(M,[2,45]),t(M,[2,46]),t(M,[2,47]),t(M,[2,48]),t(M,[2,49]),t(M,[2,50]),t(M,[2,51]),t(v,[2,10]),t(v,[2,22],{30:41,29:56,24:A,27:k}),t(v,[2,24]),t(v,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},t(v,[2,11]),t(v,[2,30],{33:60,27:w}),t(v,[2,32]),{31:[1,61]},t(v,[2,12]),{17:62,24:T},{25:63,27:D},t(v,[2,14]),{17:65,24:T},t(v,[2,16]),t(v,[2,17]),t(M,[2,41]),t(v,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(v,[2,31]),{27:[1,69]},t(v,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(v,[2,15]),t(v,[2,26]),t(v,[2,27]),{11:59,32:72,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},t(v,[2,33]),t(v,[2,19]),{25:73,27:D},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:g(function(t,i){if(!i.recoverable){var s=new Error(t);throw s.hash=i,s}this.trace(t)},"parseError"),parse:g(function(t){var i=this,s=[0],e=[],h=[null],r=[],a=this.table,n="",o=0,c=0,l=r.slice.call(arguments,1),u=Object.create(this.lexer),f={yy:{}};for(var x in this.yy)Object.prototype.hasOwnProperty.call(this.yy,x)&&(f.yy[x]=this.yy[x]);u.setInput(t,f.yy),f.yy.lexer=u,f.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var p=u.yylloc;r.push(p);var d=u.options&&u.options.ranges;function m(){var t;return"number"!=typeof(t=e.pop()||u.lex()||1)&&(t instanceof Array&&(t=(e=t).pop()),t=i.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,g(function(t){s.length=s.length-2*t,h.length=h.length-t,r.length=r.length-t},"popStack"),g(m,"lex");for(var b,_,y,A,k,w,T,v,S={};;){if(_=s[s.length-1],this.defaultActions[_]?y=this.defaultActions[_]:(null==b&&(b=m()),y=a[_]&&a[_][b]),void 0===y||!y.length||!y[0]){var M="";for(k in v=[],a[_])this.terminals_[k]&&k>2&&v.push("'"+this.terminals_[k]+"'");M=u.showPosition?"Parse error on line "+(o+1)+":\n"+u.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(M,{text:u.match,token:this.terminals_[b]||b,line:u.yylineno,loc:p,expected:v})}if(y[0]instanceof Array&&y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(y[0]){case 1:s.push(b),h.push(u.yytext),r.push(u.yylloc),s.push(y[1]),b=null,c=u.yyleng,n=u.yytext,o=u.yylineno,p=u.yylloc;break;case 2:if(w=this.productions_[y[1]][1],S.$=h[h.length-w],S._$={first_line:r[r.length-(w||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(w||1)].first_column,last_column:r[r.length-1].last_column},d&&(S._$.range=[r[r.length-(w||1)].range[0],r[r.length-1].range[1]]),void 0!==(A=this.performAction.apply(S,[n,c,o,f.yy,y[1],h,r].concat(l))))return A;w&&(s=s.slice(0,-1*w*2),h=h.slice(0,-1*w),r=r.slice(0,-1*w)),s.push(this.productions_[y[1]][0]),h.push(S.$),r.push(S._$),T=a[s[s.length-2]][s[s.length-1]],s.push(T);break;case 3:return!0}}return!0},"parse")},R=function(){return{EOF:1,parseError:g(function(t,i){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,i)},"parseError"),setInput:g(function(t,i){return this.yy=i||this.yy||{},this._input=t,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]),this.offset=0,this},"setInput"),input:g(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:g(function(t){var i=t.length,s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var e=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1&&(this.yylineno-=s.length-1);var h=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===e.length?this.yylloc.first_column:0)+e[e.length-s.length].length-s[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[h[0],h[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:g(function(t){this.unput(this.match.slice(t))},"less"),pastInput:g(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:g(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:g(function(){var t=this.pastInput(),i=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+i+"^"},"showPosition"),test_match:g(function(t,i){var s,e,h;if(this.options.backtrack_lexer&&(h={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&&(h.yylloc.range=this.yylloc.range.slice(0))),(e=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var r in h)this[r]=h[r];return!1}return!1},"test_match"),next:g(function(){if(this.done)return this.EOF;var t,i,s,e;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var h=this._currentRules(),r=0;r<h.length;r++)if((s=this._input.match(this.rules[h[r]]))&&(!i||s[0].length>i[0].length)){if(i=s,e=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,h[r])))return t;if(this._backtrack){i=!1;continue}return!1}if(!this.options.flex)break}return i?!1!==(t=this.test_match(i,h[e]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:g(function(){var t=this.next();return t||this.lex()},"lex"),begin:g(function(t){this.conditionStack.push(t)},"begin"),popState:g(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:g(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:g(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:g(function(t){this.begin(t)},"pushState"),stateStackSize:g(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:g(function(t,i,s,e){switch(s){case 0:case 1:case 5:case 44:break;case 2:case 3:return this.popState(),34;case 4:return 34;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:case 26:case 28:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 31;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 27;case 25:return this.popState(),26;case 27:this.pushState("string");break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 43;case 33:return"COLON";case 34:return 44;case 35:return 28;case 36:return 45;case 37:return 46;case 38:return 48;case 39:return 50;case 40:return 47;case 41:return 41;case 42:return 49;case 43:return 42;case 45:return 35;case 46:return 36}},"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}}}}();function C(){this.yy={}}return E.lexer=R,g(C,"Parser"),C.prototype=E,E.Parser=C,new C}();I.parser=I;var L=I;function P(t){return"bar"===t.type}function $(t){return"band"===t.type}function N(t){return"linear"===t.type}g(P,"isBarPlot"),g($,"isBandAxisData"),g(N,"isLinearAxisData");var z=(g(t=class{constructor(t){this.parentGroup=t}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((t,i)=>Math.max(i.length,t),0)*i,height:i};const s={width:0,height:0},e=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const h of t){const t=S(e,1,h),r=t?t.width:h.length*i,a=t?t.height:i;s.width=Math.max(s.width,r),s.height=Math.max(s.height,a)}return e.remove(),s}},"TextDimensionCalculatorWithFont"),t),B=(g(i=class{constructor(t,i,s,e){this.axisConfig=t,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=e,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.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}setRange(t){this.range=t,"left"===this.axisPosition||"right"===this.axisPosition?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){.7*this.getTickDistance()>2*this.outerPadding&&(this.outerPadding=Math.floor(.7*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),e=.2*t.width;this.outerPadding=Math.min(s.width/2,e);const h=s.height+2*this.axisConfig.labelPadding;this.labelTextHeight=s.height,h<=i&&(i-=h,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),s=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,s<=i&&(i-=s,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),e=.2*t.height;this.outerPadding=Math.min(s.height/2,e);const h=s.width+2*this.axisConfig.labelPadding;h<=i&&(i-=h,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),s=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,s<=i&&(i-=s,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return"left"===this.axisPosition||"right"===this.axisPosition?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.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&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(t=>({text:t.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(t),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(t=>({path:`M ${i},${this.getScaleValue(t)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(t)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.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"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.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&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(t=>({path:`M ${this.getScaleValue(t)},${i} L ${this.getScaleValue(t)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.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"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.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&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+2*this.axisConfig.titlePadding:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(t=>({path:`M ${this.getScaleValue(t)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(t)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.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"}]}),t}getDrawableElements(){if("left"===this.axisPosition)return this.getDrawableElementsForLeftAxis();if("right"===this.axisPosition)throw Error("Drawing of right axis is not implemented");return"bottom"===this.axisPosition?this.getDrawableElementsForBottomAxis():"top"===this.axisPosition?this.getDrawableElementsForTopAxis():[]}},"BaseAxis"),i),O=(g(s=class extends B{constructor(t,i,s,e,h){super(t,e,h,i),this.categories=s,this.scale=C().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=C().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),m.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},"BandAxis"),s),X=(g(e=class extends B{constructor(t,i,s,e,h){super(t,e,h,i),this.domain=s,this.scale=R().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];"left"===this.axisPosition&&t.reverse(),this.scale=R().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}},"LinearAxis"),e);function F(t,i,s,e){const h=new z(e);return $(t)?new O(i,s,t.categories,t.title,h):new X(i,s,[t.min,t.max],t.title,h)}g(F,"getAxis");var U=(g(h=class{constructor(t,i,s,e){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=e,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(i.width,t.width),e=i.height+2*this.chartConfig.titlePadding;return i.width<=s&&i.height<=e&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=s,this.boundingRect.height=e,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const t=[];return this.showChartTitle&&t.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}]}),t}},"ChartTitle"),h);function W(t,i,s,e){const h=new z(e);return new U(h,t,i,s)}g(W,"getChartTitleComponent");var Y=(g(r=class{constructor(t,i,s,e,h){this.plotData=t,this.xAxis=i,this.yAxis=s,this.orientation=e,this.plotIndex=h}getDrawableElement(){const t=this.plotData.data.map(t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]);let i;return i="horizontal"===this.orientation?M().y(t=>t[0]).x(t=>t[1])(t):M().x(t=>t[0]).y(t=>t[1])(t),i?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},"LinePlot"),r),j=(g(a=class{constructor(t,i,s,e,h,r){this.barData=t,this.boundingRect=i,this.xAxis=s,this.yAxis=e,this.orientation=h,this.plotIndex=r}getDrawableElement(){const t=this.barData.data.map(t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]),i=.95*Math.min(2*this.xAxis.getAxisOuterPadding(),this.xAxis.getTickDistance()),s=i/2;return"horizontal"===this.orientation?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(t=>({x:this.boundingRect.x,y:t[0]-s,height:i,width:t[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(t=>({x:t[0]-s,y:t[1],width:i,height:this.boundingRect.y+this.boundingRect.height-t[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},"BarPlot"),a),H=(g(n=class{constructor(t,i,s){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(t,i){this.xAxis=t,this.yAxis=i}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!this.xAxis||!this.yAxis)throw Error("Axes must be passed to render Plots");const t=[];for(const[i,s]of this.chartData.plots.entries())switch(s.type){case"line":{const e=new Y(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...e.getDrawableElement())}break;case"bar":{const e=new j(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...e.getDrawableElement())}}return t}},"BasePlot"),n);function V(t,i,s){return new H(t,i,s)}g(V,"getPlotComponent");var Q,G=(g(o=class{constructor(t,i,s,e){this.chartConfig=t,this.chartData=i,this.componentStore={title:W(t,i,s,e),plot:V(t,i,s),xAxis:F(i.xAxis,t.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},e),yAxis:F(i.yAxis,t.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},e)}}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,e=0,h=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),r=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),a=this.componentStore.plot.calculateSpace({width:h,height:r});t-=a.width,i-=a.height,a=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),e=a.height,i-=a.height,this.componentStore.xAxis.setAxisPosition("bottom"),a=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=a.height,this.componentStore.yAxis.setAxisPosition("left"),a=this.componentStore.yAxis.calculateSpace({width:t,height:i}),s=a.width,t-=a.width,t>0&&(h+=t,t=0),i>0&&(r+=i,i=0),this.componentStore.plot.calculateSpace({width:h,height:r}),this.componentStore.plot.setBoundingBoxXY({x:s,y:e}),this.componentStore.xAxis.setRange([s,s+h]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:e+r}),this.componentStore.yAxis.setRange([e,e+r]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:e}),this.chartData.plots.some(t=>P(t))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,e=0,h=0,r=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),a=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),n=this.componentStore.plot.calculateSpace({width:r,height:a});t-=n.width,i-=n.height,n=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=n.height,i-=n.height,this.componentStore.xAxis.setAxisPosition("left"),n=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=n.width,e=n.width,this.componentStore.yAxis.setAxisPosition("top"),n=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=n.height,h=s+n.height,t>0&&(r+=t,t=0),i>0&&(a+=i,i=0),this.componentStore.plot.calculateSpace({width:r,height:a}),this.componentStore.plot.setBoundingBoxXY({x:e,y:h}),this.componentStore.yAxis.setRange([e,e+r]),this.componentStore.yAxis.setBoundingBoxXY({x:e,y:s}),this.componentStore.xAxis.setRange([h,h+a]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:h}),this.chartData.plots.some(t=>P(t))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){"horizontal"===this.chartConfig.chartOrientation?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const i of Object.values(this.componentStore))t.push(...i.getDrawableElements());return t}},"Orchestrator"),o),K=(g(c=class{static build(t,i,s,e){return new G(t,i,s,e).getDrawableElement()}},"XYChartBuilder"),c),q=0,Z=rt(),J=ht(),tt=at(),it=J.plotColorPalette.split(",").map(t=>t.trim()),st=!1,et=!1;function ht(){const t=v(),i=A();return w(t.xyChart,i.themeVariables.xyChart)}function rt(){const t=A();return w(T.xyChart,t.xyChart)}function at(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function nt(t){const i=A();return k(t.trim(),i)}function ot(t){Q=t}function ct(t){Z.chartOrientation="horizontal"===t?"horizontal":"vertical"}function lt(t){tt.xAxis.title=nt(t.text)}function ut(t,i){tt.xAxis={type:"linear",title:tt.xAxis.title,min:t,max:i},st=!0}function ft(t){tt.xAxis={type:"band",title:tt.xAxis.title,categories:t.map(t=>nt(t.text))},st=!0}function xt(t){tt.yAxis.title=nt(t.text)}function pt(t,i){tt.yAxis={type:"linear",title:tt.yAxis.title,min:t,max:i},et=!0}function dt(t){const i=Math.min(...t),s=Math.max(...t),e=N(tt.yAxis)?tt.yAxis.min:1/0,h=N(tt.yAxis)?tt.yAxis.max:-1/0;tt.yAxis={type:"linear",title:tt.yAxis.title,min:Math.min(e,i),max:Math.max(h,s)}}function gt(t){let i=[];if(0===t.length)return i;if(!st){const i=N(tt.xAxis)?tt.xAxis.min:1/0,s=N(tt.xAxis)?tt.xAxis.max:-1/0;ut(Math.min(i,1),Math.max(s,t.length))}if(et||dt(t),$(tt.xAxis)&&(i=tt.xAxis.categories.map((i,s)=>[i,t[s]])),N(tt.xAxis)){const s=tt.xAxis.min,e=tt.xAxis.max,h=(e-s)/(t.length-1),r=[];for(let t=s;t<=e;t+=h)r.push(`${t}`);i=r.map((i,s)=>[i,t[s]])}return i}function mt(t){return it[0===t?0:t%it.length]}function bt(t,i){const s=gt(i);tt.plots.push({type:"line",strokeFill:mt(q),strokeWidth:2,data:s}),q++}function _t(t,i){const s=gt(i);tt.plots.push({type:"bar",fill:mt(q),data:s}),q++}function yt(){if(0===tt.plots.length)throw Error("No Plot to render, please provide a plot with some data");return tt.title=f(),K.build(Z,tt,J,Q)}function At(){return J}function kt(){return Z}function wt(){return tt}g(ht,"getChartDefaultThemeConfig"),g(rt,"getChartDefaultConfig"),g(at,"getChartDefaultData"),g(nt,"textSanitizer"),g(ot,"setTmpSVGG"),g(ct,"setOrientation"),g(lt,"setXAxisTitle"),g(ut,"setXAxisRangeData"),g(ft,"setXAxisBand"),g(xt,"setYAxisTitle"),g(pt,"setYAxisRangeData"),g(dt,"setYAxisRangeFromPlotData"),g(gt,"transformDataWithoutCategory"),g(mt,"getPlotColorFromPalette"),g(bt,"setLineData"),g(_t,"setBarData"),g(yt,"getDrawableElem"),g(At,"getChartThemeConfig"),g(kt,"getChartConfig"),g(wt,"getXYChartData");var Tt={parser:L,db:{getDrawableElem:yt,clear:g(function(){y(),q=0,Z=rt(),tt={yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]},J=ht(),it=J.plotColorPalette.split(",").map(t=>t.trim()),st=!1,et=!1},"clear"),setAccTitle:d,getAccTitle:p,setDiagramTitle:x,getDiagramTitle:f,getAccDescription:u,setAccDescription:l,setOrientation:ct,setXAxisTitle:lt,setXAxisRangeData:ut,setXAxisBand:ft,setYAxisTitle:xt,setYAxisRangeData:pt,setLineData:bt,setBarData:_t,setTmpSVGG:ot,getChartThemeConfig:At,getChartConfig:kt,getXYChartData:wt},renderer:{draw:g((t,i,s,e)=>{const h=e.db,r=h.getChartThemeConfig(),a=h.getChartConfig(),n=h.getXYChartData().plots[0].data.map(t=>t[1]);function o(t){return"top"===t?"text-before-edge":"middle"}function c(t){return"left"===t?"start":"right"===t?"end":"middle"}function l(t){return`translate(${t.x}, ${t.y}) rotate(${t.rotation||0})`}g(o,"getDominantBaseLine"),g(c,"getTextAnchor"),g(l,"getTextTransformation"),m.debug("Rendering xychart chart\n"+t);const u=b(i),f=u.append("g").attr("class","main"),x=f.append("rect").attr("width",a.width).attr("height",a.height).attr("class","background");_(u,a.height,a.width,!0),u.attr("viewBox",`0 0 ${a.width} ${a.height}`),x.attr("fill",r.backgroundColor),h.setTmpSVGG(u.append("g").attr("class","mermaid-tmp-group"));const p=h.getDrawableElem(),d={};function y(t){let i=f,s="";for(const[e]of t.entries()){let h=f;e>0&&d[s]&&(h=d[s]),s+=t[e],i=d[s],i||(i=d[s]=h.append("g").attr("class",t[e]))}return i}g(y,"getGroup");for(const m of p){if(0===m.data.length)continue;const t=y(m.groupTexts);switch(m.type){case"rect":if(t.selectAll("rect").data(m.data).enter().append("rect").attr("x",t=>t.x).attr("y",t=>t.y).attr("width",t=>t.width).attr("height",t=>t.height).attr("fill",t=>t.fill).attr("stroke",t=>t.strokeFill).attr("stroke-width",t=>t.strokeWidth),a.showDataLabel)if("horizontal"===a.chartOrientation){let i=function(t,i){const{data:e,label:h}=t;return i*h.length*s<=e.width-10};g(i,"fitsHorizontally");const s=.7,e=m.data.map((t,i)=>({data:t,label:n[i].toString()})).filter(t=>t.data.width>0&&t.data.height>0),h=e.map(t=>{const{data:s}=t;let e=.7*s.height;for(;!i(t,e)&&e>0;)e-=1;return e}),r=Math.floor(Math.min(...h));t.selectAll("text").data(e).enter().append("text").attr("x",t=>t.data.x+t.data.width-10).attr("y",t=>t.data.y+t.data.height/2).attr("text-anchor","end").attr("dominant-baseline","middle").attr("fill","black").attr("font-size",`${r}px`).text(t=>t.label)}else{let i=function(t,i,s){const{data:e,label:h}=t,r=i*h.length*.7,a=e.x+e.width/2,n=a+r/2,o=a-r/2>=e.x&&n<=e.x+e.width,c=e.y+s+i<=e.y+e.height;return o&&c};g(i,"fitsInBar");const s=10,e=m.data.map((t,i)=>({data:t,label:n[i].toString()})).filter(t=>t.data.width>0&&t.data.height>0),h=e.map(t=>{const{data:e,label:h}=t;let r=e.width/(.7*h.length);for(;!i(t,r,s)&&r>0;)r-=1;return r}),r=Math.floor(Math.min(...h));t.selectAll("text").data(e).enter().append("text").attr("x",t=>t.data.x+t.data.width/2).attr("y",t=>t.data.y+s).attr("text-anchor","middle").attr("dominant-baseline","hanging").attr("fill","black").attr("font-size",`${r}px`).text(t=>t.label)}break;case"text":t.selectAll("text").data(m.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",t=>t.fill).attr("font-size",t=>t.fontSize).attr("dominant-baseline",t=>o(t.verticalPos)).attr("text-anchor",t=>c(t.horizontalPos)).attr("transform",t=>l(t)).text(t=>t.text);break;case"path":t.selectAll("path").data(m.data).enter().append("path").attr("d",t=>t.path).attr("fill",t=>t.fill?t.fill:"none").attr("stroke",t=>t.strokeFill).attr("stroke-width",t=>t.strokeWidth)}}},"draw")}};export{Tt as diagram};
|
|
Binary file
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
<meta name="mobile-web-app-capable" content="yes" />
|
|
10
10
|
<link rel="icon" type="image/png" href="/favicon.png" />
|
|
11
11
|
<title>OmniContext CLI</title>
|
|
12
|
-
<script type="module" crossorigin src="/assets/index-
|
|
13
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
12
|
+
<script type="module" crossorigin src="/assets/index-30onxp6I.js"></script>
|
|
13
|
+
<link rel="stylesheet" crossorigin href="/assets/index-pGSHhaP9.css">
|
|
14
14
|
</head>
|
|
15
15
|
|
|
16
16
|
<body>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: simplify
|
|
3
|
+
description: Review changed code for reuse, quality, and efficiency, then fix any issues found. Use when the user asks to review, clean up, or simplify recent code changes.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Simplify: Code Review and Cleanup
|
|
7
|
+
|
|
8
|
+
Review all changed files for reuse, quality, and efficiency. Fix any issues found.
|
|
9
|
+
|
|
10
|
+
## Phase 1: Identify Changes
|
|
11
|
+
|
|
12
|
+
Run `git diff` (or `git diff HEAD` if there are staged changes) to see what changed. If there are no git changes, review the most recently modified files that the user mentioned or that you edited earlier in this conversation.
|
|
13
|
+
|
|
14
|
+
## Phase 2: Review
|
|
15
|
+
|
|
16
|
+
### Code Reuse
|
|
17
|
+
|
|
18
|
+
For each change:
|
|
19
|
+
|
|
20
|
+
1. **Search for existing utilities and helpers** that could replace newly written code. Look for similar patterns elsewhere in the codebase -- common locations are utility directories, shared modules, and files adjacent to the changed ones.
|
|
21
|
+
2. **Flag any new function that duplicates existing functionality.** Suggest the existing function to use instead.
|
|
22
|
+
3. **Flag any inline logic that could use an existing utility** -- hand-rolled string manipulation, manual path handling, custom environment checks, ad-hoc type guards, and similar patterns are common candidates.
|
|
23
|
+
|
|
24
|
+
### Code Quality
|
|
25
|
+
|
|
26
|
+
Review the same changes for hacky patterns:
|
|
27
|
+
|
|
28
|
+
1. **Redundant state**: state that duplicates existing state, cached values that could be derived, observers/effects that could be direct calls
|
|
29
|
+
2. **Parameter sprawl**: adding new parameters to a function instead of generalizing or restructuring existing ones
|
|
30
|
+
3. **Copy-paste with slight variation**: near-duplicate code blocks that should be unified with a shared abstraction
|
|
31
|
+
4. **Leaky abstractions**: exposing internal details that should be encapsulated, or breaking existing abstraction boundaries
|
|
32
|
+
5. **Stringly-typed code**: using raw strings where constants, enums (string unions), or branded types already exist in the codebase
|
|
33
|
+
6. **Unnecessary comments**: comments explaining WHAT the code does (well-named identifiers already do that), narrating the change, or referencing the task/caller -- delete; keep only non-obvious WHY (hidden constraints, subtle invariants, workarounds)
|
|
34
|
+
|
|
35
|
+
### Efficiency
|
|
36
|
+
|
|
37
|
+
Review the same changes for efficiency:
|
|
38
|
+
|
|
39
|
+
1. **Unnecessary work**: redundant computations, repeated file reads, duplicate network/API calls, N+1 patterns
|
|
40
|
+
2. **Missed concurrency**: independent operations run sequentially when they could run in parallel
|
|
41
|
+
3. **Hot-path bloat**: new blocking work added to startup or per-request/per-render hot paths
|
|
42
|
+
4. **Recurring no-op updates**: state/store updates inside polling loops, intervals, or event handlers that fire unconditionally -- add a change-detection guard so downstream consumers aren't notified when nothing changed
|
|
43
|
+
5. **Unnecessary existence checks**: pre-checking file/resource existence before operating (TOCTOU anti-pattern) -- operate directly and handle the error
|
|
44
|
+
6. **Memory**: unbounded data structures, missing cleanup, event listener leaks
|
|
45
|
+
7. **Overly broad operations**: reading entire files when only a portion is needed, loading all items when filtering for one
|
|
46
|
+
|
|
47
|
+
## Phase 3: Fix Issues
|
|
48
|
+
|
|
49
|
+
After completing the review, fix each issue directly. If a finding is a false positive or not worth addressing, note it and move on.
|
|
50
|
+
|
|
51
|
+
When done, briefly summarize what was fixed (or confirm the code was already clean).
|
|
52
|
+
|
|
53
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: General
|
|
3
|
+
icon: "◇"
|
|
4
|
+
allowBaseTools: true
|
|
5
|
+
allowCustomAgents: true
|
|
6
|
+
allowMcpTools: true
|
|
7
|
+
allowRemoteTools: true
|
|
8
|
+
---
|
|
9
|
+
Omx is a versatile personal assistant connected to the user's
|
|
10
|
+
applications. You can read, edit, and create content in whatever app
|
|
11
|
+
the user currently has open. Be proactive about using your tools to
|
|
12
|
+
inspect the document, spreadsheet, or presentation before answering
|
|
13
|
+
questions about it. When the user asks you to make changes, apply
|
|
14
|
+
them directly rather than just describing what to do. Keep your
|
|
15
|
+
responses clear, friendly, and to the point. Match the tone of the
|
|
16
|
+
conversation -- casual when chatting, precise when working on
|
|
17
|
+
something specific. Avoid jargon unless the user uses it first.
|
|
18
|
+
You're running on {{OS_TYPE}} ({{PLATFORM}}/{{ARCH}}). The current
|
|
19
|
+
working directory is {{CWD}}. Today is {{TODAY}}.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Programming
|
|
3
|
+
icon: "○"
|
|
4
|
+
allowBaseTools: true
|
|
5
|
+
allowBuiltinAgents: true
|
|
6
|
+
allowCustomAgents: true
|
|
7
|
+
allowMcpTools: true
|
|
8
|
+
allowRemoteTools: true
|
|
9
|
+
---
|
|
10
|
+
Omx is a small, helpful, zero-telemetry coding assistant. Keep your
|
|
11
|
+
responses short and concise, using markdown for formatting. Avoid
|
|
12
|
+
emojis and special Unicode characters. Stick to plain ASCII text that
|
|
13
|
+
displays well in any terminal. Always communicate through text. Never
|
|
14
|
+
use tools or code comments to talk to the user. Prefer editing
|
|
15
|
+
existing files over creating new ones. Only create files when
|
|
16
|
+
absolutely necessary for the task. Before modifying code, read it
|
|
17
|
+
first to understand the current implementation. Keep it simple: make
|
|
18
|
+
only the changes that are directly requested or clearly necessary.
|
|
19
|
+
Don't add extra features, refactor unrelated code, or make
|
|
20
|
+
improvements beyond what was asked. A bug fix doesn't need the
|
|
21
|
+
surrounding code cleaned up. A simple feature doesn't need additional
|
|
22
|
+
configurability. The right level of complexity is the minimum required
|
|
23
|
+
for the current task. Use specialized tools (read, write, edit, glob,
|
|
24
|
+
grep) instead of bash when possible. Save bash for actual system
|
|
25
|
+
commands and terminal operations. Run multiple tools in parallel when
|
|
26
|
+
there are no dependencies between them. For complex or multi-step
|
|
27
|
+
tasks, lean on agent tools (prefixed with Agent_) to save context. For
|
|
28
|
+
example, use Agent_Explore for code investigation. Prioritize
|
|
29
|
+
technical accuracy and truthfulness over validating user beliefs.
|
|
30
|
+
Focus on facts and problem-solving. When referencing code, use the
|
|
31
|
+
format file_path:line_number. You're running on {{OS_TYPE}}
|
|
32
|
+
({{PLATFORM}}/{{ARCH}}), so keep this in mind for commands, paths, and
|
|
33
|
+
platform-specific guidance. The current working directory is {{CWD}}.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omni-context-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.77",
|
|
4
4
|
"description": "Omx is a small, helpful, zero-telemetry coding assistant.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"build": "node build.mjs",
|
|
12
12
|
"dev": "node build.mjs --watch",
|
|
13
13
|
"start": "node dist/cli.js",
|
|
14
|
-
"clean": "
|
|
14
|
+
"clean": "node scripts/clean.mjs",
|
|
15
15
|
"bump": "node scripts/bump-version.mjs",
|
|
16
16
|
"release": "node scripts/release-build.mjs",
|
|
17
17
|
"format": "dprint fmt",
|
|
@@ -62,7 +62,6 @@
|
|
|
62
62
|
"marked": "^17.0.1",
|
|
63
63
|
"react": "^19.2.3",
|
|
64
64
|
"react-reconciler": "^0.33.0",
|
|
65
|
-
"rimraf": "^6.1.2",
|
|
66
65
|
"string-width": "^8.1.0",
|
|
67
66
|
"turndown": "^7.2.2",
|
|
68
67
|
"typescript": "^5.9.3",
|
package/scripts/bump-version.mjs
CHANGED
|
@@ -34,15 +34,12 @@ const packages = [
|
|
|
34
34
|
'package.json',
|
|
35
35
|
'clients/browser/package.json',
|
|
36
36
|
'clients/desktop/package.json',
|
|
37
|
-
'clients/figma/package.json',
|
|
38
|
-
'clients/obsidian/package.json',
|
|
39
37
|
'clients/office/package.json',
|
|
40
38
|
'clients/vscode/package.json',
|
|
41
39
|
'clients/web/package.json',
|
|
42
40
|
];
|
|
43
41
|
|
|
44
42
|
const manifests = [
|
|
45
|
-
{ path: 'clients/obsidian/manifest.json', source: 'clients/obsidian/package.json' },
|
|
46
43
|
{ path: 'clients/browser/public/manifest.json', source: 'clients/browser/package.json' },
|
|
47
44
|
];
|
|
48
45
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { rm } from 'fs/promises';
|
|
2
|
+
|
|
3
|
+
const dirs = [
|
|
4
|
+
'dist',
|
|
5
|
+
'clients/desktop/out',
|
|
6
|
+
'clients/desktop/dist',
|
|
7
|
+
'clients/vscode/dist',
|
|
8
|
+
'clients/vscode/webview',
|
|
9
|
+
'clients/vscode/extension.vsix',
|
|
10
|
+
'clients/web/dist',
|
|
11
|
+
'clients/browser/dist',
|
|
12
|
+
'clients/office/dist',
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
for (const dir of dirs) {
|
|
16
|
+
await rm(dir, { recursive: true, force: true });
|
|
17
|
+
}
|
|
@@ -1,127 +1,25 @@
|
|
|
1
|
-
import { readFileSync, writeFileSync, readdirSync, statSync, mkdirSync, rmSync } from 'node:fs';
|
|
2
1
|
import { execSync } from 'node:child_process';
|
|
3
|
-
import { resolve, dirname,
|
|
2
|
+
import { resolve, dirname, relative } from 'node:path';
|
|
4
3
|
import { fileURLToPath } from 'node:url';
|
|
5
|
-
import { deflateRawSync } from 'node:zlib';
|
|
6
4
|
|
|
7
5
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
6
|
const root = resolve(__dirname, '..');
|
|
9
7
|
|
|
10
8
|
function run(cmd, cwd = root) {
|
|
11
|
-
console.log(`\n> ${cmd} (${relative(root, cwd) || '.'})`)
|
|
9
|
+
console.log(`\n> ${cmd} (${relative(root, cwd) || '.'})`)
|
|
12
10
|
execSync(cmd, { cwd, stdio: 'inherit' });
|
|
13
11
|
}
|
|
14
12
|
|
|
15
|
-
function readVersion(pkgPath) {
|
|
16
|
-
return JSON.parse(readFileSync(resolve(root, pkgPath), 'utf8')).version;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function collectFiles(dir) {
|
|
20
|
-
const entries = [];
|
|
21
|
-
for (const item of readdirSync(dir, { withFileTypes: true })) {
|
|
22
|
-
const full = join(dir, item.name);
|
|
23
|
-
if (item.isDirectory()) {
|
|
24
|
-
entries.push(...collectFiles(full));
|
|
25
|
-
} else {
|
|
26
|
-
entries.push({ name: relative(dir, full).replace(/\\/g, '/'), data: readFileSync(full) });
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return entries;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const CRC_TABLE = new Uint32Array(256);
|
|
33
|
-
for (let i = 0; i < 256; i++) {
|
|
34
|
-
let c = i;
|
|
35
|
-
for (let j = 0; j < 8; j++) c = c & 1 ? 0xEDB88320 ^ (c >>> 1) : c >>> 1;
|
|
36
|
-
CRC_TABLE[i] = c;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function crc32(buf) {
|
|
40
|
-
let crc = 0xFFFFFFFF;
|
|
41
|
-
for (let i = 0; i < buf.length; i++) crc = CRC_TABLE[(crc ^ buf[i]) & 0xFF] ^ (crc >>> 8);
|
|
42
|
-
return (crc ^ 0xFFFFFFFF) >>> 0;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function createZip(outputPath, sourceDir) {
|
|
46
|
-
const entries = collectFiles(sourceDir);
|
|
47
|
-
const localParts = [];
|
|
48
|
-
const centralParts = [];
|
|
49
|
-
let offset = 0;
|
|
50
|
-
|
|
51
|
-
for (const entry of entries) {
|
|
52
|
-
const nameBytes = Buffer.from(entry.name, 'utf8');
|
|
53
|
-
const raw = entry.data;
|
|
54
|
-
const compressed = deflateRawSync(raw, { level: 9 });
|
|
55
|
-
const crc = crc32(raw);
|
|
56
|
-
|
|
57
|
-
const local = Buffer.alloc(30 + nameBytes.length);
|
|
58
|
-
local.writeUInt32LE(0x04034b50, 0);
|
|
59
|
-
local.writeUInt16LE(20, 4);
|
|
60
|
-
local.writeUInt16LE(0, 6);
|
|
61
|
-
local.writeUInt16LE(8, 8);
|
|
62
|
-
local.writeUInt16LE(0, 10);
|
|
63
|
-
local.writeUInt16LE(0, 12);
|
|
64
|
-
local.writeUInt32LE(crc, 14);
|
|
65
|
-
local.writeUInt32LE(compressed.length, 18);
|
|
66
|
-
local.writeUInt32LE(raw.length, 22);
|
|
67
|
-
local.writeUInt16LE(nameBytes.length, 26);
|
|
68
|
-
local.writeUInt16LE(0, 28);
|
|
69
|
-
nameBytes.copy(local, 30);
|
|
70
|
-
|
|
71
|
-
const chunk = Buffer.concat([local, compressed]);
|
|
72
|
-
localParts.push(chunk);
|
|
73
|
-
|
|
74
|
-
const central = Buffer.alloc(46 + nameBytes.length);
|
|
75
|
-
central.writeUInt32LE(0x02014b50, 0);
|
|
76
|
-
central.writeUInt16LE(20, 4);
|
|
77
|
-
central.writeUInt16LE(20, 6);
|
|
78
|
-
central.writeUInt16LE(0, 8);
|
|
79
|
-
central.writeUInt16LE(8, 10);
|
|
80
|
-
central.writeUInt16LE(0, 12);
|
|
81
|
-
central.writeUInt16LE(0, 14);
|
|
82
|
-
central.writeUInt32LE(crc, 16);
|
|
83
|
-
central.writeUInt32LE(compressed.length, 20);
|
|
84
|
-
central.writeUInt32LE(raw.length, 24);
|
|
85
|
-
central.writeUInt16LE(nameBytes.length, 28);
|
|
86
|
-
central.writeUInt16LE(0, 30);
|
|
87
|
-
central.writeUInt16LE(0, 32);
|
|
88
|
-
central.writeUInt16LE(0, 34);
|
|
89
|
-
central.writeUInt16LE(0, 36);
|
|
90
|
-
central.writeUInt32LE(0, 38);
|
|
91
|
-
central.writeUInt32LE(offset, 42);
|
|
92
|
-
nameBytes.copy(central, 46);
|
|
93
|
-
centralParts.push(central);
|
|
94
|
-
|
|
95
|
-
offset += chunk.length;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const centralDir = Buffer.concat(centralParts);
|
|
99
|
-
const endRecord = Buffer.alloc(22);
|
|
100
|
-
endRecord.writeUInt32LE(0x06054b50, 0);
|
|
101
|
-
endRecord.writeUInt16LE(0, 4);
|
|
102
|
-
endRecord.writeUInt16LE(0, 6);
|
|
103
|
-
endRecord.writeUInt16LE(entries.length, 8);
|
|
104
|
-
endRecord.writeUInt16LE(entries.length, 10);
|
|
105
|
-
endRecord.writeUInt32LE(centralDir.length, 12);
|
|
106
|
-
endRecord.writeUInt32LE(offset, 16);
|
|
107
|
-
endRecord.writeUInt16LE(0, 20);
|
|
108
|
-
|
|
109
|
-
writeFileSync(outputPath, Buffer.concat([...localParts, centralDir, endRecord]));
|
|
110
|
-
const size = statSync(outputPath).size;
|
|
111
|
-
console.log(` -> ${relative(root, outputPath)} (${(size / 1024).toFixed(1)} KB)`);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
13
|
console.log('=== Step 1: Clean ===');
|
|
115
14
|
run('npm run clean');
|
|
116
15
|
|
|
117
16
|
console.log('\n=== Step 2: Build CLI ===');
|
|
118
17
|
run('npm run build');
|
|
119
18
|
|
|
120
|
-
console.log('\n=== Step 3: Build Web (
|
|
19
|
+
console.log('\n=== Step 3: Build Web (2 targets) ===');
|
|
121
20
|
const webDir = resolve(root, 'clients/web');
|
|
122
21
|
run('npm run build', webDir);
|
|
123
22
|
run('npm run build:vscode', webDir);
|
|
124
|
-
run('npm run build:desktop', webDir);
|
|
125
23
|
|
|
126
24
|
console.log('\n=== Step 4: VS Code Extension ===');
|
|
127
25
|
const vscodeDir = resolve(root, 'clients/vscode');
|
|
@@ -132,35 +30,16 @@ const officeDir = resolve(root, 'clients/office');
|
|
|
132
30
|
run('npm run build', officeDir);
|
|
133
31
|
run('npm run build:desktop', officeDir);
|
|
134
32
|
|
|
135
|
-
console.log('\n=== Step 6: Build
|
|
136
|
-
run('npm run build', resolve(root, 'clients/obsidian'));
|
|
137
|
-
run('npm run build', resolve(root, 'clients/figma'));
|
|
33
|
+
console.log('\n=== Step 6: Build Browser ===');
|
|
138
34
|
run('npm run build', resolve(root, 'clients/browser'));
|
|
139
35
|
|
|
140
|
-
console.log('\n=== Step 7: Package ===');
|
|
141
|
-
|
|
142
|
-
const releaseDir = resolve(root, 'release');
|
|
143
|
-
rmSync(releaseDir, { recursive: true, force: true });
|
|
144
|
-
mkdirSync(releaseDir, { recursive: true });
|
|
145
|
-
|
|
146
|
-
const zipTargets = [
|
|
147
|
-
{ name: 'omni-context-connect', pkg: 'clients/browser/package.json', dist: 'clients/browser/dist' },
|
|
148
|
-
{ name: 'omni-context-figma', pkg: 'clients/figma/package.json', dist: 'clients/figma/dist' },
|
|
149
|
-
{ name: 'omni-context-obsidian', pkg: 'clients/obsidian/package.json', dist: 'clients/obsidian/dist' },
|
|
150
|
-
];
|
|
151
|
-
|
|
152
|
-
for (const { name, pkg, dist } of zipTargets) {
|
|
153
|
-
const ver = readVersion(pkg);
|
|
154
|
-
const zipPath = resolve(releaseDir, `${name}-v${ver}.zip`);
|
|
155
|
-
createZip(zipPath, resolve(root, dist));
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
console.log('\n=== Step 8: Package Desktop ===');
|
|
36
|
+
console.log('\n=== Step 7: Package Desktop ===');
|
|
159
37
|
const desktopDir = resolve(root, 'clients/desktop');
|
|
160
38
|
const packageCmd = process.platform === 'win32' ? 'npm run package:win' : 'npm run package:mac';
|
|
161
39
|
run(packageCmd, desktopDir);
|
|
162
40
|
|
|
163
|
-
console.log('\n=== Step
|
|
164
|
-
|
|
41
|
+
console.log('\n=== Step 8: Install VS Code Extension ===');
|
|
42
|
+
const codeCmd = process.platform === 'win32' ? 'code.cmd' : 'code';
|
|
43
|
+
run(`${codeCmd} --install-extension dist/clients/extension.vsix`);
|
|
165
44
|
|
|
166
45
|
console.log('\nDone.');
|
package/dist/agents/pluck.md
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Pluck
|
|
3
|
-
description: Find and extract specific code segments from a file. Returns matching code with line numbers only.
|
|
4
|
-
allowedTools: [Read]
|
|
5
|
-
displayFields: [query, filePath]
|
|
6
|
-
parameters:
|
|
7
|
-
properties:
|
|
8
|
-
query:
|
|
9
|
-
type: string
|
|
10
|
-
description: What code segment to find, e.g. "the registerTool function implementation", "UserService class definition", "where formatOutput is called", "error handling in the login flow"
|
|
11
|
-
filePath:
|
|
12
|
-
type: string
|
|
13
|
-
description: Exact path to the file to search within.
|
|
14
|
-
required: [query, filePath]
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
Find and extract this code segment: {{query}}
|
|
18
|
-
|
|
19
|
-
Search within this file: {{filePath}}.
|
|
20
|
-
|
|
21
|
-
Read the file and locate the code segment that matches the query.
|
|
22
|
-
|
|
23
|
-
Return what you find in this format:
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
File: path/to/file.ts
|
|
27
|
-
Lines X-Y:
|
|
28
|
-
<the matching code>
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
If there are multiple matches, separate them like this:
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
File: path/to/file1.ts
|
|
35
|
-
Lines X-Y:
|
|
36
|
-
<the matching code>
|
|
37
|
-
---
|
|
38
|
-
File: path/to/file2.ts
|
|
39
|
-
Lines A-B:
|
|
40
|
-
<the matching code>
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
If you can't find what was asked for:
|
|
44
|
-
|
|
45
|
-
```
|
|
46
|
-
Couldn't find it: [brief explanation of what you searched and why nothing matched]
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
Do not include explanations beyond the result format. Keep responses concise and structured.
|