@chibitek/chibi 0.1.160 → 0.1.161
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{abnfDiagram-O67JEVCF-CpuRvzQ3.js → abnfDiagram-O67JEVCF-Bb-Unz3V.js} +1 -1
- package/dist/assets/{arc-ko1e0R6h.js → arc-HBMH7B4K.js} +1 -1
- package/dist/assets/{architectureDiagram-NJMV4G6O-OZ3SsOOa.js → architectureDiagram-NJMV4G6O-CYwkb2PE.js} +1 -1
- package/dist/assets/{blockDiagram-BEXU5L5S-DLRkBkjs.js → blockDiagram-BEXU5L5S-DPYYNxBH.js} +1 -1
- package/dist/assets/{c4Diagram-YGBWAQC7-e8Q3qMnw.js → c4Diagram-YGBWAQC7-DZ9hKDlA.js} +1 -1
- package/dist/assets/channel-Nx85fHZ4.js +1 -0
- package/dist/assets/{chunk-2Q5K7J3B-hCDqaM4Q.js → chunk-2Q5K7J3B-OKrUlts6.js} +1 -1
- package/dist/assets/{chunk-3FUC2YCW-Dy3Pahu-.js → chunk-3FUC2YCW-Tuur0lqz.js} +2 -2
- package/dist/assets/{chunk-5VM5RSS4-QMK3iFBF.js → chunk-5VM5RSS4-BL8QOZeP.js} +1 -1
- package/dist/assets/{chunk-GTNCS2PH-6fyp9ERp.js → chunk-GTNCS2PH-DMi8-ixt.js} +1 -1
- package/dist/assets/{chunk-GWA4HPMP-DWvOhTaO.js → chunk-GWA4HPMP-Dd7yNJ0G.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-DgohMW2S.js → chunk-JWPE2WC7-g2dOoIMX.js} +1 -1
- package/dist/assets/{chunk-NETBCI7D-sRGeD2Y7.js → chunk-NETBCI7D-Cum7feOh.js} +1 -1
- package/dist/assets/{chunk-WEXAMYUT-CZslD_VF.js → chunk-WEXAMYUT-BzCC1jc4.js} +1 -1
- package/dist/assets/{chunk-XXDRQBXY-D7ocO3VN.js → chunk-XXDRQBXY-Ck63jUMo.js} +1 -1
- package/dist/assets/{classDiagram-v2-NBCMYWYE-T1lLqHHW.js → classDiagram-v2-NBCMYWYE-DFSuRVMZ.js} +1 -1
- package/dist/assets/{cose-bilkent-JH36ORCC-BdeLiJr3.js → cose-bilkent-JH36ORCC-CegRj_kY.js} +1 -1
- package/dist/assets/{cynefin-OW5HDTMX-BydCA0pv.js → cynefin-OW5HDTMX-cZS_kt1A.js} +1 -1
- package/dist/assets/{cynefinDiagram-VND7K2PF-DBxckjwQ.js → cynefinDiagram-VND7K2PF-DfQa9Rht.js} +1 -1
- package/dist/assets/{dagre-6A5THRUB-CAsvq6Zk.js → dagre-6A5THRUB-DJ9qftJu.js} +1 -1
- package/dist/assets/{diagram-22UHCM2B-DTwH3rA_.js → diagram-22UHCM2B-KXUGUahJ.js} +1 -1
- package/dist/assets/{diagram-3UASUU5V-BNYj1bey.js → diagram-3UASUU5V-BudCYrCp.js} +1 -1
- package/dist/assets/{diagram-ATOU4E4O-CihwYFxb.js → diagram-ATOU4E4O-Du2O03NS.js} +1 -1
- package/dist/assets/{diagram-CDSNMT55-nouwk3s2.js → diagram-CDSNMT55-DXybXGYf.js} +1 -1
- package/dist/assets/{diagram-MLGK6HIB-BoKewJeA.js → diagram-MLGK6HIB-DfrknXGE.js} +1 -1
- package/dist/assets/{diagram-MPIPVDR6-CrE1m9DQ.js → diagram-MPIPVDR6-C29FmaJm.js} +1 -1
- package/dist/assets/{ebnfDiagram-ZINNZB2B-DRj0aU4Y.js → ebnfDiagram-ZINNZB2B-BF9wS0Nz.js} +1 -1
- package/dist/assets/{elk-276RUBZZ-Do0JzCG5.js → elk-276RUBZZ-B2Fah1VF.js} +1 -1
- package/dist/assets/{erDiagram-OPXOYQCR-CRsI9pXb.js → erDiagram-OPXOYQCR-Di3q4bpF.js} +1 -1
- package/dist/assets/{flowDiagram-KWPJA3E3-dtD6wm3G.js → flowDiagram-KWPJA3E3-D1UiqwbF.js} +1 -1
- package/dist/assets/{ganttDiagram-FUAMR5RP-Cn7KyLCo.js → ganttDiagram-FUAMR5RP-BjZqMt7o.js} +1 -1
- package/dist/assets/{gitGraphDiagram-X574FWY7-CGH_VWzq.js → gitGraphDiagram-X574FWY7-DiZtdip7.js} +1 -1
- package/dist/assets/{index-BIcziktH.js → index-XFwW09vd.js} +3 -3
- package/dist/assets/{index-Bk8iAodB.js → index-dbQveHan.js} +1 -1
- package/dist/assets/{infoDiagram-VRGFBTTK-CQKsYTCL.js → infoDiagram-VRGFBTTK-BJUJCgio.js} +1 -1
- package/dist/assets/{ishikawaDiagram-OU5B5YK6-D5catDe0.js → ishikawaDiagram-OU5B5YK6-BX0XdHUx.js} +1 -1
- package/dist/assets/{journeyDiagram-ZHPQQLJL-KjY8mki9.js → journeyDiagram-ZHPQQLJL-Bg904IIx.js} +1 -1
- package/dist/assets/{kanban-definition-PNTS6WVX-BKCyJtge.js → kanban-definition-PNTS6WVX-hkZMFMHZ.js} +1 -1
- package/dist/assets/{linear-B-_obUkq.js → linear-Bh29RTbQ.js} +1 -1
- package/dist/assets/{mermaid.core-DlSzuDKt.js → mermaid.core-aqB1jW_w.js} +5 -5
- package/dist/assets/{mindmap-definition-NLK3R4M7-BFQSaYKh.js → mindmap-definition-NLK3R4M7-D5GMV-Zd.js} +1 -1
- package/dist/assets/{pegDiagram-GJSIUBJH-l51izlev.js → pegDiagram-GJSIUBJH-7_wFtkFH.js} +1 -1
- package/dist/assets/{pieDiagram-5QR66LMP-6NEXRoZX.js → pieDiagram-5QR66LMP-DXtZBQ4f.js} +1 -1
- package/dist/assets/{quadrantDiagram-O4NWA36T-BCC9XlOe.js → quadrantDiagram-O4NWA36T-C1v3ydTF.js} +1 -1
- package/dist/assets/{railroadDiagram-XR7U4H2S-Dd4TmJ86.js → railroadDiagram-XR7U4H2S-CLmhiOXg.js} +1 -1
- package/dist/assets/{requirementDiagram-PLB6GJNP-C1E5DaDb.js → requirementDiagram-PLB6GJNP-BKxI2rh_.js} +1 -1
- package/dist/assets/{sankeyDiagram-IPEJSGJF-Ci6r7abb.js → sankeyDiagram-IPEJSGJF-gKK-Qs7b.js} +1 -1
- package/dist/assets/{sequenceDiagram-PO4LG4MO-BJ-I6WOh.js → sequenceDiagram-PO4LG4MO-BT94Uowp.js} +1 -1
- package/dist/assets/{sizeCapture-INFHLROL-Cs5QbLOP.js → sizeCapture-INFHLROL-RDJL6sCM.js} +1 -1
- package/dist/assets/{stateDiagram-v2-GCMORJYK-Bw--rdvq.js → stateDiagram-v2-GCMORJYK-DqHMzv-J.js} +1 -1
- package/dist/assets/{swimlanes-2SLR337P-B1O9IEz5.js → swimlanes-2SLR337P-B-NN0ql6.js} +1 -1
- package/dist/assets/swimlanesDiagram-TC7HE7FX-BO2gR34z.js +8 -0
- package/dist/assets/{timeline-definition-EJHVYXUP-CTZ7DXaw.js → timeline-definition-EJHVYXUP-C51S9tpN.js} +1 -1
- package/dist/assets/{usecaseDiagram-POWQR4AR-DjwgNG0H.js → usecaseDiagram-POWQR4AR-DyfNMmhq.js} +1 -1
- package/dist/assets/{vennDiagram-UO4OBE2U-DrdJG55h.js → vennDiagram-UO4OBE2U-D924r33S.js} +1 -1
- package/dist/assets/{wardleyDiagram-VNRHLVJA-HVq776nz.js → wardleyDiagram-VNRHLVJA-DXSfsjUr.js} +1 -1
- package/dist/assets/{xychartDiagram-PMCCYNJV-DPf9VEua.js → xychartDiagram-PMCCYNJV-mYX9tnBU.js} +1 -1
- package/dist/index.html +1 -1
- package/dist-server/index.js +26 -6
- package/dist-server/openmausbot.js +24 -3
- package/dist-server/pair-cli.js +24 -3
- package/dist-server/server/checkpoint-recovery.js +18 -0
- package/dist-server/server/drivers/acp/core.js +17 -17
- package/dist-server/server/engine-failover.js +4 -4
- package/dist-server/server/index.js +5 -6
- package/package.json +1 -1
- package/dist/assets/channel-Lp7erhx-.js +0 -1
- package/dist/assets/swimlanesDiagram-TC7HE7FX-C6wGgYKP.js +0 -8
- package/dist-server/connector-proxy.js +0 -205
- package/dist-server/server/composio.js +0 -1051
- package/dist-server/server/connector-proxy.js +0 -249
- package/dist-server/server/mcp-public-registry.js +0 -325
- package/dist-server/shared/connector-availability.js +0 -12
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as o,O as pt,I as nt,F as Rt,ai as Wt,aj as Pt,ak as Bt,c as ft,l as E,T as Vt,ac as Ft,al as yt,k as U,N as zt,am as Ot,D as Gt}from"./mermaid.core-
|
|
1
|
+
import{_ as o,O as pt,I as nt,F as Rt,ai as Wt,aj as Pt,ak as Bt,c as ft,l as E,T as Vt,ac as Ft,al as yt,k as U,N as zt,am as Ot,D as Gt}from"./mermaid.core-aqB1jW_w.js";import{d as ct}from"./arc-HBMH7B4K.js";import"./index-XFwW09vd.js";var tt=(function(){var e=o(function(k,a,d,l){for(d=d||{},l=k.length;l--;d[k[l]]=a);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],s=[1,12],r=[1,13],n=[1,14],h=[1,15],c=[1,16],i=[1,19],y=[1,20],p={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:o(function(a,d,l,g,x,u,S){var v=u.length-1;switch(x){case 1:return u[v-1];case 3:g.setDirection("LR");break;case 4:g.setDirection("TD");break;case 5:this.$=[];break;case 6:u[v-1].push(u[v]),this.$=u[v-1];break;case 7:case 8:this.$=u[v];break;case 9:case 10:this.$=[];break;case 11:g.getCommonDb().setDiagramTitle(u[v].substr(6)),this.$=u[v].substr(6);break;case 12:this.$=u[v].trim(),g.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[v].trim(),g.getCommonDb().setAccDescription(this.$);break;case 15:g.addSection(u[v].substr(8)),this.$=u[v].substr(8);break;case 18:g.addTask(u[v],0,""),this.$=u[v];break;case 19:g.addEvent(u[v].substr(2)),this.$=u[v];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:s,15:r,17:n,19:h,20:c,21:17,22:18,23:i,24:y},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:s,15:r,17:n,19:h,20:c,21:17,22:18,23:i,24:y},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:o(function(a,d){if(d.recoverable)this.trace(a);else{var l=new Error(a);throw l.hash=d,l}},"parseError"),parse:o(function(a){var d=this,l=[0],g=[],x=[null],u=[],S=this.table,v="",I=0,C=0,W=2,O=1,L=u.slice.call(arguments,1),w=Object.create(this.lexer),H={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(H.yy[V]=this.yy[V]);w.setInput(a,H.yy),H.yy.lexer=w,H.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var F=w.yylloc;u.push(F);var K=w.options&&w.options.ranges;typeof H.yy.parseError=="function"?this.parseError=H.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function N(A){l.length=l.length-2*A,x.length=x.length-A,u.length=u.length-A}o(N,"popStack");function b(){var A;return A=g.pop()||w.lex()||O,typeof A!="number"&&(A instanceof Array&&(g=A,A=g.pop()),A=d.symbols_[A]||A),A}o(b,"lex");for(var _,$,T,P,R={},G,B,X,Z;;){if($=l[l.length-1],this.defaultActions[$]?T=this.defaultActions[$]:((_===null||typeof _>"u")&&(_=b()),T=S[$]&&S[$][_]),typeof T>"u"||!T.length||!T[0]){var Y="";Z=[];for(G in S[$])this.terminals_[G]&&G>W&&Z.push("'"+this.terminals_[G]+"'");w.showPosition?Y="Parse error on line "+(I+1)+`:
|
|
2
2
|
`+w.showPosition()+`
|
|
3
3
|
Expecting `+Z.join(", ")+", got '"+(this.terminals_[_]||_)+"'":Y="Parse error on line "+(I+1)+": Unexpected "+(_==O?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(Y,{text:w.match,token:this.terminals_[_]||_,line:w.yylineno,loc:F,expected:Z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+_);switch(T[0]){case 1:l.push(_),x.push(w.yytext),u.push(w.yylloc),l.push(T[1]),_=null,C=w.yyleng,v=w.yytext,I=w.yylineno,F=w.yylloc;break;case 2:if(B=this.productions_[T[1]][1],R.$=x[x.length-B],R._$={first_line:u[u.length-(B||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(B||1)].first_column,last_column:u[u.length-1].last_column},K&&(R._$.range=[u[u.length-(B||1)].range[0],u[u.length-1].range[1]]),P=this.performAction.apply(R,[v,C,I,H.yy,T[1],x,u].concat(L)),typeof P<"u")return P;B&&(l=l.slice(0,-1*B*2),x=x.slice(0,-1*B),u=u.slice(0,-1*B)),l.push(this.productions_[T[1]][0]),x.push(R.$),u.push(R._$),X=S[l[l.length-2]][l[l.length-1]],l.push(X);break;case 3:return!0}}return!0},"parse")},m=(function(){var k={EOF:1,parseError:o(function(d,l){if(this.yy.parser)this.yy.parser.parseError(d,l);else throw new Error(d)},"parseError"),setInput:o(function(a,d){return this.yy=d||this.yy||{},this._input=a,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:o(function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var d=a.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:o(function(a){var d=a.length,l=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var g=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),l.length-1&&(this.yylineno-=l.length-1);var x=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:l?(l.length===g.length?this.yylloc.first_column:0)+g[g.length-l.length].length-l[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[x[0],x[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(a){this.unput(this.match.slice(a))},"less"),pastInput:o(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var a=this.pastInput(),d=new Array(a.length+1).join("-");return a+this.upcomingInput()+`
|
package/dist/assets/{usecaseDiagram-POWQR4AR-DjwgNG0H.js → usecaseDiagram-POWQR4AR-DyfNMmhq.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as ma}from"./chunk-XXDRQBXY-D7ocO3VN.js";import{s as Ea}from"./chunk-WEXAMYUT-CZslD_VF.js";import{g as Mn,s as ms,a as wn,b as Es,x as ga,v as Ta,_ as h,G as ht,l as Aa,c as Un,r as Sa,t as ya,u as La,j as Ra,D as Na,R as Oa,F as ka,O as Ia,H as Ca,M as ba,by as va,k as _a}from"./mermaid.core-DlSzuDKt.js";import{j as xa,c as Ma,o as wa,b as Ua,v as xs,p as T,a as Pa,w as Da,m as Fa,f as ue,r as Ze,q as y,u as Ms,s as Be}from"./_basePickBy-vr4256UX.js";import{s as Ba,p as Pn,k as Qe,M as ws,K as St,I as W,a3 as $a,a4 as Ga,a5 as Wa,b as Ka,i as qs,c as Dn,B as Fn,W as Bn,v as P,a6 as $n,D as ja,E as Zs,N as za,a7 as Va,a8 as Ha,a9 as Ya,a as Xa,g as L,h as Oe,e as Ge,r as Q,j as C,f as oe,aa as $,a0 as Ja,m as qa}from"./_baseUniq-CHc60b6y.js";import"./index-BIcziktH.js";var Za=Object.prototype,Qa=Za.hasOwnProperty,ee=xa(function(s,e){if(Ba(e)||Pn(e)){Ma(e,Qe(e),s);return}for(var t in e)Qa.call(e,t)&&wa(s,t,e[t])});function Gn(s,e,t){var n=-1,i=s.length;e<0&&(e=-e>i?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var a=Array(i);++n<i;)a[n]=s[n+e];return a}var er=4;function K(s){return Ua(s,er)}function yt(s){for(var e=-1,t=s==null?0:s.length,n=0,i=[];++e<t;){var a=s[e];a&&(i[n++]=a)}return i}function tr(s,e,t,n){for(var i=-1,a=s==null?0:s.length;++i<a;){var r=s[i];e(n,r,t(r),s)}return n}function sr(s,e,t,n){return ws(s,function(i,a,r){e(n,i,t(i),r)}),n}function nr(s,e){return function(t,n){var i=W(t)?tr:sr,a=e?e():{};return i(t,s,St(n),a)}}var ir=200;function ar(s,e,t,n){var i=-1,a=Ga,r=!0,l=s.length,o=[],c=e.length;if(!l)return o;e.length>=ir&&(a=Wa,r=!1,e=new $a(e));e:for(;++i<l;){var d=s[i],u=d;if(d=d!==0?d:0,r&&u===u){for(var f=c;f--;)if(e[f]===u)continue e;o.push(d)}else a(e,u,n)||o.push(d)}return o}var Zt=Ka(function(s,e){return qs(s)?ar(s,Dn(e,1,qs,!0)):[]});function G(s,e,t){var n=s==null?0:s.length;return n?(e=e===void 0?1:xs(e),Gn(s,e<0?0:e,n)):[]}function At(s,e,t){var n=s==null?0:s.length;return n?(e=e===void 0?1:xs(e),e=n-e,Gn(s,0,e<0?0:e)):[]}function rr(s,e){for(var t=-1,n=s==null?0:s.length;++t<n;)if(!e(s[t],t,s))return!1;return!0}function or(s,e){var t=!0;return ws(s,function(n,i,a){return t=!!e(n,i,a),t}),t}function de(s,e,t){var n=W(s)?rr:or;return n(s,St(e))}function fe(s){return s&&s.length?s[0]:void 0}function re(s,e){return Dn(T(s,e))}var lr=Object.prototype,cr=lr.hasOwnProperty,hr=nr(function(s,e,t){cr.call(s,t)?s[t].push(e):Pa(s,t,[e])}),ur="[object String]";function q(s){return typeof s=="string"||!W(s)&&Fn(s)&&Bn(s)==ur}var dr=Math.max;function Y(s,e,t,n){s=Pn(s)?s:P(s),t=t?xs(t):0;var i=s.length;return t<0&&(t=dr(i+t,0)),q(s)?t<=i&&s.indexOf(e,t)>-1:!!i&&$n(s,e,t)>-1}function Qs(s,e,t){var n=s==null?0:s.length;if(!n)return-1;var i=0;return $n(s,e,i)}var fr="[object RegExp]";function pr(s){return Fn(s)&&Bn(s)==fr}var en=Zs&&Zs.isRegExp,ke=en?ja(en):pr,mr="Expected a function";function Er(s){if(typeof s!="function")throw new TypeError(mr);return function(){var e=arguments;switch(e.length){case 0:return!s.call(this);case 1:return!s.call(this,e[0]);case 2:return!s.call(this,e[0],e[1]);case 3:return!s.call(this,e[0],e[1],e[2])}return!s.apply(this,e)}}function pe(s,e){if(s==null)return{};var t=za(Da(s),function(n){return[n]});return e=St(e),Fa(s,t,function(n,i){return e(n,i[0])})}function Qt(s,e){var t=W(s)?Va:Ha;return t(s,Er(St(e)))}function gr(s,e){var t;return ws(s,function(n,i,a){return t=e(n,i,a),!t}),!!t}function Wn(s,e,t){var n=W(s)?Ya:gr;return n(s,St(e))}function Us(s){return s&&s.length?Xa(s):[]}function gs(s){console&&console.error&&console.error(`Error: ${s}`)}function Kn(s){console&&console.warn&&console.warn(`Warning: ${s}`)}function jn(s){const e=new Date().getTime(),t=s();return{time:new Date().getTime()-e,value:t}}function zn(s){function e(){}e.prototype=s;const t=new e;function n(){return typeof t.bar}return n(),n(),s}function Tr(s){return Ar(s)?s.LABEL:s.name}function Ar(s){return q(s.LABEL)&&s.LABEL!==""}class Ae{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),L(this.definition,t=>{t.accept(e)})}}class te extends Ae{constructor(e){super([]),this.idx=1,ee(this,pe(e,t=>t!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class et extends Ae{constructor(e){super(e.definition),this.orgText="",ee(this,pe(e,t=>t!==void 0))}}class Z extends Ae{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,ee(this,pe(e,t=>t!==void 0))}}class J extends Ae{constructor(e){super(e.definition),this.idx=1,ee(this,pe(e,t=>t!==void 0))}}class Se extends Ae{constructor(e){super(e.definition),this.idx=1,ee(this,pe(e,t=>t!==void 0))}}class ye extends Ae{constructor(e){super(e.definition),this.idx=1,ee(this,pe(e,t=>t!==void 0))}}class D extends Ae{constructor(e){super(e.definition),this.idx=1,ee(this,pe(e,t=>t!==void 0))}}class me extends Ae{constructor(e){super(e.definition),this.idx=1,ee(this,pe(e,t=>t!==void 0))}}class Ee extends Ae{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,ee(this,pe(e,t=>t!==void 0))}}class v{constructor(e){this.idx=1,ee(this,pe(e,t=>t!==void 0))}accept(e){e.visit(this)}}function Sr(s){return T(s,_t)}function _t(s){function e(t){return T(t,_t)}if(s instanceof te){const t={type:"NonTerminal",name:s.nonTerminalName,idx:s.idx};return q(s.label)&&(t.label=s.label),t}else{if(s instanceof Z)return{type:"Alternative",definition:e(s.definition)};if(s instanceof J)return{type:"Option",idx:s.idx,definition:e(s.definition)};if(s instanceof Se)return{type:"RepetitionMandatory",idx:s.idx,definition:e(s.definition)};if(s instanceof ye)return{type:"RepetitionMandatoryWithSeparator",idx:s.idx,separator:_t(new v({terminalType:s.separator})),definition:e(s.definition)};if(s instanceof me)return{type:"RepetitionWithSeparator",idx:s.idx,separator:_t(new v({terminalType:s.separator})),definition:e(s.definition)};if(s instanceof D)return{type:"Repetition",idx:s.idx,definition:e(s.definition)};if(s instanceof Ee)return{type:"Alternation",idx:s.idx,definition:e(s.definition)};if(s instanceof v){const t={type:"Terminal",name:s.terminalType.name,label:Tr(s.terminalType),idx:s.idx};q(s.label)&&(t.terminalLabel=s.label);const n=s.terminalType.PATTERN;return s.terminalType.PATTERN&&(t.pattern=ke(n)?n.source:n),t}else{if(s instanceof et)return{type:"Rule",name:s.name,orgText:s.orgText,definition:e(s.definition)};throw Error("non exhaustive match")}}}class tt{visit(e){const t=e;switch(t.constructor){case te:return this.visitNonTerminal(t);case Z:return this.visitAlternative(t);case J:return this.visitOption(t);case Se:return this.visitRepetitionMandatory(t);case ye:return this.visitRepetitionMandatoryWithSeparator(t);case me:return this.visitRepetitionWithSeparator(t);case D:return this.visitRepetition(t);case Ee:return this.visitAlternation(t);case v:return this.visitTerminal(t);case et:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function yr(s){return s instanceof Z||s instanceof J||s instanceof D||s instanceof Se||s instanceof ye||s instanceof me||s instanceof v||s instanceof et}function Wt(s,e=[]){return s instanceof J||s instanceof D||s instanceof me?!0:s instanceof Ee?Wn(s.definition,n=>Wt(n,e)):s instanceof te&&Y(e,s)?!1:s instanceof Ae?(s instanceof te&&e.push(s),de(s.definition,n=>Wt(n,e))):!1}function Lr(s){return s instanceof Ee}function Te(s){if(s instanceof te)return"SUBRULE";if(s instanceof J)return"OPTION";if(s instanceof Ee)return"OR";if(s instanceof Se)return"AT_LEAST_ONE";if(s instanceof ye)return"AT_LEAST_ONE_SEP";if(s instanceof me)return"MANY_SEP";if(s instanceof D)return"MANY";if(s instanceof v)return"CONSUME";throw Error("non exhaustive match")}class es{walk(e,t=[]){L(e.definition,(n,i)=>{const a=G(e.definition,i+1);if(n instanceof te)this.walkProdRef(n,a,t);else if(n instanceof v)this.walkTerminal(n,a,t);else if(n instanceof Z)this.walkFlat(n,a,t);else if(n instanceof J)this.walkOption(n,a,t);else if(n instanceof Se)this.walkAtLeastOne(n,a,t);else if(n instanceof ye)this.walkAtLeastOneSep(n,a,t);else if(n instanceof me)this.walkManySep(n,a,t);else if(n instanceof D)this.walkMany(n,a,t);else if(n instanceof Ee)this.walkOr(n,a,t);else throw Error("non exhaustive match")})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const i=t.concat(n);this.walk(e,i)}walkOption(e,t,n){const i=t.concat(n);this.walk(e,i)}walkAtLeastOne(e,t,n){const i=[new J({definition:e.definition})].concat(t,n);this.walk(e,i)}walkAtLeastOneSep(e,t,n){const i=tn(e,t,n);this.walk(e,i)}walkMany(e,t,n){const i=[new J({definition:e.definition})].concat(t,n);this.walk(e,i)}walkManySep(e,t,n){const i=tn(e,t,n);this.walk(e,i)}walkOr(e,t,n){const i=t.concat(n);L(e.definition,a=>{const r=new Z({definition:[a]});this.walk(r,i)})}}function tn(s,e,t){return[new J({definition:[new v({terminalType:s.separator})].concat(s.definition)})].concat(e,t)}function Lt(s){if(s instanceof te)return Lt(s.referencedRule);if(s instanceof v)return Or(s);if(yr(s))return Rr(s);if(Lr(s))return Nr(s);throw Error("non exhaustive match")}function Rr(s){let e=[];const t=s.definition;let n=0,i=t.length>n,a,r=!0;for(;i&&r;)a=t[n],r=Wt(a),e=e.concat(Lt(a)),n=n+1,i=t.length>n;return Us(e)}function Nr(s){const e=T(s.definition,t=>Lt(t));return Us(ue(e))}function Or(s){return[s.terminalType]}const Vn="_~IN~_";class kr extends es{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const i=Cr(e.referencedRule,e.idx)+this.topProd.name,a=t.concat(n),r=new Z({definition:a}),l=Lt(r);this.follows[i]=l}}function Ir(s){const e={};return L(s,t=>{const n=new kr(t).startWalking();ee(e,n)}),e}function Cr(s,e){return s.name+e+Vn}function R(s){return s.charCodeAt(0)}function cs(s,e){Array.isArray(s)?s.forEach(function(t){e.push(t)}):e.push(s)}function ot(s,e){if(s[e]===!0)throw"duplicate flag "+e;s[e],s[e]=!0}function Ke(s){if(s===void 0)throw Error("Internal Error - Should never get here!");return!0}function br(){throw Error("Internal Error - Should never get here!")}function sn(s){return s.type==="Character"}const Kt=[];for(let s=R("0");s<=R("9");s++)Kt.push(s);const jt=[R("_")].concat(Kt);for(let s=R("a");s<=R("z");s++)jt.push(s);for(let s=R("A");s<=R("Z");s++)jt.push(s);const nn=[R(" "),R("\f"),R(`
|
|
1
|
+
import{g as ma}from"./chunk-XXDRQBXY-Ck63jUMo.js";import{s as Ea}from"./chunk-WEXAMYUT-BzCC1jc4.js";import{g as Mn,s as ms,a as wn,b as Es,x as ga,v as Ta,_ as h,G as ht,l as Aa,c as Un,r as Sa,t as ya,u as La,j as Ra,D as Na,R as Oa,F as ka,O as Ia,H as Ca,M as ba,by as va,k as _a}from"./mermaid.core-aqB1jW_w.js";import{j as xa,c as Ma,o as wa,b as Ua,v as xs,p as T,a as Pa,w as Da,m as Fa,f as ue,r as Ze,q as y,u as Ms,s as Be}from"./_basePickBy-vr4256UX.js";import{s as Ba,p as Pn,k as Qe,M as ws,K as St,I as W,a3 as $a,a4 as Ga,a5 as Wa,b as Ka,i as qs,c as Dn,B as Fn,W as Bn,v as P,a6 as $n,D as ja,E as Zs,N as za,a7 as Va,a8 as Ha,a9 as Ya,a as Xa,g as L,h as Oe,e as Ge,r as Q,j as C,f as oe,aa as $,a0 as Ja,m as qa}from"./_baseUniq-CHc60b6y.js";import"./index-XFwW09vd.js";var Za=Object.prototype,Qa=Za.hasOwnProperty,ee=xa(function(s,e){if(Ba(e)||Pn(e)){Ma(e,Qe(e),s);return}for(var t in e)Qa.call(e,t)&&wa(s,t,e[t])});function Gn(s,e,t){var n=-1,i=s.length;e<0&&(e=-e>i?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var a=Array(i);++n<i;)a[n]=s[n+e];return a}var er=4;function K(s){return Ua(s,er)}function yt(s){for(var e=-1,t=s==null?0:s.length,n=0,i=[];++e<t;){var a=s[e];a&&(i[n++]=a)}return i}function tr(s,e,t,n){for(var i=-1,a=s==null?0:s.length;++i<a;){var r=s[i];e(n,r,t(r),s)}return n}function sr(s,e,t,n){return ws(s,function(i,a,r){e(n,i,t(i),r)}),n}function nr(s,e){return function(t,n){var i=W(t)?tr:sr,a=e?e():{};return i(t,s,St(n),a)}}var ir=200;function ar(s,e,t,n){var i=-1,a=Ga,r=!0,l=s.length,o=[],c=e.length;if(!l)return o;e.length>=ir&&(a=Wa,r=!1,e=new $a(e));e:for(;++i<l;){var d=s[i],u=d;if(d=d!==0?d:0,r&&u===u){for(var f=c;f--;)if(e[f]===u)continue e;o.push(d)}else a(e,u,n)||o.push(d)}return o}var Zt=Ka(function(s,e){return qs(s)?ar(s,Dn(e,1,qs,!0)):[]});function G(s,e,t){var n=s==null?0:s.length;return n?(e=e===void 0?1:xs(e),Gn(s,e<0?0:e,n)):[]}function At(s,e,t){var n=s==null?0:s.length;return n?(e=e===void 0?1:xs(e),e=n-e,Gn(s,0,e<0?0:e)):[]}function rr(s,e){for(var t=-1,n=s==null?0:s.length;++t<n;)if(!e(s[t],t,s))return!1;return!0}function or(s,e){var t=!0;return ws(s,function(n,i,a){return t=!!e(n,i,a),t}),t}function de(s,e,t){var n=W(s)?rr:or;return n(s,St(e))}function fe(s){return s&&s.length?s[0]:void 0}function re(s,e){return Dn(T(s,e))}var lr=Object.prototype,cr=lr.hasOwnProperty,hr=nr(function(s,e,t){cr.call(s,t)?s[t].push(e):Pa(s,t,[e])}),ur="[object String]";function q(s){return typeof s=="string"||!W(s)&&Fn(s)&&Bn(s)==ur}var dr=Math.max;function Y(s,e,t,n){s=Pn(s)?s:P(s),t=t?xs(t):0;var i=s.length;return t<0&&(t=dr(i+t,0)),q(s)?t<=i&&s.indexOf(e,t)>-1:!!i&&$n(s,e,t)>-1}function Qs(s,e,t){var n=s==null?0:s.length;if(!n)return-1;var i=0;return $n(s,e,i)}var fr="[object RegExp]";function pr(s){return Fn(s)&&Bn(s)==fr}var en=Zs&&Zs.isRegExp,ke=en?ja(en):pr,mr="Expected a function";function Er(s){if(typeof s!="function")throw new TypeError(mr);return function(){var e=arguments;switch(e.length){case 0:return!s.call(this);case 1:return!s.call(this,e[0]);case 2:return!s.call(this,e[0],e[1]);case 3:return!s.call(this,e[0],e[1],e[2])}return!s.apply(this,e)}}function pe(s,e){if(s==null)return{};var t=za(Da(s),function(n){return[n]});return e=St(e),Fa(s,t,function(n,i){return e(n,i[0])})}function Qt(s,e){var t=W(s)?Va:Ha;return t(s,Er(St(e)))}function gr(s,e){var t;return ws(s,function(n,i,a){return t=e(n,i,a),!t}),!!t}function Wn(s,e,t){var n=W(s)?Ya:gr;return n(s,St(e))}function Us(s){return s&&s.length?Xa(s):[]}function gs(s){console&&console.error&&console.error(`Error: ${s}`)}function Kn(s){console&&console.warn&&console.warn(`Warning: ${s}`)}function jn(s){const e=new Date().getTime(),t=s();return{time:new Date().getTime()-e,value:t}}function zn(s){function e(){}e.prototype=s;const t=new e;function n(){return typeof t.bar}return n(),n(),s}function Tr(s){return Ar(s)?s.LABEL:s.name}function Ar(s){return q(s.LABEL)&&s.LABEL!==""}class Ae{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),L(this.definition,t=>{t.accept(e)})}}class te extends Ae{constructor(e){super([]),this.idx=1,ee(this,pe(e,t=>t!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class et extends Ae{constructor(e){super(e.definition),this.orgText="",ee(this,pe(e,t=>t!==void 0))}}class Z extends Ae{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,ee(this,pe(e,t=>t!==void 0))}}class J extends Ae{constructor(e){super(e.definition),this.idx=1,ee(this,pe(e,t=>t!==void 0))}}class Se extends Ae{constructor(e){super(e.definition),this.idx=1,ee(this,pe(e,t=>t!==void 0))}}class ye extends Ae{constructor(e){super(e.definition),this.idx=1,ee(this,pe(e,t=>t!==void 0))}}class D extends Ae{constructor(e){super(e.definition),this.idx=1,ee(this,pe(e,t=>t!==void 0))}}class me extends Ae{constructor(e){super(e.definition),this.idx=1,ee(this,pe(e,t=>t!==void 0))}}class Ee extends Ae{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,ee(this,pe(e,t=>t!==void 0))}}class v{constructor(e){this.idx=1,ee(this,pe(e,t=>t!==void 0))}accept(e){e.visit(this)}}function Sr(s){return T(s,_t)}function _t(s){function e(t){return T(t,_t)}if(s instanceof te){const t={type:"NonTerminal",name:s.nonTerminalName,idx:s.idx};return q(s.label)&&(t.label=s.label),t}else{if(s instanceof Z)return{type:"Alternative",definition:e(s.definition)};if(s instanceof J)return{type:"Option",idx:s.idx,definition:e(s.definition)};if(s instanceof Se)return{type:"RepetitionMandatory",idx:s.idx,definition:e(s.definition)};if(s instanceof ye)return{type:"RepetitionMandatoryWithSeparator",idx:s.idx,separator:_t(new v({terminalType:s.separator})),definition:e(s.definition)};if(s instanceof me)return{type:"RepetitionWithSeparator",idx:s.idx,separator:_t(new v({terminalType:s.separator})),definition:e(s.definition)};if(s instanceof D)return{type:"Repetition",idx:s.idx,definition:e(s.definition)};if(s instanceof Ee)return{type:"Alternation",idx:s.idx,definition:e(s.definition)};if(s instanceof v){const t={type:"Terminal",name:s.terminalType.name,label:Tr(s.terminalType),idx:s.idx};q(s.label)&&(t.terminalLabel=s.label);const n=s.terminalType.PATTERN;return s.terminalType.PATTERN&&(t.pattern=ke(n)?n.source:n),t}else{if(s instanceof et)return{type:"Rule",name:s.name,orgText:s.orgText,definition:e(s.definition)};throw Error("non exhaustive match")}}}class tt{visit(e){const t=e;switch(t.constructor){case te:return this.visitNonTerminal(t);case Z:return this.visitAlternative(t);case J:return this.visitOption(t);case Se:return this.visitRepetitionMandatory(t);case ye:return this.visitRepetitionMandatoryWithSeparator(t);case me:return this.visitRepetitionWithSeparator(t);case D:return this.visitRepetition(t);case Ee:return this.visitAlternation(t);case v:return this.visitTerminal(t);case et:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function yr(s){return s instanceof Z||s instanceof J||s instanceof D||s instanceof Se||s instanceof ye||s instanceof me||s instanceof v||s instanceof et}function Wt(s,e=[]){return s instanceof J||s instanceof D||s instanceof me?!0:s instanceof Ee?Wn(s.definition,n=>Wt(n,e)):s instanceof te&&Y(e,s)?!1:s instanceof Ae?(s instanceof te&&e.push(s),de(s.definition,n=>Wt(n,e))):!1}function Lr(s){return s instanceof Ee}function Te(s){if(s instanceof te)return"SUBRULE";if(s instanceof J)return"OPTION";if(s instanceof Ee)return"OR";if(s instanceof Se)return"AT_LEAST_ONE";if(s instanceof ye)return"AT_LEAST_ONE_SEP";if(s instanceof me)return"MANY_SEP";if(s instanceof D)return"MANY";if(s instanceof v)return"CONSUME";throw Error("non exhaustive match")}class es{walk(e,t=[]){L(e.definition,(n,i)=>{const a=G(e.definition,i+1);if(n instanceof te)this.walkProdRef(n,a,t);else if(n instanceof v)this.walkTerminal(n,a,t);else if(n instanceof Z)this.walkFlat(n,a,t);else if(n instanceof J)this.walkOption(n,a,t);else if(n instanceof Se)this.walkAtLeastOne(n,a,t);else if(n instanceof ye)this.walkAtLeastOneSep(n,a,t);else if(n instanceof me)this.walkManySep(n,a,t);else if(n instanceof D)this.walkMany(n,a,t);else if(n instanceof Ee)this.walkOr(n,a,t);else throw Error("non exhaustive match")})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const i=t.concat(n);this.walk(e,i)}walkOption(e,t,n){const i=t.concat(n);this.walk(e,i)}walkAtLeastOne(e,t,n){const i=[new J({definition:e.definition})].concat(t,n);this.walk(e,i)}walkAtLeastOneSep(e,t,n){const i=tn(e,t,n);this.walk(e,i)}walkMany(e,t,n){const i=[new J({definition:e.definition})].concat(t,n);this.walk(e,i)}walkManySep(e,t,n){const i=tn(e,t,n);this.walk(e,i)}walkOr(e,t,n){const i=t.concat(n);L(e.definition,a=>{const r=new Z({definition:[a]});this.walk(r,i)})}}function tn(s,e,t){return[new J({definition:[new v({terminalType:s.separator})].concat(s.definition)})].concat(e,t)}function Lt(s){if(s instanceof te)return Lt(s.referencedRule);if(s instanceof v)return Or(s);if(yr(s))return Rr(s);if(Lr(s))return Nr(s);throw Error("non exhaustive match")}function Rr(s){let e=[];const t=s.definition;let n=0,i=t.length>n,a,r=!0;for(;i&&r;)a=t[n],r=Wt(a),e=e.concat(Lt(a)),n=n+1,i=t.length>n;return Us(e)}function Nr(s){const e=T(s.definition,t=>Lt(t));return Us(ue(e))}function Or(s){return[s.terminalType]}const Vn="_~IN~_";class kr extends es{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const i=Cr(e.referencedRule,e.idx)+this.topProd.name,a=t.concat(n),r=new Z({definition:a}),l=Lt(r);this.follows[i]=l}}function Ir(s){const e={};return L(s,t=>{const n=new kr(t).startWalking();ee(e,n)}),e}function Cr(s,e){return s.name+e+Vn}function R(s){return s.charCodeAt(0)}function cs(s,e){Array.isArray(s)?s.forEach(function(t){e.push(t)}):e.push(s)}function ot(s,e){if(s[e]===!0)throw"duplicate flag "+e;s[e],s[e]=!0}function Ke(s){if(s===void 0)throw Error("Internal Error - Should never get here!");return!0}function br(){throw Error("Internal Error - Should never get here!")}function sn(s){return s.type==="Character"}const Kt=[];for(let s=R("0");s<=R("9");s++)Kt.push(s);const jt=[R("_")].concat(Kt);for(let s=R("a");s<=R("z");s++)jt.push(s);for(let s=R("A");s<=R("Z");s++)jt.push(s);const nn=[R(" "),R("\f"),R(`
|
|
2
2
|
`),R("\r"),R(" "),R("\v"),R(" "),R(" "),R(" "),R(" "),R(" "),R(" "),R(" "),R(" "),R(" "),R(" "),R(" "),R(" "),R(" "),R(" "),R("\u2028"),R("\u2029"),R(" "),R(" "),R(" "),R("\uFEFF")],vr=/[0-9a-fA-F]/,It=/[0-9]/,_r=/[1-9]/;class xr{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":ot(n,"global");break;case"i":ot(n,"ignoreCase");break;case"m":ot(n,"multiLine");break;case"u":ot(n,"unicode");break;case"y":ot(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let t;switch(this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}break}}Ke(t);const n=this.disjunction();return this.consumeChar(")"),{type:t,value:n,loc:this.loc(e)}}return br()}quantifier(e=!1){let t;const n=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:i,atMost:i};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),t={atLeast:i,atMost:a}):t={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&t===void 0)return;Ke(t);break}if(!(e===!0&&t===void 0)&&Ke(t))return this.peekChar(0)==="?"?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(n),t}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),Ke(e))return e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[R(`
|
|
3
3
|
`),R("\r"),R("\u2028"),R("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=Kt;break;case"D":e=Kt,t=!0;break;case"s":e=nn;break;case"S":e=nn,t=!0;break;case"w":e=jt;break;case"W":e=jt,t=!0;break}if(Ke(e))return{type:"Set",value:e,complement:t}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=R("\f");break;case"n":e=R(`
|
|
4
4
|
`);break;case"r":e=R("\r");break;case"t":e=R(" ");break;case"v":e=R("\v");break}if(Ke(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:R("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:R(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b9 as Wt,s as Kt,g as Ht,x as Yt,v as Xt,a as Zt,b as Qt,_ as w,O as wt,T as Jt,k as ot,at as $t,ai as te,aj as ee,ak as ne,d as se,D as ie,Q as oe,R as re}from"./mermaid.core-DlSzuDKt.js";import"./index-BIcziktH.js";const It=(t,n)=>Wt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,o=0;const r=[];if(e.length>1){const l=Et(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let f=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];o+=(f.x+a.x)*(a.y-f.y);const y={x:(a.x+f.x)/2,y:(a.y+f.y)/2};let h=null;for(let b=0;b<a.parentIndex.length;++b)if(f.parentIndex.includes(a.parentIndex[b])){const p=t[a.parentIndex[b]],M=Math.atan2(a.x-p.x,a.y-p.y),E=Math.atan2(f.x-p.x,f.y-p.y);let _=E-M;_<0&&(_+=2*Math.PI);const S=E-_/2;let g=q(y,{x:p.x+p.radius*Math.sin(S),y:p.y+p.radius*Math.cos(S)});g>p.radius*2&&(g=p.radius*2),(h==null||h.width>g)&&(h={circle:p,width:g,p1:a,p2:f,large:g>p.radius,sweep:!0})}h!=null&&(r.push(h),i+=lt(h.circle.radius,h.width),f=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let f=!1;for(let u=0;u<t.length;++u)if(q(t[u],l)>Math.abs(l.radius-t[u].radius)){f=!0;break}f?i=o=0:(i=l.radius*l.radius*Math.PI,r.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=r,n.innerPoints=e,n.intersectionPoints=s),i+o}function ae(t,n){return n.every(s=>q(t,s)<s.radius+_t)}function le(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Tt(t[s],t[e]);for(const o of i)o.parentIndex=[s,e],n.push(o)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function q(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),r=Math.sqrt(e*e-o*o),l=t.x+o*(n.x-t.x)/s,f=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(r/s),a=-(n.x-t.x)*(r/s);return[{x:l+u,y:f-a},{x:l-u,y:f+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,r=t(n),l=t(s);let f=s-n;if(r*l>0)throw"Initial bisect points must have opposite signs";if(r===0)return n;if(l===0)return s;for(let u=0;u<i;++u){f/=2;const a=n+f,y=t(a);if(y*r>=0&&(n=a),Math.abs(f)<o||y===0)return a}return n+f}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function $(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt($(t,t))}function ft(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function Z(t,n,s,e,i){for(let o=0;o<t.length;++o)t[o]=n*s[o]+e*i[o]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,o=s.zeroDelta||.001,r=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,f=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,y=s.sigma!==void 0?s.sigma:.5;let h;const b=n.length,p=new Array(b+1);p[0]=n,p[0].fx=t(n),p[0].id=0;for(let v=0;v<b;++v){const c=n.slice();c[v]=c[v]?c[v]*i:o,p[v+1]=c,p[v+1].fx=t(c),p[v+1].id=v+1}function M(v){for(let c=0;c<v.length;c++)p[b][c]=v[c];p[b].fx=v.fx}const E=(v,c)=>v.fx-c.fx,_=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v<e;++v){if(p.sort(E),s.history){const x=p.map(d=>{const C=d.slice();return C.fx=d.fx,C.id=d.id,C});x.sort((d,C)=>d.id-C.id),s.history.push({x:p[0].slice(),fx:p[0].fx,simplex:x})}h=0;for(let x=0;x<b;++x)h=Math.max(h,Math.abs(p[0][x]-p[1][x]));if(Math.abs(p[0].fx-p[b].fx)<r&&h<l)break;for(let x=0;x<b;++x){_[x]=0;for(let d=0;d<b;++d)_[x]+=p[d][x];_[x]/=b}const c=p[b];if(Z(S,1+f,_,-f,c),S.fx=t(S),S.fx<p[0].fx)Z(m,1+u,_,-u,c),m.fx=t(m),m.fx<S.fx?M(m):M(S);else if(S.fx>=p[b-1].fx){let x=!1;if(S.fx>c.fx?(Z(g,1+a,_,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(Z(g,1-a*f,_,a*f,c),g.fx=t(g),g.fx<S.fx?M(g):x=!0),x){if(y>=1)break;for(let d=1;d<p.length;++d)Z(p[d],1-y,p[0],y,p[d]),p[d].fx=t(p[d])}}else M(S)}return p.sort(E),{fx:p[0].fx,x:p[0]}}function ue(t,n,s,e,i,o,r){const l=s.fx,f=$(s.fxprime,n);let u=l,a=l,y=f,h=0;i=i||1,o=o||1e-6,r=r||.1;function b(p,M,E){for(let _=0;_<16;++_)if(i=(p+M)/2,Z(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||u>=E)M=i;else{if(Math.abs(y)<=-r*f)return i;y*(M-p)>=0&&(M=p),p=i,E=u}return 0}for(let p=0;p<10;++p){if(Z(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||p&&u>=a)return b(h,i,a);if(Math.abs(y)<=-r*f)return i;if(y>=0)return b(i,h,u);a=u,h=i,i*=2}return i}function fe(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let r,l,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),r=e.fxprime.slice(),ft(r,e.fxprime,-1);for(let a=0;a<u;++a){if(f=ue(t,r,e,i,f),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),!f)ft(r,e.fxprime,-1);else{Z(o,1,i.fxprime,-1,e.fxprime);const y=$(e.fxprime,e.fxprime),h=Math.max(0,$(o,i.fxprime)/y);Z(r,h,r,-1,i.fxprime),l=e,e=i,i=l}if(ut(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),e}function At(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||xe,e=n.lossFunction||tt,i=he(t,n),o=s(i,n),r=Object.keys(o),l=[];for(const a of r)l.push(o[a].x),l.push(o[a].y);const u=zt(a=>{const y={};for(let h=0;h<r.length;++h){const b=r[h];y[b]={x:a[2*h],y:a[2*h+1],radius:o[b].radius}}return e(y,i)},l,n).x;for(let a=0;a<r.length;++a){const y=r[a];o[y].x=u[2*a],o[y].y=u[2*a+1]}return o}const Rt=1e-10;function ht(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):ce(e=>xt(t,n,e)-s,0,t+n)}function he(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const f of e)for(let u=0;u<f.sets.length;u++){const a=String(f.sets[u]);l.set(a,f.size+(l.get(a)||0));for(let y=u+1;y<f.sets.length;y++){const h=String(f.sets[y]),b=`${a};${h}`,p=`${h};${a}`;l.set(b,f.size+(l.get(b)||0)),l.set(p,f.size+(l.get(p)||0))}}for(const f of e)f.sets.length<3&&(f.size=l.get(i(f.sets)))}const o=[],r=new Set;for(const l of e)if(l.sets.length===1)o.push(l.sets[0]);else if(l.sets.length===2){const f=l.sets[0],u=l.sets[1];r.add(i(l.sets)),r.add(i([u,f]))}o.sort((l,f)=>l===f?0:l<f?-1:1);for(let l=0;l<o.length;++l){const f=o[l];for(let u=l+1;u<o.length;++u){const a=o[u];r.has(i([f,a]))||e.push({sets:[f,a],size:0})}}return e}function de(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(o=>o.sets.length===2).forEach(o=>{const r=s[o.sets[0]],l=s[o.sets[1]],f=Math.sqrt(n[r].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ht(f,u,o.size);e[r][l]=e[l][r]=a;let y=0;o.size+1e-10>=Math.min(n[r].size,n[l].size)?y=1:o.size<=1e-10&&(y=-1),i[r][l]=i[l][r]=y}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let o=0;o<n.length;++o)n[o]=0;let i=0;for(let o=0;o<s.length;++o){const r=t[2*o],l=t[2*o+1];for(let f=o+1;f<s.length;++f){const u=t[2*f],a=t[2*f+1],y=s[o][f],h=e[o][f],b=(u-r)*(u-r)+(a-l)*(a-l),p=Math.sqrt(b),M=b-y*y;h>0&&p<=y||h<0&&p>=y||(i+=2*M*M,n[2*o]+=4*M*(r-u),n[2*o+1]+=4*M*(l-a),n[2*f]+=4*M*(u-r),n[2*f+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=ye(t,n),o=e(i,t),r=e(s,t);o+1e-8<r&&(s=i)}return s}function ye(t,n={}){const s=n.restarts||10,e=[],i={};for(const h of t)h.sets.length===1&&(i[h.sets[0]]=e.length,e.push(h));let{distances:o,constraints:r}=de(t,e,i);const l=ut(o.map(ut))/o.length;o=o.map(h=>h.map(b=>b/l));const f=(h,b)=>ge(h,b,o,r);let u=null;for(let h=0;h<s;++h){const b=ct(o.length*2).map(Math.random),p=fe(f,b,n);(!u||p.fx<u.fx)&&(u=p)}const a=u.x,y={};for(let h=0;h<e.length;++h){const b=e[h];y[b.sets[0]]={x:a[2*h]*l,y:a[2*h+1]*l,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const h of n.history)ft(h.x,l);return y}function pe(t,n){const s=n&&n.lossFunction?n.lossFunction:tt,e={},i={};for(const y of t)if(y.sets.length===1){const h=y.sets[0];e[h]={x:1e10,y:1e10,rowid:e.length,size:y.size,radius:Math.sqrt(y.size/Math.PI)},i[h]=[]}t=t.filter(y=>y.sets.length===2);for(const y of t){let h=y.weight!=null?y.weight:1;const b=y.sets[0],p=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[p].size)&&(h=0),i[b].push({set:p,size:y.size,weight:h}),i[p].push({set:b,size:y.size,weight:h})}const o=[];Object.keys(i).forEach(y=>{let h=0;for(let b=0;b<i[y].length;++b)h+=i[y][b].size*i[y][b].weight;o.push({set:y,size:h})});function r(y,h){return h.size-y.size}o.sort(r);const l={};function f(y){return y.set in l}function u(y,h){e[h].x=y.x,e[h].y=y.y,l[h]=!0}u({x:0,y:0},o[0].set);for(let y=1;y<o.length;++y){const h=o[y].set,b=i[h].filter(f),p=e[h];if(b.sort(r),b.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var a=0;a<b.length;++a){const S=e[b[a].set],g=ht(p.radius,S.radius,b[a].size);M.push({x:S.x+g,y:S.y}),M.push({x:S.x-g,y:S.y}),M.push({y:S.y+g,x:S.x}),M.push({y:S.y-g,x:S.x});for(let m=a+1;m<b.length;++m){const v=e[b[m].set],c=ht(p.radius,v.radius,b[m].size),x=Tt({x:S.x,y:S.y,radius:g},{x:v.x,y:v.y,radius:c});M.push(...x)}}let E=1e50,_=M[0];for(const S of M){e[h].x=S.x,e[h].y=S.y;const g=s(e,t);g<E&&(E=g,_=S)}u(_,h)}return e}function tt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const r=t[e.sets[0]],l=t[e.sets[1]];i=xt(r.radius,l.radius,q(r,l))}else i=st(e.sets.map(r=>t[r]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function Ct(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],f=t[e.sets[1]];i=xt(l.radius,f.radius,q(l,f))}else i=st(e.sets.map(l=>t[l]));const o=e.weight!=null?e.weight:1,r=Math.log((i+1)/(e.size+1));s+=o*r*r}return s}function me(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const r of t)r.x-=i,r.y-=o}if(t.length===2&&q(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),r=Math.sin(i);for(const l of t){const f=l.x,u=l.y;l.x=o*f-r*u,l.y=r*f+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const r of t){var e=(r.x+o*r.y)/(1+o*o);r.x=2*e-r.x,r.y=2*e*o-r.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const r=n(i),l=n(o);r.parent=l}for(let i=0;i<t.length;++i)for(let o=i+1;o<t.length;++o){const r=t[i].radius+t[o].radius;q(t[i],t[o])+1e-10<r&&s(t[o],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const o=n(t[i]).parent.setid;e.has(o)||e.set(o,[]),e.get(o).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,r)=>Math.max(o,r[s]+r.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,r)=>Math.min(o,r[s]-r.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Dt(t,n,s){n==null&&(n=Math.PI/2);let e=jt(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let o=e.bounds;const r=(o.xRange.max-o.xRange.min)/50;function l(u,a,y){if(!u)return;const h=u.bounds;let b,p;if(a)b=o.xRange.max-h.xRange.min+r;else{b=o.xRange.max-h.xRange.max;const M=(h.xRange.max-h.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)p=o.yRange.max-h.yRange.min+r;else{p=o.yRange.max-h.yRange.max;const M=(h.yRange.max-h.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(p+=M)}for(const M of u)M.x+=b,M.y+=p,e.push(M)}let f=1;for(;f<i.length;)l(i[f],!0,!1),l(i[f+1],!1,!0),l(i[f+2],!0,!0),f+=3,o=dt(e);return Nt(e)}function Ot(t,n,s,e,i){const o=jt(t);n-=2*e,s-=2*e;const{xRange:r,yRange:l}=dt(o);if(r.max===r.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let f,u;if(i){const b=Math.sqrt(i/Math.PI)*2;f=n/b,u=s/b}else f=n/(r.max-r.min),u=s/(l.max-l.min);const a=Math.min(u,f),y=(n-(r.max-r.min)*a)/2,h=(s-(l.max-l.min)*a)/2;return Nt(o.map(b=>({radius:a*b.radius,x:e+y+(b.x-r.min)*a,y:e+h+(b.y-l.min)*a,setid:b.setid})))}function Nt(t){const n={};for(const s of t)n[s.setid]=s;return n}function jt(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,o=1e3,r=Math.PI/2,l=!0,f=null,u=!0,a=!0,y=null,h=null,b=!1,p=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},_=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(x){if(x in E)return E[x];var d=E[x]=_[S];return S+=1,S>=_.length&&(S=0),d},m=At,v=tt;function c(x){let d=x.datum();const C=new Set;d.forEach(I=>{I.size==0&&I.sets.length==1&&C.add(I.sets[0])}),d=d.filter(I=>!I.sets.some(O=>C.has(O)));let k={},D={};if(d.length>0){let I=m(d,{lossFunction:v,distinct:b});l&&(I=Dt(I,r,h)),k=Ot(I,s,e,i,f),D=Lt(k,d,M)}const U={};d.forEach(I=>{I.label&&(U[I.sets]=I.label)});function V(I){if(I.sets in U)return U[I.sets];if(I.sets.length==1)return""+I.sets[0]}x.selectAll("svg").data([k]).enter().append("svg");const j=x.select("svg");n?j.attr("viewBox",`0 0 ${s} ${e}`):j.attr("width",s).attr("height",e);const R={};let T=!1;j.selectAll(".venn-area path").each(function(I){const O=this.getAttribute("d");I.sets.length==1&&O&&!b&&(T=!0,R[I.sets[0]]=Me(O))});function A(I){return O=>{const K=I.sets.map(et=>{let Y=R[et],X=k[et];return Y||(Y={x:s/2,y:e/2,radius:1}),X||(X={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-O)+X.x*O,y:Y.y*(1-O)+X.y*O,radius:Y.radius*(1-O)+X.radius*O}});return St(K,p)}}const G=j.selectAll(".venn-area").data(d,I=>I.sets),P=G.enter().append("g").attr("class",I=>`venn-area venn-${I.sets.length==1?"circle":"intersection"}${I.colour||I.color?" venn-coloured":""}`).attr("data-venn-sets",I=>I.sets.join("_")),B=P.append("path"),W=P.append("text").attr("class","label").text(I=>V(I)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(B.style("fill-opacity","0").filter(I=>I.sets.length==1).style("fill",I=>I.colour?I.colour:I.color?I.color:g(I.sets)).style("fill-opacity",".25"),W.style("fill",I=>I.colour||I.color?"#FFF":t.textFill?t.textFill:I.sets.length==1?g(I.sets):"#444"));function L(I){return typeof I.transition=="function"?I.transition("venn").duration(o):I}let z=x;T&&typeof z.transition=="function"?(z=L(x),z.selectAll("path").attrTween("d",A)):z.selectAll("path").attr("d",I=>St(I.sets.map(O=>k[O])),p);const N=z.selectAll("text").filter(I=>I.sets in D).text(I=>V(I)).attr("x",I=>Math.floor(D[I.sets].x)).attr("y",I=>Math.floor(D[I.sets].y));u&&(T?"on"in N?N.on("end",rt(k,V)):N.each("end",rt(k,V)):N.each(rt(k,V)));const F=L(G.exit()).remove();typeof G.transition=="function"&&F.selectAll("path").attrTween("d",A);const J=F.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(W.style("font-size","0px"),N.style("font-size",y),J.style("font-size","0px")),{circles:k,textCentres:D,nodes:G,enter:P,update:z,exit:F}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(b=x,c):b},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(y=x,c):y},c.round=function(x){return arguments.length?(p=x,c):p},c.duration=function(x){return arguments.length?(o=x,c):o},c.layoutFunction=function(x){return arguments.length?(m=x,c):m},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(f=x,c):f},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(r=x,c):r},c.orientationOrder=function(x){return arguments.length?(h=x,c):h},c.lossFunction=function(x){return arguments.length?(v=x==="default"?tt:x==="logRatio"?Ct:x,c):v},c}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",r=o.split(/\s+/).reverse(),f=(o.length+r.length)/3;let u=r.pop(),a=[u],y=0;const h=1.1;e.textContent=null;const b=[];function p(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=p(u);for(;u=r.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>f&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=p(u),y++)}const E=.35-y*h/2,_=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",_),g.setAttribute("y",S),g.setAttribute("dy",`${E+m*h}em`)})}}function at(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i<n.length;++i){const o=n[i].radius-q(n[i],t);o<=e&&(e=o)}for(let i=0;i<s.length;++i){const o=q(s[i],t)-s[i].radius;o<=e&&(e=o)}return e}function Ft(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],o=at(e[0],t,n);for(let a=1;a<e.length;++a){const y=at(e[a],t,n);y>=o&&(i=e[a],o=y)}const r=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:r[0],y:r[1]};let f=!0;for(const a of t)if(q(l,a)>a.radius){f=!1;break}for(const a of n)if(q(l,a)<a.radius){f=!1;break}if(f)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?Ft(t,[]):Et(u.arcs.map(a=>a.p1))}function ke(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],o=t[i];for(let r=e+1;r<s.length;++r){const l=s[r],f=t[l],u=q(o,f);u+f.radius<=o.radius+1e-10?n[l].push(i):u+o.radius<=f.radius+1e-10&&n[i].push(l)}}return n}function Lt(t,n,s){const e={},i=ke(t);for(let o=0;o<n.length;++o){const r=n[o].sets,l={},f={};for(let h=0;h<r.length;++h){l[r[h]]=!0;const b=i[r[h]];for(let p=0;p<b.length;++p)f[b[p]]=!0}const u=[],a=[];for(let h in t)h in l?u.push(t[h]):h in f||a.push(t[h]);const y=Ft(u,a,s);e[r]=y,y.disjoint&&n[o].size>0&&console.log("WARNING: area "+r+" not represented on screen")}return e}function Ie(t,n,s){const e=[];return e.push(`
|
|
1
|
+
import{b9 as Wt,s as Kt,g as Ht,x as Yt,v as Xt,a as Zt,b as Qt,_ as w,O as wt,T as Jt,k as ot,at as $t,ai as te,aj as ee,ak as ne,d as se,D as ie,Q as oe,R as re}from"./mermaid.core-aqB1jW_w.js";import"./index-XFwW09vd.js";const It=(t,n)=>Wt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,o=0;const r=[];if(e.length>1){const l=Et(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let f=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];o+=(f.x+a.x)*(a.y-f.y);const y={x:(a.x+f.x)/2,y:(a.y+f.y)/2};let h=null;for(let b=0;b<a.parentIndex.length;++b)if(f.parentIndex.includes(a.parentIndex[b])){const p=t[a.parentIndex[b]],M=Math.atan2(a.x-p.x,a.y-p.y),E=Math.atan2(f.x-p.x,f.y-p.y);let _=E-M;_<0&&(_+=2*Math.PI);const S=E-_/2;let g=q(y,{x:p.x+p.radius*Math.sin(S),y:p.y+p.radius*Math.cos(S)});g>p.radius*2&&(g=p.radius*2),(h==null||h.width>g)&&(h={circle:p,width:g,p1:a,p2:f,large:g>p.radius,sweep:!0})}h!=null&&(r.push(h),i+=lt(h.circle.radius,h.width),f=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let f=!1;for(let u=0;u<t.length;++u)if(q(t[u],l)>Math.abs(l.radius-t[u].radius)){f=!0;break}f?i=o=0:(i=l.radius*l.radius*Math.PI,r.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=r,n.innerPoints=e,n.intersectionPoints=s),i+o}function ae(t,n){return n.every(s=>q(t,s)<s.radius+_t)}function le(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Tt(t[s],t[e]);for(const o of i)o.parentIndex=[s,e],n.push(o)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function q(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),r=Math.sqrt(e*e-o*o),l=t.x+o*(n.x-t.x)/s,f=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(r/s),a=-(n.x-t.x)*(r/s);return[{x:l+u,y:f-a},{x:l-u,y:f+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,r=t(n),l=t(s);let f=s-n;if(r*l>0)throw"Initial bisect points must have opposite signs";if(r===0)return n;if(l===0)return s;for(let u=0;u<i;++u){f/=2;const a=n+f,y=t(a);if(y*r>=0&&(n=a),Math.abs(f)<o||y===0)return a}return n+f}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function $(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt($(t,t))}function ft(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function Z(t,n,s,e,i){for(let o=0;o<t.length;++o)t[o]=n*s[o]+e*i[o]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,o=s.zeroDelta||.001,r=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,f=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,y=s.sigma!==void 0?s.sigma:.5;let h;const b=n.length,p=new Array(b+1);p[0]=n,p[0].fx=t(n),p[0].id=0;for(let v=0;v<b;++v){const c=n.slice();c[v]=c[v]?c[v]*i:o,p[v+1]=c,p[v+1].fx=t(c),p[v+1].id=v+1}function M(v){for(let c=0;c<v.length;c++)p[b][c]=v[c];p[b].fx=v.fx}const E=(v,c)=>v.fx-c.fx,_=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v<e;++v){if(p.sort(E),s.history){const x=p.map(d=>{const C=d.slice();return C.fx=d.fx,C.id=d.id,C});x.sort((d,C)=>d.id-C.id),s.history.push({x:p[0].slice(),fx:p[0].fx,simplex:x})}h=0;for(let x=0;x<b;++x)h=Math.max(h,Math.abs(p[0][x]-p[1][x]));if(Math.abs(p[0].fx-p[b].fx)<r&&h<l)break;for(let x=0;x<b;++x){_[x]=0;for(let d=0;d<b;++d)_[x]+=p[d][x];_[x]/=b}const c=p[b];if(Z(S,1+f,_,-f,c),S.fx=t(S),S.fx<p[0].fx)Z(m,1+u,_,-u,c),m.fx=t(m),m.fx<S.fx?M(m):M(S);else if(S.fx>=p[b-1].fx){let x=!1;if(S.fx>c.fx?(Z(g,1+a,_,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(Z(g,1-a*f,_,a*f,c),g.fx=t(g),g.fx<S.fx?M(g):x=!0),x){if(y>=1)break;for(let d=1;d<p.length;++d)Z(p[d],1-y,p[0],y,p[d]),p[d].fx=t(p[d])}}else M(S)}return p.sort(E),{fx:p[0].fx,x:p[0]}}function ue(t,n,s,e,i,o,r){const l=s.fx,f=$(s.fxprime,n);let u=l,a=l,y=f,h=0;i=i||1,o=o||1e-6,r=r||.1;function b(p,M,E){for(let _=0;_<16;++_)if(i=(p+M)/2,Z(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||u>=E)M=i;else{if(Math.abs(y)<=-r*f)return i;y*(M-p)>=0&&(M=p),p=i,E=u}return 0}for(let p=0;p<10;++p){if(Z(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||p&&u>=a)return b(h,i,a);if(Math.abs(y)<=-r*f)return i;if(y>=0)return b(i,h,u);a=u,h=i,i*=2}return i}function fe(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let r,l,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),r=e.fxprime.slice(),ft(r,e.fxprime,-1);for(let a=0;a<u;++a){if(f=ue(t,r,e,i,f),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),!f)ft(r,e.fxprime,-1);else{Z(o,1,i.fxprime,-1,e.fxprime);const y=$(e.fxprime,e.fxprime),h=Math.max(0,$(o,i.fxprime)/y);Z(r,h,r,-1,i.fxprime),l=e,e=i,i=l}if(ut(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),e}function At(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||xe,e=n.lossFunction||tt,i=he(t,n),o=s(i,n),r=Object.keys(o),l=[];for(const a of r)l.push(o[a].x),l.push(o[a].y);const u=zt(a=>{const y={};for(let h=0;h<r.length;++h){const b=r[h];y[b]={x:a[2*h],y:a[2*h+1],radius:o[b].radius}}return e(y,i)},l,n).x;for(let a=0;a<r.length;++a){const y=r[a];o[y].x=u[2*a],o[y].y=u[2*a+1]}return o}const Rt=1e-10;function ht(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):ce(e=>xt(t,n,e)-s,0,t+n)}function he(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const f of e)for(let u=0;u<f.sets.length;u++){const a=String(f.sets[u]);l.set(a,f.size+(l.get(a)||0));for(let y=u+1;y<f.sets.length;y++){const h=String(f.sets[y]),b=`${a};${h}`,p=`${h};${a}`;l.set(b,f.size+(l.get(b)||0)),l.set(p,f.size+(l.get(p)||0))}}for(const f of e)f.sets.length<3&&(f.size=l.get(i(f.sets)))}const o=[],r=new Set;for(const l of e)if(l.sets.length===1)o.push(l.sets[0]);else if(l.sets.length===2){const f=l.sets[0],u=l.sets[1];r.add(i(l.sets)),r.add(i([u,f]))}o.sort((l,f)=>l===f?0:l<f?-1:1);for(let l=0;l<o.length;++l){const f=o[l];for(let u=l+1;u<o.length;++u){const a=o[u];r.has(i([f,a]))||e.push({sets:[f,a],size:0})}}return e}function de(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(o=>o.sets.length===2).forEach(o=>{const r=s[o.sets[0]],l=s[o.sets[1]],f=Math.sqrt(n[r].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ht(f,u,o.size);e[r][l]=e[l][r]=a;let y=0;o.size+1e-10>=Math.min(n[r].size,n[l].size)?y=1:o.size<=1e-10&&(y=-1),i[r][l]=i[l][r]=y}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let o=0;o<n.length;++o)n[o]=0;let i=0;for(let o=0;o<s.length;++o){const r=t[2*o],l=t[2*o+1];for(let f=o+1;f<s.length;++f){const u=t[2*f],a=t[2*f+1],y=s[o][f],h=e[o][f],b=(u-r)*(u-r)+(a-l)*(a-l),p=Math.sqrt(b),M=b-y*y;h>0&&p<=y||h<0&&p>=y||(i+=2*M*M,n[2*o]+=4*M*(r-u),n[2*o+1]+=4*M*(l-a),n[2*f]+=4*M*(u-r),n[2*f+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=ye(t,n),o=e(i,t),r=e(s,t);o+1e-8<r&&(s=i)}return s}function ye(t,n={}){const s=n.restarts||10,e=[],i={};for(const h of t)h.sets.length===1&&(i[h.sets[0]]=e.length,e.push(h));let{distances:o,constraints:r}=de(t,e,i);const l=ut(o.map(ut))/o.length;o=o.map(h=>h.map(b=>b/l));const f=(h,b)=>ge(h,b,o,r);let u=null;for(let h=0;h<s;++h){const b=ct(o.length*2).map(Math.random),p=fe(f,b,n);(!u||p.fx<u.fx)&&(u=p)}const a=u.x,y={};for(let h=0;h<e.length;++h){const b=e[h];y[b.sets[0]]={x:a[2*h]*l,y:a[2*h+1]*l,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const h of n.history)ft(h.x,l);return y}function pe(t,n){const s=n&&n.lossFunction?n.lossFunction:tt,e={},i={};for(const y of t)if(y.sets.length===1){const h=y.sets[0];e[h]={x:1e10,y:1e10,rowid:e.length,size:y.size,radius:Math.sqrt(y.size/Math.PI)},i[h]=[]}t=t.filter(y=>y.sets.length===2);for(const y of t){let h=y.weight!=null?y.weight:1;const b=y.sets[0],p=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[p].size)&&(h=0),i[b].push({set:p,size:y.size,weight:h}),i[p].push({set:b,size:y.size,weight:h})}const o=[];Object.keys(i).forEach(y=>{let h=0;for(let b=0;b<i[y].length;++b)h+=i[y][b].size*i[y][b].weight;o.push({set:y,size:h})});function r(y,h){return h.size-y.size}o.sort(r);const l={};function f(y){return y.set in l}function u(y,h){e[h].x=y.x,e[h].y=y.y,l[h]=!0}u({x:0,y:0},o[0].set);for(let y=1;y<o.length;++y){const h=o[y].set,b=i[h].filter(f),p=e[h];if(b.sort(r),b.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var a=0;a<b.length;++a){const S=e[b[a].set],g=ht(p.radius,S.radius,b[a].size);M.push({x:S.x+g,y:S.y}),M.push({x:S.x-g,y:S.y}),M.push({y:S.y+g,x:S.x}),M.push({y:S.y-g,x:S.x});for(let m=a+1;m<b.length;++m){const v=e[b[m].set],c=ht(p.radius,v.radius,b[m].size),x=Tt({x:S.x,y:S.y,radius:g},{x:v.x,y:v.y,radius:c});M.push(...x)}}let E=1e50,_=M[0];for(const S of M){e[h].x=S.x,e[h].y=S.y;const g=s(e,t);g<E&&(E=g,_=S)}u(_,h)}return e}function tt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const r=t[e.sets[0]],l=t[e.sets[1]];i=xt(r.radius,l.radius,q(r,l))}else i=st(e.sets.map(r=>t[r]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function Ct(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],f=t[e.sets[1]];i=xt(l.radius,f.radius,q(l,f))}else i=st(e.sets.map(l=>t[l]));const o=e.weight!=null?e.weight:1,r=Math.log((i+1)/(e.size+1));s+=o*r*r}return s}function me(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const r of t)r.x-=i,r.y-=o}if(t.length===2&&q(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),r=Math.sin(i);for(const l of t){const f=l.x,u=l.y;l.x=o*f-r*u,l.y=r*f+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const r of t){var e=(r.x+o*r.y)/(1+o*o);r.x=2*e-r.x,r.y=2*e*o-r.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const r=n(i),l=n(o);r.parent=l}for(let i=0;i<t.length;++i)for(let o=i+1;o<t.length;++o){const r=t[i].radius+t[o].radius;q(t[i],t[o])+1e-10<r&&s(t[o],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const o=n(t[i]).parent.setid;e.has(o)||e.set(o,[]),e.get(o).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,r)=>Math.max(o,r[s]+r.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,r)=>Math.min(o,r[s]-r.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Dt(t,n,s){n==null&&(n=Math.PI/2);let e=jt(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let o=e.bounds;const r=(o.xRange.max-o.xRange.min)/50;function l(u,a,y){if(!u)return;const h=u.bounds;let b,p;if(a)b=o.xRange.max-h.xRange.min+r;else{b=o.xRange.max-h.xRange.max;const M=(h.xRange.max-h.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)p=o.yRange.max-h.yRange.min+r;else{p=o.yRange.max-h.yRange.max;const M=(h.yRange.max-h.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(p+=M)}for(const M of u)M.x+=b,M.y+=p,e.push(M)}let f=1;for(;f<i.length;)l(i[f],!0,!1),l(i[f+1],!1,!0),l(i[f+2],!0,!0),f+=3,o=dt(e);return Nt(e)}function Ot(t,n,s,e,i){const o=jt(t);n-=2*e,s-=2*e;const{xRange:r,yRange:l}=dt(o);if(r.max===r.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let f,u;if(i){const b=Math.sqrt(i/Math.PI)*2;f=n/b,u=s/b}else f=n/(r.max-r.min),u=s/(l.max-l.min);const a=Math.min(u,f),y=(n-(r.max-r.min)*a)/2,h=(s-(l.max-l.min)*a)/2;return Nt(o.map(b=>({radius:a*b.radius,x:e+y+(b.x-r.min)*a,y:e+h+(b.y-l.min)*a,setid:b.setid})))}function Nt(t){const n={};for(const s of t)n[s.setid]=s;return n}function jt(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,o=1e3,r=Math.PI/2,l=!0,f=null,u=!0,a=!0,y=null,h=null,b=!1,p=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},_=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(x){if(x in E)return E[x];var d=E[x]=_[S];return S+=1,S>=_.length&&(S=0),d},m=At,v=tt;function c(x){let d=x.datum();const C=new Set;d.forEach(I=>{I.size==0&&I.sets.length==1&&C.add(I.sets[0])}),d=d.filter(I=>!I.sets.some(O=>C.has(O)));let k={},D={};if(d.length>0){let I=m(d,{lossFunction:v,distinct:b});l&&(I=Dt(I,r,h)),k=Ot(I,s,e,i,f),D=Lt(k,d,M)}const U={};d.forEach(I=>{I.label&&(U[I.sets]=I.label)});function V(I){if(I.sets in U)return U[I.sets];if(I.sets.length==1)return""+I.sets[0]}x.selectAll("svg").data([k]).enter().append("svg");const j=x.select("svg");n?j.attr("viewBox",`0 0 ${s} ${e}`):j.attr("width",s).attr("height",e);const R={};let T=!1;j.selectAll(".venn-area path").each(function(I){const O=this.getAttribute("d");I.sets.length==1&&O&&!b&&(T=!0,R[I.sets[0]]=Me(O))});function A(I){return O=>{const K=I.sets.map(et=>{let Y=R[et],X=k[et];return Y||(Y={x:s/2,y:e/2,radius:1}),X||(X={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-O)+X.x*O,y:Y.y*(1-O)+X.y*O,radius:Y.radius*(1-O)+X.radius*O}});return St(K,p)}}const G=j.selectAll(".venn-area").data(d,I=>I.sets),P=G.enter().append("g").attr("class",I=>`venn-area venn-${I.sets.length==1?"circle":"intersection"}${I.colour||I.color?" venn-coloured":""}`).attr("data-venn-sets",I=>I.sets.join("_")),B=P.append("path"),W=P.append("text").attr("class","label").text(I=>V(I)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(B.style("fill-opacity","0").filter(I=>I.sets.length==1).style("fill",I=>I.colour?I.colour:I.color?I.color:g(I.sets)).style("fill-opacity",".25"),W.style("fill",I=>I.colour||I.color?"#FFF":t.textFill?t.textFill:I.sets.length==1?g(I.sets):"#444"));function L(I){return typeof I.transition=="function"?I.transition("venn").duration(o):I}let z=x;T&&typeof z.transition=="function"?(z=L(x),z.selectAll("path").attrTween("d",A)):z.selectAll("path").attr("d",I=>St(I.sets.map(O=>k[O])),p);const N=z.selectAll("text").filter(I=>I.sets in D).text(I=>V(I)).attr("x",I=>Math.floor(D[I.sets].x)).attr("y",I=>Math.floor(D[I.sets].y));u&&(T?"on"in N?N.on("end",rt(k,V)):N.each("end",rt(k,V)):N.each(rt(k,V)));const F=L(G.exit()).remove();typeof G.transition=="function"&&F.selectAll("path").attrTween("d",A);const J=F.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(W.style("font-size","0px"),N.style("font-size",y),J.style("font-size","0px")),{circles:k,textCentres:D,nodes:G,enter:P,update:z,exit:F}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(b=x,c):b},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(y=x,c):y},c.round=function(x){return arguments.length?(p=x,c):p},c.duration=function(x){return arguments.length?(o=x,c):o},c.layoutFunction=function(x){return arguments.length?(m=x,c):m},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(f=x,c):f},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(r=x,c):r},c.orientationOrder=function(x){return arguments.length?(h=x,c):h},c.lossFunction=function(x){return arguments.length?(v=x==="default"?tt:x==="logRatio"?Ct:x,c):v},c}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",r=o.split(/\s+/).reverse(),f=(o.length+r.length)/3;let u=r.pop(),a=[u],y=0;const h=1.1;e.textContent=null;const b=[];function p(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=p(u);for(;u=r.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>f&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=p(u),y++)}const E=.35-y*h/2,_=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",_),g.setAttribute("y",S),g.setAttribute("dy",`${E+m*h}em`)})}}function at(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i<n.length;++i){const o=n[i].radius-q(n[i],t);o<=e&&(e=o)}for(let i=0;i<s.length;++i){const o=q(s[i],t)-s[i].radius;o<=e&&(e=o)}return e}function Ft(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],o=at(e[0],t,n);for(let a=1;a<e.length;++a){const y=at(e[a],t,n);y>=o&&(i=e[a],o=y)}const r=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:r[0],y:r[1]};let f=!0;for(const a of t)if(q(l,a)>a.radius){f=!1;break}for(const a of n)if(q(l,a)<a.radius){f=!1;break}if(f)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?Ft(t,[]):Et(u.arcs.map(a=>a.p1))}function ke(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],o=t[i];for(let r=e+1;r<s.length;++r){const l=s[r],f=t[l],u=q(o,f);u+f.radius<=o.radius+1e-10?n[l].push(i):u+o.radius<=f.radius+1e-10&&n[i].push(l)}}return n}function Lt(t,n,s){const e={},i=ke(t);for(let o=0;o<n.length;++o){const r=n[o].sets,l={},f={};for(let h=0;h<r.length;++h){l[r[h]]=!0;const b=i[r[h]];for(let p=0;p<b.length;++p)f[b[p]]=!0}const u=[],a=[];for(let h in t)h in l?u.push(t[h]):h in f||a.push(t[h]);const y=Ft(u,a,s);e[r]=y,y.disjoint&&n[o].size>0&&console.log("WARNING: area "+r+" not represented on screen")}return e}function Ie(t,n,s){const e=[];return e.push(`
|
|
2
2
|
M`,t,n),e.push(`
|
|
3
3
|
m`,-s,0),e.push(`
|
|
4
4
|
a`,s,s,0,1,0,s*2,0),e.push(`
|
package/dist/assets/{wardleyDiagram-VNRHLVJA-HVq776nz.js → wardleyDiagram-VNRHLVJA-DXSfsjUr.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as Mt}from"./chunk-JWPE2WC7-
|
|
1
|
+
import{p as Mt}from"./chunk-JWPE2WC7-g2dOoIMX.js";import{s as Nt,g as Tt,x as zt,v as Lt,a as At,b as Xt,_ as u,a9 as Et,O as Yt,Q as U,l as K,T as It,d as Bt,D as Ft,c as V}from"./mermaid.core-aqB1jW_w.js";import{p as Ot}from"./cynefin-OW5HDTMX-cZS_kt1A.js";import"./index-XFwW09vd.js";var G=u((o,r)=>{const e=o<=1?o*100:o;if(e<0||e>100)throw new Error(`${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`);return e},"toPercent"),A=u((o,r,e)=>({x:G(r,`${e} evolution`),y:G(o,`${e} visibility`)}),"toCoordinates"),J=u(o=>{if(o){if(o==="+<>")return"bidirectional";if(o==="+<")return"backward";if(o==="+>")return"forward"}},"getFlowFromPort"),Rt=u(o=>{if(!o?.startsWith("+"))return{};const e=/^\+'([^']*)'/.exec(o)?.[1];return o.includes("<>")?{flow:"bidirectional",label:e}:o.includes("<")?{flow:"backward",label:e}:o.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Wt=u((o,r)=>{if(Mt(o,r),o.size&&r.setSize(o.size.width,o.size.height),o.evolution){const e=o.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),h=o.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);r.updateAxes({stages:e,stageBoundaries:h})}if(o.anchors.forEach(e=>{const h=A(e.visibility,e.evolution,`Anchor "${e.name}"`);r.addNode(e.name,e.name,h.x,h.y,"anchor")}),o.components.forEach(e=>{const h=A(e.visibility,e.evolution,`Component "${e.name}"`),a=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,w=e.decorator?.strategy;r.addNode(e.name,e.name,h.x,h.y,"component",a,d,e.inertia,w)}),o.notes.forEach(e=>{const h=A(e.visibility,e.evolution,`Note "${e.text}"`);r.addNote(e.text,h.x,h.y)}),o.pipelines.forEach(e=>{const h=r.getNode(e.parent);if(!h||typeof h.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const a=h.y;r.startPipeline(e.parent),e.components.forEach(d=>{const w=`${e.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,O=G(d.evolution,`Pipeline component "${d.name}" evolution`);r.addNode(w,d.name,O,a,"pipeline-component",C,g),r.addPipelineComponent(e.parent,w)})}),o.links.forEach(e=>{const h=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let a=J(e.fromPort)??J(e.toPort);const{flow:d,label:w}=Rt(e.arrow);!a&&d&&(a=d);const C=e.linkLabel,g=w??C;r.addLink(r.resolveNodeId(e.from),r.resolveNodeId(e.to),h,g,a)}),o.evolves.forEach(e=>{const h=r.getNode(e.component);if(h?.y!==void 0){const a=G(e.target,`Evolve target for "${e.component}"`);r.addTrend(e.component,a,h.y)}}),o.annotations.length>0){const e=o.annotations[0],h=A(e.x,e.y,"Annotations box");r.setAnnotationsBox(h.x,h.y)}o.annotation.forEach(e=>{const h=A(e.x,e.y,`Annotation ${e.number}`);r.addAnnotation(e.number,[{x:h.x,y:h.y}],e.text)}),o.accelerators.forEach(e=>{const h=A(e.x,e.y,`Accelerator "${e.name}"`);r.addAccelerator(e.name,h.x,h.y)}),o.deaccelerators.forEach(e=>{const h=A(e.x,e.y,`Deaccelerator "${e.name}"`);r.addDeaccelerator(e.name,h.x,h.y)})},"populateDb"),tt={parser:{yy:void 0},parse:u(async o=>{const r=await Ot("wardley",o);K.debug(r);const e=tt.parser?.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Wt(r,e)},"parse")},E,Dt=(E=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(r){const e=this.nodes.get(r.id)??{id:r.id,label:r.label},h={...e,...r,className:r.className??e.className,labelOffsetX:r.labelOffsetX??e.labelOffsetX,labelOffsetY:r.labelOffsetY??e.labelOffsetY};this.nodes.set(r.id,h)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});const e=this.nodes.get(r);e&&(e.isPipelineParent=!0)}addPipelineComponent(r,e){const h=this.pipelines.get(r);h&&h.componentIds.push(e);const a=this.nodes.get(e);a&&(a.inPipeline=!0)}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,e){this.annotationsBox={x:r,y:e}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,e){this.size={width:r,height:e}}getNode(r){return this.nodes.get(r)}resolveNodeId(r){if(this.nodes.has(r))return r;for(const[e,h]of this.nodes)if(h.label===r)return e;return r}build(){const r=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);r.push(e)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},u(E,"WardleyBuilder"),E),k=new Dt;function et(){return V()["wardley-beta"]}u(et,"getConfig");function at(o,r,e,h,a,d,w,C,g){k.addNode({id:o,label:r,x:e,y:h,className:a,labelOffsetX:d,labelOffsetY:w,inertia:C,sourceStrategy:g})}u(at,"addNode");function rt(o,r,e=!1,h,a){k.addLink({source:o,target:r,dashed:e,label:h,flow:a})}u(rt,"addLink");function ot(o,r,e){k.addTrend({nodeId:o,targetX:r,targetY:e})}u(ot,"addTrend");function nt(o,r,e){k.addAnnotation({number:o,coordinates:r,text:e})}u(nt,"addAnnotation");function st(o,r,e){k.addNote({text:o,x:r,y:e})}u(st,"addNote");function it(o,r,e){k.addAccelerator({name:o,x:r,y:e})}u(it,"addAccelerator");function dt(o,r,e){k.addDeaccelerator({name:o,x:r,y:e})}u(dt,"addDeaccelerator");function lt(o,r){k.setAnnotationsBox(o,r)}u(lt,"setAnnotationsBox");function ct(o,r){k.setSize(o,r)}u(ct,"setSize");function pt(o){k.startPipeline(o)}u(pt,"startPipeline");function ft(o,r){k.addPipelineComponent(o,r)}u(ft,"addPipelineComponent");function ht(o){k.setAxes(o)}u(ht,"updateAxes");function xt(o){return k.getNode(o)}u(xt,"getNode");function gt(o){return k.resolveNodeId(o)}u(gt,"resolveNodeId");function yt(){return k.build()}u(yt,"getWardleyData");function ut(){k.clear(),Ft()}u(ut,"clear");var Gt={getConfig:et,addNode:at,addLink:rt,addTrend:ot,addAnnotation:nt,addNote:st,addAccelerator:it,addDeaccelerator:dt,setAnnotationsBox:lt,setSize:ct,startPipeline:pt,addPipelineComponent:ft,updateAxes:ht,getNode:xt,resolveNodeId:gt,getWardleyData:yt,clear:ut,setAccTitle:Xt,getAccTitle:At,setDiagramTitle:Lt,getDiagramTitle:zt,getAccDescription:Tt,setAccDescription:Nt},qt=["Genesis","Custom Built","Product","Commodity"],Ht=u(()=>{const{themeVariables:o}=V();return{backgroundColor:o.wardley?.backgroundColor??o.background??"#fff",axisColor:o.wardley?.axisColor??"#000",axisTextColor:o.wardley?.axisTextColor??o.primaryTextColor??"#222",gridColor:o.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:o.wardley?.componentFill??"#fff",componentStroke:o.wardley?.componentStroke??"#000",componentLabelColor:o.wardley?.componentLabelColor??o.primaryTextColor??"#222",linkStroke:o.wardley?.linkStroke??"#000",evolutionStroke:o.wardley?.evolutionStroke??"#dc3545",annotationStroke:o.wardley?.annotationStroke??"#000",annotationTextColor:o.wardley?.annotationTextColor??o.primaryTextColor??"#222",annotationFill:o.wardley?.annotationFill??o.background??"#fff"}},"getTheme"),jt=u(()=>{const o=V()["wardley-beta"];return{width:o?.width??900,height:o?.height??600,padding:o?.padding??48,nodeRadius:o?.nodeRadius??6,nodeLabelOffset:o?.nodeLabelOffset??8,axisFontSize:o?.axisFontSize??12,labelFontSize:o?.labelFontSize??10,showGrid:o?.showGrid??!1,useMaxWidth:o?.useMaxWidth??!0}},"getConfigValues"),Vt=u((o,r,e,h)=>{K.debug(`Rendering Wardley map
|
|
2
2
|
`+o);const a=jt(),d=Ht(),w=a.nodeRadius*1.6,C=h.db,g=C.getWardleyData(),O=C.getDiagramTitle(),S=g.size?.width??a.width,b=g.size?.height??a.height,Y=It(r);Y.selectAll("*").remove(),Bt(Y,b,S,a.useMaxWidth),Y.attr("viewBox",`0 0 ${S} ${b}`);const v=Y.append("g").attr("class","wardley-map"),q=Y.append("defs");q.append("marker").attr("id",`arrow-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.evolutionStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-end-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-start-${r}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),v.append("rect").attr("class","wardley-background").attr("width",S).attr("height",b).attr("fill",d.backgroundColor);const I=S-a.padding*2,B=b-a.padding*2;O&&v.append("text").attr("class","wardley-title").attr("x",S/2).attr("y",a.padding/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(O);const T=u(t=>a.padding+t/100*I,"projectX"),z=u(t=>b-a.padding-t/100*B,"projectY"),R=v.append("g").attr("class","wardley-axes");R.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1),R.append("line").attr("x1",a.padding).attr("x2",a.padding).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const wt=g.axes.xLabel??"Evolution",mt=g.axes.yLabel??"Visibility";R.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",a.padding+I/2).attr("y",b-a.padding/4).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(wt),R.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",a.padding/3).attr("y",a.padding+B/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${a.padding/3} ${a.padding+B/2})`).text(mt);const F=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:qt;if(F.length>0){const t=v.append("g").attr("class","wardley-stages"),s=g.axes.stageBoundaries,n=[];if(s&&s.length===F.length){let i=0;s.forEach(p=>{n.push({start:i,end:p}),i=p})}else{const i=1/F.length;F.forEach((p,l)=>{n.push({start:l*i,end:(l+1)*i})})}F.forEach((i,p)=>{const l=n[p],f=a.padding+l.start*I,x=a.padding+l.end*I,y=(f+x)/2;p>0&&t.append("line").attr("x1",f).attr("x2",f).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",y).attr("y",b-a.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(a.showGrid){const t=v.append("g").attr("class","wardley-grid");for(let s=1;s<4;s++){const n=s/4,i=a.padding+I*n;t.append("line").attr("x1",i).attr("x2",i).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding-B*n).attr("y2",b-a.padding-B*n).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:T(t.x),y:z(t.y),node:t})}),g.pipelines.length>0){const t=v.append("g").attr("class","wardley-pipelines"),s=v.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(n=>{if(n.componentIds.length===0)return;const i=n.componentIds.map(x=>({id:x,pos:c.get(x),node:g.nodes.find(y=>y.id===x)})).filter(x=>x.pos&&x.node).sort((x,y)=>x.node.x-y.node.x);for(let x=0;x<i.length-1;x++){const y=i[x],m=i[x+1];s.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",y.pos.x).attr("y1",y.pos.y).attr("x2",m.pos.x).attr("y2",m.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let p=1/0,l=-1/0,f=0;if(n.componentIds.forEach(x=>{const y=c.get(x);y&&(p=Math.min(p,y.x),l=Math.max(l,y.x),f=y.y)}),p!==1/0&&l!==-1/0){const y=a.nodeRadius*4,m=f-y/2,P=c.get(n.nodeId);if(P){const N=(p+l)/2;P.x=N,P.y=m-w/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",p-15).attr("y",m).attr("width",l-p+30).attr("height",y).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=v.append("g").attr("class","wardley-links"),Z=new Map;g.pipelines.forEach(t=>{Z.set(t.nodeId,new Set(t.componentIds))});const Q=g.links.filter(t=>!(!c.has(t.source)||!c.has(t.target)||Z.get(t.target)?.has(t.source)));_.selectAll("line").data(Q).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.x+l/x*p}).attr("y1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.y+f/x*p}).attr("x2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.x+l/x*p}).attr("y2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.y+f/x*p}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${r})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${r})`:null),_.selectAll("text").data(Q.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=n.y-s.y,l=n.x-s.x,f=Math.sqrt(l*l+p*p),x=8,y=p/f;return i+y*x}).attr("y",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.y+n.y)/2,p=n.x-s.x,l=n.y-s.y,f=Math.sqrt(p*p+l*l),x=8,y=-p/f;return i+y*x}).attr("fill",d.axisTextColor).attr("font-size",a.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=(s.y+n.y)/2,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f),y=8,m=f/x,P=-l/x,N=i+m*y,W=p+P*y;let X=Math.atan2(f,l)*180/Math.PI;return(X>90||X<-90)&&(X+=180),`rotate(${X} ${N} ${W})`}).text(t=>t.label);const kt=v.append("g").attr("class","wardley-trends"),bt=g.trends.map(t=>{const s=c.get(t.nodeId);if(!s)return null;const n=T(t.targetX),i=z(t.targetY),p=n-s.x,l=i-s.y,f=Math.sqrt(p*p+l*l),x=a.nodeRadius+2,y=f>x?n-p/f*x:n,m=f>x?i-l/f*x:i;return{origin:s,targetX:n,targetY:i,adjustedX2:y,adjustedY2:m}}).filter(t=>t!==null);kt.selectAll("line").data(bt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${r})`);const M=v.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));M.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const L=M.filter(t=>t.sourceStrategy==="market");L.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const H=a.nodeRadius*.7,$=a.nodeRadius*1.2;if(L.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),L.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),L.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),L.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),L.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),L.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),M.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-w/2).attr("y",t=>c.get(t.id).y-w/2).attr("width",w).attr("height",w).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const s=c.get(t.id);let n=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y1",t=>{const s=c.get(t.id),n=t.isPipelineParent?w:a.nodeRadius*2;return s.y-n/2}).attr("x2",t=>{const s=c.get(t.id);let n=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y2",t=>{const s=c.get(t.id),n=t.isPipelineParent?w:a.nodeRadius*2;return s.y+n/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),M.append("text").attr("x",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?s.x+t.labelOffsetX:s.x;let n=a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(n+=10);const i=t.labelOffsetX??n;return s.x+i}).attr("y",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?s.y+t.labelOffsetY:s.y-3;let n=-a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(n-=10);const i=t.labelOffsetY??n;return s.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",a.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){const t=v.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(s=>{const n=s.coordinates.map(i=>({x:T(i.x),y:z(i.y)}));if(n.length>1)for(let i=0;i<n.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",n[i].x).attr("y1",n[i].y).attr("x2",n[i+1].x).attr("y2",n[i+1].y).attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");n.forEach(i=>{const p=t.append("g").attr("class","wardley-annotation");p.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),p.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.number)})}),g.annotationsBox){let s=T(g.annotationsBox.x),n=z(g.annotationsBox.y);const i=10,p=16,l=11,f=t.append("g").attr("class","wardley-annotations-box"),x=[...g.annotations].filter(m=>m.text).sort((m,P)=>m.number-P.number),y=[];if(x.forEach((m,P)=>{const N=f.append("text").attr("x",s+i).attr("y",n+i+(P+1)*p).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${m.number}. ${m.text}`);y.push(N)}),y.length>0){let m=0,P=0;y.forEach(j=>{const D=j.node(),Ct=D.getComputedTextLength();m=Math.max(m,Ct);const St=D.getBBox();P=Math.max(P,St.height)});const N=m+i*2+105,W=x.length*p+i*2+P/2,X=a.padding,$t=S-a.padding-N,vt=a.padding,Pt=b-a.padding-W;s=Math.max(X,Math.min(s,$t)),n=Math.max(vt,Math.min(n,Pt)),y.forEach((j,D)=>{j.attr("x",s+i).attr("y",n+i+(D+1)*p)}),f.insert("rect","text").attr("x",s).attr("y",n).attr("width",N).attr("height",W).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=v.append("g").attr("class","wardley-notes");g.notes.forEach(s=>{const n=T(s.x),i=z(s.y);t.append("text").attr("x",n).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.text)})}if(g.accelerators.length>0){const t=v.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(s=>{const n=T(s.x),i=z(s.y),p=60,l=30,f=20,x=`
|
|
3
3
|
M ${n} ${i-l/2}
|
|
4
4
|
L ${n+p-f} ${i-l/2}
|
package/dist/assets/{xychartDiagram-PMCCYNJV-DPf9VEua.js → xychartDiagram-PMCCYNJV-mYX9tnBU.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{s as pe,g as me,x as $t,v as ye,a as be,b as we,_ as a,l as Ut,T as Ae,d as Ce,D as Se,O as Dt,j as Re,Q as Gt,R as _e,a9 as ke,aG as Te,aH as Xt}from"./mermaid.core-
|
|
1
|
+
import{s as pe,g as me,x as $t,v as ye,a as be,b as we,_ as a,l as Ut,T as Ae,d as Ce,D as Se,O as Dt,j as Re,Q as Gt,R as _e,a9 as ke,aG as Te,aH as Xt}from"./mermaid.core-aqB1jW_w.js";import{i as De}from"./init-Gi6I4Gst.js";import{o as ve}from"./ordinal-Cboi1Yqb.js";import{l as Nt}from"./linear-Bh29RTbQ.js";import"./index-XFwW09vd.js";import"./defaultLocale-DX6XiGOO.js";function Pe(i,t,e){i=+i,t=+t,e=(n=arguments.length)<2?(t=i,i=0,1):n<3?1:+e;for(var s=-1,n=Math.max(0,Math.ceil((t-i)/e))|0,o=new Array(n);++s<n;)o[s]=i+s*e;return o}function St(){var i=ve().unknown(void 0),t=i.domain,e=i.range,s=0,n=1,o,h,p=!1,u=0,f=0,R=.5;delete i.unknown;function C(){var y=t().length,E=n<s,P=E?n:s,L=E?s:n;o=(L-P)/Math.max(1,y-u+f*2),p&&(o=Math.floor(o)),P+=(L-P-o*(y-u))*R,h=o*(1-u),p&&(P=Math.round(P),h=Math.round(h));var M=Pe(y).map(function(b){return P+o*b});return e(E?M.reverse():M)}return i.domain=function(y){return arguments.length?(t(y),C()):t()},i.range=function(y){return arguments.length?([s,n]=y,s=+s,n=+n,C()):[s,n]},i.rangeRound=function(y){return[s,n]=y,s=+s,n=+n,p=!0,C()},i.bandwidth=function(){return h},i.step=function(){return o},i.round=function(y){return arguments.length?(p=!!y,C()):p},i.padding=function(y){return arguments.length?(u=Math.min(1,f=+y),C()):u},i.paddingInner=function(y){return arguments.length?(u=Math.min(1,y),C()):u},i.paddingOuter=function(y){return arguments.length?(f=+y,C()):f},i.align=function(y){return arguments.length?(R=Math.max(0,Math.min(1,y)),C()):R},i.copy=function(){return St(t(),[s,n]).round(p).paddingInner(u).paddingOuter(f).align(R)},De.apply(C(),arguments)}var Rt=(function(){var i=a(function(W,l,g,d){for(g=g||{},d=W.length;d--;g[W[d]]=l);return g},"o"),t=[1,10,12,14,16,18,19,21,23],e=[2,6],s=[1,3],n=[1,5],o=[1,6],h=[1,7],p=[1,5,10,12,14,16,18,19,21,23,36,37,38],u=[1,25],f=[1,26],R=[1,28],C=[1,29],y=[1,30],E=[1,31],P=[1,32],L=[1,33],M=[1,34],b=[1,35],D=[1,36],c=[1,37],B=[1,43],F=[1,42],X=[1,47],N=[1,50],k=[1,10,12,14,16,18,19,21,23,36,37,38],H=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],A=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],S=[1,65],O=[26,28],T={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:a(function(l,g,d,x,_,r,lt){var m=r.length-1;switch(_){case 5:x.setOrientation(r[m]);break;case 9:x.setDiagramTitle(r[m].text.trim());break;case 12:x.setLineData({text:"",type:"text"},r[m]);break;case 13:x.setLineData(r[m-1],r[m]);break;case 14:x.setBarData({text:"",type:"text"},r[m]);break;case 15:x.setBarData(r[m-1],r[m]);break;case 16:this.$=r[m].trim(),x.setAccTitle(this.$);break;case 17:case 18:this.$=r[m].trim(),x.setAccDescription(this.$);break;case 19:this.$=r[m-1];break;case 20:case 30:this.$=[r[m-2],...r[m]];break;case 21:case 31:this.$=[r[m]];break;case 22:this.$={value:Number(r[m-1]),label:r[m]};break;case 23:this.$={value:Number(r[m]),label:""};break;case 24:x.setXAxisTitle(r[m]);break;case 25:x.setXAxisTitle(r[m-1]);break;case 26:x.setXAxisTitle({type:"text",text:""});break;case 27:x.setXAxisBand(r[m]);break;case 28:x.setXAxisRangeData(Number(r[m-2]),Number(r[m]));break;case 29:this.$=r[m-1];break;case 32:x.setYAxisTitle(r[m]);break;case 33:x.setYAxisTitle(r[m-1]);break;case 34:x.setYAxisTitle({type:"text",text:""});break;case 35:x.setYAxisRangeData(Number(r[m-2]),Number(r[m]));break;case 39:this.$={text:r[m],type:"text"};break;case 40:this.$={text:r[m],type:"text"};break;case 41:this.$={text:r[m],type:"markdown"};break;case 42:this.$=r[m];break;case 43:this.$=r[m-1]+""+r[m];break}},"anonymous"),table:[i(t,e,{3:1,4:2,7:4,5:s,36:n,37:o,38:h}),{1:[3]},i(t,e,{4:2,7:4,3:8,5:s,36:n,37:o,38:h}),i(t,e,{4:2,7:4,6:9,3:10,5:s,8:[1,11],36:n,37:o,38:h}),{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]},i(p,[2,36]),i(p,[2,37]),i(p,[2,38]),{1:[2,1]},i(t,e,{4:2,7:4,3:21,5:s,36:n,37:o,38:h}),{1:[2,3]},i(p,[2,5]),i(t,[2,7],{4:22,36:n,37:o,38:h}),{11:23,30:u,39:24,40:f,41:27,42:R,43:C,44:y,45:E,46:P,47:L,48:M,49:b,50:D,51:c},{11:39,13:38,24:B,29:F,30:u,31:40,32:41,39:24,40:f,41:27,42:R,43:C,44:y,45:E,46:P,47:L,48:M,49:b,50:D,51:c},{11:45,15:44,29:X,30:u,35:46,39:24,40:f,41:27,42:R,43:C,44:y,45:E,46:P,47:L,48:M,49:b,50:D,51:c},{11:49,17:48,24:N,30:u,39:24,40:f,41:27,42:R,43:C,44:y,45:E,46:P,47:L,48:M,49:b,50:D,51:c},{11:52,17:51,24:N,30:u,39:24,40:f,41:27,42:R,43:C,44:y,45:E,46:P,47:L,48:M,49:b,50:D,51:c},{20:[1,53]},{22:[1,54]},i(k,[2,18]),{1:[2,2]},i(k,[2,8]),i(k,[2,9]),i(H,[2,39],{41:55,42:R,43:C,44:y,45:E,46:P,47:L,48:M,49:b,50:D,51:c}),i(H,[2,40]),i(H,[2,41]),i(A,[2,42]),i(A,[2,44]),i(A,[2,45]),i(A,[2,46]),i(A,[2,47]),i(A,[2,48]),i(A,[2,49]),i(A,[2,50]),i(A,[2,51]),i(A,[2,52]),i(A,[2,53]),i(k,[2,10]),i(k,[2,24],{32:41,31:56,24:B,29:F}),i(k,[2,26]),i(k,[2,27]),{33:[1,57]},{11:59,30:u,34:58,39:24,40:f,41:27,42:R,43:C,44:y,45:E,46:P,47:L,48:M,49:b,50:D,51:c},i(k,[2,11]),i(k,[2,32],{35:60,29:X}),i(k,[2,34]),{33:[1,61]},i(k,[2,12]),{17:62,24:N},{25:63,27:64,29:S},i(k,[2,14]),{17:66,24:N},i(k,[2,16]),i(k,[2,17]),i(A,[2,43]),i(k,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},i(k,[2,33]),{29:[1,70]},i(k,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},i(O,[2,23],{30:[1,73]}),i(k,[2,15]),i(k,[2,28]),i(k,[2,29]),{11:59,30:u,34:74,39:24,40:f,41:27,42:R,43:C,44:y,45:E,46:P,47:L,48:M,49:b,50:D,51:c},i(k,[2,35]),i(k,[2,19]),{25:75,27:64,29:S},i(O,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:a(function(l,g){if(g.recoverable)this.trace(l);else{var d=new Error(l);throw d.hash=g,d}},"parseError"),parse:a(function(l){var g=this,d=[0],x=[],_=[null],r=[],lt=this.table,m="",dt=0,Ot=0,ue=2,Vt=1,de=r.slice.call(arguments,1),v=Object.create(this.lexer),$={yy:{}};for(var bt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,bt)&&($.yy[bt]=this.yy[bt]);v.setInput(l,$.yy),$.yy.lexer=v,$.yy.parser=this,typeof v.yylloc>"u"&&(v.yylloc={});var wt=v.yylloc;r.push(wt);var xe=v.options&&v.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function fe(z){d.length=d.length-2*z,_.length=_.length-z,r.length=r.length-z}a(fe,"popStack");function Ft(){var z;return z=x.pop()||v.lex()||Vt,typeof z!="number"&&(z instanceof Array&&(x=z,z=x.pop()),z=g.symbols_[z]||z),z}a(Ft,"lex");for(var I,U,V,At,j={},xt,Y,Wt,ft;;){if(U=d[d.length-1],this.defaultActions[U]?V=this.defaultActions[U]:((I===null||typeof I>"u")&&(I=Ft()),V=lt[U]&<[U][I]),typeof V>"u"||!V.length||!V[0]){var Ct="";ft=[];for(xt in lt[U])this.terminals_[xt]&&xt>ue&&ft.push("'"+this.terminals_[xt]+"'");v.showPosition?Ct="Parse error on line "+(dt+1)+`:
|
|
2
2
|
`+v.showPosition()+`
|
|
3
3
|
Expecting `+ft.join(", ")+", got '"+(this.terminals_[I]||I)+"'":Ct="Parse error on line "+(dt+1)+": Unexpected "+(I==Vt?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Ct,{text:v.match,token:this.terminals_[I]||I,line:v.yylineno,loc:wt,expected:ft})}if(V[0]instanceof Array&&V.length>1)throw new Error("Parse Error: multiple actions possible at state: "+U+", token: "+I);switch(V[0]){case 1:d.push(I),_.push(v.yytext),r.push(v.yylloc),d.push(V[1]),I=null,Ot=v.yyleng,m=v.yytext,dt=v.yylineno,wt=v.yylloc;break;case 2:if(Y=this.productions_[V[1]][1],j.$=_[_.length-Y],j._$={first_line:r[r.length-(Y||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(Y||1)].first_column,last_column:r[r.length-1].last_column},xe&&(j._$.range=[r[r.length-(Y||1)].range[0],r[r.length-1].range[1]]),At=this.performAction.apply(j,[m,Ot,dt,$.yy,V[1],_,r].concat(de)),typeof At<"u")return At;Y&&(d=d.slice(0,-1*Y*2),_=_.slice(0,-1*Y),r=r.slice(0,-1*Y)),d.push(this.productions_[V[1]][0]),_.push(j.$),r.push(j._$),Wt=lt[d[d.length-2]][d[d.length-1]],d.push(Wt);break;case 3:return!0}}return!0},"parse")},ht=(function(){var W={EOF:1,parseError:a(function(g,d){if(this.yy.parser)this.yy.parser.parseError(g,d);else throw new Error(g)},"parseError"),setInput:a(function(l,g){return this.yy=g||this.yy||{},this._input=l,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:a(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var g=l.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),l},"input"),unput:a(function(l){var g=l.length,d=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var x=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),d.length-1&&(this.yylineno-=d.length-1);var _=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:d?(d.length===x.length?this.yylloc.first_column:0)+x[x.length-d.length].length-d[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:a(function(l){this.unput(this.match.slice(l))},"less"),pastInput:a(function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var l=this.match;return l.length<20&&(l+=this._input.substr(0,20-l.length)),(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var l=this.pastInput(),g=new Array(l.length+1).join("-");return l+this.upcomingInput()+`
|
package/dist/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<link rel="icon" type="image/svg+xml" href="/app-icon.svg" />
|
|
7
7
|
<title>Atomic</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-XFwW09vd.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-B2fJMh8N.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
package/dist-server/index.js
CHANGED
|
@@ -8022,6 +8022,19 @@ var require_dist = __commonJS({
|
|
|
8022
8022
|
}
|
|
8023
8023
|
});
|
|
8024
8024
|
|
|
8025
|
+
// server/checkpoint-recovery.ts
|
|
8026
|
+
function isBrokenAntigravityCheckpoint(driverKind, message4) {
|
|
8027
|
+
return driverKind === "antigravityAgent" && message4.includes("could not find doneCh for checkpoint");
|
|
8028
|
+
}
|
|
8029
|
+
function invalidateBrokenCheckpoint(store2, botId, driverKind, event) {
|
|
8030
|
+
if (event.providerInstanceId && isBrokenAntigravityCheckpoint(driverKind, event.message)) {
|
|
8031
|
+
store2.setResumeCursor(botId, event.providerInstanceId, void 0, event.threadId);
|
|
8032
|
+
}
|
|
8033
|
+
}
|
|
8034
|
+
function isAntigravityCheckpointReply(driverKind, text17) {
|
|
8035
|
+
return driverKind === "antigravityAgent" && /^Agent execution error: could not find doneCh for checkpoint\s*$/.test(text17.trim());
|
|
8036
|
+
}
|
|
8037
|
+
|
|
8025
8038
|
// server/model-evidence.ts
|
|
8026
8039
|
import { randomUUID } from "node:crypto";
|
|
8027
8040
|
import { mkdirSync, appendFileSync, readdirSync, readFileSync } from "node:fs";
|
|
@@ -60834,6 +60847,12 @@ function createAcpDriver(support12) {
|
|
|
60834
60847
|
session.acp.failAll(new Error("turn settled"));
|
|
60835
60848
|
session.current = null;
|
|
60836
60849
|
active.delete(threadId);
|
|
60850
|
+
if (isAntigravityCheckpointReply(DRIVER_KIND8, current4.state.text)) {
|
|
60851
|
+
ok = false;
|
|
60852
|
+
stopReason = "invalid_checkpoint";
|
|
60853
|
+
emit({ ...base6(threadId, current4.turnId), type: "runtime.error", message: current4.state.text.trim() });
|
|
60854
|
+
closeSession(threadId, "invalid-checkpoint");
|
|
60855
|
+
}
|
|
60837
60856
|
current4.flushAssistantText();
|
|
60838
60857
|
let finalOk = ok;
|
|
60839
60858
|
let finalStopReason = stopReason;
|
|
@@ -61640,7 +61659,8 @@ ${instructed.text}` : instructed.text;
|
|
|
61640
61659
|
type: "runtime.error",
|
|
61641
61660
|
message: errorMessage2
|
|
61642
61661
|
});
|
|
61643
|
-
|
|
61662
|
+
if (isBrokenAntigravityCheckpoint(DRIVER_KIND8, errorMessage2)) closeSession(threadId, "invalid-checkpoint");
|
|
61663
|
+
settle(threadId, session, false, isBrokenAntigravityCheckpoint(DRIVER_KIND8, errorMessage2) ? "invalid_checkpoint" : reason ?? "failed");
|
|
61644
61664
|
}
|
|
61645
61665
|
} catch (e) {
|
|
61646
61666
|
if (!state2.settled) {
|
|
@@ -61657,10 +61677,10 @@ ${instructed.text}` : instructed.text;
|
|
|
61657
61677
|
...needsAuth ? { setup: true } : {},
|
|
61658
61678
|
...failure7 ? { failure: failure7 } : {}
|
|
61659
61679
|
});
|
|
61660
|
-
if ((logAuth || !needsAuth && (stalled || e?.acpSessionFailure === true || code === "upstream_outage")) && session.child.exitCode === null && !session.closing) {
|
|
61680
|
+
if ((logAuth || !needsAuth && (stalled || isBrokenAntigravityCheckpoint(DRIVER_KIND8, message4) || e?.acpSessionFailure === true || code === "upstream_outage")) && session.child.exitCode === null && !session.closing) {
|
|
61661
61681
|
closeSession(threadId, logAuth ? "provider-auth" : stalled ? "prompt-stall" : "rpc-failure");
|
|
61662
61682
|
}
|
|
61663
|
-
settle(threadId, session, false, needsAuth ? "auth_required" : "rpc_error");
|
|
61683
|
+
settle(threadId, session, false, needsAuth ? "auth_required" : isBrokenAntigravityCheckpoint(DRIVER_KIND8, message4) ? "invalid_checkpoint" : "rpc_error");
|
|
61664
61684
|
}
|
|
61665
61685
|
}
|
|
61666
61686
|
})();
|
|
@@ -118951,7 +118971,7 @@ var NO_ANSWER_FAILURE = "The engine ended the turn without an answer.";
|
|
|
118951
118971
|
function unrecognisedFailure(turn) {
|
|
118952
118972
|
return { kind: "provider_error", message: turn.lastError ?? NO_ANSWER_FAILURE };
|
|
118953
118973
|
}
|
|
118954
|
-
var NOT_A_PROVIDER_FAILURE = /* @__PURE__ */ new Set(["interrupted", "cancelled"]);
|
|
118974
|
+
var NOT_A_PROVIDER_FAILURE = /* @__PURE__ */ new Set(["interrupted", "cancelled", "invalid_checkpoint"]);
|
|
118955
118975
|
var FailoverGate = class {
|
|
118956
118976
|
turns = /* @__PURE__ */ new Map();
|
|
118957
118977
|
onFailure;
|
|
@@ -127614,12 +127634,12 @@ bus.subscribe((event) => {
|
|
|
127614
127634
|
});
|
|
127615
127635
|
break;
|
|
127616
127636
|
case "runtime.error":
|
|
127637
|
+
if (bot) invalidateBrokenCheckpoint(store, bot.id, event.providerInstanceId ? registry2.get(event.providerInstanceId)?.driverKind : void 0, event);
|
|
127617
127638
|
if (event.message?.trim()) lastTurnError.set(event.threadId, event.message.trim().slice(0, 300));
|
|
127618
127639
|
pushMessage({
|
|
127619
127640
|
role: "bot",
|
|
127620
127641
|
kind: "activity",
|
|
127621
|
-
//
|
|
127622
|
-
// same way; an error line is never a lost connection either way.
|
|
127642
|
+
// Keep the category consistent across surfaces.
|
|
127623
127643
|
// The harness's own stop line is kept whole: it ends with where to fix
|
|
127624
127644
|
// the account, which a 160-character cut would drop.
|
|
127625
127645
|
tool: {
|
|
@@ -25444,6 +25444,19 @@ var init_mcp_tool_ref = __esm({
|
|
|
25444
25444
|
}
|
|
25445
25445
|
});
|
|
25446
25446
|
|
|
25447
|
+
// server/checkpoint-recovery.ts
|
|
25448
|
+
function isBrokenAntigravityCheckpoint(driverKind, message2) {
|
|
25449
|
+
return driverKind === "antigravityAgent" && message2.includes("could not find doneCh for checkpoint");
|
|
25450
|
+
}
|
|
25451
|
+
function isAntigravityCheckpointReply(driverKind, text4) {
|
|
25452
|
+
return driverKind === "antigravityAgent" && /^Agent execution error: could not find doneCh for checkpoint\s*$/.test(text4.trim());
|
|
25453
|
+
}
|
|
25454
|
+
var init_checkpoint_recovery = __esm({
|
|
25455
|
+
"server/checkpoint-recovery.ts"() {
|
|
25456
|
+
"use strict";
|
|
25457
|
+
}
|
|
25458
|
+
});
|
|
25459
|
+
|
|
25447
25460
|
// server/resume-recovery.ts
|
|
25448
25461
|
function classifyResumeFailure(state2) {
|
|
25449
25462
|
if (state2.producedOutput || state2.promptSubmitted) return "after-accept";
|
|
@@ -26428,6 +26441,12 @@ function createAcpDriver(support12) {
|
|
|
26428
26441
|
session.acp.failAll(new Error("turn settled"));
|
|
26429
26442
|
session.current = null;
|
|
26430
26443
|
active.delete(threadId);
|
|
26444
|
+
if (isAntigravityCheckpointReply(DRIVER_KIND8, current.state.text)) {
|
|
26445
|
+
ok = false;
|
|
26446
|
+
stopReason = "invalid_checkpoint";
|
|
26447
|
+
emit({ ...base3(threadId, current.turnId), type: "runtime.error", message: current.state.text.trim() });
|
|
26448
|
+
closeSession(threadId, "invalid-checkpoint");
|
|
26449
|
+
}
|
|
26431
26450
|
current.flushAssistantText();
|
|
26432
26451
|
let finalOk = ok;
|
|
26433
26452
|
let finalStopReason = stopReason;
|
|
@@ -27234,7 +27253,8 @@ ${instructed.text}` : instructed.text;
|
|
|
27234
27253
|
type: "runtime.error",
|
|
27235
27254
|
message: errorMessage
|
|
27236
27255
|
});
|
|
27237
|
-
|
|
27256
|
+
if (isBrokenAntigravityCheckpoint(DRIVER_KIND8, errorMessage)) closeSession(threadId, "invalid-checkpoint");
|
|
27257
|
+
settle(threadId, session, false, isBrokenAntigravityCheckpoint(DRIVER_KIND8, errorMessage) ? "invalid_checkpoint" : reason ?? "failed");
|
|
27238
27258
|
}
|
|
27239
27259
|
} catch (e) {
|
|
27240
27260
|
if (!state2.settled) {
|
|
@@ -27251,10 +27271,10 @@ ${instructed.text}` : instructed.text;
|
|
|
27251
27271
|
...needsAuth ? { setup: true } : {},
|
|
27252
27272
|
...failure ? { failure } : {}
|
|
27253
27273
|
});
|
|
27254
|
-
if ((logAuth || !needsAuth && (stalled || e?.acpSessionFailure === true || code === "upstream_outage")) && session.child.exitCode === null && !session.closing) {
|
|
27274
|
+
if ((logAuth || !needsAuth && (stalled || isBrokenAntigravityCheckpoint(DRIVER_KIND8, message2) || e?.acpSessionFailure === true || code === "upstream_outage")) && session.child.exitCode === null && !session.closing) {
|
|
27255
27275
|
closeSession(threadId, logAuth ? "provider-auth" : stalled ? "prompt-stall" : "rpc-failure");
|
|
27256
27276
|
}
|
|
27257
|
-
settle(threadId, session, false, needsAuth ? "auth_required" : "rpc_error");
|
|
27277
|
+
settle(threadId, session, false, needsAuth ? "auth_required" : isBrokenAntigravityCheckpoint(DRIVER_KIND8, message2) ? "invalid_checkpoint" : "rpc_error");
|
|
27258
27278
|
}
|
|
27259
27279
|
}
|
|
27260
27280
|
})();
|
|
@@ -27343,6 +27363,7 @@ var init_core3 = __esm({
|
|
|
27343
27363
|
init_mcp_tool_images();
|
|
27344
27364
|
init_mcp_tool_ref();
|
|
27345
27365
|
init_redact2();
|
|
27366
|
+
init_checkpoint_recovery();
|
|
27346
27367
|
init_resume_recovery();
|
|
27347
27368
|
init_retry();
|
|
27348
27369
|
init_engine_failure();
|
package/dist-server/pair-cli.js
CHANGED
|
@@ -25444,6 +25444,19 @@ var init_mcp_tool_ref = __esm({
|
|
|
25444
25444
|
}
|
|
25445
25445
|
});
|
|
25446
25446
|
|
|
25447
|
+
// server/checkpoint-recovery.ts
|
|
25448
|
+
function isBrokenAntigravityCheckpoint(driverKind, message2) {
|
|
25449
|
+
return driverKind === "antigravityAgent" && message2.includes("could not find doneCh for checkpoint");
|
|
25450
|
+
}
|
|
25451
|
+
function isAntigravityCheckpointReply(driverKind, text4) {
|
|
25452
|
+
return driverKind === "antigravityAgent" && /^Agent execution error: could not find doneCh for checkpoint\s*$/.test(text4.trim());
|
|
25453
|
+
}
|
|
25454
|
+
var init_checkpoint_recovery = __esm({
|
|
25455
|
+
"server/checkpoint-recovery.ts"() {
|
|
25456
|
+
"use strict";
|
|
25457
|
+
}
|
|
25458
|
+
});
|
|
25459
|
+
|
|
25447
25460
|
// server/resume-recovery.ts
|
|
25448
25461
|
function classifyResumeFailure(state2) {
|
|
25449
25462
|
if (state2.producedOutput || state2.promptSubmitted) return "after-accept";
|
|
@@ -26428,6 +26441,12 @@ function createAcpDriver(support12) {
|
|
|
26428
26441
|
session.acp.failAll(new Error("turn settled"));
|
|
26429
26442
|
session.current = null;
|
|
26430
26443
|
active.delete(threadId);
|
|
26444
|
+
if (isAntigravityCheckpointReply(DRIVER_KIND8, current.state.text)) {
|
|
26445
|
+
ok = false;
|
|
26446
|
+
stopReason = "invalid_checkpoint";
|
|
26447
|
+
emit({ ...base3(threadId, current.turnId), type: "runtime.error", message: current.state.text.trim() });
|
|
26448
|
+
closeSession(threadId, "invalid-checkpoint");
|
|
26449
|
+
}
|
|
26431
26450
|
current.flushAssistantText();
|
|
26432
26451
|
let finalOk = ok;
|
|
26433
26452
|
let finalStopReason = stopReason;
|
|
@@ -27234,7 +27253,8 @@ ${instructed.text}` : instructed.text;
|
|
|
27234
27253
|
type: "runtime.error",
|
|
27235
27254
|
message: errorMessage
|
|
27236
27255
|
});
|
|
27237
|
-
|
|
27256
|
+
if (isBrokenAntigravityCheckpoint(DRIVER_KIND8, errorMessage)) closeSession(threadId, "invalid-checkpoint");
|
|
27257
|
+
settle(threadId, session, false, isBrokenAntigravityCheckpoint(DRIVER_KIND8, errorMessage) ? "invalid_checkpoint" : reason ?? "failed");
|
|
27238
27258
|
}
|
|
27239
27259
|
} catch (e) {
|
|
27240
27260
|
if (!state2.settled) {
|
|
@@ -27251,10 +27271,10 @@ ${instructed.text}` : instructed.text;
|
|
|
27251
27271
|
...needsAuth ? { setup: true } : {},
|
|
27252
27272
|
...failure ? { failure } : {}
|
|
27253
27273
|
});
|
|
27254
|
-
if ((logAuth || !needsAuth && (stalled || e?.acpSessionFailure === true || code === "upstream_outage")) && session.child.exitCode === null && !session.closing) {
|
|
27274
|
+
if ((logAuth || !needsAuth && (stalled || isBrokenAntigravityCheckpoint(DRIVER_KIND8, message2) || e?.acpSessionFailure === true || code === "upstream_outage")) && session.child.exitCode === null && !session.closing) {
|
|
27255
27275
|
closeSession(threadId, logAuth ? "provider-auth" : stalled ? "prompt-stall" : "rpc-failure");
|
|
27256
27276
|
}
|
|
27257
|
-
settle(threadId, session, false, needsAuth ? "auth_required" : "rpc_error");
|
|
27277
|
+
settle(threadId, session, false, needsAuth ? "auth_required" : isBrokenAntigravityCheckpoint(DRIVER_KIND8, message2) ? "invalid_checkpoint" : "rpc_error");
|
|
27258
27278
|
}
|
|
27259
27279
|
}
|
|
27260
27280
|
})();
|
|
@@ -27343,6 +27363,7 @@ var init_core3 = __esm({
|
|
|
27343
27363
|
init_mcp_tool_images();
|
|
27344
27364
|
init_mcp_tool_ref();
|
|
27345
27365
|
init_redact2();
|
|
27366
|
+
init_checkpoint_recovery();
|
|
27346
27367
|
init_resume_recovery();
|
|
27347
27368
|
init_retry();
|
|
27348
27369
|
init_engine_failure();
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** This identifies an unusable saved session, never permission to replay a
|
|
2
|
+
* submitted prompt. Only a subsequent explicit turn may rebuild the context. */
|
|
3
|
+
export function isBrokenAntigravityCheckpoint(driverKind, message) {
|
|
4
|
+
return driverKind === "antigravityAgent" && message.includes("could not find doneCh for checkpoint");
|
|
5
|
+
}
|
|
6
|
+
export function invalidateBrokenCheckpoint(store, botId, driverKind, event) {
|
|
7
|
+
if (event.providerInstanceId && isBrokenAntigravityCheckpoint(driverKind, event.message)) {
|
|
8
|
+
// Undefined is absent on disk and engineIsFresh rebuilds from Atomic's
|
|
9
|
+
// transcript on the next send, including after an application restart.
|
|
10
|
+
store.setResumeCursor(botId, event.providerInstanceId, undefined, event.threadId);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/** Antigravity also sends its execution failure as a chunked assistant reply
|
|
14
|
+
* followed by end_turn. A quoted error inside a normal answer is not failure. */
|
|
15
|
+
export function isAntigravityCheckpointReply(driverKind, text) {
|
|
16
|
+
return driverKind === "antigravityAgent"
|
|
17
|
+
&& /^Agent execution error: could not find doneCh for checkpoint\s*$/.test(text.trim());
|
|
18
|
+
}
|