zidane-gui 9.3.1 → 9.4.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/out/main/chunks/{remote-hosts-B8_tzg_n.js → remote-hosts-CSiGJAfm.js} +1 -1
- package/out/main/chunks/{session-search-sql-2EUzjHAT.js → session-search-sql-D51BmAO2.js} +5 -5
- package/out/main/index.js +4397 -4086
- package/out/main/session-search-worker.js +1 -1
- package/out/preload/index.mjs +36 -2
- package/out/renderer/assets/{24BXRY42-eTlQfl4v.js → 24BXRY42-0UXaaWjY.js} +1 -1
- package/out/renderer/assets/{4FHPYW2L-BHx1bBmw.js → 4FHPYW2L-BWpHahlW.js} +1 -1
- package/out/renderer/assets/{4LWW3ZNH-D7lTurDT.js → 4LWW3ZNH-CPyJ9o9Y.js} +1 -1
- package/out/renderer/assets/{5XYWFMKW-e04QMbw9.js → 5XYWFMKW-ZZpHHfGa.js} +1 -1
- package/out/renderer/assets/{64PMEAB3-DTIFpDpU.js → 64PMEAB3-DOEnEuzl.js} +1 -1
- package/out/renderer/assets/{6BEWHPQE-BrYtHcZG.js → 6BEWHPQE-C2ZZckdj.js} +1 -1
- package/out/renderer/assets/{6PIGVMFT-CoAPPYTl.js → 6PIGVMFT-CRGq6eh3.js} +1 -1
- package/out/renderer/assets/{75JW6PN6-JbXPfJg4.js → 75JW6PN6-CYzAa9yx.js} +1 -1
- package/out/renderer/assets/{7XWI72E6-CFY3Kecs.js → 7XWI72E6-C_GZbyIF.js} +1 -1
- package/out/renderer/assets/{BGW36YJW-DhmSG9tb.js → BGW36YJW-BAwgTZ_z.js} +1 -1
- package/out/renderer/assets/{CGIZI67J-Cr9B0EmW.js → CGIZI67J-BxXITbQC.js} +1 -1
- package/out/renderer/assets/{CodeEditor-C6EJBlGG.js → CodeEditor-CLsAw7eu.js} +2 -2
- package/out/renderer/assets/{ComposerEditor-oFIdMkLB.js → ComposerEditor-BqnIn2NQ.js} +1 -1
- package/out/renderer/assets/{DNNCRC2E-CMqlK0W6.js → DNNCRC2E-kbsNJgPT.js} +1 -1
- package/out/renderer/assets/DiffsTab--BHt7StP.js +3 -0
- package/out/renderer/assets/{E67EBMDD-C_T2QnwF.js → E67EBMDD-BOeJkFNZ.js} +1 -1
- package/out/renderer/assets/{EFYWJBJK-Cbn-VZcb.js → EFYWJBJK-CFT5CQUG.js} +1 -1
- package/out/renderer/assets/{EXE5EH6O-SXdUe5We.js → EXE5EH6O-Cbj5xPKl.js} +1 -1
- package/out/renderer/assets/{EditorWorkers-bVeEZI8X.js → EditorWorkers-CXBU_HFf.js} +1 -1
- package/out/renderer/assets/{FilesTab-DtM2Q5R0.js → FilesTab-CZHD0eBx.js} +4 -4
- package/out/renderer/assets/{G6GPDDNC-XfFyRa0j.js → G6GPDDNC-Ax6dML4i.js} +1 -1
- package/out/renderer/assets/{G76NGGFM-Bj_m2WLJ.js → G76NGGFM-BxPXXNt_.js} +1 -1
- package/out/renderer/assets/{GH6G3TJC-wPRy41Zv.js → GH6G3TJC-CiCXY2r6.js} +1 -1
- package/out/renderer/assets/{HPNUA7RO-BhLNmX-t.js → HPNUA7RO-DiyW9VGu.js} +1 -1
- package/out/renderer/assets/{HQRGC5D7-dvTAT1Uv.js → HQRGC5D7-ArfvIYAC.js} +1 -1
- package/out/renderer/assets/{IX6Z2TVR-CzV_umYo.js → IX6Z2TVR-Df9chdw8.js} +1 -1
- package/out/renderer/assets/IconButtonTip-D0dQOfg6.js +1 -0
- package/out/renderer/assets/{J77NQRCJ-DTwwq3Ci.js → J77NQRCJ-DOWauTsf.js} +1 -1
- package/out/renderer/assets/{JAD36DTZ-DArKsMUT.js → JAD36DTZ-CJDdMCD5.js} +1 -1
- package/out/renderer/assets/{LF3NJQAX-DjYdE7YV.js → LF3NJQAX-B89ZqOpY.js} +1 -1
- package/out/renderer/assets/{LRZCOFJZ-C7m8fw-0.js → LRZCOFJZ-BBX_wZ5T.js} +1 -1
- package/out/renderer/assets/{N5NF2FGY-CqGhgjNF.js → N5NF2FGY-BoIFu-8L.js} +1 -1
- package/out/renderer/assets/{N7OWWQHY-BRk68LVa.js → N7OWWQHY-CloOgGu1.js} +1 -1
- package/out/renderer/assets/{NT5JY5WP-B1NtxJ-K.js → NT5JY5WP-BhjzefjG.js} +1 -1
- package/out/renderer/assets/{OT7W3RNY-CtDQ--Ld.js → OT7W3RNY-BRzBqtKB.js} +1 -1
- package/out/renderer/assets/{P67P66DB-LeAz_z3Z.js → P67P66DB-Dw-K1Ghu.js} +1 -1
- package/out/renderer/assets/{PFLLLM7K-CgODCVD8.js → PFLLLM7K-DfSPUrIT.js} +1 -1
- package/out/renderer/assets/{PUAMC4MJ-9REX_vGK.js → PUAMC4MJ-BnY1F2cF.js} +1 -1
- package/out/renderer/assets/{PVFCHRLY-CK5jTRjy.js → PVFCHRLY-BcyVPS3n.js} +1 -1
- package/out/renderer/assets/{PinnedSavedView-Dtdra7Gq.js → PinnedSavedView-ciRhY0cN.js} +1 -1
- package/out/renderer/assets/{QQW2P742-B2snHr_6.js → QQW2P742-D6aitZ24.js} +1 -1
- package/out/renderer/assets/{S63OEDPG-BeWWF1tc.js → S63OEDPG-Dlz1a9cD.js} +1 -1
- package/out/renderer/assets/{SG5TVYLW-ClCsbQ87.js → SG5TVYLW-Bu7LZZpx.js} +1 -1
- package/out/renderer/assets/{SavedViewArtifact-ATjDgAUF.js → SavedViewArtifact-CM9L4mc8.js} +1 -1
- package/out/renderer/assets/{SidebarPreviewPane-DHllX0GN.js → SidebarPreviewPane-DkOCt7Gb.js} +1 -1
- package/out/renderer/assets/{TranscriptViews-DD_JshFH.js → TranscriptViews-aYvP71ow.js} +1 -1
- package/out/renderer/assets/{UGRSUGA2-jP6nv8HL.js → UGRSUGA2-avwOtJG1.js} +1 -1
- package/out/renderer/assets/{V44WA6U7-Dr_tS3uH.js → V44WA6U7-DMF87Y7j.js} +1 -1
- package/out/renderer/assets/{V67O4WWV-BRn52u9c.js → V67O4WWV-BsDLuBDb.js} +1 -1
- package/out/renderer/assets/{VBUCM3YD-0sLtn_Zp.js → VBUCM3YD-C6FrRswP.js} +1 -1
- package/out/renderer/assets/{VINGRCPA-n98Gf7V0.js → VINGRCPA-Do3Pv3Tc.js} +1 -1
- package/out/renderer/assets/{ViewBlock-DdcTHRu3.js → ViewBlock-B-ppjb34.js} +3 -3
- package/out/renderer/assets/{ViewCharts-BAw6tExV.js → ViewCharts-jvS22ppO.js} +2 -2
- package/out/renderer/assets/{ViewCustom-BzwMbjqg.js → ViewCustom-yFkoy6a-.js} +1 -1
- package/out/renderer/assets/{ViewExtension-Ch5_33Ra.js → ViewExtension-DuHxho6W.js} +1 -1
- package/out/renderer/assets/{ViewInputs-BHooAs2f.js → ViewInputs-VAMDh56H.js} +1 -1
- package/out/renderer/assets/{ViewMcpApp-CJnOESMk.js → ViewMcpApp-CH_W9CZt.js} +1 -1
- package/out/renderer/assets/{ViewSessionAction-BHJv5QNb.js → ViewSessionAction-66veqRhO.js} +1 -1
- package/out/renderer/assets/{ViewTables-DBTupg46.js → ViewTables-CKKDcYKH.js} +1 -1
- package/out/renderer/assets/{WL6DNKX4-Csfp__Nw.js → WL6DNKX4-Cq-YK4Uf.js} +1 -1
- package/out/renderer/assets/{WQ63CJYP-oSbguA5n.js → WQ63CJYP-fjrhTSVs.js} +1 -1
- package/out/renderer/assets/{XOYAOB3S-DfDDKmX8.js → XOYAOB3S-CAQPI0he.js} +1 -1
- package/out/renderer/assets/{Y5LQLG3M-BnZ8APdi.js → Y5LQLG3M-DKntYAaW.js} +1 -1
- package/out/renderer/assets/{YIK6JTN6-Bunk5CDx.js → YIK6JTN6-CcjcC5JX.js} +1 -1
- package/out/renderer/assets/{core-BbPUgmX7.js → core-Cj89wpQh.js} +4 -4
- package/out/renderer/assets/{file-tabs-CFdJBYJ9.js → file-tabs-PoAgFa7v.js} +1 -1
- package/out/renderer/assets/{ghostty-web-Dn7o-dzQ.js → ghostty-web-DiMuvUtH.js} +1 -1
- package/out/renderer/assets/{highlights-eTGcn9lP.js → highlights-7WH0ppQl.js} +1 -1
- package/out/renderer/assets/{highlights-D4Jo_Sz0.js → highlights-DnSmFBdQ.js} +1 -1
- package/out/renderer/assets/index-CiuUSFeC.js +11 -0
- package/out/renderer/assets/kit-CD3F-f6F.js +147 -0
- package/out/renderer/assets/{langs-CXhlGiW6.js → langs-D5CRC9qz.js} +1 -1
- package/out/renderer/assets/{lazy-D3tN-GAO.js → lazy-CUmWiDAP.js} +3 -3
- package/out/renderer/assets/{loader-DGyfh0zB.js → loader-CPY9efuc.js} +1 -1
- package/out/renderer/assets/{pierre-theme-BZvsTYqQ.js → pierre-theme-BrzM0xZU.js} +3 -3
- package/out/renderer/assets/setting-demos-BW7cG2_G.css +1 -0
- package/out/renderer/assets/setting-demos-DEURBrvf.js +1 -0
- package/out/renderer/assets/{shiki-Wqv4XEGM.js → shiki-DFrbO9j3.js} +1 -1
- package/out/renderer/assets/{sidebar-layout-sK8ujsHX.js → sidebar-layout-fobokay5.js} +1 -1
- package/out/renderer/assets/{stream-tokenizer-C18hljKL.js → stream-tokenizer-CT1HAjvR.js} +1 -1
- package/out/renderer/assets/{themes-Dfx1_kFe.js → themes-Cj62ov9J.js} +1 -1
- package/out/renderer/assets/{useFind-BBxfQuQ2.js → useFind-Cdl0rVJO.js} +3 -3
- package/out/renderer/assets/{useFolderChanges-BcfSJoBT.js → useFolderChanges-C9L_NOgw.js} +2 -2
- package/out/renderer/assets/{view-preview-B2Rj--lZ.js → view-preview-BvCO9WZH.js} +1 -1
- package/out/renderer/assets/{zoom-reset-l-YVDJrI.js → zoom-reset-COqHFP45.js} +1 -1
- package/out/renderer/index.html +5 -5
- package/out/renderer/view-preview.html +6 -6
- package/package.json +2 -2
- package/out/renderer/assets/DiffsTab-D690H0Dy.js +0 -3
- package/out/renderer/assets/IconButtonTip-P9QUxPjA.js +0 -1
- package/out/renderer/assets/index-c95EBMdk.js +0 -8
- package/out/renderer/assets/kit-C9O_D5xC.js +0 -147
- package/out/renderer/assets/setting-demos-B0787McX.js +0 -1
- package/out/renderer/assets/setting-demos-vtrBsYTd.css +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i}from"./V44WA6U7-
|
|
1
|
+
import{i}from"./V44WA6U7-DMF87Y7j.js";import{f}from"./DKTLEL5E-CJTkVtjr.js";import{x as x$1,D,O,$,L,V as V$1,W,G,P as P$1,H,j,z,B as B$1,U}from"./EXE5EH6O-Cbj5xPKl.js";import{_ as _n,d as cn}from"./EFYWJBJK-CFT5CQUG.js";import{g as gt$1,I as It$1,Y as Yt$1}from"./BGW36YJW-BAwgTZ_z.js";import{R,O as Ot,Y as Yt,m,T as Tn,h as Yn,L as Le,S,j as jn}from"./lazy-CUmWiDAP.js";import"./kit-CD3F-f6F.js";import"./vendor-react-CxJ4vs-5.js";import"./vendor-motion-C2jPaSqL.js";import"./vendor-owxl31sT.js";import"./core-Cj89wpQh.js";import"./vendor-editor-gVJMCtGz.js";var ae=class{nodes=new Map;labels;links=[];trends=new Map;pipelines=new Map;annotations=[];notes=[];accelerators=[];deaccelerators=[];annotationsBox;axes={};size;addNode(e){let t=this.nodes.get(e.id)??{id:e.id,label:e.label};this.nodes.set(e.id,{...t,...e,className:e.className??t.className,labelOffsetX:e.labelOffsetX??t.labelOffsetX,labelOffsetY:e.labelOffsetY??t.labelOffsetY}),this.labels=void 0}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});let t=this.nodes.get(e);t&&(t.isPipelineParent=!0)}addPipelineComponent(e,t){this.pipelines.get(e)?.componentIds.push(t);let r=this.nodes.get(t);r&&(r.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,t){this.annotationsBox={x:e,y:t}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,t){this.size={width:e,height:t}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;if(!this.labels){this.labels=new Map;for(let[t,r]of this.nodes)this.labels.has(r.label)||this.labels.set(r.label,t)}return this.labels.get(e)??e}build(){let e=[];for(let t of this.nodes.values()){if(typeof t.x!="number"||typeof t.y!="number")throw new R(`Node "${t.label}" is missing coordinates`,"semantic",{type:"wardley"});e.push(t)}return{nodes:e,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}};function ie(n,e){let t=n<=1?n*100:n;if(t<0||t>100)throw new R(`${e} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${n}`,"semantic",{type:"wardley"});return t}function B(n,e,t){return{x:ie(e,`${t} evolution`),y:ie(n,`${t} visibility`)}}function ct(n){return n==="+<>"?"bidirectional":n==="+<"?"backward":n==="+>"?"forward":void 0}function Lt(n){if(!n?.startsWith("+"))return{};let e=n.indexOf("'",2),t=n[1]==="'"&&e!==-1?n.slice(2,e):void 0;return n.includes("<>")?{flow:"bidirectional",label:t}:n.includes("<")?{flow:"backward",label:t}:n.includes(">")?{flow:"forward",label:t}:{label:t}}function dt(n){return n?[(n.negX?-1:1)*n.offsetX,(n.negY?-1:1)*n.offsetY]:[void 0,void 0]}function _t(n,e){n.size&&e.setSize(n.size.width,n.size.height),n.evolution&&e.setAxes({stages:n.evolution.stages.map(t=>t.secondName?`${t.name.trim()} / ${t.secondName.trim()}`:t.name.trim()),stageBoundaries:n.evolution.stages.filter(t=>t.boundary!==void 0).map(t=>t.boundary)});for(let t of n.anchors){let r=B(t.visibility,t.evolution,`Anchor "${t.name}"`);e.addNode({id:t.name,label:t.name,x:r.x,y:r.y,className:"anchor"})}for(let t of n.components){let r=B(t.visibility,t.evolution,`Component "${t.name}"`),[w,u]=dt(t.label);e.addNode({id:t.name,label:t.name,x:r.x,y:r.y,className:"component",labelOffsetX:w,labelOffsetY:u,inertia:t.inertia,sourceStrategy:t.decorator?.strategy})}for(let t of n.notes){let r=B(t.visibility,t.evolution,`Note "${t.text}"`);e.addNote({text:t.text,x:r.x,y:r.y})}for(let t of n.pipelines){let r=e.getNode(t.parent);if(!r||typeof r.y!="number")throw new R(`Pipeline "${t.parent}" must reference an existing component with coordinates.`,"semantic",{type:"wardley"});let w=r.y;e.startPipeline(t.parent);for(let u of t.components){let k=`${t.parent}_${u.name}`,[g,_]=dt(u.label),$2=ie(u.evolution,`Pipeline component "${u.name}" evolution`);e.addNode({id:k,label:u.name,x:$2,y:w,className:"pipeline-component",labelOffsetX:g,labelOffsetY:_,inertia:void 0,sourceStrategy:void 0}),e.addPipelineComponent(t.parent,k)}}for(let t of n.links){let r=!!t.arrow&&(t.arrow.includes("-.->")||t.arrow.includes(".-.")),w=Lt(t.arrow),u=ct(t.fromPort)??ct(t.toPort)??w.flow;e.addLink({source:e.resolveNodeId(t.from),target:e.resolveNodeId(t.to),dashed:r,label:w.label??t.linkLabel,flow:u})}for(let t of n.evolves){let r=e.getNode(t.component);r?.y!==void 0&&e.addTrend({nodeId:t.component,targetX:ie(t.target,`Evolve target for "${t.component}"`),targetY:r.y})}if(n.annotations.length>0){let t=B(n.annotations[0].x,n.annotations[0].y,"Annotations box");e.setAnnotationsBox(t.x,t.y)}for(let t of n.annotation){let r=B(t.x,t.y,`Annotation ${t.number}`);e.addAnnotation({number:t.number,coordinates:[{x:r.x,y:r.y}],text:t.text})}for(let t of n.accelerators){let r=B(t.x,t.y,`Accelerator "${t.name}"`);e.addAccelerator({name:t.name,x:r.x,y:r.y})}for(let t of n.deaccelerators){let r=B(t.x,t.y,`Deaccelerator "${t.name}"`);e.addDeaccelerator({name:t.name,x:r.x,y:r.y})}}function pt(n,e){let t=new ae;return _t(n,t),{type:"wardley",title:n.title||e,accTitle:n.accTitle?n.accTitle.replace(/^\s+/g,""):void 0,accDescr:n.accDescr?n.accDescr.replace(/\n\s+/g,`
|
|
2
2
|
`):void 0,...t.build()}}function ft(n,e){let t=e;for(let r=n.charCodeAt(t);r>=48&&r<=57;r=n.charCodeAt(t))t++;return t}function Mt(){let n=0,e=0;return(t,r)=>{if((r<n||r>=e)&&(n=r,e=ft(t,r)),e===r||t.charCodeAt(e)!==46)return-1;let w=ft(t,e+1);return w>e+1?w:-1}}var ut={name:"ARROW",pattern:/->/y,first:"-"},mt={name:"LINK_ARROW",pattern:/-->|-\.->|>|\+'[^']*'<>|\+'[^']*'<|\+'[^']*'>/y,first:"->+"},P=(n,e)=>({name:n,pattern:new RegExp(e,"y"),first:e[0]}),yt=[{name:"[",pattern:"["},{name:",",pattern:","},{name:"]",pattern:"]"},{name:"@",pattern:"@"},{name:"/",pattern:"/"},{name:"(",pattern:"("},{name:")",pattern:")"},{name:"-",pattern:"-",longer:[ut,mt,O]},{name:"{",pattern:"{"},{name:"}",pattern:"}"},{name:"WARDLEY_NUMBER",pattern:/[0-9]+\.[0-9]+/y,first:"0123456789",scanner:Mt},ut,{name:"LINK_PORT",pattern:/\+<>|\+>|\+</y,first:"+"},mt,{name:"LINK_LABEL",pattern:/;[^\n\r]+/y,first:";"},{name:"STRATEGY",pattern:/build|buy|outsource|market/y,first:"bom"},P("KW_WARDLEY","wardley-beta"),P("KW_SIZE","size"),P("KW_EVOLUTION","evolution"),P("KW_ANCHOR","anchor"),P("KW_COMPONENT","component"),P("KW_LABEL","label"),P("KW_INERTIA","inertia"),P("KW_EVOLVE","evolve"),P("KW_PIPELINE","pipeline"),P("KW_NOTE","note"),P("KW_ANNOTATIONS","annotations"),P("KW_ANNOTATION","annotation"),P("KW_ACCELERATOR","accelerator"),P("KW_DEACCELERATOR","deaccelerator"),{name:"NAME_WITH_SPACES",pattern:/(?!title\s|accTitle|accDescr)[A-Za-z](?:[A-Za-z0-9_()&]|-(?!>))*(?:[ \t]+[A-Za-z(](?:[A-Za-z0-9_()&]|-(?!>))*)*/y,first:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"},{name:"WS",pattern:/[ \t]+/y,hidden:!0,first:" "},i(),$,L,{name:"INT",pattern:/0|[1-9][0-9]*(?!\.)/y,first:"0123456789"},V$1,{name:"ID",pattern:/[\w]([-\w]*\w)?/y,first:"_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"},W,G,O,P$1,H];function bt(n){let e=new x$1(D(n,yt,"wardley"),yt,"wardley"),t={$type:"Wardley",anchors:[],components:[],links:[],evolves:[],pipelines:[],notes:[],annotations:[],annotation:[],accelerators:[],deaccelerators:[]},r=c=>e.kinds[e.i]===c,w=()=>r(36)||r(37)||r(30),u=()=>r(36)?j(e.take()):r(37)||r(30)?e.take():e.fail("a name"),k=()=>Number(e.expect(10)),g=()=>parseInt(e.expect(35)),_=()=>r(10)?Number(e.take()):parseInt(e.expect(35)),$2=()=>{if(!r(-1))for(r(38)||e.fail("a line break or the end of input");r(38);)e.i++},W2=c=>{e.expect(0);let h=c();e.expect(1);let v=c();return e.expect(2),[h,v]},N=()=>{e.expect(21),e.expect(0);let c=e.accept(7),h=g();e.expect(1);let v=e.accept(7),T=g();return e.expect(2),{$type:"Label",negX:c,offsetX:h,negY:v,offsetY:T}},G2=()=>{let c={$type:"EvolutionStage",name:u()};return e.accept(3)&&(c.boundary=k()),e.accept(4)&&(c.secondName=u()),c};for(;r(38);)e.i++;for(e.expect(16);!r(-1);)switch(e.kind){case 38:e.i++;break;case 32:t.accDescr=U(e.take()),$2();break;case 33:t.accTitle=B$1(e.take()),$2();break;case 34:t.title=z(e.take()),$2();break;case 17:{e.i++;let[c,h]=W2(g);$2(),t.size={$type:"Size",width:c,height:h};break}case 18:{e.i++;let c=[G2()];for(e.expect(11),c.push(G2());e.accept(11);)c.push(G2());$2(),t.evolution={$type:"Evolution",stages:c};break}case 19:{e.i++;let c=u(),[h,v]=W2(k);$2(),t.anchors.push({$type:"Anchor",name:c,visibility:h,evolution:v});break}case 20:{e.i++;let c={$type:"Component",name:u(),visibility:0,evolution:0,inertia:!1};[c.visibility,c.evolution]=W2(k),r(21)&&(c.label=N()),r(5)&&e.kinds[e.i+1]===15&&(e.i++,c.decorator={$type:"Decorator",strategy:e.take()},e.expect(6)),e.accept(22)?c.inertia=!0:e.accept(5)&&(e.expect(22),e.expect(6),c.inertia=!0),$2(),t.components.push(c);break}case 23:{e.i++;let c=u(),h=k();$2(),t.evolves.push({$type:"Evolve",component:c,target:h});break}case 24:{e.i++;let c=u();for(e.expect(8),e.expect(38);r(38);)e.i++;let h=[];do{e.expect(20);let v={$type:"PipelineComponent",name:u(),evolution:0};e.expect(0),v.evolution=k(),e.expect(2),r(21)&&(v.label=N()),$2(),h.push(v)}while(r(20));e.expect(9),$2(),t.pipelines.push({$type:"Pipeline",parent:c,components:h});break}case 25:{e.i++;let c=j(e.expect(36)),[h,v]=W2(k);$2(),t.notes.push({$type:"Note",text:c,visibility:h,evolution:v});break}case 26:{e.i++;let[c,h]=W2(_);$2(),t.annotations.push({$type:"Annotations",x:c,y:h});break}case 27:{e.i++;let c=g();e.expect(1);let[h,v]=W2(_),T=j(e.expect(36));$2(),t.annotation.push({$type:"Annotation",number:c,x:h,y:v,text:T});break}case 28:case 29:{let c=e.kind===29;e.i++;let h=u(),[v,T]=W2(k);$2(),c?t.deaccelerators.push({$type:"Deaccelerator",name:h,x:v,y:T}):t.accelerators.push({$type:"Accelerator",name:h,x:v,y:T});break}default:{w()||e.fail("a statement");let c={$type:"Link",from:u(),to:""};r(12)&&(c.fromPort=e.take()),(r(13)||r(11))&&(c.arrow=e.take()),c.to=u(),r(12)&&(c.toPort=e.take()),r(14)&&(c.linkLabel=e.take().substring(1).trim()),$2(),t.links.push(c)}}return t}var Pt=["Genesis","Custom Built","Product","Commodity"],Et=48,x=6,Y=10,St=8,se=15,Q=60,Tt=30,gt=20,$e="var(--_c)",E="var(--_l)";function Ct(n,e,t,r,w){let u=n["wardley-beta"]?.[e];return typeof u=="number"&&u>=r&&u<=w?u:t}function V(n,e,t){return n<e?e:n>t?t:n}function ht(n,e,t,r){let w=Yn(n),u="",k=t;for(let g of n.lines){let _=!0;for(let $2 of g){if($2.icon!==void 0)continue;let W2=Le($2.style&~w);u+=`<tspan${_?` x="${m(e)}" y="${m(k)}"`:""}${W2}>${S($2.text)}</tspan>`,_=!1}k+=n.lineHeight}return u===""?"":`<text${jn(r,w)} xml:space="preserve">${u}</text>`}function xt(n,e,t,r){let w=typeof e=="number"&&Number.isFinite(e)?e:Ct(n,t,r,1,1e6);return V(w,200,1e4)-2*Et}function $t(n,e,t){let r=xt(e,n.size?.width,"width",900);return f(t,r,160,(w,u)=>It(n,e,t,w,r,u))}function It(n,e,t,r,w,u){let k=t.fontSize??16,g=Math.round(k*.8125),_=Math.round(k*.6875),$2=t.measurer??Ot(t.fontFamily,t.fontFamilyMono),W2=t.padding??8,N=xt(e,n.size?.height,"height",600)*Math.max(.75,r/w),G2=e["wardley-beta"]?.showGrid===!0,c=0,h=0,v=r,T=N,I=(o,a,i2,l)=>{o<c&&(c=o),a<h&&(h=a),i2>v&&(v=i2),l>T&&(T=l)},F=(o,a,i2,l)=>(I(a-o.width/2,i2-o.height/2,a+o.width/2,i2+o.height/2),Yt(o,a,i2,l,t.icons)),le=(o,a,i2,l)=>(I(a,i2-o.size,a+o.width,i2-o.size+o.height+4),ht(o,a,i2,l)),S2=(o,a,i2=u?Math.max(64,Math.min(120,r/2)):4e3,l=0)=>It$1(o,!1,$2,a,i2,l),X=o=>o/100*r,K=o=>N-o/100*N,q=n.axes.stages&&n.axes.stages.length>0?n.axes.stages:Pt,ce=n.axes.stageBoundaries,we=ce!==void 0&&ce.length===q.length,J="",ve="",ee=N,ke=0;if(q.forEach((o,a)=>{let i2=we?ke:a/q.length,l=we?V(ce[a],0,1):(a+1)/q.length;ke=l,a>0&&(J+=`<path class="pele-wardley-stage" d="M${m(i2*r)},0V${m(N)}" stroke="var(--_b)" stroke-dasharray="4 4"/>`);let p=S2(o,g,Math.max(48,Math.abs(l-i2)*r-12));ve+=F(p,(i2+l)/2*r,N+8+p.height/2,` class="pele-wardley-stage-label" font-size="${g}" fill="var(--_m)"`),ee=Math.max(ee,N+8+p.height)}),G2)for(let o=1;o<4;o++)J+=`<path class="pele-wardley-grid" d="M${m(r*o/4)},0V${m(N)}M0,${m(N*o/4)}H${m(r)}" stroke="var(--_b)" stroke-dasharray="2 6"/>`;J+=`<path class="pele-wardley-axis" d="M0,0V${m(N)}H${m(r)}" stroke="${E}"/>`;let de=S2(n.axes.xLabel??"Evolution",g),Ae=S2(n.axes.yLabel??"Visibility",g),Ne=` class="pele-wardley-axis-label" font-size="${g}" font-weight="var(--_hw)"`,wt=F(de,r/2,ee+6+de.height/2,Ne)+Yt(Ae,-16,N/2,`${Ne} transform="rotate(-90 -16 ${m(N/2)})"`);I(-16-Ae.height/2,0,0,0);let vt=ee+6+de.height+10,z2=new Map;for(let o of n.nodes)z2.set(o.id,{x:X(o.x),y:K(o.y),node:o});let We="",Le2=new Map;for(let o of n.pipelines){Le2.set(o.nodeId,new Set(o.componentIds));let a=[];for(let y of o.componentIds){let m2=z2.get(y);m2&&a.push(m2)}if(a.length===0)continue;a.sort((y,m2)=>y.x-m2.x);let i2=a[0].x,l=a[a.length-1].x,p=a[0].y,f2=p-2*x,d=z2.get(o.nodeId);d&&(d.x=(i2+l)/2,d.y=f2-Y/6),I(i2-se,f2,l+se,f2+4*x),We+=`<g class="pele-wardley-pipeline" data-id="${Tn(o.nodeId)}"><rect x="${m(i2-se)}" y="${m(f2)}" width="${m(l-i2+2*se)}" height="${m(4*x)}" fill="var(--_s)" stroke="var(--_b)"${gt$1}/>`+(a.length>1?`<path d="M${m(i2)},${m(p)}H${m(l)}" stroke="${E}" stroke-dasharray="4 4"/>`:"")+"</g>"}let pe=new Map,fe=(o,a,i2)=>{let l=o.node;if(l.className==="anchor"){let p=pe.get(l);return p||pe.set(l,p=S2(l.label,g,u?Math.max(64,r/2):4e3,1)),1/Math.hypot(a/(p.width/2+5),i2/(g*.8))}return l.isPipelineParent?Y/Math.SQRT2:l.sourceStrategy?2*x:x},ue=new Map,_e=(o,a,i2)=>{Math.abs(a)<.25||Math.abs(i2)<.25||ue.set(o,(ue.get(o)??0)|(a>0?i2<0?1:2:i2<0?4:8))},me="";for(let o of n.links){let a=z2.get(o.source),i2=z2.get(o.target);if(!a||!i2||a===i2||Le2.get(o.target)?.has(o.source))continue;let l=i2.x-a.x,p=i2.y-a.y,f2=Math.hypot(l,p);if(f2<.01)continue;let d=l/f2,y=p/f2,m$1=fe(a,d,y),A=fe(i2,d,y);if(m$1+A>=f2)continue;_e(a,d,y),_e(i2,-d,-y);let b=a.x+d*m$1,M=a.y+y*m$1,L2=i2.x-d*A,C=i2.y-y*A,O2="";(o.flow==="forward"||o.flow==="bidirectional")&&(O2+=cn("arrow_point",L2,C,d,y,E),L2-=d*_n("arrow_point"),C-=y*_n("arrow_point")),(o.flow==="backward"||o.flow==="bidirectional")&&(O2+=cn("arrow_point",b,M,-d,-y,E),b+=d*_n("arrow_point"),M+=y*_n("arrow_point"));let ne="";if(o.label){let j2=S2(o.label,_+1,200),De=d>=0?1:-1,Be=y*De,Ye=-d*De,Fe=5+Math.abs(Be)*j2.width/2+Math.abs(Ye)*j2.height/2;ne=F(j2,(a.x+i2.x)/2+Be*Fe,(a.y+i2.y)/2+Ye*Fe,` class="pele-edge-label" font-size="${_+1}" fill="var(--_m)"`)}me+=`<g class="pele-edge${o.dashed?" pele-wardley-dashed":""}" data-id="${Tn(o.source)}-${Tn(o.target)}"><path d="M${m(b)},${m(M)}L${m(L2)},${m(C)}" stroke="${E}"${o.dashed?' stroke-dasharray="6 6"':""}/>`+O2+ne+"</g>"}let ye="";for(let o of n.trends){let a=z2.get(o.nodeId);if(!a)continue;let i2=X(o.targetX),l=K(o.targetY),p=i2-a.x,f2=l-a.y,d=Math.hypot(p,f2),y="",m$1=d>0?fe(a,p/d,f2/d):0;if(d>m$1+x+4){let A=p/d,b=f2/d,M=i2-A*(x+2),L2=l-b*(x+2);y=`<path d="M${m(a.x+A*m$1)},${m(a.y+b*m$1)}L${m(M-A*_n("arrow_point"))},${m(L2-b*_n("arrow_point"))}" stroke="${$e}" stroke-dasharray="4 4"/>`+cn("arrow_point",M,L2,A,b,$e)}I(i2-x,l-x,i2+x,l+x),ye+=`<g class="pele-wardley-trend" data-id="${Tn(o.nodeId)}">${y}<circle cx="${m(i2)}" cy="${m(l)}" r="${x}" fill="var(--_bg)" stroke="${$e}"/></g>`}let Me="",te=1.2*x,kt=.7*x;for(let o of z2.values()){let a=o.node,{x:i2,y:l}=o,p=a.className==="anchor",f2=a.sourceStrategy,d="";if(f2){let b=f2==="outsource"?"var(--_m)":f2==="buy"?"var(--_a)":f2==="build"?"var(--_s)":"var(--_bg)";d+=`<circle class="pele-wardley-${f2}" cx="${m(i2)}" cy="${m(l)}" r="${2*x}" fill="${b}" stroke="${E}"/>`}if(f2==="market"){let b=te*Math.cos(Math.PI/6),M=l+te*Math.sin(Math.PI/6);d+=`<path d="M${m(i2)},${m(l-te)}L${m(i2-b)},${m(M)}H${m(i2+b)}Z" fill="none" stroke="${E}"/>`;for(let[L2,C]of[[i2,l-te],[i2-b,M],[i2+b,M]])d+=`<circle cx="${m(L2)}" cy="${m(C)}" r="${m(kt)}" fill="var(--_bg)" stroke="${E}"/>`}else a.isPipelineParent?d+=`<rect x="${m(i2-Y/2)}" y="${m(l-Y/2)}" width="${Y}" height="${Y}" fill="var(--_bg)" stroke="${E}"/>`:p||(d+=`<circle cx="${m(i2)}" cy="${m(l)}" r="${x}" fill="var(--_bg)" stroke="${E}"/>`);if(a.inertia===!0){let b=(a.isPipelineParent?Y/2:x)+10+(f2?x+4:0);d+=`<rect class="pele-wardley-inertia" x="${m(i2+b)}" y="${m(l-x)}" width="4" height="${2*x}" fill="${E}"/>`}let y=a.labelOffsetX===void 0?void 0:V(a.labelOffsetX,-5e3,5e3),m$1=a.labelOffsetY===void 0?void 0:V(a.labelOffsetY,-5e3,5e3),A;if(p){let b=pe.get(a)??S2(a.label,g,u?Math.max(64,r/2):4e3,1);A=F(b,i2+(y??0),l+(m$1??-3),` class="pele-label" font-size="${g}" font-weight="var(--_hw)"`)}else{let b=S2(a.label,g),M=` class="pele-label" font-size="${g}"`,L2=St+(f2?10:0);if(y!==void 0||m$1!==void 0)A=le(b,i2+(y??L2),l+(m$1??-L2),M);else if(a.inPipeline)A=F(b,i2,l+2*x+4+b.height/2,M);else{let C=ue.get(o)??0,O2=(C&1)===0?1:(C&2)===0?2:(C&4)===0?4:(C&8)===0?8:1,ne=O2===1||O2===2,j2=O2===1||O2===4;A=le(b,ne?i2+L2:i2-L2-b.width,j2?l-L2:l+L2+g*.75,M)}}I(i2-2*x,l-2*x,i2+2*x+20,l+2*x),Me+=`<g class="pele-node pele-wardley-${p?"anchor":a.isPipelineParent?"pipeline-parent":a.inPipeline?"pipeline-component":"component"}" data-id="${Tn(a.id)}">${d}${A}</g>`}let be="";for(let o of n.annotations){let a=S2(String(o.number),_,4e3,1),i2="";for(let l of o.coordinates){let p=X(l.x),f2=K(l.y),d=Math.max(10,a.width/2+4);I(p-d,f2-d,p+d,f2+d),i2+=`<circle cx="${m(p)}" cy="${m(f2)}" r="${m(d)}" fill="var(--_bg)" stroke="${E}"/>`+Yt(a,p,f2,` font-size="${_}" font-weight="var(--_hw)"`)}be+=`<g class="pele-wardley-annotation" data-id="${Tn(String(o.number))}">${i2}</g>`}let Pe=n.annotations.filter(o=>o.text).sort((o,a)=>o.number-a.number);if(Pe.length>0){let o=Pe.map(m2=>S2(`${m2.number}. ${m2.text}`,g,u?Math.max(80,r-20):320)),a=0,i2=0;for(let m2 of o)a=Math.max(a,m2.width),i2+=m2.height;a+=20,i2+=14;let l=n.annotationsBox,p=l?V(X(l.x),0,Math.max(0,r-a)):0,f2=l?V(K(l.y),0,Math.max(0,N-i2)):vt;I(p,f2,p+a,f2+i2);let d="",y=f2+7;for(let m2 of o)d+=ht(m2,p+10,y+m2.lineHeight/2+g*.35,` font-size="${g}"`),y+=m2.height;be+=`<g class="pele-wardley-annotations"><rect x="${m(p)}" y="${m(f2)}" width="${m(a)}" height="${m(i2)}" fill="var(--_bg)" stroke="var(--_b)"${gt$1}/>${d}</g>`}let Ee="";for(let o of n.notes)Ee+=le(S2(o.text,g,Math.min(360,r*.6),1),X(o.x),K(o.y),` class="pele-wardley-note" font-size="${g}" font-weight="var(--_hw)"`);let Se="",Te=(o,a,i2,l)=>{let p=X(a),f2=K(i2),d=Tt/2,y=l?p+Q:p,m$1=l?p:p+Q,A=l?p+Q-gt:p+gt,b=`M${m(m$1)},${m(f2-d)}H${m(A)}V${m(f2-d-8)}L${m(y)},${m(f2)}L${m(A)},${m(f2+d+8)}V${m(f2+d)}H${m(m$1)}Z`;I(p,f2-d-8,p+Q,f2+d+8),Se+=`<g class="pele-wardley-${l?"accelerator":"deaccelerator"}" data-id="${Tn(o)}"><path d="${b}" fill="var(--_s)" stroke="${E}"/>`+F(S2(o,_+1,160,1),p+Q/2,f2+d+8+12,` font-size="${_+1}" font-weight="var(--_hw)"`)+"</g>"};for(let o of n.accelerators)Te(o.name,o.x,o.y,!0);for(let o of n.deaccelerators)Te(o.name,o.x,o.y,!1);let H2=It$1(n.title,!1,$2,k,u?Math.max(80,r):4e3,1),Ce=H2.height>0?H2.height+12:0,Ie=Math.min(c,r/2-H2.width/2),At=Math.max(v,r/2+H2.width/2),Oe=W2-Ie,Nt=W2+Ce-h,Re=Math.ceil(At-Ie+2*W2),ze=Math.ceil(T-h+Ce+2*W2),Wt=Yt(H2,Oe+r/2,W2+H2.height/2,' class="pele-title" font-weight="var(--_tw)"')+`<g transform="translate(${m(Oe)},${m(Nt)})"><g class="pele-wardley-frame" fill="none">${J}</g>`+ve+wt+We+(me?`<g class="pele-edges" fill="none">${me}</g>`:"")+(ye?`<g class="pele-wardley-trends" fill="none">${ye}</g>`:"")+Me+be+Ee+Se+"</g>";return{svg:Yt$1("wardley",Re,ze,k,t,n,Wt),width:Re,height:ze,links:[]}}var nn={type:"wardley",section:"wardley-beta",parse:(n,e,t)=>pt(bt(n),t),render:$t};export{nn as wardley};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{I as It,K as Kt,Y as Yt$1,F as Ft}from"./BGW36YJW-
|
|
1
|
+
import{I as It,K as Kt,Y as Yt$1,F as Ft}from"./BGW36YJW-BAwgTZ_z.js";import{O as Ot$1,T as Tn,m,o as oe,Y as Yt,R,i as it,E as Et$1,y as ye,w as wt$1,q as kt}from"./lazy-CUmWiDAP.js";import"./kit-CD3F-f6F.js";import"./vendor-react-CxJ4vs-5.js";import"./vendor-motion-C2jPaSqL.js";import"./vendor-owxl31sT.js";import"./core-Cj89wpQh.js";import"./vendor-editor-gVJMCtGz.js";function k(c){let e=c.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function et(c){return c.map(k).sort()}var j=class{type="venn";title;subsets=[];textNodes=[];styles=[];known=new Set;current;indent=!1;setDiagramTitle(e){this.title=e}addSubsetData(e,l,t){let n=et(e);this.current=n,n.length===1&&this.known.add(n[0]),this.subsets.push({sets:n,size:t??10/e.length**2,label:l?k(l):void 0})}addTextData(e,l,t){this.textNodes.push({sets:et(e),id:k(l),label:t?k(t):void 0})}addStyleData(e,l){let t=new Map;for(let[n,o]of l)t.set(n,o&&k(o));this.styles.push({targets:et(e),styles:t})}validateUnionIdentifiers(e){let l=e.map(k).filter(t=>!this.known.has(t));if(l.length>0)throw new R(`unknown set identifier: ${l.join(", ")}`,"semantic",{type:"venn"})}getCurrentSets(){return this.current}getIndentMode(){return this.indent}setIndentMode(e){this.indent=e}},nt=["$end","INVALID","EOF","NEWLINE","VENN","TITLE","SET","UNION","TEXT","INDENT_TEXT","STYLE","BRACKET_LABEL","NUMERIC","HEXCOLOR","RGBCOLOR","RGBACOLOR","IDENTIFIER","STRING","COMMA","COLON"],Rt=[["venn-beta",4],["set",6],["union",7],["text",8],["style",10]],P=class{constructor(e,l){this.src=e,this.host=l}src;host;text="";start=0;at=0;lineStart=!1;ended=!1;word(e,l){let t=this.src;for(let n=0;n<l.length;n++){let o=t.charCodeAt(e+n),s=l.charCodeAt(n);if(o!==s&&(o+32!==s||o<65||o>90))return!1}return!0}keyword(e,l){return this.word(e,l)&&!Et$1(this.src.charCodeAt(e+l.length))}color(e,l){let t=this.src,n=e+1;for(let o=0;o<l;o++){for(;ye(t.charCodeAt(n));)n++;let s=n;for(;wt$1(t.charCodeAt(n))||t.charCodeAt(n)===46;)n++;if(n===s)return-1;for(;ye(t.charCodeAt(n));)n++;if(t.charCodeAt(n)!==(o===l-1?41:44))return-1;n++}return n}afterLineFeed(e){let l=e-1;for(;this.src.charCodeAt(l)===32||this.src.charCodeAt(l)===9;)l--;return this.src.charCodeAt(l)===10}lineEnd(e){let l=this.src.indexOf(`
|
|
2
2
|
`,e);return l===-1?this.src.length:l}next(){let e=this.src,l=e.length;for(;;){let t=this.at;if(this.start=t,this.text="",t>=l)return this.ended?0:(this.ended=!0,2);let n=e.charCodeAt(t);if(n===37&&e.charCodeAt(t+1)===37&&e.charCodeAt(t+2)!==123){this.at=this.lineEnd(t+2);continue}if(this.lineStart&&this.word(t,"title")&&this.afterLineFeed(t)&&e.slice(t+5,this.lineEnd(t+5)).trim()===""){let o=this.lineEnd(t+5);for(;e.charCodeAt(o)===10||e.charCodeAt(o)===13;)o++;this.at=o;continue}if(this.lineStart){if(n===32||n===9){let o=t+1;for(;e.charCodeAt(o)===32||e.charCodeAt(o)===9;)o++;if(this.at=o,this.keyword(o,"text")&&this.host.getIndentMode())return this.at=o+4,this.lineStart=!1,this.text=e.slice(t,o),9;continue}n!==10&&n!==13&&(this.host.setIndentMode(!1),this.lineStart=!1)}if(n===10||n===13){for(t++;e.charCodeAt(t)===10||e.charCodeAt(t)===13;)t++;return this.lineStart=!0,this.token(3,t)}if(n===37&&e.charCodeAt(t+1)===37){this.at=this.lineEnd(t);continue}if(n===32||n===9){for(t++;e.charCodeAt(t)===32||e.charCodeAt(t)===9;)t++;this.at=t;continue}if((n|32)>=97&&(n|32)<=122||n===95){let o=e.charCodeAt(t+5);if(this.word(t,"title")&&ye(o)&&o!==10&&o!==13){let s=t+6;for(;s<l;){let b=e.charCodeAt(s);if(b===35||b===10||b===59)break;s++}if(s>t+6)return this.token(5,s)}for(let[s,b]of Rt)if(this.keyword(t,s)&&e.charCodeAt(t+s.length)!==45)return this.token(b,t+s.length);if(this.word(t,"rgb")){let s=(e.charCodeAt(t+3)|32)===97,b=t+(s?4:3),r=e.charCodeAt(b)===40?this.color(b,s?4:3):-1;if(r!==-1)return this.token(s?15:14,r)}for(t++;Et$1(e.charCodeAt(t))||e.charCodeAt(t)===45;)t++;return this.token(16,t)}if(n===91){if(e.charCodeAt(t+1)===34){let s=e.indexOf('"',t+2);return s===-1||e.charCodeAt(s+1)!==93?1:(this.at=s+2,this.text=e.slice(t+2,s),11)}let o=t+1;for(;o<l&&e.charCodeAt(o)!==93&&e.charCodeAt(o)!==34;)o++;return o===t+1||e.charCodeAt(o)!==93?1:(this.at=o+1,this.text=e.slice(t+1,o).trim(),11)}if(wt$1(n)||n===46||n===43||n===45){(n===43||n===45)&&t++;let o=t;for(;wt$1(e.charCodeAt(t));)t++;if(t>o){if(e.charCodeAt(t)===46&&wt$1(e.charCodeAt(t+1)))for(t+=2;wt$1(e.charCodeAt(t));)t++}else if(e.charCodeAt(t)===46&&wt$1(e.charCodeAt(t+1)))for(t+=2;wt$1(e.charCodeAt(t));)t++;else return 1;return this.token(12,t)}if(n===35){let o=t+1;for(;o<t+9&&kt(e.charCodeAt(o));)o++;return o>=t+4?this.token(13,o):1}if(n===34){let o=e.indexOf('"',t+1);return o===-1?1:this.token(17,o+1)}return n===44?this.token(18,t+1):n===58?this.token(19,t+1):1}}token(e,l){return this.text=this.src.slice(this.at,l),this.at=l,e}},Nt="'EOF', 'NEWLINE', 'TITLE', 'SET', 'UNION', 'TEXT', 'INDENT_TEXT', 'STYLE'",wt="'NUMERIC', 'IDENTIFIER', 'STRING', 'HEXCOLOR', 'RGBCOLOR', 'RGBACOLOR'";function mt(c,e){let l=new P(c,e),t=-1,n=()=>t===-1?t=l.next():t,o=g=>{throw n()===1?it("venn",c,l.start,"",!0):it("venn",c,l.start,`Expecting ${g}, got '${nt[t]}'`)},s=()=>(t=-1,l.text),b=g=>(n()!==g&&o(`'${nt[g]}'`),s()),r=()=>(n()!==16&&t!==17&&o("'IDENTIFIER', 'STRING'"),s()),d=()=>{let g=[r()];for(;n()===18;)s(),g.push(r());return g},u=(g,h)=>{let y=n()===11?s():void 0,i;if(n()===19&&(s(),i=parseFloat(b(12))),h){if(g.length<2)throw new R("union requires multiple identifiers","semantic",{type:"venn"});e.validateUnionIdentifiers(g)}e.addSubsetData(g,y,i),e.setIndentMode(!0)},p=g=>{let h=n();h!==16&&h!==17&&h!==12&&o("'NUMERIC', 'IDENTIFIER', 'STRING'");let y=s(),i=h!==12&&n()===11?s():void 0;e.addTextData(g(),y,i)},E=()=>{let g=d(),h=[];for(;;){let y=b(16);b(19);let i;if(n()===17)i=s();else{let f=[];for(;n()===16||t>=12&&t<=15;)f.push(s());f.length===0&&o(wt),i=f.join(" ")}if(h.push([y,i]),n()!==18)break;s()}e.addStyleData(g,h)};for(;n()===3;)s();for(b(4);;){let g=n();if(g===2)return;if((g<3||g>10||g===4)&&o(Nt),s(),g===5)e.setDiagramTitle(l.text.slice(6));else if(g===6)u([r()],!1);else if(g===7)u(d(),!0);else if(g===8){let h=d();p(()=>h)}else g===9?p(()=>{let h=e.getCurrentSets();if(!h)throw new R("text requires set","semantic",{type:"venn"});return h}):g===10&&E()}}var q=Math.PI*2;function At(c){let e=new Set,l=new Map;for(let n of c)e.add(JSON.stringify([...n.sets].sort())),n.sets.length===1&&l.set(n.sets[0],n.size);let t=[];for(let n of c){if(n.sets.length<3)continue;let o=[...n.sets].sort();for(let s=0;s<o.length-1;s++)for(let b=s+1;b<o.length;b++){let r=[o[s],o[b]],d=JSON.stringify(r);if(e.has(d))continue;e.add(d);let u=l.get(r[0]),p=l.get(r[1]);t.push({sets:r,size:u!==void 0&&p!==void 0?Math.min(u,p)/4:2.5,label:""})}}return t.length>0?[...c,...t]:c}function vt(c,e,l){if(l>=c+e)return 0;let t=Math.min(c,e);if(l<=Math.abs(c-e))return Math.PI*t*t;let n=c*c*Math.acos((l*l+c*c-e*e)/(2*l*c)),o=e*e*Math.acos((l*l+e*e-c*c)/(2*l*e)),s=.5*Math.sqrt(Math.max((-l+c+e)*(l+c-e)*(l-c+e)*(l+c+e),0));return n+o-s}function Ot(c,e,l){let t=Math.abs(c-e),n=c+e;if(!(l>0))return n;if(l>=Math.PI*Math.min(c,e)**2)return t;for(let o=0;o<48;o++){let s=(t+n)/2;vt(c,e,s)>l?t=s:n=s}return(t+n)/2}function yt(c,e,l,t,n,o){let s=1/0;for(let b of e){let r=c[b],d=t-r.x,u=n-r.y,p=r.r-Math.sqrt(d*d+u*u);if(p<s){if(p<o)return p;s=p}}for(let b of l){let r=c[b],d=t-r.x,u=n-r.y,p=Math.sqrt(d*d+u*u)-r.r;if(p<s){if(p<o)return p;s=p}}return s}function W(c,e,l){let t=0,n=0,o=c[e[0]];for(let h of e){let y=c[h];t+=y.x/e.length,n+=y.y/e.length,y.r<o.r&&(o=y)}let s=o.r,b=t,r=n,d=yt(c,e,l,b,r,-1/0),u=0,p=(h,y)=>{let i=yt(c,e,l,h,y,d-s*1e-9);if(!(i>d-s*1e-9))return!1;let f=Math.hypot(h-t,y-n);return i>d+s*1e-9||f<u-s*1e-9?(d=i,u=f,b=h,r=y,!0):!1},E=10;for(let h=-E;h<=E;h++)for(let y=-E;y<=E;y++)y*y+h*h<=E*E&&p(o.x+y*s/E,o.y+h*s/E);let g=s/E;for(let h=0;h<40&&g>s*1e-6;h++){let y=!1;for(let i=0;i<8;i++){let f=i*q/8;p(b+Math.cos(f)*g,r+Math.sin(f)*g)&&(y=!0)}y||(g/=2)}return{x:b,y:r,margin:d}}function bt(c){let e=new Map;for(let i of c)for(let f of i.sets)e.has(f)||e.set(f,10);for(let i of c)i.sets.length===1&&e.set(i.sets[0],i.size);let l=new Map,t=[],n=0;for(let i of e.values())Number.isFinite(i)&&i>n&&(n=i);n===0&&(n=10);let o=Math.sqrt(n/Math.PI);for(let[i,f]of e){l.set(i,t.length);let x=Number.isFinite(f)&&f>0?Math.sqrt(f/Math.PI):0;t.push({id:i,x:0,y:0,r:Math.max(x,o*.3)})}let s=t.length;if(s<2)return t;let b=new Map;for(let i of At(c)){if(i.sets.length!==2)continue;let f=l.get(i.sets[0]),x=l.get(i.sets[1]);f!==x&&b.set(Math.min(f,x)*s+Math.max(f,x),i.size)}let r=new Map;for(let[i,f]of b)r.set(i,Ot(t[Math.floor(i/s)].r,t[i%s].r,f));let d=o*.15,u=(i,f)=>r.get(i*s+f)??t[i].r+t[f].r+d;if(s===2)return t[1].x=u(0,1),t;if(s===3){let i=u(0,1),f=u(0,2),x=u(1,2),C=c.some(N=>new Set(N.sets).size===3);for(let N=0;N<40;N++){let w=i>0?(i*i+f*f-x*x)/(2*i):0;if(t[1].x=i,t[2].x=Math.max(-f,Math.min(f,w)),t[2].y=Math.sqrt(Math.max(f*f-w*w,0)),!C||W(t,[0,1,2],[]).margin>o*.12)break;i*=.94,f*=.94,x*=.94}return t}let p=0;for(let i of t)p+=2*i.r+d;let E=Math.min(300,Math.floor(3e6/(s*s)));if(s<=64){let i=p/q;t.forEach((f,x)=>{let C=x*q/s-Math.PI/2;f.x=Math.cos(C)*i,f.y=Math.sin(C)*i})}else{let i=Math.ceil(Math.sqrt(s)),f=2*o+d;t.forEach((x,C)=>{x.x=C%i*f,x.y=Math.floor(C/i)*f})}let g=new Float64Array(s),h=new Float64Array(s),y=new Int32Array(s);for(let i=0;i<E;i++){g.fill(0),h.fill(0),y.fill(0);for(let f=0;f<s;f++)for(let x=f+1;x<s;x++){let C=r.get(f*s+x),N=t[f].r+t[x].r+d,w=t[x].x-t[f].x,v=t[x].y-t[f].y,T=Math.hypot(w,v);if(C===void 0&&T>=N)continue;T<1e-9&&(w=Math.cos(f+x),v=Math.sin(f+x),T=1);let D=(T-(C??N))/2/T;g[f]+=w*D,h[f]+=v*D,g[x]-=w*D,h[x]-=v*D,y[f]++,y[x]++}for(let f=0;f<s;f++)y[f]!==0&&(t[f].x+=g[f]/y[f],t[f].y+=h[f]/y[f])}return t}function xt(c,e){let l=r=>`M${e(r.x-r.r)},${e(r.y)}A${e(r.r)},${e(r.r)} 0 1 1 ${e(r.x+r.r)},${e(r.y)}A${e(r.r)},${e(r.r)} 0 1 1 ${e(r.x-r.r)},${e(r.y)}Z`;if(c.length===1)return l(c[0]);let t=(r,d,u,p)=>{for(let E of c)if(E!==u&&E!==p&&Math.hypot(r-E.x,d-E.y)>E.r*(1+1e-9))return!1;return!0},n=[];for(let r=0;r<c.length;r++)for(let d=r+1;d<c.length;d++){let u=c[r],p=c[d],E=Math.hypot(p.x-u.x,p.y-u.y);if(E>=u.r+p.r||E<=Math.abs(u.r-p.r)||E===0)continue;let g=(u.r*u.r-p.r*p.r+E*E)/(2*E),h=Math.sqrt(Math.max(u.r*u.r-g*g,0)),y=u.x+(p.x-u.x)*g/E,i=u.y+(p.y-u.y)*g/E;for(let f of[1,-1]){let x=y+f*h*(p.y-u.y)/E,C=i-f*h*(p.x-u.x)/E;t(x,C,u,p)&&n.push({x,y:C,a:u,b:p})}}if(n.length<2){let r=c[0];for(let d of c)d.r<r.r&&(r=d);for(let d of c)if(d!==r&&Math.hypot(d.x-r.x,d.y-r.y)+r.r>d.r*(1+1e-9))return"";return l(r)}let o=0,s=0;for(let r of n)o+=r.x/n.length,s+=r.y/n.length;n.sort((r,d)=>Math.atan2(r.y-s,r.x-o)-Math.atan2(d.y-s,d.x-o));let b="";for(let r=0;r<n.length;r++){let d=n[r],u=n[(r+1)%n.length];r===0&&(b=`M${e(d.x)},${e(d.y)}`);let p,E=0,g=1/0;for(let h of[d.a,d.b]){if(h!==u.a&&h!==u.b)continue;let y=Math.atan2(d.y-h.y,d.x-h.x),i=Math.atan2(u.y-h.y,u.x-h.x)-y;i<=0&&(i+=q);let f=h.x+h.r*Math.cos(y+i/2),x=h.y+h.r*Math.sin(y+i/2),C=Math.hypot(f-(d.x+u.x)/2,x-(d.y+u.y)/2);C<g&&(g=C,p=h,E=i>Math.PI?1:0)}p===void 0?b+=`L${e(u.x)},${e(u.y)}`:b+=`A${e(p.r)},${e(p.r)} 0 ${E} 1 ${e(u.x)},${e(u.y)}`}return b+"Z"}var Tt=100,St=1.6,Et=Ft([]);function st(c){return c.length===1?c[0]:JSON.stringify(c)}function Mt(c,e,l){let t=l.fontSize??16,n=Math.round(t*.875),o=Math.round(t*.8125),s=l.measurer??Ot$1(l.fontFamily,l.fontFamilyMono),b=l.padding??8,r=bt(c.subsets),d=new Map;r.forEach((a,m2)=>d.set(a.id,m2));let u=new Map;for(let{targets:a,styles:m2}of c.styles){let M=st(a),I=u.get(M);I||u.set(M,I=new Map);for(let[A,S]of m2)I.set(A,S)}let p=a=>{let m2=u.get(a);if(!m2)return Et;let M=[];for(let[I,A]of m2)M.push(`${I}:${A}`);return Ft(M)},E=r.map(()=>[]);for(let a=0;a<r.length;a++)for(let m2=a+1;m2<r.length;m2++)Math.hypot(r[a].x-r[m2].x,r[a].y-r[m2].y)<r[a].r+r[m2].r&&(E[a].push(m2),E[m2].push(a));let g=new Map;for(let a of c.subsets)g.set(st(a.sets),a);let h=new Map;for(let[a,m2]of g){let M=[...new Set(m2.sets)],I=M.map(O=>d.get(O)),A=new Set(I),S=I[0];for(let O of I)r[O].r<r[S].r&&(S=O);let V=p(a),R2=m2.label??(m2.sets.length===1?m2.sets[0]:void 0),L=(V.bold?1:0)|(V.italic?2:0),z=E[S].filter(O=>!A.has(O)),F=W(r,I,z),ct=z.length>0&&F.margin<r[S].r*.2;ct&&(F=W(r,I,[]));let ft={sets:M,inside:I,spot:F,lines:[],style:V,across:ct};if(R2){let O=M.length===1?t:n;ft.lines.push({id:void 0,raw:R2,size:O,base:L,label:It(R2,!1,s,O,4e3,L)})}h.set(a,ft)}for(let a of c.textNodes){let m2=a.label??a.id;h.get(st(a.sets))?.lines.push({id:a.id,raw:m2,size:o,base:0,label:It(m2,!1,s,o,4e3)})}let y=0;for(let a of r)a.r>y&&(y=a.r);let i=y>0?Tt/y:1,f=1;for(let a of h.values()){if(a.spot.margin<=0)continue;let m2=0,M=0;for(let A of a.lines)m2=Math.max(m2,A.label.width),M+=A.label.height;let I=Math.hypot(m2,M)/2+4;f=Math.max(f,Math.min(I/(a.spot.margin*i),St))}i*=f;for(let a of h.values()){let m2=Math.max(a.spot.margin*i*1.8,72);for(let M of a.lines)M.label.width>m2&&(M.label=It(M.raw,!1,s,M.size,m2,M.base))}let x=1/0,C=1/0,N=-1/0,w=-1/0;for(let a of r)x=Math.min(x,(a.x-a.r)*i),C=Math.min(C,(a.y-a.r)*i),N=Math.max(N,(a.x+a.r)*i),w=Math.max(w,(a.y+a.r)*i);for(let a of h.values()){let m2=0,M=0;for(let I of a.lines)m2=Math.max(m2,I.label.width),M+=I.label.height;x=Math.min(x,a.spot.x*i-m2/2),N=Math.max(N,a.spot.x*i+m2/2),C=Math.min(C,a.spot.y*i-M/2),w=Math.max(w,a.spot.y*i+M/2)}r.length===0&&(x=C=N=w=0);let v=It(c.title&&k(c.title),!1,s,t,4e3,1),T=v.height>0?v.height+12:0,D=Math.max(N-x,v.width),rt=b+(D-(N-x))/2-x,ot=b+T-C,Y=Math.ceil(D+2*b),it2=Math.ceil(w-C+T+2*b),lt=r.map(a=>({id:a.id,x:a.x*i+rt,y:a.y*i+ot,r:a.r*i})),at="";lt.forEach((a,m$1)=>{let M=Kt(m$1),I=h.get(a.id)?.style??Et;at+=`<circle class="pele-venn-set" data-id="${Tn(a.id)}" cx="${m(a.x)}" cy="${m(a.y)}" r="${m(a.r)}" fill="${M}" fill-opacity="0.2" stroke="${M}"${I.shape}/>`});let Ct=[...h.values()].filter(a=>a.sets.length>1&&a.style.shape!==""),It$1=a=>{if(a.across)return"";let m2=a.sets.length===1&&/[";]fill-opacity:/.test(a.style.shape)?a.style.shape:"";for(let M of Ct)M.sets.every(I=>a.sets.includes(I))&&(m2=M.style.shape);return m2},H="",K="";for(let a of h.values()){let m$1=Tn(a.sets.join("|"));if(a.sets.length>1&&a.style.shape!==""){let R2=xt(a.inside.map(L=>lt[L]),m);R2!==""&&(H+=`<path class="pele-venn-overlap" data-id="${m$1}" d="${R2}" fill="none"${a.style.shape}/>`)}let M=0;for(let R2 of a.lines)M+=R2.label.height;if(M===0)continue;let I=a.spot.x*i+rt,A=a.spot.y*i+ot-M/2,S=It$1(a),V="";for(let R2 of a.lines){let L=R2.id===void 0?a.style.text:p(R2.id).text,z=oe(S,L),F=R2.id===void 0?` class="pele-label"${R2.size===t?"":` font-size="${R2.size}"`}${z?` fill="${z}"`:""}${L}`:` class="pele-venn-text" data-id="${Tn(R2.id)}" font-size="${o}" fill="${z??"var(--_m)"}"${L}`;V+=Yt(R2.label,I,A+R2.label.height/2,F),A+=R2.label.height}K+=`<g class="pele-venn-region" data-id="${m$1}">${V}</g>`}return{svg:Yt$1("venn",Y,it2,t,l,{},Yt(v,Y/2,b+v.height/2,' class="pele-title" font-weight="var(--_tw)"')+`<g class="pele-venn-sets">${at}</g>`+(H?`<g class="pele-venn-overlaps">${H}</g>`:"")+(K?`<g class="pele-venn-labels">${K}</g>`:"")),width:Y,height:it2,links:[]}}var ee={type:"venn",parse(c,e,l){let t=new j;return l&&(t.title=l),mt(c,t),t},render:Mt};export{ee as venn};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as It}from"./BGW36YJW-
|
|
1
|
+
import{I as It}from"./BGW36YJW-BAwgTZ_z.js";import{a as mt,Y as Yt,m}from"./lazy-CUmWiDAP.js";function g(r,n,i,t){return mt(()=>It(r,!1,n,i,t,1))}function x(r,n,i,t,l,a,m$1){let e=g(r,n,i,4e3);if(e.height===0)return{width:l,height:a,content:m$1};let h=e.height+12,o=Math.max(l,Math.ceil(e.width+2*t));return{width:o,height:Math.ceil(a+h),content:Yt(e,o/2,t+e.height/2,' class="pele-title" font-weight="var(--_tw)"')+`<g transform="translate(${m((o-l)/2)},${m(h)})">${m$1}</g>`}}export{g,x};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{E}from"./75JW6PN6-
|
|
1
|
+
import{E}from"./75JW6PN6-CYzAa9yx.js";import{U,_}from"./QQW2P742-D6aitZ24.js";import{R as R$1}from"./6PIGVMFT-CRGq6eh3.js";import{p,h}from"./DKTLEL5E-CJTkVtjr.js";import{T as Tt$1,o as oe,s as se,d as cn$1,b as ae$1,_ as _n}from"./EFYWJBJK-CFT5CQUG.js";import{I as It$1,N as Nt$1,Y as Yt$2,F as Ft$2}from"./BGW36YJW-BAwgTZ_z.js";import{y as ye$1,E as Et,i as it,O as Ot$1,R,P as Pt,S,T as Tn,m,Y as Yt$1,F as Ft$1}from"./lazy-CUmWiDAP.js";import"./kit-CD3F-f6F.js";import"./vendor-react-CxJ4vs-5.js";import"./vendor-motion-C2jPaSqL.js";import"./vendor-owxl31sT.js";import"./core-Cj89wpQh.js";import"./vendor-editor-gVJMCtGz.js";var kt=new Set(["label","type","descr","techn","sprite","tags","link","bgColor","fontColor","borderColor","shadowing","shape","legendText","legendSprite"]),Yt=new Set(["label","descr","techn","sprite","tags","link","textColor","lineColor"]);function _e(t,e){let{key:n,value:r}=e;"from"in t&&(n==="offsetX"||n==="offsetY")?t[n]=parseInt(r):("from"in t?Yt:kt).has(n)?t[n]=r:(t.extra??=new Map).set(n,r)}function B(t,e,n){n!==void 0&&(typeof n=="string"?t[e]=n:_e(t,n))}function ae(t,e,n){n===void 0?t[e]??="":B(t,e,n)}function Ct(t,e){t.labelAttr=void 0,typeof e=="object"?(t.label="",t.labelAttr=e,_e(t,e)):t.label=e??""}var Ae=class{type="c4";c4Type;title;accTitle;accDescr;shapes=[];boundaries=[{alias:"global",label:"global",type:"global",parent:void 0}];rels=[];shapeInRow=4;boundaryInRow=2;shapeIndex=new Map;boundaryIndex=new Map;relIndex=new Map;current=this.boundaries[0];stack=[];setC4Type(e){this.c4Type=e}setTitle(e){this.title=e}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
|
|
2
2
|
`)}element(e,n,r,u){let s=typeof r=="string"?n.get(r):void 0;return s===void 0&&(s={alias:"",label:"",parent:void 0},e.push(s),typeof r=="string"?(s.alias=r,n.set(r,s)):(s.aliasAttr=r,_e(s,r))),Ct(s,u),s}addPersonOrSystem(e,n){let r=this.element(this.shapes,this.shapeIndex,n[0],n[1]);ae(r,"descr",n[2]),this.finishShape(r,e,n,3)}addContainer(e,n){let r=this.element(this.shapes,this.shapeIndex,n[0],n[1]);ae(r,"techn",n[2]),ae(r,"descr",n[3]),this.finishShape(r,e,n,4)}addComponent(e,n){this.addContainer(e,n)}finishShape(e,n,r,u){B(e,"sprite",r[u]),B(e,"tags",r[u+1]),B(e,"link",r[u+2]),e.kind=n,e.parent=this.current}boundary(e,n){let r=this.element(this.boundaries,this.boundaryIndex,e[0],e[1]);return e[2]===void 0?r.type=n:B(r,"type",e[2]),r}open(e){e.parent=this.current,this.stack.push(this.current),this.current=e}addPersonOrSystemBoundary(e,n="system"){let r=this.boundary(e,n);B(r,"tags",e[3]),B(r,"link",e[4]),this.open(r)}addContainerBoundary(e){this.addPersonOrSystemBoundary(e,"container")}addDeploymentNode(e,n){let r=this.boundary(n,"node");ae(r,"descr",n[3]),B(r,"sprite",n[4]),B(r,"tags",n[5]),B(r,"link",n[6]),r.nodeType=e,this.open(r)}popBoundaryParseStack(){this.current=this.stack.pop()??this.boundaries[0]}addRel(e,n){let r=n[0],u=n[1];if(r===void 0||u===void 0||n[2]===void 0)return;let s=typeof r=="string"&&typeof u=="string",l=s?this.relIndex.get(r)?.get(u):void 0;if(l===void 0){if(l={type:e,from:"",to:"",label:""},this.rels.push(l),s){let o=this.relIndex.get(r);o===void 0&&this.relIndex.set(r,o=new Map),o.set(u,l)}typeof r=="string"?l.from=r:l.fromAttr=r,typeof u=="string"?l.to=u:l.toAttr=u}l.type=e,Ct(l,n[2]),ae(l,"techn",n[3]),ae(l,"descr",n[4]),B(l,"sprite",n[5]),B(l,"tags",n[6]),B(l,"link",n[7])}getC4Shape(e){return this.shapeIndex.get(e)??this.boundaryIndex.get(e)}updateElStyle(e,n){let r=typeof n[0]=="string"?this.getC4Shape(n[0]):void 0;r!==void 0&&(B(r,"bgColor",n[1]),B(r,"fontColor",n[2]),B(r,"borderColor",n[3]),B(r,"shadowing",n[4]),B(r,"shape",n[5]),B(r,"sprite",n[6]),B(r,"techn",n[7]),B(r,"legendText",n[8]),B(r,"legendSprite",n[9]))}updateRelStyle(e,n){let r=n[0],u=n[1],s=typeof r=="string"&&typeof u=="string"?this.relIndex.get(r)?.get(u):void 0;if(s===void 0)return;B(s,"textColor",n[2]),B(s,"lineColor",n[3]);let l=n[4],o=n[5];typeof l=="string"?s.offsetX=parseInt(l):l!==void 0&&_e(s,l),typeof o=="string"?s.offsetY=parseInt(o):o!==void 0&&_e(s,o)}updateLayoutConfig(e,n){let r=l=>l===void 0?NaN:parseInt(typeof l=="string"?l:l.value),u=r(n[0]),s=r(n[1]);u>=1&&(this.shapeInRow=u),s>=1&&(this.boundaryInRow=s)}},Xe=["$end","INVALID","direction_tb","direction_bt","direction_rl","direction_lr","title","accDescription","acc_title","acc_title_value","acc_descr","acc_descr_value","acc_descr_multiline_value","NEWLINE","C4_CONTEXT","C4_CONTAINER","C4_COMPONENT","C4_DYNAMIC","C4_DEPLOYMENT","PERSON","PERSON_EXT","SYSTEM","SYSTEM_DB","SYSTEM_QUEUE","SYSTEM_EXT","SYSTEM_EXT_DB","SYSTEM_EXT_QUEUE","CONTAINER","CONTAINER_DB","CONTAINER_QUEUE","CONTAINER_EXT","CONTAINER_EXT_DB","CONTAINER_EXT_QUEUE","COMPONENT","COMPONENT_DB","COMPONENT_QUEUE","COMPONENT_EXT","COMPONENT_EXT_DB","COMPONENT_EXT_QUEUE","ENTERPRISE_BOUNDARY","SYSTEM_BOUNDARY","BOUNDARY","CONTAINER_BOUNDARY","NODE","NODE_L","NODE_R","REL","BIREL","REL_U","REL_D","REL_L","REL_R","REL_B","REL_INDEX","UPDATE_EL_STYLE","UPDATE_REL_STYLE","UPDATE_LAYOUT_CONFIG","EOF_IN_STRUCT","ATTRIBUTE_EMPTY","STR","STR_KEY","STR_VALUE","LBRACE","RBRACE","EOF"],$t=new Map([["C4Context",14],["C4Container",15],["C4Component",16],["C4Dynamic",17],["C4Deployment",18],["Person",19],["Person_Ext",20],["System",21],["SystemDb",22],["SystemQueue",23],["System_Ext",24],["SystemDb_Ext",25],["SystemQueue_Ext",26],["Container",27],["ContainerDb",28],["ContainerQueue",29],["Container_Ext",30],["ContainerDb_Ext",31],["ContainerQueue_Ext",32],["Component",33],["ComponentDb",34],["ComponentQueue",35],["Component_Ext",36],["ComponentDb_Ext",37],["ComponentQueue_Ext",38],["Enterprise_Boundary",39],["System_Boundary",40],["Boundary",41],["Container_Boundary",42],["Deployment_Node",43],["Node",43],["Node_L",44],["Node_R",45],["Rel",46],["BiRel",47],["Rel_Up",48],["Rel_U",48],["Rel_Down",49],["Rel_D",49],["Rel_Left",50],["Rel_L",50],["Rel_Right",51],["Rel_R",51],["Rel_Back",52],["RelIndex",53],["UpdateElementStyle",54],["UpdateRelStyle",55],["UpdateLayoutConfig",56]]),We=[/.*direction\s+TB[^\n]*/y,/.*direction\s+BT[^\n]*/y,/.*direction\s+RL[^\n]*/y,/.*direction\s+LR[^\n]*/y],Fe=/[\n\r\u2028\u2029]/g,Qe=/title[^\S\r\n]*(?=[\r\n]|$)\s*/y;function Rt(t){let e=t.length,n=[],r=[],u=[],s=0,l=9,o=0,a=!1,f=-2,h2=-1,m2=0,p2=(c,E2,_2)=>{n.push(c),r.push(E2),u.push(_2),o=_2},S2=c=>{for(;c<e&&ye$1(t.charCodeAt(c));)c++;return c},N=(c,E2)=>{let _2=t.indexOf(c,E2);return _2===-1?e:_2},i=(c,E2)=>{let _2=o+c.length;if(!t.startsWith(c,o)||!ye$1(t.charCodeAt(_2)))return!1;let x=++_2;for(;_2<e;){let M=t.charCodeAt(_2);if(M===35||M===10||M===59)break;_2++}return _2===x?!1:(p2(E2,o,_2),!0)};for(;;){if(a){p2(0,e,e);break}o>=e&&(a=!0);let c=t.charCodeAt(o);if(s===0){if(o>=e){p2(64,e,e);continue}if(f!==-1&&o>=m2&&(f<o&&(f=t.indexOf("direction",o)),f!==-1&&(h2<o&&(Fe.lastIndex=o,h2=Fe.test(t)?Fe.lastIndex-1:e),f<h2))){let E2=!1;for(let _2=0;_2<4&&!E2;_2++)We[_2].lastIndex=o,We[_2].test(t)&&(p2(2+_2,o,We[_2].lastIndex),E2=!0);if(E2)continue;m2=h2}if(c===116){if(Qe.lastIndex=o,Qe.test(t)){o=Qe.lastIndex;continue}if(i("title",6))continue}if(c===97){if(i("accDescription",7))continue;let E2=t.startsWith("accTitle",o);if(E2||t.startsWith("accDescr",o)){let _2=S2(o+8),x=t.charCodeAt(_2);if(x===58){p2(E2?8:10,o,S2(_2+1)),l=E2?9:11,s=7;continue}if(x===123&&!E2){o=S2(_2+1),s=8;continue}}}if(c===37&&t.charCodeAt(o+1)===37){let E2=N(`
|
|
3
3
|
`,o+2);for(;E2<e&&(t.charCodeAt(E2)===10||t.charCodeAt(E2)===13);)E2++;o=E2;continue}if(ye$1(c)){let E2=o,_2=-1;for(;E2<e;){let x=t.charCodeAt(E2);if(!ye$1(x))break;x===10&&(_2=E2),E2++}_2!==-1?p2(13,o,_2+1):o=E2;continue}if(c===123){p2(62,o,o+1);continue}if(c===125){p2(63,o,o+1);continue}if(Et(c)){let E2=o+1;for(;E2<e&&Et(t.charCodeAt(E2));)E2++;let _2=E2-o<=19?$t.get(t.slice(o,E2)):void 0;if(_2!==void 0){_2>18&&(s=1),p2(_2,o,E2);continue}}p2(1,o,o);break}if(s===1){if(o>=e)p2(57,e,e);else if(c===40){let E2=o+1;for(;t.charCodeAt(E2)===32;)E2++;t.charCodeAt(E2)===44?p2(58,o,E2+1):o++,s=2}else if(c===41)o++,s=0;else{p2(1,o,o);break}continue}if(s===2){if(o>=e)continue;if(c===41)o++,s=0;else if(c===44)t.charCodeAt(o+1)===44?p2(58,o,o+2):o++;else{let E2=o;for(;t.charCodeAt(E2)===32;)E2++;let _2=t.charCodeAt(E2);_2===34?t.charCodeAt(E2+1)===34?p2(58,o,E2+2):(o=E2+1,s=3):_2===36?(o=E2+1,s=4):p2(59,o,N(",",o))}continue}if(s===3){c===34?(o++,s=2):p2(59,o,N('"',o));continue}if(s===4){p2(60,o,N("=",o)),s=5;continue}if(s===5){if(o>=e)continue;let E2=o+1;if(c===61)for(;t.charCodeAt(E2)===32;)E2++;if(c!==61||t.charCodeAt(E2)!==34){p2(1,o,o);break}o=E2+1,s=6;continue}if(s===6){if(o>=e)continue;c===34?(o++,s=2):p2(61,o,N('"',o));continue}if(s===7){p2(l,o,N(`
|
|
4
4
|
`,o)),s=0;continue}c===125?(o++,s=0):p2(12,o,N("}",o))}return{types:n,starts:r,ends:u}}var qe=["person","external_person","system","system_db","system_queue","external_system","external_system_db","external_system_queue","container","container_db","container_queue","external_container","external_container_db","external_container_queue","component","component_db","component_queue","external_component","external_component_db","external_component_queue"],Xt=["rel","birel","rel_u","rel_d","rel_l","rel_r","rel_b","rel"],Wt=["node","nodeL","nodeR"],Ft="'direction_tb', 'direction_bt', 'direction_rl', 'direction_lr', 'C4_CONTEXT', 'C4_CONTAINER', 'C4_COMPONENT', 'C4_DYNAMIC', 'C4_DEPLOYMENT'",Qt="'STR', 'STR_KEY', 'ATTRIBUTE', 'ATTRIBUTE_EMPTY'";function qt(t){return t===6||t===7||t===8||t===10||t===12}function bt(t){return t>=19&&t<=56}function Nt(t,e){let{types:n,starts:r,ends:u}=Rt(t),s=0,l=i=>t.slice(r[i],u[i]),o=i=>{let c=n[s];throw c===1?it("c4",t,r[s],"",!0):it("c4",t,r[s],`Expecting ${i}, got '${Xe[c]}'`)},a=i=>{n[s]!==i&&o(`'${Xe[i]}'`),s++},f=()=>{let i=[];for(;;){let c=n[s];if(c===59)i.push(l(s++).trim());else if(c===58)i.push(""),s++;else if(c===60)s++,n[s]!==61&&o("'STR_VALUE'"),i.push({key:l(s-1).trim(),value:l(s).trim()}),s++;else break}return i.length===0&&o(Qt),i},h2=i=>{i===6?e.setTitle(l(s++).substring(6)):i===7?e.setAccDescription(l(s++).substring(15)):i===12?e.setAccDescription(l(s++).trim()):(s++,i===8?(n[s]!==9&&o("'acc_title_value'"),e.setTitle(l(s++).trim())):(n[s]!==11&&o("'acc_descr_value'"),e.setAccDescription(l(s++).trim())))},m2=i=>{s++;let c=f();if(i<=26)e.addPersonOrSystem(qe[i-19],c);else if(i<=32)e.addContainer(qe[i-19],c);else if(i<=38)e.addComponent(qe[i-19],c);else{if(i<=45)return i===39?c.splice(2,0,"ENTERPRISE"):i===40?c.splice(2,0,"SYSTEM"):i===42&&c.splice(2,0,"CONTAINER"),i>=43?e.addDeploymentNode(Wt[i-43],c):i===42?e.addContainerBoundary(c):e.addPersonOrSystemBoundary(c),n[s]===62?(s++,a(13)):n[s]===13?(s++,a(62),n[s]===13&&s++):o("'NEWLINE', 'LBRACE'"),!0;i<=53?(i===53&&c.splice(0,1),e.addRel(Xt[i-46],c)):i===54?e.updateElStyle("update_el_style",c):i===55?e.updateRelStyle("update_rel_style",c):e.updateLayoutConfig("update_layout_config",c)}return!1},p2=n[s];(p2<14||p2>18)&&o(Ft),s++,a(13);let S2=0,N=0;for(;;){let i=n[s];if(N===3||N===4){if(i===13){s++,N=2;continue}if(N===3&&bt(i)){N=1;continue}}else if(bt(i)){m2(i)?(S2++,N=1):N=4;continue}else if(qt(i)&&N!==1){h2(i),N=3;continue}else N!==2&&o("'title', 'accDescription', 'acc_title', 'acc_descr', 'acc_descr_multiline_value', 'PERSON', 'REL'");if(S2>0)i!==63&&o("'NEWLINE', 'RBRACE'"),s++,e.popBoundaryParseStack(),S2--,N=4;else{i!==64&&o("'NEWLINE', 'EOF'"),s++,a(0),e.setC4Type(l(0));return}}}var fe=28,le=20,Ot=7,Ht=8,Gt=30,pe=88,Oe=160,Ie=8,xe=26,Ge=t=>Math.min(12,Math.max(6,t/14)),ze=t=>Math.min(12,t/4);function ce(t,e,n,r,u,s,l,o){let a=0,f=1;if(l===0){if(u<t||u>n)return 1/0}else{let h2=(t-u)/l,m2=(n-u)/l;a=Math.max(a,Math.min(h2,m2)),f=Math.min(f,Math.max(h2,m2))}if(o===0){if(s<e||s>r)return 1/0}else{let h2=(e-s)/o,m2=(r-s)/o;a=Math.max(a,Math.min(h2,m2)),f=Math.min(f,Math.max(h2,m2))}return a<=f?a:1/0}function ye(t,e,n,r,u,s,l,o){let a=l/n,f=o/r,h2=(u-t)/n,m2=(s-e)/r,p2=a*a+f*f,S2=2*(a*h2+f*m2),N=h2*h2+m2*m2-1,i=S2*S2-4*p2*N;if(p2===0||i<0)return 1/0;let c=(-S2-Math.sqrt(i))/(2*p2);return c>=0&&c<=1?c:N<=0?0:1/0}function X(t,e,n,r,u){let{x:s,y:l,w:o,h:a}=t,f=r-e,h2=u-n;if(t.form==="person")return Math.min(ce(s,l+xe,s+o,l+a,e,n,f,h2),ye(s+o/2,l+14,13,13,e,n,f,h2));if(t.form==="cyl"){let m2=Ge(o);return Math.min(ce(s,l+m2,s+o,l+a-m2,e,n,f,h2),ye(s+o/2,l+m2,o/2,m2,e,n,f,h2),ye(s+o/2,l+a-m2,o/2,m2,e,n,f,h2))}if(t.form==="h-cyl"){let m2=ze(a);return Math.min(ce(s+m2,l,s+o-m2,l+a,e,n,f,h2),ye(s+m2,l+a/2,m2,a/2,e,n,f,h2),ye(s+o-m2,l+a/2,m2,a/2,e,n,f,h2))}return ce(s,l,s+o,l+a,e,n,f,h2)}function je(t,e,n,r,u){for(let s=2;s<t.length;s+=2){let l=t[s-2],o=t[s-1];if(ce(e,n,r,u,l,o,t[s]-l,t[s+1]-o)<=1)return!0}return!1}function Se(t,e){return t.x<=e.x&&t.y<=e.y&&t.x+t.w>=e.x+e.w&&t.y+t.h>=e.y+e.h}function zt(t,e,n){let r=t.x+t.w/2,u=t.y+t.h/2,s=e.x+e.w/2,l=e.y+e.h/2,o=Se(t,e);if(o||Se(e,t)){let C=o?t:e,D=o?e:t,k=D.x+D.w/2,U2=D.y+D.h/2,W=D.x-C.x,T=C.x+C.w-D.x-D.w,J=D.y-C.y,F=C.y+C.h-D.y-D.h,Y=Math.min(W,T,J,F),Q=Y===W?C.x:Y===T?C.x+C.w:k,q=Y===W||Y===T?U2:Y===F?C.y+C.h:C.y,ee=Math.min(X(D,Q,q,k,U2),1),te=Q+(k-Q)*ee,j=q+(U2-q)*ee;return o?[Q,q,te,j]:[te,j,Q,q]}let a=r,f=u,h2=s,m2=l,p2=Math.max(t.x,e.x),S2=Math.min(t.x+t.w,e.x+e.w),N=Math.max(t.y,e.y),i=Math.min(t.y+t.h,e.y+e.h);p2<S2?a=h2=(p2+S2)/2:N<i&&(f=m2=(N+i)/2);let c=Math.hypot(h2-a,m2-f)||1,E2=-(m2-f)/c*n,_2=(h2-a)/c*n,x=X(t,h2+E2,m2+_2,a+E2,f+_2),M=X(e,a+E2,f+_2,h2+E2,m2+_2);return x<=1&&M<=1?(a+=E2,f+=_2,h2+=E2,m2+=_2):(a=r,f=u,h2=s,m2=l,x=Math.min(X(t,h2,m2,a,f),1),M=Math.min(X(e,a,f,h2,m2),1)),[h2+(a-h2)*x,m2+(f-m2)*x,a+(h2-a)*M,f+(m2-f)*M]}var He=6,jt=3,Mt=12,De=class{upright=[];level=[];frames=[[],[]];taken=new Map;squeezed=0;free(e,n,r,u){let s=Math.min(r,u),l=Math.max(r,u),o=(a,f)=>{for(let h2=0;h2<a.length;h2+=3)if(Math.abs(a[h2]-n)<f&&a[h2+1]<l&&a[h2+2]>s)return!0;return!1};return!o(e?this.upright:this.level,He)&&!o(this.frames[e?0:1],jt)}crossings(e){let n=0;for(let r=2;r<e.length;r+=2){let u=e[r]===e[r-2],s=u?e[r]:e[r+1],l=Math.min(u?e[r-1]:e[r-2],u?e[r+1]:e[r]),o=Math.max(u?e[r-1]:e[r-2],u?e[r+1]:e[r]),a=u?this.level:this.upright;for(let f=0;f<a.length;f+=3)a[f]>l&&a[f]<o&&a[f+1]<s&&a[f+2]>s&&n++}return n}frame(e){this.frames[0].push(e.x,e.y,e.y+e.h,e.x+e.w,e.y,e.y+e.h),this.frames[1].push(e.y,e.x,e.x+e.w,e.y+e.h,e.x,e.x+e.w)}take(e){for(let n=2;n<e.length;n+=2)e[n]===e[n-2]?this.upright.push(e[n],Math.min(e[n-1],e[n+1]),Math.max(e[n-1],e[n+1])):e[n+1]===e[n-1]&&this.level.push(e[n+1],Math.min(e[n-2],e[n]),Math.max(e[n-2],e[n]))}ports(e,n,r,u,s){let l=this.taken.get(e)??[],o=[];for(let a=0;a<9&&o.length<4;a++){let f=r+(a&1?1:-1)*Math.ceil(a/2)*Mt;if(f<u||f>s)continue;let h2=!0;for(let m2=0;m2<l.length;m2+=2)l[m2]===n&&Math.abs(l[m2+1]-f)<Mt&&(h2=!1);h2&&o.push(f)}return o.length?o:[r]}claim(e,n,r){let u=this.taken.get(e);u?u.push(n,r):this.taken.set(e,[n,r])}};function Kt(t,e,n){let r=t.length,u=Math.sign(t[2]-t[0]),s=Math.sign(t[3]-t[1]),l=`M${m(t[0]+u*e)},${m(t[1]+s*e)}`;for(let f=2;f<r-2;f+=2){let h2=t[f],m$1=t[f+1],p2=Math.sign(h2-t[f-2]),S2=Math.sign(m$1-t[f-1]),N=Math.sign(t[f+2]-h2),i=Math.sign(t[f+3]-m$1),c=Math.min(Ht,Math.abs(h2-t[f-2]+m$1-t[f-1])/2,Math.abs(t[f+2]-h2+t[f+3]-m$1)/2);l+=`${p2?"H"+m(h2-p2*c):"V"+m(m$1-S2*c)}Q${m(h2)},${m(m$1)} ${m(h2+N*c)},${m(m$1+i*c)}`}let o=Math.sign(t[r-2]-t[r-4]),a=Math.sign(t[r-1]-t[r-3]);return l+(o?"H"+m(t[r-2]-o*n):"V"+m(t[r-1]-a*n))}function St(t,e,n,r){for(let u of e)if(u!==n&&u!==r&&je(t,u.x,u.y,u.x+u.w,u.y+u.h))return!1;return!0}function Dt(t,e,n,r,u){let s=t.length;return{d:Kt(t,n,r),sx:t[0],sy:t[1],sdx:-Math.sign(t[2]-t[0]),sdy:-Math.sign(t[3]-t[1]),ex:t[s-2],ey:t[s-1],edx:Math.sign(t[s-2]-t[s-4]),edy:Math.sign(t[s-1]-t[s-3]),x0:t[e],y0:t[e+1],x1:t[e+2],y1:t[e+3],nx:0,ny:0,lean:0,room:Oe,...u,points:t}}function At(t,e){let n=[],r=(t+e)/2,u=Math.max(Ot,(e-t)/4);for(let s=0;s<9;s++){let l=r+(s&1?1:-1)*Math.ceil(s/2)*u;l>=t+He&&l<=e-He&&n.push(l)}return n}function Vt(t,e,n,r,u,s){let l=t.x+t.w/2,o=t.y+t.h/2,a=e.x+e.w/2,f=e.y+e.h/2,h2,m2=(i,c,E2)=>{if(!St(i,n,t,e))return;for(let x=2;x<i.length;x+=2){let M=i[x]===i[x-2];if(!r.free(M,M?i[x]:i[x+1],M?i[x-1]:i[x-2],M?i[x+1]:i[x]))return}let _2=r.crossings(i)*1e6;for(let x=2;x<i.length;x+=2)_2+=Math.abs(i[x]-i[x-2])+Math.abs(i[x+1]-i[x-1]);(!h2||_2<h2.cost)&&(h2={points:i,cost:_2,upright:c,sides:E2})};if(t.x+t.w<=e.x||e.x+e.w<=t.x){let i=a>l,c=Math.sign(f-o),E2=i?[1,0]:[0,1],_2=At(i?t.x+t.w:e.x+e.w,i?e.x:t.x);e:for(let x of r.ports(t,E2[0],o+c*t.h/4,t.y+8,t.y+t.h-8))for(let M of r.ports(e,E2[1],f-c*e.h/4,e.y+8,e.y+e.h-8))for(let C of _2){let D=C+(l-C)*Math.min(X(t,C,x,l,x),1),k=C+(a-C)*Math.min(X(e,C,M,a,M),1),U2=h2;if(m2([D,x,C,x,C,M,k,M],!0,E2),h2!==U2)break e}}if(t.y+t.h<=e.y||e.y+e.h<=t.y){let i=f>o,c=Math.sign(a-l),E2=i?[3,2]:[2,3],_2=At(i?t.y+t.h:e.y+e.h,i?e.y:t.y);e:for(let x of r.ports(t,E2[0],l+c*t.w/4,t.x+8,t.x+t.w-8))for(let M of r.ports(e,E2[1],a-c*e.w/4,e.x+8,e.x+e.w-8))for(let C of _2){let D=C+(o-C)*Math.min(X(t,x,C,x,o),1),k=C+(f-C)*Math.min(X(e,M,C,M,f),1),U2=h2;if(m2([x,D,x,C,M,C,M,k],!1,E2),h2!==U2)break e}}if(!h2)return;let{points:p2,upright:S2,sides:N}=h2;return r.take(p2),r.claim(t,N[0],S2?p2[1]:p2[0]),r.claim(e,N[1],S2?p2[7]:p2[6]),Dt(p2,2,u,s,{room:S2?pe:Oe})}function It(t,e,n,r,u,s,l){if(t===e){let c=Math.min(t.h/2-4,10),E2=Math.hypot(fe,c),_2=t.x+t.w,x=t.y+t.h/2,M=fe/E2,C=c/E2;return{d:`M${m(_2+M*s)},${m(x-c-C*s)}C${m(_2+fe)},${m(x-c*2)} ${m(_2+fe)},${m(x+c*2)} ${m(_2+M*l)},${m(x+c+C*l)}`,sx:_2,sy:x-c,sdx:-M,sdy:C,ex:_2,ey:x+c,edx:-M,edy:-C,x0:_2+fe+4,y0:x,x1:_2+fe+4,y1:x,nx:1,ny:0,lean:0,room:64,points:[]}}let[o,a,f,h2]=zt(t,e,n),m$1=o===f,p2=!1;if(r&&!Se(t,e)&&!Se(e,t))for(let c of r)c!==t&&c!==e&&ce(c.x,c.y,c.x+c.w,c.y+c.h,o,a,f-o,h2-a)<=1&&(p2=!0);if(r&&p2&&!m$1&&a!==h2){let c=Vt(t,e,r,u,s,l);if(c)return c;u.squeezed++}if(r&&p2&&(m$1||a===h2)){let c=$=>{let H=$?-1/0:1/0,P=d=>{let g=m$1?d.x:d.y;H=$?Math.max(H,g+(m$1?d.w:d.h)):Math.min(H,g)};P(t),P(e);for(let d of r)d!==t&&d!==e&&ce(d.x,d.y,d.x+d.w,d.y+d.h,o,a,f-o,h2-a)<=1&&P(d);return H},E2=m$1?Math.min(t.y,e.y):Math.min(t.x,e.x),_2=m$1?Math.max(t.y+t.h,e.y+e.h):Math.max(t.x+t.w,e.x+e.w),x=($,H)=>{for(let P of r){if(P===t||P===e)continue;let d=m$1?P.y<_2&&P.y+P.h>E2:P.x<_2&&P.x+P.w>E2,g=m$1?P.x:P.y,y=g+(m$1?P.w:P.h);if(d&&($?y>H:g<H))return!1}return!0},M=t.x+t.w/2,C=t.y+t.h/2,D=e.x+e.w/2,k=e.y+e.h/2,U2=Math.sign(m$1?k-C:D-M),W=$=>{let H=c($),P=$?1:-1,d=m$1?$?1:0:$?3:2,g=m$1?u.ports(t,d,C+U2*t.h/4,t.y+8,t.y+t.h-8)[0]:u.ports(t,d,M+U2*t.w/4,t.x+8,t.x+t.w-8)[0],y=m$1?u.ports(e,d,k-U2*e.h/4,e.y+8,e.y+e.h-8)[0]:u.ports(e,d,D-U2*e.w/4,e.x+8,e.x+e.w-8)[0],I=b=>{if(m$1){let R2=b+(M-b)*Math.min(X(t,b,g,M,g),1),w=b+(D-b)*Math.min(X(e,b,y,D,y),1);return[R2,g,b,g,b,y,w,y]}let L=b+(C-b)*Math.min(X(t,g,b,g,C),1),v=b+(k-b)*Math.min(X(e,y,b,y,k),1);return[g,L,g,b,y,b,y,v]},A=I(H+P*le);for(let b=0;b<=4;b++){let L=H+P*(le+b*Ot),v=I(L);if(St(v,r,t,e)&&(A=v,u.free(m$1,L,g,y)))return{points:A,side:d,p0:g,p1:y,step:b}}return{points:A,side:d,p0:g,p1:y,step:5}},T=m$1?h2>a:f<o,J=x(T,c(T)),F=x(!T,c(!T)),Y=W(T),Q=J===F?W(!T):void 0,q=$=>u.crossings($.points)*8+$.step,ee=F&&!J||Q&&q(Q)<q(Y)?!T:T,{points:te,side:j,p0:Ce,p1:Re,step:he}=ee===T?Y:Q??W(!T),be=ee?1:-1;return he>4&&u.squeezed++,u.take(te),u.claim(t,j,Ce),u.claim(e,j,Re),Dt(te,2,s,l,m$1?{nx:be,lean:Gt,room:pe}:{room:Oe})}let S2=Math.hypot(f-o,h2-a)||1,N=(f-o)/S2,i=(h2-a)/S2;return(m$1||a===h2)&&u.take([o,a,f,h2]),{d:`M${m(o+N*s)},${m(a+i*s)}L${m(f-N*l)},${m(h2-i*l)}`,sx:o,sy:a,sdx:-N,sdy:-i,ex:f,ey:h2,edx:N,edy:i,x0:o,y0:a,x1:f,y1:h2,nx:n?-i:0,ny:n?N:0,lean:0,room:Math.abs(N)>Math.abs(i)?pe:Oe,points:[o,a,f,h2]}}var Ve=216,Jt=64,Lt=14,Zt=12,en=pe+Ie+3*Tt$1,tn=88,wt=le+8,Le=48,de=16,we=10,Ke=new Map([["person","person"],["box","rect"],["rounded","rect"],["component","rect"],["cylinder","cyl"],["database","cyl"],["db","cyl"],["queue","h-cyl"],["pipe","h-cyl"]]);function nn(t){let e=Ke.get((t.shape??"").toLowerCase())??Ke.get((t.sprite??"").toLowerCase());if(e)return e;if(t.tags)for(let r of t.tags.split(",")){let u=Ke.get(r.trim().toLowerCase());if(u)return u}let n=t.kind;return n.endsWith("person")?"person":n.endsWith("_db")?"cyl":n.endsWith("_queue")?"h-cyl":"rect"}function on(t,e,n,r,u=Ve){let s=nn(t),l=s==="h-cyl"?36:0,o=s==="person"?xe:s==="cyl"?24:0,a=u-2*Lt-l,f=[It$1("«"+t.kind.replace(/_/g," ")+"»",!1,e,r-1,a),It$1(t.label,!1,e,n,a,1),It$1(t.techn?`[${t.techn}]`:void 0,!1,e,r,a),It$1(t.descr,!1,e,r,a)],h2=0,m2=f[3].height>0?4:0;for(let p2 of f)h2=Math.max(h2,p2.width),m2+=p2.height;return{shape:t,form:s,labels:f,textH:m2,x:0,y:0,w:Math.max(u,h2+2*Lt+l),h:Math.max(Jt,m2+2*Zt+o)}}function Bt(t,e,n,r,u){let s=0,l=0;for(let o=0;o<t.length;o+=e){let a=Math.min(t.length,o+e),f=0,h2=0;for(let m2=o;m2<a;m2++)h2=Math.max(h2,t[m2].h);for(let m2=o;m2<a;m2++){let p2=t[m2];p2.x=f,p2.y=l,u&&(p2.h=h2),f+=p2.w+n}s=Math.max(s,f-n),l+=h2+r}return[s,t.length>0?l-r:0]}function Tt(t,e,n,r,u,s){let l=u===void 0?wt:12,o=new Map;for(let i of t.boundaries){let c=u===void 0?4e3:Math.max(80,u-2*de-2*wt*2),E2=i.parent?[It$1(i.label,!1,e,n,c,1),It$1(i.type?`[${i.type}]`:void 0,!1,e,r,c),It$1(i.descr,!1,e,r,c)]:[],_2=0,x=0;for(let M of E2)_2+=M.height,x=Math.max(x,M.width);o.set(i,{boundary:i,kids:[],nodes:[],labels:E2,head:_2>0?_2+we+6+le:l,headW:x,headX:de,x:0,y:0,w:0,h:0,form:"rect"})}let a=o.get(t.boundaries[0]);for(let i of o.values()){let c=i.boundary.parent;c&&o.get(c)?.kids.push(i)}let f=[a],h2=new Map([[a.boundary,0]]);for(let i=0;i<f.length;i++)for(let c of f[i].kids)h2.set(c.boundary,h2.get(f[i].boundary)+1),f.push(c);for(let i of t.shapes)if(i.parent){let c=h2.get(i.parent)??0,E2=u===void 0?Ve:Math.max(100,Math.min(Ve,u-2*c*l-32));o.get(i.parent)?.nodes.push(on(i,e,n,r,E2))}let m2=Math.max(1,t.shapeInRow),p2=Math.max(1,t.boundaryInRow),S2=new Map;for(let i=f.length-1;i>=0;i--){let c=f[i],E2=u===void 0?en:s,_2=(W,T,J)=>{if(u===void 0)return T;let F=1;for(let Y of W)F=Math.max(F,Y.w);return Math.max(1,Math.min(T,Math.floor((u+J-2*l)/(F+J))))},[x,M]=Bt(c.nodes,_2(c.nodes,m2,E2),E2,tn,!0),[C,D]=Bt(c.kids,_2(c.kids,p2,Le),Le,Le,!1),k=M>0&&D>0?Le:0,U2=c===a?0:l;S2.set(c,M+k),c.w=Math.max(x,C,c.headW+2*de-2*U2)+2*U2,c.h=(U2&&c.head)+M+k+D+U2}let N=new Map;for(let i of f){let c=i.x+(i===a?0:l),E2=i.y+(i===a?0:i.head);for(let _2 of i.nodes)_2.x+=c,_2.y+=E2,N.set(_2.shape,_2);for(let _2 of i.kids)_2.x+=c,_2.y+=E2+S2.get(i);i!==a&&N.set(i.boundary,i)}return{order:f,boxes:N}}var rn=7,Te=36,Je=24,vt=2e3,Be=8,sn=[.5,.4,.6,.3,.7,.2,.8],cn=2e6;function ge(t,e,n){let r=[];return t&&r.push("fill:"+t),e&&r.push("stroke:"+e),n&&r.push("color:"+n),Ft$2(r)}function Ze(t,e,n,r,u){return e?U(t,_(e.includes("¶ß")?e.replace(/\ufb02\u00b0\u00b0?/g,"#").replace(/\u00b6\u00df/g,";"):e),n,r,u):t}function Ut(t,e,n){return p(n,r=>{if(!r)return et(t,e,n,!1)[0];let[u,s]=et(t,e,n,!0,Te);for(let l=Te+Je;s>0&&l<=Te+3*Je;l+=Je){let[o,a]=et(t,e,n,!0,l);a<s&&([u,s]=[o,a])}return u})}function et(t,e,n,r,u=Te){let s=n.fontSize??16,l=Math.round(s*.8125),o=n.measurer??Ot$1(n.fontFamily,n.fontFamilyMono),a=n.padding??8,f=[],{order:h$1,boxes:m$1}=Tt(t,o,s,l,r?Math.max(80,(n.maxWidth??320)-2*a):void 0,u),p2=h$1[0],S$1=0,N=0,i=p2.w,c=p2.h,E$1=(d,g,y,I)=>{S$1=Math.min(S$1,d),N=Math.min(N,g),i=Math.max(i,y),c=Math.max(c,I)},_2=[],x=new Map;for(let d of t.rels){let g=d.fromAttr?void 0:t.getC4Shape(d.from),y=d.toAttr?void 0:t.getC4Shape(d.to),I=g&&m$1.get(g),A=y&&m$1.get(y);if(!I||!A)throw new R(`C4 rel "${d.from}" -> "${d.to}" references an unknown shape or boundary`,"semantic",{type:"c4"});_2.push(I,A);let b=x.get(I);b||x.set(I,b=new Set),b.add(A)}let M=[],C=[];for(let d of h$1)for(let g of d.nodes)M.push(g),C.push(g.x+Be,g.y+Be,g.x+g.w-Be,g.y+g.h-Be);let D=t.rels.length*(M.length+h$1.length+3*t.rels.length)<=cn,k=(d,g,y,I)=>{let A=0;for(let b=0;b<C.length;b+=4){let L=Math.min(y,C[b+2])-Math.max(d,C[b]);if(L<=0)continue;let v=Math.min(I,C[b+3])-Math.max(g,C[b+1]);v>0&&(A+=L*v)}return A},U2=d=>d?Math.max(-vt,Math.min(vt,d)):0,W="",T="",J=_n("arrow_point"),F=[];for(let d of h$1){if(d===p2)continue;let g=ge(d.boundary.bgColor,void 0,void 0).shape;Pt(g)&&F.push({box:[d.x,d.y,d.x+d.w,d.y+d.h],shape:g})}let Y=new De;for(let d of h$1)d!==p2&&Y.frame(d);let Q=t.rels.map((d,g)=>{let y=_2[g*2],I=_2[g*2+1],A=ge(void 0,d.lineColor,void 0),b=d.type==="birel"||d.type==="rel_b",L=d.type!=="rel_b",v=y!==I&&x.get(I)?.has(y)===!0,R2=It(y,I,v?rn:0,D?M:void 0,Y,b?J:0,L?J:0);E$1(Math.min(R2.x0,R2.x1),Math.min(R2.y0,R2.y1),Math.max(R2.x0,R2.x1),Math.max(R2.y0,R2.y1)),b&&D&&C.push(R2.sx-Tt$1,R2.sy-Tt$1,R2.sx+Tt$1,R2.sy+Tt$1),L&&D&&C.push(R2.ex-Tt$1,R2.ey-Tt$1,R2.ex+Tt$1,R2.ey+Tt$1);let w=oe(R2.d,[R2.sx,R2.sy,R2.ex,R2.ey],F,A.line),Z=w||(A.stroke?S(A.stroke):"var(--_l)");return w===""&&(W+=se(R2,b?"arrow_point":"none",L?"arrow_point":"none",A.line)),T+=`<g class="pele-edge" data-id="${Tn(d.from+"-"+d.to)}"${w?` stroke="${w}"`:""}${A.line}><path d="${R2.d}"/>`+(b?cn$1("arrow_point",R2.sx,R2.sy,R2.sdx,R2.sdy,Z):"")+(L?cn$1("arrow_point",R2.ex,R2.ey,R2.edx,R2.edy,Z):"")+"</g>",R2});for(let d of h$1){if(!D||d.headW===0)continue;let g=d.y+we,y=d.y+d.head-le,I=1/0;for(let A of[de,(d.w-d.headW)/2,d.w-de-d.headW]){let b=0;for(let L of Q)je(L.points,d.x+A-4,g,d.x+A+d.headW+4,y)&&b++;if(b<I&&(I=b,d.headX=A),b===0)break}C.push(d.x+d.headX-4,g,d.x+d.headX+d.headW+4,y)}let q="";t.rels.forEach((d,g)=>{let y=Q[g],I=d.from+"-"+d.to,A=ge(void 0,void 0,d.textColor),b=(t.c4Type==="C4Dynamic"?g+1+": ":"")+d.label,L=It$1(b,!1,o,l,y.room),v=It$1(d.techn?`[${d.techn}]`:void 0,!1,o,l,y.room,2),R2=Math.max(L.width,v.width)+Ie,w=L.height+v.height;if(w===0)return;let Z=Math.abs(y.nx)*(R2/2)+Math.abs(y.ny)*(w/2)+2,ne=y.lean?Math.max(0,Math.min(y.lean,Z-14)):Z,re=y.nx*ne+(r?0:U2(d.offsetX)),se2=y.ny*ne+(r?0:U2(d.offsetY)),K=.5;if(D){let ve=1/0,Pt2=re!==y.nx*ne||se2!==y.ny*ne;for(let Ne=0;Ne<(Pt2?2:1)&&ve>0;Ne++){let tt=Ne?y.nx*ne:re,nt=Ne?y.ny*ne:se2;for(let Ue of sn){let ot=y.x0+(y.x1-y.x0)*Ue+tt,rt=y.y0+(y.y1-y.y0)*Ue+nt,Pe=k(ot-R2/2,rt-w/2,ot+R2/2,rt+w/2);if(Pe<ve&&(ve=Pe,K=Ue,re=tt,se2=nt),Pe===0)break}}}let G=y.x0+(y.x1-y.x0)*K+re,ie=y.y0+(y.y1-y.y0)*K+se2-w/2;D&&C.push(G-R2/2,ie,G+R2/2,ie+w),E$1(G-R2/2,ie,G+R2/2,ie+w),q+=`<g class="pele-edge-label" data-id="${Tn(I)}">`+(d.descr?`<title>${Tn(d.descr)}</title>`:"")+`<rect x="${m(G-R2/2)}" y="${m(ie)}" width="${m(R2)}" height="${m(w)}" rx="3" fill="var(--_bg)"/>`+Ze(Yt$1(L,G,ie+L.height/2,A.text)+Yt$1(v,G,ie+L.height+v.height/2,` class="pele-c4-techn" fill="var(--_m)"${A.text}`),d.link,I,f,n)+"</g>"});let ee="",te="";for(let d of h$1){if(d!==p2){let g=d.boundary,y=ge(g.bgColor,g.borderColor,g.fontColor),I=d.x+d.headX,A=d.y+we,b=Ft$1(y)+y.text,L=Ft$1(y,"var(--_m)")+y.text,v=E(d.labels[0],I,A,` class="pele-cluster-label" font-weight="var(--_hw)"${b}`);A+=d.labels[0].height,v+=E(d.labels[1],I,A,` class="pele-c4-type" font-size="${l}"${L}`),A+=d.labels[1].height,v+=E(d.labels[2],I,A,` class="pele-c4-descr" font-size="${l}"${L}`),ee+=`<g class="pele-cluster pele-c4-${g.nodeType?"node":"boundary"}" data-id="${Tn(g.alias)}"><rect x="${m(d.x)}" y="${m(d.y)}" width="${m(d.w)}" height="${m(d.h)}" fill="none" stroke="var(--_b)"${g.nodeType?"":' stroke-dasharray="6 4"'}${Nt$1(y.shape)}/>`+Ze(v,g.link,g.alias,f,n)+"</g>"}for(let g of d.nodes){let y=g.shape,I=y.kind.startsWith("external"),A=ge(y.bgColor,y.borderColor,y.fontColor),b=' stroke="var(--_b)"'+(I?' stroke-dasharray="4 3"':""),{w:L,h:v,form:R2,labels:w}=g,Z=R2==="h-cyl"?-ze(v)/2:0,ne=R2==="person"?xe/2:R2==="cyl"?Ge(L)/2:0,re=Ft$1(A)+A.text,se2=Ft$1(A,"var(--_m)")+A.text,K=ne-g.textH/2,G=Yt$1(w[0],Z,K+w[0].height/2,` class="pele-c4-type" font-size="${l-1}"${se2}`);K+=w[0].height,G+=Yt$1(w[1],Z,K+w[1].height/2,` class="pele-label" font-weight="var(--_hw)"${re}`),K+=w[1].height,G+=Yt$1(w[2],Z,K+w[2].height/2,` class="pele-c4-techn" font-size="${l}"${se2}`),K+=w[2].height+4,G+=Yt$1(w[3],Z,K+w[3].height/2,` class="pele-c4-descr" font-size="${l}"${re}`),te+=`<g class="pele-node pele-shape-${R2} pele-c4-${y.kind}${I?" pele-c4-external":""}" data-id="${Tn(y.alias)}" transform="translate(${m(g.x+L/2)},${m(g.y+v/2)})">`+Ze(R$1(R2,L,v,` fill="var(${I?"--_bg":"--_s"})"${b}${A.shape}`,b+A.line)+G,y.link,y.alias,f,n)+"</g>"}}let j=It$1(t.title,!1,o,s,r?h(n):4e3,1),Ce=j.height>0?j.height+12:0,Re=Math.max(i-S$1,j.width),he=Math.ceil(Re+2*a),be=Math.ceil(c-N+Ce+2*a),$=a-S$1+(Re-(i-S$1))/2,H=a+Ce-N;return[{svg:Yt$2("c4",he,be,s,n,t,Yt$1(j,he/2,a+j.height/2,' class="pele-title" font-weight="var(--_tw)"')+`<g transform="translate(${m($)},${m(H)})">`+(ee?`<g class="pele-clusters">${ee}</g>`:"")+ae$1(W)+(T?`<g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round">${T}</g>`:"")+(te?`<g class="pele-nodes">${te}</g>`:"")+(q?`<g class="pele-edge-labels" font-size="${l}">${q}</g>`:"")+"</g>"),width:he,height:be,links:f},Y.squeezed]}var Wn={type:"c4",parse(t,e,n){let r=new Ae;return n&&(r.title=n),Nt(t,r),r},render:Ut};export{Wn as c4};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{s}from"./RVARI57O-3awfcSaT.js";import{l}from"./DKTLEL5E-CJTkVtjr.js";import{I as It,g as gt,D as Dt,F as Ft,Y as Yt$2,K as Kt$1}from"./BGW36YJW-
|
|
1
|
+
import{s}from"./RVARI57O-3awfcSaT.js";import{l}from"./DKTLEL5E-CJTkVtjr.js";import{I as It,g as gt,D as Dt,F as Ft,Y as Yt$2,K as Kt$1}from"./BGW36YJW-BAwgTZ_z.js";import{O as Ot,m,Y as Yt$1,T as Tn,R,E as Et,y as ye,l as yt$1,w as wt,i as it,x as xt$1}from"./lazy-CUmWiDAP.js";import"./kit-CD3F-f6F.js";import"./vendor-react-CxJ4vs-5.js";import"./vendor-motion-C2jPaSqL.js";import"./vendor-owxl31sT.js";import"./core-Cj89wpQh.js";import"./vendor-editor-gVJMCtGz.js";var oe=/^\d+$/,Ht=/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/,ce=/^\d+px$/;function ft(t,e,i){return new R(`value for ${t} ${e} is invalid, please use a valid ${i}`,"semantic",{type:"quadrantChart"})}function ue(t){let e=t.trim(),i=e.indexOf(":");if(i===-1)return[e,"undefined"];let r=e.slice(i+1).trimStart(),u=r.indexOf(":");return[e.slice(0,i).trimEnd(),u===-1?r:r.slice(0,u).trimEnd()]}function Kt(t){let e={};for(let i of t){let[r,u]=ue(i);if(r==="radius"){if(!oe.test(u))throw ft(r,u,"number");e.radius=parseInt(u)}else if(r==="color"){if(!Ht.test(u))throw ft(r,u,"hex code");e.color=u}else if(r==="stroke-color"){if(!Ht.test(u))throw ft(r,u,"hex code");e.strokeColor=u}else if(r==="stroke-width"){if(!ce.test(u))throw ft(r,u,"number of pixels (eg. 10px)");e.strokeWidth=u}else throw new R(`style named ${r} is not supported.`,"semantic",{type:"quadrantChart"})}return e}function F(t){return{text:t.text.trim(),type:t.type}}var xt=class{type="quadrantChart";title;accTitle;accDescr;quadrants=[void 0,void 0,void 0,void 0];xAxisLeft;xAxisRight;yAxisBottom;yAxisTop;points=[];classes=new Map;setQuadrant1Text(e){this.quadrants[0]=F(e)}setQuadrant2Text(e){this.quadrants[1]=F(e)}setQuadrant3Text(e){this.quadrants[2]=F(e)}setQuadrant4Text(e){this.quadrants[3]=F(e)}setXAxisLeftText(e){this.xAxisLeft=F(e)}setXAxisRightText(e){this.xAxisRight=F(e)}setYAxisBottomText(e){this.yAxisBottom=F(e)}setYAxisTopText(e){this.yAxisTop=F(e)}addPoint(e,i,r,u,a){this.points.push({x:Number(r),y:Number(u),text:F(e),className:i,...Kt(a)})}addClass(e,i){this.classes.set(e,Kt(i))}setDiagramTitle(e){this.title=e}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,"")}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
|
|
2
2
|
`)}},yt=["$end","INVALID","NEWLINE","title","title_value","acc_title","acc_title_value","acc_descr","acc_descr_value","acc_descr_multiline_value","X-AXIS","Y-AXIS","AXIS-TEXT-DELIMITER","QUADRANT_1","QUADRANT_2","QUADRANT_3","QUADRANT_4","CLASSDEF","MD_STR","STR","class_name","point_start","point_x","point_y","QUADRANT","ALPHA","UNICODE_TEXT","COLON","PLUS","COMMA","EQUALS","MULT","BRKT","UNDERSCORE","DOT","AMP","MINUS","NUM","SPACE","SEMI","PUNCTUATION","EOF"],Mt=[41,4,6,8,9,19],bt=new Uint8Array(128);for(let[t,e]of[[":",27],["+",28],[",",29],["=",30],["*",31],["#",32],["_",33],[".",34],["&",35],["-",36],[" \v\f",38],[";",39],["!$%'`?\\/",40]])for(let i=0;i<t.length;i++)bt[t.charCodeAt(i)]=e;function Yt(t){let e=t.length,i=[],r=[],u=[],a=[],g=0,n=0,$=0,U=0,q=0,d=0,h=0,M=0,O=0,w=0,A=(c,N,S)=>{i.push(c),r.push(t.slice(N,S)),u.push(N),n=S},L=c=>{a.push(g),g=c},b=()=>{a.length>0&&(g=a.pop())},B=c=>{let N=t.indexOf(`
|
|
3
3
|
`,c);return N===-1?e:N},Y=c=>{for(;t.charCodeAt(c)===32;)c++;return c},D=c=>{for(;c<e&&ye(t.charCodeAt(c));)c++;return c},J=c=>{let N=t.charCodeAt(c);if(N===49)return c+1;if(N!==48)return-1;let S=c+1;if(S<e&&!xt$1(t.charCodeAt(S))&&wt(t.charCodeAt(S+1)))for(S+=2;wt(t.charCodeAt(S));)S++;return S};t:for(;n<e;){let c=t.charCodeAt(n),N=t.charCodeAt(n+1);switch(g){case 0:break;case 1:case 2:case 3:A(Mt[g],n,B(n)),b();continue;case 4:if(c===125)n++,b();else{let s2=t.indexOf("}",n);A(9,n,s2===-1?e:s2)}continue;case 5:if(c===34)n++,b();else{let s2=t.indexOf('"',n);A(19,n,s2===-1?e:s2)}continue;case 6:if(c===96&&N===34){n+=2,b();continue}if(c!==96&&c!==34){let s2=n+1;for(let E=t.charCodeAt(s2);s2<e&&E!==96&&E!==34;E=t.charCodeAt(++s2));A(18,n,s2);continue}break t;case 7:if(Et(c)){let s2=n+1;for(;Et(t.charCodeAt(s2));)s2++;A(20,n,s2),b();continue}break t;case 8:{let s2=J(n);if(s2!==-1){A(22,n,s2),L(9);continue}let E=D(n);if(t.charCodeAt(E)===93){n=Y(E+1),b();continue}break t}case 9:{let s2=D(n);if(t.charCodeAt(s2)===44){n=D(s2+1),g=10;continue}break t}case 10:{let s2=J(n);if(s2!==-1){A(23,n,s2),b();continue}break t}}if(c===37&&N===37){n=B(n+2);continue}if(c===10||c===13){let s2=n+1;for(let E=t.charCodeAt(s2);E===10||E===13;E=t.charCodeAt(++s2));A(2,n,s2);continue}let S=c|32;if(S===116&&s(t,n,"title")&&!Et(t.charCodeAt(n+5))){A(3,n,n+5),L(1);continue}if(S===97&&s(t,n,"acc")){let s$1=s(t,n+3,"descr");if(s$1||s(t,n+3,"title")){let E=D(n+8),G=t.charCodeAt(E);if(G===58){A(s$1?7:5,n,D(E+1)),L(s$1?3:2);continue}if(G===123&&s$1){n=D(E+1),L(4);continue}}}let x=n;c===32&&((n<$||n>=U)&&($=n,U=Y(n)),x=U);let j=t.charCodeAt(x),W=j|32,I=0,X=0;if(W===120&&s(t,x,"x-axis"))I=10,X=x+6;else if(W===121&&s(t,x,"y-axis"))I=11,X=x+6;else if(j===45){if(x<q||x>=d)for(q=x,d=x;t.charCodeAt(d)===45;)d++;d-x>=2&&t.charCodeAt(d)===62&&(I=12,X=d+1)}else if(W===113&&s(t,x,"quadrant")){let s$1=t.charCodeAt(x+9);t.charCodeAt(x+8)===45&&s$1>=49&&s$1<=52?(I=13+s$1-49,X=x+10):s(t,x+8,"chart")&&(I=24,X=x+13)}if(I!==0){A(I,n,Y(X));continue}if(S===99&&s(t,n,"classdef")&&!Et(t.charCodeAt(n+8))){A(17,n,n+8);continue}if(c===34){N===96?(n+=2,L(6)):(n++,L(5));continue}if(c===58&&N===58&&t.charCodeAt(n+2)===58){n+=3,L(7);continue}if(c===58||ye(c)){let s2=n;if(c!==58&&((n<h||n>=M)&&(h=n,M=D(n)),s2=M),t.charCodeAt(s2)===58&&((s2+1<O||s2+1>=w)&&(O=s2+1,w=D(s2+1)),t.charCodeAt(w)===91)){A(21,n,D(w+1)),L(8);continue}}if(yt$1(c)){let s2=n+1;for(;yt$1(t.charCodeAt(s2));)s2++;A(25,n,s2);continue}if(c>=128){let s2=n+1;for(;t.charCodeAt(s2)>=128;)s2++;A(26,n,s2);continue}if(wt(c)){let s2=n+1;for(;wt(t.charCodeAt(s2));)s2++;A(37,n,s2);continue}if(bt[c]!==0){A(bt[c],n,n+1);continue}break}return n<e?(i.push(1),r.push(""),u.push(n),{types:i,texts:r,starts:u}):(g<Mt.length&&(i.push(Mt[g]),r.push(""),u.push(e)),i.push(0),r.push(""),u.push(e),{types:i,texts:r,starts:u})}function At(...t){let e=new Uint8Array(42);for(let i of t)e[i]=1;return e}var jt=At(40,35,37,25,29,28,30,31,34,32,33,26),Gt=At(25,37,36,29,27,35,32,31,26),Rt=At(25,37,27,38,32,36),Vt=At(2,39,41),de=["setQuadrant1Text","setQuadrant2Text","setQuadrant3Text","setQuadrant4Text"],le="'STR', 'MD_STR', 'ALPHA', 'NUM', 'UNICODE_TEXT', 'PUNCTUATION'";function Jt(t,e){let{types:i,texts:r,starts:u}=Yt(t),a=0,g=d=>{let h=i[a];throw h===1?it("quadrantChart",t,u[a],"",!0):it("quadrantChart",t,u[a],`Expecting ${d}, got '${yt[h]}'`)},n=d=>(i[a]!==d&&g(`'${yt[d]}'`),r[a++]),$=d=>d===19||d===18||jt[d]===1,U=()=>{let d=i[a];$(d)||g(le);let h=r[a++];for(;jt[i[a]]===1||i[a]===38||i[a]===36;)h+=r[a++];return{text:h,type:d===18?"markdown":"text"}},q=()=>{let d=[];for(;;){Rt[i[a]]===0&&g("'ALPHA', 'NUM', 'COLON', 'SPACE', 'BRKT', 'MINUS'");let h=r[a++];for(;Rt[i[a]]===1;)h+=r[a++];if(d.push(h.trim()),i[a]!==29)return d;a++}};for(;Vt[i[a]]===1||i[a]===38;)a++;for(n(24);i[a]!==0;){for(;i[a]===38;)a++;let d=i[a];switch(d){case 17:{a++,n(38),Gt[i[a]]===0&&g("'ALPHA', 'NUM', 'UNICODE_TEXT'");let h=r[a++];for(;Gt[i[a]]===1;)h+=r[a++];n(38),e.addClass(h,q());break}case 10:case 11:{a++;let h=U(),M;i[a]===12&&(a++,$(i[a])?M=U():h.text+=" ⟶ "),d===10?(e.setXAxisLeftText(h),M&&e.setXAxisRightText(M)):(e.setYAxisBottomText(h),M&&e.setYAxisTopText(M));break}case 13:case 14:case 15:case 16:a++,e[de[d-13]](U());break;case 3:a++,e.setDiagramTitle(n(4).trim());break;case 5:a++,e.setAccTitle(n(6).trim());break;case 7:a++,e.setAccDescription(n(8).trim());break;case 9:e.setAccDescription(r[a++].trim());break;default:if($(d)){let h=U(),M=i[a]===20?r[a++]:"";n(21);let O=n(22),w=n(23);e.addPoint(h,M,O,w,Rt[i[a]]===1?q():[])}}Vt[i[a]]===0&&g("'NEWLINE', 'SEMI', 'EOF'"),a++}}var Zt=4,he=300;function pt(t,e){return t.quadrantChart?.[e]}function z(t,e,i,r){let u=pt(t,e);return typeof u=="number"&&u>=0?Math.min(u,r):i}function at(t,e,i){let r=pt(t,e);return typeof r=="number"&&Number.isFinite(r)?Math.min(72,Math.max(4,r)):i}function te(t){return t.startsWith("#")?t:"#"+t}function ee(t,e,i){let r=i.fontSize??16,u=at(e,"titleFontSize",r),a=at(e,"quadrantLabelFontSize",r),g=at(e,"xAxisLabelFontSize",Math.round(r*.875)),n=at(e,"yAxisLabelFontSize",Math.round(r*.875)),$=at(e,"pointLabelFontSize",Math.round(r*.75)),U=(o,f)=>o===f?"":` font-size="${o}"`,q=i.measurer??Ot(i.fontFamily,i.fontFamilyMono),d=Math.round(Math.max(100,z(e,"chartWidth",500,4e3))),h=Math.round(l(i,d,280)),M=Math.round(Math.max(100,z(e,"chartHeight",500,4e3))*h/d),O=z(e,"quadrantPadding",i.padding??8,200),w=z(e,"xAxisLabelPadding",5,200),A=z(e,"yAxisLabelPadding",5,200),L=t.points.length>0,b=(o,f,m2)=>It(o?.text,o?.type==="markdown",q,f,Math.max(m2,40)),B=It(t.title,!1,q,u,Math.max(h-2*O,40),1),Y=z(e,"titlePadding",10,200),D=B.height>0?B.height+Y:0,J=!!(t.xAxisLeft?.text||t.xAxisRight?.text),c=!!(t.yAxisBottom?.text||t.yAxisTop?.text),N=L||pt(e,"xAxisPosition")==="bottom",S=pt(e,"yAxisPosition")==="right",x=h-2*O,j=b(t.xAxisLeft,g,t.xAxisRight?x/2-16:x),W=b(t.xAxisRight,g,x/2-16),I=Math.max(j.height,W.height),X=J?I+w:0,s2=M-2*O-D-X,E=b(t.yAxisBottom,n,t.yAxisTop?s2/2-16:s2),G=b(t.yAxisTop,n,s2/2-16),mt=Math.max(E.height,G.height),Tt=c?mt+A:0,C=O+(S?0:Tt),y=O+D+(N?0:X),R2=Math.max(0,x-Tt),Q=Math.max(0,s2),H=Math.max(0,(R2-Zt)/2),Z=Math.max(0,(Q-Zt)/2),T=[C+H,y,C+R2-H,y+Q,C,y+Z,C+R2,y+Q-Z],ne=(o,f,m2,p,_)=>{for(let l2=o;l2<T.length;l2+=4)if(!(T[l2]>=T[l2+2]||T[l2+1]>=T[l2+3])&&f<T[l2+2]&&p>T[l2]&&m2<T[l2+3]&&_>T[l2+1])return!1;return!0},ie=z(e,"quadrantTextTopPadding",5,200),Ut="";for(let o=0;o<4;o++){let f=o===0||o===3?C+R2-H:C,m$1=o<2?y:y+Q-Z,p=b(t.quadrants[o],a,H-16),_=f+H/2,l2=L?m$1+ie+p.height/2:m$1+Z/2;T.push(_-p.width/2,l2-p.height/2,_+p.width/2,l2+p.height/2),Ut+=`<g class="pele-quadrant" data-id="${o+1}"><rect x="${m(f)}" y="${m(m$1)}" width="${m(H)}" height="${m(Z)}"${gt}/>`+Yt$1(p,_,l2,` class="pele-label"${U(a,r)} fill="var(--_fg)" stroke="none"`)+"</g>"}let rt="";if(J){let o=N?y+Q+w+I/2:y-w-I/2;rt+=Yt$1(j,W.height>0?C+R2/4:C+j.width/2,o,"")+Yt$1(W,C+R2*3/4,o,"")}if(c){let o=S?C+R2+A+mt/2:C-A-mt/2,f=(m$1,p)=>m$1.height>0?`<g transform="translate(${m(o)},${m(p)}) rotate(-90)"${U(n,g)}>${Yt$1(m$1,0,0,"")}</g>`:"";rt+=f(E,G.height>0?y+Q*3/4:y+Q-E.width/2)+f(G,y+Q/4)}let se=z(e,"pointRadius",5,200),Dt$1=z(e,"pointTextPadding",5,200),Qt=Kt$1(0),tt=[],Lt=[];for(let o of t.points){if(!(o.x>=0&&o.x<=1&&o.y>=0&&o.y<=1))continue;let f=t.classes.get(o.className),m$1=Math.min(o.radius??f?.radius??se,2e3),p=o.color??f?.color,_=o.strokeColor??f?.strokeColor,l2=o.strokeWidth??f?.strokeWidth,P=[];p&&P.push("fill:"+te(p)),l2&&(_&&P.push("stroke:"+te(_)),P.push("stroke-width:"+l2));let ot=C+o.x*R2,ct=y+(1-o.y)*Q;tt.push({cx:ot,cy:ct,reach:m$1+(l2?Math.min(parseInt(l2),400)/2:0),text:b(o.text,$,R2)}),Lt.push(`<circle class="pele-point${Dt(o.className)}" data-id="${Tn(o.text.text)}" cx="${m(ot)}" cy="${m(ct)}" r="${m(m$1)}"${l2&&!_?` stroke="${Qt}"`:""}${Ft(P).shape}/>`)}let _t=tt.length<=he;if(_t)for(let{cx:o,cy:f,reach:m2}of tt)T.push(o-m2,f-m2,o+m2,f+m2);let It$1="";for(let{cx:o,cy:f,reach:m2,text:p}of tt){let _=p.width/2,l2=p.size*.6+(p.height-p.lineHeight)/2,P=m2+Dt$1,ot=Math.min(P,Math.max(0,(H-p.width)/2)),ct=8+4*(o<C+R2/2?f<y+Q/2?1:2:f<y+Q/2?0:3),re=Math.max(f+P,T[ct+3]+Dt$1)+l2,ut=[o,f+P+l2,o,f-P-l2,o+P+_,f,o-P-_,f,o,re],dt=o,lt=ut[1],Pt=!1;for(let ht=0;ht<20;ht+=2){let V=ht%10,Ot2=V===8?ot:0,et=(V<4||V===8)&&p.width<R2?Math.min(Math.max(ut[V],C+_+Ot2),C+R2-_-Ot2):ut[V],nt=ut[V+1];if(et-_<C||et+_>C+R2||nt-l2<y||nt+l2>y+Q)continue;let wt2=!_t||ne(ht<10?0:8,et-_,nt-l2,et+_,nt+l2);if((!Pt||wt2)&&(dt=et,lt=nt,Pt=!0),wt2)break}_t&&T.push(dt-_,lt-l2,dt+_,lt+l2),It$1+=Yt$1(p,dt,lt,' class="pele-label"')}let ae=Yt$1(B,h/2,Y/2+B.height/2,` class="pele-title"${U(u,r)} font-weight="var(--_tw)"`)+`<g class="pele-quadrants" fill="var(--_s)" stroke="var(--_b)">${Ut}</g>`+(rt?`<g class="pele-axis-labels" font-size="${g}" fill="var(--_m)">${rt}</g>`:"")+(tt.length>0?`<g class="pele-points" fill="${Qt}">${Lt.reverse().join("")}</g><g class="pele-point-labels" font-size="${$}">${It$1}</g>`:"");return{svg:Yt$2("quadrantChart",h,M,r,i,t,ae),width:h,height:M,links:[]}}var Oe={type:"quadrantChart",parse(t,e,i){let r=new xt;return r.title=i,Jt(t,r),r},render:ee};export{Oe as quadrantChart};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s}from"./G6GPDDNC-
|
|
1
|
+
import{s}from"./G6GPDDNC-Ax6dML4i.js";import{c}from"./DKTLEL5E-CJTkVtjr.js";import{x,D as D$1,M,$,V,W,G,O,P,H,z,B,U,Y,v,j}from"./EXE5EH6O-Cbj5xPKl.js";import{K as Kt,g as gt$1,I as It,Y as Yt$1}from"./BGW36YJW-BAwgTZ_z.js";import{O as Ot,T as Tn,m,Y as Yt,G as Gt,R}from"./lazy-CUmWiDAP.js";import"./kit-CD3F-f6F.js";import"./vendor-react-CxJ4vs-5.js";import"./vendor-motion-C2jPaSqL.js";import"./vendor-owxl31sT.js";import"./core-Cj89wpQh.js";import"./vendor-editor-gVJMCtGz.js";var w={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4};function D(n){throw new R(n,"semantic",{type:"gitGraph"})}function Xe(n){return n==="REVERSE"?w.REVERSE:n==="HIGHLIGHT"?w.HIGHLIGHT:w.NORMAL}function mt(n,e){n.dir&&e.setDirection(n.dir);for(let l of n.statements)gt(l,e)}function gt(n,e){switch(n.$type){case"Commit":e.commit({id:n.id,msg:n.message??"",type:n.type!==void 0?Xe(n.type):w.NORMAL,tags:n.tags??void 0});break;case"Branch":e.branch({name:n.name,order:n.order??0});break;case"Merge":e.merge({branch:n.branch,id:n.id??"",type:n.type!==void 0?Xe(n.type):void 0,tags:n.tags??void 0});break;case"Checkout":e.checkout(n.branch);break;case"CherryPicking":e.cherryPick({id:n.id,targetId:"",tags:n.tags?.length===0?void 0:n.tags,parent:n.parent});break}}function Qe(n,e,l){let p=e.gitGraph,L=typeof p?.mainBranchName=="string"?p.mainBranchName:"main",x2=typeof p?.mainBranchOrder=="number"?p.mainBranchOrder:0,M2=new Map,m2=new Map([[L,null]]),J=new Map([[L,x2]]),oe=[],I=null,A=L,u="LR",_=0,U2=()=>{for(let i=_+1;;i+=2654435761){let d=`${_}-${(Math.imul(i,2654435761)>>>0).toString(16).padStart(8,"0").slice(0,7)}`;if(!M2.has(d))return d}},O2=i=>{I=i,M2.set(i.id,i),m2.set(A,i.id)},ee=i=>{m2.has(i)||D(`Trying to checkout branch which is not yet created. (Help try using "branch ${i}")`),A=i;let d=m2.get(i);I=d?M2.get(d)??null:null};mt(n,{setDirection(i){u=i},commit({msg:i,id:d,type:H2,tags:v2}){let b={id:d||U2(),message:i,seq:_++,type:H2??w.NORMAL,tags:v2?[...v2]:[],parents:I===null?[]:[I.id],branch:A};M2.has(b.id)&&oe.push(`Commit ID ${b.id} already exists`),O2(b)},branch({name:i,order:d}){m2.has(i)&&D(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${i}")`),m2.set(i,I!==null?I.id:null),J.set(i,d),ee(i)},merge({branch:i,id:d,type:H2,tags:v2}){let b=m2.get(A),B2=m2.get(i),V2=b?M2.get(b):void 0,X=B2?M2.get(B2):void 0;V2&&X&&V2.branch===i&&D(`Cannot merge branch '${i}' into itself.`),A===i&&D('Incorrect usage of "merge". Cannot merge a branch to itself'),V2===void 0&&D(`Incorrect usage of "merge". Current branch (${A})has no commits`),m2.has(i)||D(`Incorrect usage of "merge". Branch to be merged (${i}) does not exist`),X===void 0&&D(`Incorrect usage of "merge". Branch to be merged (${i}) has no commits`),V2===X&&D('Incorrect usage of "merge". Both branches have same head'),d&&M2.has(d)&&D(`Incorrect usage of "merge". Commit with id:${d} already exists, use different custom id`),O2({id:d||U2(),message:`merged branch ${i} into ${A}`,seq:_++,parents:I===null?[]:[I.id,B2||""],branch:A,type:w.MERGE,customType:H2,customId:!!d,tags:v2?[...v2]:[]})},cherryPick({id:i,targetId:d,tags:H2,parent:v2}){let b=i?M2.get(i):void 0;if(b===void 0&&D('Incorrect usage of "cherryPick". Source commit id should exist and provided'),v2&&!b.parents.includes(v2)&&D("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit."),b.type===w.MERGE&&!v2&&D("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified."),d&&M2.has(d))return;b.branch===A&&D('Incorrect usage of "cherryPick". Source commit is already on current branch');let B2=m2.get(A);(!B2||!M2.has(B2))&&D(`Incorrect usage of "cherry-pick". Current branch (${A})has no commits`),O2({id:U2(),message:`cherry-picked ${b.message} into ${A}`,seq:_++,parents:I===null?[]:[I.id,b.id],branch:A,type:w.CHERRY_PICK,tags:H2?H2.filter(Boolean):[`cherry-pick:${b.id}${b.type===w.MERGE?`|parent:${v2}`:""}`]})},checkout:ee});let ce=[...J].map(([i,d],H2)=>({name:i,order:d??parseFloat(`0.${H2}`)})).sort((i,d)=>i.order-d.order).map(i=>i.name);return{type:"gitGraph",title:n.title||l,accTitle:n.accTitle?n.accTitle.replace(/^\s+/g,""):void 0,accDescr:n.accDescr?n.accDescr.replace(/\n\s+/g,`
|
|
2
2
|
`):void 0,direction:u,commits:M2,branches:m2,lanes:ce,currentBranch:A,head:I,warnings:oe}}var Je={name:"REFERENCE",pattern:/\w([-\./\w]*[-\w])?/y},et=[Je];function N(n){return{name:n,pattern:n,longer:et}}var Ze=[N("cherry-pick"),{name:"gitGraph:",pattern:"gitGraph:"},N("HIGHLIGHT"),{...Y("gitGraph"),longer:et},N("checkout"),N("REVERSE"),{name:"parent:",pattern:"parent:"},N("commit"),N("NORMAL"),N("branch"),{name:"order:",pattern:"order:"},N("switch"),{name:"type:",pattern:"type:"},N("merge"),{name:"msg:",pattern:"msg:"},{name:"tag:",pattern:"tag:"},{name:"id:",pattern:"id:"},N("LR"),N("TB"),N("BT"),{name:":",pattern:":"},{...M,opener:/[\t ]*accDescr\s*{/y},$,v(String.raw`[-./\w]*[-\w]`),{name:"INT",pattern:/0|[1-9][0-9]*(?!\.)/y},V,W,G,O,P,H,Je];function tt(n){let e=new x(D$1(n,Ze,"gitGraph"),Ze,"gitGraph"),l={$type:"GitGraph",statements:[]},p=()=>{if(e.kind!==-1)for(e.kind!==26&&e.fail("a line break or the end of input");e.kind===26;)e.i++},L=()=>e.kind===31?e.take():e.kind===25?j(e.take()):e.fail("a branch name"),x$1=()=>j(e.expect(25)),M2=()=>(e.kind!==8&&e.kind!==5&&e.kind!==2&&e.fail("NORMAL, REVERSE, or HIGHLIGHT"),e.take());for(;e.kind===26;)e.i++;if(!e.accept(1)){e.expect(3);let m2=e.kinds[e.i+1];(e.kind===17||e.kind===18||e.kind===19)&&m2===20?(l.$type="Direction",l.dir=e.take(),e.i++):e.accept(20)}for(;e.kind!==-1;)switch(e.kind){case 26:e.i++;break;case 21:l.accDescr=U(e.take()),p();break;case 22:l.accTitle=B(e.take()),p();break;case 23:l.title=z(e.take()),p();break;case 7:{e.i++;let m2={$type:"Commit",tags:[]};for(;;)if(e.accept(16))m2.id=x$1();else if(e.accept(15))m2.tags.push(x$1());else if(e.accept(12))m2.type=M2();else if(e.accept(14)||e.kinds[e.i]===25)m2.message=x$1();else break;p(),l.statements.push(m2);break}case 9:{e.i++;let m2={$type:"Branch",name:L()};e.accept(10)&&(m2.order=parseInt(e.expect(24))),p(),l.statements.push(m2);break}case 13:{e.i++;let m2={$type:"Merge",branch:L(),tags:[]};for(;;)if(e.accept(16))m2.id=x$1();else if(e.accept(15))m2.tags.push(x$1());else if(e.accept(12))m2.type=M2();else break;p(),l.statements.push(m2);break}case 4:case 11:{e.i++;let m2={$type:"Checkout",branch:L()};p(),l.statements.push(m2);break}case 0:{e.i++;let m2={$type:"CherryPicking",tags:[]};for(;;)if(e.accept(16))m2.id=x$1();else if(e.accept(15))m2.tags.push(x$1());else if(e.accept(6))m2.parent=x$1();else break;p(),l.statements.push(m2);break}default:e.fail("a statement, a title, or a line break")}return l}var E=7,ht=44,dt=44,he=36,de=8,ae=20,se=7,nt=6,we=Math.SQRT1_2,rt=["normal","reverse","highlight","merge","cherry-pick"];function pe(n,e,l){let p=n.gitGraph?.[e];return typeof p=="boolean"?p:l}function it(n){return se+4+n.width+6}function pt(n,e,l,p){let L=`cx="${m(e)}" cy="${m(l)}"`;if(n===w.HIGHLIGHT)return`<rect x="${m(e-E-1)}" y="${m(l-E-1)}" width="${2*E+2}" height="${2*E+2}" rx="2" fill="${p}"/>`;if(n===w.MERGE)return`<circle ${L} r="${E-1}" fill="var(--_bg)" stroke="${p}" stroke-width="2"/><circle ${L} r="2.5" fill="${p}"/>`;let x2=`<circle ${L} r="${E}" fill="${p}"/>`;return n===w.REVERSE?x2+`<path d="M${m(e-3)},${m(l-3)}l6,6M${m(e-3)},${m(l+3)}l6,-6" fill="none" stroke="var(--_bg)" stroke-width="1.5" stroke-linecap="round"/>`:n===w.CHERRY_PICK?x2+`<path d="M${m(e-2.6)},${m(l+1)}L${m(e+.8)},${m(l-4.2)}L${m(e+2.6)},${m(l+1)}" fill="none" stroke="var(--_bg)" stroke-linejoin="round"/><circle cx="${m(e-2.6)}" cy="${m(l+2.2)}" r="1.8" fill="var(--_bg)"/><circle cx="${m(e+2.6)}" cy="${m(l+2.2)}" r="1.8" fill="var(--_bg)"/>`:x2}function st(n,e,l){return n.direction!=="LR"?at(n,e,l,n.direction):c(l,p=>at(n,e,l,p?"TB":"LR"))}function at(n,e,l,p){let L=l.fontSize??16,x2=Math.round(L*.75),M2=l.measurer??Ot(l.fontFamily,l.fontFamilyMono),m$1=l.padding??8,J=pe(e,"showBranches",!0),oe=pe(e,"showCommitLabel",!0),I=pe(e,"rotateCommitLabel",!0),A=pe(e,"parallelCommits",!1),u=p!=="LR",_=p==="BT",U2=new Map;n.lanes.forEach((t,r)=>U2.set(t,r));let O2=n.lanes.length,ee=Math.round(L*.875),ce=n.lanes.map(t=>s(J?t:"",M2,ee,4e3)),i=[],d=new Map;for(let t of[...n.commits.values()].sort((r,a)=>r.seq-a.seq)){let r=oe&&t.type!==w.CHERRY_PICK&&(t.type!==w.MERGE||t.customId===!0),a=[];for(let o of t.tags){let g=s(o,M2,x2,4e3);g.lines.length>0&&a.push(g)}let s$1={commit:t,index:i.length,lane:U2.get(t.branch)??0,m:0,label:r?s(t.id,M2,x2,4e3):void 0,tags:a};i.push(s$1),d.set(t.id,s$1)}let H2=new Float64Array(i.length),v2=new Float64Array(i.length),b=new Float64Array(O2).fill(E),B2=new Float64Array(O2).fill(E);i.forEach((t,r)=>{let{label:a,tags:s2}=t,o=0,g=0;for(let h of s2){let y=it(h);u?(o=Math.max(o,h.height),g+=y+4):(o=Math.max(o,y),g+=h.height+3)}let $2=0,f=0;a!==void 0&&a.lines.length>0&&(I?f=3+we*(a.width+a.height):($2=u?a.height:a.width,f=6+(u?a.width:a.height))),H2[r]=Math.max(E,o/2,$2/2),v2[r]=o/2;let R2=E+(s2.length>0?nt+g:0),F=E+f,P2=t.lane;b[P2]=Math.max(b[P2],u?F:R2),B2[P2]=Math.max(B2[P2],u?R2:F)});let V2=new Float64Array(i.length);u||i.forEach((t,r)=>{if(v2[r]!==0)for(let a of t.commit.parents){let s2=d.get(a);s2!==void 0&&s2.lane<t.lane&&(V2[r]=v2[r]+4)}});let X=(t,r)=>Math.max(ht,H2[t]+H2[r]+de,V2[r]>0?H2[t]+he+V2[r]:0);i.forEach((t,r)=>{if(!A){t.m=r===0?0:i[r-1].m+X(r-1,r);return}let a=0;for(let s2 of t.commit.parents){let o=d.get(s2);o===void 0||o.index>=r||(a=Math.max(a,o.m+X(o.index,r)))}t.m=a});let q=0;for(let t of i)q=Math.max(q,t.m);let Y2=new Float64Array(O2);for(let t=0;t<O2;t++){let r=ce[t],a=r.lines.length===0?0:u?r.width/2+8:r.height/2+2;b[t]=Math.max(b[t],a),B2[t]=Math.max(B2[t],a),t>0&&(Y2[t]=Y2[t-1]+Math.max(dt,B2[t-1]+b[t]+de))}let z2=(t,r)=>u?r:t,K=(t,r)=>u?_?-t:t:r,G2=(t,r)=>`${m(z2(t,r))},${m(K(t,r))}`,Q=1/0,le=1/0,te=-1/0,fe=-1/0,j2=(t,r,a,s2)=>{t<Q&&(Q=t),r<le&&(le=r),a>te&&(te=a),s2>fe&&(fe=s2)},ne="";if(J)for(let t=0;t<O2;t++){let r=ce[t],a=Kt(t),s2=Y2[t],o=r.width+16,g=r.height+4,$2=r.lines.length===0?-20:-20-(u?g:o),f=z2($2+(u?g:o)/2,s2),R2=K($2+(u?g:o)/2,s2);j2(z2(-20,s2),K(-20,s2),z2(-20,s2),K(-20,s2)),j2(z2(q+ae,s2),K(q+ae,s2),z2(q+ae,s2),K(q+ae,s2)),ne+=`<g class="pele-branch" data-id="${Tn(n.lanes[t])}"><path class="pele-lane" d="M${G2(-20,s2)}L${G2(q+ae,s2)}" stroke="${a}" stroke-dasharray="2 4"/>`,r.lines.length>0&&(j2(f-o/2,R2-g/2,f+o/2,R2+g/2),ne+=`<rect x="${m(f-o/2)}" y="${m(R2-g/2)}" width="${m(o)}" height="${m(g)}" fill="${a}"${gt$1}/>`+Yt(r,f,R2,' class="pele-label"'+(Gt(t)||' fill="var(--_bg)"'))),ne+="</g>"}let ue=Array.from({length:O2},()=>[]);for(let t of i)ue[t.lane].push(t.m);if(A)for(let t of ue)t.sort((r,a)=>r-a);let Ee=(t,r,a)=>{let s2=ue[t],o=0,g=s2.length;for(;o<g;){let $2=o+g>>1;s2[$2]<=r?o=$2+1:g=$2}return o<s2.length&&s2[o]<a},be="",ye="";for(let t of i){let{commit:r}=t,a=Y2[t.lane],s2=t.m;for(let o=0;o<r.parents.length;o++){let g=d.get(r.parents[o]);if(g===void 0||g===t)continue;let $2=Y2[g.lane],f=g.m;if(g.lane===t.lane){ye+=`<path class="pele-edge" d="M${G2(f,$2)}L${G2(s2,a)}" stroke="${Kt(t.lane)}"/>`;continue}let R2=o>0&&r.type===w.MERGE,F=o>0&&!R2,P2=`M${G2(f,$2)}`;if(s2<=f){let h=(f+s2)/2;P2+=`C${G2(h,$2)} ${G2(h,a)} ${G2(s2,a)}`}else if(!R2&&!Ee(t.lane,f,s2)){let h=Math.min(he,s2-f);P2+=`C${G2(f+h/2,$2)} ${G2(f+h/2,a)} ${G2(f+h,a)}L${G2(s2,a)}`}else{let h=g.lane<t.lane&&s2-V2[t.index]>f?s2-V2[t.index]:s2,y=Math.min(he,h-f),S=$2;(!R2||Ee(g.lane,f,s2))&&(S=$2>a?a+B2[t.lane]+de/2:a-b[t.lane]-de/2,y=Math.min(he,(h-f)/2),P2+=`C${G2(f+y/2,$2)} ${G2(f+y/2,S)} ${G2(f+y,S)}`),P2+=`L${G2(h-y,S)}C${G2(h-y/2,S)} ${G2(h-y/2,a)} ${G2(h,a)}`,h<s2&&(P2+=`L${G2(s2,a)}`)}be+=`<path class="pele-edge${R2?" pele-edge-merge":F?" pele-edge-cherry-pick":""}" d="${P2}" stroke="${Kt(R2?g.lane:t.lane)}"${F?' stroke-dasharray="4 3"':""}/>`}}let $e="";for(let t of i){let{commit:r,label:a,tags:s2}=t,o=z2(t.m,Y2[t.lane]),g=K(t.m,Y2[t.lane]),$2=r.customType??r.type;j2(o-E-1,g-E-1,o+E+1,g+E+1);let R2=r.type<w.MERGE&&r.message!==""?`<title>${Tn(r.message)}</title>`:"";if(R2+=pt($2,o,g,Kt(t.lane)),a!==void 0&&a.lines.length>0){let h=a.width,y=a.height,S=(C,k)=>`<rect x="${m(C-h/2-2)}" y="${m(k-y/2+2)}" width="${m(h+4)}" height="${m(y-4)}" rx="3" fill="var(--_bg)"/>`;if(I){let C=we*y/2,k=u?o-E-3-C:o+3,T=u?g:g+E+3+C,Ge=we*h+C;j2(k-Ge,_?T-Ge:T-C,k+C,_?T+C:T+Ge),R2+=`<g class="pele-commit-label" transform="rotate(${_?45:-45} ${m(k)} ${m(T)})">`+S(k-h/2,T)+Yt(a,k-h/2,T,"")+"</g>"}else{let C=u?o-E-6-h/2:o,k=u?g:g+E+6+y/2;j2(C-h/2,k-y/2,C+h/2,k+y/2),R2+=`<g class="pele-commit-label">${S(C,k)}${Yt(a,C,k,"")}</g>`}}let F=E+nt;for(let h=u?0:s2.length-1;h>=0&&h<s2.length;h+=u?1:-1){let y=s2[h],S=it(y),C=y.height,k=u?o+F:o-S/2,T=u?g:g-F-C/2;F+=u?S+4:C+3,j2(k,T-C/2,k+S,T+C/2),R2+=`<g class="pele-tag"><path d="M${m(k)},${m(T)}L${m(k+se)},${m(T-C/2)}H${m(k+S)}V${m(T+C/2)}H${m(k+se)}Z" fill="var(--_s)" stroke="var(--_b)" stroke-linejoin="round"/><circle cx="${m(k+se)}" cy="${m(T)}" r="1.5" fill="var(--_b)"/>`+Yt(y,k+se+4+y.width/2,T,' fill="var(--_fg)"')+"</g>"}let P2=r.type===w.MERGE&&$2!==w.MERGE?" pele-commit-merge":"";$e+=`<g class="pele-commit pele-commit-${rt[$2]??rt[0]}${P2}" data-id="${Tn(r.id)}">${R2}</g>`}Q>te&&j2(0,0,0,0);let re=It(n.title,!1,M2,L,4e3,1),Me=re.height>0?re.height+16:0,Re=Math.max(te-Q,re.width),ke=Math.ceil(Re+2*m$1),xe=Math.ceil(fe-le+Me+2*m$1),ot=m$1-Q+(Re-(te-Q))/2,ct=m$1+Me-le,lt=Yt(re,ke/2,m$1+re.height/2,' class="pele-title" font-weight="var(--_tw)"')+`<g transform="translate(${m(ot)},${m(ct)})">`+(ne?`<g class="pele-branches" fill="none" font-size="${ee}">${ne}</g>`:"")+(be||ye?`<g class="pele-edges" fill="none" stroke-width="2" stroke-linecap="round">${be}${ye}</g>`:"")+($e?`<g class="pele-commits" font-size="${x2}" fill="var(--_m)">${$e}</g>`:"")+"</g>";return{svg:Yt$1("gitGraph",ke,xe,L,l,n,lt),width:ke,height:xe,links:[]}}var Bt={type:"gitGraph",parse:(n,e,l)=>Qe(tt(n),e,l),render:st};export{Bt as gitGraph};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{T}from"./75JW6PN6-
|
|
1
|
+
import{T}from"./75JW6PN6-CYzAa9yx.js";import{g}from"./NT5JY5WP-BhjzefjG.js";import{p,h}from"./DKTLEL5E-CJTkVtjr.js";import{T as Tt,d as cn}from"./EFYWJBJK-CFT5CQUG.js";import{F as Ft,N as Nt,g as gt,Y as Yt$1,O as Ot$1,I as It,D as Dt}from"./BGW36YJW-BAwgTZ_z.js";import{k as we$1,R,i as it,y as ye$1,E as Et,w as wt,O as Ot,m,T as Tn$1,Y as Yt,o as oe,S}from"./lazy-CUmWiDAP.js";import"./kit-CD3F-f6F.js";import"./vendor-react-CxJ4vs-5.js";import"./vendor-motion-C2jPaSqL.js";import"./vendor-owxl31sT.js";import"./core-Cj89wpQh.js";import"./vendor-editor-gVJMCtGz.js";var Mn="aliceblue antiquewhite aqua aquamarine azure beige bisque black blanchedalmond blue blueviolet brown burlywood cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan darkblue darkcyan darkgoldenrod darkgray darkgreen darkgrey darkkhaki darkmagenta darkolivegreen darkorange darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkslategrey darkturquoise darkviolet deeppink deepskyblue dimgray dimgrey dodgerblue firebrick floralwhite forestgreen fuchsia gainsboro ghostwhite gold goldenrod gray green greenyellow grey honeydew hotpink indianred indigo ivory khaki lavender lavenderblush lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgreen lightgrey lightpink lightsalmon lightseagreen lightskyblue lightslategray lightslategrey lightsteelblue lightyellow lime limegreen linen magenta maroon mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen mediumslateblue mediumspringgreen mediumturquoise mediumvioletred midnightblue mintcream mistyrose moccasin navajowhite navy oldlace olive olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise palevioletred papayawhip peachpuff peru pink plum powderblue purple rebeccapurple red rosybrown royalblue saddlebrown salmon sandybrown seagreen seashell sienna silver skyblue slateblue slategray slategrey snow springgreen steelblue tan teal thistle tomato turquoise violet wheat white whitesmoke yellow yellowgreen transparent currentcolor inherit initial unset revert accentcolor accentcolortext activetext buttonborder buttonface buttontext canvas canvastext field fieldtext graytext highlight highlighttext linktext mark marktext selecteditem selecteditemtext visitedtext activeborder activecaption appworkspace background buttonhighlight buttonshadow captiontext inactiveborder inactivecaption inactivecaptiontext infobackground infotext menu menutext scrollbar threeddarkshadow threedface threedhighlight threedlightshadow threedshadow window windowframe windowtext",dn,vn=/^[+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?(%|deg|grad|rad|turn)?$/i;function un(r){if(r.toLowerCase()==="none")return 4;let e=vn.exec(r);return e?e[1]===void 0?1:e[1]==="%"?2:3:0}function Wn(r,e){let s=un(r);return s===1||s===2||e&&s===4}function Pn(r){let e=r.startsWith("hsl"),s=r.indexOf("("),a=r.slice(0,s);if(a!=="rgb"&&a!=="rgba"&&a!=="hsl"&&a!=="hsla"||r.length>120||r.indexOf(")")!==r.length-1)return!1;let f=r.slice(s+1,-1).trim(),d,E,n=f.includes(",");if(n)d=f.split(",").map(m2=>m2.trim()),d.length===4&&(E=d.pop());else{let m2=f.split("/");if(m2.length>2)return!1;d=m2[0].trim().split(/\s+/),m2.length===2&&(E=m2[1].trim())}if(d.length!==3||E!==void 0&&!Wn(E,!n))return!1;let x=d.map(un);if(n)return e?(x[0]===1||x[0]===3)&&x[1]===2&&x[2]===2:(x[0]===1||x[0]===2)&&x[1]===x[0]&&x[2]===x[0];for(let m2=0;m2<3;m2++){let N=x[m2];if(!(N===1||N===4||(e&&m2===0?N===3:N===2)))return!1}return!0}function fn(r){return r.includes("(")?Pn(r):(dn??=new Set(Mn.split(" ")),dn.has(r.toLowerCase()))}var Bn=/^:?wrap:/,qn=/^:?nowrap:/,Vn=/^:?(?:no)?wrap:/,Kn=/^(?:rgba?|hsla?)\s*\(/,pn=/[\r\u2028\u2029]/,Hn=/^\w*/;function Be(r){throw new R(r,"semantic",{type:"sequence"})}function hn(r){let e=r.trim(),s=Bn.test(e)?!0:qn.test(e)?!1:void 0;return{text:(s===void 0?e:e.replace(Vn,"")).trim(),wrap:s}}function Fn(r){let e=Kn.exec(r);if(e){let a=r.lastIndexOf(")");if(a>=e[0].length)return pn.test(r.slice(e[0].length))?void 0:[r.slice(0,a+1),r.slice(a+1)]}if(pn.test(r))return;let s=Hn.exec(r)[0];return[s,r.slice(s.length)]}function On(r){return typeof r=="string"?[...r].map((e,s)=>[String(s),e]):r!==null&&typeof r=="object"?Object.entries(r):[]}var tt=class{type="sequence";actors=new Map;createdActors=new Map;destroyedActors=new Map;boxes=[];messages=[];notes=[];title;accTitle;accDescr;prevActor;currentBox;lastCreated;lastDestroyed;wrapEnabled;sequenceWrap;active=new Map;constructor(e={}){this.wrapEnabled=e.wrap,this.sequenceWrap=e.sequenceWrap??!1}autoWrap(){return this.wrapEnabled??this.sequenceWrap}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,"")}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
|
|
2
2
|
`)}setDiagramTitle(e){this.title=e}parseMessage(e){return hn(e)}parseBoxData(e){let s=Fn(e),a=s?.[0]?s[0].trim():"transparent",f=s?.[1]?s[1].trim():void 0;if(fn(a)||(a="transparent",f=e.trim()),f===void 0)return{text:void 0,color:a,wrap:void 0};let{text:d,wrap:E}=hn(f);return{text:d||void 0,color:a,wrap:E}}addBox(e){this.currentBox={name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]},this.boxes.push(this.currentBox)}addActor(e,s,a,f,d){let E=this.currentBox,n;if(d!==void 0){let C;try{C=we$1(d.includes(`
|
|
3
3
|
`)?d+`
|
|
4
4
|
`:`{
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{g}from"./NT5JY5WP-
|
|
1
|
+
import{g}from"./NT5JY5WP-BhjzefjG.js";import{R as R$1,B,P,I}from"./6PIGVMFT-CRGq6eh3.js";import{p,h}from"./DKTLEL5E-CJTkVtjr.js";import{o as oe,s as se,d as cn,c as ce$1,b as ae$1,T as Tt$1,_ as _n}from"./EFYWJBJK-CFT5CQUG.js";import{D as Dt$1,C as Ct$1,N as Nt$1,I as It$1,Y as Yt$2,F as Ft$2}from"./BGW36YJW-BAwgTZ_z.js";import{R,i as it,y as ye,E as Et$1,O as Ot$1,T as Tn,P as Pt$1,m,Y as Yt$1,F as Ft$1}from"./lazy-CUmWiDAP.js";import"./kit-CD3F-f6F.js";import"./vendor-react-CxJ4vs-5.js";import"./vendor-motion-C2jPaSqL.js";import"./vendor-owxl31sT.js";import"./core-Cj89wpQh.js";import"./vendor-editor-gVJMCtGz.js";var mt=1e5;function Ot(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 Tt(e){switch(e.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}function Rt(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 Bt(e){return e.includes("==")?"thick":"normal"}function Kt(e){return e.includes(".-")?"dotted":"solid"}function pt(e,n){let i=e.flat(),a=-1;for(let r of i)if(r.type==="column-setting"){a=r.columns??-1;break}return{list:i,at:0,parent:n,children:[],columns:a}}var xe=class{type="block";title;root={id:"root",type:"composite",children:[],columns:-1};blocks=[];edges=[];classes=new Map;byId=new Map;typeStr2Type=Ot;edgeStrToEdgeData=Tt;edgeStrToEdgeStartData=Rt;edgeStrToThickness=Bt;edgeStrToPattern=Kt;warn;pending=new Set;edgeCount=new Map;ids=0;colors=0;spaces=0;constructor(n={}){this.warn=n.warn}generateId(){return"id-"+ ++this.ids}addStyleClass(n,i=""){let a=this.classes.get(n);a||(a={id:n,styles:[],textStyles:[]},this.classes.set(n,a));for(let r of i.split(",")){let c=r.indexOf(";"),o=(c===-1?r:r.slice(0,c)+r.slice(c+1)).trim();r.includes("color")&&a.textStyles.push(o.replace("fill","bgFill").replace("color","fill")),a.styles.push(o)}}addStyle2Node(n,i=""){this.named(n).styles=i.split(",")}setCssClass(n,i){for(let a of n.split(","))(this.named(a.trim()).classes??=[]).push(i)}named(n){let i=this.byId.get(n);return i===void 0&&(i={id:n,type:"na",children:[]},this.byId.set(n,i),this.pending.add(n)),i}setHierarchy(n){let i=[pt(n,this.root)];for(;i.length>0;){let a=i[i.length-1];if(a.at===a.list.length){a.parent.children=a.children,i.pop();continue}let r=a.list[a.at++];switch(a.columns>0&&r.type!=="column-setting"&&typeof r.widthInColumns=="number"&&r.widthInColumns>a.columns&&this.warn?.(`Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${a.columns}`),r.type){case"classDef":this.addStyleClass(r.id,r.css);continue;case"applyClass":this.setCssClass(r.id,r.styleClass??"");continue;case"applyStyles":r.stylesStr&&this.addStyle2Node(r.id,r.stylesStr);continue;case"column-setting":a.parent.columns=r.columns??-1;continue;case"edge":{let b=(this.edgeCount.get(r.id)??0)+1;this.edgeCount.set(r.id,b),r.id=b+"-"+r.id,this.edges.push(r);continue}}r.id??=this.generateId(),r.label||(r.label=r.type==="composite"?"":r.id);let c=this.byId.get(r.id),o=c===void 0||this.pending.delete(r.id);o?(c&&(r.classes=c.classes,r.styles=c.styles),r.type==="composite"&&(r.colorIndex=this.colors++),this.byId.set(r.id,r)):(r.type!=="na"&&(c.type=r.type),r.label!==r.id&&(c.label=r.label));let t=r.children;if(r.children=[],r.type==="space"){let b=r.width??1;if(!(b<=mt-this.spaces))throw new R(`A block diagram can hold at most ${mt} space blocks.`,"limit",{type:"block"});this.spaces+=Math.max(b,0);for(let d=0;d<b;d++){let u={...r,id:r.id+"-"+d,children:[]};this.byId.set(u.id,u),a.children.push(u)}}else o&&a.children.push(r);t&&t.length>0&&i.push(pt(t,r))}this.blocks=this.root.children??[]}},Ve=["$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"],Ft=["right","left","x","y","up","down"],St=new Uint8Array(128);for(let e of[9,10,11,12,13,32,40,41,45,58,60,61,62,91,123,125])St[e]=1;function yt(e){let n=e.length,i=[],a=[],r=[],c=[],o=0,t=0,b=(S,f,h2)=>(i.push(S),a.push(f),r.push(t),t=h2,!0),d=(S,f)=>b(S,e.slice(t,f),f),u=S=>{c.push(o),o=S},m2=()=>{c.length>0&&(o=c.pop())},l=S=>{for(;S<n&&ye(e.charCodeAt(S));)S++;return S},w=S=>{for(;S<n;){let f=e.charCodeAt(S);if(f<48||f>57)break;S++}return S},y=S=>{for(;S<n&&Et$1(e.charCodeAt(S));)S++;return S},g2=S=>e.startsWith(S,t)&&!Et$1(e.charCodeAt(t+S.length)),C=()=>(e.charCodeAt(t+1)===96?(u(2),t+=2):(u(1),t++),!0),L=S=>{if(e.charCodeAt(S)!==46)return-1;do S++;while(e.charCodeAt(S)===46);if(e.charCodeAt(S)!==45)return-1;let f=e.charCodeAt(S+1);return f===120||f===111||f===62?S+2:S+1},M=S=>{let f=e.charCodeAt(S);(f===120||f===111||f===60)&&S++;let h2=e.charCodeAt(S);if(h2===46)return L(S);if(h2!==45&&h2!==61)return-1;let p2=S+1;for(;e.charCodeAt(p2)===h2;)p2++;if(p2-S===1)return h2===45?L(p2):-1;let D=e.charCodeAt(p2);return D===120||D===111||D===62?p2+1:p2-S>=3?p2:-1},K=()=>{let S=M(t);if(S>=0)return d(33,l(S));let f=e.charCodeAt(t)===60?t+1:t,h2=e.charCodeAt(f),p2=e.charCodeAt(f+1);return h2===45&&(p2===45||p2===46)||h2===61&&p2===61?(u(6),d(34,l(f+2))):!1},R2=S=>{let f=e.indexOf(`
|
|
2
2
|
`,t);return f===-1&&(f=n),m2(),d(S,f)},F=(S,f)=>{let h2=y(t);if(h2===t)return!1;for(;e.charCodeAt(h2)===44;){let p2=l(h2+1),D=y(p2);if(D===p2)break;h2=D}return o=f,d(S,h2)},G=S=>{if(ye(S))return t=l(t+1),!0;let f;switch(S){case 98:if(e.startsWith("block",t)){if(g2("block-beta"))return d(2,t+10);if(e.charCodeAt(t+5)===58)return d(3,t+6);if(!Et$1(e.charCodeAt(t+5)))return d(2,t+5)}break;case 99:if(e.startsWith("columns",t)){if(f=l(t+7),f>t+7){if(e.startsWith("auto",f)&&!Et$1(e.charCodeAt(f+4)))return b(4,"-1",f+4);let h2=w(f);if(h2>f)return b(4,e.slice(f,h2),h2)}}else if(e.startsWith("class",t)){let h2=e.startsWith("Def",t+5),p2=h2?t+8:t+5;if(f=l(p2),f>p2)return u(h2?7:9),d(h2?11:15,f)}break;case 34:return C();case 115:if(e.startsWith("space",t)){if(e.charCodeAt(t+5)===58){let h2=w(t+6);if(h2>t+6)return b(7,e.slice(t+6,h2),h2)}if(!Et$1(e.charCodeAt(t+5)))return b(7,"1",t+5)}else if(e.startsWith("style",t)&&(f=l(t+5),f>t+5))return u(11),d(18,f);break;case 100:if(g2("default"))return d(8,t+7);break;case 108:if(g2("linkStyle"))return d(9,t+9);break;case 105:if(g2("interpolate"))return d(10,t+11);break;case 97:if(e.startsWith("accTitle",t)){if(f=l(t+8),e.charCodeAt(f)===58)return u(13),d(21,l(f+1))}else if(e.startsWith("accDescr",t)){f=l(t+8);let h2=e.charCodeAt(f);if(h2===58)return u(14),d(23,l(f+1));if(h2===123)return u(15),t=l(f+1),!0}break;case 101:if(g2("end"))return d(26,l(t+3));break;case 45:return e.charCodeAt(t+1)===41?(u(3),d(27,t+2)):K();case 61:return K();case 60:return e.charCodeAt(t+1)===91?(u(4),d(29,t+2)):K();case 40:{let h2=e.charCodeAt(t+1),p2=h2===45||h2===91?2:h2===40?e.charCodeAt(t+2)===40?3:2:1;return u(3),d(27,t+p2)}case 41:case 123:return u(3),d(27,e.charCodeAt(t+1)===S?t+2:t+1);case 62:return u(3),d(27,t+1);case 91:{let h2=e.charCodeAt(t+1);return u(3),d(27,h2===91||h2===124||h2===40||h2===92||h2===47?t+2:t+1)}case 58:{let h2=w(t+1);return h2>t+1?b(36,e.slice(t+1,h2),h2):!1}}for(f=t;f<n;){let h2=e.charCodeAt(f);if(h2<128?St[h2]===1:ye(h2))break;f++}return f>t&&d(32,f)},V=S=>{let f=e.charCodeAt(t+1),h2=0;switch(S){case 34:return C();case 40:h2=f===45?2:f===40?e.charCodeAt(t+2)===40?3:2:1;break;case 41:h2=f===41?e.charCodeAt(t+2)===41?3:2:f===93?2:1;break;case 125:h2=f===125?2:1;break;case 45:h2=f===41?2:0;break;case 93:h2=f===93||f===41||f===62?2:1;break;case 92:case 47:h2=f===93?2:0;break}return h2===0?!1:(m2(),d(28,t+h2))},z=S=>{if(S===41)return m2(),m2(),b(30,"]>",l(t+1));let f=l(S===44?t+1:t);for(let h2 of Ft)if(e.startsWith(h2,f)){let p2=l(f+h2.length);return b(31,e.slice(S===44?f:t,p2),p2)}return!1};for(;;){if(t>=n){let h2=-1;switch(o){case 0:h2=37;break;case 1:h2=6;break;case 8:h2=14;break;case 10:h2=17;break;case 12:h2=20;break;case 13:h2=22;break;case 14:h2=24;break;case 15:h2=25;break}t=n,h2!==-1&&b(h2,"",n);break}let S=e.charCodeAt(t),f=!0;switch(o){case 0:f=G(S);break;case 1:if(S===34)m2(),t++;else{let h2=e.indexOf('"',t);d(6,h2===-1?n:h2)}break;case 2:if(S===96)f=e.charCodeAt(t+1)===34,f&&(m2(),t+=2);else if(S===34)f=!1;else{let h2=t+1;for(;h2<n;){let p2=e.charCodeAt(h2);if(p2===96||p2===34)break;h2++}d(5,h2)}break;case 3:f=V(S);break;case 4:if(S===34)C();else if(S===93&&e.charCodeAt(t+1)===62){let h2=l(t+2);f=e.charCodeAt(h2)===40,f&&(u(5),t=h2+1)}else f=!1;break;case 5:f=z(S);break;case 6:if(S===34)e.charCodeAt(t+1)===96?C():(d(35,t+1),u(1));else{let h2=M(l(t));f=h2>=0,f&&(m2(),d(33,l(h2)))}break;case 7:{let h2=12,p2=e.startsWith("DEFAULT",t)?t+7:t,D=l(p2);(p2===t||D===p2)&&(h2=13,p2=y(t),D=l(p2)),f=p2>t&&D>p2,f&&(o=8,d(h2,D));break}case 8:R2(14);break;case 9:f=F(16,10);break;case 10:R2(17);break;case 11:f=F(19,12);break;case 12:R2(20);break;case 13:R2(22);break;case 14:R2(24);break;case 15:if(S===125)m2(),t++;else{let h2=e.indexOf("}",t);d(25,h2===-1?n:h2)}break}if(!f)return i.push(1),a.push(""),r.push(t),{types:i,texts:a,starts:r}}return i.push(0),a.push(""),r.push(n),{types:i,texts:a,starts:r}}var me="'NODE_ID', 'COLUMNS', 'SPACE_BLOCK', 'BLOCK_DIAGRAM_KEY', 'id-block', 'classDef', 'class', 'style'";function wt(e){let n=e[e.length-1];return Array.isArray(n)?(e.pop(),e.concat(n)):e}function gt(e,n){let{types:i,texts:a,starts:r}=yt(e),c=0,o=l=>{let w=i[c];throw w===1?it("block",e,r[c],"",!0):it("block",e,r[c],`Expecting ${l}, got '${Ve[w]}'`)},t=l=>(i[c]!==l&&o(`'${Ve[l]}'`),a[c++]),b=()=>{let l=t(32);if(i[c]===27){let w=a[c++],y=t(6);return{id:l,label:y,typeStr:w+t(28)}}if(i[c]===29){let w=a[c++],y=t(6),g2=[t(31)];for(;i[c]===31;)g2.push(a[c++]);return{id:l,label:y,typeStr:w+t(30),directions:g2}}return{id:l}},d=()=>{let l=b(),w=i[c]===36?parseInt(a[c++],10):1,y={id:l.id,label:l.label,type:n.typeStr2Type(l.typeStr),directions:l.directions,widthInColumns:w},g2;for(;i[c]===33||i[c]===34;){let C="";i[c++]===34&&(t(35),C=t(6),t(33));let L=a[c-1],M=b(),K=n.edgeStrToEdgeData(L),R2=n.edgeStrToEdgeStartData(L),F=n.edgeStrToThickness(L),G=n.edgeStrToPattern(L);g2??=[{id:y.id,label:y.label,type:y.type,directions:y.directions}],y={id:M.id,label:M.label,type:n.typeStr2Type(M.typeStr),directions:M.directions},g2.push({id:g2[g2.length-1].id+"-"+M.id,start:g2[g2.length-1].id,end:M.id,label:C,type:"edge",thickness:F,pattern:G,directions:M.directions,arrowTypeEnd:K,arrowTypeStart:R2},y)}return g2??y};t(2);let u=[],m2=[];for(;;)switch(i[c]){case 32:m2.push(d());break;case 4:m2.push({type:"column-setting",columns:parseInt(a[c++],10)});break;case 7:{let l=parseInt(a[c++],10);m2.push({id:n.generateId(),type:"space",label:"",width:l,children:[]});break}case 2:c++,u.push({list:m2,header:void 0}),m2=[];break;case 3:c++,i[c]!==32&&o("'NODE_ID'"),u.push({list:m2,header:d()}),m2=[];break;case 26:{let l=u.pop();if(l===void 0||m2.length===0)return o(me);c++;let w=n.generateId(),y=wt(m2);m2=l.list,m2.push(l.header===void 0?{id:w,type:"composite",label:"",children:y}:{...l.header,type:"composite",children:y});break}case 11:{c++;let l=t(13).trim();m2.push({type:"classDef",id:l,css:t(14).trim()});break}case 15:{c++;let l=t(16).trim();m2.push({type:"applyClass",id:l,styleClass:t(17).trim()});break}case 18:{c++;let l=t(19).trim();m2.push({type:"applyStyles",id:l,stylesStr:t(20).trim()});break}case 37:u.length>0&&o(me+", 'end'"),m2.length===0&&o(me),n.setHierarchy(wt(m2));return;default:o(m2.length===0?me:me+(u.length>0?", 'end'":", 'EOF'"))}}var H=1,j=2,X=4,Z=8,re=7,Ee=20,q=12;function _t(e){let n=0;if(e)for(let i of e)switch(i.trim()){case"right":n|=H;break;case"left":n|=j;break;case"up":n|=X;break;case"down":n|=Z;break;case"x":n|=H|j;break;case"y":n|=X|Z;break}return n}var J=(e,n)=>e&n?1:0;function pe(e){return e!==0&&(e&(X|Z))===0?"x":e!==0&&(e&(H|j))===0?"y":""}function We(e,n,i){let a=pe(e),r=J(e,j)-J(e,H),c=J(e,X)-J(e,Z);if(a==="x"){let o=Math.max(i+8,14)+2*re,t=Math.min(o/2,Ee);return{w:Math.max(n+12,16)+t*(e===(H|j)?2:1),h:o,dx:r*t/2,dy:0}}if(a==="y"){let o=Math.max(n+16,14)+2*re,t=Math.min(o/2,Ee);return{w:o,h:Math.max(i+8,16)+t*(e===(X|Z)?2:1),dx:0,dy:c*t/2}}return{w:Math.max(n+16,24)+q*(J(e,j)+J(e,H)),h:Math.max(i+8,24)+q*(J(e,X)+J(e,Z)),dx:r*q/2,dy:c*q/2}}function xt(e,n,i,a){let r=pe(e),c=n/2,o=i/2,t;if(r==="x"){let d=Math.min(o,Ee),u=o-re,m2=e&j?-c+d:-c,l=e&H?c-d:c;t=[m2,-u,l,-u],e&H&&t.push(l,-o,c,0,l,o),t.push(l,u,m2,u),e&j&&t.push(m2,o,-c,0,m2,-o)}else if(r==="y"){let d=Math.min(c,Ee),u=c-re,m2=e&X?-o+d:-o,l=e&Z?o-d:o;t=[u,m2,u,l],e&Z&&t.push(c,l,0,o,-c,l),t.push(-u,l,-u,m2),e&X&&t.push(-c,m2,0,-o,c,m2)}else{let d=e&j?-c+q:-c,u=e&H?c-q:c,m2=e&X?-o+q:-o,l=e&Z?o-q:o,w=(d+u)/2,y=(m2+l)/2,g2=Math.min(10,(u-d)/2),C=Math.min(10,(l-m2)/2);t=[d,m2],e&X&&t.push(w-g2,m2,w,-o,w+g2,m2),t.push(u,m2),e&H&&t.push(u,y-C,c,y,u,y+C),t.push(u,l),e&Z&&t.push(w+g2,l,w,o,w-g2,l),t.push(d,l),e&j&&t.push(d,y+C,-c,y,d,y-C)}let b="";for(let d=0;d<t.length;d+=2)b+=(d?" ":"")+m(t[d])+","+m(t[d+1]);return`<polygon points="${b}" stroke-linejoin="round"${a}/>`}var Yt=1e3;function $t(e,n){if(e===0||!Number.isInteger(e))throw new R("Columns must be an integer !== 0.","semantic",{type:"block"});if(n<0||!Number.isInteger(n))throw new R("Position must be a non-negative integer."+n,"semantic",{type:"block"});return e<0?{px:n,py:0}:{px:n%e,py:Math.floor(n/e)}}function Pt(e,n,i){let a=e.columns,r=[],c=0,o=0,t=0,b=0;for(let u of e.children){let{px:m2,py:l}=$t(a,c),w=u.span>=1?Math.min(u.span,Yt):1;if(a>0&&w>a-m2&&(w=a-m2),u.span=w,u.col=m2,u.row=l,c+=w,m2+w>o&&(o=m2+w),l===r.length&&r.push(0),u.children.length===0?r[l]=-1:r[l]>=0&&u.nh>r[l]&&(r[l]=u.nh),u.space)continue;let y=(u.nw-n*(w-1))/w;y>t&&(t=y),u.nh>b&&(b=u.nh)}let d=(r.length-1)*n+Ae(e.rowGaps);for(let u=0;u<r.length;u++)r[u]<0&&(r[u]=b),d+=r[u];e.cols=o,e.heights=r,e.nw=Math.max(e.nw,o*t+(o-1)*n+Ae(e.colGaps)+2*i),e.nh=d+2*i+e.head}function Vt(e,n,i){let{cols:a,heights:r,rowGaps:c,colGaps:o}=e,t=r.length,b=(e.w-2*i-(a-1)*n-Ae(o))/a,d=e.h-2*i-e.head-(t-1)*n-Ae(c),u=[];if(o.length>0){let L=0;for(let M=0;M<a;M++)u.push(L),L+=o[M]??0}let m2=0;for(let L of r)m2+=L;let l=m2>0?d/m2:0,w=m2>0?0:d/t,y=e.x-e.w/2+i,g2=e.y-e.h/2+i+e.head,C=0;for(let L of e.children){for(;C<L.row;C++)g2+=r[C]*l+w+n+(c[C]??0);let M=u[L.col]??0;L.w=b*L.span+n*(L.span-1)+(u[L.col+L.span-1]??0)-M,L.h=r[C]*l+w,L.x=y+L.col*(b+n)+M+L.w/2,L.y=g2+L.h/2}}function Ae(e){let n=0;for(let i of e)n+=i??0;return n}function Et(e,n){let i=[e];for(let a=0;a<i.length;a++)for(let r of i[a].children)i.push(r);for(let a=i.length-1;a>=0;a--){let r=i[a];r.children.length>0&&Pt(r,n,a===0?0:n)}e.w=e.nw,e.h=e.nh,e.x=e.w/2,e.y=e.h/2;for(let a=0;a<i.length;a++){let r=i[a];r.children.length>0&&Vt(r,n,a===0?0:n)}return{width:e.w,height:e.h}}var Wt=12,At=200,Gt=8,Lt=' fill="var(--_s)" stroke="var(--_b)"',vt=' stroke="var(--_b)"',Dt=[],zt=[],Ut=[],ce=[],Ht=["default"],kt=2e6,Ge=4,jt=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"]]),It=new Set(["circle","dbl-circ","diam"]),Xt=new Set(["stadium","hex","odd","lean-r","lean-l","trap-b","trap-t"]);function Le(e){return e.kind===0&&(e.shape==="circle"||e.shape==="dbl-circ")}function ie(e,n,i){let a=e.bw/2,r=e.bh/2,c=Math.abs(n-e.x),o=r;return Le(e)?o=Math.sqrt(Math.max(a*a-c*c,0)):e.kind===0&&e.shape==="diam"?o=r*Math.max(1-c/a,0):e.kind===0?o=r-I(e.shape,e.bw,e.bh,i>0?2:0):e.kind===1&&pe(e.mask)==="x"&&(o=r-re),e.y+i*o}function ae(e,n,i){let a=e.bw/2,r=e.bh/2,c=Math.abs(n-e.y),o=a;return Le(e)?o=Math.sqrt(Math.max(r*r-c*c,0)):e.kind===0&&e.shape==="diam"?o=a*Math.max(1-c/r,0):e.kind===0?o=a-I(e.shape,e.bw,e.bh,i>0?1:3):e.kind===1&&pe(e.mask)==="y"&&(o=a-re),e.x+i*o}function Ct(e,n,i,a){let r=n-e.x,c=i-e.y,o=e.bw/2,t=e.bh/2,b;Le(e)?b=o/(Math.hypot(r,c)||1):e.kind===0&&e.shape==="diam"?b=1/(Math.abs(r)/o+Math.abs(c)/t||1):b=Math.min(r===0?1/0:o/Math.abs(r),c===0?1/0:t/Math.abs(c)),b===1/0&&(b=0),a.push(e.x+r*b,e.y+c*b)}function Zt(e,n,i,a,r){let c=r.x-r.bw/2+1,o=r.x+r.bw/2-1,t=r.y-r.bh/2+1,b=r.y+r.bh/2-1;if(e<c&&i<c||e>o&&i>o||n<t&&a<t||n>b&&a>b)return!1;if(e===i||n===a)return!0;let d=i-e,u=a-n,m2=(w,y)=>Math.sign(d*(y-n)-u*(w-e)),l=m2(c,t);return l===0||m2(o,t)!==l||m2(o,b)!==l||m2(c,b)!==l}function ve(e,n,i,a){let r=0;for(let c of a)if(!(c===n||c===i)){for(let o=0;o+3<e.length;o+=2)if(Zt(e[o],e[o+1],e[o+2],e[o+3],c)){r++;break}}return r}function Qt(e,n,i,a){let r=e.x-e.bw/2,c=e.x+e.bw/2,o=e.y-e.bh/2,t=e.y+e.bh/2,b=n.x-n.bw/2,d=n.x+n.bw/2,u=n.y-n.bh/2,m2=n.y+n.bh/2,l=Math.max(r,b),w=Math.min(c,d),y=Math.max(o,u),g2=Math.min(t,m2),C=w-l>6,L=g2-y>6;if(C&&L){let p2=e.bw*e.bh<=n.bw*n.bh?e:n,D=p2===e?n:e,P2=p2.y-p2.bh/2-(D.y-D.bh/2),Se=D.y+D.bh/2-(p2.y+p2.bh/2),le=p2.x-p2.bw/2-(D.x-D.bw/2),he=D.x+D.bw/2-(p2.x+p2.bw/2),v=Math.min(P2,Se,le,he),Y;return v===Se?Y=[p2.x,ie(p2,p2.x,1),p2.x,D.y+D.bh/2]:v===P2?Y=[p2.x,ie(p2,p2.x,-1),p2.x,D.y-D.bh/2]:v===he?Y=[ae(p2,p2.y,1),p2.y,D.x+D.bw/2,p2.y]:Y=[ae(p2,p2.y,-1),p2.y,D.x-D.bw/2,p2.y],p2===e?Y:[Y[2],Y[3],Y[0],Y[1]]}if(C){let p2=Math.min(6,(w-l)/2),D=Math.min(Math.max((l+w)/2+i,l+p2),w-p2),P2=n.y>e.y?1:-1;return[D,ie(e,D,P2),D,ie(n,D,-P2)]}if(L){let p2=Math.min(6,(g2-y)/2),D=Math.min(Math.max((y+g2)/2+i,y+p2),g2-p2),P2=n.x>e.x?1:-1;return[ae(e,D,P2),D,ae(n,D,-P2),D]}let M=n.x>e.x?1:-1,K=n.y>e.y?1:-1,R2=[ae(e,e.y,M),e.y,n.x,e.y,n.x,ie(n,n.x,-K)],F=[e.x,ie(e,e.x,K),e.x,n.y,ae(n,n.y,-M),n.y],G=Math.abs(n.x-e.x)>=Math.abs(n.y-e.y),V=G?R2:F;if(a===void 0)return V;let z=ve(V,e,n,a);if(z===0)return V;let S=G?F:R2,f=ve(S,e,n,a);if(f<z&&(V=S,z=f),z===0)return V;let h2=[];return Ct(e,n.x,n.y,h2),Ct(n,e.x,e.y,h2),ve(h2,e,n,a)<z?h2:V}function Jt(e,n,i){let a=e.length,r=e[0],c=e[1],o=e[a-2],t=e[a-1],b=e[2]-r,d=e[3]-c,u=Math.hypot(b,d);b/=u||1,d/=u||1;let m$1=o-e[a-4],l=t-e[a-3],w=Math.hypot(m$1,l);if(m$1/=w||1,l/=w||1,a===4&&n+i>u){let g2=u/(n+i);n*=g2,i*=g2}n=Math.min(n,u),i=Math.min(i,w);let y=`M${m(r+b*n)},${m(c+d*n)}`;if(a===6){let g2=Math.max(0,Math.min(Gt,u-n,w-i));y+=`L${m(e[2]-b*g2)},${m(e[3]-d*g2)}Q${m(e[2])},${m(e[3])} ${m(e[2]+m$1*g2)},${m(e[3]+l*g2)}`}return y+=`L${m(o-m$1*i)},${m(t-l*i)}`,{d:y,sx:r,sy:c,sdx:-b,sdy:-d,ex:o,ey:t,edx:m$1,edy:l}}function ze(e,n){let i=e.bw/2,a=e.bh/2,r=Math.max(1,Math.min(10+5*(n-1),i,a));if(Le(e)){let c=e.x+i*Math.SQRT1_2,o=e.y-i*Math.SQRT1_2,t=2*Math.asin(Math.min(1,r/(2*i))),b=d=>Math.atan2(e.y-i*Math.sin(d)-o,e.x+i*Math.cos(d)-c);return[c,o,r,b(Math.PI/4+t),b(Math.PI/4-t)]}if(e.kind===0&&e.shape==="diam"){let c=Math.atan2(a,i);return[e.x+i/2,e.y-a/2,r,c+Math.PI,c]}return[e.x+i,e.y-a,r,Math.PI,Math.PI/2]}function qt(e,n,i,a){let[r,c,o,t,b]=ze(e,n),d=t+i/o,u=b-a/o,m$1=(u-d)%(2*Math.PI);m$1<=0&&(m$1+=2*Math.PI);let l=r+o*Math.cos(d),w=c+o*Math.sin(d),y=r+o*Math.cos(u),g2=c+o*Math.sin(u),C=r+o*Math.cos(t),L=c+o*Math.sin(t),M=r+o*Math.cos(b),K=c+o*Math.sin(b),R2=Math.hypot(C-l,L-w),F=Math.hypot(M-y,K-g2);return{d:`M${m(l)},${m(w)}A${m(o)},${m(o)} 0 ${m$1>Math.PI?1:0} 1 ${m(y)},${m(g2)}`,sx:C,sy:L,sdx:R2>0?(C-l)/R2:Math.sin(t),sdy:R2>0?(L-w)/R2:-Math.cos(t),ex:M,ey:K,edx:F>0?(M-y)/F:-Math.sin(b),edy:F>0?(K-g2)/F:Math.cos(b)}}var en=[.5,.3,.7,.15,.85];function Mt(e,n,i,a,r,c,o){if(o===void 0)return!1;for(let t of o)if(t!==r&&t!==c&&Math.abs(e-t.x)<(i+t.bw)/2&&Math.abs(n-t.y)<(a+t.bh)/2)return!0;return!1}function tn(e,n,i,a,r,c,o){if(o===void 0)return .5;for(let t of en){let b=e[n]+(e[n+2]-e[n])*t,d=e[n+1]+(e[n+3]-e[n+1])*t;if(!Mt(b,d,i,a,r,c,o))return t}return .5}function nn(e,n,i,a,r,c){let o=i[e[0]][0]===i[e[0]][2],t=-1/0,b=1/0,d=-Ge,u=!1;for(let w=0;w<e.length;w++){let y=i[e[w]];if(o?y[0]!==y[2]:y[1]!==y[3])return 0;t=Math.max(t,o?Math.min(y[1],y[3]):Math.min(y[0],y[2])),b=Math.min(b,o?Math.max(y[1],y[3]):Math.max(y[0],y[2]));let g2=n[e[w]];d+=(o?g2.label.height:g2.label.width+8)+Ge;for(let C=0;C<w;C++){let L=n[e[C]];Math.abs(g2.lx-L.lx)<(g2.label.width+L.label.width)/2+8&&Math.abs(g2.ly-L.ly)<(g2.label.height+L.label.height)/2&&(u=!0)}}if(!u)return 0;if(d>b-t-2*Tt$1)return d-(b-t-2*Tt$1);let m2=[],l=(t+b-d)/2;for(let w of e){let{label:y,lx:g2,ly:C}=n[w],L=o?y.height:y.width+8,M=l+L/2;if(Mt(o?g2:M,o?M:C,y.width+8,y.height,a,r,c))return 0;m2.push(M),l+=L+Ge}return e.forEach((w,y)=>{o?n[w].ly=m2[y]:n[w].lx=m2[y]}),0}function rn(e,n,i,a,r,c){let o=new Set;for(let l=n;l!==void 0;l=e[l.index])o.add(l);let t,b=i;for(;b!==void 0&&!o.has(b);)t=b,b=e[b.index];if(b===void 0||t===void 0||b===n)return!1;let d=n;for(;e[d.index]!==b;)d=e[d.index];let u;if(a){if(d.row===t.row)return!1;u=Math.max(d.row,t.row)-1,b.rowGaps===ce&&(b.rowGaps=[])}else{let[l,w]=d.col<t.col?[d,t]:[t,d];if(w.col<l.col+l.span)return!1;u=w.col-1,b.colGaps===ce&&(b.colGaps=[])}let m2=a?b.rowGaps:b.colGaps;return c.has(m2)||c.set(m2,m2.slice()),m2[u]=Math.max(m2[u]??0,(c.get(m2)[u]??0)+r),!0}function Nt(e,n,i){return p(i,a=>sn(e,n,i,a))}function sn(e,n,i,a){let r=i.fontSize??16,c=Math.round(r*.875),o=i.measurer??Ot$1(i.fontFamily,i.fontFamilyMono),t=i.padding??8,b=i.icons,d=n.block?.padding,u=Math.min(typeof d=="number"&&d>=0?Math.min(d,200):Wt,a?6:1/0),m$1=a?80:At,l=_=>{let s=[],x=E=>{for(let k of E)for(let N of k.split(";"))s.push(N)};for(let E of _.classes&&_.classes.length>0?_.classes:Ht){let k=e.classes.get(E);k&&x(k.styles)}return _.styles&&x(_.styles),Ft$2(s)},w=(_,s)=>{let x=_.type,E=x==="space"?Ft$2(Dt):l(_),k=(E.bold?1:0)|(E.italic?2:0),N=E.fontSize??r,O=0,I2="",A,U=0,$=0,Q=0,W=0,ee=0,ue=0;if(x==="space")O=3,A=It$1(void 0,!1,o,N,m$1);else if(x==="composite")O=2,A=It$1(_.label,!1,o,N,a?h(i):4e3,k),Q=A.height>0?A.height+4:0,U=A.width+2*u,$=Q+2*u;else if(x==="block_arrow"){O=1,A=It$1(_.label,!1,o,N,m$1,k);let B2=!0;for(let we of A.lines)for(let qe of we)(qe.icon!==void 0||qe.text.trim()!=="")&&(B2=!1);W=_t(_.directions);let te=B2?We(W,0,0):We(W,A.width,A.height);U=te.w,$=te.h,ee=te.dx,ue=te.dy}else{I2=jt.get(x??"")??"rect",A=It$1(_.label,!1,o,N,m$1,k);let B2=P(I2,A.width,A.height);U=B2.w,$=I2==="cyl"?Math.max(B2.h,A.height+40):B2.h,ue=B2.dy}return{children:[],columns:O===2?_.columns??-1:-1,span:O===3?1:_.widthInColumns??1,space:O===3,head:Q,nw:U,nh:$,col:0,row:0,cols:0,heights:Ut,rowGaps:ce,colGaps:ce,x:0,y:0,w:0,h:0,block:_,kind:O,index:s,shape:I2,label:A,style:E,mask:W,dx:ee,dy:ue,bw:0,bh:0}},y=w(e.root,0);y.nw=0,y.nh=0;let g$1=[y],C=[],L=new Map;for(let _=0;_<g$1.length;_++){let s=g$1[_];if(s.kind===2)for(let x of s.block.children??zt){let E=w(x,g$1.length);s.children.push(E),C[E.index]=s,g$1.push(E),E.kind!==3&&L.set(x.id,E)}}let M=[],K=[],R2=g$1.map(_=>_.nw),F=()=>{for(let s of g$1)s.nw=R2[s.index];let _=Et(y,u);M.length=0,K.length=0;for(let s of g$1)s.kind===0&&It.has(s.shape)?(s.bw=s.nw,s.bh=s.nh):s.kind===1?(s.bw=s.span>1?s.w:s.nw,s.bh=s.nh):(s.bw=s.w,s.bh=s.kind===0&&Xt.has(s.shape)?s.nh:s.h),s.kind===0&&s.shape==="cyl"&&(s.dy=Math.min(12,Math.max(6,s.bw/14))/2),s.kind===0||s.kind===1?M.push(s):s.head>0&&K.push({x:s.x,y:s.y-s.h/2+(s.head+u)/2+2,bw:s.label.width,bh:s.label.height});return _},G=F(),V=new Map,z=new Set,S=[],f=[];for(let _ of e.edges){let s=L.get(_.start??""),x=L.get(_.end??"");if(s===void 0||x===void 0)continue;let E=Math.min(s.index,x.index)*g$1.length+Math.max(s.index,x.index);V.set(E,(V.get(E)??0)+1),_.label&&z.add(E),S.push([s,x]),f.push(_)}let h$1=f.length*M.length<=kt?M:void 0,p2=[],D=new Map,P$1=[],Se=()=>{let _=new Map;p2.length=0,D.clear();for(let s=0;s<f.length;s++){let[x,E]=S[s],k=Math.min(x.index,E.index)*g$1.length+Math.max(x.index,E.index),N=V.get(k)??1,O=_.get(k)??0;_.set(k,O+1);let I2=It$1(f[s].label,!1,o,c,At),A,U,$;if(x===E){let[Q,W,ee]=ze(x,O+1);A=[],U=Q+ee+6+I2.width/2,$=W-ee/2}else{let Q=z.has(k)?Math.round(c*1.5)+2:14;A=Qt(x,E,(O-(N-1)/2)*Q,h$1);let W=A.length,ee=Math.abs(A[2]-A[0])+Math.abs(A[3]-A[1]),ue=Math.abs(A[W-2]-A[W-4])+Math.abs(A[W-1]-A[W-3]),B2=W===6&&ue>ee?2:0,te=I2.width>0?tn(A,B2,I2.width+8,I2.height,x,E,h$1):.5;if(U=A[B2]+(A[B2+2]-A[B2])*te,$=A[B2+1]+(A[B2+3]-A[B2+1])*te,I2.width>0&&N>1){P$1[s]=A.slice(B2,B2+4);let we=D.get(k);we?we.push(s):D.set(k,[s])}}p2.push({edge:f[s],points:A,loop:x===E?O+1:0,label:I2,lx:U,ly:$})}},le=_=>{Se();let s=h$1&&[...h$1,...K],x=new Map,E=!1;for(let k of D.values()){if(k.length<2)continue;let[N,O]=S[k[0]],I2=nn(k,p2,P$1,N,O,s),A=P$1[k[0]][0]===P$1[k[0]][2];_&&I2>0&&(A||!a)&&rn(C,N,O,A,Math.ceil(I2),x)&&(E=!0)}return E},he=()=>{let _=0;for(let s=0;s<p2.length;s++){let x=p2[s];for(let E=s+1;E<p2.length;E++){let k=p2[E],N=(x.label.width+8)/2,O=(k.label.width+8)/2,I2=Math.min(x.lx+N,k.lx+O)-Math.max(x.lx-N,k.lx-O),A=Math.min(x.ly+x.label.height/2,k.ly+k.label.height/2)-Math.max(x.ly-x.label.height/2,k.ly-k.label.height/2);x.label.width>0&&k.label.width>0&&I2>0&&A>0&&(_+=I2*A)}}return _},v=0,Y=0,se$1=0,ye2=0,Ue=(_,s,x,E)=>{_-x/2<v&&(v=_-x/2),_+x/2>se$1&&(se$1=_+x/2),s-E/2<Y&&(Y=s-E/2),s+E/2>ye2&&(ye2=s+E/2)},De=()=>{v=0,Y=0,se$1=G.width,ye2=G.height;for(let _=0;_<p2.length;_++){let s=p2[_];if(s.loop>0){let[x,E,k]=ze(S[_][0],s.loop);Ue(x,E,2*k+2,2*k+2)}s.label.width>0&&Ue(s.lx,s.ly,s.label.width+8,s.label.height)}return se$1-v};if(le(f.length*f.length<=kt)){let _=he(),s=De(),x=!0;for(let N=0;N<3&&x;N++)G=F(),x=le(N<2);let E=De(),k=i.maxWidth!==void 0&&i.maxWidth>0?i.maxWidth:1/0;if(he()>_-1||E>s&&Math.ceil(E+2*t)>k){for(let N of g$1)N.rowGaps=ce,N.colGaps=ce;G=F(),le(!1)}}De();let de=g(e.title,o,r,a?h(i):4e3),He=de.height>0?de.height+12:0,je=Math.max(se$1-v,de.width),ke=t-v+(je-(se$1-v))/2,Ie=t+He-Y;for(let _ of g$1)_.x+=ke,_.y+=Ie;let Ce=Math.ceil(je+2*t),Xe=Math.ceil(ye2-Y+He+2*t),Me="",Ze="",Qe=[];for(let _=1;_<g$1.length;_++){let s=g$1[_];if(s.kind===3)continue;let x=Dt$1((s.block.classes??Dt).join(" ")),E=Tn(s.block.id);if(s.kind===2){let O=s.y-s.h/2;Pt$1(s.style.shape)&&Qe.push({box:[s.x-s.w/2,O,s.x+s.w/2,O+s.h],shape:s.style.shape}),Me+=`<g class="pele-cluster${x}" data-id="${E}"><rect x="${m(s.x-s.w/2)}" y="${m(O)}" width="${m(s.w)}" height="${m(s.h)}" fill="var(--_a)"${Ct$1(s.style.shape)?"":' fill-opacity="0.5"'} stroke="var(--_b)"${Nt$1(s.style.shape)}/>`+Yt$1(s.label,s.x,O+(s.head+u)/2+2,` class="pele-cluster-label"${Ft$1(s.style,"var(--_m)")}${s.style.text}`,b)+"</g>";continue}let k=s.kind===1,N=s.label;if(s.span>1&&s.label.width>0&&s.label.lines.length>1&&s.bw>s.nw&&(k||!It.has(s.shape))){let O=(s.style.bold?1:0)|(s.style.italic?2:0),I2=s.label.width+(s.bw-s.nw);N=It$1(s.block.label,!1,o,s.label.size,I2,O)}Ze+=`<g class="pele-node pele-shape-${k?"block-arrow":s.shape}${x}" data-id="${E}" transform="translate(${m(s.x)},${m(s.y)})">`+(k?xt(s.mask,s.bw,s.bh,Lt+s.style.shape):R$1(s.shape,s.bw,s.bh,Lt+s.style.shape,vt+s.style.line))+Yt$1(N,s.dx,s.dy,` class="pele-label"${k||B(s.shape)?Ft$1(s.style):""}${s.style.text}`,b)+"</g>"}let Je="",Ne="",Oe="";for(let _=0;_<p2.length;_++){let{edge:s,points:x,loop:E,label:k}=p2[_],N=s.arrowTypeStart??"",O=s.arrowTypeEnd??"",I2;if(E>0)I2=qt(S[_][0],E,_n(N),_n(O));else{for(let $=0;$<x.length;$+=2)x[$]+=ke,x[$+1]+=Ie;I2=Jt(x,_n(N),_n(O))}let A=oe(I2.d,[I2.sx,I2.sy,I2.ex,I2.ey],Qe);A===""&&(Je+=se(I2,N,O,"",s.thickness==="thick"));let U=Tn(s.id);if(Ne+=`<g class="pele-edge" data-id="${U}"${A?` stroke="${A}"`:""}><path d="${I2.d}"${s.thickness==="thick"?' stroke-width="2.5"':""}${s.pattern==="dotted"?' stroke-dasharray="3 4"':""}/>`+cn(N,I2.sx,I2.sy,I2.sdx,I2.sdy,A||"var(--_l)")+cn(O,I2.ex,I2.ey,I2.edx,I2.edy,A||"var(--_l)")+"</g>",k.width>0){let $=p2[_].lx+ke,Q=p2[_].ly+Ie;Oe+=ce$1(s.id,k,$,Q,"",b)}}return{svg:Yt$2("block",Ce,Xe,r,i,e,Yt$1(de,Ce/2,t+de.height/2,' class="pele-title" font-weight="var(--_tw)"')+(Me?`<g class="pele-clusters">${Me}</g>`:"")+ae$1(Je)+(Ne?`<g class="pele-edges" fill="none" stroke="var(--_l)" stroke-linecap="round">${Ne}</g>`:"")+`<g class="pele-nodes">${Ze}</g>`+(Oe?`<g class="pele-edge-labels" font-size="${c}">${Oe}</g>`:"")),width:Ce,height:Xe,links:[]}}var Yn={type:"block",math:!0,parse(e,n,i){let a=new xe;return a.title=i,gt(e,a),a},render:Nt};export{Yn as block};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as reactExports,c as reactDomExports,j as jsxRuntimeExports}from"./vendor-react-CxJ4vs-5.js";import{u as useViewsHost,e as useViewsLabels,g as useSettings,h as useOptionalWorkspaceActions,S as SavedViewRenameContext,V as ViewChromeContext,v as viewsScopeOf,R as RowMenuButton,N as Notice,i as ViewsScopeContext}from"./kit-
|
|
1
|
+
import{r as reactExports,c as reactDomExports,j as jsxRuntimeExports}from"./vendor-react-CxJ4vs-5.js";import{u as useViewsHost,e as useViewsLabels,g as useSettings,h as useOptionalWorkspaceActions,S as SavedViewRenameContext,V as ViewChromeContext,v as viewsScopeOf,R as RowMenuButton,N as Notice,i as ViewsScopeContext}from"./kit-CD3F-f6F.js";import{S as SavedViewInputsContext}from"./input-preview-CvBe1Cwt.js";import{b as useViewPin,S as StoredViewBlock}from"./ViewBlock-B-ppjb34.js";import"./vendor-motion-C2jPaSqL.js";import"./vendor-owxl31sT.js";import"./core-Cj89wpQh.js";import"./vendor-editor-gVJMCtGz.js";const ARTIFACTS_TAB="artifacts",PIN_ITEM_IDS=["open-artifacts","open-chat","rename","unpin"];function metaOf(record){const{view}=record;return{id:view.id,anchor:{kind:"fence",turnId:record.origin.turnId??"",fenceIndex:0},title:"",alt:view.alt,heights:view.heights,origin:view.origin,createdAt:view.createdAt,...view.refreshedAt!==void 0?{refreshedAt:view.refreshedAt}:{},...view.updatedAt!==void 0?{updatedAt:view.updatedAt}:{},hasErrors:view.errors.some(error=>error.level==="error")}}function heldMeta(heights){return{id:"",anchor:{kind:"fence",turnId:"",fenceIndex:0},title:"",alt:"",heights:[...heights],origin:"fence",createdAt:0,hasErrors:!1}}const NO_HEIGHTS=[];function PinnedSavedView({viewScope,viewKey,heights=NO_HEIGHTS,onOpenSession}){const host=useViewsHost(),labels=useViewsLabels(),{settings}=useSettings(),workspace=useOptionalWorkspaceActions(),pins=useViewPin(),[record,setRecord]=reactExports.useState(void 0),[error,setError]=reactExports.useState(null),[reads,setReads]=reactExports.useState(0),getSaved=host?.getSaved;reactExports.useEffect(()=>{if(!getSaved)return;let live=!0;return getSaved({kind:"saved",scope:viewScope,key:viewKey}).then(result=>{live&&(result.ok?setRecord(result.value):setError("message"in result.error?result.error.message:labels.viewLoadFailed))}),()=>{live=!1}},[getSaved,viewScope,viewKey,reads,labels.viewLoadFailed]);const onRefreshed=reactExports.useCallback(()=>setReads(n=>n+1),[]),version=record?.version,ref=reactExports.useMemo(()=>({kind:"saved",scope:viewScope,key:viewKey,...version!==void 0?{version}:{}}),[viewScope,viewKey,version]),held=reactExports.useMemo(()=>heldMeta(heights),[heights]),origin=record?.origin.sessionId,subscribe=host?.subscribe,viewId=record?.view.id;reactExports.useEffect(()=>{if(!(!subscribe||!origin||!viewId))return subscribe(origin,ids=>{ids.includes(viewId)&&setReads(n=>n+1)})},[subscribe,origin,viewId]);const unpin=reactExports.useRef(pins.unpin);reactExports.useEffect(()=>{unpin.current=pins.unpin});const canUnpin=pins.unpin!==void 0,rename=reactExports.useContext(SavedViewRenameContext),chrome=reactExports.useContext(ViewChromeContext),chromeItems=chrome?.items,[menuItems,fallbackItems]=reactExports.useMemo(()=>{const items=[...origin&&onOpenSession?[{id:"open-artifacts",label:labels.viewOpenInArtifacts,icon:"i-ph-cube",onSelect:()=>{onOpenSession(origin),requestAnimationFrame(()=>requestAnimationFrame(()=>workspace?.focusTab(ARTIFACTS_TAB)))}},{id:"open-chat",label:labels.viewOpenChat,icon:"i-ph-chat-circle",onSelect:()=>onOpenSession(origin)}]:[],...rename?[{id:"rename",label:labels.viewRename,icon:"i-ph-pencil-simple",group:"pin",onSelect:rename}]:[],...canUnpin?[{id:"unpin",label:labels.viewUnpin,icon:"i-ph-push-pin-fill",group:"pin",onSelect:()=>{unpin.current?.(viewScope,viewKey)}}]:[]],own=new Set(PIN_ITEM_IDS);return[items,[...items,...(chromeItems??[]).filter(item=>!own.has(item.id))]]},[origin,onOpenSession,labels,workspace,rename,canUnpin,viewScope,viewKey,chromeItems]),inputs=reactExports.useMemo(()=>origin&&onOpenSession?{openChat:()=>onOpenSession(origin)}:{},[origin,onOpenSession]),scope=reactExports.useMemo(()=>viewsScopeOf(settings.views===!0,settings.viewsCustomCode!==!1,!1,null,null,!0,!1,settings.viewsOrchestration??"off"),[settings.views,settings.viewsCustomCode,settings.viewsOrchestration]);if(error||record===null){const menu=chrome?.slot?reactDomExports.createPortal(jsxRuntimeExports.jsx(RowMenuButton,{label:labels.viewActions,items:fallbackItems,...chrome.reveal?{className:chrome.reveal}:{}}),chrome.slot):null;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[menu,jsxRuntimeExports.jsx(Notice,{tone:"error",compact:!0,...error?{detail:error}:{},children:labels.viewLoadFailed})]})}return jsxRuntimeExports.jsx(ViewsScopeContext.Provider,{value:scope,children:jsxRuntimeExports.jsx(SavedViewInputsContext.Provider,{value:inputs,children:jsxRuntimeExports.jsx("div",{"data-zg-pinned-view":viewKey,className:"min-w-0",children:jsxRuntimeExports.jsx(StoredViewBlock,{sessionId:record?record.view.sessionId:"",meta:record?metaOf(record):held,viewRef:ref,menuItems,onRefreshed,held:!record,...chrome?{frame:"none",chrome}:{}})})})})}export{PinnedSavedView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as me,S as S$1,_ as _t}from"./lazy-
|
|
1
|
+
import{b as me,S as S$1,_ as _t}from"./lazy-CUmWiDAP.js";var c="about:blank",C=/^([^\w]*)(javascript|data|vbscript)/im,g=/&#(\w+)(^\w|;)?/g,m=/&(newline|tab);/gi,u=/[\u0000-\u001F\u007F-\u009F -\uD800-\uDFFF\uFFFE\uFFFF]/gimu,S=/^.+(:|:)/gim,E=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g;function R(e){try{return decodeURIComponent(e)}catch{return e}}function l(e,t){let n=t?R(e.trim()):e.trim(),i,o=0;do{if(++o>32)return;n=n.replace(u,"").replace(g,(s,r)=>String.fromCharCode(r)).replace(m,"").replace(u,"").replace(E,"").trim(),t&&(n=R(n)),i=n.match(u)||n.match(g)||n.match(m)||n.match(E)}while(i&&i.length>0);return n}function _(e){if(!e)return c;let t=l(e,!0),n=l(e,!1);if(!t||!n)return c;if(t[0]==="."||t[0]==="/")return n;let i=t.trimStart().match(S);if(!i)return n;let o=i[0].toLowerCase().trim();if(C.test(o))return c;let s=n.trimStart().replace(/\\/g,"/");if(o==="mailto:"||o.includes("://"))return s;if(o==="http:"||o==="https:"){let r;try{r=new URL(s)}catch{return c}return r.protocol=r.protocol.toLowerCase(),r.hostname=r.hostname.toLowerCase(),r.toString()}return s}function A(e){return _(me(e))}var w=["http","https","mailto","tel"],F=["http","https"],x=/^([a-z][a-z0-9+.-]*):/i,I=/^[\\/]{2}/;function h(e,t){if(I.test(e))return!1;let n=x.exec(e);return!n||t.includes(n[1].toLowerCase())}function L(e,t){let n=l(e,!0);return n!==void 0&&h(e,t)&&h(n,t)?e:void 0}function d(e,t){return t.links===!1?void 0:L(e,t.linkSchemes??w)}function N(e,t){return t.images===!1?void 0:L(e,t.imageSchemes??F)}var O=new RegExp(_t.source,"gu");function H(e,t){let n=_(e);if(n===c||d(n,t)===void 0)return!1;let i=e.replace(O,"").replace(/[\t\n\r]/g,"").replace(/^[\x00-\x20]+/,"");return d(i,t)!==void 0}function U(e,t,n,i,o,s=""){let r=d(t,o);return r===void 0?e:(i.push({id:n,href:r,internal:!1}),`<a href="${S$1(r)}"${s}${T(o)}>${e}</a>`)}function T(e){let t=e.linkRel??"noopener";return t?` rel="${S$1(t)}"`:""}export{A,H,N,T,U,_,d};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{T as Tn,m,E as Et,i as it}from"./lazy-
|
|
1
|
+
import{T as Tn,m,E as Et,i as it}from"./lazy-CUmWiDAP.js";var x=["1","INVALID","SPACELINE","NL","EOF","","SPACELIST","ICON","CLASS","NODE_DSTART","NODE_ID","NODE_DESCR","NODE_DEND","SHAPE_DATA"];function P(E,D){return E===5?D?"KANBAN":"MINDMAP":x[E]}var O={DEFAULT:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6};function W(E,D){switch(E){case"[":return O.RECT;case"(":return D===")"?O.ROUNDED_RECT:O.CLOUD;case"((":return O.CIRCLE;case")":return O.CLOUD;case"))":return O.BANG;case"{{":return O.HEXAGON;default:return O.DEFAULT}}var y=/\s+/y,d=/.+/y,H=/[^([\n){}]+/y,v=/[^([\n){}@]+/y,w=/[^)\](}]+/y,k=/[^`"]+/y,$=/[^}^"]+/y,B=/\n\s*/g;function p(E,D,r){for(let T=0;T<r.length;T++)if((E.charCodeAt(D+T)|32)!==r.charCodeAt(T))return!1;return!0}function F(E,D){let r=E.length,T=[],i=[],I=[],c=D?"kanban":"mindmap",u=D?v:H,e=0,t=0,L=-1,l=(n,A,N)=>{T.push(n),i.push(A),I.push(t),t=N},s=(n,A,N)=>{l(n,E.slice(t,A),A),e=N},o=(n,A)=>(n.lastIndex=A,n.test(E)?n.lastIndex:-1),f=n=>{let A=E.indexOf(n,t);return A===-1?r:A};for(;t<r;){let n=E.charCodeAt(t),A=E.charCodeAt(t+1),N;if(e===0){let S=n<=32||n>=160?Math.max(o(y,t),t):t;if(D&&n===64&&A===123)l(13,"",t+2),e=6;else if(E.charCodeAt(S)===37&&E.charCodeAt(S+1)===37)s(2,o(d,S),0);else if(S>t)L<t&&(L=f(`
|
|
2
2
|
`)),L>=S?s(6,S,0):(N=E.lastIndexOf(`
|
|
3
3
|
`,S-1))>t?s(2,N+1,0):s(3,t+1,0);else if(p(E,t,c)&&!Et(E.charCodeAt(t+c.length)))s(5,t+c.length,0);else if(n===58&&A===58&&E.charCodeAt(t+2)===58)t+=3,e=1;else if(n===58&&A===58&&p(E,t+2,"icon")&&E.charCodeAt(t+6)===40)t+=7,e=2;else if(n===45&&A===41||n===40&&(A===45||A===40)||(n===41||n===123)&&A===n)s(9,t+2,3);else if(n===41||n===40||n===91)s(9,t+1,3);else if((N=o(u,t))!==-1)s(10,N,0);else break}else if(e===3)n===34?(e=A===96?5:4,t+=A===96?2:1):n===41||n===40?s(12,A===n||n===40&&A===45?t+2:t+1,0):n===93?s(12,t+1,0):n===125&&A===125||n===45&&A===41?s(12,t+2,0):s(11,o(n===125?d:w,t),3);else if(e===4)n===34?(t++,e=3):s(11,f('"'),4);else if(e===5)if(n===96&&A===34)t+=2,e=3;else if((N=o(k,t))!==-1)s(11,N,5);else break;else if(e===1)if((N=o(d,t))!==-1)s(8,N,0);else if(n===10)t++,e=0;else break;else if(e===2)n===41?(t++,e=0):s(7,f(")"),2);else if(e===6)if(n===34)s(13,t+1,7);else if(n===125)t++,e=0;else if((N=o($,t))!==-1)s(13,N,6);else break;else n===34?s(13,t+1,6):(N=f('"'),l(13,E.slice(t,N).replace(B,"<br/>"),N))}return t<r?l(1,"",t):(e===0&&l(4,"",r),l(0,"",r)),{types:T,texts:i,starts:I}}var C="'SPACELINE', 'NL', 'EOF'",h=new Uint8Array(14);for(let E of[2,6,7,8,9,10])h[E]=1;function R(E){return E===2||E===3||E===4}function Y(E,D,r){let T=r?"kanban":"mindmap",{types:i,texts:I,starts:c}=F(E,r),u=r?", 'SHAPE_DATA'":"",e=0,t=s=>{let o=i[e];throw o===1?it(T,E,c[e],"",!0):it(T,E,c[e],`Expecting ${s}, got '${P(o,r)}'`)},L=`'${P(5,r)}'`;if(i[e]===2){for(e++;i[e]===2||i[e]===3;)e++;i[e]!==5&&t(`'SPACELINE', 'NL', ${L}`)}else i[e]!==5&&t(`'SPACELINE', ${L}`);e++;let l="'SPACELINE', 'NL', 'SPACELIST', 'ICON', 'CLASS', 'NODE_DSTART', 'NODE_ID'";for(i[e]===3&&(e++,l="'SPACELINE', 'SPACELIST', 'ICON', 'CLASS', 'NODE_DSTART', 'NODE_ID'");;){let s=i[e],o=0,f=s===6;if(f&&(o=I[e++].length,s=i[e]),s===10||s===9){let n,A,N=0;if(s===10&&(n=I[e++]),i[e]===9){let S=I[e++];i[e]!==11&&t("'NODE_DESCR'"),A=I[e++],i[e]!==12&&t("'NODE_DEND'");let b=I[e++];!R(i[e])&&i[e]!==13&&t(C+u),N=D.getType(S,b)}else!R(i[e])&&i[e]!==13&&t(C+", 'NODE_DSTART'"+u),A=n;if(i[e]===13){let S=I[e++];for(;i[e]===13;)S+=I[e++];R(i[e])||t(C+u),D.addNode(o,n??A,A,N,S)}else D.addNode(o,n??A,A,N)}else if(s===7||s===8){let n=I[e++];R(i[e])||t(C),D.decorateNode(s===7?{icon:n}:{class:n})}else f?R(s)||t(C+", 'ICON', 'CLASS', 'NODE_DSTART', 'NODE_ID'"):s===2?R(i[++e])||t(C):t(l);for(e++;i[e]===3||i[e]===4;)e++;if(i[e]===0)return;h[i[e]]===0&&t(C+", 'SPACELIST', 'ICON', 'CLASS', 'NODE_DSTART', 'NODE_ID'")}}function X(E,D,r,T,i){return`<svg class="pele-icon" data-icon="${Tn(E)}" x="${m(D)}" y="${m(r)}" width="${m(T)}" height="${m(T)}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${i?.(E)??""}</svg>`}export{W,X,Y};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{T}from"./75JW6PN6-
|
|
1
|
+
import{T}from"./75JW6PN6-CYzAa9yx.js";import{c,h}from"./DKTLEL5E-CJTkVtjr.js";import{d as cn,T as Tt}from"./EFYWJBJK-CFT5CQUG.js";import{I as It,g as gt,Y as Yt$1}from"./BGW36YJW-BAwgTZ_z.js";import{y as ye,i as it,E as Et,O as Ot,m,Y as Yt,T as Tn}from"./lazy-CUmWiDAP.js";import"./kit-CD3F-f6F.js";import"./vendor-react-CxJ4vs-5.js";import"./vendor-motion-C2jPaSqL.js";import"./vendor-owxl31sT.js";import"./core-Cj89wpQh.js";import"./vendor-editor-gVJMCtGz.js";var D=class{type="ishikawa";title;root;stack=[];baseLevel;addNode(d,t){let r={text:t,children:[]};if(!this.root){this.root=r,this.stack=[{level:0,node:r}];return}this.baseLevel??=d;let h2=Math.max(d-this.baseLevel+1,1),e=this.stack;for(;e.length>1&&e[e.length-1].level>=h2;)e.pop();e[e.length-1].node.children.push(r),e.push({level:h2,node:r})}},pe=["$end","EOF","SPACELINE","NL","ISHIKAWA","SPACELIST","TEXT"];function we(i,d){let t="ishikawa-beta",r=0;for(;r<13;){let h2=i.charCodeAt(d+r),e=t.charCodeAt(r);if(h2!==e&&(h2+32!==e||h2<65||h2>90))break;r++}return r===13&&!Et(i.charCodeAt(d+13))?13:r>=8&&!Et(i.charCodeAt(d+8))?8:0}function me(i){let d=[],t=[],r=[],h2=i.length,e=0;for(;e<h2;){let m2=e,s=-1;for(;m2<h2&&ye(i.charCodeAt(m2));)i.charCodeAt(m2)===10&&(s=m2),m2++;let c2,l;if(i.charCodeAt(m2)===37&&i.charCodeAt(m2+1)===37)for(c2=2,l=m2+2;l<h2;){let u=i.charCodeAt(l);if(u===10||u===13||u===8232||u===8233)break;l++}else if(m2===e){let u=we(i,e);u>0?(c2=4,l=e+u):(c2=6,l=i.indexOf(`
|
|
2
2
|
`,e),l===-1&&(l=h2))}else s>e?(c2=2,l=s+1):s===e?(c2=3,l=e+1):(c2=5,l=m2);d.push(c2),t.push(e),r.push(l),e=l}return d.push(1,0),t.push(h2,h2),r.push(h2,h2),{types:d,starts:t,ends:r}}var q="'SPACELINE', 'NL', 'EOF'";function fe(i,d){let{types:t,starts:r,ends:h2}=me(i),e=0,m2=s=>{throw it("ishikawa",i,r[e],`Expecting ${s}, got '${pe[t[e]]}'`)};if(t[e]===2){for(e++;t[e]===2||t[e]===3;)e++;t[e]!==4&&m2("'SPACELINE', 'NL', 'ISHIKAWA'")}else t[e]!==4&&m2("'SPACELINE', 'ISHIKAWA'");for(e++,t[e]===3&&e++;;){let s=t[e];if(s===6||s===5&&t[e+1]===6){let c2=s===6?e:e+1;e=c2+1,t[e]!==2&&t[e]!==3&&t[e]!==1&&m2(q),d.addNode(s===6?0:h2[c2-1]-r[c2-1],i.slice(r[c2],h2[c2]).trim())}else s===2||s===5?(e++,t[e]!==2&&t[e]!==3&&t[e]!==1&&m2(s===5?`${q}, 'TEXT'`:q)):m2("'SPACELINE', 'SPACELIST', 'TEXT'");for(e++;t[e]===3||t[e]===1;)e++;if(t[e]===0)return}}var B=.5,F=Math.hypot(B,1),Ee=14,ge=6,ke=8,be=22,Ie=18,J=5,Ae=26,$e=28,Me=10,Ne=5;function Se(i,d,t,r,h2){let e=It(i.text,!1,t,r,180),m2=Math.round(h2*1.5),s=[],c2=[],l=[],u=(o,f,$)=>{let I=o.length;for(let k=I-1;k>=0;k--)l.push({node:o[d?I-1-k:k],depth:f,parent:$,slot:k,bone:-1})};for(u(i.children,2,-1);l.length>0;){let o=l.pop();if(o.bone!==-1){c2.push(o.bone);continue}let f=s.length;s.push({label:It(o.node.text,!1,t,h2,200),depth:o.depth,parent:o.parent,slot:o.slot,kids:o.node.children.length,rise:0,at:0,textEnd:0}),o.depth%2===0?c2.push(f):(o.bone=f,l.push(o)),u(o.node.children,o.depth+1,f)}let E=Ee;for(let o of c2){let f=Math.max(s[o].label.height,m2)+ge;s[o].rise=E+f/2,E+=f}let x=e.width+2*Me,w=x/2;for(let o of s){let f=o.parent===-1?void 0:s[o.parent];o.depth%2===0?(o.at=f?f.at:0,o.textEnd=o.at-(o.kids>0?(o.kids+1)*be:Ie)-J):(o.at=f.at-(f.kids-o.slot)*be,o.textEnd=o.at-J),w=Math.max(w,o.label.width-o.textEnd)}return{node:i,label:e,boxW:x,boxH:e.height+2*Ne,bones:s,rise:E+ke,reach:w}}function xe(i,d,t){return c(t,r=>Le(i,d,t,r))}function Le(i,d,t,r){let h2=t.fontSize??16,e=Math.round(h2*.875),m$1=t.measurer??Ot(t.fontFamily,t.fontFamilyMono),s=t.padding??8;if(r)return Te(i,t);let c2=i.root,l=It(i.title,!1,m$1,h2,4e3,1),u=l.height>0?l.height+12:0,E="",x=0,w=0,o=0,f=0;if(c2){let M=It(c2.text,!1,m$1,h2,200,1),S=Math.max(M.height+24,48),K=M.width+24+S/2,v=c2.children.map((p,N)=>Se(p,N%2===0,m$1,h2,e));for(let p of v)p.rise=Math.max(p.rise,S/2+14);let Q=[],W=-34;for(let p=0;p<v.length;p+=2){if(p>0){let N=0;for(let g=0;g<2;g++){let P=v[p-2+g],A=v[p+g];P&&(N=Math.max(N,P.reach+(A?A.boxW/2:0)))}W-=N+Ae}Q.push(W,W)}let ee=v.length>0?W-$e:-34;w=K,x=ee,o=-S/2,f=S/2;let te="";v.forEach((p,N)=>{let g=N%2===0?-1:1,P=Q[N],A=(b,O)=>P+b-O*B,H=A(0,p.rise),ne=g*p.rise,oe=Tt-1,j=`M${m(P-B/F*oe)},${m(g*oe/F)}L${m(H)},${m(ne)}`,z="";for(let b of p.bones){let O=g*b.rise;if(b.depth%2===0)j+=`M${m(A(b.at,b.rise))},${m(O)}H${m(A(b.textEnd+J,b.rise))}`;else{let ae=p.bones[b.parent].rise;j+=`M${m(A(b.at,ae))},${m(g*ae)}L${m(A(b.at,b.rise))},${m(O)}`}let se=A(b.textEnd,b.rise);z+=Yt(b.label,se-b.label.width/2,O,b.depth>2?' fill="var(--_m)"':""),x=Math.min(x,se-b.label.width)}let R=ne+g*(p.boxH/2);x=Math.min(x,H-p.boxW/2),w=Math.max(w,H+p.boxW/2),o=Math.min(o,R-p.boxH/2),f=Math.max(f,R+p.boxH/2),te+=`<g class="pele-ishikawa-category" data-id="${Tn(p.node.text)}"><path class="pele-ishikawa-bones" d="${j}" fill="none" stroke="var(--_l)"/>`+cn("arrow_point",P,0,B/F,-g/F,"var(--_l)")+`<rect x="${m(H-p.boxW/2)}" y="${m(R-p.boxH/2)}" width="${m(p.boxW)}" height="${m(p.boxH)}" fill="var(--_s)" stroke="var(--_b)"${gt}/>`+Yt(p.label,H,R,' class="pele-label"')+(z?`<g class="pele-ishikawa-causes" font-size="${e}">${z}</g>`:"")+"</g>"});let _=S/2;E=`<path class="pele-ishikawa-spine" d="M${m(ee)},0H${m(-7)}" fill="none" stroke="var(--_l)"/>`+cn("arrow_point",0,0,1,0,"var(--_l)")+te+`<g class="pele-ishikawa-head" data-id="${Tn(c2.text)}"><path d="M0,${m(-_)}H${m(K-_)}A${m(_)},${m(_)} 0 0 1 ${m(K-_)},${m(_)}H0Z" fill="var(--_s)" stroke="var(--_b)" stroke-linejoin="round"/>`+Yt(M,12+M.width/2,0,' class="pele-label" font-weight="var(--_hw)"')+"</g>"}let $=Math.max(w-x,l.width),I=Math.ceil($+2*s),k=Math.ceil(f-o+u+2*s),n=s+($-(w-x))/2-x,y=s+u-o;return{svg:Yt$1("ishikawa",I,k,h2,t,{},Yt(l,I/2,s+l.height/2,' class="pele-title" font-weight="var(--_tw)"')+(E?`<g transform="translate(${m(n)},${m(y)})">${E}</g>`:"")),width:I,height:k,links:[]}}function Te(i,d){let t=d.fontSize??16,r=Math.round(t*.875),h$1=d.measurer??Ot(d.fontFamily,d.fontFamilyMono),e=d.padding??8,m$1=Math.max(140,(d.maxWidth??320)-2*e),s=It(i.title,!1,h$1,t,h(d),1),c2=[],l=i.root?[{node:i.root,depth:0,parent:-1}]:[],u=0;for(;l.length;){let n=l.pop(),y=c2.length;c2.push({...n,x:0,y:0,w:0,h:0}),u=Math.max(u,n.depth);for(let C=n.node.children.length-1;C>=0;C--)l.push({node:n.node.children[C],depth:n.depth+1,parent:y})}let E=Math.min(20,Math.max(2,(m$1-120)/Math.max(1,u))),x=e+(s.height?s.height+12:0),w=s.width,o="",f="";for(let n of c2){n.x=e+n.depth*E;let y=Math.max(60,m$1-n.depth*E-20);n.label=T(It(n.node.text,!1,h$1,n.depth<2?t:r,y,n.depth<2?1:0),h$1,y),n.w=n.label.width+20,n.h=n.label.height+12,n.y=x,x+=n.h+12,w=Math.max(w,n.x-e+n.w);let C=n.depth<2;if(o+=`<g class="pele-node ${n.depth===0?"pele-ishikawa-head":n.depth===1?"pele-ishikawa-category":"pele-ishikawa-cause"}" data-id="${Tn(n.node.text)}">`+(C?`<rect x="${m(n.x)}" y="${m(n.y)}" width="${m(n.w)}" height="${m(n.h)}" rx="${n.depth===0?12:4}" fill="var(--_s)" stroke="var(--_b)"/>`:"")+Yt(n.label,n.x+n.w/2,n.y+n.h/2,` class="pele-label"${n.depth<2?' font-weight="var(--_hw)"':""}${n.depth>1?` font-size="${r}"`:""}`)+"</g>",n.parent>=0){let M=c2[n.parent],S=M.x+E/2;f+=`<path class="pele-edge" d="M${m(S)},${m(M.y+M.h)}V${m(n.y+n.h/2)}H${m(n.x)}" fill="none" stroke="var(--_b)"/>`}}let $=Math.ceil(w+2*e),I=Math.ceil(Math.max(e+s.height,x-12)+e),k=Yt(s,$/2,e+s.height/2,' class="pele-title" font-weight="var(--_tw)"')+f+o;return{svg:Yt$1("ishikawa",$,I,t,d,{},k),width:$,height:I,links:[]}}var Ze={type:"ishikawa",parse(i,d,t){let r=new D;return r.title=t,fe(i,r),r},render:xe};export{Ze as ishikawa};
|