plan-assistant 1.2.2 → 1.3.0-alpha.3
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/build/client/_app/immutable/assets/0.xgRkQ1lY.css +1 -0
- package/build/client/_app/immutable/chunks/{C40UEiDa.js → -aE-KL3N.js} +1 -1
- package/build/client/_app/immutable/chunks/{Cnk3veQv.js → A2YmdcbE.js} +1 -1
- package/build/client/_app/immutable/chunks/{Zl01-BCk.js → BDlseEyh.js} +1 -1
- package/build/client/_app/immutable/chunks/{et9SQoBt.js → BFBYzAsj.js} +41 -41
- package/build/client/_app/immutable/chunks/{Cfu7LlTl.js → BGqF3rQm.js} +1 -1
- package/build/client/_app/immutable/chunks/{CjU8zlr4.js → BHjBWvud.js} +1 -1
- package/build/client/_app/immutable/chunks/{DV6acRrl.js → BSxTGtcK.js} +1 -1
- package/build/client/_app/immutable/chunks/{CdWYTPbj.js → BZNiIU90.js} +1 -1
- package/build/client/_app/immutable/chunks/{D1smdH78.js → B_U299fe.js} +1 -1
- package/build/client/_app/immutable/chunks/BdoKnygS.js +2 -0
- package/build/client/_app/immutable/chunks/{ChXJ3_8d.js → BeBcuTsW.js} +1 -1
- package/build/client/_app/immutable/chunks/{Ds2Jk9YM.js → BgbLjDvB.js} +1 -1
- package/build/client/_app/immutable/chunks/{CCvUv5wO.js → BglRpvde.js} +1 -1
- package/build/client/_app/immutable/chunks/{DYmr2Cu_.js → BvvuIzZ5.js} +1 -1
- package/build/client/_app/immutable/chunks/{BEd52Y9t.js → BwE9TKxZ.js} +42 -42
- package/build/client/_app/immutable/chunks/{zzrVTw61.js → BzUyy-dt.js} +1 -1
- package/build/client/_app/immutable/chunks/{CpzGW5sx.js → C0xCC0Sq.js} +1 -1
- package/build/client/_app/immutable/chunks/{BgWVd2JH.js → C2X8ykUY.js} +1 -1
- package/build/client/_app/immutable/chunks/{D7AzvARu.js → C4TRBxnl.js} +1 -1
- package/build/client/_app/immutable/chunks/C7DdITi2.js +1 -0
- package/build/client/_app/immutable/chunks/{B_m78aJo.js → CELHSnoC.js} +1 -1
- package/build/client/_app/immutable/chunks/{DtRnjJCq.js → CGtriK76.js} +1 -1
- package/build/client/_app/immutable/chunks/{C7_sUGKI.js → CYYXOzpr.js} +1 -1
- package/build/client/_app/immutable/chunks/{_8lNgEhN.js → CZCoJGyT.js} +1 -1
- package/build/client/_app/immutable/chunks/{C6G9eLNg.js → CdPLj01x.js} +1 -1
- package/build/client/_app/immutable/chunks/{CZDB-NCS.js → CdVbgzBr.js} +1 -1
- package/build/client/_app/immutable/chunks/{CAs7BFgw.js → CukMqC9d.js} +1 -1
- package/build/client/_app/immutable/chunks/{D6mQqXUs.js → Czrxw8H8.js} +1 -1
- package/build/client/_app/immutable/chunks/{Rt06R0BH.js → D9jmuUDt.js} +1 -1
- package/build/client/_app/immutable/chunks/DKNAb9R5.js +1 -0
- package/build/client/_app/immutable/chunks/{DK1EzMSE.js → DLgNdwL-.js} +1 -1
- package/build/client/_app/immutable/chunks/{SLcsOks0.js → DNTjyB5O.js} +1 -1
- package/build/client/_app/immutable/chunks/{66S44dU2.js → DPoAdk27.js} +1 -1
- package/build/client/_app/immutable/chunks/{BwE1zFLP.js → DUhNQyOP.js} +1 -1
- package/build/client/_app/immutable/chunks/{BQLlh6rw.js → DVrXUsxi.js} +1 -1
- package/build/client/_app/immutable/chunks/{C9sq1NiT.js → Da7RbzHT.js} +1 -1
- package/build/client/_app/immutable/chunks/{yJkIcB-2.js → DbHdHraX.js} +1 -1
- package/build/client/_app/immutable/chunks/{BPiLmQNn.js → Dd71Iv7J.js} +1 -1
- package/build/client/_app/immutable/chunks/{CptLmxn7.js → DlujAFOe.js} +1 -1
- package/build/client/_app/immutable/chunks/{CEkljthY.js → Dn2N7IvN.js} +1 -1
- package/build/client/_app/immutable/chunks/DpY4-NiY.js +3 -0
- package/build/client/_app/immutable/chunks/{DJPNFy2Z.js → DwoAbj8z.js} +1 -1
- package/build/client/_app/immutable/chunks/{B5wH4gxC.js → PRH9vIIE.js} +1 -1
- package/build/client/_app/immutable/chunks/{QOziFLFL.js → dEcRtk-k.js} +1 -1
- package/build/client/_app/immutable/chunks/{BcL-TGiq.js → dv8n_yuj.js} +1 -1
- package/build/client/_app/immutable/chunks/{enKT794F.js → jS-WS0qK.js} +1 -1
- package/build/client/_app/immutable/chunks/{De3MB1l1.js → rQOBSFfb.js} +1 -1
- package/build/client/_app/immutable/chunks/{BlhCArX0.js → sQwqhwzr.js} +1 -1
- package/build/client/_app/immutable/entry/{app.drqszXmO.js → app.DhdLjL2n.js} +2 -2
- package/build/client/_app/immutable/entry/start.CDcVNCIu.js +1 -0
- package/build/client/_app/immutable/nodes/{1.BLhKeqW1.js → 1.ejshJzsT.js} +1 -1
- package/build/client/_app/immutable/nodes/{2.CNfAa1lN.js → 2.ZFWOqsMm.js} +1 -1
- package/build/client/_app/immutable/nodes/3.BY6KFpqQ.js +1 -0
- package/build/client/_app/version.json +1 -1
- package/build/server/chunks/{0-FD3Yst2W.js → 0-F8UDIQlw.js} +3 -3
- package/build/server/chunks/{0-FD3Yst2W.js.map → 0-F8UDIQlw.js.map} +1 -1
- package/build/server/chunks/{1-DPyxh1rx.js → 1-DuleYJMw.js} +2 -2
- package/build/server/chunks/{1-DPyxh1rx.js.map → 1-DuleYJMw.js.map} +1 -1
- package/build/server/chunks/{2-C9Pr1aKN.js → 2-tND4IT0j.js} +4 -4
- package/build/server/chunks/{2-C9Pr1aKN.js.map → 2-tND4IT0j.js.map} +1 -1
- package/build/server/chunks/{3-CsZto47z.js → 3-BaEfaEMw.js} +4 -4
- package/build/server/chunks/{3-CsZto47z.js.map → 3-BaEfaEMw.js.map} +1 -1
- package/build/server/chunks/{_page.svelte-C-jd6GOL.js → _page.svelte-BHgQV7I4.js} +67 -60
- package/build/server/chunks/_page.svelte-BHgQV7I4.js.map +1 -0
- package/build/server/chunks/{_page.svelte-CWIhxW51.js → _page.svelte-ByTjHRUq.js} +2 -2
- package/build/server/chunks/{_page.svelte-CWIhxW51.js.map → _page.svelte-ByTjHRUq.js.map} +1 -1
- package/build/server/chunks/{_server.ts-CpPXj3O_.js → _server.ts-BkcqX0Gw.js} +2 -2
- package/build/server/chunks/{_server.ts-CpPXj3O_.js.map → _server.ts-BkcqX0Gw.js.map} +1 -1
- package/build/server/chunks/{_server.ts-DJbYluhf.js → _server.ts-C9Rz5pqb.js} +2 -2
- package/build/server/chunks/{_server.ts-DJbYluhf.js.map → _server.ts-C9Rz5pqb.js.map} +1 -1
- package/build/server/chunks/{_server.ts-CY7NfbtD.js → _server.ts-DCa-_qe7.js} +5 -2
- package/build/server/chunks/_server.ts-DCa-_qe7.js.map +1 -0
- package/build/server/chunks/_server.ts-DVH0ejp0.js +12 -0
- package/build/server/chunks/_server.ts-DVH0ejp0.js.map +1 -0
- package/build/server/chunks/{_server.ts-CtgVvBfR.js → _server.ts-aWI5JVTi.js} +2 -2
- package/build/server/chunks/{_server.ts-CtgVvBfR.js.map → _server.ts-aWI5JVTi.js.map} +1 -1
- package/build/server/chunks/{_server.ts-K9S2g_-L.js → _server.ts-b4ynvdd4.js} +2 -2
- package/build/server/chunks/{_server.ts-K9S2g_-L.js.map → _server.ts-b4ynvdd4.js.map} +1 -1
- package/build/server/chunks/{_server.ts-DI8tBJml.js → _server.ts-r59HGb-h.js} +2 -2
- package/build/server/chunks/{_server.ts-DI8tBJml.js.map → _server.ts-r59HGb-h.js.map} +1 -1
- package/build/server/chunks/{hooks.server-BHuIRhU1.js → hooks.server-CeNxBnIX.js} +2 -4
- package/build/server/chunks/hooks.server-CeNxBnIX.js.map +1 -0
- package/build/server/chunks/{session-manager-CBzriHWC.js → session-manager-Vdr0BxAo.js} +7 -12
- package/build/server/chunks/session-manager-Vdr0BxAo.js.map +1 -0
- package/build/server/chunks/{status-BrtsDZqP.js → status-BV9je7QE.js} +10 -2
- package/build/server/chunks/status-BV9je7QE.js.map +1 -0
- package/build/server/index.js +2 -2
- package/build/server/index.js.map +1 -1
- package/build/server/manifest.js +12 -12
- package/build/server/manifest.js.map +1 -1
- package/dist/cli/commands/review.js +125 -38
- package/dist/cli/index.js +78 -9
- package/dist/cli/markdown-parser.js +3 -3
- package/dist/cli/markdown-to-plan.js +1 -19
- package/dist/cli/utils.js +14 -13
- package/package.json +13 -4
- package/build/client/_app/immutable/assets/0.DdHQkxqS.css +0 -1
- package/build/client/_app/immutable/chunks/9io9WUbM.js +0 -2
- package/build/client/_app/immutable/chunks/B1KfJkVF.js +0 -1
- package/build/client/_app/immutable/chunks/D5TNeoIz.js +0 -1
- package/build/client/_app/immutable/chunks/DtlciwlI.js +0 -3
- package/build/client/_app/immutable/entry/start.C0P0in9X.js +0 -1
- package/build/client/_app/immutable/nodes/3.nevoqbPf.js +0 -1
- package/build/server/chunks/_page.svelte-C-jd6GOL.js.map +0 -1
- package/build/server/chunks/_server.ts-CY7NfbtD.js.map +0 -1
- package/build/server/chunks/_server.ts-DAVgIfvo.js +0 -11
- package/build/server/chunks/_server.ts-DAVgIfvo.js.map +0 -1
- package/build/server/chunks/hooks.server-BHuIRhU1.js.map +0 -1
- package/build/server/chunks/session-manager-CBzriHWC.js.map +0 -1
- package/build/server/chunks/status-BrtsDZqP.js.map +0 -1
- /package/build/client/_app/immutable/nodes/{0.DJ6Q_WzM.js → 0.BZ6p9IRV.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as G,a as W,S as N}from"./QOziFLFL.js";import{_ as f,c as t,d as H,l as S,e as P,k as z,R as _,S as U,O as C,u as F}from"./BEd52Y9t.js";import{G as O}from"./DtRnjJCq.js";import{l as J}from"./BQLlh6rw.js";var X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),D=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Y=f((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(g,m,B){const E=g.append("tspan").attr("x",2*t().state.padding).text(m);B||E.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),l=n.height,x=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(g){a||(d(x,g,s),s=!1),a=!1});const w=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),p=x.node().getBBox(),o=Math.max(p.width,n.width);return w.attr("x2",o+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",o+2*t().state.padding).attr("height",p.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),x=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),p=s.node().getBBox().width+n;let o=Math.max(p,x);o===x&&(o=o+n);let g;const m=e.node().getBBox();i.doc,g=a-c,p>x&&(g=(x-o)/2+c),Math.abs(a-m.x)<c&&p>x&&(g=a-(p-x)/2);const B=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",g).attr("y",B).attr("class",d?"alt-composit":"composit").attr("width",o).attr("height",m.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",g+c),p<=x&&s.attr("x",a+(o-n)/2-p/2+c),e.insert("rect",":first-child").attr("x",g).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",o).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",g).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",o).attr("height",m.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),q=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),Z=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),j=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let x=e.replace(/\r\n/g,"<br/>");x=x.replace(/\n/g,"<br/>");const a=x.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const w of a){const p=w.trim();if(p.length>0){const o=l.append("tspan");if(o.text(p),s===0){const g=o.node().getBBox();s+=g.height}n+=s,o.attr("x",i+t().state.noteMargin),o.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),K=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=j(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&q(n),(i.type==="fork"||i.type==="join")&&Z(n,i),i.type==="note"&&K(i.note.text,n),i.type==="divider"&&D(n),i.type==="default"&&i.descriptions.length===0&&Y(n,i),i.type==="default"&&i.descriptions.length>0&&I(n,i);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),R=0,Q=f(function(e,i,d){const c=f(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,l=_().x(function(s){return s.x}).y(function(s){return s.y}).curve(U),x=e.append("path").attr("d",l(n)).attr("id","edge"+R).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=C(!0)),x.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:w,y:p}=F.calcLabelPosition(i.points),o=z.getRows(d.title);let g=0;const m=[];let B=0,E=0;for(let u=0;u<=o.length;u++){const h=s.append("text").attr("text-anchor","middle").text(o[u]).attr("x",w).attr("y",p+g),y=h.node().getBBox();B=Math.max(B,y.width),E=Math.min(E,y.x),S.info(y.x,w,p+g),g===0&&(g=h.node().getBBox().height,S.info("Title height",g,p)),m.push(h)}let k=g*o.length;if(o.length>1){const u=(o.length-1)*g*.5;m.forEach((h,y)=>h.attr("y",p+y*g-u)),k=g*o.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",w-B/2-t().state.padding/2).attr("y",p-k/2-t().state.padding/2-3.5).attr("width",B+t().state.padding).attr("height",k+t().state.padding),S.info(r)}R++},"drawEdge"),b,T={},V=f(function(){},"setConf"),tt=f(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),et=f(function(e,i,d,c){b=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=H("#i"+i));const x=n==="sandbox"?H(l.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=x.select(`[id='${i}']`);tt(s);const w=c.db.getRootDoc();A(w,s,void 0,!1,x,a,c);const p=b.padding,o=s.node().getBBox(),g=o.width+p*2,m=o.height+p*2,B=g*1.75;P(s,m,B,b.useMaxWidth),s.attr("viewBox",`${o.x-b.padding} ${o.y-b.padding} `+g+" "+m)},"draw"),at=f(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),A=f((e,i,d,c,n,l,x)=>{const a=new O({compound:!0,multigraph:!0});let s,w=!0;for(s=0;s<e.length;s++)if(e[s].stmt==="relation"){w=!1;break}d?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:w?1:b.edgeLengthFactor,nodeSep:w?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:w?1:b.edgeLengthFactor,nodeSep:w?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const p=x.db.getStates(),o=x.db.getRelations(),g=Object.keys(p);for(const r of g){const u=p[r];d&&(u.parentId=d);let h;if(u.doc){let y=i.append("g").attr("id",u.id).attr("class","stateGroup");h=A(u.doc,y,u.id,!c,n,l,x);{y=$(y,u,c);let v=y.node().getBBox();h.width=v.width,h.height=v.height+b.padding/2,T[u.id]={y:b.compositTitleSize}}}else h=L(i,u,a);if(u.note){const y={descriptions:[],id:u.id+"-note",note:u.note,type:"note"},v=L(i,y,a);u.note.position==="left of"?(a.setNode(h.id+"-note",v),a.setNode(h.id,h)):(a.setNode(h.id,h),a.setNode(h.id+"-note",v)),a.setParent(h.id,h.id+"-group"),a.setParent(h.id+"-note",h.id+"-group")}else a.setNode(h.id,h)}S.debug("Count=",a.nodeCount(),a);let m=0;o.forEach(function(r){m++,S.debug("Setting edge",r),a.setEdge(r.id1,r.id2,{relation:r,width:at(r.title),height:b.labelHeight*z.getRows(r.title).length,labelpos:"c"},"id"+m)}),J(a),S.debug("Graph after layout",a.nodes());const B=i.node();a.nodes().forEach(function(r){r!==void 0&&a.node(r)!==void 0?(S.warn("Node "+r+": "+JSON.stringify(a.node(r))),n.select("#"+B.id+" #"+r).attr("transform","translate("+(a.node(r).x-a.node(r).width/2)+","+(a.node(r).y+(T[r]?T[r].y:0)-a.node(r).height/2)+" )"),n.select("#"+B.id+" #"+r).attr("data-x-shift",a.node(r).x-a.node(r).width/2),l.querySelectorAll("#"+B.id+" #"+r+" .divider").forEach(h=>{const y=h.parentElement;let v=0,M=0;y&&(y.parentElement&&(v=y.parentElement.getBBox().width),M=parseInt(y.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",v-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let E=B.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),Q(i,a.edge(r),a.edge(r).relation))}),E=B.getBBox();const k={id:d||"root",label:d||"root",width:0,height:0};return k.width=E.width+2*b.padding,k.height=E.height+2*b.padding,S.debug("Doc rendered",k,a),k},"renderDoc"),it={setConf:V,draw:et},ot={parser:W,get db(){return new N(1)},renderer:it,styles:G,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{ot as diagram};
|
|
1
|
+
import{s as G,a as W,S as N}from"./dEcRtk-k.js";import{_ as f,c as t,d as H,l as S,e as P,k as z,R as _,S as U,O as C,u as F}from"./BwE9TKxZ.js";import{G as O}from"./CGtriK76.js";import{l as J}from"./DVrXUsxi.js";var X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),D=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),Y=f((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(g,m,B){const E=g.append("tspan").attr("x",2*t().state.padding).text(m);B||E.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),l=n.height,x=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(g){a||(d(x,g,s),s=!1),a=!1});const w=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),p=x.node().getBBox(),o=Math.max(p.width,n.width);return w.attr("x2",o+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",o+2*t().state.padding).attr("height",p.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),x=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),p=s.node().getBBox().width+n;let o=Math.max(p,x);o===x&&(o=o+n);let g;const m=e.node().getBBox();i.doc,g=a-c,p>x&&(g=(x-o)/2+c),Math.abs(a-m.x)<c&&p>x&&(g=a-(p-x)/2);const B=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",g).attr("y",B).attr("class",d?"alt-composit":"composit").attr("width",o).attr("height",m.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",g+c),p<=x&&s.attr("x",a+(o-n)/2-p/2+c),e.insert("rect",":first-child").attr("x",g).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",o).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",g).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",o).attr("height",m.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),q=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),Z=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),j=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let x=e.replace(/\r\n/g,"<br/>");x=x.replace(/\n/g,"<br/>");const a=x.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const w of a){const p=w.trim();if(p.length>0){const o=l.append("tspan");if(o.text(p),s===0){const g=o.node().getBBox();s+=g.height}n+=s,o.attr("x",i+t().state.noteMargin),o.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),K=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=j(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&q(n),(i.type==="fork"||i.type==="join")&&Z(n,i),i.type==="note"&&K(i.note.text,n),i.type==="divider"&&D(n),i.type==="default"&&i.descriptions.length===0&&Y(n,i),i.type==="default"&&i.descriptions.length>0&&I(n,i);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),R=0,Q=f(function(e,i,d){const c=f(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,l=_().x(function(s){return s.x}).y(function(s){return s.y}).curve(U),x=e.append("path").attr("d",l(n)).attr("id","edge"+R).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=C(!0)),x.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:w,y:p}=F.calcLabelPosition(i.points),o=z.getRows(d.title);let g=0;const m=[];let B=0,E=0;for(let u=0;u<=o.length;u++){const h=s.append("text").attr("text-anchor","middle").text(o[u]).attr("x",w).attr("y",p+g),y=h.node().getBBox();B=Math.max(B,y.width),E=Math.min(E,y.x),S.info(y.x,w,p+g),g===0&&(g=h.node().getBBox().height,S.info("Title height",g,p)),m.push(h)}let k=g*o.length;if(o.length>1){const u=(o.length-1)*g*.5;m.forEach((h,y)=>h.attr("y",p+y*g-u)),k=g*o.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",w-B/2-t().state.padding/2).attr("y",p-k/2-t().state.padding/2-3.5).attr("width",B+t().state.padding).attr("height",k+t().state.padding),S.info(r)}R++},"drawEdge"),b,T={},V=f(function(){},"setConf"),tt=f(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),et=f(function(e,i,d,c){b=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=H("#i"+i));const x=n==="sandbox"?H(l.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=x.select(`[id='${i}']`);tt(s);const w=c.db.getRootDoc();A(w,s,void 0,!1,x,a,c);const p=b.padding,o=s.node().getBBox(),g=o.width+p*2,m=o.height+p*2,B=g*1.75;P(s,m,B,b.useMaxWidth),s.attr("viewBox",`${o.x-b.padding} ${o.y-b.padding} `+g+" "+m)},"draw"),at=f(e=>e?e.length*b.fontSizeFactor:1,"getLabelWidth"),A=f((e,i,d,c,n,l,x)=>{const a=new O({compound:!0,multigraph:!0});let s,w=!0;for(s=0;s<e.length;s++)if(e[s].stmt==="relation"){w=!1;break}d?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:w?1:b.edgeLengthFactor,nodeSep:w?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:w?1:b.edgeLengthFactor,nodeSep:w?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const p=x.db.getStates(),o=x.db.getRelations(),g=Object.keys(p);for(const r of g){const u=p[r];d&&(u.parentId=d);let h;if(u.doc){let y=i.append("g").attr("id",u.id).attr("class","stateGroup");h=A(u.doc,y,u.id,!c,n,l,x);{y=$(y,u,c);let v=y.node().getBBox();h.width=v.width,h.height=v.height+b.padding/2,T[u.id]={y:b.compositTitleSize}}}else h=L(i,u,a);if(u.note){const y={descriptions:[],id:u.id+"-note",note:u.note,type:"note"},v=L(i,y,a);u.note.position==="left of"?(a.setNode(h.id+"-note",v),a.setNode(h.id,h)):(a.setNode(h.id,h),a.setNode(h.id+"-note",v)),a.setParent(h.id,h.id+"-group"),a.setParent(h.id+"-note",h.id+"-group")}else a.setNode(h.id,h)}S.debug("Count=",a.nodeCount(),a);let m=0;o.forEach(function(r){m++,S.debug("Setting edge",r),a.setEdge(r.id1,r.id2,{relation:r,width:at(r.title),height:b.labelHeight*z.getRows(r.title).length,labelpos:"c"},"id"+m)}),J(a),S.debug("Graph after layout",a.nodes());const B=i.node();a.nodes().forEach(function(r){r!==void 0&&a.node(r)!==void 0?(S.warn("Node "+r+": "+JSON.stringify(a.node(r))),n.select("#"+B.id+" #"+r).attr("transform","translate("+(a.node(r).x-a.node(r).width/2)+","+(a.node(r).y+(T[r]?T[r].y:0)-a.node(r).height/2)+" )"),n.select("#"+B.id+" #"+r).attr("data-x-shift",a.node(r).x-a.node(r).width/2),l.querySelectorAll("#"+B.id+" #"+r+" .divider").forEach(h=>{const y=h.parentElement;let v=0,M=0;y&&(y.parentElement&&(v=y.parentElement.getBBox().width),M=parseInt(y.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",v-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let E=B.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),Q(i,a.edge(r),a.edge(r).relation))}),E=B.getBBox();const k={id:d||"root",label:d||"root",width:0,height:0};return k.width=E.width+2*b.padding,k.height=E.height+2*b.padding,S.debug("Doc rendered",k,a),k},"renderDoc"),it={setConf:V,draw:et},ot={parser:W,get db(){return new N(1)},renderer:it,styles:G,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{ot as diagram};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.
|
|
2
|
-
var V=e=>{throw TypeError(e)};var B=(e,t,r)=>t.has(e)||V("Cannot "+r);var i=(e,t,r)=>(B(e,t,"read from private field"),r?r.call(e):t.get(e)),k=(e,t,r)=>t.has(e)?V("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),w=(e,t,r,n)=>(B(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);import{p as j,b as I,_ as O}from"../chunks/1uq0WVax.js";import{h as N,f as U,e as W,E as X,i as $,k as tt,l as et,m as F,H as rt,n as at,b as A,Z as st,g as f,aK as nt,ax as ot,aL as ct,p as it,a6 as ut,B as dt,aM as mt,G as T,s as lt,a as ft,d as L,c as _t,r as ht,t as vt,u as p}from"../chunks/CD_kQCcy.js";import{h as gt,m as yt,u as bt,s as Et}from"../chunks/wOfVBGZS.js";import{a as E,c as C,f as G,t as Rt}from"../chunks/Dl-inTne.js";import{o as Pt}from"../chunks/BfABZbDO.js";import{i as D}from"../chunks/DteI5BLO.js";import{B as xt}from"../chunks/2wZlHG5k.js";function S(e,t,r){var n;N&&(n=at,U());var o=new xt(e);W(()=>{var c=t()??null;if(N){var a=$(n),s=a===rt,l=c!==null;if(s!==l){var R=tt();et(R),o.anchor=R,F(!1),o.ensure(c,c&&(y=>r(y,c))),F(!0);return}}o.ensure(c,c&&(y=>r(y,c)))},X)}function Ot(e){return class extends Tt{constructor(t){super({component:e,...t})}}}var _,d;class Tt{constructor(t){k(this,_);k(this,d);var c;var r=new Map,n=(a,s)=>{var l=ct(s,!1,!1);return r.set(a,l),l};const o=new Proxy({...t.props||{},$$events:{}},{get(a,s){return f(r.get(s)??n(s,Reflect.get(a,s)))},has(a,s){return s===st?!0:(f(r.get(s)??n(s,Reflect.get(a,s))),Reflect.has(a,s))},set(a,s,l){return A(r.get(s)??n(s,l),l),Reflect.set(a,s,l)}});w(this,d,(t.hydrate?gt:yt)(t.component,{target:t.target,anchor:t.anchor,props:o,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError})),(!((c=t==null?void 0:t.props)!=null&&c.$$host)||t.sync===!1)&&nt(),w(this,_,o.$$events);for(const a of Object.keys(i(this,d)))a==="$set"||a==="$destroy"||a==="$on"||ot(this,a,{get(){return i(this,d)[a]},set(s){i(this,d)[a]=s},enumerable:!0});i(this,d).$set=a=>{Object.assign(o,a)},i(this,d).$destroy=()=>{bt(i(this,d))}}$set(t){i(this,d).$set(t)}$on(t,r){i(this,_)[t]=i(this,_)[t]||[];const n=(...o)=>r.call(this,...o);return i(this,_)[t].push(n),()=>{i(this,_)[t]=i(this,_)[t].filter(o=>o!==n)}}$destroy(){i(this,d).$destroy()}}_=new WeakMap,d=new WeakMap;const Nt={};var At=G('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),kt=G("<!> <!>",1);function wt(e,t){it(t,!0);let r=j(t,"components",23,()=>[]),n=j(t,"data_0",3,null),o=j(t,"data_1",3,null);ut(()=>t.stores.page.set(t.page)),dt(()=>{t.stores,t.page,t.constructors,r(),t.form,n(),o(),t.stores.page.notify()});let c=L(!1),a=L(!1),s=L(null);Pt(()=>{const u=t.stores.page.subscribe(()=>{f(c)&&(A(a,!0),mt().then(()=>{A(s,document.title||"untitled page",!0)}))});return A(c,!0),u});const l=p(()=>t.constructors[1]);var R=kt(),y=T(R);{var Y=u=>{const h=p(()=>t.constructors[0]);var v=C(),P=T(v);S(P,()=>f(h),(g,b)=>{I(b(g,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(m,It)=>{var M=C(),z=T(M);S(z,()=>f(l),(J,Q)=>{I(Q(J,{get data(){return o()},get form(){return t.form},get params(){return t.page.params}}),x=>r()[1]=x,()=>{var x;return(x=r())==null?void 0:x[1]})}),E(m,M)},$$slots:{default:!0}}),m=>r()[0]=m,()=>{var m;return(m=r())==null?void 0:m[0]})}),E(u,v)},K=u=>{const h=p(()=>t.constructors[0]);var v=C(),P=T(v);S(P,()=>f(h),(g,b)=>{I(b(g,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),m=>r()[0]=m,()=>{var m;return(m=r())==null?void 0:m[0]})}),E(u,v)};D(y,u=>{t.constructors[1]?u(Y):u(K,!1)})}var Z=lt(y,2);{var q=u=>{var h=At(),v=_t(h);{var P=g=>{var b=Rt();vt(()=>Et(b,f(s))),E(g,b)};D(v,g=>{f(a)&&g(P)})}ht(h),E(u,h)};D(Z,u=>{f(c)&&u(q)})}E(e,R),ft()}const Ft=Ot(wt),Gt=[()=>O(()=>import("../nodes/0.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.BZ6p9IRV.js","../chunks/Dl-inTne.js","../chunks/CD_kQCcy.js","../chunks/2wZlHG5k.js","../assets/0.xgRkQ1lY.css","../nodes/1.ejshJzsT.js","../chunks/wOfVBGZS.js","../chunks/DpY4-NiY.js","../chunks/BfABZbDO.js","../nodes/2.ZFWOqsMm.js","../chunks/DteI5BLO.js","../chunks/BdoKnygS.js","../nodes/3.BY6KFpqQ.js","../chunks/BFBYzAsj.js","../chunks/1uq0WVax.js","../assets/3.OXdAvKD0.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var V=e=>{throw TypeError(e)};var B=(e,t,r)=>t.has(e)||V("Cannot "+r);var i=(e,t,r)=>(B(e,t,"read from private field"),r?r.call(e):t.get(e)),k=(e,t,r)=>t.has(e)?V("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),w=(e,t,r,n)=>(B(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);import{p as j,b as I,_ as O}from"../chunks/1uq0WVax.js";import{h as N,f as U,e as W,E as X,i as $,k as tt,l as et,m as F,H as rt,n as at,b as A,Z as st,g as f,aK as nt,ax as ot,aL as ct,p as it,a6 as ut,B as dt,aM as mt,G as T,s as lt,a as ft,d as L,c as _t,r as ht,t as vt,u as p}from"../chunks/CD_kQCcy.js";import{h as gt,m as yt,u as bt,s as Et}from"../chunks/wOfVBGZS.js";import{a as E,c as C,f as G,t as Rt}from"../chunks/Dl-inTne.js";import{o as Pt}from"../chunks/BfABZbDO.js";import{i as D}from"../chunks/DteI5BLO.js";import{B as xt}from"../chunks/2wZlHG5k.js";function S(e,t,r){var n;N&&(n=at,U());var o=new xt(e);W(()=>{var c=t()??null;if(N){var a=$(n),s=a===rt,l=c!==null;if(s!==l){var R=tt();et(R),o.anchor=R,F(!1),o.ensure(c,c&&(y=>r(y,c))),F(!0);return}}o.ensure(c,c&&(y=>r(y,c)))},X)}function Ot(e){return class extends Tt{constructor(t){super({component:e,...t})}}}var _,d;class Tt{constructor(t){k(this,_);k(this,d);var c;var r=new Map,n=(a,s)=>{var l=ct(s,!1,!1);return r.set(a,l),l};const o=new Proxy({...t.props||{},$$events:{}},{get(a,s){return f(r.get(s)??n(s,Reflect.get(a,s)))},has(a,s){return s===st?!0:(f(r.get(s)??n(s,Reflect.get(a,s))),Reflect.has(a,s))},set(a,s,l){return A(r.get(s)??n(s,l),l),Reflect.set(a,s,l)}});w(this,d,(t.hydrate?gt:yt)(t.component,{target:t.target,anchor:t.anchor,props:o,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError})),(!((c=t==null?void 0:t.props)!=null&&c.$$host)||t.sync===!1)&&nt(),w(this,_,o.$$events);for(const a of Object.keys(i(this,d)))a==="$set"||a==="$destroy"||a==="$on"||ot(this,a,{get(){return i(this,d)[a]},set(s){i(this,d)[a]=s},enumerable:!0});i(this,d).$set=a=>{Object.assign(o,a)},i(this,d).$destroy=()=>{bt(i(this,d))}}$set(t){i(this,d).$set(t)}$on(t,r){i(this,_)[t]=i(this,_)[t]||[];const n=(...o)=>r.call(this,...o);return i(this,_)[t].push(n),()=>{i(this,_)[t]=i(this,_)[t].filter(o=>o!==n)}}$destroy(){i(this,d).$destroy()}}_=new WeakMap,d=new WeakMap;const Nt={};var At=G('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),kt=G("<!> <!>",1);function wt(e,t){it(t,!0);let r=j(t,"components",23,()=>[]),n=j(t,"data_0",3,null),o=j(t,"data_1",3,null);ut(()=>t.stores.page.set(t.page)),dt(()=>{t.stores,t.page,t.constructors,r(),t.form,n(),o(),t.stores.page.notify()});let c=L(!1),a=L(!1),s=L(null);Pt(()=>{const u=t.stores.page.subscribe(()=>{f(c)&&(A(a,!0),mt().then(()=>{A(s,document.title||"untitled page",!0)}))});return A(c,!0),u});const l=p(()=>t.constructors[1]);var R=kt(),y=T(R);{var Y=u=>{const h=p(()=>t.constructors[0]);var v=C(),P=T(v);S(P,()=>f(h),(g,b)=>{I(b(g,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(m,It)=>{var M=C(),z=T(M);S(z,()=>f(l),(J,Q)=>{I(Q(J,{get data(){return o()},get form(){return t.form},get params(){return t.page.params}}),x=>r()[1]=x,()=>{var x;return(x=r())==null?void 0:x[1]})}),E(m,M)},$$slots:{default:!0}}),m=>r()[0]=m,()=>{var m;return(m=r())==null?void 0:m[0]})}),E(u,v)},K=u=>{const h=p(()=>t.constructors[0]);var v=C(),P=T(v);S(P,()=>f(h),(g,b)=>{I(b(g,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),m=>r()[0]=m,()=>{var m;return(m=r())==null?void 0:m[0]})}),E(u,v)};D(y,u=>{t.constructors[1]?u(Y):u(K,!1)})}var Z=lt(y,2);{var q=u=>{var h=At(),v=_t(h);{var P=g=>{var b=Rt();vt(()=>Et(b,f(s))),E(g,b)};D(v,g=>{f(a)&&g(P)})}ht(h),E(u,h)};D(Z,u=>{f(c)&&u(q)})}E(e,R),ft()}const Ft=Ot(wt),Gt=[()=>O(()=>import("../nodes/0.BZ6p9IRV.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url),()=>O(()=>import("../nodes/1.ejshJzsT.js"),__vite__mapDeps([5,1,2,6,7,8]),import.meta.url),()=>O(()=>import("../nodes/2.ZFWOqsMm.js"),__vite__mapDeps([9,1,2,8,6,10,3,11]),import.meta.url),()=>O(()=>import("../nodes/3.BY6KFpqQ.js"),__vite__mapDeps([12,13,1,2,8,6,10,3,11,14,15]),import.meta.url)],Ht=[],Yt={"/":[-3],"/plan/[sessionId]":[-4]},H={handleError:(({error:e})=>{console.error(e)}),reroute:(()=>{}),transport:{}},jt=Object.fromEntries(Object.entries(H.transport).map(([e,t])=>[e,t.decode])),Kt=Object.fromEntries(Object.entries(H.transport).map(([e,t])=>[e,t.encode])),Zt=!1,qt=(e,t)=>jt[e](t);export{qt as decode,jt as decoders,Yt as dictionary,Kt as encoders,Zt as hash,H as hooks,Nt as matchers,Gt as nodes,Ft as root,Ht as server_loads};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as o,a as r}from"../chunks/DpY4-NiY.js";export{o as load_css,r as start};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as b,f as k}from"../chunks/Dl-inTne.js";import{C as x,a6 as y,B as i,F as $,a7 as l,a8 as B,g as v,a9 as C,W as E,aa as F,p as G,G as W,t as j,a as q,c as u,r as m,s as w}from"../chunks/CD_kQCcy.js";import{s as g}from"../chunks/wOfVBGZS.js";import{s as z,p as _}from"../chunks/
|
|
1
|
+
import{a as b,f as k}from"../chunks/Dl-inTne.js";import{C as x,a6 as y,B as i,F as $,a7 as l,a8 as B,g as v,a9 as C,W as E,aa as F,p as G,G as W,t as j,a as q,c as u,r as m,s as w}from"../chunks/CD_kQCcy.js";import{s as g}from"../chunks/wOfVBGZS.js";import{s as z,p as _}from"../chunks/DpY4-NiY.js";function A(r=!1){const t=x,e=t.l.u;if(!e)return;let a=()=>C(t.s);if(r){let o=0,s={};const c=E(()=>{let n=!1;const p=t.s;for(const f in p)p[f]!==s[f]&&(s[f]=p[f],n=!0);return n&&o++,o});a=()=>v(c)}e.b.length&&y(()=>{d(t,a),l(e.b)}),i(()=>{const o=$(()=>e.m.map(B));return()=>{for(const s of o)typeof s=="function"&&s()}}),e.a.length&&i(()=>{d(t,a),l(e.a)})}function d(r,t){if(r.l.s)for(const e of r.l.s)v(e);t()}F();const D={get error(){return _.error},get status(){return _.status}};z.updated.check;const h=D;var H=k("<h1> </h1> <p> </p>",1);function M(r,t){G(t,!1),A();var e=H(),a=W(e),o=u(a,!0);m(a);var s=w(a,2),c=u(s,!0);m(s),j(()=>{var n;g(o,h.status),g(c,(n=h.error)==null?void 0:n.message)}),b(r,e),q()}export{M as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as i,f as d}from"../chunks/Dl-inTne.js";import{o as R}from"../chunks/BfABZbDO.js";import{p as B,a as M,c as r,s as x,g as e,r as a,b as N,u as P,d as T,t as U}from"../chunks/CD_kQCcy.js";import{s as f}from"../chunks/wOfVBGZS.js";import{i as V}from"../chunks/DteI5BLO.js";import{e as W,s as q,a as z,b as F}from"../chunks/
|
|
1
|
+
import{a as i,f as d}from"../chunks/Dl-inTne.js";import{o as R}from"../chunks/BfABZbDO.js";import{p as B,a as M,c as r,s as x,g as e,r as a,b as N,u as P,d as T,t as U}from"../chunks/CD_kQCcy.js";import{s as f}from"../chunks/wOfVBGZS.js";import{i as V}from"../chunks/DteI5BLO.js";import{e as W,s as q,a as z,b as F}from"../chunks/BdoKnygS.js";var G=d('<div class="bg-surface border-border rounded-lg border p-8 text-center"><p class="text-text-dim mb-2 text-lg">No active sessions</p> <p class="text-text-dim text-sm">Run <code class="bg-surface2 rounded px-1.5 py-0.5 font-mono text-sm text-accent">/create_plan</code> in Claude Code to start a new plan review session.</p> <div class="text-text-dim mt-3 animate-pulse text-xs">Watching for new sessions...</div></div>'),H=d('<a class="bg-surface border-border hover:border-accent/50 flex items-center justify-between rounded-lg border p-5 transition-colors"><div><h2 class="mb-1 text-lg font-semibold"> </h2> <p class="text-text-dim text-sm"> </p></div> <span> </span></a>'),J=d('<div class="space-y-3"></div>'),K=d('<div class="min-h-screen p-8"><div class="mx-auto max-w-4xl"><h1 class="mb-1 text-2xl font-bold">Plan Assistant</h1> <p class="text-text-dim mb-8 text-sm">Review and annotate implementation plans from Claude Code</p> <!></div></div>');function tt(y,b){B(b,!0);let h=T(null),_=P(()=>e(h)??b.data.sessions);async function l(){try{const t=await fetch("/api/sessions");t.ok&&N(h,await t.json(),!0)}catch{}}R(()=>{const t=new EventSource("/api/sse/*");t.addEventListener("sessions-updated",()=>l()),t.addEventListener("plan-updated",()=>l());const s=setInterval(l,1e4);return()=>{t.close(),clearInterval(s)}});function S(t){return new Date(t).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})}var c=K(),g=r(c),C=x(r(g),4);{var k=t=>{var s=G();i(t,s)},D=t=>{var s=J();W(s,21,()=>e(_),p=>p.id,(p,o)=>{var n=H(),v=r(n),m=r(v),E=r(m,!0);a(m);var w=x(m,2),L=r(w);a(w),a(v);var u=x(v,2),j=r(u,!0);a(u),a(n),U((A,I)=>{z(n,"href",`/plan/${e(o).id??""}`),f(E,e(o).planTitle),f(L,`v${e(o).planVersion??""} · ${A??""}`),F(u,1,`inline-block rounded-full px-3 py-1 text-xs font-semibold ${I??""}`),f(j,e(o).status)},[()=>S(e(o).updatedAt),()=>q(e(o).status)]),i(p,n)}),a(s),i(t,s)};V(C,t=>{e(_).length===0?t(k):t(D,!1)})}a(g),a(c),i(y,c),M()}export{tt as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as m}from"../chunks/BFBYzAsj.js";export{m as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"
|
|
1
|
+
{"version":"1772793347683"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const index = 0;
|
|
2
2
|
let component_cache;
|
|
3
3
|
const component = async () => component_cache ??= (await import('./_layout.svelte-D_wzPsk8.js')).default;
|
|
4
|
-
const imports = ["_app/immutable/nodes/0.
|
|
5
|
-
const stylesheets = ["_app/immutable/assets/0.
|
|
4
|
+
const imports = ["_app/immutable/nodes/0.BZ6p9IRV.js","_app/immutable/chunks/Dl-inTne.js","_app/immutable/chunks/CD_kQCcy.js","_app/immutable/chunks/2wZlHG5k.js"];
|
|
5
|
+
const stylesheets = ["_app/immutable/assets/0.xgRkQ1lY.css"];
|
|
6
6
|
const fonts = [];
|
|
7
7
|
|
|
8
8
|
export { component, fonts, imports, index, stylesheets };
|
|
9
|
-
//# sourceMappingURL=0-
|
|
9
|
+
//# sourceMappingURL=0-F8UDIQlw.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"0-
|
|
1
|
+
{"version":3,"file":"0-F8UDIQlw.js","sources":["../../../.svelte-kit/adapter-node/nodes/0.js"],"sourcesContent":["\n\nexport const index = 0;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/_layout.svelte.js')).default;\nexport const imports = [\"_app/immutable/nodes/0.BZ6p9IRV.js\",\"_app/immutable/chunks/Dl-inTne.js\",\"_app/immutable/chunks/CD_kQCcy.js\",\"_app/immutable/chunks/2wZlHG5k.js\"];\nexport const stylesheets = [\"_app/immutable/assets/0.xgRkQ1lY.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG;AACrB,IAAI,eAAe;AACP,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,8BAAoC,CAAC,EAAE;AAClG,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC;AAC5J,MAAC,WAAW,GAAG,CAAC,sCAAsC;AACtD,MAAC,KAAK,GAAG;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const index = 1;
|
|
2
2
|
let component_cache;
|
|
3
3
|
const component = async () => component_cache ??= (await import('./error.svelte-DItLqhaS.js')).default;
|
|
4
|
-
const imports = ["_app/immutable/nodes/1.
|
|
4
|
+
const imports = ["_app/immutable/nodes/1.ejshJzsT.js","_app/immutable/chunks/Dl-inTne.js","_app/immutable/chunks/CD_kQCcy.js","_app/immutable/chunks/wOfVBGZS.js","_app/immutable/chunks/DpY4-NiY.js","_app/immutable/chunks/BfABZbDO.js"];
|
|
5
5
|
const stylesheets = [];
|
|
6
6
|
const fonts = [];
|
|
7
7
|
|
|
8
8
|
export { component, fonts, imports, index, stylesheets };
|
|
9
|
-
//# sourceMappingURL=1-
|
|
9
|
+
//# sourceMappingURL=1-DuleYJMw.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"1-
|
|
1
|
+
{"version":3,"file":"1-DuleYJMw.js","sources":["../../../.svelte-kit/adapter-node/nodes/1.js"],"sourcesContent":["\n\nexport const index = 1;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/fallbacks/error.svelte.js')).default;\nexport const imports = [\"_app/immutable/nodes/1.ejshJzsT.js\",\"_app/immutable/chunks/Dl-inTne.js\",\"_app/immutable/chunks/CD_kQCcy.js\",\"_app/immutable/chunks/wOfVBGZS.js\",\"_app/immutable/chunks/DpY4-NiY.js\",\"_app/immutable/chunks/BfABZbDO.js\"];\nexport const stylesheets = [];\nexport const fonts = [];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG;AACrB,IAAI,eAAe;AACP,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAsC,CAAC,EAAE;AACpG,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC;AACpO,MAAC,WAAW,GAAG;AACf,MAAC,KAAK,GAAG;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as listSessions } from './session-manager-
|
|
1
|
+
import { l as listSessions } from './session-manager-Vdr0BxAo.js';
|
|
2
2
|
import 'node:fs';
|
|
3
3
|
import 'node:path';
|
|
4
4
|
import 'node:os';
|
|
@@ -16,11 +16,11 @@ var _page_server_ts = /*#__PURE__*/Object.freeze({
|
|
|
16
16
|
|
|
17
17
|
const index = 2;
|
|
18
18
|
let component_cache;
|
|
19
|
-
const component = async () => component_cache ??= (await import('./_page.svelte-
|
|
19
|
+
const component = async () => component_cache ??= (await import('./_page.svelte-ByTjHRUq.js')).default;
|
|
20
20
|
const server_id = "src/routes/+page.server.ts";
|
|
21
|
-
const imports = ["_app/immutable/nodes/2.
|
|
21
|
+
const imports = ["_app/immutable/nodes/2.ZFWOqsMm.js","_app/immutable/chunks/Dl-inTne.js","_app/immutable/chunks/CD_kQCcy.js","_app/immutable/chunks/BfABZbDO.js","_app/immutable/chunks/wOfVBGZS.js","_app/immutable/chunks/DteI5BLO.js","_app/immutable/chunks/2wZlHG5k.js","_app/immutable/chunks/BdoKnygS.js"];
|
|
22
22
|
const stylesheets = [];
|
|
23
23
|
const fonts = [];
|
|
24
24
|
|
|
25
25
|
export { component, fonts, imports, index, _page_server_ts as server, server_id, stylesheets };
|
|
26
|
-
//# sourceMappingURL=2-
|
|
26
|
+
//# sourceMappingURL=2-tND4IT0j.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2-
|
|
1
|
+
{"version":3,"file":"2-tND4IT0j.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/_page.server.ts.js","../../../.svelte-kit/adapter-node/nodes/2.js"],"sourcesContent":["import { l as listSessions } from \"../../chunks/session-manager.js\";\nconst load = async () => {\n return {\n sessions: listSessions()\n };\n};\nexport {\n load\n};\n","import * as server from '../entries/pages/_page.server.ts.js';\n\nexport const index = 2;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/_page.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/+page.server.ts\";\nexport const imports = [\"_app/immutable/nodes/2.ZFWOqsMm.js\",\"_app/immutable/chunks/Dl-inTne.js\",\"_app/immutable/chunks/CD_kQCcy.js\",\"_app/immutable/chunks/BfABZbDO.js\",\"_app/immutable/chunks/wOfVBGZS.js\",\"_app/immutable/chunks/DteI5BLO.js\",\"_app/immutable/chunks/2wZlHG5k.js\",\"_app/immutable/chunks/BdoKnygS.js\"];\nexport const stylesheets = [];\nexport const fonts = [];\n"],"names":[],"mappings":";;;;;AACA,MAAM,IAAI,GAAG,YAAY;AACzB,EAAE,OAAO;AACT,IAAI,QAAQ,EAAE,YAAY;AAC1B,GAAG;AACH,CAAC;;;;;;;ACHW,MAAC,KAAK,GAAG;AACrB,IAAI,eAAe;AACP,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAkC,CAAC,EAAE;AAEhG,MAAC,SAAS,GAAG;AACb,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC;AAC5S,MAAC,WAAW,GAAG;AACf,MAAC,KAAK,GAAG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { e as error } from './index-CoD1IJuy.js';
|
|
2
|
-
import { a as getSession, b as getPlan, c as getFeedback, d as listVersions } from './session-manager-
|
|
2
|
+
import { a as getSession, b as getPlan, c as getFeedback, d as listVersions } from './session-manager-Vdr0BxAo.js';
|
|
3
3
|
import 'node:fs';
|
|
4
4
|
import 'node:path';
|
|
5
5
|
import 'node:os';
|
|
@@ -26,11 +26,11 @@ var _page_server_ts = /*#__PURE__*/Object.freeze({
|
|
|
26
26
|
|
|
27
27
|
const index = 3;
|
|
28
28
|
let component_cache;
|
|
29
|
-
const component = async () => component_cache ??= (await import('./_page.svelte-
|
|
29
|
+
const component = async () => component_cache ??= (await import('./_page.svelte-BHgQV7I4.js')).default;
|
|
30
30
|
const server_id = "src/routes/plan/[sessionId]/+page.server.ts";
|
|
31
|
-
const imports = ["_app/immutable/nodes/3.
|
|
31
|
+
const imports = ["_app/immutable/nodes/3.BY6KFpqQ.js","_app/immutable/chunks/BFBYzAsj.js","_app/immutable/chunks/Dl-inTne.js","_app/immutable/chunks/CD_kQCcy.js","_app/immutable/chunks/BfABZbDO.js","_app/immutable/chunks/wOfVBGZS.js","_app/immutable/chunks/DteI5BLO.js","_app/immutable/chunks/2wZlHG5k.js","_app/immutable/chunks/BdoKnygS.js","_app/immutable/chunks/1uq0WVax.js"];
|
|
32
32
|
const stylesheets = ["_app/immutable/assets/3.OXdAvKD0.css"];
|
|
33
33
|
const fonts = [];
|
|
34
34
|
|
|
35
35
|
export { component, fonts, imports, index, _page_server_ts as server, server_id, stylesheets };
|
|
36
|
-
//# sourceMappingURL=3-
|
|
36
|
+
//# sourceMappingURL=3-BaEfaEMw.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3-
|
|
1
|
+
{"version":3,"file":"3-BaEfaEMw.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/plan/_sessionId_/_page.server.ts.js","../../../.svelte-kit/adapter-node/nodes/3.js"],"sourcesContent":["import { error } from \"@sveltejs/kit\";\nimport { a as getSession, b as getPlan, d as getFeedback, e as listVersions } from \"../../../../chunks/session-manager.js\";\nconst load = async ({ params }) => {\n const session = getSession(params.sessionId);\n if (!session) throw error(404, \"Session not found\");\n const plan = getPlan(params.sessionId);\n const feedback = getFeedback(params.sessionId);\n const versions = listVersions(params.sessionId);\n return {\n session,\n plan,\n feedback,\n versions,\n sessionId: params.sessionId\n };\n};\nexport {\n load\n};\n","import * as server from '../entries/pages/plan/_sessionId_/_page.server.ts.js';\n\nexport const index = 3;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/plan/_sessionId_/_page.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/plan/[sessionId]/+page.server.ts\";\nexport const imports = [\"_app/immutable/nodes/3.BY6KFpqQ.js\",\"_app/immutable/chunks/BFBYzAsj.js\",\"_app/immutable/chunks/Dl-inTne.js\",\"_app/immutable/chunks/CD_kQCcy.js\",\"_app/immutable/chunks/BfABZbDO.js\",\"_app/immutable/chunks/wOfVBGZS.js\",\"_app/immutable/chunks/DteI5BLO.js\",\"_app/immutable/chunks/2wZlHG5k.js\",\"_app/immutable/chunks/BdoKnygS.js\",\"_app/immutable/chunks/1uq0WVax.js\"];\nexport const stylesheets = [\"_app/immutable/assets/3.OXdAvKD0.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":";;;;;;AAEA,MAAM,IAAI,GAAG,OAAO,EAAE,MAAM,EAAE,KAAK;AACnC,EAAE,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC;AAC9C,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,KAAK,CAAC,GAAG,EAAE,mBAAmB,CAAC;AACrD,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC;AACxC,EAAE,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC;AAChD,EAAE,MAAM,QAAQ,GAAG,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC;AACjD,EAAE,OAAO;AACT,IAAI,OAAO;AACX,IAAI,IAAI;AACR,IAAI,QAAQ;AACZ,IAAI,QAAQ;AACZ,IAAI,SAAS,EAAE,MAAM,CAAC;AACtB,GAAG;AACH,CAAC;;;;;;;ACbW,MAAC,KAAK,GAAG;AACrB,IAAI,eAAe;AACP,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAmD,CAAC,EAAE;AAEjH,MAAC,SAAS,GAAG;AACb,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC;AACpX,MAAC,WAAW,GAAG,CAAC,sCAAsC;AACtD,MAAC,KAAK,GAAG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a8 as ensure_array_like, a9 as attr, aa as stringify, c as escape_html, a3 as derived, ac as attr_style, ab as attr_class, ad as clsx } from './index-DzKdq15H.js';
|
|
2
|
-
import { a as statusBadgeClass } from './status-
|
|
2
|
+
import { a as statusBadgeClass, b as statusLabel, S as STATUS_LABELS } from './status-BV9je7QE.js';
|
|
3
3
|
import { marked } from 'marked';
|
|
4
4
|
|
|
5
5
|
function html(value) {
|
|
@@ -7,10 +7,11 @@ function html(value) {
|
|
|
7
7
|
var open = "<!---->";
|
|
8
8
|
return open + html2 + "<!---->";
|
|
9
9
|
}
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
let
|
|
13
|
-
|
|
10
|
+
let instance$1 = null;
|
|
11
|
+
function createPlanStore() {
|
|
12
|
+
let currentPlan = null;
|
|
13
|
+
let eventSource = null;
|
|
14
|
+
let reconnectTimer = null;
|
|
14
15
|
return {
|
|
15
16
|
get plan() {
|
|
16
17
|
return currentPlan;
|
|
@@ -18,10 +19,10 @@ function getPlanStore() {
|
|
|
18
19
|
set(plan) {
|
|
19
20
|
currentPlan = plan;
|
|
20
21
|
},
|
|
21
|
-
connectSSE(
|
|
22
|
+
connectSSE(sessionId) {
|
|
22
23
|
this.disconnectSSE();
|
|
23
24
|
const connect = () => {
|
|
24
|
-
eventSource = new EventSource(`/api/sse/${
|
|
25
|
+
eventSource = new EventSource(`/api/sse/${sessionId}`);
|
|
25
26
|
eventSource.addEventListener("plan-updated", (event) => {
|
|
26
27
|
try {
|
|
27
28
|
const plan = JSON.parse(event.data);
|
|
@@ -48,28 +49,33 @@ function getPlanStore() {
|
|
|
48
49
|
}
|
|
49
50
|
};
|
|
50
51
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
function getPlanStore() {
|
|
53
|
+
if (!instance$1) instance$1 = createPlanStore();
|
|
54
|
+
return instance$1;
|
|
55
|
+
}
|
|
54
56
|
function genId() {
|
|
55
57
|
return "fb-" + Date.now().toString(36) + Math.random().toString(36).slice(2, 6);
|
|
56
58
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
let instance = null;
|
|
60
|
+
function createFeedbackStore() {
|
|
61
|
+
let currentFeedback = null;
|
|
62
|
+
let saveTimer = null;
|
|
63
|
+
let sessionId = "";
|
|
64
|
+
async function persistFeedback() {
|
|
65
|
+
if (!currentFeedback || !sessionId) return;
|
|
66
|
+
try {
|
|
67
|
+
await fetch(`/api/sessions/${sessionId}/feedback`, {
|
|
68
|
+
method: "PUT",
|
|
69
|
+
headers: { "Content-Type": "application/json" },
|
|
70
|
+
body: JSON.stringify(currentFeedback)
|
|
71
|
+
});
|
|
72
|
+
} catch {
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function debouncedSave() {
|
|
76
|
+
if (saveTimer) clearTimeout(saveTimer);
|
|
77
|
+
saveTimer = setTimeout(persistFeedback, 500);
|
|
66
78
|
}
|
|
67
|
-
}
|
|
68
|
-
function debouncedSave() {
|
|
69
|
-
if (saveTimer) clearTimeout(saveTimer);
|
|
70
|
-
saveTimer = setTimeout(persistFeedback, 500);
|
|
71
|
-
}
|
|
72
|
-
function getFeedbackStore() {
|
|
73
79
|
return {
|
|
74
80
|
get feedback() {
|
|
75
81
|
return currentFeedback;
|
|
@@ -181,6 +187,10 @@ function getFeedbackStore() {
|
|
|
181
187
|
}
|
|
182
188
|
};
|
|
183
189
|
}
|
|
190
|
+
function getFeedbackStore() {
|
|
191
|
+
if (!instance) instance = createFeedbackStore();
|
|
192
|
+
return instance;
|
|
193
|
+
}
|
|
184
194
|
function PlanHeader($$renderer, $$props) {
|
|
185
195
|
$$renderer.component(($$renderer2) => {
|
|
186
196
|
let { meta, status } = $$props;
|
|
@@ -204,22 +214,12 @@ function PlanHeader($$renderer, $$props) {
|
|
|
204
214
|
function PhaseTable($$renderer, $$props) {
|
|
205
215
|
$$renderer.component(($$renderer2) => {
|
|
206
216
|
let { phases, phaseStatuses } = $$props;
|
|
207
|
-
function badgeLabel(status) {
|
|
208
|
-
switch (status) {
|
|
209
|
-
case "approved":
|
|
210
|
-
return "Approved";
|
|
211
|
-
case "needs-work":
|
|
212
|
-
return "Needs Work";
|
|
213
|
-
default:
|
|
214
|
-
return "Pending";
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
217
|
$$renderer2.push(`<div class="overflow-x-auto"><table class="w-full text-sm"><thead><tr><th class="bg-surface2 border-b border-border px-3 py-2 text-left font-semibold">Phase</th><th class="bg-surface2 border-b border-border px-3 py-2 text-left font-semibold">Focus</th><th class="bg-surface2 border-b border-border px-3 py-2 text-left font-semibold w-32">Status</th></tr></thead><tbody><!--[-->`);
|
|
218
218
|
const each_array = ensure_array_like(phases);
|
|
219
219
|
for (let $$index = 0, $$length = each_array.length; $$index < $$length; $$index++) {
|
|
220
220
|
let phase = each_array[$$index];
|
|
221
221
|
const status = phaseStatuses[phase.id]?.status ?? "pending";
|
|
222
|
-
$$renderer2.push(`<tr${attr_class("hover:bg-surface transition-colors", void 0, { "opacity-50": status === "approved" })}><td class="border-b border-border px-3 py-2 font-medium">Phase ${escape_html(phase.number)}: ${escape_html(phase.name)}</td><td class="text-text-dim border-b border-border px-3 py-2">${escape_html(phase.overview.length > 100 ? phase.overview.slice(0, 100) + "..." : phase.overview)}</td><td class="border-b border-border px-3 py-2"><button${attr_class(`inline-block cursor-pointer rounded-full px-2 py-0.5 text-xs font-semibold ${stringify(statusBadgeClass(status))}`)}>${escape_html(
|
|
222
|
+
$$renderer2.push(`<tr${attr_class("hover:bg-surface transition-colors", void 0, { "opacity-50": status === "approved" })}><td class="border-b border-border px-3 py-2 font-medium">Phase ${escape_html(phase.number)}: ${escape_html(phase.name)}</td><td class="text-text-dim border-b border-border px-3 py-2">${escape_html(phase.overview.length > 100 ? phase.overview.slice(0, 100) + "..." : phase.overview)}</td><td class="border-b border-border px-3 py-2"><button${attr_class(`inline-block cursor-pointer rounded-full px-2 py-0.5 text-xs font-semibold ${stringify(statusBadgeClass(status))}`)}>${escape_html(statusLabel(status))}</button></td></tr>`);
|
|
223
223
|
}
|
|
224
224
|
$$renderer2.push(`<!--]--></tbody></table></div>`);
|
|
225
225
|
});
|
|
@@ -251,23 +251,16 @@ function MarkdownBlock($$renderer, $$props) {
|
|
|
251
251
|
function PhaseStatusControl($$renderer, $$props) {
|
|
252
252
|
$$renderer.component(($$renderer2) => {
|
|
253
253
|
let { status, onSetStatus } = $$props;
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
value: "needs-work",
|
|
267
|
-
label: "Needs Work",
|
|
268
|
-
color: "bg-orange/15 text-orange border-orange/30"
|
|
269
|
-
}
|
|
270
|
-
];
|
|
254
|
+
const STATE_COLORS = {
|
|
255
|
+
"pending": "bg-accent/15 text-accent border-accent/30",
|
|
256
|
+
"approved": "bg-green/15 text-green border-green/30",
|
|
257
|
+
"needs-work": "bg-orange/15 text-orange border-orange/30"
|
|
258
|
+
};
|
|
259
|
+
const states = Object.keys(STATUS_LABELS).map((value) => ({
|
|
260
|
+
value,
|
|
261
|
+
label: STATUS_LABELS[value],
|
|
262
|
+
color: STATE_COLORS[value]
|
|
263
|
+
}));
|
|
271
264
|
$$renderer2.push(`<div class="flex gap-1" role="radiogroup" aria-label="Phase status"><!--[-->`);
|
|
272
265
|
const each_array = ensure_array_like(states);
|
|
273
266
|
for (let $$index = 0, $$length = each_array.length; $$index < $$length; $$index++) {
|
|
@@ -512,13 +505,24 @@ function HoverToolbar($$renderer, $$props) {
|
|
|
512
505
|
}
|
|
513
506
|
function ApprovalBar($$renderer, $$props) {
|
|
514
507
|
$$renderer.component(($$renderer2) => {
|
|
515
|
-
let { commentCount } = $$props;
|
|
508
|
+
let { status, commentCount, computedStatus } = $$props;
|
|
516
509
|
$$renderer2.push(`<div role="toolbar" aria-label="Review actions" class="fixed right-0 bottom-0 left-0 z-40 border-t border-border bg-surface px-6 py-3"><div class="mx-auto flex max-w-5xl items-center justify-between pr-80"><div class="text-text-dim text-sm">`);
|
|
517
|
-
{
|
|
510
|
+
if (commentCount > 0) {
|
|
511
|
+
$$renderer2.push("<!--[1-->");
|
|
512
|
+
$$renderer2.push(`<span class="text-orange">${escape_html(commentCount)} unresolved comment${escape_html(commentCount !== 1 ? "s" : "")}</span> <span class="ml-2">— will submit as <span class="font-semibold text-orange">needs-work</span></span>`);
|
|
513
|
+
} else {
|
|
514
|
+
$$renderer2.push("<!--[!-->");
|
|
515
|
+
$$renderer2.push(`<span class="text-text-dim">No unresolved comments — will submit as <span class="font-semibold text-green">approved</span></span>`);
|
|
516
|
+
}
|
|
517
|
+
$$renderer2.push(`<!--]--></div> <div class="flex gap-3">`);
|
|
518
|
+
if (status !== "approved" && status !== "needs-work") {
|
|
519
|
+
$$renderer2.push("<!--[-->");
|
|
520
|
+
$$renderer2.push(`<button${attr_class(`cursor-pointer rounded-lg px-5 py-2 text-sm font-semibold transition-colors ${stringify(computedStatus === "approved" ? "bg-green text-white hover:brightness-110" : "bg-orange/15 text-orange hover:bg-orange/25")}`)} aria-label="Submit feedback">Submit Feedback</button>`);
|
|
521
|
+
} else {
|
|
518
522
|
$$renderer2.push("<!--[!-->");
|
|
519
|
-
$$renderer2.push(
|
|
523
|
+
$$renderer2.push(`<span${attr_class(`rounded-lg px-5 py-2 text-sm font-semibold ${stringify(status === "approved" ? "bg-green/15 text-green" : "bg-orange/15 text-orange")}`)}>${escape_html(status === "approved" ? "Approved ✓" : "Changes requested")}</span>`);
|
|
520
524
|
}
|
|
521
|
-
$$renderer2.push(`<!--]--></div
|
|
525
|
+
$$renderer2.push(`<!--]--></div></div></div>`);
|
|
522
526
|
});
|
|
523
527
|
}
|
|
524
528
|
function _page($$renderer, $$props) {
|
|
@@ -546,6 +550,8 @@ function _page($$renderer, $$props) {
|
|
|
546
550
|
let plan = derived(() => planStore.plan);
|
|
547
551
|
if (plan()) {
|
|
548
552
|
$$renderer2.push("<!--[-->");
|
|
553
|
+
const unresolvedCount = feedbackStore.comments.filter((c) => !c.resolved).length;
|
|
554
|
+
const computedStatus = unresolvedCount > 0 ? "needs-work" : "approved";
|
|
549
555
|
ProgressBar($$renderer2, {
|
|
550
556
|
phases: plan().phases,
|
|
551
557
|
phaseStatuses: feedbackStore.phaseStatuses
|
|
@@ -712,10 +718,11 @@ function _page($$renderer, $$props) {
|
|
|
712
718
|
FeedbackPanel($$renderer2, {
|
|
713
719
|
comments: feedbackStore.comments
|
|
714
720
|
});
|
|
715
|
-
$$renderer2.push(`<!---->
|
|
721
|
+
$$renderer2.push(`<!----> `);
|
|
716
722
|
ApprovalBar($$renderer2, {
|
|
717
723
|
status: feedbackStore.status,
|
|
718
|
-
commentCount:
|
|
724
|
+
commentCount: unresolvedCount,
|
|
725
|
+
computedStatus
|
|
719
726
|
});
|
|
720
727
|
$$renderer2.push(`<!----> <div class="sr-only" aria-live="polite"></div>`);
|
|
721
728
|
} else {
|
|
@@ -727,4 +734,4 @@ function _page($$renderer, $$props) {
|
|
|
727
734
|
}
|
|
728
735
|
|
|
729
736
|
export { _page as default };
|
|
730
|
-
//# sourceMappingURL=_page.svelte-
|
|
737
|
+
//# sourceMappingURL=_page.svelte-BHgQV7I4.js.map
|