@smartmemory/compose 0.2.43-beta → 0.2.45-beta
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/App-DQblyoua.js +696 -0
- package/dist/assets/{arc-fd_r6IIl.js → arc-B4fPSjcd.js} +1 -1
- package/dist/assets/{architectureDiagram-3BPJPVTR-UehcfvE8.js → architectureDiagram-3BPJPVTR-SiqLJ2Dv.js} +1 -1
- package/dist/assets/{blockDiagram-GPEHLZMM-Dm-THFZ6.js → blockDiagram-GPEHLZMM-DgA84B2f.js} +1 -1
- package/dist/assets/{c4Diagram-AAUBKEIU-CIZ7QDGR.js → c4Diagram-AAUBKEIU-B-tXpPJU.js} +1 -1
- package/dist/assets/channel-D60Ea_Qi.js +1 -0
- package/dist/assets/{chunk-2J33WTMH-COBZ5eyU.js → chunk-2J33WTMH-Ch2s7Kg8.js} +1 -1
- package/dist/assets/{chunk-4BX2VUAB-w3bqdoNF.js → chunk-4BX2VUAB-B0CaezI4.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-D18v8dR4.js → chunk-55IACEB6-B7bap9LR.js} +1 -1
- package/dist/assets/{chunk-727SXJPM-2MAwFz_9.js → chunk-727SXJPM-CMksbsjL.js} +1 -1
- package/dist/assets/{chunk-AQP2D5EJ-Dp_jdVPB.js → chunk-AQP2D5EJ-ChOCnmMe.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-mPSIpSeS.js → chunk-FMBD7UC4-qcUlmmEN.js} +1 -1
- package/dist/assets/{chunk-ND2GUHAM-gkRIeuOg.js → chunk-ND2GUHAM-BWwR4JBR.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-DJ7h7c2i.js → chunk-QZHKN3VN-DuRbBL0q.js} +1 -1
- package/dist/assets/classDiagram-4FO5ZUOK-Vt88epYI.js +1 -0
- package/dist/assets/classDiagram-v2-Q7XG4LA2-Vt88epYI.js +1 -0
- package/dist/assets/{cose-bilkent-S5V4N54A-BC5rkVLI.js → cose-bilkent-S5V4N54A-Dd3Ids4E.js} +1 -1
- package/dist/assets/{dagre-BM42HDAG-DBwRZbPz.js → dagre-BM42HDAG-C2fmFG1L.js} +1 -1
- package/dist/assets/{diagram-2AECGRRQ-CmljsTYt.js → diagram-2AECGRRQ-gZjYzjSJ.js} +1 -1
- package/dist/assets/{diagram-5GNKFQAL-Pcdh-Hev.js → diagram-5GNKFQAL-uxJ9zL35.js} +1 -1
- package/dist/assets/{diagram-KO2AKTUF-CrEqfa_s.js → diagram-KO2AKTUF--9DBGjk3.js} +1 -1
- package/dist/assets/{diagram-LMA3HP47-pmYhkUAj.js → diagram-LMA3HP47-DkhUcRJZ.js} +1 -1
- package/dist/assets/{diagram-OG6HWLK6-1mWNdTnP.js → diagram-OG6HWLK6-BaJ__gNW.js} +1 -1
- package/dist/assets/{erDiagram-TEJ5UH35-BuNJLn2I.js → erDiagram-TEJ5UH35-DWszA5vM.js} +1 -1
- package/dist/assets/{flowDiagram-I6XJVG4X-D84i8zUb.js → flowDiagram-I6XJVG4X-DKGbnIHA.js} +1 -1
- package/dist/assets/{ganttDiagram-6RSMTGT7-DW_1tH7v.js → ganttDiagram-6RSMTGT7-D5CoNr7u.js} +1 -1
- package/dist/assets/{gitGraphDiagram-PVQCEYII-Mo99IrfD.js → gitGraphDiagram-PVQCEYII-wraCb0iO.js} +1 -1
- package/dist/assets/{graph-BqpC5g-G.js → graph-BlEwG9Ro.js} +1 -1
- package/dist/assets/{index-DfocQEE0.js → index-CE1ehTQn.js} +3 -3
- package/dist/assets/index-D9M5IzwO.css +1 -0
- package/dist/assets/{infoDiagram-5YYISTIA-BJvJda4j.js → infoDiagram-5YYISTIA-CLT2YJ_w.js} +1 -1
- package/dist/assets/{ishikawaDiagram-YF4QCWOH-Dl7ib9vb.js → ishikawaDiagram-YF4QCWOH-1WQ5ViOx.js} +1 -1
- package/dist/assets/{journeyDiagram-JHISSGLW-DmgxLRyA.js → journeyDiagram-JHISSGLW-CbYKANnV.js} +1 -1
- package/dist/assets/{kanban-definition-UN3LZRKU-DV6cN2Fc.js → kanban-definition-UN3LZRKU-CYNaaEmw.js} +1 -1
- package/dist/assets/{linear-ChPnBFTg.js → linear-C6l6Hee2.js} +1 -1
- package/dist/assets/{mindmap-definition-RKZ34NQL-C0dgdrrD.js → mindmap-definition-RKZ34NQL-DzXKDTRa.js} +1 -1
- package/dist/assets/mobile-4lQex-UI.js +17 -0
- package/dist/assets/mobile-D8UQvJ1i.css +1 -0
- package/dist/assets/{pieDiagram-4H26LBE5-N-HzAPPi.js → pieDiagram-4H26LBE5-CppszhAX.js} +1 -1
- package/dist/assets/{quadrantDiagram-W4KKPZXB-YEX6PyFG.js → quadrantDiagram-W4KKPZXB-jpp555QD.js} +1 -1
- package/dist/assets/{requirementDiagram-4Y6WPE33-CCpgQqwO.js → requirementDiagram-4Y6WPE33-nKJCyHfW.js} +1 -1
- package/dist/assets/{sankeyDiagram-5OEKKPKP-BSUvtggj.js → sankeyDiagram-5OEKKPKP-D-oX8o5g.js} +1 -1
- package/dist/assets/{sequenceDiagram-3UESZ5HK-Dh8UHRBI.js → sequenceDiagram-3UESZ5HK-CcOMecR8.js} +1 -1
- package/dist/assets/{stateDiagram-AJRCARHV-DKvZ4fLX.js → stateDiagram-AJRCARHV-D0yHv9PM.js} +1 -1
- package/dist/assets/stateDiagram-v2-BHNVJYJU-CFwFamMD.js +1 -0
- package/dist/assets/{timeline-definition-PNZ67QCA-qunNDnlH.js → timeline-definition-PNZ67QCA-hsR-T0Te.js} +1 -1
- package/dist/assets/{vennDiagram-CIIHVFJN-D5a-gmIU.js → vennDiagram-CIIHVFJN-C9b10oqu.js} +1 -1
- package/dist/assets/{wardley-L42UT6IY-akIUfw-F.js → wardley-L42UT6IY-BHnzDf0e.js} +1 -1
- package/dist/assets/{wardleyDiagram-YWT4CUSO-R1zmVC27.js → wardleyDiagram-YWT4CUSO-DReamCcN.js} +1 -1
- package/dist/assets/{xychartDiagram-2RQKCTM6-Do2YVGeZ.js → xychartDiagram-2RQKCTM6-CrSsH0ZL.js} +1 -1
- package/dist/index.html +4 -4
- package/package.json +1 -1
- package/server/graph-export.js +8 -3
- package/server/journal-routes.js +130 -0
- package/server/vision-routes.js +2 -66
- package/server/vision-server.js +9 -2
- package/dist/assets/App-BD4lfyhF.js +0 -686
- package/dist/assets/channel-C0cFeemU.js +0 -1
- package/dist/assets/classDiagram-4FO5ZUOK-7kNnlTD1.js +0 -1
- package/dist/assets/classDiagram-v2-Q7XG4LA2-7kNnlTD1.js +0 -1
- package/dist/assets/index-vDKys15R.css +0 -1
- package/dist/assets/mobile-5PV1E6OC.css +0 -1
- package/dist/assets/mobile-DAxPPzok.js +0 -17
- package/dist/assets/stateDiagram-v2-BHNVJYJU-DF_adEfb.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as a,l as s,I as n,e as i}from"./App-
|
|
1
|
+
import{_ as a,l as s,I as n,e as i}from"./App-DQblyoua.js";import{p}from"./wardley-L42UT6IY-BHnzDf0e.js";import"./mobile-4lQex-UI.js";import"./index-CE1ehTQn.js";import"./graph-BlEwG9Ro.js";var g={parse:a(async r=>{const e=await p("info",r);s.debug(e)},"parse")},v={version:"11.15.0"},d=a(()=>v.version,"getVersion"),m={getVersion:d},c=a((r,e,o)=>{s.debug(`rendering info diagram
|
|
2
2
|
`+r);const t=n(e);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${o}`)},"draw"),l={draw:c},y={parser:g,db:m,renderer:l};export{y as diagram};
|
package/dist/assets/{ishikawaDiagram-YF4QCWOH-Dl7ib9vb.js → ishikawaDiagram-YF4QCWOH-1WQ5ViOx.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as o,c as ot,N as ut,I as dt,ap as yt,z as pt,k as ft,p as it,a as gt,b as kt,g as mt,s as wt,q as _t,e as bt}from"./App-
|
|
1
|
+
import{_ as o,c as ot,N as ut,I as dt,ap as yt,z as pt,k as ft,p as it,a as gt,b as kt,g as mt,s as wt,q as _t,e as bt}from"./App-DQblyoua.js";import"./mobile-4lQex-UI.js";import"./index-CE1ehTQn.js";import"./graph-BlEwG9Ro.js";var tt=(function(){var e=o(function(M,t,s,i){for(s=s||{},i=M.length;i--;s[M[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],p=[1,20],d=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],B={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,u,f,n,v){var w=n.length-1;switch(f){case 6:case 7:return u;case 15:u.addNode(n[w-1].length,n[w].trim());break;case 16:u.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:p,7:d,10:17,11:m},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:p,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(c,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],u=[],f=[null],n=[],v=this.table,w="",I=0,S=0,L=2,E=1,R=n.slice.call(arguments,1),b=Object.create(this.lexer),C={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(C.yy[z]=this.yy[z]);b.setInput(t,C.yy),C.yy.lexer=b,C.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var T=b.yylloc;n.push(T);var D=b.options&&b.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function F(N){i.length=i.length-2*N,f.length=f.length-N,n.length=n.length-N}o(F,"popStack");function j(){var N;return N=u.pop()||b.lex()||E,typeof N!="number"&&(N instanceof Array&&(u=N,N=u.pop()),N=s.symbols_[N]||N),N}o(j,"lex");for(var A,W,P,K,H={},X,V,et,Y;;){if(W=i[i.length-1],this.defaultActions[W]?P=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=j()),P=v[W]&&v[W][A]),typeof P>"u"||!P.length||!P[0]){var Q="";Y=[];for(X in v[W])this.terminals_[X]&&X>L&&Y.push("'"+this.terminals_[X]+"'");b.showPosition?Q="Parse error on line "+(I+1)+`:
|
|
2
2
|
`+b.showPosition()+`
|
|
3
3
|
Expecting `+Y.join(", ")+", got '"+(this.terminals_[A]||A)+"'":Q="Parse error on line "+(I+1)+": Unexpected "+(A==E?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(Q,{text:b.match,token:this.terminals_[A]||A,line:b.yylineno,loc:T,expected:Y})}if(P[0]instanceof Array&&P.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+A);switch(P[0]){case 1:i.push(A),f.push(b.yytext),n.push(b.yylloc),i.push(P[1]),A=null,S=b.yyleng,w=b.yytext,I=b.yylineno,T=b.yylloc;break;case 2:if(V=this.productions_[P[1]][1],H.$=f[f.length-V],H._$={first_line:n[n.length-(V||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(V||1)].first_column,last_column:n[n.length-1].last_column},D&&(H._$.range=[n[n.length-(V||1)].range[0],n[n.length-1].range[1]]),K=this.performAction.apply(H,[w,S,I,C.yy,P[1],f,n].concat(R)),typeof K<"u")return K;V&&(i=i.slice(0,-1*V*2),f=f.slice(0,-1*V),n=n.slice(0,-1*V)),i.push(this.productions_[P[1]][0]),f.push(H.$),n.push(H._$),et=v[i[i.length-2]][i[i.length-1]],i.push(et);break;case 3:return!0}}return!0},"parse")},O=(function(){var M={EOF:1,parseError:o(function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},"parseError"),setInput:o(function(t,s){return this.yy=s||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var s=t.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var s=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var u=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),i.length-1&&(this.yylineno-=i.length-1);var f=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:i?(i.length===u.length?this.yylloc.first_column:0)+u[u.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-s]),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(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),s=new Array(t.length+1).join("-");return t+this.upcomingInput()+`
|
package/dist/assets/{journeyDiagram-JHISSGLW-DmgxLRyA.js → journeyDiagram-JHISSGLW-CbYKANnV.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as gt}from"./chunk-FMBD7UC4-
|
|
1
|
+
import{g as gt}from"./chunk-FMBD7UC4-qcUlmmEN.js";import{a as mt,g as lt,h as xt,d as kt}from"./chunk-ND2GUHAM-BWwR4JBR.js";import{g as _t,s as vt,a as bt,b as wt,q as Tt,p as St,_ as s,c as R,d as X,e as $t,z as Mt}from"./App-DQblyoua.js";import{d as it}from"./arc-B4fPSjcd.js";import"./mobile-4lQex-UI.js";import"./index-CE1ehTQn.js";import"./graph-BlEwG9Ro.js";var U=(function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var H="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`:
|
|
2
2
|
`+_.showPosition()+`
|
|
3
3
|
Expecting `+z.join(", ")+", got '"+(this.terminals_[b]||b)+"'":H="Parse error on line "+(C+1)+": Unexpected "+(b==D?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(H,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Y,expected:z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+b);switch(T[0]){case 1:l.push(b),d.push(_.yytext),c.push(_.yylloc),l.push(T[1]),b=null,Q=_.yyleng,k=_.yytext,C=_.yylineno,Y=_.yylloc;break;case 2:if(M=this.productions_[T[1]][1],F.$=d[d.length-M],F._$={first_line:c[c.length-(M||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(M||1)].first_column,last_column:c[c.length-1].last_column},ft&&(F._$.range=[c[c.length-(M||1)].range[0],c[c.length-1].range[1]]),q=this.performAction.apply(F,[k,Q,C,I.yy,T[1],d,c].concat(dt)),typeof q<"u")return q;M&&(l=l.slice(0,-1*M*2),d=d.slice(0,-1*M),c=c.slice(0,-1*M)),l.push(this.productions_[T[1]][0]),d.push(F.$),c.push(F._$),et=v[l[l.length-2]][l[l.length-1]],l.push(et);break;case 3:return!0}}return!0},"parse")},m=(function(){var h={EOF:1,parseError:s(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:s(function(r,n){return this.yy=n||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var n=r.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:s(function(r){var n=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var y=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 d=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===y.length?this.yylloc.first_column:0)+y[y.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(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:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var r=this.pastInput(),n=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as c,l as te,c as W,I as fe,af as ye,ag as be,ah as me,Y as _e,G as K,i as F,t as ke,J as Ee,V as Se,W as le,X as ce}from"./App-
|
|
1
|
+
import{_ as c,l as te,c as W,I as fe,af as ye,ag as be,ah as me,Y as _e,G as K,i as F,t as ke,J as Ee,V as Se,W as le,X as ce}from"./App-DQblyoua.js";import{g as Ne}from"./chunk-FMBD7UC4-qcUlmmEN.js";import"./mobile-4lQex-UI.js";import"./index-CE1ehTQn.js";import"./graph-BlEwG9Ro.js";var $=(function(){var t=c(function(_,s,n,a){for(n=n||{},a=_.length;a--;n[_[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],k=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],M=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],U=[1,35],j=[1,36],A=[1,6,7,11,13,16,17,20,23],H=[1,38],V={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,n,a,o,u,e,B){var l=e.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:M}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(P,[2,14],{7:U,11:j}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:M}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:H}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:U,11:j}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:H}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],B=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(T.yy[J]=this.yy[J]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var q=m.yylloc;e.push(q);var de=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var E,R,v,Q,G={},X,I,oe,Y;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((E===null||typeof E>"u")&&(E=ae()),v=B[R]&&B[R][E]),typeof v>"u"||!v.length||!v[0]){var Z="";Y=[];for(X in B[R])this.terminals_[X]&&X>ue&&Y.push("'"+this.terminals_[X]+"'");m.showPosition?Z="Parse error on line "+(z+1)+`:
|
|
2
2
|
`+m.showPosition()+`
|
|
3
3
|
Expecting `+Y.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Z="Parse error on line "+(z+1)+": Unexpected "+(E==re?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Z,{text:m.match,token:this.terminals_[E]||E,line:m.yylineno,loc:q,expected:Y})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+E);switch(v[0]){case 1:a.push(E),u.push(m.yytext),e.push(m.yylloc),a.push(v[1]),E=null,ie=m.yyleng,l=m.yytext,z=m.yylineno,q=m.yylloc;break;case 2:if(I=this.productions_[v[1]][1],G.$=u[u.length-I],G._$={first_line:e[e.length-(I||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(I||1)].first_column,last_column:e[e.length-1].last_column},de&&(G._$.range=[e[e.length-(I||1)].range[0],e[e.length-1].range[1]]),Q=this.performAction.apply(G,[l,ie,z,T.yy,v[1],u,e].concat(ge)),typeof Q<"u")return Q;I&&(a=a.slice(0,-1*I*2),u=u.slice(0,-1*I),e=e.slice(0,-1*I)),a.push(this.productions_[v[1]][0]),u.push(G.$),e.push(G._$),oe=B[a[a.length-2]][a[a.length-1]],a.push(oe);break;case 3:return!0}}return!0},"parse")},y=(function(){var _={EOF:1,parseError:c(function(n,a){if(this.yy.parser)this.yy.parser.parseError(n,a);else throw new Error(n)},"parseError"),setInput:c(function(s,n){return this.yy=n||this.yy||{},this._input=s,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:c(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var n=s.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:c(function(s){var n=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var o=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),a.length-1&&(this.yylineno-=a.length-1);var u=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:a?(a.length===o.length?this.yylloc.first_column:0)+o[o.length-a.length].length-a[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:c(function(){return this._more=!0,this},"more"),reject:c(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:c(function(s){this.unput(this.match.slice(s))},"less"),pastInput:c(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:c(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:c(function(){var s=this.pastInput(),n=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b7 as j,b8 as p,b9 as w,ba as k,bb as q}from"./App-
|
|
1
|
+
import{b7 as j,b8 as p,b9 as w,ba as k,bb as q}from"./App-DQblyoua.js";import{i as D}from"./init-Gi6I4Gst.js";import{e as g,f as F,a as z,b as B}from"./defaultLocale-DX6XiGOO.js";function M(n,r){return n==null||r==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function I(n,r){return n==null||r==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=M,t=(o,c)=>M(n(o),c),e=(o,c)=>n(o)-c):(r=n===M||n===I?n:P,t=n,e=n);function u(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<0?i=l+1:h=l}while(i<h)}return i}function f(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<=0?i=l+1:h=l}while(i<h)}return i}function a(o,c,i=0,h=o.length){const l=u(o,c,i,h-1);return l>i&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function P(){return 0}function V(n){return n===null?NaN:+n}const $=R(M),x=$.right;R(V).center;const O=Math.sqrt(50),T=Math.sqrt(10),C=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=O?10:f>=T?5:f>=C?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/i<n&&++o,c/i>r&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*i<n&&++o,c*i>r&&--c),c<o&&.5<=t&&t<2?v(n,r,t*2):[o,c,i]}function E(n,r,t){if(r=+r,n=+n,t=+t,!(t>0))return[];if(n===r)return[n];const e=r<n,[u,f,a]=e?v(r,n,t):v(n,r,t);if(!(f>=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;i<o;++i)c[i]=(f-i)/-a;else for(let i=0;i<o;++i)c[i]=(f-i)*a;else if(a<0)for(let i=0;i<o;++i)c[i]=(u+i)/-a;else for(let i=0;i<o;++i)c[i]=(u+i)*a;return c}function y(n,r,t){return r=+r,n=+n,t=+t,v(n,r,t)[2]}function G(n,r,t){r=+r,n=+n,t=+t;const e=r<n,u=e?y(r,n,t):y(n,r,t);return(e?-1:1)*(u<0?1/-u:u)}function H(n,r){r||(r=[]);var t=n?Math.min(r.length,n.length):0,e=r.slice(),u;return function(f){for(u=0;u<t;++u)e[u]=n[u]*(1-f)+r[u]*f;return e}}function J(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function K(n,r){var t=r?r.length:0,e=n?Math.min(t,n.length):0,u=new Array(e),f=new Array(t),a;for(a=0;a<e;++a)u[a]=d(n[a],r[a]);for(;a<t;++a)f[a]=r[a];return function(o){for(a=0;a<e;++a)f[a]=u[a](o);return f}}function L(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function Q(n,r){var t={},e={},u;(n===null||typeof n!="object")&&(n={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in n?t[u]=d(n[u],r[u]):e[u]=r[u];return function(f){for(u in t)e[u]=t[u](f);return e}}function d(n,r){var t=typeof r,e;return r==null||t==="boolean"?j(r):(t==="number"?p:t==="string"?(e=w(r))?(r=e,k):q:r instanceof w?k:r instanceof Date?L:J(r)?H:Array.isArray(r)?K:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Q:p)(n,r)}function U(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function W(n){return Math.max(0,-g(Math.abs(n)))}function X(n,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(g(r)/3)))*3-g(Math.abs(n)))}function Y(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,g(r)-g(n))+1}function Z(n){return function(){return n}}function _(n){return+n}var A=[0,1];function m(n){return n}function N(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:Z(isNaN(r)?NaN:.5)}function b(n,r){var t;return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u<e?(e=N(u,e),f=t(a,f)):(e=N(e,u),f=t(f,a)),function(o){return f(e(o))}}function rn(n,r,t){var e=Math.min(n.length,r.length)-1,u=new Array(e),f=new Array(e),a=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++a<e;)u[a]=N(n[a],n[a+1]),f[a]=t(r[a],r[a+1]);return function(o){var c=x(n,o,1,e)-1;return f[c](u[c](o))}}function en(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function tn(){var n=A,r=A,t=d,e,u,f,a=m,o,c,i;function h(){var s=Math.min(n.length,r.length);return a!==m&&(a=b(n[0],n[s-1])),o=s>2?rn:nn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),p)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,_),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=U,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,S){return e=s,u=S,h()}}function un(){return tn()(m,m)}function an(n,r,t,e){var u=G(n,r,t),f;switch(e=F(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=X(u,a))&&(e.precision=f),z(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Y(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=W(u))&&(e.precision=f-(e.type==="%")*2);break}}return B(e)}function on(n){var r=n.domain;return n.ticks=function(t){var e=r();return E(e[0],e[e.length-1],t??10)},n.tickFormat=function(t,e){var u=r();return an(u[0],u[u.length-1],t??10,e)},n.nice=function(t){t==null&&(t=10);var e=r(),u=0,f=e.length-1,a=e[u],o=e[f],c,i,h=10;for(o<a&&(i=a,a=o,o=i,i=u,u=f,f=i);h-- >0;){if(i=y(a,o,t),i===c)return e[u]=a,e[f]=o,r(e);if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else if(i<0)a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i;else break;c=i}return n},n}function fn(){var n=un();return n.copy=function(){return en(n,fn())},D.apply(n,arguments),on(n)}export{en as a,R as b,un as c,fn as l,G as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as le}from"./chunk-55IACEB6-
|
|
1
|
+
import{g as le}from"./chunk-55IACEB6-B7bap9LR.js";import{s as he}from"./chunk-2J33WTMH-Ch2s7Kg8.js";import{_ as h,l as R,o as de,r as ge,D as ue,G as W,c as M,i as H,b6 as pe,V as fe,W as me,X as ye}from"./App-DQblyoua.js";import"./mobile-4lQex-UI.js";import"./index-CE1ehTQn.js";import"./graph-BlEwG9Ro.js";const _=[];for(let t=0;t<256;++t)_.push((t+256).toString(16).slice(1));function Ee(t,e=0){return(_[t[e+0]]+_[t[e+1]]+_[t[e+2]]+_[t[e+3]]+"-"+_[t[e+4]]+_[t[e+5]]+"-"+_[t[e+6]]+_[t[e+7]]+"-"+_[t[e+8]]+_[t[e+9]]+"-"+_[t[e+10]]+_[t[e+11]]+_[t[e+12]]+_[t[e+13]]+_[t[e+14]]+_[t[e+15]]).toLowerCase()}let K;const _e=new Uint8Array(16);function be(){if(!K){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");K=crypto.getRandomValues.bind(crypto)}return K(_e)}const ke=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ie={randomUUID:ke};function Se(t,e,a){var n;if(ie.randomUUID&&!t)return ie.randomUUID();t=t||{};const l=t.random??((n=t.rng)==null?void 0:n.call(t))??be();if(l.length<16)throw new Error("Random bytes length must be >= 16");return l[6]=l[6]&15|64,l[8]=l[8]&63|128,Ee(l)}var Q=(function(){var t=h(function(O,s,i,o){for(i=i||{},o=O.length;o--;i[O[o]]=s);return i},"o"),e=[1,4],a=[1,13],l=[1,12],n=[1,15],d=[1,16],p=[1,20],y=[1,19],E=[6,7,8],k=[1,26],L=[1,24],N=[1,25],b=[6,7,11],$=[1,6,13,15,16,19,22],f=[1,33],U=[1,34],B=[1,6,7,11,13,15,16,19,22],X={trace:h(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:h(function(s,i,o,c,u,r,P){var g=r.length-1;switch(u){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",r[g].id),c.addNode(r[g-1].length,r[g].id,r[g].descr,r[g].type);break;case 16:c.getLogger().trace("Icon: ",r[g]),c.decorateNode({icon:r[g]});break;case 17:case 21:c.decorateNode({class:r[g]});break;case 18:c.getLogger().trace("SPACELIST");break;case 19:c.getLogger().trace("Node: ",r[g].id),c.addNode(0,r[g].id,r[g].descr,r[g].type);break;case 20:c.decorateNode({icon:r[g]});break;case 25:c.getLogger().trace("node found ..",r[g-2]),this.$={id:r[g-1],descr:r[g-1],type:c.getType(r[g-2],r[g])};break;case 26:this.$={id:r[g],descr:r[g],type:c.nodeType.DEFAULT};break;case 27:c.getLogger().trace("node found ..",r[g-3]),this.$={id:r[g-3],descr:r[g-1],type:c.getType(r[g-2],r[g])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:a,7:[1,10],9:9,12:11,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},t(E,[2,3]),{1:[2,2]},t(E,[2,4]),t(E,[2,5]),{1:[2,6],6:a,12:21,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},{6:a,9:22,12:11,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},{6:k,7:L,10:23,11:N},t(b,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:p,22:y}),t(b,[2,18]),t(b,[2,19]),t(b,[2,20]),t(b,[2,21]),t(b,[2,23]),t(b,[2,24]),t(b,[2,26],{19:[1,30]}),{20:[1,31]},{6:k,7:L,10:32,11:N},{1:[2,7],6:a,12:21,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},t($,[2,14],{7:f,11:U}),t(B,[2,8]),t(B,[2,9]),t(B,[2,10]),t(b,[2,15]),t(b,[2,16]),t(b,[2,17]),{20:[1,35]},{21:[1,36]},t($,[2,13],{7:f,11:U}),t(B,[2,11]),t(B,[2,12]),{21:[1,37]},t(b,[2,25]),t(b,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:h(function(s,i){if(i.recoverable)this.trace(s);else{var o=new Error(s);throw o.hash=i,o}},"parseError"),parse:h(function(s){var i=this,o=[0],c=[],u=[null],r=[],P=this.table,g="",F=0,Z=0,re=2,ee=1,oe=r.slice.call(arguments,1),m=Object.create(this.lexer),I={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(I.yy[z]=this.yy[z]);m.setInput(s,I.yy),I.yy.lexer=m,I.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var Y=m.yylloc;r.push(Y);var ae=m.options&&m.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ce(x){o.length=o.length-2*x,u.length=u.length-x,r.length=r.length-x}h(ce,"popStack");function te(){var x;return x=c.pop()||m.lex()||ee,typeof x!="number"&&(x instanceof Array&&(c=x,x=c.pop()),x=i.symbols_[x]||x),x}h(te,"lex");for(var S,C,D,q,w={},G,v,ne,j;;){if(C=o[o.length-1],this.defaultActions[C]?D=this.defaultActions[C]:((S===null||typeof S>"u")&&(S=te()),D=P[C]&&P[C][S]),typeof D>"u"||!D.length||!D[0]){var J="";j=[];for(G in P[C])this.terminals_[G]&&G>re&&j.push("'"+this.terminals_[G]+"'");m.showPosition?J="Parse error on line "+(F+1)+`:
|
|
2
2
|
`+m.showPosition()+`
|
|
3
3
|
Expecting `+j.join(", ")+", got '"+(this.terminals_[S]||S)+"'":J="Parse error on line "+(F+1)+": Unexpected "+(S==ee?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(J,{text:m.match,token:this.terminals_[S]||S,line:m.yylineno,loc:Y,expected:j})}if(D[0]instanceof Array&&D.length>1)throw new Error("Parse Error: multiple actions possible at state: "+C+", token: "+S);switch(D[0]){case 1:o.push(S),u.push(m.yytext),r.push(m.yylloc),o.push(D[1]),S=null,Z=m.yyleng,g=m.yytext,F=m.yylineno,Y=m.yylloc;break;case 2:if(v=this.productions_[D[1]][1],w.$=u[u.length-v],w._$={first_line:r[r.length-(v||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(v||1)].first_column,last_column:r[r.length-1].last_column},ae&&(w._$.range=[r[r.length-(v||1)].range[0],r[r.length-1].range[1]]),q=this.performAction.apply(w,[g,Z,F,I.yy,D[1],u,r].concat(oe)),typeof q<"u")return q;v&&(o=o.slice(0,-1*v*2),u=u.slice(0,-1*v),r=r.slice(0,-1*v)),o.push(this.productions_[D[1]][0]),u.push(w.$),r.push(w._$),ne=P[o[o.length-2]][o[o.length-1]],o.push(ne);break;case 3:return!0}}return!0},"parse")},se=(function(){var O={EOF:1,parseError:h(function(i,o){if(this.yy.parser)this.yy.parser.parseError(i,o);else throw new Error(i)},"parseError"),setInput:h(function(s,i){return this.yy=i||this.yy||{},this._input=s,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:h(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var i=s.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:h(function(s){var i=s.length,o=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var c=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),o.length-1&&(this.yylineno-=o.length-1);var u=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:o?(o.length===c.length?this.yylloc.first_column:0)+c[c.length-o.length].length-o[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:h(function(){return this._more=!0,this},"more"),reject:h(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:h(function(s){this.unput(this.match.slice(s))},"less"),pastInput:h(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:h(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:h(function(){var s=this.pastInput(),i=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
function Le(e,n){for(var s=0;s<n.length;s++){const a=n[s];if(typeof a!="string"&&!Array.isArray(a)){for(const i in a)if(i!=="default"&&!(i in e)){const d=Object.getOwnPropertyDescriptor(a,i);d&&Object.defineProperty(e,i,d.get?d:{enumerable:!0,get:()=>a[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var xs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Oe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ce={exports:{}},se={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var he;function De(){if(he)return se;he=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function s(a,i,d){var o=null;if(d!==void 0&&(o=""+d),i.key!==void 0&&(o=""+i.key),"key"in i){d={};for(var c in i)c!=="key"&&(d[c]=i[c])}else d=i;return i=d.ref,{$$typeof:e,type:a,key:o,ref:i!==void 0?i:null,props:d}}return se.Fragment=n,se.jsx=s,se.jsxs=s,se}var pe;function Me(){return pe||(pe=1,ce.exports=De()),ce.exports}var t=Me(),ue={exports:{}},P={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var be;function Ge(){if(be)return P;be=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),p=Symbol.iterator;function g(l){return l===null||typeof l!="object"?null:(l=p&&l[p]||l["@@iterator"],typeof l=="function"?l:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,v={};function E(l,k,$){this.props=l,this.context=k,this.refs=v,this.updater=$||N}E.prototype.isReactComponent={},E.prototype.setState=function(l,k){if(typeof l!="object"&&typeof l!="function"&&l!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,l,k,"setState")},E.prototype.forceUpdate=function(l){this.updater.enqueueForceUpdate(this,l,"forceUpdate")};function w(){}w.prototype=E.prototype;function T(l,k,$){this.props=l,this.context=k,this.refs=v,this.updater=$||N}var x=T.prototype=new w;x.constructor=T,C(x,E.prototype),x.isPureReactComponent=!0;var j=Array.isArray;function h(){}var b={H:null,A:null,T:null,S:null},S=Object.prototype.hasOwnProperty;function A(l,k,$){var _=$.ref;return{$$typeof:e,type:l,key:k,ref:_!==void 0?_:null,props:$}}function D(l,k){return A(l.type,k,l.props)}function I(l){return typeof l=="object"&&l!==null&&l.$$typeof===e}function O(l){var k={"=":"=0",":":"=2"};return"$"+l.replace(/[=:]/g,function($){return k[$]})}var L=/\/+/g;function F(l,k){return typeof l=="object"&&l!==null&&l.key!=null?O(""+l.key):k.toString(36)}function q(l){switch(l.status){case"fulfilled":return l.value;case"rejected":throw l.reason;default:switch(typeof l.status=="string"?l.then(h,h):(l.status="pending",l.then(function(k){l.status==="pending"&&(l.status="fulfilled",l.value=k)},function(k){l.status==="pending"&&(l.status="rejected",l.reason=k)})),l.status){case"fulfilled":return l.value;case"rejected":throw l.reason}}throw l}function Y(l,k,$,_,M){var G=typeof l;(G==="undefined"||G==="boolean")&&(l=null);var U=!1;if(l===null)U=!0;else switch(G){case"bigint":case"string":case"number":U=!0;break;case"object":switch(l.$$typeof){case e:case n:U=!0;break;case m:return U=l._init,Y(U(l._payload),k,$,_,M)}}if(U)return M=M(l),U=_===""?"."+F(l,0):_,j(M)?($="",U!=null&&($=U.replace(L,"$&/")+"/"),Y(M,k,$,"",function(R){return R})):M!=null&&(I(M)&&(M=D(M,$+(M.key==null||l&&l.key===M.key?"":(""+M.key).replace(L,"$&/")+"/")+U)),k.push(M)),1;U=0;var K=_===""?".":_+":";if(j(l))for(var B=0;B<l.length;B++)_=l[B],G=K+F(_,B),U+=Y(_,k,$,G,M);else if(B=g(l),typeof B=="function")for(l=B.call(l),B=0;!(_=l.next()).done;)_=_.value,G=K+F(_,B++),U+=Y(_,k,$,G,M);else if(G==="object"){if(typeof l.then=="function")return Y(q(l),k,$,_,M);throw k=String(l),Error("Objects are not valid as a React child (found: "+(k==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":k)+"). If you meant to render a collection of children, use an array instead.")}return U}function z(l,k,$){if(l==null)return l;var _=[],M=0;return Y(l,_,"","",function(G){return k.call($,G,M++)}),_}function ee(l){if(l._status===-1){var k=l._result;k=k(),k.then(function($){(l._status===0||l._status===-1)&&(l._status=1,l._result=$)},function($){(l._status===0||l._status===-1)&&(l._status=2,l._result=$)}),l._status===-1&&(l._status=0,l._result=k)}if(l._status===1)return l._result.default;throw l._result}var Q=typeof reportError=="function"?reportError:function(l){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var k=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof l=="object"&&l!==null&&typeof l.message=="string"?String(l.message):String(l),error:l});if(!window.dispatchEvent(k))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",l);return}console.error(l)},W={map:z,forEach:function(l,k,$){z(l,function(){k.apply(this,arguments)},$)},count:function(l){var k=0;return z(l,function(){k++}),k},toArray:function(l){return z(l,function(k){return k})||[]},only:function(l){if(!I(l))throw Error("React.Children.only expected to receive a single React element child.");return l}};return P.Activity=f,P.Children=W,P.Component=E,P.Fragment=s,P.Profiler=i,P.PureComponent=T,P.StrictMode=a,P.Suspense=u,P.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=b,P.__COMPILER_RUNTIME={__proto__:null,c:function(l){return b.H.useMemoCache(l)}},P.cache=function(l){return function(){return l.apply(null,arguments)}},P.cacheSignal=function(){return null},P.cloneElement=function(l,k,$){if(l==null)throw Error("The argument must be a React element, but you passed "+l+".");var _=C({},l.props),M=l.key;if(k!=null)for(G in k.key!==void 0&&(M=""+k.key),k)!S.call(k,G)||G==="key"||G==="__self"||G==="__source"||G==="ref"&&k.ref===void 0||(_[G]=k[G]);var G=arguments.length-2;if(G===1)_.children=$;else if(1<G){for(var U=Array(G),K=0;K<G;K++)U[K]=arguments[K+2];_.children=U}return A(l.type,M,_)},P.createContext=function(l){return l={$$typeof:o,_currentValue:l,_currentValue2:l,_threadCount:0,Provider:null,Consumer:null},l.Provider=l,l.Consumer={$$typeof:d,_context:l},l},P.createElement=function(l,k,$){var _,M={},G=null;if(k!=null)for(_ in k.key!==void 0&&(G=""+k.key),k)S.call(k,_)&&_!=="key"&&_!=="__self"&&_!=="__source"&&(M[_]=k[_]);var U=arguments.length-2;if(U===1)M.children=$;else if(1<U){for(var K=Array(U),B=0;B<U;B++)K[B]=arguments[B+2];M.children=K}if(l&&l.defaultProps)for(_ in U=l.defaultProps,U)M[_]===void 0&&(M[_]=U[_]);return A(l,G,M)},P.createRef=function(){return{current:null}},P.forwardRef=function(l){return{$$typeof:c,render:l}},P.isValidElement=I,P.lazy=function(l){return{$$typeof:m,_payload:{_status:-1,_result:l},_init:ee}},P.memo=function(l,k){return{$$typeof:y,type:l,compare:k===void 0?null:k}},P.startTransition=function(l){var k=b.T,$={};b.T=$;try{var _=l(),M=b.S;M!==null&&M($,_),typeof _=="object"&&_!==null&&typeof _.then=="function"&&_.then(h,Q)}catch(G){Q(G)}finally{k!==null&&$.types!==null&&(k.types=$.types),b.T=k}},P.unstable_useCacheRefresh=function(){return b.H.useCacheRefresh()},P.use=function(l){return b.H.use(l)},P.useActionState=function(l,k,$){return b.H.useActionState(l,k,$)},P.useCallback=function(l,k){return b.H.useCallback(l,k)},P.useContext=function(l){return b.H.useContext(l)},P.useDebugValue=function(){},P.useDeferredValue=function(l,k){return b.H.useDeferredValue(l,k)},P.useEffect=function(l,k){return b.H.useEffect(l,k)},P.useEffectEvent=function(l){return b.H.useEffectEvent(l)},P.useId=function(){return b.H.useId()},P.useImperativeHandle=function(l,k,$){return b.H.useImperativeHandle(l,k,$)},P.useInsertionEffect=function(l,k){return b.H.useInsertionEffect(l,k)},P.useLayoutEffect=function(l,k){return b.H.useLayoutEffect(l,k)},P.useMemo=function(l,k){return b.H.useMemo(l,k)},P.useOptimistic=function(l,k){return b.H.useOptimistic(l,k)},P.useReducer=function(l,k,$){return b.H.useReducer(l,k,$)},P.useRef=function(l){return b.H.useRef(l)},P.useState=function(l){return b.H.useState(l)},P.useSyncExternalStore=function(l,k,$){return b.H.useSyncExternalStore(l,k,$)},P.useTransition=function(){return b.H.useTransition()},P.version="19.2.7",P}var ye;function Fe(){return ye||(ye=1,ue.exports=Ge()),ue.exports}var r=Fe();const Ue=Oe(r),js=Le({__proto__:null,default:Ue},[r]);let fe=null;function Ns(e){fe=e??null}function J(e,n={}){const s={...n.headers||{}};return fe&&(s["X-Compose-Workspace-Id"]=fe),fetch(e,{...n,headers:s})}const He="";let Ee=null;function ge(e){Ee=e||null}function Be(){return Ee||He||""}function V(e={}){const n=Be();return n?{...e,"x-compose-token":n}:e}const Je=[{id:"explore_design",name:"Explore Design",agent:"claude",phase:"design",hasGate:!1},{id:"design_review",name:"Design Review",agent:"codex",phase:"design",hasGate:!1},{id:"design_gate",name:"Design Gate",agent:"human",phase:"design",hasGate:!0},{id:"prd",name:"PRD",agent:"claude",phase:"design",hasGate:!1},{id:"prd_review",name:"PRD Review",agent:"codex",phase:"design",hasGate:!1},{id:"prd_gate",name:"PRD Gate",agent:"human",phase:"design",hasGate:!0},{id:"architecture",name:"Architecture",agent:"claude",phase:"design",hasGate:!1},{id:"architecture_review",name:"Arch Review",agent:"codex",phase:"design",hasGate:!1},{id:"architecture_gate",name:"Arch Gate",agent:"human",phase:"design",hasGate:!0},{id:"blueprint",name:"Blueprint",agent:"claude",phase:"blueprint",hasGate:!1},{id:"verification",name:"Verification",agent:"claude",phase:"blueprint",hasGate:!1},{id:"blueprint_review",name:"BP Review",agent:"codex",phase:"blueprint",hasGate:!1},{id:"plan",name:"Plan",agent:"claude",phase:"implementation",hasGate:!1},{id:"plan_review",name:"Plan Review",agent:"codex",phase:"implementation",hasGate:!1},{id:"plan_gate",name:"Plan Gate",agent:"human",phase:"implementation",hasGate:!0},{id:"execute",name:"Execute",agent:"claude",phase:"implementation",hasGate:!1},{id:"review",name:"Review Loop",agent:"codex",phase:"implementation",hasGate:!1},{id:"coverage",name:"Coverage Sweep",agent:"claude",phase:"implementation",hasGate:!1},{id:"report",name:"Report",agent:"claude",phase:"ship",hasGate:!1},{id:"report_review",name:"Report Review",agent:"codex",phase:"ship",hasGate:!1},{id:"report_gate",name:"Report Gate",agent:"human",phase:"ship",hasGate:!0},{id:"docs",name:"Docs",agent:"claude",phase:"ship",hasGate:!1},{id:"ship",name:"Ship",agent:"claude",phase:"ship",hasGate:!1},{id:"ship_gate",name:"Ship Gate",agent:"human",phase:"ship",hasGate:!0}],qe=new Set(["complete","completed","aborted","failed","killed","done"]);function ae(e){return qe.has(e)}function Ye(e,n,s){const a=Array.isArray(n)?Object.fromEntries(n.map(o=>[o.id,o.status])):{},i=Array.isArray(n)?Object.fromEntries(n.map(o=>[o.id,o])):{},d=e.map(o=>{const c=i[o.id],u=c?{...o,...c}:{...o};return u.id===s&&!a[u.id]&&(u.status="active"),u});if(Array.isArray(n))for(const o of n)e.find(c=>c.id===o.id)||d.push({id:o.id,name:o.id.replace(/_/g," "),agent:"claude",phase:"implementation",...o});return d}function We(e,n,s){if(!e)return!1;const{featureCode:a,status:i,currentStepId:d}=e;if(i!=="running"||!d||!d.endsWith("_gate"))return!1;const o=Array.isArray(s)?s:[],c=o.find(u=>u.featureCode===a)||o.find(u=>u.title===a)||o.find(u=>u.title&&u.title.startsWith(a+":"));return c?(Array.isArray(n)?n:[]).some(u=>u.itemId===c.id&&!u.resolvedAt):!1}const Ke=[{id:"agents",label:"Agents",icon:"◇"},{id:"roadmap",label:"Roadmap",icon:"⚡"},{id:"builds",label:"Builds",icon:"⏵"},{id:"ideas",label:"Ideas",icon:"✦"}];function ze({active:e,onSelect:n,badges:s}){return t.jsx("nav",{className:"m-bottom-nav",role:"tablist","aria-label":"Mobile navigation",children:Ke.map(a=>{const i=s==null?void 0:s[a.id];return t.jsxs("button",{type:"button",className:"m-nav-btn",role:"tab","aria-pressed":e===a.id?"true":"false","aria-label":a.label,"data-tab":a.id,"data-testid":`mobile-nav-${a.id}`,onClick:()=>n(a.id),children:[t.jsxs("span",{className:"m-nav-icon-wrap",children:[t.jsx("span",{className:"m-nav-icon","aria-hidden":"true",children:a.icon}),i&&t.jsx("span",{className:`m-nav-badge m-nav-badge-${i.level||"info"}`,"data-testid":`mobile-nav-badge-${a.id}`,"aria-hidden":"true",children:i.count!=null?String(i.count):""})]}),t.jsx("span",{className:"m-nav-label",children:a.label})]},a.id)})})}async function Xe(e,n={}){const s=await J(e,n);let a=null;try{a=await s.json()}catch{}if(!s.ok){const i=a&&a.error||`HTTP ${s.status}`;throw new Error(i)}return a}function Ve(){const[e,n]=r.useState([]),[s,a]=r.useState(!0),[i,d]=r.useState(null),o=r.useRef(!0),c=r.useCallback(async()=>{try{const u=await Xe("/api/agents/tree");if(!o.current)return;n(Array.isArray(u==null?void 0:u.agents)?u.agents:[]),d(null)}catch(u){if(!o.current)return;d(u.message)}finally{o.current&&a(!1)}},[]);return r.useEffect(()=>(o.current=!0,c(),()=>{o.current=!1}),[c]),r.useEffect(()=>{if(typeof window>"u"||typeof WebSocket>"u")return;let u=null,y=!1,m=null;function f(){if(!y){try{const g=window.location.protocol==="https:"?"wss:":"ws:";u=new WebSocket(`${g}//${window.location.host}/ws/vision`)}catch{p();return}u.onmessage=g=>{try{const N=JSON.parse(g.data);if(!N||!N.type)return;(N.type==="agentSpawned"||N.type==="agentStopped"||N.type==="agentStatusChanged"||N.type==="agentTreeUpdated")&&c()}catch{}},u.onclose=()=>{y||p()},u.onerror=()=>{try{u.close()}catch{}}}}function p(){m&&clearTimeout(m),m=setTimeout(f,3e3)}return f(),()=>{y=!0,m&&clearTimeout(m);try{u&&(u.onclose=null,u.close())}catch{}}},[c]),{agents:e,loading:s,error:i,refetch:c}}const de={};function re(e){if(typeof window>"u"||!window.location)return e;const n=typeof import.meta<"u"&&(de==null?void 0:de.VITE_AGENT_PORT)||"4002";return`${window.location.protocol}//${window.location.hostname}:${n}${e}`}const Qe=5e3;async function xe(e,n){const s=await fetch(re(e),{method:"POST",headers:V({"Content-Type":"application/json"}),body:JSON.stringify(n||{})});let a=null;try{a=await s.json()}catch{}if(!s.ok){const i=a&&a.error||`HTTP ${s.status}`;throw new Error(i)}return a}function Ze(){const[e,n]=r.useState(!1),[s,a]=r.useState(null),[i,d]=r.useState(!0),[o,c]=r.useState(null),[u,y]=r.useState(!1),m=r.useRef(!0),f=r.useCallback(async()=>{try{const C=await(await fetch(re("/api/agent/session/status"))).json().catch(()=>({}));if(!m.current)return;n(!!C.active),a(C.sessionId||null),c(null)}catch(N){if(!m.current)return;c(N.message)}finally{m.current&&d(!1)}},[]);r.useEffect(()=>{m.current=!0,f();const N=setInterval(f,Qe);return()=>{m.current=!1,clearInterval(N)}},[f]);const p=r.useCallback(async N=>{const C=(N||"").trim();if(!C)throw new Error("message is empty");y(!0);try{const E=await xe(s?"/api/agent/message":"/api/agent/session",{prompt:C});return f(),E}finally{y(!1)}},[s,f]),g=r.useCallback(async()=>xe("/api/agent/interrupt",{}),[]);return{active:e,sessionId:s,loading:i,error:o,sending:u,sendMessage:p,interrupt:g,refresh:f}}function et(e){if(!e)return"";const n=typeof e=="string"?Date.parse(e):Number(e);if(!n||Number.isNaN(n))return"";const s=Date.now()-n;return s<5e3?"just now":s<6e4?`${Math.floor(s/1e3)}s ago`:s<36e5?`${Math.floor(s/6e4)}m ago`:`${Math.floor(s/36e5)}h ago`}function tt({agent:e,onOpen:n,onAfterKill:s}){const[a,i]=r.useState(!1),[d,o]=r.useState(null),c=e.agentId||e.id,u=e.status||"unknown",y=e.lastActivityAt||e.lastEventAt||e.startedAt||null,m=r.useCallback(async p=>{if(p==null||p.stopPropagation(),!!c){i(!0),o(null);try{const g=await J(re(`/api/agent/${encodeURIComponent(c)}/stop`),{method:"POST",headers:V({"Content-Type":"application/json"}),body:JSON.stringify({})});if(!g.ok){let N=null;try{N=await g.json()}catch{}throw new Error(N&&N.error||`HTTP ${g.status}`)}s==null||s(c)}catch(g){o(g.message)}finally{i(!1)}}},[c,s]),f=r.useCallback(()=>n==null?void 0:n(e),[n,e]);return t.jsxs("div",{className:"m-agent-card","data-testid":`mobile-agent-card-${c}`,role:"button",tabIndex:0,onClick:f,onKeyDown:p=>{p.key==="Enter"&&f()},children:[t.jsxs("div",{className:"m-agent-card-row",children:[t.jsx("div",{className:"m-agent-card-id",title:c,children:c||"(no id)"}),t.jsx("span",{className:"m-status-pill","data-status":u,children:u})]}),t.jsxs("div",{className:"m-agent-card-meta",children:[t.jsx("span",{className:"m-agent-card-time",children:et(y)}),t.jsx("button",{type:"button",className:"m-btn m-btn-danger m-btn-sm","data-testid":`mobile-agent-kill-${c}`,disabled:a||u!=="running",onClick:m,children:a?"Killing…":"Kill"})]}),d&&t.jsx("div",{className:"m-agent-card-error",children:d})]})}const st=3e4,nt=5,at=3e4;function rt({url:e,onEvent:n,onOpen:s,onClose:a,onError:i,onRetry:d,onStall:o,onExhausted:c,namedEvents:u=["hydrate"],maxBackoffMs:y=st,maxRetries:m=nt,stallTimeoutMs:f=at}){if(!e)throw new Error("createAgentStream: url is required");if(typeof EventSource>"u")return{close(){}};let p=null,g=!1,N=0,C=null,v=null;function E(){v&&clearTimeout(v),!g&&(v=setTimeout(()=>{o==null||o({elapsedMs:f})},f))}function w(){v&&(clearTimeout(v),v=null)}function T(h,b){if(E(),!!n)try{const S=JSON.parse(b);n(S,h)}catch{}}function x(){if(w(),g||C)return;if(N>=m){const b=new Error(`agent-stream: failed after ${m} retries`);i==null||i(b),g=!0;try{p==null||p.close()}catch{}p=null,a==null||a(),c==null||c();return}const h=Math.min(y,1e3*Math.pow(2,N));N+=1,d==null||d({attempt:N,maxRetries:m,nextBackoffMs:h}),C=setTimeout(()=>{C=null,j()},h)}function j(){if(!g){try{p=new EventSource(e)}catch(h){i==null||i(h),x();return}p.onopen=()=>{N=0,w(),s==null||s()},p.onmessage=h=>T("message",h.data);for(const h of u)p.addEventListener(h,b=>T(h,b.data));p.onerror=h=>{i==null||i(h instanceof Error?h:new Error("agent-stream error"));try{p==null||p.close()}catch{}p=null,a==null||a(),x()}}}return j(),{close(){g=!0,w(),C&&(clearTimeout(C),C=null);try{p==null||p.close()}catch{}p=null},reconnect(){g=!1,N=0,w(),C&&(clearTimeout(C),C=null);try{p==null||p.close()}catch{}p=null,j()}}}function it(){return typeof window>"u"||!window.location?"":re("/api/agent/stream")}function lt(e){return!e||typeof e!="object"?null:e.agentId||e.agent_id||e.id||null}function Re({url:e,agentId:n,max:s=500,enabled:a=!0}={}){const[i,d]=r.useState([]),[o,c]=r.useState(!1),u=r.useRef(null),y=r.useMemo(()=>e||it(),[e]);return r.useEffect(()=>{if(!a||!y)return;const f=rt({url:y,onOpen:()=>c(!0),onClose:()=>c(!1),onEvent:p=>{d(g=>{const N=g.length>=s?g.slice(g.length-s+1):g.slice();return N.push(p),N})}});return u.current=f,()=>{try{f.close()}catch{}}},[y,a,s]),{events:r.useMemo(()=>n?i.filter(f=>lt(f)===n):i,[i,n]),allEvents:i,connected:o}}function ot(e,n){if(typeof e=="string")return e;if(e!=null&&e.type&&(e!=null&&e.message))return`[${e.type}] ${typeof e.message=="string"?e.message:JSON.stringify(e.message)}`;if(e!=null&&e.type)return`[${e.type}] ${JSON.stringify(e).slice(0,240)}`;try{return JSON.stringify(e)}catch{return`(unserializable #${n})`}}function ct({agent:e,onClose:n}){const s=(e==null?void 0:e.agentId)||(e==null?void 0:e.id),{events:a}=Re({agentId:s}),i=r.useRef(null),[d,o]=r.useState(!1),[c,u]=r.useState(null);r.useEffect(()=>{var m;(m=i.current)==null||m.scrollIntoView({behavior:"smooth"})},[a.length]);const y=r.useCallback(async()=>{if(s){o(!0),u(null);try{const m=await J(re(`/api/agent/${encodeURIComponent(s)}/stop`),{method:"POST",headers:V({"Content-Type":"application/json"}),body:JSON.stringify({})});if(!m.ok){let f=null;try{f=await m.json()}catch{}throw new Error(f&&f.error||`HTTP ${m.status}`)}}catch(m){u(m.message)}finally{o(!1)}}},[s]);return e?t.jsxs("div",{className:"m-overlay","data-testid":"mobile-agent-detail",role:"dialog","aria-modal":"true",children:[t.jsxs("header",{className:"m-overlay-header",children:[t.jsxs("div",{className:"m-overlay-header-inner",children:[t.jsx("div",{className:"m-overlay-title",title:s,children:s}),t.jsx("span",{className:"m-status-pill","data-status":e.status,children:e.status||"unknown"})]}),t.jsxs("div",{className:"m-overlay-actions",children:[t.jsx("button",{type:"button",className:"m-btn m-btn-danger m-btn-sm",disabled:d,onClick:y,"data-testid":"mobile-agent-detail-kill",children:d?"Killing…":"Kill"}),t.jsx("button",{type:"button",className:"m-btn m-btn-sm",onClick:n,"data-testid":"mobile-agent-detail-close",children:"Close"})]})]}),t.jsxs("div",{className:"m-overlay-body m-agent-log",children:[a.length===0?t.jsx("div",{className:"m-empty",children:"No live events for this agent yet."}):a.map((m,f)=>t.jsx("div",{className:"m-agent-log-line",children:ot(m,f)},f)),t.jsx("div",{ref:i})]}),c&&t.jsx("div",{className:"m-agent-card-error",children:c})]}):null}function ut({session:e}){const{active:n,sessionId:s,sending:a,sendMessage:i}=e,[d,o]=r.useState(""),[c,u]=r.useState(null),y=r.useCallback(async m=>{if(m==null||m.preventDefault(),!!d.trim()){u(null);try{await i(d),o("")}catch(f){u(f.message)}}},[d,i]);return t.jsxs("div",{className:"m-session-card","data-testid":"mobile-interactive-session",children:[t.jsxs("div",{className:"m-session-card-row",children:[t.jsx("div",{className:"m-session-card-title",children:"Interactive session"}),t.jsx("span",{className:"m-status-pill","data-status":n?"in_progress":"planned",children:n?"active":"ready"})]}),t.jsx("div",{className:"m-session-card-id",children:s?`id: ${s}`:"No active session"}),t.jsxs("form",{className:"m-session-card-form",onSubmit:y,children:[t.jsx("input",{type:"text",className:"m-input",placeholder:n?"Message Claude…":"Start a new session…",value:d,onChange:m=>o(m.target.value),"data-testid":"mobile-interactive-session-input",disabled:a}),t.jsx("button",{type:"submit",className:"m-btn m-btn-primary m-btn-sm",disabled:a||!d.trim(),"data-testid":"mobile-interactive-session-send",children:a?"Sending…":"Send"})]}),c&&t.jsx("div",{className:"m-agent-card-error",children:c})]})}function dt({gate:e,onOpen:n}){const s=e.id,a=e.flowId||e.flow||"",i=e.stepId||e.step||"",d=e.summary||e.comment||"",o=e.toPhase||e.fromPhase||"";return t.jsxs("div",{className:"m-gate-card","data-testid":`mobile-gate-card-${s}`,role:"button",tabIndex:0,onClick:()=>n==null?void 0:n(e),onKeyDown:c=>{c.key==="Enter"&&(n==null||n(e))},children:[t.jsxs("div",{className:"m-gate-card-row",children:[t.jsx("div",{className:"m-gate-card-title",children:a||s}),o&&t.jsx("span",{className:"m-status-pill","data-status":"in_progress",children:o})]}),t.jsx("div",{className:"m-gate-card-step",children:i}),d&&t.jsx("div",{className:"m-gate-card-summary",children:d})]})}const mt=[{id:"approve",label:"Approve",kind:"primary"},{id:"revise",label:"Revise",kind:"warn"},{id:"kill",label:"Kill",kind:"danger"}];function ft({gate:e,onResolve:n,onClose:s}){const[a,i]=r.useState(null),[d,o]=r.useState(""),[c,u]=r.useState(""),[y,m]=r.useState(!1),[f,p]=r.useState(null),g=r.useCallback(async N=>{if(N==null||N.preventDefault(),!a){p("Pick an outcome");return}if(a==="kill"&&!d.trim()){p("Reason is required when killing a gate");return}m(!0),p(null);try{await n(e.id,{outcome:a,reason:d.trim(),summary:c.trim()}),s==null||s()}catch(C){p(C.message)}finally{m(!1)}},[e,a,d,c,n,s]);return t.jsx("div",{className:"m-sheet-backdrop","data-testid":"mobile-gate-sheet",onClick:s,children:t.jsxs("div",{className:"m-sheet",role:"dialog","aria-modal":"true",onClick:N=>N.stopPropagation(),children:[t.jsxs("div",{className:"m-sheet-header",children:[t.jsx("div",{className:"m-sheet-title",children:"Resolve gate"}),t.jsxs("div",{className:"m-sheet-subtitle",children:[e.flowId,":",e.stepId]})]}),t.jsxs("form",{onSubmit:g,className:"m-sheet-body",children:[t.jsx("div",{className:"m-sheet-outcomes",role:"radiogroup","aria-label":"Outcome",children:mt.map(N=>t.jsx("button",{type:"button",role:"radio","aria-checked":a===N.id,className:`m-btn m-btn-${N.kind} ${a===N.id?"m-btn-active":""}`,"data-testid":`mobile-gate-outcome-${N.id}`,onClick:()=>i(N.id),children:N.label},N.id))}),t.jsxs("label",{className:"m-field",children:[t.jsxs("span",{className:"m-field-label",children:["Reason ",a==="kill"?"(required)":"(optional)"]}),t.jsx("textarea",{className:"m-textarea","data-testid":"mobile-gate-reason",value:d,onChange:N=>o(N.target.value),rows:2})]}),t.jsxs("label",{className:"m-field",children:[t.jsx("span",{className:"m-field-label",children:"Summary (optional)"}),t.jsx("textarea",{className:"m-textarea","data-testid":"mobile-gate-summary",value:c,onChange:N=>u(N.target.value),rows:2})]}),f&&t.jsx("div",{className:"m-agent-card-error",children:f}),t.jsxs("div",{className:"m-sheet-actions",children:[t.jsx("button",{type:"button",className:"m-btn m-btn-sm",onClick:s,disabled:y,children:"Cancel"}),t.jsx("button",{type:"submit",className:"m-btn m-btn-primary m-btn-sm",disabled:y||!a,"data-testid":"mobile-gate-submit",children:y?"Submitting…":"Submit"})]})]})]})})}function ht({gates:e=[],gatesLoading:n=!1,resolveGate:s}){const{agents:a,loading:i,refetch:d}=Ve(),o=Ze(),[c,u]=r.useState(null),[y,m]=r.useState(null),f=r.useCallback(()=>{d(),u(null)},[d]);return t.jsxs("section",{"data-testid":"mobile-tab-agents",className:"m-agents-tab",children:[t.jsxs("div",{className:"m-section","data-testid":"mobile-section-spawned",children:[t.jsx("h2",{className:"m-section-title",children:"Spawned agents"}),i?t.jsx("div",{className:"m-empty",children:"Loading agents…"}):a.length===0?t.jsx("div",{className:"m-empty",children:"No spawned agents."}):t.jsx("div",{className:"m-stack",children:a.map(p=>t.jsx(tt,{agent:p,onOpen:u,onAfterKill:f},p.agentId||p.id))})]}),t.jsxs("div",{className:"m-section","data-testid":"mobile-section-session",children:[t.jsx("h2",{className:"m-section-title",children:"Interactive session"}),t.jsx(ut,{session:o})]}),t.jsxs("div",{className:"m-section","data-testid":"mobile-section-gates",children:[t.jsx("h2",{className:"m-section-title",children:"Pending gates"}),n?t.jsx("div",{className:"m-empty",children:"Loading gates…"}):e.length===0?t.jsx("div",{className:"m-empty",children:"No pending gates."}):t.jsx("div",{className:"m-stack",children:e.map(p=>t.jsx(dt,{gate:p,onOpen:m},p.id))})]}),c&&t.jsx(ct,{agent:c,onClose:()=>u(null)}),y&&t.jsx(ft,{gate:y,onResolve:s,onClose:()=>m(null)})]})}const pt=[{value:"planned",label:"planned"},{value:"in_progress",label:"in progress"},{value:"blocked",label:"blocked"},{value:"complete",label:"complete"},{value:"parked",label:"parked"},{value:"killed",label:"killed"}];function bt({statuses:e=[],onToggleStatus:n,group:s="",groupOptions:a=[],onChangeGroup:i,keyword:d="",onChangeKeyword:o}){return t.jsxs("div",{className:"m-filter-bar","data-testid":"mobile-filter-bar",children:[t.jsx("div",{className:"m-filter-chips",role:"group","aria-label":"Status filter",children:pt.map(c=>{const u=e.includes(c.value);return t.jsx("button",{type:"button",className:"m-filter-chip","aria-pressed":u,"data-testid":`mobile-filter-status-${c.value}`,onClick:()=>n==null?void 0:n(c.value),children:c.label},c.value)})}),t.jsxs("div",{className:"m-filter-row",children:[t.jsxs("select",{className:"m-filter-select","data-testid":"mobile-filter-group",value:s,onChange:c=>i==null?void 0:i(c.target.value),"aria-label":"Group filter",children:[t.jsx("option",{value:"",children:"All groups"}),a.map(c=>t.jsx("option",{value:c,children:c},c))]}),t.jsx("input",{type:"search",className:"m-filter-keyword","data-testid":"mobile-filter-keyword",placeholder:"Search title or description",value:d,onChange:c=>o==null?void 0:o(c.target.value),"aria-label":"Keyword filter"})]})]})}const yt=new Set(["planned","in_progress","blocked","complete","partial","superseded","parked"]);function Ae({status:e,children:n}){const s=typeof e=="string"?e.toLowerCase():"",a=yt.has(s)?s:"unknown",i=n??e??"unknown";return t.jsx("span",{className:"m-status-pill","data-status":a,children:i})}function gt(e,n=140){if(typeof e!="string")return"";const s=e.trim();return s.length<=n?s:s.slice(0,n-1).trimEnd()+"…"}function xt({item:e,onSelect:n}){if(!e)return null;const s=e.title||e.id||"Untitled",a=e.status||"unknown",i=e.group||"",d=gt(e.description||"");return t.jsxs("button",{type:"button",className:"m-item-card","data-testid":`mobile-item-card-${e.id}`,onClick:()=>n==null?void 0:n(e),children:[t.jsxs("div",{className:"m-item-card-row",children:[t.jsx("div",{className:"m-item-card-title",children:s}),t.jsx(Ae,{status:a})]}),t.jsxs("div",{className:"m-item-card-meta",children:[i?t.jsx("span",{className:"m-item-card-group","data-testid":"mobile-item-group",children:i}):null,e.id?t.jsx("span",{className:"m-item-card-id",children:e.id}):null]}),d?t.jsx("div",{className:"m-item-card-desc",children:d}):null]})}const jt=["planned","ready","in_progress","review","complete","blocked","parked","killed","superseded"],Nt=["informs","blocks","supports","contradicts","implements"];function vt({item:e,onClose:n,onSave:s,onDelete:a,allItems:i=[],addConnection:d,removeConnection:o,fetchItemDetail:c}){const u=r.useMemo(()=>({status:(e==null?void 0:e.status)||"planned",group:(e==null?void 0:e.group)||"",confidence:(e==null?void 0:e.confidence)??""}),[e]),[y,m]=r.useState(u.status),[f,p]=r.useState(u.group),[g,N]=r.useState(u.confidence),[C,v]=r.useState(!1),[E,w]=r.useState(!1),[T,x]=r.useState(!1),j=r.useRef(null),[h,b]=r.useState([]),[S,A]=r.useState(!1),[D,I]=r.useState(!1),[O,L]=r.useState(""),[F,q]=r.useState("informs"),[Y,z]=r.useState(!1),[ee,Q]=r.useState(null),W=r.useRef(null);if(r.useEffect(()=>{m(u.status),p(u.group),N(u.confidence),w(!1),b([]),I(!1),L(""),q("informs"),Q(null),j.current&&clearTimeout(j.current),W.current&&clearTimeout(W.current)},[e==null?void 0:e.id,u.status,u.group,u.confidence]),r.useEffect(()=>{!(e!=null&&e.id)||!c||(A(!0),c(e.id).then(R=>{var H;R!=null&&R.ok&&Array.isArray((H=R.item)==null?void 0:H.connections)&&b(R.item.connections)}).finally(()=>A(!1)))},[e==null?void 0:e.id,c]),r.useEffect(()=>()=>{j.current&&clearTimeout(j.current),W.current&&clearTimeout(W.current)},[]),!e)return null;const l=y!==u.status||f!==u.group||String(g)!==String(u.confidence);function k(){w(!1),j.current&&clearTimeout(j.current)}function $(){E&&k(),ee!==null&&(Q(null),W.current&&clearTimeout(W.current))}const _=async()=>{if(!l||C)return;const R={};if(y!==u.status&&(R.status=y),f!==u.group&&(R.group=f),String(g)!==String(u.confidence)){const H=g===""?null:Number(g);H!==null&&Number.isFinite(H)?R.confidence=H:g===""&&(R.confidence=null)}v(!0);try{await(s==null?void 0:s(e.id,R))}finally{v(!1)}},M=async()=>{if(!E)w(!0),j.current=setTimeout(()=>{w(!1)},3e3);else{j.current&&clearTimeout(j.current),w(!1),x(!0);try{await(a==null?void 0:a(e.id))}finally{x(!1)}}},G=r.useMemo(()=>{const R=O.toLowerCase();return i.filter(H=>H.id===e.id?!1:R?H.id.toLowerCase().includes(R)||(H.title||"").toLowerCase().includes(R):!0)},[i,e==null?void 0:e.id,O]),U=async R=>{z(!0);const H=await(d==null?void 0:d({fromId:e.id,toId:R.id,type:F}));if(H!=null&&H.ok){const X=H.connection||{id:`local-${Date.now()}`,fromId:e.id,toId:R.id,type:F};b(te=>[...te,X]),I(!1),L(""),q("informs")}z(!1)},K=async(R,H)=>{if(ee!==H)W.current&&clearTimeout(W.current),Q(H),W.current=setTimeout(()=>{Q(null)},3e3);else{W.current&&clearTimeout(W.current),Q(null);const X=await(o==null?void 0:o(R.id));X!=null&&X.ok&&b(te=>te.filter(le=>le.id!==R.id))}};function B(R){const H=i.find(X=>X.id===R);return(H==null?void 0:H.title)||R}return t.jsx("div",{className:"m-sheet-overlay",role:"dialog","aria-modal":"true","data-testid":"mobile-item-sheet",children:t.jsxs("div",{className:"m-sheet",children:[t.jsxs("header",{className:"m-sheet-header",children:[t.jsx("button",{type:"button",className:"m-sheet-close",onClick:n,"data-testid":"mobile-item-sheet-close","aria-label":"Close",children:"×"}),t.jsxs("div",{className:"m-sheet-title-row",children:[t.jsx("div",{className:"m-sheet-title",children:e.title||e.id}),t.jsx(Ae,{status:y})]})]}),t.jsxs("div",{className:"m-sheet-body",children:[e.description?t.jsxs("section",{className:"m-sheet-section",children:[t.jsx("div",{className:"m-sheet-label",children:"Description"}),t.jsx("p",{className:"m-sheet-desc",children:e.description})]}):null,t.jsxs("section",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-sheet-status",children:"Status"}),t.jsx("select",{id:"m-sheet-status",className:"m-sheet-input","data-testid":"mobile-item-sheet-status",value:y,onChange:R=>{$(),m(R.target.value)},children:jt.map(R=>t.jsx("option",{value:R,children:R},R))})]}),t.jsxs("section",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-sheet-group",children:"Group"}),t.jsx("input",{id:"m-sheet-group",type:"text",className:"m-sheet-input","data-testid":"mobile-item-sheet-group",value:f,onChange:R=>{$(),p(R.target.value)}})]}),t.jsxs("section",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-sheet-confidence",children:"Confidence (0–4)"}),t.jsx("input",{id:"m-sheet-confidence",type:"number",min:"0",max:"4",step:"1",className:"m-sheet-input","data-testid":"mobile-item-sheet-confidence",value:g,onChange:R=>{$(),N(R.target.value)}})]}),t.jsxs("section",{className:"m-sheet-section m-sheet-connections",children:[t.jsxs("div",{className:"m-sheet-connections-header",children:[t.jsx("span",{className:"m-sheet-label",children:"Connections"}),!D&&t.jsx("button",{type:"button",className:"m-conn-add-btn","data-testid":"mobile-item-conn-add",onClick:()=>{$(),I(!0)},children:"+ Add"})]}),S?t.jsx("div",{className:"m-conn-loading",children:"Loading…"}):h.length===0&&!D?t.jsx("div",{className:"m-conn-empty",children:"No connections"}):t.jsx("ul",{className:"m-conn-list",children:h.map((R,H)=>{const X=R.fromId===e.id,te=X?R.toId:R.fromId,le=B(te),oe=ee===H;return t.jsxs("li",{className:"m-conn-row",children:[t.jsx("span",{className:"m-conn-dir",children:X?"→":"←"}),t.jsx("span",{className:"m-conn-title",children:le}),t.jsx("span",{className:"m-conn-type",children:R.type}),t.jsx("button",{type:"button",className:`m-conn-remove${oe?" m-conn-remove--armed":""}`,"data-testid":`mobile-item-conn-remove-${H}`,"aria-label":oe?"Confirm remove connection":"Remove connection",onClick:()=>{$(),K(R,H)},children:oe?"✓":"×"})]},R.id)})}),D&&t.jsxs("div",{className:"m-conn-picker",children:[t.jsxs("div",{className:"m-conn-picker-row",children:[t.jsx("input",{type:"text",className:"m-sheet-input m-conn-search",placeholder:"Search items…",value:O,onChange:R=>L(R.target.value),"data-testid":"mobile-item-conn-search",autoFocus:!0}),t.jsx("select",{className:"m-sheet-input m-conn-type-select",value:F,onChange:R=>q(R.target.value),"data-testid":"mobile-item-conn-type",children:Nt.map(R=>t.jsx("option",{value:R,children:R},R))})]}),t.jsxs("ul",{className:"m-conn-picker-list",children:[G.map(R=>t.jsx("li",{children:t.jsxs("button",{type:"button",className:"m-conn-picker-item",disabled:Y,onClick:()=>U(R),"data-testid":`mobile-item-conn-pick-${R.id}`,children:[t.jsx("span",{className:"m-conn-picker-title",children:R.title||R.id}),t.jsx("span",{className:"m-conn-picker-id",children:R.id})]})},R.id)),G.length===0&&t.jsx("li",{className:"m-conn-picker-empty",children:"No items found"})]}),t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-secondary",onClick:()=>{I(!1),L(""),q("informs")},children:"Cancel"})]})]})]}),t.jsxs("footer",{className:"m-sheet-footer",children:[t.jsx("button",{type:"button",className:`m-sheet-btn m-sheet-btn-danger${E?" m-sheet-btn-danger--armed":""}`,onClick:M,disabled:T,"data-testid":"mobile-item-sheet-delete",children:T?"Deleting…":E?"Confirm delete":"Delete"}),t.jsxs("div",{className:"m-sheet-footer-right",children:[t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-secondary",onClick:n,"data-testid":"mobile-item-sheet-cancel",children:"Cancel"}),t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-primary",onClick:_,disabled:!l||C,"data-testid":"mobile-item-sheet-save",children:C?"Saving…":"Save"})]})]})]})})}const wt=["planned","ready","in_progress","review","complete","blocked","parked","killed","superseded"];function St({open:e,onClose:n,onCreate:s,groupOptions:a=[]}){const[i,d]=r.useState(""),[o,c]=r.useState(""),[u,y]=r.useState(""),[m,f]=r.useState("planned"),[p,g]=r.useState(""),[N,C]=r.useState(!1),[v,E]=r.useState(null),w=r.useId();if(!e)return null;function T(){d(""),c(""),y(""),f("planned"),g(""),E(null),C(!1)}function x(){T(),n==null||n()}async function j(h){if(h.preventDefault(),!i.trim()){E("Title is required");return}C(!0),E(null);try{const b={title:i.trim()};if(o.trim()&&(b.description=o.trim()),u.trim()&&(b.group=u.trim()),m&&(b.status=m),p!==""){const S=Number(p);Number.isFinite(S)&&(b.confidence=S)}await(s==null?void 0:s(b)),x()}catch(b){E(b.message||"Failed to create item"),C(!1)}}return t.jsx("div",{className:"m-sheet-overlay","data-testid":"mobile-create-sheet",role:"dialog","aria-modal":"true","aria-label":"Create roadmap item",onClick:h=>{h.target===h.currentTarget&&x()},children:t.jsxs("div",{className:"m-sheet",children:[t.jsxs("header",{className:"m-sheet-header",children:[t.jsx("button",{type:"button",className:"m-sheet-close","aria-label":"Close",onClick:x,disabled:N,children:"×"}),t.jsx("div",{className:"m-sheet-title-row",children:t.jsx("div",{className:"m-sheet-title",children:"New roadmap item"})})]}),t.jsxs("form",{className:"m-sheet-body",onSubmit:j,children:[t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-create-title",children:"Title"}),t.jsx("input",{id:"m-create-title",type:"text",className:"m-sheet-input",value:i,onChange:h=>d(h.target.value),placeholder:"Feature title","data-testid":"mobile-create-title",autoFocus:!0,required:!0})]}),t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-create-desc",children:"Description (optional)"}),t.jsx("textarea",{id:"m-create-desc",className:"m-sheet-input m-textarea",value:o,onChange:h=>c(h.target.value),rows:3,"data-testid":"mobile-create-desc"})]}),t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-create-group",children:"Group (optional)"}),t.jsx("input",{id:"m-create-group",type:"text",className:"m-sheet-input",value:u,onChange:h=>y(h.target.value),list:w,placeholder:"e.g. core, infra","data-testid":"mobile-create-group"}),t.jsx("datalist",{id:w,children:a.map(h=>t.jsx("option",{value:h},h))})]}),t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-create-status",children:"Status"}),t.jsx("select",{id:"m-create-status",className:"m-sheet-input",value:m,onChange:h=>f(h.target.value),"data-testid":"mobile-create-status",children:wt.map(h=>t.jsx("option",{value:h,children:h},h))})]}),t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-create-confidence",children:"Confidence (0–4, optional)"}),t.jsx("input",{id:"m-create-confidence",type:"number",min:"0",max:"4",step:"1",className:"m-sheet-input",value:p,onChange:h=>g(h.target.value),"data-testid":"mobile-create-confidence"})]}),v?t.jsx("div",{className:"m-form-error",role:"alert","data-testid":"mobile-create-error",children:v}):null]}),t.jsxs("footer",{className:"m-sheet-footer",children:[t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-secondary",onClick:x,disabled:N,"data-testid":"mobile-create-cancel",children:"Cancel"}),t.jsx("div",{className:"m-sheet-footer-right",children:t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-primary",disabled:N||!i.trim(),"data-testid":"mobile-create-submit",onClick:j,children:N?"Creating…":"Create"})})]})]})})}function $e({message:e,kind:n="error",durationMs:s=3e3,onDismiss:a}){return r.useEffect(()=>{if(!e)return;const i=setTimeout(()=>a==null?void 0:a(),s);return()=>clearTimeout(i)},[e,s,a]),e?t.jsx("div",{className:"m-toast",role:"status","data-kind":n,"data-testid":"mobile-toast",children:e}):null}function kt(e){const n=new Set;for(const s of e){const a=((s==null?void 0:s.group)||"").trim();a&&n.add(a)}return Array.from(n).sort()}function Ct(e,n){if(!n)return!0;const s=n.toLowerCase(),a=(e.title||"").toLowerCase(),i=(e.description||"").toLowerCase();return a.includes(s)||i.includes(s)}function Tt({items:e=[],loading:n=!1,error:s=null,applyOptimisticEdit:a,createItem:i,deleteItem:d,addConnection:o,removeConnection:c,fetchItemDetail:u}){const[y,m]=r.useState([]),[f,p]=r.useState(""),[g,N]=r.useState(""),[C,v]=r.useState(null),[E,w]=r.useState(!1),[T,x]=r.useState(null),j=r.useMemo(()=>kt(e),[e]),h=r.useMemo(()=>e.filter(O=>!(y.length&&!y.includes(O.status)||f&&O.group!==f||!Ct(O,g))),[e,y,f,g]),b=r.useMemo(()=>e.find(O=>O.id===C)||null,[e,C]),S=O=>{m(L=>L.includes(O)?L.filter(F=>F!==O):[...L,O])},A=async(O,L)=>{const F=await a(O,L);F!=null&&F.ok?v(null):x((F==null?void 0:F.error)||"Save failed")},D=async O=>{const L=await(i==null?void 0:i(O));if(!(L!=null&&L.ok))throw new Error((L==null?void 0:L.error)||"Create failed")},I=async O=>{const L=await(d==null?void 0:d(O));L!=null&&L.ok?v(null):x((L==null?void 0:L.error)||"Delete failed")};return t.jsxs("section",{className:"m-roadmap","data-testid":"mobile-tab-roadmap",children:[t.jsx(bt,{statuses:y,onToggleStatus:S,group:f,groupOptions:j,onChangeGroup:p,keyword:g,onChangeKeyword:N}),s?t.jsx("div",{className:"m-roadmap-error","data-testid":"mobile-roadmap-error",children:s}):null,n?t.jsx("div",{className:"m-roadmap-skeleton","data-testid":"mobile-roadmap-loading",children:Array.from({length:4}).map((O,L)=>t.jsx("div",{className:"m-skel-card"},L))}):h.length===0?t.jsx("div",{className:"m-roadmap-empty","data-testid":"mobile-roadmap-empty",children:e.length===0?"No roadmap items yet.":"No items match the current filters."}):t.jsx("ul",{className:"m-roadmap-list","data-testid":"mobile-roadmap-list",children:h.map(O=>t.jsx("li",{children:t.jsx(xt,{item:O,onSelect:L=>v(L.id)})},O.id))}),b?t.jsx(vt,{item:b,onClose:()=>v(null),onSave:A,onDelete:I,allItems:e,addConnection:o,removeConnection:c,fetchItemDetail:u}):null,t.jsx(St,{open:E,onClose:()=>w(!1),onCreate:D,groupOptions:j}),t.jsx("button",{type:"button",className:"m-fab","data-testid":"mobile-roadmap-fab","aria-label":"Create new roadmap item",onClick:()=>w(!0),children:"+"}),t.jsx($e,{message:T,onDismiss:()=>x(null)})]})}const Z="—";async function ne(e,n={}){const s=await J(e,n);let a=null;try{a=await s.json()}catch{}if(!s.ok){const i=a&&a.error||`HTTP ${s.status}`;throw new Error(i)}return a}function Et(){const[e,n]=r.useState([]),[s,a]=r.useState([]),[i,d]=r.useState(!0),[o,c]=r.useState(null),[u,y]=r.useState([]),m=r.useRef(e);m.current=e;const f=r.useCallback((w,T)=>{const x=`t_${Date.now()}_${Math.random().toString(36).slice(2,6)}`;y(j=>[...j,{id:x,kind:w,message:T}]),setTimeout(()=>{y(j=>j.filter(h=>h.id!==x))},3500)},[]),p=r.useCallback(w=>{y(T=>T.filter(x=>x.id!==w))},[]),g=r.useCallback(async()=>{try{const w=await ne("/api/ideabox");n(Array.isArray(w==null?void 0:w.ideas)?w.ideas:[]),a(Array.isArray(w==null?void 0:w.killed)?w.killed:[]),c(null)}catch(w){c(w.message),f("error",`Failed to load ideas: ${w.message}`)}finally{d(!1)}},[f]);r.useEffect(()=>{let w=!0;return(async()=>w&&await g())(),()=>{w=!1}},[g]),r.useEffect(()=>{if(typeof window>"u"||typeof WebSocket>"u")return;let w=null,T=!1,x=null;function j(){if(!T){try{const b=window.location.protocol==="https:"?"wss:":"ws:";w=new WebSocket(`${b}//${window.location.host}/ws/vision`)}catch{h();return}w.onmessage=b=>{try{const S=JSON.parse(b.data);S&&S.type==="ideaboxUpdated"&&g()}catch{}},w.onclose=()=>{T||h()},w.onerror=()=>{try{w.close()}catch{}}}}function h(){x&&clearTimeout(x),x=setTimeout(j,3e3)}return j(),()=>{T=!0,x&&clearTimeout(x);try{w&&(w.onclose=null,w.close())}catch{}}},[g]);const N=r.useCallback(async({title:w,description:T,source:x,tags:j,cluster:h})=>{if(!w||!w.trim()){const A=new Error("title is required");throw f("error",A.message),A}const b=`tmp_${Date.now()}`,S={id:b,num:0,title:w.trim(),description:T||"",source:x||"",tags:Array.isArray(j)?j:[],cluster:h||null,status:"NEW",priority:Z,_pending:!0};n(A=>[S,...A]);try{const A=await ne("/api/ideabox/ideas",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:w.trim(),description:T,source:x,tags:j,cluster:h})});return n(D=>D.map(I=>I.id===b?{...A}:I)),f("ok","Idea captured"),A}catch(A){throw n(D=>D.filter(I=>I.id!==b)),f("error",`Capture failed: ${A.message}`),A}},[f]),C=r.useCallback(async(w,{featureCode:T}={})=>{const x=m.current;n(j=>j.map(h=>h.id===w?{...h,_promoting:!0}:h));try{const j=await ne(`/api/ideabox/ideas/${encodeURIComponent(w)}/promote`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({featureCode:T||""})});return f("ok",`Promoted${j!=null&&j.featureCode?` → ${j.featureCode}`:""}`),g(),j}catch(j){throw n(x),f("error",`Promote failed: ${j.message}`),j}},[f,g]),v=r.useCallback(async(w,{reason:T}={})=>{const x=m.current,j=x.find(h=>h.id===w);n(h=>h.filter(b=>b.id!==w)),j&&a(h=>[{...j,status:"KILLED",reason:T||""},...h]);try{const h=await ne(`/api/ideabox/ideas/${encodeURIComponent(w)}/kill`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:T||""})});return f("ok","Idea killed"),g(),h}catch(h){throw n(x),a(b=>b.filter(S=>S.id!==w||S.status!=="KILLED")),f("error",`Kill failed: ${h.message}`),h}},[f,g]),E=r.useCallback(async(w,T)=>{if(!["P0","P1","P2",Z].includes(T)){const h=new Error(`Invalid priority: ${T}`);throw f("error",h.message),h}const j=m.current;n(h=>h.map(b=>b.id===w?{...b,priority:T}:b));try{const h=await ne(`/api/ideabox/ideas/${encodeURIComponent(w)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:T})});return f("ok",`Priority → ${T===Z?"Untriaged":T}`),h}catch(h){throw n(j),f("error",`Set priority failed: ${h.message}`),h}},[f]);return{ideas:e,killed:s,loading:i,error:o,toasts:u,dismissToast:p,refetch:g,createIdea:N,promote:C,kill:v,setPriority:E}}function Rt(e,n={}){const{onSwipeLeft:s,onSwipeRight:a,onDrag:i,onDragEnd:d,threshold:o=80,axis:c="x"}=n,u=r.useRef({onSwipeLeft:s,onSwipeRight:a,onDrag:i,onDragEnd:d});u.current={onSwipeLeft:s,onSwipeRight:a,onDrag:i,onDragEnd:d},r.useEffect(()=>{const y=e&&e.current;if(!y)return;let m=0,f=0,p=null,g=!1,N=0;function C(w){if(!(w.button!==void 0&&w.button!==0)){p=w.pointerId,m=w.clientX,f=w.clientY,g=!0,N=0;try{y.setPointerCapture(w.pointerId)}catch{}}}function v(w){var j,h,b,S;if(!g||w.pointerId!==p)return;const T=w.clientX-m,x=w.clientY-f;if(c==="x"&&Math.abs(x)>Math.abs(T)&&Math.abs(x)>12){g=!1,(h=(j=u.current).onDragEnd)==null||h.call(j,0,!1);return}N=T,(S=(b=u.current).onDrag)==null||S.call(b,T)}function E(w){var j,h,b,S,A,D;if(!g||w&&w.pointerId!==p)return;const T=N;g=!1;try{y.releasePointerCapture(p)}catch{}p=null;let x=!1;T<=-o?((h=(j=u.current).onSwipeLeft)==null||h.call(j),x=!0):T>=o&&((S=(b=u.current).onSwipeRight)==null||S.call(b),x=!0),(D=(A=u.current).onDragEnd)==null||D.call(A,T,x)}return y.addEventListener("pointerdown",C),y.addEventListener("pointermove",v),y.addEventListener("pointerup",E),y.addEventListener("pointercancel",E),()=>{y.removeEventListener("pointerdown",C),y.removeEventListener("pointermove",v),y.removeEventListener("pointerup",E),y.removeEventListener("pointercancel",E)}},[e,o,c])}function At(e){return e==="P0"||e==="P1"||e==="P2"?e.toLowerCase():"untriaged"}function $t(e){return e==="P0"||e==="P1"||e==="P2"?e:"Untriaged"}function _t({idea:e,onTap:n,onSwipeLeft:s,onSwipeRight:a}){const i=r.useRef(null),[d,o]=r.useState(0),[c,u]=r.useState(null),y=r.useCallback(g=>{o(g),g<=-40?u("kill"):g>=40?u("promote"):u(null)},[]),m=r.useCallback(()=>{o(0),u(null)},[]);Rt(i,{onSwipeLeft:()=>s==null?void 0:s(e),onSwipeRight:()=>a==null?void 0:a(e),onDrag:y,onDragEnd:m,threshold:80});const f=At(e.priority),p=Array.isArray(e.tags)?e.tags:[];return t.jsxs("div",{className:"m-idea-row","data-testid":`idea-row-${e.id}`,children:[t.jsx("div",{className:"m-idea-action m-idea-action-left","aria-hidden":"true",children:"Promote"}),t.jsx("div",{className:"m-idea-action m-idea-action-right","aria-hidden":"true",children:"Kill"}),t.jsxs("article",{ref:i,className:`m-idea-card${c?` is-intent-${c}`:""}`,"data-testid":"idea-card","data-idea-id":e.id,"data-priority":f,style:{transform:`translateX(${d}px)`},role:"button",tabIndex:0,onClick:()=>{Math.abs(d)<4&&(n==null||n(e))},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),n==null||n(e))},children:[t.jsxs("div",{className:"m-idea-head",children:[t.jsx("span",{className:"m-priority-badge","data-priority":f,"data-testid":`priority-badge-${e.id}`,children:$t(e.priority)}),e.cluster?t.jsx("span",{className:"m-idea-cluster",title:e.cluster,children:e.cluster}):null]}),t.jsx("h3",{className:"m-idea-title","data-testid":`idea-title-${e.id}`,children:e.title}),p.length>0?t.jsx("div",{className:"m-idea-tags",children:p.map(g=>t.jsx("span",{className:"m-idea-tag",children:g},g))}):null]})]})}function It({open:e,onClose:n,onSubmit:s,existingClusters:a=[]}){const[i,d]=r.useState(""),[o,c]=r.useState(""),[u,y]=r.useState(""),[m,f]=r.useState([]),[p,g]=r.useState(""),[N,C]=r.useState(!1),[v,E]=r.useState(null),w=r.useId(),T=r.useMemo(()=>{const S=new Set;for(const A of a)A&&typeof A=="string"&&S.add(A);return[...S].sort()},[a]);if(!e)return null;function x(){d(""),c(""),y(""),f([]),g(""),E(null),C(!1)}function j(){x(),n==null||n()}function h(){const S=u.trim();S&&(m.includes(S)||f([...m,S]),y(""))}async function b(S){if(S.preventDefault(),!i.trim()){E("Title is required");return}C(!0),E(null);try{await(s==null?void 0:s({title:i.trim(),description:o.trim()||void 0,tags:m.length?m:void 0,cluster:p.trim()||void 0})),j()}catch(A){E(A.message||"Failed to capture"),C(!1)}}return t.jsx("div",{className:"m-sheet-overlay","data-testid":"capture-sheet",role:"dialog","aria-modal":"true","aria-label":"Capture idea",onClick:S=>{S.target===S.currentTarget&&j()},children:t.jsxs("div",{className:"m-sheet",children:[t.jsxs("header",{className:"m-sheet-header",children:[t.jsx("button",{type:"button",className:"m-sheet-close","aria-label":"Close capture",onClick:j,disabled:N,children:"×"}),t.jsx("div",{className:"m-sheet-title-row",children:t.jsx("div",{className:"m-sheet-title",children:"Capture idea"})})]}),t.jsxs("form",{className:"m-sheet-body",onSubmit:b,children:[t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-capture-title",children:"Title"}),t.jsx("input",{id:"m-capture-title",type:"text",className:"m-sheet-input",value:i,onChange:S=>d(S.target.value),placeholder:"What's the idea?","data-testid":"capture-title",autoFocus:!0,required:!0})]}),t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-capture-desc",children:"Description (optional)"}),t.jsx("textarea",{id:"m-capture-desc",className:"m-sheet-input m-textarea",value:o,onChange:S=>c(S.target.value),rows:4,"data-testid":"capture-description"})]}),t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-capture-tag",children:"Tags (optional)"}),t.jsxs("div",{className:"m-tag-input-row",children:[t.jsx("input",{id:"m-capture-tag",type:"text",className:"m-sheet-input",value:u,onChange:S=>y(S.target.value),onKeyDown:S=>{(S.key==="Enter"||S.key===",")&&(S.preventDefault(),h())},placeholder:"Add tag and press Enter","data-testid":"capture-tag-input"}),t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-secondary m-tag-add",onClick:h,children:"Add"})]}),m.length>0?t.jsx("div",{className:"m-idea-tags","data-testid":"capture-tags",children:m.map(S=>t.jsxs("span",{className:"m-idea-tag",children:[S,t.jsx("button",{type:"button",className:"m-tag-remove","aria-label":`Remove tag ${S}`,onClick:()=>f(m.filter(A=>A!==S)),children:"×"})]},S))}):null]}),t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-capture-cluster",children:"Cluster (optional)"}),t.jsx("input",{id:"m-capture-cluster",type:"text",className:"m-sheet-input",value:p,onChange:S=>g(S.target.value),list:w,placeholder:"Group into a theme","data-testid":"capture-cluster"}),t.jsx("datalist",{id:w,children:T.map(S=>t.jsx("option",{value:S},S))})]}),v?t.jsx("div",{className:"m-form-error",role:"alert",children:v}):null]}),t.jsxs("footer",{className:"m-sheet-footer",children:[t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-secondary",onClick:j,disabled:N,"data-testid":"capture-cancel",children:"Cancel"}),t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-primary",disabled:N||!i.trim(),"data-testid":"capture-submit",onClick:b,children:N?"Saving…":"Capture"})]})]})})}const Pt=[{value:"P0",label:"P0"},{value:"P1",label:"P1"},{value:"P2",label:"P2"},{value:Z,label:"Untriaged"}];function Lt({value:e,onChange:n,disabled:s=!1}){return t.jsx("div",{className:"m-priority-selector",role:"radiogroup","aria-label":"Priority",children:Pt.map(a=>{const i=e===a.value,d=`m-priority-chip${i?" is-selected":""}`;return t.jsx("button",{type:"button",role:"radio","aria-checked":i?"true":"false",className:d,"data-priority":a.value===Z?"untriaged":a.value.toLowerCase(),"data-testid":`priority-chip-${a.value===Z?"untriaged":a.value.toLowerCase()}`,disabled:s,onClick:()=>n(a.value),children:a.label},a.value)})})}function Ot({idea:e,open:n,onClose:s,onPromote:a,onKill:i,onSetPriority:d}){const[o,c]=r.useState(!1);if(!n||!e)return null;const u=Array.isArray(e.tags)?e.tags:[],y=e.priority||Z;async function m(f,p=!0){c(!0);try{await f(),p&&(s==null||s())}catch{}finally{c(!1)}}return t.jsx("div",{className:"m-sheet-overlay","data-testid":"idea-detail-sheet",role:"dialog","aria-modal":"true","aria-label":`Idea ${e.id}`,onClick:f=>{f.target===f.currentTarget&&(s==null||s())},children:t.jsxs("div",{className:"m-sheet",children:[t.jsxs("header",{className:"m-sheet-header",children:[t.jsx("button",{type:"button",className:"m-sheet-close","aria-label":"Close detail",onClick:s,disabled:o,children:"×"}),t.jsx("div",{className:"m-sheet-title-row",children:t.jsx("div",{className:"m-sheet-title",children:e.title})}),t.jsxs("div",{className:"m-detail-meta",children:[t.jsx("span",{className:"m-detail-meta-id",children:e.id}),t.jsx("span",{className:"m-detail-meta-status",children:e.status||"NEW"}),e.cluster?t.jsx("span",{className:"m-detail-meta-cluster",children:e.cluster}):null]})]}),t.jsxs("div",{className:"m-sheet-body",children:[e.description?t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("div",{className:"m-sheet-label",children:"Description"}),t.jsx("p",{className:"m-sheet-desc",children:e.description})]}):null,e.source?t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("div",{className:"m-sheet-label",children:"Source"}),t.jsx("p",{className:"m-sheet-desc",children:e.source})]}):null,u.length>0?t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("div",{className:"m-sheet-label",children:"Tags"}),t.jsx("div",{className:"m-idea-tags",children:u.map(f=>t.jsx("span",{className:"m-idea-tag",children:f},f))})]}):null,t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("div",{className:"m-sheet-label",children:"Priority"}),t.jsx(Lt,{value:y,disabled:o,onChange:f=>m(()=>d==null?void 0:d(e.id,f),!1)})]})]}),t.jsxs("footer",{className:"m-sheet-footer",children:[t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-secondary","data-testid":"detail-kill",disabled:o,onClick:()=>m(()=>i==null?void 0:i(e.id)),children:"Kill"}),t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-primary","data-testid":"detail-promote",disabled:o,onClick:()=>m(()=>a==null?void 0:a(e.id)),children:"Promote"})]})]})})}const Dt=[{id:"all",label:"All"},{id:"P0",label:"P0"},{id:"P1",label:"P1"},{id:"P2",label:"P2"},{id:"untriaged",label:"Untriaged"}],je={P0:3,P1:2,P2:1};function Mt(e){return[...e].sort((n,s)=>{const a=je[n.priority]||0,i=je[s.priority]||0;if(a!==i)return i-a;const d=typeof n.num=="number"?n.num:0;return(typeof s.num=="number"?s.num:0)-d})}function Gt(){const{ideas:e,loading:n,toasts:s,dismissToast:a,createIdea:i,promote:d,kill:o,setPriority:c}=Et(),[u,y]=r.useState("all"),[m,f]=r.useState(!1),[p,g]=r.useState(null),N=r.useMemo(()=>{let v=e;return u==="untriaged"?v=v.filter(E=>!E.priority||E.priority===Z||E.priority===""):u!=="all"&&(v=v.filter(E=>E.priority===u)),Mt(v)},[e,u]),C=r.useMemo(()=>{const v=new Set;for(const E of e)E.cluster&&v.add(E.cluster);return[...v]},[e]);return t.jsxs("section",{className:"m-ideas-tab","data-testid":"mobile-tab-ideas",children:[t.jsxs("div",{className:"m-ideas-toolbar",children:[t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-primary m-capture-btn",onClick:()=>f(!0),"data-testid":"open-capture","aria-label":"Capture new idea",children:"+ Capture"}),t.jsx("div",{className:"m-filter-chips",role:"tablist","aria-label":"Priority filter",children:Dt.map(v=>t.jsx("button",{type:"button",role:"tab","aria-pressed":u===v.id?"true":"false","aria-selected":u===v.id?"true":"false",className:"m-filter-chip",onClick:()=>y(v.id),"data-testid":`filter-${v.id}`,children:v.label},v.id))})]}),n?t.jsx("div",{className:"m-ideas-list","data-testid":"ideas-loading",children:[0,1,2].map(v=>t.jsx("div",{className:"m-idea-skeleton","aria-hidden":"true"},v))}):N.length===0?t.jsxs("div",{className:"m-empty-state","data-testid":"ideas-empty",children:[t.jsx("div",{className:"m-empty-title",children:e.length===0?"No ideas yet":"Nothing matches this filter"}),t.jsx("div",{className:"m-empty-body",children:e.length===0?"Tap Capture to add your first idea.":"Try All to see everything."})]}):t.jsx("div",{className:"m-ideas-list","data-testid":"ideas-list",children:N.map(v=>t.jsx(_t,{idea:v,onTap:E=>g(E),onSwipeLeft:E=>o(E.id),onSwipeRight:E=>d(E.id)},v.id))}),t.jsx(It,{open:m,onClose:()=>f(!1),onSubmit:i,existingClusters:C}),t.jsx(Ot,{idea:p,open:!!p,onClose:()=>g(null),onPromote:v=>d(v),onKill:v=>o(v),onSetPriority:(v,E)=>c(v,E)}),t.jsx("div",{className:"m-toast-stack","aria-live":"polite","data-testid":"toasts",children:s.map(v=>t.jsx("div",{className:"m-toast","data-kind":v.kind==="error"?"error":"ok",role:v.kind==="error"?"alert":"status",onClick:()=>a(v.id),children:v.message},v.id))})]})}function Ft(e){if(!e)return"";const n=typeof e=="string"?Date.parse(e):Number(e);if(!n||Number.isNaN(n))return"";const s=Date.now()-n;return s<5e3?"just now":s<6e4?`${Math.floor(s/1e3)}s ago`:s<36e5?`${Math.floor(s/6e4)}m ago`:`${Math.floor(s/36e5)}h ago`}function Ut(e,n=3){return e?Array.isArray(e.logTail)?e.logTail.slice(-n):Array.isArray(e.recentLogs)?e.recentLogs.slice(-n):Array.isArray(e.steps)?e.steps.slice(-n).map(s=>`${s.id||s.name||""}: ${s.status||""}`.trim()):[]:[]}function Ht({active:e,onOpen:n,onAbort:s,aborting:a}){const[i,d]=r.useState(null),o=(e==null?void 0:e.featureCode)||"(unknown)",c=(e==null?void 0:e.mode)||"feature",u=(e==null?void 0:e.status)||"unknown",y=(e==null?void 0:e.startedAt)||(e==null?void 0:e.started_at)||null,m=Ut(e),f=r.useCallback(async g=>{if(g==null||g.stopPropagation(),!!(e!=null&&e.featureCode)){d(null);try{await(s==null?void 0:s({featureCode:e.featureCode}))}catch(N){d(N.message||"Failed to abort")}}},[e,s]),p=r.useCallback(()=>n==null?void 0:n(e),[n,e]);return t.jsxs("div",{className:"m-build-card","data-testid":"mobile-build-card","data-feature":o,role:"button",tabIndex:0,onClick:p,onKeyDown:g=>{g.key==="Enter"&&p()},children:[t.jsxs("div",{className:"m-build-card-row",children:[t.jsx("div",{className:"m-build-card-feature",title:o,children:o}),t.jsx("span",{className:"m-status-pill","data-status":u,children:u})]}),t.jsxs("div",{className:"m-build-card-meta",children:[t.jsx("span",{className:"m-build-card-mode","data-mode":c,children:c}),t.jsx("span",{className:"m-build-card-time",children:Ft(y)})]}),m.length>0&&t.jsx("div",{className:"m-build-card-tail",children:m.map((g,N)=>t.jsx("div",{className:"m-build-card-tail-line",children:String(g).slice(0,200)},N))}),t.jsx("div",{className:"m-build-card-actions",children:t.jsx("button",{type:"button",className:"m-btn m-btn-danger m-btn-sm","data-testid":"mobile-build-abort",disabled:a||ae(u),onClick:f,children:a?"Aborting…":"Abort"})}),i&&t.jsx("div",{className:"m-agent-card-error",children:i})]})}const Bt={design:"Design",blueprint:"Blueprint",implementation:"Implementation",ship:"Ship"},Jt=["design","blueprint","implementation","ship"];function qt(e){return e==="active"?"◉":e==="done"||e==="complete"||e==="completed"?"●":e==="failed"||e==="error"?"✕":"○"}function Ne(e){return e==="done"||e==="complete"||e==="completed"}function Yt(e){return e==="failed"||e==="error"}function Wt(e){return e||null}function Kt(e){const n=[];let s=0;for(;s<e.length;){const a=e[s];if(!Ne(a.status)){n.push({type:"step",step:a}),s++;continue}let i=s;for(;i<e.length&&Ne(e[i].status);)i++;const d=i-s;if(d>=3)n.push({type:"collapsed",steps:e.slice(s,i),count:d});else for(let o=s;o<i;o++)n.push({type:"step",step:e[o]});s=i}return n}function _e({step:e}){const n=qt(e.status),s=Yt(e.status),a=e.status==="active";return t.jsxs("div",{className:["m-step-row",a?"m-step-row--active":"",s?"m-step-row--failed":""].filter(Boolean).join(" "),"data-testid":`mobile-build-step-${e.id}`,"data-status":e.status||"pending",children:[t.jsx("span",{className:`m-step-glyph${a?" m-step-glyph--pulse":""}`,"aria-hidden":"true",children:n}),t.jsx("span",{className:"m-step-name",children:e.name||e.id}),Wt(e.agent)&&t.jsx("span",{className:"m-step-agent-chip",children:e.agent}),s&&e.summary&&t.jsx("div",{className:"m-step-summary",children:e.summary})]})}function zt({segment:e,expandedKey:n,onToggle:s}){const a=n===e.steps[0].id;return t.jsx("div",{className:"m-step-collapsed-row","data-testid":"mobile-build-steps-collapsed",role:"button",tabIndex:0,"aria-expanded":a,onClick:()=>s(e.steps[0].id),onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&s(e.steps[0].id)},children:a?e.steps.map(i=>t.jsx(_e,{step:i},i.id)):t.jsxs("span",{className:"m-step-collapsed-label",children:[e.count," done ✓"]})})}function Xt({active:e}){const[n,s]=r.useState(null),a=Ye(Je,(e==null?void 0:e.steps)??null,(e==null?void 0:e.currentStepId)??null),i={};for(const c of a){const u=c.phase||"implementation";i[u]||(i[u]=[]),i[u].push(c)}const d=Jt.filter(c=>{var u;return((u=i[c])==null?void 0:u.length)>0});function o(c){s(u=>u===c?null:c)}return t.jsx("div",{className:"m-build-steps-list","data-testid":"mobile-build-steps",children:d.map(c=>{const u=i[c],y=Kt(u);return t.jsxs("div",{className:"m-build-steps-phase",children:[t.jsx("div",{className:"m-build-steps-phase-header",children:Bt[c]||c}),t.jsx("div",{className:"m-build-steps-phase-rows",children:y.map((m,f)=>m.type==="collapsed"?t.jsx(zt,{segment:m,expandedKey:n,onToggle:o},`collapsed-${f}`):t.jsx(_e,{step:m.step},m.step.id))})]},c)})})}function Vt(e,n){if(typeof e=="string")return e;if(e!=null&&e.type&&(e!=null&&e.message))return`[${e.type}] ${typeof e.message=="string"?e.message:JSON.stringify(e.message)}`;if(e!=null&&e.type)return`[${e.type}] ${JSON.stringify(e).slice(0,240)}`;try{return JSON.stringify(e)}catch{return`(unserializable #${n})`}}function Qt({active:e,onClose:n,onAbort:s}){const a=e==null?void 0:e.featureCode,{events:i}=Re({agentId:(e==null?void 0:e.flowId)||null}),d=r.useRef(null),[o,c]=r.useState(!1),[u,y]=r.useState(null),[m,f]=r.useState("steps");r.useEffect(()=>{var C;(C=d.current)==null||C.scrollIntoView({behavior:"smooth"})},[i.length]);const p=r.useCallback(async()=>{if(a){c(!0),y(null);try{await(s==null?void 0:s({featureCode:a}))}catch(C){y(C.message||"Failed to abort")}finally{c(!1)}}},[a,s]);if(!e)return null;const g=e.status||"unknown",N=e.mode||"feature";return t.jsxs("div",{className:"m-overlay","data-testid":"mobile-build-detail",role:"dialog","aria-modal":"true",children:[t.jsxs("header",{className:"m-overlay-header",children:[t.jsxs("div",{className:"m-overlay-header-inner",children:[t.jsx("div",{className:"m-overlay-title",title:a,children:a}),t.jsx("span",{className:"m-status-pill","data-status":g,children:g}),t.jsx("span",{className:"m-build-card-mode","data-mode":N,children:N})]}),t.jsxs("div",{className:"m-overlay-actions",children:[t.jsx("button",{type:"button",className:"m-btn m-btn-danger m-btn-sm",disabled:o||ae(g),onClick:p,"data-testid":"mobile-build-detail-abort",children:o?"Aborting…":"Abort"}),t.jsx("button",{type:"button",className:"m-btn m-btn-sm",onClick:n,"data-testid":"mobile-build-detail-close",children:"Close"})]})]}),t.jsxs("div",{className:"m-build-detail-tabs",children:[t.jsx("button",{type:"button",className:`m-build-detail-tab${m==="steps"?" is-active":""}`,"data-testid":"mobile-build-detail-tab-steps","aria-pressed":m==="steps",onClick:()=>f("steps"),children:"Steps"}),t.jsx("button",{type:"button",className:`m-build-detail-tab${m==="log"?" is-active":""}`,"data-testid":"mobile-build-detail-tab-log","aria-pressed":m==="log",onClick:()=>f("log"),children:"Log"})]}),m==="steps"?t.jsx("div",{className:"m-overlay-body",children:t.jsx(Xt,{active:e})}):t.jsxs("div",{className:"m-overlay-body m-agent-log",children:[i.length===0?t.jsx("div",{className:"m-empty",children:"No live events yet."}):i.map((C,v)=>t.jsx("div",{className:"m-agent-log-line",children:Vt(C,v)},v)),t.jsx("div",{ref:d})]}),u&&t.jsx("div",{className:"m-agent-card-error",children:u})]})}function Zt(e){if(!e)return"";const n=typeof e=="string"?Date.parse(e):Number(e);if(!n||Number.isNaN(n))return"";const s=Date.now()-n;return s<5e3?"just now":s<6e4?`${Math.floor(s/1e3)}s ago`:s<36e5?`${Math.floor(s/6e4)}m ago`:s<864e5?`${Math.floor(s/36e5)}h ago`:`${Math.floor(s/864e5)}d ago`}function es(e){if(!e||typeof e!="number")return"—";if(e<1e3)return`${e}ms`;if(e<6e4)return`${Math.floor(e/1e3)}s`;if(e<36e5){const a=Math.floor(e/6e4),i=Math.floor(e%6e4/1e3);return i>0?`${a}m ${i}s`:`${a}m`}const n=Math.floor(e/36e5),s=Math.floor(e%36e5/6e4);return s>0?`${n}h ${s}m`:`${n}h`}const ve=80;function ts(e){if(!e)return"";const n=e.toLowerCase();return n==="complete"||n==="completed"?"ok":n==="failed"||n==="error"?"error":n==="aborted"||n==="killed"?"warn":""}function ss({build:e,index:n}){const[s,a]=r.useState(!1),i=Zt(e.completedAt),d=e.failureReason?e.failureReason.slice(0,ve)+(e.failureReason.length>ve?"…":""):null,o=ts(e.status);return t.jsxs("div",{className:`m-build-history-row${s?" is-expanded":""}`,"data-testid":`mobile-build-history-${n}`,"data-status":e.status||"unknown",role:"button",tabIndex:0,"aria-expanded":s,onClick:()=>a(c=>!c),onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&a(u=>!u)},children:[t.jsxs("div",{className:"m-build-history-summary",children:[t.jsx("span",{className:"m-build-history-code",children:e.featureCode||"(unknown)"}),t.jsx("span",{className:`m-status-pill${o?" m-status-pill--"+o:""}`,"data-status":e.status,children:e.status||"unknown"}),i&&t.jsx("span",{className:"m-build-history-rel",children:i}),!s&&d&&t.jsx("span",{className:"m-build-history-reason-trunc",children:d})]}),s&&t.jsxs("div",{className:"m-build-history-detail",children:[e.mode!=null&&t.jsxs("div",{className:"m-build-history-field",children:[t.jsx("span",{className:"m-build-history-field-label",children:"Mode"}),t.jsx("span",{className:"m-build-history-field-value",children:e.mode})]}),e.durationMs!=null&&t.jsxs("div",{className:"m-build-history-field",children:[t.jsx("span",{className:"m-build-history-field-label",children:"Duration"}),t.jsx("span",{className:"m-build-history-field-value",children:es(e.durationMs)})]}),e.stepCount!=null&&t.jsxs("div",{className:"m-build-history-field",children:[t.jsx("span",{className:"m-build-history-field-label",children:"Steps"}),t.jsx("span",{className:"m-build-history-field-value",children:e.stepCount})]}),e.failureReason&&t.jsxs("div",{className:"m-build-history-field m-build-history-field--block",children:[t.jsx("span",{className:"m-build-history-field-label",children:"Failure reason"}),t.jsx("span",{className:"m-build-history-field-value m-build-history-failure",children:e.failureReason})]}),e.startedAt&&t.jsxs("div",{className:"m-build-history-field",children:[t.jsx("span",{className:"m-build-history-field-label",children:"Started"}),t.jsx("span",{className:"m-build-history-field-value",children:new Date(e.startedAt).toLocaleString()})]}),e.completedAt&&t.jsxs("div",{className:"m-build-history-field",children:[t.jsx("span",{className:"m-build-history-field-label",children:"Completed"}),t.jsx("span",{className:"m-build-history-field-value",children:new Date(e.completedAt).toLocaleString()})]})]})]})}function ns({builds:e,loading:n,error:s}){return n?t.jsx("div",{className:"m-build-history","data-testid":"mobile-build-history",children:t.jsx("div",{className:"m-empty",children:"Loading history…"})}):s?t.jsx("div",{className:"m-build-history","data-testid":"mobile-build-history",children:t.jsxs("div",{className:"m-empty",children:["Error: ",s]})}):t.jsx("div",{className:"m-build-history","data-testid":"mobile-build-history",children:!e||e.length===0?t.jsx("div",{className:"m-empty",children:"No past builds."}):e.map((a,i)=>t.jsx(ss,{build:a,index:i},a.flowId||i))})}async function as(){var e;try{const n=await J("/api/vision/items");if(!n.ok)return[];const s=await n.json(),a=Array.isArray(s==null?void 0:s.items)?s.items:Array.isArray(s)?s:[],i=new Set;for(const d of a){const o=((e=d==null?void 0:d.lifecycle)==null?void 0:e.featureCode)||(d==null?void 0:d.featureCode)||(d==null?void 0:d.id);o&&typeof o=="string"&&i.add(o)}return[...i].sort()}catch{return[]}}function rs({open:e,onClose:n,onSubmit:s}){const[a,i]=r.useState(""),[d,o]=r.useState("feature"),[c,u]=r.useState(""),[y,m]=r.useState(!1),[f,p]=r.useState(null),[g,N]=r.useState([]),C=r.useId();r.useEffect(()=>{if(!e)return;let x=!0;return as().then(j=>{x&&N(j)}),()=>{x=!1}},[e]);const v=r.useMemo(()=>g,[g]);if(!e)return null;function E(){i(""),o("feature"),u(""),p(null),m(!1)}function w(){E(),n==null||n()}async function T(x){if(x==null||x.preventDefault(),!a.trim()){p("Feature code is required");return}m(!0),p(null);try{await(s==null?void 0:s({featureCode:a.trim(),mode:d,description:c.trim()})),w()}catch(j){p(j.message||"Failed to start build"),m(!1)}}return t.jsx("div",{className:"m-sheet-overlay","data-testid":"mobile-start-build-sheet",role:"dialog","aria-modal":"true","aria-label":"Start build",onClick:x=>{x.target===x.currentTarget&&w()},children:t.jsxs("div",{className:"m-sheet",children:[t.jsxs("header",{className:"m-sheet-header",children:[t.jsx("button",{type:"button",className:"m-sheet-close","aria-label":"Close start build",onClick:w,disabled:y,children:"×"}),t.jsx("div",{className:"m-sheet-title-row",children:t.jsx("div",{className:"m-sheet-title",children:"Start build"})})]}),t.jsxs("form",{className:"m-sheet-body",onSubmit:T,children:[t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-build-feature",children:"Feature code"}),t.jsx("input",{id:"m-build-feature",type:"text",className:"m-sheet-input",value:a,onChange:x=>i(x.target.value),placeholder:"e.g. COMP-MOBILE","data-testid":"mobile-build-feature-input",list:C,autoFocus:!0,required:!0}),t.jsx("datalist",{id:C,children:v.map(x=>t.jsx("option",{value:x},x))})]}),t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("div",{className:"m-sheet-label",children:"Mode"}),t.jsxs("div",{className:"m-build-mode-row",role:"radiogroup","aria-label":"Build mode",children:[t.jsx("button",{type:"button",role:"radio","aria-checked":d==="feature",className:`m-priority-chip${d==="feature"?" is-selected":""}`,"data-testid":"mobile-build-mode-feature",onClick:()=>o("feature"),children:"Feature"}),t.jsx("button",{type:"button",role:"radio","aria-checked":d==="bug",className:`m-priority-chip${d==="bug"?" is-selected":""}`,"data-testid":"mobile-build-mode-bug",onClick:()=>o("bug"),children:"Bug"})]})]}),t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-build-desc",children:"Description (optional)"}),t.jsx("textarea",{id:"m-build-desc",className:"m-sheet-input m-textarea",value:c,onChange:x=>u(x.target.value),rows:4,"data-testid":"mobile-build-description"})]}),f?t.jsx("div",{className:"m-form-error",role:"alert",children:f}):null]}),t.jsxs("footer",{className:"m-sheet-footer",children:[t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-secondary",onClick:w,disabled:y,"data-testid":"mobile-build-cancel",children:"Cancel"}),t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-primary",disabled:y||!a.trim(),"data-testid":"mobile-build-submit",onClick:T,children:y?"Starting…":"Start"})]})]})})}const Ie=4e3,we={info:{color:"hsl(var(--foreground))",bg:"hsl(var(--muted))"},warn:{color:"hsl(var(--warning, 32 95% 52%))",bg:"hsl(var(--muted))"},error:{color:"hsl(var(--destructive))",bg:"hsl(var(--destructive) / 0.08)"}};function vs(){const[e,n]=r.useState(null),s=r.useRef(null);if(r.useEffect(()=>{function i(d){const{message:o,level:c="info",ttl:u=Ie}=d.detail??{};o&&(clearTimeout(s.current),n({message:o,level:c}),u>0&&(s.current=setTimeout(()=>n(null),u)))}return window.addEventListener("compose:notify",i),()=>{window.removeEventListener("compose:notify",i),clearTimeout(s.current)}},[]),!e)return null;const a=we[e.level]??we.info;return t.jsxs("div",{className:"h-6 flex items-center justify-between px-3 gap-2 shrink-0 text-[11px] font-mono",style:{background:a.bg,color:a.color,borderTop:"1px solid hsl(var(--border))"},role:"status","aria-live":"polite",children:[t.jsx("span",{className:"flex-1 min-w-0 truncate",children:e.message}),t.jsx("button",{className:"shrink-0 opacity-60 hover:opacity-100 text-[10px]",onClick:()=>{clearTimeout(s.current),n(null)},"aria-label":"Dismiss notification",children:"✕"})]})}function ie(e,n="info",s=Ie){try{window.dispatchEvent(new CustomEvent("compose:notify",{detail:{message:e,level:n,ttl:s}}))}catch{}}async function Se(e,n={}){const s=await J(e,n);let a=null;try{a=await s.json()}catch{}if(!s.ok){const i=a&&a.error||`HTTP ${s.status}`;throw new Error(i)}return a}const is=new Set(["complete","completed"]);function ls({active:e,limit:n=20}={}){const[s,a]=r.useState([]),[i,d]=r.useState(!0),[o,c]=r.useState(null),u=r.useRef(new Map),y=r.useRef(new Map),m=r.useRef(!0),f=r.useRef(null),p=r.useCallback(C=>{a(C),c(null);for(const v of C){const E=v.flowId;if(!E)continue;const w=u.current.get(E);if(w&&is.has(w)&&v.status==="failed"&&y.current.get(E)!==v.status){y.current.set(E,v.status);try{ie(`Build failed post-checks: ${v.featureCode}`,"error",0)}catch{}}}},[]),g=r.useCallback(async({pendingFlowId:C}={})=>{try{const v=await Se(`/api/builds?limit=${n}`);if(!m.current)return;const E=Array.isArray(v==null?void 0:v.builds)?v.builds:[];p(E),C&&(E.some(T=>T.flowId===C)||(f.current&&clearTimeout(f.current),f.current=setTimeout(async()=>{if(m.current)try{const T=await Se(`/api/builds?limit=${n}`);if(!m.current)return;const x=Array.isArray(T==null?void 0:T.builds)?T.builds:[];p(x)}catch(T){m.current&&c(T.message)}},2500)))}catch(v){if(!m.current)return;c(v.message)}finally{m.current&&d(!1)}},[n,p]);r.useEffect(()=>(m.current=!0,g(),()=>{m.current=!1,f.current&&clearTimeout(f.current)}),[g]);const N=r.useRef(null);return r.useEffect(()=>{if(!e)return;N.current,N.current=e;const C=e.flowId;!C||!ae(e.status)||u.current.has(C)||(u.current.set(C,e.status),g({pendingFlowId:C}))},[e,g]),{builds:s,loading:i,error:o,refetch:g}}function os({active:e,loading:n,error:s,startBuild:a,abortBuild:i}){const[d,o]=r.useState(!1),[c,u]=r.useState(!1),[y,m]=r.useState(!1),[f,p]=r.useState(null),{builds:g,loading:N,error:C}=ls({active:e}),v=!!(e&&e.featureCode&&!ae(e.status)),E=r.useCallback(async({featureCode:T,mode:x,description:j})=>{try{await a({featureCode:T,mode:x,description:j}),p({kind:"ok",message:`Build started for ${T}`})}catch(h){const b=(h==null?void 0:h.status)===409?`A build for ${T} is already active`:(h==null?void 0:h.message)||"Failed to start build";throw p({kind:"error",message:b}),h}},[a]),w=r.useCallback(async({featureCode:T})=>{m(!0);try{await i({featureCode:T}),p({kind:"ok",message:`Aborted ${T}`}),u(!1)}catch(x){throw p({kind:"error",message:(x==null?void 0:x.message)||"Failed to abort"}),x}finally{m(!1)}},[i]);return t.jsxs("section",{"data-testid":"mobile-tab-builds",className:"m-builds-tab",children:[t.jsxs("div",{className:"m-section",children:[t.jsx("h2",{className:"m-section-title",children:"Current build"}),n?t.jsx("div",{className:"m-empty","data-testid":"mobile-build-loading",children:"Loading…"}):v?t.jsx(Ht,{active:e,onOpen:()=>u(!0),onAbort:w,aborting:y}):t.jsxs("div",{className:"m-empty-state","data-testid":"mobile-build-empty",children:[t.jsx("div",{className:"m-empty-title",children:"No active build"}),t.jsx("div",{className:"m-empty-body",children:e&&ae(e.status)?`Last build: ${e.featureCode} (${e.status})`:"Start a build to track progress here."}),t.jsx("button",{type:"button",className:"m-btn m-btn-primary","data-testid":"mobile-build-start",onClick:()=>o(!0),children:"Start build"})]}),s&&t.jsxs("div",{className:"m-empty","data-testid":"mobile-build-error",children:["Error: ",s]})]}),v&&t.jsx("div",{className:"m-section",children:t.jsx("button",{type:"button",className:"m-btn m-btn-sm","data-testid":"mobile-build-start-secondary",onClick:()=>o(!0),children:"Start another build"})}),t.jsxs("div",{className:"m-section","data-testid":"mobile-build-history-section",children:[t.jsx("h2",{className:"m-section-title",children:"History"}),t.jsx(ns,{builds:g,loading:N,error:C})]}),t.jsx(rs,{open:d,onClose:()=>o(!1),onSubmit:E}),c&&e&&t.jsx(Qt,{active:e,onClose:()=>u(!1),onAbort:w}),t.jsx($e,{message:f==null?void 0:f.message,kind:f==null?void 0:f.kind,onDismiss:()=>p(null)})]})}const cs=3;function us({onNavigate:e}){const[n,s]=r.useState([]),a=r.useRef(new Map),i=r.useRef(0),d=r.useCallback(c=>{clearTimeout(a.current.get(c)),a.current.delete(c),s(u=>u.filter(y=>y.id!==c))},[]);if(r.useEffect(()=>{function c(u){const{message:y,level:m="info",ttl:f}=u.detail??{};if(!y)return;const p=++i.current;s(N=>{const C=[...N,{id:p,message:y,level:m}];if(C.length>cs){const v=C.shift();clearTimeout(a.current.get(v.id)),a.current.delete(v.id)}return C});const g=typeof f=="number"&&f>0&&isFinite(f)?f:0;if(g>0){const N=setTimeout(()=>{s(C=>C.filter(v=>v.id!==p)),a.current.delete(p)},g);a.current.set(p,N)}}return window.addEventListener("compose:notify",c),()=>{window.removeEventListener("compose:notify",c);for(const u of a.current.values())clearTimeout(u);a.current.clear()}},[]),n.length===0)return null;function o(c){return c==="warn"?"agents":"builds"}return t.jsx("div",{className:"m-alert-bar","data-testid":"mobile-alert-bar","aria-live":"polite",children:n.map(c=>t.jsxs("div",{className:`m-alert m-alert-${c.level}`,"data-testid":`mobile-alert-${c.level}`,role:"status",onClick:()=>{e==null||e(o(c.level)),d(c.id)},children:[t.jsx("span",{className:"m-alert-msg",children:c.message}),t.jsx("button",{type:"button",className:"m-alert-dismiss","aria-label":"Dismiss",onClick:u=>{u.stopPropagation(),d(c.id)},children:"✕"})]},c.id))})}async function ke(e,n={}){const s=await J(e,n);let a=null;try{a=await s.json()}catch{}if(!s.ok){const i=a&&a.error||`HTTP ${s.status}`;throw new Error(i)}return a}function ds(){const[e,n]=r.useState([]),[s,a]=r.useState(!0),[i,d]=r.useState(null),o=r.useRef(!0),c=r.useCallback(async()=>{try{const y=await ke("/api/vision/gates");if(!o.current)return;n(Array.isArray(y==null?void 0:y.gates)?y.gates:[]),d(null)}catch(y){if(!o.current)return;d(y.message)}finally{o.current&&a(!1)}},[]);r.useEffect(()=>(o.current=!0,c(),()=>{o.current=!1}),[c]),r.useEffect(()=>{if(typeof window>"u"||typeof WebSocket>"u")return;let y=null,m=!1,f=null;function p(){if(!m){try{const N=window.location.protocol==="https:"?"wss:":"ws:";y=new WebSocket(`${N}//${window.location.host}/ws/vision`)}catch{g();return}y.onmessage=N=>{try{const C=JSON.parse(N.data);if(!C||!C.type)return;(C.type==="gateCreated"||C.type==="gateResolved"||C.type==="gateUpdated")&&c()}catch{}},y.onclose=()=>{m||g()},y.onerror=()=>{try{y.close()}catch{}}}}function g(){f&&clearTimeout(f),f=setTimeout(p,3e3)}return p(),()=>{m=!0,f&&clearTimeout(f);try{y&&(y.onclose=null,y.close())}catch{}}},[c]);const u=r.useCallback(async(y,{outcome:m,reason:f,summary:p}={})=>{if(!["approve","revise","kill"].includes(m))throw new Error(`outcome must be approve|revise|kill (got ${m})`);const g=[];f&&g.push(f),p&&g.push(p);const N=g.join(" — ")||void 0,C={outcome:m};N&&(C.comment=N);const v=await ke(`/api/vision/gates/${encodeURIComponent(y)}/resolve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(C)});return c(),v},[c]);return{gates:e,loading:s,error:i,refetch:c,resolve:u}}async function me(e,n={}){const s=await J(e,n);let a=null;try{a=await s.json()}catch{}if(!s.ok){const i=a&&a.error||`HTTP ${s.status}`,d=new Error(i);throw d.status=s.status,d.data=a,d}return a}function ms(){const[e,n]=r.useState(null),[s,a]=r.useState(!0),[i,d]=r.useState(null),o=r.useRef(!0),c=r.useCallback(async()=>{try{const m=await me("/api/build/state");if(!o.current)return;n((m==null?void 0:m.state)??null),d(null)}catch(m){if(!o.current)return;d(m.message)}finally{o.current&&a(!1)}},[]);r.useEffect(()=>(o.current=!0,c(),()=>{o.current=!1}),[c]),r.useEffect(()=>{if(typeof window>"u"||typeof WebSocket>"u")return;let m=null,f=!1,p=null;function g(){if(!f){try{const C=window.location.protocol==="https:"?"wss:":"ws:";m=new WebSocket(`${C}//${window.location.host}/ws/vision`)}catch{N();return}m.onmessage=C=>{try{const v=JSON.parse(C.data);if(!v||!v.type)return;v.type==="buildState"&&c()}catch{}},m.onclose=()=>{f||N()},m.onerror=()=>{try{m.close()}catch{}}}}function N(){p&&clearTimeout(p),p=setTimeout(g,3e3)}return g(),()=>{f=!0,p&&clearTimeout(p);try{m&&(m.onclose=null,m.close())}catch{}}},[c]);const u=r.useCallback(async({featureCode:m,mode:f="feature",description:p=""}={})=>{if(!m)throw new Error("featureCode required");const g=await me("/api/build/start",{method:"POST",headers:V({"Content-Type":"application/json"}),body:JSON.stringify({featureCode:m,mode:f,description:p})});return c(),g},[c]),y=r.useCallback(async({featureCode:m}={})=>{if(!m)throw new Error("featureCode required");const f=await me("/api/build/abort",{method:"POST",headers:V({"Content-Type":"application/json"}),body:JSON.stringify({featureCode:m})});return c(),f},[c]);return{active:e,loading:s,error:i,refetch:c,startBuild:u,abortBuild:y}}function fs({url:e,onMessage:n,onOpen:s,onClose:a,onError:i,maxBackoffMs:d=3e4}){let o=null,c=0,u=!1,y=null;function m(){if(!u){try{o=new WebSocket(e)}catch(p){i==null||i(p),f();return}o.onopen=()=>{c=0,s==null||s(o)},o.onmessage=p=>n==null?void 0:n(p),o.onclose=()=>{a==null||a(),f()},o.onerror=p=>{i==null||i(p)}}}function f(){if(u||y)return;const p=Math.min(d,1e3*Math.pow(2,c++));y=setTimeout(()=>{y=null,m()},p)}return m(),{get socket(){return o},isOpen(){return(o==null?void 0:o.readyState)===1},send(p){(o==null?void 0:o.readyState)===1&&o.send(p)},close(){if(u=!0,y&&(clearTimeout(y),y=null),o){try{o.onclose=null,o.onerror=null,o.close()}catch{}o=null}}}}function hs(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/vision`}function ps(){const[e,n]=r.useState([]),[s,a]=r.useState(!0),[i,d]=r.useState(null),[o,c]=r.useState(!1),u=r.useRef(e);u.current=e;const y=r.useRef(new Map),m=r.useRef(new Map),f=r.useRef(new Set),p=r.useRef(0),g=r.useCallback(async()=>{try{const j=await(await J("/api/vision/items")).json(),h=Array.isArray(j==null?void 0:j.items)?j.items:Array.isArray(j)?j:[];n(h),d(null)}catch(x){d((x==null?void 0:x.message)||"Failed to load items")}finally{a(!1)}},[]);r.useEffect(()=>{let x=!1;g();const j=fs({url:hs(),onOpen:()=>{x||c(!0)},onClose:()=>{x||c(!1)},onMessage:h=>{var A,D;if(x)return;let b;try{b=JSON.parse(h.data)}catch{return}if(!b||typeof b!="object")return;const S=b.type;(S==="visionState"||S==="hydrate")&&Array.isArray(b.items)?n(()=>{const I=y.current,O=m.current,L=f.current;let F=b.items;if(I.size>0&&(F=F.map(q=>{const Y=I.get(q.id);return Y?{...q,...Y}:q})),L.size>0&&(F=F.filter(q=>!L.has(q.id))),O.size>0){const q=new Set(F.map(z=>z.id)),Y=[...O.values()].filter(z=>!q.has(z.id));Y.length>0&&(F=[...Y,...F])}return F}):S==="itemUpdated"&&((A=b.item)!=null&&A.id)?n(I=>{const O=I.findIndex(F=>F.id===b.item.id);if(O===-1)return[...I,b.item];const L=I.slice();return L[O]={...L[O],...b.item},L}):S==="itemCreated"&&((D=b.item)!=null&&D.id)?n(I=>I.some(O=>O.id===b.item.id)?I:[...I,b.item]):S==="itemDeleted"&&b.id?n(I=>I.filter(O=>O.id!==b.id)):S==="state"&&Array.isArray(b.items)?n(b.items):(S==="visionUpdated"||S==="roadmapUpdated")&&g()}});return()=>{x=!0;try{j.close()}catch{}}},[g]);const N=r.useCallback(async(x,j)=>{if(!x||!j||typeof j!="object")return{ok:!1,error:"invalid patch"};const h=u.current;if(!h.find(A=>A.id===x))return{ok:!1,error:"item not found"};y.current.set(x,j);const S=h.map(A=>A.id===x?{...A,...j}:A);n(S);try{const A=await J(`/api/vision/items/${x}`,{method:"PATCH",headers:V({"Content-Type":"application/json"}),body:JSON.stringify(j)}),D=await A.json().catch(()=>({}));if(!A.ok)return y.current.delete(x),n(h),{ok:!1,error:(D==null?void 0:D.error)||`HTTP ${A.status}`};y.current.delete(x);const I=(D==null?void 0:D.item)||(D==null?void 0:D.updated)||null;return I&&I.id===x&&n(O=>O.map(L=>L.id===x?{...L,...I}:L)),{ok:!0,item:I||S.find(O=>O.id===x)}}catch(A){return y.current.delete(x),n(h),{ok:!1,error:(A==null?void 0:A.message)||"Network error"}}},[]),C=r.useCallback(async x=>{if(!x||typeof x!="object")return{ok:!1,error:"invalid fields"};const j=`tmp-${++p.current}`,h={...x,type:"feature",id:j};m.current.set(j,h),n(b=>[h,...b]);try{const b=await J("/api/vision/items",{method:"POST",headers:V({"Content-Type":"application/json"}),body:JSON.stringify({...x,type:"feature"})}),S=await b.json().catch(()=>({}));if(!b.ok)return m.current.delete(j),n(D=>D.filter(I=>I.id!==j)),{ok:!1,error:(S==null?void 0:S.error)||`HTTP ${b.status}`};const A=(S==null?void 0:S.item)||(S!=null&&S.id?S:null);return m.current.delete(j),n(D=>A&&D.some(I=>I.id===A.id)?D.filter(I=>I.id!==j):D.map(I=>I.id===j&&A?{...I,...A}:I)),{ok:!0,item:A}}catch(b){return m.current.delete(j),n(S=>S.filter(A=>A.id!==j)),{ok:!1,error:(b==null?void 0:b.message)||"Network error"}}},[]),v=r.useCallback(async x=>{if(!x)return{ok:!1,error:"id required"};const j=u.current;f.current.add(x),n(h=>h.filter(b=>b.id!==x));try{const h=await J(`/api/vision/items/${x}`,{method:"DELETE",headers:V({"Content-Type":"application/json"})}),b=await h.json().catch(()=>({}));return h.ok?(f.current.delete(x),{ok:!0}):(f.current.delete(x),n(j),{ok:!1,error:(b==null?void 0:b.error)||`HTTP ${h.status}`})}catch(h){return f.current.delete(x),n(j),{ok:!1,error:(h==null?void 0:h.message)||"Network error"}}},[]),E=r.useCallback(async({fromId:x,toId:j,type:h})=>{try{const b=await J("/api/vision/connections",{method:"POST",headers:V({"Content-Type":"application/json"}),body:JSON.stringify({fromId:x,toId:j,type:h})}),S=await b.json().catch(()=>({}));return b.ok?{ok:!0,connection:(S==null?void 0:S.connection)||S}:{ok:!1,error:(S==null?void 0:S.error)||`HTTP ${b.status}`}}catch(b){return{ok:!1,error:(b==null?void 0:b.message)||"Network error"}}},[]),w=r.useCallback(async x=>{try{const j=await J(`/api/vision/connections/${x}`,{method:"DELETE",headers:V({"Content-Type":"application/json"})}),h=await j.json().catch(()=>({}));return j.ok?{ok:!0}:{ok:!1,error:(h==null?void 0:h.error)||`HTTP ${j.status}`}}catch(j){return{ok:!1,error:(j==null?void 0:j.message)||"Network error"}}},[]),T=r.useCallback(async x=>{try{const j=await J(`/api/vision/items/${x}`),h=await j.json().catch(()=>({}));return j.ok?{ok:!0,item:h}:{ok:!1,error:(h==null?void 0:h.error)||`HTTP ${j.status}`}}catch(j){return{ok:!1,error:(j==null?void 0:j.message)||"Network error"}}},[]);return{items:e,loading:s,error:i,connected:o,refetch:g,applyOptimisticEdit:N,createItem:C,deleteItem:v,addConnection:E,removeConnection:w,fetchItemDetail:T}}function bs({active:e,gates:n,items:s}){const a=r.useRef(null),i=r.useRef(new Map);r.useEffect(()=>{if(Array.isArray(n)){if(a.current===null){a.current=new Set(n.map(d=>d.id));return}for(const d of n)if(!a.current.has(d.id)){a.current.add(d.id);const o=(Array.isArray(s)?s:[]).find(u=>u.id===d.itemId),c=(o==null?void 0:o.title)||"Gate pending";ie(`Gate pending: ${c}`,"warn",0)}}},[n,s]),r.useEffect(()=>{if(!e||!e.flowId)return;const d=i.current.get(e.flowId),o=e.status;d!==void 0&&d!==o&&(o==="failed"?ie(`Build failed: ${e.featureCode||e.flowId}`,"error",0):(o==="complete"||o==="completed")&&ie(`Build complete: ${e.featureCode||e.flowId}`,"info",4e3)),i.current.set(e.flowId,o)},[e])}const Pe=["agents","roadmap","builds","ideas"],Ce="agents",Te="compose:mobile:sensitiveToken";function ys(e){const n=e.match(/^\/m(?:\/([^/?#]+))?\/?$/);if(!n)return Ce;const s=n[1];return s&&Pe.includes(s)?s:Ce}function gs(){const[e,n]=r.useState(()=>ys(window.location.pathname));r.useEffect(()=>{try{const h=new URL(window.location.href),b=h.searchParams.get("token");if(b){try{localStorage.setItem(Te,b)}catch{}ge(b),h.searchParams.delete("token"),window.history.replaceState({},"",h.pathname+(h.search?h.search:"")+h.hash)}else{let S=null;try{S=localStorage.getItem(Te)}catch{}S&&ge(S)}}catch{}},[]),r.useEffect(()=>{if(!(typeof navigator>"u")&&"serviceWorker"in navigator)try{navigator.serviceWorker.register("/m-sw.js").catch(h=>{console.warn("[compose-mobile] SW registration failed:",h)})}catch(h){console.warn("[compose-mobile] SW registration threw:",h)}},[]);const s=r.useCallback(h=>{if(Pe.includes(h)){n(h);try{const b=new URL(window.location.href);b.pathname=`/m/${h}`,window.history.replaceState({},"",b.pathname+b.search+b.hash)}catch{}}},[]),{gates:a,loading:i,resolve:d}=ds(),{active:o,loading:c,error:u,startBuild:y,abortBuild:m}=ms(),{items:f,loading:p,error:g,applyOptimisticEdit:N,createItem:C,deleteItem:v,addConnection:E,removeConnection:w,fetchItemDetail:T}=ps();bs({active:o,gates:a,items:f});const x={};a.length>0&&(x.agents={count:a.length,level:"warn"}),(o==null?void 0:o.status)==="failed"?x.builds={level:"error"}:We(o,a,f)&&(x.builds={level:"warn"});let j=null;return e==="agents"?j=t.jsx(ht,{gates:a,gatesLoading:i,resolveGate:d}):e==="roadmap"?j=t.jsx(Tt,{items:f,loading:p,error:g,applyOptimisticEdit:N,createItem:C,deleteItem:v,addConnection:E,removeConnection:w,fetchItemDetail:T}):e==="ideas"?j=t.jsx(Gt,{}):e==="builds"&&(j=t.jsx(os,{active:o,loading:c,error:u,startBuild:y,abortBuild:m})),t.jsxs("div",{className:"m-root","data-testid":"mobile-root",children:[t.jsx("header",{className:"m-header",children:t.jsx("div",{className:"m-header-title",children:"Compose"})}),t.jsx(us,{onNavigate:s}),t.jsx("main",{className:"m-main","data-testid":"mobile-main","data-tab":e,children:j}),t.jsx(ze,{active:e,onSelect:s,badges:x})]})}const ws=Object.freeze(Object.defineProperty({__proto__:null,default:gs},Symbol.toStringTag,{value:"Module"}));export{ws as M,vs as N,Je as P,js as R,r as a,Ue as b,xs as c,rt as d,fs as e,V as f,Oe as g,re as h,t as j,Ye as m,ie as n,Fe as r,Ns as s,J as w};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.m-root{--m-bg: #0a0a0f;--m-surface: #14141c;--m-surface-2: #1c1c26;--m-border: #2a2a35;--m-text: #e6e6f0;--m-text-dim: #9090a0;--m-accent: #7c8cff;--m-danger: #ff6b6b;--m-warn: #f5b342;--m-ok: #4ad28b;--m-touch: 44px;--m-pad: 12px;--m-pad-lg: 16px;--m-radius: 10px;position:fixed;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;background:var(--m-bg);color:var(--m-text);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:15px;line-height:1.4;overflow:hidden}.m-header{flex:0 0 auto;padding:env(safe-area-inset-top) var(--m-pad-lg) 0;background:var(--m-surface);border-bottom:1px solid var(--m-border)}.m-header-title{height:48px;display:flex;align-items:center;font-weight:600;font-size:17px;letter-spacing:.2px}.m-main{flex:1 1 auto;overflow-y:auto;padding:var(--m-pad-lg);padding-bottom:calc(var(--m-pad-lg) + 64px + env(safe-area-inset-bottom))}.m-bottom-nav{flex:0 0 auto;display:grid;grid-template-columns:repeat(4,1fr);gap:0;background:var(--m-surface);border-top:1px solid var(--m-border);padding-bottom:env(safe-area-inset-bottom);position:absolute;left:0;right:0;bottom:0}.m-nav-btn{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;color:var(--m-text-dim);min-height:var(--m-touch);height:64px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:11px;cursor:pointer;padding:6px 4px}.m-nav-btn[aria-pressed=true]{color:var(--m-accent)}.m-nav-btn .m-nav-icon{font-size:20px;line-height:1}.m-nav-btn .m-nav-label{font-size:11px;letter-spacing:.2px}.m-nav-icon-wrap{position:relative;display:inline-flex;align-items:center;justify-content:center}.m-nav-badge{position:absolute;top:-4px;right:-6px;min-width:8px;height:8px;border-radius:999px;font-size:9px;font-weight:600;line-height:8px;padding:0 3px;display:flex;align-items:center;justify-content:center;background:var(--m-text-dim);color:var(--m-bg);border:1px solid var(--m-bg)}.m-nav-badge-info{background:var(--m-accent)}.m-nav-badge-warn{background:var(--m-warn)}.m-nav-badge-error{background:var(--m-danger)}.m-alert-bar{flex:0 0 auto;display:flex;flex-direction:column;gap:0}.m-alert{display:flex;align-items:center;gap:var(--m-pad);padding:8px var(--m-pad-lg);font-size:13px;cursor:pointer;border-bottom:1px solid var(--m-border);background:var(--m-surface);color:var(--m-text)}.m-alert-info{border-left:3px solid var(--m-accent)}.m-alert-warn{border-left:3px solid var(--m-warn)}.m-alert-error{border-left:3px solid var(--m-danger)}.m-alert-msg{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.m-alert-dismiss{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;color:var(--m-text-dim);cursor:pointer;font-size:12px;padding:4px;flex:0 0 auto}.m-status-pill{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:500;letter-spacing:.3px;text-transform:uppercase;background:var(--m-surface-2);color:var(--m-text-dim);border:1px solid var(--m-border)}.m-status-pill[data-status=planned]{color:var(--m-text-dim)}.m-status-pill[data-status=in_progress]{color:var(--m-accent);border-color:var(--m-accent)}.m-status-pill[data-status=blocked]{color:var(--m-danger);border-color:var(--m-danger)}.m-status-pill[data-status=complete]{color:var(--m-ok);border-color:var(--m-ok)}.m-status-pill[data-status=partial]{color:var(--m-warn);border-color:var(--m-warn)}.m-placeholder{background:var(--m-surface);border:1px solid var(--m-border);border-radius:var(--m-radius);padding:var(--m-pad-lg);text-align:center;color:var(--m-text-dim)}.m-placeholder-title{font-size:16px;font-weight:600;color:var(--m-text);margin-bottom:8px}.m-placeholder-body{font-size:13px}.m-roadmap{display:flex;flex-direction:column;gap:var(--m-pad)}.m-roadmap-error{background:var(--m-surface);border:1px solid var(--m-danger);color:var(--m-danger);border-radius:var(--m-radius);padding:var(--m-pad);font-size:13px}.m-roadmap-empty{background:var(--m-surface);border:1px solid var(--m-border);border-radius:var(--m-radius);padding:var(--m-pad-lg);text-align:center;color:var(--m-text-dim);font-size:14px}.m-roadmap-skeleton{display:flex;flex-direction:column;gap:8px}.m-skel-card{height:72px;border-radius:var(--m-radius);background:linear-gradient(90deg,var(--m-surface) 0%,var(--m-surface-2) 50%,var(--m-surface) 100%);background-size:200% 100%;animation:m-skel 1.4s ease-in-out infinite;border:1px solid var(--m-border)}@keyframes m-skel{0%{background-position:200% 0}to{background-position:-200% 0}}.m-roadmap-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}.m-item-card{display:block;width:100%;text-align:left;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--m-surface);border:1px solid var(--m-border);border-radius:var(--m-radius);padding:var(--m-pad);color:var(--m-text);cursor:pointer;font:inherit;min-height:var(--m-touch)}.m-item-card:active{background:var(--m-surface-2)}.m-item-card-row{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;margin-bottom:4px}.m-item-card-title{font-weight:600;font-size:15px;line-height:1.3;flex:1 1 auto;word-break:break-word}.m-item-card-meta{display:flex;align-items:center;gap:8px;color:var(--m-text-dim);font-size:12px}.m-item-card-group{background:var(--m-surface-2);border:1px solid var(--m-border);border-radius:6px;padding:1px 6px;font-size:11px;color:var(--m-text)}.m-item-card-id{opacity:.7;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px}.m-item-card-desc{margin-top:6px;color:var(--m-text-dim);font-size:13px;line-height:1.35}.m-filter-bar{display:flex;flex-direction:column;gap:8px;background:var(--m-surface);border:1px solid var(--m-border);border-radius:var(--m-radius);padding:var(--m-pad);position:sticky;top:0;z-index:2}.m-filter-chips{display:flex;flex-wrap:wrap;gap:6px}.m-filter-chip{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--m-surface-2);border:1px solid var(--m-border);color:var(--m-text-dim);border-radius:999px;padding:6px 12px;font-size:12px;cursor:pointer;min-height:32px}.m-filter-chip[aria-pressed=true]{background:var(--m-accent);color:#0a0a0f;border-color:var(--m-accent)}.m-filter-row{display:flex;gap:8px}.m-filter-select,.m-filter-keyword{flex:1 1 50%;background:var(--m-surface-2);border:1px solid var(--m-border);color:var(--m-text);border-radius:8px;padding:8px 10px;font:inherit;font-size:14px;min-height:36px}.m-filter-keyword::-moz-placeholder{color:var(--m-text-dim)}.m-filter-keyword::placeholder{color:var(--m-text-dim)}.m-sheet-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#0000008c;z-index:100;display:flex;align-items:stretch;justify-content:stretch}.m-sheet{position:absolute;left:0;right:0;bottom:0;top:0;background:var(--m-bg);display:flex;flex-direction:column;animation:m-sheet-slide-up .22s ease-out}@keyframes m-sheet-slide-up{0%{transform:translateY(100%);opacity:.6}to{transform:translateY(0);opacity:1}}.m-sheet-header{flex:0 0 auto;padding:env(safe-area-inset-top) var(--m-pad-lg) var(--m-pad);background:var(--m-surface);border-bottom:1px solid var(--m-border)}.m-sheet-close{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;color:var(--m-text-dim);font-size:28px;line-height:1;cursor:pointer;padding:6px 10px;margin-left:-10px;min-width:var(--m-touch);min-height:var(--m-touch)}.m-sheet-title-row{display:flex;align-items:center;gap:8px;margin-top:4px}.m-sheet-title{flex:1 1 auto;font-size:17px;font-weight:600;word-break:break-word}.m-sheet-body{flex:1 1 auto;overflow-y:auto;padding:var(--m-pad-lg);display:flex;flex-direction:column;gap:16px}.m-sheet-section{display:flex;flex-direction:column;gap:6px}.m-sheet-label{font-size:12px;text-transform:uppercase;letter-spacing:.4px;color:var(--m-text-dim)}.m-sheet-desc{margin:0;white-space:pre-wrap;font-size:14px;line-height:1.45}.m-sheet-input{background:var(--m-surface);border:1px solid var(--m-border);color:var(--m-text);border-radius:8px;padding:10px 12px;font:inherit;font-size:15px;min-height:var(--m-touch)}.m-sheet-footer{flex:0 0 auto;display:flex;gap:8px;padding:var(--m-pad) var(--m-pad-lg) calc(var(--m-pad-lg) + env(safe-area-inset-bottom));background:var(--m-surface);border-top:1px solid var(--m-border)}.m-sheet-btn{flex:1 1 50%;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:8px;padding:12px;font:inherit;font-weight:600;font-size:15px;cursor:pointer;min-height:var(--m-touch);border:1px solid var(--m-border)}.m-sheet-btn-secondary{background:var(--m-surface-2);color:var(--m-text)}.m-sheet-btn-primary{background:var(--m-accent);color:#0a0a0f;border-color:var(--m-accent)}.m-sheet-btn-primary:disabled{opacity:.5;cursor:not-allowed}.m-toast{position:fixed;left:50%;bottom:calc(80px + env(safe-area-inset-bottom));transform:translate(-50%);background:var(--m-surface);color:var(--m-text);border:1px solid var(--m-border);border-radius:8px;padding:10px 16px;font-size:13px;z-index:200;box-shadow:0 8px 24px #00000080;max-width:calc(100% - 32px)}.m-toast[data-kind=error]{border-color:var(--m-danger);color:var(--m-danger)}.m-toast[data-kind=ok]{border-color:var(--m-ok);color:var(--m-ok)}.m-ideas-tab{display:flex;flex-direction:column;gap:var(--m-pad)}.m-ideas-toolbar{display:flex;flex-direction:column;gap:var(--m-pad);position:sticky;top:0;z-index:1;background:var(--m-bg);padding-bottom:4px}.m-capture-btn{flex:0 0 auto;align-self:flex-start;padding:10px 18px;font-size:14px}.m-toast-stack{position:fixed;left:0;right:0;bottom:calc(80px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:6px;align-items:center;pointer-events:none;z-index:200;padding:0 var(--m-pad-lg)}.m-toast-stack .m-toast{position:static;transform:none;pointer-events:auto;left:auto;bottom:auto}.m-ideas-list{display:flex;flex-direction:column;gap:10px}.m-idea-skeleton{height:76px;border-radius:var(--m-radius);background:linear-gradient(90deg,var(--m-surface) 0%,var(--m-surface-2) 50%,var(--m-surface) 100%);background-size:200% 100%;animation:m-skel 1.4s ease-in-out infinite;border:1px solid var(--m-border)}.m-empty-state{background:var(--m-surface);border:1px dashed var(--m-border);border-radius:var(--m-radius);padding:32px var(--m-pad-lg);text-align:center;color:var(--m-text-dim)}.m-empty-title{font-size:15px;font-weight:600;color:var(--m-text);margin-bottom:4px}.m-empty-body{font-size:13px}.m-idea-row{position:relative;border-radius:var(--m-radius);overflow:hidden;background:var(--m-surface-2)}.m-idea-action{position:absolute;top:0;bottom:0;display:flex;align-items:center;width:50%;padding:0 18px;font-size:13px;font-weight:700;letter-spacing:.5px;text-transform:uppercase}.m-idea-action-left{left:0;background:var(--m-ok);color:#06140c;justify-content:flex-start}.m-idea-action-right{right:0;background:var(--m-danger);color:#fff;justify-content:flex-end}.m-idea-card{position:relative;background:var(--m-surface);border:1px solid var(--m-border);border-radius:var(--m-radius);padding:var(--m-pad);display:flex;flex-direction:column;gap:6px;cursor:pointer;touch-action:pan-y;-webkit-user-select:none;-moz-user-select:none;user-select:none}.m-idea-card.is-intent-promote{box-shadow:0 0 0 2px var(--m-ok) inset}.m-idea-card.is-intent-kill{box-shadow:0 0 0 2px var(--m-danger) inset}.m-idea-head{display:flex;align-items:center;gap:8px}.m-priority-badge{display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:700;letter-spacing:.3px;background:var(--m-surface-2);color:var(--m-text-dim);border:1px solid var(--m-border)}.m-priority-badge[data-priority=p0]{background:var(--m-danger);color:#fff;border-color:var(--m-danger)}.m-priority-badge[data-priority=p1]{background:var(--m-warn);color:#1a1306;border-color:var(--m-warn)}.m-priority-badge[data-priority=p2]{background:var(--m-accent);color:#0b0b14;border-color:var(--m-accent)}.m-idea-cluster{font-size:12px;color:var(--m-text-dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.m-idea-title{margin:0;font-size:15px;font-weight:600;color:var(--m-text);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.m-idea-tags{display:flex;flex-wrap:wrap;gap:4px}.m-idea-tag{display:inline-flex;align-items:center;gap:4px;background:var(--m-surface-2);color:var(--m-text-dim);border:1px solid var(--m-border);border-radius:6px;padding:2px 6px;font-size:11px}.m-tag-remove{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;color:var(--m-text-dim);font-size:14px;line-height:1;cursor:pointer;padding:0 2px}.m-tag-input-row{display:flex;gap:6px;align-items:stretch}.m-tag-input-row .m-sheet-input{flex:1 1 auto}.m-tag-add{flex:0 0 auto;padding:0 14px}.m-textarea{resize:vertical;min-height:88px;font-family:inherit}.m-form-error{background:#ff6b6b1a;color:var(--m-danger);padding:8px 12px;border-radius:8px;font-size:13px}.m-detail-meta{display:flex;flex-wrap:wrap;gap:8px;font-size:12px;color:var(--m-text-dim);margin-top:6px}.m-detail-meta-id{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;background:var(--m-surface-2);border:1px solid var(--m-border);border-radius:6px;padding:2px 6px}.m-detail-meta-status{letter-spacing:.4px;text-transform:uppercase}.m-priority-selector{display:flex;flex-wrap:wrap;gap:6px}.m-priority-chip{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--m-surface-2);color:var(--m-text);border:1px solid var(--m-border);border-radius:999px;padding:6px 14px;font-size:13px;font-weight:500;cursor:pointer;min-height:32px}.m-priority-chip[data-priority=p0].is-selected{background:var(--m-danger);color:#fff;border-color:var(--m-danger)}.m-priority-chip[data-priority=p1].is-selected{background:var(--m-warn);color:#1a1306;border-color:var(--m-warn)}.m-priority-chip[data-priority=p2].is-selected{background:var(--m-accent);color:#0b0b14;border-color:var(--m-accent)}.m-priority-chip[data-priority=untriaged].is-selected{background:var(--m-text-dim);color:#0b0b14;border-color:var(--m-text-dim)}.m-agents-tab{display:flex;flex-direction:column;gap:var(--m-pad-lg)}.m-section{display:flex;flex-direction:column;gap:8px}.m-section-title{font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.6px;color:var(--m-text-dim);margin:0 0 4px}.m-stack{display:flex;flex-direction:column;gap:8px}.m-empty{background:var(--m-surface);border:1px dashed var(--m-border);border-radius:var(--m-radius);padding:var(--m-pad);color:var(--m-text-dim);font-size:13px;text-align:center}.m-btn{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--m-surface-2);color:var(--m-text);border:1px solid var(--m-border);border-radius:8px;padding:8px 12px;font-size:13px;font-weight:500;min-height:var(--m-touch);cursor:pointer}.m-btn-sm{min-height:32px;padding:6px 10px;font-size:12px}.m-btn-primary{background:var(--m-accent);color:#0a0a0f;border-color:var(--m-accent)}.m-btn-danger{background:#ff6b6b1f;color:var(--m-danger);border-color:#ff6b6b66}.m-btn-warn{background:#f5b3421f;color:var(--m-warn);border-color:#f5b34266}.m-btn-active{outline:2px solid currentColor;outline-offset:-1px}.m-btn:disabled{opacity:.5;cursor:not-allowed}.m-agent-card,.m-gate-card,.m-session-card{background:var(--m-surface);border:1px solid var(--m-border);border-radius:var(--m-radius);padding:var(--m-pad);display:flex;flex-direction:column;gap:6px}.m-agent-card-row,.m-gate-card-row,.m-session-card-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.m-agent-card-id,.m-gate-card-title,.m-session-card-title{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px;color:var(--m-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1 1 auto}.m-agent-card-meta{display:flex;align-items:center;justify-content:space-between;gap:8px}.m-agent-card-time,.m-gate-card-step,.m-session-card-id{font-size:11px;color:var(--m-text-dim)}.m-gate-card-summary{font-size:13px;color:var(--m-text);line-height:1.35}.m-agent-card-error{color:var(--m-danger);font-size:12px;padding:6px 8px;background:#ff6b6b14;border-radius:6px}.m-session-card-form{display:flex;gap:6px}.m-input,.m-textarea{flex:1 1 auto;background:var(--m-surface-2);color:var(--m-text);border:1px solid var(--m-border);border-radius:8px;padding:8px 10px;font:inherit;font-size:14px}.m-textarea{resize:vertical;min-height:44px}.m-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;background:var(--m-bg);display:flex;flex-direction:column;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}.m-overlay-header{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:var(--m-pad);border-bottom:1px solid var(--m-border)}.m-overlay-header-inner{display:flex;align-items:center;gap:8px;flex:1 1 auto;min-width:0}.m-overlay-title{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.m-overlay-actions{display:flex;gap:6px;flex:0 0 auto}.m-overlay-body{flex:1 1 auto;overflow-y:auto;padding:var(--m-pad)}.m-agent-log{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;line-height:1.45}.m-agent-log-line{white-space:pre-wrap;word-break:break-word;padding:2px 0;border-bottom:1px solid rgba(255,255,255,.04);color:var(--m-text-dim)}.m-sheet-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1100;background:#0009;display:flex;align-items:flex-end}.m-sheet{flex:1 1 auto;background:var(--m-surface);border-top-left-radius:14px;border-top-right-radius:14px;border-top:1px solid var(--m-border);padding:var(--m-pad-lg);padding-bottom:calc(var(--m-pad-lg) + env(safe-area-inset-bottom));max-height:90vh;overflow-y:auto}.m-sheet-header{margin-bottom:var(--m-pad)}.m-sheet-title{font-size:16px;font-weight:600;color:var(--m-text)}.m-sheet-subtitle{font-size:12px;color:var(--m-text-dim);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;margin-top:2px}.m-sheet-body{display:flex;flex-direction:column;gap:var(--m-pad)}.m-sheet-outcomes{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.m-field{display:flex;flex-direction:column;gap:4px}.m-field-label{font-size:11px;text-transform:uppercase;letter-spacing:.5px;color:var(--m-text-dim)}.m-sheet-actions{display:flex;justify-content:flex-end;gap:8px}.m-builds-tab{display:flex;flex-direction:column;gap:var(--m-pad);padding:var(--m-pad)}.m-build-card{display:flex;flex-direction:column;gap:6px;padding:var(--m-pad);background:var(--m-surface);border:1px solid var(--m-border);border-radius:10px;cursor:pointer}.m-build-card-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.m-build-card-feature{font-weight:600;color:var(--m-text);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1 1 auto}.m-build-card-meta{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--m-text-dim)}.m-build-card-mode{text-transform:uppercase;letter-spacing:.5px;font-size:10px;padding:2px 6px;border-radius:4px;background:#ffffff0f;color:var(--m-text)}.m-build-card-mode[data-mode=bug]{background:#f5b3421f;color:var(--m-warn)}.m-build-card-tail{display:flex;flex-direction:column;gap:2px;font-size:11px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:var(--m-text-dim);background:#0000002e;border-radius:6px;padding:6px 8px;max-height:64px;overflow:hidden}.m-build-card-tail-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.m-build-card-actions{display:flex;justify-content:flex-end;gap:6px}.m-build-mode-row{display:flex;gap:8px}.m-build-steps-list{display:flex;flex-direction:column;gap:12px;padding:4px 0}.m-build-steps-phase{display:flex;flex-direction:column;gap:0}.m-build-steps-phase-header{font-size:11px;text-transform:uppercase;letter-spacing:.6px;color:var(--m-text-dim);font-weight:600;padding:4px 0 6px;border-bottom:1px solid var(--m-border);margin-bottom:4px}.m-build-steps-phase-rows{display:flex;flex-direction:column;gap:0}.m-step-row{display:flex;align-items:flex-start;flex-wrap:wrap;gap:6px;padding:6px 4px;border-bottom:1px solid rgba(255,255,255,.04);min-height:36px}.m-step-row--active{background:#7c8cff12;border-radius:6px;border-bottom-color:transparent}.m-step-row--failed{background:#ff6b6b12;border-radius:6px;border-left:3px solid var(--m-danger);padding-left:8px;border-bottom-color:transparent}.m-step-glyph{flex:0 0 auto;width:18px;font-size:13px;line-height:1.6;color:var(--m-text-dim);text-align:center}.m-step-glyph--pulse{color:var(--m-accent);animation:m-step-pulse 1.2s ease-in-out infinite}@keyframes m-step-pulse{0%,to{opacity:1}50%{opacity:.35}}.m-step-name{flex:1 1 auto;font-size:13px;color:var(--m-text);line-height:1.5}.m-step-row--active .m-step-name{color:var(--m-accent);font-weight:500}.m-step-row--failed .m-step-name{color:var(--m-danger);font-weight:500}.m-step-agent-chip{flex:0 0 auto;background:var(--m-surface-2);border:1px solid var(--m-border);border-radius:4px;padding:1px 6px;font-size:10px;color:var(--m-text-dim);text-transform:uppercase;letter-spacing:.3px}.m-step-summary{flex:0 0 100%;font-size:12px;color:var(--m-danger);padding-left:24px;line-height:1.35;margin-top:2px}.m-step-collapsed-row{display:flex;flex-direction:column;padding:4px;cursor:pointer;border-radius:6px;border:1px solid transparent}.m-step-collapsed-row:hover,.m-step-collapsed-row:focus{background:var(--m-surface-2);outline:none}.m-step-collapsed-label{font-size:12px;color:var(--m-text-dim);padding:4px;font-style:italic}.m-build-detail-tabs{flex:0 0 auto;display:flex;gap:0;border-bottom:1px solid var(--m-border);background:var(--m-surface)}.m-build-detail-tab{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;border-bottom:2px solid transparent;color:var(--m-text-dim);padding:10px 20px;font:inherit;font-size:14px;font-weight:500;cursor:pointer;margin-bottom:-1px}.m-build-detail-tab.is-active,.m-build-detail-tab[aria-pressed=true]{color:var(--m-accent);border-bottom-color:var(--m-accent)}.m-build-history{display:flex;flex-direction:column;gap:0;background:var(--m-surface);border:1px solid var(--m-border);border-radius:var(--m-radius);overflow:hidden}.m-build-history-row{display:flex;flex-direction:column;padding:10px 12px;border-bottom:1px solid var(--m-border);cursor:pointer;min-height:var(--m-touch)}.m-build-history-row:last-child{border-bottom:0}.m-build-history-row:hover,.m-build-history-row:focus{background:var(--m-surface-2);outline:none}.m-build-history-summary{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.m-build-history-code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px;font-weight:600;color:var(--m-text);flex:0 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.m-build-history-rel{font-size:11px;color:var(--m-text-dim);margin-left:auto;white-space:nowrap}.m-build-history-reason-trunc{flex:0 0 100%;font-size:12px;color:var(--m-danger);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.m-build-history-detail{margin-top:8px;display:flex;flex-direction:column;gap:4px;padding-top:8px;border-top:1px solid var(--m-border)}.m-build-history-field{display:flex;align-items:flex-start;gap:8px;font-size:12px}.m-build-history-field--block{flex-direction:column;gap:2px}.m-build-history-field-label{flex:0 0 80px;color:var(--m-text-dim);text-transform:uppercase;letter-spacing:.3px;font-size:10px;padding-top:1px}.m-build-history-field-value{flex:1 1 auto;color:var(--m-text);word-break:break-word}.m-build-history-failure{color:var(--m-danger);white-space:pre-wrap}.m-fab{position:fixed;bottom:calc(76px + env(safe-area-inset-bottom));right:16px;width:52px;height:52px;border-radius:50%;background:var(--m-accent);color:#fff;border:none;font-size:28px;line-height:1;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 4px 12px #0006;z-index:10;transition:transform .15s ease,opacity .15s ease}.m-fab:active{transform:scale(.93);opacity:.85}.m-sheet-btn-danger{background:transparent;color:var(--m-danger);border:1px solid var(--m-danger);border-radius:var(--m-radius);padding:0 12px;height:var(--m-touch);min-width:80px;font-size:14px;cursor:pointer;transition:background .15s ease,color .15s ease}.m-sheet-btn-danger:hover{background:color-mix(in srgb,var(--m-danger) 15%,transparent)}.m-sheet-btn-danger--armed{background:var(--m-danger);color:#fff}.m-sheet-btn-danger:disabled{opacity:.5;cursor:not-allowed}.m-sheet-footer-right{display:flex;gap:8px;margin-left:auto}.m-sheet-connections{border-top:1px solid var(--m-border);padding-top:12px}.m-sheet-connections-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.m-conn-add-btn{background:transparent;color:var(--m-accent);border:1px solid var(--m-accent);border-radius:6px;padding:2px 10px;font-size:12px;cursor:pointer}.m-conn-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}.m-conn-row{display:flex;align-items:center;gap:6px;padding:6px 0;border-bottom:1px solid var(--m-border);font-size:13px}.m-conn-dir{color:var(--m-text-dim);flex:0 0 16px;text-align:center}.m-conn-title{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.m-conn-type{flex:0 0 auto;font-size:11px;color:var(--m-text-dim);background:var(--m-surface-2);border-radius:4px;padding:1px 5px}.m-conn-remove{flex:0 0 28px;height:28px;border:none;background:transparent;color:var(--m-text-dim);cursor:pointer;font-size:16px;border-radius:4px}.m-conn-remove--armed{background:var(--m-danger);color:#fff}.m-conn-loading,.m-conn-empty{font-size:12px;color:var(--m-text-dim);padding:4px 0}.m-conn-picker{margin-top:8px;background:var(--m-surface-2);border-radius:var(--m-radius);padding:10px;display:flex;flex-direction:column;gap:8px}.m-conn-picker-row{display:flex;gap:6px}.m-conn-search{flex:1 1 auto}.m-conn-type-select{flex:0 0 110px}.m-conn-picker-list{list-style:none;margin:0;padding:0;max-height:160px;overflow-y:auto;display:flex;flex-direction:column;gap:2px}.m-conn-picker-item{width:100%;text-align:left;background:var(--m-surface);border:none;border-radius:6px;padding:8px;cursor:pointer;display:flex;align-items:center;gap:8px}.m-conn-picker-item:active{background:var(--m-surface-2)}.m-conn-picker-title{flex:1 1 auto;font-size:13px;color:var(--m-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.m-conn-picker-id{flex:0 0 auto;font-size:11px;color:var(--m-text-dim);font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.m-conn-picker-empty{font-size:12px;color:var(--m-text-dim);padding:6px 0;text-align:center}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a4 as S,a7 as R,b5 as Q,g as Y,s as tt,a as et,b as at,q as rt,p as nt,_ as p,l as z,c as it,F as st,I as ot,N as lt,e as ct,z as ut,G as pt}from"./App-
|
|
1
|
+
import{a4 as S,a7 as R,b5 as Q,g as Y,s as tt,a as et,b as at,q as rt,p as nt,_ as p,l as z,c as it,F as st,I as ot,N as lt,e as ct,z as ut,G as pt}from"./App-DQblyoua.js";import{p as gt}from"./chunk-4BX2VUAB-B0CaezI4.js";import{p as dt}from"./wardley-L42UT6IY-BHnzDf0e.js";import{d as _}from"./arc-B4fPSjcd.js";import{o as ft}from"./ordinal-Cboi1Yqb.js";import"./mobile-4lQex-UI.js";import"./index-CE1ehTQn.js";import"./graph-BlEwG9Ro.js";import"./init-Gi6I4Gst.js";function ht(t,a){return a<t?-1:a>t?1:a>=t?0:NaN}function mt(t){return t}function vt(){var t=mt,a=ht,f=null,y=S(0),s=S(R),g=S(0);function o(e){var n,l=(e=Q(e)).length,d,h,v=0,c=new Array(l),i=new Array(l),x=+y.apply(this,arguments),w=Math.min(R,Math.max(-R,s.apply(this,arguments)-x)),m,D=Math.min(Math.abs(w)/l,g.apply(this,arguments)),$=D*(w<0?-1:1),u;for(n=0;n<l;++n)(u=i[c[n]=n]=+t(e[n],n,e))>0&&(v+=u);for(a!=null?c.sort(function(A,C){return a(i[A],i[C])}):f!=null&&c.sort(function(A,C){return f(e[A],e[C])}),n=0,h=v?(w-l*$)/v:0;n<l;++n,x=m)d=c[n],u=i[d],m=x+(u>0?u*h:0)+$,i[d]={data:e[d],index:n,value:u,startAngle:x,endAngle:m,padAngle:D};return i}return o.value=function(e){return arguments.length?(t=typeof e=="function"?e:S(+e),o):t},o.sortValues=function(e){return arguments.length?(a=e,f=null,o):a},o.sort=function(e){return arguments.length?(f=e,a=null,o):f},o.startAngle=function(e){return arguments.length?(y=typeof e=="function"?e:S(+e),o):y},o.endAngle=function(e){return arguments.length?(s=typeof e=="function"?e:S(+e),o):s},o.padAngle=function(e){return arguments.length?(g=typeof e=="function"?e:S(+e),o):g},o}var xt=pt.pie,F={sections:new Map,showData:!1},T=F.sections,W=F.showData,St=structuredClone(xt),yt=p(()=>structuredClone(St),"getConfig"),wt=p(()=>{T=new Map,W=F.showData,ut()},"clear"),At=p(({label:t,value:a})=>{if(a<0)throw new Error(`"${t}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);T.has(t)||(T.set(t,a),z.debug(`added new section: ${t}, with value: ${a}`))},"addSection"),Ct=p(()=>T,"getSections"),Dt=p(t=>{W=t},"setShowData"),$t=p(()=>W,"getShowData"),V={getConfig:yt,clear:wt,setDiagramTitle:nt,getDiagramTitle:rt,setAccTitle:at,getAccTitle:et,setAccDescription:tt,getAccDescription:Y,addSection:At,getSections:Ct,setShowData:Dt,getShowData:$t},Tt=p((t,a)=>{gt(t,a),a.setShowData(t.showData),t.sections.map(a.addSection)},"populateDb"),bt={parse:p(async t=>{const a=await dt("pie",t);z.debug(a),Tt(a,V)},"parse")},kt=p(t=>`
|
|
2
2
|
.pieCircle{
|
|
3
3
|
stroke: ${t.pieStrokeColor};
|
|
4
4
|
stroke-width : ${t.pieStrokeWidth};
|