@launchsecure/launch-kit 0.0.41 → 0.0.42

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.
Files changed (60) hide show
  1. package/dist/deck-client/assets/{_baseUniq-mvYvzeEJ.js → _baseUniq-BrhDuG3C.js} +1 -1
  2. package/dist/deck-client/assets/{arc-CX4ylnp2.js → arc-DXtPHMhw.js} +1 -1
  3. package/dist/deck-client/assets/{architectureDiagram-Q4EWVU46-BkR-5IRK.js → architectureDiagram-Q4EWVU46-Cs9IdLQQ.js} +1 -1
  4. package/dist/deck-client/assets/{blockDiagram-DXYQGD6D-DVNQht7c.js → blockDiagram-DXYQGD6D--wpvoBAt.js} +1 -1
  5. package/dist/deck-client/assets/{c4Diagram-AHTNJAMY-Cbq1rlG8.js → c4Diagram-AHTNJAMY-BNIKE8-Z.js} +1 -1
  6. package/dist/deck-client/assets/channel-Bb5wIjTD.js +1 -0
  7. package/dist/deck-client/assets/{chunk-4BX2VUAB-D58Co4lU.js → chunk-4BX2VUAB-Bz3EWmUo.js} +1 -1
  8. package/dist/deck-client/assets/{chunk-4TB4RGXK-BYvhTm3d.js → chunk-4TB4RGXK-D55BBvVZ.js} +1 -1
  9. package/dist/deck-client/assets/{chunk-55IACEB6-oWukUhYg.js → chunk-55IACEB6-BzjEcoTi.js} +1 -1
  10. package/dist/deck-client/assets/{chunk-EDXVE4YY-Cm58kVnZ.js → chunk-EDXVE4YY-CH1vs4Lu.js} +1 -1
  11. package/dist/deck-client/assets/{chunk-FMBD7UC4-Dg-i7kzi.js → chunk-FMBD7UC4-CVRnaGM0.js} +1 -1
  12. package/dist/deck-client/assets/{chunk-OYMX7WX6-C72wigPl.js → chunk-OYMX7WX6-BCTV_aEZ.js} +1 -1
  13. package/dist/deck-client/assets/{chunk-QZHKN3VN-CLgeuAKw.js → chunk-QZHKN3VN-BqM8r4ee.js} +1 -1
  14. package/dist/deck-client/assets/{chunk-YZCP3GAM-HDDlJ5oI.js → chunk-YZCP3GAM-Rhbb691A.js} +1 -1
  15. package/dist/deck-client/assets/classDiagram-6PBFFD2Q-CN-ZYMbT.js +1 -0
  16. package/dist/deck-client/assets/classDiagram-v2-HSJHXN6E-CN-ZYMbT.js +1 -0
  17. package/dist/deck-client/assets/clone-D6e7poKG.js +1 -0
  18. package/dist/deck-client/assets/{cose-bilkent-S5V4N54A-CUXQKg2M.js → cose-bilkent-S5V4N54A-fWyBR9Nn.js} +1 -1
  19. package/dist/deck-client/assets/{dagre-KV5264BT-C5M-fVDc.js → dagre-KV5264BT-Ds0Sqext.js} +1 -1
  20. package/dist/deck-client/assets/{diagram-5BDNPKRD-CcVsQ0S8.js → diagram-5BDNPKRD-BGz_X007.js} +1 -1
  21. package/dist/deck-client/assets/{diagram-G4DWMVQ6-DJswXyep.js → diagram-G4DWMVQ6-C78jeb-r.js} +1 -1
  22. package/dist/deck-client/assets/{diagram-MMDJMWI5-CGT76fm1.js → diagram-MMDJMWI5-BdoHW8mF.js} +1 -1
  23. package/dist/deck-client/assets/{diagram-TYMM5635-BBsYUNN6.js → diagram-TYMM5635-C8i9zc-U.js} +1 -1
  24. package/dist/deck-client/assets/{erDiagram-SMLLAGMA-DKWYEHQS.js → erDiagram-SMLLAGMA-DplAZ-yG.js} +1 -1
  25. package/dist/deck-client/assets/{flowDiagram-DWJPFMVM-DLuDYIKT.js → flowDiagram-DWJPFMVM-F3N9yTAB.js} +1 -1
  26. package/dist/deck-client/assets/{ganttDiagram-T4ZO3ILL-B19b6Qtj.js → ganttDiagram-T4ZO3ILL-DebdM4S5.js} +1 -1
  27. package/dist/deck-client/assets/{gitGraphDiagram-UUTBAWPF-BYLAfYVS.js → gitGraphDiagram-UUTBAWPF-htCk0oPz.js} +1 -1
  28. package/dist/deck-client/assets/{graph-CfzQUfPh.js → graph-Dtxc2PT4.js} +1 -1
  29. package/dist/deck-client/assets/{index-DlwdTgE_.js → index-CwAiam97.js} +2 -2
  30. package/dist/deck-client/assets/{infoDiagram-42DDH7IO-Dp3mUA9c.js → infoDiagram-42DDH7IO-gTxegviJ.js} +1 -1
  31. package/dist/deck-client/assets/{ishikawaDiagram-UXIWVN3A-BhrNX_jI.js → ishikawaDiagram-UXIWVN3A-DYSEsfUK.js} +1 -1
  32. package/dist/deck-client/assets/{journeyDiagram-VCZTEJTY-B5lJI492.js → journeyDiagram-VCZTEJTY-DgVc1q4D.js} +1 -1
  33. package/dist/deck-client/assets/{kanban-definition-6JOO6SKY-D9-lmhQf.js → kanban-definition-6JOO6SKY-DcOf3i9N.js} +1 -1
  34. package/dist/deck-client/assets/{layout-CfIe_Su8.js → layout-CHP9HIw4.js} +1 -1
  35. package/dist/deck-client/assets/{linear-09ZFRoh_.js → linear-XjVb7x4Q.js} +1 -1
  36. package/dist/deck-client/assets/{mermaid.core-BaQyIOvj.js → mermaid.core-bouKOnsR.js} +4 -4
  37. package/dist/deck-client/assets/{min-CYwCzYaL.js → min-Jl4GV9DB.js} +1 -1
  38. package/dist/deck-client/assets/{mindmap-definition-QFDTVHPH-CouFxf6C.js → mindmap-definition-QFDTVHPH-FXXf4cJx.js} +1 -1
  39. package/dist/deck-client/assets/{pieDiagram-DEJITSTG-DMB1ufC0.js → pieDiagram-DEJITSTG-Dl4plCTi.js} +1 -1
  40. package/dist/deck-client/assets/{quadrantDiagram-34T5L4WZ-CBiOKudN.js → quadrantDiagram-34T5L4WZ-BeOEeelg.js} +1 -1
  41. package/dist/deck-client/assets/{requirementDiagram-MS252O5E-BMc3GJkx.js → requirementDiagram-MS252O5E-CBh1jchM.js} +1 -1
  42. package/dist/deck-client/assets/{sankeyDiagram-XADWPNL6-CxACUncm.js → sankeyDiagram-XADWPNL6-BK6gG-ub.js} +1 -1
  43. package/dist/deck-client/assets/{sequenceDiagram-FGHM5R23-Ch-P3Mzc.js → sequenceDiagram-FGHM5R23-BtQwzsF5.js} +1 -1
  44. package/dist/deck-client/assets/{stateDiagram-FHFEXIEX-Cy8n7Yzk.js → stateDiagram-FHFEXIEX--kLQOi8R.js} +1 -1
  45. package/dist/deck-client/assets/stateDiagram-v2-QKLJ7IA2-CHEPjgB0.js +1 -0
  46. package/dist/deck-client/assets/{timeline-definition-GMOUNBTQ-C2V4sSkm.js → timeline-definition-GMOUNBTQ-CQ_-CLh7.js} +1 -1
  47. package/dist/deck-client/assets/{vennDiagram-DHZGUBPP-YOqt4VbE.js → vennDiagram-DHZGUBPP-DBhKYAFT.js} +1 -1
  48. package/dist/deck-client/assets/{wardley-RL74JXVD-Bxo5x40D.js → wardley-RL74JXVD-DLKe29q9.js} +1 -1
  49. package/dist/deck-client/assets/{wardleyDiagram-NUSXRM2D-DW9SOqbx.js → wardleyDiagram-NUSXRM2D-Brb8ezsV.js} +1 -1
  50. package/dist/deck-client/assets/{xychartDiagram-5P7HB3ND-D-rZvZOL.js → xychartDiagram-5P7HB3ND-LogZ0Az9.js} +1 -1
  51. package/dist/deck-client/index.html +1 -1
  52. package/dist/server/deck-mcp-entry.js +137 -2
  53. package/dist/server/deck-serve.js +93 -1
  54. package/dist/server/rover-entry.js +1 -1
  55. package/package.json +1 -1
  56. package/dist/deck-client/assets/channel-B9GC-CLn.js +0 -1
  57. package/dist/deck-client/assets/classDiagram-6PBFFD2Q-CFBvYQ9j.js +0 -1
  58. package/dist/deck-client/assets/classDiagram-v2-HSJHXN6E-CFBvYQ9j.js +0 -1
  59. package/dist/deck-client/assets/clone-n-WQlAGe.js +0 -1
  60. package/dist/deck-client/assets/stateDiagram-v2-QKLJ7IA2-C14VKCzi.js +0 -1
@@ -56,7 +56,7 @@ ${u.map((k,_)=>`${_+1}. ${k}`).join(`
56
56
  </head>
57
57
  <body>${e}</body>
58
58
  </html>
59
- `),o.close()},[e,t]),d.jsx("iframe",{ref:n,sandbox:"allow-same-origin",className:"w-full h-full border-0",title:"HTML Preview"})}const Hh="modulepreload",Vh=function(e){return"/"+e},Za={},Md=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),s=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));o=Promise.allSettled(n.map(a=>{if(a=Vh(a),a in Za)return;Za[a]=!0;const u=a.endsWith(".css"),p=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${p}`))return;const v=document.createElement("link");if(v.rel=u?"stylesheet":Hh,u||(v.as="script"),v.crossOrigin="",v.href=a,s&&v.setAttribute("nonce",s),document.head.appendChild(v),u)return new Promise((h,x)=>{v.addEventListener("load",h),v.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${a}`)))})}))}function l(i){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=i,window.dispatchEvent(s),!s.defaultPrevented)throw i}return o.then(i=>{for(const s of i||[])s.status==="rejected"&&l(s.reason);return t().catch(l)})},Ja=.1,eu=8,tu=32,Qh="'DM Sans', system-ui, sans-serif";function nu(e,t,n){return Math.min(n,Math.max(t,e))}let Pi=null,Rl=null;async function qh(){Rl||(Rl=Md(()=>import("./mermaid.core-BaQyIOvj.js").then(r=>r.bD),[]).then(r=>r.default));const e=await Rl,n=document.documentElement.classList.contains("dark")?"dark":"default";return Pi!==n&&(e.initialize({startOnLoad:!1,theme:n,securityLevel:"loose",fontFamily:Qh,suppressErrorRendering:!0}),Pi=n),e}function Kh({content:e,renderedSvg:t,onError:n,theme:r,version:o}){const l=C.useRef(null),i=C.useRef(null),s=C.useRef(null),[a,u]=C.useState(null),p=C.useRef({scale:1,tx:0,ty:0}),v=C.useRef({w:0,h:0}),h=C.useCallback(()=>{const f=s.current;if(!f)return;const{scale:c,tx:m,ty:g}=p.current;f.style.transform=`translate(${m}px, ${g}px) scale(${c})`},[]),x=C.useCallback(()=>{const f=i.current,{w:c,h:m}=v.current;if(!f||!c||!m)return;const g=nu(Math.min((f.clientWidth-tu)/c,(f.clientHeight-tu)/m,1),Ja,eu);p.current={scale:g,tx:(f.clientWidth-c*g)/2,ty:(f.clientHeight-m*g)/2},h()},[h]),y=C.useCallback((f,c,m)=>{const g=nu(f,Ja,eu),{scale:w,tx:S,ty:b}=p.current,N=(c-S)/w,L=(m-b)/w;p.current={scale:g,tx:c-N*g,ty:m-L*g},h()},[h]),k=C.useCallback(f=>{const c=i.current;c&&y(p.current.scale*f,c.clientWidth/2,c.clientHeight/2)},[y]);C.useEffect(()=>{u(null)},[e,t,o]),C.useEffect(()=>{Pi=null},[r]);const _=C.useCallback(()=>{const f=l.current;if(!f)return;const c=f.querySelector("svg");if(!c)return;const m=(c.getAttribute("viewBox")||"").split(/[\s,]+/).map(Number);let g=m[2],w=m[3];if(!g||!w){const S=c.getBoundingClientRect();g=S.width,w=S.height}v.current={w:g,h:w},c.style.maxWidth="none",c.style.width=`${g}px`,c.style.height=`${w}px`,x()},[x]);return C.useEffect(()=>{const f=l.current;if(!f)return;if(t&&t.trim()){f.innerHTML=t,_();return}if(!e.trim())return;let c=!1;const m=`mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;return qh().then(g=>g.parse(e.trim()).then(()=>g.render(m,e.trim()))).then(({svg:g})=>{if(c)return;const w=l.current;w&&(w.innerHTML=g,_())}).catch(g=>{var S;if(c)return;const w=String(g);u(w),l.current&&(l.current.innerHTML=""),(S=document.getElementById(m))==null||S.remove(),n==null||n(w,e.trim())}),()=>{c=!0}},[e,t,r,o,_,n]),C.useEffect(()=>{const f=i.current;if(!f)return;const c=R=>{R.preventDefault();const K=f.getBoundingClientRect(),me=R.deltaY<0?1.1:1/1.1;y(p.current.scale*me,R.clientX-K.left,R.clientY-K.top)};let m=!1,g=-1,w=0,S=0;const b=R=>{m=!0,g=R.pointerId,w=R.clientX,S=R.clientY;try{f.setPointerCapture(R.pointerId)}catch{}f.style.cursor="grabbing"},N=R=>{!m||R.pointerId!==g||(p.current.tx+=R.clientX-w,p.current.ty+=R.clientY-S,w=R.clientX,S=R.clientY,h())},L=R=>{if(!(R.pointerId!==g&&g!==-1)){m=!1,g=-1,f.style.cursor="grab";try{f.releasePointerCapture(R.pointerId)}catch{}}};return f.addEventListener("wheel",c,{passive:!1}),f.addEventListener("pointerdown",b),f.addEventListener("pointermove",N),f.addEventListener("pointerup",L),f.addEventListener("pointerleave",L),()=>{f.removeEventListener("wheel",c),f.removeEventListener("pointerdown",b),f.removeEventListener("pointermove",N),f.removeEventListener("pointerup",L),f.removeEventListener("pointerleave",L)}},[y,h]),C.useEffect(()=>{const f=i.current;if(!f||typeof ResizeObserver>"u")return;const c=new ResizeObserver(()=>x());return c.observe(f),()=>c.disconnect()},[x]),d.jsxs("div",{className:"relative h-full w-full min-h-0 flex-1",children:[d.jsx("div",{ref:i,className:`mermaid-viewport absolute inset-0 overflow-hidden ${a?"hidden":""}`,style:{cursor:"grab",touchAction:"none"},children:d.jsx("div",{ref:s,className:"mermaid-pan",style:{transformOrigin:"0 0",willChange:"transform"},children:d.jsx("div",{ref:l,className:"mermaid-container"})})}),!a&&d.jsx(Yh,{onIn:()=>k(1.2),onOut:()=>k(1/1.2),onReset:x}),a&&d.jsx("div",{className:"flex h-full items-center justify-center",children:d.jsxs("div",{className:"text-center text-muted-foreground",children:[d.jsx("p",{className:"text-sm font-medium",children:"Diagram syntax error"}),d.jsx("p",{className:"mt-1 text-xs",children:a})]})})]})}function Yh({onIn:e,onOut:t,onReset:n}){const r="flex h-9 w-9 items-center justify-center border border-border bg-background/80 text-muted-foreground shadow-sm backdrop-blur transition-colors hover:border-primary hover:text-foreground";return d.jsxs("div",{className:"absolute right-3 top-3 z-10 flex flex-col overflow-hidden rounded-lg shadow-lg",children:[d.jsx("button",{onClick:e,className:`${r} rounded-t-lg border-b-0`,"aria-label":"Zoom in",title:"Zoom in",children:d.jsxs("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",children:[d.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),d.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),d.jsx("button",{onClick:t,className:r,"aria-label":"Zoom out",title:"Zoom out",children:d.jsx("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",children:d.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})}),d.jsx("button",{onClick:n,className:`${r} rounded-b-lg border-t-0`,"aria-label":"Reset zoom (fit)",title:"Fit to screen",children:d.jsxs("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3"}),d.jsx("path",{d:"M21 8V5a2 2 0 0 0-2-2h-3"}),d.jsx("path",{d:"M3 16v3a2 2 0 0 0 2 2h3"}),d.jsx("path",{d:"M16 21h3a2 2 0 0 0 2-2v-3"})]})})]})}function Rs(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var on=Rs();function $d(e){on=e}var ir={exec:()=>null};function W(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(o,l)=>{let i=typeof l=="string"?l:l.source;return i=i.replace(ke.caret,"$1"),n=n.replace(o,i),r},getRegex:()=>new RegExp(n,t)};return r}var ke={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},Gh=/^(?:[ \t]*(?:\n|$))+/,Xh=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Zh=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Rr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Jh=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ps=/(?:[*+-]|\d{1,9}[.)])/,Id=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Dd=W(Id).replace(/bull/g,Ps).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),em=W(Id).replace(/bull/g,Ps).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),zs=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,tm=/^[^\n]+/,As=/(?!\s*\])(?:\\.|[^\[\]\\])+/,nm=W(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",As).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),rm=W(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ps).getRegex(),rl="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ms=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,om=W("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ms).replace("tag",rl).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Od=W(zs).replace("hr",Rr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rl).getRegex(),lm=W(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Od).getRegex(),$s={blockquote:lm,code:Xh,def:nm,fences:Zh,heading:Jh,hr:Rr,html:om,lheading:Dd,list:rm,newline:Gh,paragraph:Od,table:ir,text:tm},ru=W("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Rr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rl).getRegex(),im={...$s,lheading:em,table:ru,paragraph:W(zs).replace("hr",Rr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ru).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rl).getRegex()},sm={...$s,html:W(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ms).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ir,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:W(zs).replace("hr",Rr).replace("heading",` *#{1,6} *[^
59
+ `),o.close()},[e,t]),d.jsx("iframe",{ref:n,sandbox:"allow-same-origin",className:"w-full h-full border-0",title:"HTML Preview"})}const Hh="modulepreload",Vh=function(e){return"/"+e},Za={},Md=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),s=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));o=Promise.allSettled(n.map(a=>{if(a=Vh(a),a in Za)return;Za[a]=!0;const u=a.endsWith(".css"),p=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${p}`))return;const v=document.createElement("link");if(v.rel=u?"stylesheet":Hh,u||(v.as="script"),v.crossOrigin="",v.href=a,s&&v.setAttribute("nonce",s),document.head.appendChild(v),u)return new Promise((h,x)=>{v.addEventListener("load",h),v.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${a}`)))})}))}function l(i){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=i,window.dispatchEvent(s),!s.defaultPrevented)throw i}return o.then(i=>{for(const s of i||[])s.status==="rejected"&&l(s.reason);return t().catch(l)})},Ja=.1,eu=8,tu=32,Qh="'DM Sans', system-ui, sans-serif";function nu(e,t,n){return Math.min(n,Math.max(t,e))}let Pi=null,Rl=null;async function qh(){Rl||(Rl=Md(()=>import("./mermaid.core-bouKOnsR.js").then(r=>r.bD),[]).then(r=>r.default));const e=await Rl,n=document.documentElement.classList.contains("dark")?"dark":"default";return Pi!==n&&(e.initialize({startOnLoad:!1,theme:n,securityLevel:"loose",fontFamily:Qh,suppressErrorRendering:!0}),Pi=n),e}function Kh({content:e,renderedSvg:t,onError:n,theme:r,version:o}){const l=C.useRef(null),i=C.useRef(null),s=C.useRef(null),[a,u]=C.useState(null),p=C.useRef({scale:1,tx:0,ty:0}),v=C.useRef({w:0,h:0}),h=C.useCallback(()=>{const f=s.current;if(!f)return;const{scale:c,tx:m,ty:g}=p.current;f.style.transform=`translate(${m}px, ${g}px) scale(${c})`},[]),x=C.useCallback(()=>{const f=i.current,{w:c,h:m}=v.current;if(!f||!c||!m)return;const g=nu(Math.min((f.clientWidth-tu)/c,(f.clientHeight-tu)/m,1),Ja,eu);p.current={scale:g,tx:(f.clientWidth-c*g)/2,ty:(f.clientHeight-m*g)/2},h()},[h]),y=C.useCallback((f,c,m)=>{const g=nu(f,Ja,eu),{scale:w,tx:S,ty:b}=p.current,N=(c-S)/w,L=(m-b)/w;p.current={scale:g,tx:c-N*g,ty:m-L*g},h()},[h]),k=C.useCallback(f=>{const c=i.current;c&&y(p.current.scale*f,c.clientWidth/2,c.clientHeight/2)},[y]);C.useEffect(()=>{u(null)},[e,t,o]),C.useEffect(()=>{Pi=null},[r]);const _=C.useCallback(()=>{const f=l.current;if(!f)return;const c=f.querySelector("svg");if(!c)return;const m=(c.getAttribute("viewBox")||"").split(/[\s,]+/).map(Number);let g=m[2],w=m[3];if(!g||!w){const S=c.getBoundingClientRect();g=S.width,w=S.height}v.current={w:g,h:w},c.style.maxWidth="none",c.style.width=`${g}px`,c.style.height=`${w}px`,x()},[x]);return C.useEffect(()=>{const f=l.current;if(!f)return;if(t&&t.trim()){f.innerHTML=t,_();return}if(!e.trim())return;let c=!1;const m=`mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;return qh().then(g=>g.parse(e.trim()).then(()=>g.render(m,e.trim()))).then(({svg:g})=>{if(c)return;const w=l.current;w&&(w.innerHTML=g,_())}).catch(g=>{var S;if(c)return;const w=String(g);u(w),l.current&&(l.current.innerHTML=""),(S=document.getElementById(m))==null||S.remove(),n==null||n(w,e.trim())}),()=>{c=!0}},[e,t,r,o,_,n]),C.useEffect(()=>{const f=i.current;if(!f)return;const c=R=>{R.preventDefault();const K=f.getBoundingClientRect(),me=R.deltaY<0?1.1:1/1.1;y(p.current.scale*me,R.clientX-K.left,R.clientY-K.top)};let m=!1,g=-1,w=0,S=0;const b=R=>{m=!0,g=R.pointerId,w=R.clientX,S=R.clientY;try{f.setPointerCapture(R.pointerId)}catch{}f.style.cursor="grabbing"},N=R=>{!m||R.pointerId!==g||(p.current.tx+=R.clientX-w,p.current.ty+=R.clientY-S,w=R.clientX,S=R.clientY,h())},L=R=>{if(!(R.pointerId!==g&&g!==-1)){m=!1,g=-1,f.style.cursor="grab";try{f.releasePointerCapture(R.pointerId)}catch{}}};return f.addEventListener("wheel",c,{passive:!1}),f.addEventListener("pointerdown",b),f.addEventListener("pointermove",N),f.addEventListener("pointerup",L),f.addEventListener("pointerleave",L),()=>{f.removeEventListener("wheel",c),f.removeEventListener("pointerdown",b),f.removeEventListener("pointermove",N),f.removeEventListener("pointerup",L),f.removeEventListener("pointerleave",L)}},[y,h]),C.useEffect(()=>{const f=i.current;if(!f||typeof ResizeObserver>"u")return;const c=new ResizeObserver(()=>x());return c.observe(f),()=>c.disconnect()},[x]),d.jsxs("div",{className:"relative h-full w-full min-h-0 flex-1",children:[d.jsx("div",{ref:i,className:`mermaid-viewport absolute inset-0 overflow-hidden ${a?"hidden":""}`,style:{cursor:"grab",touchAction:"none"},children:d.jsx("div",{ref:s,className:"mermaid-pan",style:{transformOrigin:"0 0",willChange:"transform"},children:d.jsx("div",{ref:l,className:"mermaid-container"})})}),!a&&d.jsx(Yh,{onIn:()=>k(1.2),onOut:()=>k(1/1.2),onReset:x}),a&&d.jsx("div",{className:"flex h-full items-center justify-center",children:d.jsxs("div",{className:"text-center text-muted-foreground",children:[d.jsx("p",{className:"text-sm font-medium",children:"Diagram syntax error"}),d.jsx("p",{className:"mt-1 text-xs",children:a})]})})]})}function Yh({onIn:e,onOut:t,onReset:n}){const r="flex h-9 w-9 items-center justify-center border border-border bg-background/80 text-muted-foreground shadow-sm backdrop-blur transition-colors hover:border-primary hover:text-foreground";return d.jsxs("div",{className:"absolute right-3 top-3 z-10 flex flex-col overflow-hidden rounded-lg shadow-lg",children:[d.jsx("button",{onClick:e,className:`${r} rounded-t-lg border-b-0`,"aria-label":"Zoom in",title:"Zoom in",children:d.jsxs("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",children:[d.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),d.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),d.jsx("button",{onClick:t,className:r,"aria-label":"Zoom out",title:"Zoom out",children:d.jsx("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",children:d.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})}),d.jsx("button",{onClick:n,className:`${r} rounded-b-lg border-t-0`,"aria-label":"Reset zoom (fit)",title:"Fit to screen",children:d.jsxs("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3"}),d.jsx("path",{d:"M21 8V5a2 2 0 0 0-2-2h-3"}),d.jsx("path",{d:"M3 16v3a2 2 0 0 0 2 2h3"}),d.jsx("path",{d:"M16 21h3a2 2 0 0 0 2-2v-3"})]})})]})}function Rs(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var on=Rs();function $d(e){on=e}var ir={exec:()=>null};function W(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(o,l)=>{let i=typeof l=="string"?l:l.source;return i=i.replace(ke.caret,"$1"),n=n.replace(o,i),r},getRegex:()=>new RegExp(n,t)};return r}var ke={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},Gh=/^(?:[ \t]*(?:\n|$))+/,Xh=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Zh=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Rr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Jh=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ps=/(?:[*+-]|\d{1,9}[.)])/,Id=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Dd=W(Id).replace(/bull/g,Ps).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),em=W(Id).replace(/bull/g,Ps).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),zs=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,tm=/^[^\n]+/,As=/(?!\s*\])(?:\\.|[^\[\]\\])+/,nm=W(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",As).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),rm=W(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ps).getRegex(),rl="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ms=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,om=W("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ms).replace("tag",rl).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Od=W(zs).replace("hr",Rr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rl).getRegex(),lm=W(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Od).getRegex(),$s={blockquote:lm,code:Xh,def:nm,fences:Zh,heading:Jh,hr:Rr,html:om,lheading:Dd,list:rm,newline:Gh,paragraph:Od,table:ir,text:tm},ru=W("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Rr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rl).getRegex(),im={...$s,lheading:em,table:ru,paragraph:W(zs).replace("hr",Rr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ru).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rl).getRegex()},sm={...$s,html:W(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ms).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ir,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:W(zs).replace("hr",Rr).replace("heading",` *#{1,6} *[^
60
60
  ]`).replace("lheading",Dd).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},am=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,um=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Bd=/^( {2,}|\\)\n(?!\s*$)/,cm=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ol=/[\p{P}\p{S}]/u,Is=/[\s\p{P}\p{S}]/u,Fd=/[^\s\p{P}\p{S}]/u,dm=W(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Is).getRegex(),Ud=/(?!~)[\p{P}\p{S}]/u,fm=/(?!~)[\s\p{P}\p{S}]/u,pm=/(?:[^\s\p{P}\p{S}]|~)/u,hm=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Wd=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,mm=W(Wd,"u").replace(/punct/g,ol).getRegex(),gm=W(Wd,"u").replace(/punct/g,Ud).getRegex(),Hd="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",vm=W(Hd,"gu").replace(/notPunctSpace/g,Fd).replace(/punctSpace/g,Is).replace(/punct/g,ol).getRegex(),ym=W(Hd,"gu").replace(/notPunctSpace/g,pm).replace(/punctSpace/g,fm).replace(/punct/g,Ud).getRegex(),xm=W("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Fd).replace(/punctSpace/g,Is).replace(/punct/g,ol).getRegex(),wm=W(/\\(punct)/,"gu").replace(/punct/g,ol).getRegex(),km=W(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),bm=W(Ms).replace("(?:-->|$)","-->").getRegex(),Sm=W("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",bm).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Io=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Em=W(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Io).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Vd=W(/^!?\[(label)\]\[(ref)\]/).replace("label",Io).replace("ref",As).getRegex(),Qd=W(/^!?\[(ref)\](?:\[\])?/).replace("ref",As).getRegex(),Cm=W("reflink|nolink(?!\\()","g").replace("reflink",Vd).replace("nolink",Qd).getRegex(),Ds={_backpedal:ir,anyPunctuation:wm,autolink:km,blockSkip:hm,br:Bd,code:um,del:ir,emStrongLDelim:mm,emStrongRDelimAst:vm,emStrongRDelimUnd:xm,escape:am,link:Em,nolink:Qd,punctuation:dm,reflink:Vd,reflinkSearch:Cm,tag:Sm,text:cm,url:ir},Nm={...Ds,link:W(/^!?\[(label)\]\((.*?)\)/).replace("label",Io).getRegex(),reflink:W(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Io).getRegex()},zi={...Ds,emStrongRDelimAst:ym,emStrongLDelim:gm,url:W(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},jm={...zi,br:W(Bd).replace("{2,}","*").getRegex(),text:W(zi.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Yr={normal:$s,gfm:im,pedantic:sm},Hn={normal:Ds,gfm:zi,breaks:jm,pedantic:Nm},Lm={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ou=e=>Lm[e];function lt(e,t){if(t){if(ke.escapeTest.test(e))return e.replace(ke.escapeReplace,ou)}else if(ke.escapeTestNoEncode.test(e))return e.replace(ke.escapeReplaceNoEncode,ou);return e}function lu(e){try{e=encodeURI(e).replace(ke.percentDecode,"%")}catch{return null}return e}function iu(e,t){var l;const n=e.replace(ke.findPipe,(i,s,a)=>{let u=!1,p=s;for(;--p>=0&&a[p]==="\\";)u=!u;return u?"|":" |"}),r=n.split(ke.splitPipe);let o=0;if(r[0].trim()||r.shift(),r.length>0&&!((l=r.at(-1))!=null&&l.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(ke.slashPipe,"|");return r}function Vn(e,t,n){const r=e.length;if(r===0)return"";let o=0;for(;o<r&&e.charAt(r-o-1)===t;)o++;return e.slice(0,r-o)}function _m(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function su(e,t,n,r,o){const l=t.href,i=t.title||null,s=e[1].replace(o.other.outputLinkReplace,"$1");r.state.inLink=!0;const a={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:l,title:i,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,a}function Tm(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(r===null)return t;const o=r[1];return t.split(`
61
61
  `).map(l=>{const i=l.match(n.other.beginningSpace);if(i===null)return l;const[s]=i;return s.length>=o.length?l.slice(o.length):l}).join(`
62
62
  `)}var Do=class{constructor(e){Q(this,"options");Q(this,"rules");Q(this,"lexer");this.options=e||on}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Vn(n,`
@@ -889,4 +889,4 @@ dialog.beacon-dialog::backdrop {
889
889
  <div class="beacon-pin-popover-actions">
890
890
  <button type="button" class="beacon-btn primary" data-action="save">${Xg} Save</button>
891
891
  </div>
892
- `;const r=240,o=160,l=Math.min(Math.max(8,e.anchor.x),window.innerWidth-r-8),i=Math.min(Math.max(8,e.anchor.y+12),window.innerHeight-o-8);n.style.left=`${l}px`,n.style.top=`${i}px`,document.body.appendChild(n);const s=n.querySelector("textarea");s.focus();function a(p){document.removeEventListener("keydown",u,!0),n.remove(),t(p)}function u(p){p.key==="Escape"&&(p.preventDefault(),p.stopPropagation(),a({cancelled:"all"}))}document.addEventListener("keydown",u,!0),n.addEventListener("click",p=>{var x;const h=(x=p.target.closest("[data-action]"))==null?void 0:x.getAttribute("data-action");if(h&&(p.stopPropagation(),h==="cancel"&&a({cancelled:"pin"}),h==="save")){const y=s.value.trim();a({...y?{note:y}:{},cancelled:!1})}}),s.addEventListener("keydown",p=>{if(p.key==="Enter"&&(p.metaKey||p.ctrlKey)){p.preventDefault();const v=s.value.trim();a({...v?{note:v}:{},cancelled:!1})}})})}const Jg="#0ea5e9";function ev(e,t){return/^#[0-9a-fA-F]{6}$/.test(e)?`${e}${t}`:e}function tv(e){const{shadowRoot:t,onHover:n}=e,r=e.accent??Jg,o=ev(r,"14"),l=document.createElement("div");l.style.cssText=["position: fixed","pointer-events: none","z-index: 2147483646",`border: 2px solid ${r}`,`background: ${o}`,"transition: all 60ms ease-out","box-sizing: border-box","border-radius: 2px"].join("; "),document.body.appendChild(l);const i=document.createElement("div");i.style.cssText=["position: fixed","pointer-events: none","z-index: 2147483647","background: #0f172a","color: #fff","font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace","padding: 3px 6px","border-radius: 3px","max-width: 280px","overflow: hidden","text-overflow: ellipsis","white-space: nowrap"].join("; "),document.body.appendChild(i);const s=document.body.style.cursor;document.body.style.cursor="crosshair";let a=!1,u=()=>{};const p=new Promise(g=>{u=g});function v(g){if(!g||!(g instanceof Node))return!1;let w=g;for(;w;){if(w===t||w===t.host)return!0;w=w.parentNode??w.host??null}return!1}function h(g){return g.tagName.includes("-")}function x(g,w){var b,N;l.style.display="none",i.style.display="none";const S=document.elementsFromPoint(g,w);l.style.display="block",i.style.display="block";for(const L of S){if(v(L))continue;let R=L,K=16;for(;R.shadowRoot&&!h(R)&&K-- >0;){const ae=(((N=(b=R.shadowRoot).elementsFromPoint)==null?void 0:N.call(b,g,w))??[]).find(Fe=>!v(Fe)&&Fe!==R);if(!ae)break;R=ae}return R}return null}function y(g){const w=g.getBoundingClientRect();l.style.left=`${w.left}px`,l.style.top=`${w.top}px`,l.style.width=`${w.width}px`,l.style.height=`${w.height}px`;const S=g.tagName.toLowerCase(),b=g.classList.length>0?"."+Array.from(g.classList).slice(0,2).join("."):"";i.textContent=S+b;const N=w.top-22;i.style.left=`${w.left}px`,i.style.top=`${N>=0?N:w.bottom+4}px`}function k(g){const w=x(g.clientX,g.clientY);w?(y(w),n==null||n(w)):(l.style.display="none",i.style.display="none",n==null||n(null))}function _(g){if(g.button!==0)return;g.preventDefault(),g.stopPropagation();const w=x(g.clientX,g.clientY);w&&m(w)}function f(g){g.preventDefault(),g.stopPropagation()}function c(g){g.key==="Escape"&&(g.preventDefault(),m(null))}function m(g){a||(a=!0,document.removeEventListener("mousemove",k,!0),document.removeEventListener("pointerdown",_,!0),document.removeEventListener("click",f,!0),document.removeEventListener("mouseup",f,!0),document.removeEventListener("keydown",c,!0),l.remove(),i.remove(),document.body.style.cursor=s,u(g))}return document.addEventListener("mousemove",k,!0),document.addEventListener("pointerdown",_,!0),document.addEventListener("click",f,!0),document.addEventListener("mouseup",f,!0),document.addEventListener("keydown",c,!0),{cancel:()=>m(null),promise:p}}let Il=null;async function nv(){return Il||(Il=await Md(()=>import("./index-6sdqbm2o.js"),[])),Il}const co="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkAAIAAAoAAv/lxKUAAAAASUVORK5CYII=";function yu(e,t){if(!e||e.startsWith("data:")||e.startsWith("blob:")||e.startsWith("/")||e.startsWith("#"))return!0;try{if(new URL(e,window.location.href).origin===window.location.origin)return!0}catch{return!1}return t==="anonymous"||t==="use-credentials"}function rv(){const e=[],t=[];return document.querySelectorAll("img").forEach(n=>{yu(n.src,n.crossOrigin)||(e.push({el:n,src:n.src}),n.src=co)}),document.querySelectorAll("image").forEach(n=>{const r=n,o=r.getAttribute("href"),l=r.getAttributeNS("http://www.w3.org/1999/xlink","href"),i=o||l||"";i&&!yu(i)&&(t.push({el:r,href:o,xlink:l}),o!==null&&r.setAttribute("href",co),l!==null&&r.setAttributeNS("http://www.w3.org/1999/xlink","href",co))}),()=>{for(const{el:n,src:r}of e)n.src=r;for(const{el:n,href:r,xlink:o}of t)r!==null&&n.setAttribute("href",r),o!==null&&n.setAttributeNS("http://www.w3.org/1999/xlink","href",o)}}function ov(){const e=[];document.querySelectorAll("*").forEach(l=>{const i=getComputedStyle(l),s=(i.overflowY==="auto"||i.overflowY==="scroll")&&l.scrollHeight>l.clientHeight,a=(i.overflowX==="auto"||i.overflowX==="scroll")&&l.scrollWidth>l.clientWidth;(s||a)&&e.push(l)});const t=window.scrollX,n=window.scrollY,r=e.map(l=>({el:l,scrollLeft:l.scrollLeft,scrollTop:l.scrollTop})),o=new Map;for(const l of e){let i=l;for(;i&&i!==document.documentElement.parentElement;)o.has(i)||o.set(i,i.style.cssText),i=i.parentElement}for(const l of o.keys())l.style.setProperty("overflow","visible","important"),l.style.setProperty("overflow-x","visible","important"),l.style.setProperty("overflow-y","visible","important"),l.style.setProperty("max-height","none","important"),l.style.setProperty("height","auto","important"),l.style.setProperty("min-height","0","important");return()=>{for(const[l,i]of o)l.style.cssText=i;for(const{el:l,scrollLeft:i,scrollTop:s}of r)l.scrollLeft=i,l.scrollTop=s;window.scrollTo(t,n)}}function lv(){const e=document.createElement("style");return e.setAttribute("data-beacon-capture",""),e.textContent="*,*::before,*::after{animation:none !important;transition:none !important;}",(document.head??document.documentElement).appendChild(e),()=>{e.remove()}}let xu=Promise.resolve();async function Zd(e={}){const t=xu;let n;xu=new Promise(r=>{n=r});try{return await t,await iv(e,n)}catch(r){throw n(),r}}async function iv(e,t){const{quality:n=.7,pixelRatio:r=Math.min(window.devicePixelRatio||1,2),excludeShadowRoot:o,excludeHosts:l,fullPage:i=!0}=e,s=await nv(),a=o||l!=null&&l.length?y=>{let k=y;for(;k;){if(o&&k===o.host||l&&k instanceof Element&&l.includes(k)||k instanceof Element&&k.classList.contains("beacon-no-capture"))return!1;k=k.parentNode}return!0}:void 0,u=rv(),p=i?ov():()=>{},v=lv();let h=!1;const x=()=>{if(!h){h=!0;try{v()}finally{try{p()}finally{try{u()}finally{t()}}}}};try{i&&await new Promise(c=>requestAnimationFrame(()=>c()));const y=document.documentElement,k=i?Math.max(y.scrollWidth,window.innerWidth):window.innerWidth,_=i?Math.max(y.scrollHeight,window.innerHeight):window.innerHeight;return{dataUrl:await s.toJpeg(y,{quality:n,pixelRatio:r,cacheBust:!0,...a?{filter:a}:{},imagePlaceholder:co,width:k,height:_,style:{transform:"none"}}),width:k,height:_,pixelRatio:r,dispose:x}}catch(y){throw x(),y}}let Bs=null;function sv(e){Bs=e}function av(){return Bs}function sn(){Bs=null}const wu="http://www.w3.org/2000/svg";function uv(){const e=document.createElementNS(wu,"svg");e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round"),e.setAttribute("aria-hidden","true");const t=["M3 6h18","M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6","M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"];for(const n of t){const r=document.createElementNS(wu,"path");r.setAttribute("d",n),e.appendChild(r)}return e}function cv(e={}){const t=e.maxPins??20;let n=[],r=new WeakMap,o=null,l=0,i=null,s=null,a=null,u=null;function p(){n=[],r=new WeakMap,o=null,l+=1,sn(),_(),f()}function v(){const c=document.querySelector("launch-kit-beacon");return(c==null?void 0:c.shadowRoot)??null}function h(){if(typeof window>"u")return e.accent??"#0ea5e9";if(e.accent)return e.accent;const c=document.querySelector("launch-kit-beacon");return c&&getComputedStyle(c).getPropertyValue("--beacon-accent").trim()||"#0ea5e9"}async function x(c){const m=v();if(!m)return;const g=h(),w=await c.requestMode("pickElement"),S=Yg({accent:g});for(const b of n){const N=r.get(b);N&&S.addPin(b.number,{target:N,selector:b.selector,fallbackRect:b.boundingRect})}try{let b=!0;for(;b&&!(n.length>=t);){const L=await tv({shadowRoot:m,accent:g}).promise;if(!L)break;const R=L.getBoundingClientRect(),K=await Zg({anchor:{x:R.left,y:R.bottom},pinNumber:n.length+1});if(K.cancelled==="all"){b=!1;break}if(K.cancelled==="pin")continue;const me=Bg(L),ae={number:n.length+1,...me,...K.note?{note:K.note}:{}};n.push(ae),r.set(ae,L),S.addPin(ae.number,{target:L,selector:me.selector,fallbackRect:me.boundingRect})}n.length>0?(S.setLoading("Capturing screenshot…"),await new Promise(N=>requestAnimationFrame(()=>N())),await y()):(o=null,sn())}finally{S.destroy(),w()}_(),f()}async function y(){const c=++l;if(n.length===0){o=null,sn(),f();return}const m=h();try{const g=Array.from(document.querySelectorAll("launch-kit-beacon")),w=await Zd({excludeHosts:g});try{if(c!==l)return;const S=n.map(L=>({number:L.number,selector:L.selector,boundingRect:L.boundingRect,...r.get(L)?{liveElement:r.get(L)}:{}})),b={w:w.width,h:w.height,dpr:w.pixelRatio},N=await Xd(w.dataUrl,S,b,m);if(c!==l)return;o=N,sv({dataUrl:N,mime:"image/jpeg"})}finally{w.dispose()}}catch{if(c!==l)return;o=null,sn()}c===l&&f()}function k(c){const m=n.findIndex(g=>g.number===c);m!==-1&&(n.splice(m,1),n.forEach((g,w)=>{g.number=w+1}),o=null,sn(),_(),f(),y())}function _(){if(i&&(i.textContent=`Pins (${n.length})`,i.style.display=n.length===0?"none":""),u&&(u.textContent=n.length===0?"Annotate elements":"Add another pin"),!!s){s.innerHTML="",s.style.display=n.length===0?"none":"";for(const c of n){const m=document.createElement("div");m.className="beacon-pin-item",m.dataset.pin=String(c.number);const g=document.createElement("span");g.className="beacon-pin-num",g.textContent=String(c.number);const w=document.createElement("div");w.className="beacon-pin-meta";const S=document.createElement("div");S.className="beacon-pin-selector",S.title=c.selector,S.textContent=c.selector||c.tagName;const b=document.createElement("input");b.type="text",b.className="beacon-pin-note-input",b.placeholder="Add a note (optional)",b.value=c.note??"",b.addEventListener("input",()=>{b.value.trim()?c.note=b.value:delete c.note}),w.appendChild(S),w.appendChild(b);const N=document.createElement("button");N.type="button",N.className="beacon-icon-btn",N.setAttribute("aria-label",`Remove pin ${c.number}`),N.appendChild(uv()),N.addEventListener("click",()=>k(c.number)),m.appendChild(g),m.appendChild(w),m.appendChild(N),s.appendChild(m)}}}function f(){a&&(o?(a.src=o,a.style.display="block"):(a.removeAttribute("src"),a.style.display="none"))}return{name:"domEle",setupOnce(c){return c.on("close",()=>p())},form(c){return{render:m=>(i=document.createElement("div"),i.className="beacon-pin-list-header",m.appendChild(i),s=document.createElement("div"),s.className="beacon-pin-list",m.appendChild(s),u=document.createElement("button"),u.type="button",u.className="beacon-btn secondary beacon-pin-annotate",u.addEventListener("click",()=>{x(c)}),m.appendChild(u),a=document.createElement("img"),a.className="beacon-thumb",a.alt="Annotated screenshot preview",a.style.display="none",m.appendChild(a),_(),f(),()=>{i=null,s=null,a=null,u=null})}},capture(){return n.length===0?null:{pins:n}}}}function dv(e){return!!e&&typeof e=="object"&&!("v"in e)&&"error"in e}function fv(e={}){return{name:"domSS",async capture(t){const n=av();if(n)return{dataUrl:n.dataUrl,mime:n.mime};const r=await t.requestMode("hide");try{await new Promise(i=>requestAnimationFrame(()=>i()));const o=Array.from(document.querySelectorAll("launch-kit-beacon")),l=await Zd({quality:e.quality,pixelRatio:e.pixelRatio,excludeHosts:o});try{const i=t.captured("domEle"),s=pv(i),a={w:l.width,h:l.height,dpr:l.pixelRatio},u=e.accent??hv();return{dataUrl:s.length>0?await Xd(l.dataUrl,s,a,u):l.dataUrl,mime:"image/jpeg"}}finally{l.dispose()}}finally{r()}}}}function pv(e){if(!e||dv(e))return[];const t=e.pins;return Array.isArray(t)?t.filter(n=>!!n&&typeof n=="object").map(n=>({number:Number(n.number)||0,selector:typeof n.selector=="string"?n.selector:void 0,boundingRect:n.boundingRect??{x:0,y:0,w:0,h:0}})):[]}function hv(){if(typeof window>"u")return"#0ea5e9";const e=document.querySelector("launch-kit-beacon");return e&&getComputedStyle(e).getPropertyValue("--beacon-accent").trim()||"#0ea5e9"}let Ie=null;const Fs={"plugin:error":new Set,"submit:success":new Set,"submit:error":new Set,ready:new Set};function mv(e){if(typeof window>"u")return;if(!e.endpoint)throw new Error("init: endpoint is required");Gd(),ef();const t={...yg(),...e.labels??{}},n=new AbortController,r=xv(e),o=e.position??"bottom-right",l=e.theme??"auto";rg(),yv(e,o,l);const i=document.querySelector(Cr);if(!i)throw new Error("init: failed to acquire <launch-kit-beacon> host");if(!i.shadow)throw new Error("init: host element shadow root not initialized");const s=xg(i.shadow),a=new vg(t,["bug","idea","ux","a11y"],{onSubmit:()=>{kv()},onClose:v=>{Bo("close",{}),v==="user"&&nf()}});i.shadow.appendChild(a.root),i.classList.add("beacon-no-capture");const u=ug(r),p={endpoint:e.endpoint,headers:e.headers,context:e.context,credentials:e.credentials??"omit",plugins:r,registry:u,dialog:a,overlayHost:s,hostElement:i,initAbort:n,labels:t,debug:!!e.debug||wv(),healthIndicator:e.healthIndicator??"never",position:o,theme:l,currentSubmit:null,capturedEntries:{},formValues:{},lifecycleHandlers:{open:new Set,close:new Set,beforeSubmit:new Set,afterSubmit:new Set},panelSources:[]};Ie=p,i.onTriggerClick=()=>Jd(),u.install(v=>tf(v),v=>Us(v)),sr("ready",{ready:!0}),p.debug&&console.info("[beacon] ready",p.endpoint)}function Jd(){const e=Ie;e&&(e.currentSubmit||(e.panelSources=e.plugins.map(t=>{if(!t.form)return null;const n=tf(t.name);let r;try{r=t.form(n)}catch(o){return Us({plugin:t.name,error:o instanceof Error?o:new Error(String(o)),at:"form"}),null}return{name:t.name,form:r,ctx:n}}).filter(t=>t!==null),e.dialog.installPluginPanels(e.panelSources,{get:(t,n)=>{var r;return(r=e.formValues[t])==null?void 0:r[n]},set:(t,n,r)=>{var l;const o=(l=e.formValues)[t]??(l[t]={});o[n]=r}}),e.dialog.open(),Bo("open",{})))}function ef(){var t;const e=Ie;if(e){e.initAbort.abort(),(t=e.currentSubmit)==null||t.abort(),e.registry.destroy(),sn();try{e.dialog.root.remove(),e.overlayHost.layer.remove()}catch{}e.hostElement.onTriggerClick=null,Ie=null}}function gv(e,t){return Fs[e].add(t),()=>vv(e,t)}function vv(e,t){Fs[e].delete(t)}function yv(e,t,n){let r=document.querySelector(Cr);if(!r){r=document.createElement(Cr),r.setAttribute("position",t),r.setAttribute("theme",n),t==="hidden"&&(r.style.position="absolute",r.style.left="-9999px"),(document.body??document.documentElement).appendChild(r);return}e.position!==void 0&&r.setAttribute("position",t),e.theme!==void 0&&r.setAttribute("theme",n)}function xv(e){return e.plugins?e.plugins:[]}function wv(){if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).has("lsbeacon-debug")}catch{return!1}}function tf(e){const t=Ie;return sg(e,{getCaptured:r=>t==null?void 0:t.capturedEntries[r],getFormValues:r=>{var o;return t?(o=t.formValues)[r]??(o[r]={}):{}},getCaptureSignal:()=>{var r;return(r=t==null?void 0:t.currentSubmit)==null?void 0:r.signal},getInitSignal:()=>t.initAbort.signal,requestMode:async r=>t?t.dialog.requestMode(r):()=>{},overlay:r=>t?wg(t.overlayHost,r.render):()=>{},onLifecycle:(r,o)=>{if(!t)return()=>{};const l=t.lifecycleHandlers[r];return l.add(o),()=>l.delete(o)}})}function Bo(e,t){const n=Ie;if(n)for(const r of n.lifecycleHandlers[e])try{r(t)}catch(o){n.debug&&console.error("[beacon] lifecycle handler threw:",o)}}function sr(e,t){for(const n of Fs[e])try{n(t)}catch(r){Ie!=null&&Ie.debug&&console.error("[beacon] system handler threw:",r)}}function Us(e){sr("plugin:error",{plugin:e.plugin,error:e.error,at:e.at});const t=Ie;t&&((t.healthIndicator==="always"||t.healthIndicator==="dev"&&t.debug)&&t.hostElement.setHealthIndicator(!0),t.debug&&console.warn(`[beacon] plugin "${e.plugin}" ${e.at} failed:`,e.error))}function nf(){const e=Ie;e&&(e.dialog.resetState(),e.dialog.clearPluginPanels(),e.formValues={})}async function kv(){const e=Ie;if(!e||e.currentSubmit)return;const t=e.dialog.getDescription().trim();if(!t){e.dialog.setStatus("Description is required","error");return}e.currentSubmit=new AbortController,e.capturedEntries={},e.dialog.setSubmitting(!0),e.dialog.setStatus("Capturing…");let n=null;try{const r=await e.registry.capture(s=>e.capturedEntries[s],s=>Us(s));e.capturedEntries=r,n=bv(e,t,r);let o=null;if(Bo("beforeSubmit",{payload:n,cancel:s=>{o===null&&(o=s)}}),o!==null){e.dialog.setSubmitting(!1),e.dialog.setStatus(`Cancelled: ${o}`,"error");return}e.dialog.setStatus("Sending…");const i=await fg(e.endpoint,n,e.headers,e.currentSubmit.signal,e.credentials);Bo("afterSubmit",{payload:n,response:i}),e.dialog.setSubmitting(!1),i.ok?(sr("submit:success",{payload:n,response:i}),e.dialog.setSubmitSucceeded(!0),e.dialog.setStatus(e.labels.sentSuccess,"success"),window.setTimeout(()=>{Ie===e&&e.dialog.close("submitted"),nf()},1500)):(sr("submit:error",{payload:n,error:new Error(`HTTP ${i.status}`)}),e.dialog.setStatus(`Failed (${i.status})`,"error"))}catch(r){e.dialog.setSubmitting(!1);const o=r instanceof Error?r:new Error(String(r));n&&sr("submit:error",{payload:n,error:o}),e.dialog.setStatus(`Failed: ${o.message}`,"error")}finally{e.currentSubmit=null}}function bv(e,t,n){var l;const r=Sv(),o=(l=e.context)==null?void 0:l.call(e);return{description:t,severity:e.dialog.getSeverity(),metadata:r,...o?{context:o}:{},plugins:n}}function Sv(){const e=window.location.href,t=document.referrer,n=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return{url:e,...t?{referrer:t}:{},userAgent:navigator.userAgent,viewport:{w:window.innerWidth,h:window.innerHeight,dpr:window.devicePixelRatio||1},screen:{w:window.screen.width,h:window.screen.height},timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,locale:navigator.language,theme:n,capturedAt:new Date().toISOString()}}Gd();const rf="LaunchDeck";let fo=null;function Ev(){"Notification"in window&&Notification.permission==="default"&&Notification.requestPermission()}function Cv(e,t){if("Notification"in window&&Notification.permission==="granted"&&document.hidden){const n=e==="feedback"?t||"Claude is waiting for your feedback":"Claude sent new content";new Notification("LaunchDeck",{body:n,icon:"/favicon.ico"})}document.hidden&&Nv(e==="feedback")}function Nv(e){$i();let t=!0;const n=e?"● LaunchDeck — Feedback needed":"● LaunchDeck — New content";fo=setInterval(()=>{document.title=t?n:rf,t=!t},1e3)}function $i(){fo&&(clearInterval(fo),fo=null),document.title=rf}function jv({theme:e,setTheme:t}){const[n,r]=C.useState(!1),[o,l]=C.useState([]),[i,s]=C.useState(0),[a,u]=C.useState([]),[p,v]=C.useState(!1),[h,x]=C.useState([]),[y,k]=C.useState(null),[_,f]=C.useState([]),c=C.useRef(null),m=C.useRef(),g=C.useRef(e);g.current=e;const w=C.useCallback(async()=>{try{const T=await(await fetch("/api/sessions")).json();u(T.sessions)}catch{}},[]),S=C.useCallback(async()=>{try{const T=await(await fetch("/api/deck/courses")).json();x(T.courses),k($=>{var O;return $??((O=T.courses.find(ne=>ne.active))==null?void 0:O.name)??null})}catch{}},[]),b=C.useCallback(async P=>{l(T=>{const $=T.findIndex(O=>O.id===P);return $>=0&&s($),T});try{const T=await fetch(`/api/sessions/${encodeURIComponent(P)}`);if(!T.ok)return;const $=await T.json();l(O=>{var je;const ne=O.findIndex(Le=>Le.id===$.id),Ne={id:$.id,mode:$.mode,blocks:$.blocks,prompt:$.prompt,selections:((je=O[ne])==null?void 0:je.selections)??{},version:$.version};if(ne>=0){const Le=[...O];return Le[ne]=Ne,s(ne),Le}return s(O.length),[...O,Ne]})}catch{}},[]),N=C.useCallback(async P=>{try{await fetch(`/api/sessions/${encodeURIComponent(P)}`,{method:"DELETE"}),await w()}catch{}},[w]),L=C.useCallback(async(P,T)=>{const $={};document.querySelectorAll("[data-block-index]").forEach(Ne=>{const je=Number(Ne.getAttribute("data-block-index"));if(!Number.isFinite(je))return;const Le=Ne.querySelector(".mermaid-container svg");Le&&($[je]=Le.outerHTML)});const O=await fetch(`/api/sessions/${encodeURIComponent(P)}/share`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...y?{course:y}:{},...Object.keys($).length?{svgByIndex:$}:{},...T!=null&&T.publicLink?{publicLink:!0}:{}})}),ne=await O.json().catch(()=>({}));if(!O.ok||!ne.ok)throw new Error(ne.error||`Share failed (${O.status})`);return await w(),{shareUrl:ne.shareUrl??void 0,linkWarning:ne.linkWarning}},[w,y]),R=C.useCallback(async P=>{const T=await fetch(`/api/sessions/${encodeURIComponent(P)}/public-link`,{method:"POST"}),$=await T.json().catch(()=>({}));if(!T.ok||!$.ok||!$.shareUrl)throw new Error($.error||`Couldn't create public link (${T.status})`);return await w(),$.shareUrl},[w]),K=C.useCallback(async P=>{const T=await fetch(`/api/sessions/${encodeURIComponent(P)}/public-link`,{method:"DELETE"}),$=await T.json().catch(()=>({}));if(!T.ok||!$.ok)throw new Error($.error||`Couldn't revoke public link (${T.status})`);await w()},[w]),me=C.useCallback(async P=>{const T=await fetch(`/api/sessions/${encodeURIComponent(P)}/remote`,{method:"DELETE"}),$=await T.json().catch(()=>({}));if(!T.ok||!$.ok)throw new Error($.error||`Cloud delete failed (${T.status})`);await w()},[w]);C.useEffect(()=>{Ev()},[]);const ae=C.useRef(null),Fe=C.useRef(null);C.useEffect(()=>{mv({endpoint:"/api/feedback",position:"hidden",plugins:[bg(),cv(),fv()],context:()=>{const T=Fe.current;return T?{sessionId:T.id,...Object.keys(T.selections).length>0?{selections:T.selections}:{}}:{}},labels:{triggerButton:"Respond",drawerTitle:"Your response",send:"Submit",sending:"Submitting…",sentSuccess:"Sent",descriptionLabel:"Comment",descriptionPlaceholder:"Type your response, or use the picker to annotate…",severityLabel:"Verdict",severityBug:"Blocker",severityIdea:"Iterate",severityUx:"Note",severityA11y:"Approve"}});const P=gv("submit:success",()=>{var $;const T=($=Fe.current)==null?void 0:$.id;T&&(l(O=>O.map(ne=>ne.id===T?{...ne,mode:"show"}:ne)),$i())});return()=>{P(),ef()}},[]),C.useEffect(()=>{w(),S();const P=window.location.hash.replace(/^#/,"");P&&b(decodeURIComponent(P))},[w,S,b]),C.useEffect(()=>{const P=()=>{const T=window.location.hash.replace(/^#/,"");if(!T)return;const $=decodeURIComponent(T);ae.current!==$&&b($)};return window.addEventListener("hashchange",P),()=>window.removeEventListener("hashchange",P)},[b]);const I=C.useCallback(()=>{const P=c.current;!P||P.readyState!==WebSocket.OPEN||P.send(JSON.stringify({type:"active_session",session:ae.current,focused:!document.hidden}))},[]);C.useEffect(()=>{const P=o[i]??null;Fe.current=P,ae.current=(P==null?void 0:P.id)??null;const T=P?`#${encodeURIComponent(P.id)}`:"";if(window.location.hash!==T){const $=`${window.location.pathname}${window.location.search}${T}`;window.history.replaceState(null,"",$)}I()},[i,o,I]),C.useEffect(()=>{document.querySelectorAll("iframe").forEach(P=>{var T;try{(T=P.contentWindow)==null||T.postMessage({type:"deck-theme",theme:e},"*")}catch{}})},[e]),C.useEffect(()=>{const P=T=>{var $;if((($=T.data)==null?void 0:$.type)==="deck-iframe-ready"&&T.source)try{T.source.postMessage({type:"deck-theme",theme:g.current},"*")}catch{}};return window.addEventListener("message",P),()=>window.removeEventListener("message",P)},[]),C.useEffect(()=>{const P=()=>{$i(),I()},T=()=>I(),$=()=>{document.documentElement.classList.toggle("deck-hidden-tab",document.hidden),I()};return window.addEventListener("focus",P),window.addEventListener("blur",T),document.addEventListener("visibilitychange",$),()=>{window.removeEventListener("focus",P),window.removeEventListener("blur",T),document.removeEventListener("visibilitychange",$)}},[I]);const U=C.useCallback(()=>{const P=window.location.protocol==="https:"?"wss:":"ws:",T=new WebSocket(`${P}//${window.location.host}`);T.onopen=()=>{r(!0),I(),fetch("/api/active-session").then($=>$.json()).then($=>f($.discuss??[])).catch(()=>{})},T.onclose=()=>{r(!1),c.current=null,m.current=setTimeout(U,2e3)},T.onerror=()=>T.close(),T.onmessage=$=>{try{const O=JSON.parse($.data);if(O.type==="session"&&O.session){const ne={id:O.session,mode:O.mode??"show",blocks:O.blocks??[],prompt:O.prompt,selections:{},version:O.version??1};l(Ne=>{const je=Ne.findIndex(Le=>Le.id===O.session);if(je>=0){const Le=[...Ne];return Le[je]={...ne,version:O.version??Ne[je].version+1},Le}return[...Ne,ne]}),l(Ne=>{const je=Ne.findIndex(Le=>Le.id===O.session);return je>=0&&s(je),Ne}),Cv(O.mode??"show",O.prompt),w()}O.type==="clear_session"&&O.session&&(l(ne=>ne.filter(je=>je.id!==O.session)),s(ne=>Math.min(ne,Math.max(0,o.length-2))),w()),O.type==="clear_all"&&(l([]),s(0),w()),O.type==="discuss_session"&&f(O.sessions??[])}catch{}},c.current=T},[w,I]),de=C.useCallback(P=>{const T=c.current;!T||T.readyState!==WebSocket.OPEN||T.send(JSON.stringify({type:"discuss_session",session:P}))},[]),j=C.useCallback(()=>{const P=c.current;!P||P.readyState!==WebSocket.OPEN||P.send(JSON.stringify({type:"discuss_clear_all"}))},[]),A=C.useCallback(()=>{_.forEach(P=>b(P))},[_,b]);C.useEffect(()=>(U(),()=>{var P;clearTimeout(m.current),(P=c.current)==null||P.close()}),[U]);const M=o[i]??null,D=M?a.find(P=>P.id===M.id):void 0,Z=((D==null?void 0:D.shared)??!1)&&((D==null?void 0:D.course)==null||D.course===y),Ke=Z,Ce=Z&&((D==null?void 0:D.stale)??!1),bt=Z?D==null?void 0:D.shareUrl:void 0,Ye=C.useCallback(P=>{M&&l(T=>T.map($=>$.id===M.id?{...$,selections:{...$.selections,[P]:!$.selections[P]}}:$))},[M]),rt=C.useCallback(P=>{c.current&&c.current.send(JSON.stringify({type:"session_closed",session:P})),l(T=>T.filter(O=>O.id!==P)),s(T=>Math.min(T,Math.max(0,o.length-2)))},[o.length]),of=C.useCallback((P,T)=>{c.current&&c.current.send(JSON.stringify({type:"render_error",error:P,source:T}))},[]),lf=M?M.mode==="feedback"?"feedback":"delivered":"idle",sf=!p||!M;return d.jsxs("div",{className:"flex h-screen flex-col overflow-hidden bg-background text-foreground",children:[sf&&d.jsx(Uh,{connected:n,theme:e,setTheme:t,status:lf,availableSessions:a,onOpenSession:b,courses:h,selectedCourse:y,onSelectCourse:k,pinnedSessionIds:_,onOpenAllPinned:A,onClearPins:j}),d.jsx("div",{className:"flex flex-1 min-h-0 flex-col",children:d.jsx(Vm,{sessions:o,activeSessionIndex:i,onSessionChange:s,onCloseSession:rt,onToggleSelection:Ye,onMermaidError:of,theme:e,onRespond:Jd,onShareSession:L,isActiveSessionShared:Ke,isActiveSessionStale:Ce,activeSessionShareUrl:bt,onMintPublicLink:R,onRevokePublicLink:K,onDeleteSession:N,onDeleteRemote:me,immersive:p,onToggleImmersive:()=>v(P=>!P),discussSessionIds:_,onToggleDiscuss:de})})]})}function Lv({children:e}){const[t,n]=Zr.useState(()=>localStorage.getItem("launchdeck-theme")||"dark"),r=Zr.useCallback(o=>{n(o),localStorage.setItem("launchdeck-theme",o);const l=o==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":o;document.documentElement.classList.toggle("dark",l==="dark")},[]);return Zr.useEffect(()=>{const o=t==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t;document.documentElement.classList.toggle("dark",o==="dark")},[t]),d.jsx(jv,{theme:t,setTheme:r})}Ol.createRoot(document.getElementById("root")).render(d.jsx(Zr.StrictMode,{children:d.jsx(Lv,{})}));export{Md as _,Rv as a,Tv as c,cf as g};
892
+ `;const r=240,o=160,l=Math.min(Math.max(8,e.anchor.x),window.innerWidth-r-8),i=Math.min(Math.max(8,e.anchor.y+12),window.innerHeight-o-8);n.style.left=`${l}px`,n.style.top=`${i}px`,document.body.appendChild(n);const s=n.querySelector("textarea");s.focus();function a(p){document.removeEventListener("keydown",u,!0),n.remove(),t(p)}function u(p){p.key==="Escape"&&(p.preventDefault(),p.stopPropagation(),a({cancelled:"all"}))}document.addEventListener("keydown",u,!0),n.addEventListener("click",p=>{var x;const h=(x=p.target.closest("[data-action]"))==null?void 0:x.getAttribute("data-action");if(h&&(p.stopPropagation(),h==="cancel"&&a({cancelled:"pin"}),h==="save")){const y=s.value.trim();a({...y?{note:y}:{},cancelled:!1})}}),s.addEventListener("keydown",p=>{if(p.key==="Enter"&&(p.metaKey||p.ctrlKey)){p.preventDefault();const v=s.value.trim();a({...v?{note:v}:{},cancelled:!1})}})})}const Jg="#0ea5e9";function ev(e,t){return/^#[0-9a-fA-F]{6}$/.test(e)?`${e}${t}`:e}function tv(e){const{shadowRoot:t,onHover:n}=e,r=e.accent??Jg,o=ev(r,"14"),l=document.createElement("div");l.style.cssText=["position: fixed","pointer-events: none","z-index: 2147483646",`border: 2px solid ${r}`,`background: ${o}`,"transition: all 60ms ease-out","box-sizing: border-box","border-radius: 2px"].join("; "),document.body.appendChild(l);const i=document.createElement("div");i.style.cssText=["position: fixed","pointer-events: none","z-index: 2147483647","background: #0f172a","color: #fff","font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace","padding: 3px 6px","border-radius: 3px","max-width: 280px","overflow: hidden","text-overflow: ellipsis","white-space: nowrap"].join("; "),document.body.appendChild(i);const s=document.body.style.cursor;document.body.style.cursor="crosshair";let a=!1,u=()=>{};const p=new Promise(g=>{u=g});function v(g){if(!g||!(g instanceof Node))return!1;let w=g;for(;w;){if(w===t||w===t.host)return!0;w=w.parentNode??w.host??null}return!1}function h(g){return g.tagName.includes("-")}function x(g,w){var b,N;l.style.display="none",i.style.display="none";const S=document.elementsFromPoint(g,w);l.style.display="block",i.style.display="block";for(const L of S){if(v(L))continue;let R=L,K=16;for(;R.shadowRoot&&!h(R)&&K-- >0;){const ae=(((N=(b=R.shadowRoot).elementsFromPoint)==null?void 0:N.call(b,g,w))??[]).find(Fe=>!v(Fe)&&Fe!==R);if(!ae)break;R=ae}return R}return null}function y(g){const w=g.getBoundingClientRect();l.style.left=`${w.left}px`,l.style.top=`${w.top}px`,l.style.width=`${w.width}px`,l.style.height=`${w.height}px`;const S=g.tagName.toLowerCase(),b=g.classList.length>0?"."+Array.from(g.classList).slice(0,2).join("."):"";i.textContent=S+b;const N=w.top-22;i.style.left=`${w.left}px`,i.style.top=`${N>=0?N:w.bottom+4}px`}function k(g){const w=x(g.clientX,g.clientY);w?(y(w),n==null||n(w)):(l.style.display="none",i.style.display="none",n==null||n(null))}function _(g){if(g.button!==0)return;g.preventDefault(),g.stopPropagation();const w=x(g.clientX,g.clientY);w&&m(w)}function f(g){g.preventDefault(),g.stopPropagation()}function c(g){g.key==="Escape"&&(g.preventDefault(),m(null))}function m(g){a||(a=!0,document.removeEventListener("mousemove",k,!0),document.removeEventListener("pointerdown",_,!0),document.removeEventListener("click",f,!0),document.removeEventListener("mouseup",f,!0),document.removeEventListener("keydown",c,!0),l.remove(),i.remove(),document.body.style.cursor=s,u(g))}return document.addEventListener("mousemove",k,!0),document.addEventListener("pointerdown",_,!0),document.addEventListener("click",f,!0),document.addEventListener("mouseup",f,!0),document.addEventListener("keydown",c,!0),{cancel:()=>m(null),promise:p}}let Il=null;async function nv(){return Il||(Il=await Md(()=>import("./index-6sdqbm2o.js"),[])),Il}const co="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkAAIAAAoAAv/lxKUAAAAASUVORK5CYII=";function yu(e,t){if(!e||e.startsWith("data:")||e.startsWith("blob:")||e.startsWith("/")||e.startsWith("#"))return!0;try{if(new URL(e,window.location.href).origin===window.location.origin)return!0}catch{return!1}return t==="anonymous"||t==="use-credentials"}function rv(){const e=[],t=[];return document.querySelectorAll("img").forEach(n=>{yu(n.src,n.crossOrigin)||(e.push({el:n,src:n.src}),n.src=co)}),document.querySelectorAll("image").forEach(n=>{const r=n,o=r.getAttribute("href"),l=r.getAttributeNS("http://www.w3.org/1999/xlink","href"),i=o||l||"";i&&!yu(i)&&(t.push({el:r,href:o,xlink:l}),o!==null&&r.setAttribute("href",co),l!==null&&r.setAttributeNS("http://www.w3.org/1999/xlink","href",co))}),()=>{for(const{el:n,src:r}of e)n.src=r;for(const{el:n,href:r,xlink:o}of t)r!==null&&n.setAttribute("href",r),o!==null&&n.setAttributeNS("http://www.w3.org/1999/xlink","href",o)}}function ov(){const e=[];document.querySelectorAll("*").forEach(l=>{const i=getComputedStyle(l),s=(i.overflowY==="auto"||i.overflowY==="scroll")&&l.scrollHeight>l.clientHeight,a=(i.overflowX==="auto"||i.overflowX==="scroll")&&l.scrollWidth>l.clientWidth;(s||a)&&e.push(l)});const t=window.scrollX,n=window.scrollY,r=e.map(l=>({el:l,scrollLeft:l.scrollLeft,scrollTop:l.scrollTop})),o=new Map;for(const l of e){let i=l;for(;i&&i!==document.documentElement.parentElement;)o.has(i)||o.set(i,i.style.cssText),i=i.parentElement}for(const l of o.keys())l.style.setProperty("overflow","visible","important"),l.style.setProperty("overflow-x","visible","important"),l.style.setProperty("overflow-y","visible","important"),l.style.setProperty("max-height","none","important"),l.style.setProperty("height","auto","important"),l.style.setProperty("min-height","0","important");return()=>{for(const[l,i]of o)l.style.cssText=i;for(const{el:l,scrollLeft:i,scrollTop:s}of r)l.scrollLeft=i,l.scrollTop=s;window.scrollTo(t,n)}}function lv(){const e=document.createElement("style");return e.setAttribute("data-beacon-capture",""),e.textContent="*,*::before,*::after{animation:none !important;transition:none !important;}",(document.head??document.documentElement).appendChild(e),()=>{e.remove()}}let xu=Promise.resolve();async function Zd(e={}){const t=xu;let n;xu=new Promise(r=>{n=r});try{return await t,await iv(e,n)}catch(r){throw n(),r}}async function iv(e,t){const{quality:n=.7,pixelRatio:r=Math.min(window.devicePixelRatio||1,2),excludeShadowRoot:o,excludeHosts:l,fullPage:i=!0}=e,s=await nv(),a=o||l!=null&&l.length?y=>{let k=y;for(;k;){if(o&&k===o.host||l&&k instanceof Element&&l.includes(k)||k instanceof Element&&k.classList.contains("beacon-no-capture"))return!1;k=k.parentNode}return!0}:void 0,u=rv(),p=i?ov():()=>{},v=lv();let h=!1;const x=()=>{if(!h){h=!0;try{v()}finally{try{p()}finally{try{u()}finally{t()}}}}};try{i&&await new Promise(c=>requestAnimationFrame(()=>c()));const y=document.documentElement,k=i?Math.max(y.scrollWidth,window.innerWidth):window.innerWidth,_=i?Math.max(y.scrollHeight,window.innerHeight):window.innerHeight;return{dataUrl:await s.toJpeg(y,{quality:n,pixelRatio:r,cacheBust:!0,...a?{filter:a}:{},imagePlaceholder:co,width:k,height:_,style:{transform:"none"}}),width:k,height:_,pixelRatio:r,dispose:x}}catch(y){throw x(),y}}let Bs=null;function sv(e){Bs=e}function av(){return Bs}function sn(){Bs=null}const wu="http://www.w3.org/2000/svg";function uv(){const e=document.createElementNS(wu,"svg");e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round"),e.setAttribute("aria-hidden","true");const t=["M3 6h18","M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6","M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"];for(const n of t){const r=document.createElementNS(wu,"path");r.setAttribute("d",n),e.appendChild(r)}return e}function cv(e={}){const t=e.maxPins??20;let n=[],r=new WeakMap,o=null,l=0,i=null,s=null,a=null,u=null;function p(){n=[],r=new WeakMap,o=null,l+=1,sn(),_(),f()}function v(){const c=document.querySelector("launch-kit-beacon");return(c==null?void 0:c.shadowRoot)??null}function h(){if(typeof window>"u")return e.accent??"#0ea5e9";if(e.accent)return e.accent;const c=document.querySelector("launch-kit-beacon");return c&&getComputedStyle(c).getPropertyValue("--beacon-accent").trim()||"#0ea5e9"}async function x(c){const m=v();if(!m)return;const g=h(),w=await c.requestMode("pickElement"),S=Yg({accent:g});for(const b of n){const N=r.get(b);N&&S.addPin(b.number,{target:N,selector:b.selector,fallbackRect:b.boundingRect})}try{let b=!0;for(;b&&!(n.length>=t);){const L=await tv({shadowRoot:m,accent:g}).promise;if(!L)break;const R=L.getBoundingClientRect(),K=await Zg({anchor:{x:R.left,y:R.bottom},pinNumber:n.length+1});if(K.cancelled==="all"){b=!1;break}if(K.cancelled==="pin")continue;const me=Bg(L),ae={number:n.length+1,...me,...K.note?{note:K.note}:{}};n.push(ae),r.set(ae,L),S.addPin(ae.number,{target:L,selector:me.selector,fallbackRect:me.boundingRect})}n.length>0?(S.setLoading("Capturing screenshot…"),await new Promise(N=>requestAnimationFrame(()=>N())),await y()):(o=null,sn())}finally{S.destroy(),w()}_(),f()}async function y(){const c=++l;if(n.length===0){o=null,sn(),f();return}const m=h();try{const g=Array.from(document.querySelectorAll("launch-kit-beacon")),w=await Zd({excludeHosts:g});try{if(c!==l)return;const S=n.map(L=>({number:L.number,selector:L.selector,boundingRect:L.boundingRect,...r.get(L)?{liveElement:r.get(L)}:{}})),b={w:w.width,h:w.height,dpr:w.pixelRatio},N=await Xd(w.dataUrl,S,b,m);if(c!==l)return;o=N,sv({dataUrl:N,mime:"image/jpeg"})}finally{w.dispose()}}catch{if(c!==l)return;o=null,sn()}c===l&&f()}function k(c){const m=n.findIndex(g=>g.number===c);m!==-1&&(n.splice(m,1),n.forEach((g,w)=>{g.number=w+1}),o=null,sn(),_(),f(),y())}function _(){if(i&&(i.textContent=`Pins (${n.length})`,i.style.display=n.length===0?"none":""),u&&(u.textContent=n.length===0?"Annotate elements":"Add another pin"),!!s){s.innerHTML="",s.style.display=n.length===0?"none":"";for(const c of n){const m=document.createElement("div");m.className="beacon-pin-item",m.dataset.pin=String(c.number);const g=document.createElement("span");g.className="beacon-pin-num",g.textContent=String(c.number);const w=document.createElement("div");w.className="beacon-pin-meta";const S=document.createElement("div");S.className="beacon-pin-selector",S.title=c.selector,S.textContent=c.selector||c.tagName;const b=document.createElement("input");b.type="text",b.className="beacon-pin-note-input",b.placeholder="Add a note (optional)",b.value=c.note??"",b.addEventListener("input",()=>{b.value.trim()?c.note=b.value:delete c.note}),w.appendChild(S),w.appendChild(b);const N=document.createElement("button");N.type="button",N.className="beacon-icon-btn",N.setAttribute("aria-label",`Remove pin ${c.number}`),N.appendChild(uv()),N.addEventListener("click",()=>k(c.number)),m.appendChild(g),m.appendChild(w),m.appendChild(N),s.appendChild(m)}}}function f(){a&&(o?(a.src=o,a.style.display="block"):(a.removeAttribute("src"),a.style.display="none"))}return{name:"domEle",setupOnce(c){return c.on("close",()=>p())},form(c){return{render:m=>(i=document.createElement("div"),i.className="beacon-pin-list-header",m.appendChild(i),s=document.createElement("div"),s.className="beacon-pin-list",m.appendChild(s),u=document.createElement("button"),u.type="button",u.className="beacon-btn secondary beacon-pin-annotate",u.addEventListener("click",()=>{x(c)}),m.appendChild(u),a=document.createElement("img"),a.className="beacon-thumb",a.alt="Annotated screenshot preview",a.style.display="none",m.appendChild(a),_(),f(),()=>{i=null,s=null,a=null,u=null})}},capture(){return n.length===0?null:{pins:n}}}}function dv(e){return!!e&&typeof e=="object"&&!("v"in e)&&"error"in e}function fv(e={}){return{name:"domSS",async capture(t){const n=av();if(n)return{dataUrl:n.dataUrl,mime:n.mime};const r=await t.requestMode("hide");try{await new Promise(i=>requestAnimationFrame(()=>i()));const o=Array.from(document.querySelectorAll("launch-kit-beacon")),l=await Zd({quality:e.quality,pixelRatio:e.pixelRatio,excludeHosts:o});try{const i=t.captured("domEle"),s=pv(i),a={w:l.width,h:l.height,dpr:l.pixelRatio},u=e.accent??hv();return{dataUrl:s.length>0?await Xd(l.dataUrl,s,a,u):l.dataUrl,mime:"image/jpeg"}}finally{l.dispose()}}finally{r()}}}}function pv(e){if(!e||dv(e))return[];const t=e.pins;return Array.isArray(t)?t.filter(n=>!!n&&typeof n=="object").map(n=>({number:Number(n.number)||0,selector:typeof n.selector=="string"?n.selector:void 0,boundingRect:n.boundingRect??{x:0,y:0,w:0,h:0}})):[]}function hv(){if(typeof window>"u")return"#0ea5e9";const e=document.querySelector("launch-kit-beacon");return e&&getComputedStyle(e).getPropertyValue("--beacon-accent").trim()||"#0ea5e9"}let Ie=null;const Fs={"plugin:error":new Set,"submit:success":new Set,"submit:error":new Set,ready:new Set};function mv(e){if(typeof window>"u")return;if(!e.endpoint)throw new Error("init: endpoint is required");Gd(),ef();const t={...yg(),...e.labels??{}},n=new AbortController,r=xv(e),o=e.position??"bottom-right",l=e.theme??"auto";rg(),yv(e,o,l);const i=document.querySelector(Cr);if(!i)throw new Error("init: failed to acquire <launch-kit-beacon> host");if(!i.shadow)throw new Error("init: host element shadow root not initialized");const s=xg(i.shadow),a=new vg(t,["bug","idea","ux","a11y"],{onSubmit:()=>{kv()},onClose:v=>{Bo("close",{}),v==="user"&&nf()}});i.shadow.appendChild(a.root),i.classList.add("beacon-no-capture");const u=ug(r),p={endpoint:e.endpoint,headers:e.headers,context:e.context,credentials:e.credentials??"omit",plugins:r,registry:u,dialog:a,overlayHost:s,hostElement:i,initAbort:n,labels:t,debug:!!e.debug||wv(),healthIndicator:e.healthIndicator??"never",position:o,theme:l,currentSubmit:null,capturedEntries:{},formValues:{},lifecycleHandlers:{open:new Set,close:new Set,beforeSubmit:new Set,afterSubmit:new Set},panelSources:[]};Ie=p,i.onTriggerClick=()=>Jd(),u.install(v=>tf(v),v=>Us(v)),sr("ready",{ready:!0}),p.debug&&console.info("[beacon] ready",p.endpoint)}function Jd(){const e=Ie;e&&(e.currentSubmit||(e.panelSources=e.plugins.map(t=>{if(!t.form)return null;const n=tf(t.name);let r;try{r=t.form(n)}catch(o){return Us({plugin:t.name,error:o instanceof Error?o:new Error(String(o)),at:"form"}),null}return{name:t.name,form:r,ctx:n}}).filter(t=>t!==null),e.dialog.installPluginPanels(e.panelSources,{get:(t,n)=>{var r;return(r=e.formValues[t])==null?void 0:r[n]},set:(t,n,r)=>{var l;const o=(l=e.formValues)[t]??(l[t]={});o[n]=r}}),e.dialog.open(),Bo("open",{})))}function ef(){var t;const e=Ie;if(e){e.initAbort.abort(),(t=e.currentSubmit)==null||t.abort(),e.registry.destroy(),sn();try{e.dialog.root.remove(),e.overlayHost.layer.remove()}catch{}e.hostElement.onTriggerClick=null,Ie=null}}function gv(e,t){return Fs[e].add(t),()=>vv(e,t)}function vv(e,t){Fs[e].delete(t)}function yv(e,t,n){let r=document.querySelector(Cr);if(!r){r=document.createElement(Cr),r.setAttribute("position",t),r.setAttribute("theme",n),t==="hidden"&&(r.style.position="absolute",r.style.left="-9999px"),(document.body??document.documentElement).appendChild(r);return}e.position!==void 0&&r.setAttribute("position",t),e.theme!==void 0&&r.setAttribute("theme",n)}function xv(e){return e.plugins?e.plugins:[]}function wv(){if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).has("lsbeacon-debug")}catch{return!1}}function tf(e){const t=Ie;return sg(e,{getCaptured:r=>t==null?void 0:t.capturedEntries[r],getFormValues:r=>{var o;return t?(o=t.formValues)[r]??(o[r]={}):{}},getCaptureSignal:()=>{var r;return(r=t==null?void 0:t.currentSubmit)==null?void 0:r.signal},getInitSignal:()=>t.initAbort.signal,requestMode:async r=>t?t.dialog.requestMode(r):()=>{},overlay:r=>t?wg(t.overlayHost,r.render):()=>{},onLifecycle:(r,o)=>{if(!t)return()=>{};const l=t.lifecycleHandlers[r];return l.add(o),()=>l.delete(o)}})}function Bo(e,t){const n=Ie;if(n)for(const r of n.lifecycleHandlers[e])try{r(t)}catch(o){n.debug&&console.error("[beacon] lifecycle handler threw:",o)}}function sr(e,t){for(const n of Fs[e])try{n(t)}catch(r){Ie!=null&&Ie.debug&&console.error("[beacon] system handler threw:",r)}}function Us(e){sr("plugin:error",{plugin:e.plugin,error:e.error,at:e.at});const t=Ie;t&&((t.healthIndicator==="always"||t.healthIndicator==="dev"&&t.debug)&&t.hostElement.setHealthIndicator(!0),t.debug&&console.warn(`[beacon] plugin "${e.plugin}" ${e.at} failed:`,e.error))}function nf(){const e=Ie;e&&(e.dialog.resetState(),e.dialog.clearPluginPanels(),e.formValues={})}async function kv(){const e=Ie;if(!e||e.currentSubmit)return;const t=e.dialog.getDescription().trim();if(!t){e.dialog.setStatus("Description is required","error");return}e.currentSubmit=new AbortController,e.capturedEntries={},e.dialog.setSubmitting(!0),e.dialog.setStatus("Capturing…");let n=null;try{const r=await e.registry.capture(s=>e.capturedEntries[s],s=>Us(s));e.capturedEntries=r,n=bv(e,t,r);let o=null;if(Bo("beforeSubmit",{payload:n,cancel:s=>{o===null&&(o=s)}}),o!==null){e.dialog.setSubmitting(!1),e.dialog.setStatus(`Cancelled: ${o}`,"error");return}e.dialog.setStatus("Sending…");const i=await fg(e.endpoint,n,e.headers,e.currentSubmit.signal,e.credentials);Bo("afterSubmit",{payload:n,response:i}),e.dialog.setSubmitting(!1),i.ok?(sr("submit:success",{payload:n,response:i}),e.dialog.setSubmitSucceeded(!0),e.dialog.setStatus(e.labels.sentSuccess,"success"),window.setTimeout(()=>{Ie===e&&e.dialog.close("submitted"),nf()},1500)):(sr("submit:error",{payload:n,error:new Error(`HTTP ${i.status}`)}),e.dialog.setStatus(`Failed (${i.status})`,"error"))}catch(r){e.dialog.setSubmitting(!1);const o=r instanceof Error?r:new Error(String(r));n&&sr("submit:error",{payload:n,error:o}),e.dialog.setStatus(`Failed: ${o.message}`,"error")}finally{e.currentSubmit=null}}function bv(e,t,n){var l;const r=Sv(),o=(l=e.context)==null?void 0:l.call(e);return{description:t,severity:e.dialog.getSeverity(),metadata:r,...o?{context:o}:{},plugins:n}}function Sv(){const e=window.location.href,t=document.referrer,n=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return{url:e,...t?{referrer:t}:{},userAgent:navigator.userAgent,viewport:{w:window.innerWidth,h:window.innerHeight,dpr:window.devicePixelRatio||1},screen:{w:window.screen.width,h:window.screen.height},timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,locale:navigator.language,theme:n,capturedAt:new Date().toISOString()}}Gd();const rf="LaunchDeck";let fo=null;function Ev(){"Notification"in window&&Notification.permission==="default"&&Notification.requestPermission()}function Cv(e,t){if("Notification"in window&&Notification.permission==="granted"&&document.hidden){const n=e==="feedback"?t||"Claude is waiting for your feedback":"Claude sent new content";new Notification("LaunchDeck",{body:n,icon:"/favicon.ico"})}document.hidden&&Nv(e==="feedback")}function Nv(e){$i();let t=!0;const n=e?"● LaunchDeck — Feedback needed":"● LaunchDeck — New content";fo=setInterval(()=>{document.title=t?n:rf,t=!t},1e3)}function $i(){fo&&(clearInterval(fo),fo=null),document.title=rf}function jv({theme:e,setTheme:t}){const[n,r]=C.useState(!1),[o,l]=C.useState([]),[i,s]=C.useState(0),[a,u]=C.useState([]),[p,v]=C.useState(!1),[h,x]=C.useState([]),[y,k]=C.useState(null),[_,f]=C.useState([]),c=C.useRef(null),m=C.useRef(),g=C.useRef(e);g.current=e;const w=C.useCallback(async()=>{try{const T=await(await fetch("/api/sessions")).json();u(T.sessions)}catch{}},[]),S=C.useCallback(async()=>{try{const T=await(await fetch("/api/deck/courses")).json();x(T.courses),k($=>{var O;return $??((O=T.courses.find(ne=>ne.active))==null?void 0:O.name)??null})}catch{}},[]),b=C.useCallback(async P=>{l(T=>{const $=T.findIndex(O=>O.id===P);return $>=0&&s($),T});try{const T=await fetch(`/api/sessions/${encodeURIComponent(P)}`);if(!T.ok)return;const $=await T.json();l(O=>{var je;const ne=O.findIndex(Le=>Le.id===$.id),Ne={id:$.id,mode:$.mode,blocks:$.blocks,prompt:$.prompt,selections:((je=O[ne])==null?void 0:je.selections)??{},version:$.version};if(ne>=0){const Le=[...O];return Le[ne]=Ne,s(ne),Le}return s(O.length),[...O,Ne]})}catch{}},[]),N=C.useCallback(async P=>{try{await fetch(`/api/sessions/${encodeURIComponent(P)}`,{method:"DELETE"}),await w()}catch{}},[w]),L=C.useCallback(async(P,T)=>{const $={};document.querySelectorAll("[data-block-index]").forEach(Ne=>{const je=Number(Ne.getAttribute("data-block-index"));if(!Number.isFinite(je))return;const Le=Ne.querySelector(".mermaid-container svg");Le&&($[je]=Le.outerHTML)});const O=await fetch(`/api/sessions/${encodeURIComponent(P)}/share`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...y?{course:y}:{},...Object.keys($).length?{svgByIndex:$}:{},...T!=null&&T.publicLink?{publicLink:!0}:{}})}),ne=await O.json().catch(()=>({}));if(!O.ok||!ne.ok)throw new Error(ne.error||`Share failed (${O.status})`);return await w(),{shareUrl:ne.shareUrl??void 0,linkWarning:ne.linkWarning}},[w,y]),R=C.useCallback(async P=>{const T=await fetch(`/api/sessions/${encodeURIComponent(P)}/public-link`,{method:"POST"}),$=await T.json().catch(()=>({}));if(!T.ok||!$.ok||!$.shareUrl)throw new Error($.error||`Couldn't create public link (${T.status})`);return await w(),$.shareUrl},[w]),K=C.useCallback(async P=>{const T=await fetch(`/api/sessions/${encodeURIComponent(P)}/public-link`,{method:"DELETE"}),$=await T.json().catch(()=>({}));if(!T.ok||!$.ok)throw new Error($.error||`Couldn't revoke public link (${T.status})`);await w()},[w]),me=C.useCallback(async P=>{const T=await fetch(`/api/sessions/${encodeURIComponent(P)}/remote`,{method:"DELETE"}),$=await T.json().catch(()=>({}));if(!T.ok||!$.ok)throw new Error($.error||`Cloud delete failed (${T.status})`);await w()},[w]);C.useEffect(()=>{Ev()},[]);const ae=C.useRef(null),Fe=C.useRef(null);C.useEffect(()=>{mv({endpoint:"/api/feedback",credentials:"same-origin",position:"hidden",plugins:[bg(),cv(),fv()],context:()=>{const T=Fe.current;return T?{sessionId:T.id,...Object.keys(T.selections).length>0?{selections:T.selections}:{}}:{}},labels:{triggerButton:"Respond",drawerTitle:"Your response",send:"Submit",sending:"Submitting…",sentSuccess:"Sent",descriptionLabel:"Comment",descriptionPlaceholder:"Type your response, or use the picker to annotate…",severityLabel:"Verdict",severityBug:"Blocker",severityIdea:"Iterate",severityUx:"Note",severityA11y:"Approve"}});const P=gv("submit:success",()=>{var $;const T=($=Fe.current)==null?void 0:$.id;T&&(l(O=>O.map(ne=>ne.id===T?{...ne,mode:"show"}:ne)),$i())});return()=>{P(),ef()}},[]),C.useEffect(()=>{w(),S();const P=window.location.hash.replace(/^#/,"");P&&b(decodeURIComponent(P))},[w,S,b]),C.useEffect(()=>{const P=()=>{const T=window.location.hash.replace(/^#/,"");if(!T)return;const $=decodeURIComponent(T);ae.current!==$&&b($)};return window.addEventListener("hashchange",P),()=>window.removeEventListener("hashchange",P)},[b]);const I=C.useCallback(()=>{const P=c.current;!P||P.readyState!==WebSocket.OPEN||P.send(JSON.stringify({type:"active_session",session:ae.current,focused:!document.hidden}))},[]);C.useEffect(()=>{const P=o[i]??null;Fe.current=P,ae.current=(P==null?void 0:P.id)??null;const T=P?`#${encodeURIComponent(P.id)}`:"";if(window.location.hash!==T){const $=`${window.location.pathname}${window.location.search}${T}`;window.history.replaceState(null,"",$)}I()},[i,o,I]),C.useEffect(()=>{document.querySelectorAll("iframe").forEach(P=>{var T;try{(T=P.contentWindow)==null||T.postMessage({type:"deck-theme",theme:e},"*")}catch{}})},[e]),C.useEffect(()=>{const P=T=>{var $;if((($=T.data)==null?void 0:$.type)==="deck-iframe-ready"&&T.source)try{T.source.postMessage({type:"deck-theme",theme:g.current},"*")}catch{}};return window.addEventListener("message",P),()=>window.removeEventListener("message",P)},[]),C.useEffect(()=>{const P=()=>{$i(),I()},T=()=>I(),$=()=>{document.documentElement.classList.toggle("deck-hidden-tab",document.hidden),I()};return window.addEventListener("focus",P),window.addEventListener("blur",T),document.addEventListener("visibilitychange",$),()=>{window.removeEventListener("focus",P),window.removeEventListener("blur",T),document.removeEventListener("visibilitychange",$)}},[I]);const U=C.useCallback(()=>{const P=window.location.protocol==="https:"?"wss:":"ws:",T=new WebSocket(`${P}//${window.location.host}`);T.onopen=()=>{r(!0),I(),fetch("/api/active-session").then($=>$.json()).then($=>f($.discuss??[])).catch(()=>{})},T.onclose=()=>{r(!1),c.current=null,m.current=setTimeout(U,2e3)},T.onerror=()=>T.close(),T.onmessage=$=>{try{const O=JSON.parse($.data);if(O.type==="session"&&O.session){const ne={id:O.session,mode:O.mode??"show",blocks:O.blocks??[],prompt:O.prompt,selections:{},version:O.version??1};l(Ne=>{const je=Ne.findIndex(Le=>Le.id===O.session);if(je>=0){const Le=[...Ne];return Le[je]={...ne,version:O.version??Ne[je].version+1},Le}return[...Ne,ne]}),l(Ne=>{const je=Ne.findIndex(Le=>Le.id===O.session);return je>=0&&s(je),Ne}),Cv(O.mode??"show",O.prompt),w()}O.type==="clear_session"&&O.session&&(l(ne=>ne.filter(je=>je.id!==O.session)),s(ne=>Math.min(ne,Math.max(0,o.length-2))),w()),O.type==="clear_all"&&(l([]),s(0),w()),O.type==="discuss_session"&&f(O.sessions??[])}catch{}},c.current=T},[w,I]),de=C.useCallback(P=>{const T=c.current;!T||T.readyState!==WebSocket.OPEN||T.send(JSON.stringify({type:"discuss_session",session:P}))},[]),j=C.useCallback(()=>{const P=c.current;!P||P.readyState!==WebSocket.OPEN||P.send(JSON.stringify({type:"discuss_clear_all"}))},[]),A=C.useCallback(()=>{_.forEach(P=>b(P))},[_,b]);C.useEffect(()=>(U(),()=>{var P;clearTimeout(m.current),(P=c.current)==null||P.close()}),[U]);const M=o[i]??null,D=M?a.find(P=>P.id===M.id):void 0,Z=((D==null?void 0:D.shared)??!1)&&((D==null?void 0:D.course)==null||D.course===y),Ke=Z,Ce=Z&&((D==null?void 0:D.stale)??!1),bt=Z?D==null?void 0:D.shareUrl:void 0,Ye=C.useCallback(P=>{M&&l(T=>T.map($=>$.id===M.id?{...$,selections:{...$.selections,[P]:!$.selections[P]}}:$))},[M]),rt=C.useCallback(P=>{c.current&&c.current.send(JSON.stringify({type:"session_closed",session:P})),l(T=>T.filter(O=>O.id!==P)),s(T=>Math.min(T,Math.max(0,o.length-2)))},[o.length]),of=C.useCallback((P,T)=>{c.current&&c.current.send(JSON.stringify({type:"render_error",error:P,source:T}))},[]),lf=M?M.mode==="feedback"?"feedback":"delivered":"idle",sf=!p||!M;return d.jsxs("div",{className:"flex h-screen flex-col overflow-hidden bg-background text-foreground",children:[sf&&d.jsx(Uh,{connected:n,theme:e,setTheme:t,status:lf,availableSessions:a,onOpenSession:b,courses:h,selectedCourse:y,onSelectCourse:k,pinnedSessionIds:_,onOpenAllPinned:A,onClearPins:j}),d.jsx("div",{className:"flex flex-1 min-h-0 flex-col",children:d.jsx(Vm,{sessions:o,activeSessionIndex:i,onSessionChange:s,onCloseSession:rt,onToggleSelection:Ye,onMermaidError:of,theme:e,onRespond:Jd,onShareSession:L,isActiveSessionShared:Ke,isActiveSessionStale:Ce,activeSessionShareUrl:bt,onMintPublicLink:R,onRevokePublicLink:K,onDeleteSession:N,onDeleteRemote:me,immersive:p,onToggleImmersive:()=>v(P=>!P),discussSessionIds:_,onToggleDiscuss:de})})]})}function Lv({children:e}){const[t,n]=Zr.useState(()=>localStorage.getItem("launchdeck-theme")||"dark"),r=Zr.useCallback(o=>{n(o),localStorage.setItem("launchdeck-theme",o);const l=o==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":o;document.documentElement.classList.toggle("dark",l==="dark")},[]);return Zr.useEffect(()=>{const o=t==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t;document.documentElement.classList.toggle("dark",o==="dark")},[t]),d.jsx(jv,{theme:t,setTheme:r})}Ol.createRoot(document.getElementById("root")).render(d.jsx(Zr.StrictMode,{children:d.jsx(Lv,{})}));export{Md as _,Rv as a,Tv as c,cf as g};
@@ -1,2 +1,2 @@
1
- import{_ as a,l as s,I as n,e as i}from"./mermaid.core-BaQyIOvj.js";import{p}from"./wardley-RL74JXVD-Bxo5x40D.js";import"./index-DlwdTgE_.js";import"./min-CYwCzYaL.js";import"./_baseUniq-mvYvzeEJ.js";var g={parse:a(async r=>{const e=await p("info",r);s.debug(e)},"parse")},v={version:"11.14.0"},d=a(()=>v.version,"getVersion"),m={getVersion:d},c=a((r,e,o)=>{s.debug(`rendering info diagram
1
+ import{_ as a,l as s,I as n,e as i}from"./mermaid.core-bouKOnsR.js";import{p}from"./wardley-RL74JXVD-DLKe29q9.js";import"./index-CwAiam97.js";import"./min-Jl4GV9DB.js";import"./_baseUniq-BrhDuG3C.js";var g={parse:a(async r=>{const e=await p("info",r);s.debug(e)},"parse")},v={version:"11.14.0"},d=a(()=>v.version,"getVersion"),m={getVersion:d},c=a((r,e,o)=>{s.debug(`rendering info diagram
2
2
  `+r);const t=n(e);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${o}`)},"draw"),l={draw:c},y={parser:g,db:m,renderer:l};export{y as diagram};
@@ -1,4 +1,4 @@
1
- import{_ as o,c as ot,N as ut,I as dt,as as yt,z as ft,k as pt,p as it,a as gt,b as kt,g as mt,s as wt,q as _t,e as bt}from"./mermaid.core-BaQyIOvj.js";import"./index-DlwdTgE_.js";var tt=function(){var e=o(function(M,t,s,i){for(s=s||{},i=M.length;i--;s[M[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],B={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,u,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return u;case 15:u.addNode(n[w-1].length,n[w].trim());break;case 16:u.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(c,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],u=[],p=[null],n=[],v=this.table,w="",I=0,S=0,L=2,E=1,R=n.slice.call(arguments,1),b=Object.create(this.lexer),C={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(C.yy[z]=this.yy[z]);b.setInput(t,C.yy),C.yy.lexer=b,C.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var T=b.yylloc;n.push(T);var D=b.options&&b.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function F(N){i.length=i.length-2*N,p.length=p.length-N,n.length=n.length-N}o(F,"popStack");function j(){var N;return N=u.pop()||b.lex()||E,typeof N!="number"&&(N instanceof Array&&(u=N,N=u.pop()),N=s.symbols_[N]||N),N}o(j,"lex");for(var A,W,P,K,H={},X,V,et,Y;;){if(W=i[i.length-1],this.defaultActions[W]?P=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=j()),P=v[W]&&v[W][A]),typeof P>"u"||!P.length||!P[0]){var Q="";Y=[];for(X in v[W])this.terminals_[X]&&X>L&&Y.push("'"+this.terminals_[X]+"'");b.showPosition?Q="Parse error on line "+(I+1)+`:
1
+ import{_ as o,c as ot,N as ut,I as dt,as as yt,z as ft,k as pt,p as it,a as gt,b as kt,g as mt,s as wt,q as _t,e as bt}from"./mermaid.core-bouKOnsR.js";import"./index-CwAiam97.js";var tt=function(){var e=o(function(M,t,s,i){for(s=s||{},i=M.length;i--;s[M[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],B={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,u,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return u;case 15:u.addNode(n[w-1].length,n[w].trim());break;case 16:u.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(c,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],u=[],p=[null],n=[],v=this.table,w="",I=0,S=0,L=2,E=1,R=n.slice.call(arguments,1),b=Object.create(this.lexer),C={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(C.yy[z]=this.yy[z]);b.setInput(t,C.yy),C.yy.lexer=b,C.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var T=b.yylloc;n.push(T);var D=b.options&&b.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function F(N){i.length=i.length-2*N,p.length=p.length-N,n.length=n.length-N}o(F,"popStack");function j(){var N;return N=u.pop()||b.lex()||E,typeof N!="number"&&(N instanceof Array&&(u=N,N=u.pop()),N=s.symbols_[N]||N),N}o(j,"lex");for(var A,W,P,K,H={},X,V,et,Y;;){if(W=i[i.length-1],this.defaultActions[W]?P=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=j()),P=v[W]&&v[W][A]),typeof P>"u"||!P.length||!P[0]){var Q="";Y=[];for(X in v[W])this.terminals_[X]&&X>L&&Y.push("'"+this.terminals_[X]+"'");b.showPosition?Q="Parse error on line "+(I+1)+`:
2
2
  `+b.showPosition()+`
3
3
  Expecting `+Y.join(", ")+", got '"+(this.terminals_[A]||A)+"'":Q="Parse error on line "+(I+1)+": Unexpected "+(A==E?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(Q,{text:b.match,token:this.terminals_[A]||A,line:b.yylineno,loc:T,expected:Y})}if(P[0]instanceof Array&&P.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+A);switch(P[0]){case 1:i.push(A),p.push(b.yytext),n.push(b.yylloc),i.push(P[1]),A=null,S=b.yyleng,w=b.yytext,I=b.yylineno,T=b.yylloc;break;case 2:if(V=this.productions_[P[1]][1],H.$=p[p.length-V],H._$={first_line:n[n.length-(V||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(V||1)].first_column,last_column:n[n.length-1].last_column},D&&(H._$.range=[n[n.length-(V||1)].range[0],n[n.length-1].range[1]]),K=this.performAction.apply(H,[w,S,I,C.yy,P[1],p,n].concat(R)),typeof K<"u")return K;V&&(i=i.slice(0,-1*V*2),p=p.slice(0,-1*V),n=n.slice(0,-1*V)),i.push(this.productions_[P[1]][0]),p.push(H.$),n.push(H._$),et=v[i[i.length-2]][i[i.length-1]],i.push(et);break;case 3:return!0}}return!0},"parse")},O=function(){var M={EOF:1,parseError:o(function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},"parseError"),setInput:o(function(t,s){return this.yy=s||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var s=t.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var s=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===u.length?this.yylloc.first_column:0)+u[u.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),s=new Array(t.length+1).join("-");return t+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{g as gt}from"./chunk-FMBD7UC4-Dg-i7kzi.js";import{a as mt,g as lt,h as xt,d as kt}from"./chunk-YZCP3GAM-HDDlJ5oI.js";import{g as _t,s as vt,a as bt,b as wt,q as Tt,p as St,_ as s,c as R,d as G,e as $t,z as Mt}from"./mermaid.core-BaQyIOvj.js";import{d as it}from"./arc-CX4ylnp2.js";import"./index-DlwdTgE_.js";var U=function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var X="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?X="Parse error on line "+(C+1)+`:
1
+ import{g as gt}from"./chunk-FMBD7UC4-CVRnaGM0.js";import{a as mt,g as lt,h as xt,d as kt}from"./chunk-YZCP3GAM-Rhbb691A.js";import{g as _t,s as vt,a as bt,b as wt,q as Tt,p as St,_ as s,c as R,d as G,e as $t,z as Mt}from"./mermaid.core-bouKOnsR.js";import{d as it}from"./arc-DXtPHMhw.js";import"./index-CwAiam97.js";var U=function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var X="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?X="Parse error on line "+(C+1)+`:
2
2
  `+_.showPosition()+`
3
3
  Expecting `+z.join(", ")+", got '"+(this.terminals_[b]||b)+"'":X="Parse error on line "+(C+1)+": Unexpected "+(b==D?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(X,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Y,expected:z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+b);switch(T[0]){case 1:l.push(b),d.push(_.yytext),c.push(_.yylloc),l.push(T[1]),b=null,Q=_.yyleng,k=_.yytext,C=_.yylineno,Y=_.yylloc;break;case 2:if(M=this.productions_[T[1]][1],F.$=d[d.length-M],F._$={first_line:c[c.length-(M||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(M||1)].first_column,last_column:c[c.length-1].last_column},ft&&(F._$.range=[c[c.length-(M||1)].range[0],c[c.length-1].range[1]]),q=this.performAction.apply(F,[k,Q,C,I.yy,T[1],d,c].concat(dt)),typeof q<"u")return q;M&&(l=l.slice(0,-1*M*2),d=d.slice(0,-1*M),c=c.slice(0,-1*M)),l.push(this.productions_[T[1]][0]),d.push(F.$),c.push(F._$),et=v[l[l.length-2]][l[l.length-1]],l.push(et);break;case 3:return!0}}return!0},"parse")},m=function(){var h={EOF:1,parseError:s(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:s(function(r,n){return this.yy=n||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var n=r.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:s(function(r){var n=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var d=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===y.length?this.yylloc.first_column:0)+y[y.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var r=this.pastInput(),n=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{_ as c,l as te,c as W,I as fe,af as ye,ag as be,ah as me,Y as _e,G as K,i as F,t as ke,J as Ee,V as Se,W as le,X as ce}from"./mermaid.core-BaQyIOvj.js";import{g as Ne}from"./chunk-FMBD7UC4-Dg-i7kzi.js";import"./index-DlwdTgE_.js";var $=function(){var t=c(function(_,s,n,a){for(n=n||{},a=_.length;a--;n[_[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],k=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],M=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],U=[1,35],j=[1,36],A=[1,6,7,11,13,16,17,20,23],H=[1,38],V={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,n,a,o,u,e,B){var l=e.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:M}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(P,[2,14],{7:U,11:j}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:M}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:H}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:U,11:j}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:H}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],B=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(T.yy[J]=this.yy[J]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var q=m.yylloc;e.push(q);var de=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var E,R,v,Q,G={},X,I,oe,Y;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((E===null||typeof E>"u")&&(E=ae()),v=B[R]&&B[R][E]),typeof v>"u"||!v.length||!v[0]){var Z="";Y=[];for(X in B[R])this.terminals_[X]&&X>ue&&Y.push("'"+this.terminals_[X]+"'");m.showPosition?Z="Parse error on line "+(z+1)+`:
1
+ import{_ as c,l as te,c as W,I as fe,af as ye,ag as be,ah as me,Y as _e,G as K,i as F,t as ke,J as Ee,V as Se,W as le,X as ce}from"./mermaid.core-bouKOnsR.js";import{g as Ne}from"./chunk-FMBD7UC4-CVRnaGM0.js";import"./index-CwAiam97.js";var $=function(){var t=c(function(_,s,n,a){for(n=n||{},a=_.length;a--;n[_[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],k=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],M=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],U=[1,35],j=[1,36],A=[1,6,7,11,13,16,17,20,23],H=[1,38],V={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,n,a,o,u,e,B){var l=e.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:M}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(P,[2,14],{7:U,11:j}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:M}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:H}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:U,11:j}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:H}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],B=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(T.yy[J]=this.yy[J]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var q=m.yylloc;e.push(q);var de=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var E,R,v,Q,G={},X,I,oe,Y;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((E===null||typeof E>"u")&&(E=ae()),v=B[R]&&B[R][E]),typeof v>"u"||!v.length||!v[0]){var Z="";Y=[];for(X in B[R])this.terminals_[X]&&X>ue&&Y.push("'"+this.terminals_[X]+"'");m.showPosition?Z="Parse error on line "+(z+1)+`:
2
2
  `+m.showPosition()+`
3
3
  Expecting `+Y.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Z="Parse error on line "+(z+1)+": Unexpected "+(E==re?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Z,{text:m.match,token:this.terminals_[E]||E,line:m.yylineno,loc:q,expected:Y})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+E);switch(v[0]){case 1:a.push(E),u.push(m.yytext),e.push(m.yylloc),a.push(v[1]),E=null,ie=m.yyleng,l=m.yytext,z=m.yylineno,q=m.yylloc;break;case 2:if(I=this.productions_[v[1]][1],G.$=u[u.length-I],G._$={first_line:e[e.length-(I||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(I||1)].first_column,last_column:e[e.length-1].last_column},de&&(G._$.range=[e[e.length-(I||1)].range[0],e[e.length-1].range[1]]),Q=this.performAction.apply(G,[l,ie,z,T.yy,v[1],u,e].concat(ge)),typeof Q<"u")return Q;I&&(a=a.slice(0,-1*I*2),u=u.slice(0,-1*I),e=e.slice(0,-1*I)),a.push(this.productions_[v[1]][0]),u.push(G.$),e.push(G._$),oe=B[a[a.length-2]][a[a.length-1]],a.push(oe);break;case 3:return!0}}return!0},"parse")},y=function(){var _={EOF:1,parseError:c(function(n,a){if(this.yy.parser)this.yy.parser.parseError(n,a);else throw new Error(n)},"parseError"),setInput:c(function(s,n){return this.yy=n||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:c(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var n=s.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:c(function(s){var n=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var o=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===o.length?this.yylloc.first_column:0)+o[o.length-a.length].length-a[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:c(function(){return this._more=!0,this},"more"),reject:c(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:c(function(s){this.unput(this.match.slice(s))},"less"),pastInput:c(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:c(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:c(function(){var s=this.pastInput(),n=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
@@ -1 +1 @@
1
- import{b as Ve,G as g,i as m,v as E}from"./graph-CfzQUfPh.js";import{i as z,c as C,k as Ye,o as $e,p as ve,q as pe,t as De,u as we,v as qe,w as be,d as V,x as We,b as ze,y as Xe,n as f,m as I,r as B}from"./_baseUniq-mvYvzeEJ.js";import{f as O,b as me,a as He,c as Ue,m as w,d as P}from"./min-CYwCzYaL.js";import{a$ as M,by as Ze,bz as Je,b6 as ge,bA as S,aS as ye,br as Ke,aG as Qe,bw as en,bB as nn,aI as xe,bv as rn,b5 as Ee,aH as ke,aZ as tn,b8 as an,bC as X}from"./mermaid.core-BaQyIOvj.js";var on=/\s/;function un(e){for(var n=e.length;n--&&on.test(e.charAt(n)););return n}var dn=/^\s+/;function sn(e){return e&&e.slice(0,un(e)+1).replace(dn,"")}var re=NaN,fn=/^[-+]0x[0-9a-f]+$/i,cn=/^0b[01]+$/i,ln=/^0o[0-7]+$/i,hn=parseInt;function vn(e){if(typeof e=="number")return e;if(z(e))return re;if(M(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=M(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=sn(e);var r=cn.test(e);return r||ln.test(e)?hn(e.slice(2),r?2:8):fn.test(e)?re:+e}var te=1/0,pn=17976931348623157e292;function T(e){if(!e)return e===0?e:0;if(e=vn(e),e===te||e===-te){var n=e<0?-1:1;return n*pn}return e===e?e:0}function wn(e){var n=T(e),r=n%1;return n===n?r?n-r:n:0}function bn(e){return Ze(Je(e,void 0,O),e+"")}var mn=1,gn=4;function yn(e){return Ve(e,mn|gn)}var Oe=Object.prototype,xn=Oe.hasOwnProperty,En=ge(function(e,n){e=Object(e);var r=-1,t=n.length,i=t>2?n[2]:void 0;for(i&&S(n[0],n[1],i)&&(t=1);++r<t;)for(var o=n[r],a=ye(o),u=-1,d=a.length;++u<d;){var s=a[u],c=e[s];(c===void 0||Ke(c,Oe[s])&&!xn.call(e,s))&&(e[s]=o[s])}return e});function F(e){var n=e==null?0:e.length;return n?e[n-1]:void 0}function kn(e){return function(n,r,t){var i=Object(n);if(!Qe(n)){var o=C(r);n=Ye(n),r=function(u){return o(i[u],u,i)}}var a=e(n,r,t);return a>-1?i[o?n[a]:a]:void 0}}var On=Math.max;function Nn(e,n,r){var t=e==null?0:e.length;if(!t)return-1;var i=r==null?0:wn(r);return i<0&&(i=On(t+i,0)),$e(e,C(n),i)}var U=kn(Nn);function Ln(e,n){return e==null?e:en(e,ve(n),ye)}function Pn(e,n){return e&&pe(e,ve(n))}function _n(e,n){return e>n}var Cn=Object.prototype,In=Cn.hasOwnProperty;function Rn(e,n){return e!=null&&In.call(e,n)}function Ne(e,n){return e!=null&&De(e,n,Rn)}function j(e,n){var r={};return n=C(n),pe(e,function(t,i,o){nn(r,i,n(t,i,o))}),r}function y(e){return e&&e.length?me(e,xe,_n):void 0}function Z(e,n){return e&&e.length?me(e,C(n),He):void 0}function Tn(e,n,r,t){if(!M(e))return e;n=we(n,e);for(var i=-1,o=n.length,a=o-1,u=e;u!=null&&++i<o;){var d=qe(n[i]),s=r;if(d==="__proto__"||d==="constructor"||d==="prototype")return e;if(i!=a){var c=u[d];s=void 0,s===void 0&&(s=M(c)?c:rn(n[i+1])?[]:{})}Ee(u,d,s),u=u[d]}return e}function Mn(e,n,r){for(var t=-1,i=n.length,o={};++t<i;){var a=n[t],u=be(e,a);r(u,a)&&Tn(o,we(a,e),u)}return o}function Sn(e,n){var r=e.length;for(e.sort(n);r--;)e[r]=e[r].value;return e}function Fn(e,n){if(e!==n){var r=e!==void 0,t=e===null,i=e===e,o=z(e),a=n!==void 0,u=n===null,d=n===n,s=z(n);if(!u&&!s&&!o&&e>n||o&&a&&d&&!u&&!s||t&&a&&d||!r&&d||!i)return 1;if(!t&&!o&&!s&&e<n||s&&r&&i&&!t&&!o||u&&r&&i||!a&&i||!d)return-1}return 0}function An(e,n,r){for(var t=-1,i=e.criteria,o=n.criteria,a=i.length,u=r.length;++t<a;){var d=Fn(i[t],o[t]);if(d){if(t>=u)return d;var s=r[t];return d*(s=="desc"?-1:1)}}return e.index-n.index}function Bn(e,n,r){n.length?n=V(n,function(o){return ke(o)?function(a){return be(a,o.length===1?o[0]:o)}:o}):n=[xe];var t=-1;n=V(n,tn(C));var i=Ue(e,function(o,a,u){var d=V(n,function(s){return s(o)});return{criteria:d,index:++t,value:o}});return Sn(i,function(o,a){return An(o,a,r)})}function jn(e,n){return Mn(e,n,function(r,t){return We(e,t)})}var A=bn(function(e,n){return e==null?{}:jn(e,n)}),Gn=Math.ceil,Vn=Math.max;function Yn(e,n,r,t){for(var i=-1,o=Vn(Gn((n-e)/(r||1)),0),a=Array(o);o--;)a[++i]=e,e+=r;return a}function $n(e){return function(n,r,t){return t&&typeof t!="number"&&S(n,r,t)&&(r=t=void 0),n=T(n),r===void 0?(r=n,n=0):r=T(r),t=t===void 0?n<r?1:-1:T(t),Yn(n,r,t)}}var k=$n(),R=ge(function(e,n){if(e==null)return[];var r=n.length;return r>1&&S(e,n[0],n[1])?n=[]:r>2&&S(n[0],n[1],n[2])&&(n=[n[0]]),Bn(e,ze(n),[])}),Dn=0;function J(e){var n=++Dn;return Xe(e)+n}function qn(e,n,r){for(var t=-1,i=e.length,o=n.length,a={};++t<i;){var u=t<o?n[t]:void 0;r(a,e[t],u)}return a}function Wn(e,n){return qn(e||[],n||[],Ee)}class zn{constructor(){var n={};n._next=n._prev=n,this._sentinel=n}dequeue(){var n=this._sentinel,r=n._prev;if(r!==n)return ie(r),r}enqueue(n){var r=this._sentinel;n._prev&&n._next&&ie(n),n._next=r._next,r._next._prev=n,r._next=n,n._prev=r}toString(){for(var n=[],r=this._sentinel,t=r._prev;t!==r;)n.push(JSON.stringify(t,Xn)),t=t._prev;return"["+n.join(", ")+"]"}}function ie(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Xn(e,n){if(e!=="_next"&&e!=="_prev")return n}var Hn=an(1);function Un(e,n){if(e.nodeCount()<=1)return[];var r=Jn(e,n||Hn),t=Zn(r.graph,r.buckets,r.zeroIdx);return O(w(t,function(i){return e.outEdges(i.v,i.w)}))}function Zn(e,n,r){for(var t=[],i=n[n.length-1],o=n[0],a;e.nodeCount();){for(;a=o.dequeue();)Y(e,n,r,a);for(;a=i.dequeue();)Y(e,n,r,a);if(e.nodeCount()){for(var u=n.length-2;u>0;--u)if(a=n[u].dequeue(),a){t=t.concat(Y(e,n,r,a,!0));break}}}return t}function Y(e,n,r,t,i){var o=i?[]:void 0;return f(e.inEdges(t.v),function(a){var u=e.edge(a),d=e.node(a.v);i&&o.push({v:a.v,w:a.w}),d.out-=u,H(n,r,d)}),f(e.outEdges(t.v),function(a){var u=e.edge(a),d=a.w,s=e.node(d);s.in-=u,H(n,r,s)}),e.removeNode(t.v),o}function Jn(e,n){var r=new g,t=0,i=0;f(e.nodes(),function(u){r.setNode(u,{v:u,in:0,out:0})}),f(e.edges(),function(u){var d=r.edge(u.v,u.w)||0,s=n(u),c=d+s;r.setEdge(u.v,u.w,c),i=Math.max(i,r.node(u.v).out+=s),t=Math.max(t,r.node(u.w).in+=s)});var o=k(i+t+3).map(function(){return new zn}),a=t+1;return f(r.nodes(),function(u){H(o,a,r.node(u))}),{graph:r,buckets:o,zeroIdx:a}}function H(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function Kn(e){var n=e.graph().acyclicer==="greedy"?Un(e,r(e)):Qn(e);f(n,function(t){var i=e.edge(t);e.removeEdge(t),i.forwardName=t.name,i.reversed=!0,e.setEdge(t.w,t.v,i,J("rev"))});function r(t){return function(i){return t.edge(i).weight}}}function Qn(e){var n=[],r={},t={};function i(o){Object.prototype.hasOwnProperty.call(t,o)||(t[o]=!0,r[o]=!0,f(e.outEdges(o),function(a){Object.prototype.hasOwnProperty.call(r,a.w)?n.push(a):i(a.w)}),delete r[o])}return f(e.nodes(),i),n}function er(e){f(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}})}function N(e,n,r,t){var i;do i=J(t);while(e.hasNode(i));return r.dummy=n,e.setNode(i,r),i}function nr(e){var n=new g().setGraph(e.graph());return f(e.nodes(),function(r){n.setNode(r,e.node(r))}),f(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},i=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+i.weight,minlen:Math.max(t.minlen,i.minlen)})}),n}function Le(e){var n=new g({multigraph:e.isMultigraph()}).setGraph(e.graph());return f(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),f(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n}function ae(e,n){var r=e.x,t=e.y,i=n.x-r,o=n.y-t,a=e.width/2,u=e.height/2;if(!i&&!o)throw new Error("Not possible to find intersection inside of the rectangle");var d,s;return Math.abs(o)*a>Math.abs(i)*u?(o<0&&(u=-u),d=u*i/o,s=u):(i<0&&(a=-a),d=a,s=a*o/i),{x:r+d,y:t+s}}function G(e){var n=w(k(Pe(e)+1),function(){return[]});return f(e.nodes(),function(r){var t=e.node(r),i=t.rank;m(i)||(n[i][t.order]=r)}),n}function rr(e){var n=P(w(e.nodes(),function(r){return e.node(r).rank}));f(e.nodes(),function(r){var t=e.node(r);Ne(t,"rank")&&(t.rank-=n)})}function tr(e){var n=P(w(e.nodes(),function(o){return e.node(o).rank})),r=[];f(e.nodes(),function(o){var a=e.node(o).rank-n;r[a]||(r[a]=[]),r[a].push(o)});var t=0,i=e.graph().nodeRankFactor;f(r,function(o,a){m(o)&&a%i!==0?--t:t&&f(o,function(u){e.node(u).rank+=t})})}function oe(e,n,r,t){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=t),N(e,"border",i,n)}function Pe(e){return y(w(e.nodes(),function(n){var r=e.node(n).rank;if(!m(r))return r}))}function ir(e,n){var r={lhs:[],rhs:[]};return f(e,function(t){n(t)?r.lhs.push(t):r.rhs.push(t)}),r}function ar(e,n){return n()}function or(e){function n(r){var t=e.children(r),i=e.node(r);if(t.length&&f(t,n),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var o=i.minRank,a=i.maxRank+1;o<a;++o)ue(e,"borderLeft","_bl",r,i,o),ue(e,"borderRight","_br",r,i,o)}}f(e.children(),n)}function ue(e,n,r,t,i,o){var a={width:0,height:0,rank:o,borderType:n},u=i[n][o-1],d=N(e,"border",a,r);i[n][o]=d,e.setParent(d,t),u&&e.setEdge(u,d,{weight:1})}function ur(e){var n=e.graph().rankdir.toLowerCase();(n==="lr"||n==="rl")&&_e(e)}function dr(e){var n=e.graph().rankdir.toLowerCase();(n==="bt"||n==="rl")&&sr(e),(n==="lr"||n==="rl")&&(fr(e),_e(e))}function _e(e){f(e.nodes(),function(n){de(e.node(n))}),f(e.edges(),function(n){de(e.edge(n))})}function de(e){var n=e.width;e.width=e.height,e.height=n}function sr(e){f(e.nodes(),function(n){$(e.node(n))}),f(e.edges(),function(n){var r=e.edge(n);f(r.points,$),Object.prototype.hasOwnProperty.call(r,"y")&&$(r)})}function $(e){e.y=-e.y}function fr(e){f(e.nodes(),function(n){D(e.node(n))}),f(e.edges(),function(n){var r=e.edge(n);f(r.points,D),Object.prototype.hasOwnProperty.call(r,"x")&&D(r)})}function D(e){var n=e.x;e.x=e.y,e.y=n}function cr(e){e.graph().dummyChains=[],f(e.edges(),function(n){lr(e,n)})}function lr(e,n){var r=n.v,t=e.node(r).rank,i=n.w,o=e.node(i).rank,a=n.name,u=e.edge(n),d=u.labelRank;if(o!==t+1){e.removeEdge(n);var s=void 0,c,l;for(l=0,++t;t<o;++l,++t)u.points=[],s={width:0,height:0,edgeLabel:u,edgeObj:n,rank:t},c=N(e,"edge",s,"_d"),t===d&&(s.width=u.width,s.height=u.height,s.dummy="edge-label",s.labelpos=u.labelpos),e.setEdge(r,c,{weight:u.weight},a),l===0&&e.graph().dummyChains.push(c),r=c;e.setEdge(r,i,{weight:u.weight},a)}}function hr(e){f(e.graph().dummyChains,function(n){var r=e.node(n),t=r.edgeLabel,i;for(e.setEdge(r.edgeObj,t);r.dummy;)i=e.successors(n)[0],e.removeNode(n),t.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height),n=i,r=e.node(n)})}function K(e){var n={};function r(t){var i=e.node(t);if(Object.prototype.hasOwnProperty.call(n,t))return i.rank;n[t]=!0;var o=P(w(e.outEdges(t),function(a){return r(a.w)-e.edge(a).minlen}));return(o===Number.POSITIVE_INFINITY||o===void 0||o===null)&&(o=0),i.rank=o}f(e.sources(),r)}function _(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function Ce(e){var n=new g({directed:!1}),r=e.nodes()[0],t=e.nodeCount();n.setNode(r,{});for(var i,o;vr(n,e)<t;)i=pr(n,e),o=n.hasNode(i.v)?_(e,i):-_(e,i),wr(n,e,o);return n}function vr(e,n){function r(t){f(n.nodeEdges(t),function(i){var o=i.v,a=t===o?i.w:o;!e.hasNode(a)&&!_(n,i)&&(e.setNode(a,{}),e.setEdge(t,a,{}),r(a))})}return f(e.nodes(),r),e.nodeCount()}function pr(e,n){return Z(n.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return _(n,r)})}function wr(e,n,r){f(e.nodes(),function(t){n.node(t).rank+=r})}function br(){}br.prototype=new Error;function Ie(e,n,r){ke(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],o={};return f(n,function(a){if(!e.hasNode(a))throw new Error("Graph does not have node: "+a);Re(e,a,r==="post",o,t,i)}),i}function Re(e,n,r,t,i,o){Object.prototype.hasOwnProperty.call(t,n)||(t[n]=!0,r||o.push(n),f(i(n),function(a){Re(e,a,r,t,i,o)}),r&&o.push(n))}function mr(e,n){return Ie(e,n,"post")}function gr(e,n){return Ie(e,n,"pre")}x.initLowLimValues=ee;x.initCutValues=Q;x.calcCutValue=Te;x.leaveEdge=Se;x.enterEdge=Fe;x.exchangeEdges=Ae;function x(e){e=nr(e),K(e);var n=Ce(e);ee(n),Q(n,e);for(var r,t;r=Se(n);)t=Fe(n,e,r),Ae(n,e,r,t)}function Q(e,n){var r=mr(e,e.nodes());r=r.slice(0,r.length-1),f(r,function(t){yr(e,n,t)})}function yr(e,n,r){var t=e.node(r),i=t.parent;e.edge(r,i).cutvalue=Te(e,n,r)}function Te(e,n,r){var t=e.node(r),i=t.parent,o=!0,a=n.edge(r,i),u=0;return a||(o=!1,a=n.edge(i,r)),u=a.weight,f(n.nodeEdges(r),function(d){var s=d.v===r,c=s?d.w:d.v;if(c!==i){var l=s===o,h=n.edge(d).weight;if(u+=l?h:-h,Er(e,r,c)){var v=e.edge(r,c).cutvalue;u+=l?-v:v}}}),u}function ee(e,n){arguments.length<2&&(n=e.nodes()[0]),Me(e,{},1,n)}function Me(e,n,r,t,i){var o=r,a=e.node(t);return n[t]=!0,f(e.neighbors(t),function(u){Object.prototype.hasOwnProperty.call(n,u)||(r=Me(e,n,r,u,t))}),a.low=o,a.lim=r++,i?a.parent=i:delete a.parent,r}function Se(e){return U(e.edges(),function(n){return e.edge(n).cutvalue<0})}function Fe(e,n,r){var t=r.v,i=r.w;n.hasEdge(t,i)||(t=r.w,i=r.v);var o=e.node(t),a=e.node(i),u=o,d=!1;o.lim>a.lim&&(u=a,d=!0);var s=I(n.edges(),function(c){return d===se(e,e.node(c.v),u)&&d!==se(e,e.node(c.w),u)});return Z(s,function(c){return _(n,c)})}function Ae(e,n,r,t){var i=r.v,o=r.w;e.removeEdge(i,o),e.setEdge(t.v,t.w,{}),ee(e),Q(e,n),xr(e,n)}function xr(e,n){var r=U(e.nodes(),function(i){return!n.node(i).parent}),t=gr(e,r);t=t.slice(1),f(t,function(i){var o=e.node(i).parent,a=n.edge(i,o),u=!1;a||(a=n.edge(o,i),u=!0),n.node(i).rank=n.node(o).rank+(u?a.minlen:-a.minlen)})}function Er(e,n,r){return e.hasEdge(n,r)}function se(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function kr(e){switch(e.graph().ranker){case"network-simplex":fe(e);break;case"tight-tree":Nr(e);break;case"longest-path":Or(e);break;default:fe(e)}}var Or=K;function Nr(e){K(e),Ce(e)}function fe(e){x(e)}function Lr(e){var n=N(e,"root",{},"_root"),r=Pr(e),t=y(E(r))-1,i=2*t+1;e.graph().nestingRoot=n,f(e.edges(),function(a){e.edge(a).minlen*=i});var o=_r(e)+1;f(e.children(),function(a){Be(e,n,i,o,t,r,a)}),e.graph().nodeRankFactor=i}function Be(e,n,r,t,i,o,a){var u=e.children(a);if(!u.length){a!==n&&e.setEdge(n,a,{weight:0,minlen:r});return}var d=oe(e,"_bt"),s=oe(e,"_bb"),c=e.node(a);e.setParent(d,a),c.borderTop=d,e.setParent(s,a),c.borderBottom=s,f(u,function(l){Be(e,n,r,t,i,o,l);var h=e.node(l),v=h.borderTop?h.borderTop:l,p=h.borderBottom?h.borderBottom:l,b=h.borderTop?t:2*t,L=v!==p?1:i-o[a]+1;e.setEdge(d,v,{weight:b,minlen:L,nestingEdge:!0}),e.setEdge(p,s,{weight:b,minlen:L,nestingEdge:!0})}),e.parent(a)||e.setEdge(n,d,{weight:0,minlen:i+o[a]})}function Pr(e){var n={};function r(t,i){var o=e.children(t);o&&o.length&&f(o,function(a){r(a,i+1)}),n[t]=i}return f(e.children(),function(t){r(t,1)}),n}function _r(e){return B(e.edges(),function(n,r){return n+e.edge(r).weight},0)}function Cr(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,f(e.edges(),function(r){var t=e.edge(r);t.nestingEdge&&e.removeEdge(r)})}function Ir(e,n,r){var t={},i;f(r,function(o){for(var a=e.parent(o),u,d;a;){if(u=e.parent(a),u?(d=t[u],t[u]=a):(d=i,i=a),d&&d!==a){n.setEdge(d,a);return}a=u}})}function Rr(e,n,r){var t=Tr(e),i=new g({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(o){return e.node(o)});return f(e.nodes(),function(o){var a=e.node(o),u=e.parent(o);(a.rank===n||a.minRank<=n&&n<=a.maxRank)&&(i.setNode(o),i.setParent(o,u||t),f(e[r](o),function(d){var s=d.v===o?d.w:d.v,c=i.edge(s,o),l=m(c)?0:c.weight;i.setEdge(s,o,{weight:e.edge(d).weight+l})}),Object.prototype.hasOwnProperty.call(a,"minRank")&&i.setNode(o,{borderLeft:a.borderLeft[n],borderRight:a.borderRight[n]}))}),i}function Tr(e){for(var n;e.hasNode(n=J("_root")););return n}function Mr(e,n){for(var r=0,t=1;t<n.length;++t)r+=Sr(e,n[t-1],n[t]);return r}function Sr(e,n,r){for(var t=Wn(r,w(r,function(s,c){return c})),i=O(w(n,function(s){return R(w(e.outEdges(s),function(c){return{pos:t[c.w],weight:e.edge(c).weight}}),"pos")})),o=1;o<r.length;)o<<=1;var a=2*o-1;o-=1;var u=w(new Array(a),function(){return 0}),d=0;return f(i.forEach(function(s){var c=s.pos+o;u[c]+=s.weight;for(var l=0;c>0;)c%2&&(l+=u[c+1]),c=c-1>>1,u[c]+=s.weight;d+=s.weight*l})),d}function Fr(e){var n={},r=I(e.nodes(),function(u){return!e.children(u).length}),t=y(w(r,function(u){return e.node(u).rank})),i=w(k(t+1),function(){return[]});function o(u){if(!Ne(n,u)){n[u]=!0;var d=e.node(u);i[d.rank].push(u),f(e.successors(u),o)}}var a=R(r,function(u){return e.node(u).rank});return f(a,o),i}function Ar(e,n){return w(n,function(r){var t=e.inEdges(r);if(t.length){var i=B(t,function(o,a){var u=e.edge(a),d=e.node(a.v);return{sum:o.sum+u.weight*d.order,weight:o.weight+u.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function Br(e,n){var r={};f(e,function(i,o){var a=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:o};m(i.barycenter)||(a.barycenter=i.barycenter,a.weight=i.weight)}),f(n.edges(),function(i){var o=r[i.v],a=r[i.w];!m(o)&&!m(a)&&(a.indegree++,o.out.push(r[i.w]))});var t=I(r,function(i){return!i.indegree});return jr(t)}function jr(e){var n=[];function r(o){return function(a){a.merged||(m(a.barycenter)||m(o.barycenter)||a.barycenter>=o.barycenter)&&Gr(o,a)}}function t(o){return function(a){a.in.push(o),--a.indegree===0&&e.push(a)}}for(;e.length;){var i=e.pop();n.push(i),f(i.in.reverse(),r(i)),f(i.out,t(i))}return w(I(n,function(o){return!o.merged}),function(o){return A(o,["vs","i","barycenter","weight"])})}function Gr(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}function Vr(e,n){var r=ir(e,function(c){return Object.prototype.hasOwnProperty.call(c,"barycenter")}),t=r.lhs,i=R(r.rhs,function(c){return-c.i}),o=[],a=0,u=0,d=0;t.sort(Yr(!!n)),d=ce(o,i,d),f(t,function(c){d+=c.vs.length,o.push(c.vs),a+=c.barycenter*c.weight,u+=c.weight,d=ce(o,i,d)});var s={vs:O(o)};return u&&(s.barycenter=a/u,s.weight=u),s}function ce(e,n,r){for(var t;n.length&&(t=F(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function Yr(e){return function(n,r){return n.barycenter<r.barycenter?-1:n.barycenter>r.barycenter?1:e?r.i-n.i:n.i-r.i}}function je(e,n,r,t){var i=e.children(n),o=e.node(n),a=o?o.borderLeft:void 0,u=o?o.borderRight:void 0,d={};a&&(i=I(i,function(p){return p!==a&&p!==u}));var s=Ar(e,i);f(s,function(p){if(e.children(p.v).length){var b=je(e,p.v,r,t);d[p.v]=b,Object.prototype.hasOwnProperty.call(b,"barycenter")&&Dr(p,b)}});var c=Br(s,r);$r(c,d);var l=Vr(c,t);if(a&&(l.vs=O([a,l.vs,u]),e.predecessors(a).length)){var h=e.node(e.predecessors(a)[0]),v=e.node(e.predecessors(u)[0]);Object.prototype.hasOwnProperty.call(l,"barycenter")||(l.barycenter=0,l.weight=0),l.barycenter=(l.barycenter*l.weight+h.order+v.order)/(l.weight+2),l.weight+=2}return l}function $r(e,n){f(e,function(r){r.vs=O(r.vs.map(function(t){return n[t]?n[t].vs:t}))})}function Dr(e,n){m(e.barycenter)?(e.barycenter=n.barycenter,e.weight=n.weight):(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight)}function qr(e){var n=Pe(e),r=le(e,k(1,n+1),"inEdges"),t=le(e,k(n-1,-1,-1),"outEdges"),i=Fr(e);he(e,i);for(var o=Number.POSITIVE_INFINITY,a,u=0,d=0;d<4;++u,++d){Wr(u%2?r:t,u%4>=2),i=G(e);var s=Mr(e,i);s<o&&(d=0,a=yn(i),o=s)}he(e,a)}function le(e,n,r){return w(n,function(t){return Rr(e,t,r)})}function Wr(e,n){var r=new g;f(e,function(t){var i=t.graph().root,o=je(t,i,r,n);f(o.vs,function(a,u){t.node(a).order=u}),Ir(t,r,o.vs)})}function he(e,n){f(n,function(r){f(r,function(t,i){e.node(t).order=i})})}function zr(e){var n=Hr(e);f(e.graph().dummyChains,function(r){for(var t=e.node(r),i=t.edgeObj,o=Xr(e,n,i.v,i.w),a=o.path,u=o.lca,d=0,s=a[d],c=!0;r!==i.w;){if(t=e.node(r),c){for(;(s=a[d])!==u&&e.node(s).maxRank<t.rank;)d++;s===u&&(c=!1)}if(!c){for(;d<a.length-1&&e.node(s=a[d+1]).minRank<=t.rank;)d++;s=a[d]}e.setParent(r,s),r=e.successors(r)[0]}})}function Xr(e,n,r,t){var i=[],o=[],a=Math.min(n[r].low,n[t].low),u=Math.max(n[r].lim,n[t].lim),d,s;d=r;do d=e.parent(d),i.push(d);while(d&&(n[d].low>a||u>n[d].lim));for(s=d,d=t;(d=e.parent(d))!==s;)o.push(d);return{path:i.concat(o.reverse()),lca:s}}function Hr(e){var n={},r=0;function t(i){var o=r;f(e.children(i),t),n[i]={low:o,lim:r++}}return f(e.children(),t),n}function Ur(e,n){var r={};function t(i,o){var a=0,u=0,d=i.length,s=F(o);return f(o,function(c,l){var h=Jr(e,c),v=h?e.node(h).order:d;(h||c===s)&&(f(o.slice(u,l+1),function(p){f(e.predecessors(p),function(b){var L=e.node(b),ne=L.order;(ne<a||v<ne)&&!(L.dummy&&e.node(p).dummy)&&Ge(r,b,p)})}),u=l+1,a=v)}),o}return B(n,t),r}function Zr(e,n){var r={};function t(o,a,u,d,s){var c;f(k(a,u),function(l){c=o[l],e.node(c).dummy&&f(e.predecessors(c),function(h){var v=e.node(h);v.dummy&&(v.order<d||v.order>s)&&Ge(r,h,c)})})}function i(o,a){var u=-1,d,s=0;return f(a,function(c,l){if(e.node(c).dummy==="border"){var h=e.predecessors(c);h.length&&(d=e.node(h[0]).order,t(a,s,l,u,d),s=l,u=d)}t(a,s,a.length,d,o.length)}),a}return B(n,i),r}function Jr(e,n){if(e.node(n).dummy)return U(e.predecessors(n),function(r){return e.node(r).dummy})}function Ge(e,n,r){if(n>r){var t=n;n=r,r=t}Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[n];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Kr(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function Qr(e,n,r,t){var i={},o={},a={};return f(n,function(u){f(u,function(d,s){i[d]=d,o[d]=d,a[d]=s})}),f(n,function(u){var d=-1;f(u,function(s){var c=t(s);if(c.length){c=R(c,function(b){return a[b]});for(var l=(c.length-1)/2,h=Math.floor(l),v=Math.ceil(l);h<=v;++h){var p=c[h];o[s]===s&&d<a[p]&&!Kr(r,s,p)&&(o[p]=s,o[s]=i[s]=i[p],d=a[p])}}})}),{root:i,align:o}}function et(e,n,r,t,i){var o={},a=nt(e,n,r,i),u=i?"borderLeft":"borderRight";function d(l,h){for(var v=a.nodes(),p=v.pop(),b={};p;)b[p]?l(p):(b[p]=!0,v.push(p),v=v.concat(h(p))),p=v.pop()}function s(l){o[l]=a.inEdges(l).reduce(function(h,v){return Math.max(h,o[v.v]+a.edge(v))},0)}function c(l){var h=a.outEdges(l).reduce(function(p,b){return Math.min(p,o[b.w]-a.edge(b))},Number.POSITIVE_INFINITY),v=e.node(l);h!==Number.POSITIVE_INFINITY&&v.borderType!==u&&(o[l]=Math.max(o[l],h))}return d(s,a.predecessors.bind(a)),d(c,a.successors.bind(a)),f(t,function(l){o[l]=o[r[l]]}),o}function nt(e,n,r,t){var i=new g,o=e.graph(),a=ot(o.nodesep,o.edgesep,t);return f(n,function(u){var d;f(u,function(s){var c=r[s];if(i.setNode(c),d){var l=r[d],h=i.edge(l,c);i.setEdge(l,c,Math.max(a(e,s,d),h||0))}d=s})}),i}function rt(e,n){return Z(E(n),function(r){var t=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return Ln(r,function(o,a){var u=ut(e,a)/2;t=Math.max(o+u,t),i=Math.min(o-u,i)}),t-i})}function tt(e,n){var r=E(n),t=P(r),i=y(r);f(["u","d"],function(o){f(["l","r"],function(a){var u=o+a,d=e[u],s;if(d!==n){var c=E(d);s=a==="l"?t-P(c):i-y(c),s&&(e[u]=j(d,function(l){return l+s}))}})})}function it(e,n){return j(e.ul,function(r,t){if(n)return e[n.toLowerCase()][t];var i=R(w(e,t));return(i[1]+i[2])/2})}function at(e){var n=G(e),r=X(Ur(e,n),Zr(e,n)),t={},i;f(["u","d"],function(a){i=a==="u"?n:E(n).reverse(),f(["l","r"],function(u){u==="r"&&(i=w(i,function(l){return E(l).reverse()}));var d=(a==="u"?e.predecessors:e.successors).bind(e),s=Qr(e,i,r,d),c=et(e,i,s.root,s.align,u==="r");u==="r"&&(c=j(c,function(l){return-l})),t[a+u]=c})});var o=rt(e,t);return tt(t,o),it(t,e.graph().align)}function ot(e,n,r){return function(t,i,o){var a=t.node(i),u=t.node(o),d=0,s;if(d+=a.width/2,Object.prototype.hasOwnProperty.call(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":s=-a.width/2;break;case"r":s=a.width/2;break}if(s&&(d+=r?s:-s),s=0,d+=(a.dummy?n:e)/2,d+=(u.dummy?n:e)/2,d+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":s=u.width/2;break;case"r":s=-u.width/2;break}return s&&(d+=r?s:-s),s=0,d}}function ut(e,n){return e.node(n).width}function dt(e){e=Le(e),st(e),Pn(at(e),function(n,r){e.node(r).x=n})}function st(e){var n=G(e),r=e.graph().ranksep,t=0;f(n,function(i){var o=y(w(i,function(a){return e.node(a).height}));f(i,function(a){e.node(a).y=t+o/2}),t+=o+r})}function Bt(e,n){var r=ar;r("layout",()=>{var t=r(" buildLayoutGraph",()=>yt(e));r(" runLayout",()=>ft(t,r)),r(" updateInputGraph",()=>ct(e,t))})}function ft(e,n){n(" makeSpaceForEdgeLabels",()=>xt(e)),n(" removeSelfEdges",()=>It(e)),n(" acyclic",()=>Kn(e)),n(" nestingGraph.run",()=>Lr(e)),n(" rank",()=>kr(Le(e))),n(" injectEdgeLabelProxies",()=>Et(e)),n(" removeEmptyRanks",()=>tr(e)),n(" nestingGraph.cleanup",()=>Cr(e)),n(" normalizeRanks",()=>rr(e)),n(" assignRankMinMax",()=>kt(e)),n(" removeEdgeLabelProxies",()=>Ot(e)),n(" normalize.run",()=>cr(e)),n(" parentDummyChains",()=>zr(e)),n(" addBorderSegments",()=>or(e)),n(" order",()=>qr(e)),n(" insertSelfEdges",()=>Rt(e)),n(" adjustCoordinateSystem",()=>ur(e)),n(" position",()=>dt(e)),n(" positionSelfEdges",()=>Tt(e)),n(" removeBorderNodes",()=>Ct(e)),n(" normalize.undo",()=>hr(e)),n(" fixupEdgeLabelCoords",()=>Pt(e)),n(" undoCoordinateSystem",()=>dr(e)),n(" translateGraph",()=>Nt(e)),n(" assignNodeIntersects",()=>Lt(e)),n(" reversePoints",()=>_t(e)),n(" acyclic.undo",()=>er(e))}function ct(e,n){f(e.nodes(),function(r){var t=e.node(r),i=n.node(r);t&&(t.x=i.x,t.y=i.y,n.children(r).length&&(t.width=i.width,t.height=i.height))}),f(e.edges(),function(r){var t=e.edge(r),i=n.edge(r);t.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(t.x=i.x,t.y=i.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}var lt=["nodesep","edgesep","ranksep","marginx","marginy"],ht={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},vt=["acyclicer","ranker","rankdir","align"],pt=["width","height"],wt={width:0,height:0},bt=["minlen","weight","width","height","labeloffset"],mt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},gt=["labelpos"];function yt(e){var n=new g({multigraph:!0,compound:!0}),r=W(e.graph());return n.setGraph(X({},ht,q(r,lt),A(r,vt))),f(e.nodes(),function(t){var i=W(e.node(t));n.setNode(t,En(q(i,pt),wt)),n.setParent(t,e.parent(t))}),f(e.edges(),function(t){var i=W(e.edge(t));n.setEdge(t,X({},mt,q(i,bt),A(i,gt)))}),n}function xt(e){var n=e.graph();n.ranksep/=2,f(e.edges(),function(r){var t=e.edge(r);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function Et(e){f(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),i=e.node(n.w),o={rank:(i.rank-t.rank)/2+t.rank,e:n};N(e,"edge-proxy",o,"_ep")}})}function kt(e){var n=0;f(e.nodes(),function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=y(n,t.maxRank))}),e.graph().maxRank=n}function Ot(e){f(e.nodes(),function(n){var r=e.node(n);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}function Nt(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,i=0,o=e.graph(),a=o.marginx||0,u=o.marginy||0;function d(s){var c=s.x,l=s.y,h=s.width,v=s.height;n=Math.min(n,c-h/2),r=Math.max(r,c+h/2),t=Math.min(t,l-v/2),i=Math.max(i,l+v/2)}f(e.nodes(),function(s){d(e.node(s))}),f(e.edges(),function(s){var c=e.edge(s);Object.prototype.hasOwnProperty.call(c,"x")&&d(c)}),n-=a,t-=u,f(e.nodes(),function(s){var c=e.node(s);c.x-=n,c.y-=t}),f(e.edges(),function(s){var c=e.edge(s);f(c.points,function(l){l.x-=n,l.y-=t}),Object.prototype.hasOwnProperty.call(c,"x")&&(c.x-=n),Object.prototype.hasOwnProperty.call(c,"y")&&(c.y-=t)}),o.width=r-n+a,o.height=i-t+u}function Lt(e){f(e.edges(),function(n){var r=e.edge(n),t=e.node(n.v),i=e.node(n.w),o,a;r.points?(o=r.points[0],a=r.points[r.points.length-1]):(r.points=[],o=i,a=t),r.points.unshift(ae(t,o)),r.points.push(ae(i,a))})}function Pt(e){f(e.edges(),function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function _t(e){f(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}function Ct(e){f(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),i=e.node(r.borderBottom),o=e.node(F(r.borderLeft)),a=e.node(F(r.borderRight));r.width=Math.abs(a.x-o.x),r.height=Math.abs(i.y-t.y),r.x=o.x+r.width/2,r.y=t.y+r.height/2}}),f(e.nodes(),function(n){e.node(n).dummy==="border"&&e.removeNode(n)})}function It(e){f(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}function Rt(e){var n=G(e);f(n,function(r){var t=0;f(r,function(i,o){var a=e.node(i);a.order=o+t,f(a.selfEdges,function(u){N(e,"selfedge",{width:u.label.width,height:u.label.height,rank:a.rank,order:o+ ++t,e:u.e,label:u.label},"_se")}),delete a.selfEdges})})}function Tt(e){f(e.nodes(),function(n){var r=e.node(n);if(r.dummy==="selfedge"){var t=e.node(r.e.v),i=t.x+t.width/2,o=t.y,a=r.x-i,u=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:i+2*a/3,y:o-u},{x:i+5*a/6,y:o-u},{x:i+a,y:o},{x:i+5*a/6,y:o+u},{x:i+2*a/3,y:o+u}],r.label.x=r.x,r.label.y=r.y}})}function q(e,n){return j(A(e,n),Number)}function W(e){var n={};return f(e,function(r,t){n[t.toLowerCase()]=r}),n}export{Bt as l};
1
+ import{b as Ve,G as g,i as m,v as E}from"./graph-Dtxc2PT4.js";import{i as z,c as C,k as Ye,o as $e,p as ve,q as pe,t as De,u as we,v as qe,w as be,d as V,x as We,b as ze,y as Xe,n as f,m as I,r as B}from"./_baseUniq-BrhDuG3C.js";import{f as O,b as me,a as He,c as Ue,m as w,d as P}from"./min-Jl4GV9DB.js";import{a$ as M,by as Ze,bz as Je,b6 as ge,bA as S,aS as ye,br as Ke,aG as Qe,bw as en,bB as nn,aI as xe,bv as rn,b5 as Ee,aH as ke,aZ as tn,b8 as an,bC as X}from"./mermaid.core-bouKOnsR.js";var on=/\s/;function un(e){for(var n=e.length;n--&&on.test(e.charAt(n)););return n}var dn=/^\s+/;function sn(e){return e&&e.slice(0,un(e)+1).replace(dn,"")}var re=NaN,fn=/^[-+]0x[0-9a-f]+$/i,cn=/^0b[01]+$/i,ln=/^0o[0-7]+$/i,hn=parseInt;function vn(e){if(typeof e=="number")return e;if(z(e))return re;if(M(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=M(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=sn(e);var r=cn.test(e);return r||ln.test(e)?hn(e.slice(2),r?2:8):fn.test(e)?re:+e}var te=1/0,pn=17976931348623157e292;function T(e){if(!e)return e===0?e:0;if(e=vn(e),e===te||e===-te){var n=e<0?-1:1;return n*pn}return e===e?e:0}function wn(e){var n=T(e),r=n%1;return n===n?r?n-r:n:0}function bn(e){return Ze(Je(e,void 0,O),e+"")}var mn=1,gn=4;function yn(e){return Ve(e,mn|gn)}var Oe=Object.prototype,xn=Oe.hasOwnProperty,En=ge(function(e,n){e=Object(e);var r=-1,t=n.length,i=t>2?n[2]:void 0;for(i&&S(n[0],n[1],i)&&(t=1);++r<t;)for(var o=n[r],a=ye(o),u=-1,d=a.length;++u<d;){var s=a[u],c=e[s];(c===void 0||Ke(c,Oe[s])&&!xn.call(e,s))&&(e[s]=o[s])}return e});function F(e){var n=e==null?0:e.length;return n?e[n-1]:void 0}function kn(e){return function(n,r,t){var i=Object(n);if(!Qe(n)){var o=C(r);n=Ye(n),r=function(u){return o(i[u],u,i)}}var a=e(n,r,t);return a>-1?i[o?n[a]:a]:void 0}}var On=Math.max;function Nn(e,n,r){var t=e==null?0:e.length;if(!t)return-1;var i=r==null?0:wn(r);return i<0&&(i=On(t+i,0)),$e(e,C(n),i)}var U=kn(Nn);function Ln(e,n){return e==null?e:en(e,ve(n),ye)}function Pn(e,n){return e&&pe(e,ve(n))}function _n(e,n){return e>n}var Cn=Object.prototype,In=Cn.hasOwnProperty;function Rn(e,n){return e!=null&&In.call(e,n)}function Ne(e,n){return e!=null&&De(e,n,Rn)}function j(e,n){var r={};return n=C(n),pe(e,function(t,i,o){nn(r,i,n(t,i,o))}),r}function y(e){return e&&e.length?me(e,xe,_n):void 0}function Z(e,n){return e&&e.length?me(e,C(n),He):void 0}function Tn(e,n,r,t){if(!M(e))return e;n=we(n,e);for(var i=-1,o=n.length,a=o-1,u=e;u!=null&&++i<o;){var d=qe(n[i]),s=r;if(d==="__proto__"||d==="constructor"||d==="prototype")return e;if(i!=a){var c=u[d];s=void 0,s===void 0&&(s=M(c)?c:rn(n[i+1])?[]:{})}Ee(u,d,s),u=u[d]}return e}function Mn(e,n,r){for(var t=-1,i=n.length,o={};++t<i;){var a=n[t],u=be(e,a);r(u,a)&&Tn(o,we(a,e),u)}return o}function Sn(e,n){var r=e.length;for(e.sort(n);r--;)e[r]=e[r].value;return e}function Fn(e,n){if(e!==n){var r=e!==void 0,t=e===null,i=e===e,o=z(e),a=n!==void 0,u=n===null,d=n===n,s=z(n);if(!u&&!s&&!o&&e>n||o&&a&&d&&!u&&!s||t&&a&&d||!r&&d||!i)return 1;if(!t&&!o&&!s&&e<n||s&&r&&i&&!t&&!o||u&&r&&i||!a&&i||!d)return-1}return 0}function An(e,n,r){for(var t=-1,i=e.criteria,o=n.criteria,a=i.length,u=r.length;++t<a;){var d=Fn(i[t],o[t]);if(d){if(t>=u)return d;var s=r[t];return d*(s=="desc"?-1:1)}}return e.index-n.index}function Bn(e,n,r){n.length?n=V(n,function(o){return ke(o)?function(a){return be(a,o.length===1?o[0]:o)}:o}):n=[xe];var t=-1;n=V(n,tn(C));var i=Ue(e,function(o,a,u){var d=V(n,function(s){return s(o)});return{criteria:d,index:++t,value:o}});return Sn(i,function(o,a){return An(o,a,r)})}function jn(e,n){return Mn(e,n,function(r,t){return We(e,t)})}var A=bn(function(e,n){return e==null?{}:jn(e,n)}),Gn=Math.ceil,Vn=Math.max;function Yn(e,n,r,t){for(var i=-1,o=Vn(Gn((n-e)/(r||1)),0),a=Array(o);o--;)a[++i]=e,e+=r;return a}function $n(e){return function(n,r,t){return t&&typeof t!="number"&&S(n,r,t)&&(r=t=void 0),n=T(n),r===void 0?(r=n,n=0):r=T(r),t=t===void 0?n<r?1:-1:T(t),Yn(n,r,t)}}var k=$n(),R=ge(function(e,n){if(e==null)return[];var r=n.length;return r>1&&S(e,n[0],n[1])?n=[]:r>2&&S(n[0],n[1],n[2])&&(n=[n[0]]),Bn(e,ze(n),[])}),Dn=0;function J(e){var n=++Dn;return Xe(e)+n}function qn(e,n,r){for(var t=-1,i=e.length,o=n.length,a={};++t<i;){var u=t<o?n[t]:void 0;r(a,e[t],u)}return a}function Wn(e,n){return qn(e||[],n||[],Ee)}class zn{constructor(){var n={};n._next=n._prev=n,this._sentinel=n}dequeue(){var n=this._sentinel,r=n._prev;if(r!==n)return ie(r),r}enqueue(n){var r=this._sentinel;n._prev&&n._next&&ie(n),n._next=r._next,r._next._prev=n,r._next=n,n._prev=r}toString(){for(var n=[],r=this._sentinel,t=r._prev;t!==r;)n.push(JSON.stringify(t,Xn)),t=t._prev;return"["+n.join(", ")+"]"}}function ie(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Xn(e,n){if(e!=="_next"&&e!=="_prev")return n}var Hn=an(1);function Un(e,n){if(e.nodeCount()<=1)return[];var r=Jn(e,n||Hn),t=Zn(r.graph,r.buckets,r.zeroIdx);return O(w(t,function(i){return e.outEdges(i.v,i.w)}))}function Zn(e,n,r){for(var t=[],i=n[n.length-1],o=n[0],a;e.nodeCount();){for(;a=o.dequeue();)Y(e,n,r,a);for(;a=i.dequeue();)Y(e,n,r,a);if(e.nodeCount()){for(var u=n.length-2;u>0;--u)if(a=n[u].dequeue(),a){t=t.concat(Y(e,n,r,a,!0));break}}}return t}function Y(e,n,r,t,i){var o=i?[]:void 0;return f(e.inEdges(t.v),function(a){var u=e.edge(a),d=e.node(a.v);i&&o.push({v:a.v,w:a.w}),d.out-=u,H(n,r,d)}),f(e.outEdges(t.v),function(a){var u=e.edge(a),d=a.w,s=e.node(d);s.in-=u,H(n,r,s)}),e.removeNode(t.v),o}function Jn(e,n){var r=new g,t=0,i=0;f(e.nodes(),function(u){r.setNode(u,{v:u,in:0,out:0})}),f(e.edges(),function(u){var d=r.edge(u.v,u.w)||0,s=n(u),c=d+s;r.setEdge(u.v,u.w,c),i=Math.max(i,r.node(u.v).out+=s),t=Math.max(t,r.node(u.w).in+=s)});var o=k(i+t+3).map(function(){return new zn}),a=t+1;return f(r.nodes(),function(u){H(o,a,r.node(u))}),{graph:r,buckets:o,zeroIdx:a}}function H(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function Kn(e){var n=e.graph().acyclicer==="greedy"?Un(e,r(e)):Qn(e);f(n,function(t){var i=e.edge(t);e.removeEdge(t),i.forwardName=t.name,i.reversed=!0,e.setEdge(t.w,t.v,i,J("rev"))});function r(t){return function(i){return t.edge(i).weight}}}function Qn(e){var n=[],r={},t={};function i(o){Object.prototype.hasOwnProperty.call(t,o)||(t[o]=!0,r[o]=!0,f(e.outEdges(o),function(a){Object.prototype.hasOwnProperty.call(r,a.w)?n.push(a):i(a.w)}),delete r[o])}return f(e.nodes(),i),n}function er(e){f(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}})}function N(e,n,r,t){var i;do i=J(t);while(e.hasNode(i));return r.dummy=n,e.setNode(i,r),i}function nr(e){var n=new g().setGraph(e.graph());return f(e.nodes(),function(r){n.setNode(r,e.node(r))}),f(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},i=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+i.weight,minlen:Math.max(t.minlen,i.minlen)})}),n}function Le(e){var n=new g({multigraph:e.isMultigraph()}).setGraph(e.graph());return f(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),f(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n}function ae(e,n){var r=e.x,t=e.y,i=n.x-r,o=n.y-t,a=e.width/2,u=e.height/2;if(!i&&!o)throw new Error("Not possible to find intersection inside of the rectangle");var d,s;return Math.abs(o)*a>Math.abs(i)*u?(o<0&&(u=-u),d=u*i/o,s=u):(i<0&&(a=-a),d=a,s=a*o/i),{x:r+d,y:t+s}}function G(e){var n=w(k(Pe(e)+1),function(){return[]});return f(e.nodes(),function(r){var t=e.node(r),i=t.rank;m(i)||(n[i][t.order]=r)}),n}function rr(e){var n=P(w(e.nodes(),function(r){return e.node(r).rank}));f(e.nodes(),function(r){var t=e.node(r);Ne(t,"rank")&&(t.rank-=n)})}function tr(e){var n=P(w(e.nodes(),function(o){return e.node(o).rank})),r=[];f(e.nodes(),function(o){var a=e.node(o).rank-n;r[a]||(r[a]=[]),r[a].push(o)});var t=0,i=e.graph().nodeRankFactor;f(r,function(o,a){m(o)&&a%i!==0?--t:t&&f(o,function(u){e.node(u).rank+=t})})}function oe(e,n,r,t){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=t),N(e,"border",i,n)}function Pe(e){return y(w(e.nodes(),function(n){var r=e.node(n).rank;if(!m(r))return r}))}function ir(e,n){var r={lhs:[],rhs:[]};return f(e,function(t){n(t)?r.lhs.push(t):r.rhs.push(t)}),r}function ar(e,n){return n()}function or(e){function n(r){var t=e.children(r),i=e.node(r);if(t.length&&f(t,n),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var o=i.minRank,a=i.maxRank+1;o<a;++o)ue(e,"borderLeft","_bl",r,i,o),ue(e,"borderRight","_br",r,i,o)}}f(e.children(),n)}function ue(e,n,r,t,i,o){var a={width:0,height:0,rank:o,borderType:n},u=i[n][o-1],d=N(e,"border",a,r);i[n][o]=d,e.setParent(d,t),u&&e.setEdge(u,d,{weight:1})}function ur(e){var n=e.graph().rankdir.toLowerCase();(n==="lr"||n==="rl")&&_e(e)}function dr(e){var n=e.graph().rankdir.toLowerCase();(n==="bt"||n==="rl")&&sr(e),(n==="lr"||n==="rl")&&(fr(e),_e(e))}function _e(e){f(e.nodes(),function(n){de(e.node(n))}),f(e.edges(),function(n){de(e.edge(n))})}function de(e){var n=e.width;e.width=e.height,e.height=n}function sr(e){f(e.nodes(),function(n){$(e.node(n))}),f(e.edges(),function(n){var r=e.edge(n);f(r.points,$),Object.prototype.hasOwnProperty.call(r,"y")&&$(r)})}function $(e){e.y=-e.y}function fr(e){f(e.nodes(),function(n){D(e.node(n))}),f(e.edges(),function(n){var r=e.edge(n);f(r.points,D),Object.prototype.hasOwnProperty.call(r,"x")&&D(r)})}function D(e){var n=e.x;e.x=e.y,e.y=n}function cr(e){e.graph().dummyChains=[],f(e.edges(),function(n){lr(e,n)})}function lr(e,n){var r=n.v,t=e.node(r).rank,i=n.w,o=e.node(i).rank,a=n.name,u=e.edge(n),d=u.labelRank;if(o!==t+1){e.removeEdge(n);var s=void 0,c,l;for(l=0,++t;t<o;++l,++t)u.points=[],s={width:0,height:0,edgeLabel:u,edgeObj:n,rank:t},c=N(e,"edge",s,"_d"),t===d&&(s.width=u.width,s.height=u.height,s.dummy="edge-label",s.labelpos=u.labelpos),e.setEdge(r,c,{weight:u.weight},a),l===0&&e.graph().dummyChains.push(c),r=c;e.setEdge(r,i,{weight:u.weight},a)}}function hr(e){f(e.graph().dummyChains,function(n){var r=e.node(n),t=r.edgeLabel,i;for(e.setEdge(r.edgeObj,t);r.dummy;)i=e.successors(n)[0],e.removeNode(n),t.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height),n=i,r=e.node(n)})}function K(e){var n={};function r(t){var i=e.node(t);if(Object.prototype.hasOwnProperty.call(n,t))return i.rank;n[t]=!0;var o=P(w(e.outEdges(t),function(a){return r(a.w)-e.edge(a).minlen}));return(o===Number.POSITIVE_INFINITY||o===void 0||o===null)&&(o=0),i.rank=o}f(e.sources(),r)}function _(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function Ce(e){var n=new g({directed:!1}),r=e.nodes()[0],t=e.nodeCount();n.setNode(r,{});for(var i,o;vr(n,e)<t;)i=pr(n,e),o=n.hasNode(i.v)?_(e,i):-_(e,i),wr(n,e,o);return n}function vr(e,n){function r(t){f(n.nodeEdges(t),function(i){var o=i.v,a=t===o?i.w:o;!e.hasNode(a)&&!_(n,i)&&(e.setNode(a,{}),e.setEdge(t,a,{}),r(a))})}return f(e.nodes(),r),e.nodeCount()}function pr(e,n){return Z(n.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return _(n,r)})}function wr(e,n,r){f(e.nodes(),function(t){n.node(t).rank+=r})}function br(){}br.prototype=new Error;function Ie(e,n,r){ke(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],o={};return f(n,function(a){if(!e.hasNode(a))throw new Error("Graph does not have node: "+a);Re(e,a,r==="post",o,t,i)}),i}function Re(e,n,r,t,i,o){Object.prototype.hasOwnProperty.call(t,n)||(t[n]=!0,r||o.push(n),f(i(n),function(a){Re(e,a,r,t,i,o)}),r&&o.push(n))}function mr(e,n){return Ie(e,n,"post")}function gr(e,n){return Ie(e,n,"pre")}x.initLowLimValues=ee;x.initCutValues=Q;x.calcCutValue=Te;x.leaveEdge=Se;x.enterEdge=Fe;x.exchangeEdges=Ae;function x(e){e=nr(e),K(e);var n=Ce(e);ee(n),Q(n,e);for(var r,t;r=Se(n);)t=Fe(n,e,r),Ae(n,e,r,t)}function Q(e,n){var r=mr(e,e.nodes());r=r.slice(0,r.length-1),f(r,function(t){yr(e,n,t)})}function yr(e,n,r){var t=e.node(r),i=t.parent;e.edge(r,i).cutvalue=Te(e,n,r)}function Te(e,n,r){var t=e.node(r),i=t.parent,o=!0,a=n.edge(r,i),u=0;return a||(o=!1,a=n.edge(i,r)),u=a.weight,f(n.nodeEdges(r),function(d){var s=d.v===r,c=s?d.w:d.v;if(c!==i){var l=s===o,h=n.edge(d).weight;if(u+=l?h:-h,Er(e,r,c)){var v=e.edge(r,c).cutvalue;u+=l?-v:v}}}),u}function ee(e,n){arguments.length<2&&(n=e.nodes()[0]),Me(e,{},1,n)}function Me(e,n,r,t,i){var o=r,a=e.node(t);return n[t]=!0,f(e.neighbors(t),function(u){Object.prototype.hasOwnProperty.call(n,u)||(r=Me(e,n,r,u,t))}),a.low=o,a.lim=r++,i?a.parent=i:delete a.parent,r}function Se(e){return U(e.edges(),function(n){return e.edge(n).cutvalue<0})}function Fe(e,n,r){var t=r.v,i=r.w;n.hasEdge(t,i)||(t=r.w,i=r.v);var o=e.node(t),a=e.node(i),u=o,d=!1;o.lim>a.lim&&(u=a,d=!0);var s=I(n.edges(),function(c){return d===se(e,e.node(c.v),u)&&d!==se(e,e.node(c.w),u)});return Z(s,function(c){return _(n,c)})}function Ae(e,n,r,t){var i=r.v,o=r.w;e.removeEdge(i,o),e.setEdge(t.v,t.w,{}),ee(e),Q(e,n),xr(e,n)}function xr(e,n){var r=U(e.nodes(),function(i){return!n.node(i).parent}),t=gr(e,r);t=t.slice(1),f(t,function(i){var o=e.node(i).parent,a=n.edge(i,o),u=!1;a||(a=n.edge(o,i),u=!0),n.node(i).rank=n.node(o).rank+(u?a.minlen:-a.minlen)})}function Er(e,n,r){return e.hasEdge(n,r)}function se(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function kr(e){switch(e.graph().ranker){case"network-simplex":fe(e);break;case"tight-tree":Nr(e);break;case"longest-path":Or(e);break;default:fe(e)}}var Or=K;function Nr(e){K(e),Ce(e)}function fe(e){x(e)}function Lr(e){var n=N(e,"root",{},"_root"),r=Pr(e),t=y(E(r))-1,i=2*t+1;e.graph().nestingRoot=n,f(e.edges(),function(a){e.edge(a).minlen*=i});var o=_r(e)+1;f(e.children(),function(a){Be(e,n,i,o,t,r,a)}),e.graph().nodeRankFactor=i}function Be(e,n,r,t,i,o,a){var u=e.children(a);if(!u.length){a!==n&&e.setEdge(n,a,{weight:0,minlen:r});return}var d=oe(e,"_bt"),s=oe(e,"_bb"),c=e.node(a);e.setParent(d,a),c.borderTop=d,e.setParent(s,a),c.borderBottom=s,f(u,function(l){Be(e,n,r,t,i,o,l);var h=e.node(l),v=h.borderTop?h.borderTop:l,p=h.borderBottom?h.borderBottom:l,b=h.borderTop?t:2*t,L=v!==p?1:i-o[a]+1;e.setEdge(d,v,{weight:b,minlen:L,nestingEdge:!0}),e.setEdge(p,s,{weight:b,minlen:L,nestingEdge:!0})}),e.parent(a)||e.setEdge(n,d,{weight:0,minlen:i+o[a]})}function Pr(e){var n={};function r(t,i){var o=e.children(t);o&&o.length&&f(o,function(a){r(a,i+1)}),n[t]=i}return f(e.children(),function(t){r(t,1)}),n}function _r(e){return B(e.edges(),function(n,r){return n+e.edge(r).weight},0)}function Cr(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,f(e.edges(),function(r){var t=e.edge(r);t.nestingEdge&&e.removeEdge(r)})}function Ir(e,n,r){var t={},i;f(r,function(o){for(var a=e.parent(o),u,d;a;){if(u=e.parent(a),u?(d=t[u],t[u]=a):(d=i,i=a),d&&d!==a){n.setEdge(d,a);return}a=u}})}function Rr(e,n,r){var t=Tr(e),i=new g({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(o){return e.node(o)});return f(e.nodes(),function(o){var a=e.node(o),u=e.parent(o);(a.rank===n||a.minRank<=n&&n<=a.maxRank)&&(i.setNode(o),i.setParent(o,u||t),f(e[r](o),function(d){var s=d.v===o?d.w:d.v,c=i.edge(s,o),l=m(c)?0:c.weight;i.setEdge(s,o,{weight:e.edge(d).weight+l})}),Object.prototype.hasOwnProperty.call(a,"minRank")&&i.setNode(o,{borderLeft:a.borderLeft[n],borderRight:a.borderRight[n]}))}),i}function Tr(e){for(var n;e.hasNode(n=J("_root")););return n}function Mr(e,n){for(var r=0,t=1;t<n.length;++t)r+=Sr(e,n[t-1],n[t]);return r}function Sr(e,n,r){for(var t=Wn(r,w(r,function(s,c){return c})),i=O(w(n,function(s){return R(w(e.outEdges(s),function(c){return{pos:t[c.w],weight:e.edge(c).weight}}),"pos")})),o=1;o<r.length;)o<<=1;var a=2*o-1;o-=1;var u=w(new Array(a),function(){return 0}),d=0;return f(i.forEach(function(s){var c=s.pos+o;u[c]+=s.weight;for(var l=0;c>0;)c%2&&(l+=u[c+1]),c=c-1>>1,u[c]+=s.weight;d+=s.weight*l})),d}function Fr(e){var n={},r=I(e.nodes(),function(u){return!e.children(u).length}),t=y(w(r,function(u){return e.node(u).rank})),i=w(k(t+1),function(){return[]});function o(u){if(!Ne(n,u)){n[u]=!0;var d=e.node(u);i[d.rank].push(u),f(e.successors(u),o)}}var a=R(r,function(u){return e.node(u).rank});return f(a,o),i}function Ar(e,n){return w(n,function(r){var t=e.inEdges(r);if(t.length){var i=B(t,function(o,a){var u=e.edge(a),d=e.node(a.v);return{sum:o.sum+u.weight*d.order,weight:o.weight+u.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function Br(e,n){var r={};f(e,function(i,o){var a=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:o};m(i.barycenter)||(a.barycenter=i.barycenter,a.weight=i.weight)}),f(n.edges(),function(i){var o=r[i.v],a=r[i.w];!m(o)&&!m(a)&&(a.indegree++,o.out.push(r[i.w]))});var t=I(r,function(i){return!i.indegree});return jr(t)}function jr(e){var n=[];function r(o){return function(a){a.merged||(m(a.barycenter)||m(o.barycenter)||a.barycenter>=o.barycenter)&&Gr(o,a)}}function t(o){return function(a){a.in.push(o),--a.indegree===0&&e.push(a)}}for(;e.length;){var i=e.pop();n.push(i),f(i.in.reverse(),r(i)),f(i.out,t(i))}return w(I(n,function(o){return!o.merged}),function(o){return A(o,["vs","i","barycenter","weight"])})}function Gr(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}function Vr(e,n){var r=ir(e,function(c){return Object.prototype.hasOwnProperty.call(c,"barycenter")}),t=r.lhs,i=R(r.rhs,function(c){return-c.i}),o=[],a=0,u=0,d=0;t.sort(Yr(!!n)),d=ce(o,i,d),f(t,function(c){d+=c.vs.length,o.push(c.vs),a+=c.barycenter*c.weight,u+=c.weight,d=ce(o,i,d)});var s={vs:O(o)};return u&&(s.barycenter=a/u,s.weight=u),s}function ce(e,n,r){for(var t;n.length&&(t=F(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function Yr(e){return function(n,r){return n.barycenter<r.barycenter?-1:n.barycenter>r.barycenter?1:e?r.i-n.i:n.i-r.i}}function je(e,n,r,t){var i=e.children(n),o=e.node(n),a=o?o.borderLeft:void 0,u=o?o.borderRight:void 0,d={};a&&(i=I(i,function(p){return p!==a&&p!==u}));var s=Ar(e,i);f(s,function(p){if(e.children(p.v).length){var b=je(e,p.v,r,t);d[p.v]=b,Object.prototype.hasOwnProperty.call(b,"barycenter")&&Dr(p,b)}});var c=Br(s,r);$r(c,d);var l=Vr(c,t);if(a&&(l.vs=O([a,l.vs,u]),e.predecessors(a).length)){var h=e.node(e.predecessors(a)[0]),v=e.node(e.predecessors(u)[0]);Object.prototype.hasOwnProperty.call(l,"barycenter")||(l.barycenter=0,l.weight=0),l.barycenter=(l.barycenter*l.weight+h.order+v.order)/(l.weight+2),l.weight+=2}return l}function $r(e,n){f(e,function(r){r.vs=O(r.vs.map(function(t){return n[t]?n[t].vs:t}))})}function Dr(e,n){m(e.barycenter)?(e.barycenter=n.barycenter,e.weight=n.weight):(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight)}function qr(e){var n=Pe(e),r=le(e,k(1,n+1),"inEdges"),t=le(e,k(n-1,-1,-1),"outEdges"),i=Fr(e);he(e,i);for(var o=Number.POSITIVE_INFINITY,a,u=0,d=0;d<4;++u,++d){Wr(u%2?r:t,u%4>=2),i=G(e);var s=Mr(e,i);s<o&&(d=0,a=yn(i),o=s)}he(e,a)}function le(e,n,r){return w(n,function(t){return Rr(e,t,r)})}function Wr(e,n){var r=new g;f(e,function(t){var i=t.graph().root,o=je(t,i,r,n);f(o.vs,function(a,u){t.node(a).order=u}),Ir(t,r,o.vs)})}function he(e,n){f(n,function(r){f(r,function(t,i){e.node(t).order=i})})}function zr(e){var n=Hr(e);f(e.graph().dummyChains,function(r){for(var t=e.node(r),i=t.edgeObj,o=Xr(e,n,i.v,i.w),a=o.path,u=o.lca,d=0,s=a[d],c=!0;r!==i.w;){if(t=e.node(r),c){for(;(s=a[d])!==u&&e.node(s).maxRank<t.rank;)d++;s===u&&(c=!1)}if(!c){for(;d<a.length-1&&e.node(s=a[d+1]).minRank<=t.rank;)d++;s=a[d]}e.setParent(r,s),r=e.successors(r)[0]}})}function Xr(e,n,r,t){var i=[],o=[],a=Math.min(n[r].low,n[t].low),u=Math.max(n[r].lim,n[t].lim),d,s;d=r;do d=e.parent(d),i.push(d);while(d&&(n[d].low>a||u>n[d].lim));for(s=d,d=t;(d=e.parent(d))!==s;)o.push(d);return{path:i.concat(o.reverse()),lca:s}}function Hr(e){var n={},r=0;function t(i){var o=r;f(e.children(i),t),n[i]={low:o,lim:r++}}return f(e.children(),t),n}function Ur(e,n){var r={};function t(i,o){var a=0,u=0,d=i.length,s=F(o);return f(o,function(c,l){var h=Jr(e,c),v=h?e.node(h).order:d;(h||c===s)&&(f(o.slice(u,l+1),function(p){f(e.predecessors(p),function(b){var L=e.node(b),ne=L.order;(ne<a||v<ne)&&!(L.dummy&&e.node(p).dummy)&&Ge(r,b,p)})}),u=l+1,a=v)}),o}return B(n,t),r}function Zr(e,n){var r={};function t(o,a,u,d,s){var c;f(k(a,u),function(l){c=o[l],e.node(c).dummy&&f(e.predecessors(c),function(h){var v=e.node(h);v.dummy&&(v.order<d||v.order>s)&&Ge(r,h,c)})})}function i(o,a){var u=-1,d,s=0;return f(a,function(c,l){if(e.node(c).dummy==="border"){var h=e.predecessors(c);h.length&&(d=e.node(h[0]).order,t(a,s,l,u,d),s=l,u=d)}t(a,s,a.length,d,o.length)}),a}return B(n,i),r}function Jr(e,n){if(e.node(n).dummy)return U(e.predecessors(n),function(r){return e.node(r).dummy})}function Ge(e,n,r){if(n>r){var t=n;n=r,r=t}Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[n];Object.defineProperty(i,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Kr(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function Qr(e,n,r,t){var i={},o={},a={};return f(n,function(u){f(u,function(d,s){i[d]=d,o[d]=d,a[d]=s})}),f(n,function(u){var d=-1;f(u,function(s){var c=t(s);if(c.length){c=R(c,function(b){return a[b]});for(var l=(c.length-1)/2,h=Math.floor(l),v=Math.ceil(l);h<=v;++h){var p=c[h];o[s]===s&&d<a[p]&&!Kr(r,s,p)&&(o[p]=s,o[s]=i[s]=i[p],d=a[p])}}})}),{root:i,align:o}}function et(e,n,r,t,i){var o={},a=nt(e,n,r,i),u=i?"borderLeft":"borderRight";function d(l,h){for(var v=a.nodes(),p=v.pop(),b={};p;)b[p]?l(p):(b[p]=!0,v.push(p),v=v.concat(h(p))),p=v.pop()}function s(l){o[l]=a.inEdges(l).reduce(function(h,v){return Math.max(h,o[v.v]+a.edge(v))},0)}function c(l){var h=a.outEdges(l).reduce(function(p,b){return Math.min(p,o[b.w]-a.edge(b))},Number.POSITIVE_INFINITY),v=e.node(l);h!==Number.POSITIVE_INFINITY&&v.borderType!==u&&(o[l]=Math.max(o[l],h))}return d(s,a.predecessors.bind(a)),d(c,a.successors.bind(a)),f(t,function(l){o[l]=o[r[l]]}),o}function nt(e,n,r,t){var i=new g,o=e.graph(),a=ot(o.nodesep,o.edgesep,t);return f(n,function(u){var d;f(u,function(s){var c=r[s];if(i.setNode(c),d){var l=r[d],h=i.edge(l,c);i.setEdge(l,c,Math.max(a(e,s,d),h||0))}d=s})}),i}function rt(e,n){return Z(E(n),function(r){var t=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return Ln(r,function(o,a){var u=ut(e,a)/2;t=Math.max(o+u,t),i=Math.min(o-u,i)}),t-i})}function tt(e,n){var r=E(n),t=P(r),i=y(r);f(["u","d"],function(o){f(["l","r"],function(a){var u=o+a,d=e[u],s;if(d!==n){var c=E(d);s=a==="l"?t-P(c):i-y(c),s&&(e[u]=j(d,function(l){return l+s}))}})})}function it(e,n){return j(e.ul,function(r,t){if(n)return e[n.toLowerCase()][t];var i=R(w(e,t));return(i[1]+i[2])/2})}function at(e){var n=G(e),r=X(Ur(e,n),Zr(e,n)),t={},i;f(["u","d"],function(a){i=a==="u"?n:E(n).reverse(),f(["l","r"],function(u){u==="r"&&(i=w(i,function(l){return E(l).reverse()}));var d=(a==="u"?e.predecessors:e.successors).bind(e),s=Qr(e,i,r,d),c=et(e,i,s.root,s.align,u==="r");u==="r"&&(c=j(c,function(l){return-l})),t[a+u]=c})});var o=rt(e,t);return tt(t,o),it(t,e.graph().align)}function ot(e,n,r){return function(t,i,o){var a=t.node(i),u=t.node(o),d=0,s;if(d+=a.width/2,Object.prototype.hasOwnProperty.call(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":s=-a.width/2;break;case"r":s=a.width/2;break}if(s&&(d+=r?s:-s),s=0,d+=(a.dummy?n:e)/2,d+=(u.dummy?n:e)/2,d+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":s=u.width/2;break;case"r":s=-u.width/2;break}return s&&(d+=r?s:-s),s=0,d}}function ut(e,n){return e.node(n).width}function dt(e){e=Le(e),st(e),Pn(at(e),function(n,r){e.node(r).x=n})}function st(e){var n=G(e),r=e.graph().ranksep,t=0;f(n,function(i){var o=y(w(i,function(a){return e.node(a).height}));f(i,function(a){e.node(a).y=t+o/2}),t+=o+r})}function Bt(e,n){var r=ar;r("layout",()=>{var t=r(" buildLayoutGraph",()=>yt(e));r(" runLayout",()=>ft(t,r)),r(" updateInputGraph",()=>ct(e,t))})}function ft(e,n){n(" makeSpaceForEdgeLabels",()=>xt(e)),n(" removeSelfEdges",()=>It(e)),n(" acyclic",()=>Kn(e)),n(" nestingGraph.run",()=>Lr(e)),n(" rank",()=>kr(Le(e))),n(" injectEdgeLabelProxies",()=>Et(e)),n(" removeEmptyRanks",()=>tr(e)),n(" nestingGraph.cleanup",()=>Cr(e)),n(" normalizeRanks",()=>rr(e)),n(" assignRankMinMax",()=>kt(e)),n(" removeEdgeLabelProxies",()=>Ot(e)),n(" normalize.run",()=>cr(e)),n(" parentDummyChains",()=>zr(e)),n(" addBorderSegments",()=>or(e)),n(" order",()=>qr(e)),n(" insertSelfEdges",()=>Rt(e)),n(" adjustCoordinateSystem",()=>ur(e)),n(" position",()=>dt(e)),n(" positionSelfEdges",()=>Tt(e)),n(" removeBorderNodes",()=>Ct(e)),n(" normalize.undo",()=>hr(e)),n(" fixupEdgeLabelCoords",()=>Pt(e)),n(" undoCoordinateSystem",()=>dr(e)),n(" translateGraph",()=>Nt(e)),n(" assignNodeIntersects",()=>Lt(e)),n(" reversePoints",()=>_t(e)),n(" acyclic.undo",()=>er(e))}function ct(e,n){f(e.nodes(),function(r){var t=e.node(r),i=n.node(r);t&&(t.x=i.x,t.y=i.y,n.children(r).length&&(t.width=i.width,t.height=i.height))}),f(e.edges(),function(r){var t=e.edge(r),i=n.edge(r);t.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(t.x=i.x,t.y=i.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}var lt=["nodesep","edgesep","ranksep","marginx","marginy"],ht={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},vt=["acyclicer","ranker","rankdir","align"],pt=["width","height"],wt={width:0,height:0},bt=["minlen","weight","width","height","labeloffset"],mt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},gt=["labelpos"];function yt(e){var n=new g({multigraph:!0,compound:!0}),r=W(e.graph());return n.setGraph(X({},ht,q(r,lt),A(r,vt))),f(e.nodes(),function(t){var i=W(e.node(t));n.setNode(t,En(q(i,pt),wt)),n.setParent(t,e.parent(t))}),f(e.edges(),function(t){var i=W(e.edge(t));n.setEdge(t,X({},mt,q(i,bt),A(i,gt)))}),n}function xt(e){var n=e.graph();n.ranksep/=2,f(e.edges(),function(r){var t=e.edge(r);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function Et(e){f(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),i=e.node(n.w),o={rank:(i.rank-t.rank)/2+t.rank,e:n};N(e,"edge-proxy",o,"_ep")}})}function kt(e){var n=0;f(e.nodes(),function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=y(n,t.maxRank))}),e.graph().maxRank=n}function Ot(e){f(e.nodes(),function(n){var r=e.node(n);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}function Nt(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,i=0,o=e.graph(),a=o.marginx||0,u=o.marginy||0;function d(s){var c=s.x,l=s.y,h=s.width,v=s.height;n=Math.min(n,c-h/2),r=Math.max(r,c+h/2),t=Math.min(t,l-v/2),i=Math.max(i,l+v/2)}f(e.nodes(),function(s){d(e.node(s))}),f(e.edges(),function(s){var c=e.edge(s);Object.prototype.hasOwnProperty.call(c,"x")&&d(c)}),n-=a,t-=u,f(e.nodes(),function(s){var c=e.node(s);c.x-=n,c.y-=t}),f(e.edges(),function(s){var c=e.edge(s);f(c.points,function(l){l.x-=n,l.y-=t}),Object.prototype.hasOwnProperty.call(c,"x")&&(c.x-=n),Object.prototype.hasOwnProperty.call(c,"y")&&(c.y-=t)}),o.width=r-n+a,o.height=i-t+u}function Lt(e){f(e.edges(),function(n){var r=e.edge(n),t=e.node(n.v),i=e.node(n.w),o,a;r.points?(o=r.points[0],a=r.points[r.points.length-1]):(r.points=[],o=i,a=t),r.points.unshift(ae(t,o)),r.points.push(ae(i,a))})}function Pt(e){f(e.edges(),function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function _t(e){f(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}function Ct(e){f(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),i=e.node(r.borderBottom),o=e.node(F(r.borderLeft)),a=e.node(F(r.borderRight));r.width=Math.abs(a.x-o.x),r.height=Math.abs(i.y-t.y),r.x=o.x+r.width/2,r.y=t.y+r.height/2}}),f(e.nodes(),function(n){e.node(n).dummy==="border"&&e.removeNode(n)})}function It(e){f(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}function Rt(e){var n=G(e);f(n,function(r){var t=0;f(r,function(i,o){var a=e.node(i);a.order=o+t,f(a.selfEdges,function(u){N(e,"selfedge",{width:u.label.width,height:u.label.height,rank:a.rank,order:o+ ++t,e:u.e,label:u.label},"_se")}),delete a.selfEdges})})}function Tt(e){f(e.nodes(),function(n){var r=e.node(n);if(r.dummy==="selfedge"){var t=e.node(r.e.v),i=t.x+t.width/2,o=t.y,a=r.x-i,u=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:i+2*a/3,y:o-u},{x:i+5*a/6,y:o-u},{x:i+a,y:o},{x:i+5*a/6,y:o+u},{x:i+2*a/3,y:o+u}],r.label.x=r.x,r.label.y=r.y}})}function q(e,n){return j(A(e,n),Number)}function W(e){var n={};return f(e,function(r,t){n[t.toLowerCase()]=r}),n}export{Bt as l};
@@ -1 +1 @@
1
- import{aM as j,aN as p,aO as w,aP as k,aQ as q}from"./mermaid.core-BaQyIOvj.js";import{i as D}from"./init-Gi6I4Gst.js";import{e as M,f as F,a as P,b as z}from"./defaultLocale-DX6XiGOO.js";function g(n,r){return n==null||r==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function B(n,r){return n==null||r==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=g,t=(o,c)=>g(n(o),c),e=(o,c)=>n(o)-c):(r=n===g||n===B?n:I,t=n,e=n);function u(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<0?i=l+1:h=l}while(i<h)}return i}function f(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<=0?i=l+1:h=l}while(i<h)}return i}function a(o,c,i=0,h=o.length){const l=u(o,c,i,h-1);return l>i&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function I(){return 0}function O(n){return n===null?NaN:+n}const V=R(g),$=V.right;R(O).center;const x=Math.sqrt(50),Q=Math.sqrt(10),T=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=x?10:f>=Q?5:f>=T?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/i<n&&++o,c/i>r&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*i<n&&++o,c*i>r&&--c),c<o&&.5<=t&&t<2?v(n,r,t*2):[o,c,i]}function C(n,r,t){if(r=+r,n=+n,t=+t,!(t>0))return[];if(n===r)return[n];const e=r<n,[u,f,a]=e?v(r,n,t):v(n,r,t);if(!(f>=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;i<o;++i)c[i]=(f-i)/-a;else for(let i=0;i<o;++i)c[i]=(f-i)*a;else if(a<0)for(let i=0;i<o;++i)c[i]=(u+i)/-a;else for(let i=0;i<o;++i)c[i]=(u+i)*a;return c}function y(n,r,t){return r=+r,n=+n,t=+t,v(n,r,t)[2]}function E(n,r,t){r=+r,n=+n,t=+t;const e=r<n,u=e?y(r,n,t):y(n,r,t);return(e?-1:1)*(u<0?1/-u:u)}function G(n,r){r||(r=[]);var t=n?Math.min(r.length,n.length):0,e=r.slice(),u;return function(f){for(u=0;u<t;++u)e[u]=n[u]*(1-f)+r[u]*f;return e}}function H(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function J(n,r){var t=r?r.length:0,e=n?Math.min(t,n.length):0,u=new Array(e),f=new Array(t),a;for(a=0;a<e;++a)u[a]=d(n[a],r[a]);for(;a<t;++a)f[a]=r[a];return function(o){for(a=0;a<e;++a)f[a]=u[a](o);return f}}function K(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function L(n,r){var t={},e={},u;(n===null||typeof n!="object")&&(n={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in n?t[u]=d(n[u],r[u]):e[u]=r[u];return function(f){for(u in t)e[u]=t[u](f);return e}}function d(n,r){var t=typeof r,e;return r==null||t==="boolean"?j(r):(t==="number"?p:t==="string"?(e=w(r))?(r=e,k):q:r instanceof w?k:r instanceof Date?K:H(r)?G:Array.isArray(r)?J:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?L:p)(n,r)}function U(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function W(n){return Math.max(0,-M(Math.abs(n)))}function X(n,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(M(r)/3)))*3-M(Math.abs(n)))}function Y(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,M(r)-M(n))+1}function Z(n){return function(){return n}}function _(n){return+n}var A=[0,1];function m(n){return n}function N(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:Z(isNaN(r)?NaN:.5)}function b(n,r){var t;return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u<e?(e=N(u,e),f=t(a,f)):(e=N(e,u),f=t(f,a)),function(o){return f(e(o))}}function rn(n,r,t){var e=Math.min(n.length,r.length)-1,u=new Array(e),f=new Array(e),a=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++a<e;)u[a]=N(n[a],n[a+1]),f[a]=t(r[a],r[a+1]);return function(o){var c=$(n,o,1,e)-1;return f[c](u[c](o))}}function en(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function tn(){var n=A,r=A,t=d,e,u,f,a=m,o,c,i;function h(){var s=Math.min(n.length,r.length);return a!==m&&(a=b(n[0],n[s-1])),o=s>2?rn:nn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),p)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,_),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=U,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,S){return e=s,u=S,h()}}function un(){return tn()(m,m)}function an(n,r,t,e){var u=E(n,r,t),f;switch(e=F(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=X(u,a))&&(e.precision=f),P(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Y(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=W(u))&&(e.precision=f-(e.type==="%")*2);break}}return z(e)}function on(n){var r=n.domain;return n.ticks=function(t){var e=r();return C(e[0],e[e.length-1],t??10)},n.tickFormat=function(t,e){var u=r();return an(u[0],u[u.length-1],t??10,e)},n.nice=function(t){t==null&&(t=10);var e=r(),u=0,f=e.length-1,a=e[u],o=e[f],c,i,h=10;for(o<a&&(i=a,a=o,o=i,i=u,u=f,f=i);h-- >0;){if(i=y(a,o,t),i===c)return e[u]=a,e[f]=o,r(e);if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else if(i<0)a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i;else break;c=i}return n},n}function fn(){var n=un();return n.copy=function(){return en(n,fn())},D.apply(n,arguments),on(n)}export{en as a,R as b,un as c,fn as l,E as t};
1
+ import{aM as j,aN as p,aO as w,aP as k,aQ as q}from"./mermaid.core-bouKOnsR.js";import{i as D}from"./init-Gi6I4Gst.js";import{e as M,f as F,a as P,b as z}from"./defaultLocale-DX6XiGOO.js";function g(n,r){return n==null||r==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function B(n,r){return n==null||r==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=g,t=(o,c)=>g(n(o),c),e=(o,c)=>n(o)-c):(r=n===g||n===B?n:I,t=n,e=n);function u(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<0?i=l+1:h=l}while(i<h)}return i}function f(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<=0?i=l+1:h=l}while(i<h)}return i}function a(o,c,i=0,h=o.length){const l=u(o,c,i,h-1);return l>i&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function I(){return 0}function O(n){return n===null?NaN:+n}const V=R(g),$=V.right;R(O).center;const x=Math.sqrt(50),Q=Math.sqrt(10),T=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=x?10:f>=Q?5:f>=T?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/i<n&&++o,c/i>r&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*i<n&&++o,c*i>r&&--c),c<o&&.5<=t&&t<2?v(n,r,t*2):[o,c,i]}function C(n,r,t){if(r=+r,n=+n,t=+t,!(t>0))return[];if(n===r)return[n];const e=r<n,[u,f,a]=e?v(r,n,t):v(n,r,t);if(!(f>=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;i<o;++i)c[i]=(f-i)/-a;else for(let i=0;i<o;++i)c[i]=(f-i)*a;else if(a<0)for(let i=0;i<o;++i)c[i]=(u+i)/-a;else for(let i=0;i<o;++i)c[i]=(u+i)*a;return c}function y(n,r,t){return r=+r,n=+n,t=+t,v(n,r,t)[2]}function E(n,r,t){r=+r,n=+n,t=+t;const e=r<n,u=e?y(r,n,t):y(n,r,t);return(e?-1:1)*(u<0?1/-u:u)}function G(n,r){r||(r=[]);var t=n?Math.min(r.length,n.length):0,e=r.slice(),u;return function(f){for(u=0;u<t;++u)e[u]=n[u]*(1-f)+r[u]*f;return e}}function H(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function J(n,r){var t=r?r.length:0,e=n?Math.min(t,n.length):0,u=new Array(e),f=new Array(t),a;for(a=0;a<e;++a)u[a]=d(n[a],r[a]);for(;a<t;++a)f[a]=r[a];return function(o){for(a=0;a<e;++a)f[a]=u[a](o);return f}}function K(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function L(n,r){var t={},e={},u;(n===null||typeof n!="object")&&(n={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in n?t[u]=d(n[u],r[u]):e[u]=r[u];return function(f){for(u in t)e[u]=t[u](f);return e}}function d(n,r){var t=typeof r,e;return r==null||t==="boolean"?j(r):(t==="number"?p:t==="string"?(e=w(r))?(r=e,k):q:r instanceof w?k:r instanceof Date?K:H(r)?G:Array.isArray(r)?J:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?L:p)(n,r)}function U(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function W(n){return Math.max(0,-M(Math.abs(n)))}function X(n,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(M(r)/3)))*3-M(Math.abs(n)))}function Y(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,M(r)-M(n))+1}function Z(n){return function(){return n}}function _(n){return+n}var A=[0,1];function m(n){return n}function N(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:Z(isNaN(r)?NaN:.5)}function b(n,r){var t;return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u<e?(e=N(u,e),f=t(a,f)):(e=N(e,u),f=t(f,a)),function(o){return f(e(o))}}function rn(n,r,t){var e=Math.min(n.length,r.length)-1,u=new Array(e),f=new Array(e),a=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++a<e;)u[a]=N(n[a],n[a+1]),f[a]=t(r[a],r[a+1]);return function(o){var c=$(n,o,1,e)-1;return f[c](u[c](o))}}function en(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function tn(){var n=A,r=A,t=d,e,u,f,a=m,o,c,i;function h(){var s=Math.min(n.length,r.length);return a!==m&&(a=b(n[0],n[s-1])),o=s>2?rn:nn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),p)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,_),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=U,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,S){return e=s,u=S,h()}}function un(){return tn()(m,m)}function an(n,r,t,e){var u=E(n,r,t),f;switch(e=F(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=X(u,a))&&(e.precision=f),P(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Y(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=W(u))&&(e.precision=f-(e.type==="%")*2);break}}return z(e)}function on(n){var r=n.domain;return n.ticks=function(t){var e=r();return C(e[0],e[e.length-1],t??10)},n.tickFormat=function(t,e){var u=r();return an(u[0],u[u.length-1],t??10,e)},n.nice=function(t){t==null&&(t=10);var e=r(),u=0,f=e.length-1,a=e[u],o=e[f],c,i,h=10;for(o<a&&(i=a,a=o,o=i,i=u,u=f,f=i);h-- >0;){if(i=y(a,o,t),i===c)return e[u]=a,e[f]=o,r(e);if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else if(i<0)a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i;else break;c=i}return n},n}function fn(){var n=un();return n.copy=function(){return en(n,fn())},D.apply(n,arguments),on(n)}export{en as a,R as b,un as c,fn as l,E as t};