isorite 0.16.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +1634 -62
- package/package.json +4 -1
- package/web/_app/immutable/assets/0.BGpjfMlq.css +1 -0
- package/web/_app/immutable/assets/4.Dn5sJ8uq.css +1 -0
- package/web/_app/immutable/assets/5.DJhOSn7C.css +1 -0
- package/web/_app/immutable/assets/NoteList.Wxp_AH0Y.css +1 -0
- package/web/_app/immutable/chunks/{BQeONalw.js → -_CDfwKC.js} +1 -1
- package/web/_app/immutable/chunks/{BtcGx-KQ.js → -oRvYXNk.js} +1 -1
- package/web/_app/immutable/chunks/0qd6IUbO.js +1 -0
- package/web/_app/immutable/chunks/{DbtvzL7r.js → 7faei0hL.js} +1 -1
- package/web/_app/immutable/chunks/{zasx25UV.js → BArcFmbE.js} +3 -3
- package/web/_app/immutable/chunks/BF1TezEe.js +1 -0
- package/web/_app/immutable/chunks/{Kem7IXj7.js → BF3mdiSX.js} +1 -1
- package/web/_app/immutable/chunks/BFOLKM4z.js +1 -0
- package/web/_app/immutable/chunks/{BPpUSQ2Y.js → BezGs1Zj.js} +1 -1
- package/web/_app/immutable/chunks/Bg-39frG.js +1 -0
- package/web/_app/immutable/chunks/BleKqNM1.js +1 -0
- package/web/_app/immutable/chunks/{e7GRa0yc.js → BpHE30PI.js} +1 -1
- package/web/_app/immutable/chunks/{DAVMwq6b.js → BtF1frCE.js} +1 -1
- package/web/_app/immutable/chunks/{0B47b24t.js → BuNfZSU6.js} +1 -1
- package/web/_app/immutable/chunks/{BAVnZFPa.js → BubCsN15.js} +1 -1
- package/web/_app/immutable/chunks/{CcE14TDI.js → BvhVny3O.js} +1 -1
- package/web/_app/immutable/chunks/{C9Qdslk3.js → Bvs-JCN-.js} +1 -1
- package/web/_app/immutable/chunks/{DFo4P1vU.js → C-F98t31.js} +1 -1
- package/web/_app/immutable/chunks/{Cpjqsnqr.js → C1OaBy7n.js} +1 -1
- package/web/_app/immutable/chunks/{C8FxuPry.js → C4SqDe8e.js} +1 -1
- package/web/_app/immutable/chunks/{D9uNsgxP.js → C74H8jNb.js} +1 -1
- package/web/_app/immutable/chunks/{CUNetmvQ.js → C7bouMY8.js} +1 -1
- package/web/_app/immutable/chunks/{BiHyHFlW.js → C8IrXs1w.js} +1 -1
- package/web/_app/immutable/chunks/{MrW4zd8l.js → CGGjDDVZ.js} +1 -1
- package/web/_app/immutable/chunks/{Wv-ICQRy.js → CL9QeiGC.js} +85 -85
- package/web/_app/immutable/chunks/{BLzZIf7l.js → CMAnq3x6.js} +1 -1
- package/web/_app/immutable/chunks/{OG9GsKke.js → CMe14KUo.js} +1 -1
- package/web/_app/immutable/chunks/{DW5uy3Jw.js → CXc9Iibq.js} +1 -1
- package/web/_app/immutable/chunks/Cb-KPahQ.js +1 -0
- package/web/_app/immutable/chunks/{DWwu8a1P.js → Cf13Ew0A.js} +1 -1
- package/web/_app/immutable/chunks/CkSjC-iE.js +9 -0
- package/web/_app/immutable/chunks/{DY0M2GMn.js → Cn8Mg7_E.js} +1 -1
- package/web/_app/immutable/chunks/{f7mFVWQS.js → CoeYsgbS.js} +1 -1
- package/web/_app/immutable/chunks/{CZSmkKvQ.js → CrqOdm1D.js} +1 -1
- package/web/_app/immutable/chunks/{CVqwkR8N.js → CyJXJYoE.js} +1 -1
- package/web/_app/immutable/chunks/{AnnzTlE8.js → Cz6kYWmu.js} +1 -1
- package/web/_app/immutable/chunks/{ZTEErEOd.js → CzbFy3_5.js} +1 -1
- package/web/_app/immutable/chunks/{Ih6r6QR2.js → D-9suc4b.js} +1 -1
- package/web/_app/immutable/chunks/{BZX8cNYL.js → D37hxBaz.js} +1 -1
- package/web/_app/immutable/chunks/D7yT4F_8.js +517 -0
- package/web/_app/immutable/chunks/{DxRGLDbV.js → DNs5kWvM.js} +1 -1
- package/web/_app/immutable/chunks/DQp-M3XN.js +1 -0
- package/web/_app/immutable/chunks/{D7jLdCNu.js → DR5d84Z7.js} +1 -1
- package/web/_app/immutable/chunks/{DH_19--P.js → DaEL1AOW.js} +1 -1
- package/web/_app/immutable/chunks/{CSKABQj2.js → Dazeexma.js} +1 -1
- package/web/_app/immutable/chunks/{mhWk5y4o.js → Dc2_04md.js} +1 -1
- package/web/_app/immutable/chunks/{1j--pDqt.js → Dcjgv4h2.js} +1 -1
- package/web/_app/immutable/chunks/{CSTv2fL0.js → DgI3Vj5v.js} +1 -1
- package/web/_app/immutable/chunks/{B7LnLClC.js → Dgko1xMH.js} +1 -1
- package/web/_app/immutable/chunks/{DEQsS4Ez.js → DlgOmQ_G.js} +1 -1
- package/web/_app/immutable/chunks/{BLe29cGh.js → DmS5Qyvl.js} +1 -1
- package/web/_app/immutable/chunks/{CglDFp51.js → DqnDX3G8.js} +1 -1
- package/web/_app/immutable/chunks/{CTuuQ66F.js → DyZdoKBK.js} +1 -1
- package/web/_app/immutable/chunks/{CUB9vnd0.js → DzAOHjhV.js} +1 -1
- package/web/_app/immutable/chunks/{DJT73ARj.js → Iqegk1SI.js} +1 -1
- package/web/_app/immutable/chunks/{Mwr1r9aw.js → ONqdwA3r.js} +1 -1
- package/web/_app/immutable/chunks/{Bytzbt5l.js → Oikibjm2.js} +1 -1
- package/web/_app/immutable/chunks/{C1FDDux-.js → T3u7Skc8.js} +1 -1
- package/web/_app/immutable/chunks/{Ch5Z7cbP.js → cWWhqL1F.js} +1 -1
- package/web/_app/immutable/chunks/{CwHHpacD.js → fRXyV4Ec.js} +1 -1
- package/web/_app/immutable/chunks/{CWc-mNzo.js → jAC4YCqW.js} +1 -1
- package/web/_app/immutable/chunks/{hjSZ041d.js → kFEqmLql.js} +1 -1
- package/web/_app/immutable/chunks/{BtYMl4bD.js → y0C1JQ1v.js} +1 -1
- package/web/_app/immutable/chunks/{DJQ6favH.js → yvD4_bP8.js} +1 -1
- package/web/_app/immutable/entry/app.CyEmP0i2.js +2 -0
- package/web/_app/immutable/entry/start.BxCHvKWL.js +1 -0
- package/web/_app/immutable/nodes/0.Bkbiw_sA.js +11 -0
- package/web/_app/immutable/nodes/1.kdx6h8ts.js +1 -0
- package/web/_app/immutable/nodes/2.CtK7BGB8.js +1 -0
- package/web/_app/immutable/nodes/3.D5PZa2kH.js +1 -0
- package/web/_app/immutable/nodes/4.DzS8oPUH.js +3 -0
- package/web/_app/immutable/nodes/5.B-1BDKsL.js +19 -0
- package/web/_app/immutable/nodes/6.DDT1DtCg.js +1 -0
- package/web/_app/immutable/nodes/7.CCNCaItj.js +1 -0
- package/web/_app/immutable/workers/worker-C_nKscAW.js +1 -0
- package/web/_app/version.json +1 -1
- package/web/fonts/LythMono-LICENSE.md +112 -0
- package/web/fonts/lyth-mono-latin-bold.woff2 +0 -0
- package/web/fonts/lyth-mono-latin-bolditalic.woff2 +0 -0
- package/web/fonts/lyth-mono-latin-italic.woff2 +0 -0
- package/web/fonts/lyth-mono-latin-regular.woff2 +0 -0
- package/web/index.html +19 -17
- package/web/_app/immutable/assets/0.BEFtmzIh.css +0 -1
- package/web/_app/immutable/assets/4.LR47AJKA.css +0 -1
- package/web/_app/immutable/assets/NoteList.C2GYAaLW.css +0 -1
- package/web/_app/immutable/chunks/BHORylQC.js +0 -1
- package/web/_app/immutable/chunks/BMijTvgG.js +0 -1
- package/web/_app/immutable/chunks/C7qBBO-i.js +0 -1
- package/web/_app/immutable/chunks/CA-rzUq8.js +0 -524
- package/web/_app/immutable/chunks/DtEVmiYo.js +0 -1
- package/web/_app/immutable/chunks/Qej0SEux.js +0 -1
- package/web/_app/immutable/chunks/TmxIGCN3.js +0 -1
- package/web/_app/immutable/entry/app.B9TPZNFw.js +0 -2
- package/web/_app/immutable/entry/start.WU9HKeyT.js +0 -1
- package/web/_app/immutable/nodes/0.C9NFEqJd.js +0 -3
- package/web/_app/immutable/nodes/1.B5PJwWOG.js +0 -1
- package/web/_app/immutable/nodes/2.DRtC7zjs.js +0 -1
- package/web/_app/immutable/nodes/3.EEMisvUL.js +0 -1
- package/web/_app/immutable/nodes/4.DthmsFQC.js +0 -19
- package/web/_app/immutable/nodes/5.CEu0DlpQ.js +0 -1
- package/web/_app/immutable/nodes/6.DzvF0ZPt.js +0 -1
- package/web/_app/immutable/workers/worker-CWkpeSVG.js +0 -1
- /package/web/_app/immutable/assets/{6.C00vyVPo.css → 7.C00vyVPo.css} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as e,a as t,b as n,d as r,i,o as a,r as o,s,u as c,x as l}from"./
|
|
1
|
+
import{_ as e,a as t,b as n,d as r,i,o as a,r as o,s,u as c,x as l}from"./DlgOmQ_G.js";import{o as u,r as d}from"./DciMwFJ1.js";import{s as f}from"./BF3mdiSX.js";import{t as p}from"./T3u7Skc8.js";import{r as m}from"./CMAnq3x6.js";import{PeleError as h,g,h as _,n as v,s as y,u as b,y as x}from"./BArcFmbE.js";var S=`aliceblue antiquewhite aqua aquamarine azure beige bisque black blanchedalmond blue blueviolet brown burlywood cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan darkblue darkcyan darkgoldenrod darkgray darkgreen darkgrey darkkhaki darkmagenta darkolivegreen darkorange darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkslategrey darkturquoise darkviolet deeppink deepskyblue dimgray dimgrey dodgerblue firebrick floralwhite forestgreen fuchsia gainsboro ghostwhite gold goldenrod gray green greenyellow grey honeydew hotpink indianred indigo ivory khaki lavender lavenderblush lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgreen lightgrey lightpink lightsalmon lightseagreen lightskyblue lightslategray lightslategrey lightsteelblue lightyellow lime limegreen linen magenta maroon mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen mediumslateblue mediumspringgreen mediumturquoise mediumvioletred midnightblue mintcream mistyrose moccasin navajowhite navy oldlace olive olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise palevioletred papayawhip peachpuff peru pink plum powderblue purple rebeccapurple red rosybrown royalblue saddlebrown salmon sandybrown seagreen seashell sienna silver skyblue slateblue slategray slategrey snow springgreen steelblue tan teal thistle tomato turquoise violet wheat white whitesmoke yellow yellowgreen transparent currentcolor inherit initial unset revert accentcolor accentcolortext activetext buttonborder buttonface buttontext canvas canvastext field fieldtext graytext highlight highlighttext linktext mark marktext selecteditem selecteditemtext visitedtext activeborder activecaption appworkspace background buttonhighlight buttonshadow captiontext inactiveborder inactivecaption inactivecaptiontext infobackground infotext menu menutext scrollbar threeddarkshadow threedface threedhighlight threedlightshadow threedshadow window windowframe windowtext`,C,w=/^[+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?(%|deg|grad|rad|turn)?$/i;function T(e){if(e.toLowerCase()===`none`)return 4;let t=w.exec(e);return t?t[1]===void 0?1:t[1]===`%`?2:3:0}function ee(e,t){let n=T(e);return n===1||n===2||t&&n===4}function E(e){let t=e.startsWith(`hsl`),n=e.indexOf(`(`),r=e.slice(0,n);if(r!==`rgb`&&r!==`rgba`&&r!==`hsl`&&r!==`hsla`||e.length>120||e.indexOf(`)`)!==e.length-1)return!1;let i=e.slice(n+1,-1).trim(),a,o,s=i.includes(`,`);if(s)a=i.split(`,`).map(e=>e.trim()),a.length===4&&(o=a.pop());else{let e=i.split(`/`);if(e.length>2)return!1;a=e[0].trim().split(/\s+/),e.length===2&&(o=e[1].trim())}if(a.length!==3||o!==void 0&&!ee(o,!s))return!1;let c=a.map(T);if(s)return t?(c[0]===1||c[0]===3)&&c[1]===2&&c[2]===2:(c[0]===1||c[0]===2)&&c[1]===c[0]&&c[2]===c[0];for(let e=0;e<3;e++){let n=c[e];if(!(n===1||n===4||(t&&e===0?n===3:n===2)))return!1}return!0}function te(e){return e.includes(`(`)?E(e):(C??=new Set(S.split(` `)),C.has(e.toLowerCase()))}var ne=/^:?wrap:/,D=/^:?nowrap:/,re=/^:?(?:no)?wrap:/,ie=/^(?:rgba?|hsla?)\s*\(/,O=/[\r\u2028\u2029]/,ae=/^\w*/;function k(e){throw new h(e,`semantic`,{type:`sequence`})}function A(e){let t=e.trim(),n=ne.test(t)?!0:!D.test(t)&&void 0;return{text:(n===void 0?t:t.replace(re,``)).trim(),wrap:n}}function oe(e){let t=ie.exec(e);if(t){let n=e.lastIndexOf(`)`);if(n>=t[0].length)return O.test(e.slice(t[0].length))?void 0:[e.slice(0,n+1),e.slice(n+1)]}if(O.test(e))return;let n=ae.exec(e)[0];return[n,e.slice(n.length)]}function se(e){return typeof e==`string`?[...e].map((e,t)=>[String(t),e]):typeof e==`object`&&e?Object.entries(e):[]}var j=class{type=`sequence`;actors=new Map;createdActors=new Map;destroyedActors=new Map;boxes=[];messages=[];notes=[];title;accTitle;accDescr;prevActor;currentBox;lastCreated;lastDestroyed;wrapEnabled;sequenceWrap;active=new Map;constructor(e={}){this.wrapEnabled=e.wrap,this.sequenceWrap=e.sequenceWrap??!1}autoWrap(){return this.wrapEnabled??this.sequenceWrap}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,``)}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
|
|
2
2
|
`)}setDiagramTitle(e){this.title=e}parseMessage(e){return A(e)}parseBoxData(e){let t=oe(e),n=t?.[0]?t[0].trim():`transparent`,r=t?.[1]?t[1].trim():void 0;if(te(n)||(n=`transparent`,r=e.trim()),r===void 0)return{text:void 0,color:n,wrap:void 0};let{text:i,wrap:a}=A(r);return{text:i||void 0,color:n,wrap:a}}addBox(e){this.currentBox={name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]},this.boxes.push(this.currentBox)}addActor(e,t,n,r,i){let a=this.currentBox,o;if(i!==void 0){let t;try{t=v(i.includes(`
|
|
3
3
|
`)?i+`
|
|
4
4
|
`:`{
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e,n as t,r as n,t as r}from"./
|
|
1
|
+
import{i as e,n as t,r as n,t as r}from"./DNs5kWvM.js";import{_ as i,d as a,f as o,i as s,o as c,x as l}from"./DlgOmQ_G.js";import{n as u,t as d}from"./D37hxBaz.js";import{t as f}from"./DciMwFJ1.js";import{s as p}from"./BF3mdiSX.js";import{PeleError as m,g as h,h as g,s as _,u as ee}from"./BArcFmbE.js";var v=class{type=`timeline`;title;accTitle;accDescr;direction=`LR`;sections=[];periods=[];currentSection=``;getCommonDb(){return this}setDiagramTitle(e){this.title=e}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,``)}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
|
|
2
2
|
`)}setDirection(e){this.direction=e}addSection(e){this.currentSection=e,this.sections.push(e)}addTask(e,t,n){this.periods.push({text:e,events:n?[n]:[],section:this.currentSection,sectionIndex:this.sections.length-1})}addEvent(e){let t=this.periods[this.periods.length-1];if(!t)throw new m(`An event needs a time period before it.`,`semantic`,{type:`timeline`});t.events.push(e)}},y=[`$end`,`EOF`,`INVALID`,`NEWLINE`,`timeline`,`timeline_lr`,`timeline_td`,`title`,`acc_title`,`acc_title_value`,`acc_descr`,`acc_descr_value`,`acc_descr_multiline_value`,`section`,`period`,`event`];function b(i){let a=i.length,o=[],s=[],c=[],l={types:o,texts:s,starts:c},u=0,d=(e,t)=>{o.push(e),s.push(i.slice(u,t)),c.push(u),u=t};for(;u=t(i,u),!(u>=a);){let t=i.charCodeAt(u),o=u+1;if(t===10){for(;i.charCodeAt(o)===10;)o++;d(3,o)}else{if(r(i,u,`timeline`)){for(o=u+8;i.charCodeAt(o)===32||i.charCodeAt(o)===9;)o++;let e=r(i,o,`lr`);if(o>u+8&&(e||r(i,o,`td`))&&!h(i.charCodeAt(o+2))){d(e?5:6,o+2);continue}if(!h(i.charCodeAt(u+8))){d(4,u+8);continue}}if(r(i,u,`title`)){for(o=u+5;i.charCodeAt(o)!==10&&g(i.charCodeAt(o));)o++;if(o===a||i.charCodeAt(o)===10){u=o;continue}let e=i.charCodeAt(u+5);if(e!==13&&g(e)){d(7,n(i,u+6));continue}}if(o=e(i,u,l,8),o!==u)u=o;else{if(r(i,u,`section`)&&g(i.charCodeAt(u+7))){for(o=u+8;o<a&&i.charCodeAt(o)!==58&&i.charCodeAt(o)!==10;)o++;if(o>u+8){d(13,o);continue}}if(t!==58){o=u+1;for(let e=i.charCodeAt(o);o<a&&e!==35&&e!==58&&e!==10;e=i.charCodeAt(++o));d(14,o)}else{if(g(i.charCodeAt(u+1))){for(o=u+2;o<a;o++){let e=i.charCodeAt(o);if(e===10||e===58&&g(i.charCodeAt(o+1)))break}if(o>u+2){d(15,o);continue}}d(2,u+1)}}}}return(c.length===0||c[c.length-1]<a)&&d(1,a),d(0,a),l}var x=`'EOF', 'SPACE', 'NEWLINE', 'title', 'acc_title', 'acc_descr', 'acc_descr_multiline_value', 'section', 'period', 'event'`;function S(e,t){let{types:n,texts:r,starts:i}=b(e),a=(t,r)=>{let a=n[t]===0?`1`:y[n[t]];throw _(`timeline`,e,i[t],`Expecting ${r}, got '${a}'`)},o=n[0];o!==4&&o!==5&&o!==6&&a(0,`'timeline', 'timeline_lr', 'timeline_td'`),o!==4&&t.setDirection(o===5?`LR`:`TD`);for(let e=1;;e++){let i=r[e];switch(n[e]){case 3:break;case 7:t.getCommonDb().setDiagramTitle(i.substring(6));break;case 8:t.getCommonDb().setAccTitle(r[++e].trim());break;case 10:t.getCommonDb().setAccDescription(r[++e].trim());break;case 12:t.getCommonDb().setAccDescription(i.trim());break;case 13:t.addSection(i.substring(8));break;case 14:t.addTask(i,0,``);break;case 15:t.addEvent(i.substring(2));break;case 1:return;default:a(e,x)}}}var C=12,te=8,ne=152,re=216,ie=264,w=20,T=20,E=14,D=8,O=8,k=12,A=` fill="var(--_bg)"`,ae=` fill="none" stroke="var(--_b)"`;function j(e,t,n,r,i){return`<rect x="${l(e)}" y="${l(t)}" width="${l(n)}" height="${l(r)}"${a(i)}/>`}function M(e,t,n){return e.direction===`TD`?N(e,t,n,!0):f(n,r=>N(e,t,n,r))}function N(e,t,n,r){let a=n.fontSize??16,f=Math.round(a*.875),m=n.measurer??ee(n.fontFamily,n.fontFamilyMono),h=n.padding??8,g=t.timeline?.disableMulticolor!==!0,_=e.periods,v=e.sections.length>0,y=e.sections.map((e,t)=>({section:t,periods:[]})),b={section:-1,periods:[]};_.forEach((e,t)=>(y[e.sectionIndex]??b).periods.push(t)),b.periods.length>0&&y.unshift(b);let x=r&&n.maxWidth!==void 0&&n.maxWidth>0?n.maxWidth-2*h:1/0,S=T+E*2+4*C,M=Math.min(ne,Math.max(80,Math.round((x-S)*.38))),N=Math.min(ie,Math.max(110,x-S-M)),P=M,F=()=>r?N:P,I=_.map(e=>u(e.text,m,a,P)),L=_.map(e=>e.events.map(e=>u(e,m,f,F()))),R=0;for(let e of I)R=Math.max(R,e.width);if(!r)for(let e of L)for(let t of e)R=Math.max(R,t.width);let oe=R>P;if(r)for(let e of L)for(let t of e)oe||=t.width>N;oe&&(P=Math.min(Math.max(Math.ceil(R),M),x===1/0?re:M),I=_.map(e=>d(e.text,m,a,P)),L=_.map(e=>e.events.map(e=>d(e,m,f,F()))));let se=Math.round(a*1.5),z=P+2*C,B=F()+2*C,V=e=>Math.max(e.height,se)+2*te,H=e=>Math.max(e.height,Math.round(f*1.5))+2*te,ce=(e,t)=>e.section>=0?o(e.section):v?`var(--_m)`:o(g?t:0),le=!1;for(let e of L)e.length>0&&(le=!0);let U=0;for(let e of y)U+=Math.max(e.periods.length,1);let W=z+w,G=_.length>0,K=r?z+(le?T+E*2+B:G?T+k:0):U>0?U*W-w+(G?k+8:0):0,q=d(e.title,m,a,Math.max(K,320),1),ue=q.height>0?q.height+16:0,de=Math.max(K,q.width),J=h+(de-K)/2,Y=h+ue,fe=(t,n)=>d(e.sections[t.section],m,a,n-2*C,1),X=(e,t,n,r,i,a)=>j(n,r,i,a,` fill="${o(e.section)}"`)+c(t,n+i/2,r+a/2,` font-weight="var(--_hw)"`+A),pe=(e,t,n,r,i)=>j(n,r,z,i,` fill="${t}"`)+c(I[e],n+z/2,r+i/2,A),me=(e,t,n,r,i)=>`<g class="pele-node pele-event">`+j(n,r,B,i,` fill="${t}" fill-opacity="0.16"`)+c(e,n+B/2,r+i/2,` font-size="${f}"`)+`</g>`,he=(e,t,n)=>`<circle class="pele-dot" cx="${l(e)}" cy="${l(t)}" r="4" fill="${n}" stroke="var(--_bg)" stroke-width="2"/>`,ge=t=>t.section>=0?`<g class="pele-cluster pele-section" data-id="${s(e.sections[t.section].trim())}">`:``,_e=e=>`<g class="pele-node pele-period" data-id="${s(_[e].text.trim())}">`,Z=``,Q;if(r){let e=J+z+T,t=e+E,n=t+E,r=Y;for(let i of y){if(Z+=ge(i),i.section>=0){let e=fe(i,K),t=V(e);Z+=X(i,e,J,r,K,t),r+=t+O+4}for(let a of i.periods){let o=ce(i,a),s=V(I[a]),c=L[a].length>0?H(L[a][0]):s,u=r+Math.max(s,c)/2,d=`M${l(J+z)},${l(u)}H${l(e)}`,f=``,p=u-c/2,m=u;for(let e of L[a]){let r=H(e);m=p+r/2,d+=`M${l(t)},${l(m)}H${l(n)}`,f+=me(e,o,n,p,r),p+=r+D}f&&(d+=`M${l(e)},${l(u)}H${l(t)}V${l(m)}`),Z+=_e(a)+pe(a,o,J,u-s/2,s)+`<path class="pele-edge" d="${d}"${ae}/>`+he(e,u,o)+f+`</g>`,r=Math.max(u+s/2,p-D)+w}i.periods.length===0&&(r+=w-O-4),i.section>=0&&(Z+=`</g>`)}if(y.length>0&&(r-=w),G){let t=r+k+8;Z=`<path class="pele-axis" d="M${l(e)},${l(Y)}V${l(t-8+1)}" fill="none" stroke="var(--_l)"/>`+p(`arrow_point`,e,t,0,1,`var(--_l)`)+Z,r=t}Q=r+h}else{let e=0,t=y.map(t=>{if(t.section<0)return;let n=fe(t,Math.max(t.periods.length,1)*W-w);return e=Math.max(e,V(n)),n}),n=0;for(let e of I)n=Math.max(n,V(e));let r=Y+(v?e+O:0),i=r+n+(n>0?T:0),a=i+T,o=G?i+k:Y+e,s=0;if(y.forEach((c,u)=>{let d=Math.max(c.periods.length,1),f=J+s*W;Z+=ge(c);let p=t[u];p&&(Z+=X(c,p,f,Y,d*W-w,e)),c.periods.forEach((e,t)=>{let s=ce(c,e),u=f+t*W,d=u+z/2,p=`M${l(d)},${l(r+n)}V${l(L[e].length>0?a:i)}`,m=``,h=a;for(let t of L[e]){let e=H(t);h>a&&(p+=`M${l(d)},${l(h-D)}V${l(h)}`),m+=me(t,s,u,h,e),h+=e+D}o=Math.max(o,h-D),Z+=_e(e)+pe(e,s,u,r,n)+`<path class="pele-edge" d="${p}"${ae}/>`+he(d,i,s)+m+`</g>`}),c.section>=0&&(Z+=`</g>`),s+=d}),G){let e=J+K;Z=`<path class="pele-axis" d="M${l(J)},${l(i)}H${l(e-8+1)}" fill="none" stroke="var(--_l)"/>`+p(`arrow_point`,e,i,1,0,`var(--_l)`)+Z}Q=o+h}let $=Math.ceil(de+2*h),ve=Math.ceil(Math.max(Q,h*2)),ye=c(q,$/2,h+q.height/2,` class="pele-title" font-weight="var(--_tw)"`)+Z;return{svg:i(`timeline`,$,ve,a,n,e,ye),width:$,height:ve,links:[]}}var P={type:`timeline`,parse(e,t,n){let r=new v;return r.title=n,S(e,r),r},render:M};export{P as timeline};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as e,i as t,o as n,r,u as i,x as a}from"./
|
|
1
|
+
import{_ as e,i as t,o as n,r,u as i,x as a}from"./DlgOmQ_G.js";import{o,r as s}from"./DciMwFJ1.js";import{a as c,i as l,s as u}from"./BF3mdiSX.js";import{a as d,c as f,d as p,f as m,g as h,h as g,l as _,m as v,n as y,o as b,p as x,r as S,s as C,t as w,u as T}from"./jAC4YCqW.js";import{PeleError as E,u as ee}from"./BArcFmbE.js";function D(e){throw new E(e,`semantic`,{type:`architecture`})}var O=class{type=`architecture`;title;accTitle;accDescr;nodes=new Map;groups=new Map;edges=[];layoutHints=[];registered=new Map;register(e,t,n){this.registered.has(t)&&D(`The ${e} id [${t}] is already in use by another ${this.registered.get(t)}`),n!==void 0&&(t===n&&D(`The ${e} [${t}] cannot be placed within itself`),this.registered.has(n)||D(`The ${e} [${t}]'s parent does not exist. Please make sure the parent is created before this ${e}`),this.registered.get(n)===`node`&&D(`The ${e} [${t}]'s parent is not a group`)),this.registered.set(t,e===`group`?`group`:`node`)}addService({id:e,icon:t,iconText:n,title:r,in:i}){this.register(`service`,e,i),this.nodes.set(e,{id:e,type:`service`,icon:t,iconText:n,title:r,in:i})}addJunction({id:e,in:t}){this.register(`junction`,e,t),this.nodes.set(e,{id:e,type:`junction`,in:t})}addGroup({id:e,icon:t,title:n,in:r}){this.register(`group`,e,r),this.groups.set(e,{id:e,icon:t,title:n,in:r})}addEdge({lhsId:e,rhsId:t,lhsDir:n,rhsDir:r,lhsInto:i,rhsInto:a,lhsGroup:o,rhsGroup:s,title:c}){let l=[[`left`,e,o],[`right`,t,s]];for(let[e,t]of l)this.registered.has(t)||D(`The ${e}-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);for(let[e,t]of l)this.nodes.has(t)||D(`The ${e}-hand id [${t}] is a group. Add {group} to a service inside it instead.`);let u=this.nodes.get(e).in;if(u!==void 0&&u===this.nodes.get(t).in)for(let[e,t,n]of l)n&&D(`The ${e}-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);this.edges.push({lhsId:e,lhsDir:n,lhsInto:i,lhsGroup:o,rhsId:t,rhsDir:r,rhsInto:a,rhsGroup:s,title:c})}addLayoutHint(e){e.members.length<2&&D(`An align directive requires at least two members; got ${e.members.length}`);let t=new Set;for(let n of e.members)this.registered.get(n)!==`node`&&D(`align ${e.direction} references [${n}], which is not a service or junction`),t.has(n)&&D(`align ${e.direction} lists [${n}] more than once`),t.add(n);this.layoutHints.push(e)}};function k(e,t){e.accDescr&&(t.accDescr=e.accDescr.replace(/\n\s+/g,`
|
|
2
2
|
`)),e.accTitle&&(t.accTitle=e.accTitle.replace(/^\s+/g,``)),e.title&&(t.title=e.title);for(let n of e.groups)t.addGroup(n);for(let n of e.services)t.addService(n);for(let n of e.junctions)t.addJunction(n);for(let n of e.edges)t.addEdge(n);for(let n of e.alignments)t.addLayoutHint({direction:n.direction,members:[...n.members]})}var A={name:`ID`,pattern:/[\w]([-\w]*\w)?/y};function j(e){return{name:e,pattern:e,longer:[A]}}var M=[j(`architecture-beta`),j(`junction`),j(`service`),j(`column`),j(`group`),j(`align`),j(`row`),{name:`--`,pattern:`--`,longer:[S]},j(`in`),{name:`:`,pattern:`:`},{name:`-`,pattern:`-`,longer:[S]},{name:`ARROW_DIRECTION`,pattern:/L|R|T|B/y},{name:`ARROW_GROUP`,pattern:/\{group\}/y},{name:`ARROW_INTO`,pattern:/<|>/y},d,w,x,v,A,_,T,S,b,C,{name:`ARCH_ICON`,pattern:/\([\w-:]+\)/y},{name:`ARCH_TITLE`,pattern:/\[(?:"([^"\\]|\\.)*"|'([^'\\]|\\.)*'|[^\[\]\r\n]+)\]/y}];function N(e){let t=e.slice(1,-1).trim();return(t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`))&&(t=t.slice(1,-1).replace(/\\"/g,`"`).replace(/\\'/g,`'`)),t.trim()}function P(e){let t=new g(y(e,M,`architecture`),M,`architecture`),n={$type:`Architecture`,groups:[],services:[],junctions:[],edges:[],alignments:[]},r=e=>t.kinds[t.i]===e,i=()=>{if(t.kind!==-1)for(t.kind!==19&&t.fail(`a line break or the end of input`);t.kind===19;)t.i++};for(;t.kind===19;)t.i++;for(t.expect(0);t.kind!==-1;){switch(t.kind){case 19:t.i++;continue;case 14:n.accDescr=f(t.take());break;case 15:n.accTitle=h(t.take());break;case 16:n.title=p(t.take());break;case 4:{t.i++;let e={$type:`Group`,id:t.expect(18)};r(24)&&(e.icon=t.take().slice(1,-1)),r(25)&&(e.title=N(t.take())),t.accept(8)&&(e.in=t.expect(18)),n.groups.push(e);break}case 2:{t.i++;let e={$type:`Service`,id:t.expect(18)};r(17)?e.iconText=m(t.take()):r(24)&&(e.icon=t.take().slice(1,-1)),r(25)&&(e.title=N(t.take())),t.accept(8)&&(e.in=t.expect(18)),n.services.push(e);break}case 1:{t.i++;let e={$type:`Junction`,id:t.expect(18)};t.accept(8)&&(e.in=t.expect(18)),n.junctions.push(e);break}case 18:{let e=t.take(),i=t.accept(12);t.expect(9);let a=t.expect(11),o=t.accept(13),s;t.accept(7)||(r(10)||t.fail(`'--' or '-'`),t.i++,s=N(t.expect(25)),t.expect(10));let c=t.accept(13),l=t.expect(11);t.expect(9);let u=t.expect(18),d=t.accept(12);n.edges.push({$type:`Edge`,lhsId:e,lhsGroup:i,lhsDir:a,lhsInto:o,title:s,rhsInto:c,rhsDir:l,rhsId:u,rhsGroup:d});break}case 5:{t.i++,!r(6)&&!r(3)&&t.fail(`'row' or 'column'`);let e=t.take(),i=[t.expect(18),t.expect(18)];for(;r(18);)i.push(t.take());n.alignments.push({$type:`Alignment`,direction:e,members:i});break}default:t.fail(`a group, a service, a junction, an edge, an alignment, a title, or a line break`)}i()}return n}var F=new Map([[`database`,`M4 6a8 3 0 1 0 16 0a8 3 0 1 0-16 0M4 6v12a8 3 0 0 0 16 0V6M4 12a8 3 0 0 0 16 0`],[`server`,`M3 4h18v7H3zM3 13h18v7H3zM7 7.5h.01M7 16.5h.01M11 7.5h6M11 16.5h6`],[`disk`,`M5 3h14v18H5zM12 6.5a4 4 0 1 0 0 8a4 4 0 1 0 0-8M12 10.5h.01M8 18h3`],[`internet`,`M3 12a9 9 0 1 0 18 0a9 9 0 1 0-18 0M3 12h18M12 3a13 13 0 0 0 0 18M12 3a13 13 0 0 1 0 18`],[`cloud`,`M7 18a4 4 0 0 1-.5-7.97A6 6 0 0 1 18 9.5a4.25 4.25 0 0 1-.5 8.5z`]]);function I(e){let t=F.get(e);return t===void 0?``:`<path d="${t}" stroke="var(--_fg)" stroke-width="1.5"/>`}var L=[-1,1,0,0],R=[0,0,-1,1];function te(e){return e===`L`?0:e===`R`?1:e===`T`?2:3}var z=64,B=2**25,V=2**26;function ne(e,t,n,r){let i=e.length,a=t.length,o=a,s=new Map,c=new Map,l=new Int32Array(i+a).fill(o),u=new Int32Array(a+1),d=[];for(let e=0;e<=a;e++)d.push([]);t.forEach((e,t)=>{c.set(e.id,t);let n=e.in===void 0?void 0:c.get(e.in);n!==void 0&&n!==t?(l[i+t]=n,u[t]=u[n]+1):u[t]=1}),e.forEach((e,t)=>{s.set(e.id,t);let n=e.in===void 0?void 0:c.get(e.in);n!==void 0&&(l[t]=n),d[l[t]].push(t)});for(let e=0;e<a;e++)d[l[i+e]].push(i+e);let f=[],p=[],m=[],h=[],g=[],_=[],v=Array(i+a),y=Array(i+a),b=(e,t,n,r,a)=>{if(e===t)return;let o=e,s=t,c=l[e],d=l[t];for(;c!==d;)u[c]>=u[d]?(o=i+c,c=l[o]):(s=i+d,d=l[s]);let v=f.length;f.push(e),p.push(t),m.push(n),h.push(r),g.push(o),_.push(s),(a[o]??=[]).push(v),(a[s]??=[]).push(v)};for(let e of r){let t=e.direction===`row`;for(let n=1;n<e.members.length;n++){let r=s.get(e.members[n-1]),i=s.get(e.members[n]);r!==void 0&&i!==void 0&&b(r,i,t?1:3,t?0:2,v)}}for(let e of[!1,!0])for(let t of n){if(t.lhsDir===t.rhsDir!==e)continue;let n=s.get(t.lhsId),r=s.get(t.rhsId);n!==void 0&&r!==void 0&&b(n,r,te(t.lhsDir),te(t.rhsDir),y)}let x=new Int32Array(i+a),S=new Int32Array(i+a),C=new Int32Array(i+a).fill(1),w=new Int32Array(i+a).fill(1),T=new Uint8Array(i+a),E=[],ee=new Map,D=[],O=new Map,k=0,A=0,j=0,M=(e,t)=>{A=0,j=0;for(let n=e;n!==t;n=i+l[n])A+=x[n],j+=S[n]},N=(e,t,n)=>{if(x[e]=t,S[e]=n,T[e]=1,E.push(e),C[e]*w[e]>z)D.push(e);else for(let r=n;r<n+w[e];r++)for(let n=t;n<t+C[e];n++)ee.set((n+B)*V+r+B,e)},P=(e,t,n,r,i)=>x[e]<t+r&&t<x[e]+C[e]&&S[e]<n+i&&n<S[e]+w[e],F=(e,t,n,r)=>{if(n*r>z){for(let i=k;i<E.length;i++)if(P(E[i],e,t,n,r))return E[i];return-1}for(let i=t;i<t+r;i++)for(let t=e;t<e+n;t++){let e=ee.get((t+B)*V+i+B);if(e!==void 0)return e}for(let i of D)if(P(i,e,t,n,r))return i;return-1},I=(e,t,n,r,i,a)=>{let o=`${e},${t},${n},${r},${i},${a}`,s=O.get(o)??0;for(;;){let o=F(e+s*i,t+s*a,n,r);if(o<0)break;s=i>0?x[o]+C[o]-e:i<0?e+n-x[o]:a>0?S[o]+w[o]-t:t+r-S[o]}return O.set(o,s),s},ne=(e,t)=>{let n=g[t]===e,r=n?_[t]:g[t];if(T[r])return;let i=n?m[t]:h[t],a=n?h[t]:m[t];M(n?f[t]:p[t],e);let o=A,s=j;M(n?p[t]:f[t],r);let c=L[i],l=R[i],u=0,d=0,v=L[i]+L[a]===0&&R[i]+R[a]===0;i===a?(c=+(L[i]===0),l=1-c):v||(u=-L[a],d=-R[a]);let b,E;if(c===0?(E=l>0?S[e]+w[e]:S[e]-w[r],b=x[e]+o+u-A):(b=c>0?x[e]+C[e]:x[e]-C[r],E=S[e]+s+d-j),v){let e=y[r];if(e!==void 0&&e.length>1){let t=[];for(let n of e){let e=_[n]===r,o=e?g[n]:_[n];if(!T[o]||(e?m[n]:h[n])!==i||(e?h[n]:m[n])!==a)continue;M(e?f[n]:p[n],o);let s=c===0?x[o]+A:S[o]+j;M(e?p[n]:f[n],r),t.push(s-(c===0?A:j))}t.length>1&&(t.sort((e,t)=>e-t),c===0?b=t[t.length-1>>1]:E=t[t.length-1>>1])}let t=+(c===0),n=1-t,o=I(b,E,C[r],w[r],t,n),s=o===0?0:I(b,E,C[r],w[r],-t,-n),l=o<=s?o:-s;b+=t*l,E+=n*l}else{let e=I(b,E,C[r],w[r],c,l);b+=c*e,E+=l*e}N(r,b,E)},H=e=>{let t=d[e];if(t.length===0)return;E.length=0;let n=[];for(let e of t){if(T[e])continue;k=E.length,n.push(k),ee.clear(),D.length=0,O.clear(),N(e,0,0);let t=k,r=k,i=0;for(;;){if(t<E.length){let e=E[t++],n=v[e];if(n!==void 0)for(let t of n)ne(e,t);continue}if(r>=E.length)break;let e=y[E[r]];e===void 0||i>=e.length?(r++,i=0):ne(E[r],e[i++])}}n.push(E.length);let r=n.length-1,o=Array(r),s=Array(r),c=Array(r),l=Array(r),u=0,f=0;for(let e=0;e<r;e++){let t=1/0,r=1/0,i=-1/0,a=-1/0;for(let o=n[e];o<n[e+1];o++){let e=E[o];t=Math.min(t,x[e]),r=Math.min(r,S[e]),i=Math.max(i,x[e]+C[e]),a=Math.max(a,S[e]+w[e])}o[e]=t,s[e]=r,c[e]=i-t,l[e]=a-r,u+=c[e]*l[e],f=Math.max(f,c[e])}let p=Math.max(f,Math.ceil(Math.sqrt(u*2))),m=0,h=0,g=0,_=0;for(let e=0;e<r;e++){m>0&&m+c[e]>p&&(h+=g,m=0,g=0);for(let t=n[e];t<n[e+1];t++)x[E[t]]+=m-o[e],S[E[t]]+=h-s[e];m+=c[e],g=Math.max(g,l[e]),_=Math.max(_,m)}e<a&&(C[i+e]=_,w[i+e]=h+g)};for(let e=a-1;e>=0;e--)H(e);H(o);let U=new Int32Array(a),W=new Int32Array(a),re=new Int32Array(a),ie=new Uint8Array(a);for(let e=0;e<a;e++){let t=l[i+e];re[e]=t===o?-1:t,U[e]=x[i+e]+(t===o?0:U[t]),W[e]=S[i+e]+(t===o?0:W[t]),d[e].length===0&&(ie[e]=1)}let ae=new Int32Array(i),oe=new Int32Array(i),se=new Int32Array(i);for(let e=0;e<i;e++){let t=l[e];se[e]=t===o?-1:t,ae[e]=x[e]+(t===o?0:U[t]),oe[e]=S[e]+(t===o?0:W[t])}return{col:ae,row:oe,groupCol:U,groupRow:W,groupCols:C.slice(i),groupRows:w.slice(i),groupParent:re,groupEmpty:ie,nodeParent:se}}var H=12,U=6,W=4,re=3,ie=[-1,1,0,0],ae=[0,0,-1,1];function oe(e,t,n,r,i){let a=e.architecture,o=typeof a==`object`&&a&&!Array.isArray(a)?a[t]:void 0;return typeof o==`number`&&Number.isFinite(o)?Math.min(i,Math.max(r,o)):n}function se(e){let t=new Map;for(let n of e.sort((e,t)=>e-t))t.has(n)||t.set(n,t.size);return t}function ce(e,n,r,i,o){return`<svg class="pele-icon" data-icon="${t(e)}" x="${a(n)}" y="${a(r)}" width="${a(i)}" height="${a(i)}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${o?.(e)??I(e)}</svg>`}function le(e,t,n,r){let i=e.lines.length>n;if(!i&&e.width<=t)return e;let a=r.width(`…`,e.size,0),o=[],s=[],c=0;for(let l=0;l<Math.min(n,e.lines.length);l++){let u=e.lines[l].map(e=>({...e})),d=e.widths[l];if(d>t||i&&l===n-1)for(;;){let n=u[u.length-1];if(n===void 0){u.push({text:`…`,style:0,width:a}),d=a;break}let i=d-n.width;if(n.icon===void 0&&i+a<t){let o=0,s=n.text.length;for(;o<s;){let c=o+s+1>>1;i+r.width(n.text.slice(0,c),e.size,n.style)+a<=t?o=c:s=c-1}let c=o>0?n.text.charCodeAt(o-1):0;c>=55296&&c<=56319&&o--,n.text=n.text.slice(0,o).trimEnd()+`…`,n.width=r.width(n.text,e.size,n.style),d=i+n.width;break}u.pop(),d=i}o.push(u),s.push(d),c=Math.max(c,d)}return{...e,lines:o,widths:s,width:c,height:o.length*e.lineHeight}}function ue(e,t){let{x:n,y:r,dx:i,dy:a}=e,{x:o,y:s,dx:c,dy:l}=t,u=n+i*H,d=r+a*H,f=o+c*H,p=s+l*H;if(i*c+a*l===0){let e=i===0?n:o,t=i===0?s:r;return(e-n)*i+(t-r)*a>0&&(e-o)*c+(t-s)*l>0?[n,r,e,t,o,s]:i===0?[n,r,u,d,f,d,f,p,o,s]:[n,r,u,d,u,p,f,p,o,s]}let m=i!==0,h=m?s-r:o-n;if(i===-c&&a===-l){if((o-n)*i+(s-r)*a>0){if(Math.abs(h)<.5)return[n,r,o,s];if(m){let a=i>0?e.x1:t.x1,c=i>0?t.x0:e.x0,l=a<c?(a+c)/2:(n+o)/2;return[n,r,l,r,l,s,o,s]}let c=a>0?e.y1:t.y1,l=a>0?t.y0:e.y0,u=c<l?(c+l)/2:(r+s)/2;return[n,r,n,u,o,u,o,s]}}else if(Math.abs(h)>=1){if(m){let e=i>0?Math.max(n,o)+H:Math.min(n,o)-H;return[n,r,e,r,e,s,o,s]}let e=a>0?Math.max(r,s)+H:Math.min(r,s)-H;return[n,r,n,e,o,e,o,s]}if(m){let i=e.y1+H<=t.y0?(e.y1+t.y0)/2:t.y1+H<=e.y0?(t.y1+e.y0)/2:Math.max(e.y1,t.y1)+H;return[n,r,u,r,u,i,f,i,f,s,o,s]}let g=e.x1+H<=t.x0?(e.x1+t.x0)/2:t.x1+H<=e.x0?(t.x1+e.x0)/2:Math.max(e.x1,t.x1)+H;return[n,r,n,d,g,d,g,p,o,p,o,s]}function de(e){let t=[e[0],e[1]];for(let n=2;n<e.length;n+=2){let r=e[n],i=e[n+1],a=t.length,o=Math.abs(r-t[a-2])<.01,s=Math.abs(i-t[a-1])<.01;o&&s||(a>=4&&(o&&Math.abs(t[a-4]-t[a-2])<.01||s&&Math.abs(t[a-3]-t[a-1])<.01)?(t[a-2]=r,t[a-1]=i):t.push(r,i))}return t}function fe(e,t,n){let r=e.length/2,i=Array(r),o=Array(r);for(let t=0;t<r;t++)i[t]=e[t*2],o[t]=e[t*2+1];let s=(e,t,n)=>{let r=Math.hypot(i[t]-i[e],o[t]-o[e]),a=Math.min(n,Math.max(0,r-1));r>0&&a>0&&(i[e]+=(i[t]-i[e])/r*a,o[e]+=(o[t]-o[e])/r*a)};s(0,1,t),s(r-1,r-2,n);let c=`M${a(i[0])},${a(o[0])}`;for(let e=1;e<r-1;e++){let t=Math.hypot(i[e]-i[e-1],o[e]-o[e-1]),n=Math.hypot(i[e+1]-i[e],o[e+1]-o[e]),r=Math.min(U,t/2,n/2);if(r<.5){c+=`L${a(i[e])},${a(o[e])}`;continue}let s=i[e]-(i[e]-i[e-1])/t*r,l=o[e]-(o[e]-o[e-1])/t*r,u=i[e]+(i[e+1]-i[e])/n*r,d=o[e]+(o[e+1]-o[e])/n*r;c+=`L${a(s)},${a(l)}Q${a(i[e])},${a(o[e])} ${a(u)},${a(d)}`}return c+`L${a(i[r-1])},${a(o[r-1])}`}function G(e,t,n){return o(n,r=>K(e,t,n,r))}function K(o,d,f,p){let m=oe(d,`iconSize`,48,8,512),h=oe(d,`fontSize`,f.fontSize??16,4,128),g=Math.min(oe(d,`padding`,20,0,256),p?12:1/0),_=Math.round(h*.875),v=f.measurer??ee(f.fontFamily,f.fontFamilyMono),y=f.padding??8,b=f.icons,x=m/2,S=[...o.nodes.values()],C=[...o.groups.values()],w=S.length,T=C.length,E=ne(S,C,o.edges,o.layoutHints),D=new Map;S.forEach((e,t)=>D.set(e.id,t));let O=Array(w),k=new Float64Array(w),A=new Float64Array(w),j=p?Math.max(m,64):Math.max(m*2.25,96);for(let e=0;e<w;e++){let t=S[e],n=i(t.type===`service`?t.title:void 0,!0,v,h,j);O[e]=n,k[e]=Math.max(m,2*Math.ceil(n.width/2)),A[e]=m+(n.height>0?W+n.height:0)}let M=[],N=[];for(let e=0;e<w;e++)M.push(E.col[e]),N.push(E.row[e]);for(let e=0;e<T;e++)E.groupEmpty[e]&&(M.push(E.groupCol[e]),N.push(E.groupRow[e]));let P=se(M),F=se(N),I=P.size,L=F.size,R=new Float64Array(I),z=new Float64Array(L),B=p?Math.max(24,2*H):Math.max(40,Math.round(m*.75)),V=new Float64Array(I).fill(B),U=new Float64Array(L).fill(B),G=new Int32Array(w),K=new Int32Array(w);for(let e=0;e<w;e++){let t=G[e]=P.get(E.col[e]),n=K[e]=F.get(E.row[e]);R[t]=Math.max(R[t],k[e]),z[n]=Math.max(z[n],A[e])}for(let e=0;e<T;e++){if(!E.groupEmpty[e])continue;let t=P.get(E.groupCol[e]),n=F.get(E.groupRow[e]);R[t]=Math.max(R[t],m),z[n]=Math.max(z[n],x)}let pe=o.edges.length,me=Array(pe),he=new Int32Array(pe*2);for(let e=0;e<pe;e++){let t=o.edges[e],n=he[e*2]=D.get(t.lhsId)??-1,r=he[e*2+1]=D.get(t.rhsId)??-1,a=i(t.title,!0,v,_,160);if(me[e]=a,!(a.width===0||n<0||r<0)){if(G[n]!==G[r]){let e=Math.min(G[n],G[r]);V[e]=Math.max(V[e],Math.ceil(a.width)+28)}else if(R[G[n]]=Math.max(R[G[n]],2*Math.ceil(a.width/2)+8),K[n]!==K[r]){let e=Math.min(K[n],K[r]);U[e]=Math.max(U[e],Math.ceil(a.height)+24)}}}let ge=Array(T),q=new Int32Array(T),J=new Int32Array(T),_e=new Int32Array(T),Y=new Int32Array(T),ve=new Float64Array(T),ye=new Float64Array(T),be=new Float64Array(T),xe=new Float64Array(T),X=new Float64Array(T),Se=new Float64Array(T),Ce=new Float64Array(I),we=new Float64Array(I),Te=new Float64Array(L),Ee=new Float64Array(L),De=Math.round(h*1.25);for(let e=0;e<T;e++){q[e]=P.get(E.groupCol[e]),J[e]=P.get(E.groupCol[e]+E.groupCols[e]-1),_e[e]=F.get(E.groupRow[e]),Y[e]=F.get(E.groupRow[e]+E.groupRows[e]-1);let t=i(C[e].title,!0,v,h,p?Math.max(80,s(f)/2):320);ge[e]=t;let n=C[e].icon?De:0;X[e]=t.width+n+(t.width>0&&n>0?6:0),Se[e]=Math.max(t.height,n)}for(let e=T-1;e>=0;e--){let t=g+ve[e],n=g+ye[e],r=(Se[e]>0?Math.max(g,Se[e]+12):g)+be[e],i=g+xe[e];if(X[e]>0){let r=t+n;for(let t=q[e];t<=J[e];t++)r+=R[t]+(t<J[e]?we[t]+V[t]+Ce[t+1]:0);X[e]+20>r&&(n+=Math.ceil(X[e]+20-r))}ve[e]=t,ye[e]=n,be[e]=r,xe[e]=i,Ce[q[e]]=Math.max(Ce[q[e]],t),we[J[e]]=Math.max(we[J[e]],n),Te[_e[e]]=Math.max(Te[_e[e]],r),Ee[Y[e]]=Math.max(Ee[Y[e]],i);let a=E.groupParent[e];a<0||(q[a]===q[e]&&(ve[a]=Math.max(ve[a],t)),J[a]===J[e]&&(ye[a]=Math.max(ye[a],n)),_e[a]===_e[e]&&(be[a]=Math.max(be[a],r)),Y[a]===Y[e]&&(xe[a]=Math.max(xe[a],i)))}let Oe=new Float64Array(I),Z=new Float64Array(L),ke=0;for(let e=0;e<I;e++)Oe[e]=ke+Ce[e],ke=Oe[e]+R[e]+we[e]+(e<I-1?V[e]:0);let Ae=0;for(let e=0;e<L;e++)Z[e]=Ae+Te[e],Ae=Z[e]+z[e]+Ee[e]+(e<L-1?U[e]:0);let Q=0,je=0,Me=ke,Ne=Ae,Pe=e=>Oe[q[e]]-ve[e],Fe=e=>Oe[J[e]]+R[J[e]]+ye[e],Ie=e=>Z[_e[e]]-be[e],Le=e=>Z[Y[e]]+z[Y[e]]+xe[e],Re=e=>Oe[G[e]]+R[G[e]]/2,ze=(e,t,n)=>{let r=ie[t],i=ae[t],a=Re(e),o=Z[K[e]],s={x:a,y:o+x,dx:r,dy:i,x0:a-k[e]/2,y0:o,x1:a+k[e]/2,y1:o+A[e],gap:0,wire:!1};S[e].type===`junction`?(s.x0=s.x1=a,s.y0=s.y1=s.y,s.gap=re):r===0?s.y=i<0?o:o+A[e]+(O[e].height>0?2:0):s.x=a+r*x;let c=n?E.nodeParent[e]:-1;return c>=0&&(s.x0=Pe(c),s.x1=Fe(c),s.y0=Ie(c),s.y1=Le(c),s.gap=0,s.wire=S[e].type===`junction`,r===0?s.y=i<0?s.y0:s.y1:s.x=r<0?s.x0:s.x1),s},Be=``,Ve=``,$=[],He=c(`arrow_point`);for(let e=0;e<pe;e++){let n=o.edges[e],r=he[e*2],i=he[e*2+1];if(r<0||i<0)continue;let a=ze(r,te(n.lhsDir),n.lhsGroup),s=ze(i,te(n.rhsDir),n.rhsGroup);a.x===s.x&&a.y===s.y&&a.dx===s.dx&&(a.x-=8*Math.abs(a.dy),a.y-=8*Math.abs(a.dx),s.x+=8*Math.abs(a.dy),s.y+=8*Math.abs(a.dx));let c=ue(a,s);a.wire&&c.unshift(Re(r),Z[K[r]]+x),s.wire&&c.push(Re(i),Z[K[i]]+x);let d=de(c);if(d.length<4)continue;let f=t(`${n.lhsId}-${n.rhsId}`);Be+=`<g class="pele-edge" data-id="${f}"><path d="${fe(d,n.lhsInto&&!a.wire?He+a.gap:0,n.rhsInto&&!s.wire?He+s.gap:0)}"/>`+(n.lhsInto?u(`arrow_point`,a.x+a.dx*a.gap,a.y+a.dy*a.gap,-a.dx,-a.dy,`var(--_l)`):``)+(n.rhsInto?u(`arrow_point`,s.x+s.dx*s.gap,s.y+s.dy*s.gap,-s.dx,-s.dy,`var(--_l)`):``)+`</g>`;let p=-1,m=-1,h=-1,g=-1,_=me[e];for(let e=0;e<d.length;e+=2)Q=Math.min(Q,d[e]-4),Me=Math.max(Me,d[e]+4),je=Math.min(je,d[e+1]-4),Ne=Math.max(Ne,d[e+1]+4);for(let e=0;e+3<d.length;e+=2){let t=Math.abs(d[e+1]-d[e+3])<.01,n=Math.abs(d[e]-d[e+2])+Math.abs(d[e+1]-d[e+3]);t||$.push(d[e],Math.min(d[e+1],d[e+3]),Math.max(d[e+1],d[e+3])),n>m&&(p=e,m=n),t&&n>g&&(h=e,g=n)}if(_.width>0){let e=g>=_.width+8?h:p,t=(d[e]+d[e+2])/2,r=(d[e+1]+d[e+3])/2,i=_.width+8,o=Math.abs(d[e]-d[e+2])<.01;for(let e of[a,s])t+i/2<=e.x0||t-i/2>=e.x1||r+_.height/2<=e.y0||r-_.height/2>=e.y1||(o?t=t>=(e.x0+e.x1)/2?e.x1+i/2+4:e.x0-i/2-4:r=r>=(e.y0+e.y1)/2?e.y1+_.height/2+4:e.y0-_.height/2-4);Q=Math.min(Q,t-i/2),Me=Math.max(Me,t+i/2),je=Math.min(je,r-_.height/2),Ne=Math.max(Ne,r+_.height/2),Ve+=l(`${n.lhsId}-${n.rhsId}`,_,t,r,``,b)}}let Ue=``;for(let e=0;e<T;e++){let i=C[e],o=Pe(e),s=Ie(e),c=Fe(e)-o,l=ge[e],u=``;if(X[e]>0){let t=s+Se[e]+12,r=[];for(let e=0;e<$.length;e+=3)$[e+1]<t&&$[e+2]>s&&$[e]>o&&$[e]<o+c&&r.push($[e]);r.sort((e,t)=>e-t),r.push(o+c-4);let a=o+10;for(let t of r){if(t-6-a>=X[e])break;a=Math.max(a,t+6)}a+X[e]>o+c-4&&(a=o+10);let d=s+6+Se[e]/2,f=a;i.icon&&(u+=ce(i.icon,a,d-De/2,De,b),f+=De+6),u+=n(l,f+l.width/2,d,` class="pele-cluster-label" fill="var(--_m)"`,b)}Ue+=`<g class="pele-cluster" data-id="${t(i.id)}"><rect x="${a(o)}" y="${a(s)}" width="${a(c)}" height="${a(Le(e)-s)}" fill="var(--_a)" fill-opacity="0.5" stroke="var(--_b)"${r}/>`+u+`</g>`}let We=``,Ge=m*.5,Ke=Math.max(6,Math.round(h*.75));for(let e=0;e<w;e++){let o=S[e],s=`data-id="${t(o.id)}" transform="translate(${a(Re(e))},${a(Z[K[e]])})"`;if(o.type===`junction`){We+=`<g class="pele-node pele-junction" ${s}><circle cy="${a(x)}" r="${re}" fill="var(--_l)"/></g>`;continue}let c=``;if(o.icon)c=ce(o.icon,-Ge/2,(m-Ge)/2,Ge,b);else if(o.iconText){let e=i(o.iconText,!1,v,Ke,m-8),t=Math.max(1,Math.floor((m-4)/(e.lineHeight||1)));c=n(le(e,m-8,t,v),0,x,` class="pele-icon-text" font-size="${Ke}"`,b)}We+=`<g class="pele-node pele-service" ${s}><rect x="${a(-x)}" width="${a(m)}" height="${a(m)}" fill="var(--_s)" stroke="var(--_b)"${r}/>`+c+n(O[e],0,m+W+O[e].height/2,` class="pele-label"`,b)+`</g>`}let qe=i(o.title,!1,v,h,p?s(f):4e3,1),Je=qe.height>0?qe.height+12:0,Ye=Math.ceil(Math.max(Me-Q,qe.width)+2*y),Xe=Math.ceil(Ne-je+Je+2*y),Ze=Math.round((Ye-(Me-Q))/2-Q),Qe=Math.round(y+Je-je),$e=(Ue?`<g class="pele-clusters">${Ue}</g>`:``)+(Be?`<g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round" stroke-linejoin="round">${Be}</g>`:``)+(Ve?`<g class="pele-edge-labels" font-size="${_}">${Ve}</g>`:``)+(We?`<g class="pele-nodes">${We}</g>`:``);return{svg:e(`architecture`,Ye,Xe,h,f,o,n(qe,Ye/2,y+qe.height/2,` class="pele-title" font-weight="var(--_tw)"`)+($e?`<g transform="translate(${Ze},${Qe})">${$e}</g>`:``)),width:Ye,height:Xe,links:[]}}var pe={type:`architecture`,parse(e,t,n){let r=new O;return n&&(r.title=n),k(P(e),r),r},render:G};export{pe as architecture};
|