agentic-mermaid 0.3.0 → 0.3.1
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/CHANGELOG.md +14 -0
- package/dist/agent-core.d.ts +8 -3
- package/dist/agent-core.js +2 -2
- package/dist/agent.d.ts +2 -2
- package/dist/agent.js +4 -4
- package/dist/agentic-mermaid-mcp.js +5 -5
- package/dist/am.js +6 -6
- package/dist/browser-lazy/chunks/architecture-3CGEU363.js +31 -0
- package/dist/browser-lazy/chunks/chunk-2U4EUPSI.js +4 -0
- package/dist/browser-lazy/chunks/chunk-4IUBLBJJ.js +11 -0
- package/dist/browser-lazy/chunks/chunk-4U2TVB2S.js +1 -0
- package/dist/browser-lazy/chunks/chunk-5Q4S74UO.js +1 -0
- package/dist/browser-lazy/chunks/chunk-6UT2VTFI.js +1 -0
- package/dist/browser-lazy/chunks/chunk-7D24ZLOV.js +1 -0
- package/dist/browser-lazy/chunks/chunk-A7L4WWVW.js +143 -0
- package/dist/browser-lazy/chunks/chunk-CTVVJPMX.js +24 -0
- package/dist/browser-lazy/chunks/chunk-DPSSG7LR.js +4 -0
- package/dist/browser-lazy/chunks/chunk-EPFMQPXX.js +1 -0
- package/dist/browser-lazy/chunks/chunk-FFOHLPDA.js +2 -0
- package/dist/browser-lazy/chunks/chunk-FLD63DXE.js +2 -0
- package/dist/browser-lazy/chunks/chunk-FXBBGAMJ.js +46 -0
- package/dist/browser-lazy/chunks/chunk-GRXCKTHX.js +0 -0
- package/dist/browser-lazy/chunks/chunk-HZ4ADQMK.js +1 -0
- package/dist/browser-lazy/chunks/chunk-I6VE56S7.js +1 -0
- package/dist/browser-lazy/chunks/chunk-JX5ZZY3T.js +1 -0
- package/dist/browser-lazy/chunks/chunk-KJVNXJ5Y.js +1 -0
- package/dist/browser-lazy/chunks/chunk-KTTWXSIX.js +1 -0
- package/dist/browser-lazy/chunks/chunk-M6BT2HIP.js +1 -0
- package/dist/browser-lazy/chunks/chunk-MMWVZP6M.js +1 -0
- package/dist/browser-lazy/chunks/chunk-OFRMKQA6.js +1 -0
- package/dist/browser-lazy/chunks/chunk-P7HMSKHJ.js +1 -0
- package/dist/browser-lazy/chunks/chunk-PXRUFH7U.js +1 -0
- package/dist/browser-lazy/chunks/chunk-PZEWZT35.js +1 -0
- package/dist/browser-lazy/chunks/chunk-RVO6J7S3.js +1 -0
- package/dist/browser-lazy/chunks/chunk-STQRDZ67.js +1 -0
- package/dist/browser-lazy/chunks/chunk-T7IJ6V4B.js +3 -0
- package/dist/browser-lazy/chunks/chunk-VDTSULBU.js +7 -0
- package/dist/browser-lazy/chunks/chunk-WEUWIFG3.js +1 -0
- package/dist/browser-lazy/chunks/class-B3AVLSIF.js +9 -0
- package/dist/browser-lazy/chunks/er-AF4BKKKC.js +9 -0
- package/dist/browser-lazy/chunks/flowchart-BE6BQZLZ.js +4 -0
- package/dist/browser-lazy/chunks/gantt-U4BMMSEL.js +28 -0
- package/dist/browser-lazy/chunks/gitgraph-UPSWNFRP.js +8 -0
- package/dist/browser-lazy/chunks/journey-PDZ7FDJR.js +40 -0
- package/dist/browser-lazy/chunks/mindmap-BFEUURLS.js +9 -0
- package/dist/browser-lazy/chunks/pie-ZFYW5JZO.js +19 -0
- package/dist/browser-lazy/chunks/quadrant-XJVEYYXK.js +24 -0
- package/dist/browser-lazy/chunks/radar-OVXFNRNC.js +32 -0
- package/dist/browser-lazy/chunks/render-core-R4ZGGEFS.js +12 -0
- package/dist/browser-lazy/chunks/sequence-AWY6JCSB.js +12 -0
- package/dist/browser-lazy/chunks/state-TCE4DXKR.js +4 -0
- package/dist/browser-lazy/chunks/timeline-W4ZVT3FF.js +20 -0
- package/dist/browser-lazy/chunks/xychart-K3QQACKS.js +36 -0
- package/dist/browser-lazy/index.d.ts +1012 -0
- package/dist/browser-lazy/index.js +1 -0
- package/dist/browser.global.js +322 -321
- package/dist/{chunk-AVCWKYII.js → chunk-BSVM3VMO.js} +18 -5
- package/dist/{chunk-HFD4MALA.js → chunk-FGO3J7RA.js} +7 -7
- package/dist/{chunk-UJNY65QS.js → chunk-JJ7JRYZV.js} +2 -2
- package/dist/{chunk-3QCXO4V6.js → chunk-KQMJ37OY.js} +4 -4
- package/dist/{chunk-GILQUGFK.js → chunk-MBIR6S3B.js} +2 -2
- package/dist/{chunk-WHYJLDYG.js → chunk-XVY324NY.js} +47736 -47665
- package/dist/{index-CLwYn6Im.d.ts → index-Do8z5rPq.d.ts} +5409 -5391
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp-cli-7FLGTEG3.js +17 -0
- package/docs/README.md +1 -1
- package/docs/browser.md +355 -47
- package/package.json +13 -3
- package/server.json +2 -2
- package/dist/mcp-cli-SJVOGRA6.js +0 -17
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import"./chunk-2U4EUPSI.js";import"./chunk-T7IJ6V4B.js";import{a as te}from"./chunk-WEUWIFG3.js";import{c as Yt,d as et}from"./chunk-A7L4WWVW.js";import"./chunk-KJVNXJ5Y.js";import{a as Jt}from"./chunk-DPSSG7LR.js";import{e as $t}from"./chunk-MMWVZP6M.js";import"./chunk-FFOHLPDA.js";import{a as oe}from"./chunk-I6VE56S7.js";import{b as Ut}from"./chunk-FLD63DXE.js";import{a as jt,e as bt,j as K,k as Vt}from"./chunk-RVO6J7S3.js";import{a as zt,b as Xt,c as Kt}from"./chunk-EPFMQPXX.js";import{G as Zt,H as qt,I as Qt,N as lt,O as nt,ia as tt,ja as ee,ka as ne,na as Ft,oa as ae,qa as re,xa as ie}from"./chunk-FXBBGAMJ.js";import"./chunk-P7HMSKHJ.js";var Re=Object.freeze({id:"gantt",upstreamId:"gantt",maturity:"stable",label:"Gantt",headers:["gantt"],aliases:[],config:{section:"gantt",keys:["displayMode","barHeight","topAxis","tickInterval","axisFormat","barGap","topPadding","leftPadding","gridLineStartPadding","fontSize","sectionFontSize","numberSectionStyles","todayMarker","weekday"],noopKeys:["barGap","topPadding","leftPadding","gridLineStartPadding","fontSize","sectionFontSize","numberSectionStyles","todayMarker","weekday"]},identity:{id:"family:gantt",kind:"family",version:"1.0.0",compatibility:{core:"^0.3.0"},provenance:{owner:"agentic-mermaid",source:"built-in"}},collisionPriority:100,semanticChannels:["status","progress","emphasis","category"],semanticRoles:["prelude","defs","chrome","section","grid","axis","label","task","milestone","edge","marker-line","title"],scenePrimitiveEvidence:[{role:"prelude",primitive:"document",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"defs",primitive:"document",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"defs",primitive:"marker",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"chrome",primitive:"document",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"section",primitive:"text",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"section",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"grid",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"axis",primitive:"text",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"label",primitive:"text",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"task",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"milestone",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"edge",primitive:"connector",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"marker-line",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"title",primitive:"text",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]}],example:`gantt
|
|
2
|
+
title Plan
|
|
3
|
+
dateFormat YYYY-MM-DD
|
|
4
|
+
section Build
|
|
5
|
+
Implement :a1, 2026-01-05, 5d
|
|
6
|
+
Review :after a1, 2d`,detect:t=>/^gantt\s*$/.test(t),detectLoose:t=>/^gantt(?:\s|$)/.test(t)}),se=Re;var $=class extends Error{code;line;constructor(e,r,n){super(`${e}: ${r}`),this.name="GanttError",this.code=e,this.line=n}};var We=["active","done","crit","milestone","vert"],ce=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],Et=/^(\d+(?:\.\d+)?)(ms|s|m|h|d|w|M|y)$/,le=/^([1-9][0-9]*)(millisecond|second|minute|hour|day|week|month)$/;function Pe(t){let e=t.split(",").map(d=>d.trim());if(e.some(d=>d.length===0))return null;let r=[],n=0;for(;n<e.length&&We.includes(e[n]);){let d=e[n];if(r.includes(d))return null;r.push(d),n++}let i=e.slice(n);if(i.length===0||i.length>3)return null;let o=d=>{let l=d.match(/^after\s+(.+)$/);return l?{kind:"after",refs:l[1].split(/\s+/).filter(Boolean)}:{kind:"date",raw:d}},s=d=>{let l=d.match(/^until\s+(.+)$/);return l?{kind:"until",refs:l[1].split(/\s+/).filter(Boolean)}:Et.test(d)?{kind:"duration",raw:d}:{kind:"date",raw:d}};if(i.length===1)return{tags:r,end:s(i[0])};if(i.length===2)return{tags:r,start:o(i[0]),end:s(i[1])};let a=i[0];return/^[\w-]+$/.test(a)?{tags:r,id:a,start:o(i[1]),end:s(i[2])}:null}function de(t){return t.split(/[,\s]+/).filter(Boolean).map(e=>{let r=e.toLowerCase();return r==="weekends"?{kind:"weekends"}:ce.includes(r)?{kind:"weekday",day:r}:{kind:"date",raw:e}})}var U={title:/^title\s+(.+)$/i,dateFormat:/^dateFormat\s+(.+)$/i,axisFormat:/^axisFormat\s+(.+)$/i,tickInterval:/^tickInterval\s+(.+)$/i,excludes:/^excludes\s+(.+)$/i,includes:/^includes\s+(.+)$/i,todayMarker:/^todayMarker\s+(.+)$/i,weekday:/^weekday\s+(.+)$/i,weekend:/^weekend\s+(.+)$/i,section:/^section\s+(.+)$/i,click:/^click\s+([\w-]+)\s+(href|call)\s+(.+)$/i};function ue(t){let e=Ut(t);if(e.unclosedIndex!==void 0)throw new $("GANTT_BAD_DIRECTIVE","Unclosed accDescr block",e.unclosedIndex+1);t=e.familyLines;let r=(t[0]??"").trim();if(!/^gantt\s*$/i.test(r))throw new $("GANTT_BAD_DIRECTIVE",`Expected "gantt" header, got "${r}"`,1);let n={dateFormat:"YYYY-MM-DD",inclusiveEndDates:!1,topAxis:!1,excludes:[],includes:[],weekendStart:"saturday",weekStart:"sunday",sections:[{taskIndexes:[]}],tasks:[],clicks:[],...e.accessibility.title!==void 0?{accTitle:e.accessibility.title}:{},...e.accessibility.descr!==void 0?{accDescr:e.accessibility.descr.replace(/\s*\n\s*/g," ")}:{}},i=new Set,o=0;for(let s=1;s<t.length;s++){let a=t[s].trim(),d=s+1;if(!a||a.startsWith("%%"))continue;let l;if(l=a.match(U.title)){n.title=l[1].trim();continue}if(l=a.match(U.dateFormat)){n.dateFormat=l[1].trim();continue}if(l=a.match(U.axisFormat)){n.axisFormat=l[1].trim();continue}if(l=a.match(U.tickInterval)){let u=l[1].trim().match(le);u&&(n.tickInterval={count:Number(u[1]),unit:u[2]});continue}if(/^inclusiveEndDates\s*$/i.test(a)){n.inclusiveEndDates=!0;continue}if(/^topAxis\s*$/i.test(a)){n.topAxis=!0;continue}if(l=a.match(U.excludes)){n.excludes.push(...de(l[1].trim()));continue}if(l=a.match(U.includes)){n.includes.push(...de(l[1].trim()));continue}if(l=a.match(U.todayMarker)){let u=l[1].trim();n.todayMarker=u.toLowerCase()==="off"?{off:!0}:{off:!1,style:u};continue}if(l=a.match(U.weekday)){let u=l[1].trim().toLowerCase();if(!ce.includes(u))throw new $("GANTT_BAD_DIRECTIVE",`Invalid weekday "${l[1].trim()}"`,d);n.weekStart=u;continue}if(l=a.match(U.weekend)){let u=l[1].trim().toLowerCase();if(u!=="friday"&&u!=="saturday")throw new $("GANTT_BAD_DIRECTIVE",`Invalid weekend "${l[1].trim()}" (friday or saturday)`,d);n.weekendStart=u;continue}if(l=a.match(U.click)){n.clicks.push({taskId:l[1],action:l[2].toLowerCase(),rest:l[3].trim(),line:d});continue}if(l=a.match(U.section)){n.sections.push({label:l[1].trim(),taskIndexes:[],line:d}),o=n.sections.length-1;continue}let x=a.indexOf(":");if(x>0&&x<a.length-1){let u=a.slice(0,x).trim(),S=a.slice(x+1).trim(),f=Pe(S);if(!f)throw new $("GANTT_BAD_TASK",`Invalid task metadata "${S}"`,d);if(!u)throw new $("GANTT_BAD_TASK","Task label is empty",d);if(f.id!==void 0){if(i.has(f.id))throw new $("GANTT_DUPLICATE_TASK_ID",`Duplicate task id "${f.id}"`,d);i.add(f.id)}let M={index:n.tasks.length,id:f.id,label:u,tags:f.tags,start:f.start,end:f.end,sectionIndex:o,line:d};n.tasks.push(M),n.sections[o].taskIndexes.push(M.index);continue}throw new $("GANTT_BAD_DIRECTIVE",`Unrecognized gantt line "${a}"`,d)}return n}function Tt(t){if(!t)return{};let e={},r=et(t,["displayMode"]),o=(Yt(t,["gantt"])?et(t,["gantt","displayMode"]):void 0)??r;typeof o=="string"&&o.toLowerCase()==="compact"&&(e.displayMode="compact");let s=et(t,["gantt","barHeight"]);typeof s=="number"&&Number.isFinite(s)&&s>0&&(e.barHeight=s),et(t,["gantt","topAxis"])===!0&&(e.topAxis=!0);let d=et(t,["gantt","axisFormat"]);typeof d=="string"&&(e.axisFormat=d);let l=et(t,["gantt","tickInterval"]);if(typeof l=="string"){let x=l.match(le);x&&(e.tickInterval={count:Number(x[1]),unit:x[2]})}return e}function fe(t,e){return e.displayMode&&(t.displayMode=e.displayMode),e.barHeight!==void 0&&(t.barHeight=e.barHeight),e.topAxis&&(t.topAxis=!0),e.axisFormat!==void 0&&t.axisFormat===void 0&&(t.axisFormat=e.axisFormat),e.tickInterval!==void 0&&t.tickInterval===void 0&&(t.tickInterval=e.tickInterval),t}var I=864e5,pe=1e4;function Mt(t){return Math.floor(t/I)}function ut(t){return Mt(t)*I}function rt(t){return((Mt(t)+4)%7+7)%7}var vt={sunday:0,monday:1,tuesday:2,wednesday:3,thursday:4,friday:5,saturday:6};function Be(t,e,r,n=0,i=0,o=0,s=0){if(e<1||e>12||r<1||r>31||n<0||n>23||i<0||i>59||o<0||o>59)return null;let a=Date.UTC(t,e-1,r,n,i,o,s),d=new Date(a);return d.getUTCFullYear()!==t||d.getUTCMonth()!==e-1||d.getUTCDate()!==r?null:a}var Oe=["YYYY","YY","MM","M","DD","D","HH","H","mm","m","ss","s","SSS","X","x"],Ne=new Set(["HH","H","mm","m","ss","s","SSS","X","x"]);function he(t){let e=[],r=0;t:for(;r<t.length;){for(let n of Oe)if(t.startsWith(n,r)){e.push({kind:"field",field:n}),r+=n.length;continue t}e.push({kind:"literal",text:t[r]}),r++}return e}function He(t){return!he(t).some(e=>e.kind==="field"&&Ne.has(e.field))}function at(t,e){let r=he(e),n=0,i={},o=(s,a)=>{let d=0;for(;d<a&&n+d<t.length&&t[n+d]>="0"&&t[n+d]<="9";)d++;if(d<s)return null;let l=Number(t.slice(n,n+d));return n+=d,l};for(let s of r){if(s.kind==="literal"){if(t[n]!==s.text)return null;n++;continue}switch(s.field){case"YYYY":{let a=o(4,4);if(a===null)return null;i.year=a;break}case"YY":{let a=o(2,2);if(a===null)return null;i.year=2e3+a;break}case"MM":{let a=o(2,2);if(a===null)return null;i.month=a;break}case"M":{let a=o(1,2);if(a===null)return null;i.month=a;break}case"DD":{let a=o(2,2);if(a===null)return null;i.day=a;break}case"D":{let a=o(1,2);if(a===null)return null;i.day=a;break}case"HH":{let a=o(2,2);if(a===null)return null;i.hour=a;break}case"H":{let a=o(1,2);if(a===null)return null;i.hour=a;break}case"mm":{let a=o(2,2);if(a===null)return null;i.minute=a;break}case"m":{let a=o(1,2);if(a===null)return null;i.minute=a;break}case"ss":{let a=o(2,2);if(a===null)return null;i.second=a;break}case"s":{let a=o(1,2);if(a===null)return null;i.second=a;break}case"SSS":{let a=o(3,3);if(a===null)return null;i.msec=a;break}case"X":{let a=o(1,11);if(a===null)return null;i.unix=a;break}case"x":{let a=o(1,14);if(a===null)return null;i.unixMs=a;break}}}return n!==t.length?null:i.unixMs!==void 0?i.unixMs:i.unix!==void 0?i.unix*1e3:Be(i.year??1970,i.month??1,i.day??1,i.hour??0,i.minute??0,i.second??0,i.msec??0)}var Ue={ms:1,s:1e3,m:6e4,h:36e5,d:I,w:7*I};function Ye(t,e){let r=e.match(Et);if(!r)return null;let n=Number(r[1]),i=r[2];if(!Number.isFinite(n))return null;if(i==="M"||i==="y"){let o=i==="y"?n*12:n,s=Math.trunc(o),a=o-s,d=new Date(t),l=d.getUTCMonth()+s,x=new Date(Date.UTC(d.getUTCFullYear(),l,1,d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds())),u=new Date(Date.UTC(x.getUTCFullYear(),x.getUTCMonth()+1,0)).getUTCDate();x.setUTCDate(Math.min(d.getUTCDate(),u));let S=x.getTime();return a>0&&(S+=Math.round(a*30*I)),S}return t+Math.round(n*Ue[i])}function ze(t){return{dateFormat:t.dateFormat,inclusiveEndDates:t.inclusiveEndDates,excludes:t.excludes,includes:t.includes,weekendStart:t.weekendStart,weekStart:t.weekStart}}function me(t,e){let r=new Set,n=new Set,i=!1;for(let o of t){if(o.kind==="weekends"){i=!0;continue}if(o.kind==="weekday"){n.add(vt[o.day]);continue}let s=at(o.raw,e.dateFormat)??at(o.raw,"YYYY-MM-DD");if(s===null)throw new $("GANTT_BAD_DATE",`Invalid calendar date "${o.raw}" for dateFormat "${e.dateFormat}"`);r.add(Mt(s))}return{days:r,weekdays:n,weekends:i}}function Xe(t){let e=me(t.excludes,t),r=me(t.includes,t),n=t.weekendStart==="friday"?[5,6]:[6,0];return i=>{let o=Mt(i),s=rt(i);return r.days.has(o)||r.weekdays.has(s)||r.weekends&&n.includes(s)?!1:!!(e.days.has(o)||e.weekdays.has(s)||e.weekends&&n.includes(s))}}function Ke(t,e,r,n){let i=t+I,o=e,s=e,a=!1,d=0;for(;i<=o;){if(++d>pe)throw new $("GANTT_SCHEDULE_OVERFLOW",`Calendar exclusion walk exceeded ${pe} days (is every day excluded?)`,n);a||(s=o),a=r(i),a&&(o+=I),i+=I}return{end:o,renderEnd:s}}function je(t,e,r){let n=[];if(t.start===void 0&&r&&n.push(r.index),t.start?.kind==="after")for(let i of t.start.refs){let o=e.get(i);if(!o)throw new $("GANTT_UNKNOWN_TASK_REF",`Task "${t.label}" starts after unknown id "${i}"`,t.line);n.push(o.index)}if(t.end.kind==="until")for(let i of t.end.refs){let o=e.get(i);if(!o)throw new $("GANTT_UNKNOWN_TASK_REF",`Task "${t.label}" runs until unknown id "${i}"`,t.line);n.push(o.index)}return n}function Ve(t,e,r){let n=new Array(t).fill(0),i=[],o=s=>{n[s]=1,i.push(s);for(let a of e[s])if(n[a]===0)o(a);else if(n[a]===1){let d=i.indexOf(a),l=i.slice(d).concat(a).map(r);throw new $("GANTT_DEPENDENCY_CYCLE",`Dependency cycle: ${l.join(" -> ")}`)}i.pop(),n[s]=2};for(let s=0;s<t;s++)n[s]===0&&o(s)}function ge(t,e={}){let r=ze(t),n=Xe(r),i=He(t.dateFormat),o=new Map;for(let f of t.tasks)f.id!==void 0&&o.set(f.id,f);let s=t.tasks.map((f,M)=>je(f,o,t.tasks[M-1]));Ve(t.tasks.length,s,f=>t.tasks[f].id??t.tasks[f].label);let a=new Array(t.tasks.length),d=f=>{if(a[f.index])return a[f.index];for(let g of s[f.index])a[g]||d(t.tasks[g]);let M;if(f.start===void 0){let g=f.index>0?a[f.index-1]:void 0;if(!g)throw new $("GANTT_NO_START",`Task "${f.label}" has no start date and no previous task to follow`,f.line);M=g.end}else if(f.start.kind==="after")M=Math.max(...f.start.refs.map(g=>a[o.get(g).index].end));else{let g=at(f.start.raw,t.dateFormat);if(g===null)throw new $("GANTT_BAD_DATE",`Invalid start date "${f.start.raw}" for dateFormat "${t.dateFormat}"`,f.line);M=g}let G,m=!1;if(f.end.kind==="until")G=Math.min(...f.end.refs.map(g=>a[o.get(g).index].start)),m=!0;else if(f.end.kind==="duration"){let g=Ye(M,f.end.raw);if(g===null)throw new $("GANTT_BAD_DURATION",`Invalid duration "${f.end.raw}"`,f.line);G=g}else{let g=at(f.end.raw,t.dateFormat);if(g===null)throw new $("GANTT_BAD_DATE",`Invalid end date "${f.end.raw}" for dateFormat "${t.dateFormat}"`,f.line);G=r.inclusiveEndDates&&i?g+I:g,m=!0}let D=G;if(!m&&r.excludes.length>0){let g=Ke(M,G,n,f.line);G=g.end,D=g.renderEnd}G<M&&(G=M),D<M&&(D=M),D>G&&(D=G);let F={index:f.index,id:f.id,label:f.label,tags:f.tags,sectionIndex:f.sectionIndex,start:M,end:G,renderEnd:D,manualEnd:m,line:f.line};return a[f.index]=F,F};for(let f of t.tasks)d(f);let l=a;if(l.length===0)throw new $("GANTT_EMPTY","Gantt diagram has no tasks");let x=1/0,u=-1/0;for(let f of l)x=Math.min(x,f.start),u=Math.max(u,f.renderEnd);u===x&&(u=x+(i?I:36e5));let S;if(e.today!==void 0&&!t.todayMarker?.off){let f=at(e.today,t.dateFormat)??at(e.today,"YYYY-MM-DD");if(f===null)throw new $("GANTT_BAD_DATE",`Invalid clock value "${e.today}" for dateFormat "${t.dateFormat}"`);S=f}return{tasks:l,timeMin:x,timeMax:u,dateOnly:i,today:S,analysis:Je(t,l,o),isExcludedDay:n}}function ye(t){let e=new Map;for(let o of t.tasks)o.id!==void 0&&e.set(o.id,o);let r=[],n=new Set,i=(o,s,a)=>{let d=`${o}>${s}:${a}`;n.has(d)||(n.add(d),r.push({from:o,to:s,kind:a}))};for(let o of t.tasks){if(o.start?.kind==="after")for(let s of o.start.refs){let a=e.get(s);a&&i(a.index,o.index,"after")}if(o.end.kind==="until")for(let s of o.end.refs){let a=e.get(s);a&&i(o.index,a.index,"until")}}return r}function Je(t,e,r){let n=[],i=new Set;for(let m of t.tasks){if(m.start?.kind==="after")for(let D of m.start.refs){let F=r.get(D);n.push({from:F.index,to:m.index}),i.add(F.index)}if(m.end.kind==="until")for(let D of m.end.refs)i.add(r.get(D).index)}if(n.length===0)return;let o=Math.min(...e.map(m=>m.start)),s=Math.max(...e.map(m=>m.end)),a=e.map(()=>[]);for(let m of n)a[m.from].push(m.to);let d=new Array(e.length).fill(Number.NaN),l=m=>{if(!Number.isNaN(d[m]))return d[m];let D=a[m],F=s;for(let g of D){let v=e[g].end-e[g].start;F=Math.min(F,l(g)-v)}return d[m]=F,F};for(let m=0;m<e.length;m++)l(m);let x={},u=new Set;for(let m of n)u.add(m.from),u.add(m.to);let S=[];for(let m of e){let D=d[m.index]-m.end;m.id!==void 0&&(x[m.id]=D),u.has(m.index)&&D===0&&m.id!==void 0&&S.push(m.id)}let f=new Set(n.map(m=>m.to)),M=e.filter(m=>m.id!==void 0&&!f.has(m.index)).map(m=>m.id),G=e.filter(m=>m.id!==void 0&&!i.has(m.index)).map(m=>m.id);return{criticalPathTaskIds:S,slackByTaskId:x,projectStart:o,projectEnd:s,entryTaskIds:M,sinkTaskIds:G}}var Ze=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],qe=["January","February","March","April","May","June","July","August","September","October","November","December"],Qe=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],tn=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Ct(t,e){let r=new Date(t),n=(a,d=2)=>String(a).padStart(d,"0"),i=()=>{let a=Date.UTC(r.getUTCFullYear(),0,1);return Math.floor((t-a)/I)+1},o=a=>{let d=Date.UTC(r.getUTCFullYear(),0,1),x=(7+rt(d)-a)%7;return Math.floor((i()-1+x)/7)},s="";for(let a=0;a<e.length;a++){let d=e[a];if(d!=="%"){s+=d;continue}let l=e[++a];switch(l){case"Y":s+=String(r.getUTCFullYear());break;case"y":s+=n(r.getUTCFullYear()%100);break;case"m":s+=n(r.getUTCMonth()+1);break;case"d":s+=n(r.getUTCDate());break;case"e":s+=String(r.getUTCDate()).padStart(2," ");break;case"b":s+=Ze[r.getUTCMonth()];break;case"B":s+=qe[r.getUTCMonth()];break;case"a":s+=Qe[rt(t)];break;case"A":s+=tn[rt(t)];break;case"H":s+=n(r.getUTCHours());break;case"I":s+=n((r.getUTCHours()+11)%12+1);break;case"M":s+=n(r.getUTCMinutes());break;case"S":s+=n(r.getUTCSeconds());break;case"L":s+=n(r.getUTCMilliseconds(),3);break;case"p":s+=r.getUTCHours()<12?"AM":"PM";break;case"j":s+=n(i(),3);break;case"U":s+=n(o(0));break;case"W":s+=n(o(1));break;case"%":s+="%";break;default:s+=l===void 0?"%":`%${l}`}}return s}var Rt=120,xe=220,en=1e4,W={plotWidth:600,padding:16,titleHeight:34,axisHeight:24,rowGap:8,sectionGap:6,barHeight:22,labelGap:12,labelFontSize:13,sectionFontSize:13},nn={nodeLabelFontSize:W.labelFontSize,edgeLabelFontSize:11,groupHeaderFontSize:W.sectionFontSize,nodeLabelFontWeight:500,edgeLabelFontWeight:500,groupHeaderFontWeight:600,nodePaddingX:0,nodePaddingY:0,nodeLineWidth:bt.innerBox,edgeLineWidth:bt.connector,groupCornerRadius:0,groupPaddingX:0,groupPaddingY:0,groupLineWidth:bt.outerBox},pt={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:I,week:7*I,month:30*I},At=[{unit:"minute",count:1,format:"%H:%M"},{unit:"minute",count:15,format:"%H:%M"},{unit:"hour",count:1,format:"%H:%M"},{unit:"hour",count:6,format:"%H:%M"},{unit:"day",count:1,format:"%m-%d"},{unit:"week",count:1,format:"%m-%d"},{unit:"week",count:2,format:"%m-%d"},{unit:"month",count:1,format:"%b %Y"},{unit:"month",count:3,format:"%b %Y"},{unit:"month",count:12,format:"%Y"}],an=/<\/?(?:b|strong|i|em|u|s|del)\s*>/gi;function Wt(t={},e){return Vt(t,nn,e)}function Pt(t){return Math.max(17,t.groupHeaderFontSize)}function Te(t){let e=Me(t);return e===W.titleHeight?18:e/2}function Bt(t){return Math.max(10,t.edgeLabelFontSize*.75)}function mt(t,e,r,n=0){let i=t.replace(an,""),o=[...i].length,s=Math.max(0,o-1)*n;return Math.max(0,jt(i,e,r)+s)}function Me(t){return Math.max(W.titleHeight,Math.ceil(Pt(t)*1.3)+8)}function rn(t){return Math.max(W.axisHeight,Math.ceil(Bt(t)+t.edgeLabelFontSize*.65+4))}function on(t,e){let r=Math.max(t.nodeLabelFontSize,t.groupHeaderFontSize)*1.3;return Math.ceil(Math.max(e,r))+W.rowGap}function sn(t,e,r=8){let n=t.timeMax-t.timeMin;if(e.tickInterval){let s=pt[e.tickInterval.unit]*e.tickInterval.count;if(n/s<=Rt)return{...e.tickInterval,format:e.axisFormat??dn(e.tickInterval.unit)}}for(let s of At){let a=pt[s.unit]*s.count;if(n/a<=r)return{unit:s.unit,count:s.count,format:e.axisFormat??s.format}}let i=At[At.length-1],o=i.count;for(;n/(pt.month*o)>Rt;)o*=2;return{unit:"month",count:o,format:e.axisFormat??i.format}}function dn(t){switch(t){case"millisecond":case"second":return"%H:%M:%S";case"minute":case"hour":return"%H:%M";case"day":case"week":return"%m-%d";case"month":return"%b %Y"}}function cn(t,e,r){if(e.unit==="week"){let i=ut(t),o=0;for(;rt(i)!==r&&o++<7;)i-=I;return i}if(e.unit==="month"){let i=new Date(t);return Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),1)}if(e.unit==="day")return ut(t);let n=pt[e.unit]*e.count;return Math.floor(t/n)*n}function ln(t,e){if(e.unit==="month"){let r=new Date(t);return Date.UTC(r.getUTCFullYear(),r.getUTCMonth()+e.count,1)}return t+pt[e.unit]*e.count}function un(t,e,r=8){let n=sn(t,e,r),i=vt[e.weekStart],o=[],s=cn(t.timeMin,n,i),a=0;for(;s<=t.timeMax&&a++<=Rt;)s>=t.timeMin&&o.push({time:s,label:Ct(s,n.format)}),s=ln(s,n);return o.length===0&&o.push({time:t.timeMin,label:Ct(t.timeMin,n.format)}),o}function fn(t){let e=[],r=[];for(let n of t){let i=e.findIndex(o=>o<=n.start);i===-1?(i=e.length,e.push(n.end)):e[i]=n.end,r.push(i)}return r}var we=8,E=.01;function _t(t){return t.milestoneX!==void 0?{x:t.milestoneX-t.h/2,y:t.y,w:t.h,h:t.h}:{x:t.x,y:t.y,w:t.w,h:t.h}}function pn(t,e,r,n){let[i,o]=e<=r?[e,r]:[r,e];return t>n.y+E&&t<n.y+n.h-E&&o>n.x+E&&i<n.x+n.w-E}function Ot(t,e,r,n){let[i,o]=e<=r?[e,r]:[r,e];return t>n.x+E&&t<n.x+n.w-E&&o>n.y+E&&i<n.y+n.h-E}function ft(t,e,r){return Math.abs(t.x-e.x)<=E?r.some(n=>Ot(t.x,t.y,e.y,n)):r.some(n=>pn(t.y,t.x,e.x,n))}function mn(t){return t.map(e=>({y:e.y,h:e.h})).sort((e,r)=>e.y-r.y)}function ke(t,e){return t.findIndex(r=>e>=r.y-E&&e<=r.y+r.h+E)}function Lt(t,e,r){let n=t[e].y+t[e].h,i=e+1<t.length?t[e+1].y:r.y+r.h;return(n+i)/2}function It(t,e,r){let n=t[e].y;return((e>0?t[e-1].y+t[e-1].h:r.y)+n)/2}function hn(t,e,r,n){let i=we,o=r.x-i,s=r.x+r.w+i,a=e.filter(u=>u.y<t.y+t.h-E&&u.y+u.h>t.y+E),d=new Set([o]);for(let u of a)d.add(Math.max(o,Math.min(s,u.x-i))),d.add(Math.max(o,Math.min(s,u.x+u.w+i)));let l=o,x=1/0;for(let u of d){if(a.some(f=>Ot(u,t.y-1,t.y+t.h+1,f)))continue;let S=Math.abs(u-n);(S<x-E||Math.abs(S-x)<=E&&u<l)&&(l=u,x=S)}return l}function gn(t){let e=[];for(let r of t){let n=e[e.length-1];if(n&&Math.abs(n.x-r.x)<=E&&Math.abs(n.y-r.y)<=E)continue;e.push({x:r.x,y:r.y});let i=e.length;if(i>=3){let o=e[i-3],s=e[i-2],a=e[i-1];(Math.abs(o.x-s.x)<=E&&Math.abs(s.x-a.x)<=E||Math.abs(o.y-s.y)<=E&&Math.abs(s.y-a.y)<=E)&&e.splice(i-2,1)}}return e}function yn(t,e,r,n,i){let o=we,s=t.rect,a=e.rect,d=s.y+s.h/2,l=a.y+a.h/2,x=ke(n,d),u=ke(n,l);if(x===-1||u===-1)return null;let S=x===u,f=S||u>x,M=f?Lt(n,x,i):It(n,x,i),G=S?M:f?It(n,u,i):Lt(n,u,i),m=[],D=s.x+s.w,F=[{x:D,y:d},{x:D+o,y:d},{x:D+o,y:M}];if(!ft(F[0],F[1],r)&&!ft(F[1],F[2],r))m.push(...F);else{let _=t.tipX??(s.w>=2*o?D-o:s.x+s.w/2);m.push({x:_,y:f?s.y+s.h:s.y},{x:_,y:M})}let g=m[m.length-1].x,v=a.x-o;if(!S){let _=f?1:-1;for(let O=x+_;O!==u;O+=_){let N=n[O];if(r.some(V=>Ot(g,N.y-1,N.y+N.h+1,V))){let V=f?It(n,O,i):Lt(n,O,i),J=hn(N,r,i,v);m.push({x:g,y:V},{x:J,y:V}),g=J}}}let Y=a.x-o,B=[{x:Y,y:G},{x:Y,y:l},{x:a.x,y:l}],j,C;if(!ft(B[0],B[1],r)&&!ft(B[1],B[2],r))C=B,j="right";else{let _=e.tipX??(a.w>=2*o?a.x+o:a.x+a.w/2),O=G<a.y;C=[{x:_,y:G},{x:_,y:O?a.y:a.y+a.h}],j=O?"down":"up"}m.push({x:g,y:G},...C);let z=gn(m);for(let _=1;_<z.length;_++)if(ft(z[_-1],z[_],r))return null;return{points:z,arrowDir:j}}function xn(t,e,r,n,i){let o=ye(t);if(o.length===0)return[];let s=new Map(r.map(u=>[u.taskIndex,u])),a=r.map(_t),d=mn(n),l=new Set(e.analysis?.criticalPathTaskIds??[]),x=[];for(let u of o){let S=s.get(u.from),f=s.get(u.to);if(!S||!f)continue;let M=yn({rect:_t(S),tipX:S.milestoneX},{rect:_t(f),tipX:f.milestoneX},a,d,i);if(!M)continue;let G=e.tasks[u.from],m=e.tasks[u.to],D=u.kind==="after"&&G.id!==void 0&&m.id!==void 0&&l.has(G.id)&&l.has(m.id)&&G.end===m.start;x.push({fromTaskIndex:u.from,toTaskIndex:u.to,kind:u.kind,critical:D,points:M.points,arrowDir:M.arrowDir})}return x}function be(t,e,r,n,i){let o=K(t,e),s=mt(o,r,n,i);if(s<=xe)return{lines:[o],width:s};let a=Jt(o,xe,r,n).split(`
|
|
7
|
+
`);return{lines:a,width:Math.max(...a.map(d=>mt(d,r,n,i)))}}function Se(t,e,r={}){let n=Wt(r.renderOptions,r.styleFace),i=r.compact??t.displayMode==="compact",o=r.barHeight??t.barHeight??W.barHeight,s=on(n,o),a=e.tasks.filter(p=>p.tags.includes("vert")),d=e.tasks.filter(p=>!p.tags.includes("vert")),l=new Map,x=new Map,u=0;for(let p of d)if(i){let b=K(p.label,n.nodeTextTransform);u=Math.max(u,mt(b,n.nodeLabelFontSize,n.nodeLabelFontWeight,n.nodeLetterSpacing))}else{let b=be(p.label,n.nodeTextTransform,n.nodeLabelFontSize,n.nodeLabelFontWeight,n.nodeLetterSpacing);l.set(p.index,b),u=Math.max(u,b.width)}for(let p=0;p<t.sections.length;p++){let b=t.sections[p];if(b.label){let T=be(b.label,n.groupTextTransform,n.groupHeaderFontSize,n.groupHeaderFontWeight,n.groupLetterSpacing);x.set(p,T),u=Math.max(u,T.width)}}u=Math.ceil(u)+W.labelGap;let S=r.width??W.padding*2+u+W.plotWidth,f=W.padding+u,M=Math.max(120,S-f-W.padding),G=t.title?Me(n):0,m=rn(n),D=t.topAxis?m:0,F=W.padding+G+D,g=e.timeMax-e.timeMin,v=p=>f+(p-e.timeMin)/g*M,Y=[],B=[],j=[],C=F,z=(p,b)=>p<=1?s:Math.max(s,Math.ceil(o/2+(p-.5)*b)+W.rowGap),_=n.nodeLabelFontSize*1.3,O=n.groupHeaderFontSize*1.3;for(let p=0;p<t.sections.length;p++){let b=t.sections[p],T=d.filter(w=>w.sectionIndex===p);if(T.length===0&&b.label===void 0)continue;let A=j.length,L=C,Z=B.length,H=x.get(p)?.lines;b.label!==void 0&&(C+=z(H?.length??1,O));let Q=i?fn(T):T.map((w,P)=>P),X=T.length===0?0:Math.max(...Q)+1,R=[];if(i)for(let w=0;w<X;w++)R.push({barIndexes:[],sectionIndex:A,y:C+w*s,h:o});else{let w=C;for(let P of T)R.push({barIndexes:[],sectionIndex:A,y:w,h:o}),w+=z(l.get(P.index)?.lines.length??1,_)}if(T.forEach((w,P)=>{let kt=Q[P],it=R[kt],ot=v(w.start),st=Math.max(w.renderEnd>w.start?2:0,v(w.renderEnd)-ot),dt=w.tags.includes("milestone"),ct;if(dt){let Nt=o/2,Ht=f+Nt,Ie=Math.max(Ht,f+M-Nt);ct=Math.min(Ie,Math.max(Ht,ot+st/2))}let Dt=l.get(w.index)?.lines;Y.push({taskIndex:w.index,id:w.id,label:w.label,tags:w.tags,sectionIndex:A,x:ot,y:it.y,w:st,h:o,milestoneX:ct,rowIndex:Z+(b.label!==void 0?1:0)+kt,start:w.start,end:w.renderEnd,...Dt&&Dt.length>1?{labelLines:Dt}:{}}),it.barIndexes.push(Y.length-1)}),B.push(...R),i)C+=X*s;else for(let w of T)C+=z(l.get(w.index)?.lines.length??1,_);j.push({label:b.label,y:L,h:C-L,rowStart:Z,rowEnd:B.length,...H&&H.length>1?{labelLines:H}:{}}),C+=W.sectionGap}let N=Math.max(s,C-F),V=F+N+m+W.padding,J=un(e,t).map(p=>({time:p.time,x:v(p.time),label:p.label})),ht=a.map(p=>({taskIndex:p.index,label:p.label,x:v(p.start+(p.renderEnd-p.start)/2),time:p.start})),gt=r.today!==void 0&&r.today>=e.timeMin&&r.today<=e.timeMax?v(r.today):void 0,yt=[];if(t.excludes.length>0&&e.dateOnly&&(e.timeMax-ut(e.timeMin))/I<=en){let p,b=T=>{if(p===void 0)return;let A=Math.max(p,e.timeMin),L=Math.min(T,e.timeMax);L>A&&yt.push({x:v(A),w:v(L)-v(A),start:A,end:L}),p=void 0};for(let T=ut(e.timeMin);T<e.timeMax;T+=I)e.isExcludedDay(T)?p===void 0&&(p=T):b(T);b(e.timeMax)}let Gt=new Set(e.analysis?.criticalPathTaskIds??[]),xt=e.tasks.filter(p=>p.id!==void 0&&Gt.has(p.id)).map(p=>p.index),c=xn(t,e,Y,B,{x:f,y:F,w:M,h:N}),k=new Map(t.tasks.flatMap(p=>p.id?[[p.id,p.index]]:[])),y=t.clicks.flatMap(p=>{if(p.action!=="href")return[];let b=k.get(p.taskId),T=p.rest.match(/^"((?:\\.|[^"])*)"|^(\S+)/)?.slice(1).find(Boolean);return b===void 0||!T||!/^(?:https?:|mailto:)/i.test(T)?[]:[{taskIndex:b,href:T.replace(/\\(["\\])/g,"$1")}]});return{title:t.title,width:S,height:V,plot:{x:f,y:F,w:M,h:N},labelColumnWidth:u,rows:B,sections:j,bars:Y,links:y,verts:ht,ticks:J,dependencies:c,criticalTaskIndexes:xt,excludedBands:yt,topAxis:t.topAxis,todayX:gt,...t.todayMarker?.style!==void 0?{todayMarkerStyle:t.todayMarker.style}:{},timeMin:e.timeMin,timeMax:e.timeMax,dateOnly:e.dateOnly,compact:i,barHeight:o}}function Ge(t,e,r={}){let n=fe(ue(t),e),i=ge(n,r.clock),o=Se(n,i,{...r.layout,today:i.today});return{model:n,schedule:i,positioned:o}}var kn=["stroke","stroke-width","opacity","stroke-dasharray"],bn=/^[#\w][\w#(),.%\s/-]*$/;function De(t){let e=[],r=[],n=te(t);for(let[i,o]of Object.entries(n)){let s=i.toLowerCase();if(!kn.includes(s)||!bn.test(o)){r.push(s);continue}e.push([s,o])}return{applied:e,ignored:r}}function Fe(t){return t.applied.map(([e,r])=>`${e}:${r}`).join(";")}var wt={barRadius:3};function _e(t){return{groupFill:t.groupFillColor??"var(--surface, var(--fg))",groupOpacity:t.groupFillColor?"1":"0.07",excludedFill:t.edgeStrokeColor??"var(--muted, var(--line, var(--fg)))",edgeStroke:t.edgeStrokeColor??"var(--line, var(--border, var(--fg)))",nodeFill:t.nodeFillColor??"var(--accent, var(--fg))",nodeBorder:t.nodeBorderColor??"var(--fg)",doneFill:t.nodeFillColor??"var(--muted, var(--line, var(--fg)))",criticalFill:t.nodeFillColor??"var(--fg)",criticalStroke:t.nodeBorderColor??t.edgeStrokeColor??"var(--accent, var(--fg))",titleFill:t.groupTextColor??t.nodeTextColor??"var(--fg)",groupText:t.groupTextColor??t.nodeTextColor??"var(--fg)",taskText:t.nodeTextColor??"var(--fg)",axisText:t.edgeTextColor??t.groupTextColor??"var(--muted, var(--fg))"}}var Tn={dependencyArrows:!1,criticalBars:!1,criticalArrows:!1},Mn={excludedBands:!1,milestoneDone:!1,milestoneActive:!1};function wn(t,e=Tn,r=Mn){let n=_e(t),i=[];r.excludedBands&&i.push(` .gantt-excluded-band { fill: ${n.excludedFill}; opacity: 0.1; }`),r.milestoneDone&&i.push(` .gantt-milestone-done { fill: ${n.doneFill}; opacity: ${t.nodeFillColor?"0.72":"0.55"}; }`),r.milestoneActive&&i.push(` .gantt-milestone-active { fill: ${n.nodeFill}; stroke: ${n.nodeBorder}; stroke-width: ${Math.max(1.5,t.nodeLineWidth)}; opacity: 1; }`),e.dependencyArrows&&i.push(` .gantt-dep-arrow { fill: none; stroke: ${n.edgeStroke}; stroke-width: ${Math.max(1.2,t.lineWidth)}; opacity: 0.6; }`),e.criticalArrows&&i.push(` .gantt-dep-arrow-crit { stroke: ${n.criticalStroke}; stroke-width: ${Math.max(1.8,t.lineWidth*1.5)}; opacity: 0.95; }`),e.criticalBars&&i.push(` .gantt-bar-critical-path { stroke: ${n.criticalStroke}; stroke-width: ${Math.max(2,t.nodeLineWidth*1.5)}; }`);let o=i.length>0?`${i.join(`
|
|
8
|
+
`)}
|
|
9
|
+
`:"";return`<style>
|
|
10
|
+
.gantt-section-band { fill: ${n.groupFill}; opacity: ${n.groupOpacity}; }
|
|
11
|
+
.gantt-grid-line { stroke: ${n.edgeStroke}; stroke-width: ${t.lineWidth}; opacity: ${t.edgeStrokeColor?"0.6":"0.45"}; }
|
|
12
|
+
.gantt-bar { fill: ${n.nodeFill}; stroke: ${t.nodeBorderColor?n.nodeBorder:"none"};${t.nodeBorderColor?` stroke-width: ${t.nodeLineWidth};`:""} opacity: 0.92; }
|
|
13
|
+
.gantt-bar-active { fill: ${n.nodeFill}; stroke: ${n.nodeBorder}; stroke-width: ${Math.max(1.5,t.nodeLineWidth)}; opacity: 1; }
|
|
14
|
+
.gantt-bar-done { fill: ${n.doneFill}; opacity: ${t.nodeFillColor?"0.72":"0.55"}; }
|
|
15
|
+
.gantt-bar-crit { fill: ${n.criticalFill}; stroke: ${n.criticalStroke}; stroke-width: ${Math.max(1.5,t.nodeLineWidth)}; opacity: 0.95; }
|
|
16
|
+
.gantt-milestone { fill: ${n.nodeFill}; stroke: ${n.nodeBorder}; stroke-width: ${Math.max(1,t.nodeLineWidth)}; }
|
|
17
|
+
.gantt-milestone-crit { fill: ${n.criticalFill}; stroke: ${n.criticalStroke}; stroke-width: ${Math.max(1.5,t.nodeLineWidth)}; }
|
|
18
|
+
.gantt-vert-marker { stroke: ${n.edgeStroke}; stroke-width: ${Math.max(2,t.lineWidth)}; stroke-dasharray: 6 3; }
|
|
19
|
+
.gantt-today-marker { stroke: ${t.edgeStrokeColor??"var(--accent, var(--fg))"}; stroke-width: ${Math.max(2,t.lineWidth)}; stroke-dasharray: 4 3; }
|
|
20
|
+
.gantt-title { fill: ${n.titleFill}; }
|
|
21
|
+
.gantt-section-label { fill: ${n.groupText}; }
|
|
22
|
+
.gantt-task-label { fill: ${n.taskText}; }
|
|
23
|
+
.gantt-axis-label { fill: ${n.axisText}; }
|
|
24
|
+
${o}</style>`}function Sn(t){return t.includes("crit")?"gantt-bar gantt-bar-crit":t.includes("active")?"gantt-bar gantt-bar-active":t.includes("done")?"gantt-bar gantt-bar-done":"gantt-bar"}function St(t){if(t.includes("crit"))return"crit";if(t.includes("active"))return"active";if(t.includes("done"))return"done"}function Gn(t,e,r){switch(t){case"crit":return{fill:e.criticalFill,stroke:e.criticalStroke,strokeWidth:String(Math.max(1.5,r.nodeLineWidth)),opacity:"0.95"};case"active":return{fill:e.nodeFill,stroke:e.nodeBorder,strokeWidth:String(Math.max(1.5,r.nodeLineWidth)),opacity:"1"};case"done":return{fill:e.doneFill,opacity:r.nodeFillColor?"0.72":"0.55"};default:return{fill:e.nodeFill,stroke:r.nodeBorderColor?e.nodeBorder:"none",...r.nodeBorderColor?{strokeWidth:String(r.nodeLineWidth)}:{},opacity:"0.92"}}}function Dn(t,e,r,n,i,o,s="start",a=0){let d=a!==0?` letter-spacing="${a}"`:"";return`<text class="${n}" x="${h(t)}" y="${h(e)}" text-anchor="${s}" dominant-baseline="middle" font-size="${i}" font-weight="${o}"${d}>${lt(r)}</text>`}function q(t,e,r,n,i,o,s,a,d,l="start",x=0,u){return ne({id:t,role:e,text:i,x:h(r),y:h(n),fontSize:s,anchor:l,paint:{fill:d},channels:u},Dn(r,n,i,o,s,a,l,x))}function $e(t){if(!t)return{};let e=t.lineWidth===void 0?void 0:t.cue==="outline"?t.lineWidth+1:t.cue==="double-line"?t.lineWidth+2:t.lineWidth,r=t.cue==="pattern"?"3 2":t.cue==="double-line"?"8 2 2 2":void 0;return{...t.fillColor!==void 0?{fill:t.fillColor}:{},...t.strokeColor??t.borderColor?{stroke:t.strokeColor??t.borderColor}:{},...e!==void 0?{strokeWidth:String(e)}:{},...r!==void 0?{strokeDasharray:r}:{}}}function Ee(t,e){if(!t||t.fillColor===void 0&&t.strokeColor===void 0&&t.borderColor===void 0&&t.lineWidth===void 0&&(t.cue===void 0||t.cue==="none"))return"";let r=[e.fill!==void 0?`fill:${e.fill}`:void 0,e.stroke!==void 0?`stroke:${e.stroke}`:void 0,e.strokeWidth!==void 0?`stroke-width:${e.strokeWidth}`:void 0,e.strokeDasharray!==void 0?`stroke-dasharray:${e.strokeDasharray}`:void 0,e.opacity!==void 0?`opacity:${e.opacity}`:void 0].filter(n=>n!==void 0);return r.length>0?` style="${nt(r.join(";"))}"`:""}function ve(t){return t?.cue&&t.cue!=="none"?` data-brand-cue="${nt(t.cue)}"`:""}function h(t){return Math.round(t*100)/100}function Le(t){let{positioned:e,colors:r,resolved:n}=t,i=n.renderOptions,o=r.font??"Inter",s=i.transparent??!1,a=Wt(i,n.styleFace),d=_e(a),l=[],x=i.gantt??{},u={dependencyArrows:x.dependencyArrows===!0&&e.dependencies.length>0,criticalBars:x.criticalPath===!0&&e.criticalTaskIndexes.length>0,criticalArrows:x.dependencyArrows===!0&&x.criticalPath===!0&&e.dependencies.some(c=>c.critical)},S=new Set(u.criticalBars?e.criticalTaskIndexes:[]),f={excludedBands:e.excludedBands.length>0,milestoneDone:e.bars.some(c=>c.milestoneX!==void 0&&St(c.tags)==="done"),milestoneActive:e.bars.some(c=>c.milestoneX!==void 0&&St(c.tags)==="active")},M=wn(a,u,f);l.push(re({id:"prelude",width:e.width,height:e.height,colors:r,transparent:s,font:o,hasMonoFont:!1,extraCss:M},Qt(e.width,e.height,r,s)+`
|
|
25
|
+
`+qt(o,!1,r.shadow,r.embedFontImport)+`
|
|
26
|
+
`+M));let G=Zt(r);G&&l.push(Ft({id:"shadow-defs"},`<defs>${G}</defs>`));let m=`${Fn(e)}-dep-arrow`,D=`${m}-crit`,F=[Ce(m,d.edgeStroke),...u.criticalArrows?[Ce(D,d.criticalStroke)]:[]];u.dependencyArrows&&l.push(Ft({id:"defs",markerResources:F},`<defs>
|
|
27
|
+
${ie(F)}
|
|
28
|
+
</defs>`));let g=e.plot,v=g.y+g.h,Y=new Map;e.sections.forEach((c,k)=>{if(k%2===0){let y=c.label??"",p=Y.get(y)??0;Y.set(y,p+1),l.push(tt({id:`section-band:${y}#${p}`,role:"section",geometry:{kind:"rect",x:h(g.x),y:h(c.y),width:h(g.w),height:h(c.h)},paint:{fill:d.groupFill,opacity:d.groupOpacity},channels:c.label!==void 0?{category:c.label}:void 0},`<rect class="gantt-section-band" x="${h(g.x)}" y="${h(c.y)}" width="${h(g.w)}" height="${h(c.h)}" />`))}});let B={fill:d.excludedFill,opacity:"0.1"};for(let c of e.excludedBands)l.push(tt({id:`excluded:${c.start}`,role:"grid",geometry:{kind:"rect",x:h(c.x),y:h(g.y),width:h(c.w),height:h(g.h)},paint:B},`<rect class="gantt-excluded-band" x="${h(c.x)}" y="${h(g.y)}" width="${h(c.w)}" height="${h(g.h)}" />`));let j={stroke:d.edgeStroke,strokeWidth:String(a.lineWidth),opacity:a.edgeStrokeColor?"0.6":"0.45"};for(let c of e.ticks)l.push(tt({id:`grid:${c.time}`,role:"grid",geometry:{kind:"line",x1:h(c.x),y1:h(g.y),x2:h(c.x),y2:h(v)},paint:j},`<line class="gantt-grid-line" x1="${h(c.x)}" y1="${h(g.y)}" x2="${h(c.x)}" y2="${h(v)}" />`));let C=Bt(a),z=C===10&&a.edgeLabelFontSize===11?12:Math.max(12,C);for(let c of e.ticks){let k=K(c.label,a.edgeTextTransform);l.push(q(`axis:${c.time}:bottom`,"axis",c.x,v+z,k,"gantt-axis-label",a.edgeLabelFontSize,a.edgeLabelFontWeight,d.axisText,"middle",a.edgeLetterSpacing)),e.topAxis&&l.push(q(`axis:${c.time}:top`,"axis",c.x,g.y-C,k,"gantt-axis-label",a.edgeLabelFontSize,a.edgeLabelFontWeight,d.axisText,"middle",a.edgeLetterSpacing))}let _=a.groupHeaderFontSize*1.3,O=a.nodeLabelFontSize*1.3,N=new Map;for(let c of e.sections)if(c.label!==void 0){let k=N.get(c.label)??0;N.set(c.label,k+1),(c.labelLines??[K(c.label,a.groupTextTransform)]).forEach((p,b)=>{let T=b===0?`section-label:${c.label}#${k}`:`section-label:${c.label}#${k}/${b}`;l.push(q(T,"section",8,c.y+e.barHeight/2+4+b*_,p,"gantt-section-label",a.groupHeaderFontSize,a.groupHeaderFontWeight,d.groupText,"start",a.groupLetterSpacing,{category:c.label}))})}let V=new Map,J=c=>{let k=V.get(c)??0;return V.set(c,k+1),k===0?`task-label:${c}`:`task-label:${c}#${k}`};if(e.compact){let c=new Map;for(let k of e.bars){let y=c.get(k.y)??[];y.push(k),c.set(k.y,y)}for(let k of c.values())k.sort((y,p)=>y.x-p.x),k.forEach((y,p)=>{let b=K(y.label,a.nodeTextTransform),T=mt(b,a.nodeLabelFontSize,a.nodeLabelFontWeight,a.nodeLetterSpacing),A=y.y+y.h/2,L=p>0?k[p-1].x+k[p-1].w+4:2,Z=p+1<k.length?k[p+1].x-4:e.width-2;y.x-6-T>=L?l.push(q(J(y.id??y.label),"label",y.x-6,A,b,"gantt-task-label",a.nodeLabelFontSize,a.nodeLabelFontWeight,d.taskText,"end",a.nodeLetterSpacing)):y.x+y.w+6+T<=Z?l.push(q(J(y.id??y.label),"label",y.x+y.w+6,A,b,"gantt-task-label",a.nodeLabelFontSize,a.nodeLabelFontWeight,d.taskText,"start",a.nodeLetterSpacing)):l.push(q(J(y.id??y.label),"label",16,A,b,"gantt-task-label",a.nodeLabelFontSize,a.nodeLabelFontWeight,d.taskText,"start",a.nodeLetterSpacing))})}else for(let c of e.bars){let k=c.labelLines??[K(c.label,a.nodeTextTransform)],y=J(c.id??c.label);k.forEach((p,b)=>{let T=b===0?y:`${y}/${b}`;l.push(q(T,"label",16,c.y+c.h/2+b*O,p,"gantt-task-label",a.nodeLabelFontSize,a.nodeLabelFontWeight,d.taskText,"start",a.nodeLetterSpacing))})}let ht=new Map,gt=c=>{let k=ht.get(c)??0;return ht.set(c,k+1),k===0?`task:${c}`:`task:${c}#${k}`},yt=new Map(e.links.map(c=>[c.taskIndex,c.href]));for(let c of e.bars){let k=e.sections[c.sectionIndex]?.label,y=i.security==="strict"?void 0:yt.get(c.taskIndex),p=y?` data-href="${lt(y)}"`:"",b=S.has(c.taskIndex),T=b?" gantt-bar-critical-path":"",A=b?{stroke:d.criticalStroke,strokeWidth:String(Math.max(2,a.nodeLineWidth*1.5))}:{};if(c.milestoneX!==void 0){let X=c.milestoneX,R=c.y+c.h/2,w=c.h/2,P=St(c.tags),kt="gantt-milestone"+(P!==void 0?` gantt-milestone-${P}`:"")+T,it=`M ${h(X)} ${h(R-w)} L ${h(X+w)} ${h(R)} L ${h(X)} ${h(R+w)} L ${h(X-w)} ${h(R)} Z`,ot=P==="crit"?{fill:d.criticalFill,stroke:d.criticalStroke,strokeWidth:String(Math.max(1.5,a.nodeLineWidth))}:P==="active"?{fill:d.nodeFill,stroke:d.nodeBorder,strokeWidth:String(Math.max(1.5,a.nodeLineWidth)),opacity:"1"}:P==="done"?{fill:d.doneFill,stroke:d.nodeBorder,strokeWidth:String(Math.max(1,a.nodeLineWidth)),opacity:a.nodeFillColor?"0.72":"0.55"}:{fill:d.nodeFill,stroke:d.nodeBorder,strokeWidth:String(Math.max(1,a.nodeLineWidth))},st={...P!==void 0?{status:P}:{},...P==="done"?{progress:1}:{},...b?{emphasis:!0}:{},...k!==void 0?{category:k}:{}},dt=$t(n.styleFace,"milestone",st,{includeFallback:!1}),ct={...ot,...$e(dt),...A};l.push(tt({id:gt(c.id??c.label),role:"milestone",geometry:{kind:"path",d:it},paint:ct,channels:st},`<path class="${kt}" d="${it}" data-task="${lt(c.id??c.label)}"${Ee(dt,ct)}${ve(dt)}${p} />`));continue}let L=St(c.tags),Z={...L!==void 0?{status:L}:{},...L==="done"?{progress:1}:{},...b?{emphasis:!0}:{},...k!==void 0?{category:k}:{}},H=$t(n.styleFace,"task",Z,{includeFallback:!1}),Q={...Gn(L,d,a),...$e(H),...A};l.push(tt({id:gt(c.id??c.label),role:"task",geometry:{kind:"rect",x:h(c.x),y:h(c.y),width:h(Math.max(2,c.w)),height:h(c.h),rx:wt.barRadius,ry:wt.barRadius},paint:Q,channels:Z},`<rect class="${Sn(c.tags)}${T}" x="${h(c.x)}" y="${h(c.y)}" width="${h(Math.max(2,c.w))}" height="${h(c.h)}" rx="${wt.barRadius}" ry="${wt.barRadius}" data-task="${lt(c.id??c.label)}"${Ee(H,Q)}${ve(H)}${p} />`))}if(u.dependencyArrows){let c=new Map(e.bars.map(y=>[y.taskIndex,y])),k=new Map;for(let y of e.dependencies){let p=Ae(c.get(y.fromTaskIndex)),b=Ae(c.get(y.toTaskIndex)),T=`${p}->${b}:${y.kind}`,A=k.get(T)??0;k.set(T,A+1);let L=u.criticalArrows&&y.critical,Z=L?"gantt-dep-arrow gantt-dep-arrow-crit":"gantt-dep-arrow",H=L?D:m,Q=y.points.map(R=>({x:h(R.x),y:h(R.y)})),X=Q.map((R,w)=>`${w===0?"M":"L"} ${R.x} ${R.y}`).join(" ");l.push(ee({id:A===0?`dep:${T}`:`dep:${T}#${A}`,role:"edge",geometry:{kind:"path",d:X,points:Q},lineStyle:"solid",paint:L?{stroke:d.criticalStroke,strokeWidth:String(Math.max(1.8,a.lineWidth*1.5)),opacity:"0.95"}:{stroke:d.edgeStroke,strokeWidth:String(Math.max(1.2,a.lineWidth)),opacity:"0.6"},markers:{mid:[],end:F.find(R=>R.id===H)},endpoints:{from:p,to:b},relationship:{kind:y.kind,direction:"forward"},route:{ownership:"layout"},channels:L?{status:"crit",emphasis:!0}:void 0},`<path class="${Z}" d="${X}" marker-end="url(#${nt(H)})" data-from="${nt(p)}" data-to="${nt(b)}" />`))}}let Gt={stroke:d.edgeStroke,strokeWidth:String(Math.max(2,a.lineWidth)),strokeDasharray:"6 3"},xt=new Map;for(let c of e.verts){let k=xt.get(c.label)??0;xt.set(c.label,k+1),l.push(tt({id:`vert:${c.label}#${k}`,role:"marker-line",geometry:{kind:"line",x1:h(c.x),y1:h(g.y),x2:h(c.x),y2:h(v)},paint:Gt},`<line class="gantt-vert-marker" x1="${h(c.x)}" y1="${h(g.y)}" x2="${h(c.x)}" y2="${h(v)}" />`));let y=K(c.label,a.edgeTextTransform),p=e.topAxis?Math.max(24,C+a.edgeLabelFontSize*1.25):C===10&&a.edgeLabelFontSize===11?8:C;l.push(q(`vert-label:${c.label}#${k}`,"axis",c.x,g.y-p,y,"gantt-axis-label",a.edgeLabelFontSize,Math.max(a.edgeLabelFontWeight,600),d.axisText,"middle",a.edgeLetterSpacing))}if(e.todayX!==void 0){let c=e.todayMarkerStyle!==void 0?De(e.todayMarkerStyle):void 0,k=c!==void 0?Fe(c):"",y=Object.fromEntries(c?.applied??[]);l.push(tt({id:"today-marker",role:"marker-line",geometry:{kind:"line",x1:h(e.todayX),y1:h(g.y),x2:h(e.todayX),y2:h(v)},paint:{stroke:y.stroke??a.edgeStrokeColor??"var(--accent, var(--fg))",strokeWidth:y["stroke-width"]??String(Math.max(2,a.lineWidth)),strokeDasharray:y["stroke-dasharray"]??"4 3",...y.opacity!==void 0?{opacity:y.opacity}:{}}},`<line class="gantt-today-marker"${k?` style="${nt(k)}"`:""} x1="${h(e.todayX)}" y1="${h(g.y)}" x2="${h(e.todayX)}" y2="${h(v)}" />`))}if(e.title){let c=K(e.title,a.groupTextTransform);l.push(q("title","title",e.width/2,Te(a),c,"gantt-title",Pt(a),Math.max(a.groupHeaderFontWeight,600),d.titleFill,"middle",a.groupLetterSpacing))}return l.push(ae()),{family:"gantt",width:e.width,height:e.height,colors:r,transparent:s,parts:l}}function Fn(t){return`gantt-${oe(t.width,t.height,...t.bars.map(e=>`${e.taskIndex}:${e.id??e.label}`),...t.dependencies.map(e=>`${e.fromTaskIndex}>${e.toTaskIndex}:${e.kind}`))}`}function Ce(t,e){return{id:t,shape:"arrow",size:{width:8,height:7},ref:{x:8,y:3.5},orient:"auto",geometry:{kind:"path",d:"M0,0 L8,3.5 L0,7 Z"},paint:{fill:e}}}function Ae(t){return t===void 0?"":t.id??t.label}var la=Kt(se,{normalizeRequest:t=>({familyConfig:{config:Tt(t.source.frontmatter)}}),layout:t=>{let e=t.familyConfig?.config??Tt(void 0),r=Ge(t.source.familyLines,e,{clock:{today:t.renderOptions.ganttToday},layout:{renderOptions:t.renderOptions,...t.styleFace?{styleFace:t.styleFace}:{}}});return Xt(r.positioned)},lowerScene:zt(Le)});export{la as default};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{a as $e}from"./chunk-KTTWXSIX.js";import{f as ke}from"./chunk-7D24ZLOV.js";import{a as Ge}from"./chunk-OFRMKQA6.js";import{b as ae,e as se}from"./chunk-FLD63DXE.js";import{a as ce,b as me,c as le}from"./chunk-EPFMQPXX.js";import{C as Y,G as pe,H as de,I as fe,N as j,O as v,aa as ue,ba as z,ca as ge,e as A,ia as N,ja as ye,ka as q,ma as K,n as U,o as he,oa as be,p as H,pa as Z,qa as xe,ya as J}from"./chunk-FXBBGAMJ.js";import{f as oe}from"./chunk-P7HMSKHJ.js";var Re=Object.freeze({id:"gitgraph",upstreamId:"gitGraph",maturity:"stable",label:"GitGraph",headers:["gitGraph"],aliases:[],config:{section:"gitGraph",keys:["showBranches","showCommitLabel","mainBranchName","mainBranchOrder","parallelCommits","rotateCommitLabel"]},identity:{id:"family:gitgraph",kind:"family",version:"1.0.0",compatibility:{core:"^0.3.0"},provenance:{owner:"agentic-mermaid",source:"built-in"}},collisionPriority:100,semanticChannels:["status","category"],semanticRoles:["prelude","chrome","title","group","rail","edge","node","label"],scenePrimitiveEvidence:[{role:"prelude",primitive:"document",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"chrome",primitive:"document",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"chrome",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"title",primitive:"text",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"group",primitive:"container",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"rail",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"edge",primitive:"connector",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"node",primitive:"container",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"label",primitive:"text",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]}],example:`gitGraph
|
|
2
|
+
commit id:"base"
|
|
3
|
+
branch feature
|
|
4
|
+
commit id:"work"
|
|
5
|
+
checkout main
|
|
6
|
+
commit id:"release"
|
|
7
|
+
merge feature id:"merge"`,detect:e=>/^gitgraph(?:\s+(?:lr|tb|bt))?\s*:?\s*$/.test(e),detectLoose:e=>/^gitgraph(?:\s|:|$)/.test(e)}),we=Re;var $=class extends Error{constructor(n,r){super(n);this.line=r;this.name="GitGraphParseError"}line},te=class extends ${constructor(n,r){super(`Duplicate gitGraph commit id '${n}' on line ${r}; commit IDs must be unique.`,r);this.id=n}id;code="GITGRAPH_DUPLICATE_COMMIT_ID"};function Ce(e,t={}){let n=ae(e.replace(/^\uFEFF/,"").split(/\r?\n/));if(n.unclosedIndex!==void 0)throw new $("Unclosed accDescr block",n.unclosedIndex+1);let r=n.familyLines,s=r.findIndex(a=>/^\s*gitgraph\b/i.test(a));if(s<0)throw new $("gitGraph source must start with a gitGraph header");let c=r[s].trim().match(/^gitGraph(?:\s+(LR|TB|BT))?\s*:?[ \t]*$/i);if(!c)throw new $("Invalid gitGraph header; expected gitGraph, gitGraph LR:, gitGraph TB:, or gitGraph BT:",s+1);let f=c[1]?.toUpperCase()??"LR",h=typeof t.mainBranchName=="string"&&t.mainBranchName.trim()?t.mainBranchName.trim():"main",p=Te(t.mainBranchOrder,0),b=typeof t.title=="string"&&t.title.trim()?t.title.trim():void 0,B=[],u=new Map([[h,{name:h,order:p,sequence:0}]]),k=[],w=new Map,y=h,P=0,I=n.accessibility.title,o=n.accessibility.descr,M=(a,C,L,D={},S)=>{let E=a.id!==void 0,T=a.id??`c${P}`;if(w.has(T))throw new te(T,L);let m=C==="merge"?"MERGE":C==="cherry-pick"?"CHERRY_PICK":a.type??"NORMAL",g=u.get(y),i={id:T,...a.msg?{message:a.msg}:{},type:m,tags:a.tags,branch:y,parents:S??(g.head?[g.head]:[]),sequence:P++,source:C,customId:E,...D};return B.push(i),w.set(T,i),g.head=T,i};for(let a=s+1;a<r.length;a++){let C=r[a].trim();if(!C||C.startsWith("%%"))continue;let L=C.match(/^commit(?:\s+(.*))?$/i);if(L){let m=L[1]??"",g=m.match(/^"((?:\\.|[^"])*)"$/),i=g?{tags:[],msg:g[1].replace(/\\(["\\])/g,"$1")}:Q(m,a+1,["id","tag","type","msg"]),l=M(i,"commit",a+1);k.push({kind:"commit",ref:l.id});continue}let D=C.match(/^branch\s+("(?:\\.|[^"])+"|\S+)(?:\s+order\s*:\s*(-?\d+))?$/i);if(D){let m=ee(D[1]);if(u.has(m))throw new $(`Trying to create existing branch '${m}'; use checkout ${_e(m)} instead.`,a+1);let g=D[2]===void 0?void 0:Number(D[2]);if(g!==void 0&&g<=0)throw new $("Branch order must be a positive integer.",a+1);let i=g??De(u.size);u.set(m,{name:m,order:i,sequence:u.size,...u.get(y)?.head?{head:u.get(y).head}:{}}),y=m,k.push({kind:"branch",name:m,...D[2]!==void 0?{order:i}:{}});continue}let S=C.match(/^(checkout|switch)\s+("(?:\\.|[^"])+"|\S+)$/i);if(S){let m=ee(S[2]);if(!u.has(m))throw new $(`Trying to checkout branch '${m}' before it is created.`,a+1);y=m,k.push({kind:"checkout",branch:m,keyword:S[1].toLowerCase()});continue}let E=C.match(/^merge\s+("(?:\\.|[^"])+"|\S+)(?:\s+(.*))?$/i);if(E){let m=ee(E[1]),g=Q(E[2]??"",a+1,["id","tag","type"]);if(m===y)throw new $(`Cannot merge branch '${m}' into itself.`,a+1);let i=u.get(y),l=u.get(m);if(!l)throw new $(`Branch to be merged ('${m}') does not exist.`,a+1);if(!i.head)throw new $(`Current branch '${y}' has no commits.`,a+1);if(!l.head)throw new $(`Branch to be merged ('${m}') has no commits.`,a+1);if(l.head===i.head)throw new $("Cannot merge branches with the same head commit.",a+1);let x=M(g,"merge",a+1,{mergeBranch:m,message:`merged branch ${m} into ${y}`,...g.type?{customType:g.type}:{}},[i.head,l.head]);k.push({kind:"merge",ref:x.id,branch:m});continue}let T=C.match(/^cherry-pick\s+(.+)$/i);if(T){let m=Q(T[1],a+1,["id","tag","parent"]);if(!m.id)throw new $('cherry-pick requires id:"existing commit".',a+1);let g=w.get(m.id);if(!g)throw new $(`Cherry-pick source commit '${m.id}' does not exist.`,a+1);let i=u.get(y);if(!i.head)throw new $(`Current branch '${y}' has no commits.`,a+1);if(Ie(i.head,g.id,w))throw new $(`Cherry-pick source '${g.id}' is already reachable from current branch '${y}'.`,a+1);if(g.parents.length===2){if(!m.parent)throw new $(`Cherry-picking merge commit '${g.id}' requires parent:"immediate parent".`,a+1);if(!g.parents.includes(m.parent))throw new $(`Cherry-pick parent '${m.parent}' is not an immediate parent of '${g.id}'.`,a+1)}let l=m.tags.length===0?`cherry-pick:${g.id}${m.parent?`|parent:${m.parent}`:""}`:void 0,x={tags:l?[l]:m.tags},G=M(x,"cherry-pick",a+1,{message:`cherry-picked ${g.message??g.id} into ${y}`,cherrySource:g.id,...m.parent?{cherryParent:m.parent}:{},...l?{syntheticCherryTag:l}:{}},[i.head,g.id]);k.push({kind:"cherry-pick",ref:G.id,source:g.id,...m.parent?{parent:m.parent}:{}});continue}throw new $(`Unsupported gitGraph statement on line ${a+1}: ${C}`,a+1)}return{direction:f,mainBranchName:h,...b?{title:b}:{},commits:B,branches:[...u.values()],statements:k,...I?{accessibilityTitle:I}:{},...o?{accessibilityDescription:o}:{}}}function Q(e,t,n){let r={tags:[]},s=0,c=/([A-Za-z][\w-]*)\s*:\s*(?:"((?:\\.|[^"])*)"|(\S+))/gy;for(;s<e.length;){for(;/\s/.test(e[s]??"");)s++;if(s>=e.length)break;c.lastIndex=s;let f=c.exec(e);if(!f)throw new $(`Invalid gitGraph attribute syntax near '${e.slice(s)}'.`,t);let h=f[1].toLowerCase();if(!n.includes(h))throw new $(`Attribute '${h}' is not valid for this gitGraph statement.`,t);let p=(f[2]??f[3]??"").replace(/\\(["\\])/g,"$1");if(h==="id")r.id=p;else if(h==="msg")r.msg=p;else if(h==="tag")r.tags.push(p);else if(h==="parent")r.parent=p;else{let b=p.toUpperCase();if(!["NORMAL","REVERSE","HIGHLIGHT"].includes(b))throw new $(`Invalid commit type '${p}'.`,t);r.type=b}s=c.lastIndex}return r}function ee(e){return e.startsWith('"')?e.slice(1,-1).replace(/\\(["\\])/g,"$1"):e}function _e(e){return/^[A-Za-z0-9_./-]+$/.test(e)&&!/^(commit|branch|checkout|switch|merge|cherry-pick)$/i.test(e)?e:`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Te(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function Ie(e,t,n){let r=[e],s=new Set;for(;r.length>0;){let c=r.pop();if(c===t)return!0;s.has(c)||(s.add(c),r.push(...n.get(c)?.parents??[]))}return!1}function De(e){return e<=9?e/10:1-1/(e+1)}var W=12;function Le(e,t={}){let n=Ae(t.padding,44),r=t.showBranches!==!1,s=t.showCommitLabel!==!1,c=t.rotateCommitLabel!==!1,f=Xe(t.commitLabelFontSize,11),h=e.title?40:0,p=[...e.branches].sort((i,l)=>i.order-l.order||i.sequence-l.sequence||oe(i.name,l.name)),b=new Map(p.map((i,l)=>[i.name,l])),B=new Map(e.commits.map(i=>[i.id,i])),u=new Map;for(let i of e.commits){let l=i.parents.length===0?0:Math.max(...i.parents.map(x=>u.get(x)??0))+1;u.set(i.id,l)}let k=i=>t.parallelCommits?u.get(i.id):i.sequence,w=Math.max(0,...e.commits.map(k)),y=82,P=94,I=r?Math.max(80,...p.map(i=>A(i.name,12,600)+24)):20,o=new Map;for(let i of e.commits){let l=k(i),x=Se(i,e.direction,c,f,s),G=o.get(l);o.set(l,G?{minX:Math.min(G.minX,x.minX),minY:Math.min(G.minY,x.minY),maxX:Math.max(G.maxX,x.maxX),maxY:Math.max(G.maxY,x.maxY)}:x)}let M=new Map;for(let i=0;i<=w;i++){let l=o.get(i)??{minX:-10,minY:-10,maxX:10,maxY:10};if(i===0){M.set(i,Math.max(0,-l.minX));continue}let x=o.get(i-1)??{minX:-10,minY:-10,maxX:10,maxY:10},G=M.get(i-1);M.set(i,Math.max(G+P,G+x.maxX-l.minX+18))}let a=n+I+20,C=n+h+38,L=e.commits.map(i=>{let l=b.get(i.branch)??0,x=k(i);return e.direction==="LR"?{...i,lane:l,x:a+M.get(x),y:n+h+l*y}:{...i,lane:l,x:n+I+l*150,y:C+(e.direction==="BT"?w-x:x)*P}}),D=new Map(L.map(i=>[i.id,i])),S=[];for(let i of L)for(let[l,x]of[...new Set(i.parents)].entries()){let G=D.get(x);if(!G)continue;let R=e.direction==="LR"?(G.x+i.x)/2:(G.y+i.y)/2,O=e.direction==="LR"?[{x:G.x,y:G.y},{x:R,y:G.y},{x:R,y:i.y},{x:i.x,y:i.y}]:[{x:G.x,y:G.y},{x:G.x,y:R},{x:i.x,y:R},{x:i.x,y:i.y}],F=l===0?"parent":i.source==="cherry-pick"?"cherry-pick":"merge";S.push({from:G.id,to:i.id,kind:F,points:O})}let E=p.map((i,l)=>{let x=L.filter(R=>R.branch===i.name);if(e.direction==="LR"){let R=n+h+l*y;return{...i,lane:l,x1:a-14,y1:R,x2:Math.max(a,...x.map(O=>O.x)),y2:R}}let G=n+I+l*150;return{...i,lane:l,x1:G,y1:n+h-14,x2:G,y2:Math.max(C,...x.map(R=>R.y))}}),T,m;e.direction==="LR"?(T=Math.max(n*2+I+80,...L.map(i=>i.x+(s?Math.max(26,A(i.message||i.id,f,500)*.75):18)))+n,m=n*2+h+Math.max(1,p.length)*y+(s?f*2+26:0)):(T=n*2+I+Math.max(1,p.length)*150,m=Math.max(n*2+h+80,...L.map(i=>i.y+(s?38:18)))+n),e.title&&(T=Math.max(T,A(e.title,16,600)+n*2));let g=L.flatMap(i=>[...s?[ze(i,e.direction,c,f)]:[],...i.tags.map((l,x)=>Be(l,i.x+14,i.y-16-x*17,10,600,"start",0))]);if(g.length>0){let i=Math.min(...g.map(_=>_.minX)),l=Math.min(...g.map(_=>_.minY)),x=Math.max(...g.map(_=>_.maxX)),G=Math.max(...g.map(_=>_.maxY)),R=i<n?n-i:0,O=n+h,F=l<O?O-l:0;if(R!==0||F!==0){for(let _ of L)_.x+=R,_.y+=F;for(let _ of E)_.x1+=R,_.x2+=R,_.y1+=F,_.y2+=F;for(let _ of S)for(let re of _.points)re.x+=R,re.y+=F}T=Math.max(T+R,x+R+n),m=Math.max(m+F,G+F+n)}for(let i of L)i.x=X(i.x),i.y=X(i.y);for(let i of E)i.x1=X(i.x1),i.y1=X(i.y1),i.x2=X(i.x2),i.y2=X(i.y2);for(let i of S)for(let l of i.points)l.x=X(l.x),l.y=X(l.y);return{width:X(T),height:X(m),direction:e.direction,...e.title?{title:e.title}:{},commits:L,branches:E,edges:S,accessibilityTitle:e.accessibilityTitle,accessibilityDescription:e.accessibilityDescription,showBranches:r,showCommitLabel:s,rotateCommitLabel:c}}function Se(e,t,n,r,s){let c=[{minX:-10,minY:-10,maxX:10,maxY:10}];if(s){let f=e.message||e.id;c.push(ie(f,t==="LR"?0:14,t==="LR"?24:4,r,t==="LR"?"middle":"start",t==="LR"&&n?45:0))}for(let[f,h]of e.tags.entries()){let p=Be(h,14,-16-f*17,10,600,"start",0);c.push({...p,minX:p.minX-4,maxX:p.maxX+6,minY:p.minY-2,maxY:p.maxY+2})}return{minX:Math.min(...c.map(f=>f.minX)),minY:Math.min(...c.map(f=>f.minY)),maxX:Math.max(...c.map(f=>f.maxX)),maxY:Math.max(...c.map(f=>f.maxY))}}function ze(e,t,n,r){let s=e.message||e.id;return t==="LR"?ie(s,e.x,e.y+24,r,"middle",n?45:0):ie(s,e.x+14,e.y+4,r,"start",0)}function ie(e,t,n,r,s,c){let f=Math.max(18,A(e,r,500)+W*2),h=s==="middle"?-f/2:-W,p=J({x0:t+h,y0:n-r,x1:t+h+f,y1:n+6},{x:t,y:n},c);return{minX:p.x0,minY:p.y0,maxX:p.x1,maxY:p.y1}}function Be(e,t,n,r,s,c,f){let h=A(e,r,s),p=c==="middle"?-h/2:0,b=-r,B=r*.28,u=J({x0:t+p,y0:n+b,x1:t+p+h,y1:n+B},{x:t,y:n},f);return{minX:u.x0,minY:u.y0,maxX:u.x1,maxY:u.y1}}function Ae(e,t){return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:t}function Xe(e,t){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:t}function X(e){return Math.round(e*1e3)/1e3}function V(e){let n=(e&&typeof e=="object"&&!Array.isArray(e)?e:{}).commitLabelFontSize,r=typeof n=="number"?n:typeof n=="string"?Number.parseFloat(n):11;return Number.isFinite(r)&&r>0?r:11}function ne(e,t){let n={commitLabelFontSize:V(t)};if(!e||typeof e!="object"||Array.isArray(e))return n;let r=e;for(let s of["showBranches","showCommitLabel","rotateCommitLabel","parallelCommits"])typeof r[s]=="boolean"&&(n[s]=r[s]);return typeof r.mainBranchName=="string"&&r.mainBranchName.trim()&&(n.mainBranchName=r.mainBranchName.trim()),typeof r.mainBranchOrder=="number"&&Number.isFinite(r.mainBranchOrder)&&(n.mainBranchOrder=r.mainBranchOrder),n}function Pe(e,t){return Le(e,t)}function ve(e){let t=e&&typeof e=="object"&&!Array.isArray(e)?e:{},n={commitLabelFontSize:V(t)};for(let r=0;r<8;r++)for(let s of[`git${r}`,`gitBranchLabel${r}`,`gitInv${r}`]){let c=Y(t[s]);c!==void 0&&(n[s]=c)}for(let r of["commitLabelColor","commitLabelBackground"]){let s=Y(t[r]);s!==void 0&&(n[r]=s)}return n}function Me(e){let{positioned:t,colors:n,resolved:r}=e,s=r.renderOptions,c=n.font??"Inter",f=s.transparent??!1,h="gitgraph-title",p="gitgraph-desc",b=Ge(t.accessibilityTitle??"Git graph",t.accessibilityDescription,h,p,"git graph"),B=[fe(t.width,t.height,n,f,{attrs:b}),de(c,!1,n.shadow,n.embedFontImport)],u=pe(n);u&&B.push(`<defs>${u}</defs>`);let k=r.familyAppearance;if(!k)throw new Error("GitGraph rendering requires request-boundary family appearance resolution");let w=k.themeVariables,y=Ye(t,w,n),P=[xe({id:"prelude",width:t.width,height:t.height,colors:n,transparent:f,font:c,hasMonoFont:!1},B.join(`
|
|
8
|
+
`))];if(P.push(K({id:"acc-title",element:"title",domId:h,text:t.accessibilityTitle??"Git graph"})),t.accessibilityDescription&&P.push(K({id:"acc-desc",element:"description",domId:p,text:t.accessibilityDescription})),t.title&&P.push(q({id:"gitgraph-visible-title",role:"title",text:t.title,x:t.width/2,y:24,fontSize:16,anchor:"middle",paint:{fill:"var(--_text)"}},`<text class="gitgraph-title" data-id="gitgraph-title" x="${d(t.width/2)}" y="24" text-anchor="middle" font-size="16" font-weight="600" fill="var(--_text)">${j(t.title)}</text>`)),t.showBranches)for(let o of t.branches){let M=ge("branch",o.name),a=y.branches.get(o.name),C=d(t.direction==="LR"?o.x1-10:o.x1),L=d(t.direction==="LR"?o.y1:o.y1-16),D=d(A(o.name,12,600)+10),S=d(t.direction==="LR"?C-D:C-D/2);P.push(Z({id:M,role:"group",channels:{category:o.name},open:`<g class="git-branch" data-id="${v(M)}" data-branch="${v(o.name)}">`,close:"</g>",children:[{node:N({id:z(M,"label-bg"),role:"chrome",geometry:{kind:"rect",x:S,y:L-13,width:D,height:18,rx:4,ry:4},paint:{fill:a.labelBackground,stroke:a.line,strokeWidth:"1"}},`<rect class="git-branch-label-background" x="${d(S)}" y="${d(L-13)}" width="${d(D)}" height="18" rx="4" fill="${v(a.labelBackground)}" stroke="${v(a.line)}" stroke-width="1" />`),indent:2},{node:N({id:z(M,"line"),role:"rail",geometry:{kind:"line",x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2},paint:{stroke:a.line,strokeWidth:"3",opacity:"0.86"},channels:{category:o.name}},`<line class="git-branch-line" data-branch="${v(o.name)}" x1="${d(o.x1)}" y1="${d(o.y1)}" x2="${d(o.x2)}" y2="${d(o.y2)}" stroke="${v(a.line)}" stroke-width="3" opacity="0.86" />`),indent:2},{node:q({id:z(M,"label"),role:"label",text:o.name,x:C,y:L,fontSize:12,anchor:t.direction==="LR"?"end":"middle",paint:{fill:a.label},channels:{category:o.name}},`<text class="git-branch-label" data-branch="${v(o.name)}" x="${d(C)}" y="${d(L)}" text-anchor="${t.direction==="LR"?"end":"middle"}" font-size="12" font-weight="600" fill="${v(a.label)}">${j(o.name)}</text>`),indent:2}]}))}let I=new Map(t.commits.map(o=>[o.id,o]));for(let o of t.edges){let M=o.points.map(L=>`${d(L.x)},${d(L.y)}`).join(" "),a=I.get(o.to)?.branch,C=a?y.branches.get(a)?.line??"var(--_line)":"var(--_line)";P.push(ye({id:ue(o.from,o.to),role:"edge",geometry:{kind:"polyline",points:o.points},lineStyle:o.kind==="cherry-pick"?"dashed":"solid",paint:{fill:"none",stroke:C,strokeWidth:o.kind==="parent"?"2":"2.5",...o.kind==="cherry-pick"?{strokeDasharray:"4 3"}:{}},endpoints:{from:o.from,to:o.to},relationship:{kind:o.kind,direction:"forward"},route:{ownership:"layout"},channels:{category:o.kind}},`<polyline class="git-edge git-edge-${o.kind}" data-from="${v(o.from)}" data-to="${v(o.to)}" points="${M}" fill="none" stroke="${v(C)}" stroke-width="${o.kind==="parent"?2:2.5}"${o.kind==="cherry-pick"?' stroke-dasharray="4 3"':""} />`))}for(let o of t.commits)P.push(Ee(o,t,y));return P.push(be()),{family:"gitgraph",width:t.width,height:t.height,colors:n,transparent:f,parts:P}}function Ee(e,t,n){let r=e.customType??e.type,s=Fe(e),c=n.branches.get(e.branch),f=r==="HIGHLIGHT"?c.highlight:r==="MERGE"?c.line:c.normalFill,h=c.line,p=[{node:N({id:z(e.id,"shape"),role:"chrome",geometry:s,paint:{fill:f,stroke:h,strokeWidth:"2"},channels:{status:r.toLowerCase(),category:e.branch}},$e(s,{fill:f,stroke:h,strokeWidth:"2"})),indent:2}];if(r==="MERGE"&&p.push({node:N({id:z(e.id,"inner"),role:"chrome",geometry:{kind:"circle",cx:e.x,cy:e.y,r:5},paint:{fill:"none",stroke:"var(--bg)",strokeWidth:"1.5"}},`<circle cx="${d(e.x)}" cy="${d(e.y)}" r="5" fill="none" stroke="var(--bg)" stroke-width="1.5" />`),indent:2}),r==="REVERSE")for(let b of[-1,1])p.push({node:N({id:z(e.id,"cross",b),role:"chrome",geometry:{kind:"line",x1:e.x-6,y1:e.y+b*6,x2:e.x+6,y2:e.y-b*6},paint:{stroke:"var(--_arrow)",strokeWidth:"2"}},`<line x1="${d(e.x-6)}" y1="${d(e.y+b*6)}" x2="${d(e.x+6)}" y2="${d(e.y-b*6)}" stroke="var(--_arrow)" stroke-width="2" />`),indent:2});if(t.showCommitLabel){let b=e.message||e.id,B=t.direction==="LR"?e.x:e.x+14,u=t.direction==="LR"?e.y+24:e.y+4,k=t.direction==="LR"?"middle":"start",w=t.direction==="LR"&&t.rotateCommitLabel?{kind:"rotate",angle:45,cx:d(B),cy:d(u)}:void 0,y=w?` transform="rotate(${w.angle} ${w.cx} ${w.cy})"`:"";if(n.commitLabelBackground){let P=d(Math.max(18,A(b,n.commitLabelFontSize,500)+W*2)),I=d(k==="middle"?B-P/2:B-W);p.push({node:N({id:z(e.id,"label-bg"),role:"chrome",geometry:{kind:"rect",x:I,y:u-n.commitLabelFontSize,width:P,height:n.commitLabelFontSize+6,rx:3,ry:3},paint:{fill:n.commitLabelBackground,stroke:c.line,strokeWidth:"0.75"},transform:w},`<rect class="git-commit-label-background" x="${d(I)}" y="${d(u-n.commitLabelFontSize)}" width="${d(P)}" height="${d(n.commitLabelFontSize+6)}" rx="3" fill="${v(n.commitLabelBackground)}" fill-opacity="0.94" stroke="${v(c.line)}" stroke-width="0.75"${y} />`),indent:2})}p.push({node:q({id:z(e.id,"label"),role:"label",text:b,x:B,y:u,fontSize:n.commitLabelFontSize,anchor:k,paint:{fill:n.commitLabelColor},transform:w},`<text class="git-commit-label" x="${d(B)}" y="${d(u)}" text-anchor="${k}" font-size="${d(n.commitLabelFontSize)}" fill="${v(n.commitLabelColor)}"${y}>${j(b)}</text>`),indent:2})}return e.tags.forEach((b,B)=>{let u=e.x+14,k=e.y-16-B*17,w=d(A(b,10,600)+10);p.push({node:N({id:z(e.id,"tag-bg",B),role:"chrome",geometry:{kind:"rect",x:u-4,y:k-11,width:w,height:15,rx:4,ry:4},paint:{fill:c.labelBackground,stroke:c.line,strokeWidth:"0.75"}},`<rect class="git-tag-background" x="${d(u-4)}" y="${d(k-11)}" width="${d(w)}" height="15" rx="4" fill="${v(c.labelBackground)}" stroke="${v(c.line)}" stroke-width="0.75" />`),indent:2}),p.push({node:q({id:z(e.id,"tag",B),role:"label",text:b,x:u,y:k,fontSize:10,anchor:"start",paint:{fill:c.label}},`<text class="git-tag" x="${d(u)}" y="${d(k)}" text-anchor="start" font-size="10" font-weight="600" fill="${v(c.label)}">${j(b)}</text>`),indent:2})}),Z({id:e.id,role:"node",channels:{status:r.toLowerCase(),category:e.branch},open:`<g class="git-commit type-${r.toLowerCase()}" data-id="${v(e.id)}" data-branch="${v(e.branch)}" data-commit-type="${e.type}"${r!==e.type?` data-visual-type="${r}"`:""}>`,close:"</g>",children:p})}function Fe(e){let t=e.customType??e.type;return t==="HIGHLIGHT"?{kind:"rect",x:e.x-9,y:e.y-9,width:18,height:18,rx:2,ry:2}:t==="CHERRY_PICK"?{kind:"polygon",points:[{x:e.x,y:e.y-10},{x:e.x+10,y:e.y},{x:e.x,y:e.y+10},{x:e.x-10,y:e.y}]}:{kind:"circle",cx:e.x,cy:e.y,r:t==="MERGE"?10:8}}function Ye(e,t,n){let r=t&&typeof t=="object"&&!Array.isArray(t)?t:{},s=typeof n.accent=="string"?n.accent:"#3b82f6",c=typeof n.bg=="string"?n.bg:"#ffffff",f=/^#[0-9a-f]{6}$/i.test(s)?s:"#3b82f6",h=/^#[0-9a-f]{6}$/i.test(c)?c:"#ffffff",p=ke(e.branches.length,e.branches.length<=6?{accent:f,bg:h}:{accent:s,bg:c}),b=new Map;e.branches.forEach((u,k)=>{let w=k%8,y=Y(r[`git${w}`])??p[k],P=Y(r[`gitBranchLabel${w}`])??y,I=Y(r[`gitInv${w}`])??y,o=H(y)&&H(h)?U(y,h,18):"var(--_node-fill)",M=H(y)&&H(h)?U(y,h,9):"var(--bg)",a=he(P,M,4.5,n.fg);b.set(u.name,{line:y,label:a,highlight:I,normalFill:o,labelBackground:M})});let B=V(r);return{branches:b,commitLabelColor:Y(r.commitLabelColor)??"var(--_text-sec)",commitLabelBackground:Y(r.commitLabelBackground)??(H(h)?h:"var(--bg)"),commitLabelFontSize:B}}function d(e){return Math.round(e*1e3)/1e3}var bt=le(we,{normalizeRequest:e=>({familyConfig:{position:ne(e.source.config.gitGraph,e.source.config.themeVariables),...typeof e.source.frontmatter.title=="string"?{title:e.source.frontmatter.title}:{}},appearance:{family:{themeVariables:ve(e.source.config.themeVariables)}}}),layout:e=>{let t=e.familyConfig,n=t?.position??ne(void 0),r=se(Ce(e.source.familyBody,{mainBranchName:n.mainBranchName,mainBranchOrder:n.mainBranchOrder,title:t?.title}),e.source.accessibility);return me(Pe(r,n),{injectAccessibility:!1})},lowerScene:ce(Me)});export{bt as default};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import{b as je,c as Le,e as Ae,f as ee}from"./chunk-7D24ZLOV.js";import{a as se}from"./chunk-DPSSG7LR.js";import{a as me}from"./chunk-PZEWZT35.js";import{e as Z}from"./chunk-MMWVZP6M.js";import"./chunk-FFOHLPDA.js";import{a as De}from"./chunk-I6VE56S7.js";import{a as ze}from"./chunk-OFRMKQA6.js";import{a as de,d as ke}from"./chunk-FLD63DXE.js";import{e as re,j as L,k as ie}from"./chunk-RVO6J7S3.js";import{a as $e,b as Se,c as Fe}from"./chunk-EPFMQPXX.js";import{G as ve,H as Ce,I as Je,J as ge,M as Re,N as pe,O as _,P as Y,e as _e,ea as Me,i as V,ia as M,ja as K,ka as H,la as Q,na as Pe,oa as we,p as N,pa as O,qa as Te,s as ue,u as ae,wa as We}from"./chunk-FXBBGAMJ.js";import"./chunk-P7HMSKHJ.js";var ut=Object.freeze({id:"journey",upstreamId:"journey",maturity:"stable",label:"Journey",headers:["journey"],aliases:[],config:{section:"journey",keys:["diagramMarginX","diagramMarginY","leftMargin","maxLabelWidth","width","height","taskFontSize","taskFontFamily","taskMargin","actorColours","sectionFills","sectionColours","titleColor","titleFontFamily","titleFontSize","useMaxWidth","boxMargin","boxTextMargin","noteMargin","messageMargin","messageAlign","bottomMarginAdj","rightAngles","activationWidth","textPlacement"],noopKeys:["boxMargin","boxTextMargin","noteMargin","messageMargin","messageAlign","bottomMarginAdj","rightAngles","activationWidth","textPlacement"]},identity:{id:"family:journey",kind:"family",version:"1.0.0",compatibility:{core:"^0.3.0"},provenance:{owner:"agentic-mermaid",source:"built-in"}},collisionPriority:100,semanticChannels:["value","category"],semanticRoles:["prelude","defs","chrome","title","series","grid","axis","rail","legend","actor","section","group-header","task","marker-line","label","score"],scenePrimitiveEvidence:[{role:"prelude",primitive:"document",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"defs",primitive:"document",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"defs",primitive:"marker",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"chrome",primitive:"document",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"title",primitive:"text",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"series",primitive:"connector",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"grid",primitive:"container",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"grid",primitive:"connector",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"axis",primitive:"text",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"rail",primitive:"connector",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"legend",primitive:"text",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"legend",primitive:"container",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"actor",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"section",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"section",primitive:"container",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"group-header",primitive:"text",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"group-header",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"task",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"task",primitive:"container",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"task",primitive:"data-mark",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"marker-line",primitive:"connector",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"label",primitive:"text",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"score",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"score",primitive:"container",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"score",primitive:"data-mark",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]}],example:`journey
|
|
2
|
+
title Checkout
|
|
3
|
+
section Browse
|
|
4
|
+
Find product: 4: Shopper
|
|
5
|
+
section Buy
|
|
6
|
+
Pay: 3: Shopper`,detect:e=>/^journey\s*$/.test(e),detectLoose:e=>/^journey(?:\s|$)/.test(e)}),Ye=ut;var d={paddingX:32,paddingY:28,titleFontSize:18,titleFontWeight:600,titleGap:22,sectionFontSize:12,sectionFontWeight:600,sectionHeaderMinHeight:36,sectionHeaderPadX:16,sectionTaskGap:30,sectionSpanPadX:10,sectionGap:8,legendGap:26,legendMinWidth:96,legendTitleGap:26,legendRowGap:22,legendDotRadius:5,legendDotLabelGap:12,scoreLabelGutter:22,scoreLabelGap:12,taskGap:26,taskMinWidth:124,taskMinHeight:58,taskFontSize:13,taskFontWeight:500,taskPadX:14,taskPadY:12,actorDotRadius:4,actorDotGap:8,taskToGuideGap:56,scoreStep:40,markerRadius:16,baselineGap:32,baselineClearance:6,arrowOverhang:28,minPlotWidth:200},He={nodeLabelFontSize:d.taskFontSize,edgeLabelFontSize:11,groupHeaderFontSize:d.sectionFontSize,nodeLabelFontWeight:d.taskFontWeight,edgeLabelFontWeight:600,groupHeaderFontWeight:d.sectionFontWeight,nodePaddingX:d.taskPadX,nodePaddingY:d.taskPadY,nodeCornerRadius:5,nodeLineWidth:re.outerBox,edgeLineWidth:re.connector,groupCornerRadius:6,groupPaddingX:d.sectionHeaderPadX,groupPaddingY:10,groupLabelPaddingX:d.sectionHeaderPadX,groupLineWidth:re.outerBox};function gt(e){let t=e.mermaidConfig?.journey,n=Ee(t?.titleFontSize,d.titleFontSize);return{visual:{paddingX:I(t?.diagramMarginX,d.paddingX),paddingY:I(t?.diagramMarginY,d.paddingY),legendMinWidth:I(t?.leftMargin,d.legendMinWidth),maxLabelWidth:I(t?.maxLabelWidth,360),taskGap:I(t?.taskMargin,d.taskGap),taskMinWidth:I(t?.width,d.taskMinWidth),taskMinHeight:I(t?.height,d.taskMinHeight),titleFontSize:n,titleFontSizeCss:String(t?.titleFontSize??n),titleFontFamily:ye(t?.titleFontFamily),titleColor:ye(t?.titleColor),taskFontFamily:ye(t?.taskFontFamily),actorColours:t?.actorColours??[],sectionFills:t?.sectionFills??[],sectionColours:t?.sectionColours??[]},styleDefaults:pt(t),useMaxWidth:t?.useMaxWidth===!0}}function he(e={}){return gt(e)}function pt(e){return{...He,nodeLabelFontSize:Ee(e?.taskFontSize,He.nodeLabelFontSize)}}function Ge(e,t,n={},o){let r=t.visual,i=ie(n,t.styleDefaults,o),a=e.sections.some(g=>!!g.label),s=e.title?L(e.title,i.groupTextTransform):void 0,l=s?V(s,r.titleFontSize,d.titleFontWeight):void 0,c=yt(e).map(g=>{let f=L(g,i.edgeTextTransform);return{raw:g,label:se(f,r.maxLabelWidth,i.edgeLabelFontSize,i.edgeLabelFontWeight)}}),u=new Map(c.map((g,f)=>[g.raw,f])),p=c.map(g=>V(Re(g.label),i.edgeLabelFontSize,i.edgeLabelFontWeight)),m=c.length>0?Math.max(r.legendMinWidth,d.legendDotRadius*2+d.legendDotLabelGap+Math.max(_e("Actors",i.groupHeaderFontSize,i.groupHeaderFontWeight),...p.map(g=>g.width))):0,h=e.sections.map(g=>{let f=g.label??g.id,b=Z(o,"group-header",{category:f},{includeFallback:!1}),P=b?.fontSize??i.groupHeaderFontSize,w=b?.fontWeight??i.groupHeaderFontWeight,A=b?.letterSpacing??i.groupLetterSpacing,j=g.label?se(L(g.label,b?.textTransform??i.groupTextTransform),r.maxLabelWidth,P,w,A):void 0,B=j?V(j,P,w,A):void 0,X=B?.width??0,T=B?.height??0,J=g.tasks.map(q=>mt(q.text,q.actors.length,i,r)),R=Math.max(r.taskMinWidth,X+d.sectionHeaderPadX*2);return{category:f,label:j,labelWidth:X,labelHeight:T,tasks:J,emptyWidth:R}}),v=Math.max(r.taskMinHeight,...h.flatMap(g=>g.tasks.map(f=>f.height))),x=r.paddingY;l&&(x+=l.height+d.titleGap);let k=a?Math.max(d.sectionHeaderMinHeight,...h.map(g=>g.label?g.labelHeight+i.groupPaddingY*2:0)):0,$=x,y=$+(a?k+d.sectionTaskGap:0),S=y+v+d.taskToGuideGap,z=d.scoreStep*4,E=S+z+d.baselineGap,F=r.paddingX+m+(m>0?d.legendGap:0)+d.scoreLabelGutter,C=F,le=[];for(let g=0;g<e.sections.length;g++){let f=e.sections[g],b=h[g],P=!!b.label;g>0&&(C+=d.sectionGap);let w=b.tasks.length>0?b.tasks.reduce((T,J)=>T+J.width,0)+(b.tasks.length-1)*r.taskGap:0,A=P?Math.max(w>0?w+d.sectionSpanPadX*2:b.emptyWidth,b.labelWidth+d.sectionHeaderPadX*2):Math.max(w,b.tasks.length===0?b.emptyWidth:0),j=C,B=[],X=j+(A-w)/2;for(let T=0;T<f.tasks.length;T++){let J=f.tasks[T],R=b.tasks[T];T>0&&(X+=r.taskGap);let q=X,U=q+R.width/2,lt=Ie(J.score,S),dt=ht(J,u,U,y+R.height-i.nodePaddingY-d.actorDotRadius);B.push({id:J.id,sectionId:f.id,text:R.text,score:J.score,actors:J.actors,x:q,y,width:R.width,height:R.height,textX:U,textY:y+i.nodePaddingY+R.textHeight/2,centerX:U,track:{x:U,y1:y+R.height,y2:E},marker:{cx:U,cy:lt,r:d.markerRadius,score:J.score},actorDots:dt}),X+=R.width}C=j+A,le.push({id:f.id,category:b.category,label:b.label,x:j,y:$,width:A,height:P?k:0,labelX:j+A/2,labelY:$+k/2,framed:P,headerHeight:P?k:0,tasks:B})}let st=C+d.arrowOverhang,ne=Math.max(st,F+d.minPlotWidth),be=Math.max(ne,...le.map(g=>g.x+g.width))+r.paddingX,xe=y+d.legendDotRadius,oe=c.map((g,f)=>{let b=p[f],P={label:g.label,x:r.paddingX+d.legendDotRadius,y:xe,colorIndex:f},w=g.label.includes(`
|
|
7
|
+
`);return xe+=w?Math.max(d.legendRowGap,b.height+8):d.legendRowGap,P}),at=oe.length>0?oe[oe.length-1].y+d.legendDotRadius:0,ct=Math.max(E+d.baselineClearance+r.paddingY,at+r.paddingY);return{width:be,height:ct,title:s?{text:s,x:be/2,y:r.paddingY+l.height/2}:void 0,accessibilityTitle:e.accessibilityTitle,accessibilityDescription:e.accessibilityDescription,actors:oe,scoreGuide:{x:F,y:S,width:ne-F,height:z,ticks:[5,4,3,2,1].map(g=>{let f=Ie(g,S);return{score:g,x1:F,x2:ne,y:f,labelX:F-d.scoreLabelGap,labelY:f}}),baseline:{x1:F,y1:E,x2:ne,y2:E}},sections:le}}function mt(e,t,n,o){let r=se(L(e,n.nodeTextTransform),o.maxLabelWidth,n.nodeLabelFontSize,n.nodeLabelFontWeight),i=V(r,n.nodeLabelFontSize,n.nodeLabelFontWeight),a=t>0?t*d.actorDotRadius*2+(t-1)*d.actorDotGap:0,s=Math.max(o.taskMinWidth,i.width+n.nodePaddingX*2,a+n.nodePaddingX*2),l=t>0?d.actorDotRadius*2:0,c=Math.max(o.taskMinHeight,n.nodePaddingY*2+i.height+(l>0?12+l:0));return{text:r,textWidth:i.width,textHeight:i.height,actorDotsWidth:a,width:s,height:c}}function yt(e){let t=[],n=new Set;for(let o of e.sections)for(let r of o.tasks)for(let i of r.actors)n.has(i)||(n.add(i),t.push(i));return t}function Ee(e,t){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;if(typeof e!="string")return t;let n=e.trim(),o=Number.parseFloat(n);return!Number.isFinite(o)||o<=0?t:/^[0-9.]+(?:px)?$/i.test(n)?o:/^[0-9.]+ex$/i.test(n)?o*8:/^[0-9.]+em$/i.test(n)?o*t:t}function I(e,t){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:t}function ye(e){return typeof e=="string"&&e.trim().length>0?e.trim():void 0}function ht(e,t,n,o){let r=e.actors.length;if(r===0)return[];let i=r*d.actorDotRadius*2+(r-1)*d.actorDotGap,a=n-i/2+d.actorDotRadius;return e.actors.map(s=>{let l={label:s,colorIndex:t.get(s)??0,x:a,y:o,r:d.actorDotRadius};return a+=d.actorDotRadius*2+d.actorDotGap,l})}function Ie(e,t){return t+(ft-e)*d.scoreStep}var ft=5;var Be=1,qe=5,fe=256,bt=/^title\s+(.+)$/i,xt=/^section\s+(.+)$/i,kt=/^([^:]+?)\s*:\s*([0-9]+)\s*(?::\s*(.*))?$/,$t=/^([^:]+?)\s*:\s*([^:]+?)(?:\s*:\s*.*)?$/;function St(e){return e.replace(/<br\s*\/?>/gi,`
|
|
8
|
+
`).replace(/\\n/g,`
|
|
9
|
+
`).replace(/<\/?(?:sub|sup|small|mark)\s*>/gi,"").replace(/\*\*(.+?)\*\*/g,"<b>$1</b>").replace(/(?<!\*)\*([^\s*](?:[^*]*[^\s*])?)\*(?!\*)/g,"<i>$1</i>").replace(/~~(.+?)~~/g,"<s>$1</s>")}function G(e){return St(e).split(/\r?\n/).map(t=>t.trim()).filter(Boolean).join(`
|
|
10
|
+
`)}function Ft(e){return G(e).split(`
|
|
11
|
+
`).join(" / ")}function Ue(e){return e.startsWith("%%")||e.startsWith("#")||e.startsWith("%")}function _t(e){return Number.isInteger(e)&&e>=Be&&e<=qe}function Ve(e,t,n){for(let o=t;o<e.length;o++){let r=e[o].trim();if(!r||Ue(r))continue;let i=de(e,o);if(i===void 0)return n.issue?.({code:"unclosed_accdescr",lineIndex:o,statement:r,detail:'Journey accDescr block is missing a closing "}"'})==="stop",void 0;if(i?.form==="block"){n.accDescr?.(G(i.value),o),o=i.endIndex;for(let a of Oe(i.suffixLine??""))if(Xe(a,i.endIndex,n)==="stop")return;continue}for(let a of Oe(r))if(Xe(a,o,n)==="stop")return}}function Xe(e,t,n){let o=(c,u)=>n.issue?.({code:c,lineIndex:t,statement:e,detail:u}),r=de([e],0);if(r){let c=G(r.value);r.title?n.accTitle?.(c,t):n.accDescr?.(c,t);return}let i=e.match(bt);if(i){let c=G(i[1]);if(!c)return o("empty_title",`Journey title is empty: "${e}"`);n.title?.(c,t);return}let a=e.match(xt);if(a){let c=G(a[1]);if(!c||c.includes(":"))return o("section_colon",`Journey section labels must not contain ':': "${e}"`);n.section?.(c,t);return}let s=e.match(kt);if(s){let c=G(s[1]);if(!c)return o("empty_task_text",`Journey task text is empty: "${e}"`);let u=s[2],p=Number.parseInt(u,10);if(!_t(p))return o("invalid_score",Ne(c,u));let m=(s[3]??"").split(",").map(Ft).filter(Boolean);n.task?.(c,p,m,t);return}let l=e.match($t);if(l){let c=G(l[1]),u=l[2].trim();if(c&&u)return o("invalid_score",Ne(c,u))}return o("unrecognized_line",`Invalid user journey line: "${e}". Expected title, section, accessibility metadata, or "Task name: 3: Actor"`)}function Ne(e,t){return`Journey task "${e}" has invalid score ${t}. Expected an integer from ${Be} through ${qe}`}var vt=/^&(?:[a-zA-Z][a-zA-Z0-9]{1,31}|#[0-9]{1,7}|#x[0-9a-fA-F]{1,6});$/;function Oe(e){if(!e.trim())return[];if(!e.includes(";"))return[e.trim()];let t=[],n=0;for(let o=0;o<e.length;o++){if(e[o]!==";")continue;let r=e.lastIndexOf("&",o);r>=n&&vt.test(e.slice(r,o+1))||(t.push(e.slice(n,o)),n=o+1)}return t.push(e.slice(n)),t.map(o=>o.trim()).filter(o=>o&&!Ue(o))}function Ke(e,t={}){let n={sections:[],...ke(t)},o,r=0,i=0,a=()=>o||(o={id:`section-${r++}`,tasks:[]},n.sections.push(o),o);if(Ve(e,1,{title:s=>{n.title=s},accTitle:s=>{n.accessibilityTitle=s},accDescr:s=>{n.accessibilityDescription=s},section:s=>{o={id:`section-${r++}`,label:s,tasks:[]},n.sections.push(o)},task:(s,l,c)=>{let u={id:`task-${i++}`,text:s,score:l,actors:c};a().tasks.push(u)},issue:s=>{throw Ct(s)}}),n.sections.length===0&&!n.title&&n.sections.every(s=>s.tasks.length===0)&&!n.accessibilityTitle&&!n.accessibilityDescription)throw new Error("Journey diagram must include at least one scored task, a section, or a title");return n}function Ct(e){switch(e.code){case"section_colon":return me({what:`Invalid user journey section: "${e.statement}"`,expectedForm:"section Section name",example:"section Go to work"});case"empty_task_text":return me({what:`Invalid user journey task: "${e.statement}"`,expectedForm:"Task name: score: Actor[, Actor\u2026]",example:"Pay: 3: Shopper"});case"invalid_score":case"unclosed_accdescr":return new Error(e.detail);case"empty_title":case"unrecognized_line":case"empty_journey":return new Error(`Invalid user journey line: "${e.statement}". Expected title, section, accessibility metadata, or "Task name: 3: Actor"`)}}var W={titleFontSize:18,titleFontWeight:600,sectionFontSize:12,sectionFontWeight:600,taskFontSize:13,taskFontWeight:500,actorFontSize:11,actorFontWeight:600,legendDotRadius:5,legendLabelGap:12,legendTitleGap:26},ce=5;function et(e){let{positioned:t,colors:n,resolved:o}=e,r=o.renderOptions,i=n.font??"Inter",a=r.transparent??!1,s=[],l=o.familyAppearance;if(!l)throw new Error("Journey rendering requires request-boundary family appearance resolution");let c=ie(r,l.styleDefaults,o.styleFace),u=l.visual,p=Ot(c,u,n,{sectionCount:t.sections.length,actorCount:t.actors.length}),m=Rt(t),h=Jt(t),v=`${h}-arrowhead`,x=Pt(v,p.arrow),k=`${h}-title`,$=`${h}-desc`,y=r.journey?.experienceCurve!==!1?t.sections.flatMap(F=>F.tasks.map(C=>C.marker)):[],S=y.length>=2,z=Tt(c,u,p,S);s.push(Te({id:"prelude",width:t.width,height:t.height,colors:n,transparent:a,font:i,hasMonoFont:!1,extraCss:z},Mt(t,n,a,m,k,$,l.useMaxWidth))),m.title&&s.push(Q({id:"a11y-title",role:"chrome"},`<title id="${k}">${pe(m.title)}</title>`)),m.description&&s.push(Q({id:"a11y-desc",role:"chrome"},`<desc id="${$}">${pe(m.description)}</desc>`)),s.push(Q({id:"style",role:"chrome"},Ce(i,!1,n.shadow,n.embedFontImport))),s.push(Pe({id:"defs",markerResources:[x]},wt(n,x))),s.push(Q({id:"journey-style",role:"chrome"},z)),s.push(Dt(t.scoreGuide,c,x)),t.actors.length>0&&s.push(jt(t.actors,c,p));let D=r.mermaidConfig?.journey,E=D?.sectionFills!==void 0||D?.sectionColours!==void 0;t.sections.forEach((F,C)=>{F.framed&&s.push(Lt(F,c,p,C,o.styleFace,E))}),S&&s.push(Wt(y,c,p));for(let F of t.sections)for(let C of F.tasks)s.push(Yt(C,F.label,c,p));return t.title&&s.push(H({id:"title",role:"title",text:t.title.text,x:t.title.x,y:t.title.y,fontSize:u.titleFontSize,anchor:"middle",paint:{fill:p.titleColor}},Y(t.title.text,t.title.x,t.title.y,u.titleFontSize,`class="journey-title" text-anchor="middle" font-size="${_(u.titleFontSizeCss)}" font-weight="${W.titleFontWeight}"${u.titleFontFamily?` font-family="${_(u.titleFontFamily)}"`:""}`))),s.push(we()),{family:"journey",width:t.width,height:t.height,colors:n,transparent:a,parts:s}}function Jt(e){let t=e.sections.flatMap(n=>[n.id,n.label??"",...n.tasks.flatMap(o=>[o.id,o.text,String(o.score),...o.actors])]);return`journey-${De(e.width,e.height,e.title?.text??"",e.accessibilityTitle??"",e.accessibilityDescription??"",...t)}`}function Rt(e){return{title:e.accessibilityTitle??e.title?.text,description:e.accessibilityDescription}}function Mt(e,t,n,o,r,i,a){return Je(e.width,e.height,t,n,{...a?{width:"100%",height:"100%",style:`max-width:${e.width}px`}:{},attrs:ze(o.title,o.description,r,i,"user journey")})}function Pt(e,t){return{id:e,shape:"arrow",size:{width:10,height:8},ref:{x:9,y:4},orient:"auto",geometry:{kind:"path",d:"M0,0 L10,4 L0,8 Z"},paint:{fill:t}}}function wt(e,t){return`<defs>
|
|
12
|
+
${[ve(e),We(t)].filter(Boolean).join(`
|
|
13
|
+
`)}
|
|
14
|
+
</defs>`}function Tt(e,t,n,o){let r=en(n),i=tn(n),a=nn(n),s=on(n);return`<style>
|
|
15
|
+
.journey-title { fill: ${n.titleColor}; }
|
|
16
|
+
.journey-section-bg { fill: ${n.groupFill}; stroke: ${n.groupStroke}; stroke-width: ${e.groupLineWidth}; }
|
|
17
|
+
${r}
|
|
18
|
+
.journey-section-label-band { fill: ${n.sectionBands[0]}; stroke: none; }
|
|
19
|
+
${i}
|
|
20
|
+
.journey-section-label { fill: ${n.sectionTextColors[0]??"var(--_text)"}; }
|
|
21
|
+
${a}
|
|
22
|
+
.journey-task-box { fill: ${n.nodeFill}; stroke: ${n.nodeStroke}; stroke-width: ${e.nodeLineWidth}; }
|
|
23
|
+
.journey-task-text { fill: ${e.nodeTextColor??"var(--_text)"};${t.taskFontFamily?` font-family: ${t.taskFontFamily};`:""} }
|
|
24
|
+
.journey-track { stroke: color-mix(in srgb, ${n.nodeStroke} 78%, var(--bg)); stroke-width: ${e.lineWidth}; stroke-dasharray: 4 7; }${o?`
|
|
25
|
+
.journey-curve { fill: none; stroke: color-mix(in srgb, ${n.arrow} 55%, var(--bg)); stroke-width: ${Math.max(2,e.lineWidth*2)}; stroke-linecap: round; }`:""}
|
|
26
|
+
.journey-guide { stroke: color-mix(in srgb, ${n.nodeStroke} 62%, var(--bg)); stroke-width: 1; }
|
|
27
|
+
.journey-score-label { fill: ${e.edgeTextColor??"var(--_text-sec)"}; }
|
|
28
|
+
.journey-baseline { stroke: ${n.arrow}; stroke-width: ${Math.max(2,e.lineWidth*2)}; }
|
|
29
|
+
.journey-score-face { fill: ${n.scoreFaceFill}; stroke: ${n.scoreFaceStroke}; stroke-width: 1.2; }
|
|
30
|
+
.journey-face-eye { fill: ${n.scoreFaceInk}; }
|
|
31
|
+
.journey-face-mouth { fill: none; stroke: ${n.scoreFaceInk}; stroke-width: 1.6; stroke-linecap: round; }
|
|
32
|
+
.journey-actor-legend-title { fill: ${n.groupText}; }
|
|
33
|
+
.journey-actor-legend-text { fill: ${n.groupText}; }
|
|
34
|
+
.journey-actor-dot { stroke: var(--bg); stroke-width: 1; }
|
|
35
|
+
${s}
|
|
36
|
+
</style>`}function Wt(e,t,n){let o=e.map(i=>({x:i.cx,y:i.cy})),r=zt(o);return K({id:"experience-curve",role:"series",geometry:r.geometry,lineStyle:"solid",paint:{stroke:`color-mix(in srgb, ${n.arrow} 55%, var(--bg))`,strokeWidth:String(Math.max(2,t.lineWidth*2))},route:{ownership:"family",contours:r.contours}},`<path class="journey-curve" d="${r.geometry.d}" />`)}function zt(e){let t=e[0],n=`M${t.x},${t.y}`,o=[];for(let r=1;r<e.length;r++){let i=e[r-1],a=e[r],s=(a.x-i.x)/3,l={x:i.x+s,y:i.y},c={x:a.x-s,y:a.y};n+=` C${l.x},${l.y} ${c.x},${c.y} ${a.x},${a.y}`,o.push({kind:"cubic",control1:l,control2:c,end:a})}return Me(n,t,o)}function Dt(e,t,n){let o=[];for(let i of e.ticks)o.push({indent:2,node:K({id:`score-guide:${i.score}`,role:"grid",geometry:{kind:"line",x1:i.x1,y1:i.y,x2:i.x2,y2:i.y},lineStyle:"solid",paint:{stroke:`color-mix(in srgb, ${t.nodeBorderColor??"var(--_node-stroke)"} 62%, var(--bg))`,strokeWidth:"1"},channels:{value:i.score/ce}},`<line class="journey-guide" x1="${i.x1}" y1="${i.y}" x2="${i.x2}" y2="${i.y}" />`)}),o.push({indent:2,node:H({id:`score-label:${i.score}`,role:"axis",text:String(i.score),x:i.labelX,y:i.labelY,fontSize:t.edgeLabelFontSize,anchor:"end",paint:{fill:t.edgeTextColor??"var(--_text-sec)"},channels:{value:i.score/ce}},Y(String(i.score),i.labelX,i.labelY,t.edgeLabelFontSize,`class="journey-score-label" text-anchor="end" font-size="${t.edgeLabelFontSize}" font-weight="${t.edgeLabelFontWeight}"${te(t.edgeLetterSpacing)}`))});let r=e.baseline;return o.push({indent:2,node:K({id:"journey-baseline",role:"rail",geometry:{kind:"line",x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2},lineStyle:"solid",paint:{stroke:t.edgeStrokeColor??"var(--_arrow)",strokeWidth:String(Math.max(2,t.lineWidth*2))},markers:{mid:[],end:n}},`<line class="journey-baseline" x1="${r.x1}" y1="${r.y1}" x2="${r.x2}" y2="${r.y2}" marker-end="url(#${_(n.id)})" />`)}),O({id:"score-guide",role:"grid",open:'<g class="journey-score-guide" data-score-min="1" data-score-max="5">',close:"</g>",children:o})}function jt(e,t,n){let o=e[0],r=o.x-W.legendDotRadius,i=o.y-W.legendTitleGap,a=L("Actors",t.groupTextTransform),s=[{indent:2,node:H({id:"actor-legend-title",role:"legend",text:a,x:r,y:i,fontSize:t.groupHeaderFontSize,anchor:"start",paint:{fill:t.groupTextColor??"var(--_text-sec)"}},Y(a,r,i,t.groupHeaderFontSize,`class="journey-actor-legend-title" text-anchor="start" font-size="${t.groupHeaderFontSize}" font-weight="${t.groupHeaderFontWeight}"${te(t.groupLetterSpacing)}`))}];for(let l of e)s.push({indent:2,node:M({id:`actor-legend-dot:${l.label}`,role:"actor",geometry:{kind:"circle",cx:l.x,cy:l.y,r:W.legendDotRadius},paint:{fill:it(l.colorIndex,n),stroke:"var(--bg)",strokeWidth:"1"},channels:{category:l.label}},`<circle class="journey-actor-dot ${rt(l.colorIndex,n)}" data-actor="${_(l.label)}" cx="${l.x}" cy="${l.y}" r="${W.legendDotRadius}" />`)}),s.push({indent:2,node:H({id:`actor-legend-label:${l.label}`,role:"legend",text:l.label,x:l.x+W.legendDotRadius+W.legendLabelGap,y:l.y,fontSize:t.edgeLabelFontSize,anchor:"start",paint:{fill:t.groupTextColor??"var(--_text-sec)"},channels:{category:l.label}},Y(l.label,l.x+W.legendDotRadius+W.legendLabelGap,l.y,t.edgeLabelFontSize,`class="journey-actor-legend-text" text-anchor="start" font-size="${t.edgeLabelFontSize}" font-weight="${t.edgeLabelFontWeight}"${te(t.edgeLetterSpacing)}`))});return O({id:"actor-legend",role:"legend",open:'<g class="journey-actor-legend">',close:"</g>",children:s})}function Lt(e,t,n,o,r,i){let a=e.category,s=e.label?` data-label="${_(e.label)}"`:"",l=[];if(l.push({indent:2,node:M({id:`section-bg:${e.id}`,role:"section",geometry:{kind:"rect",x:e.x,y:e.y,width:e.width,height:e.height,rx:t.groupCornerRadius,ry:t.groupCornerRadius},paint:{fill:Qt(o,n),stroke:Zt(o,n),strokeWidth:String(t.groupLineWidth)}},`<rect class="journey-section-bg journey-section-${o%n.sectionFills.length}" x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" rx="${t.groupCornerRadius}" ry="${t.groupCornerRadius}" />`)}),e.label){let u=Z(r,"group-header",{category:a},{includeFallback:!1}),p=L(e.label,u?.textTransform??t.groupTextTransform),m=u?.fontSize??t.groupHeaderFontSize,h=u?.fontWeight??t.groupHeaderFontWeight,v=u?.fontFamily??t.groupFont,x=u?.letterSpacing??t.groupLetterSpacing,k=i?Ze(o,n):u?.textColor??Ze(o,n);l.push({indent:2,node:At(e,t,n,o,r,i)}),l.push({indent:2,node:H({id:`section-label:${e.id}`,role:"group-header",text:p,x:e.labelX,y:e.labelY,fontSize:m,anchor:"middle",paint:{fill:k}},Y(p,e.labelX,e.labelY,m,`class="journey-section-label journey-section-label-${o%n.sectionTextColors.length}" text-anchor="middle" font-size="${m}" font-weight="${h}"${v?` font-family="${_(v)}"`:""}${te(x)}${u?.textColor&&!i?` style="fill:${_(k)}"`:""}`))})}return O({id:`section:${e.id}`,role:"section",open:`<g class="journey-section" data-id="${_(e.id)}"${s}>`,close:"</g>",children:l,channels:{category:a}})}function At(e,t,n,o,r,i){let a={category:e.category},s=Z(r,"group-header",a,{includeFallback:!1}),l=i?Qe(o,n):s?.fillColor??Qe(o,n),c=s?.cue??"none",u=s?.strokeColor??s?.borderColor??(c!=="none"?"var(--fg)":"none"),p=s?.lineWidth??(c!=="none"?t.groupLineWidth:void 0),m=p===void 0?void 0:c==="outline"?p+1:c==="double-line"?p+2:p,h=c==="pattern"?"3 2":c==="double-line"?"8 2 2 2":void 0,v=s&&(s.fillColor!==void 0||u!=="none"||m!==void 0||h!==void 0)?` style="${_([`fill:${l}`,u!=="none"?`stroke:${u}`:void 0,m!==void 0?`stroke-width:${m}`:void 0,h?`stroke-dasharray:${h}`:void 0].filter(Boolean).join(";"))}"`:"",x=c!=="none"?` data-brand-cue="${_(c)}"`:"",k=Math.min(6,Math.max(3,e.height/6)),$=Math.max(18,Math.min(e.height-k*2,t.groupHeaderFontSize+t.groupPaddingY)),y=e.x+k,S=e.labelY-$/2,z=Math.max(0,e.width-k*2),D=Math.min(t.groupCornerRadius,$/2);return M({id:`section-band:${e.id}`,role:"group-header",geometry:{kind:"rect",x:y,y:S,width:z,height:$,rx:D,ry:D},paint:{fill:l,stroke:u,...m!==void 0?{strokeWidth:String(m)}:{},...h?{strokeDasharray:h}:{}},channels:a},`<rect class="journey-section-label-band journey-section-band-${o%n.sectionBands.length}" x="${y}" y="${S}" width="${z}" height="${$}" rx="${D}" ry="${D}"${v}${x} />`)}function Yt(e,t,n,o){let r=t?` data-section="${_(t)}"`:"",i=e.actors.length>0?` data-actors="${_(e.actors.join(", "))}"`:"",a=e.score/ce,s=t?{value:a,category:t}:{value:a},l=[{indent:2,node:Ht(e.track,e,n,o)},{indent:2,node:It(e,n,o,s)},{indent:2,node:Gt(e,n,s)}];for(let c of e.actorDots)l.push({indent:2,node:Et(c,e.id,o)});return l.push({indent:2,node:Xt(e.marker,e.id,o,s)}),O({id:`task:${e.id}`,role:"task",open:`<g class="journey-task" data-id="${_(e.id)}" data-score="${e.score}"${r}${i}>`,close:"</g>",children:l,channels:s})}function Ht(e,t,n,o){return K({id:`track:${t.id}`,role:"marker-line",geometry:{kind:"line",x1:e.x,y1:e.y1,x2:e.x,y2:e.y2},lineStyle:"dashed",paint:{stroke:`color-mix(in srgb, ${o.nodeStroke} 78%, var(--bg))`,strokeWidth:String(n.lineWidth),strokeDasharray:"4 7"},channels:{value:t.score/ce}},`<line class="journey-track" x1="${e.x}" y1="${e.y1}" x2="${e.x}" y2="${e.y2}" />`)}function It(e,t,n,o){return M({id:`task-box:${e.id}`,role:"task",geometry:{kind:"rect",x:e.x,y:e.y,width:e.width,height:e.height,rx:t.cornerRadius??0,ry:t.cornerRadius??0},paint:{fill:n.nodeFill,stroke:n.nodeStroke,strokeWidth:String(t.nodeLineWidth)},channels:o},`<rect class="journey-task-box" x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" rx="${t.cornerRadius??0}" ry="${t.cornerRadius??0}" />`)}function Gt(e,t,n){return H({id:`task-label:${e.id}`,role:"label",text:e.text,x:e.textX,y:e.textY,fontSize:t.nodeLabelFontSize,anchor:"middle",paint:{fill:t.nodeTextColor??"var(--_text)"},channels:n},Y(e.text,e.textX,e.textY,t.nodeLabelFontSize,`class="journey-task-text" text-anchor="middle" font-size="${t.nodeLabelFontSize}" font-weight="${t.nodeLabelFontWeight}"${te(t.nodeLetterSpacing)}`))}function Et(e,t,n){return M({id:`actor-dot:${t}:${e.label}`,role:"actor",geometry:{kind:"circle",cx:e.x,cy:e.y,r:e.r},paint:{fill:it(e.colorIndex,n),stroke:"var(--bg)",strokeWidth:"1"},channels:{category:e.label}},`<circle class="journey-actor-dot ${rt(e.colorIndex,n)}" data-actor="${_(e.label)}" cx="${e.x}" cy="${e.y}" r="${e.r}" />`)}function Xt(e,t,n,o){let r=e.cy-4.5,i=e.cx-5.5,a=e.cx+5.5,s=Nt(e);return O({id:`score-marker:${t}`,role:"score",open:`<g class="journey-score-marker" data-score="${e.score}">`,close:"</g>",children:[{indent:2,node:M({id:`score-face:${t}`,role:"score",geometry:{kind:"circle",cx:e.cx,cy:e.cy,r:e.r},paint:{fill:n.scoreFaceFill,stroke:n.scoreFaceStroke,strokeWidth:"1.2"},channels:o},`<circle class="journey-score-face" cx="${e.cx}" cy="${e.cy}" r="${e.r}" />`)},{indent:2,node:M({id:`score-eye-left:${t}`,role:"score",geometry:{kind:"circle",cx:i,cy:r,r:2},paint:{fill:n.scoreFaceInk},channels:o},`<circle class="journey-face-eye" cx="${i}" cy="${r}" r="2" />`)},{indent:2,node:M({id:`score-eye-right:${t}`,role:"score",geometry:{kind:"circle",cx:a,cy:r,r:2},paint:{fill:n.scoreFaceInk},channels:o},`<circle class="journey-face-eye" cx="${a}" cy="${r}" r="2" />`)},{indent:2,node:M({id:`score-mouth:${t}`,role:"score",geometry:{kind:"path",d:s},paint:{fill:"none",stroke:n.scoreFaceInk,strokeWidth:"1.6"},channels:o},`<path class="journey-face-mouth" d="${s}" />`)}],channels:o})}function Nt(e){let t=e.cx,n=e.cy;return e.score>=5?`M${t-8},${n+4} Q${t},${n+13} ${t+8},${n+4}`:e.score>=4?`M${t-8},${n+5} Q${t},${n+11} ${t+8},${n+5}`:e.score===3?`M${t-8},${n+6} L${t+8},${n+6}`:e.score===2?`M${t-8},${n+10} Q${t},${n+2} ${t+8},${n+10}`:`M${t-9},${n+11} Q${t},${n} ${t+9},${n+11}`}function Ot(e,t,n,o){let r=e.edgeStrokeColor??"var(--_arrow)",i=e.nodeFillColor??"var(--_node-fill)",a=e.nodeBorderColor??"var(--_node-stroke)",s=e.groupFillColor??`color-mix(in srgb, ${r} 8%, var(--bg))`,l=e.groupBorderColor??"var(--_node-stroke)",c=e.groupTextColor??"var(--_text-sec)",u=Bt(r,n,e,o.sectionCount),p=Math.max(t.sectionFills.length,t.sectionColours.length,Math.min(u.length,Math.max(o.sectionCount,1))),m=Array.from({length:p},($,y)=>t.sectionFills[y%t.sectionFills.length]??e.groupFillColor??`color-mix(in srgb, ${u[y%u.length]} ${y===0?8:9}%, var(--bg))`),h=Array.from({length:p},($,y)=>t.sectionFills[y%t.sectionFills.length]??e.groupHeaderFillColor??`color-mix(in srgb, ${u[y%u.length]} ${y===0?14:16}%, var(--bg))`),v=Array.from({length:p},($,y)=>{let S=t.sectionFills[y%t.sectionFills.length];return S?`color-mix(in srgb, ${S} ${y===0?42:38}%, var(--bg))`:e.groupBorderColor??`color-mix(in srgb, ${u[y%u.length]} ${y===0?42:38}%, var(--bg))`}),x=Array.from({length:p},($,y)=>qt(t.sectionColours.length>0?t.sectionColours[y%t.sectionColours.length]:void 0,h[y],e.groupTextColor??"var(--_text)",n.bg)),k=t.actorColours.length>0?t.actorColours:Ut(r,n,e,o.actorCount);return{arrow:r,nodeFill:i,nodeStroke:a,groupFill:s,groupStroke:l,groupText:c,titleColor:t.titleColor??e.groupTextColor??e.nodeTextColor??"var(--_text)",sectionFills:m,sectionBands:h,sectionStrokes:v,sectionTextColors:x,actorColors:k,scoreFaceFill:`color-mix(in srgb, ${r} 22%, var(--bg))`,scoreFaceStroke:r,scoreFaceInk:e.edgeTextColor??e.nodeTextColor??"var(--_text)"}}function Bt(e,t,n,o){let r=Kt(t,n,Math.max(6,o));return r||[e,"var(--line, var(--_line))","var(--accent, var(--_arrow))","var(--muted, var(--_text-sec))","var(--border, var(--_node-stroke))","var(--fg)"]}function qt(e,t,n,o){if(e){let a=ae(e,t,o);if(a!==null&&a>=4.5)return e}let r=ae("#000000",t,o),i=ae("#ffffff",t,o);return r!==null&&i!==null?r>=i?"#000000":"#ffffff":n}function Ut(e,t,n,o){let r=Math.max(o,1);if(r>6&&ot(t.bg)){let a=nt(n.edgeStrokeColor,t.accent);if(a)return ee(r,{accent:a,bg:t.bg})}if(N(t.bg)&&N(t.fg)){let a=ge(t),s=tt(n.edgeStrokeColor,t.accent,a.arrow);if(s)return r<=6?Vt(s,t.bg,r):ee(r,{accent:s,bg:t.bg})}let i=[e,"var(--line, var(--_line))","var(--accent, var(--_arrow))","var(--muted, var(--_text-sec))","var(--border, var(--_node-stroke))","var(--fg)","color-mix(in srgb, var(--accent, var(--_arrow)) 62%, var(--bg))","color-mix(in srgb, var(--line, var(--_line)) 72%, var(--bg))"];return i.slice(0,Math.max(r<=i.length?r:i.length,1))}function Vt(e,t,n){let[o,r]=je(e),i=Ae(t),a=r<20?230:o,s=Math.min(72,Math.max(42,r<20?46:r)),l=i?64:38,c=[],u=new Set,p=Math.min(n,fe);for(let m=0;c.length<p&&m<fe*16;m++){let h=Math.floor(m/360),v=(a+m%360*137.508)%360,x=Le(v,Math.max(34,s-h%4*7),Math.max(i?46:24,Math.min(i?78:58,l+(h%2===0?-h*2:h*2))));u.has(x)||(u.add(x),c.push(x))}return Array.from({length:n},(m,h)=>c[h%c.length])}function Kt(e,t,n){if(n>6&&ot(e.bg)){let i=nt(t.edgeStrokeColor,e.accent);if(i)return ee(n,{accent:i,bg:e.bg})}if(!N(e.bg)||!N(e.fg))return;let o=ge(e),r=tt(t.edgeStrokeColor,e.accent,o.arrow);if(r)return ee(n,{accent:r,bg:e.bg})}function tt(...e){return e.find(t=>t!==void 0&&N(t))}function nt(...e){return e.find(t=>t!==void 0&&ue(t)!==null)}function ot(e){return ue(e)?.[3]===1}function rt(e,t){return`journey-actor-${e%t.actorColors.length}`}function it(e,t){return t.actorColors[e%t.actorColors.length]}function Qt(e,t){return t.sectionFills[e%t.sectionFills.length]}function Qe(e,t){return t.sectionBands[e%t.sectionBands.length]}function Zt(e,t){return t.sectionStrokes[e%t.sectionStrokes.length]}function Ze(e,t){return t.sectionTextColors[e%t.sectionTextColors.length]}function en(e){return e.sectionFills.map((t,n)=>` .journey-section-${n} { fill: ${t}; stroke: ${e.sectionStrokes[n]}; }`).join(`
|
|
37
|
+
`)}function tn(e){return e.sectionBands.map((t,n)=>` .journey-section-band-${n} { fill: ${t}; }`).join(`
|
|
38
|
+
`)}function nn(e){return e.sectionTextColors.map((t,n)=>` .journey-section-label-${n} { fill: ${t}; }`).join(`
|
|
39
|
+
`)}function on(e){return e.actorColors.map((t,n)=>` .journey-actor-${n} { fill: ${t}; }`).join(`
|
|
40
|
+
`)}function te(e){return e!==0?` letter-spacing="${e}"`:""}var Hn=Fe(Ye,{normalizeRequest:e=>({appearance:{family:he(e.renderOptions)}}),layout:e=>Se(Ge(Ke(e.source.familyLines,e.source.accessibility),e.familyAppearance??he(e.renderOptions),e.renderOptions,e.styleFace)),lowerScene:$e(et)});export{Hn as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{a as $e}from"./chunk-KTTWXSIX.js";import{a as Me}from"./chunk-5Q4S74UO.js";import"./chunk-STQRDZ67.js";import{f as we}from"./chunk-7D24ZLOV.js";import{a as ne}from"./chunk-DPSSG7LR.js";import{a as xe}from"./chunk-OFRMKQA6.js";import{a as J,b as K,e as Q}from"./chunk-FLD63DXE.js";import{a as V,b as ee,c as te}from"./chunk-EPFMQPXX.js";import{G as re,H as ae,I as se,J as ce,L as B,N as de,O as P,P as le,aa as me,ba as R,ea as pe,i as ie,ia as he,ja as ue,ka as O,la as fe,ma as G,n as oe,o as L,oa as ge,p as z,pa as be,qa as ye}from"./chunk-FXBBGAMJ.js";import"./chunk-P7HMSKHJ.js";var We=Object.freeze({id:"mindmap",upstreamId:"mindmap",maturity:"stable",label:"Mindmap",headers:["mindmap"],aliases:[],config:{section:"mindmap",keys:["padding","maxNodeWidth"]},identity:{id:"family:mindmap",kind:"family",version:"1.0.0",compatibility:{core:"^0.3.0"},provenance:{owner:"agentic-mermaid",source:"built-in"}},collisionPriority:100,semanticChannels:["importance","category"],semanticRoles:["prelude","chrome","edge","node","icon","label"],scenePrimitiveEvidence:[{role:"prelude",primitive:"document",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"chrome",primitive:"document",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"chrome",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"edge",primitive:"connector",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"node",primitive:"container",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"icon",primitive:"document",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"icon",primitive:"text",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"label",primitive:"text",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]}],example:`mindmap
|
|
2
|
+
root((Product))
|
|
3
|
+
Research
|
|
4
|
+
Interviews
|
|
5
|
+
Evidence
|
|
6
|
+
Delivery
|
|
7
|
+
Launch`,detect:e=>/^mindmap\s*$/.test(e),detectLoose:e=>/^mindmap(?:\s|$)/.test(e)}),Ne=We;var v=class extends Error{constructor(i,o){super(i);this.line=o;this.name="MindmapParseError"}line},j=class extends v{constructor(i,o){super(`Duplicate mindmap node identity '${i}' on line ${o}; every node identity must be unique.`,o);this.id=i}id;code="MINDMAP_DUPLICATE_ID"};function _e(e){let i=e.replace(/^\uFEFF/,"").split(/\r?\n/).map(a=>J([a],0)?.form==="inline"?ve(a):a),o=K(i);if(o.unclosedIndex!==void 0)throw new v("Unclosed accDescr block",o.unclosedIndex+1);let n=o.familyLines,c=n.findIndex(a=>/^\s*mindmap\s*$/i.test(a));if(c<0)throw new v("Mindmap source must start with the mindmap header");let s=[],r=new Set,m,l,d=o.accessibility.title!==void 0?B(o.accessibility.title):void 0,p=o.accessibility.descr!==void 0?B(o.accessibility.descr):void 0;for(let a=c+1;a<n.length;a++){let f=n[a];if(f.includes('["`')&&!f.includes('`"]')){let M=[f],D=!1;for(;++a<n.length;)if(M.push(n[a]),n[a].includes('`"]')){D=!0;break}if(!D)throw new v("Unclosed mindmap Markdown String",a+1);f=M.join(`
|
|
8
|
+
`)}f=ve(f);let y=f.trim();if(!y||y.startsWith("%%"))continue;if(/^acc(?:Title|Descr)\b/i.test(y)){let M=/^accTitle\b/i.test(y)?"accTitle":"accDescr";throw new v(`Mindmap ${M} must contain a non-empty value`,a+1)}if(/^::icon\b/i.test(y)){let M=y.match(/^::icon\(([^)]*)\)$/i),D=M?.[1]?.trim();if(!M||!D)throw new v("Mindmap icon decoration must contain a non-empty value without closing parentheses",a+1);if(!l)throw new v("Mindmap icon decoration requires a preceding node",a+1);l.icon=D;continue}if(y.startsWith(":::")){let M=y.match(/^:::\s*(.+)$/);if(!M)throw new v("Mindmap class decoration must contain at least one class name",a+1);if(!l)throw new v("Mindmap class decoration requires a preceding node",a+1);l.className=M[1].trim().replace(/\s+/g," ");continue}let $=Re(y);if(!$||$.shape==="default"&&Fe(y))throw new v(`Invalid mindmap node syntax on line ${a+1}: ${y}`,a+1);if(r.has($.id))throw new j($.id,a+1);r.add($.id);let N={...$,children:[]},A=Ee(f);for(;s.length>0&&s[s.length-1].indent>=A;)s.pop();if(s.length===0){if(m)throw new v(`There can be only one mindmap root; '${N.label}' has no parent on line ${a+1}.`,a+1);m=N}else s[s.length-1].node.children.push(N);s.push({indent:A,node:N}),l=N}if(!m)throw new v("Mindmap requires exactly one root node");return{root:m,...d?{accessibilityTitle:d}:{},...p?{accessibilityDescription:p}:{}}}function ve(e){let t=!1,i=!1;for(let o=0;o<e.length-1;o++){let n=e[o];if(i){i=!1;continue}if(n==="\\"){i=!0;continue}if(n==='"'){t=!t;continue}if(!t&&n==="%"&&e[o+1]==="%")return e.slice(0,o)}return e}function Ee(e){let t=0;for(let i of e)if(i===" ")t++;else if(i===" ")t+=4;else break;return t}function Re(e){let t=[{regex:/^(.*?)\(\((.*)\)\)$/,shape:"circle"},{regex:/^(.*?)\{\{(.*)\}\}$/,shape:"hexagon"},{regex:/^(.*?)\[([\s\S]*)\]$/,shape:"rect"},{regex:/^(.*?)\)\)(.*)\(\($/,shape:"bang"},{regex:/^(.*?)\)(.*)\($/,shape:"cloud"},{regex:/^(.*?)\((.*)\)$/,shape:"rounded"}];for(let{regex:n,shape:c}of t){let s=e.match(n);if(!s)continue;let r=De(s[2]),l=s[1].trim()||ke(r.label);return!l||!r.label?null:{id:l,label:r.label,shape:c,...r.markdown?{markdown:!0}:{}}}let i=De(e),o=ke(i.label);return o?{id:o,label:i.label,shape:"default",...i.markdown?{markdown:!0}:{}}:null}function De(e){let t=e.trim(),i=t.startsWith('"`')&&t.endsWith('`"');return i?t=Be(t.slice(2,-2)):(t.startsWith('"')&&t.endsWith('"')&&(t=t.slice(1,-1)),t=t.replace(/\*\*([^*]+)\*\*/g,"$1").replace(/\*([^*]+)\*/g,"$1")),{label:B(t).trim(),markdown:i}}function Be(e){return e.replace(/\*\*([\s\S]+?)\*\*/g,"<b>$1</b>").replace(/\*([\s\S]+?)\*/g,"<i>$1</i>")}function ke(e){return e.replace(/<\/?(?:b|i)>/gi,"").trim()}function Fe(e){return/^[^\s[\](){}]+\s*(?:\[|\(\(?|\{\{|\)\))/.test(e)}function H(e,t){let i=e.width*(e.shape==="bang"?.38:.5);return e.x+e.width/2+(t==="right"?i:-i)}var Pe=13,Se=500;function Ie(e,t={}){let i=F(t.padding,32),o=F(t.maxNodeWidth,180),n=F(t.nodeGap,40),c=F(t.layerGap,20),s=Le(e.root,o);return t.layout==="tidy-tree"?Oe(e,s,i,n,c):Ge(e,s,i,n,c)}function Le(e,t){let i=new Map,o=(n,c,s)=>{let r=ne(n.label,t,Pe,Se),m=ie(r,Pe,Se),l=Math.max(56,m.width+24),d=Math.max(34,m.height+18+(n.icon?14:0));n.shape==="circle"&&(l=d=Math.max(l,d,54)),(n.shape==="bang"||n.shape==="cloud")&&(l+=18,d+=10),i.set(n.id,{id:n.id,label:r,shape:n.shape,markdown:n.markdown,icon:n.icon,className:n.className,...s?{parentId:s}:{},depth:c,side:c===0?"root":"right",x:0,y:0,width:l,height:d});for(let p of n.children)o(p,c+1,n.id)};return o(e,0),i}function Oe(e,t,i,o,n){let c=je(t),s=new Map([[0,i]]),r=Math.max(...Array.from(t.values(),d=>d.depth));for(let d=1;d<=r;d++)s.set(d,s.get(d-1)+(c.get(d-1)??0)+n);let m=i,l=d=>{let p=t.get(d.id);if(p.side=p.depth===0?"root":"right",p.x=s.get(p.depth),d.children.length===0)return p.y=m,m+=p.height+o,p.y+p.height/2;let a=d.children.map(l),f=(a[0]+a.at(-1))/2;return p.y=Math.max(i,f-p.height/2),p.y+p.height/2};return l(e.root),Ae(t,i),Te(e,t,i)}function Ge(e,t,i,o,n){let c=t.get(e.root.id),s=h=>{let u=t.get(h.id).height;return h.children.length===0?u:Math.max(u,h.children.reduce((b,k)=>b+s(k),0)+o*(h.children.length-1))},r=[],m=[],l=0,d=0;e.root.children.forEach((h,u)=>{let b=s(h)+o;u===1||u>1&&l<d?(r.push(h),l+=b):(m.push(h),d+=b)});let p=(h,u)=>{t.get(h.id).side=u,h.children.forEach(b=>p(b,u))};r.forEach(h=>p(h,"left")),m.forEach(h=>p(h,"right"));let a=h=>{let u=new Map;for(let b of t.values())b.side===h&&u.set(b.depth,Math.max(u.get(b.depth)??0,b.width));return u},f=a("left"),y=a("right"),$=h=>[...h.values()].reduce((u,b)=>u+b+n,0);c.x=i+$(f);let N=(h,u)=>{let b=new Map,k=h==="left"?c.x:c.x+c.width,T=Math.max(0,...u.keys());for(let _=1;_<=T;_++){let C=u.get(_)??0;h==="left"?(k-=n+C,b.set(_,k)):(k+=n,b.set(_,k),k+=C)}return b},A=N("left",f),M=N("right",y),D=(h,u)=>{let b=i,k=u==="left"?f:y,T=u==="left"?A:M,_=C=>{let I=t.get(C.id),U=T.get(I.depth);if(I.x=u==="left"?U+(k.get(I.depth)-I.width):U,C.children.length===0)return I.y=b,b+=I.height+o,I.y+I.height/2;let Y=C.children.map(_),Z=(Y[0]+Y.at(-1))/2;return I.y=Z-I.height/2,Z};return h.forEach(_),{min:i,max:Math.max(i,b-o)}},g=D(r,"left"),S=D(m,"right"),W=Math.max(c.height,g.max-g.min,S.max-S.min);c.y=i+Math.max(0,(W-c.height)/2);let E=(h,u)=>{if(h.length===0)return;let b=u.max-u.min,k=i+(W-b)/2-u.min,T=_=>{t.get(_.id).y+=k,_.children.forEach(T)};h.forEach(T)};return E(r,g),E(m,S),Ae(t,i),Te(e,t,i)}function je(e){let t=new Map;for(let i of e.values())t.set(i.depth,Math.max(t.get(i.depth)??0,i.width));return t}function Ae(e,t){let i=Math.min(...Array.from(e.values(),o=>o.y));if(i<t)for(let o of e.values())o.y+=t-i}function Te(e,t,i){let o=Array.from(t.values()).flatMap(r=>{if(!r.parentId)return[];let m=t.get(r.parentId),l=r.side==="left",d={x:H(m,l?"left":"right"),y:m.y+m.height/2},p={x:H(r,l?"right":"left"),y:r.y+r.height/2},a=Math.abs(p.x-d.x)*.42,f={x:d.x+(l?-a:a),y:d.y},y={x:p.x+(l?a:-a),y:p.y};return[{from:m.id,to:r.id,points:[d,f,y,p],d:`M ${w(d.x)} ${w(d.y)} C ${w(f.x)} ${w(f.y)} ${w(y.x)} ${w(y.y)} ${w(p.x)} ${w(p.y)}`}]}),n=Math.min(...Array.from(t.values(),r=>r.x));if(n<i){let r=i-n;for(let m of t.values())m.x+=r;for(let m of o){m.points.forEach(f=>{f.x+=r});let[l,d,p,a]=m.points;m.d=`M ${w(l.x)} ${w(l.y)} C ${w(d.x)} ${w(d.y)} ${w(p.x)} ${w(p.y)} ${w(a.x)} ${w(a.y)}`}}let c=Math.max(...Array.from(t.values(),r=>r.x+r.width))+i,s=Math.max(...Array.from(t.values(),r=>r.y+r.height))+i;return{width:c,height:s,accessibilityTitle:e.accessibilityTitle,accessibilityDescription:e.accessibilityDescription,nodes:[...t.values()],edges:o}}function F(e,t){return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:t}function w(e){return Math.round(e*1e3)/1e3}function X(e,t){let i={layout:t==="tidy-tree"?"tidy-tree":"radial"};if(!e||typeof e!="object"||Array.isArray(e))return i;let o=e;return typeof o.padding=="number"&&Number.isFinite(o.padding)&&o.padding>=0&&(i.padding=o.padding),typeof o.maxNodeWidth=="number"&&Number.isFinite(o.maxNodeWidth)&&o.maxNodeWidth>0&&(i.maxNodeWidth=o.maxNodeWidth),i}function Ce(e,t){return Ie(e,t)}var q=13;function ze(e){let{positioned:t,colors:i,resolved:o}=e,n=o.renderOptions,c=i.font??"Inter",s=n.transparent??!1,r="mindmap-title",m="mindmap-desc",l=xe(t.accessibilityTitle??t.nodes[0]?.label,t.accessibilityDescription,r,m,"mindmap"),d=[se(t.width,t.height,i,s,{attrs:l}),ae(c,!1,i.shadow,i.embedFontImport)],p=re(i);p&&d.push(`<defs>${p}</defs>`);let a=Ue(t),f=new Set(a.values()).size,y=z(i.accent??"")?i.accent:"#3b82f6",$=z(i.bg)?i.bg:"#ffffff",N=we(f,f<=6?{accent:y,bg:$}:{accent:i.accent??y,bg:i.bg}),A=g=>{let S=a.get(g)??0;return N[S]??y},M=[ye({id:"prelude",width:t.width,height:t.height,colors:i,transparent:s,font:c,hasMonoFont:!1},d.join(`
|
|
9
|
+
`))],D=t.accessibilityTitle??t.nodes[0]?.label;D&&M.push(G({id:"acc-title",element:"title",domId:r,text:D})),t.accessibilityDescription&&M.push(G({id:"acc-desc",element:"description",domId:m,text:t.accessibilityDescription}));for(let g of t.edges){let S=A(g.to),[W,E,h,u]=g.points;if(!W||!E||!h||!u)throw new Error(`Mindmap edge "${g.from}" -> "${g.to}" requires four cubic control points`);let b=pe(g.d,W,[{kind:"cubic",control1:E,control2:h,end:u}]);M.push(ue({id:me(g.from,g.to),role:"edge",geometry:b.geometry,lineStyle:"solid",paint:{fill:"none",stroke:S,strokeWidth:"2.5"},endpoints:{from:g.from,to:g.to},relationship:{kind:"mindmap-branch",direction:"forward"},route:{ownership:"layout",contours:b.contours},stroke:{lineCap:"round"},channels:{importance:1,category:String(a.get(g.to)??0)}},`<path class="mindmap-edge" data-from="${P(g.from)}" data-to="${P(g.to)}" data-branch-index="${a.get(g.to)??0}" d="${g.d}" fill="none" stroke="${P(S)}" stroke-width="2.5" stroke-linecap="round" />`))}for(let g of t.nodes)M.push(Xe(g,i,a.get(g.id),A(g.id)));return M.push(ge()),{family:"mindmap",width:t.width,height:t.height,colors:i,transparent:s,parts:M}}function Xe(e,t,i,o){let n=z(t.bg)&&z(t.fg)&&(t.accent===void 0||z(t.accent)),c=n?ce(t).arrow:"var(--_arrow)",s=n?oe(o,t.bg,e.depth===1?30:e.depth===2?20:13):"var(--_node-fill)",r=e.depth===0?c:s,m=e.depth===0?c:o,l=e.depth===0?n?L(t.bg,c,4.5,t.fg):"var(--bg)":n?L(t.fg,s,4.5):"var(--_text)",d=qe(e),p=$e(d,{fill:r,stroke:m,strokeWidth:"1.5"}),a=[{node:he({id:R(e.id,"shape"),role:"chrome",geometry:d,paint:{fill:r,stroke:m,strokeWidth:"1.5"}},p),indent:2}];if(e.icon){let $=Me(e.icon);if($){let A=e.x+e.width/2-7,M=e.y+4,D=14/24,g=$.paths.map(S=>`<path d="${S}" />`).join("");a.push({node:fe({id:R(e.id,"icon"),role:"icon"},`<g class="mindmap-icon-glyph" data-icon="${P(e.icon)}" data-icon-source="${P($.source)}" transform="translate(${x(A)} ${x(M)}) scale(${x(D)})" fill="${l}" stroke="${l}" stroke-width="0.8">${g}</g>`),indent:2})}else{let N=e.icon.split(/[:\s/-]+/).filter(Boolean).at(-1)?.slice(0,2).toUpperCase()||"?";a.push({node:O({id:R(e.id,"icon"),role:"icon",text:N,x:e.x+e.width/2,y:e.y+12,fontSize:9,anchor:"middle",paint:{fill:l}},`<text class="mindmap-icon-fallback" data-icon="${P(e.icon)}" x="${x(e.x+e.width/2)}" y="${x(e.y+12)}" text-anchor="middle" font-size="9" fill="${l}">${de(N)}</text>`),indent:2})}}let f=e.y+e.height/2+(e.icon?5:0);a.push({node:O({id:R(e.id,"label"),role:"label",text:e.label,x:e.x+e.width/2,y:f,fontSize:q,anchor:"middle",paint:{fill:l}},le(e.label,e.x+e.width/2,f,q,`text-anchor="middle" font-size="${q}" font-weight="500" fill="${l}"`)),indent:2});let y=e.className?` ${P(e.className)}`:"";return be({id:e.id,role:"node",channels:{importance:Math.max(1,5-e.depth),...i===void 0?{}:{category:String(i)}},open:`<g class="mindmap-node depth-${e.depth}${y}" data-id="${P(e.id)}" data-label="${P(e.label)}"${i===void 0?"":` data-branch-index="${i}"`}${e.parentId?` data-parent-id="${P(e.parentId)}"`:""}>`,close:"</g>",children:a})}function qe(e){let{x:t,y:i,width:o,height:n}=e,c=(s,r)=>({x:x(s),y:x(r)});if(e.shape==="circle")return{kind:"circle",cx:x(t+o/2),cy:x(i+n/2),r:x(Math.min(o,n)/2)};if(e.shape==="cloud")return{kind:"ellipse",cx:x(t+o/2),cy:x(i+n/2),rx:x(o/2),ry:x(n/2)};if(e.shape==="hexagon")return{kind:"polygon",points:[c(t+12,i),c(t+o-12,i),c(t+o,i+n/2),c(t+o-12,i+n),c(t+12,i+n),c(t,i+n/2)]};if(e.shape==="bang"){let s=[];for(let r=0;r<12;r++){let m=-Math.PI/2+r*Math.PI/6,l=r%2===0?o/2:o*.38,d=r%2===0?n/2:n*.38;s.push(c(t+o/2+Math.cos(m)*l,i+n/2+Math.sin(m)*d))}return{kind:"polygon",points:s}}return{kind:"rect",x:x(t),y:x(i),width:x(o),height:x(n),rx:e.shape==="rect"?0:e.shape==="rounded"?10:16,ry:e.shape==="rect"?0:e.shape==="rounded"?10:16}}function Ue(e){let t=new Map,i=e.nodes.find(n=>n.depth===0);if(!i)return t;let o=0;for(let n of[...e.nodes].sort((c,s)=>c.depth-s.depth))n.depth!==0&&(n.parentId===i.id?t.set(n.id,o++):n.parentId&&t.has(n.parentId)&&t.set(n.id,t.get(n.parentId)));return t}function x(e){return Math.round(e*1e3)/1e3}var _t=te(Ne,{normalizeRequest:e=>({familyConfig:{position:X(e.source.config.mindmap,e.source.config.layout)}}),layout:e=>ee(Ce(Q(_e(e.source.familyBody),e.source.accessibility),e.familyConfig?.position??X(void 0,void 0)),{injectAccessibility:!1}),lowerScene:V(ze)});export{_t as default};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import{a as ve,b as We}from"./chunk-VDTSULBU.js";import{a as we}from"./chunk-JX5ZZY3T.js";import{c as te}from"./chunk-A7L4WWVW.js";import{f as $e}from"./chunk-PXRUFH7U.js";import"./chunk-KJVNXJ5Y.js";import"./chunk-7D24ZLOV.js";import{a as ke}from"./chunk-PZEWZT35.js";import{e as ne}from"./chunk-MMWVZP6M.js";import"./chunk-FFOHLPDA.js";import{b as he}from"./chunk-FLD63DXE.js";import{e as oe,j as A,k as Y}from"./chunk-RVO6J7S3.js";import{a as ge,b as me,c as ue}from"./chunk-EPFMQPXX.js";import{C as R,G as be,H as Se,I as ye,L as U,N as O,P as j,e as fe,f as xe,h as ie,ia as Z,ka as K,la as Pe,oa as Te,qa as Ce}from"./chunk-FXBBGAMJ.js";import"./chunk-P7HMSKHJ.js";var Ae=Object.freeze({id:"pie",upstreamId:"pie",maturity:"stable",label:"Pie",headers:["pie"],aliases:[],config:{section:"pie",keys:["textPosition","donutHole","legendPosition","highlightSlice","useMaxWidth","useWidth"],noopKeys:["useMaxWidth","useWidth"]},identity:{id:"family:pie",kind:"family",version:"1.0.0",compatibility:{core:"^0.3.0"},provenance:{owner:"agentic-mermaid",source:"built-in"}},collisionPriority:100,semanticChannels:["value","category","emphasis"],semanticRoles:["prelude","chrome","pie-slice","legend","title","label"],scenePrimitiveEvidence:[{role:"prelude",primitive:"document",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"chrome",primitive:"document",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"chrome",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"pie-slice",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"pie-slice",primitive:"data-mark",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"legend",primitive:"text",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"legend",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"legend",primitive:"data-mark",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"title",primitive:"text",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"label",primitive:"text",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]}],example:`pie title Plans
|
|
2
|
+
"Free" : 60
|
|
3
|
+
"Pro" : 30
|
|
4
|
+
"Enterprise" : 10`,detect:e=>/^pie(?:\s|$)/.test(e),detectLoose:e=>/^pie(?:\s|$)/.test(e)}),Fe=Ae;var re={textPosition:.75,donutHole:0,legendPosition:"right",paletteOverrides:[]},Ne=["top","bottom","left","right","center"];function V(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;if(typeof e=="string"){let t=/^([+-]?(?:\d+(?:\.\d+)?|\.\d+))(?:px)?$/.exec(e.trim());if(t){let i=Number.parseFloat(t[1]);if(Number.isFinite(i)&&i>0)return i}}}function se(e={}){let t=te(e,["pie"])??{},i=te(e,["themeVariables"])??{},l={...re,paletteOverrides:[]},h=t.textPosition;typeof h=="number"&&Number.isFinite(h)&&h>=0&&h<=1&&(l.textPosition=h);let u=t.donutHole;typeof u=="number"&&Number.isFinite(u)&&u>0&&u<=.9&&(l.donutHole=u);let f=t.legendPosition;typeof f=="string"&&Ne.includes(f)&&(l.legendPosition=f),typeof t.highlightSlice=="string"&&t.highlightSlice.trim()&&(l.highlightSlice=t.highlightSlice.trim());for(let w=0;w<12;w++){let v=R(i[`pie${w+1}`]);v!==void 0&&(l.paletteOverrides[w]=v)}let d=R(i.pieStrokeColor);d!==void 0&&(l.strokeColor=d);let r=V(i.pieStrokeWidth);r!==void 0&&(l.strokeWidth=r);let S=V(i.pieOuterStrokeWidth);S!==void 0&&(l.outerStrokeWidth=S);let o=R(i.pieOuterStrokeColor);o!==void 0&&(l.outerStrokeColor=o);let a=i.pieOpacity;typeof a=="number"&&Number.isFinite(a)&&a>=0&&a<=1&&(l.opacity=a);let y=V(i.pieSectionTextSize);y!==void 0&&(l.sectionTextSize=y);let x=R(i.pieSectionTextColor);x!==void 0&&(l.sectionTextColor=x);let $=V(i.pieTitleTextSize);$!==void 0&&(l.titleTextSize=$);let C=R(i.pieTitleTextColor);C!==void 0&&(l.titleTextColor=C);let k=V(i.pieLegendTextSize);k!==void 0&&(l.legendTextSize=k);let E=R(i.pieLegendTextColor);return E!==void 0&&(l.legendTextColor=E),l}var c={paddingX:24,paddingY:24,titleFontSize:18,titleFontWeight:600,titleGap:20,radius:95,circleToLegendGap:32,circleToLegendStackGap:24,legendFontSize:13,legendFontWeight:500,sliceStrokeWidth:1.5,legendLineHeight:13*1.3,legendSwatch:14,legendRowGap:8,legendSwatchToText:8,legendHighlightWidthScale:1.1,sliceLabelFontSize:12,sliceLabelFontWeight:500,sliceLabelFitPad:4},_e=c.sliceLabelFontWeight,J=700,le={nodeLabelFontSize:c.legendFontSize,edgeLabelFontSize:c.legendFontSize,groupHeaderFontSize:c.titleFontSize,nodeLabelFontWeight:c.legendFontWeight,edgeLabelFontWeight:c.legendFontWeight,groupHeaderFontWeight:c.titleFontWeight,nodePaddingX:0,nodePaddingY:0,nodeLineWidth:c.sliceStrokeWidth,edgeLineWidth:oe.connector,groupCornerRadius:0,groupPaddingX:0,groupPaddingY:0,groupLineWidth:oe.outerBox};function Le(e,t,i,l){let h=ie(e,t,i,l)-ie(e,t,i);return xe(e,t,i)+h}function ae(e){return Number.isInteger(e)?String(e):String(Math.round(e*100)/100)}function Q(e){return e>0?`${Math.max(.1,Math.round(e*1e3)/10).toFixed(1)}%`:"0.0%"}function Ge(e){return`${(e*100).toFixed(0)}%`}function Ve(e,t,i,l,h,u=0){let f=h-l,d=u>0?Math.min(u,i):0;if(f>=Math.PI*2-1e-9){let x=s(e),$=s(t-i),C=s(t+i),k=`M ${x} ${$} A ${s(i)} ${s(i)} 0 1 1 ${x} ${C} A ${s(i)} ${s(i)} 0 1 1 ${x} ${$} Z`;if(d<=0)return k;let E=s(t-d),w=s(t+d),v=`M ${x} ${E} A ${s(d)} ${s(d)} 0 1 0 ${x} ${w} A ${s(d)} ${s(d)} 0 1 0 ${x} ${E} Z`;return`${k} ${v}`}let r=q(e,t,i,l),S=q(e,t,i,h),o=f>Math.PI?1:0;if(d<=0)return`M ${s(e)} ${s(t)} L ${s(r.x)} ${s(r.y)} A ${s(i)} ${s(i)} 0 ${o} 1 ${s(S.x)} ${s(S.y)} Z`;let a=q(e,t,d,l),y=q(e,t,d,h);return`M ${s(r.x)} ${s(r.y)} A ${s(i)} ${s(i)} 0 ${o} 1 ${s(S.x)} ${s(S.y)} L ${s(y.x)} ${s(y.y)} A ${s(d)} ${s(d)} 0 ${o} 0 ${s(a.x)} ${s(a.y)} Z`}function q(e,t,i,l){return{x:e+i*Math.sin(l),y:t-i*Math.cos(l)}}function s(e){return Math.round(e*100)/100}function ze(e,t={},i=re,l){let h=Y(t,le,l),u=e.entries.reduce((m,P)=>m+P.value,0),f=c.radius,d=f*2,r=i.donutHole>0?s(i.donutHole*f):0,S=i.titleTextSize??h.groupHeaderFontSize,o=i.legendTextSize??h.nodeLabelFontSize,a=o*1.3,y=e.title?A(e.title,h.groupTextTransform):void 0,x=y?S+c.titleGap:0,$=y?Math.max(...y.split(`
|
|
5
|
+
`).map(m=>Le(m,S,h.groupHeaderFontWeight,h.groupLetterSpacing))):0,C=i.highlightSlice==="hover"?void 0:i.highlightSlice,k=e.entries.map(m=>{let P=u>0?m.value/u:0,M=`${e.showData?` [${ae(m.value)}]`:""} (${Q(P)})`,N=m.label.split(`
|
|
6
|
+
`),G=N.map((B,De)=>A(De===N.length-1?`${B}${M}`:B,h.nodeTextTransform)),de=C===m.label?J:h.nodeLabelFontWeight,pe=Math.max(...G.map(B=>Le(B,o,de,h.nodeLetterSpacing))),Re=de===J?pe*c.legendHighlightWidthScale:pe,Oe=Math.max(c.legendSwatch,o)+(G.length-1)*a;return{lines:G,fraction:P,textWidth:Re,contentHeight:Oe}}),E=k.length>0?Math.max(...k.map(m=>m.textWidth)):0,w=c.legendSwatch+c.legendSwatchToText+E,v=k.reduce((m,P)=>m+P.contentHeight,0)+Math.max(0,k.length-1)*c.legendRowGap,z=c.paddingY+x,p=i.legendPosition,n,g,T,b,W,F;if(p==="left"||p==="right"){let m=Math.max(d,v);g=z+m/2,b=z+(m-v)/2,p==="right"?(n=c.paddingX+f,T=c.paddingX+d+c.circleToLegendGap,W=T+w+c.paddingX):(T=c.paddingX,n=c.paddingX+w+c.circleToLegendGap+f,W=n+f+c.paddingX),W=Math.max(W,$+2*c.paddingX),F=z+m+c.paddingY}else{let m=Math.max(d,w);if(W=Math.max(c.paddingX*2+m,$+2*c.paddingX),n=(W-m)/2+m/2,T=n-w/2,p==="top")b=z,g=z+v+c.circleToLegendStackGap+f,F=g+f+c.paddingY;else if(p==="bottom")g=z+f,b=z+d+c.circleToLegendStackGap,F=b+v+c.paddingY;else{let _=Math.max(d,v);g=z+_/2,b=g-v/2,F=z+_+c.paddingY}}let I=[],L=0;e.entries.forEach(m=>{let P=u>0?m.value/u:0,_=L,M=u>0?L+P*Math.PI*2:L;L=M,I.push({label:m.label,value:m.value,fraction:P,startAngle:_,endAngle:M,path:Ve(n,g,f,_,M,r)})}),Xe(I,n,g,f,i);let H=b,D=k.map((m,P)=>{let _=e.entries[P],M={label:_.label,value:_.value,fraction:m.fraction,x:s(T),y:s(H),swatchSize:c.legendSwatch,textX:s(T+c.legendSwatch+c.legendSwatchToText),textY:s(H+m.contentHeight/2),lines:m.lines};return H+=m.contentHeight+c.legendRowGap,M});return{width:s(W),height:s(F),title:e.title?{text:y,x:s(W/2),y:c.paddingY+S/2}:void 0,cx:s(n),cy:s(g),radius:f,innerRadius:r,slices:I,legend:D,showData:e.showData,total:u,visual:i}}function Xe(e,t,i,l,h){let u=l*h.textPosition,f=h.sectionTextSize??c.sliceLabelFontSize,d=f*1.1,r=[];for(let o=0;o<e.length;o++){let a=e[o];if(a.fraction<.01)continue;let y=Ge(a.fraction);if(y==="0%")continue;let x=a.endAngle-a.startAngle;if(!(x>0))continue;let $=fe(y,f,c.sliceLabelFontWeight),C=2*u*Math.sin(Math.min(x,Math.PI)/2);if($+c.sliceLabelFitPad>C)continue;let k=(a.startAngle+a.endAngle)/2;r.push({index:o,fraction:a.fraction,halfWidth:$/2,label:{text:y,x:s(t+u*Math.sin(k)),y:s(i-u*Math.cos(k)),fontSize:f}})}r.sort((o,a)=>a.fraction-o.fraction||o.index-a.index);let S=[];for(let o of r){let a={x0:o.label.x-o.halfWidth,y0:o.label.y-d/2,x1:o.label.x+o.halfWidth,y1:o.label.y+d/2};S.some(x=>Math.min(a.x1,x.x1)-Math.max(a.x0,x.x0)>1&&Math.min(a.y1,x.y1)-Math.max(a.y0,x.y0)>1)||(S.push(a),e[o.index].pctLabel=o.label)}}var Be=/^"((?:[^"\\]|\\.)*)"\s*:\s*(.+)$/,Ye=/^\+?(?:\d+(?:\.\d+)?|\.\d+)$/;function Ee(e){if(e=he(e).familyLines,e.length===0)throw new Error("Pie chart is empty");let t=e[0].trim(),i=t.match(/^pie\b(.*)$/i);if(!i)throw new Error(`Pie chart must start with "pie", got: "${t}"`);let l=!1,h,u=i[1].trim(),f=u.match(/^showData\b\s*(.*)$/i);f&&(l=!0,u=f[1].trim());let d=u.match(/^title\s+(.+)$/i);if(d)h=U(d[1].trim());else if(u.length>0)throw new Error(`Unexpected text after pie header: "${u}"`);let r=[];for(let S=1;S<e.length;S++){let o=e[S].trim();if(o.length===0||o.startsWith("%%"))continue;if(/^showData\s*$/i.test(o)){l=!0;continue}let a=o.match(/^title\s+(.+)$/i);if(a){h=U(a[1].trim());continue}let y=o.match(Be);if(y){let x=U(Ue(y[1])),$=y[2].trim();if(!Ye.test($))throw new Error(`Pie slice "${x}" has invalid value "${$}". Values must be non-negative numbers.`);let C=Number.parseFloat($);if(!Number.isFinite(C)||C<0)throw new Error(`Pie slice "${x}" has invalid value "${$}". Values must be non-negative numbers.`);r.push({label:x,value:C});continue}throw o.includes(":")?new Error(`Invalid pie entry: "${o}". Expected: "label" : positiveNumber`):ke({what:`Unrecognized pie chart line: "${o}"`,expectedForm:'a title, showData, or a slice ("Label" : number)',example:'"Free" : 60'})}if(r.length===0)throw new Error('Pie chart must include at least one "label" : value entry');return{title:h,showData:l,entries:r}}function Ue(e){return e.replace(/\\(["\\])/g,"$1")}var ee={titleFontSize:18,titleFontWeight:600,legendFontSize:13,legendFontWeight:500,sliceStrokeWidth:1.5,dimOpacity:.4};function Ie(e){let{positioned:t,colors:i,resolved:l}=e,h=l.renderOptions,u=i.font??"Inter",f=h.transparent??!1,d=h.interactive??!1,r=Y(h,le,l.styleFace),S=ne(l.styleFace,"pie-slice",{},{includeFallback:!1}),o=t.visual,a=[],y=we(t.slices.length,{accent:i.accent,bg:i.bg,overrides:o.paletteOverrides}),x=o.highlightSlice==="hover",$=!x&&t.slices.some(p=>o.highlightSlice===p.label),C=[];C.push(je(t,i,f)),C.push(Se(u,!1,i.shadow,i.embedFontImport));let k=be(i);k&&C.push(`<defs>${k}</defs>`);let E=Ze(r,o,d,S);if(C.push(E),a.push(Ce({id:"prelude",width:t.width,height:t.height,colors:i,transparent:f,font:u,hasMonoFont:!1,extraCss:E},C.join(`
|
|
7
|
+
`))),o.outerStrokeWidth!==void 0||o.outerStrokeColor!==void 0){let p=o.outerStrokeWidth??2,n=X(t.radius+p/2);a.push(Z({id:"outer-circle",role:"chrome",geometry:{kind:"circle",cx:t.cx,cy:t.cy,r:n},paint:{fill:"none",stroke:He(o,r),strokeWidth:String(p)}},`<circle class="pie-outer-circle" cx="${t.cx}" cy="${t.cy}" r="${n}" fill="none" />`))}let w=new Map,v=(p,n)=>{let g=`${p}:${n}`,T=w.get(g)??0;return w.set(g,T+1),T===0?g:`${g}#${T}`},z=ce(o.strokeWidth??S?.lineWidth??r.nodeLineWidth);for(let p=0;p<t.slices.length;p++){let n=t.slices[p],g=Q(n.fraction),T={category:n.label,value:n.fraction},b=ne(l.styleFace,"pie-slice",T,{includeFallback:!1}),W=o.paletteOverrides[p]??b?.fillColor??y[p],F=o.strokeColor??b?.strokeColor??b?.borderColor??r.nodeBorderColor??"var(--bg)",I=o.strokeWidth??b?.lineWidth??r.nodeLineWidth,L=b?.cue??"none",H=L==="outline"?I+1:L==="double-line"?I+2:I,D=L==="pattern"?"3 2":L==="double-line"?"8 2 2 2":void 0,m=ce(H),P=$&&o.highlightSlice===n.label,_=$&&!P,M=`pie-slice${P?" highlighted":""}${x?" highlighted-on-hover":""}${_?" pie-dim":""}`,N=P?1:_?X((o.opacity??1)*ee.dimOpacity):o.opacity,G=b!==void 0&&(b.strokeColor!==void 0||b.borderColor!==void 0||b.lineWidth!==void 0||L!=="none");a.push(Z({id:v("slice",n.label),role:"pie-slice",geometry:{kind:"path",d:n.path},paint:{fill:W,stroke:P?"var(--fg)":F,strokeWidth:String(P?m:H),...D?{strokeDasharray:D}:{},...N!==void 0?{opacity:String(N)}:{}},channels:{...T,...P?{emphasis:!0}:{}}},`<path class="${M}" d="${n.path}" fill="${O(W)}" ${G?`stroke="${O(P?"var(--fg)":F)}" stroke-width="${P?m:H}"${D?` stroke-dasharray="${D}"`:""} `:""}data-label="${O(n.label)}" data-value="${n.value}" data-percent="${g}"${L!=="none"?` data-brand-cue="${L}"`:""}${P?' data-highlighted="true"':""} />`))}for(let p=0;p<t.slices.length;p++){let n=t.slices[p],g=n.pctLabel;if(!g)continue;let T=$&&o.highlightSlice!==n.label,b=o.sectionTextColor??(T?r.nodeTextColor??i.fg:$e(y[p])??r.nodeTextColor??i.fg);a.push(K({id:v("slice-label",n.label),role:"label",text:g.text,x:g.x,y:g.y,fontSize:g.fontSize,anchor:"middle",paint:{fill:b},channels:{category:n.label,value:n.fraction}},j(g.text,g.x,g.y,g.fontSize,`class="pie-slice-label" text-anchor="middle" dominant-baseline="middle" font-size="${g.fontSize}" font-weight="${_e}" fill="${O(b)}"`)))}for(let p=0;p<t.legend.length;p++){let n=t.legend[p],g=y[p],T=$&&o.highlightSlice===n.label,b=$&&!T,W=T?J:r.nodeLabelFontWeight;a.push(Z({id:v("legend",n.label),role:"legend",geometry:{kind:"rect",x:n.x,y:n.y,width:n.swatchSize,height:n.swatchSize,rx:2,ry:2},paint:{fill:g,stroke:r.nodeBorderColor??"var(--_node-stroke)",strokeWidth:String(r.nodeBorderColor?Math.max(1,r.nodeLineWidth):1),...b?{opacity:String(ee.dimOpacity)}:{}},channels:{category:n.label,value:n.fraction}},`<rect class="pie-legend-swatch${b?" pie-dim":""}" x="${n.x}" y="${n.y}" width="${n.swatchSize}" height="${n.swatchSize}" rx="2" ry="2" fill="${O(g)}" />`));let F=A(n.lines.join(`
|
|
8
|
+
`),r.nodeTextTransform);a.push(K({id:v("legend-label",n.label),role:"legend",text:F,x:n.textX,y:n.textY,fontSize:o.legendTextSize??r.nodeLabelFontSize,anchor:"start",paint:{fill:o.legendTextColor??r.nodeTextColor??"var(--_text)"},channels:{category:n.label,value:n.fraction}},j(F,n.textX,n.textY,o.legendTextSize??r.nodeLabelFontSize,`class="pie-legend-text" text-anchor="start" dominant-baseline="middle" font-size="${o.legendTextSize??r.nodeLabelFontSize}" font-weight="${W}"${Me(r.nodeLetterSpacing)}`)))}if(t.title){let p=A(t.title.text,r.groupTextTransform);a.push(K({id:"title",role:"title",text:p,x:t.title.x,y:t.title.y,fontSize:o.titleTextSize??r.groupHeaderFontSize,anchor:"middle",paint:{fill:o.titleTextColor??r.groupTextColor??r.nodeTextColor??"var(--_text)"}},j(p,t.title.x,t.title.y,o.titleTextSize??r.groupHeaderFontSize,`class="pie-title" text-anchor="middle" dominant-baseline="middle" font-size="${o.titleTextSize??r.groupHeaderFontSize}" font-weight="${r.groupHeaderFontWeight}"${Me(r.groupLetterSpacing)}`)))}if(d||x){let p=t.radius*o.textPosition;for(let n of t.slices){let g=(n.startAngle+n.endAngle)/2,T=X(t.cx+p*Math.sin(g)),b=X(t.cy-p*Math.cos(g)),W=`${n.label.replace(/\n/g," ")}: ${ae(n.value)} (${Q(n.fraction)})`,F=x?` class="pie-slice-hover-target" stroke="transparent" stroke-width="${z}"`:"";a.push(Pe({id:v("tooltip:slice",n.label),role:"chrome"},`<g class="pie-slice-group"><path d="${n.path}" fill="transparent"${F}/>`+(d?`<title>${O(W)}</title>`+ve("pie",T,b,W):"")+"</g>"))}}return a.push(Te()),{family:"pie",width:t.width,height:t.height,colors:i,transparent:f,parts:a}}function He(e,t){return e.outerStrokeColor??t.nodeBorderColor??"var(--_node-stroke)"}function je(e,t,i){return ye(e.width,e.height,t,i,{attrs:{role:"img","aria-roledescription":"pie chart"}})}function Ze(e,t,i,l){let h=t.strokeColor??l?.strokeColor??l?.borderColor??e.nodeBorderColor??"var(--bg)",u=t.strokeWidth??l?.lineWidth??e.nodeLineWidth,f=t.opacity!==void 0?` opacity: ${t.opacity};`:"",d=ce(u),r=X((t.opacity??1)*ee.dimOpacity),S=t.outerStrokeWidth!==void 0||t.outerStrokeColor!==void 0?`
|
|
9
|
+
.pie-outer-circle { stroke: ${He(t,e)}; stroke-width: ${t.outerStrokeWidth??2}; }`:"",o=i?We("pie",["pie-slice-group"]):"",a=t.highlightSlice==="hover"?`,
|
|
10
|
+
.pie-slice-group:hover > .pie-slice-hover-target`:"";return`<style>
|
|
11
|
+
.pie-slice { stroke: ${h}; stroke-width: ${u};${f} }
|
|
12
|
+
.pie-slice.highlighted { stroke: var(--fg); stroke-width: ${d}; opacity: 1; }
|
|
13
|
+
.pie-slice.highlighted-on-hover:hover${a} { stroke: var(--fg); stroke-width: ${d}; opacity: 1; }${S}
|
|
14
|
+
.pie-legend-swatch { stroke: ${e.nodeBorderColor??"var(--_node-stroke)"}; stroke-width: ${e.nodeBorderColor?Math.max(1,e.nodeLineWidth):1}; }
|
|
15
|
+
.pie-legend-text { fill: ${t.legendTextColor??e.nodeTextColor??"var(--_text)"}; }
|
|
16
|
+
.pie-title { fill: ${t.titleTextColor??e.groupTextColor??e.nodeTextColor??"var(--_text)"}; }
|
|
17
|
+
.pie-slice.pie-dim { opacity: ${r}; }
|
|
18
|
+
.pie-legend-swatch.pie-dim { opacity: ${ee.dimOpacity}; }${o}
|
|
19
|
+
</style>`}function ce(e){return Math.max(e+1,2.5)}function Me(e){return e!==0?` letter-spacing="${e}"`:""}function X(e){return Math.round(e*100)/100}var vt=ue(Fe,{normalizeRequest:e=>({familyConfig:{visual:se(e.source.frontmatter)}}),layout:e=>me(ze(Ee(e.source.familyLines),e.renderOptions,e.familyConfig?.visual??se(),e.styleFace)),lowerScene:ge(Ie)});export{vt as default};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{a as Rt,b as Et}from"./chunk-VDTSULBU.js";import{c as kt,d as rt}from"./chunk-A7L4WWVW.js";import"./chunk-KJVNXJ5Y.js";import{a as At}from"./chunk-DPSSG7LR.js";import{a as It}from"./chunk-PZEWZT35.js";import"./chunk-FFOHLPDA.js";import{a as Tt}from"./chunk-I6VE56S7.js";import{a as Mt}from"./chunk-OFRMKQA6.js";import{b as gt,c as St,f as $t}from"./chunk-FLD63DXE.js";import{e as Ft,j as D,k as it}from"./chunk-RVO6J7S3.js";import{a as Pt,b as Lt,c as Ct}from"./chunk-EPFMQPXX.js";import{D as xt,G as vt,H as qt,I as _t,L as T,N as I,P as ot,d as zt,e as U,ia as B,ka as K,la as wt,oa as Wt,qa as Qt}from"./chunk-FXBBGAMJ.js";import"./chunk-P7HMSKHJ.js";var te=Object.freeze({id:"quadrant",upstreamId:"quadrantChart",maturity:"stable",label:"Quadrant",headers:["quadrantChart"],aliases:["quadrant"],config:{section:"quadrantChart",keys:["chartWidth","chartHeight","titleFontSize","titlePadding","quadrantPadding","quadrantLabelFontSize","xAxisLabelFontSize","yAxisLabelFontSize","xAxisLabelPadding","yAxisLabelPadding","pointLabelFontSize","pointRadius","pointTextPadding","quadrantInternalBorderStrokeWidth","quadrantExternalBorderStrokeWidth","useMaxWidth","quadrantTextTopPadding","xAxisPosition","yAxisPosition","useWidth"],noopKeys:["quadrantTextTopPadding","xAxisPosition","yAxisPosition","useWidth"]},identity:{id:"family:quadrant",kind:"family",version:"1.0.0",compatibility:{core:"^0.3.0"},provenance:{owner:"agentic-mermaid",source:"built-in"}},collisionPriority:100,semanticChannels:["category"],semanticRoles:["prelude","chrome","plate","grid","point","axis","title","label"],scenePrimitiveEvidence:[{role:"prelude",primitive:"document",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"chrome",primitive:"document",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"chrome",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"plate",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"grid",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"point",primitive:"shape",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"axis",primitive:"text",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"title",primitive:"text",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]},{role:"label",primitive:"text",applicability:"applicable",realization:"native",evidence:["src/__tests__/section-a-family-descriptor-conformance.test.ts"]}],example:`quadrantChart
|
|
2
|
+
title Prioritize
|
|
3
|
+
x-axis Low Effort --> High Effort
|
|
4
|
+
y-axis Low Value --> High Value
|
|
5
|
+
Quick win: [0.2, 0.8]
|
|
6
|
+
Money pit: [0.8, 0.2]`,detect:t=>/^quadrant(?:chart)?\s*$/.test(t),detectLoose:t=>/^quadrant(?:chart)?(?:\s|$)/.test(t)}),Nt=te;var ee=["chartWidth","chartHeight","titleFontSize","quadrantLabelFontSize","xAxisLabelFontSize","yAxisLabelFontSize","pointLabelFontSize","pointRadius"],ne=["titlePadding","quadrantPadding","xAxisLabelPadding","yAxisLabelPadding","pointTextPadding","quadrantInternalBorderStrokeWidth","quadrantExternalBorderStrokeWidth"];function ft(t={}){let e=kt(t,["quadrantChart"])??{},n={};for(let o of ee){let s=rt(e,[o]);typeof s=="number"&&Number.isFinite(s)&&s>0&&(n[o]=s)}for(let o of ne){let s=rt(e,[o]);typeof s=="number"&&Number.isFinite(s)&&s>=0&&(n[o]=s)}let i=rt(e,["useMaxWidth"]);return typeof i=="boolean"&&(n.useMaxWidth=i),n}var re=/^\d+(?:\.\d+)?$/,ie=/^\d+(?:\.\d+)?(?:px)?$/,oe=/^[#\w][\w#(),.%+\s/~-]*$/;function ae(t){let e=[],n=0,i=0;for(let o=0;o<t.length;o++){let s=t[o];if(s==="(")i++;else if(s===")"){if(i--,i<0)return null}else s===","&&i===0&&(e.push(t.slice(n,o)),n=o+1)}return i!==0?null:(e.push(t.slice(n)),e)}function pt(t){let e=t.trim();if(e.length===0)return{ok:!0,style:void 0};let n={},i=!1,o=ae(e);if(!o)return{ok:!1,error:"style functions have unbalanced parentheses"};for(let s of o){let l=s.trim();if(!l)continue;let p=l.match(/^([a-z][\w-]*)\s*:\s*(.+)$/i);if(!p)return{ok:!1,error:`malformed style entry "${l}" (expected key: value)`};let a=p[1].toLowerCase(),u=p[2].trim();switch(a){case"radius":{if(!re.test(u))return{ok:!1,error:`radius must be a non-negative number, got "${u}"`};n.radius=Number.parseFloat(u);break}case"color":{if(!xt(u))return{ok:!1,error:`color has unsupported characters or syntax: "${u}"`};n.color=u;break}case"stroke-color":{if(!xt(u))return{ok:!1,error:`stroke-color has unsupported characters or syntax: "${u}"`};n.strokeColor=u;break}case"stroke-width":{if(!ie.test(u))return{ok:!1,error:`stroke-width must be a number with optional px suffix, got "${u}"`};n.strokeWidth=u;break}default:{if(!oe.test(u))return{ok:!1,error:`style property "${a}" has unsupported characters: "${u}"`};n.extra=n.extra??[],n.extra.push(`${a}: ${u}`);break}}i=!0}return{ok:!0,style:i?n:void 0}}function Dt(t){let e=t.trim().match(/^([A-Za-z_][\w-]*)\s+(.+)$/);if(!e)return{ok:!1,error:`expected "classDef <name> <styles>", got "classDef ${t.trim()}"`};let n=e[1],i=pt(e[2]);return i.ok?i.style?{ok:!0,name:n,style:i.style}:{ok:!1,error:`classDef ${n} has no style entries`}:{ok:!1,error:`classDef ${n}: ${i.error}`}}var se=/\s*:::\s*([A-Za-z_][\w-]*)\s*$/;function Bt(t){let e=t.match(se);return e?{label:t.slice(0,e.index).trim(),className:e[1]}:{label:t}}function Ht(t,e,n){let i=t.className&&e&&Object.hasOwn(e,t.className)?e[t.className]:void 0,o={radius:t.style?.radius??i?.radius??n.radius},s=t.style?.color??i?.color,l=t.style?.strokeColor??i?.strokeColor,p=t.style?.strokeWidth??i?.strokeWidth;return s!==void 0&&(o.fill=s),l!==void 0&&(o.stroke=l),p!==void 0&&(o.strokeWidth=p),o}var k={paddingX:24,paddingY:24,titleFontSize:18,titleGap:18,plotSize:380,axisFontSize:13,axisLabelPadding:4,quadrantFontSize:15,pointRadius:6,pointFontSize:12,pointTextPadding:4};function mt(t={}){return{nodeLabelFontSize:t.pointLabelFontSize??k.pointFontSize,edgeLabelFontSize:t.xAxisLabelFontSize??k.axisFontSize,groupHeaderFontSize:t.quadrantLabelFontSize??k.quadrantFontSize,nodeLabelFontWeight:500,edgeLabelFontWeight:500,groupHeaderFontWeight:600,nodePaddingX:0,nodePaddingY:0,nodeLineWidth:Ft.innerBox,edgeLineWidth:1,groupCornerRadius:0,groupPaddingX:0,groupPaddingY:0,groupLineWidth:2}}function x(t){return Math.round(t*100)/100}function de(t,e,n,i){if(U(t,n,i)<=e)return t;let o="\u2026",s="";for(let l of zt(t)){if(U(s+l+o,n,i)>e)break;s+=l}return s+o}function at(t,e,n,i){let o=At(t,e,n,i).split(`
|
|
7
|
+
`);return o.length<=2?o.join(`
|
|
8
|
+
`):`${o[0]}
|
|
9
|
+
${de(o.slice(1).join(" "),e,n,i)}`}function le(t){return t<=8?k.plotSize:Math.min(720,k.plotSize+(t-8)*20)}var Ot=(t,e)=>Math.min(t.x1,e.x1)-Math.max(t.x0,e.x0)>.5&&Math.min(t.y1,e.y1)-Math.max(t.y0,e.y0)>.5,ce=[0,Math.PI,-Math.PI/2,Math.PI/2,-Math.PI/4,Math.PI/4,-3*Math.PI/4,3*Math.PI/4,-Math.PI/8,Math.PI/8,-3*Math.PI/8,3*Math.PI/8,-5*Math.PI/8,5*Math.PI/8,-7*Math.PI/8,7*Math.PI/8],ue=10;function xe(t,e,n,i,o){let s=[{x:t+n,y:e,anchor:"start",far:!1,box:{x0:t+n,y0:e-o/2,x1:t+n+i,y1:e+o/2}},{x:t-n,y:e,anchor:"end",far:!1,box:{x0:t-n-i,y0:e-o/2,x1:t-n,y1:e+o/2}},{x:t,y:e+n+o/2,anchor:"middle",far:!1,box:{x0:t-i/2,y0:e+n,x1:t+i/2,y1:e+n+o}},{x:t,y:e-n-o/2,anchor:"middle",far:!1,box:{x0:t-i/2,y0:e-n-o,x1:t+i/2,y1:e-n}}],l=[];for(let p=1;p<=ue;p++){let a=n+p*(o+6);for(let u of ce){let c=t+Math.cos(u)*a,h=e+Math.sin(u)*a,y=Math.cos(u),m=y>.38?"start":y<-.38?"end":"middle",b=m==="start"?c:m==="end"?c-i:c-i/2;l.push({x:c,y:h,anchor:m,far:!0,box:{x0:b,y0:h-o/2,x1:b+i,y1:h+o/2}})}}return[...s,...l]}function Xt(t,e,n,i){let o=i.x-t,s=i.y-e,l=Math.hypot(o,s)||1,p=o/l,a=s/l,u=i.anchor==="start"?i.box.x0-2:i.anchor==="end"?i.box.x1+2:i.x,c=i.anchor==="middle"?i.y>e?i.box.y0-1:i.box.y1+1:i.y;return{x1:x(t+p*n),y1:x(e+a*n),x2:x(u),y2:x(c)}}function Z(t,e,n,i,o,s){return(n-t)*(s-e)-(i-e)*(o-t)}function st(t,e,n){let i=n.x2-n.x1,o=n.y2-n.y1,s=i*i+o*o,l=s===0?0:Math.max(0,Math.min(1,((t-n.x1)*i+(e-n.y1)*o)/s));return Math.hypot(t-(n.x1+l*i),e-(n.y1+l*o))}function Yt(t,e){if(Math.hypot(t.x1-e.x1,t.y1-e.y1)<=.5)return!1;let n=.01,i=(a,u,c)=>Math.abs(Z(a.x1,a.y1,a.x2,a.y2,u,c))<=n&&u>=Math.min(a.x1,a.x2)-n&&u<=Math.max(a.x1,a.x2)+n&&c>=Math.min(a.y1,a.y2)-n&&c<=Math.max(a.y1,a.y2)+n,o=Z(t.x1,t.y1,t.x2,t.y2,e.x1,e.y1),s=Z(t.x1,t.y1,t.x2,t.y2,e.x2,e.y2),l=Z(e.x1,e.y1,e.x2,e.y2,t.x1,t.y1),p=Z(e.x1,e.y1,e.x2,e.y2,t.x2,t.y2);return o*s<-n&&l*p<-n||i(t,e.x1,e.y1)||i(t,e.x2,e.y2)||i(e,t.x1,t.y1)||i(e,t.x2,t.y2)?!0:Math.min(st(t.x1,t.y1,e),st(t.x2,t.y2,e),st(e.x1,e.y1,t),st(e.x2,e.y2,t))<3}function fe(t,e){let n={x0:e.x0-2,y0:e.y0-2,x1:e.x1+2,y1:e.y1+2};if(Math.max(t.x1,t.x2)<n.x0||Math.min(t.x1,t.x2)>n.x1||Math.max(t.y1,t.y2)<n.y0||Math.min(t.y1,t.y2)>n.y1)return!1;let i=(s,l)=>s>=n.x0&&s<=n.x1&&l>=n.y0&&l<=n.y1;return i(t.x1,t.y1)||i(t.x2,t.y2)?!0:[{x1:n.x0,y1:n.y0,x2:n.x1,y2:n.y0},{x1:n.x1,y1:n.y0,x2:n.x1,y2:n.y1},{x1:n.x1,y1:n.y1,x2:n.x0,y2:n.y1},{x1:n.x0,y1:n.y1,x2:n.x0,y2:n.y0}].some(s=>Yt(t,s))}function Vt(t,e={},n={},i){let o=it(e,mt(n),i),s=n.quadrantPadding??k.paddingX,l=n.quadrantPadding??k.paddingY,p=n.titleFontSize??k.titleFontSize,a=n.titlePadding??k.titleGap,u=t.title?p+a:0,c=n.xAxisLabelFontSize??o.edgeLabelFontSize,h=n.yAxisLabelFontSize??o.edgeLabelFontSize,y=n.xAxisLabelPadding??k.axisLabelPadding,m=n.yAxisLabelPadding??k.axisLabelPadding,b=c+y*2+7,R=h+m*2+7,S=b,Q=R,d=le(t.points.length),z,v;for(let f=0;f<2;f++){if(n.chartWidth!==void 0||n.chartHeight!==void 0){let g=s*2+Q,et=l*2+u+S,ct=n.chartWidth!==void 0?n.chartWidth-g:Number.POSITIVE_INFINITY,ut=n.chartHeight!==void 0?n.chartHeight-et:Number.POSITIVE_INFINITY;d=Math.max(60,Math.min(ct,ut))}let A=Math.max(24,d/2-12);z=t.xAxis?{near:at(t.xAxis.near,A,c,o.edgeLabelFontWeight),...t.xAxis.far?{far:at(t.xAxis.far,A,c,o.edgeLabelFontWeight)}:{}}:void 0,v=t.yAxis?{near:at(t.yAxis.near,A,h,o.edgeLabelFontWeight),...t.yAxis.far?{far:at(t.yAxis.far,A,h,o.edgeLabelFontWeight)}:{}}:void 0;let $=Math.max(1,...z?[z.near,z.far??""].map(g=>g.split(`
|
|
10
|
+
`).length):[1]),q=Math.max(1,...v?[v.near,v.far??""].map(g=>g.split(`
|
|
11
|
+
`).length):[1]);S=b+($-1)*c*1.1,Q=R+(q-1)*h*1.1}let C=s+Q,F=l+u,_=d/2,X=C+d+s,Y=F+d+S+l,r=[{number:2,col:0,row:0},{number:1,col:1,row:0},{number:3,col:0,row:1},{number:4,col:1,row:1}].map(({number:f,col:A,row:$})=>{let q=C+A*_,g=F+$*_;return{number:f,label:t.quadrants[f-1],x:x(q),y:x(g),width:x(_),height:x(_),labelX:x(q+_/2),labelY:x(g+_/2)}}),P=o.nodeLabelFontSize,E=o.nodeLabelFontWeight,J=n.pointTextPadding??k.pointTextPadding,w=r.filter(f=>f.label).map(f=>{let A=U(D(f.label,o.groupTextTransform),o.groupHeaderFontSize,o.groupHeaderFontWeight);return{x0:f.labelX-A/2,y0:f.labelY-o.groupHeaderFontSize*.75,x1:f.labelX+A/2,y1:f.labelY+o.groupHeaderFontSize*.75}}),L=n.pointRadius??k.pointRadius,tt=t.points.map(f=>Ht(f,t.classDefs,{radius:L})),V=t.points.map((f,A)=>{let $=C+f.x*d,q=F+(1-f.y)*d,g=tt[A].radius+1;return{x0:$-g,y0:q-g,x1:$+g,y1:q+g}}),H={x0:2,y0:2,x1:X-2,y1:Y-2},ht=[],Kt=t.points.map((f,A)=>{let $=tt[A],q=x(C+f.x*d),g=x(F+(1-f.y)*d),et=D(f.label,o.nodeTextTransform),ct=U(et,P,E),ut=P*1.1,Zt=$.radius+J,Jt=j=>{let O=j.box;if(!(O.x0>=H.x0&&O.y0>=H.y0&&O.x1<=H.x1&&O.y1<=H.y1)||w.some(N=>Ot(O,N))||V.some(N=>Ot(O,N)))return!1;if(!j.far)return!0;let bt=Xt(q,g,$.radius,j);return!w.some(N=>fe(bt,N))&&!ht.some(N=>Yt(bt,N))},nt=xe(q,g,Zt,ct,ut),W=nt.find(Jt),M={label:et,nx:f.x,ny:f.y,cx:q,cy:g,radius:$.radius,labelX:x((W??nt[0]).x),labelY:x((W??nt[0]).y),labelAnchor:(W??nt[0]).anchor};if($.fill!==void 0&&(M.fill=$.fill),$.stroke!==void 0&&(M.stroke=$.stroke),$.strokeWidth!==void 0&&(M.strokeWidth=$.strokeWidth),f.className!==void 0&&(M.className=f.className),W){w.push(W.box);let j={x0:x(W.box.x0),y0:x(W.box.y0),x1:x(W.box.x1),y1:x(W.box.y1)};M.labelBox=j,W.far&&(M.leader=Xt(q,g,$.radius,W),ht.push(M.leader))}else M.labelHidden=!0;return M}),G=[],yt=F+d+c+y;if(z&&(G.push({text:z.near,x:x(C+4),y:x(yt),anchor:"start",fontSize:c}),z.far&&G.push({text:z.far,x:x(C+d-4),y:x(yt),anchor:"end",fontSize:c})),v){let f=s+h;G.push({text:v.near,x:x(f),y:x(F+d-4),anchor:"start",fontSize:h}),v.far&&G.push({text:v.far,x:x(f),y:x(F+4),anchor:"end",fontSize:h})}return{width:x(X),height:x(Y),title:t.title?{text:t.title,x:x(C+d/2),y:x(l+p/2),fontSize:p}:void 0,accessibility:t.accessibility?{...t.accessibility}:void 0,plot:{x:x(C),y:x(F),size:x(d)},regions:r,points:Kt,axisLabels:G,visual:n}}var Qe={titleFontSize:k.titleFontSize,axisFontSize:k.axisFontSize,quadrantFontSize:k.quadrantFontSize,pointFontSize:k.pointFontSize};var pe=/^title\s+(.+)$/i,me=/^([xy])-axis\s+(.+)$/i,he=/^quadrant-([1-4])\s+(.+)$/i,ye=/^(.+?)\s*:\s*\[\s*([^,\]]+)\s*,\s*([^,\]]+)\s*\]\s*(.*)$/,be=/^classDef\s+(.+)$/i;function jt(t){let e=gt(t);if(St(e),t=e.familyLines,t.length===0)throw new Error("Quadrant chart is empty");let n=t[0].trim();if(!/^quadrant(?:Chart)?\b\s*$/i.test(n))throw new Error(`Quadrant chart must start with "quadrant" or "quadrantChart", got: "${n}"`);let i,o={...e.accessibility.title!==void 0?{title:T(e.accessibility.title)}:{},...e.accessibility.descr!==void 0?{description:T(e.accessibility.descr)}:{}},s,l,p=[void 0,void 0,void 0,void 0],a=[],u=Object.create(null),c=new Set;for(let h=1;h<t.length;h++){let y=t[h].trim();if(y.length===0||y.startsWith("%%"))continue;let m;if(m=y.match(be)){let b=Dt(m[1]);if(!b.ok)throw new Error(`Invalid quadrant classDef: ${b.error}`);u[b.name]=b.style;continue}if(m=y.match(pe)){i=T(m[1].trim());continue}if(m=y.match(me)){let b=ge(m[2].trim(),m[1].toLowerCase());m[1].toLowerCase()==="x"?s=b:l=b;continue}if(m=y.match(he)){let b=Number.parseInt(m[1],10)-1;p[b]=T(m[2].trim());continue}if(m=y.match(ye)){let{label:b,className:R}=Bt(m[1].trim()),S=T(b),Q=m[4].trim(),d=pt(Q);if(!d.ok)throw new Error(`Unsupported quadrant point style metadata: "${Q}" \u2014 ${d.error}. Expected comma-separated radius/color/stroke-color/stroke-width entries.`);let z=Gt(S,m[2].trim()),v=Gt(S,m[3].trim());if(c.has(S))throw new Error(`Duplicate quadrant point label: "${S}"`);c.add(S);let C={label:S,x:z,y:v};R!==void 0&&(C.className=R),d.style!==void 0&&(C.style=d.style),a.push(C);continue}throw y.includes(":")?new Error(`Invalid quadrant point: "${y}". Expected: Label: [x, y] with x,y in [0,1]`):It({what:`Unrecognized quadrant chart line: "${y}"`,expectedForm:"a title, x-axis/y-axis, a quadrant-N label, a point (Label: [x, y]), or a classDef",example:"Quick win: [0.2, 0.8]"})}return{title:i,...o.title||o.description?{accessibility:o}:{},xAxis:s,yAxis:l,quadrants:p,points:a,classDefs:u}}function ge(t,e){let n=e==="x"?"left":"bottom",i=t.indexOf("-->");if(i>=0){let s=T(t.slice(0,i).trim()),l=T(t.slice(i+3).trim());if(!s)throw new Error(`Quadrant ${e}-axis is missing its ${n} label: "${t}"`);if(!l)throw new Error(`Quadrant ${e}-axis has "-->" but no far label: "${t}"`);return{near:s,far:l}}let o=T(t.trim());if(!o)throw new Error(`Quadrant ${e}-axis is missing its ${n} label`);return{near:o}}function Gt(t,e){if(!/^[+-]?(?:\d+(?:\.\d+)?|\.\d+)$/.test(e))throw new Error(`Quadrant point "${t}" has non-numeric coordinate "${e}". Coordinates must be numbers in [0, 1].`);let n=Number.parseFloat(e);if(!Number.isFinite(n)||n<0||n>1)throw new Error(`Quadrant point "${t}" coordinate "${e}" is out of range. Coordinates must be in [0, 1].`);return n}function Ut(t){let{positioned:e,colors:n,resolved:i}=t,o=i.renderOptions,s=n.font??"Inter",l=o.transparent??!1,p=o.interactive??!1,a=it(o,mt(e.visual),i.styleFace),u=e.points.some(r=>r.leader),c=[],h={title:e.accessibility?.title??e.title?.text,description:e.accessibility?.description},y=`quadrant-${Tt(e.width,e.height,h.title??"",h.description??"",...e.points.flatMap(r=>[r.label,r.nx,r.ny]))}`,m=`${y}-title`,b=`${y}-desc`,R=Pe(e,a,{leaders:u,interactive:p}),S=[$e(e,n,l,h,y,m,b)];h.title&&S.push(`<title id="${m}">${I(h.title)}</title>`),h.description&&S.push(`<desc id="${b}">${I(h.description)}</desc>`),S.push(qt(s,!1,n.shadow,n.embedFontImport));let Q=vt(n);Q&&S.push(`<defs>${Q}</defs>`),S.push(R),c.push(Qt({id:"prelude",width:e.width,height:e.height,colors:n,transparent:l,font:s,hasMonoFont:!1,extraCss:R},S.join(`
|
|
12
|
+
`)));let{plot:d}=e,z=d.size/2,v=e.visual.quadrantInternalBorderStrokeWidth??a.lineWidth,C=e.visual.quadrantExternalBorderStrokeWidth??a.groupLineWidth;for(let r of e.regions){let P=ke(r.number,a);c.push(B({id:`plate:${r.number}`,role:"plate",geometry:{kind:"rect",x:r.x,y:r.y,width:r.width,height:r.height},paint:{fill:P,stroke:"none"},channels:r.label?{category:r.label}:void 0},`<rect class="quadrant-region" x="${r.x}" y="${r.y}" width="${r.width}" height="${r.height}" fill="${P}" data-quadrant="${r.number}" />`))}let F=d.x+z,_=d.y+z,X={stroke:a.edgeStrokeColor??"var(--_line)",strokeWidth:String(v)};c.push(B({id:"divider:v",role:"grid",geometry:{kind:"line",x1:F,y1:d.y,x2:F,y2:d.y+d.size},paint:X},`<line class="quadrant-divider" x1="${F}" y1="${d.y}" x2="${F}" y2="${d.y+d.size}" />`)),c.push(B({id:"divider:h",role:"grid",geometry:{kind:"line",x1:d.x,y1:_,x2:d.x+d.size,y2:_},paint:X},`<line class="quadrant-divider" x1="${d.x}" y1="${_}" x2="${d.x+d.size}" y2="${_}" />`)),c.push(B({id:"border",role:"chrome",geometry:{kind:"rect",x:d.x,y:d.y,width:d.size,height:d.size},paint:{fill:"none",stroke:a.groupBorderColor??a.nodeBorderColor??"var(--_node-stroke)",strokeWidth:String(C)}},`<rect class="quadrant-border" x="${d.x}" y="${d.y}" width="${d.size}" height="${d.size}" fill="none" />`));for(let r of e.regions){if(!r.label)continue;let P=D(r.label,a.groupTextTransform);c.push(K({id:`quadrant-label:${r.number}`,role:"label",text:P,x:r.labelX,y:r.labelY,fontSize:a.groupHeaderFontSize,anchor:"middle",paint:{fill:a.groupTextColor??"var(--_text-sec)"},channels:{category:r.label}},ot(P,r.labelX,r.labelY,a.groupHeaderFontSize,`class="quadrant-label" text-anchor="middle" dominant-baseline="middle" font-size="${a.groupHeaderFontSize}" font-weight="${a.groupHeaderFontWeight}"${dt(a.groupLetterSpacing)}`)))}let Y=[],lt=new Map;for(let r of e.points){let P=lt.get(r.label)??0;lt.set(r.label,P+1);let E=P===0?`point:${r.label}`:`point:${r.label}#${P}`;if(r.leader){let L=r.leader;c.push(B({id:`leader:${r.label}`,role:"chrome",geometry:{kind:"line",x1:L.x1,y1:L.y1,x2:L.x2,y2:L.y2},paint:{stroke:a.edgeStrokeColor??"var(--_line)",strokeWidth:"1"}},`<line class="quadrant-leader" x1="${L.x1}" y1="${L.y1}" x2="${L.x2}" y2="${L.y2}" />`))}let J=Se(r),w=r.className?`quadrant-point ${r.className}`:"quadrant-point";if(c.push(B({id:E,role:"point",geometry:{kind:"circle",cx:r.cx,cy:r.cy,r:r.radius},paint:{fill:r.fill??a.nodeFillColor??"var(--accent, var(--_arrow))",stroke:r.stroke??a.nodeBorderColor??"var(--bg)",strokeWidth:r.strokeWidth??String(Math.max(1,a.nodeLineWidth))}},`<circle class="${I(w)}" cx="${r.cx}" cy="${r.cy}" r="${r.radius}"${J} data-label="${I(r.label)}" data-x="${r.nx}" data-y="${r.ny}" />`)),r.labelHidden||c.push(K({id:`${E}:label`,role:"label",text:r.label,x:r.labelX,y:r.labelY,fontSize:a.nodeLabelFontSize,anchor:r.labelAnchor,paint:{fill:a.nodeTextColor??"var(--_text)"}},ot(r.label,r.labelX,r.labelY,a.nodeLabelFontSize,`class="quadrant-point-label" text-anchor="${r.labelAnchor}" dominant-baseline="middle" font-size="${a.nodeLabelFontSize}" font-weight="${a.nodeLabelFontWeight}"${dt(a.nodeLetterSpacing)}`))),p){let L=`${r.label}: [${r.nx}, ${r.ny}]`;Y.push(wt({id:`tooltip:${E}`,role:"chrome"},`<g class="quadrant-point-group"><circle cx="${r.cx}" cy="${r.cy}" r="${r.radius+6}" fill="transparent"/><title>${I(L)}</title>`+Rt("quadrant",r.cx,r.cy-r.radius,L)+"</g>"))}}c.push(...Y);for(let r of e.axisLabels){let P=r.text.split(`
|
|
13
|
+
`).map(V=>D(V,a.edgeTextTransform)),E=P.join(`
|
|
14
|
+
`),w=r.x<d.x?{kind:"rotate",angle:-90,cx:r.x,cy:r.y}:void 0,L=w?` transform="rotate(${w.angle} ${w.cx} ${w.cy})"`:"",tt=P.length===1?I(E):P.map((V,H)=>`<tspan x="${r.x}" dy="${H===0?0:"1.1em"}">${I(V)}</tspan>`).join("");c.push(K({id:`axis:${r.text}`,role:"axis",text:E,x:r.x,y:r.y,fontSize:r.fontSize,anchor:r.anchor,paint:{fill:a.edgeTextColor??"var(--_text-muted)"},transform:w},`<text class="quadrant-axis-label" x="${r.x}" y="${r.y}" text-anchor="${r.anchor}" font-size="${r.fontSize}" font-weight="${a.edgeLabelFontWeight}"${dt(a.edgeLetterSpacing)}${L}>${tt}</text>`))}if(e.title){let r=D(e.title.text,a.groupTextTransform);c.push(K({id:"title",role:"title",text:r,x:e.title.x,y:e.title.y,fontSize:e.title.fontSize,anchor:"middle",paint:{fill:a.groupTextColor??a.nodeTextColor??"var(--_text)"}},ot(r,e.title.x,e.title.y,e.title.fontSize,`class="quadrant-title" text-anchor="middle" dominant-baseline="middle" font-size="${e.title.fontSize}" font-weight="${Math.max(a.groupHeaderFontWeight,600)}"${dt(a.groupLetterSpacing)}`)))}return c.push(Wt()),{family:"quadrant",width:e.width,height:e.height,colors:n,transparent:l,parts:c}}function Se(t){let e=[];return t.fill!==void 0&&e.push(`fill:${t.fill}`),t.stroke!==void 0&&e.push(`stroke:${t.stroke}`),t.strokeWidth!==void 0&&e.push(`stroke-width:${t.strokeWidth}`),e.length>0?` style="${I(e.join(";"))}"`:""}function $e(t,e,n,i,o,s,l){let p=t.visual.useMaxWidth?{width:"100%",height:"100%",style:`max-width:${t.width}px`}:{};return _t(t.width,t.height,e,n,{...p,attrs:{id:o,...Mt(i.title,i.description,s,l,"quadrant chart")}})}function ke(t,e){let n=t===1||t===3?10:5;if(e.groupFillColor){let i=t===1||t===3?88:76;return`color-mix(in srgb, ${e.groupFillColor} ${i}%, var(--bg))`}return`color-mix(in srgb, var(--accent, var(--_arrow)) ${n}%, var(--bg))`}function Pe(t,e,n){let i=t.visual.quadrantInternalBorderStrokeWidth??e.lineWidth,o=t.visual.quadrantExternalBorderStrokeWidth??e.groupLineWidth,s=n.leaders?`
|
|
15
|
+
.quadrant-leader { stroke: ${e.edgeStrokeColor??"var(--_line)"}; stroke-width: 1; }`:"",l=n.interactive?Et("quadrant",["quadrant-point-group"]):"";return`<style>
|
|
16
|
+
.quadrant-region { stroke: none; }
|
|
17
|
+
.quadrant-divider { stroke: ${e.edgeStrokeColor??"var(--_line)"}; stroke-width: ${i}; }
|
|
18
|
+
.quadrant-border { stroke: ${e.groupBorderColor??e.nodeBorderColor??"var(--_node-stroke)"}; stroke-width: ${o}; }
|
|
19
|
+
.quadrant-label { fill: ${e.groupTextColor??"var(--_text-sec)"}; }
|
|
20
|
+
.quadrant-point { fill: ${e.nodeFillColor??"var(--accent, var(--_arrow))"}; stroke: ${e.nodeBorderColor??"var(--bg)"}; stroke-width: ${Math.max(1,e.nodeLineWidth)}; }
|
|
21
|
+
.quadrant-point-label { fill: ${e.nodeTextColor??"var(--_text)"}; }
|
|
22
|
+
.quadrant-axis-label { fill: ${e.edgeTextColor??"var(--_text-muted)"}; }
|
|
23
|
+
.quadrant-title { fill: ${e.groupTextColor??e.nodeTextColor??"var(--_text)"}; }${s}${l}
|
|
24
|
+
</style>`}function dt(t){return t!==0?` letter-spacing="${t}"`:""}var an=Ct(Nt,{normalizeRequest:t=>({familyConfig:{visual:ft(t.source.frontmatter)}}),layout:t=>Lt(Vt($t(jt(t.source.familyLines),t.source.accessibility),t.renderOptions,t.familyConfig?.visual??ft(),t.styleFace)),lowerScene:Pt(Ut)});export{an as default};
|