isorite 0.8.1 → 0.10.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/core.js +84 -10
- package/dist/main.js +692 -99
- package/docs/setup-for-agents.md +8 -5
- package/docs/setup.md +31 -4
- package/docs/terminal.md +9 -3
- package/notes/algorithms/the-quadtree/subdivision.svg +15 -0
- package/notes/algorithms/the-quadtree.md +2 -0
- package/package.json +1 -1
- package/plugin/server.ts +1 -1
- package/plugin/tui.tsx +6 -0
- package/web/_app/immutable/assets/{0.CTbO0owi.css → 0.CPW9fjPu.css} +1 -1
- package/web/_app/immutable/assets/NoteEditor.Wt5vU9Tb.css +1 -0
- package/web/_app/immutable/chunks/{8wVGBFSs.js → -2Meesge.js} +3 -3
- package/web/_app/immutable/chunks/{C_ER1Any.js → 6RXH8WsD.js} +1 -1
- package/web/_app/immutable/chunks/{BL3mLym4.js → 9z49435t.js} +1 -1
- package/web/_app/immutable/chunks/B0A4Snxv.js +6 -0
- package/web/_app/immutable/chunks/B8Qvvm53.js +1 -0
- package/web/_app/immutable/chunks/{DMAYXnpq.js → BA8Hpxhg.js} +1 -1
- package/web/_app/immutable/chunks/{CKSRTWxH.js → BAclEN0O.js} +1 -1
- package/web/_app/immutable/chunks/BJo70SOc.js +1 -0
- package/web/_app/immutable/chunks/{DECNRCf2.js → BLmF1B2i.js} +1 -1
- package/web/_app/immutable/chunks/{CiVjR8gq.js → BTclWEfx.js} +1 -1
- package/web/_app/immutable/chunks/{Cp_JbuGh.js → BWVMfAMh.js} +1 -1
- package/web/_app/immutable/chunks/{D4fLEcOQ.js → BXAOBcPb.js} +1 -1
- package/web/_app/immutable/chunks/BYSDTLqw.js +1 -0
- package/web/_app/immutable/chunks/{Cgml88Pl.js → BcgO-fBX.js} +1 -1
- package/web/_app/immutable/chunks/BimZp6R0.js +523 -0
- package/web/_app/immutable/chunks/{CO2Y5y64.js → Bq2GBAJ0.js} +1 -1
- package/web/_app/immutable/chunks/BqrMZ9MX.js +1 -0
- package/web/_app/immutable/chunks/{BN6xhG8e.js → Bt7VOT5H.js} +1 -1
- package/web/_app/immutable/chunks/{BGbXxNFa.js → BuUzVkG2.js} +1 -1
- package/web/_app/immutable/chunks/{Brxvm_b1.js → By4S_gy5.js} +1 -1
- package/web/_app/immutable/chunks/{CRIvE37b.js → BymwHy7o.js} +1 -1
- package/web/_app/immutable/chunks/{B4sg4e8i.js → C5MPRibb.js} +1 -1
- package/web/_app/immutable/chunks/CBkjDkEN.js +151 -0
- package/web/_app/immutable/chunks/{BrqJKzQU.js → CD6xPodA.js} +1 -1
- package/web/_app/immutable/chunks/{CEufJyoj.js → CQd9D8Nc.js} +1 -1
- package/web/_app/immutable/chunks/{BrGmYbJT.js → CT_Ry4q8.js} +1 -1
- package/web/_app/immutable/chunks/{CQadubS9.js → C_amgxV1.js} +1 -1
- package/web/_app/immutable/chunks/CiU6tYJv.js +1 -0
- package/web/_app/immutable/chunks/{spNKdrPy.js → CjtKPNlv.js} +1 -1
- package/web/_app/immutable/chunks/{DxLkKbK2.js → Cl5zRP_n.js} +1 -1
- package/web/_app/immutable/chunks/{yXUzBjUq.js → CsRPJjQS.js} +1 -1
- package/web/_app/immutable/chunks/{CETSRtnV.js → CyFLqlvP.js} +1 -1
- package/web/_app/immutable/chunks/{Bq5hCPe1.js → Czz9qOh8.js} +1 -1
- package/web/_app/immutable/chunks/{BguXRgvc.js → D3-rqfsM.js} +1 -1
- package/web/_app/immutable/chunks/{bcQIrid8.js → D5XlJBy8.js} +1 -1
- package/web/_app/immutable/chunks/{TuFg0KqZ.js → D5vocsTl.js} +1 -1
- package/web/_app/immutable/chunks/{CTscJvp6.js → D95RKsvN.js} +1 -1
- package/web/_app/immutable/chunks/{BzI3yqBQ.js → DBC2xjOo.js} +1 -1
- package/web/_app/immutable/chunks/{C1hqerMA.js → DCD8_jrW.js} +1 -1
- package/web/_app/immutable/chunks/{BsLNwr5A.js → DF89zyH-.js} +1 -1
- package/web/_app/immutable/chunks/{DsIcKd8x.js → DQjIi5Jv.js} +1 -1
- package/web/_app/immutable/chunks/{C-dfcq9W.js → DRX-TQzj.js} +1 -1
- package/web/_app/immutable/chunks/{BunrC_8P.js → DX4bJJO0.js} +1 -1
- package/web/_app/immutable/chunks/{EQVRMnZU.js → DXK7PB4g.js} +1 -1
- package/web/_app/immutable/chunks/{mbLqADPr.js → DXTK-eyo.js} +1 -1
- package/web/_app/immutable/chunks/{wCTXGvXm.js → DbNETcPs.js} +1 -1
- package/web/_app/immutable/chunks/{CX-xckzu.js → DfCZPwp1.js} +1 -1
- package/web/_app/immutable/chunks/{DKNOMI4Y.js → Dh1lBxfx.js} +1 -1
- package/web/_app/immutable/chunks/{BgczuZKA.js → DkxkvOjx.js} +1 -1
- package/web/_app/immutable/chunks/DlKQFacy.js +1 -0
- package/web/_app/immutable/chunks/{0M1khDs2.js → DlXrOzlh.js} +1 -1
- package/web/_app/immutable/chunks/{B85D_PlV.js → Dpa4Syyy.js} +1 -1
- package/web/_app/immutable/chunks/DshHzxgH.js +1 -0
- package/web/_app/immutable/chunks/{CdY1YAit.js → EMo1IeTW.js} +1 -1
- package/web/_app/immutable/chunks/Iqr2CudW.js +3 -0
- package/web/_app/immutable/chunks/{CoyQYage.js → RFxekmX-.js} +1 -1
- package/web/_app/immutable/chunks/{vk5Wkr31.js → RlApGeew.js} +1 -1
- package/web/_app/immutable/chunks/{CLVUDRRk.js → Xm0YTnxV.js} +1 -1
- package/web/_app/immutable/chunks/c7PFFMl4.js +1 -0
- package/web/_app/immutable/chunks/{CZ8wTb_M.js → gPtCGHiy.js} +1 -1
- package/web/_app/immutable/chunks/{D4SKbj9K.js → oWM_kgYq.js} +1 -1
- package/web/_app/immutable/chunks/{wj7G6pU5.js → rghE0CVz.js} +1 -1
- package/web/_app/immutable/chunks/{B9YLdnR_.js → tUSDgbpy.js} +1 -1
- package/web/_app/immutable/chunks/{DTdlqvEb.js → vfDvz3qP.js} +1 -1
- package/web/_app/immutable/chunks/{BRKS-CCX.js → whhiiiga.js} +1 -1
- package/web/_app/immutable/entry/app.iw6ZIOh2.js +2 -0
- package/web/_app/immutable/entry/start.CFnKMSWs.js +1 -0
- package/web/_app/immutable/nodes/0.BzEgwgsa.js +26 -0
- package/web/_app/immutable/nodes/1.rzuq9VRh.js +1 -0
- package/web/_app/immutable/nodes/2.D_jWsQLW.js +1 -0
- package/web/_app/immutable/nodes/3.BzRx3SiD.js +1 -0
- package/web/_app/immutable/nodes/4.DP2MGav1.js +2 -0
- package/web/_app/immutable/nodes/5.BPS-CCQT.js +5 -0
- package/web/_app/immutable/nodes/6.DQMCyNJ3.js +1 -0
- package/web/_app/immutable/nodes/7.MWEn-qPC.js +1 -0
- package/web/_app/version.json +1 -1
- package/web/index.html +17 -17
- package/web/_app/immutable/assets/NoteEditor.8wWtZK_A.css +0 -1
- package/web/_app/immutable/chunks/B2TCcw-P.js +0 -6
- package/web/_app/immutable/chunks/BAkGB2fM.js +0 -1
- package/web/_app/immutable/chunks/CHbKgHy3.js +0 -1
- package/web/_app/immutable/chunks/CMTjeXEe.js +0 -1
- package/web/_app/immutable/chunks/CurmVJyp.js +0 -1
- package/web/_app/immutable/chunks/D29fKEzc.js +0 -1
- package/web/_app/immutable/chunks/D3BEa5-_.js +0 -673
- package/web/_app/immutable/chunks/DPnfDiTn.js +0 -1
- package/web/_app/immutable/chunks/DZYaqCwi.js +0 -1
- package/web/_app/immutable/chunks/D_19S_Iu.js +0 -1
- package/web/_app/immutable/chunks/DtPULAe0.js +0 -1
- package/web/_app/immutable/chunks/nMarIA7J.js +0 -3
- package/web/_app/immutable/entry/app.idRgnoYp.js +0 -2
- package/web/_app/immutable/entry/start.CEx_UQO6.js +0 -1
- package/web/_app/immutable/nodes/0.BUd_gY_8.js +0 -26
- package/web/_app/immutable/nodes/1.DHK7VmG0.js +0 -1
- package/web/_app/immutable/nodes/2.CDAt-6SJ.js +0 -1
- package/web/_app/immutable/nodes/3.4Wv5nmaw.js +0 -1
- package/web/_app/immutable/nodes/4.Ceb5g4Ps.js +0 -2
- package/web/_app/immutable/nodes/5.DioYOANs.js +0 -5
- package/web/_app/immutable/nodes/6.CzYfNb6g.js +0 -1
- package/web/_app/immutable/nodes/7.BxQaF3lD.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as e,a as t,b as n,i as r,o as i,r as a,u as o,x as s}from"./
|
|
1
|
+
import{_ as e,a as t,b as n,i as r,o as i,r as a,u as o,x as s}from"./DfCZPwp1.js";import{o as c,r as l}from"./DciMwFJ1.js";import{c as u,d,g as f,h as p,i as m,n as h,p as g,t as _}from"./DX4bJJO0.js";import{n as v,t as y}from"./CD6xPodA.js";import{t as b}from"./CQd9D8Nc.js";import{PeleError as x,d as S,o as C,u as ee,v as w}from"./-2Meesge.js";var T=/[─━│┃└┗├┣]/,E=/[└┗├┣]/,D=/[─━]/,O=/^[\s│┃]+$/,k=/^[\s─━│┃└┗├┣]+$/,A=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,j=/^\s*%%/,M=` `;function N(e){return e.some(e=>T.test(e))}function P(e){for(let t of e){let e=E.exec(t);if(e?.index&&e.index>0)return e.index}return 4}function F(e,t){return e.replace(/\bline\s+(\d+)\b/gi,(e,n)=>{let r=t.get(parseInt(n,10));return r?`line ${r}`:e})}function I(e,t){let n=0;for(let r=1;r<t;r++)n=e.indexOf(`
|
|
2
2
|
`,n)+1;return n}function L(e,t,n){let{line:r}=C(e,I(e,t+1));throw new x(`Line ${r}: ${n}`,`syntax`,{type:`treeView`,line:r})}function R(e,t){let n=0;for(let r=0;n<e.length&&r<t;n++)r+=e[n]===` `?4:1;return n}function z(e){let t=new Map,n=new Map;if(!T.test(e))return{text:e,lineMap:t,columns:n};let r=e.split(`
|
|
3
3
|
`),i=-1;for(let e=0;e<r.length;e++)if(r[e].trim()===`treeView-beta`){i=e;break}if(i===-1)return{text:e,lineMap:t,columns:n};let a=e=>e.trim()===``||j.test(e)||A.test(e),o=[];for(let e=i+1;e<r.length;e++){let t=r[e];a(t)||O.test(t)||o.push(t.replace(/\t/g,` `))}if(!N(o))return{text:e,lineMap:t,columns:n};let s=P(o),c=[],l=(e,r,i)=>{c.push(e),t.set(c.length,r+1),i&&n.set(c.length,i)};for(let e=0;e<=i;e++)l(r[e],e);for(let t=i+1;t<r.length;t++){let n=r[t];if(a(n)){l(n,t);continue}if(O.test(n))continue;let i=n.replace(/\t/g,` `),o=E.exec(i);if(o){let r=Math.round(o.index/s)+1,a=o.index+1;for(;a<i.length&&D.test(i[a]);)a++;for(;a<i.length&&i[a]===` `;)a++;let c=i.slice(a).trimEnd();c||L(e,t,`Empty node — expected a filename or directory name after the box-drawing prefix`);let u=M.repeat(r);l(u+c,t,e=>R(n,a+Math.max(e-u.length,0)))}else{if(k.test(i))continue;T.test(i)?l(n,t):/^\s+/.test(i)?L(e,t,`Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`):l(n,t)}}return{text:c.join(`
|
|
4
4
|
`),lineMap:t,columns:n}}function B(e,t){if(e.startsWith(`##`,t)||e.startsWith(`icon(`,t))return!0;if(!e.startsWith(`:::`,t))return!1;let n=t+3;for(;w(e.charCodeAt(n));)n++;let r=e.charCodeAt(n);return r>=65&&r<=90||r>=97&&r<=122||r===95}function V(e,t){let n=e.charCodeAt(t);if(w(n)||n===10||n===13||n===34||n===39||e.startsWith(`:::`,t)||e.startsWith(`icon(`,t)||e.startsWith(`##`,t))return-1;let r=e.length,i=t+1;for(;i<r;){let t=e.charCodeAt(i);if(t===10||t===13)break;if(w(t)){let t=i+1;for(;w(e.charCodeAt(t));)t++;if(B(e,t))break;i=t}else i++}return i}var H={name:`BARE_NAME`,pattern:/(?!:::|icon\(|##)[^ \t\n\r"'](?:(?![ \t]+:::[ \t]*[A-Za-z_]|[ \t]+icon\(|[ \t]+##)[^\n\r])*/y,match:V},U=[{...m(`treeView-beta`),longer:[H]},b(),_,g,{name:`CLASS_ANNOTATION`,pattern:/[ \t]+:::[ \t]*[A-Za-z_][\w-]*/y},{name:`ICON_ANNOTATION`,pattern:/[ \t]+icon\([\w-]*(?::[\w-]+)?\)/y},{name:`DESC_ANNOTATION`,pattern:/[ \t]+##[^\n\r]*/y},{name:`INDENTATION`,pattern:/[ \t]{1,}/y},{name:`QUOTED_NAME`,pattern:/"[^"]*"|'[^']*'/y},{name:`WS`,pattern:/[ \t]+/y,hidden:!0},{name:`ML_COMMENT`,pattern:/\%\%[^\n]*/y,hidden:!0},{name:`NL`,pattern:/\r?\n/y,hidden:!0},H];function W(e){let t=e.length;for(;t>0&&w(e.charCodeAt(t-1));)t--;return t===e.length?e:e.slice(0,t)}function G(e,t){switch(e){case`INDENTATION`:return t?.length||0;case`QUOTED_NAME`:return t.substring(1,t.length-1);case`BARE_NAME`:return W(t);case`CLASS_ANNOTATION`:return t.trim().substring(3).trim();case`ICON_ANNOTATION`:{let e=t.trim();return e.substring(5,e.length-1)}case`DESC_ANNOTATION`:return t.trim().substring(2).trim();default:return}}function K(e){let t=new p(h(e,U,`treeView`),U,`treeView`),n={$type:`TreeView`,nodes:[]};for(t.expect(0);;)if(t.kind===1)n.accDescr=u(t.take());else if(t.kind===2)n.accTitle=f(t.take());else if(t.kind===3)n.title=d(t.take());else break;for(;t.kind!==-1;){let e={$type:`TreeNode`,name:``};if(t.kind===7&&(e.indent=t.take().length),t.kind===8){let n=t.take();e.name=n.substring(1,n.length-1)}else t.kind===12?e.name=W(t.take()):t.fail(`a name`);for(;;)if(t.kind===4)e.classAnnotation=G(`CLASS_ANNOTATION`,t.take());else if(t.kind===5)e.iconAnnotation=G(`ICON_ANNOTATION`,t.take());else if(t.kind===6)e.descAnnotation=G(`DESC_ANNOTATION`,t.take());else break;n.nodes.push(e)}return n}var q=class{count=1;root={id:0,level:-1,name:`/`,nodeType:`directory`,children:[]};stack=[this.root];addNode(e,t,n,r,i,a){let o=this.stack;for(;e<=o[o.length-1].level;)o.pop();let s={id:this.count++,level:e,name:t,nodeType:n,icon:i,cssClass:r,description:a,children:[]};o[o.length-1].children.push(s),o.push(s)}};function J(e,t){for(let n of e.nodes){let e=typeof n.indent==`number`?n.indent:0,r=n.name,i=r.endsWith(`/`);i&&(r=r.slice(0,-1));let a=n.iconAnnotation;t.addNode(e,r,i?`directory`:`file`,n.classAnnotation||void 0,a===void 0?void 0:a||`none`,n.descAnnotation||void 0)}}function te(e){let{text:t,lineMap:n,columns:r}=z(e);try{return K(t)}catch(i){if(!(i instanceof x)||t===e)throw i;let a=n.get(i.line);if(a===void 0)throw i;let o=i.column>0?r.get(i.line)?.(i.column-1)??i.column-1:0,s=C(e,I(e,a)+o),c=i.message.includes(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{s as e}from"
|
|
1
|
+
import{s as e}from"./-2Meesge.js";var t=new WeakMap;function n(e){let n=e.map((e,t)=>t),r=[];for(let t=0;t<128;t++){let i=String.fromCharCode(t);r.push(n.filter(t=>{let{pattern:n,first:r}=e[t];return typeof n==`string`?n[0]===i:r===void 0||r.includes(i)}))}let i={starting:r,every:n,longer:e.map(t=>t.longer?.map(t=>e.indexOf(t)))};return t.set(e,i),i}function r(r,i,a){let o=[],s=[],c=[],l=new Uint8Array(i.length),{starting:u,every:d,longer:f}=t.get(i)??n(i),p=[],m=r.length,h=(e,t)=>{if(l[e])return-1;let n=i[e];if(n.match!==void 0)return n.match(r,t);if(n.scanner!==void 0)return(p[e]??=n.scanner())(r,t);let a=n.pattern;return typeof a==`string`?r.startsWith(a,t)?t+a.length:-1:(a.lastIndex=t,a.test(r)?a.lastIndex:(n.opener!==void 0&&(n.opener.lastIndex=t,n.opener.test(r)&&(l[e]=1)),-1))},g=0;n:for(;g<m;){let t=r.charCodeAt(g);for(let e of t<128?u[t]:d){let t=h(e,g);if(t<=g)continue;let n=e,r=f[e];if(r!==void 0)for(let e of r){let r=h(e,g);if(r>t){n=e,t=r;break}}i[n].hidden||(o.push(n),s.push(g),c.push(t)),g=t;continue n}throw e(a,r,g,``,!0)}return o.push(-1),s.push(m),c.push(m),{kinds:o,starts:s,ends:c,src:r}}var i={name:`ACC_DESCR`,pattern:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/y,first:` a`},a={name:`ACC_TITLE`,pattern:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/y,first:` a`},o={name:`TITLE`,pattern:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/y,first:` t`},s={name:`STRING`,pattern:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/y,first:`"'`},c={name:`NEWLINE`,pattern:/\r?\n/y,first:`\r
|
|
2
2
|
`},l={name:`WHITESPACE`,pattern:/[\t ]+/y,hidden:!0,first:` `},u={name:`YAML`,pattern:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/y,hidden:!0,opener:/---[\t ]*\r?\n/y,first:`-`},d={name:`DIRECTIVE`,pattern:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/y,hidden:!0,opener:/[\t ]*%%{/y,first:` %`},f={name:`SINGLE_LINE_COMMENT`,pattern:/[\t ]*%%[^\n\r]*/y,first:` %`,hidden:!0};function p(e){return{name:e,pattern:RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)+`(?:(?=%%)|(?!\\S))`,`y`),first:e[0]}}var m=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,h=/accTitle[\t ]*:([^\n\r]*)/,g=/title([\t ][^\n\r]*|)/;function _(e){return e.trim().replace(/[\t ]{2,}/gm,` `)}function v(e){return _(g.exec(e)[1])}function y(e){return _(h.exec(e)[1])}function b(e){let t=m.exec(e);return t[1]===void 0?t[2].replace(/^\s*/gm,``).replace(/\s+$/gm,``).replace(/[\t ]{2,}/gm,` `).replace(/[\n\r]{2,}/gm,`
|
|
3
3
|
`):_(t[1])}var x=new Map([[`b`,`\b`],[`f`,`\f`],[`n`,`
|
|
4
4
|
`],[`r`,`\r`],[`t`,` `],[`v`,`\v`],[`0`,`\0`]]);function S(e){if(!e.includes(`\\`))return e.slice(1,-1);let t=``;for(let n=1;n<e.length-1;n++){let r=e[n];if(r===`\\`){let r=e[++n];t+=x.get(r)??r}else t+=r}return t}var C=class{constructor(e,t,n){this.tokens=e,this.types=t,this.diagram=n,this.kinds=e.kinds}tokens;types;diagram;i=0;kinds;get kind(){return this.kinds[this.i]}text(e=this.i){return this.tokens.src.slice(this.tokens.starts[e],this.tokens.ends[e])}take(){return this.text(this.i++)}accept(e){return this.kinds[this.i]===e&&(this.i++,!0)}expect(e){return this.kinds[this.i]!==e&&this.fail(`token of type '${this.types[e].name}'`),this.take()}fail(t){let n=this.kind===-1?`end of input`:`\`${this.text()}\``;throw e(this.diagram,this.tokens.src,this.tokens.starts[this.i],`Expecting ${t} but found ${n}.`)}};export{i as a,b as c,v as d,S as f,y as g,C as h,p as i,c as l,s as m,r as n,d as o,o as p,u as r,f as s,a as t,l as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as e,f as t,i as n,o as r,u as i,x as a}from"./
|
|
1
|
+
import{_ as e,f as t,i as n,o as r,u as i,x as a}from"./DfCZPwp1.js";import{n as o}from"./BymwHy7o.js";import{t as s}from"./DciMwFJ1.js";import{a as c,c as l,d as u,f as d,g as f,h as p,i as m,l as h,m as g,n as _,o as v,p as y,r as b,s as x,t as S,u as C}from"./DX4bJJO0.js";import{PeleError as ee,u as te}from"./-2Meesge.js";var w={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4};function T(e){throw new ee(e,`semantic`,{type:`gitGraph`})}function E(e){return e===`REVERSE`?w.REVERSE:e===`HIGHLIGHT`?w.HIGHLIGHT:w.NORMAL}function D(e,t){e.dir&&t.setDirection(e.dir);for(let n of e.statements)O(n,t)}function O(e,t){switch(e.$type){case`Commit`:t.commit({id:e.id,msg:e.message??``,type:e.type===void 0?w.NORMAL:E(e.type),tags:e.tags??void 0});break;case`Branch`:t.branch({name:e.name,order:e.order??0});break;case`Merge`:t.merge({branch:e.branch,id:e.id??``,type:e.type===void 0?void 0:E(e.type),tags:e.tags??void 0});break;case`Checkout`:t.checkout(e.branch);break;case`CherryPicking`:t.cherryPick({id:e.id,targetId:``,tags:e.tags?.length===0?void 0:e.tags,parent:e.parent})}}function k(e,t,n){let r=t.gitGraph,i=typeof r?.mainBranchName==`string`?r.mainBranchName:`main`,a=typeof r?.mainBranchOrder==`number`?r.mainBranchOrder:0,o=new Map,s=new Map([[i,null]]),c=new Map([[i,a]]),l=[],u=null,d=i,f=`LR`,p=0,m=()=>{for(let e=p+1;;e+=2654435761){let t=`${p}-${(Math.imul(e,2654435761)>>>0).toString(16).padStart(8,`0`).slice(0,7)}`;if(!o.has(t))return t}},h=e=>{u=e,o.set(e.id,e),s.set(d,e.id)},g=e=>{s.has(e)||T(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`),d=e;let t=s.get(e);u=t?o.get(t)??null:null};D(e,{setDirection(e){f=e},commit({msg:e,id:t,type:n,tags:r}){let i={id:t||m(),message:e,seq:p++,type:n??w.NORMAL,tags:r?[...r]:[],parents:u===null?[]:[u.id],branch:d};o.has(i.id)&&l.push(`Commit ID ${i.id} already exists`),h(i)},branch({name:e,order:t}){s.has(e)&&T(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${e}")`),s.set(e,u===null?null:u.id),c.set(e,t),g(e)},merge({branch:e,id:t,type:n,tags:r}){let i=s.get(d),a=s.get(e),c=i?o.get(i):void 0,l=a?o.get(a):void 0;c&&l&&c.branch===e&&T(`Cannot merge branch '${e}' into itself.`),d===e&&T(`Incorrect usage of "merge". Cannot merge a branch to itself`),c===void 0&&T(`Incorrect usage of "merge". Current branch (${d})has no commits`),s.has(e)||T(`Incorrect usage of "merge". Branch to be merged (${e}) does not exist`),l===void 0&&T(`Incorrect usage of "merge". Branch to be merged (${e}) has no commits`),c===l&&T(`Incorrect usage of "merge". Both branches have same head`),t&&o.has(t)&&T(`Incorrect usage of "merge". Commit with id:${t} already exists, use different custom id`),h({id:t||m(),message:`merged branch ${e} into ${d}`,seq:p++,parents:u===null?[]:[u.id,a||``],branch:d,type:w.MERGE,customType:n,customId:!!t,tags:r?[...r]:[]})},cherryPick({id:e,targetId:t,tags:n,parent:r}){let i=e?o.get(e):void 0;if(i===void 0&&T(`Incorrect usage of "cherryPick". Source commit id should exist and provided`),r&&!i.parents.includes(r)&&T(`Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.`),i.type===w.MERGE&&!r&&T(`Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.`),t&&o.has(t))return;i.branch===d&&T(`Incorrect usage of "cherryPick". Source commit is already on current branch`);let a=s.get(d);(!a||!o.has(a))&&T(`Incorrect usage of "cherry-pick". Current branch (${d})has no commits`),h({id:m(),message:`cherry-picked ${i.message} into ${d}`,seq:p++,parents:u===null?[]:[u.id,i.id],branch:d,type:w.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${i.id}${i.type===w.MERGE?`|parent:${r}`:``}`]})},checkout:g});let _=[...c].map(([e,t],n)=>({name:e,order:t??parseFloat(`0.${n}`)})).sort((e,t)=>e.order-t.order).map(e=>e.name);return{type:`gitGraph`,title:e.title||n,accTitle:e.accTitle?e.accTitle.replace(/^\s+/g,``):void 0,accDescr:e.accDescr?e.accDescr.replace(/\n\s+/g,`
|
|
2
2
|
`):void 0,direction:f,commits:o,branches:s,lanes:_,currentBranch:d,head:u,warnings:l}}var A={name:`REFERENCE`,pattern:/\w([-\./\w]*[-\w])?/y},j=[A];function M(e){return{name:e,pattern:e,longer:j}}var N=[M(`cherry-pick`),{name:`gitGraph:`,pattern:`gitGraph:`},M(`HIGHLIGHT`),{...m(`gitGraph`),longer:j},M(`checkout`),M(`REVERSE`),{name:`parent:`,pattern:`parent:`},M(`commit`),M(`NORMAL`),M(`branch`),{name:`order:`,pattern:`order:`},M(`switch`),{name:`type:`,pattern:`type:`},M(`merge`),{name:`msg:`,pattern:`msg:`},{name:`tag:`,pattern:`tag:`},{name:`id:`,pattern:`id:`},M(`LR`),M(`TB`),M(`BT`),{name:`:`,pattern:`:`},{...c,opener:/[\t ]*accDescr\s*{/y},S,y,{name:`INT`,pattern:/0|[1-9][0-9]*(?!\.)/y},g,h,C,b,v,x,A];function P(e){let t=new p(_(e,N,`gitGraph`),N,`gitGraph`),n={$type:`GitGraph`,statements:[]},r=()=>{if(t.kind!==-1)for(t.kind!==26&&t.fail(`a line break or the end of input`);t.kind===26;)t.i++},i=()=>t.kind===31?t.take():t.kind===25?d(t.take()):t.fail(`a branch name`),a=()=>d(t.expect(25)),o=()=>(t.kind!==8&&t.kind!==5&&t.kind!==2&&t.fail(`NORMAL, REVERSE, or HIGHLIGHT`),t.take());for(;t.kind===26;)t.i++;if(!t.accept(1)){t.expect(3);let e=t.kinds[t.i+1];(t.kind===17||t.kind===18||t.kind===19)&&e===20?(n.$type=`Direction`,n.dir=t.take(),t.i++):t.accept(20)}for(;t.kind!==-1;)switch(t.kind){case 26:t.i++;break;case 21:n.accDescr=l(t.take()),r();break;case 22:n.accTitle=f(t.take()),r();break;case 23:n.title=u(t.take()),r();break;case 7:{t.i++;let e={$type:`Commit`,tags:[]};for(;;)if(t.accept(16))e.id=a();else if(t.accept(15))e.tags.push(a());else if(t.accept(12))e.type=o();else if(t.accept(14)||t.kinds[t.i]===25)e.message=a();else break;r(),n.statements.push(e);break}case 9:{t.i++;let e={$type:`Branch`,name:i()};t.accept(10)&&(e.order=parseInt(t.expect(24))),r(),n.statements.push(e);break}case 13:{t.i++;let e={$type:`Merge`,branch:i(),tags:[]};for(;;)if(t.accept(16))e.id=a();else if(t.accept(15))e.tags.push(a());else if(t.accept(12))e.type=o();else break;r(),n.statements.push(e);break}case 4:case 11:{t.i++;let e={$type:`Checkout`,branch:i()};r(),n.statements.push(e);break}case 0:{t.i++;let e={$type:`CherryPicking`,tags:[]};for(;;)if(t.accept(16))e.id=a();else if(t.accept(15))e.tags.push(a());else if(t.accept(6))e.parent=a();else break;r(),n.statements.push(e);break}default:t.fail(`a statement, a title, or a line break`)}return n}var F=7,ne=44,re=44,I=36,L=8,R=20,z=20,B=7,ie=6,V=Math.SQRT1_2,ae=[`normal`,`reverse`,`highlight`,`merge`,`cherry-pick`];function H(e,t,n){let r=e.gitGraph?.[t];return typeof r==`boolean`?r:n}function oe(e){return B+4+e.width+6}function se(e,t,n,r){let i=`cx="${a(t)}" cy="${a(n)}"`;if(e===w.HIGHLIGHT)return`<rect x="${a(t-F-1)}" y="${a(n-F-1)}" width="${2*F+2}" height="${2*F+2}" rx="2" fill="${r}"/>`;if(e===w.MERGE)return`<circle ${i} r="${F-1}" fill="var(--_bg)" stroke="${r}" stroke-width="2"/><circle ${i} r="2.5" fill="${r}"/>`;let o=`<circle ${i} r="${F}" fill="${r}"/>`;return e===w.REVERSE?o+`<path d="M${a(t-3)},${a(n-3)}l6,6M${a(t-3)},${a(n+3)}l6,-6" fill="none" stroke="var(--_bg)" stroke-width="1.5" stroke-linecap="round"/>`:e===w.CHERRY_PICK?o+`<path d="M${a(t-2.6)},${a(n+1)}L${a(t+.8)},${a(n-4.2)}L${a(t+2.6)},${a(n+1)}" fill="none" stroke="var(--_bg)" stroke-linejoin="round"/><circle cx="${a(t-2.6)}" cy="${a(n+2.2)}" r="1.8" fill="var(--_bg)"/><circle cx="${a(t+2.6)}" cy="${a(n+2.2)}" r="1.8" fill="var(--_bg)"/>`:o}function U(e,t,n){return e.direction===`LR`?s(n,r=>W(e,t,n,r?`TB`:`LR`)):W(e,t,n,e.direction)}function W(s,c,l,u){let d=l.fontSize??16,f=Math.round(d*.75),p=l.measurer??te(l.fontFamily,l.fontFamilyMono),m=l.padding??8,h=H(c,`showBranches`,!0),g=H(c,`showCommitLabel`,!0),_=H(c,`rotateCommitLabel`,!0),v=H(c,`parallelCommits`,!1),y=u!==`LR`,b=u===`BT`,x=new Map;s.lanes.forEach((e,t)=>x.set(e,t));let S=s.lanes.length,C=Math.round(d*.875),ee=s.lanes.map(e=>o(h?e:``,p,C,4e3)),T=[],E=new Map;for(let e of[...s.commits.values()].sort((e,t)=>e.seq-t.seq)){let t=g&&e.type!==w.CHERRY_PICK&&(e.type!==w.MERGE||e.customId===!0),n=[];for(let t of e.tags){let e=o(t,p,f,4e3);e.lines.length>0&&n.push(e)}let r={commit:e,index:T.length,lane:x.get(e.branch)??0,m:0,label:t?o(e.id,p,f,4e3):void 0,tags:n};T.push(r),E.set(e.id,r)}let D=new Float64Array(T.length),O=new Float64Array(T.length),k=new Float64Array(S).fill(F),A=new Float64Array(S).fill(F);T.forEach((e,t)=>{let{label:n,tags:r}=e,i=0,a=0;for(let e of r){let t=oe(e);y?(i=Math.max(i,e.height),a+=t+4):(i=Math.max(i,t),a+=e.height+3)}let o=0,s=0;n!==void 0&&n.lines.length>0&&(_?s=3+V*(n.width+n.height):(o=y?n.height:n.width,s=6+(y?n.width:n.height))),D[t]=Math.max(F,i/2,o/2),O[t]=i/2;let c=F+(r.length>0?ie+a:0),l=F+s,u=e.lane;k[u]=Math.max(k[u],y?l:c),A[u]=Math.max(A[u],y?c:l)});let j=new Float64Array(T.length);y||T.forEach((e,t)=>{if(O[t]!==0)for(let n of e.commit.parents){let r=E.get(n);r!==void 0&&r.lane<e.lane&&(j[t]=O[t]+4)}});let M=(e,t)=>Math.max(ne,D[e]+D[t]+L,j[t]>0?D[e]+I+j[t]:0);T.forEach((e,t)=>{if(!v){e.m=t===0?0:T[t-1].m+M(t-1,t);return}let n=0;for(let r of e.commit.parents){let e=E.get(r);e===void 0||e.index>=t||(n=Math.max(n,e.m+M(e.index,t)))}e.m=n});let N=0;for(let e of T)N=Math.max(N,e.m);let P=new Float64Array(S);for(let e=0;e<S;e++){let t=ee[e],n=t.lines.length===0?0:y?t.width/2+8:t.height/2+2;k[e]=Math.max(k[e],n),A[e]=Math.max(A[e],n),e>0&&(P[e]=P[e-1]+Math.max(re,A[e-1]+k[e]+L))}let U=(e,t)=>y?t:e,W=(e,t)=>y?b?-e:e:t,G=(e,t)=>`${a(U(e,t))},${a(W(e,t))}`,K=1/0,q=1/0,J=-1/0,Y=-1/0,X=(e,t,n,r)=>{e<K&&(K=e),t<q&&(q=t),n>J&&(J=n),r>Y&&(Y=r)},Z=``;if(h)for(let e=0;e<S;e++){let i=ee[e],o=t(e),c=P[e],l=i.width+16,u=i.height+4,d=i.lines.length===0?-R:-R-(y?u:l),f=U(d+(y?u:l)/2,c),p=W(d+(y?u:l)/2,c);X(U(-R,c),W(-R,c),U(-R,c),W(-R,c)),X(U(N+z,c),W(N+z,c),U(N+z,c),W(N+z,c)),Z+=`<g class="pele-branch" data-id="${n(s.lanes[e])}"><path class="pele-lane" d="M${G(-R,c)}L${G(N+z,c)}" stroke="${o}" stroke-dasharray="2 4"/>`,i.lines.length>0&&(X(f-l/2,p-u/2,f+l/2,p+u/2),Z+=`<rect x="${a(f-l/2)}" y="${a(p-u/2)}" width="${a(l)}" height="${a(u)}" fill="${o}" style="rx:var(--_r)"/>`+r(i,f,p,` class="pele-label" fill="var(--_bg)"`)),Z+=`</g>`}let ce=Array.from({length:S},()=>[]);for(let e of T)ce[e.lane].push(e.m);if(v)for(let e of ce)e.sort((e,t)=>e-t);let le=(e,t,n)=>{let r=ce[e],i=0,a=r.length;for(;i<a;){let e=i+a>>1;r[e]<=t?i=e+1:a=e}return i<r.length&&r[i]<n},ue=``,Q=``;for(let e of T){let{commit:n}=e,r=P[e.lane],i=e.m;for(let a=0;a<n.parents.length;a++){let o=E.get(n.parents[a]);if(o===void 0||o===e)continue;let s=P[o.lane],c=o.m;if(o.lane===e.lane){Q+=`<path class="pele-edge" d="M${G(c,s)}L${G(i,r)}" stroke="${t(e.lane)}"/>`;continue}let l=a>0&&n.type===w.MERGE,u=a>0&&!l,d=`M${G(c,s)}`;if(i<=c){let e=(c+i)/2;d+=`C${G(e,s)} ${G(e,r)} ${G(i,r)}`}else if(!l&&!le(e.lane,c,i)){let e=Math.min(I,i-c);d+=`C${G(c+e/2,s)} ${G(c+e/2,r)} ${G(c+e,r)}L${G(i,r)}`}else{let t=o.lane<e.lane&&i-j[e.index]>c?i-j[e.index]:i,n=Math.min(I,t-c),a=s;(!l||le(o.lane,c,i))&&(a=s>r?r+A[e.lane]+L/2:r-k[e.lane]-L/2,n=Math.min(I,(t-c)/2),d+=`C${G(c+n/2,s)} ${G(c+n/2,a)} ${G(c+n,a)}`),d+=`L${G(t-n,a)}C${G(t-n/2,a)} ${G(t-n/2,r)} ${G(t,r)}`,t<i&&(d+=`L${G(i,r)}`)}ue+=`<path class="pele-edge${l?` pele-edge-merge`:u?` pele-edge-cherry-pick`:``}" d="${d}" stroke="${t(l?o.lane:e.lane)}"${u?` stroke-dasharray="4 3"`:``}/>`}}let de=``;for(let e of T){let{commit:i,label:o,tags:s}=e,c=U(e.m,P[e.lane]),l=W(e.m,P[e.lane]),u=i.customType??i.type;X(c-F-1,l-F-1,c+F+1,l+F+1);let d=i.type<w.MERGE&&i.message!==``?`<title>${n(i.message)}</title>`:``;if(d+=se(u,c,l,t(e.lane)),o!==void 0&&o.lines.length>0){let e=o.width,t=o.height,n=(n,r)=>`<rect x="${a(n-e/2-2)}" y="${a(r-t/2+2)}" width="${a(e+4)}" height="${a(t-4)}" rx="3" fill="var(--_bg)"/>`;if(_){let i=V*t/2,s=y?c-F-3-i:c+3,u=y?l:l+F+3+i,f=V*e+i;X(s-f,b?u-f:u-i,s+i,b?u+i:u+f),d+=`<g class="pele-commit-label" transform="rotate(${b?45:-45} ${a(s)} ${a(u)})">`+n(s-e/2,u)+r(o,s-e/2,u,``)+`</g>`}else{let i=y?c-F-6-e/2:c,a=y?l:l+F+6+t/2;X(i-e/2,a-t/2,i+e/2,a+t/2),d+=`<g class="pele-commit-label">${n(i,a)}${r(o,i,a,``)}</g>`}}let f=F+ie;for(let e=y?0:s.length-1;e>=0&&e<s.length;e+=y?1:-1){let t=s[e],n=oe(t),i=t.height,o=y?c+f:c-n/2,u=y?l:l-f-i/2;f+=y?n+4:i+3,X(o,u-i/2,o+n,u+i/2),d+=`<g class="pele-tag"><path d="M${a(o)},${a(u)}L${a(o+B)},${a(u-i/2)}H${a(o+n)}V${a(u+i/2)}H${a(o+B)}Z" fill="var(--_s)" stroke="var(--_b)" stroke-linejoin="round"/><circle cx="${a(o+B)}" cy="${a(u)}" r="1.5" fill="var(--_b)"/>`+r(t,o+B+4+t.width/2,u,` fill="var(--_fg)"`)+`</g>`}let p=i.type===w.MERGE&&u!==w.MERGE?` pele-commit-merge`:``;de+=`<g class="pele-commit pele-commit-${ae[u]??ae[0]}${p}" data-id="${n(i.id)}">${d}</g>`}K>J&&X(0,0,0,0);let $=i(s.title,!1,p,d,4e3,1),fe=$.height>0?$.height+16:0,pe=Math.max(J-K,$.width),me=Math.ceil(pe+2*m),he=Math.ceil(Y-q+fe+2*m),ge=m-K+(pe-(J-K))/2,_e=m+fe-q,ve=r($,me/2,m+$.height/2,` class="pele-title" font-weight="var(--_tw)"`)+`<g transform="translate(${a(ge)},${a(_e)})">`+(Z?`<g class="pele-branches" fill="none" font-size="${C}">${Z}</g>`:``)+(ue||Q?`<g class="pele-edges" fill="none" stroke-width="2" stroke-linecap="round">${ue}${Q}</g>`:``)+(de?`<g class="pele-commits" font-size="${f}" fill="var(--_m)">${de}</g>`:``)+`</g>`;return{svg:e(`gitGraph`,me,he,d,l,s,ve),width:me,height:he,links:[]}}var G={type:`gitGraph`,parse:(e,t,n)=>k(P(e),t,n),render:U};export{G as gitGraph};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e,x as t}from"./CX-xckzu.js";import{f as n,n as r,o as i,t as a}from"./DECNRCf2.js";import{n as o,t as s}from"./CZ8wTb_M.js";var c=34,l=24,u=8,d=2e4,f=1e4,p=2e6,m=4,h=3,ee=8,g=20,te=20,ne=14,_=3;function v(e,t,o,s,v=l){let b=e.length;if(b===0)return{width:0,height:0};let x=o===`LR`||o===`RL`,re=o===`BT`||o===`RL`,S=[];for(let t=b-1;t>=0;t--)e[t].parent<0&&e[t].isGroup&&S.push(t);let C=Math.max(1,S.length),w=new Int32Array(b).fill(-1);S.forEach((e,t)=>w[e]=t);let T=new Uint8Array(b);for(let t=0;t<b;t++)e[t].parent>=0&&(T[e[t].parent]=1);let ie=new Float64Array(C).fill(v),ae=v,E=t=>{let n=t,r=v;for(let t=0;e[n].parent>=0&&t<f;t++)n=e[n].parent,w[n]<0&&(r+=Math.max(e[n].padX,e[n].padTop,e[n].padBottom));let i=Math.max(0,w[n]);return r>ie[i]&&(ie[i]=r),r>ae&&(ae=r),i},oe=new Int32Array(b).fill(-1),D=[];for(let t=0;t<b;t++)w[t]>=0||(!e[t].isGroup||!T[t])&&(oe[t]=D.length,D.push(t));let O=e=>x?e.w:e.h,k=e=>x?e.h:e.w,A=D.map(t=>i(k(e[t]),O(e[t]))),j=[],se=[],M=1;{let e=new Set;for(let n=0;n<t.length;n++){let r=t[n],i=oe[r.src],o=oe[r.dst];if(i<0||o<0||i===o)continue;let s=Math.min(i,o)*D.length+Math.max(i,o);(r.labelW>0||e.has(s))&&(M=2),e.add(s),j.push(a(i,o,r.minlen,x?r.labelH:r.labelW,x?r.labelW:r.labelH)),se.push(n)}}n(A,j),r(A,j,M);let N=j.length,ce=Int32Array.from(D,E),P=(n,r)=>{let i=ie.map((e,t)=>r[t]?Math.max(e,te):e),a=new Uint8Array(C),o=0,l=new Int32Array(N);for(let e=0;e<N;e++)l[e]=Math.abs(A[j[e].head].rank-A[j[e].tail].rank),n[e]||(o+=l[e]-1);let h=o>d,v=D.length+(h?0:o),T=new Int32Array(v),E=new Int32Array(v),O=new Float64Array(v),k=new Float64Array(v),P=new Uint8Array(v),F=0;for(let e=0;e<D.length;e++)T[e]=A[e].rank,E[e]=ce[e],O[e]=A[e].w,k[e]=A[e].h,T[e]>F&&(F=T[e]);let I=new Int32Array(N).fill(-1),L=new Int32Array(N).fill(-1),R=[];{let e=D.length;for(let t=0;t<N;t++){let r=j[t],i=r.reversed?r.head:r.tail,a=r.reversed?r.tail:r.head;if(h||l[t]<2||n[t]){R.push(i,a);continue}let o=T[i],s=T[a],c=-1;r.labelW>0&&(c=o+(s-o>>1),M===2&&!(c&1)&&c--),I[t]=e;let u=i;for(let n=o+1;n<s;n++){let l=e++;T[l]=n,E[l]=E[i]+Math.round((E[a]-E[i])*(n-o)/(s-o)),P[l]=1,n===c&&(O[l]=r.labelW,k[l]=r.labelH,L[t]=l),R.push(u,l),u=l}R.push(u,a)}}let z=new Int32Array(v+1),B=new Int32Array(v+1);for(let e=0;e<R.length;e+=2)B[R[e]+1]++,z[R[e+1]+1]++;for(let e=0;e<v;e++)z[e+1]+=z[e],B[e+1]+=B[e];let le=new Int32Array(R.length/2),ue=new Int32Array(R.length/2);{let e=z.slice(0,v),t=B.slice(0,v);for(let n=0;n<R.length;n+=2)ue[t[R[n]]++]=R[n+1],le[e[R[n+1]]++]=R[n]}let V=[];for(let e=0;e<=F;e++)V.push([]);for(let e=0;e<v;e++)V[T[e]].push(e);let de=new Float64Array(v),H=new Float64Array(v),fe=e=>{e.sort((e,t)=>E[e]-E[t]||H[e]-H[t]||e-t);for(let t=0;t<e.length;t++)de[e[t]]=t};for(let e of V){for(let t=0;t<e.length;t++)H[e[t]]=t;fe(e)}for(let e=0;e<u&&F>0;e++){let t=!(e&1);for(let e=1;e<=F;e++){let n=V[t?e:F-e],r=t?z:B,i=t?le:ue;for(let e of n){let t=0,n=r[e+1]-r[e];for(let n=r[e];n<r[e+1];n++)t+=de[i[n]];H[e]=n>0?t/n:de[e]}fe(n)}}let U=(e,t)=>P[e]||P[t]?s.edgeSep:s.nodeSep,pe=(e,t)=>{let n=0;for(;n<e.length;){let r=n;for(;r+1<e.length&&E[e[r+1]]===E[e[n]];)r++;t(e,n,r),n=r+1}},me=(e,t,n)=>{let r=O[e[t]];for(let i=t;i<n;i++)r+=U(e[i],e[i+1])+O[e[i+1]];return r},he=new Float64Array(C),W=S.length>0?c:0;for(let t=0;t<S.length;t++){let n=e[S[t]];he[t]=Math.max(0,n.minW-2*i[t]),n.padTop>W&&(W=n.padTop)}for(let e of V)pe(e,(t,n,r)=>{let i=me(e,n,r);i>he[E[e[n]]]&&(he[E[e[n]]]=i)});let G=new Float64Array(C+1);for(let e=0;e<C;e++)G[e+1]=G[e]+he[e]+2*i[e];let K=new Float64Array(v),ge=new Float64Array(v),_e=(e,t,n)=>{let r=E[e[t]],a=(G[r]+i[r]+(G[r+1]-i[r])-me(e,t,n))/2;for(let r=t;r<=n;r++)K[e[r]]=a+O[e[r]]/2,r<n&&(a+=O[e[r]]+U(e[r],e[r+1]))},ve=(e,t,n)=>{let r=E[e[t]],a=G[r]+i[r];for(let r=t;r<=n;r++){let t=e[r];K[t]=Math.max(ge[t],a+O[t]/2),r<n&&(a=K[t]+O[t]/2+U(t,e[r+1]))}let o=G[r+1]-i[r];for(let r=n;r>=t;r--){let n=e[r];K[n]=Math.min(K[n],o-O[n]/2),r>t&&(o=K[n]-O[n]/2-U(e[r-1],n))}};for(let e of V)pe(e,_e);for(let e=0;e<4&&F>0;e++){let t=!(e&1);for(let e=1;e<=F;e++){let n=V[t?e:F-e],r=t?z:B,i=t?le:ue;for(let e of n){let t=0,n=0;for(let a=r[e];a<r[e+1];a++)E[i[a]]===E[e]&&(t+=K[i[a]],n++);ge[e]=n>0?t/n:K[e]}pe(n,ve)}}let q=new Float64Array(F+1),J=new Float64Array(F+1),Y=new Float64Array(F+1).fill(s.rankSep/M);if(n.some(e=>e===1)){let e=s.rankSep/M;Y.fill(e/_);for(let t=0;t<N;t++){let r=j[t],i=r.reversed?r.head:r.tail,a=r.reversed?r.tail:r.head;if(n[t]){if(r.labelH<=0||l[t]>M)continue;let n=Math.min(e,(r.labelH+2*g-Math.min(k[i],k[a])/2)/l[t]);for(let e=T[i];e<T[a];e++)n>Y[e]&&(Y[e]=n);continue}let o=I[t];if(o<0||l[t]<=M*r.minlen)for(let t=T[i];t<T[a];t++)Y[t]=e;else for(let n=o-1;n<o+l[t]-1;n++){let r=n<o?i:n,s=n+1<o+l[t]-1?n+1:a;(E[r]!==E[s]||Math.abs(K[r]-K[s])>=.5)&&(Y[T[r]]=e)}}}let ye=W+ae;for(let e=0;e<=F;e++){let t=0;for(let n of V[e])k[n]>t&&(t=k[n]);q[e]=ye,J[e]=ye+t,ye+=t+(e===F?0:Y[e])}let X=ye+ae,be=G[C],xe=e=>re?W+X-e:e,Z=(e,t)=>x?xe(t):e,Q=(e,t)=>x?e:xe(t),Se=+!!x;for(let t=0;t<D.length;t++){let n=e[D[t]],r=(q[T[t]]+J[T[t]])/2;n.x=Z(K[t],r),n.y=Q(K[t],r)}for(let t=0;t<S.length;t++){let n=e[S[t]],r=(G[t]+G[t+1])/2,i=G[t+1]-G[t];n.x=x?X/2:r,n.y=x?r:X/2,n.w=x?X:i,n.h=x?i:X,n.padTop=W}let Ce=new Int32Array(b),we=[];for(let t=0;t<b;t++){if(!e[t].isGroup||w[t]>=0||oe[t]>=0)continue;let n=0;for(let r=e[t].parent;r>=0&&n<f;r=e[r].parent)n++;Ce[t]=n,we.push(t)}we.sort((e,t)=>Ce[t]-Ce[e]||e-t);let $=new Float64Array(b*4);for(let e=0;e<b;e++)$[e*4]=1/0,$[e*4+1]=1/0,$[e*4+2]=-1/0,$[e*4+3]=-1/0;let Te=(e,t)=>{t.x-t.w/2<$[e*4]&&($[e*4]=t.x-t.w/2),t.y-t.h/2<$[e*4+1]&&($[e*4+1]=t.y-t.h/2),t.x+t.w/2>$[e*4+2]&&($[e*4+2]=t.x+t.w/2),t.y+t.h/2>$[e*4+3]&&($[e*4+3]=t.y+t.h/2)};for(let t of D)e[t].parent>=0&&w[e[t].parent]<0&&Te(e[t].parent,e[t]);for(let t of we){let n=e[t];if($[t*4]===1/0)continue;let r=Math.max($[t*4+2]-$[t*4]+2*n.padX,n.minW);n.x=($[t*4]+$[t*4+2])/2,n.w=r,n.y=($[t*4+1]-n.padTop+$[t*4+3]+n.padBottom)/2,n.h=$[t*4+3]-$[t*4+1]+n.padTop+n.padBottom,n.parent>=0&&w[n.parent]<0&&Te(n.parent,n)}for(let e of t)e.route=[];for(let e=0;e<N;e++){let n=j[e],r=t[se[e]],i=n.reversed?n.head:n.tail,a=n.reversed?n.tail:n.head,o=[K[i],J[T[i]]-(J[T[i]]-q[T[i]]-k[i])/2],s=I[e];if(s>=0)for(let t=s;t<s+l[e]-1;t++)o.push(K[t],q[T[t]]),J[T[t]]>q[T[t]]&&o.push(K[t],J[T[t]]);o.push(K[a],q[T[a]]+(J[T[a]]-q[T[a]]-k[a])/2);let c=[];for(let e=0;e<o.length;e+=2)c.push(Z(o[e],o[e+1]),Q(o[e],o[e+1]),Se);if(n.reversed)for(let e=0,t=c.length-3;e<t;e+=3,t-=3)for(let n=0;n<2;n++){let r=c[e+n];c[e+n]=c[t+n],c[t+n]=r}r.route=c;let u=L[e];if(u>=0){let e=(q[T[u]]+J[T[u]])/2;r.labelX=Z(K[u],e),r.labelY=Q(K[u],e)}else r.labelX=(c[0]+c[c.length-3])/2,r.labelY=(c[1]+c[c.length-2])/2}for(let n of t){if(n.route.length>0||n.src===n.dst)continue;let t=e[n.src],r=e[n.dst],[i,a]=y(t,r),[o,s]=y(r,t),c=+(Math.abs(o-i)>Math.abs(s-a));n.route=[i,a,c,o,s,c],n.labelX=(i+o)/2,n.labelY=(a+s)/2}let Ee=new Uint8Array(N),De=t.reduce((e,t)=>e+t.route.length/3,0),Oe=N*(D.length+t.length+De);if(Oe<=p){let e=e=>(q[T[e]]+J[T[e]])/2,n=t.map(e=>[x?e.labelY:e.labelX,xe(x?e.labelX:e.labelY)]),r=(e,t,n,r,i,a,o,s)=>n>i-o/2&&e<i+o/2&&r>a-s/2&&t<a+s/2,o=(i,a,o,s,c,l,u)=>{for(let t=0;t<D.length;t++)if(t!==c&&t!==l&&r(i,a,o,s,K[t],e(t),O[t]+8,k[t]+8))return!1;for(let e=0;e<t.length;e++){let c=t[e];if(e!==u&&c.labelW>0&&c.src!==c.dst&&r(i,a,o,s,n[e][0],n[e][1],x?c.labelH:c.labelW,x?c.labelW:c.labelH))return!1}return!0},s=(e,n,r,i,a)=>{let o=0;for(let s=0;s<t.length;s++){if(s===a)continue;let c=t[s].route;for(let t=3;t<c.length;t+=3)if(Math.max(c[t-3],c[t])>e&&Math.min(c[t-3],c[t])<r&&Math.max(c[t-2],c[t+1])>n&&Math.min(c[t-2],c[t+1])<i){o++;break}}return o},c=(e,n,r)=>{let i=0;for(let a=0;a<t.length;a++){let o=t[a].route;if(a===r||o.length===0)continue;let s=o.length-3;(Math.abs(o[0]-e)<1&&Math.abs(o[1]-n)<1||Math.abs(o[s]-e)<1&&Math.abs(o[s+1]-n)<1)&&i++}return i},l=(e,n,r,i,a)=>{let o=Math.abs(r-e)<.5,s=o?Math.min(n,i):Math.min(e,r),c=o?Math.max(n,i):Math.max(e,r),l=o?e:n;for(let e=0;e<t.length;e++){let n=t[e];if(e===a||n.src===t[a].src||n.dst===t[a].dst)continue;let r=n.route;for(let e=3;e<r.length;e+=3){let t=r[e-3+ +!o],n=r[e+ +!o];if(Math.abs(t-l)>=m||Math.abs(n-l)>=m)continue;let i=r[e-3+ +!!o],a=r[e+ +!!o];if(Math.min(c,Math.max(i,a))-Math.max(s,Math.min(i,a))>1)return!0}}return!1};for(let r=0;r<N;r++){let u=j[r],d=se[r],f=t[d],m=u.tail,h=u.head;if(E[m]===E[h]||Math.abs(K[h]-K[m])<1)continue;let _=K[m],v=K[h],y=e(m),b=e(h),x=Math.sign(v-_),re=Math.sign(b-y),S=(e,t)=>{for(let n=2;n<e.length;n+=2)if(!o(Math.min(e[n-2],e[n])-t,Math.min(e[n-1],e[n+1])-t,Math.max(e[n-2],e[n])+t,Math.max(e[n-1],e[n+1])+t,m,h,d)||l(Z(e[n-2],e[n-1]),Q(e[n-2],e[n-1]),Z(e[n],e[n+1]),Q(e[n],e[n+1]),d))return!1;let i=0,a=0,c=-1;if(f.labelW>0){let t=u.labelW,n=u.labelH;for(let r=2;r<e.length;r+=2){let l=(e[r-2]+e[r])/2,u=(e[r-1]+e[r+1])/2,p=Math.abs(e[r]-e[r-2]),m=Math.abs(e[r+1]-e[r-1]),h=p+m;if(h<=c||(p>0?p<t+8:m<n+8)||l-t/2<0||l+t/2>be||u-n/2<0||u+n/2>X||!o(l-t/2,u-n/2,l+t/2,u+n/2,-1,-1,d))continue;let ee=Z(l,u),g=Q(l,u);s(ee-f.labelW/2,g-f.labelH/2,ee+f.labelW/2,g+f.labelH/2,d)>0||(i=l,a=u,c=h)}if(c<0)return!1}let p=[e[0],e[1]];for(let t=2;t<e.length;t+=2){let n=e[t]-e[t-2],r=e[t+1]-e[t-1],i=Math.abs(n)+Math.abs(r),a=t>2?g:0,o=t+2<e.length?g:0;i>a+o+1&&(a&&p.push(e[t-2]+n/i*a,e[t-1]+r/i*a),o&&p.push(e[t]-n/i*o,e[t+1]-r/i*o)),p.push(e[t],e[t+1])}f.route=[];for(let e=0;e<p.length;e+=2){let t=e===0?p[0]!==p[2]:p[e]!==p[e-2];f.route.push(Z(p[e],p[e+1]),Q(p[e],p[e+1]),t?1-Se:Se)}return f.labelW>0&&(f.labelX=Z(i,a),f.labelY=Q(i,a),n[d]=[i,a]),Ee[r]=1,!0};if(S([_+x*O[m]/2,y,v,y,v,b-re*k[h]/2],2)||S([_,y+re*k[m]/2,_,b,v-x*O[h]/2,b],2)||Oe>p/ee)continue;let C=[];for(let e of E[m]<E[h]?[E[h],E[m]]:[E[m],E[h]]){let t=Math.max(i[e]-ne,Math.min(i[e]/2,te-ne));for(let n of[G[e]+t,G[e+1]-t]){if(Math.abs(n-_)<O[m]/2+4||Math.abs(n-v)<O[h]/2+4)continue;let t=[_+Math.sign(n-_)*O[m]/2,y,n,y,n,b,v+Math.sign(n-v)*O[h]/2,b],r=(c(Z(t[0],t[1]),Q(t[0],t[1]),d)+c(Z(t[6],t[7]),Q(t[6],t[7]),d))*1e6;for(let e=2;e<t.length;e+=2){let n=Z(t[e-2],t[e-1]),i=Q(t[e-2],t[e-1]),a=Z(t[e],t[e+1]),o=Q(t[e],t[e+1]);r+=s(Math.min(n,a),Math.min(i,o),Math.max(n,a),Math.max(i,o),d)*1e6+Math.abs(a-n)+Math.abs(o-i)}C.push({pts:t,cost:r,lane:e})}}C.sort((e,t)=>e.cost-t.cost);for(let e of C)if(S(e.pts,1)){a[e.lane]=1;break}}}return{width:x?X:be,height:x?be:X,routed:Ee,margins:a,work:Oe}},F=new Uint8Array(N),I=new Uint8Array(C),L=P(F,I);for(let e=0;e<h&&L.work<=p/ee;e++){let t=e===0?L.routed:F.map((e,t)=>e&L.routed[t]);if(t.every((e,t)=>e===F[t])&&L.margins.every((e,t)=>e===I[t]))break;F=t,I=L.margins,L=P(F,I)}return F.some((e,t)=>e&&!L.routed[t])&&(L=P(new Uint8Array(N),new Uint8Array(C))),{width:L.width,height:L.height}}function y(e,t){let n=t.x-e.x,r=t.y-e.y,i=Math.max(e.w/2,.5),a=Math.max(e.h/2,.5);if(Math.abs(n)<i&&Math.abs(r)<a)return i-Math.abs(n)<a-Math.abs(r)?[e.x+(n<0?-i:i),t.y]:[t.x,e.y+(r<0?-a:a)];let o=Math.min(n===0?1/0:i/Math.abs(n),r===0?1/0:a/Math.abs(r));return[e.x+n*o,e.y+r*o]}var b=`__swimlane_default__`;function x(e){let t=!1;for(let n of e.nodes)n.isGroup?n.dir=void 0:n.parentId===void 0&&(t=!0);if(t){for(let t of e.nodes)!t.isGroup&&t.parentId===void 0&&(t.parentId=b);e.nodes.push({id:b,label:void 0,labelType:`text`,shape:`rect`,isGroup:!0,parentId:void 0,cssStyles:[],cssCompiledStyles:[],cssClasses:``,dir:void 0})}}function re(n,r,i,a,o,s,c){let l=n.x-n.w/2,u=n.y-n.h/2,d=s===`LR`||s===`RL`,f=d?l+n.padTop/2:n.x,p=d?n.y:u+n.padTop/2,m=e(r,f,p,` class="pele-cluster-label" fill="var(--_m)"${i.text}`,c);return`<g class="pele-cluster pele-lane${a}" data-id="${o}"><rect x="${t(l)}" y="${t(u)}" width="${t(n.w)}" height="${t(n.h)}" fill="none" stroke="var(--_b)"/><rect x="${t(l)}" y="${t(u)}" width="${t(d?n.padTop:n.w)}" height="${t(d?n.h:n.padTop)}" fill="var(--_a)" stroke="var(--_b)"${i.shape}/>`+(d&&m?`<g transform="rotate(-90 ${t(f)} ${t(p)})">${m}</g>`:m)+`</g>`}var S={type:`swimlane`,prepare:x,layout:(e,t,n,r,i)=>v(e,t,n,r,i?12:void 0),drawGroup:re},C={type:`swimlane`,math:!0,parse:s.parse,render:(e,t,n)=>o(e,t,n,S)};export{C as swimlane};
|
|
1
|
+
import{o as e,x as t}from"./DfCZPwp1.js";import{f as n,n as r,o as i,t as a}from"./BLmF1B2i.js";import{n as o,t as s}from"./gPtCGHiy.js";var c=34,l=24,u=8,d=2e4,f=1e4,p=2e6,m=4,h=3,ee=8,g=20,te=20,ne=14,_=3;function v(e,t,o,s,v=l){let b=e.length;if(b===0)return{width:0,height:0};let x=o===`LR`||o===`RL`,re=o===`BT`||o===`RL`,S=[];for(let t=b-1;t>=0;t--)e[t].parent<0&&e[t].isGroup&&S.push(t);let C=Math.max(1,S.length),w=new Int32Array(b).fill(-1);S.forEach((e,t)=>w[e]=t);let T=new Uint8Array(b);for(let t=0;t<b;t++)e[t].parent>=0&&(T[e[t].parent]=1);let ie=new Float64Array(C).fill(v),ae=v,E=t=>{let n=t,r=v;for(let t=0;e[n].parent>=0&&t<f;t++)n=e[n].parent,w[n]<0&&(r+=Math.max(e[n].padX,e[n].padTop,e[n].padBottom));let i=Math.max(0,w[n]);return r>ie[i]&&(ie[i]=r),r>ae&&(ae=r),i},oe=new Int32Array(b).fill(-1),D=[];for(let t=0;t<b;t++)w[t]>=0||(!e[t].isGroup||!T[t])&&(oe[t]=D.length,D.push(t));let O=e=>x?e.w:e.h,k=e=>x?e.h:e.w,A=D.map(t=>i(k(e[t]),O(e[t]))),j=[],se=[],M=1;{let e=new Set;for(let n=0;n<t.length;n++){let r=t[n],i=oe[r.src],o=oe[r.dst];if(i<0||o<0||i===o)continue;let s=Math.min(i,o)*D.length+Math.max(i,o);(r.labelW>0||e.has(s))&&(M=2),e.add(s),j.push(a(i,o,r.minlen,x?r.labelH:r.labelW,x?r.labelW:r.labelH)),se.push(n)}}n(A,j),r(A,j,M);let N=j.length,ce=Int32Array.from(D,E),P=(n,r)=>{let i=ie.map((e,t)=>r[t]?Math.max(e,te):e),a=new Uint8Array(C),o=0,l=new Int32Array(N);for(let e=0;e<N;e++)l[e]=Math.abs(A[j[e].head].rank-A[j[e].tail].rank),n[e]||(o+=l[e]-1);let h=o>d,v=D.length+(h?0:o),T=new Int32Array(v),E=new Int32Array(v),O=new Float64Array(v),k=new Float64Array(v),P=new Uint8Array(v),F=0;for(let e=0;e<D.length;e++)T[e]=A[e].rank,E[e]=ce[e],O[e]=A[e].w,k[e]=A[e].h,T[e]>F&&(F=T[e]);let I=new Int32Array(N).fill(-1),L=new Int32Array(N).fill(-1),R=[];{let e=D.length;for(let t=0;t<N;t++){let r=j[t],i=r.reversed?r.head:r.tail,a=r.reversed?r.tail:r.head;if(h||l[t]<2||n[t]){R.push(i,a);continue}let o=T[i],s=T[a],c=-1;r.labelW>0&&(c=o+(s-o>>1),M===2&&!(c&1)&&c--),I[t]=e;let u=i;for(let n=o+1;n<s;n++){let l=e++;T[l]=n,E[l]=E[i]+Math.round((E[a]-E[i])*(n-o)/(s-o)),P[l]=1,n===c&&(O[l]=r.labelW,k[l]=r.labelH,L[t]=l),R.push(u,l),u=l}R.push(u,a)}}let z=new Int32Array(v+1),B=new Int32Array(v+1);for(let e=0;e<R.length;e+=2)B[R[e]+1]++,z[R[e+1]+1]++;for(let e=0;e<v;e++)z[e+1]+=z[e],B[e+1]+=B[e];let le=new Int32Array(R.length/2),ue=new Int32Array(R.length/2);{let e=z.slice(0,v),t=B.slice(0,v);for(let n=0;n<R.length;n+=2)ue[t[R[n]]++]=R[n+1],le[e[R[n+1]]++]=R[n]}let V=[];for(let e=0;e<=F;e++)V.push([]);for(let e=0;e<v;e++)V[T[e]].push(e);let de=new Float64Array(v),H=new Float64Array(v),fe=e=>{e.sort((e,t)=>E[e]-E[t]||H[e]-H[t]||e-t);for(let t=0;t<e.length;t++)de[e[t]]=t};for(let e of V){for(let t=0;t<e.length;t++)H[e[t]]=t;fe(e)}for(let e=0;e<u&&F>0;e++){let t=!(e&1);for(let e=1;e<=F;e++){let n=V[t?e:F-e],r=t?z:B,i=t?le:ue;for(let e of n){let t=0,n=r[e+1]-r[e];for(let n=r[e];n<r[e+1];n++)t+=de[i[n]];H[e]=n>0?t/n:de[e]}fe(n)}}let U=(e,t)=>P[e]||P[t]?s.edgeSep:s.nodeSep,pe=(e,t)=>{let n=0;for(;n<e.length;){let r=n;for(;r+1<e.length&&E[e[r+1]]===E[e[n]];)r++;t(e,n,r),n=r+1}},me=(e,t,n)=>{let r=O[e[t]];for(let i=t;i<n;i++)r+=U(e[i],e[i+1])+O[e[i+1]];return r},he=new Float64Array(C),W=S.length>0?c:0;for(let t=0;t<S.length;t++){let n=e[S[t]];he[t]=Math.max(0,n.minW-2*i[t]),n.padTop>W&&(W=n.padTop)}for(let e of V)pe(e,(t,n,r)=>{let i=me(e,n,r);i>he[E[e[n]]]&&(he[E[e[n]]]=i)});let G=new Float64Array(C+1);for(let e=0;e<C;e++)G[e+1]=G[e]+he[e]+2*i[e];let K=new Float64Array(v),ge=new Float64Array(v),_e=(e,t,n)=>{let r=E[e[t]],a=(G[r]+i[r]+(G[r+1]-i[r])-me(e,t,n))/2;for(let r=t;r<=n;r++)K[e[r]]=a+O[e[r]]/2,r<n&&(a+=O[e[r]]+U(e[r],e[r+1]))},ve=(e,t,n)=>{let r=E[e[t]],a=G[r]+i[r];for(let r=t;r<=n;r++){let t=e[r];K[t]=Math.max(ge[t],a+O[t]/2),r<n&&(a=K[t]+O[t]/2+U(t,e[r+1]))}let o=G[r+1]-i[r];for(let r=n;r>=t;r--){let n=e[r];K[n]=Math.min(K[n],o-O[n]/2),r>t&&(o=K[n]-O[n]/2-U(e[r-1],n))}};for(let e of V)pe(e,_e);for(let e=0;e<4&&F>0;e++){let t=!(e&1);for(let e=1;e<=F;e++){let n=V[t?e:F-e],r=t?z:B,i=t?le:ue;for(let e of n){let t=0,n=0;for(let a=r[e];a<r[e+1];a++)E[i[a]]===E[e]&&(t+=K[i[a]],n++);ge[e]=n>0?t/n:K[e]}pe(n,ve)}}let q=new Float64Array(F+1),J=new Float64Array(F+1),Y=new Float64Array(F+1).fill(s.rankSep/M);if(n.some(e=>e===1)){let e=s.rankSep/M;Y.fill(e/_);for(let t=0;t<N;t++){let r=j[t],i=r.reversed?r.head:r.tail,a=r.reversed?r.tail:r.head;if(n[t]){if(r.labelH<=0||l[t]>M)continue;let n=Math.min(e,(r.labelH+2*g-Math.min(k[i],k[a])/2)/l[t]);for(let e=T[i];e<T[a];e++)n>Y[e]&&(Y[e]=n);continue}let o=I[t];if(o<0||l[t]<=M*r.minlen)for(let t=T[i];t<T[a];t++)Y[t]=e;else for(let n=o-1;n<o+l[t]-1;n++){let r=n<o?i:n,s=n+1<o+l[t]-1?n+1:a;(E[r]!==E[s]||Math.abs(K[r]-K[s])>=.5)&&(Y[T[r]]=e)}}}let ye=W+ae;for(let e=0;e<=F;e++){let t=0;for(let n of V[e])k[n]>t&&(t=k[n]);q[e]=ye,J[e]=ye+t,ye+=t+(e===F?0:Y[e])}let X=ye+ae,be=G[C],xe=e=>re?W+X-e:e,Z=(e,t)=>x?xe(t):e,Q=(e,t)=>x?e:xe(t),Se=+!!x;for(let t=0;t<D.length;t++){let n=e[D[t]],r=(q[T[t]]+J[T[t]])/2;n.x=Z(K[t],r),n.y=Q(K[t],r)}for(let t=0;t<S.length;t++){let n=e[S[t]],r=(G[t]+G[t+1])/2,i=G[t+1]-G[t];n.x=x?X/2:r,n.y=x?r:X/2,n.w=x?X:i,n.h=x?i:X,n.padTop=W}let Ce=new Int32Array(b),we=[];for(let t=0;t<b;t++){if(!e[t].isGroup||w[t]>=0||oe[t]>=0)continue;let n=0;for(let r=e[t].parent;r>=0&&n<f;r=e[r].parent)n++;Ce[t]=n,we.push(t)}we.sort((e,t)=>Ce[t]-Ce[e]||e-t);let $=new Float64Array(b*4);for(let e=0;e<b;e++)$[e*4]=1/0,$[e*4+1]=1/0,$[e*4+2]=-1/0,$[e*4+3]=-1/0;let Te=(e,t)=>{t.x-t.w/2<$[e*4]&&($[e*4]=t.x-t.w/2),t.y-t.h/2<$[e*4+1]&&($[e*4+1]=t.y-t.h/2),t.x+t.w/2>$[e*4+2]&&($[e*4+2]=t.x+t.w/2),t.y+t.h/2>$[e*4+3]&&($[e*4+3]=t.y+t.h/2)};for(let t of D)e[t].parent>=0&&w[e[t].parent]<0&&Te(e[t].parent,e[t]);for(let t of we){let n=e[t];if($[t*4]===1/0)continue;let r=Math.max($[t*4+2]-$[t*4]+2*n.padX,n.minW);n.x=($[t*4]+$[t*4+2])/2,n.w=r,n.y=($[t*4+1]-n.padTop+$[t*4+3]+n.padBottom)/2,n.h=$[t*4+3]-$[t*4+1]+n.padTop+n.padBottom,n.parent>=0&&w[n.parent]<0&&Te(n.parent,n)}for(let e of t)e.route=[];for(let e=0;e<N;e++){let n=j[e],r=t[se[e]],i=n.reversed?n.head:n.tail,a=n.reversed?n.tail:n.head,o=[K[i],J[T[i]]-(J[T[i]]-q[T[i]]-k[i])/2],s=I[e];if(s>=0)for(let t=s;t<s+l[e]-1;t++)o.push(K[t],q[T[t]]),J[T[t]]>q[T[t]]&&o.push(K[t],J[T[t]]);o.push(K[a],q[T[a]]+(J[T[a]]-q[T[a]]-k[a])/2);let c=[];for(let e=0;e<o.length;e+=2)c.push(Z(o[e],o[e+1]),Q(o[e],o[e+1]),Se);if(n.reversed)for(let e=0,t=c.length-3;e<t;e+=3,t-=3)for(let n=0;n<2;n++){let r=c[e+n];c[e+n]=c[t+n],c[t+n]=r}r.route=c;let u=L[e];if(u>=0){let e=(q[T[u]]+J[T[u]])/2;r.labelX=Z(K[u],e),r.labelY=Q(K[u],e)}else r.labelX=(c[0]+c[c.length-3])/2,r.labelY=(c[1]+c[c.length-2])/2}for(let n of t){if(n.route.length>0||n.src===n.dst)continue;let t=e[n.src],r=e[n.dst],[i,a]=y(t,r),[o,s]=y(r,t),c=+(Math.abs(o-i)>Math.abs(s-a));n.route=[i,a,c,o,s,c],n.labelX=(i+o)/2,n.labelY=(a+s)/2}let Ee=new Uint8Array(N),De=t.reduce((e,t)=>e+t.route.length/3,0),Oe=N*(D.length+t.length+De);if(Oe<=p){let e=e=>(q[T[e]]+J[T[e]])/2,n=t.map(e=>[x?e.labelY:e.labelX,xe(x?e.labelX:e.labelY)]),r=(e,t,n,r,i,a,o,s)=>n>i-o/2&&e<i+o/2&&r>a-s/2&&t<a+s/2,o=(i,a,o,s,c,l,u)=>{for(let t=0;t<D.length;t++)if(t!==c&&t!==l&&r(i,a,o,s,K[t],e(t),O[t]+8,k[t]+8))return!1;for(let e=0;e<t.length;e++){let c=t[e];if(e!==u&&c.labelW>0&&c.src!==c.dst&&r(i,a,o,s,n[e][0],n[e][1],x?c.labelH:c.labelW,x?c.labelW:c.labelH))return!1}return!0},s=(e,n,r,i,a)=>{let o=0;for(let s=0;s<t.length;s++){if(s===a)continue;let c=t[s].route;for(let t=3;t<c.length;t+=3)if(Math.max(c[t-3],c[t])>e&&Math.min(c[t-3],c[t])<r&&Math.max(c[t-2],c[t+1])>n&&Math.min(c[t-2],c[t+1])<i){o++;break}}return o},c=(e,n,r)=>{let i=0;for(let a=0;a<t.length;a++){let o=t[a].route;if(a===r||o.length===0)continue;let s=o.length-3;(Math.abs(o[0]-e)<1&&Math.abs(o[1]-n)<1||Math.abs(o[s]-e)<1&&Math.abs(o[s+1]-n)<1)&&i++}return i},l=(e,n,r,i,a)=>{let o=Math.abs(r-e)<.5,s=o?Math.min(n,i):Math.min(e,r),c=o?Math.max(n,i):Math.max(e,r),l=o?e:n;for(let e=0;e<t.length;e++){let n=t[e];if(e===a||n.src===t[a].src||n.dst===t[a].dst)continue;let r=n.route;for(let e=3;e<r.length;e+=3){let t=r[e-3+ +!o],n=r[e+ +!o];if(Math.abs(t-l)>=m||Math.abs(n-l)>=m)continue;let i=r[e-3+ +!!o],a=r[e+ +!!o];if(Math.min(c,Math.max(i,a))-Math.max(s,Math.min(i,a))>1)return!0}}return!1};for(let r=0;r<N;r++){let u=j[r],d=se[r],f=t[d],m=u.tail,h=u.head;if(E[m]===E[h]||Math.abs(K[h]-K[m])<1)continue;let _=K[m],v=K[h],y=e(m),b=e(h),x=Math.sign(v-_),re=Math.sign(b-y),S=(e,t)=>{for(let n=2;n<e.length;n+=2)if(!o(Math.min(e[n-2],e[n])-t,Math.min(e[n-1],e[n+1])-t,Math.max(e[n-2],e[n])+t,Math.max(e[n-1],e[n+1])+t,m,h,d)||l(Z(e[n-2],e[n-1]),Q(e[n-2],e[n-1]),Z(e[n],e[n+1]),Q(e[n],e[n+1]),d))return!1;let i=0,a=0,c=-1;if(f.labelW>0){let t=u.labelW,n=u.labelH;for(let r=2;r<e.length;r+=2){let l=(e[r-2]+e[r])/2,u=(e[r-1]+e[r+1])/2,p=Math.abs(e[r]-e[r-2]),m=Math.abs(e[r+1]-e[r-1]),h=p+m;if(h<=c||(p>0?p<t+8:m<n+8)||l-t/2<0||l+t/2>be||u-n/2<0||u+n/2>X||!o(l-t/2,u-n/2,l+t/2,u+n/2,-1,-1,d))continue;let ee=Z(l,u),g=Q(l,u);s(ee-f.labelW/2,g-f.labelH/2,ee+f.labelW/2,g+f.labelH/2,d)>0||(i=l,a=u,c=h)}if(c<0)return!1}let p=[e[0],e[1]];for(let t=2;t<e.length;t+=2){let n=e[t]-e[t-2],r=e[t+1]-e[t-1],i=Math.abs(n)+Math.abs(r),a=t>2?g:0,o=t+2<e.length?g:0;i>a+o+1&&(a&&p.push(e[t-2]+n/i*a,e[t-1]+r/i*a),o&&p.push(e[t]-n/i*o,e[t+1]-r/i*o)),p.push(e[t],e[t+1])}f.route=[];for(let e=0;e<p.length;e+=2){let t=e===0?p[0]!==p[2]:p[e]!==p[e-2];f.route.push(Z(p[e],p[e+1]),Q(p[e],p[e+1]),t?1-Se:Se)}return f.labelW>0&&(f.labelX=Z(i,a),f.labelY=Q(i,a),n[d]=[i,a]),Ee[r]=1,!0};if(S([_+x*O[m]/2,y,v,y,v,b-re*k[h]/2],2)||S([_,y+re*k[m]/2,_,b,v-x*O[h]/2,b],2)||Oe>p/ee)continue;let C=[];for(let e of E[m]<E[h]?[E[h],E[m]]:[E[m],E[h]]){let t=Math.max(i[e]-ne,Math.min(i[e]/2,te-ne));for(let n of[G[e]+t,G[e+1]-t]){if(Math.abs(n-_)<O[m]/2+4||Math.abs(n-v)<O[h]/2+4)continue;let t=[_+Math.sign(n-_)*O[m]/2,y,n,y,n,b,v+Math.sign(n-v)*O[h]/2,b],r=(c(Z(t[0],t[1]),Q(t[0],t[1]),d)+c(Z(t[6],t[7]),Q(t[6],t[7]),d))*1e6;for(let e=2;e<t.length;e+=2){let n=Z(t[e-2],t[e-1]),i=Q(t[e-2],t[e-1]),a=Z(t[e],t[e+1]),o=Q(t[e],t[e+1]);r+=s(Math.min(n,a),Math.min(i,o),Math.max(n,a),Math.max(i,o),d)*1e6+Math.abs(a-n)+Math.abs(o-i)}C.push({pts:t,cost:r,lane:e})}}C.sort((e,t)=>e.cost-t.cost);for(let e of C)if(S(e.pts,1)){a[e.lane]=1;break}}}return{width:x?X:be,height:x?be:X,routed:Ee,margins:a,work:Oe}},F=new Uint8Array(N),I=new Uint8Array(C),L=P(F,I);for(let e=0;e<h&&L.work<=p/ee;e++){let t=e===0?L.routed:F.map((e,t)=>e&L.routed[t]);if(t.every((e,t)=>e===F[t])&&L.margins.every((e,t)=>e===I[t]))break;F=t,I=L.margins,L=P(F,I)}return F.some((e,t)=>e&&!L.routed[t])&&(L=P(new Uint8Array(N),new Uint8Array(C))),{width:L.width,height:L.height}}function y(e,t){let n=t.x-e.x,r=t.y-e.y,i=Math.max(e.w/2,.5),a=Math.max(e.h/2,.5);if(Math.abs(n)<i&&Math.abs(r)<a)return i-Math.abs(n)<a-Math.abs(r)?[e.x+(n<0?-i:i),t.y]:[t.x,e.y+(r<0?-a:a)];let o=Math.min(n===0?1/0:i/Math.abs(n),r===0?1/0:a/Math.abs(r));return[e.x+n*o,e.y+r*o]}var b=`__swimlane_default__`;function x(e){let t=!1;for(let n of e.nodes)n.isGroup?n.dir=void 0:n.parentId===void 0&&(t=!0);if(t){for(let t of e.nodes)!t.isGroup&&t.parentId===void 0&&(t.parentId=b);e.nodes.push({id:b,label:void 0,labelType:`text`,shape:`rect`,isGroup:!0,parentId:void 0,cssStyles:[],cssCompiledStyles:[],cssClasses:``,dir:void 0})}}function re(n,r,i,a,o,s,c){let l=n.x-n.w/2,u=n.y-n.h/2,d=s===`LR`||s===`RL`,f=d?l+n.padTop/2:n.x,p=d?n.y:u+n.padTop/2,m=e(r,f,p,` class="pele-cluster-label" fill="var(--_m)"${i.text}`,c);return`<g class="pele-cluster pele-lane${a}" data-id="${o}"><rect x="${t(l)}" y="${t(u)}" width="${t(n.w)}" height="${t(n.h)}" fill="none" stroke="var(--_b)"/><rect x="${t(l)}" y="${t(u)}" width="${t(d?n.padTop:n.w)}" height="${t(d?n.h:n.padTop)}" fill="var(--_a)" stroke="var(--_b)"${i.shape}/>`+(d&&m?`<g transform="rotate(-90 ${t(f)} ${t(p)})">${m}</g>`:m)+`</g>`}var S={type:`swimlane`,prepare:x,layout:(e,t,n,r,i)=>v(e,t,n,r,i?12:void 0),drawGroup:re},C={type:`swimlane`,math:!0,parse:s.parse,render:(e,t,n)=>o(e,t,n,S)};export{C as swimlane};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as e,b as t,d as n,i as r,o as i,s as a,u as o,x as s}from"./
|
|
1
|
+
import{_ as e,b as t,d as n,i as r,o as i,s as a,u as o,x as s}from"./DfCZPwp1.js";import{o as c,r as l}from"./DciMwFJ1.js";import{a as u,i as d,s as f}from"./BLmF1B2i.js";import{t as p}from"./RFxekmX-.js";import{a as m,i as h,o as g}from"./Dh1lBxfx.js";import{PeleError as _,g as v,h as y,s as b,u as x}from"./-2Meesge.js";var S=1e5;function C(e){switch(e){case`[]`:return`square`;case`()`:return`round`;case`(())`:return`circle`;case`>]`:return`rect_left_inv_arrow`;case`{}`:return`diamond`;case`{{}}`:return`hexagon`;case`([])`:return`stadium`;case`[[]]`:return`subroutine`;case`[()]`:return`cylinder`;case`((()))`:return`doublecircle`;case`[//]`:return`lean_right`;case`[\\\\]`:return`lean_left`;case`[/\\]`:return`trapezoid`;case`[\\/]`:return`inv_trapezoid`;case`<[]>`:return`block_arrow`;default:return`na`}}function w(e){switch(e.trim().slice(-1)){case`x`:return`arrow_cross`;case`o`:return`arrow_circle`;case`>`:return`arrow_point`;default:return``}}function T(e){switch(e.trim().charAt(0)){case`x`:return`arrow_cross`;case`o`:return`arrow_circle`;case`<`:return`arrow_point`;default:return`arrow_open`}}function E(e){return e.includes(`==`)?`thick`:`normal`}function D(e){return e.includes(`.-`)?`dotted`:`solid`}function O(e,t){let n=e.flat(),r=-1;for(let e of n)if(e.type===`column-setting`){r=e.columns??-1;break}return{list:n,at:0,parent:t,children:[],columns:r}}var k=class{type=`block`;title;root={id:`root`,type:`composite`,children:[],columns:-1};blocks=[];edges=[];classes=new Map;byId=new Map;typeStr2Type=C;edgeStrToEdgeData=w;edgeStrToEdgeStartData=T;edgeStrToThickness=E;edgeStrToPattern=D;warn;pending=new Set;edgeCount=new Map;ids=0;colors=0;spaces=0;constructor(e={}){this.warn=e.warn}generateId(){return`id-`+ ++this.ids}addStyleClass(e,t=``){let n=this.classes.get(e);n||(n={id:e,styles:[],textStyles:[]},this.classes.set(e,n));for(let e of t.split(`,`)){let t=e.indexOf(`;`),r=(t===-1?e:e.slice(0,t)+e.slice(t+1)).trim();e.includes(`color`)&&n.textStyles.push(r.replace(`fill`,`bgFill`).replace(`color`,`fill`)),n.styles.push(r)}}addStyle2Node(e,t=``){this.named(e).styles=t.split(`,`)}setCssClass(e,t){for(let n of e.split(`,`))(this.named(n.trim()).classes??=[]).push(t)}named(e){let t=this.byId.get(e);return t===void 0&&(t={id:e,type:`na`,children:[]},this.byId.set(e,t),this.pending.add(e)),t}setHierarchy(e){let t=[O(e,this.root)];for(;t.length>0;){let e=t[t.length-1];if(e.at===e.list.length){e.parent.children=e.children,t.pop();continue}let n=e.list[e.at++];switch(e.columns>0&&n.type!==`column-setting`&&typeof n.widthInColumns==`number`&&n.widthInColumns>e.columns&&this.warn?.(`Block ${n.id} width ${n.widthInColumns} exceeds configured column width ${e.columns}`),n.type){case`classDef`:this.addStyleClass(n.id,n.css);continue;case`applyClass`:this.setCssClass(n.id,n.styleClass??``);continue;case`applyStyles`:n.stylesStr&&this.addStyle2Node(n.id,n.stylesStr);continue;case`column-setting`:e.parent.columns=n.columns??-1;continue;case`edge`:{let e=(this.edgeCount.get(n.id)??0)+1;this.edgeCount.set(n.id,e),n.id=e+`-`+n.id,this.edges.push(n);continue}}n.id??=this.generateId(),n.label||=n.type===`composite`?``:n.id;let r=this.byId.get(n.id),i=r===void 0||this.pending.delete(n.id);i?(r&&(n.classes=r.classes,n.styles=r.styles),n.type===`composite`&&(n.colorIndex=this.colors++),this.byId.set(n.id,n)):(n.type!==`na`&&(r.type=n.type),n.label!==n.id&&(r.label=n.label));let a=n.children;if(n.children=[],n.type===`space`){let t=n.width??1;if(!(t<=S-this.spaces))throw new _(`A block diagram can hold at most ${S} space blocks.`,`limit`,{type:`block`});this.spaces+=Math.max(t,0);for(let r=0;r<t;r++){let t={...n,id:n.id+`-`+r,children:[]};this.byId.set(t.id,t),e.children.push(t)}}else i&&e.children.push(n);a&&a.length>0&&t.push(O(a,n))}this.blocks=this.root.children??[]}},A=`$end.INVALID.BLOCK_DIAGRAM_KEY.id-block.COLUMNS.MD_STR.STR.SPACE_BLOCK.DEFAULT.LINKSTYLE.INTERPOLATE.classDef.DEFAULT_CLASSDEF_ID.CLASSDEF_ID.CLASSDEF_STYLEOPTS.class.CLASSENTITY_IDS.STYLECLASS.style.STYLE_ENTITY_IDS.STYLE_DEFINITION_DATA.acc_title.acc_title_value.acc_descr.acc_descr_value.acc_descr_multiline_value.end.NODE_DSTART.NODE_DEND.BLOCK_ARROW_START.BLOCK_ARROW_END.DIR.NODE_ID.LINK.START_LINK.LINK_LABEL.SIZE.EOF`.split(`.`),j=[`right`,`left`,`x`,`y`,`up`,`down`],M=new Uint8Array(128);for(let e of[9,10,11,12,13,32,40,41,45,58,60,61,62,91,123,125])M[e]=1;function ee(e){let t=e.length,n=[],r=[],i=[],a=[],o=0,s=0,c=(e,t,a)=>(n.push(e),r.push(t),i.push(s),s=a,!0),l=(t,n)=>c(t,e.slice(s,n),n),u=e=>{a.push(o),o=e},d=()=>{a.length>0&&(o=a.pop())},f=n=>{for(;n<t&&y(e.charCodeAt(n));)n++;return n},p=n=>{for(;n<t;){let t=e.charCodeAt(n);if(t<48||t>57)break;n++}return n},m=n=>{for(;n<t&&v(e.charCodeAt(n));)n++;return n},h=t=>e.startsWith(t,s)&&!v(e.charCodeAt(s+t.length)),g=()=>(e.charCodeAt(s+1)===96?(u(2),s+=2):(u(1),s++),!0),_=t=>{if(e.charCodeAt(t)!==46)return-1;do t++;while(e.charCodeAt(t)===46);if(e.charCodeAt(t)!==45)return-1;let n=e.charCodeAt(t+1);return n===120||n===111||n===62?t+2:t+1},b=t=>{let n=e.charCodeAt(t);(n===120||n===111||n===60)&&t++;let r=e.charCodeAt(t);if(r===46)return _(t);if(r!==45&&r!==61)return-1;let i=t+1;for(;e.charCodeAt(i)===r;)i++;if(i-t===1)return r===45?_(i):-1;let a=e.charCodeAt(i);return a===120||a===111||a===62?i+1:i-t>=3?i:-1},x=()=>{let t=b(s);if(t>=0)return l(33,f(t));let n=e.charCodeAt(s)===60?s+1:s,r=e.charCodeAt(n),i=e.charCodeAt(n+1);return r===45&&(i===45||i===46)||r===61&&i===61?(u(6),l(34,f(n+2))):!1},S=n=>{let r=e.indexOf(`
|
|
2
2
|
`,s);return r===-1&&(r=t),d(),l(n,r)},C=(t,n)=>{let r=m(s);if(r===s)return!1;for(;e.charCodeAt(r)===44;){let e=f(r+1),t=m(e);if(t===e)break;r=t}return o=n,l(t,r)},w=n=>{if(y(n))return s=f(s+1),!0;let r;switch(n){case 98:if(e.startsWith(`block`,s)){if(h(`block-beta`))return l(2,s+10);if(e.charCodeAt(s+5)===58)return l(3,s+6);if(!v(e.charCodeAt(s+5)))return l(2,s+5)}break;case 99:if(e.startsWith(`columns`,s)){if(r=f(s+7),r>s+7){if(e.startsWith(`auto`,r)&&!v(e.charCodeAt(r+4)))return c(4,`-1`,r+4);let t=p(r);if(t>r)return c(4,e.slice(r,t),t)}}else if(e.startsWith(`class`,s)){let t=e.startsWith(`Def`,s+5),n=t?s+8:s+5;if(r=f(n),r>n)return u(t?7:9),l(t?11:15,r)}break;case 34:return g();case 115:if(e.startsWith(`space`,s)){if(e.charCodeAt(s+5)===58){let t=p(s+6);if(t>s+6)return c(7,e.slice(s+6,t),t)}if(!v(e.charCodeAt(s+5)))return c(7,`1`,s+5)}else if(e.startsWith(`style`,s)&&(r=f(s+5),r>s+5))return u(11),l(18,r);break;case 100:if(h(`default`))return l(8,s+7);break;case 108:if(h(`linkStyle`))return l(9,s+9);break;case 105:if(h(`interpolate`))return l(10,s+11);break;case 97:if(e.startsWith(`accTitle`,s)){if(r=f(s+8),e.charCodeAt(r)===58)return u(13),l(21,f(r+1))}else if(e.startsWith(`accDescr`,s)){r=f(s+8);let t=e.charCodeAt(r);if(t===58)return u(14),l(23,f(r+1));if(t===123)return u(15),s=f(r+1),!0}break;case 101:if(h(`end`))return l(26,f(s+3));break;case 45:return e.charCodeAt(s+1)===41?(u(3),l(27,s+2)):x();case 61:return x();case 60:return e.charCodeAt(s+1)===91?(u(4),l(29,s+2)):x();case 40:{let t=e.charCodeAt(s+1),n=t===45||t===91?2:t===40?e.charCodeAt(s+2)===40?3:2:1;return u(3),l(27,s+n)}case 41:case 123:return u(3),l(27,e.charCodeAt(s+1)===n?s+2:s+1);case 62:return u(3),l(27,s+1);case 91:{let t=e.charCodeAt(s+1);return u(3),l(27,t===91||t===124||t===40||t===92||t===47?s+2:s+1)}case 58:{let t=p(s+1);return t>s+1&&c(36,e.slice(s+1,t),t)}}for(r=s;r<t;){let t=e.charCodeAt(r);if(t<128?M[t]===1:y(t))break;r++}return r>s&&l(32,r)},T=t=>{let n=e.charCodeAt(s+1),r=0;switch(t){case 34:return g();case 40:r=n===45?2:n===40?e.charCodeAt(s+2)===40?3:2:1;break;case 41:r=n===41?e.charCodeAt(s+2)===41?3:2:n===93?2:1;break;case 125:r=n===125?2:1;break;case 45:r=n===41?2:0;break;case 93:r=n===93||n===41||n===62?2:1;break;case 92:case 47:r=n===93?2:0}return r!==0&&(d(),l(28,s+r))},E=t=>{if(t===41)return d(),d(),c(30,`]>`,f(s+1));let n=f(t===44?s+1:s);for(let r of j)if(e.startsWith(r,n)){let i=f(n+r.length);return c(31,e.slice(t===44?n:s,i),i)}return!1};for(;;){if(s>=t){let e=-1;switch(o){case 0:e=37;break;case 1:e=6;break;case 8:e=14;break;case 10:e=17;break;case 12:e=20;break;case 13:e=22;break;case 14:e=24;break;case 15:e=25}s=t,e!==-1&&c(e,``,t);break}let a=e.charCodeAt(s),p=!0;switch(o){case 0:p=w(a);break;case 1:if(a===34)d(),s++;else{let n=e.indexOf(`"`,s);l(6,n===-1?t:n)}break;case 2:if(a===96)p=e.charCodeAt(s+1)===34,p&&(d(),s+=2);else if(a===34)p=!1;else{let n=s+1;for(;n<t;){let t=e.charCodeAt(n);if(t===96||t===34)break;n++}l(5,n)}break;case 3:p=T(a);break;case 4:if(a===34)g();else if(a===93&&e.charCodeAt(s+1)===62){let t=f(s+2);p=e.charCodeAt(t)===40,p&&(u(5),s=t+1)}else p=!1;break;case 5:p=E(a);break;case 6:if(a===34)e.charCodeAt(s+1)===96?g():(l(35,s+1),u(1));else{let e=b(f(s));p=e>=0,p&&(d(),l(33,f(e)))}break;case 7:{let t=12,n=e.startsWith(`DEFAULT`,s)?s+7:s,r=f(n);(n===s||r===n)&&(t=13,n=m(s),r=f(n)),p=n>s&&r>n,p&&(o=8,l(t,r));break}case 8:S(14);break;case 9:p=C(16,10);break;case 10:S(17);break;case 11:p=C(19,12);break;case 12:S(20);break;case 13:S(22);break;case 14:S(24);break;case 15:if(a===125)d(),s++;else{let n=e.indexOf(`}`,s);l(25,n===-1?t:n)}}if(!p)return n.push(1),r.push(``),i.push(s),{types:n,texts:r,starts:i}}return n.push(0),r.push(``),i.push(t),{types:n,texts:r,starts:i}}var N=`'NODE_ID', 'COLUMNS', 'SPACE_BLOCK', 'BLOCK_DIAGRAM_KEY', 'id-block', 'classDef', 'class', 'style'`;function P(e){let t=e[e.length-1];return Array.isArray(t)?(e.pop(),e.concat(t)):e}function te(e,t){let{types:n,texts:r,starts:i}=ee(e),a=0,o=t=>{let r=n[a];throw r===1?b(`block`,e,i[a],``,!0):b(`block`,e,i[a],`Expecting ${t}, got '${A[r]}'`)},s=e=>(n[a]!==e&&o(`'${A[e]}'`),r[a++]),c=()=>{let e=s(32);if(n[a]===27){let t=r[a++];return{id:e,label:s(6),typeStr:t+s(28)}}if(n[a]===29){let t=r[a++],i=s(6),o=[s(31)];for(;n[a]===31;)o.push(r[a++]);return{id:e,label:i,typeStr:t+s(30),directions:o}}return{id:e}},l=()=>{let e=c(),i=n[a]===36?parseInt(r[a++],10):1,o={id:e.id,label:e.label,type:t.typeStr2Type(e.typeStr),directions:e.directions,widthInColumns:i},l;for(;n[a]===33||n[a]===34;){let e=``;n[a++]===34&&(s(35),e=s(6),s(33));let i=r[a-1],u=c(),d=t.edgeStrToEdgeData(i),f=t.edgeStrToEdgeStartData(i),p=t.edgeStrToThickness(i),m=t.edgeStrToPattern(i);l??=[{id:o.id,label:o.label,type:o.type,directions:o.directions}],o={id:u.id,label:u.label,type:t.typeStr2Type(u.typeStr),directions:u.directions},l.push({id:l[l.length-1].id+`-`+u.id,start:l[l.length-1].id,end:u.id,label:e,type:`edge`,thickness:p,pattern:m,directions:u.directions,arrowTypeEnd:d,arrowTypeStart:f},o)}return l??o};s(2);let u=[],d=[];for(;;)switch(n[a]){case 32:d.push(l());break;case 4:d.push({type:`column-setting`,columns:parseInt(r[a++],10)});break;case 7:{let e=parseInt(r[a++],10);d.push({id:t.generateId(),type:`space`,label:``,width:e,children:[]});break}case 2:a++,u.push({list:d,header:void 0}),d=[];break;case 3:a++,n[a]!==32&&o(`'NODE_ID'`),u.push({list:d,header:l()}),d=[];break;case 26:{let e=u.pop();if(e===void 0||d.length===0)return o(N);a++;let n=t.generateId(),r=P(d);d=e.list,d.push(e.header===void 0?{id:n,type:`composite`,label:``,children:r}:{...e.header,type:`composite`,children:r});break}case 11:{a++;let e=s(13).trim();d.push({type:`classDef`,id:e,css:s(14).trim()});break}case 15:{a++;let e=s(16).trim();d.push({type:`applyClass`,id:e,styleClass:s(17).trim()});break}case 18:{a++;let e=s(19).trim();d.push({type:`applyStyles`,id:e,stylesStr:s(20).trim()});break}case 37:u.length>0&&o(N+`, 'end'`),d.length===0&&o(N),t.setHierarchy(P(d));return;default:o(d.length===0?N:N+(u.length>0?`, 'end'`:`, 'EOF'`))}}var F=1,I=2,L=4,R=8,z=7,B=20,V=12;function ne(e){let t=0;if(e)for(let n of e)switch(n.trim()){case`right`:t|=F;break;case`left`:t|=I;break;case`up`:t|=L;break;case`down`:t|=R;break;case`x`:t|=F|I;break;case`y`:t|=L|R}return t}var H=(e,t)=>e&t?1:0;function U(e){return e!==0&&(e&(L|R))===0?`x`:e!==0&&(e&(F|I))===0?`y`:``}function re(e,t,n){let r=U(e),i=H(e,I)-H(e,F),a=H(e,L)-H(e,R);if(r===`x`){let r=Math.max(n+8,14)+2*z,a=Math.min(r/2,B);return{w:Math.max(t+12,16)+a*(e===(F|I)?2:1),h:r,dx:i*a/2,dy:0}}if(r===`y`){let r=Math.max(t+16,14)+2*z,i=Math.min(r/2,B);return{w:r,h:Math.max(n+8,16)+i*(e===(L|R)?2:1),dx:0,dy:a*i/2}}return{w:Math.max(t+16,24)+V*(H(e,I)+H(e,F)),h:Math.max(n+8,24)+V*(H(e,L)+H(e,R)),dx:i*V/2,dy:a*V/2}}function ie(e,t,n,r){let i=U(e),a=t/2,o=n/2,c;if(i===`x`){let t=Math.min(o,B),n=o-z,r=e&I?-a+t:-a,i=e&F?a-t:a;c=[r,-n,i,-n],e&F&&c.push(i,-o,a,0,i,o),c.push(i,n,r,n),e&I&&c.push(r,o,-a,0,r,-o)}else if(i===`y`){let t=Math.min(a,B),n=a-z,r=e&L?-o+t:-o,i=e&R?o-t:o;c=[n,r,n,i],e&R&&c.push(a,i,0,o,-a,i),c.push(-n,i,-n,r),e&L&&c.push(-a,r,0,-o,a,r)}else{let t=e&I?-a+V:-a,n=e&F?a-V:a,r=e&L?-o+V:-o,i=e&R?o-V:o,s=(t+n)/2,l=(r+i)/2,u=Math.min(10,(n-t)/2),d=Math.min(10,(i-r)/2);c=[t,r],e&L&&c.push(s-u,r,s,-o,s+u,r),c.push(n,r),e&F&&c.push(n,l-d,a,l,n,l+d),c.push(n,i),e&R&&c.push(s+u,i,s,o,s-u,i),c.push(t,i),e&I&&c.push(t,l+d,-a,l,t,l-d)}let l=``;for(let e=0;e<c.length;e+=2)l+=(e?` `:``)+s(c[e])+`,`+s(c[e+1]);return`<polygon points="${l}" stroke-linejoin="round"${r}/>`}var ae=1e3;function W(e,t){if(e===0||!Number.isInteger(e))throw new _(`Columns must be an integer !== 0.`,`semantic`,{type:`block`});if(t<0||!Number.isInteger(t))throw new _(`Position must be a non-negative integer.`+t,`semantic`,{type:`block`});return e<0?{px:t,py:0}:{px:t%e,py:Math.floor(t/e)}}function G(e,t,n){let r=e.columns,i=[],a=0,o=0,s=0,c=0;for(let n of e.children){let{px:e,py:l}=W(r,a),u=n.span>=1?Math.min(n.span,ae):1;if(r>0&&u>r-e&&(u=r-e),n.span=u,n.col=e,n.row=l,a+=u,e+u>o&&(o=e+u),l===i.length&&i.push(0),n.children.length===0?i[l]=-1:i[l]>=0&&n.nh>i[l]&&(i[l]=n.nh),n.space)continue;let d=(n.nw-t*(u-1))/u;d>s&&(s=d),n.nh>c&&(c=n.nh)}let l=(i.length-1)*t;for(let e=0;e<i.length;e++)i[e]<0&&(i[e]=c),l+=i[e];e.cols=o,e.heights=i,e.nw=Math.max(e.nw,o*s+(o-1)*t+2*n),e.nh=l+2*n+e.head}function K(e,t,n){let{cols:r,heights:i}=e,a=i.length,o=(e.w-2*n-(r-1)*t)/r,s=e.h-2*n-e.head-(a-1)*t,c=0;for(let e of i)c+=e;let l=c>0?s/c:0,u=c>0?0:s/a,d=e.x-e.w/2+n,f=e.y-e.h/2+n+e.head,p=0;for(let n of e.children){for(;p<n.row;p++)f+=i[p]*l+u+t;n.w=o*n.span+t*(n.span-1),n.h=i[p]*l+u,n.x=d+n.col*(o+t)+n.w/2,n.y=f+n.h/2}}function oe(e,t){let n=[e];for(let e=0;e<n.length;e++)for(let t of n[e].children)n.push(t);for(let e=n.length-1;e>=0;e--){let r=n[e];r.children.length>0&&G(r,t,e===0?0:t)}e.w=e.nw,e.h=e.nh,e.x=e.w/2,e.y=e.h/2;for(let e=0;e<n.length;e++){let r=n[e];r.children.length>0&&K(r,t,e===0?0:t)}return{width:e.w,height:e.h}}var se=12,ce=200,q=8,le=` fill="var(--_s)" stroke="var(--_b)"`,ue=` stroke="var(--_b)"`,de=[],fe=[],pe=[],me=[`default`],he=2e6,ge=new Map([[`square`,`rect`],[`round`,`rounded`],[`circle`,`circle`],[`doublecircle`,`dbl-circ`],[`diamond`,`diam`],[`hexagon`,`hex`],[`stadium`,`stadium`],[`subroutine`,`fr-rect`],[`cylinder`,`cyl`],[`rect_left_inv_arrow`,`odd`],[`lean_right`,`lean-r`],[`lean_left`,`lean-l`],[`trapezoid`,`trap-b`],[`inv_trapezoid`,`trap-t`]]),_e=new Set([`circle`,`dbl-circ`,`diam`]),ve=new Set([`stadium`,`hex`,`odd`,`lean-r`,`lean-l`,`trap-b`,`trap-t`]);function J(e){return e.kind===0&&(e.shape===`circle`||e.shape===`dbl-circ`)}function Y(e,t,n){let r=e.bw/2,i=e.bh/2,a=Math.abs(t-e.x),o=i;return J(e)?o=Math.sqrt(Math.max(r*r-a*a,0)):e.kind===0&&e.shape===`diam`?o=i*Math.max(1-a/r,0):e.kind===0?o=i-g(e.shape,e.bw,e.bh,n>0?2:0):e.kind===1&&U(e.mask)===`x`&&(o=i-z),e.y+n*o}function X(e,t,n){let r=e.bw/2,i=e.bh/2,a=Math.abs(t-e.y),o=r;return J(e)?o=Math.sqrt(Math.max(i*i-a*a,0)):e.kind===0&&e.shape===`diam`?o=r*Math.max(1-a/i,0):e.kind===0?o=r-g(e.shape,e.bw,e.bh,n>0?1:3):e.kind===1&&U(e.mask)===`y`&&(o=r-z),e.x+n*o}function Z(e,t,n,r){let i=t-e.x,a=n-e.y,o=e.bw/2,s=e.bh/2,c;c=J(e)?o/(Math.hypot(i,a)||1):e.kind===0&&e.shape===`diam`?1/(Math.abs(i)/o+Math.abs(a)/s||1):Math.min(i===0?1/0:o/Math.abs(i),a===0?1/0:s/Math.abs(a)),c===1/0&&(c=0),r.push(e.x+i*c,e.y+a*c)}function ye(e,t,n,r,i){let a=i.x-i.bw/2+1,o=i.x+i.bw/2-1,s=i.y-i.bh/2+1,c=i.y+i.bh/2-1;if(e<a&&n<a||e>o&&n>o||t<s&&r<s||t>c&&r>c)return!1;if(e===n||t===r)return!0;let l=n-e,u=r-t,d=(n,r)=>Math.sign(l*(r-t)-u*(n-e)),f=d(a,s);return f===0||d(o,s)!==f||d(o,c)!==f||d(a,c)!==f}function Q(e,t,n,r){let i=0;for(let a of r)if(a!==t&&a!==n){for(let t=0;t+3<e.length;t+=2)if(ye(e[t],e[t+1],e[t+2],e[t+3],a)){i++;break}}return i}function be(e,t,n,r){let i=e.x-e.bw/2,a=e.x+e.bw/2,o=e.y-e.bh/2,s=e.y+e.bh/2,c=t.x-t.bw/2,l=t.x+t.bw/2,u=t.y-t.bh/2,d=t.y+t.bh/2,f=Math.max(i,c),p=Math.min(a,l),m=Math.max(o,u),h=Math.min(s,d),g=p-f>6,_=h-m>6;if(g&&_){let n=e.bw*e.bh<=t.bw*t.bh?e:t,r=n===e?t:e,i=n.y-n.bh/2-(r.y-r.bh/2),a=r.y+r.bh/2-(n.y+n.bh/2),o=n.x-n.bw/2-(r.x-r.bw/2),s=r.x+r.bw/2-(n.x+n.bw/2),c=Math.min(i,a,o,s),l;return l=c===a?[n.x,Y(n,n.x,1),n.x,r.y+r.bh/2]:c===i?[n.x,Y(n,n.x,-1),n.x,r.y-r.bh/2]:c===s?[X(n,n.y,1),n.y,r.x+r.bw/2,n.y]:[X(n,n.y,-1),n.y,r.x-r.bw/2,n.y],n===e?l:[l[2],l[3],l[0],l[1]]}if(g){let r=Math.min(6,(p-f)/2),i=Math.min(Math.max((f+p)/2+n,f+r),p-r),a=t.y>e.y?1:-1;return[i,Y(e,i,a),i,Y(t,i,-a)]}if(_){let r=Math.min(6,(h-m)/2),i=Math.min(Math.max((m+h)/2+n,m+r),h-r),a=t.x>e.x?1:-1;return[X(e,i,a),i,X(t,i,-a),i]}let v=t.x>e.x?1:-1,y=t.y>e.y?1:-1,b=[X(e,e.y,v),e.y,t.x,e.y,t.x,Y(t,t.x,-y)],x=[e.x,Y(e,e.x,y),e.x,t.y,X(t,t.y,-v),t.y],S=Math.abs(t.x-e.x)>=Math.abs(t.y-e.y),C=S?b:x;if(r===void 0)return C;let w=Q(C,e,t,r);if(w===0)return C;let T=S?x:b,E=Q(T,e,t,r);if(E<w&&(C=T,w=E),w===0)return C;let D=[];return Z(e,t.x,t.y,D),Z(t,e.x,e.y,D),Q(D,e,t,r)<w?D:C}function xe(e,t,n){let r=e.length,i=e[0],a=e[1],o=e[r-2],c=e[r-1],l=e[2]-i,u=e[3]-a,d=Math.hypot(l,u);l/=d||1,u/=d||1;let f=o-e[r-4],p=c-e[r-3],m=Math.hypot(f,p);if(f/=m||1,p/=m||1,r===4&&t+n>d){let e=d/(t+n);t*=e,n*=e}t=Math.min(t,d),n=Math.min(n,m);let h=`M${s(i+l*t)},${s(a+u*t)}`;if(r===6){let r=Math.max(0,Math.min(q,d-t,m-n));h+=`L${s(e[2]-l*r)},${s(e[3]-u*r)}Q${s(e[2])},${s(e[3])} ${s(e[2]+f*r)},${s(e[3]+p*r)}`}return h+=`L${s(o-f*n)},${s(c-p*n)}`,{d:h,sx:i,sy:a,sdx:-l,sdy:-u,ex:o,ey:c,edx:f,edy:p}}function Se(e,t){let n=e.bw/2,r=e.bh/2,i=Math.max(1,Math.min(10+5*(t-1),n,r));if(J(e)){let t=e.x+n*Math.SQRT1_2,r=e.y-n*Math.SQRT1_2,a=2*Math.asin(Math.min(1,i/(2*n))),o=i=>Math.atan2(e.y-n*Math.sin(i)-r,e.x+n*Math.cos(i)-t);return[t,r,i,o(Math.PI/4+a),o(Math.PI/4-a)]}if(e.kind===0&&e.shape===`diam`){let t=Math.atan2(r,n);return[e.x+n/2,e.y-r/2,i,t+Math.PI,t]}return[e.x+n,e.y-r,i,Math.PI,Math.PI/2]}function Ce(e,t,n,r){let[i,a,o,c,l]=Se(e,t),u=c+n/o,d=l-r/o,f=(d-u)%(2*Math.PI);f<=0&&(f+=2*Math.PI);let p=i+o*Math.cos(u),m=a+o*Math.sin(u),h=i+o*Math.cos(d),g=a+o*Math.sin(d),_=i+o*Math.cos(c),v=a+o*Math.sin(c),y=i+o*Math.cos(l),b=a+o*Math.sin(l),x=Math.hypot(_-p,v-m),S=Math.hypot(y-h,b-g);return{d:`M${s(p)},${s(m)}A${s(o)},${s(o)} 0 ${+(f>Math.PI)} 1 ${s(h)},${s(g)}`,sx:_,sy:v,sdx:x>0?(_-p)/x:Math.sin(c),sdy:x>0?(v-m)/x:-Math.cos(c),ex:y,ey:b,edx:S>0?(y-h)/S:-Math.sin(l),edy:S>0?(b-g)/S:Math.cos(l)}}var $=[.5,.3,.7,.15,.85];function we(e,t,n,r,i,a,o){if(o===void 0)return .5;for(let s of $){let c=e[t]+(e[t+2]-e[t])*s,l=e[t+1]+(e[t+3]-e[t+1])*s,u=!0;for(let e of o)if(e!==i&&e!==a&&Math.abs(c-e.x)<(n+e.bw)/2&&Math.abs(l-e.y)<(r+e.bh)/2){u=!1;break}if(u)return s}return .5}function Te(e,t,n){return c(n,r=>Ee(e,t,n,r))}function Ee(c,g,_,v){let y=_.fontSize??16,b=Math.round(y*.875),S=_.measurer??x(_.fontFamily,_.fontFamilyMono),C=_.padding??8,w=_.icons,T=g.block?.padding,E=Math.min(typeof T==`number`&&T>=0?Math.min(T,200):se,v?6:1/0),D=v?80:ce,O=e=>{let t=[],n=e=>{for(let n of e)for(let e of n.split(`;`))t.push(e)};for(let t of e.classes&&e.classes.length>0?e.classes:me){let e=c.classes.get(t);e&&n(e.styles)}return e.styles&&n(e.styles),a(t)},k=(e,t)=>{let n=e.type,r=n===`space`?a(de):O(e),i=+!!r.bold|(r.italic?2:0),s=r.fontSize??y,c=0,u=``,d,f=0,p=0,m=0,g=0,b=0,x=0;if(n===`space`)c=3,d=o(void 0,!1,S,s,D);else if(n===`composite`)c=2,d=o(e.label,!1,S,s,v?l(_):4e3,i),m=d.height>0?d.height+4:0,f=d.width+2*E,p=m+2*E;else if(n===`block_arrow`){c=1,d=o(e.label,!1,S,s,D,i);let t=!0;for(let e of d.lines)for(let n of e)(n.icon!==void 0||n.text.trim()!==``)&&(t=!1);g=ne(e.directions);let n=t?re(g,0,0):re(g,d.width,d.height);f=n.w,p=n.h,b=n.dx,x=n.dy}else{u=ge.get(n??``)??`rect`,d=o(e.label,!1,S,s,D,i);let t=h(u,d.width,d.height);f=t.w,p=u===`cyl`?Math.max(t.h,d.height+40):t.h,x=t.dy}return{children:[],columns:c===2?e.columns??-1:-1,span:c===3?1:e.widthInColumns??1,space:c===3,head:m,nw:f,nh:p,col:0,row:0,cols:0,heights:pe,x:0,y:0,w:0,h:0,block:e,kind:c,index:t,shape:u,label:d,style:r,mask:g,dx:b,dy:x,bw:0,bh:0}},A=k(c.root,0);A.nw=0,A.nh=0;let j=[A],M=new Map;for(let e=0;e<j.length;e++){let t=j[e];if(t.kind===2)for(let e of t.block.children??fe){let n=k(e,j.length);t.children.push(n),j.push(n),n.kind!==3&&M.set(e.id,n)}}let ee=oe(A,E),N=[];for(let e of j)e.kind===0&&_e.has(e.shape)?(e.bw=e.nw,e.bh=e.nh):e.kind===1?(e.bw=e.span>1?e.w:e.nw,e.bh=e.nh):(e.bw=e.w,e.bh=e.kind===0&&ve.has(e.shape)?e.nh:e.h),e.kind===0&&e.shape===`cyl`&&(e.dy=Math.min(12,Math.max(6,e.bw/14))/2),(e.kind===0||e.kind===1)&&N.push(e);let P=new Map,te=new Set,F=[],I=[];for(let e of c.edges){let t=M.get(e.start??``),n=M.get(e.end??``);if(t===void 0||n===void 0)continue;let r=Math.min(t.index,n.index)*j.length+Math.max(t.index,n.index);P.set(r,(P.get(r)??0)+1),e.label&&te.add(r),F.push([t,n]),I.push(e)}let L=I.length*N.length<=he?N:void 0,R=new Map,z=[],B=0,V=0,H=ee.width,U=ee.height,ae=(e,t,n,r)=>{e-n/2<B&&(B=e-n/2),e+n/2>H&&(H=e+n/2),t-r/2<V&&(V=t-r/2),t+r/2>U&&(U=t+r/2)};for(let e=0;e<I.length;e++){let[t,n]=F[e],r=Math.min(t.index,n.index)*j.length+Math.max(t.index,n.index),i=P.get(r)??1,a=R.get(r)??0;R.set(r,a+1);let s=o(I[e].label,!1,S,b,ce),c,l,u;if(t===n){let[e,n,r]=Se(t,a+1);c=[],ae(e,n,2*r+2,2*r+2),l=e+r+6+s.width/2,u=n-r/2}else{let e=te.has(r)?Math.round(b*1.5)+2:14;c=be(t,n,(a-(i-1)/2)*e,L);let o=c.length,d=Math.abs(c[2]-c[0])+Math.abs(c[3]-c[1]),f=Math.abs(c[o-2]-c[o-4])+Math.abs(c[o-1]-c[o-3]),p=o===6&&f>d?2:0,m=s.width>0?we(c,p,s.width+8,s.height,t,n,L):.5;l=c[p]+(c[p+2]-c[p])*m,u=c[p+1]+(c[p+3]-c[p+1])*m}s.width>0&&ae(l,u,s.width+8,s.height),z.push({edge:I[e],points:c,loop:t===n?a+1:0,label:s,lx:l,ly:u})}let W=p(c.title,S,y,v?l(_):4e3),G=W.height>0?W.height+12:0,K=Math.max(H-B,W.width),q=C-B+(K-(H-B))/2,J=C+G-V;for(let e of j)e.x+=q,e.y+=J;let Y=Math.ceil(K+2*C),X=Math.ceil(U-V+G+2*C),Z=``,ye=``;for(let e=1;e<j.length;e++){let a=j[e];if(a.kind===3)continue;let o=t((a.block.classes??de).join(` `)),c=r(a.block.id);if(a.kind===2){let e=a.y-a.h/2;Z+=`<g class="pele-cluster${o}" data-id="${c}"><rect x="${s(a.x-a.w/2)}" y="${s(e)}" width="${s(a.w)}" height="${s(a.h)}" fill="var(--_a)" fill-opacity="0.5" stroke="var(--_b)"${n(a.style.shape)}/>`+i(a.label,a.x,e+(a.head+E)/2+2,` class="pele-cluster-label" fill="var(--_m)"${a.style.text}`,w)+`</g>`;continue}let l=a.kind===1;ye+=`<g class="pele-node pele-shape-${l?`block-arrow`:a.shape}${o}" data-id="${c}" transform="translate(${s(a.x)},${s(a.y)})">`+(l?ie(a.mask,a.bw,a.bh,le+a.style.shape):m(a.shape,a.bw,a.bh,le+a.style.shape,ue+a.style.line))+i(a.label,a.dx,a.dy,` class="pele-label"${a.style.text}`,w)+`</g>`}let Q=``,$=``;for(let e=0;e<z.length;e++){let{edge:t,points:n,loop:i,label:a}=z[e],o=t.arrowTypeStart??``,s=t.arrowTypeEnd??``,c;if(i>0)c=Ce(F[e][0],i,u(o),u(s));else{for(let e=0;e<n.length;e+=2)n[e]+=q,n[e+1]+=J;c=xe(n,u(o),u(s))}let l=r(t.id);if(Q+=`<g class="pele-edge" data-id="${l}"><path d="${c.d}"${t.thickness===`thick`?` stroke-width="2.5"`:``}${t.pattern===`dotted`?` stroke-dasharray="3 4"`:``}/>`+f(o,c.sx,c.sy,c.sdx,c.sdy,`var(--_l)`)+f(s,c.ex,c.ey,c.edx,c.edy,`var(--_l)`)+`</g>`,a.width>0){let n=z[e].lx+q,r=z[e].ly+J;$+=d(t.id,a,n,r,``,w)}}return{svg:e(`block`,Y,X,y,_,c,i(W,Y/2,C+W.height/2,` class="pele-title" font-weight="var(--_tw)"`)+(Z?`<g class="pele-clusters">${Z}</g>`:``)+(Q?`<g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round">${Q}</g>`:``)+`<g class="pele-nodes">${ye}</g>`+($?`<g class="pele-edge-labels" font-size="${b}">${$}</g>`:``)),width:Y,height:X,links:[]}}var De={type:`block`,math:!0,parse(e,t,n){let r=new k;return r.title=n,te(e,r),r},render:Te};export{De as block};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as e,f as t,m as n,p as r}from"
|
|
1
|
+
import{d as e,f as t,m as n,p as r}from"./-2Meesge.js";var i=/[&<>"\x00-\x08\x0b\x0c\x0e-\x1f\x7f\ud800-\udfff\ufffe\uffff]/u,a=/[&<>"]|[\x00-\x08\x0b\x0c\x0e-\x1f\x7f\ud800-\udfff\ufffe\uffff]+/gu,o={"&":`&`,"<":`<`,">":`>`,'"':`"`},s=/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f\ud800-\udfff\ufffe\uffff]/u;function c(e){return i.test(e)?e.replace(a,e=>o[e]??``):e}function l(t){return c(e(t))}var u=[];for(let e=0;e<100;e++)u.push(e===0?``:e%10==0?`.`+e/10:`.`+(e<10?`0`+e:e));function d(e){let t=Math.round(e*100);if(t===0)return`0`;if(t>0){if(t<1e11){let e=Math.floor(t/100);return e+u[t-e*100]}}else if(t>-1e11){let e=-t,n=Math.floor(e/100);return`-`+n+u[e-n*100]}return String(t/100)}function f(e,t,n,r,i){let a=e.lines;if(a.length===0)return``;let o=e.lineHeight,s=e.heights,u=e.size*.35,f=n-e.height/2,p=a.length===1&&a[0].length===1?a[0][0]:void 0;if(p&&p.icon===void 0&&p.math===void 0&&p.style===0)return`<text${r} x="${d(t)}" y="${d(f+o/2+u)}" text-anchor="middle">${c(p.text)}</text>`;let m=T(e),h=r,g;r=E(r,m);let _=``,b=``;for(let n=0;n<a.length;n++){let r=a[n],p=s?s[n]:o,x=f+p/2,S=x+u,C=!1;for(let e of r)(e.icon!==void 0||e.math)&&(C=!0);if(C){let a=t-e.widths[n]/2;for(let t of r){if(t.math){let n=`x="${d(a)}" y="${d(x-t.math.height/2)}" width="${d(t.math.width)}" height="${d(t.math.height)}"`;g??=v(h),b+=g.halo===void 0?y(t.math,n,e.size,g.attrs):`<rect ${n} rx="2" fill="${g.halo}"/>`}else if(t.icon!==void 0){let n=e.size*1.1,r=i?.(t.icon)??``;b+=`<svg class="pele-icon" data-icon="${l(t.icon)}" x="${d(a)}" y="${d(x-n/2)}" width="${d(n)}" height="${d(n)}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${r}</svg>`}else t.text!==``&&(_+=`<tspan x="${d(a)}" y="${d(S)}" text-anchor="start"${w(t.style&~m)}>${c(t.text)}</tspan>`);a+=t.width}}else{for(let e=0;e<r.length;e++){let n=r[e],i=e===0?` x="${d(t)}" y="${d(S)}"`:``;_+=`<tspan${i}${w(n.style&~m)}>${c(n.text)}</tspan>`}r.length===0&&(_+=`<tspan x="${d(t)}" y="${d(S)}"> </tspan>`)}f+=p}return`<text${r} text-anchor="middle" xml:space="preserve">${_}</text>${b}`}var p=/ fill="([^"]*)"/,m=/ stroke="([^"]*)"/,h=/ style="([^"]*)"/,g=/(?:^|;)\s*fill:([^;]*)/,_=/(?:^|;)\s*opacity:([^;]*)/;function v(e){let t=h.exec(e)?.[1]??``,n=(g.exec(t)?.[1]??p.exec(e)?.[1]??``).trim();if(n===`none`)return{attrs:``,halo:m.exec(e)?.[1]??`none`};let r=_.exec(t)?.[1].trim();return{attrs:(n===``?``:` color="${n}"`)+(r?` opacity="${r}"`:``)}}function y(e,t,n,r){return`svg`in e?`<svg class="pele-math" ${t} overflow="visible"${r}>${e.svg}</svg>`:`<foreignObject class="pele-math" ${t} overflow="visible"${r}><div xmlns="http://www.w3.org/1999/xhtml" style="display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:${d(n)}px;line-height:normal;white-space:nowrap">${e.html}</div></foreignObject>`}var b=` font-weight="var(--_w)"`,x=` font-style="italic"`,S=` text-decoration="underline"`,C=` font-family="var(--_fm)"`,ee=` baseline-shift="sub" font-size="smaller"`,te=` baseline-shift="super" font-size="smaller"`;function w(e){return(e&1?b:``)+(e&2?x:``)+(e&4?C:``)+(e&32?S:``)+(e&8?ee:e&16?te:``)}function T(e){let t=7,n=!1;for(let r of e.lines)for(let e of r)e.icon!==void 0||e.text===``||(t&=e.style,n=!0);return n?t:0}function E(e,t){return e+(t&1&&!e.includes(` font-weight="`)?b:``)+(t&2&&!e.includes(` font-style="`)?x:``)+(t&4&&!e.includes(` font-family="`)?C:``)}var ne=1.5,D=1.3,re=/<br\s*\/?>|\\n|\n/gi,O=/<\/?([a-zA-Z][\w-]*)(?:\s[^<>]*)?\/?>/y,k=/(fa[bklrs]?):fa-([\w-]+)/g,A=/[<\\\n*_]|fa[bklrs]?:fa-/,j=new Map([[`b`,1],[`strong`,1],[`i`,2],[`em`,2],[`cite`,2],[`dfn`,2],[`var`,2],[`code`,4],[`kbd`,4],[`samp`,4],[`tt`,4],[`sub`,8],[`sup`,16],[`u`,32],[`ins`,32]]),ie=24,ae=new Set(`a abbr address article aside audio b bdi bdo big blockquote body br button caption center cite code col colgroup data dd del details dfn dialog div dl dt em embed fieldset figcaption figure font footer form h1 h2 h3 h4 h5 h6 head header hr html i iframe img input ins kbd label legend li link main map mark meta meter nav noscript object ol optgroup option output p picture pre progress q rp rt ruby s samp script section select small source span strike strong style sub summary sup table tbody td template textarea tfoot th thead time title tr track tt u ul var video wbr`.split(` `)),M=`\\u2e80-\\u9fff\\uf900-\\ufaff\\uff00-\\uff60`,N=`、。,.:;!?)]}」』】〕〉》〙〗ー…‥・ゝゞぁぃぅぇぉっゃゅょゎァィゥェォッャュョヮ,.:;!?)\\]}`,oe=`([{「『【〔〈《〘〖([{`,se=RegExp(`[${M}]`),P=`\\u200b\\u00ad`,ce=RegExp(`[${P}]`),le=RegExp(`\\s*(?:[${oe}]*[${M}][${N}]*|[^\\s${M}${P}]+[${P}]*[${N}]*|[${P}]+)\\s*|\\s+`,`g`),F=57344,I=6400,L=/\$\$(.+?)\$\$/g,R=/[\ue000-\uf8ff]/,z=/([\ue000-\uf8ff])/,B,V={lines:[],widths:[],width:0,height:0,size:0,lineHeight:0};function H(e){let t=e.split(`
|
|
2
2
|
`),n=1/0;for(let e of t){if(e.trim()===``)continue;let t=e.length-e.trimStart().length;t<n&&(n=t)}return n===1/0||n===0?e:t.map(e=>e.slice(Math.min(n,e.length-e.trimStart().length))).join(`
|
|
3
3
|
`)}function U(e){return e!==void 0&&e.icon===void 0&&e.math===void 0}function W(e,t,n){if(t!==``){if(B!==void 0&&R.test(t)){let r=B,i=t.split(z);for(let t=0;t<i.length;t++){if(t%2==0){i[t]!==``&&G(e,i[t],n);continue}let a=i[t].charCodeAt(0)-F,o=r.math[a];o?e.push({text:``,style:n,math:o,width:o.width}):G(e,`$$${r.tex[a]}$$`,n)}return}G(e,t,n)}}function G(t,n,r){let i=e(n),a=t[t.length-1];U(a)&&a.style===r?a.text+=i:t.push({text:i,style:r,width:0})}function ue(e,n,r){if(!n.includes(`:fa-`)){W(e,n,r);return}let i=0;k.lastIndex=0;let a;for(;(a=k.exec(n))!==null;){let o=`${a[1]}:fa-${a[2]}`;if(W(e,n.slice(i,a.index),r),i=a.index+a[0].length,t(o)!==``)e.push({text:``,style:r,icon:o,width:0});else if(n[i]===` `)i++;else if(i===n.length){let t=e[e.length-1];U(t)&&(t.text=t.text.trimEnd())}}W(e,n.slice(i),r)}function de(e,t,n,r,i){let a=i.style,o=0,s=``,c=0,l=t.length,u=()=>{ue(e,s,a|(i.shifts[i.shifts.length-1]??0)),s=``};for(;c<l;){let e=t[c];if(e===`<`){O.lastIndex=c;let e=O.exec(t);if(e&&e.index===c){let n=e[1].toLowerCase(),o=t[c+1]===`/`,s=j.get(n)??0;if(s&ie){u();let e=i.shifts.lastIndexOf(s);o?e!==-1&&i.shifts.splice(e,1):i.shifts.push(s)}else s&&(u(),i.style=o?i.style&~s|r&s:i.style|s,a=o?a&~s|r&s:a|s);if(s||ae.has(n)){c+=e[0].length;continue}}}else if(n&&(e===`*`||e===`_`)){let n=t[c+1]===e,i=n?1:2,s=n?2:1,d=(o&i)===0,f=c>0?t[c-1]:` `,p=c+s<l?t[c+s]:` `,m=d&&p.trim()!==``&&t.indexOf(n?e+e:e,c+s)!==-1,h=!d&&f.trim()!==``,g=e===`_`&&/\w/.test(f)&&/\w/.test(p);if((m||h)&&!g){u(),o=m?o|i:o&~i,a=m?a|i:a&~i|r&i,c+=s;continue}}s+=e,c++}u()}function fe(e,t,n){let r=0;for(let i of e)i.width=i.icon===void 0?i.math?i.math.width:t.width(i.text,n,i.style):n*1.25,r+=i.width;return r}function K(e,t,n,r,i,a){let o=[],s=0,c=(e=!1)=>{let r=o[o.length-1];if(U(r)){let i=r.text.trimEnd();if(e&&r.text.endsWith(``)&&(i=i.slice(0,-1)+`-`),i!==r.text){r.text=i;let e=t.width(i,n,r.style);s+=e-r.width,r.width=e}}i.push(o),a.push(s),o=[],s=0};for(let i of e){if(i.icon!==void 0||i.math){let e=i.math?i.math.width:n*1.25;s>0&&s+e>r&&c(),o.push({...i,width:e}),s+=e;continue}let a=i.text.match(le)??[],l=i.text.includes(``),u=l?a.length:0,d=new Float64Array(u),f=new Float64Array(u+1);for(let r=u-1;r>=0;r--){let o=a[r].endsWith(``),s=a[r].trimEnd();d[r]=t.width(o?s.slice(0,-1):s,n,i.style),f[r]=o?r===u-1?i===e[e.length-1]?d[r]:1/0:d[r]+f[r+1]:d[r]}for(let e=0;e<a.length;e++){let u=a[e],p=l?d[e]:t.width(u.trimEnd(),n,i.style),m=!l||!u.endsWith(``)?s+p<=r:s+t.width(u.slice(0,-1)+`-`,n,i.style)<=r||s+f[e]<=r;s>0&&!m&&(c(u.trimStart()===u),u=u.trimStart());let h=o[o.length-1];if(U(h)&&h.style===i.style){if(h.text+=u,p>0||u.trimEnd()!==u){let e=h.width;h.width=t.width(h.text,n,h.style),s+=h.width-e}}else{let e=t.width(u,n,i.style);o.push({text:u,style:i.style,width:e}),s+=e}}}(o.length>0||i.length===0)&&c()}function pe(t,i,a,o,s,c=0){if(t===void 0||t===``)return V;let l=Math.round(o*ne);if(r()&&t.includes(`$$`)&&!R.test(t)){let r={tex:[],math:[]},u=t.replace(L,(e,t)=>r.tex.length===I?e:(r.tex.push(t),String.fromCharCode(F+r.tex.length-1)));if(r.tex.length>0){for(let t of r.tex)r.math.push(n(e(t),o));return q(u,i,a,o,s,c,l,r)}}if(!A.test(t)&&!t.includes(`&`)&&!t.includes(`fl`)){let e=t.trim(),n=a.width(e,o,c);if(n<=s||!(e.includes(` `)||se.test(e)||ce.test(e)))return{lines:[[{text:e,style:c,width:n}]],widths:[n],width:n,height:l,size:o,lineHeight:l};let r=[],i=[];K([{text:e,style:c,width:n}],a,o,s,r,i);let u=0;for(let e of i)e>u&&(u=e);let d=r.length>1?Math.round(o*D):l;return{lines:r,widths:i,width:u,height:r.length*d,size:o,lineHeight:d}}return q(t,i,a,o,s,c,l)}function q(e,t,n,r,i,a,o,s){let c=B;B=s;try{let c=me(e,t,n,r,i,a,o);return s?J(c):c}finally{B=c}}function me(e,t,n,r,i,a,o){let s=t?H(e.replace(/\r\n?/g,`
|
|
4
4
|
`)).trim():e.trim(),c=[],l=[],u=0,d={style:a,shifts:[]};for(let e of s.split(re)){let o=[];de(o,e.trim(),t,a,d);let s=fe(o,n,r);s>i?K(o,n,r,i,c,l):(c.push(o),l.push(s))}for(let e of l)e>u&&(u=e);let f=c.length>1?Math.round(r*D):o;return{lines:c,widths:l,width:u,height:c.length*f,size:r,lineHeight:f}}function J(e){let t;for(let n=0;n<e.lines.length;n++){let r=e.lineHeight;for(let t of e.lines[n])t.math&&(r=Math.max(r,Math.ceil(t.math.height+e.size/4)));r!==e.lineHeight&&t===void 0&&(t=e.lines.map(()=>e.lineHeight)),t&&(t[n]=r)}if(t===void 0)return e.heights===void 0?e:{...e,heights:void 0,height:e.lines.length*e.lineHeight};let n=0;for(let e of t)n+=e;return{...e,heights:t,height:n}}function he(e){for(let t of e)if(t.math)return!0;return!1}function ge(e,t){let n=e.heights;if(!n)return(t+.5)*e.lineHeight;let r=0;for(let e=0;e<t;e++)r+=n[e];return r+n[t]/2}function _e(e,t){let n=e.widths[t],r=e.heights?e.heights[t]:e.lineHeight,i={lines:[e.lines[t]],widths:[n],width:n,height:r,size:e.size,lineHeight:e.lineHeight};return r!==e.lineHeight&&(i.heights=[r]),i}var ve=`--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_m:var(--pele-muted,#6e6e6e);--_l:var(--pele-line,#1f1f1f);--_s:var(--pele-surface,#f3f3f3);--_a:var(--pele-surface-alt,#e6e6e6);--_b:var(--pele-border,#8a8a8a);--_c:var(--pele-accent,#5b7bd5);color:var(--_fg)`,ye=`var(--_fm)`,be=`var(--pele-radius,4px)`,Y=` style="rx:var(--_r)"`;function xe(e){let t=e.indexOf(` style="`);return t<0?e+Y:`${e.slice(0,t+8)}rx:var(--_r);${e.slice(t+8)}`}var Se=`var(--pele-critical,#e45756)`,X=String.raw`(?:"[^"'\\\n<>{}();:@]*"|'[^"'\\\n<>{}();:@]*'|[\p{L}\p{N}_-][\p{L}\p{N}_ .-]*)`,Ce=new RegExp(String.raw`^\s*${X}(?:\s*,\s*${X})*\s*$`,`u`);function Z(e,t){return e&&Ce.test(e)?e:t}function we(e,t,n){return`;--_fm:var(--pele-font-mono,${Z(n,`monospace`)});font:${e}px sans-serif;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;font-family:var(--pele-font,${Z(t,`sans-serif`)})`}var Te=new Set([`fill`,`fill-opacity`,`stroke`,`stroke-width`,`stroke-dasharray`,`stroke-dashoffset`,`stroke-linecap`,`stroke-linejoin`,`stroke-opacity`,`opacity`,`rx`,`ry`]),Ee=new Set([`color`,`font-size`,`font-family`,`font-weight`,`font-style`,`text-decoration`,`letter-spacing`,`word-spacing`,`opacity`]),De=/url\s*\(|expression\s*\(|javascript:|[<>{};\\]|@import|image-set|\/\*/i,Q={shape:``,line:``,text:``,stroke:void 0,bold:!1,italic:!1,fontSize:void 0};function $(e){if(e.length===0)return Q;let t=new Map,n=new Map;for(let r of e){let e=r.indexOf(`:`);if(e<=0)continue;let i=r.slice(0,e).trim().toLowerCase(),a=r.slice(e+1).replace(/!important/gi,``).trim();a===``||De.test(a)||s.test(a)||(Te.has(i)&&t.set(i,a),Ee.has(i)&&n.set(i===`color`?`fill`:i,a))}if(t.size===0&&n.size===0)return Q;let r=``,i=``;for(let[e,n]of t)r+=`${e}:${n};`,e!==`fill`&&e!==`fill-opacity`&&(i+=`${e}:${n};`);let a=``;for(let[e,t]of n)a+=`${e}:${t};`;let o=n.get(`font-weight`),l=n.get(`font-size`),u=l&&/^[\d.]+(px)?$/.test(l)?parseFloat(l):void 0;return{shape:r?` style="${c(r)}"`:``,line:i?` style="${c(i)}"`:``,text:a?` style="${c(a)}"`:``,stroke:t.get(`stroke`),bold:o===`bold`||o===`bolder`||Number(o)>=600,italic:n.get(`font-style`)===`italic`,fontSize:u!==void 0&&u>0&&u<=200?u:void 0}}var Oe=/[^\w-]+/g;function ke(e){let t=e.replace(Oe,` `).trim();return t===``?``:` `+t}var Ae=[`#4c78a8`,`#f58518`,`#54a24b`,`#e45756`,`#72b7b2`,`#eeca3b`,`#b279a2`,`#9d755d`];function je(e){let t=(e%8+8)%8;return`var(--pele-series-${t+1},${Ae[t]})`}var Me=[[`tw`,`title`],[`hw`,`heading`],[`w`,`bold`]],Ne=/var\(--_(r|tw|hw|w)\)/g;function Pe(e,t,n,r,i,a,o){let s=c(i.idPrefix??`pele`),u=``,d=``;a.accTitle&&(u+=`<title id="${s}-title">${l(a.accTitle)}</title>`,d+=` aria-labelledby="${s}-title"`),a.accDescr&&(u+=`<desc id="${s}-desc">${l(a.accDescr)}</desc>`,d+=` aria-describedby="${s}-desc"`);let f=i.responsive===!1?``:`max-width:100%;height:auto;`,p=new Set;for(let[,e]of o.matchAll(Ne))if(p.add(e),p.size===4)break;let m=p.has(`r`)?`;--_r:${be}`:``;for(let[e,t]of Me)p.has(e)&&(m+=`;--_${e}:var(--pele-${t}-weight,bold)`);return`<svg xmlns="http://www.w3.org/2000/svg" class="pele pele-${e}" viewBox="0 0 ${t} ${n}" width="${t}" height="${n}" style="${f}${ve}${m}${c(we(r,i.fontFamily,i.fontFamilyMono))}" fill="var(--_fg)" role="graphics-document document" aria-roledescription="${e}"${d}>`+u+o+`</svg>`}export{Pe as _,c as a,ke as b,T as c,xe as d,je as f,Se as g,J as h,l as i,ye as l,w as m,s as n,f as o,ge as p,Y as r,$ as s,E as t,pe as u,he as v,d as x,_e as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as e,x as t}from"./CX-xckzu.js";var n=12,r=(e,t,r)=>(r?t:e)-2*n,i=e=>(t,r,i)=>i?0:t-2*e(r)-2*n;function a(e,t,n){let r=Math.min(1,Math.abs(e)/t);return n*(1-Math.sqrt(1-r*r))}var o=(e,t,n,r)=>n&1?a(r,t/2,e/2):a(r,e/2,t/2),s=(e,t,n)=>(n?t:e)*.6,c=(e,t,n,r)=>n&1?0:a(r,e/2,Math.min(12,Math.max(6,e/14))),l=(e,t)=>()=>({w:e,h:t,dy:0});function u(e,t,n){let r=Math.max(1.6*e+40,80),i=(t+10)/(1-(e+8)/r),a=i/2-10-t/2;return{w:r,h:i,dy:n?-a:a}}function d(e,t){return`<path d="${e}"${t}/>`}var f=(e,t,n)=>n&1?t/8:0,p=(e,t)=>({w:Math.max(e+36,48),h:t+24,dy:0});function m(e,n){let r=``;for(let n=0;n<e.length;n+=2)r+=(n?` `:``)+t(e[n])+`,`+t(e[n+1]);return`<polygon points="${r}"${n}/>`}function h(e,n,r,i=``){return`<rect x="${t(-e/2)}" y="${t(-n/2)}" width="${t(e)}" height="${t(n)}"${i}${r}/>`}var g={rect:{size:p,span:r,draw:(t,n,r)=>h(t,n,e(r))},rounded:{size:p,span:r,draw:(e,n,r)=>h(e,n,r,` rx="${t(Math.min(12,n/2))}"`)},stadium:{inset:(e,t,n,r)=>n&1?a(r,t/2,t/2):0,span:(e,t,n)=>n?t*.6:e-t,size:(e,t)=>{let n=t+24;return{w:e+n*.5+36-8,h:n,dy:0}},draw:(e,n,r)=>h(e,n,r,` rx="${t(n/2)}"`)},"fr-rect":{span:r,size:(e,t)=>({w:e+36+16,h:t+24,dy:0}),draw:(n,r,i,a)=>{let o=n/2-8;return h(n,r,e(i))+`<path d="M${t(-o)},${t(-r/2)}V${t(r/2)}M${t(o)},${t(-r/2)}V${t(r/2)}" fill="none"${a}/>`}},cyl:{inset:c,span:(e,t,r)=>r?t-2*n-12:e*.6,size:(e,t)=>{let n=Math.max(e+36,56),r=Math.min(12,Math.max(6,n/14));return{w:n,h:t+24+2*r,dy:r/2}},draw:(e,n,r,i)=>{let a=e/2,o=Math.min(12,Math.max(6,e/14)),s=-n/2+o,c=n/2-o;return`<path d="M${t(-a)},${t(s)}A${t(a)},${t(o)} 0 0 1 ${t(a)},${t(s)}V${t(c)}A${t(a)},${t(o)} 0 0 1 ${t(-a)},${t(c)}Z"${r}/><path d="M${t(-a)},${t(s)}A${t(a)},${t(o)} 0 0 0 ${t(a)},${t(s)}" fill="none"${i}/>`}},circle:{inset:o,span:s,size:(e,t)=>{let n=Math.max(Math.sqrt(e*e+t*t)+16,44);return{w:n,h:n,dy:0}},draw:(e,n,r)=>`<circle r="${t(e/2)}"${r}/>`},"dbl-circ":{inset:o,span:s,size:(e,t)=>{let n=Math.max(Math.sqrt(e*e+t*t)+26,54);return{w:n,h:n,dy:0}},draw:(e,n,r,i)=>`<circle r="${t(e/2)}"${r}/><circle r="${t(e/2-5)}" fill="none"${i}/>`},ellipse:{inset:o,span:s,size:(e,t)=>({w:e*1.3+36,h:t*1.2+24,dy:0}),draw:(e,n,r)=>`<ellipse rx="${t(e/2)}" ry="${t(n/2)}"${r}/>`},diam:{inset:(e,t,n,r)=>n&1?Math.abs(r)*e/t:Math.abs(r)*t/e,span:(e,t,n)=>(n?t:e)*.6,size:(e,t)=>{let n=e+16,r=t+8;return{w:n+1.6*r,h:n/1.6+r,dy:0}},draw:(e,t,n)=>m([0,-t/2,e/2,0,0,t/2,-e/2,0],n)},hex:{inset:(e,t,n,r)=>n&1?Math.abs(r)/2:0,span:(e,t,r)=>r?t*.5:e-t/2-n,size:(e,t)=>{let n=t+24;return{w:e+36+n/2,h:n,dy:0}},draw:(e,t,n)=>{let r=t/4;return m([-e/2+r,-t/2,e/2-r,-t/2,e/2,0,e/2-r,t/2,-e/2+r,t/2,-e/2,0],n)}},odd:{inset:(e,t,n)=>n===3?t/4:0,span:i(()=>0),size:(e,t)=>{let n=t+24;return{w:e+36+n/4,h:n,dy:0}},draw:(e,t,n)=>{let r=t/4;return m([-e/2,-t/2,e/2,-t/2,e/2,t/2,-e/2,t/2,-e/2+r,0],n)}},"lean-r":{inset:f,span:i(e=>e/4),size:(e,t)=>{let n=t+24;return{w:e+36+n/2,h:n,dy:0}},draw:(e,t,n)=>{let r=t/4;return m([-e/2+r,-t/2,e/2,-t/2,e/2-r,t/2,-e/2,t/2],n)}},"lean-l":{inset:f,span:i(e=>e/4),size:(e,t)=>{let n=t+24;return{w:e+36+n/2,h:n,dy:0}},draw:(e,t,n)=>{let r=t/4;return m([-e/2,-t/2,e/2-r,-t/2,e/2,t/2,-e/2+r,t/2],n)}},"trap-b":{inset:f,span:i(e=>e/4),size:(e,t)=>{let n=t+24;return{w:e+36+n/2,h:n,dy:0}},draw:(e,t,n)=>{let r=t/4;return m([-e/2+r,-t/2,e/2-r,-t/2,e/2,t/2,-e/2,t/2],n)}},"trap-t":{inset:f,span:i(e=>e/4),size:(e,t)=>{let n=t+24;return{w:e+36+n/2,h:n,dy:0}},draw:(e,t,n)=>{let r=t/4;return m([-e/2,-t/2,e/2,-t/2,e/2-r,t/2,-e/2+r,t/2],n)}},text:{span:r,size:(e,t)=>({w:e+8,h:t+8,dy:0}),draw:(e,t)=>h(e,t,` fill="none" stroke="none"`)},"sm-circ":{noLabel:!0,inset:o,span:s,size:l(14,14),draw:(e,n,r)=>`<circle r="${t(e/2)}"${r}/>`},"f-circ":{noLabel:!0,inset:o,span:s,size:l(14,14),draw:(e,n,r,i)=>`<circle r="${t(e/2)}" fill="var(--_l)"${i}/>`},"fr-circ":{noLabel:!0,inset:o,span:s,size:l(18,18),draw:(e,n,r,i)=>`<circle r="${t(e/2)}"${r}/><circle r="${t(e/2-4)}" fill="var(--_l)"${i}/>`},fork:{noLabel:!0,span:(e,t,n)=>(n?t:e)-8,size:l(72,8),draw:(e,t,n,r)=>h(e,t,` fill="var(--_l)"${r}`,` rx="2"`)},"notch-rect":{size:p,span:r,draw:(e,t,n)=>m([-e/2+10,-t/2,e/2,-t/2,e/2,t/2,-e/2,t/2,-e/2,-t/2+10],n)},"lin-rect":{span:r,size:(e,t)=>({w:e+36+8,h:t+24,dy:0}),draw:(n,r,i,a)=>h(n,r,e(i))+`<path d="M${t(-n/2+8)},${t(-r/2)}V${t(r/2)}" fill="none"${a}/>`},"div-rect":{span:r,size:(e,t)=>({w:e+36,h:t+24+8,dy:4}),draw:(n,r,i,a)=>h(n,r,e(i))+`<path d="M${t(-n/2)},${t(-r/2+8)}H${t(n/2)}" fill="none"${a}/>`},"win-pane":{span:r,size:(e,t)=>({w:e+36+8,h:t+24+8,dy:4}),draw:(n,r,i,a)=>h(n,r,e(i))+`<path d="M${t(-n/2+8)},${t(-r/2)}V${t(r/2)}M${t(-n/2)},${t(-r/2+8)}H${t(n/2)}" fill="none"${a}/>`},tri:{inset:(e,t,n)=>n&1?e/4:0,size:(e,t)=>u(e,t,!1),draw:(e,t,n)=>m([0,-t/2,e/2,t/2,-e/2,t/2],n)},"flip-tri":{inset:(e,t,n)=>n&1?e/4:0,size:(e,t)=>u(e,t,!0),draw:(e,t,n)=>m([-e/2,-t/2,e/2,-t/2,0,t/2],n)},"sl-rect":{inset:(e,t,n)=>n===0?5:0,size:(e,t)=>({w:e+36,h:t+24+10,dy:5}),draw:(e,t,n)=>m([-e/2,-t/2+10,e/2,-t/2,e/2,t/2,-e/2,t/2],n)},"notch-pent":{span:r,size:(e,t)=>({w:e+36,h:t+24,dy:0}),draw:(e,t,n)=>m([-e/2+10,-t/2,e/2-10,-t/2,e/2,-t/2+10,e/2,t/2,-e/2,t/2,-e/2,-t/2+10],n)},hourglass:{noLabel:!0,inset:(e,t,n)=>n&1?e/2:0,size:l(32,40),draw:(e,t,n)=>m([-e/2,-t/2,e/2,-t/2,-e/2,t/2,e/2,t/2],n)},delay:{size:(e,t)=>{let n=t+24;return{w:e+36+n/4,h:n,dy:0}},draw:(e,n,r)=>{let i=n/2;return`<path d="M${t(-e/2)},${t(-i)}H${t(e/2-i)}A${t(i)},${t(i)} 0 0 1 ${t(e/2-i)},${t(i)}H${t(-e/2)}Z"${r}/>`}},"h-cyl":{size:(e,t)=>{let n=t+24,r=Math.min(12,n/4);return{w:e+36+2*r,h:n,dy:0}},draw:(e,n,r,i)=>{let a=n/2,o=Math.min(12,n/4),s=-e/2+o,c=e/2-o;return`<path d="M${t(s)},${t(-a)}H${t(c)}A${t(o)},${t(a)} 0 0 1 ${t(c)},${t(a)}H${t(s)}A${t(o)},${t(a)} 0 0 1 ${t(s)},${t(-a)}Z"${r}/><path d="M${t(c)},${t(-a)}A${t(o)},${t(a)} 0 0 0 ${t(c)},${t(a)}" fill="none"${i}/>`}},"cross-circ":{noLabel:!0,inset:o,span:s,size:l(44,44),draw:(e,n,r,i)=>{let a=e/2,o=a*Math.SQRT1_2;return`<circle r="${t(a)}"${r}/><path d="M${t(-o)},${t(-o)}L${t(o)},${t(o)}M${t(o)},${t(-o)}L${t(-o)},${t(o)}" fill="none"${i}/>`}},"st-rect":{span:(e,t,r)=>(r?t:e)-2*n-8,size:(e,t)=>({w:e+36+8,h:t+24+8,dy:4}),draw:(n,r,i)=>{let a=n-8,o=r-8,s=``;for(let c=0;c<3;c++){let l=-n/2+(2-c)*4,u=-r/2+c*4;s+=`<rect x="${t(l)}" y="${t(u)}" width="${t(a)}" height="${t(o)}"${e(i)}/>`}return s}},doc:{inset:(e,t,n)=>n===2?10:0,size:(e,t)=>({w:e+36,h:t+24+10,dy:-5}),draw:(e,t,n)=>v(e,t,n)},flag:{inset:(e,t,n)=>n&1?0:8,size:(e,t)=>({w:e+36,h:t+24+16,dy:0}),draw:(e,n,r)=>{let i=e/2,a=n/2-8,o=e/4;return`<path d="M${t(-i)},${t(-a)}q${t(o)},-10 ${t(2*o)},0t${t(2*o)},0V${t(a)}q${t(-o)},10 ${t(-2*o)},0t${t(-2*o)},0Z"${r}/>`}},datastore:{size:p,span:r,draw:(e,n,r,i)=>h(e,n,r.replace(`stroke="var(--_b)"`,`stroke="none"`))+`<path d="M${t(-e/2)},${t(-n/2)}H${t(e/2)}M${t(-e/2)},${t(n/2)}H${t(e/2)}" fill="none"${i}/>`},folder:{size:(e,t)=>({w:Math.max(e+36,64),h:t+24+8,dy:4}),draw:(e,n,r)=>{let i=e/2,a=n/2,o=Math.min(e*.4,48);return d(`M${t(-i)},${t(-a)}H${t(-i+o)}L${t(-i+o+8)},${t(-a+8)}H${t(i)}V${t(a)}H${t(-i)}Z`,r)}},bucket:{size:(e,t)=>({w:e+36+20,h:t+24+10,dy:3}),inset:(e,t,n)=>n&1?t/12:0,draw:(e,n,r,i)=>{let a=e/2,o=n/2,s=n/6;return d(`M${t(-a)},${t(-o+5)}A${t(a)},${t(5)} 0 0 1 ${t(a)},${t(-o+5)}L${t(a-s)},${t(o-5)}A${t(a-s)},${t(5)} 0 0 1 ${t(-a+s)},${t(o-5)}Z`,r)+`<path d="M${t(-a)},${t(-o+5)}A${t(a)},${t(5)} 0 0 0 ${t(a)},${t(-o+5)}" fill="none"${i}/>`}},console:{span:r,size:(e,t)=>({w:Math.max(e+36,72),h:t+24+12,dy:6}),draw:(n,r,i,a)=>h(n,r,e(i))+`<path d="M${t(-n/2)},${t(-r/2+12)}H${t(n/2)}M${t(-n/2+7)},${t(-r/2+4)}l3,2.5l-3,2.5M${t(-n/2+13)},${t(-r/2+9)}h4" fill="none"${a}/>`},browser:{span:r,size:(e,t)=>({w:Math.max(e+36,72),h:t+24+12,dy:6}),draw:(n,r,i,a)=>{let o=``;for(let e=0;e<3;e++)o+=`<circle cx="${t(-n/2+8+e*7)}" cy="${t(-r/2+6)}" r="1.5" fill="none"${a}/>`;return h(n,r,e(i))+`<path d="M${t(-n/2)},${t(-r/2+12)}H${t(n/2)}" fill="none"${a}/>`+o}},person:{size:(e,t)=>({w:Math.max(e+36,56),h:t+24+26,dy:13}),draw:(e,n,r)=>{let i=-n/2;return`<rect x="${t(-e/2)}" y="${t(i+26)}" width="${t(e)}" height="${t(n-26)}" rx="12"${r}/><circle cy="${t(i+14)}" r="13"${r}/>`}},bang:{size:(e,t)=>({w:e+36+28,h:t+24+24,dy:0}),inset:()=>3,draw:(e,t,n)=>{let r=[];for(let n=0;n<28;n++){let i=Math.PI*n/14-Math.PI/2,a=n%2==0?1:.82;r.push(e/2*Math.cos(i)*a,t/2*Math.sin(i)*a)}return m(r,n)}},cloud:{size:(e,t)=>({w:e+36+32,h:t+24+24,dy:0}),inset:(e,t,n)=>n&1?2:1,draw:(e,n,r)=>{let i=e/2,a=n/2,o=a*.55;return d(`M${t(-i+o)},${t(a)}A${t(o)},${t(o)} 0 0 1 ${t(-i+o*.6)},${t(-a*.1)}A${t(i*.42)},${t(a*.7)} 0 0 1 ${t(-i*.1)},${t(-a*.72)}A${t(i*.4)},${t(a*.62)} 0 0 1 ${t(i*.62)},${t(-a*.42)}A${t(o*1.05)},${t(o*1.05)} 0 0 1 ${t(i-o)},${t(a)}Z`,r)}},brace:{size:(e,t)=>({w:e+36+12,h:t+24,dy:0}),draw:(e,t,n,r)=>h(e,t,` fill="none" stroke="none"`)+_(-e/2+12,t,-1,r)},"brace-r":{size:(e,t)=>({w:e+36+12,h:t+24,dy:0}),draw:(e,t,n,r)=>h(e,t,` fill="none" stroke="none"`)+_(e/2-12,t,1,r)},braces:{size:(e,t)=>({w:e+36+24,h:t+24,dy:0}),draw:(e,t,n,r)=>h(e,t,` fill="none" stroke="none"`)+_(-e/2+12,t,-1,r)+_(e/2-12,t,1,r)},bolt:{noLabel:!0,size:l(36,56),inset:(e,t,n)=>n&1?e/4:0,draw:(e,t,n)=>m([e*.15,-t/2,-e/2,t*.08,-e*.05,t*.08,-e*.15,t/2,e/2,-t*.08,e*.05,-t*.08],n)},"lin-cyl":{inset:c,span:(e,t,r)=>r?t-2*n-20:e*.6,size:(e,t)=>{let n=Math.max(e+36,56),r=Math.min(12,Math.max(6,n/14));return{w:n,h:t+24+2*r+8,dy:r/2+4}},draw:(e,n,r,i)=>{let a=e/2,o=Math.min(12,Math.max(6,e/14)),s=-n/2+o,c=n/2-o,l=e=>`M${t(-a)},${t(e)}A${t(a)},${t(o)} 0 0 0 ${t(a)},${t(e)}`;return d(`M${t(-a)},${t(s)}A${t(a)},${t(o)} 0 0 1 ${t(a)},${t(s)}V${t(c)}A${t(a)},${t(o)} 0 0 1 ${t(-a)},${t(c)}Z`,r)+`<path d="${l(s)}${l(s+8)}" fill="none"${i}/>`}},"curv-trap":{size:(e,t)=>{let n=t+24;return{w:e+36+n*.6,h:n,dy:0}},draw:(e,n,r)=>{let i=e/2,a=n/2,o=n*.3;return d(`M${t(-i+o)},${t(-a)}H${t(i-o)}A${t(o)},${t(a)} 0 0 1 ${t(i-o)},${t(a)}H${t(-i+o)}L${t(-i)},0Z`,r)}},docs:{size:(e,t)=>({w:e+36+8,h:t+24+18,dy:-1}),inset:(e,t,n)=>n===2?10:0,draw:(e,t,n)=>{let r=``;for(let i=0;i<3;i++)r+=`<g transform="translate(${(1-i)*4},${(i-1)*4})">${v(e-8,t-8,n)}</g>`;return r}},"bow-rect":{size:(e,t)=>{let n=t+24;return{w:e+36+n*.4,h:n,dy:0}},inset:(e,t,n)=>n===1?t*.2:0,draw:(e,n,r)=>{let i=e/2,a=n/2,o=n*.2;return d(`M${t(-i+o)},${t(-a)}H${t(i)}A${t(o)},${t(a)} 0 0 0 ${t(i)},${t(a)}H${t(-i+o)}A${t(o)},${t(a)} 0 0 1 ${t(-i+o)},${t(-a)}Z`,r)}},"tag-rect":{size:p,span:r,draw:(n,r,i,a)=>h(n,r,e(i))+`<path d="M${t(n/2-12)},${t(r/2)}L${t(n/2)},${t(r/2-12)}" fill="none"${a}/>`},"tag-doc":{size:(e,t)=>({w:e+36,h:t+24+10,dy:-5}),inset:(e,t,n)=>n===2?10:0,draw:(e,n,r,i)=>v(e,n,r)+`<path d="M${t(e/2-12)},${t(n/2-14)}L${t(e/2)},${t(n/2-26)}" fill="none"${i}/>`},"lin-doc":{size:(e,t)=>({w:e+36+8,h:t+24+10,dy:-5}),inset:(e,t,n)=>n===2?10:0,draw:(e,n,r,i)=>v(e,n,r)+`<path d="M${t(-e/2+8)},${t(-n/2)}V${t(n/2-6)}" fill="none"${i}/>`},collapsedGroup:{size:(e,t)=>({w:e+36+8,h:t+24+8,dy:-2}),draw:(n,r,i)=>`<rect x="${t(-n/2+6)}" y="${t(-r/2+8)}" width="${t(n-12)}" height="${t(r-8)}"${e(i)}/><rect x="${t(-n/2)}" y="${t(-r/2)}" width="${t(n)}" height="${t(r-4)}"${e(i)}/>`}};function _(e,n,r,i){let a=n/2,o=6*r;return`<path d="M${t(e)},${t(-a)}q${t(o)},0 ${t(o)},6V-6q0,6 ${t(o)},6q${t(-o)},0 ${t(-o)},6V${t(a-6)}q0,6 ${t(-o)},6" fill="none"${i}/>`}function v(e,n,r){let i=e/2,a=-n/2,o=n/2-10,s=e/4;return`<path d="M${t(-i)},${t(a)}H${t(i)}V${t(o)}q${t(-s)},-12 ${t(-2*s)},0t${t(-2*s)},0Z"${r}/>`}var y=g.rect,b=new Map(Object.entries(g));function x(e,t,n){return(b.get(e)??y).size(t,n)}function S(e,t,n,r,i){return(b.get(e)??y).draw(t,n,r,i)}function C(e,t,n,r,i=0){return b.get(e)?.inset?.(t,n,r,i)??0}function w(e,t,n,r){return Math.max(0,b.get(e)?.span?.(t,n,r)??0)}function T(e){return b.get(e)?.noLabel!==!0}function E(e,t,n){let r=e[t]-n.x,i=e[t+1]-n.y;return Math.abs(Math.abs(i)-n.h/2)<.5?i<0?0:2:Math.abs(Math.abs(r)-n.w/2)<.5?r<0?3:1:-1}function D(e,t,n,r){if(r.isGroup)return;let i=E(e,t,r);if(i===0||i===2){let a=C(n.shape,n.w,n.h,i,e[t]-r.x)+(r.h-n.h)/2;e[t+1]+=i===0?a:-a}else if(i>=0){let a=C(n.shape,n.w,n.h,i,e[t+1]-r.y)+(r.w-n.w)/2;e[t]+=i===3?a:-a}}export{S as a,x as i,E as n,C as o,w as r,T as s,D as t};
|
|
1
|
+
import{d as e,x as t}from"./DfCZPwp1.js";var n=12,r=(e,t,r)=>(r?t:e)-2*n,i=e=>(t,r,i)=>i?0:t-2*e(r)-2*n;function a(e,t,n){let r=Math.min(1,Math.abs(e)/t);return n*(1-Math.sqrt(1-r*r))}var o=(e,t,n,r)=>n&1?a(r,t/2,e/2):a(r,e/2,t/2),s=(e,t,n)=>(n?t:e)*.6,c=(e,t,n,r)=>n&1?0:a(r,e/2,Math.min(12,Math.max(6,e/14))),l=(e,t)=>()=>({w:e,h:t,dy:0});function u(e,t,n){let r=Math.max(1.6*e+40,80),i=(t+10)/(1-(e+8)/r),a=i/2-10-t/2;return{w:r,h:i,dy:n?-a:a}}function d(e,t){return`<path d="${e}"${t}/>`}var f=(e,t,n)=>n&1?t/8:0,p=(e,t)=>({w:Math.max(e+36,48),h:t+24,dy:0});function m(e,n){let r=``;for(let n=0;n<e.length;n+=2)r+=(n?` `:``)+t(e[n])+`,`+t(e[n+1]);return`<polygon points="${r}"${n}/>`}function h(e,n,r,i=``){return`<rect x="${t(-e/2)}" y="${t(-n/2)}" width="${t(e)}" height="${t(n)}"${i}${r}/>`}var g={rect:{size:p,span:r,draw:(t,n,r)=>h(t,n,e(r))},rounded:{size:p,span:r,draw:(e,n,r)=>h(e,n,r,` rx="${t(Math.min(12,n/2))}"`)},stadium:{inset:(e,t,n,r)=>n&1?a(r,t/2,t/2):0,span:(e,t,n)=>n?t*.6:e-t,size:(e,t)=>{let n=t+24;return{w:e+n*.5+36-8,h:n,dy:0}},draw:(e,n,r)=>h(e,n,r,` rx="${t(n/2)}"`)},"fr-rect":{span:r,size:(e,t)=>({w:e+36+16,h:t+24,dy:0}),draw:(n,r,i,a)=>{let o=n/2-8;return h(n,r,e(i))+`<path d="M${t(-o)},${t(-r/2)}V${t(r/2)}M${t(o)},${t(-r/2)}V${t(r/2)}" fill="none"${a}/>`}},cyl:{inset:c,span:(e,t,r)=>r?t-2*n-12:e*.6,size:(e,t)=>{let n=Math.max(e+36,56),r=Math.min(12,Math.max(6,n/14));return{w:n,h:t+24+2*r,dy:r/2}},draw:(e,n,r,i)=>{let a=e/2,o=Math.min(12,Math.max(6,e/14)),s=-n/2+o,c=n/2-o;return`<path d="M${t(-a)},${t(s)}A${t(a)},${t(o)} 0 0 1 ${t(a)},${t(s)}V${t(c)}A${t(a)},${t(o)} 0 0 1 ${t(-a)},${t(c)}Z"${r}/><path d="M${t(-a)},${t(s)}A${t(a)},${t(o)} 0 0 0 ${t(a)},${t(s)}" fill="none"${i}/>`}},circle:{inset:o,span:s,size:(e,t)=>{let n=Math.max(Math.sqrt(e*e+t*t)+16,44);return{w:n,h:n,dy:0}},draw:(e,n,r)=>`<circle r="${t(e/2)}"${r}/>`},"dbl-circ":{inset:o,span:s,size:(e,t)=>{let n=Math.max(Math.sqrt(e*e+t*t)+26,54);return{w:n,h:n,dy:0}},draw:(e,n,r,i)=>`<circle r="${t(e/2)}"${r}/><circle r="${t(e/2-5)}" fill="none"${i}/>`},ellipse:{inset:o,span:s,size:(e,t)=>({w:e*1.3+36,h:t*1.2+24,dy:0}),draw:(e,n,r)=>`<ellipse rx="${t(e/2)}" ry="${t(n/2)}"${r}/>`},diam:{inset:(e,t,n,r)=>n&1?Math.abs(r)*e/t:Math.abs(r)*t/e,span:(e,t,n)=>(n?t:e)*.6,size:(e,t)=>{let n=e+16,r=t+8;return{w:n+1.6*r,h:n/1.6+r,dy:0}},draw:(e,t,n)=>m([0,-t/2,e/2,0,0,t/2,-e/2,0],n)},hex:{inset:(e,t,n,r)=>n&1?Math.abs(r)/2:0,span:(e,t,r)=>r?t*.5:e-t/2-n,size:(e,t)=>{let n=t+24;return{w:e+36+n/2,h:n,dy:0}},draw:(e,t,n)=>{let r=t/4;return m([-e/2+r,-t/2,e/2-r,-t/2,e/2,0,e/2-r,t/2,-e/2+r,t/2,-e/2,0],n)}},odd:{inset:(e,t,n)=>n===3?t/4:0,span:i(()=>0),size:(e,t)=>{let n=t+24;return{w:e+36+n/4,h:n,dy:0}},draw:(e,t,n)=>{let r=t/4;return m([-e/2,-t/2,e/2,-t/2,e/2,t/2,-e/2,t/2,-e/2+r,0],n)}},"lean-r":{inset:f,span:i(e=>e/4),size:(e,t)=>{let n=t+24;return{w:e+36+n/2,h:n,dy:0}},draw:(e,t,n)=>{let r=t/4;return m([-e/2+r,-t/2,e/2,-t/2,e/2-r,t/2,-e/2,t/2],n)}},"lean-l":{inset:f,span:i(e=>e/4),size:(e,t)=>{let n=t+24;return{w:e+36+n/2,h:n,dy:0}},draw:(e,t,n)=>{let r=t/4;return m([-e/2,-t/2,e/2-r,-t/2,e/2,t/2,-e/2+r,t/2],n)}},"trap-b":{inset:f,span:i(e=>e/4),size:(e,t)=>{let n=t+24;return{w:e+36+n/2,h:n,dy:0}},draw:(e,t,n)=>{let r=t/4;return m([-e/2+r,-t/2,e/2-r,-t/2,e/2,t/2,-e/2,t/2],n)}},"trap-t":{inset:f,span:i(e=>e/4),size:(e,t)=>{let n=t+24;return{w:e+36+n/2,h:n,dy:0}},draw:(e,t,n)=>{let r=t/4;return m([-e/2,-t/2,e/2,-t/2,e/2-r,t/2,-e/2+r,t/2],n)}},text:{span:r,size:(e,t)=>({w:e+8,h:t+8,dy:0}),draw:(e,t)=>h(e,t,` fill="none" stroke="none"`)},"sm-circ":{noLabel:!0,inset:o,span:s,size:l(14,14),draw:(e,n,r)=>`<circle r="${t(e/2)}"${r}/>`},"f-circ":{noLabel:!0,inset:o,span:s,size:l(14,14),draw:(e,n,r,i)=>`<circle r="${t(e/2)}" fill="var(--_l)"${i}/>`},"fr-circ":{noLabel:!0,inset:o,span:s,size:l(18,18),draw:(e,n,r,i)=>`<circle r="${t(e/2)}"${r}/><circle r="${t(e/2-4)}" fill="var(--_l)"${i}/>`},fork:{noLabel:!0,span:(e,t,n)=>(n?t:e)-8,size:l(72,8),draw:(e,t,n,r)=>h(e,t,` fill="var(--_l)"${r}`,` rx="2"`)},"notch-rect":{size:p,span:r,draw:(e,t,n)=>m([-e/2+10,-t/2,e/2,-t/2,e/2,t/2,-e/2,t/2,-e/2,-t/2+10],n)},"lin-rect":{span:r,size:(e,t)=>({w:e+36+8,h:t+24,dy:0}),draw:(n,r,i,a)=>h(n,r,e(i))+`<path d="M${t(-n/2+8)},${t(-r/2)}V${t(r/2)}" fill="none"${a}/>`},"div-rect":{span:r,size:(e,t)=>({w:e+36,h:t+24+8,dy:4}),draw:(n,r,i,a)=>h(n,r,e(i))+`<path d="M${t(-n/2)},${t(-r/2+8)}H${t(n/2)}" fill="none"${a}/>`},"win-pane":{span:r,size:(e,t)=>({w:e+36+8,h:t+24+8,dy:4}),draw:(n,r,i,a)=>h(n,r,e(i))+`<path d="M${t(-n/2+8)},${t(-r/2)}V${t(r/2)}M${t(-n/2)},${t(-r/2+8)}H${t(n/2)}" fill="none"${a}/>`},tri:{inset:(e,t,n)=>n&1?e/4:0,size:(e,t)=>u(e,t,!1),draw:(e,t,n)=>m([0,-t/2,e/2,t/2,-e/2,t/2],n)},"flip-tri":{inset:(e,t,n)=>n&1?e/4:0,size:(e,t)=>u(e,t,!0),draw:(e,t,n)=>m([-e/2,-t/2,e/2,-t/2,0,t/2],n)},"sl-rect":{inset:(e,t,n)=>n===0?5:0,size:(e,t)=>({w:e+36,h:t+24+10,dy:5}),draw:(e,t,n)=>m([-e/2,-t/2+10,e/2,-t/2,e/2,t/2,-e/2,t/2],n)},"notch-pent":{span:r,size:(e,t)=>({w:e+36,h:t+24,dy:0}),draw:(e,t,n)=>m([-e/2+10,-t/2,e/2-10,-t/2,e/2,-t/2+10,e/2,t/2,-e/2,t/2,-e/2,-t/2+10],n)},hourglass:{noLabel:!0,inset:(e,t,n)=>n&1?e/2:0,size:l(32,40),draw:(e,t,n)=>m([-e/2,-t/2,e/2,-t/2,-e/2,t/2,e/2,t/2],n)},delay:{size:(e,t)=>{let n=t+24;return{w:e+36+n/4,h:n,dy:0}},draw:(e,n,r)=>{let i=n/2;return`<path d="M${t(-e/2)},${t(-i)}H${t(e/2-i)}A${t(i)},${t(i)} 0 0 1 ${t(e/2-i)},${t(i)}H${t(-e/2)}Z"${r}/>`}},"h-cyl":{size:(e,t)=>{let n=t+24,r=Math.min(12,n/4);return{w:e+36+2*r,h:n,dy:0}},draw:(e,n,r,i)=>{let a=n/2,o=Math.min(12,n/4),s=-e/2+o,c=e/2-o;return`<path d="M${t(s)},${t(-a)}H${t(c)}A${t(o)},${t(a)} 0 0 1 ${t(c)},${t(a)}H${t(s)}A${t(o)},${t(a)} 0 0 1 ${t(s)},${t(-a)}Z"${r}/><path d="M${t(c)},${t(-a)}A${t(o)},${t(a)} 0 0 0 ${t(c)},${t(a)}" fill="none"${i}/>`}},"cross-circ":{noLabel:!0,inset:o,span:s,size:l(44,44),draw:(e,n,r,i)=>{let a=e/2,o=a*Math.SQRT1_2;return`<circle r="${t(a)}"${r}/><path d="M${t(-o)},${t(-o)}L${t(o)},${t(o)}M${t(o)},${t(-o)}L${t(-o)},${t(o)}" fill="none"${i}/>`}},"st-rect":{span:(e,t,r)=>(r?t:e)-2*n-8,size:(e,t)=>({w:e+36+8,h:t+24+8,dy:4}),draw:(n,r,i)=>{let a=n-8,o=r-8,s=``;for(let c=0;c<3;c++){let l=-n/2+(2-c)*4,u=-r/2+c*4;s+=`<rect x="${t(l)}" y="${t(u)}" width="${t(a)}" height="${t(o)}"${e(i)}/>`}return s}},doc:{inset:(e,t,n)=>n===2?10:0,size:(e,t)=>({w:e+36,h:t+24+10,dy:-5}),draw:(e,t,n)=>v(e,t,n)},flag:{inset:(e,t,n)=>n&1?0:8,size:(e,t)=>({w:e+36,h:t+24+16,dy:0}),draw:(e,n,r)=>{let i=e/2,a=n/2-8,o=e/4;return`<path d="M${t(-i)},${t(-a)}q${t(o)},-10 ${t(2*o)},0t${t(2*o)},0V${t(a)}q${t(-o)},10 ${t(-2*o)},0t${t(-2*o)},0Z"${r}/>`}},datastore:{size:p,span:r,draw:(e,n,r,i)=>h(e,n,r.replace(`stroke="var(--_b)"`,`stroke="none"`))+`<path d="M${t(-e/2)},${t(-n/2)}H${t(e/2)}M${t(-e/2)},${t(n/2)}H${t(e/2)}" fill="none"${i}/>`},folder:{size:(e,t)=>({w:Math.max(e+36,64),h:t+24+8,dy:4}),draw:(e,n,r)=>{let i=e/2,a=n/2,o=Math.min(e*.4,48);return d(`M${t(-i)},${t(-a)}H${t(-i+o)}L${t(-i+o+8)},${t(-a+8)}H${t(i)}V${t(a)}H${t(-i)}Z`,r)}},bucket:{size:(e,t)=>({w:e+36+20,h:t+24+10,dy:3}),inset:(e,t,n)=>n&1?t/12:0,draw:(e,n,r,i)=>{let a=e/2,o=n/2,s=n/6;return d(`M${t(-a)},${t(-o+5)}A${t(a)},${t(5)} 0 0 1 ${t(a)},${t(-o+5)}L${t(a-s)},${t(o-5)}A${t(a-s)},${t(5)} 0 0 1 ${t(-a+s)},${t(o-5)}Z`,r)+`<path d="M${t(-a)},${t(-o+5)}A${t(a)},${t(5)} 0 0 0 ${t(a)},${t(-o+5)}" fill="none"${i}/>`}},console:{span:r,size:(e,t)=>({w:Math.max(e+36,72),h:t+24+12,dy:6}),draw:(n,r,i,a)=>h(n,r,e(i))+`<path d="M${t(-n/2)},${t(-r/2+12)}H${t(n/2)}M${t(-n/2+7)},${t(-r/2+4)}l3,2.5l-3,2.5M${t(-n/2+13)},${t(-r/2+9)}h4" fill="none"${a}/>`},browser:{span:r,size:(e,t)=>({w:Math.max(e+36,72),h:t+24+12,dy:6}),draw:(n,r,i,a)=>{let o=``;for(let e=0;e<3;e++)o+=`<circle cx="${t(-n/2+8+e*7)}" cy="${t(-r/2+6)}" r="1.5" fill="none"${a}/>`;return h(n,r,e(i))+`<path d="M${t(-n/2)},${t(-r/2+12)}H${t(n/2)}" fill="none"${a}/>`+o}},person:{size:(e,t)=>({w:Math.max(e+36,56),h:t+24+26,dy:13}),draw:(e,n,r)=>{let i=-n/2;return`<rect x="${t(-e/2)}" y="${t(i+26)}" width="${t(e)}" height="${t(n-26)}" rx="12"${r}/><circle cy="${t(i+14)}" r="13"${r}/>`}},bang:{size:(e,t)=>({w:e+36+28,h:t+24+24,dy:0}),inset:()=>3,draw:(e,t,n)=>{let r=[];for(let n=0;n<28;n++){let i=Math.PI*n/14-Math.PI/2,a=n%2==0?1:.82;r.push(e/2*Math.cos(i)*a,t/2*Math.sin(i)*a)}return m(r,n)}},cloud:{size:(e,t)=>({w:e+36+32,h:t+24+24,dy:0}),inset:(e,t,n)=>n&1?2:1,draw:(e,n,r)=>{let i=e/2,a=n/2,o=a*.55;return d(`M${t(-i+o)},${t(a)}A${t(o)},${t(o)} 0 0 1 ${t(-i+o*.6)},${t(-a*.1)}A${t(i*.42)},${t(a*.7)} 0 0 1 ${t(-i*.1)},${t(-a*.72)}A${t(i*.4)},${t(a*.62)} 0 0 1 ${t(i*.62)},${t(-a*.42)}A${t(o*1.05)},${t(o*1.05)} 0 0 1 ${t(i-o)},${t(a)}Z`,r)}},brace:{size:(e,t)=>({w:e+36+12,h:t+24,dy:0}),draw:(e,t,n,r)=>h(e,t,` fill="none" stroke="none"`)+_(-e/2+12,t,-1,r)},"brace-r":{size:(e,t)=>({w:e+36+12,h:t+24,dy:0}),draw:(e,t,n,r)=>h(e,t,` fill="none" stroke="none"`)+_(e/2-12,t,1,r)},braces:{size:(e,t)=>({w:e+36+24,h:t+24,dy:0}),draw:(e,t,n,r)=>h(e,t,` fill="none" stroke="none"`)+_(-e/2+12,t,-1,r)+_(e/2-12,t,1,r)},bolt:{noLabel:!0,size:l(36,56),inset:(e,t,n)=>n&1?e/4:0,draw:(e,t,n)=>m([e*.15,-t/2,-e/2,t*.08,-e*.05,t*.08,-e*.15,t/2,e/2,-t*.08,e*.05,-t*.08],n)},"lin-cyl":{inset:c,span:(e,t,r)=>r?t-2*n-20:e*.6,size:(e,t)=>{let n=Math.max(e+36,56),r=Math.min(12,Math.max(6,n/14));return{w:n,h:t+24+2*r+8,dy:r/2+4}},draw:(e,n,r,i)=>{let a=e/2,o=Math.min(12,Math.max(6,e/14)),s=-n/2+o,c=n/2-o,l=e=>`M${t(-a)},${t(e)}A${t(a)},${t(o)} 0 0 0 ${t(a)},${t(e)}`;return d(`M${t(-a)},${t(s)}A${t(a)},${t(o)} 0 0 1 ${t(a)},${t(s)}V${t(c)}A${t(a)},${t(o)} 0 0 1 ${t(-a)},${t(c)}Z`,r)+`<path d="${l(s)}${l(s+8)}" fill="none"${i}/>`}},"curv-trap":{size:(e,t)=>{let n=t+24;return{w:e+36+n*.6,h:n,dy:0}},draw:(e,n,r)=>{let i=e/2,a=n/2,o=n*.3;return d(`M${t(-i+o)},${t(-a)}H${t(i-o)}A${t(o)},${t(a)} 0 0 1 ${t(i-o)},${t(a)}H${t(-i+o)}L${t(-i)},0Z`,r)}},docs:{size:(e,t)=>({w:e+36+8,h:t+24+18,dy:-1}),inset:(e,t,n)=>n===2?10:0,draw:(e,t,n)=>{let r=``;for(let i=0;i<3;i++)r+=`<g transform="translate(${(1-i)*4},${(i-1)*4})">${v(e-8,t-8,n)}</g>`;return r}},"bow-rect":{size:(e,t)=>{let n=t+24;return{w:e+36+n*.4,h:n,dy:0}},inset:(e,t,n)=>n===1?t*.2:0,draw:(e,n,r)=>{let i=e/2,a=n/2,o=n*.2;return d(`M${t(-i+o)},${t(-a)}H${t(i)}A${t(o)},${t(a)} 0 0 0 ${t(i)},${t(a)}H${t(-i+o)}A${t(o)},${t(a)} 0 0 1 ${t(-i+o)},${t(-a)}Z`,r)}},"tag-rect":{size:p,span:r,draw:(n,r,i,a)=>h(n,r,e(i))+`<path d="M${t(n/2-12)},${t(r/2)}L${t(n/2)},${t(r/2-12)}" fill="none"${a}/>`},"tag-doc":{size:(e,t)=>({w:e+36,h:t+24+10,dy:-5}),inset:(e,t,n)=>n===2?10:0,draw:(e,n,r,i)=>v(e,n,r)+`<path d="M${t(e/2-12)},${t(n/2-14)}L${t(e/2)},${t(n/2-26)}" fill="none"${i}/>`},"lin-doc":{size:(e,t)=>({w:e+36+8,h:t+24+10,dy:-5}),inset:(e,t,n)=>n===2?10:0,draw:(e,n,r,i)=>v(e,n,r)+`<path d="M${t(-e/2+8)},${t(-n/2)}V${t(n/2-6)}" fill="none"${i}/>`},collapsedGroup:{size:(e,t)=>({w:e+36+8,h:t+24+8,dy:-2}),draw:(n,r,i)=>`<rect x="${t(-n/2+6)}" y="${t(-r/2+8)}" width="${t(n-12)}" height="${t(r-8)}"${e(i)}/><rect x="${t(-n/2)}" y="${t(-r/2)}" width="${t(n)}" height="${t(r-4)}"${e(i)}/>`}};function _(e,n,r,i){let a=n/2,o=6*r;return`<path d="M${t(e)},${t(-a)}q${t(o)},0 ${t(o)},6V-6q0,6 ${t(o)},6q${t(-o)},0 ${t(-o)},6V${t(a-6)}q0,6 ${t(-o)},6" fill="none"${i}/>`}function v(e,n,r){let i=e/2,a=-n/2,o=n/2-10,s=e/4;return`<path d="M${t(-i)},${t(a)}H${t(i)}V${t(o)}q${t(-s)},-12 ${t(-2*s)},0t${t(-2*s)},0Z"${r}/>`}var y=g.rect,b=new Map(Object.entries(g));function x(e,t,n){return(b.get(e)??y).size(t,n)}function S(e,t,n,r,i){return(b.get(e)??y).draw(t,n,r,i)}function C(e,t,n,r,i=0){return b.get(e)?.inset?.(t,n,r,i)??0}function w(e,t,n,r){return Math.max(0,b.get(e)?.span?.(t,n,r)??0)}function T(e){return b.get(e)?.noLabel!==!0}function E(e,t,n){let r=e[t]-n.x,i=e[t+1]-n.y;return Math.abs(Math.abs(i)-n.h/2)<.5?i<0?0:2:Math.abs(Math.abs(r)-n.w/2)<.5?r<0?3:1:-1}function D(e,t,n,r){if(r.isGroup)return;let i=E(e,t,r);if(i===0||i===2){let a=C(n.shape,n.w,n.h,i,e[t]-r.x)+(r.h-n.h)/2;e[t+1]+=i===0?a:-a}else if(i>=0){let a=C(n.shape,n.w,n.h,i,e[t+1]-r.y)+(r.w-n.w)/2;e[t]+=i===3?a:-a}}export{S as a,x as i,E as n,C as o,w as r,T as s,D as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as e,a as t,b as n,c as r,d as i,i as a,m as o,o as s,p as c,s as l,t as u,u as d,v as f,x as p,y as m}from"./
|
|
1
|
+
import{_ as e,a as t,b as n,c as r,d as i,i as a,m as o,o as s,p as c,s as l,t as u,u as d,v as f,x as p,y as m}from"./DfCZPwp1.js";import{a as h,t as g}from"./DciMwFJ1.js";import{i as _,l as v}from"./BLmF1B2i.js";import{t as y}from"./RFxekmX-.js";import{i as b,r as x,t as ee}from"./RlApGeew.js";import{PeleError as S,_ as C,g as w,h as T,s as E,u as te}from"./-2Meesge.js";var D={REQUIREMENT:`Requirement`,FUNCTIONAL_REQUIREMENT:`Functional Requirement`,INTERFACE_REQUIREMENT:`Interface Requirement`,PERFORMANCE_REQUIREMENT:`Performance Requirement`,PHYSICAL_REQUIREMENT:`Physical Requirement`,DESIGN_CONSTRAINT:`Design Constraint`},O={LOW_RISK:`Low`,MED_RISK:`Medium`,HIGH_RISK:`High`},k={VERIFY_ANALYSIS:`Analysis`,VERIFY_DEMONSTRATION:`Demonstration`,VERIFY_INSPECTION:`Inspection`,VERIFY_TEST:`Test`},A={CONTAINS:`contains`,COPIES:`copies`,DERIVES:`derives`,SATISFIES:`satisfies`,VERIFIES:`verifies`,REFINES:`refines`,TRACES:`traces`},j=1e6,M=class{type=`requirement`;direction=`TB`;requirements=new Map;elements=new Map;relations=[];classes=new Map;title;accTitle;accDescr;newId=``;newText=``;newRisk=``;newVerifyMethod=``;newElementType=``;newDocRef=``;styleCopies=0;copy(e,t){if(this.styleCopies+=t.length,this.styleCopies>j)throw new S(`Requirement diagram applies too many style declarations.`,`limit`,{type:`requirement`});for(let n of t)e.push(n)}setDirection(e){this.direction=e}addRequirement(e,t){let n=this.requirements.get(e);return n===void 0&&(n={name:e,type:t,requirementId:this.newId,text:this.newText,risk:this.newRisk,verifyMethod:this.newVerifyMethod,cssStyles:[],classes:[`default`]},this.requirements.set(e,n)),this.newId=this.newText=this.newRisk=this.newVerifyMethod=``,n}setNewReqId(e){this.newId=e}setNewReqText(e){this.newText=e}setNewReqRisk(e){this.newRisk=e}setNewReqVerifyMethod(e){this.newVerifyMethod=e}addElement(e){let t=this.elements.get(e);return t===void 0&&(t={name:e,type:this.newElementType,docRef:this.newDocRef,cssStyles:[],classes:[`default`]},this.elements.set(e,t)),this.newElementType=this.newDocRef=``,t}setNewElementType(e){this.newElementType=e}setNewElementDocRef(e){this.newDocRef=e}addRelationship(e,t,n){this.relations.push({type:e,src:t,dst:n})}node(e){return this.requirements.get(e)??this.elements.get(e)}setCssStyle(e,t){for(let n of e){let e=this.node(n);if(!t||!e)return;for(let n of t)this.copy(e.cssStyles,n.includes(`,`)?n.split(`,`):[n])}}setClass(e,t){for(let n of e){let e=this.node(n);if(e)for(let n of t){e.classes.push(n);let t=this.classes.get(n)?.styles;t&&this.copy(e.cssStyles,t)}}}defineClass(e,t){for(let n of e){let e=this.classes.get(n);e===void 0&&(e={id:n,styles:[],textStyles:[]},this.classes.set(n,e));for(let n of t)n.includes(`color`)&&e.textStyles.push(n.replace(`fill`,`bgFill`)),e.styles.push(n);let r=t.flatMap(e=>e.split(`,`));for(let e of this.requirements.values())e.classes.includes(n)&&this.copy(e.cssStyles,r);for(let e of this.elements.values())e.classes.includes(n)&&this.copy(e.cssStyles,r)}}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,``)}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
|
|
2
2
|
`)}},N=`$end.INVALID.title.acc_title.acc_title_value.acc_descr.acc_descr_value.acc_descr_multiline_value.direction_tb.direction_bt.direction_rl.direction_lr.NEWLINE.EOF.RD.STRUCT_START.STRUCT_STOP.STYLE_SEPARATOR.COLONSEP.ID.TEXT.RISK.VERIFYMTHD.REQUIREMENT.FUNCTIONAL_REQUIREMENT.INTERFACE_REQUIREMENT.PERFORMANCE_REQUIREMENT.PHYSICAL_REQUIREMENT.DESIGN_CONSTRAINT.LOW_RISK.MED_RISK.HIGH_RISK.VERIFY_ANALYSIS.VERIFY_DEMONSTRATION.VERIFY_INSPECTION.VERIFY_TEST.ELEMENT.CONTAINS.COPIES.DERIVES.SATISFIES.VERIFIES.REFINES.TRACES.TYPE.DOCREF.STYLE.CLASSDEF.CLASS.ALPHA.COLON.SEMICOLON.PERCENT.MINUS.BRKT.END_ARROW_L.END_ARROW_R.LINE.qString.unqString.COMMA`.split(`.`),P=new Map([[`requirementdiagram`,14],[`id`,19],[`text`,20],[`risk`,21],[`verifymethod`,22],[`requirement`,23],[`functionalrequirement`,24],[`interfacerequirement`,25],[`performancerequirement`,26],[`physicalrequirement`,27],[`designconstraint`,28],[`low`,29],[`medium`,30],[`high`,31],[`analysis`,32],[`demonstration`,33],[`inspection`,34],[`test`,35],[`element`,36],[`contains`,37],[`copies`,38],[`derives`,39],[`satisfies`,40],[`verifies`,41],[`refines`,42],[`traces`,43],[`type`,44],[`docref`,45],[`style`,46],[`classdef`,47],[`class`,48]]),F=/accTitle\s*:\s*/iy,I=/accDescr\s*:\s*/iy,L=/accDescr\s*\{\s*/iy,R=/direction\s+(?:(TB)|(BT)|(RL)|LR)/gi,z=/[\n\r\u2028\u2029]/g,B=22,V=new Uint8Array(128);for(let e of`:,\r
|
|
3
3
|
{<>-=`)V[e.charCodeAt(0)]=1;function ne(e){let t=e.length,n=[],r=[],i=[],a=[],o=0,s=0,c=[[],[],[],[]],l=[[],[],[],[]],u=[0,0,0,0],d=!1,f=-1;R.lastIndex=0;for(let t=R.exec(e);t!==null;t=R.exec(e)){let e=t[1]===void 0?t[2]===void 0?t[3]===void 0?3:2:1:0;c[e].push(t.index),l[e].push(R.lastIndex),d=!0}let p=(t,a,o)=>{n.push(t),r.push(e.slice(a,o)),i.push(a),s=o},m=e=>{a.push(o),o=e},h=()=>{a.length>0&&(o=a.pop())},g=(t,n)=>(t.lastIndex=n,t.test(e)?t.lastIndex:-1),_=n=>{let r=e.indexOf(`
|
|
4
4
|
`,n);return r===-1?t:r},v=()=>{if(f<s){z.lastIndex=s,f=z.test(e)?z.lastIndex-1:t;for(let e=0;e<4;e++){let t=c[e],n=u[e];for(;n<t.length&&t[n]<=f;)n++;u[e]=n}}for(let e=0;e<4;e++){let t=u[e]-1;if(t>=0&&c[e][t]>=s)return p(8+e,s,_(l[e][t])),!0}return!1},y=a=>{let o=a|32;if(o===116&&e.slice(s+1,s+5).toLowerCase()===`itle`&&T(e.charCodeAt(s+5))){let n=s+6;for(;n<t;){let t=e.charCodeAt(n);if(t===35||t===10||t===59)break;n++}if(n>s+6)return p(2,s,n),!0}if(o===97&&(e.charCodeAt(s+1)|32)==99&&(e.charCodeAt(s+2)|32)==99){let e;if((e=g(F,s))>=0)return m(3),p(3,s,e),!0;if((e=g(I,s))>=0)return m(4),p(5,s,e),!0;if((e=g(L,s))>=0)return m(5),s=e,!0}if(d&&!C(a)&&v())return!0;if(a===10||a===13&&e.charCodeAt(s+1)===10){let n=s;for(;n<t;){let t=e.charCodeAt(n);if(t===10)n++;else if(t===13&&e.charCodeAt(n+1)===10)n+=2;else break}return p(12,s,n),!0}if(T(a)){for(s++;s<t&&T(e.charCodeAt(s));)s++;return!0}if(a===35||a===37)return s=_(s),!0;if(w(a)){let a=s+1;for(;a<t&&w(e.charCodeAt(a));)a++;if(a-s<=B){let t=P.get(e.slice(s,a).toLowerCase());if(t!==void 0)return(t===46||t===47||t===48)&&m(2),p(t,s,a),!0}for(;a<t;){let t=e.charCodeAt(a);if(t<128&&V[t]===1)break;a++}return n.push(59),r.push(e.slice(s,a).trim()),i.push(s),s=a,!0}switch(a){case 123:return p(15,s,s+1),!0;case 125:return p(16,s,s+1),!0;case 58:return e.charCodeAt(s+1)===58&&e.charCodeAt(s+2)===58?p(17,s,s+3):p(18,s,s+1),!0;case 60:return e.charCodeAt(s+1)===45&&(p(55,s,s+2),!0);case 45:return e.charCodeAt(s+1)===62?p(56,s,s+2):p(57,s,s+1),!0;case 34:return m(1),s++,!0;case 44:return p(60,s,s+1),!0}return!1},b=n=>{if(w(n)){let n=s+1;for(;n<t&&w(e.charCodeAt(n));)n++;return p(49,s,n),!0}switch(n){case 58:return p(50,s,s+1),!0;case 59:return p(51,s,s+1),!0;case 37:return p(52,s,s+1),!0;case 45:return p(53,s,s+1),!0;case 35:return p(54,s,s+1),!0;case 32:return s++,!0;case 34:return m(1),s++,!0;case 10:return h(),s++,!0;case 44:return p(60,s,s+1),!0}return!1};for(;s<t;){let a=e.charCodeAt(s),c=!0;switch(o){case 0:c=y(a);break;case 2:c=b(a);break;case 1:if(a===34)h(),s++;else{let n=e.indexOf(`"`,s);p(58,s,n===-1?t:n)}break;case 3:h(),p(4,s,_(s));break;case 4:h(),p(6,s,_(s));break;case 5:if(a===125)h(),s++;else{let n=e.indexOf(`}`,s);p(7,s,n===-1?t:n)}}if(!c)return n.push(1),r.push(``),i.push(s),{types:n,texts:r,starts:i}}let x=o===0?13:o===1?58:o===3?4:o===4?6:o===5?7:-1;return x!==-1&&p(x,t,t),p(0,t,t),{types:n,texts:r,starts:i}}var re=[D.REQUIREMENT,D.FUNCTIONAL_REQUIREMENT,D.INTERFACE_REQUIREMENT,D.PERFORMANCE_REQUIREMENT,D.PHYSICAL_REQUIREMENT,D.DESIGN_CONSTRAINT,O.LOW_RISK,O.MED_RISK,O.HIGH_RISK,k.VERIFY_ANALYSIS,k.VERIFY_DEMONSTRATION,k.VERIFY_INSPECTION,k.VERIFY_TEST,``,A.CONTAINS,A.COPIES,A.DERIVES,A.SATISFIES,A.VERIFIES,A.REFINES,A.TRACES];function H(e){return e===49||e===50||e===54||e===53||e===51}function ie(e,t){let{types:n,texts:r,starts:i}=ne(e),a=0,o=[],s=[],c=(t,r=t,...o)=>{let s=n[a];if(s===1)throw E(`requirement`,e,i[a],``,!0);for(let e=r;e>=t;e--)o.unshift(e);let c=o.map(e=>`'${N[e]}'`).join(`, `);throw E(`requirement`,e,i[a],`Expecting ${c}, got '${N[s]}'`)},l=e=>(n[a]!==e&&c(e),r[a++]),u=(e,t)=>{let r=n[a];return(r<e||r>t)&&c(e,t),a++,re[r-23]},d=()=>{let e=n[a];return e!==59&&e!==58&&c(58,59),r[a++]},f=()=>{let e=n[a];if(e===3)a++,t.setAccTitle(l(4).trim());else if(e===5)a++,t.setAccDescription(l(6).trim());else if(e===7)t.setAccDescription(r[a++].trim());else return!1;return!0},p=()=>{let e=[];for(;;){let t=n[a];if(t!==49&&t!==59&&t!==58&&c(58,59,49),e.push(r[a++]),n[a]!==60)return e;a++}},m=()=>{let e=[];for(;;){H(n[a])||c(49,51,53,54);let t=r[a++];for(;H(n[a]);)t+=r[a++];if(e.push(t),n[a]!==60)return e;a++}},h=()=>{let e;return n[a]===17?(a++,e=p(),l(15)):n[a]===15?a++:c(15,15,17),l(12),e},g=e=>{for(o.length=0,s.length=0;;){let t=n[a];if(t===16){a++;break}t===12?a++:((e?t<19||t>22:t!==44&&t!==45)&&(e&&c(19,22,12,16),c(44,45,12,16)),a++,l(18),s.push(t===21?u(29,31):t===22?u(32,35):d()),o.push(t),l(12))}for(let e=o.length-1;e>=0;e--){let n=s[e];switch(o[e]){case 19:t.setNewReqId(n);break;case 20:t.setNewReqText(n);break;case 21:t.setNewReqRisk(n);break;case 22:t.setNewReqVerifyMethod(n);break;case 44:t.setNewElementType(n);break;default:t.setNewElementDocRef(n)}}};for(;f();)n[a]===12&&a++;for(n[a]!==14&&c(14,14,3,5,7),a++,l(12);;){let e=n[a];if(e===13)return;if(e===12)a++;else{if(f())continue;if(e>=8&&e<=11)a++,t.setDirection(e===8?`TB`:e===9?`BT`:e===10?`RL`:`LR`);else if(e>=23&&e<=28){let e=u(23,28),n=d(),r=h();g(!0),t.addRequirement(n,e),r&&t.setClass([n],r)}else if(e===36){a++;let e=d(),n=h();g(!1),t.addElement(e),n&&t.setClass([e],n)}else if(e===46){a++;let e=p();t.setCssStyle(e,m())}else if(e===47){a++;let e=p();t.defineClass(e,m())}else if(e===48){a++;let e=p();t.setClass(e,p())}else if(e===59||e===58){let e=r[a++],i=n[a];if(i===17)a++,t.setClass([e],p());else if(i===55||i===57){a++;let n=u(37,43);l(i===57?56:57);let r=d();i===57?t.addRelationship(n,e,r):t.addRelationship(n,r,e)}else c(17,17,55,57)}else c(12,13,3,5,7,8,9,10,11,23,24,25,26,27,28,36,47,48,46,59,58)}}}function ae(e){let t=[];for(let n of e.requirements.values())t.push({id:n.name,requirement:n,element:void 0,cssStyles:n.cssStyles,cssClasses:n.classes.join(` `)});for(let n of e.elements.values())t.push({id:n.name,requirement:void 0,element:n,cssStyles:n.cssStyles,cssClasses:n.classes.join(` `)});let n=t=>e.requirements.has(t)||e.elements.has(t)?t:void 0;return{nodes:t,edges:e.relations.map((e,t)=>({id:`${e.src}-${e.dst}-${t}`,start:n(e.src),end:n(e.dst),type:e.type,contains:e.type===A.CONTAINS})),direction:e.direction}}var oe=40,se=16,ce=56,U=14,W=10,G=2,K=12,le=120,ue=280,de=240,q=26,J=6,Y=9,X=4.5,fe=28,pe=14;function Z(e,t,n){if(t===0||e.lines.length===0)return e;let r=0,i=[],a=e.lines.map(a=>{let o=0,s=a.map(r=>{let i=r.style|t,a=r.icon!==void 0||r.math?r.width:n.width(r.text,e.size,i);return o+=a,{...r,style:i,width:a}});return i.push(o),o>r&&(r=o),s});return{...e,lines:a,widths:i,width:r}}function Q(e,n,i,a){let l=r(e),d=``,h=``;for(let r=0;r<e.lines.length;r++){let u=e.lines[r],g=i+c(e,r);if(f(u)){h+=s(m(e,r),n+e.widths[r]/2,g,a);continue}let _=g+e.size*.35,v=!0;for(let e of u)e.icon!==void 0||e.text===``||(d+=`<tspan${v?` x="${p(n)}" y="${p(_)}"`:``}${o(e.style&~l)}>${t(e.text)}</tspan>`,v=!1)}return(d===``?``:`<text${u(a,l)} text-anchor="start" xml:space="preserve">${d}</text>`)+h}function me(e,t,n,r){let i=J,a=e-n*i,o=t-r*i;return`<circle class="pele-marker" cx="${p(a)}" cy="${p(o)}" r="${i}"/><path class="pele-marker" d="M${p(a-n*i)},${p(o-r*i)}L${p(a+n*i)},${p(o+r*i)}M${p(a+r*i)},${p(o-n*i)}L${p(a-r*i)},${p(o+n*i)}"/>`}function he(e,t,n,r){let i=e-n*Y,a=t-r*Y;return`<path class="pele-marker" d="M${p(i-r*X)},${p(a+n*X)}L${p(e)},${p(t)}L${p(i+r*X)},${p(a-n*X)}" stroke-linejoin="round"/>`}function ge(e,t,n){let r=new Map;for(let n of t){let t=n.route;if(!(n.src===n.dst||t.length<6))for(let i of[0,t.length-3]){let a=i===0?n.src:n.dst,o=e[a],s=t[i]-o.x,c=t[i+1]-o.y,l=i===0?3:i-3,u;if(Math.abs(Math.abs(c)-o.h/2)<.5)u=c<0?0:2;else if(Math.abs(Math.abs(s)-o.w/2)<.5)u=s<0?3:1;else continue;let d=a*4+u,f={route:t,at:i,toward:t[u%2==0?l:l+1]},p=r.get(d);p?p.push(f):r.set(d,[f])}}for(let[t,i]of r){if(i.length<2)continue;let r=t>>2,a=t%2==1,o=(a?n[r].h:n[r].w)-2*pe,s=Math.max(0,Math.min(fe,o/(i.length-1)));i.sort((e,t)=>e.toward-t.toward);for(let t=0;t<i.length;t++){let n=(t-(i.length-1)/2)*s;a?i[t].route[i[t].at+1]=e[r].y+n:i[t].route[i[t].at]=e[r].x+n}}}function _e(e,t,n){return h(e.direction)?g(n,r=>$(e,t,n,r)):$(e,t,n,!1)}function $(t,r,o,c){let u=ae(t),f=o.fontSize??16,m=Math.round(f*.875),h=o.measurer??te(o.fontFamily,o.fontFamilyMono),g=o.padding??8,S=new Map,C=[],w=[];for(let e of u.nodes){let t=l(e.cssStyles),n=+!!t.bold|(t.italic?2:0),r=t.fontSize??f,i=t.fontSize??m,a=e.requirement,o=e.element,s=Z(d(`«${a?a.type:`Element`}»`,!1,h,i,4e3),n,h),c=Z(d(e.id,!0,h,r,ue),n|1,h),u=a?[[`ID`,a.requirementId],[`Text`,a.text],[`Risk`,a.risk],[`Verification`,a.verifyMethod]]:[[`Type`,o.type],[`Doc Ref`,o.docRef]],p=[],g=0,_=0,v=0;for(let[e,t]of u){if(!t)continue;let r=Z(d(e,!1,h,i,4e3),n,h),a=Z(d(t,!0,h,i,de),n,h),o=Math.max(r.height,a.height);p.push({key:r,value:a,height:o}),g=Math.max(g,r.width),_=Math.max(_,a.width),v+=o+G}p.length>0&&(v+=2*W-G);let y=2*W+s.height+c.height,b=Math.max(le,Math.max(s.width,c.width)+2*U,p.length>0?g+K+_+2*U:0);S.has(e.id)||S.set(e.id,C.length);let x=ee(b,y+v);x.seq=C.length,C.push({node:e,style:t,kind:s,name:c,rows:p,keyWidth:g,headHeight:y,w:b,h:y+v}),w.push(x)}let T=c?`TB`:x(u.direction),E=T===`LR`||T===`RL`,D=[],O=[],k=[];for(let e of u.edges){let t=e.start===void 0?void 0:S.get(e.start),n=e.end===void 0?void 0:S.get(e.end);if(t===void 0||n===void 0)continue;let r=d(`«${e.type}»`,!1,h,m,4e3);t===n&&(E?w[t].h+=2*(q+r.height+8):w[t].w+=2*(q+r.width+12)),k.push(e),O.push(r),D.push({src:t,dst:n,minlen:1,labelW:r.width+12,labelH:r.height+4,route:[],labelX:0,labelY:0})}let A=b(w,D,T,{nodeSep:oe,edgeSep:se,rankSep:ce,portSep:20});ge(w,D,C);let j=y(t.title,h,f,4e3),M=j.height>0?j.height+12:0,N=Math.max(A.width,j.width),P=g+(N-A.width)/2,F=g+M,I=Math.ceil(N+2*g),L=Math.ceil(A.height+M+2*g),R=``;for(let e=0;e<C.length;e++){let t=C[e],{w:r,h:o,style:c}=t,l=-r/2,u=-o/2,d=`<rect x="${p(l)}" y="${p(u)}" width="${p(r)}" height="${p(o)}" fill="var(--_s)" stroke="var(--_b)"${i(c.shape)}/>`+s(t.kind,0,u+W+t.kind.height/2,` class="pele-stereotype" font-size="${t.kind.size}" fill="var(--_m)"${c.text}`)+s(t.name,0,u+W+t.kind.height+t.name.height/2,` class="pele-label" font-size="${t.name.size}" font-weight="var(--_hw)"${c.text}`);if(t.rows.length>0){let e=u+t.headHeight;d+=`<path class="pele-divider" d="M${p(l)},${p(e)}H${p(-l)}" stroke="var(--_b)"${c.line}/>`;let n=e+W,r=``;for(let e of t.rows)r+=Q(e.key,l+U,n,` class="pele-field" fill="var(--_m)"${c.text}`)+Q(e.value,l+U+t.keyWidth+K,n,` class="pele-value"${c.text}`),n+=e.height+G;d+=`<g class="pele-fields" font-size="${t.rows[0].key.size}">${r}</g>`}R+=`<g class="pele-node ${t.node.requirement?`pele-requirement`:`pele-element`}${n(t.node.cssClasses.replace(/^default\s?/,``))}" data-id="${a(t.node.id)}" transform="translate(${p(w[e].x+P)},${p(w[e].y+F)})">${d}</g>`}let z=``,B=``,V=new Map;for(let e=0;e<D.length;e++){let t=D[e],n=k[e],r=O[e],i=n.contains?2*J:0,o,s=t.labelX+P,c=t.labelY+F;if(t.src===t.dst){let e=C[t.src],n=w[t.src].x+P,r=w[t.src].y+F,a=V.get(t.src)??0;V.set(t.src,a+1);let l=(E?e.w:e.h)/2,u=Math.min(l-4,12+a*6),d=q+a*8,f=(t,i)=>E?`${p(n+i)},${p(r+e.h/2+t)}`:`${p(n+e.w/2+t)},${p(r+i)}`,m=d/.75;o={d:`M${f(i,-u)}C${f(m,-u)} ${f(m,u)} ${f(0,u)}`,sx:E?n-u:n+e.w/2,sy:E?r+e.h/2:r-u,sdx:E?0:-1,sdy:E?-1:0,ex:E?n+u:n+e.w/2,ey:E?r+e.h/2:r+u,edx:E?0:-1,edy:E?-1:0},E?(s=n,c=r+e.h/2+d+4+t.labelH/2):(s=n+e.w/2+d+4+t.labelW/2,c=r)}else{let e=t.route.slice();for(let t=0;t<e.length;t+=3)e[t]+=P,e[t+1]+=F;o=v(e,void 0,i,0)}z+=`<g class="pele-edge pele-relationship-${n.contains?`contains`:`arrow`}" data-id="${a(n.id)}"><path d="${o.d}"${n.contains?``:` stroke-dasharray="5 4"`}/>`+(n.contains?me(o.sx,o.sy,o.sdx,o.sdy):he(o.ex,o.ey,o.edx,o.edy))+`</g>`,B+=_(n.id,r,s,c,``)}return{svg:e(`requirement`,I,L,f,o,t,s(j,I/2,g+j.height/2,` class="pele-title" font-weight="var(--_tw)"`)+(z?`<g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round">${z}</g>`:``)+(B?`<g class="pele-edge-labels" font-size="${m}" fill="var(--_m)">${B}</g>`:``)+`<g class="pele-nodes">${R}</g>`),width:I,height:L,links:[]}}var ve={type:`requirement`,math:!0,parse(e,t,n){let r=new M;return n&&(r.title=n),ie(e,r),r},render:_e};export{ve as requirement};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,et as t,tt as n,z as r}from"./Iqr2CudW.js";import{o as i,t as a}from"./c7PFFMl4.js";import{r as o,s}from"./CBkjDkEN.js";var c=(e,t)=>{try{return localStorage.getItem(e)??t}catch{return t}},l=(e,t)=>{try{localStorage.setItem(e,t)}catch{}},u=(e,t)=>{try{return{...t,...JSON.parse(c(e,`{}`))}}catch{return t}},d=[`note`,`atlas`,`iso`],f=[`cols`,`stack`,`one`],p={note:[`provenance`,`timeline`],atlas:[`questions`,`problems`,`web`,`code`,`pictures`,`context`],iso:[`notes`,`files`,`run`]},m={provenance:!1,timeline:!1,questions:!0,problems:!0,web:!1,code:!1,pictures:!1,context:!1,notes:!1,files:!1,run:!1},h={note:1.25,atlas:1,iso:1.05},g={min:.4,max:3},_=new class{#e=n(e(f.includes(c(`isorite.layout`,``))?c(`isorite.layout`,``):`cols`));get layout(){return r(this.#e)}set layout(e){t(this.#e,e,!0)}#t=n(e(u(`isorite.show`,{note:!0,atlas:!0,iso:!0})));get show(){return r(this.#t)}set show(e){t(this.#t,e,!0)}#n=n(e(u(`isorite.widths`,h)));get widths(){return r(this.#n)}set widths(e){t(this.#n,e,!0)}#r=n(e(u(`isorite.switches`,m)));get on(){return r(this.#r)}set on(e){t(this.#r,e,!0)}#i=n(c(`isorite.understanding`,``)===`1`);get understanding(){return r(this.#i)}set understanding(e){t(this.#i,e,!0)}#a=n(`note`);get focus(){return r(this.#a)}set focus(e){t(this.#a,e,!0)}#o=n(!1);get narrow(){return r(this.#o)}set narrow(e){t(this.#o,e,!0)}#s=n(0);get unseen(){return r(this.#s)}set unseen(e){t(this.#s,e,!0)}#c=n(!1);get tree(){return r(this.#c)}set tree(e){t(this.#c,e,!0)}#l=n(``);get fresh(){return r(this.#l)}set fresh(e){t(this.#l,e,!0)}#u=n(null);get settings(){return r(this.#u)}set settings(e){t(this.#u,e,!0)}#d=n(e(c(s(`isorite.last`),``)));get last(){return r(this.#d)}set last(e){t(this.#d,e,!0)}get standing(){if(this.narrow)return[...d];let e=d.filter(e=>this.show[e]);return this.layout===`one`?[e.includes(this.focus)?this.focus:e[0]??`note`]:e}setLayout(e){this.layout=e,l(`isorite.layout`,e)}nextLayout(){this.setLayout(f[(f.indexOf(this.layout)+1)%f.length])}toggle(e){this.show[e]&&d.filter(e=>this.show[e]).length===1||(this.show[e]=!this.show[e],l(`isorite.show`,JSON.stringify(this.show)),!this.show[e]&&this.focus===e&&(this.focus=d.find(e=>this.show[e])))}setWidth(e,t){this.widths[e]=Math.min(g.max,Math.max(g.min,t)),l(`isorite.widths`,JSON.stringify(this.widths))}to(e){!this.narrow&&!this.show[e]&&this.toggle(e),this.focus=e,e===`iso`&&(this.unseen=0),this.scroll?.(e)}scroll=null;step(e){let t=this.narrow?[...d]:d.filter(e=>this.show[e]),n=t.indexOf(this.focus);this.to(t[(n+e+t.length)%t.length])}flip(e,t=!this.on[e]){this.on[e]=t,l(`isorite.switches`,JSON.stringify(this.on)),(e===`notes`||e===`files`||e===`run`)&&this.onMode?.()}showUnderstanding(e=!this.understanding){this.understanding=e,l(`isorite.understanding`,e?`1`:``),this.onMode?.()}busy(e){let t=typeof document>`u`?null:document.activeElement;return!!t&&!!t.closest(`[data-pane="${e}"]`)&&(t.matches(`input, textarea, [contenteditable=true]`)||!!t.closest(`.cm-editor`))}#f=n(!1);get terminal(){return r(this.#f)}set terminal(e){t(this.#f,e,!0)}setTerminal(e){this.terminal=e}get mode(){return this.terminal&&(this.on.files||this.on.run)?`build`:this.on.notes?`write`:`ask`}onMode=null;setLast(e){e&&!e.startsWith(`@`)&&(this.last=e,l(s(`isorite.last`),e))}async open(e,t=this.narrow){await a(o(e)),t&&this.to(`note`)}async home(){await a(i(`/notes`))}};export{_ as i,d as n,p as r,f as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as e,f as t,i as n,o as r,r as i,u as a,x as o}from"./
|
|
1
|
+
import{_ as e,f as t,i as n,o as r,r as i,u as a,x as o}from"./DfCZPwp1.js";import{a as s,s as c}from"./BLmF1B2i.js";import{a as l,c as u,d,f,g as p,h as m,i as h,l as g,m as ee,n as _,o as v,p as y,r as b,s as x,t as S,u as C}from"./DX4bJJO0.js";import{u as te}from"./-2Meesge.js";var w=class{domains=new Map;transitions=[];setDomains(e){if(e)for(let t of e){let e=t.domain;this.domains.set(e,{name:e,items:(t.items??[]).map(e=>({label:e.label}))})}}setTransitions(e){e&&(this.transitions=e.filter(e=>e.from!==e.to).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))}};function T(e,t){let n=new w;return n.setDomains(e.domains),n.setTransitions(e.transitions),{type:`cynefin`,title:e.title||t,accTitle:e.accTitle?e.accTitle.replace(/^\s+/g,``):void 0,accDescr:e.accDescr?e.accDescr.replace(/\n\s+/g,`
|
|
2
2
|
`):void 0,domains:n.domains,transitions:n.transitions}}var E=[{name:`cynefin-beta:`,pattern:`cynefin-beta:`},h(`cynefin-beta`),{name:`-->`,pattern:`-->`},{name:`:`,pattern:`:`},{name:`DOMAIN_NAME`,pattern:/complex|complicated|clear|chaotic|confusion/y},l,S,y,ee,g,C,b,v,x];function D(e){let t=new m(_(e,E,`cynefin`),E,`cynefin`),n={$type:`Cynefin`,domains:[],transitions:[]},r=()=>{for(;t.kinds[t.i]===9;)t.i++},i=()=>{t.kind!==-1&&(t.kind!==9&&t.fail(`a line break or the end of input`),r())};for(r(),t.kind!==1&&t.kind!==0&&t.fail(`'cynefin-beta'`),t.i++;t.kind!==-1;)switch(t.kind){case 9:t.i++;break;case 5:n.accDescr=u(t.take()),i();break;case 6:n.accTitle=p(t.take()),i();break;case 7:n.title=d(t.take()),i();break;case 4:{let e=t.take();if(t.accept(2)){let r={$type:`Transition`,from:e,to:t.expect(4)};t.accept(3)&&(r.label=f(t.expect(8))),i(),n.transitions.push(r);break}let a={$type:`DomainBlock`,domain:e,items:[]};for(r();t.kinds[t.i]===8;)a.items.push({$type:`DomainItem`,label:f(t.take())}),r();n.domains.push(a);break}default:t.fail(`a domain, a transition, a title, or a line break`)}return n}function O(e){let t=e+1831565813|0;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function k(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}function ne(e,t){return typeof e==`number`&&Number.isFinite(e)&&e!==0?e:k(t)}var re={segments:7,vertical:!0,pointStep:17,controlStep:31,controlShift:7},A={segments:7,vertical:!1,pointStep:23,controlStep:37,controlShift:11};function j(e,t,n,r,i,a){let o=(t-e)/a.segments,s=[],c=[];for(let t=0;t<=a.segments;t++){let l=t===0&&a.pinStart||t===a.segments&&a.pinEnd;s.push(e+t*o),c.push(l?n:n+O(r+t*a.pointStep)*i*2-i)}let l=a.vertical?[c[0],s[0]]:[s[0],c[0]];for(let e=0;e<a.segments;e++){let t=(s[e]+s[e+1])/2,n=i*1.5*(e%2==0?1:-1)*O(r+e*a.controlStep+a.controlShift);a.vertical?l.push(c[e]+n,t,c[e+1]-n,t,c[e+1],s[e+1]):l.push(t,c[e]+n,t,c[e+1]-n,s[e+1],c[e+1])}return l}function ie(e,t,n,r){let i=n-t;return[e,t,e+r,t+i*.2,e-r*1.5,t+i*.55,e+r*.5,t+i*.75,e-r,t+i*.85,e+r*.3,t+i*.95,e,n]}function M(e){let t=``;for(let n=2;n<e.length;n+=6)t+=`C${o(e[n])},${o(e[n+1])} ${o(e[n+2])},${o(e[n+3])} ${o(e[n+4])},${o(e[n+5])}`;return t}function N(e){let t=``;for(let n=e.length-6;n>=2;n-=6)t+=`C${o(e[n+2])},${o(e[n+3])} ${o(e[n])},${o(e[n+1])} ${o(e[n-2])},${o(e[n-1])}`;return t}function P(e){return`M${o(e[0])},${o(e[1])}${M(e)}`}function F(e,t,n,r){let i=`${o(n)},${o(r)}`;return`M${o(e-n)},${o(t)}A${i} 0 1,1 ${o(e+n)},${o(t)}A${i} 0 1,1 ${o(e-n)},${o(t)}Z`}var I=[[`complex`,0,0,0],[`complicated`,1,0,1],[`chaotic`,0,1,3],[`clear`,1,1,2]],ae=4,L=new Map([[`complex`,[`Complex`,`Probe → Sense → Respond`,`Emergent Practices`]],[`complicated`,[`Complicated`,`Sense → Analyse → Respond`,`Good Practices`]],[`clear`,[`Clear`,`Sense → Categorise → Respond`,`Best Practices`]],[`chaotic`,[`Chaotic`,`Act → Sense → Respond`,`Novel Practices`]],[`confusion`,[`Confusion`,``,`Disorder`]]]),oe=3,se=200,ce=10,le=4,R=6,ue=10,de=20,z=10;function B(e,t,n,r,i){let a=e.cynefin?.[t];return typeof a==`number`&&a>=r&&a<=i?a:n}function V(l,u,d){let f=d.fontSize??16,p=Math.round(f*.8125),m=Math.round(f*.875),h=d.measurer??te(d.fontFamily,d.fontFamilyMono),g=d.padding??8,ee=d.icons,_=u.cynefin?.showDomainDescriptions!==!1,v=B(u,`boundaryAmplitude`,8,0,50),y=ne(B(u,`seed`,0,-0x38d7ea4c68000,0x38d7ea4c68000),d.idPrefix??`pele`),b=Math.round(m*1.5),x=(e,t)=>{let n=a(e,!1,h,m,se);return{text:e,label:n,w:n.width+2*ce,h:Math.max(n.height,b)+2*le,overflow:t}},S=e=>{let t=L.get(e),n=a(t[0],!1,h,f,4e3,1),r=[];if(_)for(let e of[t[1],t[2]])e&&r.push(a(e,!1,h,p,4e3,2));let i=l.domains.get(e)?.items??[],o=e===`confusion`&&i.length>oe?oe:i.length,s=[];for(let e=0;e<o;e++)s.push(x(i[e].label,!1));o<i.length&&s.push(x(`+${i.length-o} more`,!0));let c=n.width,u=n.height;for(let e of r)c=Math.max(c,e.width),u+=e.height;s.length>0&&(u+=ue-R);for(let e of s)c=Math.max(c,e.w),u+=R+e.h;return{name:e,title:n,subtitles:r,badges:s,w:c,h:u,cx:0,cy:0}},C=I.map(([e])=>S(e)),w=S(`confusion`),T=Math.max(88,w.w*.71+8),E=Math.max(64,w.h*.71+6),D=B(u,`width`,640,100,1e4)/2,O=B(u,`height`,440,100,1e4)/2;for(let e of C)D=Math.max(D,e.w+2*de),O=Math.max(O,e.h+2*de);for(let e of C){let t=(D-e.w)/2,n=(O-e.h)/2;if((t/(T+z))**2+(n/(E+z))**2>=1)continue;let r=e.w+2*(T+z),i=e.h+2*(E+z);r*O<=D*i?D=Math.max(D,r):O=Math.max(O,i)}let k=a(l.title,!1,h,f,4e3,1),V=k.height>0?k.height+12:0,H=2*D,fe=2*O,U=g,W=g+V,G=U+D,K=W+O,q=U+H,pe=W+fe,J=j(W,K,G,y,v,{...re,segments:4,pinEnd:!0}),Y=j(U,G,K,y+100,v,{...A,segments:4,pinEnd:!0}),X=j(G,q,K,y+200,v,{...A,segments:4,pinStart:!0}),Z=ie(G,K,pe,H*.03),Q=(e,t)=>t?`${o(e[e.length-2])},${o(e[e.length-1])}`:`${o(e[0])},${o(e[1])}`,me=new Map([[`complex`,`M${o(U)},${o(W)}L${Q(J,!1)}${M(J)}${N(Y)}Z`],[`complicated`,`M${Q(J,!1)}L${o(q)},${o(W)}L${Q(X,!0)}${N(X)}${N(J)}Z`],[`chaotic`,`M${Q(Y,!1)}${M(Y)}${M(Z)}L${o(U)},${o(pe)}Z`],[`clear`,`M${Q(X,!1)}${M(X)}L${o(q)},${o(pe)}L${Q(Z,!0)}${N(Z)}Z`]]),he=``;for(let[e,,,n]of I)he+=`<path class="pele-cynefin-region" data-id="${e}" d="${me.get(e)}" fill="${t(n)}" fill-opacity="0.14"/>`;let ge=`<g class="pele-cynefin-boundaries" fill="none" stroke="var(--_b)" stroke-dasharray="6 3"><path d="${P(J)}"/><path d="${P(Y)}"/><path d="${P(X)}"/><path class="pele-cynefin-cliff" d="${P(Z)}" stroke="var(--_l)" stroke-width="2" stroke-dasharray="none" stroke-linecap="round"/></g>`,_e=F(G,K,T,E),ve=`<path d="${_e}" fill="var(--_bg)"/><path class="pele-cynefin-region" data-id="confusion" d="${_e}" fill="${t(ae)}" fill-opacity="0.18" stroke="var(--_b)" stroke-dasharray="4 2"/>`,ye=e=>{let t=e.cy-e.h/2,a=r(e.title,e.cx,t+e.title.height/2,` class="pele-label" font-weight="var(--_hw)"`);t+=e.title.height;for(let n of e.subtitles)a+=r(n,e.cx,t+n.height/2,` class="pele-cynefin-subtitle" font-size="${p}" font-style="italic" fill="var(--_m)"`),t+=n.height;t+=ue-R;for(let s of e.badges)t+=R,a+=`<g class="pele-node${s.overflow?` pele-cynefin-overflow`:``}"${s.overflow?``:` data-id="${n(s.text)}"`}><rect x="${o(e.cx-s.w/2)}" y="${o(t)}" width="${o(s.w)}" height="${o(s.h)}" fill="var(--_bg)" stroke="var(--_b)"${s.overflow?` stroke-dasharray="3 2"`:``}${i}/>`+r(s.label,e.cx,t+s.h/2,` class="pele-label" font-size="${m}"${s.overflow?` fill="var(--_m)"`:``}`,ee)+`</g>`,t+=s.h;return`<g class="pele-cynefin-domain" data-id="${e.name}">${a}</g>`},$=new Map,be=``;I.forEach(([e,t,n],r)=>{let i=C[r];i.cx=U+D*(t+.5),i.cy=W+O*(n+.5),$.set(e,i),be+=ye(i)}),w.cx=G,w.cy=K,$.set(`confusion`,w),be+=ye(w);let xe=(e,t,n)=>e===w?((t-G)/(T+4))**2+((n-K)/(E+4))**2<=1:Math.abs(t-e.cx)<=e.w/2+8&&Math.abs(n-e.cy)<=e.h/2+8,Se=``,Ce=new Map;for(let e of l.transitions){let t=$.get(e.from),n=$.get(e.to);if(!t||!n||t===n)continue;let i=e.from<e.to?`${e.from} ${e.to}`:`${e.to} ${e.from}`,l=Ce.get(i)??0;Ce.set(i,l+1);let u=n.cx-t.cx,d=n.cy-t.cy,f=Math.hypot(u,d)||1,m=(t.cx+n.cx)/2,g=(t.cy+n.cy)/2,_=-d*(m-G)+u*(g-K)>=0?1:-1,v=-d/f*_,y=u/f*_,b=(t!==w&&n!==w&&Math.abs(u)>1&&Math.abs(d)>1?2*(Math.hypot(T*v,E*y)+16):f*.15)+l*56,x=m+v*b,S=g+y*b,C=e=>{let r=1-e;return[r*r*t.cx+2*r*e*x+e*e*n.cx,r*r*t.cy+2*r*e*S+e*e*n.cy]},te=(e,t,n,r)=>{for(let i=0;i<16;i++){let i=(t+n)/2;xe(e,...C(i))===r?t=i:n=i}return(t+n)/2},D=1;for(;D<=48&&xe(t,...C(D/48));)D++;if(D>48)continue;let O=te(t,(D-1)/48,D/48,!0);for(;D<=48&&!xe(n,...C(D/48));)D++;let k=D>48?1:te(n,(D-1)/48,D/48,!1),[ne,re]=C(O),[A,j]=C(k),ie=(e,t,n)=>(1-O)*(1-k)*e+((1-O)*k+O*(1-k))*t+O*k*n,M=ie(t.cx,x,n.cx),N=ie(t.cy,S,n.cy),P=Math.hypot(A-M,j-N)||1,F=(A-M)/P,I=(j-N)/P,ae=c(`arrow_point`,A,j,F,I,`var(--_l)`);A-=F*s(`arrow_point`),j-=I*s(`arrow_point`);let L=``;if(e.label){let t=a(e.label,!1,h,p,se),[n,i]=C((O+k)/2),o=Math.abs(v)*t.width/2+Math.abs(y)*t.height/2+6,s=t.width/2+4,c=Math.min(Math.max(n+v*o,U+s),Math.max(q-s,U+s));L=r(t,c,i+y*o,` class="pele-edge-label" font-size="${p}"`,ee)}Se+=`<g class="pele-edge" data-id="${e.from}-${e.to}"><path d="M${o(ne)},${o(re)}Q${o(M)},${o(N)} ${o(A)},${o(j)}" fill="none" stroke="var(--_l)"/>`+ae+L+`</g>`}let we=Math.ceil(Math.max(H,k.width)+2*g),Te=Math.ceil(fe+V+2*g),Ee=r(k,U+H/2,g+k.height/2,` class="pele-title" font-weight="var(--_tw)"`)+`<g class="pele-cynefin-regions">${he}</g>`+ge+ve+be+(Se?`<g class="pele-edges">${Se}</g>`:``);return{svg:e(`cynefin`,we,Te,f,d,l,Ee),width:we,height:Te,links:[]}}var H={type:`cynefin`,parse:(e,t,n)=>T(D(e),n),render:V};export{H as cynefin};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as e,a as t,g as n,i as r,o as i,r as a,s as o,u as s,x as c}from"./
|
|
1
|
+
import{_ as e,a as t,g as n,i as r,o as i,r as a,s as o,u as s,x as c}from"./DfCZPwp1.js";import{i as l}from"./DciMwFJ1.js";import{i as u,t as d}from"./Bt7VOT5H.js";import{PeleError as f,h as p,s as m,u as ee}from"./-2Meesge.js";var h=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],g=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`];function _(e){return!Number.isNaN(e.getTime())}function v(e,t){let n=String(e);return n.length>=t?n:`0`.repeat(t-n.length)+n}function te(e){let t=[`th`,`st`,`nd`,`rd`],n=e%100;return e+(t[(n-20)%10]||t[n]||t[0])}function y(e){let t=-Math.round(e.getTimezoneOffset()/15)*15;return t===0?0:t}function b(e){let t=y(e),n=Math.abs(t);return(t>=0?`+`:`-`)+v(Math.floor(n/60),2)+`:`+v(n%60,2)}function x(e){return e.getDay()||7}function S(e,t){let n=new Date(e);return n.setDate(n.getDate()+t),n}function ne(e){let t=new Date(e.getFullYear(),e.getMonth()+1,0);return t.setHours(23,59,59,999),t.getDate()}function re(e,t){let n=new Date(e);return n.setDate(1),t(n),n.setDate(Math.min(e.getDate(),ne(n))),n}function ie(e,t,n){switch(n){case`M`:return re(e,n=>n.setMonth(e.getMonth()+t));case`y`:return re(e,n=>n.setFullYear(e.getFullYear()+t));case`d`:return S(e,Math.round(t));case`w`:return S(e,Math.round(7*t));case`h`:return new Date(e.getTime()+t*36e5);case`m`:return new Date(e.getTime()+t*6e4);case`s`:return new Date(e.getTime()+t*1e3);default:return new Date(e.getTime()+t)}}function ae(e){return S(e,4-x(e))}function oe(e){let t=ae(e),n=new Date(t.getFullYear(),0,1),r=x(n),i=S(n,4-r+(r>4?7:0)),a=(y(i)-y(t))*6e4,o=(t.getTime()-i.getTime()-a)/6048e5;return(o<0?Math.ceil(o)||0:Math.floor(o))+1}var se=/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,ce=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C=`YYYY-MM-DDTHH:mm:ssZ`;function le(e,t){if(!_(e))return`Invalid Date`;let n=t||C;if(n===`YYYY-MM-DD`)return w(e);let r=!1,i=n.replace(se,t=>{switch(t){case`Q`:return String(Math.ceil((e.getMonth()+1)/3));case`Do`:return`[`+te(e.getDate())+`]`;case`GGGG`:return String(ae(e).getFullYear());case`W`:return String(oe(e));case`WW`:return v(oe(e),2);case`k`:return String(e.getHours()||24);case`kk`:return v(e.getHours()||24,2);case`X`:return String(Math.floor(e.getTime()/1e3));case`x`:return String(e.getTime());case`gggg`:case`wo`:case`w`:case`ww`:case`z`:case`zzz`:return r=!0,t;default:return t}});if(r)return;let a=e.getHours();return i.replace(ce,(t,n)=>{if(n)return n;switch(t){case`YY`:return String(e.getFullYear()).slice(-2);case`YYYY`:return v(e.getFullYear(),4);case`M`:return String(e.getMonth()+1);case`MM`:return v(e.getMonth()+1,2);case`MMM`:return h[e.getMonth()].slice(0,3);case`MMMM`:return h[e.getMonth()];case`D`:return String(e.getDate());case`DD`:return v(e.getDate(),2);case`d`:return String(e.getDay());case`dd`:return g[e.getDay()].slice(0,2);case`ddd`:return g[e.getDay()].slice(0,3);case`dddd`:return g[e.getDay()];case`H`:return String(a);case`HH`:return v(a,2);case`h`:return String(a%12||12);case`hh`:return v(a%12||12,2);case`a`:return a<12?`am`:`pm`;case`A`:return a<12?`AM`:`PM`;case`m`:return String(e.getMinutes());case`mm`:return v(e.getMinutes(),2);case`s`:return String(e.getSeconds());case`ss`:return v(e.getSeconds(),2);case`SSS`:return v(e.getMilliseconds(),3);case`Z`:return b(e);default:return b(e).replace(`:`,``)}})}function w(e){let t=e.getFullYear(),n=e.getMonth()+1,r=e.getDate();return(t>=1e3&&t<=9999?t:v(t,4))+(n<10?`-0`:`-`)+n+(r<10?`-0`:`-`)+r}var ue=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,T=/\[[^\]]+]/g,E=/\d/,D=/\d\d/,O=/\d{3}/,de=/\d{4}/,k=/\d\d?/,A=/[+-]?\d+/,fe=/[+-]\d\d:?(\d\d)?|Z/,j=/\d*[^-_:/,()\s\d]+/;function M(e){return(t,n)=>(t[e]=+n,!0)}var N=(e,t)=>{if(t===`Z`)return e.offset=0,!0;let n=t.match(/([+-]|\d\d)/g),r=n[1]*60+(+n[2]||0);return e.offset=r===0?0:n[0]===`+`?-r:r,!0};function pe(e){return(t,n)=>{let r=e.indexOf(n)+1;return r<1?!1:(t.month=r%12||r,!0)}}var me=new Map([[`A`,{re:j,read:(e,t)=>(e.afternoon=t===`PM`,!0)}],[`a`,{re:j,read:(e,t)=>(e.afternoon=t===`pm`,!0)}],[`Q`,{re:E,read:(e,t)=>(e.month=(t-1)*3+1,!0)}],[`S`,{re:E,read:(e,t)=>(e.milliseconds=t*100,!0)}],[`SS`,{re:D,read:(e,t)=>(e.milliseconds=t*10,!0)}],[`SSS`,{re:O,read:(e,t)=>(e.milliseconds=+t,!0)}],[`s`,{re:k,read:M(`seconds`)}],[`ss`,{re:k,read:M(`seconds`)}],[`m`,{re:k,read:M(`minutes`)}],[`mm`,{re:k,read:M(`minutes`)}],[`H`,{re:k,read:M(`hours`)}],[`h`,{re:k,read:M(`hours`)}],[`HH`,{re:k,read:M(`hours`)}],[`hh`,{re:k,read:M(`hours`)}],[`D`,{re:k,read:M(`day`)}],[`DD`,{re:D,read:M(`day`)}],[`Do`,{re:j,read:(e,t)=>{let n=t.match(/\d+/);if(!n)return!1;e.day=+n[0],e.dayGiven=!0;for(let n=1;n<=31;n++)te(n)===t&&(e.day=n);return!0}}],[`w`,{re:k,read:M(`week`)}],[`ww`,{re:D,read:M(`week`)}],[`M`,{re:k,read:M(`month`)}],[`MM`,{re:D,read:M(`month`)}],[`MMM`,{re:j,read:pe(h.map(e=>e.slice(0,3)))}],[`MMMM`,{re:j,read:pe(h)}],[`Y`,{re:A,read:M(`year`)}],[`YY`,{re:D,read:(e,t)=>(e.year=+t+(+t>68?1900:2e3),!0)}],[`YYYY`,{re:de,read:M(`year`)}],[`Z`,{re:fe,read:N}],[`ZZ`,{re:fe,read:N}]]),P,F=null;function he(e){if(e===P)return F;if(P=e,F=null,/[Ll]/.test(e.replace(T,``)))return null;let t=e.match(ue);return t?(F=t.map(e=>me.get(e)??e.replace(/^\[|\]$/g,``)),F):null}function I(e,t,n){if(t===`x`||t===`X`)return new Date((t===`X`?1e3:1)*Number(e));let r=he(t);if(!r)return;let i={},a=e,o=0;for(let e of r){if(typeof e==`string`){o+=e.length;continue}let t=e.re.exec(a.slice(o));if(!t||!e.read(i,t[0]))return;a=a.replace(t[0],``)}i.afternoon!==void 0&&i.hours!==void 0&&(i.afternoon?i.hours<12&&(i.hours+=12):i.hours===12&&(i.hours=0));let s=i.dayGiven||i.day?i.day:!i.year&&!i.month?n.getDate():1,c=i.year||n.getFullYear(),l=0;i.year&&!i.month||(l=i.month>0?i.month-1:n.getMonth());let u=i.hours||0,d=i.minutes||0,f=i.seconds||0,p=i.milliseconds||0;if(i.offset!==void 0)return new Date(Date.UTC(c,l,s,u,d,f,p+i.offset*6e4));if(!i.week)return new Date(c,l,s,u,d,f,p)}function L(e,t,n){let r=I(e,t,n);return r&&_(r)&&le(r,t)===e?r:void 0}var ge=/^[YMDHhmsSZXx\-/.:, T]*$/,_e=/^\s*(active|done|crit|milestone|vert)\s*$/,ve=/^after\s+([\d\w- ]+)/,R=/^until\s+([\d\w- ]+)/,z=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/,ye=/[\s,]+/,B=/^\d+$/,be=new Set(g.map(e=>e.toLowerCase())),V=4e8,xe=400,Se=200,Ce=400;function we(e){let t=e===void 0?NaN:+e;return Number.isFinite(t)?t:Date.now()}function Te(e){let t=z.exec(e.trim());return t?[Number.parseFloat(t[1]),t[2]]:[NaN,`ms`]}function Ee(e,t){let n=new Set(e);for(let e of t.toLowerCase().split(ye))e!==``&&n.add(e);return[...n]}var De=class{type=`gantt`;title;accTitle;accDescr;dateFormat=``;axisFormat=``;tickInterval;todayMarker=``;includes=[];excludes=[];inclusiveEndDates=!1;topAxis=!1;displayMode=``;weekday;weekend=`saturday`;sections=[];links=new Map;tasks=[];byId=new Map;currentSection=``;taskCount=0;lastOrder=0;lastTaskId;options;now=0;work=0;includeSet=new Set;excludeSet=new Set;excludedDays=[];datedTokens=!1;constructor(e={}){this.options=e}setDateFormat(e){this.dateFormat=e}enableInclusiveEndDates(){this.inclusiveEndDates=!0}TopAxis(){this.topAxis=!0}setAxisFormat(e){this.axisFormat=e}setTickInterval(e){this.tickInterval=e}setTodayMarker(e){this.todayMarker=e}setIncludes(e){this.includes=Ee(this.includes,e)}setExcludes(e){this.excludes=Ee(this.excludes,e)}setWeekday(e){this.weekday=e}setWeekend(e){this.weekend=e}setDiagramTitle(e){this.title=e}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,``)}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
|
|
2
2
|
`)}addSection(e){this.currentSection=e,this.sections.push(e)}addTask(e,t){let n=(t.startsWith(`:`)?t.slice(1):t).split(`,`),r={id:``,task:e,section:this.currentSection,startTime:void 0,endTime:void 0,renderEndTime:null,manualEndTime:!1,processed:!1,active:!1,done:!1,crit:!1,milestone:!1,vert:!1,order:-1,classes:[],prevTaskId:this.lastTaskId,raw:{data:t,start:void 0,end:``}},i;for(;n.length>0&&(i=_e.exec(n[0]))!==null;)r[i[1]]=!0,n.shift();if(n.length===0)throw new f(`Task "${e.trim()}" needs a duration or an end date.`,`semantic`,{type:`gantt`});if(n.length>3)throw new f(`Task "${e.trim()}" has too many fields. A task takes an id, a start, and an end or duration.`,`semantic`,{type:`gantt`});for(let e=0;e<n.length;e++)n[e]=n[e].trim();n.length===3?r.id=n[0]:(this.taskCount++,r.id=`task`+this.taskCount),n.length>1&&(r.raw.start=n[n.length-2]),r.raw.end=n[n.length-1],r.vert||(r.order=this.lastOrder++),this.tasks.push(r),this.lastTaskId=r.id,this.byId.set(r.id,r)}setLink(e,t){let n=u(t);for(let t of e.split(`,`))this.byId.has(t)&&this.links.set(t,n);this.setClass(e,`clickable`)}setClickEvent(e,t,n){this.setClass(e,`clickable`)}setClass(e,t){for(let n of e.split(`,`))this.byId.get(n)?.classes.push(t)}getTasks(e){this.now=we(e),this.work=0,this.includeSet=new Set(this.includes),this.excludeSet=new Set(this.excludes);let t=this.weekend===`friday`?5:this.weekend===`saturday`?6:NaN,n=this.excludeSet.has(`weekends`);this.excludedDays=g.map((e,r)=>{let i=r||7;return n&&(i===t||i===t+1)||this.excludeSet.has(e.toLowerCase())}),this.datedTokens=this.includes.length>0||!ge.test(this.dateFormat.trim());for(let e of this.excludes)e!==`weekends`&&!be.has(e)&&(this.datedTokens=!0);for(let e of this.tasks)e.startTime=e.endTime=void 0,e.renderEndTime=null,e.processed=e.manualEndTime=!1;let r=this.compileTasks();for(let e=0;!r&&e<10;e++)r=this.compileTasks();return this.tasks}isInvalidDate(e){let t=this.excludedDays[e.getDay()];if(!this.datedTokens)return t;let n=this.dateFormat.trim(),r=w(e),i=r;this.spend(Se),n!==`YYYY-MM-DD`&&(this.spend(Ce+n.length*8),i=le(e,n));let a=e=>e.has(r)||i!==void 0&&e.has(i);return a(this.includeSet)?!1:t||a(this.excludeSet)}spend(e){if(this.work+=e,this.work>V)throw new f(`The gantt chart takes too much work to schedule.`,`limit`,{type:`gantt`})}parse(e,t){return this.spend((t.length+1)*(e.length+1)),L(e,t,new Date(this.now))}today(){let e=new Date(this.now);return e.setHours(0,0,0,0),e}warn(e){this.options.warn&&this.options.warn(e())}compileTasks(){let e=!0;for(let t of this.tasks)this.compileTask(t),e&&=t.processed;return e}compileTask(e){let t=e.raw.start;if(t===void 0){let t=e.prevTaskId===void 0?void 0:this.byId.get(e.prevTaskId);e.startTime=t?t.endTime:this.today()}else{let n=this.getStartDate(t);n&&(e.startTime=n)}e.startTime&&(e.endTime=this.getEndDate(e.startTime,e.raw.end),e.endTime&&(e.processed=!0,e.manualEndTime=this.parse(e.raw.end,`YYYY-MM-DD`)!==void 0,this.checkTaskDates(e)))}references(e,t){let n=[],r;for(let e of t.split(` `)){if(e===``)continue;let t=this.byId.get(e);t?n.push(t):(r??=[]).push(e)}if(r){let t=r;this.warn(()=>`Gantt: "${e}" refers to task ids that do not exist: ${t.join(`, `)}.`)}return n}getStartDate(e){let t=e.trim(),n=this.dateFormat.trim();if((n===`x`||n===`X`)&&B.test(t))return this.checked(new Date(Number(t)),t);let r=ve.exec(t);if(r!==null){let e=this.references(`after`,r[1]),t;for(let n of e)(!t||n.endTime>t.endTime)&&(t=n);return t?t.endTime:this.today()}let i=this.parse(t,n);if(i)return i;let a=new Date(t);if(!_(a)||a.getFullYear()<-1e4||a.getFullYear()>1e4)throw new f(`Invalid date:`+t,`semantic`,{type:`gantt`});return a}checked(e,t){if(!_(e))throw new f(`Invalid date:`+t,`semantic`,{type:`gantt`});return e}getEndDate(e,t){let n=t.trim(),r=R.exec(n);if(r!==null){let e=this.references(`until`,r[1]),t;for(let n of e)(!t||n.startTime<t.startTime)&&(t=n);return t?t.startTime:this.today()}let i=this.dateFormat.trim(),a=this.parse(n,i);if(a)return this.inclusiveEndDates?S(a,1):a;let[o,s]=Te(n);if(Number.isNaN(o))return this.warn(()=>`Gantt: "${n}" is neither a date in the "${i}" format nor a duration such as "3d", so the task gets no duration.`),new Date(e);let c=ie(e,o,s);return _(c)?c:new Date(e)}checkTaskDates(e){if(this.excludes.length===0||e.manualEndTime)return;let t=S(e.startTime,1),n=new Date(e.endTime),r=+S(n,1e4),i=!1,a=null;for(;+t<=+n;){if(this.spend(xe),i||(a=+n),i=this.isInvalidDate(t),i&&(n.setDate(n.getDate()+1),+n>r))throw new f("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.",`semantic`,{type:`gantt`});t.setDate(t.getDate()+1)}e.endTime=n,e.renderEndTime=a===null?null:new Date(a)}},Oe=`$end.INVALID.open_directive.acc_title.acc_title_value.acc_descr.acc_descr_value.acc_descr_multiline_value.NL.href.callbackname.callbackargs.click.gantt.dateFormat.inclusiveEndDates.topAxis.axisFormat.tickInterval.includes.excludes.todayMarker.weekday_monday.weekday_tuesday.weekday_wednesday.weekday_thursday.weekday_friday.weekday_saturday.weekday_sunday.weekend_friday.weekend_saturday.date.title.accDescription.section.taskTxt.taskData.:.EOF`.split(`.`),ke=/accTitle\s*:\s*/iy,Ae=/accDescr\s*:\s*/iy,je=/accDescr\s*\{\s*/iy,Me=/href\s+"/iy,Ne=/call\s+/iy,Pe=/click\s+/iy,H=/\(\s*\)/y,Fe=/weekday\s+(monday|tuesday|wednesday|thursday|friday|saturday|sunday)\b/iy,Ie=[`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`,`sunday`],U=/weekend\s+(?:(friday)|saturday)\b/iy,Le=/\d\d\d\d-\d\d-\d\d\b/y,Re=/title[^\S\r\n]*(?=[\r\n]|$)/iy,ze=new Map([[97,[[/axisFormat\s[^#\n;]+/iy,17],[/accDescription\s[^#\n;]+/iy,33]]],[103,[[/gantt\b/iy,13]]],[100,[[/dateFormat\s[^#\n;]+/iy,14]]],[105,[[/inclusiveEndDates\b/iy,15],[/includes\s[^#\n;]+/iy,19]]],[116,[[/topAxis\b/iy,16],[/tickInterval\s[^#\n;]+/iy,18],[/todayMarker\s[^\n;]+/iy,21],[/title[^\S\r\n][^\n]+/iy,32]]],[101,[[/excludes\s[^#\n;]+/iy,20]]],[115,[[/section\s[^\n]+/iy,34]]]]);function Be(e){let t=e.length,n=[],r=[],i=[],a=0,o=0,s=(t,a,s)=>{n.push(t),r.push(e.slice(a,s)),i.push(a),o=s},c=t=>(t.lastIndex=o,t.test(e)?t.lastIndex:-1),l=(n,r)=>{let i=e.indexOf(n,r);return i===-1?t:i},u=t=>{let n;switch(t|32){case 97:if((n=c(ke))>=0)return a=1,s(3,o,n),!0;if((n=c(Ae))>=0)return a=2,s(5,o,n),!0;if((n=c(je))>=0)return a=3,o=n,!0;break;case 104:if((n=c(Me))>=0)return a=4,o=n,!0;break;case 99:if((n=c(Ne))>=0)return a=5,o=n,!0;if((n=c(Pe))>=0)return a=7,o=n,!0;break;case 116:if((n=c(Re))>=0)return o=n,!0;break;case 119:{Fe.lastIndex=o;let t=Fe.exec(e);if(t)return s(22+Ie.indexOf(t[1].toLowerCase()),o,Fe.lastIndex),!0;if(U.lastIndex=o,t=U.exec(e),t)return s(t[1]===void 0?30:29,o,U.lastIndex),!0;break}}let r=ze.get(t|32);if(r){for(let[e,t]of r)if((n=c(e))>=0)return s(t,o,n),!0}return!1};for(;;){if(o>=t){let e=38;switch(a){case 1:e=4;break;case 2:e=6;break;case 3:e=7;break;case 4:e=9;break;case 5:e=10;break;case 6:e=11;break;case 7:e=12}s(e,t,t);break}let d=e.charCodeAt(o);switch(a){case 0:{let a=e.charCodeAt(o+1);if(d===37){if(a!==37){let t=l(`
|
|
3
3
|
`,o+1);for(;e.charCodeAt(t)===10;)t++;o=t}else{if(e.charCodeAt(o+2)===123)return s(2,o,o+3),s(1,o,o),{types:n,texts:r,starts:i};o=l(`
|
|
4
4
|
`,o+2)}}else if(d===10){let t=o+1;for(;e.charCodeAt(t)===10;)t++;s(8,o,t)}else if(p(d))for(o++;o<t&&p(e.charCodeAt(o));)o++;else{if(u(d))break;if(d>=48&&d<=57&&c(Le)>=0)s(31,o,o+10);else if(d!==58){let n=o+1;for(;n<t;){let t=e.charCodeAt(n);if(t===58||t===10)break;n++}s(35,o,n)}else{let n=o+1;for(;n<t;){let t=e.charCodeAt(n);if(t===35||t===10||t===59)break;n++}s(n>o+1?36:37,o,n)}}break}case 1:case 2:{let e=a===1?4:6;a=0,s(e,o,l(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{t as flowchart}from"./gPtCGHiy.js";
|