@hardikg/mdview 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/README.md +52 -10
  3. package/bin/chunk-RBYD2HWV.mjs +196 -0
  4. package/bin/chunk-WWM6JNAS.mjs +209 -0
  5. package/bin/chunk-XFRQFZZ4.mjs +20 -0
  6. package/bin/mdview.mjs +521 -1323
  7. package/bin/regex-worker.mjs +52 -0
  8. package/bin/server-KALIU7HM.mjs +1854 -0
  9. package/bin/shiki-5SFVA32N.mjs +13 -0
  10. package/dist/client/assets/23I4SOAX-BN9xvzna.js +2 -0
  11. package/dist/client/assets/26H2HVXD-Cu1OTMxT.js +2 -0
  12. package/dist/client/assets/2IZ5MNOH-DMjMO3_9.js +1 -0
  13. package/dist/client/assets/2P3CZEXH-D-4BP7dg.js +2 -0
  14. package/dist/client/assets/3E5HRNYT-DUYblpdl.js +5 -0
  15. package/dist/client/assets/3JIRLDUO-C1CwW1Ha.js +1 -0
  16. package/dist/client/assets/5MJ3UKSG-DtT76qKq.js +2 -0
  17. package/dist/client/assets/5THPTBWS-Ce_hS451.js +1 -0
  18. package/dist/client/assets/7WLXJQOR-D6QVYUu9.js +1 -0
  19. package/dist/client/assets/A255FCTW-woaH7Mj_.js +1 -0
  20. package/dist/client/assets/AM43MQ64-CsWC_OQH.js +2 -0
  21. package/dist/client/assets/AOZTNTMC-BIehUQHD.js +5 -0
  22. package/dist/client/assets/AQNLM6KG-DIUuJgPm.js +4 -0
  23. package/dist/client/assets/BNU2RHQB-DeXpwU5k.js +2 -0
  24. package/dist/client/assets/C5HTQT3I-7U13x70S.js +4 -0
  25. package/dist/client/assets/CPKRWH5G-CRxaqyOs.js +12 -0
  26. package/dist/client/assets/CUVCMPQX-JTGMOfG2.js +1 -0
  27. package/dist/client/assets/D4V2MWCI-CytzCr6g.js +1 -0
  28. package/dist/client/assets/DHKBVIA3-CVnlqiEq.js +1 -0
  29. package/dist/client/assets/DKTLEL5E-DciMwFJ1.js +1 -0
  30. package/dist/client/assets/DUZNPW7S-D3pifVNb.js +2 -0
  31. package/dist/client/assets/E3FWOBN4-D5m5o2g0.js +4 -0
  32. package/dist/client/assets/E65FQMJL-Bg5F0Zo8.js +1 -0
  33. package/dist/client/assets/FTXIJQGB-CggtIYAM.js +1 -0
  34. package/dist/client/assets/G3MDBVQH-BZmnMkFw.js +1 -0
  35. package/dist/client/assets/G3OATVW2-VpVvT5i2.js +8 -0
  36. package/dist/client/assets/IV52FOAS-DgPxxRI4.js +5 -0
  37. package/dist/client/assets/JTJEEBDN-Bl0iUT_r.js +2 -0
  38. package/dist/client/assets/K7FUICZ3-DgoihkiR.js +2 -0
  39. package/dist/client/assets/LHH2HHRB-BXHTnBD0.js +2 -0
  40. package/dist/client/assets/MSPQPZZY-DQg7F6a8.js +4 -0
  41. package/dist/client/assets/OB6ZFVKF-UHmC8m-y.js +2 -0
  42. package/dist/client/assets/PLTZDMI2-C1ZAoc-e.js +1 -0
  43. package/dist/client/assets/R7EPXMMD-ChI1SqjJ.js +5 -0
  44. package/dist/client/assets/RVARI57O-CgA1WoRv.js +1 -0
  45. package/dist/client/assets/SPBWZ4VS-EqfCsJ5V.js +1 -0
  46. package/dist/client/assets/SR7OOV3Q-CFnFs0kL.js +4 -0
  47. package/dist/client/assets/STAXBNH4-D4c13Xlj.js +2 -0
  48. package/dist/client/assets/SXFARSFO-CkFSkgdi.js +1 -0
  49. package/dist/client/assets/TC77ISAL--WP0GBo0.js +2 -0
  50. package/dist/client/assets/TYIQQHVC-B67pCpxM.js +13 -0
  51. package/dist/client/assets/TZUXETIT-BFD9W5hl.js +2 -0
  52. package/dist/client/assets/U7N72BGE-Do3829la.js +6 -0
  53. package/dist/client/assets/UFPIB6EZ-DTs_MyQv.js +3 -0
  54. package/dist/client/assets/UO52YEYL-DN1qbGwF.js +3 -0
  55. package/dist/client/assets/VIK3ONSK-DC8mR2sZ.js +2 -0
  56. package/dist/client/assets/VVVO4ZVP-DAtGLbxR.js +2 -0
  57. package/dist/client/assets/WRGXZO53-D30IuREw.js +3 -0
  58. package/dist/client/assets/X5SG7MGC-CdjdoL_s.js +2 -0
  59. package/dist/client/assets/XLHPVVFU-BFP9ID9p.js +2 -0
  60. package/dist/client/assets/XXYPNCD5-DqCewu_S.js +5 -0
  61. package/dist/client/assets/Z6WRYFJC-BEt1KCoU.js +7 -0
  62. package/dist/client/assets/ZI2QNEGF-VzC4uHcW.js +8 -0
  63. package/dist/client/assets/index-B96jWJTi.css +1 -0
  64. package/dist/client/assets/index-DCU09WmS.js +2 -0
  65. package/dist/client/assets/katex-C0xaXAD4.js +257 -0
  66. package/dist/client/assets/katex.min-3X1qOa03.js +1 -0
  67. package/dist/client/assets/katex.min-DMey5pMQ.css +1 -0
  68. package/dist/client/assets/lazy-DaMZI1F7.js +45 -0
  69. package/dist/client/index.html +2 -2
  70. package/package.json +32 -27
  71. package/dist/client/assets/2DXBBFLN-BxPqHNSN.js +0 -5
  72. package/dist/client/assets/46IJ22JX-u_jvQJNg.js +0 -2
  73. package/dist/client/assets/4TTDE5I4-BgbNAVNj.js +0 -3
  74. package/dist/client/assets/4UF3HTLV-DNbPxlOE.js +0 -2
  75. package/dist/client/assets/5THPTBWS-D57irc_4.js +0 -1
  76. package/dist/client/assets/7WLXJQOR-CHhKreq0.js +0 -1
  77. package/dist/client/assets/AAXQQPKT-CsAJqrOC.js +0 -5
  78. package/dist/client/assets/AKE5O7KZ-MSuBOjCG.js +0 -2
  79. package/dist/client/assets/BNMLP6AG-Ca3zyKQY.js +0 -3
  80. package/dist/client/assets/DKTLEL5E-B7ILCVTH.js +0 -1
  81. package/dist/client/assets/DR6PKOQU-Bw7cHvYp.js +0 -2
  82. package/dist/client/assets/E4RJ7UJB-CYB5C4K7.js +0 -2
  83. package/dist/client/assets/ELSXBIJH-DG0MW5dC.js +0 -1
  84. package/dist/client/assets/ERTIBQVS-BMWumWfk.js +0 -2
  85. package/dist/client/assets/F653G4FO-FI8M9Mc0.js +0 -12
  86. package/dist/client/assets/FKCDD66M-BPFkyrwI.js +0 -1
  87. package/dist/client/assets/FP7KDXVC-BLEBNkCO.js +0 -2
  88. package/dist/client/assets/FT5I3RHX-j5YoMicq.js +0 -6
  89. package/dist/client/assets/FTXIJQGB-nrHdCfp7.js +0 -1
  90. package/dist/client/assets/G3MDBVQH-EkdejvdW.js +0 -1
  91. package/dist/client/assets/GY35JXOZ-3ovTGxgz.js +0 -2
  92. package/dist/client/assets/H5EEJPP2-CNVQBEB3.js +0 -1
  93. package/dist/client/assets/HWDLEDTA-C_JcdBMO.js +0 -1
  94. package/dist/client/assets/JZWSX6AR-OwVPptYv.js +0 -1
  95. package/dist/client/assets/KQOEJWJY-DKTXya68.js +0 -2
  96. package/dist/client/assets/KS3BB3KE-QkpqVdmA.js +0 -1
  97. package/dist/client/assets/KXJRRZHI-BQRjeGWj.js +0 -2
  98. package/dist/client/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  99. package/dist/client/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  100. package/dist/client/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  101. package/dist/client/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  102. package/dist/client/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  103. package/dist/client/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  104. package/dist/client/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  105. package/dist/client/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  106. package/dist/client/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  107. package/dist/client/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  108. package/dist/client/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  109. package/dist/client/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  110. package/dist/client/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  111. package/dist/client/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  112. package/dist/client/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  113. package/dist/client/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  114. package/dist/client/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  115. package/dist/client/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  116. package/dist/client/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  117. package/dist/client/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  118. package/dist/client/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  119. package/dist/client/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  120. package/dist/client/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  121. package/dist/client/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  122. package/dist/client/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  123. package/dist/client/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  124. package/dist/client/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  125. package/dist/client/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  126. package/dist/client/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  127. package/dist/client/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  128. package/dist/client/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  129. package/dist/client/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  130. package/dist/client/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  131. package/dist/client/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  132. package/dist/client/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  133. package/dist/client/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  134. package/dist/client/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  135. package/dist/client/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  136. package/dist/client/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  137. package/dist/client/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  138. package/dist/client/assets/MFVI5XKI-DrRaRE9X.js +0 -1
  139. package/dist/client/assets/MWY2J62P-AbEgJnzK.js +0 -12
  140. package/dist/client/assets/MXGNCBL2-DG3CZR8g.js +0 -2
  141. package/dist/client/assets/N6DAJLIZ-BsZQKTyT.js +0 -3
  142. package/dist/client/assets/NU5M23IW-CvtpIovv.js +0 -2
  143. package/dist/client/assets/NV4XNBIS-nS8wAx3h.js +0 -8
  144. package/dist/client/assets/OGLU4SIR-DoTUWhkz.js +0 -2
  145. package/dist/client/assets/OUNS5N76-BwVLonT4.js +0 -8
  146. package/dist/client/assets/PU4ISKXV-BYX7eA_r.js +0 -2
  147. package/dist/client/assets/PUZGS23X-n6IKOr7S.js +0 -1
  148. package/dist/client/assets/Q3IYVLG5-hWt1rVyh.js +0 -4
  149. package/dist/client/assets/QYHQDLKZ-CjGeJM7R.js +0 -4
  150. package/dist/client/assets/RVARI57O-CXmrUIiS.js +0 -1
  151. package/dist/client/assets/RZSVICHU-BiwjruZZ.js +0 -4
  152. package/dist/client/assets/UEXXS2NB-Dkz_tz-N.js +0 -2
  153. package/dist/client/assets/UHTQJXKL-lvl-7QeT.js +0 -5
  154. package/dist/client/assets/URA2L2QI-B8pYKxOk.js +0 -1
  155. package/dist/client/assets/UXCHDUKG-BGy3ZRLM.js +0 -2
  156. package/dist/client/assets/VKNV3BUX-DZnoX4IV.js +0 -5
  157. package/dist/client/assets/VMV7XPHP-6QkisQwm.js +0 -4
  158. package/dist/client/assets/WEVWDWVA-nohBBhTA.js +0 -2
  159. package/dist/client/assets/XRRJ35LF-BE7gSN1k.js +0 -2
  160. package/dist/client/assets/YFKBLVVN-CVTPpei6.js +0 -6
  161. package/dist/client/assets/YHRE5QGZ-Bs7dUKjj.js +0 -4
  162. package/dist/client/assets/ZF3OVT4B-6LaC6iLs.js +0 -3
  163. package/dist/client/assets/index-392ivruk.js +0 -2
  164. package/dist/client/assets/index-CGQuEJ_w.css +0 -1
  165. package/dist/client/assets/jetbrains-mono-cyrillic-400-normal-ugxPyKxw.woff +0 -0
  166. package/dist/client/assets/jetbrains-mono-cyrillic-600-normal-8K4wrrwR.woff +0 -0
  167. package/dist/client/assets/jetbrains-mono-greek-400-normal-B9oWc5Lo.woff +0 -0
  168. package/dist/client/assets/jetbrains-mono-greek-600-normal-mc2nkWzM.woff +0 -0
  169. package/dist/client/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
  170. package/dist/client/assets/jetbrains-mono-latin-600-normal-BfsvjouI.woff +0 -0
  171. package/dist/client/assets/jetbrains-mono-latin-ext-400-normal-fXTG6kC5.woff +0 -0
  172. package/dist/client/assets/jetbrains-mono-latin-ext-600-normal-DObL3zCW.woff +0 -0
  173. package/dist/client/assets/jetbrains-mono-vietnamese-400-normal-CqNFfHCs.woff +0 -0
  174. package/dist/client/assets/jetbrains-mono-vietnamese-600-normal-OWROknRo.woff +0 -0
  175. package/dist/client/assets/katex-C5jXJg4s.js +0 -257
  176. package/dist/client/assets/katex.min-BYZTj3zW.css +0 -1
  177. package/dist/client/assets/katex.min-DXaO1tdm.js +0 -1
  178. package/dist/client/assets/lazy-CKqR1774.js +0 -43
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ highlightCache,
4
+ highlightCode,
5
+ warmHighlighter
6
+ } from "./chunk-RBYD2HWV.mjs";
7
+ import "./chunk-XFRQFZZ4.mjs";
8
+ export {
9
+ highlightCache,
10
+ highlightCode,
11
+ warmHighlighter
12
+ };
13
+ //# sourceMappingURL=shiki-5SFVA32N.mjs.map
@@ -0,0 +1,2 @@
1
+ import{i as e,n as t,r as n,t as r}from"./XLHPVVFU-BFP9ID9p.js";import{_ as i,d as a,f as o,i as s,o as c,x as l}from"./E3FWOBN4-D5m5o2g0.js";import{n as u,t as d}from"./STAXBNH4-D4c13Xlj.js";import{t as f}from"./DKTLEL5E-DciMwFJ1.js";import{s as p}from"./CUVCMPQX-JTGMOfG2.js";import{PeleError as m,g as h,h as g,s as _,u as ee}from"./lazy-DaMZI1F7.js";var v=class{type=`timeline`;title;accTitle;accDescr;direction=`LR`;sections=[];periods=[];currentSection=``;getCommonDb(){return this}setDiagramTitle(e){this.title=e}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,``)}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
2
+ `)}setDirection(e){this.direction=e}addSection(e){this.currentSection=e,this.sections.push(e)}addTask(e,t,n){this.periods.push({text:e,events:n?[n]:[],section:this.currentSection,sectionIndex:this.sections.length-1})}addEvent(e){let t=this.periods[this.periods.length-1];if(!t)throw new m(`An event needs a time period before it.`,`semantic`,{type:`timeline`});t.events.push(e)}},y=[`$end`,`EOF`,`INVALID`,`NEWLINE`,`timeline`,`timeline_lr`,`timeline_td`,`title`,`acc_title`,`acc_title_value`,`acc_descr`,`acc_descr_value`,`acc_descr_multiline_value`,`section`,`period`,`event`];function b(i){let a=i.length,o=[],s=[],c=[],l={types:o,texts:s,starts:c},u=0,d=(e,t)=>{o.push(e),s.push(i.slice(u,t)),c.push(u),u=t};for(;u=t(i,u),!(u>=a);){let t=i.charCodeAt(u),o=u+1;if(t===10){for(;i.charCodeAt(o)===10;)o++;d(3,o)}else{if(r(i,u,`timeline`)){for(o=u+8;i.charCodeAt(o)===32||i.charCodeAt(o)===9;)o++;let e=r(i,o,`lr`);if(o>u+8&&(e||r(i,o,`td`))&&!h(i.charCodeAt(o+2))){d(e?5:6,o+2);continue}if(!h(i.charCodeAt(u+8))){d(4,u+8);continue}}if(r(i,u,`title`)){for(o=u+5;i.charCodeAt(o)!==10&&g(i.charCodeAt(o));)o++;if(o===a||i.charCodeAt(o)===10){u=o;continue}let e=i.charCodeAt(u+5);if(e!==13&&g(e)){d(7,n(i,u+6));continue}}if(o=e(i,u,l,8),o!==u)u=o;else{if(r(i,u,`section`)&&g(i.charCodeAt(u+7))){for(o=u+8;o<a&&i.charCodeAt(o)!==58&&i.charCodeAt(o)!==10;)o++;if(o>u+8){d(13,o);continue}}if(t!==58){o=u+1;for(let e=i.charCodeAt(o);o<a&&e!==35&&e!==58&&e!==10;e=i.charCodeAt(++o));d(14,o)}else{if(g(i.charCodeAt(u+1))){for(o=u+2;o<a;o++){let e=i.charCodeAt(o);if(e===10||e===58&&g(i.charCodeAt(o+1)))break}if(o>u+2){d(15,o);continue}}d(2,u+1)}}}}return(c.length===0||c[c.length-1]<a)&&d(1,a),d(0,a),l}var x=`'EOF', 'SPACE', 'NEWLINE', 'title', 'acc_title', 'acc_descr', 'acc_descr_multiline_value', 'section', 'period', 'event'`;function S(e,t){let{types:n,texts:r,starts:i}=b(e),a=(t,r)=>{let a=n[t]===0?`1`:y[n[t]];throw _(`timeline`,e,i[t],`Expecting ${r}, got '${a}'`)},o=n[0];o!==4&&o!==5&&o!==6&&a(0,`'timeline', 'timeline_lr', 'timeline_td'`),o!==4&&t.setDirection(o===5?`LR`:`TD`);for(let e=1;;e++){let i=r[e];switch(n[e]){case 3:break;case 7:t.getCommonDb().setDiagramTitle(i.substring(6));break;case 8:t.getCommonDb().setAccTitle(r[++e].trim());break;case 10:t.getCommonDb().setAccDescription(r[++e].trim());break;case 12:t.getCommonDb().setAccDescription(i.trim());break;case 13:t.addSection(i.substring(8));break;case 14:t.addTask(i,0,``);break;case 15:t.addEvent(i.substring(2));break;case 1:return;default:a(e,x)}}}var C=12,te=8,ne=152,re=216,ie=264,w=20,T=20,E=14,D=8,O=8,k=12,A=` fill="var(--_bg)"`,ae=` fill="none" stroke="var(--_b)"`;function j(e,t,n,r,i){return`<rect x="${l(e)}" y="${l(t)}" width="${l(n)}" height="${l(r)}"${a(i)}/>`}function M(e,t,n){return e.direction===`TD`?N(e,t,n,!0):f(n,r=>N(e,t,n,r))}function N(e,t,n,r){let a=n.fontSize??16,f=Math.round(a*.875),m=n.measurer??ee(n.fontFamily,n.fontFamilyMono),h=n.padding??8,g=t.timeline?.disableMulticolor!==!0,_=e.periods,v=e.sections.length>0,y=e.sections.map((e,t)=>({section:t,periods:[]})),b={section:-1,periods:[]};_.forEach((e,t)=>(y[e.sectionIndex]??b).periods.push(t)),b.periods.length>0&&y.unshift(b);let x=r&&n.maxWidth!==void 0&&n.maxWidth>0?n.maxWidth-2*h:1/0,S=T+E*2+4*C,M=Math.min(ne,Math.max(80,Math.round((x-S)*.38))),N=Math.min(ie,Math.max(110,x-S-M)),P=M,F=()=>r?N:P,I=_.map(e=>u(e.text,m,a,P)),L=_.map(e=>e.events.map(e=>u(e,m,f,F()))),R=0;for(let e of I)R=Math.max(R,e.width);if(!r)for(let e of L)for(let t of e)R=Math.max(R,t.width);let oe=R>P;if(r)for(let e of L)for(let t of e)oe||=t.width>N;oe&&(P=Math.min(Math.max(Math.ceil(R),M),x===1/0?re:M),I=_.map(e=>d(e.text,m,a,P)),L=_.map(e=>e.events.map(e=>d(e,m,f,F()))));let se=Math.round(a*1.5),z=P+2*C,B=F()+2*C,V=e=>Math.max(e.height,se)+2*te,H=e=>Math.max(e.height,Math.round(f*1.5))+2*te,ce=(e,t)=>e.section>=0?o(e.section):v?`var(--_m)`:o(g?t:0),le=!1;for(let e of L)e.length>0&&(le=!0);let U=0;for(let e of y)U+=Math.max(e.periods.length,1);let W=z+w,G=_.length>0,K=r?z+(le?T+E*2+B:G?T+k:0):U>0?U*W-w+(G?k+8:0):0,q=d(e.title,m,a,Math.max(K,320),1),ue=q.height>0?q.height+16:0,de=Math.max(K,q.width),J=h+(de-K)/2,Y=h+ue,fe=(t,n)=>d(e.sections[t.section],m,a,n-2*C,1),X=(e,t,n,r,i,a)=>j(n,r,i,a,` fill="${o(e.section)}"`)+c(t,n+i/2,r+a/2,` font-weight="var(--_hw)"`+A),pe=(e,t,n,r,i)=>j(n,r,z,i,` fill="${t}"`)+c(I[e],n+z/2,r+i/2,A),me=(e,t,n,r,i)=>`<g class="pele-node pele-event">`+j(n,r,B,i,` fill="${t}" fill-opacity="0.16"`)+c(e,n+B/2,r+i/2,` font-size="${f}"`)+`</g>`,he=(e,t,n)=>`<circle class="pele-dot" cx="${l(e)}" cy="${l(t)}" r="4" fill="${n}" stroke="var(--_bg)" stroke-width="2"/>`,ge=t=>t.section>=0?`<g class="pele-cluster pele-section" data-id="${s(e.sections[t.section].trim())}">`:``,_e=e=>`<g class="pele-node pele-period" data-id="${s(_[e].text.trim())}">`,Z=``,Q;if(r){let e=J+z+T,t=e+E,n=t+E,r=Y;for(let i of y){if(Z+=ge(i),i.section>=0){let e=fe(i,K),t=V(e);Z+=X(i,e,J,r,K,t),r+=t+O+4}for(let a of i.periods){let o=ce(i,a),s=V(I[a]),c=L[a].length>0?H(L[a][0]):s,u=r+Math.max(s,c)/2,d=`M${l(J+z)},${l(u)}H${l(e)}`,f=``,p=u-c/2,m=u;for(let e of L[a]){let r=H(e);m=p+r/2,d+=`M${l(t)},${l(m)}H${l(n)}`,f+=me(e,o,n,p,r),p+=r+D}f&&(d+=`M${l(e)},${l(u)}H${l(t)}V${l(m)}`),Z+=_e(a)+pe(a,o,J,u-s/2,s)+`<path class="pele-edge" d="${d}"${ae}/>`+he(e,u,o)+f+`</g>`,r=Math.max(u+s/2,p-D)+w}i.periods.length===0&&(r+=w-O-4),i.section>=0&&(Z+=`</g>`)}if(y.length>0&&(r-=w),G){let t=r+k+8;Z=`<path class="pele-axis" d="M${l(e)},${l(Y)}V${l(t-8+1)}" fill="none" stroke="var(--_l)"/>`+p(`arrow_point`,e,t,0,1,`var(--_l)`)+Z,r=t}Q=r+h}else{let e=0,t=y.map(t=>{if(t.section<0)return;let n=fe(t,Math.max(t.periods.length,1)*W-w);return e=Math.max(e,V(n)),n}),n=0;for(let e of I)n=Math.max(n,V(e));let r=Y+(v?e+O:0),i=r+n+(n>0?T:0),a=i+T,o=G?i+k:Y+e,s=0;if(y.forEach((c,u)=>{let d=Math.max(c.periods.length,1),f=J+s*W;Z+=ge(c);let p=t[u];p&&(Z+=X(c,p,f,Y,d*W-w,e)),c.periods.forEach((e,t)=>{let s=ce(c,e),u=f+t*W,d=u+z/2,p=`M${l(d)},${l(r+n)}V${l(L[e].length>0?a:i)}`,m=``,h=a;for(let t of L[e]){let e=H(t);h>a&&(p+=`M${l(d)},${l(h-D)}V${l(h)}`),m+=me(t,s,u,h,e),h+=e+D}o=Math.max(o,h-D),Z+=_e(e)+pe(e,s,u,r,n)+`<path class="pele-edge" d="${p}"${ae}/>`+he(d,i,s)+m+`</g>`}),c.section>=0&&(Z+=`</g>`),s+=d}),G){let e=J+K;Z=`<path class="pele-axis" d="M${l(J)},${l(i)}H${l(e-8+1)}" fill="none" stroke="var(--_l)"/>`+p(`arrow_point`,e,i,1,0,`var(--_l)`)+Z}Q=o+h}let $=Math.ceil(de+2*h),ve=Math.ceil(Math.max(Q,h*2)),ye=c(q,$/2,h+q.height/2,` class="pele-title" font-weight="var(--_tw)"`)+Z;return{svg:i(`timeline`,$,ve,a,n,e,ye),width:$,height:ve,links:[]}}var P={type:`timeline`,parse(e,t,n){let r=new v;return r.title=n,S(e,r),r},render:M};export{P as timeline};
@@ -0,0 +1,2 @@
1
+ import{_ as e,f as t,i as n,o as r,s as i,u as a,x as o}from"./E3FWOBN4-D5m5o2g0.js";import{PeleError as s,g as c,h as l,s as u,u as d,x as f,y as p}from"./lazy-DaMZI1F7.js";function m(e){let t=e.trim();return t.length>=2&&t.startsWith(`"`)&&t.endsWith(`"`)?t.slice(1,-1):t}function h(e){return e.map(m).sort()}var g=class{type=`venn`;title;subsets=[];textNodes=[];styles=[];known=new Set;current;indent=!1;setDiagramTitle(e){this.title=e}addSubsetData(e,t,n){let r=h(e);this.current=r,r.length===1&&this.known.add(r[0]),this.subsets.push({sets:r,size:n??10/e.length**2,label:t?m(t):void 0})}addTextData(e,t,n){this.textNodes.push({sets:h(e),id:m(t),label:n?m(n):void 0})}addStyleData(e,t){let n=new Map;for(let[e,r]of t)n.set(e,r&&m(r));this.styles.push({targets:h(e),styles:n})}validateUnionIdentifiers(e){let t=e.map(m).filter(e=>!this.known.has(e));if(t.length>0)throw new s(`unknown set identifier: ${t.join(`, `)}`,`semantic`,{type:`venn`})}getCurrentSets(){return this.current}getIndentMode(){return this.indent}setIndentMode(e){this.indent=e}},_=[`$end`,`INVALID`,`EOF`,`NEWLINE`,`VENN`,`TITLE`,`SET`,`UNION`,`TEXT`,`INDENT_TEXT`,`STYLE`,`BRACKET_LABEL`,`NUMERIC`,`HEXCOLOR`,`RGBCOLOR`,`RGBACOLOR`,`IDENTIFIER`,`STRING`,`COMMA`,`COLON`],v=[[`venn-beta`,4],[`set`,6],[`union`,7],[`text`,8],[`style`,10]],y=class{constructor(e,t){this.src=e,this.host=t}src;host;text=``;start=0;at=0;lineStart=!1;ended=!1;word(e,t){let n=this.src;for(let r=0;r<t.length;r++){let i=n.charCodeAt(e+r),a=t.charCodeAt(r);if(i!==a&&(i+32!==a||i<65||i>90))return!1}return!0}keyword(e,t){return this.word(e,t)&&!c(this.src.charCodeAt(e+t.length))}color(e,t){let n=this.src,r=e+1;for(let e=0;e<t;e++){for(;l(n.charCodeAt(r));)r++;let i=r;for(;p(n.charCodeAt(r))||n.charCodeAt(r)===46;)r++;if(r===i)return-1;for(;l(n.charCodeAt(r));)r++;if(n.charCodeAt(r)!==(e===t-1?41:44))return-1;r++}return r}afterLineFeed(e){let t=e-1;for(;this.src.charCodeAt(t)===32||this.src.charCodeAt(t)===9;)t--;return this.src.charCodeAt(t)===10}lineEnd(e){let t=this.src.indexOf(`
2
+ `,e);return t===-1?this.src.length:t}next(){let e=this.src,t=e.length;for(;;){let n=this.at;if(this.start=n,this.text=``,n>=t)return this.ended?0:(this.ended=!0,2);let r=e.charCodeAt(n);if(r===37&&e.charCodeAt(n+1)===37&&e.charCodeAt(n+2)!==123)this.at=this.lineEnd(n+2);else if(this.lineStart&&this.word(n,`title`)&&this.afterLineFeed(n)&&e.slice(n+5,this.lineEnd(n+5)).trim()===``){let t=this.lineEnd(n+5);for(;e.charCodeAt(t)===10||e.charCodeAt(t)===13;)t++;this.at=t}else{if(this.lineStart){if(r===32||r===9){let t=n+1;for(;e.charCodeAt(t)===32||e.charCodeAt(t)===9;)t++;if(this.at=t,this.keyword(t,`text`)&&this.host.getIndentMode())return this.at=t+4,this.lineStart=!1,this.text=e.slice(n,t),9;continue}r!==10&&r!==13&&(this.host.setIndentMode(!1),this.lineStart=!1)}if(r===10||r===13){for(n++;e.charCodeAt(n)===10||e.charCodeAt(n)===13;)n++;return this.lineStart=!0,this.token(3,n)}if(r===37&&e.charCodeAt(n+1)===37)this.at=this.lineEnd(n);else if(r===32||r===9){for(n++;e.charCodeAt(n)===32||e.charCodeAt(n)===9;)n++;this.at=n}else{if((r|32)>=97&&(r|32)<=122||r===95){let r=e.charCodeAt(n+5);if(this.word(n,`title`)&&l(r)&&r!==10&&r!==13){let r=n+6;for(;r<t;){let t=e.charCodeAt(r);if(t===35||t===10||t===59)break;r++}if(r>n+6)return this.token(5,r)}for(let[e,t]of v)if(this.keyword(n,e))return this.token(t,n+e.length);if(this.word(n,`rgb`)){let t=(e.charCodeAt(n+3)|32)==97,r=n+(t?4:3),i=e.charCodeAt(r)===40?this.color(r,t?4:3):-1;if(i!==-1)return this.token(t?15:14,i)}for(n++;c(e.charCodeAt(n))||e.charCodeAt(n)===45;)n++;return this.token(16,n)}if(r===91){if(e.charCodeAt(n+1)===34){let t=e.indexOf(`"`,n+2);return t===-1||e.charCodeAt(t+1)!==93?1:(this.at=t+2,this.text=e.slice(n+2,t),11)}let r=n+1;for(;r<t&&e.charCodeAt(r)!==93&&e.charCodeAt(r)!==34;)r++;return r===n+1||e.charCodeAt(r)!==93?1:(this.at=r+1,this.text=e.slice(n+1,r).trim(),11)}if(p(r)||r===46||r===43||r===45){(r===43||r===45)&&n++;let t=n;for(;p(e.charCodeAt(n));)n++;if(n>t){if(e.charCodeAt(n)===46&&p(e.charCodeAt(n+1)))for(n+=2;p(e.charCodeAt(n));)n++}else if(e.charCodeAt(n)===46&&p(e.charCodeAt(n+1)))for(n+=2;p(e.charCodeAt(n));)n++;else return 1;return this.token(12,n)}if(r===35){let t=n+1;for(;t<n+9&&f(e.charCodeAt(t));)t++;return t>=n+4?this.token(13,t):1}if(r===34){let t=e.indexOf(`"`,n+1);return t===-1?1:this.token(17,t+1)}return r===44?this.token(18,n+1):r===58?this.token(19,n+1):1}}}}token(e,t){return this.text=this.src.slice(this.at,t),this.at=t,e}},b=`'EOF', 'NEWLINE', 'TITLE', 'SET', 'UNION', 'TEXT', 'INDENT_TEXT', 'STYLE'`,x=`'NUMERIC', 'IDENTIFIER', 'STRING', 'HEXCOLOR', 'RGBCOLOR', 'RGBACOLOR'`;function S(e,t){let n=new y(e,t),r=-1,i=()=>r===-1?r=n.next():r,a=t=>{throw i()===1?u(`venn`,e,n.start,``,!0):u(`venn`,e,n.start,`Expecting ${t}, got '${_[r]}'`)},o=()=>(r=-1,n.text),c=e=>(i()!==e&&a(`'${_[e]}'`),o()),l=()=>(i()!==16&&r!==17&&a(`'IDENTIFIER', 'STRING'`),o()),d=()=>{let e=[l()];for(;i()===18;)o(),e.push(l());return e},f=(e,n)=>{let r=i()===11?o():void 0,a;if(i()===19&&(o(),a=parseFloat(c(12))),n){if(e.length<2)throw new s(`union requires multiple identifiers`,`semantic`,{type:`venn`});t.validateUnionIdentifiers(e)}t.addSubsetData(e,r,a),t.setIndentMode(!0)},p=e=>{let n=i();n!==16&&n!==17&&n!==12&&a(`'NUMERIC', 'IDENTIFIER', 'STRING'`);let r=o(),s=n!==12&&i()===11?o():void 0;t.addTextData(e(),r,s)},m=()=>{let e=d(),n=[];for(;;){let e=c(16);c(19);let t;if(i()===17)t=o();else{let e=[];for(;i()===16||r>=12&&r<=15;)e.push(o());e.length===0&&a(x),t=e.join(` `)}if(n.push([e,t]),i()!==18)break;o()}t.addStyleData(e,n)};for(;i()===3;)o();for(c(4);;){let e=i();if(e===2)return;if((e<3||e>10||e===4)&&a(b),o(),e===5)t.setDiagramTitle(n.text.slice(6));else if(e===6)f([l()],!1);else if(e===7)f(d(),!0);else if(e===8){let e=d();p(()=>e)}else e===9?p(()=>{let e=t.getCurrentSets();if(!e)throw new s(`text requires set`,`semantic`,{type:`venn`});return e}):e===10&&m()}}var C=Math.PI*2;function w(e){let t=new Set,n=new Map;for(let r of e)t.add(JSON.stringify([...r.sets].sort())),r.sets.length===1&&n.set(r.sets[0],r.size);let r=[];for(let i of e){if(i.sets.length<3)continue;let e=[...i.sets].sort();for(let i=0;i<e.length-1;i++)for(let a=i+1;a<e.length;a++){let o=[e[i],e[a]],s=JSON.stringify(o);if(t.has(s))continue;t.add(s);let c=n.get(o[0]),l=n.get(o[1]);r.push({sets:o,size:c!==void 0&&l!==void 0?Math.min(c,l)/4:2.5,label:``})}}return r.length>0?[...e,...r]:e}function T(e,t,n){if(n>=e+t)return 0;let r=Math.min(e,t);if(n<=Math.abs(e-t))return Math.PI*r*r;let i=e*e*Math.acos((n*n+e*e-t*t)/(2*n*e)),a=t*t*Math.acos((n*n+t*t-e*e)/(2*n*t)),o=.5*Math.sqrt(Math.max((-n+e+t)*(n+e-t)*(n-e+t)*(n+e+t),0));return i+a-o}function E(e,t,n){let r=Math.abs(e-t),i=e+t;if(!(n>0))return i;if(n>=Math.PI*Math.min(e,t)**2)return r;for(let a=0;a<48;a++){let a=(r+i)/2;T(e,t,a)>n?r=a:i=a}return(r+i)/2}function D(e,t,n,r,i,a){let o=1/0;for(let n of t){let t=e[n],s=r-t.x,c=i-t.y,l=t.r-Math.sqrt(s*s+c*c);if(l<o){if(l<a)return l;o=l}}for(let t of n){let n=e[t],s=r-n.x,c=i-n.y,l=Math.sqrt(s*s+c*c)-n.r;if(l<o){if(l<a)return l;o=l}}return o}function O(e,t,n){let r=0,i=0,a=e[t[0]];for(let n of t){let o=e[n];r+=o.x/t.length,i+=o.y/t.length,o.r<a.r&&(a=o)}let o=a.r,s=r,c=i,l=D(e,t,n,s,c,-1/0),u=0,d=(a,d)=>{let f=D(e,t,n,a,d,l-o*1e-9);if(!(f>l-o*1e-9))return!1;let p=Math.hypot(a-r,d-i);return f>l+o*1e-9||p<u-o*1e-9?(l=f,u=p,s=a,c=d,!0):!1};for(let e=-10;e<=10;e++)for(let t=-10;t<=10;t++)t*t+e*e<=100&&d(a.x+t*o/10,a.y+e*o/10);let f=o/10;for(let e=0;e<40&&f>o*1e-6;e++){let e=!1;for(let t=0;t<8;t++){let n=t*C/8;d(s+Math.cos(n)*f,c+Math.sin(n)*f)&&(e=!0)}e||(f/=2)}return{x:s,y:c,margin:l}}function k(e){let t=new Map;for(let n of e)for(let e of n.sets)t.has(e)||t.set(e,10);for(let n of e)n.sets.length===1&&t.set(n.sets[0],n.size);let n=new Map,r=[],i=0;for(let e of t.values())Number.isFinite(e)&&e>i&&(i=e);i===0&&(i=10);let a=Math.sqrt(i/Math.PI);for(let[e,i]of t){n.set(e,r.length);let t=Number.isFinite(i)&&i>0?Math.sqrt(i/Math.PI):0;r.push({id:e,x:0,y:0,r:Math.max(t,a*.3)})}let o=r.length;if(o<2)return r;let s=new Map;for(let t of w(e)){if(t.sets.length!==2)continue;let e=n.get(t.sets[0]),r=n.get(t.sets[1]);e!==r&&s.set(Math.min(e,r)*o+Math.max(e,r),t.size)}let c=new Map;for(let[e,t]of s)c.set(e,E(r[Math.floor(e/o)].r,r[e%o].r,t));let l=a*.15,u=(e,t)=>c.get(e*o+t)??r[e].r+r[t].r+l;if(o===2)return r[1].x=u(0,1),r;if(o===3){let t=u(0,1),n=u(0,2),i=u(1,2),o=e.some(e=>new Set(e.sets).size===3);for(let e=0;e<40;e++){let e=t>0?(t*t+n*n-i*i)/(2*t):0;if(r[1].x=t,r[2].x=Math.max(-n,Math.min(n,e)),r[2].y=Math.sqrt(Math.max(n*n-e*e,0)),!o||O(r,[0,1,2],[]).margin>a*.12)break;t*=.94,n*=.94,i*=.94}return r}let d=0;for(let e of r)d+=2*e.r+l;let f=Math.min(300,Math.floor(3e6/(o*o)));if(o<=64){let e=d/C;r.forEach((t,n)=>{let r=n*C/o-Math.PI/2;t.x=Math.cos(r)*e,t.y=Math.sin(r)*e})}else{let e=Math.ceil(Math.sqrt(o)),t=2*a+l;r.forEach((n,r)=>{n.x=r%e*t,n.y=Math.floor(r/e)*t})}let p=new Float64Array(o),m=new Float64Array(o),h=new Int32Array(o);for(let e=0;e<f;e++){p.fill(0),m.fill(0),h.fill(0);for(let e=0;e<o;e++)for(let t=e+1;t<o;t++){let n=c.get(e*o+t),i=r[e].r+r[t].r+l,a=r[t].x-r[e].x,s=r[t].y-r[e].y,u=Math.hypot(a,s);if(n===void 0&&u>=i)continue;u<1e-9&&(a=Math.cos(e+t),s=Math.sin(e+t),u=1);let d=(u-(n??i))/2/u;p[e]+=a*d,m[e]+=s*d,p[t]-=a*d,m[t]-=s*d,h[e]++,h[t]++}for(let e=0;e<o;e++)h[e]!==0&&(r[e].x+=p[e]/h[e],r[e].y+=m[e]/h[e])}return r}function A(e,t){let n=e=>`M${t(e.x-e.r)},${t(e.y)}A${t(e.r)},${t(e.r)} 0 1 1 ${t(e.x+e.r)},${t(e.y)}A${t(e.r)},${t(e.r)} 0 1 1 ${t(e.x-e.r)},${t(e.y)}Z`;if(e.length===1)return n(e[0]);let r=(t,n,r,i)=>{for(let a of e)if(a!==r&&a!==i&&Math.hypot(t-a.x,n-a.y)>a.r*(1+1e-9))return!1;return!0},i=[];for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++){let a=e[t],o=e[n],s=Math.hypot(o.x-a.x,o.y-a.y);if(s>=a.r+o.r||s<=Math.abs(a.r-o.r)||s===0)continue;let c=(a.r*a.r-o.r*o.r+s*s)/(2*s),l=Math.sqrt(Math.max(a.r*a.r-c*c,0)),u=a.x+(o.x-a.x)*c/s,d=a.y+(o.y-a.y)*c/s;for(let e of[1,-1]){let t=u+e*l*(o.y-a.y)/s,n=d-e*l*(o.x-a.x)/s;r(t,n,a,o)&&i.push({x:t,y:n,a,b:o})}}if(i.length<2){let t=e[0];for(let n of e)n.r<t.r&&(t=n);for(let n of e)if(n!==t&&Math.hypot(n.x-t.x,n.y-t.y)+t.r>n.r*(1+1e-9))return``;return n(t)}let a=0,o=0;for(let e of i)a+=e.x/i.length,o+=e.y/i.length;i.sort((e,t)=>Math.atan2(e.y-o,e.x-a)-Math.atan2(t.y-o,t.x-a));let s=``;for(let e=0;e<i.length;e++){let n=i[e],r=i[(e+1)%i.length];e===0&&(s=`M${t(n.x)},${t(n.y)}`);let a,o=0,c=1/0;for(let e of[n.a,n.b]){if(e!==r.a&&e!==r.b)continue;let t=Math.atan2(n.y-e.y,n.x-e.x),i=Math.atan2(r.y-e.y,r.x-e.x)-t;i<=0&&(i+=C);let s=e.x+e.r*Math.cos(t+i/2),l=e.y+e.r*Math.sin(t+i/2),u=Math.hypot(s-(n.x+r.x)/2,l-(n.y+r.y)/2);u<c&&(c=u,a=e,o=+(i>Math.PI))}s+=a===void 0?`L${t(r.x)},${t(r.y)}`:`A${t(a.r)},${t(a.r)} 0 ${o} 1 ${t(r.x)},${t(r.y)}`}return s+`Z`}var j=100,M=1.6,N=i([]);function P(e){return e.length===1?e[0]:JSON.stringify(e)}function F(s,c,l){let u=l.fontSize??16,f=Math.round(u*.875),p=Math.round(u*.8125),h=l.measurer??d(l.fontFamily,l.fontFamilyMono),g=l.padding??8,_=k(s.subsets),v=new Map;_.forEach((e,t)=>v.set(e.id,t));let y=new Map;for(let{targets:e,styles:t}of s.styles){let n=P(e),r=y.get(n);r||y.set(n,r=new Map);for(let[e,n]of t)r.set(e,n)}let b=e=>{let t=y.get(e);if(!t)return N;let n=[];for(let[e,r]of t)n.push(`${e}:${r}`);return i(n)},x=_.map(()=>[]);for(let e=0;e<_.length;e++)for(let t=e+1;t<_.length;t++)Math.hypot(_[e].x-_[t].x,_[e].y-_[t].y)<_[e].r+_[t].r&&(x[e].push(t),x[t].push(e));let S=new Map;for(let e of s.subsets)S.set(P(e.sets),e);let C=new Map;for(let[e,t]of S){let n=[...new Set(t.sets)],r=n.map(e=>v.get(e)),i=new Set(r),o=r[0];for(let e of r)_[e].r<_[o].r&&(o=e);let s=b(e),c=t.label??(t.sets.length===1?t.sets[0]:void 0),l=+!!s.bold|(s.italic?2:0),d=O(_,r,x[o].filter(e=>!i.has(e)));d.margin<_[o].r*.2&&(d=O(_,r,[]));let p={sets:n,inside:r,spot:d,lines:[],style:s};if(c){let e=n.length===1?u:f;p.lines.push({id:void 0,raw:c,size:e,base:l,label:a(c,!1,h,e,4e3,l)})}C.set(e,p)}for(let e of s.textNodes){let t=e.label??e.id;C.get(P(e.sets))?.lines.push({id:e.id,raw:t,size:p,base:0,label:a(t,!1,h,p,4e3)})}let w=0;for(let e of _)e.r>w&&(w=e.r);let T=w>0?j/w:1,E=1;for(let e of C.values()){if(e.spot.margin<=0)continue;let t=0,n=0;for(let r of e.lines)t=Math.max(t,r.label.width),n+=r.label.height;let r=Math.hypot(t,n)/2+4;E=Math.max(E,Math.min(r/(e.spot.margin*T),M))}T*=E;for(let e of C.values()){let t=Math.max(e.spot.margin*T*1.8,72);for(let n of e.lines)n.label.width>t&&(n.label=a(n.raw,!1,h,n.size,t,n.base))}let D=1/0,F=1/0,I=-1/0,L=-1/0;for(let e of _)D=Math.min(D,(e.x-e.r)*T),F=Math.min(F,(e.y-e.r)*T),I=Math.max(I,(e.x+e.r)*T),L=Math.max(L,(e.y+e.r)*T);for(let e of C.values()){let t=0,n=0;for(let r of e.lines)t=Math.max(t,r.label.width),n+=r.label.height;D=Math.min(D,e.spot.x*T-t/2),I=Math.max(I,e.spot.x*T+t/2),F=Math.min(F,e.spot.y*T-n/2),L=Math.max(L,e.spot.y*T+n/2)}_.length===0&&(D=F=I=L=0);let R=a(s.title&&m(s.title),!1,h,u,4e3,1),z=R.height>0?R.height+12:0,B=Math.max(I-D,R.width),V=g+(B-(I-D))/2-D,H=g+z-F,U=Math.ceil(B+2*g),W=Math.ceil(L-F+z+2*g),G=_.map(e=>({id:e.id,x:e.x*T+V,y:e.y*T+H,r:e.r*T})),K=``;G.forEach((e,r)=>{let i=t(r),a=C.get(e.id)?.style??N;K+=`<circle class="pele-venn-set" data-id="${n(e.id)}" cx="${o(e.x)}" cy="${o(e.y)}" r="${o(e.r)}" fill="${i}" fill-opacity="0.2" stroke="${i}"${a.shape}/>`});let q=``,J=``;for(let e of C.values()){let t=n(e.sets.join(`|`));if(e.sets.length>1&&e.style.shape!==``){let n=A(e.inside.map(e=>G[e]),o);n!==``&&(q+=`<path class="pele-venn-overlap" data-id="${t}" d="${n}" fill="none"${e.style.shape}/>`)}let i=0;for(let t of e.lines)i+=t.label.height;if(i===0)continue;let a=e.spot.x*T+V,s=e.spot.y*T+H-i/2,c=``;for(let t of e.lines){let i=t.id===void 0?` class="pele-label"${t.size===u?``:` font-size="${t.size}"`}${e.style.text}`:` class="pele-venn-text" data-id="${n(t.id)}" font-size="${p}" fill="var(--_m)"${b(t.id).text}`;c+=r(t.label,a,s+t.label.height/2,i),s+=t.label.height}J+=`<g class="pele-venn-region" data-id="${t}">${c}</g>`}return{svg:e(`venn`,U,W,u,l,{},r(R,U/2,g+R.height/2,` class="pele-title" font-weight="var(--_tw)"`)+`<g class="pele-venn-sets">${K}</g>`+(q?`<g class="pele-venn-overlaps">${q}</g>`:``)+(J?`<g class="pele-venn-labels">${J}</g>`:``)),width:U,height:W,links:[]}}var I={type:`venn`,parse(e,t,n){let r=new g;return n&&(r.title=n),S(e,r),r},render:F};export{I as venn};
@@ -0,0 +1 @@
1
+ import{_ as e,b as t,f as n,i as r,o as i,p as a,u as o,x as s,y as c}from"./E3FWOBN4-D5m5o2g0.js";import{r as l,t as u}from"./DKTLEL5E-DciMwFJ1.js";import{n as d,r as f,t as p}from"./UO52YEYL-DN1qbGwF.js";import{t as m}from"./E65FQMJL-Bg5F0Zo8.js";import{a as ee,i as h,o as g}from"./A255FCTW-woaH7Mj_.js";import{PeleError as _,f as v,u as y}from"./lazy-DaMZI1F7.js";var b=11,x=class{type=`mindmap`;title;nodes=[];getType=p;baseLevel=0;open=[];addNode(e,t,n,r){let i=this.nodes.length===0;i&&(this.baseLevel=e),e-=this.baseLevel;let a=this.open,o=a.length;for(;o>0&&a[o-1].level>=e;)o--;let s=a[o-1];if(!s&&!i)throw new _(`There can be only one root. No parent could be found for ("${n}")`,`semantic`,{type:`mindmap`});let c={id:this.nodes.length,nodeId:t,level:e,descr:n,type:r,children:[],isRoot:i};s&&(c.section=s.isRoot?s.children.length%b:s.section,s.children.push(c)),a.length=o,a.push(c),this.nodes.push(c)}decorateNode(e){let t=this.nodes[this.nodes.length-1];!e||!t||(e.icon&&(t.icon=e.icon),e.class&&(t.class=e.class))}};function S(e,t){f(e,t,!1)}var te=[``,`rounded`,`rect`,`circle`,`cloud`,`bang`,`hex`],ne=`stadium`,re=36,ie=8,ae=18,oe=52,se=28,ce=6,le=12,ue=.22,C=6,w=28,de=12,fe=8,pe=10;function me(e,t,n,r){if(e.lines.length<2)return i(e,t+e.width/2,n,` class="pele-label"`,r);let o=``,s=n-e.height/2;for(let n=0;n<e.lines.length;n++)o+=i(c(e,n),t+e.widths[n]/2,s+a(e,n),` class="pele-label"`,r);return o}function he(e,t,n){return u(n,r=>T(e,t,n,r))}function T(a,c,u,f){let p=u.fontSize??16,_=u.measurer??y(u.fontFamily,u.fontFamilyMono),b=u.padding??8,x=u.icons,S=c.mindmap?.maxNodeWidth,he=typeof S==`number`&&S>0?Math.min(S,2e3):200,T=p*1.25,E=a.nodes,D=E.length,O=new Int32Array(D),k=new Int32Array(D);for(let e=0;e<D;e++)for(let t of E[e].children)O[t.id]=e,k[t.id]=k[e]+1;let ge=f&&u.maxWidth!==void 0&&u.maxWidth>0?u.maxWidth-2*b:1/0,A=Array(D),j=Array(D),M=new Float64Array(D),N=new Float64Array(D),P=new Float64Array(D),F=new Float64Array(D),I=new Uint8Array(D);for(let e=0;e<D;e++){let t=E[e];I[e]=+(t.icon!==void 0&&v(t.icon)!==``);let n=Math.min(he,Math.max(72,ge-k[e]*w-2*ce-(I[e]?T+C:0))),r=A[e]=o(t.descr,!0,_,p,n),i=r.width+(I[e]?T+(r.width>0?C:0):0),a=Math.max(r.height,Math.round(p*1.5)),s=te[t.type]||(e===0?ne:``);if(f&&e===0&&s!==`rect`&&s!==`rounded`&&(s=ne),j[e]=s,s===``){let n=t.children.length>0;M[e]=i+2*(n?le:ce),N[e]=a+(n?6:0),F[e]=N[e]/2}else{let t=h(s,i,a);M[e]=t.w,N[e]=t.h,P[e]=t.dy,F[e]=t.h/2}}let L=new Float64Array(D),R=new Float64Array(D),z=new Float64Array(D),_e=new Float64Array(D),ve=0,ye=(e,t,n,r)=>{let i=0,a=0;for(let o=t;o<n;o++){let t=e[o].id;R[t]=i,a=e[o].children.length>0||o+1<n&&e[o+1].children.length>0?Math.max(r,ae):r,i+=L[t]+a}ve=i-a;let o=e[t].id,s=e[n-1].id;return(R[o]+z[o]+F[o]+R[s]+z[s]+F[s])/2};for(let e=D-1;e>0;e--){let t=E[e].children;if(t.length===0){L[e]=N[e];continue}let n=ye(t,0,t.length,ie)-F[e],r=Math.min(0,n);L[e]=Math.max(ve,n+N[e])-r,z[e]=n-r,_e[e]=-r}let B=new Float64Array(D),V=new Float64Array(D),H=new Float64Array(D),U=new Int8Array(D),be=new Float64Array(D);if(f){let e=0;for(let t=0;t<D;t++)t>0&&O[t]===0&&(e+=pe),B[t]=k[t]*w+M[t]/2,V[t]=e,e+=N[t]+pe}else if(D>0){let e=E[0].children,t=e.length,n=0;for(let t of e)n+=L[t.id];let r=t,i=1/0,a=0;for(let o=1;o<t;o++){a+=L[e[o-1].id];let s=Math.abs(2*a-n+(2*o-t)*se);s<i&&(i=s,r=o)}for(let n=0,i=r,a=1;n<t;n=i,i=t,a=-1){let t=ye(e,n,i,se);for(let r=n;r<i;r++){let n=e[r].id;H[n]=R[n]-t,U[n]=a}}V[0]=-N[0]/2;for(let e=0;e<D;e++){e>0&&(V[e]=H[e]+z[e]);for(let t of E[e].children){let n=t.id;e>0&&(U[n]=U[e],H[n]=H[e]+_e[e]+R[n]),B[n]=B[e]+U[n]*(M[e]/2+(e>0?re:oe)+M[n]/2)}}}let W=0,G=0,K=0,q=0,J=``,Y=``,X=``,Z=``,xe=e=>{X!==``&&(J+=`<g class="pele-branch pele-section-${e??0}"><g class="pele-edges" fill="none" stroke="${Z}" stroke-width="1.5">${Y}</g>${X}</g>`,Y=X=``)};for(let e=1;e<=D;e++){let a=e%D,o=E[a],c=j[a],l=A[a],u=B[a],p=V[a];if(W=Math.min(W,u-M[a]/2),G=Math.max(G,u+M[a]/2),K=Math.min(K,p),q=Math.max(q,p+N[a]),(a===0||O[a]===0)&&xe(E[e-1].section),a>0&&f){O[a]===0&&(Z=n(o.section??0));let e=O[a],t=e===0?Math.min(Math.max(de,N[0]/2),w-fe):de,r=B[e]-M[e]/2+Math.min(t,M[e]/2),i=be[e]||V[e]+N[e],l=u-M[a]/2+(c?g(c,M[a],N[a],3):0),d=p+F[a],f=Math.max(0,Math.min(fe,l-r,d-i));be[e]=d-f,Y+=`<path class="pele-edge" d="M${s(r)},${s(i)}V${s(d-f)}Q${s(r)},${s(d)} ${s(r+f)},${s(d)}H${s(l)}"/>`}else if(a>0){O[a]===0&&(Z=n(o.section??0));let e=O[a],t=U[a],r=t>0?1:3,i=B[e]+t*(M[e]/2-(j[e]?g(j[e],M[e],N[e],r):0)),l=V[e]+F[e],d=u-t*M[a]/2+(c?t*g(c,M[a],N[a],4-r):0),f=p+F[a],m=s((i+d)/2);Y+=`<path class="pele-edge" d="M${s(i)},${s(l)}C${m},${s(l)} ${m},${s(f)} ${s(d)},${s(f)}"/>`}let m=!c&&o.children.length>0,h=` fill="${Z}" fill-opacity="${ue}" stroke="${Z}"`,_=``;c?_=a>0?ee(c,M[a],N[a],h,` stroke="${Z}"`):ee(c,M[a],N[a],` fill="var(--_s)" stroke="var(--_b)"`,` stroke="var(--_b)"`):m&&(_=`<rect x="${s(-M[a]/2)}" y="${s(-N[a]/2)}" width="${s(M[a])}" height="${s(N[a])}" rx="${s(N[a]/2)}"${h}/>`);let v=0;o.icon&&I[a]&&(v=(T+(l.width>0?C:0))/2,_+=d(o.icon,-v-l.width/2,P[a]-T/2,T,x));let y=`<g class="pele-node pele-shape-${c||(m?`branch`:`text`)}${a>0?``:` pele-root`}${t(o.class??``)}" data-id="${r(o.nodeId)}" transform="translate(${s(u)},${s(p+N[a]/2)})">`+_+(f&&!c?me(l,v-l.width/2,P[a],x):i(l,v,P[a],` class="pele-label"`,x))+`</g>`;a>0?X+=y:J+=y}let Q=m(a.title,_,p,l(u)),Se=Q.height>0?Q.height+16:0,Ce=Math.max(G-W,Q.width),$=Math.ceil(Ce+2*b),we=Math.ceil(q-K+Se+2*b),Te=i(Q,$/2,b+Q.height/2,` class="pele-title" font-weight="var(--_tw)"`)+`<g transform="translate(${s(b-W+(Ce-G+W)/2)},${s(b+Se-K)})">${J}</g>`;return{svg:e(`mindmap`,$,we,p,u,{},Te),width:$,height:we,links:[]}}var E={type:`mindmap`,math:!0,parse(e,t,n){let r=new x;return r.title=n,S(e,r),r},render:he};export{E as mindmap};
@@ -0,0 +1,2 @@
1
+ import{i as e,n as t,t as n}from"./XLHPVVFU-BFP9ID9p.js";import{_ as r,f as i,i as a,o,r as s,x as c}from"./E3FWOBN4-D5m5o2g0.js";import{n as l,t as u}from"./STAXBNH4-D4c13Xlj.js";import{t as d}from"./DKTLEL5E-DciMwFJ1.js";import{g as f,h as p,s as m,u as h}from"./lazy-DaMZI1F7.js";function g(e){let t=new Set;for(let n of e)for(let e of n.people)t.add(e);return[...t].sort()}var _=class{type=`journey`;title;accTitle;accDescr;sections=[];tasks=[];currentSection=``;setDiagramTitle(e){this.title=e}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,``)}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
2
+ `)}addSection(e){this.currentSection=e,this.sections.push(e)}addTask(e,t){let n=t.substring(1).split(`:`),r=n.length===1?[]:n[1].split(`,`).map(e=>e.trim());this.tasks.push({task:e,score:Number(n[0]),people:r,section:this.currentSection})}getActors(){return g(this.tasks)}},v=[`$end`,`EOF`,`INVALID`,`NEWLINE`,`journey`,`title`,`acc_title`,`acc_title_value`,`acc_descr`,`acc_descr_value`,`acc_descr_multiline_value`,`section`,`taskName`,`taskData`,`:`];function y(e,t,n){let r=e.length,i=t;for(;i<r;i++){let t=e.charCodeAt(i);if(t===35||t===10||t===59||n&&t===58)break}return i}function b(r){let i=r.length,a=[],o=[],s=[],c={types:a,texts:o,starts:s},l=0,u=(e,t)=>{a.push(e),o.push(r.slice(l,t)),s.push(l),l=t};for(;l=t(r,l),!(l>=i);){let t=r.charCodeAt(l),a=l+1;if(t===10){for(;r.charCodeAt(a)===10;)a++;u(3,a)}else if(n(r,l,`journey`)&&!f(r.charCodeAt(l+7)))u(4,l+7);else{if(n(r,l,`title`)){for(a=l+5;r.charCodeAt(a)!==10&&p(r.charCodeAt(a));)a++;if(a===i||r.charCodeAt(a)===10){l=a;continue}let e=r.charCodeAt(l+5);if(e!==13&&p(e)&&(a=y(r,l+6,!1),a>l+6)){u(5,a);continue}}a=e(r,l,c,6),a===l?n(r,l,`section`)&&p(r.charCodeAt(l+7))&&(a=y(r,l+8,!0),a>l+8)?u(11,a):t===58?(a=y(r,l+1,!1),u(a>l+1?13:14,a>l+1?a:l+1)):t===59?u(2,l+1):u(12,y(r,l+1,!0)):l=a}}return(s.length===0||s[s.length-1]<i)&&u(1,i),u(0,i),c}var x=`'EOF', 'SPACE', 'NEWLINE', 'title', 'acc_title', 'acc_descr', 'acc_descr_multiline_value', 'section', 'taskName'`;function S(e,t){let{types:n,texts:r,starts:i}=b(e),a=(t,r)=>{let a=n[t]===0?`1`:v[n[t]];throw m(`journey`,e,i[t],`Expecting ${r}, got '${a}'`)};n[0]!==4&&a(0,`'journey'`);for(let e=1;;e++){let i=r[e];switch(n[e]){case 3:break;case 5:t.setDiagramTitle(i.substring(6));break;case 6:t.setAccTitle(r[++e].trim());break;case 8:t.setAccDescription(r[++e].trim());break;case 10:t.setAccDescription(i.trim());break;case 11:t.addSection(i.substring(8));break;case 12:n[++e]!==13&&a(e,`'taskData'`),t.addTask(i,r[e]);break;case 1:return;default:a(e,x)}}}var C=10,w=8,T=124,E=200,D=12,ee=6,O=24,k=26,A=11,j=5,te=13,ne=20,M=`<circle cx="-3.6" cy="-2.8" r="1.3"/><circle cx="3.6" cy="-2.8" r="1.3"/>`,N={happy:`M-5,2A6,6 0 0 0 5,2`,neutral:`M-4.5,4.5H4.5`,sad:`M-5,6.5A6,6 0 0 1 5,6.5`};function re(e,t,n){return`<g class="pele-face pele-face-${n}" transform="translate(${c(e)},${c(t)})"><circle r="${A}" fill="var(--_bg)" stroke="var(--_l)"/><g fill="var(--_l)">${M}</g><path d="${N[n]}" fill="none" stroke="var(--_l)" stroke-linecap="round"/></g>`}function P(e,t,n){return d(n,r=>F(e,t,n,r))}function F(e,t,n,d){let f=n.fontSize??16,p=Math.round(f*.875),m=Math.round(f*.75),_=n.measurer??h(n.fontFamily,n.fontFamilyMono),v=n.padding??8;if(d)return ie(e,n);let y=e.tasks,b=y.length,x=g(y).filter(e=>e!==``),S=new Map;x.forEach((e,t)=>S.set(e,t));let M=T,N=y.map(e=>l(e.task,_,p,M)),P=0;for(let e of N)P=Math.max(P,e.width);P>M&&(M=Math.min(Math.ceil(P),E),N=y.map(e=>u(e.task,_,p,M)));let F=M+2*C,I=F+D,L=b>0?b*I-D:0,R=Math.round(p*1.5),ae=Math.max(L,240),z=[],B=0,V=0,H=0;for(let e of x){let t=u(e,_,p,ae-2*j-6),n=2*j+6+t.width;H>0&&H+n>ae&&(H=0,V+=4);let r=H>0?z[z.length-1].y:V,i=Math.max(t.height,R);z.push({name:e,label:t,x:H,y:r,h:i}),H+=n,B=Math.max(B,H),V=Math.max(V,r+i),H+=ne}let U=b>0?O+L:0,W=u(e.title,_,f,Math.max(U,320),1),oe=W.height>0?W.height+16:0,G=Math.max(U,W.width,b>0?O+B:0),K=v+(G-U)/2+O,q=v+oe,se=[],J=0;for(let e=0;e<b;){let t=e+1;for(;t<b&&y[t].section===y[e].section;)t++;let n;y[e].section!==``&&(n=u(y[e].section,_,p,(t-e)*I-D-2*C,1),J=Math.max(J,Math.max(n.height,R)+2*ee)),se.push({start:e,count:t-e,label:n}),e=t}let Y=R;for(let e of N)Y=Math.max(Y,e.height);let ce=x.length>0?2*j+6:0,X=Y+ce+2*w,Z=q+(J>0?J+ee:0),le=Z+X+A+16,ue=le+4*k,de=K+L,Q=``,$=q;if(b>0){let e=``,t=``;for(let n=5;n>=1;n--){let r=le+(5-n)*k;e+=`M${c(K-6)},${c(r)}H${c(de)}`,t+=`<text x="${c(K-12)}" y="${c(r+m*.35)}">${n}</text>`}Q+=`<path class="pele-grid" d="${e}" fill="none" stroke="var(--_a)"/><g class="pele-scale" font-size="${m}" text-anchor="end" fill="var(--_m)">${t}</g>`;let n=``,r=``,l=``,u=[];y.forEach((e,t)=>{let d=K+t*I,f=d+F/2,m=e.score,h=le+(5-(Number.isNaN(m)?3:Math.min(5,Math.max(1,m))))*k;n+=`${t===0?`M`:`L`}${c(f)},${c(h)}`,r+=`M${c(f)},${c(Z+X)}V${c(h-A)}`,l+=re(f,h,m>3?`happy`:m<3?`sad`:`neutral`);let g=``,_=e.people.filter(e=>e!==``),v=Math.min(te,(F-2*C-2*j)/Math.max(_.length-1,1));_.forEach((e,t)=>{g+=`<circle class="pele-actor" cx="${c(f+(t-(_.length-1)/2)*v)}" cy="${c(Z+X-w-j)}" r="${j}" fill="${i(S.get(e)??0)}" stroke="var(--_s)"><title>${a(e)}</title></circle>`}),u.push(`<g class="pele-node pele-task" data-id="${a(e.task.trim())}"><rect x="${c(d)}" y="${c(Z)}" width="${c(F)}" height="${c(X)}" fill="var(--_s)" stroke="var(--_b)"${s}/>`+o(N[t],f,Z+w+Y/2,` font-size="${p}"`)+g+`</g>`)}),Q+=`<path class="pele-stems" d="${r}" fill="none" stroke="var(--_b)" stroke-dasharray="2 3"/>`+(b>1?`<path class="pele-edge" d="${n}" fill="none" stroke="var(--_l)" stroke-linejoin="round"/>`:``)+l;for(let e of se){let t=u.slice(e.start,e.start+e.count).join(``);if(!e.label){Q+=t;continue}let n=K+e.start*I,r=e.count*I-D;Q+=`<g class="pele-cluster pele-section" data-id="${a(y[e.start].section.trim())}"><rect x="${c(n)}" y="${c(q)}" width="${c(r)}" height="${c(J)}" fill="var(--_a)"${s}/>`+o(e.label,n+r/2,q+J/2,` font-size="${p}" font-weight="var(--_hw)"`)+t+`</g>`}if($=ue+A,z.length>0){let e=K+(L-B)/2,t=$+16,n=``;for(let r of z){let s=t+r.y+r.h/2;n+=`<g class="pele-legend-item" data-id="${a(r.name)}"><circle cx="${c(e+r.x+j)}" cy="${c(s)}" r="${j}" fill="${i(S.get(r.name)??0)}"/>`+o(r.label,e+r.x+2*j+6+r.label.width/2,s,``)+`</g>`}Q+=`<g class="pele-legend" font-size="${p}">${n}</g>`,$=t+V}}let fe=Math.ceil(G+2*v),pe=Math.ceil(Math.max($,v)+v),me=o(W,v+G/2,v+W.height/2,` class="pele-title" font-weight="var(--_tw)"`)+Q;return{svg:r(`journey`,fe,pe,f,n,e,me),width:fe,height:pe,links:[]}}function ie(e,t){let n=t.fontSize??16,a=Math.round(n*.875),l=t.measurer??h(t.fontFamily,t.fontFamilyMono),d=t.padding??8,f=Math.max(140,(t.maxWidth??320)-2*d),p=u(e.title,l,n,f,1),m=g(e.tasks).filter(e=>e!==``),_=new Map(m.map((e,t)=>[e,t])),v=d+(p.height?p.height+16:0),y,b=``,x=p.width;e.tasks.forEach((t,r)=>{if(t.section!==y){y=t.section;let e=u(y,l,n,f-16,1);e.height&&(b+=o(e,d+8+e.width/2,v+e.height/2,` class="pele-cluster-label" font-weight="var(--_hw)"`),x=Math.max(x,e.width+16),v+=e.height+8)}let p=u(t.task,l,a,f-72),m=t.people.filter(e=>e!==``).map(e=>({name:e,label:u(e,l,a,f-44)})),h=Math.max(p.height,42),g=2*w+h;for(let e of m)g+=Math.max(16,e.label.height)+4;let S=Math.max(f,p.width+72);b+=`<g class="pele-node pele-journey-step" data-id="${r}"><rect x="${c(d)}" y="${c(v)}" width="${c(S)}" height="${c(g)}" fill="var(--_s)" stroke="var(--_b)"${s}/>`,b+=o(p,d+C+p.width/2,v+w+p.height/2,` class="pele-label"`);let T=d+S-28;b+=re(T,v+w+A,t.score>3?`happy`:t.score<3?`sad`:`neutral`),Number.isNaN(t.score)||(b+=`<text class="pele-journey-score" x="${c(T)}" y="${c(v+w+2*A+a)}" font-size="${a}" text-anchor="middle">${c(Math.min(5,Math.max(1,t.score)))}</text>`);let E=v+w+h+4;for(let e of m){let t=Math.max(16,e.label.height);b+=`<circle class="pele-actor" cx="${c(d+16)}" cy="${c(E+t/2)}" r="${j}" fill="${i(_.get(e.name))}"/>`+o(e.label,d+28+e.label.width/2,E+t/2,` class="pele-journey-actor" font-size="${a}"`),E+=t+4}b+=`</g>`,v+=g,r+1<e.tasks.length&&(b+=`<path class="pele-edge" d="M${c(d+S/2)},${c(v)}v16" fill="none" stroke="var(--_l)"/>`),v+=16,x=Math.max(x,S)});let S=Math.ceil(x+2*d),T=Math.ceil(Math.max(d+p.height,v-(e.tasks.length?16:0))+d),E=o(p,S/2,d+p.height/2,` class="pele-title" font-weight="var(--_tw)"`)+b;return{svg:r(`journey`,S,T,n,t,e,E),width:S,height:T,links:[]}}var I={type:`journey`,parse(e,t,n){let r=new _;return r.title=n,S(e,r),r},render:P};export{I as journey};
@@ -0,0 +1,5 @@
1
+ import{_ as e,a as t,g as n,i as r,o as i,r as a,s as o,u as s,x as c}from"./E3FWOBN4-D5m5o2g0.js";import{i as l}from"./DKTLEL5E-DciMwFJ1.js";import{i as u,t as d}from"./SPBWZ4VS-EqfCsJ5V.js";import{PeleError as f,h as p,s as m,u as ee}from"./lazy-DaMZI1F7.js";var h=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],g=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`];function _(e){return!Number.isNaN(e.getTime())}function v(e,t){let n=String(e);return n.length>=t?n:`0`.repeat(t-n.length)+n}function te(e){let t=[`th`,`st`,`nd`,`rd`],n=e%100;return e+(t[(n-20)%10]||t[n]||t[0])}function y(e){let t=-Math.round(e.getTimezoneOffset()/15)*15;return t===0?0:t}function b(e){let t=y(e),n=Math.abs(t);return(t>=0?`+`:`-`)+v(Math.floor(n/60),2)+`:`+v(n%60,2)}function x(e){return e.getDay()||7}function S(e,t){let n=new Date(e);return n.setDate(n.getDate()+t),n}function ne(e){let t=new Date(e.getFullYear(),e.getMonth()+1,0);return t.setHours(23,59,59,999),t.getDate()}function re(e,t){let n=new Date(e);return n.setDate(1),t(n),n.setDate(Math.min(e.getDate(),ne(n))),n}function ie(e,t,n){switch(n){case`M`:return re(e,n=>n.setMonth(e.getMonth()+t));case`y`:return re(e,n=>n.setFullYear(e.getFullYear()+t));case`d`:return S(e,Math.round(t));case`w`:return S(e,Math.round(7*t));case`h`:return new Date(e.getTime()+t*36e5);case`m`:return new Date(e.getTime()+t*6e4);case`s`:return new Date(e.getTime()+t*1e3);default:return new Date(e.getTime()+t)}}function ae(e){return S(e,4-x(e))}function oe(e){let t=ae(e),n=new Date(t.getFullYear(),0,1),r=x(n),i=S(n,4-r+(r>4?7:0)),a=(y(i)-y(t))*6e4,o=(t.getTime()-i.getTime()-a)/6048e5;return(o<0?Math.ceil(o)||0:Math.floor(o))+1}var se=/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,ce=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C=`YYYY-MM-DDTHH:mm:ssZ`;function le(e,t){if(!_(e))return`Invalid Date`;let n=t||C;if(n===`YYYY-MM-DD`)return w(e);let r=!1,i=n.replace(se,t=>{switch(t){case`Q`:return String(Math.ceil((e.getMonth()+1)/3));case`Do`:return`[`+te(e.getDate())+`]`;case`GGGG`:return String(ae(e).getFullYear());case`W`:return String(oe(e));case`WW`:return v(oe(e),2);case`k`:return String(e.getHours()||24);case`kk`:return v(e.getHours()||24,2);case`X`:return String(Math.floor(e.getTime()/1e3));case`x`:return String(e.getTime());case`gggg`:case`wo`:case`w`:case`ww`:case`z`:case`zzz`:return r=!0,t;default:return t}});if(r)return;let a=e.getHours();return i.replace(ce,(t,n)=>{if(n)return n;switch(t){case`YY`:return String(e.getFullYear()).slice(-2);case`YYYY`:return v(e.getFullYear(),4);case`M`:return String(e.getMonth()+1);case`MM`:return v(e.getMonth()+1,2);case`MMM`:return h[e.getMonth()].slice(0,3);case`MMMM`:return h[e.getMonth()];case`D`:return String(e.getDate());case`DD`:return v(e.getDate(),2);case`d`:return String(e.getDay());case`dd`:return g[e.getDay()].slice(0,2);case`ddd`:return g[e.getDay()].slice(0,3);case`dddd`:return g[e.getDay()];case`H`:return String(a);case`HH`:return v(a,2);case`h`:return String(a%12||12);case`hh`:return v(a%12||12,2);case`a`:return a<12?`am`:`pm`;case`A`:return a<12?`AM`:`PM`;case`m`:return String(e.getMinutes());case`mm`:return v(e.getMinutes(),2);case`s`:return String(e.getSeconds());case`ss`:return v(e.getSeconds(),2);case`SSS`:return v(e.getMilliseconds(),3);case`Z`:return b(e);default:return b(e).replace(`:`,``)}})}function w(e){let t=e.getFullYear(),n=e.getMonth()+1,r=e.getDate();return(t>=1e3&&t<=9999?t:v(t,4))+(n<10?`-0`:`-`)+n+(r<10?`-0`:`-`)+r}var ue=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,T=/\[[^\]]+]/g,E=/\d/,D=/\d\d/,O=/\d{3}/,de=/\d{4}/,k=/\d\d?/,A=/[+-]?\d+/,fe=/[+-]\d\d:?(\d\d)?|Z/,j=/\d*[^-_:/,()\s\d]+/;function M(e){return(t,n)=>(t[e]=+n,!0)}var N=(e,t)=>{if(t===`Z`)return e.offset=0,!0;let n=t.match(/([+-]|\d\d)/g),r=n[1]*60+(+n[2]||0);return e.offset=r===0?0:n[0]===`+`?-r:r,!0};function pe(e){return(t,n)=>{let r=e.indexOf(n)+1;return r<1?!1:(t.month=r%12||r,!0)}}var me=new Map([[`A`,{re:j,read:(e,t)=>(e.afternoon=t===`PM`,!0)}],[`a`,{re:j,read:(e,t)=>(e.afternoon=t===`pm`,!0)}],[`Q`,{re:E,read:(e,t)=>(e.month=(t-1)*3+1,!0)}],[`S`,{re:E,read:(e,t)=>(e.milliseconds=t*100,!0)}],[`SS`,{re:D,read:(e,t)=>(e.milliseconds=t*10,!0)}],[`SSS`,{re:O,read:(e,t)=>(e.milliseconds=+t,!0)}],[`s`,{re:k,read:M(`seconds`)}],[`ss`,{re:k,read:M(`seconds`)}],[`m`,{re:k,read:M(`minutes`)}],[`mm`,{re:k,read:M(`minutes`)}],[`H`,{re:k,read:M(`hours`)}],[`h`,{re:k,read:M(`hours`)}],[`HH`,{re:k,read:M(`hours`)}],[`hh`,{re:k,read:M(`hours`)}],[`D`,{re:k,read:M(`day`)}],[`DD`,{re:D,read:M(`day`)}],[`Do`,{re:j,read:(e,t)=>{let n=t.match(/\d+/);if(!n)return!1;e.day=+n[0],e.dayGiven=!0;for(let n=1;n<=31;n++)te(n)===t&&(e.day=n);return!0}}],[`w`,{re:k,read:M(`week`)}],[`ww`,{re:D,read:M(`week`)}],[`M`,{re:k,read:M(`month`)}],[`MM`,{re:D,read:M(`month`)}],[`MMM`,{re:j,read:pe(h.map(e=>e.slice(0,3)))}],[`MMMM`,{re:j,read:pe(h)}],[`Y`,{re:A,read:M(`year`)}],[`YY`,{re:D,read:(e,t)=>(e.year=+t+(+t>68?1900:2e3),!0)}],[`YYYY`,{re:de,read:M(`year`)}],[`Z`,{re:fe,read:N}],[`ZZ`,{re:fe,read:N}]]),P,F=null;function he(e){if(e===P)return F;if(P=e,F=null,/[Ll]/.test(e.replace(T,``)))return null;let t=e.match(ue);return t?(F=t.map(e=>me.get(e)??e.replace(/^\[|\]$/g,``)),F):null}function I(e,t,n){if(t===`x`||t===`X`)return new Date((t===`X`?1e3:1)*Number(e));let r=he(t);if(!r)return;let i={},a=e,o=0;for(let e of r){if(typeof e==`string`){o+=e.length;continue}let t=e.re.exec(a.slice(o));if(!t||!e.read(i,t[0]))return;a=a.replace(t[0],``)}i.afternoon!==void 0&&i.hours!==void 0&&(i.afternoon?i.hours<12&&(i.hours+=12):i.hours===12&&(i.hours=0));let s=i.dayGiven||i.day?i.day:!i.year&&!i.month?n.getDate():1,c=i.year||n.getFullYear(),l=0;i.year&&!i.month||(l=i.month>0?i.month-1:n.getMonth());let u=i.hours||0,d=i.minutes||0,f=i.seconds||0,p=i.milliseconds||0;if(i.offset!==void 0)return new Date(Date.UTC(c,l,s,u,d,f,p+i.offset*6e4));if(!i.week)return new Date(c,l,s,u,d,f,p)}function L(e,t,n){let r=I(e,t,n);return r&&_(r)&&le(r,t)===e?r:void 0}var ge=/^[YMDHhmsSZXx\-/.:, T]*$/,_e=/^\s*(active|done|crit|milestone|vert)\s*$/,ve=/^after\s+([\d\w- ]+)/,R=/^until\s+([\d\w- ]+)/,z=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/,ye=/[\s,]+/,B=/^\d+$/,be=new Set(g.map(e=>e.toLowerCase())),V=4e8,xe=400,Se=200,Ce=400;function we(e){let t=e===void 0?NaN:+e;return Number.isFinite(t)?t:Date.now()}function Te(e){let t=z.exec(e.trim());return t?[Number.parseFloat(t[1]),t[2]]:[NaN,`ms`]}function Ee(e,t){let n=new Set(e);for(let e of t.toLowerCase().split(ye))e!==``&&n.add(e);return[...n]}var De=class{type=`gantt`;title;accTitle;accDescr;dateFormat=``;axisFormat=``;tickInterval;todayMarker=``;includes=[];excludes=[];inclusiveEndDates=!1;topAxis=!1;displayMode=``;weekday;weekend=`saturday`;sections=[];links=new Map;tasks=[];byId=new Map;currentSection=``;taskCount=0;lastOrder=0;lastTaskId;options;now=0;work=0;includeSet=new Set;excludeSet=new Set;excludedDays=[];datedTokens=!1;constructor(e={}){this.options=e}setDateFormat(e){this.dateFormat=e}enableInclusiveEndDates(){this.inclusiveEndDates=!0}TopAxis(){this.topAxis=!0}setAxisFormat(e){this.axisFormat=e}setTickInterval(e){this.tickInterval=e}setTodayMarker(e){this.todayMarker=e}setIncludes(e){this.includes=Ee(this.includes,e)}setExcludes(e){this.excludes=Ee(this.excludes,e)}setWeekday(e){this.weekday=e}setWeekend(e){this.weekend=e}setDiagramTitle(e){this.title=e}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,``)}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
2
+ `)}addSection(e){this.currentSection=e,this.sections.push(e)}addTask(e,t){let n=(t.startsWith(`:`)?t.slice(1):t).split(`,`),r={id:``,task:e,section:this.currentSection,startTime:void 0,endTime:void 0,renderEndTime:null,manualEndTime:!1,processed:!1,active:!1,done:!1,crit:!1,milestone:!1,vert:!1,order:-1,classes:[],prevTaskId:this.lastTaskId,raw:{data:t,start:void 0,end:``}},i;for(;n.length>0&&(i=_e.exec(n[0]))!==null;)r[i[1]]=!0,n.shift();if(n.length===0)throw new f(`Task "${e.trim()}" needs a duration or an end date.`,`semantic`,{type:`gantt`});if(n.length>3)throw new f(`Task "${e.trim()}" has too many fields. A task takes an id, a start, and an end or duration.`,`semantic`,{type:`gantt`});for(let e=0;e<n.length;e++)n[e]=n[e].trim();n.length===3?r.id=n[0]:(this.taskCount++,r.id=`task`+this.taskCount),n.length>1&&(r.raw.start=n[n.length-2]),r.raw.end=n[n.length-1],r.vert||(r.order=this.lastOrder++),this.tasks.push(r),this.lastTaskId=r.id,this.byId.set(r.id,r)}setLink(e,t){let n=u(t);for(let t of e.split(`,`))this.byId.has(t)&&this.links.set(t,n);this.setClass(e,`clickable`)}setClickEvent(e,t,n){this.setClass(e,`clickable`)}setClass(e,t){for(let n of e.split(`,`))this.byId.get(n)?.classes.push(t)}getTasks(e){this.now=we(e),this.work=0,this.includeSet=new Set(this.includes),this.excludeSet=new Set(this.excludes);let t=this.weekend===`friday`?5:this.weekend===`saturday`?6:NaN,n=this.excludeSet.has(`weekends`);this.excludedDays=g.map((e,r)=>{let i=r||7;return n&&(i===t||i===t+1)||this.excludeSet.has(e.toLowerCase())}),this.datedTokens=this.includes.length>0||!ge.test(this.dateFormat.trim());for(let e of this.excludes)e!==`weekends`&&!be.has(e)&&(this.datedTokens=!0);for(let e of this.tasks)e.startTime=e.endTime=void 0,e.renderEndTime=null,e.processed=e.manualEndTime=!1;let r=this.compileTasks();for(let e=0;!r&&e<10;e++)r=this.compileTasks();return this.tasks}isInvalidDate(e){let t=this.excludedDays[e.getDay()];if(!this.datedTokens)return t;let n=this.dateFormat.trim(),r=w(e),i=r;this.spend(Se),n!==`YYYY-MM-DD`&&(this.spend(Ce+n.length*8),i=le(e,n));let a=e=>e.has(r)||i!==void 0&&e.has(i);return a(this.includeSet)?!1:t||a(this.excludeSet)}spend(e){if(this.work+=e,this.work>V)throw new f(`The gantt chart takes too much work to schedule.`,`limit`,{type:`gantt`})}parse(e,t){return this.spend((t.length+1)*(e.length+1)),L(e,t,new Date(this.now))}today(){let e=new Date(this.now);return e.setHours(0,0,0,0),e}warn(e){this.options.warn&&this.options.warn(e())}compileTasks(){let e=!0;for(let t of this.tasks)this.compileTask(t),e&&=t.processed;return e}compileTask(e){let t=e.raw.start;if(t===void 0){let t=e.prevTaskId===void 0?void 0:this.byId.get(e.prevTaskId);e.startTime=t?t.endTime:this.today()}else{let n=this.getStartDate(t);n&&(e.startTime=n)}e.startTime&&(e.endTime=this.getEndDate(e.startTime,e.raw.end),e.endTime&&(e.processed=!0,e.manualEndTime=this.parse(e.raw.end,`YYYY-MM-DD`)!==void 0,this.checkTaskDates(e)))}references(e,t){let n=[],r;for(let e of t.split(` `)){if(e===``)continue;let t=this.byId.get(e);t?n.push(t):(r??=[]).push(e)}if(r){let t=r;this.warn(()=>`Gantt: "${e}" refers to task ids that do not exist: ${t.join(`, `)}.`)}return n}getStartDate(e){let t=e.trim(),n=this.dateFormat.trim();if((n===`x`||n===`X`)&&B.test(t))return this.checked(new Date(Number(t)),t);let r=ve.exec(t);if(r!==null){let e=this.references(`after`,r[1]),t;for(let n of e)(!t||n.endTime>t.endTime)&&(t=n);return t?t.endTime:this.today()}let i=this.parse(t,n);if(i)return i;let a=new Date(t);if(!_(a)||a.getFullYear()<-1e4||a.getFullYear()>1e4)throw new f(`Invalid date:`+t,`semantic`,{type:`gantt`});return a}checked(e,t){if(!_(e))throw new f(`Invalid date:`+t,`semantic`,{type:`gantt`});return e}getEndDate(e,t){let n=t.trim(),r=R.exec(n);if(r!==null){let e=this.references(`until`,r[1]),t;for(let n of e)(!t||n.startTime<t.startTime)&&(t=n);return t?t.startTime:this.today()}let i=this.dateFormat.trim(),a=this.parse(n,i);if(a)return this.inclusiveEndDates?S(a,1):a;let[o,s]=Te(n);if(Number.isNaN(o))return this.warn(()=>`Gantt: "${n}" is neither a date in the "${i}" format nor a duration such as "3d", so the task gets no duration.`),new Date(e);let c=ie(e,o,s);return _(c)?c:new Date(e)}checkTaskDates(e){if(this.excludes.length===0||e.manualEndTime)return;let t=S(e.startTime,1),n=new Date(e.endTime),r=+S(n,1e4),i=!1,a=null;for(;+t<=+n;){if(this.spend(xe),i||(a=+n),i=this.isInvalidDate(t),i&&(n.setDate(n.getDate()+1),+n>r))throw new f("Failed to find a valid date that was not excluded by `excludes` after 10,000 iterations.",`semantic`,{type:`gantt`});t.setDate(t.getDate()+1)}e.endTime=n,e.renderEndTime=a===null?null:new Date(a)}},Oe=`$end.INVALID.open_directive.acc_title.acc_title_value.acc_descr.acc_descr_value.acc_descr_multiline_value.NL.href.callbackname.callbackargs.click.gantt.dateFormat.inclusiveEndDates.topAxis.axisFormat.tickInterval.includes.excludes.todayMarker.weekday_monday.weekday_tuesday.weekday_wednesday.weekday_thursday.weekday_friday.weekday_saturday.weekday_sunday.weekend_friday.weekend_saturday.date.title.accDescription.section.taskTxt.taskData.:.EOF`.split(`.`),ke=/accTitle\s*:\s*/iy,Ae=/accDescr\s*:\s*/iy,je=/accDescr\s*\{\s*/iy,Me=/href\s+"/iy,Ne=/call\s+/iy,Pe=/click\s+/iy,H=/\(\s*\)/y,Fe=/weekday\s+(monday|tuesday|wednesday|thursday|friday|saturday|sunday)\b/iy,Ie=[`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`,`sunday`],U=/weekend\s+(?:(friday)|saturday)\b/iy,Le=/\d\d\d\d-\d\d-\d\d\b/y,Re=/title[^\S\r\n]*(?=[\r\n]|$)/iy,ze=new Map([[97,[[/axisFormat\s[^#\n;]+/iy,17],[/accDescription\s[^#\n;]+/iy,33]]],[103,[[/gantt\b/iy,13]]],[100,[[/dateFormat\s[^#\n;]+/iy,14]]],[105,[[/inclusiveEndDates\b/iy,15],[/includes\s[^#\n;]+/iy,19]]],[116,[[/topAxis\b/iy,16],[/tickInterval\s[^#\n;]+/iy,18],[/todayMarker\s[^\n;]+/iy,21],[/title[^\S\r\n][^\n]+/iy,32]]],[101,[[/excludes\s[^#\n;]+/iy,20]]],[115,[[/section\s[^\n]+/iy,34]]]]);function Be(e){let t=e.length,n=[],r=[],i=[],a=0,o=0,s=(t,a,s)=>{n.push(t),r.push(e.slice(a,s)),i.push(a),o=s},c=t=>(t.lastIndex=o,t.test(e)?t.lastIndex:-1),l=(n,r)=>{let i=e.indexOf(n,r);return i===-1?t:i},u=t=>{let n;switch(t|32){case 97:if((n=c(ke))>=0)return a=1,s(3,o,n),!0;if((n=c(Ae))>=0)return a=2,s(5,o,n),!0;if((n=c(je))>=0)return a=3,o=n,!0;break;case 104:if((n=c(Me))>=0)return a=4,o=n,!0;break;case 99:if((n=c(Ne))>=0)return a=5,o=n,!0;if((n=c(Pe))>=0)return a=7,o=n,!0;break;case 116:if((n=c(Re))>=0)return o=n,!0;break;case 119:{Fe.lastIndex=o;let t=Fe.exec(e);if(t)return s(22+Ie.indexOf(t[1].toLowerCase()),o,Fe.lastIndex),!0;if(U.lastIndex=o,t=U.exec(e),t)return s(t[1]===void 0?30:29,o,U.lastIndex),!0;break}}let r=ze.get(t|32);if(r){for(let[e,t]of r)if((n=c(e))>=0)return s(t,o,n),!0}return!1};for(;;){if(o>=t){let e=38;switch(a){case 1:e=4;break;case 2:e=6;break;case 3:e=7;break;case 4:e=9;break;case 5:e=10;break;case 6:e=11;break;case 7:e=12}s(e,t,t);break}let d=e.charCodeAt(o);switch(a){case 0:{let a=e.charCodeAt(o+1);if(d===37){if(a!==37){let t=l(`
3
+ `,o+1);for(;e.charCodeAt(t)===10;)t++;o=t}else{if(e.charCodeAt(o+2)===123)return s(2,o,o+3),s(1,o,o),{types:n,texts:r,starts:i};o=l(`
4
+ `,o+2)}}else if(d===10){let t=o+1;for(;e.charCodeAt(t)===10;)t++;s(8,o,t)}else if(p(d))for(o++;o<t&&p(e.charCodeAt(o));)o++;else{if(u(d))break;if(d>=48&&d<=57&&c(Le)>=0)s(31,o,o+10);else if(d!==58){let n=o+1;for(;n<t;){let t=e.charCodeAt(n);if(t===58||t===10)break;n++}s(35,o,n)}else{let n=o+1;for(;n<t;){let t=e.charCodeAt(n);if(t===35||t===10||t===59)break;n++}s(n>o+1?36:37,o,n)}}break}case 1:case 2:{let e=a===1?4:6;a=0,s(e,o,l(`
5
+ `,o));break}case 3:d===125?(a=0,o++):s(7,o,l(`}`,o));break;case 4:d===34?(a=0,o++):s(9,o,l(`"`,o));break;case 5:if(d===40){let e=c(H);e>=0?(a=0,o=e):(a=6,o++)}else s(10,o,l(`(`,o));break;case 6:d===41?(a=0,o++):s(11,o,l(`)`,o));break;case 7:if(p(d))a=0,o++;else{let n=o+1;for(;n<t&&!p(e.charCodeAt(n));)n++;s(12,o,n)}}}return n.push(0),r.push(``),i.push(t),{types:n,texts:r,starts:i}}var Ve=[`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`,`sunday`],He=`'EOF', 'SPACE', 'NL', 'weekday_monday', 'weekday_tuesday', 'weekday_wednesday', 'weekday_thursday', 'weekday_friday', 'weekday_saturday', 'weekday_sunday', 'weekend_friday', 'weekend_saturday', 'dateFormat', 'inclusiveEndDates', 'topAxis', 'axisFormat', 'tickInterval', 'excludes', 'includes', 'todayMarker', 'title', 'acc_title', 'acc_descr', 'acc_descr_multiline_value', 'section', 'taskTxt', 'click'`,W=new Uint8Array(39);for(let e=22;e<=30;e++)W[e]=1;for(let e of[38,8,14,15,16,17,18,20,19,21,32,3,5,7,34,35,12])W[e]=1;function Ue(e,t){let{types:n,texts:r,starts:i}=Be(e),a=0,o=t=>{let r=n[a];throw m(`gantt`,e,i[a],`Expecting ${t}, got '${r===0?`1`:Oe[r]}'`)},s=(e=``)=>{W[n[a]]!==1&&o(He+e)};for(n[a]!==13&&o(`'gantt'`),a++;;){let e=n[a],i=r[a];switch(W[e]!==1&&o(He),a++,e){case 38:if(n[a]===0)return;s();break;case 8:break;case 14:s(),t.setDateFormat(i.slice(11));break;case 15:s(),t.enableInclusiveEndDates();break;case 16:s(),t.TopAxis();break;case 17:s(),t.setAxisFormat(i.slice(11));break;case 18:s(),t.setTickInterval(i.slice(13));break;case 20:s(),t.setExcludes(i.slice(9));break;case 19:s(),t.setIncludes(i.slice(9));break;case 21:s(),t.setTodayMarker(i.slice(12));break;case 29:s(),t.setWeekend(`friday`);break;case 30:s(),t.setWeekend(`saturday`);break;case 32:s(),t.setDiagramTitle(i.slice(6));break;case 3:{n[a]!==4&&o(`'acc_title_value'`);let e=r[a++];s(),t.setAccTitle(e.trim());break}case 5:{n[a]!==6&&o(`'acc_descr_value'`);let e=r[a++];s(),t.setAccDescription(e.trim());break}case 7:s(),t.setAccDescription(i.trim());break;case 34:s(),t.addSection(i.slice(8));break;case 35:{n[a]!==36&&o(`'taskData'`);let e=r[a++];s(),t.addTask(i,e);break}case 12:{let e,c=null,l;n[a]===10?(e=r[a++],n[a]===11&&(c=r[a++]),n[a]===9?(l=r[a++],s()):s(c===null?`, 'callbackargs', 'href'`:`, 'href'`)):n[a]===9?(l=r[a++],n[a]===10?(e=r[a++],n[a]===11?(c=r[a++],s()):s(`, 'callbackargs'`)):s(`, 'callbackname'`)):o(`'callbackname', 'href'`),e!==void 0&&t.setClickEvent(i,e,c),l!==void 0&&t.setLink(i,l);break}default:s(),t.setWeekday(Ve[e-22])}}}var G=1e3,K=60*G,q=60*K,J=24*q,We=7*J,Ge=30*J,Ke=365*J;function qe(e){e.setHours(0,0,0,0)}function Je(e){return{floor(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),qe(t)},offset:(e,t)=>e.setDate(e.getDate()+t*7),cycle:1/0,ms:We}}var Ye={millisecond:{floor:()=>{},offset:(e,t)=>e.setTime(+e+t),cycle:1/0,ms:1},second:{floor:e=>e.setTime(+e-e.getMilliseconds()),offset:(e,t)=>e.setTime(+e+t*G),field:e=>e.getUTCSeconds(),cycle:60,ms:G},minute:{floor:e=>e.setTime(+e-e.getMilliseconds()-e.getSeconds()*G),offset:(e,t)=>e.setTime(+e+t*K),field:e=>e.getMinutes(),cycle:60,ms:K},hour:{floor:e=>e.setTime(+e-e.getMilliseconds()-e.getSeconds()*G-e.getMinutes()*K),offset:(e,t)=>e.setTime(+e+t*q),field:e=>e.getHours(),cycle:24,ms:q},day:{floor:qe,offset:(e,t)=>e.setDate(e.getDate()+t),field:e=>e.getDate()-1,cycle:31,ms:J},month:{floor(e){e.setDate(1),qe(e)},offset:(e,t)=>e.setMonth(e.getMonth()+t),field:e=>e.getMonth(),cycle:12,ms:Ge},year:{floor(e){e.setMonth(0,1),qe(e)},offset:(e,t)=>e.setFullYear(e.getFullYear()+t),cycle:1/0,ms:Ke}};function Xe(e,t,n){return Math.floor((+t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*K)/n)}function Ze(e,t){return(e%t+t)%t}function Qe(e,t,n){let r=e===`week`?Je(n):Ye[e];if(t<=1)return r;if(e===`millisecond`)return{...r,floor:e=>e.setTime(Math.floor(+e/t)*t),offset:(e,n)=>e.setTime(+e+n*t)};if(e===`year`)return{...r,floor(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),r.floor(e)},offset:(e,n)=>e.setFullYear(e.getFullYear()+n*t)};if(e===`week`){let e=new Date(0);return r.floor(e),{...r,floor(n){r.floor(n),r.offset(n,-Ze(Xe(e,n,We),t))},offset:(e,n)=>r.offset(e,n*t)}}let i=r.field,a=e=>i(e)%t===0;return{...r,floor(e){for(r.floor(e);Number.isFinite(+e)&&!a(e);r.floor(e))e.setTime(e-1)},offset(e,t){for(let n=0;n<t&&Number.isFinite(+e);n++)do r.offset(e,1);while(Number.isFinite(+e)&&!a(e))}}}function $e(e,t,n,r){let i=new Date(t-1);e.floor(i),e.offset(i,1),e.floor(i);let a=[],o=-1/0;for(;+i<=n&&+i>o;){if(a.length>=r)return;o=+i,a.push(o),e.offset(i,1),e.floor(i)}return a}function et(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i;return 10**i*(a>=Math.sqrt(50)?10:a>=Math.sqrt(10)?5:a>=Math.SQRT2?2:1)}var Y=[[`second`,1,G],[`second`,5,5*G],[`second`,15,15*G],[`second`,30,30*G],[`minute`,1,K],[`minute`,5,5*K],[`minute`,15,15*K],[`minute`,30,30*K],[`hour`,1,q],[`hour`,3,3*q],[`hour`,6,6*q],[`hour`,12,12*q],[`day`,1,J],[`day`,2,2*J],[`week`,1,We],[`month`,1,Ge],[`month`,3,3*Ge],[`year`,1,Ke]];function tt(e,t,n){let r=(t-e)/n,i=0;for(;i<Y.length&&Y[i][2]<=r;)i++;let a;if(i===Y.length)a=Qe(`year`,Math.max(1,et(e/Ke,t/Ke,n)),0);else if(i===0)a=Qe(`millisecond`,Math.max(et(e,t,n),1),0);else{let[e,t]=Y[r/Y[i-1][2]<Y[i][2]/r?i-1:i];a=Qe(e,t,0)}return $e(a,e,t,4*n+8)??[]}var nt=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/,rt=[`sunday`,`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`];function it(e,t,n,r,i){let a=nt.exec(e);if(!a)return;let o=parseInt(a[1],10),s=a[2],c=Qe(s,o,Math.max(0,rt.indexOf(t)));if(!((r-n)/(Math.min(o,c.cycle)*c.ms)>i))return $e(c,n,r,i)}function X(e,t,n){let r=e<0?`-`:``,i=String(r?-e:e);return r+(i.length<n?t.repeat(n-i.length)+i:i)}function Z(e,t){let n=new Date(+e);return t.floor(n),n}function at(e,t){let n=Je(t),r=Z(e,Ye.year);return Xe(Z(new Date(r-1),n),Z(e,n),We)}function ot(e){let t=Je(4),n=e.getDay(),r=Z(n>=4||n===0?e:new Date(e-1),t);return n>=4||n===0||(t.offset(r,1),t.floor(r)),r}var st=new Map([[`-`,``],[`_`,` `],[`0`,`0`]]);function ct(e,t){let n=``,r=0,i=e.length;for(let a=0;a<i;a++){if(e.charCodeAt(a)!==37)continue;n+=e.slice(r,a);let i=e.charAt(++a),o=st.get(i);o===void 0?o=i===`e`?` `:`0`:i=e.charAt(++a),n+=lt(i,t,o),r=a+1}return n+e.slice(r)}function lt(e,t,n){switch(e){case`a`:return g[t.getDay()].slice(0,3);case`A`:return g[t.getDay()];case`b`:return h[t.getMonth()].slice(0,3);case`B`:return h[t.getMonth()];case`c`:return ct(`%x, %X`,t);case`d`:case`e`:return X(t.getDate(),n,2);case`f`:return X(t.getMilliseconds(),n,3)+`000`;case`g`:return X(ot(t).getFullYear()%100,n,2);case`G`:return X(ot(t).getFullYear()%1e4,n,4);case`H`:return X(t.getHours(),n,2);case`I`:return X(t.getHours()%12||12,n,2);case`j`:return X(1+Xe(Z(t,Ye.year),Z(t,Ye.day),J),n,3);case`L`:return X(t.getMilliseconds(),n,3);case`m`:return X(t.getMonth()+1,n,2);case`M`:return X(t.getMinutes(),n,2);case`p`:return t.getHours()>=12?`PM`:`AM`;case`q`:return String(1+Math.floor(t.getMonth()/3));case`Q`:return String(+t);case`s`:return String(Math.floor(t/1e3));case`S`:return X(t.getSeconds(),n,2);case`u`:return String(t.getDay()||7);case`U`:return X(at(t,0),n,2);case`V`:{let e=ot(t),r=Z(e,Ye.year);return X(Xe(Z(r,Je(4)),e,We)+ +(r.getDay()===4),n,2)}case`w`:return String(t.getDay());case`W`:return X(at(t,1),n,2);case`x`:return ct(`%-m/%-d/%Y`,t);case`X`:return ct(`%-I:%M:%S %p`,t);case`y`:return X(t.getFullYear()%100,n,2);case`Y`:return X(t.getFullYear()%1e4,n,4);case`Z`:{let e=t.getTimezoneOffset(),n=Math.abs(e);return(e>0?`-`:`+`)+X(Math.floor(n/60),`0`,2)+X(n%60,`0`,2)}case`%`:return`%`;default:return e}}var ut=800,dt=240,Q=8,ft=/<br\s*\/?>/gi;function $(e,t,n,r){let i=e.gantt?.[t];return typeof i==`number`&&Number.isFinite(i)?Math.min(r,Math.max(n,i)):void 0}function pt(e,t){let n=e.gantt?.[t];return typeof n==`string`?n:void 0}function mt(e,t){return e.gantt?.[t]===!0}function ht(e,t,n){let r=s(e.replace(ft,` `),!1,t,n,4e3);return r.lines.length<=1?r:{...r,lines:[r.lines[0]],widths:[r.widths[0]],width:r.widths[0],height:r.lineHeight}}function gt(e){return Number.isFinite(+e.startTime)&&Number.isFinite(+e.endTime)}function _t(e,t,n){let r=e.filter(gt).sort((e,t)=>+e.startTime-t.startTime||e.order-t.order),i=[];for(let e of r){let r=+e.startTime,a=0;for(;a<i.length&&r<i[a];)a++;i[a]=+e.endTime,n.set(e,t+a)}let a=i.length;for(let r of e)n.has(r)||n.set(r,t+a++);return Math.max(a,1)}function vt(u,f,p){let m=p.fontSize??16,h=p.measurer??ee(p.fontFamily,p.fontFamilyMono),g=p.padding??8,_=we(p.now),v=$(f,`fontSize`,4,72)??Math.round(m*.8125),te=$(f,`sectionFontSize`,4,72)??v,y=Math.round(m*.75),b=$(f,`barHeight`,4,400)??Math.round(v*1.85),x=b+($(f,`barGap`,0,400)??Math.round(b/4)),ne=Math.round($(f,`numberSectionStyles`,1,1e3)??4),re=u.displayMode===`compact`,ae=u.topAxis||mt(f,`topAxis`),oe=u.getTasks(_),se=oe.filter(e=>!e.vert),ce=oe.filter(e=>e.vert&&gt(e)),C=new Map;for(let e of se)C.has(e.section)||C.set(e.section,C.size);let le=new Map,w=[];if(re){let e=new Map;for(let t of se){let n=e.get(t.section);n?n.push(t):e.set(t.section,[t])}for(let[t,n]of e){let e=_t(n,w.length,le);for(let n=0;n<e;n++)w.push(t)}}else for(let e of se)le.set(e,w.length),w.push(e.section);let ue=w.length,T=1/0,E=-1/0;for(let e of oe)gt(e)&&(T=Math.min(T,+e.startTime),E=Math.max(E,+e.endTime));let D=T<=E,O=s(u.title,!1,h,m,4e3,1),de=O.height>0?O.height+16:0;if(!D){let t=Math.ceil(Math.max(O.width,1)+2*g),n=Math.ceil(Math.max(O.height,1)+2*g),r=i(O,t/2,g+O.height/2,` class="pele-title" font-weight="var(--_tw)"`);return{svg:e(`gantt`,t,n,m,p,u,r),width:t,height:n,links:[]}}let k=new Map,A=0;for(let e of C.keys()){let t=s(e,!1,h,te,180);k.set(e,t),A=Math.max(A,t.width)}let fe=u.axisFormat||(u.dateFormat===`D`?`%d`:pt(f,`axisFormat`)??`%Y-%m-%d`),j=e=>ct(fe,new Date(e)),M=Math.max(h.width(j(T),y,0),h.width(j(E),y,0)),N=g+($(f,`leftPadding`,0,2e3)??Math.max(A>0?A+24:0,M/2)),pe=$(f,`rightPadding`,0,2e3)??Math.max(16,M/2),me=l(p,$(f,`useWidth`,100,2e4)??ut,280),P=Math.max(dt,me-N-pe-g),F=N+P,he=E>T?P/(E-T):0,I=e=>he===0?N+P/2:N+(e-T)*he,L=Math.round(y*1.75),ge=$(f,`topPadding`,0,2e3),_e=$(f,`gridLineStartPadding`,0,2e3),ve=g+de+(ae?L:0),R=Math.max(ve,ge??0),z=ge!==void 0&&_e!==void 0?Math.max(0,Math.min(ge-_e,R-ve)):0,ye=Math.max(ue,1)*x,B=R+ye,be=[],V=F+pe;for(let e of se){let t=ht(e.task,h,v),n=le.get(e);if(!gt(e)){let r=N+Q+t.width/2;V=Math.max(V,r+t.width/2),be.push({task:e,label:t,row:n,x0:NaN,x1:NaN,labelX:r,inside:!1});continue}let r=I(+e.startTime),i=Math.max(I(+(e.renderEndTime??e.endTime)),r+(e.milestone?0:2));if(e.milestone){let t=r+(I(+e.endTime)-r)/2;r=t-b/2,i=t+b/2}let a=!e.milestone&&t.width+2*Q<=i-r,o=(r+i)/2;if(!a){let e=i+Q+t.width<=F+pe,n=r-Q-t.width>=N;o=e||!n?i+Q+t.width/2:r-Q-t.width/2,V=Math.max(V,o+t.width/2)}be.push({task:e,label:t,row:n,x0:r,x1:i,labelX:o,inside:a})}let xe=u.tickInterval||pt(f,`tickInterval`)||``,Se=u.weekday??pt(f,`weekday`)??`sunday`,Ce=Math.max(2,Math.min(10,Math.floor(P/(M+24)))),Te=it(xe,Se,T,E,Math.ceil(P/3))??tt(T,E,Ce),Ee=``,De=``,Oe=``,ke=-1/0,Ae=``,je=B+L/2+2,Me=R-z-L/2-2;for(let e of Te){let n=I(e);Ee+=`M${c(n)},${c(R-z)}V${c(B)}`;let r=j(e),i=h.width(r,y,0);if(n-i/2<ke+8||r===Ae)continue;ke=n+i/2,Ae=r,V=Math.max(V,ke);let a=`text-anchor="middle">${t(r)}</text>`;De+=`<text x="${c(n)}" y="${c(je+y*.35)}" ${a}`,ae&&(Oe+=`<text x="${c(n)}" y="${c(Me+y*.35)}" ${a}`)}let Ne=``,Pe=``,H=[],Fe=B+L+4,Ie=Math.round(v*1.5);for(let e of[...ce].sort((e,t)=>+e.startTime-t.startTime)){let t=I(+e.startTime),n=ht(e.task,h,v),a=Math.max(g+n.width/2,t),o=0;for(;o<H.length&&a-n.width/2<H[o]+8;)o++;H[o]=a+n.width/2,V=Math.max(V,H[o]),Ne+=`<path class="pele-vert" data-id="${r(e.id)}" d="M${c(t)},${c(R-z)}V${c(B)}"/>`,Pe+=i(n,a,Fe+o*Ie+Ie/2,` class="pele-vert-label" data-id="${r(e.id)}"`)}let U=Math.ceil(Math.max(V,g+O.width)+g),Le=Math.ceil(B+L+(H.length>0?4+H.length*Ie:0)+g),Re=``,ze=``;for(let e=0;e<ue;){let t=w[e],n=e+1;for(;n<ue&&w[n]===t;)n++;let a=C.get(t)%ne,o=R+e*x,s=(n-e)*x;(C.size>1||t!==``)&&(Re+=`<rect class="pele-section pele-section-${a}" x="0" y="${c(o)}" width="${U}" height="${c(s)}" fill="${a%2==0?`var(--_s)`:`none`}"/>`);let l=k.get(t);ze+=i(l,g+8+l.width/2,o+s/2,` class="pele-section-label" data-id="${r(t)}"`,p.icons),e=n}let Be=``;if((u.excludes.length>0||u.includes.length>0)&&+ie(new Date(T),6,`y`)>E){let e,t,n=()=>{if(!e||!t)return;let n=new Date(e);n.setHours(0,0,0,0);let r=new Date(t);r.setHours(23,59,59,999);let i=Math.max(N,I(+n)),a=Math.min(F,I(+r));a>i&&(Be+=`<rect x="${c(i)}" y="${c(R)}" width="${c(a-i)}" height="${c(ye)}"/>`),e=t=void 0};for(let r=new Date(T);+r<=E;r=S(r,1))u.isInvalidDate(r)?(e??=r,t=r):n();n()}let Ve=[],He=``;for(let e of be){let t=e.task,o=R+e.row*x+x/2,s=t.active?`active`:t.done?`done`:``,l=`pele-task`;s&&(l+=` pele-`+s),t.crit&&(l+=` pele-crit`),t.milestone&&(l+=` pele-milestone`),t.classes.includes(`clickable`)&&(l+=` pele-clickable`);let f=``,m=``;if(Number.isNaN(e.x0))l+=` pele-unscheduled`,m=` fill="var(--_m)"`;else{let r=t.crit?n:`var(--_c)`,i=s===`done`?`fill="var(--_a)"`:s===`active`?`fill="${r}" fill-opacity="0.25"`:`fill="${r}"`,l=`stroke="${s===`done`&&!t.crit?`var(--_b)`:r}"`;if(t.milestone){let t=(e.x0+e.x1)/2,n=b/2;f=`<path d="M${c(t)},${c(o-n)}L${c(t+n)},${c(o)}L${c(t)},${c(o+n)}L${c(t-n)},${c(o)}Z" ${i} ${l} stroke-linejoin="round"/>`}else f=`<rect x="${c(e.x0)}" y="${c(o-b/2)}" width="${c(e.x1-e.x0)}" height="${c(b)}" ${i} ${l}${a}/>`;e.inside?m=s===``?` fill="var(--_bg)"`:``:s===`done`&&(m=` fill="var(--_m)"`)}let ee=f+i(e.label,e.labelX,o,` class="pele-label"${m}`),h=u.links.get(t.id);h!==void 0&&(ee=d(ee,h,t.id,Ve,p)),He+=`<g class="${l}" data-id="${r(t.id)}">${ee}</g>`}let W=``;if(u.todayMarker!==`off`&&_>=T&&_<=E&&E>T){let e=I(_),t=R-z,n=u.todayMarker?o(u.todayMarker.split(`,`)).line:``;W=`<g class="pele-today"><path d="M${c(e)},${c(t)}V${c(B)}" fill="none" stroke="var(--_c)" stroke-width="2"${n}/>`+(n?``:`<path d="M${c(e-4)},${c(t-5)}H${c(e+4)}L${c(e)},${c(t+1)}Z" fill="var(--_c)"/>`)+`</g>`}let Ue=`M${c(N)},${c(B)}H${c(F)}`+(ae?`M${c(N)},${c(R-z)}H${c(F)}`:``),G=i(O,U/2,g+O.height/2,` class="pele-title" font-weight="var(--_tw)"`)+(Re?`<g class="pele-sections">${Re}</g>`:``)+(Be?`<g class="pele-excluded" fill="var(--_a)">${Be}</g>`:``)+`<g class="pele-grid" fill="none"><path d="${Ee}" stroke="var(--_b)" stroke-dasharray="1 3"/><path d="${Ue}" stroke="var(--_b)"/></g>`+(Ne?`<g class="pele-verts" fill="none" stroke="var(--_l)" stroke-width="1.5" stroke-dasharray="4 3">${Ne}</g>`:``)+W+`<g class="pele-tasks" font-size="${c(v)}">${He}</g><g class="pele-section-labels" font-size="${c(te)}">${ze}</g><g class="pele-axis" font-size="${y}" fill="var(--_m)">${De}${Oe}</g>`+(Pe?`<g class="pele-vert-labels" font-size="${c(v)}">${Pe}</g>`:``);return{svg:e(`gantt`,U,Le,m,p,u,G),width:U,height:Le,links:Ve}}var yt={type:`gantt`,parse(e,t,n){let r=new De;n&&(r.title=n);let i=t.gantt?.displayMode;return typeof i==`string`&&(r.displayMode=i),Ue(e,r),r},render:vt};export{yt as gantt};
@@ -0,0 +1 @@
1
+ import{c as e,f as t,n,o as r,r as i,t as a}from"./CUVCMPQX-JTGMOfG2.js";function o(e){return e===`BT`||e===`LR`||e===`RL`?e:`TB`}var s=4e4,c=400,l=500,u=1.5,d=4;function f(e,t,n,r){let i=[];for(let t of e)i.push(t.x,t.y,t.w,t.h);let a=[];for(let e of t)a.push(e.labelX,e.labelY);let o=[];for(let e of n){o.push(e.x,e.y);for(let t of e.ports)o.push(t.px,t.py)}return{nodes:i,routes:t.map(e=>e.route),labels:a,levels:o,total:r}}function p(e,t,n,r){t.forEach((t,n)=>{t.x=e.nodes[4*n],t.y=e.nodes[4*n+1],t.w=e.nodes[4*n+2],t.h=e.nodes[4*n+3]}),n.forEach((t,n)=>{t.route=e.routes[n],t.labelX=e.labels[2*n],t.labelY=e.labels[2*n+1]});let i=0;for(let t of r){t.x=e.levels[i++],t.y=e.levels[i++];for(let n of t.ports)n.px=e.levels[i++],n.py=e.levels[i++]}return e.total}var m=24,h=.5,g=3,_=2,v=Math.max(3,g,_+1),y=.62,b=128;function x(e){return e.tracks?1:e.straight?2:0}function S(e,t,n=0){let r=0;for(let e of t)e.src!==e.dst&&e.route.length>3&&(r+=(e.route.length/3-1)*v);let a=new Float64Array(r),o=new Float64Array(r),s=new Float64Array(r),c=new Float64Array(r),l=new Float64Array(r),u=new Float64Array(r),d=new Int32Array(r),f=new Uint8Array(r),p=0,x=1/0,S=-1/0,C=NaN,w=NaN,T=NaN,E=NaN,D=(e,t,n,r,i,m)=>{let h=p-1;n===T&&r===E&&(m===r&&w===r||i===n&&C===n)&&d[h]===e&&f[h]===t&&(n-C)*(i-n)+(r-w)*(m-r)>0&&(p--,n=C,r=w),C=n,w=r,T=i,E=m,f[p]=t,a[p]=Math.min(n,i),s[p]=Math.max(n,i),o[p]=n<=i?r:m,c[p]=n<=i?m:r,l[p]=Math.min(r,m),u[p]=Math.max(r,m),l[p]<x&&(x=l[p]),u[p]>S&&(S=u[p]),d[p++]=e};for(let e=0;e<t.length;e++){let r=t[e];if(r.src===r.dst)continue;let a=r.route,o=e=>Math.abs(a[e]-a[e-3])<.01||Math.abs(a[e+1]-a[e-2])<.01,s=e=>Math.abs(a[e]-a[e-3])+Math.abs(a[e+1]-a[e-2]),c=e=>n===0&&e>0&&e<a.length-3&&o(e)&&o(e+3)&&s(e)>=.01&&s(e+3)>=.01&&Math.abs(a[e]-a[e-3])<.01!=Math.abs(a[e+3]-a[e])<.01,l=a[0],u=a[1];for(let t=3;t<a.length;t+=3){let r=+(t===3)|(t===a.length-3?2:0),d=l,f=u,p=a[t],m=a[t+1];if(l=p,u=m,o(t)||n===2){if(!c(t)){D(e,r,d,f,p,m);continue}let n=c(t-3)?s(t)/2:s(t),i=c(t+3)?s(t+3)/2:s(t+3),o=(p-a[t-3])/s(t),h=(m-a[t-2])/s(t),g=(a[t+3]-p)/s(t+3),v=(a[t+4]-m)/s(t+3),b=p-o*n,x=m-h*n;D(e,r,d,f,b,x);let S=p-o*n*(1-y),C=m-h*n*(1-y),w=p+g*i*(1-y),T=m+v*i*(1-y);l=p+g*i,u=m+v*i;let E=r|(t+3===a.length-3?2:0),O=b,k=x;for(let t=1;t<=_;t++){let n=t/_,r=1-n,i=r*r*r*b+3*r*r*n*S+3*r*n*n*w+n*n*n*l,a=r*r*r*x+3*r*r*n*C+3*r*n*n*T+n*n*n*u;D(e,E,O,k,i,a),O=i,k=a}continue}if(n===1){let n=a[t+2]===0,i=n?d:(d+p)/2,o=n?(f+m)/2:f;D(e,r,d,f,i,o),D(e,r,i,o,n?p:i,n?o:m),D(e,r,n?p:i,n?o:m,p,m);continue}let h=a[t+2]===0,v=h?i(p-d,m-f):i(m-f,p-d),b=d,x=f;for(let t=1;t<=g;t++){let n=t/g,i=1-n,a=n*n*(3-2*n),o=3*v*n*i*i+3*(1-v)*n*n*i+n*n*n,s=d+(p-d)*(h?a:o),c=f+(m-f)*(h?o:a);D(e,r,b,x,s,c),b=s,x=c}}}let O=S>x?Math.round(Math.sqrt(p)):1,k=S>x?O/(S-x):0,A=e=>Math.min(O-1,Math.floor((e-x)*k)),j=new Int32Array(p),M=new Int32Array(O+1);for(let e=0;e<p;e++){j[e]=A(l[e]);for(let t=j[e],n=A(u[e]);t<=n;t++)M[t+1]++}for(let e=0;e<O;e++)M[e+1]+=M[e];let N=M.slice(0,O),P=new Int32Array(M[O]);for(let e=0;e<p;e++)for(let t=j[e],n=A(u[e]);t<=n;t++)P[N[t]++]=e;let F=new Float64Array(t.length*8),I=(e,t,n,r)=>Math.abs(e[t]-e[n])<h&&Math.abs(e[t]-e[r])<h||Math.abs(e[t+1]-e[n+1])<h&&Math.abs(e[t+1]-e[r+1])<h;for(let e=0;e<t.length;e++){let n=t[e].route;if(n.length<6)continue;let r=3;for(;r+3<n.length&&I(n,0,r,r+3);)r+=3;let i=n.length-3,a=i-3;for(;a>=3&&I(n,i,a,a-3);)a-=3;F.set([n[0],n[1],n[r],n[r+1],n[a],n[a+1],n[i],n[i+1]],e*8)}let L=(e,t,n,r)=>{let i=e*8+(t===1?0:4),a=F[i],o=F[i+1],s=F[i+2]-a,c=F[i+3]-o,l=s*s+c*c,u=l>0?Math.max(0,Math.min(1,((n-a)*s+(r-o)*c)/l)):0;return Math.hypot(n-a-u*s,r-o-u*c)<h},R=0;for(let n=0;n<O;n++){let r=M[n+1];if(r-M[n]>b)P.subarray(M[n],r).sort((e,t)=>a[e]-a[t]||e-t);else for(let e=M[n]+1;e<r;e++){let t=P[e],r=e;for(;r>M[n]&&a[P[r-1]]>a[t];r--)P[r]=P[r-1];P[r]=t}for(let i=M[n];i<r;i++){let p=P[i],h=s[p]-a[p],g=c[p]-o[p],_=j[p]===n;for(let v=i+1;v<r;v++){let r=P[v];if(a[r]>s[p])break;if(u[r]<l[p]||l[r]>u[p]||d[p]===d[r]||!_&&j[r]!==n)continue;let i=h*(o[r]-o[p])-g*(a[r]-a[p]),y=h*(c[r]-o[p])-g*(s[r]-a[p]);if(i>0==y>0)continue;let b=s[r]-a[r],x=c[r]-o[r],S=b*(o[p]-o[r])-x*(a[p]-a[r]),C=b*(c[p]-o[r])-x*(s[p]-a[r]);if(S>0==C>0)continue;let w=t[d[p]],T=t[d[r]],E=S/(S-C),D=a[p]+E*h,O=o[p]+E*g,k=(t,n,i)=>(f[p]&n)!==0&&(f[r]&i)!==0||Math.abs(D-e[t].x)<e[t].w/2+m&&Math.abs(O-e[t].y)<e[t].h/2+m||L(d[p],n,D,O)&&L(d[r],i,D,O);w.src===T.src&&k(w.src,1,1)||w.src===T.dst&&k(w.src,1,2)||w.dst===T.src&&k(w.dst,2,1)||w.dst===T.dst&&k(w.dst,2,2)||R++}}}return R}function C(e,t,n,r){for(let t of e)t.x+=n,t.y+=r;for(let e of t){for(let t=0;t<e.route.length;t+=3)e.route[t]+=n,e.route[t+1]+=r;e.labelX+=n,e.labelY+=r}}function w(e,t,n=-1){return{w:e,h:t,parent:n,isGroup:!1,dir:void 0,padX:0,padTop:0,padBottom:0,minW:0,seq:0,span:0,x:0,y:0}}function T(e){return e===`TB`?0:e===`BT`?2:e===`LR`?3:1}function E(e){return e+2&3}function D(i,o,m,g){let _=i.length,v=new Map,y=[],b=(e,t)=>{let n={id:e,dir:t,items:[],edges:[],ports:[],portOf:new Map,routes:new Map,x:0,y:0};return v.set(e,n),n},C=b(-1,m),w=[];for(let e=0;e<_;e++)w.push([]);let D=[];for(let e=0;e<_;e++){let t=i[e].parent;t>=0&&t<_&&t!==e&&i[t].isGroup?w[t].push(e):(i[e].parent=-1,D.push(e))}C.items=D,y.push(C);let O=new Int32Array(_),k=new Uint8Array(_),A=e=>{for(let t=e;t<y.length;t++){let e=y[t];for(let t of e.items)if(k[t]=1,O[t]=e.id<0?0:O[e.id]+1,i[t].isGroup){let n=b(t,i[t].dir??e.dir);n.items=w[t],y.push(n)}}};A(0);for(let e=0;e<_;e++){if(k[e])continue;let t=i[e].parent;if(w[t]=w[t].filter(t=>t!==e),i[e].parent=-1,C.items.push(e),k[e]=1,O[e]=0,i[e].isGroup){let t=y.length,n=b(e,i[e].dir??m);n.items=w[e],y.push(n),A(t)}}for(let e=y.length-1;e>0;e--){let t=y[e],n=1/0;for(let e of t.items)i[e].seq<n&&(n=i[e].seq);n!==1/0&&(i[t.id].seq=n)}for(let e of y)e.items.sort((e,t)=>i[e].seq-i[t].seq||e-t);let j=0;for(let e of o){let t=e.src,n=e.dst,r=0;for(;O[t]>O[n];r++)t=i[t].parent;for(;O[n]>O[t];r++)n=i[n].parent;for(;t!==n&&i[t].parent!==i[n].parent;r+=2)t=i[t].parent,n=i[n].parent;t!==n&&(j+r>s?(e.src=t,e.dst=n):j+=r)}let M=[],N=[];for(let e=0;e<o.length;e++){let t=o[e];if(t.route=[],t.src===t.dst){M.push(e);continue}let n=t.src,r=t.dst,a=[],s=[];for(;O[n]>O[r];)a.push(n),n=i[n].parent;for(;O[r]>O[n];)s.push(r),r=i[r].parent;if(n===r)N.push(e);else{for(;i[n].parent!==i[r].parent;)a.push(n),s.push(r),n=i[n].parent,r=i[r].parent;v.get(i[n].parent).edges.push({e,a:n,b:r});for(let[t,n]of[[a,!0],[s,!1]])for(let r of t){let t=v.get(i[r].parent),a={e,inner:r,out:n,side:0,hint:NaN,px:0,py:0,route:[]};t.ports.push(a),t.portOf.set(e*2+ +!n,a)}}}let P=new Int32Array(_),F=(e,t,n)=>(n?t.src:t.dst)!==e,I=(e,t)=>{let n=e.dir===`TB`||e.dir===`BT`,s=T(e.dir),c=[],l=[];e.items.forEach((e,a)=>{P[e]=a;let o=i[e],s=t?r(n?o.w:o.h,n?o.h:o.w):r(0,0);s.span=o.isGroup?Math.min(o.span,s.w-2*o.padX):o.span,s.key=z?R[e]:NaN,c.push(s)});let u=(e,t,n)=>i[e].isGroup&&F(e,o[t],n),d=(e,r,a)=>{if(!t||!i[e].isGroup||!F(e,o[r],a))return 0;let s=v.get(e).portOf.get(r*2+ +!a);return n?s.px-i[e].w/2:s.py-i[e].h/2};for(let r of e.edges){let e=o[r.e],i=a(P[r.a],P[r.b],e.minlen);t&&(i.labelW=n?e.labelW:e.labelH,i.labelH=n?e.labelH:e.labelW,i.tailDx=d(r.a,r.e,!0),i.headDx=d(r.b,r.e,!1),i.tailFixed=u(r.a,r.e,!0),i.headFixed=u(r.b,r.e,!1)),l.push(i)}let f=new Int32Array(e.ports.length).fill(-1);return e.ports.forEach((t,n)=>{if(t.side===s||t.side===E(s)){let i=c.length,p=r(0,0,t.side===s?3:4);p.key=z?R[t.out?o[t.e].dst:o[t.e].src]:NaN,p.hint=Number.isNaN(t.hint)&&z&&V?V(e,t):t.hint,c.push(p),f[n]=i;let m=t.out?a(P[t.inner],i):a(i,P[t.inner]);t.out?(m.tailDx=d(t.inner,t.e,!0),m.tailFixed=u(t.inner,t.e,!0)):(m.headDx=d(t.inner,t.e,!1),m.headFixed=u(t.inner,t.e,!1)),l.push(m)}else c[P[t.inner]].pin=t.side===0||t.side===3?-1:1}),{lnodes:c,ledges:l,dummies:f}},L=j>1&&j<=c&&o.length<=l,R=new Float64Array(_).fill(NaN),z=!1,B=0,V,H=y.length>1&&L;for(let e of y)e.dir!==m&&(H=!1);if(H){let t=m===`TB`||m===`BT`,n=new Int32Array(_).fill(-1),s=new Int32Array(_).fill(-1),c=[],l=[],u=[];for(let e=0;e<_;e++)i[e].isGroup&&(s[e]=u.length,u.push(-1));for(let e=0;e<_;e++){let a=i[e].parent;i[e].isGroup?u[s[e]]=a>=0?s[a]:-1:(n[e]=c.length,c.push(r(t?i[e].w:i[e].h,t?i[e].h:i[e].w)),l.push(a>=0?s[a]:-1))}let d=[],f=new Int32Array(o.length).fill(-1);o.forEach((e,r)=>{e.src===e.dst||n[e.src]<0||n[e.dst]<0||(f[r]=d.length,d.push(a(n[e.src],n[e.dst],e.minlen,t?e.labelW:e.labelH,t?e.labelH:e.labelW)))});let p=e(c,d,{...g,groups:{of:Int32Array.from(l),parent:Int32Array.from(u)},orderOnly:!0});B=Math.min(p.crossings??0,p.declared??0);let h=new Float64Array(_),v=new Int32Array(_),y=new Int32Array(_).fill(-1);for(let e=0;e<_;e++)if(!(n[e]<0)){R[e]=c[n[e]].x;for(let t=i[e].parent;t>=0;t=i[t].parent)h[t]+=R[e],v[t]++,y[t]=Math.max(y[t],c[n[e]].rank)}for(let e=0;e<_;e++)v[e]>0&&(R[e]=h[e]/v[e]);V=(e,t)=>{let n=f[t.e];if(n<0||e.id<0||!t.out||t.side!==E(T(e.dir)))return NaN;let r=d[n].points,i=R[o[t.e].src],a=0;for(let t=0;t<r.length;t+=2)r[t]===y[e.id]&&(i=r[t+1]),r[t]===y[e.id]+1&&(a=r[t+1]);return i+a*1e-6}}let U=new Map,W=(t,n,r)=>{if(!L)return{lnodes:n,ledges:r,size:e(n,r,g)};let i=[];for(let e of n)i.push(e.w,e.h,e.kind,e.pin,e.hint,e.key,e.span);for(let e of r)i.push(e.tail,e.head,e.minlen,e.labelW,e.labelH,e.tailDx,e.headDx,+e.tailFixed,+e.headFixed);let a=U.get(t.id);a||U.set(t.id,a=[]);for(let e of a){let t=e.given.length===i.length;for(let n=0;t&&n<i.length;n++)t=Object.is(e.given[n],i[n]);if(t)return e}let o={given:i,lnodes:n,ledges:r,size:e(n,r,g)};return a.push(o),o},G={width:0,height:0},K=()=>{for(let e of y){for(let t of e.ports)i[t.inner].isGroup&&F(t.inner,o[t.e],t.out)&&(v.get(t.inner).portOf.get(t.e*2+ +!t.out).side=t.side);if(e.edges.length===0)continue;let r=!1;for(let t of e.edges){let e=o[t.e];(i[t.a].isGroup&&e.src!==t.a||i[t.b].isGroup&&e.dst!==t.b)&&(r=!0)}if(!r)continue;let{lnodes:a,ledges:s}=I(e,!1);t(a,s),n(a,s,1);let c=T(e.dir);e.edges.forEach((e,t)=>{let n=o[e.e],r=!s[t].reversed;i[e.a].isGroup&&n.src!==e.a&&(v.get(e.a).portOf.get(e.e*2).side=r?E(c):c),i[e.b].isGroup&&n.dst!==e.b&&(v.get(e.b).portOf.get(e.e*2+1).side=r?c:E(c))})}for(let e=y.length-1;e>=0;e--){let t=y[e],n=t.id>=0?i[t.id]:void 0,r=t.dir===`TB`||t.dir===`BT`,a=t.dir===`BT`||t.dir===`RL`,s=I(t,!0),{lnodes:c,ledges:l,size:u}=W(t,s.lnodes,s.ledges),d=s.dummies,f=r?u.width:u.height,p=r?u.height:u.width,m=n?n.padX:0,h=n?n.padTop:0,g=Math.max(f+2*m,n?n.minW:0),_=p+h+(n?n.padBottom:0),b=(g-f)/2,x=h,S=(e,t)=>b+(r?e:a?u.height-t:t),C=(e,t)=>x+(r?a?u.height-t:t:e),w=+!r,T=e=>{let t=[];for(let n=0;n<e.length;n+=2)t.push(S(e[n],e[n+1]),C(e[n],e[n+1]),w);return t};t.items.forEach((e,t)=>{i[e].x=S(c[t].x,c[t].y),i[e].y=C(c[t].x,c[t].y)}),t.edges.forEach((e,n)=>{let r=l[n];t.routes.set(e.e,T(r.points));let i=o[e.e];i.labelW>0&&(i.labelX=S(r.labelX,r.labelY),i.labelY=C(r.labelX,r.labelY))});let E=t.edges.length;t.ports.forEach((e,t)=>{let n=i[e.inner];if(d[t]>=0){let t=T(l[E++].points),n=e.out?t.length-3:0,r=t[n],i=t[n+1];e.side===0?i=0:e.side===2?i=_:r=e.side===3?0:g,e.out?t.push(r,i,w):t.unshift(r,i,w),e.px=r,e.py=i,e.route=t;return}let r=n.x,a=n.y;if(n.isGroup&&F(e.inner,o[e.e],e.out)){let t=v.get(e.inner).portOf.get(e.e*2+ +!e.out);r+=t.px-n.w/2,a+=t.py-n.h/2}else e.side===0?a-=n.h/2:e.side===2?a+=n.h/2:e.side===3?r-=n.w/2:r+=n.w/2;let s=r,c=a;e.side===0?c=0:e.side===2?c=_:s=e.side===3?0:g;let u=e.side===0||e.side===2?0:1;e.px=s,e.py=c,e.route=e.out?[r,a,u,s,c,u]:[s,c,u,r,a,u]}),n?(n.w=g,n.h=_):G={width:g,height:_}}for(let e of y){let t=e.x,n=e.y;for(let r of e.items){let e=i[r];if(e.x+=t,e.y+=n,e.isGroup){let t=v.get(r);t.x=e.x-e.w/2,t.y=e.y-e.h/2}}}let e=(e,t,n,r)=>{for(let i=0;i<t.length;i+=3){let a=t[i]+n,o=t[i+1]+r,s=e.length;s>=3&&Math.abs(e[s-3]-a)<.01&&Math.abs(e[s-2]-o)<.01||e.push(a,o,t[i+2])}};for(let t of y)for(let n of t.edges){let r=o[n.e],a=[],s=[];for(let e=r.src;i[e].parent!==t.id;e=i[e].parent)s.push(v.get(i[e].parent));for(let t of s)e(a,t.portOf.get(n.e*2).route,t.x,t.y);e(a,t.routes.get(n.e),t.x,t.y);let c=[];for(let e=r.dst;i[e].parent!==t.id;e=i[e].parent)c.push(v.get(i[e].parent));for(let t=c.length-1;t>=0;t--)e(a,c[t].portOf.get(n.e*2+1).route,c[t].x,c[t].y);r.route=a,r.labelW>0&&(r.labelX+=t.x,r.labelY+=t.y)}},q=x(g);z=H,K();let J=-1;if(H&&(J=S(i,o,q),J>B*u+d)){let e=f(i,o,y,G);z=!1,K();let t=S(i,o,q);t>=J?(z=!0,G=p(e,i,o,y)):J=t}if(z===H&&L){let e=!1;for(let t of y){if(t.id<0)continue;let n=i[t.id],r=t.dir===`TB`||t.dir===`BT`,a=E(T(t.dir)),s=[];for(let e of t.ports){if(e.side!==a)continue;let i=o[e.e].route,c=t.x+e.px,l=t.y+e.py,u=-1;for(let t=0;t<i.length&&(u<0||e.out);t+=3)Math.abs(i[t]-c)<.01&&Math.abs(i[t+1]-l)<.01&&(u=t);if(u<0)continue;let d=+!r,f=e.out?u+3:u-3;for(;f>=0&&f<i.length&&Math.abs(i[f+d]-i[u+d])<h;)f+=e.out?3:-3;f<0||f>=i.length||(e.hint=i[f+d]-(r?n.x-n.w/2:n.y-n.h/2),s.push([r?e.px:e.py,e.hint]))}s.sort((e,t)=>e[0]-t[0]);for(let t=1;t<s.length;t++)s[t-1][1]>s[t][1]&&(e=!0)}if(e){let e=J>=0?J:S(i,o,q),t=e>0?f(i,o,y,G):void 0;t&&(K(),S(i,o,q)>=e&&(G=p(t,i,o,y)))}}for(let e of N){let t=o[e],n=i[t.src],r=i[t.dst];t.route=[n.x,n.y,0,r.x,r.y,0],t.labelX=(n.x+r.x)/2,t.labelY=(n.y+r.y)/2}for(let e of M){let t=o[e],n=i[t.src];t.labelX=n.x+n.w/2+28+t.labelW/2,t.labelY=n.y}return G}export{D as i,C as n,o as r,w as t};
@@ -0,0 +1,2 @@
1
+ import{_ as e,f as t,i as n,o as r,u as i,x as a}from"./E3FWOBN4-D5m5o2g0.js";import{n as o}from"./STAXBNH4-D4c13Xlj.js";import{t as s}from"./DKTLEL5E-DciMwFJ1.js";import{a as c,c as l,d as u,f as d,g as f,h as p,i as m,l as h,m as g,n as _,o as v,p as y,r as b,s as x,t as S,u as C}from"./C5HTQT3I-7U13x70S.js";import{PeleError as ee,u as te}from"./lazy-DaMZI1F7.js";var w={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4};function T(e){throw new ee(e,`semantic`,{type:`gitGraph`})}function E(e){return e===`REVERSE`?w.REVERSE:e===`HIGHLIGHT`?w.HIGHLIGHT:w.NORMAL}function D(e,t){e.dir&&t.setDirection(e.dir);for(let n of e.statements)O(n,t)}function O(e,t){switch(e.$type){case`Commit`:t.commit({id:e.id,msg:e.message??``,type:e.type===void 0?w.NORMAL:E(e.type),tags:e.tags??void 0});break;case`Branch`:t.branch({name:e.name,order:e.order??0});break;case`Merge`:t.merge({branch:e.branch,id:e.id??``,type:e.type===void 0?void 0:E(e.type),tags:e.tags??void 0});break;case`Checkout`:t.checkout(e.branch);break;case`CherryPicking`:t.cherryPick({id:e.id,targetId:``,tags:e.tags?.length===0?void 0:e.tags,parent:e.parent})}}function k(e,t,n){let r=t.gitGraph,i=typeof r?.mainBranchName==`string`?r.mainBranchName:`main`,a=typeof r?.mainBranchOrder==`number`?r.mainBranchOrder:0,o=new Map,s=new Map([[i,null]]),c=new Map([[i,a]]),l=[],u=null,d=i,f=`LR`,p=0,m=()=>{for(let e=p+1;;e+=2654435761){let t=`${p}-${(Math.imul(e,2654435761)>>>0).toString(16).padStart(8,`0`).slice(0,7)}`;if(!o.has(t))return t}},h=e=>{u=e,o.set(e.id,e),s.set(d,e.id)},g=e=>{s.has(e)||T(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`),d=e;let t=s.get(e);u=t?o.get(t)??null:null};D(e,{setDirection(e){f=e},commit({msg:e,id:t,type:n,tags:r}){let i={id:t||m(),message:e,seq:p++,type:n??w.NORMAL,tags:r?[...r]:[],parents:u===null?[]:[u.id],branch:d};o.has(i.id)&&l.push(`Commit ID ${i.id} already exists`),h(i)},branch({name:e,order:t}){s.has(e)&&T(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${e}")`),s.set(e,u===null?null:u.id),c.set(e,t),g(e)},merge({branch:e,id:t,type:n,tags:r}){let i=s.get(d),a=s.get(e),c=i?o.get(i):void 0,l=a?o.get(a):void 0;c&&l&&c.branch===e&&T(`Cannot merge branch '${e}' into itself.`),d===e&&T(`Incorrect usage of "merge". Cannot merge a branch to itself`),c===void 0&&T(`Incorrect usage of "merge". Current branch (${d})has no commits`),s.has(e)||T(`Incorrect usage of "merge". Branch to be merged (${e}) does not exist`),l===void 0&&T(`Incorrect usage of "merge". Branch to be merged (${e}) has no commits`),c===l&&T(`Incorrect usage of "merge". Both branches have same head`),t&&o.has(t)&&T(`Incorrect usage of "merge". Commit with id:${t} already exists, use different custom id`),h({id:t||m(),message:`merged branch ${e} into ${d}`,seq:p++,parents:u===null?[]:[u.id,a||``],branch:d,type:w.MERGE,customType:n,customId:!!t,tags:r?[...r]:[]})},cherryPick({id:e,targetId:t,tags:n,parent:r}){let i=e?o.get(e):void 0;if(i===void 0&&T(`Incorrect usage of "cherryPick". Source commit id should exist and provided`),r&&!i.parents.includes(r)&&T(`Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.`),i.type===w.MERGE&&!r&&T(`Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.`),t&&o.has(t))return;i.branch===d&&T(`Incorrect usage of "cherryPick". Source commit is already on current branch`);let a=s.get(d);a&&o.has(a)||T(`Incorrect usage of "cherry-pick". Current branch (${d})has no commits`),h({id:m(),message:`cherry-picked ${i.message} into ${d}`,seq:p++,parents:u===null?[]:[u.id,i.id],branch:d,type:w.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${i.id}${i.type===w.MERGE?`|parent:${r}`:``}`]})},checkout:g});let _=[...c].map(([e,t],n)=>({name:e,order:t??parseFloat(`0.${n}`)})).sort((e,t)=>e.order-t.order).map(e=>e.name);return{type:`gitGraph`,title:e.title||n,accTitle:e.accTitle?e.accTitle.replace(/^\s+/g,``):void 0,accDescr:e.accDescr?e.accDescr.replace(/\n\s+/g,`
2
+ `):void 0,direction:f,commits:o,branches:s,lanes:_,currentBranch:d,head:u,warnings:l}}var A={name:`REFERENCE`,pattern:/\w([-\./\w]*[-\w])?/y},j=[A];function M(e){return{name:e,pattern:e,longer:j}}var N=[M(`cherry-pick`),{name:`gitGraph:`,pattern:`gitGraph:`},M(`HIGHLIGHT`),{...m(`gitGraph`),longer:j},M(`checkout`),M(`REVERSE`),{name:`parent:`,pattern:`parent:`},M(`commit`),M(`NORMAL`),M(`branch`),{name:`order:`,pattern:`order:`},M(`switch`),{name:`type:`,pattern:`type:`},M(`merge`),{name:`msg:`,pattern:`msg:`},{name:`tag:`,pattern:`tag:`},{name:`id:`,pattern:`id:`},M(`LR`),M(`TB`),M(`BT`),{name:`:`,pattern:`:`},{...c,opener:/[\t ]*accDescr\s*{/y},S,y,{name:`INT`,pattern:/0|[1-9][0-9]*(?!\.)/y},g,h,C,b,v,x,A];function P(e){let t=new p(_(e,N,`gitGraph`),N,`gitGraph`),n={$type:`GitGraph`,statements:[]},r=()=>{if(t.kind!==-1)for(t.kind!==26&&t.fail(`a line break or the end of input`);t.kind===26;)t.i++},i=()=>t.kind===31?t.take():t.kind===25?d(t.take()):t.fail(`a branch name`),a=()=>d(t.expect(25)),o=()=>(t.kind!==8&&t.kind!==5&&t.kind!==2&&t.fail(`NORMAL, REVERSE, or HIGHLIGHT`),t.take());for(;t.kind===26;)t.i++;if(!t.accept(1)){t.expect(3);let e=t.kinds[t.i+1];(t.kind===17||t.kind===18||t.kind===19)&&e===20?(n.$type=`Direction`,n.dir=t.take(),t.i++):t.accept(20)}for(;t.kind!==-1;)switch(t.kind){case 26:t.i++;break;case 21:n.accDescr=l(t.take()),r();break;case 22:n.accTitle=f(t.take()),r();break;case 23:n.title=u(t.take()),r();break;case 7:{t.i++;let e={$type:`Commit`,tags:[]};for(;;)if(t.accept(16))e.id=a();else if(t.accept(15))e.tags.push(a());else if(t.accept(12))e.type=o();else if(t.accept(14)||t.kinds[t.i]===25)e.message=a();else break;r(),n.statements.push(e);break}case 9:{t.i++;let e={$type:`Branch`,name:i()};t.accept(10)&&(e.order=parseInt(t.expect(24))),r(),n.statements.push(e);break}case 13:{t.i++;let e={$type:`Merge`,branch:i(),tags:[]};for(;;)if(t.accept(16))e.id=a();else if(t.accept(15))e.tags.push(a());else if(t.accept(12))e.type=o();else break;r(),n.statements.push(e);break}case 4:case 11:{t.i++;let e={$type:`Checkout`,branch:i()};r(),n.statements.push(e);break}case 0:{t.i++;let e={$type:`CherryPicking`,tags:[]};for(;;)if(t.accept(16))e.id=a();else if(t.accept(15))e.tags.push(a());else if(t.accept(6))e.parent=a();else break;r(),n.statements.push(e);break}default:t.fail(`a statement, a title, or a line break`)}return n}var F=7,ne=44,re=44,I=36,L=8,R=20,z=20,B=7,ie=6,V=Math.SQRT1_2,ae=[`normal`,`reverse`,`highlight`,`merge`,`cherry-pick`];function H(e,t,n){let r=e.gitGraph?.[t];return typeof r==`boolean`?r:n}function oe(e){return B+4+e.width+6}function se(e,t,n,r){let i=`cx="${a(t)}" cy="${a(n)}"`;if(e===w.HIGHLIGHT)return`<rect x="${a(t-F-1)}" y="${a(n-F-1)}" width="${2*F+2}" height="${2*F+2}" rx="2" fill="${r}"/>`;if(e===w.MERGE)return`<circle ${i} r="${F-1}" fill="var(--_bg)" stroke="${r}" stroke-width="2"/><circle ${i} r="2.5" fill="${r}"/>`;let o=`<circle ${i} r="${F}" fill="${r}"/>`;return e===w.REVERSE?o+`<path d="M${a(t-3)},${a(n-3)}l6,6M${a(t-3)},${a(n+3)}l6,-6" fill="none" stroke="var(--_bg)" stroke-width="1.5" stroke-linecap="round"/>`:e===w.CHERRY_PICK?o+`<path d="M${a(t-2.6)},${a(n+1)}L${a(t+.8)},${a(n-4.2)}L${a(t+2.6)},${a(n+1)}" fill="none" stroke="var(--_bg)" stroke-linejoin="round"/><circle cx="${a(t-2.6)}" cy="${a(n+2.2)}" r="1.8" fill="var(--_bg)"/><circle cx="${a(t+2.6)}" cy="${a(n+2.2)}" r="1.8" fill="var(--_bg)"/>`:o}function U(e,t,n){return e.direction===`LR`?s(n,r=>W(e,t,n,r?`TB`:`LR`)):W(e,t,n,e.direction)}function W(s,c,l,u){let d=l.fontSize??16,f=Math.round(d*.75),p=l.measurer??te(l.fontFamily,l.fontFamilyMono),m=l.padding??8,h=H(c,`showBranches`,!0),g=H(c,`showCommitLabel`,!0),_=H(c,`rotateCommitLabel`,!0),v=H(c,`parallelCommits`,!1),y=u!==`LR`,b=u===`BT`,x=new Map;s.lanes.forEach((e,t)=>x.set(e,t));let S=s.lanes.length,C=Math.round(d*.875),ee=s.lanes.map(e=>o(h?e:``,p,C,4e3)),T=[],E=new Map;for(let e of[...s.commits.values()].sort((e,t)=>e.seq-t.seq)){let t=g&&e.type!==w.CHERRY_PICK&&(e.type!==w.MERGE||e.customId===!0),n=[];for(let t of e.tags){let e=o(t,p,f,4e3);e.lines.length>0&&n.push(e)}let r={commit:e,index:T.length,lane:x.get(e.branch)??0,m:0,label:t?o(e.id,p,f,4e3):void 0,tags:n};T.push(r),E.set(e.id,r)}let D=new Float64Array(T.length),O=new Float64Array(T.length),k=new Float64Array(S).fill(F),A=new Float64Array(S).fill(F);T.forEach((e,t)=>{let{label:n,tags:r}=e,i=0,a=0;for(let e of r){let t=oe(e);y?(i=Math.max(i,e.height),a+=t+4):(i=Math.max(i,t),a+=e.height+3)}let o=0,s=0;n!==void 0&&n.lines.length>0&&(_?s=3+V*(n.width+n.height):(o=y?n.height:n.width,s=6+(y?n.width:n.height))),D[t]=Math.max(F,i/2,o/2),O[t]=i/2;let c=F+(r.length>0?ie+a:0),l=F+s,u=e.lane;k[u]=Math.max(k[u],y?l:c),A[u]=Math.max(A[u],y?c:l)});let j=new Float64Array(T.length);y||T.forEach((e,t)=>{if(O[t]!==0)for(let n of e.commit.parents){let r=E.get(n);r!==void 0&&r.lane<e.lane&&(j[t]=O[t]+4)}});let M=(e,t)=>Math.max(ne,D[e]+D[t]+L,j[t]>0?D[e]+I+j[t]:0);T.forEach((e,t)=>{if(!v){e.m=t===0?0:T[t-1].m+M(t-1,t);return}let n=0;for(let r of e.commit.parents){let e=E.get(r);e===void 0||e.index>=t||(n=Math.max(n,e.m+M(e.index,t)))}e.m=n});let N=0;for(let e of T)N=Math.max(N,e.m);let P=new Float64Array(S);for(let e=0;e<S;e++){let t=ee[e],n=t.lines.length===0?0:y?t.width/2+8:t.height/2+2;k[e]=Math.max(k[e],n),A[e]=Math.max(A[e],n),e>0&&(P[e]=P[e-1]+Math.max(re,A[e-1]+k[e]+L))}let U=(e,t)=>y?t:e,W=(e,t)=>y?b?-e:e:t,G=(e,t)=>`${a(U(e,t))},${a(W(e,t))}`,K=1/0,q=1/0,J=-1/0,Y=-1/0,X=(e,t,n,r)=>{e<K&&(K=e),t<q&&(q=t),n>J&&(J=n),r>Y&&(Y=r)},Z=``;if(h)for(let e=0;e<S;e++){let i=ee[e],o=t(e),c=P[e],l=i.width+16,u=i.height+4,d=i.lines.length===0?-R:-R-(y?u:l),f=U(d+(y?u:l)/2,c),p=W(d+(y?u:l)/2,c);X(U(-R,c),W(-R,c),U(-R,c),W(-R,c)),X(U(N+z,c),W(N+z,c),U(N+z,c),W(N+z,c)),Z+=`<g class="pele-branch" data-id="${n(s.lanes[e])}"><path class="pele-lane" d="M${G(-R,c)}L${G(N+z,c)}" stroke="${o}" stroke-dasharray="2 4"/>`,i.lines.length>0&&(X(f-l/2,p-u/2,f+l/2,p+u/2),Z+=`<rect x="${a(f-l/2)}" y="${a(p-u/2)}" width="${a(l)}" height="${a(u)}" fill="${o}" style="rx:var(--_r)"/>`+r(i,f,p,` class="pele-label" fill="var(--_bg)"`)),Z+=`</g>`}let ce=Array.from({length:S},()=>[]);for(let e of T)ce[e.lane].push(e.m);if(v)for(let e of ce)e.sort((e,t)=>e-t);let le=(e,t,n)=>{let r=ce[e],i=0,a=r.length;for(;i<a;){let e=i+a>>1;r[e]<=t?i=e+1:a=e}return i<r.length&&r[i]<n},ue=``,Q=``;for(let e of T){let{commit:n}=e,r=P[e.lane],i=e.m;for(let a=0;a<n.parents.length;a++){let o=E.get(n.parents[a]);if(o===void 0||o===e)continue;let s=P[o.lane],c=o.m;if(o.lane===e.lane){Q+=`<path class="pele-edge" d="M${G(c,s)}L${G(i,r)}" stroke="${t(e.lane)}"/>`;continue}let l=a>0&&n.type===w.MERGE,u=a>0&&!l,d=`M${G(c,s)}`;if(i<=c){let e=(c+i)/2;d+=`C${G(e,s)} ${G(e,r)} ${G(i,r)}`}else if(!l&&!le(e.lane,c,i)){let e=Math.min(I,i-c);d+=`C${G(c+e/2,s)} ${G(c+e/2,r)} ${G(c+e,r)}L${G(i,r)}`}else{let t=o.lane<e.lane&&i-j[e.index]>c?i-j[e.index]:i,n=Math.min(I,t-c),a=s;(!l||le(o.lane,c,i))&&(a=s>r?r+A[e.lane]+L/2:r-k[e.lane]-L/2,n=Math.min(I,(t-c)/2),d+=`C${G(c+n/2,s)} ${G(c+n/2,a)} ${G(c+n,a)}`),d+=`L${G(t-n,a)}C${G(t-n/2,a)} ${G(t-n/2,r)} ${G(t,r)}`,t<i&&(d+=`L${G(i,r)}`)}ue+=`<path class="pele-edge${l?` pele-edge-merge`:u?` pele-edge-cherry-pick`:``}" d="${d}" stroke="${t(l?o.lane:e.lane)}"${u?` stroke-dasharray="4 3"`:``}/>`}}let de=``;for(let e of T){let{commit:i,label:o,tags:s}=e,c=U(e.m,P[e.lane]),l=W(e.m,P[e.lane]),u=i.customType??i.type;X(c-F-1,l-F-1,c+F+1,l+F+1);let d=i.type<w.MERGE&&i.message!==``?`<title>${n(i.message)}</title>`:``;if(d+=se(u,c,l,t(e.lane)),o!==void 0&&o.lines.length>0){let e=o.width,t=o.height,n=(n,r)=>`<rect x="${a(n-e/2-2)}" y="${a(r-t/2+2)}" width="${a(e+4)}" height="${a(t-4)}" rx="3" fill="var(--_bg)"/>`;if(_){let i=V*t/2,s=y?c-F-3-i:c+3,u=y?l:l+F+3+i,f=V*e+i;X(s-f,b?u-f:u-i,s+i,b?u+i:u+f),d+=`<g class="pele-commit-label" transform="rotate(${b?45:-45} ${a(s)} ${a(u)})">`+n(s-e/2,u)+r(o,s-e/2,u,``)+`</g>`}else{let i=y?c-F-6-e/2:c,a=y?l:l+F+6+t/2;X(i-e/2,a-t/2,i+e/2,a+t/2),d+=`<g class="pele-commit-label">${n(i,a)}${r(o,i,a,``)}</g>`}}let f=F+ie;for(let e=y?0:s.length-1;e>=0&&e<s.length;e+=y?1:-1){let t=s[e],n=oe(t),i=t.height,o=y?c+f:c-n/2,u=y?l:l-f-i/2;f+=y?n+4:i+3,X(o,u-i/2,o+n,u+i/2),d+=`<g class="pele-tag"><path d="M${a(o)},${a(u)}L${a(o+B)},${a(u-i/2)}H${a(o+n)}V${a(u+i/2)}H${a(o+B)}Z" fill="var(--_s)" stroke="var(--_b)" stroke-linejoin="round"/><circle cx="${a(o+B)}" cy="${a(u)}" r="1.5" fill="var(--_b)"/>`+r(t,o+B+4+t.width/2,u,` fill="var(--_fg)"`)+`</g>`}let p=i.type===w.MERGE&&u!==w.MERGE?` pele-commit-merge`:``;de+=`<g class="pele-commit pele-commit-${ae[u]??ae[0]}${p}" data-id="${n(i.id)}">${d}</g>`}K>J&&X(0,0,0,0);let $=i(s.title,!1,p,d,4e3,1),fe=$.height>0?$.height+16:0,pe=Math.max(J-K,$.width),me=Math.ceil(pe+2*m),he=Math.ceil(Y-q+fe+2*m),ge=m-K+(pe-(J-K))/2,_e=m+fe-q,ve=r($,me/2,m+$.height/2,` class="pele-title" font-weight="var(--_tw)"`)+`<g transform="translate(${a(ge)},${a(_e)})">`+(Z?`<g class="pele-branches" fill="none" font-size="${C}">${Z}</g>`:``)+(ue||Q?`<g class="pele-edges" fill="none" stroke-width="2" stroke-linecap="round">${ue}${Q}</g>`:``)+(de?`<g class="pele-commits" font-size="${f}" fill="var(--_m)">${de}</g>`:``)+`</g>`;return{svg:e(`gitGraph`,me,he,d,l,s,ve),width:me,height:he,links:[]}}var G={type:`gitGraph`,parse:(e,t,n)=>k(P(e),t,n),render:U};export{G as gitGraph};
@@ -0,0 +1 @@
1
+ function e(e,t,n,r,i,a=0){if(e===``||t<=0)return;let o=i.width(e,n,a);if(o<=t)return{text:e,size:n,width:o};let s=Math.max(r,Math.floor(n*t/o));for(;s>=r;){if(o=i.width(e,s,a),o<=t)return{text:e,size:s,width:o};s--}let c=Array.from(e),l=0,u=c.length-1;for(;l<u;){let e=l+u+1>>1;i.width(c.slice(0,e).join(``).trimEnd()+`…`,r,a)<=t?l=e:u=e-1}if(l===0)return;let d=c.slice(0,l).join(``).trimEnd()+`…`;return o=i.width(d,r,a),o<=t?{text:d,size:r,width:o}:void 0}export{e as t};
@@ -0,0 +1 @@
1
+ var e;function t(){let e=`4q 0 b 0 5 0 6 m 2 u 2 cp 5 b f 4 8 0 2 0 3m 4 2 1 3 3 9 0 2 2 2 0 2 j 2 2a 2 3u 9 4d a 11 3 0 8 12 21 q 6 2 1a 16 10 1 2 2q 2 0 g 1 8 1 b 2 3 0 h 0 2 t u 2g c 0 p w a 1 5 0 6 l 5 0 a 0 4 0 o o 20 0 2 a 2g 1h 4 0 j 0 8 9 g 6 2 6 6 7 3 1 3 l 2 6 2 0 4 3 4 0 h 0 e 1 2 2 f 1 k 5 5 1 3 l 2 6 2 1 2 1 2 1 w 3 2 0 k 2 h 8 2 2 2 l 2 6 2 1 2 4 4 0 j 0 g 1 10 7 3 1 3 l 2 6 2 1 2 4 4 0 v 1 2 2 g 0 i 0 2 5 4 2 2 3 4 1 2 0 2 1 4 1 4 2 4 b n 0 1h 7 2 2 2 m 2 9 2 4 4 0 r 1 7 1 10 7 2 2 2 m 2 9 2 4 4 0 x 0 2 1 g 1 j 7 2 2 2 14 3 0 h 0 i 1 p 5 6 h 4 n 2 8 2 0 3 6 1n 1b 2 1 d 6 1n 1 2 0 3 1 2 0 3 0 7 3 2 6 2 2 2 0 2 0 3 1 2 3 2 1 a 0 3 4 2 0 m 3 x 0 1s 7 2 z s 4 38 16 l 0 h 5 5 3 4 0 4 1 8 2 5 c d 0 i 11 2 0 6 0 3 16 2 98 2 3 3 6 2 0 2 3 3 14 2 3 3 w 2 3 3 6 2 0 2 3 3 e 2 1k 2 3 3 1u 12 f h 2c d h7 3 g 2 p 6 22 m c 2 3 f h f h f c 2 2 g 1f 10 0 5 0 1w 2f 9 14 2 0 6 1x b s 1g t 3 4 c 17 m 6 1l m a 1g 2b 0 2m 1a i 6 1k t e 1 b 17 r z 16 2 b z 30 3 2 3 4 1 a 5b 1t 7p 3 5 3 11 3 5 3 7 2 0 2 0 2 0 2 u 3 1g 2 6 2 0 4 2 2 6 4 3 3 5 5 c 6 2 2 6 39 0 e 0 h c 2u 0 5 0 3 9 2 0 4 4 7 0 2 0 2 0 2 3 2 a 3 3 6 4 5 0 1h 1 22k 1a 2 1a 2 3o 7 3 4 1 d 11 2 0 6 0 3 1j 8 0 h m a 6 2 6 2 6 2 6 2 6 2 6 2 6 2 6 29 0 d2 1 17 4 6 1 5 2d 7 2 2 2h 2 3 6 14 4 2l i q 1i f e9 52t 23 g5o 1g wc 1w 19 3 7g 4 f b 1 l 1a h o 9 1x 1e 8 3 2u 3 3 2 3 d a 26 9 2 2 2 3 2 m u 1f f 1d 1r 5 4 0 f r b m q s 8 1a t 0 1d 14 o 2 2 7 l m 4 0 6 1b 2 0 4 1 3 4 3 0 2 0 p 2 3 a 8 2 d 5 3 5 3 5 a 6 2 6 42 y u 8mb d m 5 1c 6it a5 3 2x 13 6 d 4 6 0 2 9 2 c 2 4 2 0 2 1 2 1 2 2z y a2 j 1r 3 1h 15 b 39 4 2 3q 11 p 7 p c 2g 4 5 3 5 3 5 3 2`.split(` `),t=new Uint16Array(e.length),n=0;for(let r=0;r<e.length;r+=2){let i=n+parseInt(e[r],36);n=i+parseInt(e[r+1],36),t[r]=i,t[r+1]=n}return t}function n(n){if(n<170||n>65500)return!1;let r=e??=t(),i=0,a=(r.length>>1)-1;for(;i<=a;){let e=i+a>>1;if(n<r[e*2])a=e-1;else if(n>r[e*2+1])i=e+1;else return!0}return!1}export{n as t};
@@ -0,0 +1 @@
1
+ import{d as e,x as t}from"./E3FWOBN4-D5m5o2g0.js";var n=12,r=(e,t,r)=>(r?t:e)-2*n,i=e=>(t,r,i)=>i?0:t-2*e(r)-2*n;function a(e,t,n){let r=Math.min(1,Math.abs(e)/t);return n*(1-Math.sqrt(1-r*r))}var o=(e,t,n,r)=>n&1?a(r,t/2,e/2):a(r,e/2,t/2),s=(e,t,n)=>(n?t:e)*.6,c=(e,t,n,r)=>n&1?0:a(r,e/2,Math.min(12,Math.max(6,e/14))),l=(e,t)=>()=>({w:e,h:t,dy:0});function u(e,t,n){let r=Math.max(1.6*e+40,80),i=(t+10)/(1-(e+8)/r),a=i/2-10-t/2;return{w:r,h:i,dy:n?-a:a}}function d(e,t){return`<path d="${e}"${t}/>`}var f=(e,t,n)=>n&1?t/8:0,p=(e,t)=>({w:Math.max(e+36,48),h:t+24,dy:0});function m(e,n){let r=``;for(let n=0;n<e.length;n+=2)r+=(n?` `:``)+t(e[n])+`,`+t(e[n+1]);return`<polygon points="${r}"${n}/>`}function h(e,n,r,i=``){return`<rect x="${t(-e/2)}" y="${t(-n/2)}" width="${t(e)}" height="${t(n)}"${i}${r}/>`}var g={rect:{size:p,span:r,draw:(t,n,r)=>h(t,n,e(r))},rounded:{size:p,span:r,draw:(e,n,r)=>h(e,n,r,` rx="${t(Math.min(12,n/2))}"`)},stadium:{inset:(e,t,n,r)=>n&1?a(r,t/2,t/2):0,span:(e,t,n)=>n?t*.6:e-t,size:(e,t)=>{let n=t+24;return{w:e+n*.5+36-8,h:n,dy:0}},draw:(e,n,r)=>h(e,n,r,` rx="${t(n/2)}"`)},"fr-rect":{span:r,size:(e,t)=>({w:e+36+16,h:t+24,dy:0}),draw:(n,r,i,a)=>{let o=n/2-8;return h(n,r,e(i))+`<path d="M${t(-o)},${t(-r/2)}V${t(r/2)}M${t(o)},${t(-r/2)}V${t(r/2)}" fill="none"${a}/>`}},cyl:{inset:c,span:(e,t,r)=>r?t-2*n-12:e*.6,size:(e,t)=>{let n=Math.max(e+36,56),r=Math.min(12,Math.max(6,n/14));return{w:n,h:t+24+2*r,dy:r/2}},draw:(e,n,r,i)=>{let a=e/2,o=Math.min(12,Math.max(6,e/14)),s=-n/2+o,c=n/2-o;return`<path d="M${t(-a)},${t(s)}A${t(a)},${t(o)} 0 0 1 ${t(a)},${t(s)}V${t(c)}A${t(a)},${t(o)} 0 0 1 ${t(-a)},${t(c)}Z"${r}/><path d="M${t(-a)},${t(s)}A${t(a)},${t(o)} 0 0 0 ${t(a)},${t(s)}" fill="none"${i}/>`}},circle:{inset:o,span:s,size:(e,t)=>{let n=Math.max(Math.sqrt(e*e+t*t)+16,44);return{w:n,h:n,dy:0}},draw:(e,n,r)=>`<circle r="${t(e/2)}"${r}/>`},"dbl-circ":{inset:o,span:s,size:(e,t)=>{let n=Math.max(Math.sqrt(e*e+t*t)+26,54);return{w:n,h:n,dy:0}},draw:(e,n,r,i)=>`<circle r="${t(e/2)}"${r}/><circle r="${t(e/2-5)}" fill="none"${i}/>`},ellipse:{inset:o,span:s,size:(e,t)=>({w:e*1.3+36,h:t*1.2+24,dy:0}),draw:(e,n,r)=>`<ellipse rx="${t(e/2)}" ry="${t(n/2)}"${r}/>`},diam:{inset:(e,t,n,r)=>n&1?Math.abs(r)*e/t:Math.abs(r)*t/e,span:(e,t,n)=>(n?t:e)*.6,size:(e,t)=>{let n=e+16,r=t+8;return{w:n+1.6*r,h:n/1.6+r,dy:0}},draw:(e,t,n)=>m([0,-t/2,e/2,0,0,t/2,-e/2,0],n)},hex:{inset:(e,t,n,r)=>n&1?Math.abs(r)/2:0,span:(e,t,r)=>r?t*.5:e-t/2-n,size:(e,t)=>{let n=t+24;return{w:e+36+n/2,h:n,dy:0}},draw:(e,t,n)=>{let r=t/4;return m([-e/2+r,-t/2,e/2-r,-t/2,e/2,0,e/2-r,t/2,-e/2+r,t/2,-e/2,0],n)}},odd:{inset:(e,t,n)=>n===3?t/4:0,span:i(()=>0),size:(e,t)=>{let n=t+24;return{w:e+36+n/4,h:n,dy:0}},draw:(e,t,n)=>{let r=t/4;return m([-e/2,-t/2,e/2,-t/2,e/2,t/2,-e/2,t/2,-e/2+r,0],n)}},"lean-r":{inset:f,span:i(e=>e/4),size:(e,t)=>{let n=t+24;return{w:e+36+n/2,h:n,dy:0}},draw:(e,t,n)=>{let r=t/4;return m([-e/2+r,-t/2,e/2,-t/2,e/2-r,t/2,-e/2,t/2],n)}},"lean-l":{inset:f,span:i(e=>e/4),size:(e,t)=>{let n=t+24;return{w:e+36+n/2,h:n,dy:0}},draw:(e,t,n)=>{let r=t/4;return m([-e/2,-t/2,e/2-r,-t/2,e/2,t/2,-e/2+r,t/2],n)}},"trap-b":{inset:f,span:i(e=>e/4),size:(e,t)=>{let n=t+24;return{w:e+36+n/2,h:n,dy:0}},draw:(e,t,n)=>{let r=t/4;return m([-e/2+r,-t/2,e/2-r,-t/2,e/2,t/2,-e/2,t/2],n)}},"trap-t":{inset:f,span:i(e=>e/4),size:(e,t)=>{let n=t+24;return{w:e+36+n/2,h:n,dy:0}},draw:(e,t,n)=>{let r=t/4;return m([-e/2,-t/2,e/2,-t/2,e/2-r,t/2,-e/2+r,t/2],n)}},text:{span:r,size:(e,t)=>({w:e+8,h:t+8,dy:0}),draw:(e,t)=>h(e,t,` fill="none" stroke="none"`)},"sm-circ":{noLabel:!0,inset:o,span:s,size:l(14,14),draw:(e,n,r)=>`<circle r="${t(e/2)}"${r}/>`},"f-circ":{noLabel:!0,inset:o,span:s,size:l(14,14),draw:(e,n,r,i)=>`<circle r="${t(e/2)}" fill="var(--_l)"${i}/>`},"fr-circ":{noLabel:!0,inset:o,span:s,size:l(18,18),draw:(e,n,r,i)=>`<circle r="${t(e/2)}"${r}/><circle r="${t(e/2-4)}" fill="var(--_l)"${i}/>`},fork:{noLabel:!0,span:(e,t,n)=>(n?t:e)-8,size:l(72,8),draw:(e,t,n,r)=>h(e,t,` fill="var(--_l)"${r}`,` rx="2"`)},"notch-rect":{size:p,span:r,draw:(e,t,n)=>m([-e/2+10,-t/2,e/2,-t/2,e/2,t/2,-e/2,t/2,-e/2,-t/2+10],n)},"lin-rect":{span:r,size:(e,t)=>({w:e+36+8,h:t+24,dy:0}),draw:(n,r,i,a)=>h(n,r,e(i))+`<path d="M${t(-n/2+8)},${t(-r/2)}V${t(r/2)}" fill="none"${a}/>`},"div-rect":{span:r,size:(e,t)=>({w:e+36,h:t+24+8,dy:4}),draw:(n,r,i,a)=>h(n,r,e(i))+`<path d="M${t(-n/2)},${t(-r/2+8)}H${t(n/2)}" fill="none"${a}/>`},"win-pane":{span:r,size:(e,t)=>({w:e+36+8,h:t+24+8,dy:4}),draw:(n,r,i,a)=>h(n,r,e(i))+`<path d="M${t(-n/2+8)},${t(-r/2)}V${t(r/2)}M${t(-n/2)},${t(-r/2+8)}H${t(n/2)}" fill="none"${a}/>`},tri:{inset:(e,t,n)=>n&1?e/4:0,size:(e,t)=>u(e,t,!1),draw:(e,t,n)=>m([0,-t/2,e/2,t/2,-e/2,t/2],n)},"flip-tri":{inset:(e,t,n)=>n&1?e/4:0,size:(e,t)=>u(e,t,!0),draw:(e,t,n)=>m([-e/2,-t/2,e/2,-t/2,0,t/2],n)},"sl-rect":{inset:(e,t,n)=>n===0?5:0,size:(e,t)=>({w:e+36,h:t+24+10,dy:5}),draw:(e,t,n)=>m([-e/2,-t/2+10,e/2,-t/2,e/2,t/2,-e/2,t/2],n)},"notch-pent":{span:r,size:(e,t)=>({w:e+36,h:t+24,dy:0}),draw:(e,t,n)=>m([-e/2+10,-t/2,e/2-10,-t/2,e/2,-t/2+10,e/2,t/2,-e/2,t/2,-e/2,-t/2+10],n)},hourglass:{noLabel:!0,inset:(e,t,n)=>n&1?e/2:0,size:l(32,40),draw:(e,t,n)=>m([-e/2,-t/2,e/2,-t/2,-e/2,t/2,e/2,t/2],n)},delay:{size:(e,t)=>{let n=t+24;return{w:e+36+n/4,h:n,dy:0}},draw:(e,n,r)=>{let i=n/2;return`<path d="M${t(-e/2)},${t(-i)}H${t(e/2-i)}A${t(i)},${t(i)} 0 0 1 ${t(e/2-i)},${t(i)}H${t(-e/2)}Z"${r}/>`}},"h-cyl":{size:(e,t)=>{let n=t+24,r=Math.min(12,n/4);return{w:e+36+2*r,h:n,dy:0}},draw:(e,n,r,i)=>{let a=n/2,o=Math.min(12,n/4),s=-e/2+o,c=e/2-o;return`<path d="M${t(s)},${t(-a)}H${t(c)}A${t(o)},${t(a)} 0 0 1 ${t(c)},${t(a)}H${t(s)}A${t(o)},${t(a)} 0 0 1 ${t(s)},${t(-a)}Z"${r}/><path d="M${t(c)},${t(-a)}A${t(o)},${t(a)} 0 0 0 ${t(c)},${t(a)}" fill="none"${i}/>`}},"cross-circ":{noLabel:!0,inset:o,span:s,size:l(44,44),draw:(e,n,r,i)=>{let a=e/2,o=a*Math.SQRT1_2;return`<circle r="${t(a)}"${r}/><path d="M${t(-o)},${t(-o)}L${t(o)},${t(o)}M${t(o)},${t(-o)}L${t(-o)},${t(o)}" fill="none"${i}/>`}},"st-rect":{span:(e,t,r)=>(r?t:e)-2*n-8,size:(e,t)=>({w:e+36+8,h:t+24+8,dy:4}),draw:(n,r,i)=>{let a=n-8,o=r-8,s=``;for(let c=0;c<3;c++){let l=-n/2+(2-c)*4,u=-r/2+c*4;s+=`<rect x="${t(l)}" y="${t(u)}" width="${t(a)}" height="${t(o)}"${e(i)}/>`}return s}},doc:{inset:(e,t,n)=>n===2?10:0,size:(e,t)=>({w:e+36,h:t+24+10,dy:-5}),draw:(e,t,n)=>v(e,t,n)},flag:{inset:(e,t,n)=>n&1?0:8,size:(e,t)=>({w:e+36,h:t+24+16,dy:0}),draw:(e,n,r)=>{let i=e/2,a=n/2-8,o=e/4;return`<path d="M${t(-i)},${t(-a)}q${t(o)},-10 ${t(2*o)},0t${t(2*o)},0V${t(a)}q${t(-o)},10 ${t(-2*o)},0t${t(-2*o)},0Z"${r}/>`}},datastore:{size:p,span:r,draw:(e,n,r,i)=>h(e,n,r.replace(`stroke="var(--_b)"`,`stroke="none"`))+`<path d="M${t(-e/2)},${t(-n/2)}H${t(e/2)}M${t(-e/2)},${t(n/2)}H${t(e/2)}" fill="none"${i}/>`},folder:{size:(e,t)=>({w:Math.max(e+36,64),h:t+24+8,dy:4}),draw:(e,n,r)=>{let i=e/2,a=n/2,o=Math.min(e*.4,48);return d(`M${t(-i)},${t(-a)}H${t(-i+o)}L${t(-i+o+8)},${t(-a+8)}H${t(i)}V${t(a)}H${t(-i)}Z`,r)}},bucket:{size:(e,t)=>({w:e+36+20,h:t+24+10,dy:3}),inset:(e,t,n)=>n&1?t/12:0,draw:(e,n,r,i)=>{let a=e/2,o=n/2,s=n/6;return d(`M${t(-a)},${t(-o+5)}A${t(a)},${t(5)} 0 0 1 ${t(a)},${t(-o+5)}L${t(a-s)},${t(o-5)}A${t(a-s)},${t(5)} 0 0 1 ${t(-a+s)},${t(o-5)}Z`,r)+`<path d="M${t(-a)},${t(-o+5)}A${t(a)},${t(5)} 0 0 0 ${t(a)},${t(-o+5)}" fill="none"${i}/>`}},console:{span:r,size:(e,t)=>({w:Math.max(e+36,72),h:t+24+12,dy:6}),draw:(n,r,i,a)=>h(n,r,e(i))+`<path d="M${t(-n/2)},${t(-r/2+12)}H${t(n/2)}M${t(-n/2+7)},${t(-r/2+4)}l3,2.5l-3,2.5M${t(-n/2+13)},${t(-r/2+9)}h4" fill="none"${a}/>`},browser:{span:r,size:(e,t)=>({w:Math.max(e+36,72),h:t+24+12,dy:6}),draw:(n,r,i,a)=>{let o=``;for(let e=0;e<3;e++)o+=`<circle cx="${t(-n/2+8+e*7)}" cy="${t(-r/2+6)}" r="1.5" fill="none"${a}/>`;return h(n,r,e(i))+`<path d="M${t(-n/2)},${t(-r/2+12)}H${t(n/2)}" fill="none"${a}/>`+o}},person:{size:(e,t)=>({w:Math.max(e+36,56),h:t+24+26,dy:13}),draw:(e,n,r)=>{let i=-n/2;return`<rect x="${t(-e/2)}" y="${t(i+26)}" width="${t(e)}" height="${t(n-26)}" rx="12"${r}/><circle cy="${t(i+14)}" r="13"${r}/>`}},bang:{size:(e,t)=>({w:e+36+28,h:t+24+24,dy:0}),inset:()=>3,draw:(e,t,n)=>{let r=[];for(let n=0;n<28;n++){let i=Math.PI*n/14-Math.PI/2,a=n%2==0?1:.82;r.push(e/2*Math.cos(i)*a,t/2*Math.sin(i)*a)}return m(r,n)}},cloud:{size:(e,t)=>({w:e+36+32,h:t+24+24,dy:0}),inset:(e,t,n)=>n&1?2:1,draw:(e,n,r)=>{let i=e/2,a=n/2,o=a*.55;return d(`M${t(-i+o)},${t(a)}A${t(o)},${t(o)} 0 0 1 ${t(-i+o*.6)},${t(-a*.1)}A${t(i*.42)},${t(a*.7)} 0 0 1 ${t(-i*.1)},${t(-a*.72)}A${t(i*.4)},${t(a*.62)} 0 0 1 ${t(i*.62)},${t(-a*.42)}A${t(o*1.05)},${t(o*1.05)} 0 0 1 ${t(i-o)},${t(a)}Z`,r)}},brace:{size:(e,t)=>({w:e+36+12,h:t+24,dy:0}),draw:(e,t,n,r)=>h(e,t,` fill="none" stroke="none"`)+_(-e/2+12,t,-1,r)},"brace-r":{size:(e,t)=>({w:e+36+12,h:t+24,dy:0}),draw:(e,t,n,r)=>h(e,t,` fill="none" stroke="none"`)+_(e/2-12,t,1,r)},braces:{size:(e,t)=>({w:e+36+24,h:t+24,dy:0}),draw:(e,t,n,r)=>h(e,t,` fill="none" stroke="none"`)+_(-e/2+12,t,-1,r)+_(e/2-12,t,1,r)},bolt:{noLabel:!0,size:l(36,56),inset:(e,t,n)=>n&1?e/4:0,draw:(e,t,n)=>m([e*.15,-t/2,-e/2,t*.08,-e*.05,t*.08,-e*.15,t/2,e/2,-t*.08,e*.05,-t*.08],n)},"lin-cyl":{inset:c,span:(e,t,r)=>r?t-2*n-20:e*.6,size:(e,t)=>{let n=Math.max(e+36,56),r=Math.min(12,Math.max(6,n/14));return{w:n,h:t+24+2*r+8,dy:r/2+4}},draw:(e,n,r,i)=>{let a=e/2,o=Math.min(12,Math.max(6,e/14)),s=-n/2+o,c=n/2-o,l=e=>`M${t(-a)},${t(e)}A${t(a)},${t(o)} 0 0 0 ${t(a)},${t(e)}`;return d(`M${t(-a)},${t(s)}A${t(a)},${t(o)} 0 0 1 ${t(a)},${t(s)}V${t(c)}A${t(a)},${t(o)} 0 0 1 ${t(-a)},${t(c)}Z`,r)+`<path d="${l(s)}${l(s+8)}" fill="none"${i}/>`}},"curv-trap":{size:(e,t)=>{let n=t+24;return{w:e+36+n*.6,h:n,dy:0}},draw:(e,n,r)=>{let i=e/2,a=n/2,o=n*.3;return d(`M${t(-i+o)},${t(-a)}H${t(i-o)}A${t(o)},${t(a)} 0 0 1 ${t(i-o)},${t(a)}H${t(-i+o)}L${t(-i)},0Z`,r)}},docs:{size:(e,t)=>({w:e+36+8,h:t+24+18,dy:-1}),inset:(e,t,n)=>n===2?10:0,draw:(e,t,n)=>{let r=``;for(let i=0;i<3;i++)r+=`<g transform="translate(${(1-i)*4},${(i-1)*4})">${v(e-8,t-8,n)}</g>`;return r}},"bow-rect":{size:(e,t)=>{let n=t+24;return{w:e+36+n*.4,h:n,dy:0}},inset:(e,t,n)=>n===1?t*.2:0,draw:(e,n,r)=>{let i=e/2,a=n/2,o=n*.2;return d(`M${t(-i+o)},${t(-a)}H${t(i)}A${t(o)},${t(a)} 0 0 0 ${t(i)},${t(a)}H${t(-i+o)}A${t(o)},${t(a)} 0 0 1 ${t(-i+o)},${t(-a)}Z`,r)}},"tag-rect":{size:p,span:r,draw:(n,r,i,a)=>h(n,r,e(i))+`<path d="M${t(n/2-12)},${t(r/2)}L${t(n/2)},${t(r/2-12)}" fill="none"${a}/>`},"tag-doc":{size:(e,t)=>({w:e+36,h:t+24+10,dy:-5}),inset:(e,t,n)=>n===2?10:0,draw:(e,n,r,i)=>v(e,n,r)+`<path d="M${t(e/2-12)},${t(n/2-14)}L${t(e/2)},${t(n/2-26)}" fill="none"${i}/>`},"lin-doc":{size:(e,t)=>({w:e+36+8,h:t+24+10,dy:-5}),inset:(e,t,n)=>n===2?10:0,draw:(e,n,r,i)=>v(e,n,r)+`<path d="M${t(-e/2+8)},${t(-n/2)}V${t(n/2-6)}" fill="none"${i}/>`},collapsedGroup:{size:(e,t)=>({w:e+36+8,h:t+24+8,dy:-2}),draw:(n,r,i)=>`<rect x="${t(-n/2+6)}" y="${t(-r/2+8)}" width="${t(n-12)}" height="${t(r-8)}"${e(i)}/><rect x="${t(-n/2)}" y="${t(-r/2)}" width="${t(n)}" height="${t(r-4)}"${e(i)}/>`}};function _(e,n,r,i){let a=n/2,o=6*r;return`<path d="M${t(e)},${t(-a)}q${t(o)},0 ${t(o)},6V-6q0,6 ${t(o)},6q${t(-o)},0 ${t(-o)},6V${t(a-6)}q0,6 ${t(-o)},6" fill="none"${i}/>`}function v(e,n,r){let i=e/2,a=-n/2,o=n/2-10,s=e/4;return`<path d="M${t(-i)},${t(a)}H${t(i)}V${t(o)}q${t(-s)},-12 ${t(-2*s)},0t${t(-2*s)},0Z"${r}/>`}var y=g.rect,b=new Map(Object.entries(g));function x(e,t,n){return(b.get(e)??y).size(t,n)}function S(e,t,n,r,i){return(b.get(e)??y).draw(t,n,r,i)}function C(e,t,n,r,i=0){return b.get(e)?.inset?.(t,n,r,i)??0}function w(e,t,n,r){return Math.max(0,b.get(e)?.span?.(t,n,r)??0)}function T(e){return b.get(e)?.noLabel!==!0}function E(e,t,n){let r=e[t]-n.x,i=e[t+1]-n.y;return Math.abs(Math.abs(i)-n.h/2)<.5?i<0?0:2:Math.abs(Math.abs(r)-n.w/2)<.5?r<0?3:1:-1}function D(e,t,n,r){if(r.isGroup)return;let i=E(e,t,r);if(i===0||i===2){let a=C(n.shape,n.w,n.h,i,e[t]-r.x)+(r.h-n.h)/2;e[t+1]+=i===0?a:-a}else if(i>=0){let a=C(n.shape,n.w,n.h,i,e[t+1]-r.y)+(r.w-n.w)/2;e[t]+=i===3?a:-a}}export{S as a,x as i,E as n,C as o,w as r,T as s,D as t};
@@ -0,0 +1,2 @@
1
+ import{_ as e,a as t,b as n,d as r,f as i,i as a,o,s,u as c,x as l}from"./E3FWOBN4-D5m5o2g0.js";import{i as u,r as d}from"./DKTLEL5E-DciMwFJ1.js";import{a as f,c as p,d as m,g as h,h as g,n as _,p as v,t as y}from"./C5HTQT3I-7U13x70S.js";import{t as b}from"./5THPTBWS-Ce_hS451.js";import{d as x,u as S}from"./lazy-DaMZI1F7.js";function C(e){let t=[],n=[];for(let r of e){let e=r.type===`Leaf`,i={name:r.name,children:e?void 0:[]};for(i.classSelector=r.classSelector,r.cssCompiledStyles&&(i.cssCompiledStyles=r.cssCompiledStyles),e&&r.value!==void 0&&(i.value=r.value);n.length>0&&n[n.length-1].level>=r.level;)n.pop();n.length===0?t.push(i):n[n.length-1].node.children.push(i),e||n.push({node:i,level:r.level})}return t}function w(e,t){let n=new Map;for(let t of e.TreemapRows){if(t.$type!==`ClassDefStatement`)continue;let e=n.get(t.className);e||n.set(t.className,e=[]);let r=(t.styleText??``).replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`);for(let t of r.split(`;`))e.push(t)}let r=[];for(let t of e.TreemapRows){if(t.$type!==`TreemapRow`)continue;let e=t.item,i=e.classSelector?n.get(e.classSelector):void 0;r.push({level:t.indent??0,name:e.name,type:e.$type,value:e.$type===`Leaf`?e.value:void 0,classSelector:e.classSelector,cssCompiledStyles:i&&i.length>0?i:void 0})}return{type:`treemap`,title:e.title||t,accTitle:e.accTitle?e.accTitle.replace(/^\s+/g,``):void 0,accDescr:e.accDescr?e.accDescr.replace(/\n\s+/g,`
2
+ `):void 0,roots:C(r),classes:n}}var T=[f,y,v,{name:`TREEMAP_KEYWORD`,pattern:/treemap-beta|treemap/y},{name:`CLASS_DEF`,pattern:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/y},{name:`STYLE_SEPARATOR`,pattern:/:::/y},{name:`SEPARATOR`,pattern:/:/y},{name:`COMMA`,pattern:/,/y},{name:`INDENTATION`,pattern:/[ \t]{1,}/y},{name:`WS`,pattern:/[ \t]+/y,hidden:!0},{name:`ML_COMMENT`,pattern:/\%\%[^\n]*/y,hidden:!0},{name:`NL`,pattern:/\r?\n/y,hidden:!0},{name:`ID2`,pattern:/[a-zA-Z_][a-zA-Z0-9_]*/y},{name:`NUMBER2`,pattern:/[0-9_\.\,]+/y},{name:`STRING2`,pattern:/"[^"]*"|'[^']*'/y}],E=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/;function D(e){let t=new g(_(e,T,`treemap`),T,`treemap`),n=t.kinds,r={$type:`Treemap`,TreemapRows:[]},i=()=>t.accept(5)?t.expect(12):void 0;for(t.expect(3);t.kind!==-1;){let e=t.kind;if(e===0){r.accDescr=p(t.take());continue}if(e===1){r.accTitle=h(t.take());continue}if(e===2){r.title=m(t.take());continue}e!==8&&e!==14&&e!==4&&t.fail(`a node, a class definition, or a title`);let a=e===8?t.take().length:void 0;if(t.kind===4){let e=E.exec(t.take()),n={$type:`ClassDefStatement`,className:e[1]};e[2]&&(n.styleText=e[2]),a!==void 0&&(n.indent=a),r.TreemapRows.push(n);continue}let o=t.expect(14).slice(1,-1),s=n[t.i]===8?t.i+1:t.i,c;n[s]===6||n[s]===7?(t.i=s+1,t.accept(8),c={$type:`Leaf`,name:o,value:parseFloat(t.expect(13).replace(/,/g,``))}):c={$type:`Section`,name:o};let l=i();l!==void 0&&(c.classSelector=l);let u={$type:`TreemapRow`,item:c};a!==void 0&&(u.indent=a),r.TreemapRows.push(u)}return r}var O=/^(?:.?[<>=^])?([-+( ])?(\$)?0?\d*(,)?(?:\.(\d+))?(~)?([a-zA-Z%])?$/;function k(e){let t=``;for(let n=e.length;n>0;n-=3)t=e.slice(Math.max(0,n-3),n)+(t?`,`+t:``);return t}function A(e){let t=O.exec(e===`$0,0`?`$,`:e)??O.exec(`,`),n=t[1]===`+`,r=t[3]!==void 0,i=t[4]===void 0?void 0:Math.min(Number(t[4]),20),a=t[6]??``;return e=>{let o=Math.abs(e),s,c=``;if(a===`f`?s=o.toFixed(i??6):a===`%`?(s=(o*100).toFixed(i??6),c=`%`):s=a===`d`?Math.round(o).toFixed(0):a===`e`?o.toExponential(i??6):String(Number(o.toPrecision(Math.max(1,i??12)))),t[5]&&s.includes(`.`)&&!s.includes(`e`)&&(s=s.replace(/\.?0+$/,``)),r&&!s.includes(`e`)){let e=s.indexOf(`.`);s=e===-1?k(s):k(s.slice(0,e))+s.slice(e)}return(e<0?`-`:n?`+`:``)+(t[2]??``)+s+c}}function j(e,t,n){return{node:e,parent:t,series:n,value:e.children===void 0&&Number.isFinite(e.value)&&e.value>0?e.value:0,children:[],x:0,y:0,w:0,h:0}}function M(e,t,n,r,i,a,o){let s=t,c=0;for(;c<e.length;){let t=i*a/s,l=Math.min(i,a),u=e[c].value*t,d=u,f=Math.max(l*l*d/(u*u),u*u/(l*l*d)),p=c+1;for(;p<e.length;){let n=e[p].value*t,r=u+n,i=Math.max(l*l*d/(r*r),r*r/(l*l*n));if(i>f)break;f=i,u=r,p++}let m=u/l,h=0;for(let u=c;u<p;u++){let c=e[u],d=u===p-1?l-h:c.value*t/m,f=i>=a?n:n+h,g=i>=a?r+h:r,_=Math.round(f+o/2),v=Math.round(g+o/2);c.x=_,c.y=v,c.w=Math.round(f+(i>=a?m:d)-o/2)-_,c.h=Math.round(g+(i>=a?d:m)-o/2)-v,h+=d,s-=c.value}i>=a?(n+=m,i-=m):(r+=m,a-=m),c=p}}function N(e,t,n,r){let i=e.map((e,t)=>j(e,void 0,t)),a=i.slice();for(let e=0;e<a.length;e++){let t=a[e];for(let e of t.node.children??[]){let n=j(e,t,t.series);t.children.push(n),a.push(n)}}for(let e=a.length-1;e>=0;e--){let t=a[e];t.parent&&(t.parent.value+=t.value)}let{gap:o,header:s,side:c}=r,l=[],u=(e,t,n,r,i)=>{if(r<=0||i<=0)return;let a=e.filter(e=>e.value>0).sort((e,t)=>t.value-e.value),s=0;for(let e of a)s+=e.value;if(a.length!==0&&Number.isFinite(s)){M(a,s,t-o/2,n-o/2,r+o,i+o,o);for(let e of a)e.w>0&&e.h>0&&l.push(e)}};u(i,0,0,t,n);for(let e=0;e<l.length;e++){let t=l[e];t.children.length>0&&u(t.children,t.x+c,t.y+s,t.w-2*c,t.h-s-c)}return l}var P=28,F=6,I=1.25;function L(e,t,n,r,i){let a=e.treemap?.[t];return typeof a==`number`&&a>=r?Math.min(a,i):n}function R(f,p,m){let h=m.fontSize??16,g=Math.round(h*.875),_=Math.round(h*.75),v=Math.round(h*.5625),y=m.measurer??S(m.fontFamily,m.fontFamilyMono),C=p.treemap??{},w=m.padding??L(p,`diagramPadding`,8,0,2e3),T=Math.round(u(m,L(p,`nodeWidth`,64,1,400)*10,200,2*w)),E=Math.round(L(p,`nodeHeight`,40,1,400)*10),D=C.showValues!==!1,O=A(typeof C.valueFormat==`string`?C.valueFormat:`,`),k=N(f.roots,T,E,{gap:L(p,`padding`,4,0,200),header:P,side:F}),j=c(f.title,!1,y,h,d(m),1),M=j.height>0?j.height+8:0,R=w+Math.max(0,(j.width-T)/2),z=w+M,B=``,V=``;for(let e of k){let o=e.node,c=s(o.cssCompiledStyles??[]),u=i(e.series),d=R+e.x,f=z+e.y,p=x(o.name).trim(),m=D?O(e.value):``,S=`data-id="${a(o.name)}">`,C=`<rect x="${l(d)}" y="${l(f)}" width="${l(e.w)}" height="${l(e.h)}" fill="${u}"`;if(o.children!==void 0){let i=``;if(e.h>=P){let n=e.w-2*F-4,r=m?y.width(m,_,0):0,a=r>0&&n-r-12>=3*g,o=b(p,a?n-r-12:n,g,g,y,1),s=f+P/2+1;o&&(i+=`<text x="${l(d+F+2)}" y="${l(s+g*.35)}" font-weight="var(--_hw)"${c.text}>${t(o.text)}</text>`),a&&(i+=`<text class="pele-value" x="${l(d+e.w-F-2)}" y="${l(s+_*.35)}" font-size="${_}" text-anchor="end" fill="var(--_m)"${c.text}>${t(m)}</text>`)}let a=/[";]fill:/.test(c.shape)?``:` fill-opacity="0.12"`;B+=`<g class="pele-node pele-section${n(o.classSelector??``)}" ${S}${C}${r(`${a} stroke="${u}"${c.shape}`)}/>${i}</g>`;continue}let w=``,T=e.w-8,E=Math.min(h,Math.floor((e.h-4)/I)),k=E>=v?b(p,T,E,v,y):void 0;if(k){let n=l(d+e.w/2),r=f+e.h/2,i=Math.max(v,Math.round(k.size*.8)),a=(k.size+i)*I;if(m&&a<=e.h-4&&y.width(m,i,0)<=T){let e=r-a/2+k.size*I/2,o=r+a/2-i*I/2;w=`<text x="${n}" y="${l(e+k.size*.35)}" font-size="${l(k.size)}"${c.text}>${t(k.text)}</text><text class="pele-value" x="${n}" y="${l(o+i*.35)}" font-size="${l(i)}"${c.text}>${t(m)}</text>`}else w=`<text x="${n}" y="${l(r+k.size*.35)}" font-size="${l(k.size)}"${c.text}>${t(k.text)}</text>`}V+=`<g class="pele-node pele-leaf${n(o.classSelector??``)}" ${S}${C}${r(c.shape)}/>${w}</g>`}let H=Math.ceil(Math.max(T,j.width)+2*w),U=Math.ceil(E+M+2*w),W=o(j,H/2,w+j.height/2,` class="pele-title" font-weight="var(--_tw)"`)+(B?`<g class="pele-sections" font-size="${g}">${B}</g>`:``)+(V?`<g class="pele-leaves" text-anchor="middle" fill="var(--_bg)">${V}</g>`:``);return{svg:e(`treemap`,H,U,h,m,f,W),width:H,height:U,links:[]}}var z={type:`treemap`,parse:(e,t,n)=>w(D(e),n),render:R};export{z as treemap};
@@ -0,0 +1,5 @@
1
+ import{_ as e,a as t,f as n,i as r,o as i,u as a,x as o}from"./E3FWOBN4-D5m5o2g0.js";import{i as s}from"./DKTLEL5E-DciMwFJ1.js";import{t as c}from"./RVARI57O-CgA1WoRv.js";import{PeleError as l,b as u,g as d,h as f,s as p,u as m,y as h}from"./lazy-DaMZI1F7.js";var g=class{type=`xychart`;title;accTitle;accDescr;orientation;xAxis={type:`band`,title:``,categories:[]};yAxis={type:`linear`,title:``,min:1/0,max:-1/0};hasSetXAxis=!1;hasSetYAxis=!1;plots=[];setOrientation(e){this.orientation=e===`horizontal`?`horizontal`:`vertical`}setXAxisTitle(e){this.xAxis.title=e.text.trim()}setXAxisRangeData(e,t){this.xAxis={type:`linear`,title:this.xAxis.title,min:e,max:t},this.hasSetXAxis=!0}setXAxisBand(e){this.xAxis={type:`band`,title:this.xAxis.title,categories:e.map(e=>e.text.trim())},this.hasSetXAxis=!0}setYAxisTitle(e){this.yAxis.title=e.text.trim()}setYAxisRangeData(e,t){this.yAxis={type:`linear`,title:this.yAxis.title,min:e,max:t},this.hasSetYAxis=!0}plotData(e){if(e.length===0)return[];this.hasSetXAxis||this.setXAxisRangeData(1,e.length);let t=this.xAxis;if(t.type===`band`&&e.length>t.categories.length&&(e=e.slice(0,t.categories.length)),!this.hasSetYAxis){let{min:t,max:n}=this.yAxis;for(let r of e)r<t&&(t=r),r>n&&(n=r);this.yAxis={type:`linear`,title:this.yAxis.title,min:t,max:n}}if(t.type===`band`)return t.categories.map((t,n)=>[t,e[n]]);if(e.length===1)return[[`${t.min}`,e[0]]];let n=(t.max-t.min)/(e.length-1);return e.map((e,r)=>[`${t.min+r*n}`,e])}addPlot(e,t,n){let r={type:e,title:t.text.trim(),data:this.plotData(n.map(e=>e.value))};e===`line`&&n.some(e=>e.label.trim()!==``)&&(r.pointLabels=n.map(e=>e.label.trim())),this.plots.push(r)}setLineData(e,t){this.addPlot(`line`,e,t)}setBarData(e,t){this.addPlot(`bar`,e,t)}setDiagramTitle(e){this.title=e}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,``)}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
2
+ `)}},_=`$end.INVALID.NEWLINE.title.acc_title.acc_title_value.acc_descr.acc_descr_value.acc_descr_multiline_value.XYCHART.CHART_ORIENTATION.X_AXIS.Y_AXIS.ARROW_DELIMITER.LINE.BAR.NUMBER_WITH_DECIMAL.SQUARE_BRACES_START.SQUARE_BRACES_END.STR.ALPHA.COLON.PLUS.COMMA.EQUALS.MULT.BRKT.UNDERSCORE.DOT.AMP.MINUS.NUM.SEMI.EOF`.split(`.`),v=[33,33,33,33,33,19,5,7,8],y="`)"+` `.repeat(36)+`{ this.pushstate(md_string); }
3
+ <md_string>(?:(?!\`").)+`+` `.repeat(18)+`{ return md_str; }
4
+ <md_string>(?:\``,b=new Uint8Array(128);for(let[e,t]of[[`:`,21],[`+`,22],[`,`,23],[`=`,24],[`*`,25],[`#`,26],[`_`,27],[`.`,28],[`&`,29],[`-`,30],[`;`,32]])b[e.charCodeAt(0)]=t;function x(e){let t=e.length,n=[],r=[],i=[],a=[],o=0,s=0,l=(t,a,o)=>{n.push(t),r.push(e.slice(a,o)),i.push(a),s=o},p=e=>{a.push(o),o=e},m=()=>{a.length>0&&(o=a.pop())},g=n=>{let r=e.indexOf(`
5
+ `,n);return r===-1?t:r},_=n=>{for(;n<t&&f(e.charCodeAt(n));)n++;return n},x=t=>{for(;h(e.charCodeAt(t));)t++;return t},S=t=>c(e,s,t)&&!d(e.charCodeAt(s+t.length));for(;s<t;){let n=e.charCodeAt(s);if(o===5){if(n===34)s++,m();else{let n=e.indexOf(`"`,s);l(19,s,n===-1?t:n)}continue}if(o===6||o===7){l(v[o],s,g(s)),m();continue}if(o===8){if(n===125)s++,m();else{let n=e.indexOf(`}`,s);l(8,s,n===-1?t:n)}continue}let r=e.charCodeAt(s+1);if(n===37&&r===37)s=g(s+2);else if(n===10||n===13){if((o===1||o===3)&&(n===10||r===10)){l(2,s,n===10?s+1:s+2),m();continue}let t=s+1;for(let n=e.charCodeAt(t);n===10||n===13;n=e.charCodeAt(++t));l(2,s,t)}else{switch(n|32){case 116:if(S(`title`)){l(3,s,s+5);continue}break;case 97:if(c(e,s,`acc`)){let t=c(e,s+3,`descr`);if(t||c(e,s+3,`title`)){let n=_(s+8),r=e.charCodeAt(n);if(r===58){l(t?6:4,s,_(n+1)),p(t?7:6);continue}if(r===123&&t){s=_(n+1),p(8);continue}}}break;case 120:if(S(`xychart-beta`)){l(9,s,s+12);continue}if(S(`xychart`)){l(9,s,s+7);continue}if(S(`x-axis`)){l(11,s,s+6),p(1);continue}break;case 121:if(S(`y-axis`)){l(12,s,s+6),p(1);continue}break;case 118:if(c(e,s,`vertical`)){l(10,s,s+8);continue}break;case 104:if(c(e,s,`horizontal`)){l(10,s,s+10);continue}break;case 108:if(S(`line`)){l(14,s,s+4),p(3);continue}break;case 98:if(S(`bar`)){l(15,s,s+3),p(3);continue}}if(n===91)o===1?p(2):o===3&&p(4),l(17,s,s+1);else if(n===93)(o===4||o===2)&&m(),l(18,s,s+1);else if(o===1&&n===45&&r===45&&e.charCodeAt(s+2)===62)l(13,s,s+3);else{if(o===1||o===4){let t=n===43||n===45?s+1:s,r=e.charCodeAt(t),i=-1;if(h(r)?(i=x(t+1),e.charCodeAt(i)===46&&h(e.charCodeAt(i+1))&&(i=x(i+2))):r===46&&h(e.charCodeAt(t+1))&&(i=x(t+2)),i!==-1){l(16,s,i);continue}}if(n===96&&c(e,s,y))s+=y.length,m();else if(n===34)s++,p(5);else if(u(n)){let t=s+1;for(;u(e.charCodeAt(t));)t++;l(20,s,t)}else if(h(n))l(31,s,x(s+1));else if(f(n))s=_(s+1);else if(n<128&&b[n]!==0)l(b[n],s,s+1);else break}}}return s<t?(n.push(1),r.push(``),i.push(s),{types:n,texts:r,starts:i}):(n.push(v[o]),r.push(``),i.push(t),n.push(0),r.push(``),i.push(t),{types:n,texts:r,starts:i})}function S(...e){let t=new Uint8Array(34);for(let n of e)t[n]=1;return t}var C=S(29,31,20,22,24,25,28,26,30,27),w=S(2,32,33);function T(e,t){let{types:n,texts:r,starts:i}=x(e),a=0,o=t=>{let r=n[a];throw r===1?p(`xychart`,e,i[a],``,!0):p(`xychart`,e,i[a],`Expecting ${t}, got '${_[r]}'`)},s=e=>(n[a]!==e&&o(`'${_[e]}'`),r[a++]),c=e=>e===19||C[e]===1,l=()=>{c(n[a])||o(`'STR', 'ALPHA', 'NUM'`);let e=r[a++];if(n[a-1]!==19)for(;C[n[a]]===1;)e+=r[a++];return{text:e,type:`text`}},u=()=>{let e=Number(s(16));return s(13),[e,Number(s(16))]},d=()=>{let e=[];for(s(17);;){let t=Number(s(16));if(e.push({value:t,label:n[a]===19?r[a++]:``}),n[a]!==23)break;a++}return s(18),e};for(;;)if(w[n[a]]===1)a++;else{if(n[a]!==9)break;n[++a]===10&&t.setOrientation(r[a++])}for(;n[a]!==0;){let e=n[a++];switch(e){case 3:t.setDiagramTitle(l().text.trim());break;case 11:case 12:{let r=c(n[a])?l():void 0;if(e===11&&n[a]===17){let e=[];do a++,e.push(l());while(n[a]===23);s(18),t.setXAxisBand(e)}else if(n[a]===16||r===void 0){let[n,r]=u();e===11?t.setXAxisRangeData(n,r):t.setYAxisRangeData(n,r)}e===11?t.setXAxisTitle(r??{type:`text`,text:``}):t.setYAxisTitle(r??{type:`text`,text:``});break}case 14:case 15:{let r=n[a]===17?{text:``,type:`text`}:l(),i=d();e===14?t.setLineData(r,i):t.setBarData(r,i);break}case 4:t.setAccTitle(s(5).trim());break;case 6:t.setAccDescription(s(7).trim());break;case 8:t.setAccDescription(r[a-1].trim());break;default:a--,o(`'title', 'X_AXIS', 'Y_AXIS', 'LINE', 'BAR', 'acc_title', 'acc_descr', 'acc_descr_multiline_value'`)}for(;w[n[a]]===1;)a++}}function ee(e,t){let n=e/Math.max(t,1),r=Math.floor(Math.log10(n)),i=n/10**r,a=i>=7.07?10:i>=3.16?5:i>=1.41?2:1;return r<0?-(10**-r)/a:a*10**r}function te(e,t){return e>0?t/e:t*-e}function E(e,t){return e>0?t*e:t/-e}function ne(e,t,n){let r=Math.round(te(n,e));E(n,r)<e&&r++;let i=Math.round(te(n,t));E(n,i)>t&&i--;let a=[];for(let e=r;e<=i&&a.length<100;e++)a.push(E(n,e));return a}var re=4,D=12,ie=26,ae=24,oe=1e300;function se(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:{}}function O(e,t,n=!0){let r=e[t];return typeof r==`boolean`?r:n}function ce(e,t){return typeof e==`number`&&e>0?Math.round(Math.min(Math.max(e,100),4e3)):t}function k(e){return typeof e==`number`&&isFinite(e)?Math.min(Math.max(e,-oe),oe):void 0}function le(e){let t=0;for(let n of e)t=Math.max(t,n.label.width);return t}function ue(e,n,r,a){let s=e.lines.length===1?e.lines[0]:void 0;return s&&s.length===1&&s[0].icon===void 0&&s[0].style===0?`<text x="${o(n)}" y="${o(r+e.size*.35)}" text-anchor="${a}">${t(s[0].text)}</text>`:i(e,n+(a===`start`?e.width/2:a===`end`?-e.width/2:0),r,``)}function de(t,c,u){if(t.plots.length===0)throw new l(`No Plot to render, please provide a plot with some data`,`semantic`,{type:`xychart`});let d=se(c.xyChart),f=u.fontSize??16,p=Math.round(f*.875),h=Math.round(f*.75),g=u.measurer??m(u.fontFamily,u.fontFamilyMono),_=u.padding??8,v=ce(d.width,700),y=s(u,v,240),b=Math.round(ce(d.height,500)*Math.max(.6,y/v)),x=(t.orientation??d.chartOrientation)===`horizontal`,S=O(d,`showDataLabel`,!1),C=t.xAxis,w=t.plots,T=(e,t,n)=>a(e,!1,g,t,n),oe=T(`0`,p,4e3).height,de=T(`0`,h,4e3).height,A=a(O(d,`showTitle`)?t.title:void 0,!1,g,f,y-2*_,1),fe=A.height>0?A.height+12:0,pe=[],me=0;O(d,`showLegend`)&&w.forEach((e,t)=>{if(e.title===``)return;let n=T(e.title,p,y*.3);pe.push({index:t,label:n}),me=Math.max(me,n.width+D+8)});let he=pe.length>0?me+ae:0,j=w.filter(e=>e.type===`bar`).length,M=k(t.yAxis.min)??1/0,N=k(t.yAxis.max)??-1/0,ge=t.hasSetYAxis&&isFinite(M)&&isFinite(N)&&M!==N;if(!ge){M=1/0,N=-1/0;for(let e of w)for(let[,t]of e.data){let e=k(t);e!==void 0&&(e<M&&(M=e),e>N&&(N=e))}M>N&&(M=N=0),j>0&&(M=Math.min(M,0),N=Math.max(N,0)),M===N&&(M===0?N=1:(M-=Math.abs(M)/2,N+=Math.abs(N)/2))}let _e=(e,t)=>{let n=ee(Math.abs(N-M),Math.max(2,Math.min(10,Math.floor(e/t))));return ge||(M=E(n,Math.floor(te(n,M)+1e-9)),N=E(n,Math.ceil(te(n,N)-1e-9))),ne(Math.min(M,N),Math.max(M,N),n).map(e=>({at:(e-M)/(N-M),label:T(String(e),p,4e3)}))},P=1;if(C.type===`band`)P=Math.max(C.categories.length,1);else for(let e of w)P=Math.max(P,e.data.length);let F=1/P,I=C.type===`band`||j>0?F/2:0,L=k(C.type===`linear`?C.min:void 0),R=k(C.type===`linear`?C.max:void 0),ve=L!==void 0&&R!==void 0&&L!==R,ye=(e,t)=>C.type===`band`?(e+.5)*F:I+(t>1?e/(t-1):ve?0:.5)*(1-2*I),be=se(d.xAxis),xe=se(d.yAxis),z=x?be:xe,B=x?xe:be,V=T(O(z,`showTitle`)?x?C.title:t.yAxis.title:void 0,p,b*.8),Se=T(O(B,`showTitle`)?x?t.yAxis.title:C.title:void 0,p,y*.8),Ce=O(z,`showTick`)?re:0,we=O(B,`showTick`)?re:0,Te=O(z,`showLabel`),Ee=O(B,`showLabel`),De=x?y*.3:Math.max(48,(y-2*_-64-he)*F-8),Oe=C.type===`band`&&O(be,`showLabel`)?C.categories.map(e=>T(e,p,De)):[],ke=0,Ae=0;for(let e of Oe)ke=Math.max(ke,e.width),Ae=Math.max(Ae,e.height);let je=e=>{let t=[];if(C.type===`band`){let n=Oe.length===0?8:x?Ae:ke+12,r=Math.max(1,Math.ceil(n/(e*F)));for(let e=0;e<C.categories.length;e+=r)t.push({at:(e+.5)*F,label:Oe[e]??T(void 0,p,0)})}else if(ve){let n=ee(Math.abs(R-L),Math.max(2,Math.min(10,Math.floor(e/(x?32:80)))));for(let e of ne(Math.min(L,R),Math.max(L,R),n))t.push({at:I+(e-L)/(R-L)*(1-2*I),label:T(String(e),p,4e3)})}else L!==void 0&&t.push({at:.5,label:T(String(L),p,4e3)});return t},H=0,Me=0;for(let e of w){for(let t of e.pointLabels??[])H=Math.max(H,g.width(t,h,0));if(S&&x&&e.type===`bar`)for(let[,t]of e.data)Me=Math.max(Me,g.width(String(k(t)??``),h,0))}let Ne=Ee?x||C.type!==`band`?oe:Ae:0,Pe=we+(Ne>0?Ne+4:0)+(Se.height>0?Se.height+4:0),Fe=x?0:H>0||S?de+4:Te?oe/2:0,U=_+fe+Fe,W=Math.max(1,b-_-Pe-U),G=U+W,Ie=x?je(W):_e(W,56),Le=Te?le(Ie):0,K=_+(V.height>0?V.height+6:0)+(Le>0?Le+6:0)+Ce,Re=Math.max(H>0?H+12:0,Me>0?Me+8:0),ze=x?Math.min(y*.25,Re):0,q=Math.max(1,y-_-K-he-ze),Be=x?_e(q,80):je(q);if(Ee&&he+ze===0){let e=0;for(let t of Be)e=Math.max(e,t.at*q+t.label.width/2-q);q=Math.max(1,q-e)}let Ve=K+q,J=(e,t)=>x?K+t*q:K+e*q,Y=(e,t)=>x?U+e*W:G-t*W,He=e=>(e-M)/(N-M),Ue=e=>Math.min(Math.max(e,0),1),We=e=>x?`M${o(J(0,e))},${o(U)}V${o(G)}`:`M${o(K)},${o(Y(0,e))}H${o(Ve)}`,Ge=``;for(let e of x?Be:Ie)Ge+=We(e.at);let X=``,Ke=``;O(z,`showAxisLine`)&&(X+=`M${o(K)},${o(U)}V${o(G)}`),O(B,`showAxisLine`)&&(X+=`M${o(K)},${o(G)}H${o(Ve)}`);for(let e of Ie){let t=x?U+e.at*W:G-e.at*W;Ce&&(X+=`M${o(K)},${o(t)}h${-Ce}`),Te&&(Ke+=ue(e.label,K-Ce-6,t,`end`))}for(let e of Be){let t=K+e.at*q;we&&(X+=`M${o(t)},${o(G)}v${we}`),Ee&&(Ke+=ue(e.label,t,G+we+4+e.label.height/2,`middle`))}let qe=(x?W:q)*F,Z=qe*.7/Math.max(j,1),Je=j>1?Math.min(2,Z*.2):0,Q=Ue(He(0));j>0&&Q>0&&Q<1&&(X+=We(Q));let Ye=``,Xe=``,Ze=``,Qe=``,$e=0;w.forEach((e,t)=>{let i=n(t),a=e.title?` data-id="${r(e.title)}"`:``,s=C.type===`band`?Math.min(e.data.length,P):e.data.length;if(e.type===`bar`){let t=($e++-(j-1)/2)*Z-(Z-Je)/2,n=``;for(let r=0;r<s;r++){let i=k(e.data[r][1]);if(i===void 0)continue;let a=ye(r,s),c=Ue(He(i)),l=Math.min(Q,c),u=Math.max(Q,c),d=x?J(a,l):J(a,0)+t,f=x?Y(a,0)+t:Y(a,u),p=x?(u-l)*q:Z-Je,m=x?Z-Je:(u-l)*W;if(n+=`<rect x="${o(d)}" y="${o(f)}" width="${o(p)}" height="${o(m)}"/>`,!S)continue;let _=String(i),v=g.width(_,h,0),y=c>=Q?1:-1,b=d+p/2,C=f+m/2,w=`middle`;if(x){if(m<h)continue;b=(y>0?d+p:d)+y*6,w=y>0?`start`:`end`}else{if(v+2>qe/j)continue;C=(y>0?f:f+m)-y*(de/2+2)}Ze+=`<text x="${o(b)}" y="${o(C+h*.35)}" text-anchor="${w}">${_}</text>`}Ye+=`<g class="pele-series pele-bars"${a} fill="${i}">${n}</g>`;return}let c=``,l=``,u=!1,d=0,f=NaN;for(let t=0;t<s;t++){let n=k(e.data[t][1]);if(n===void 0){f=NaN;continue}let r=ye(t,s),i=He(n),a=i>=0&&i<=1;if(f!==f)a&&(c+=`M${o(J(r,i))},${o(Y(r,i))}`),u=a;else{let e=i-f,t=0,n=1;if(e!==0){let r=-f/e,i=(1-f)/e;t=Math.max(t,Math.min(r,i)),n=Math.min(n,Math.max(r,i))}else a||(t=2);if(t<=n){let i=d+(r-d)*t,a=f+e*t,s=d+(r-d)*n,l=f+e*n;(!u||t>0)&&(c+=`M${o(J(i,a))},${o(Y(i,a))}`),c+=`L${o(J(s,l))},${o(Y(s,l))}`}u=a}if(d=r,f=i,!a)continue;let p=J(r,i),m=Y(r,i);qe>=12&&(l+=`<circle cx="${o(p)}" cy="${o(m)}" r="3"/>`);let g=T(e.pointLabels?.[t],h,4e3);if(g.height>0){let e=g.width/2;Qe+=x?ue(g,p+10,m,`start`):ue(g,Math.max(Math.min(p,Ve-e),K+e),m-6-g.height/2,`middle`)}}Xe+=`<g class="pele-series pele-line"${a} fill="${i}">`+(c?`<path d="${c}" fill="none" stroke="${i}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>`:``)+l+`</g>`});let $=``;V.height>0&&($+=`<g transform="translate(${o(_+V.height/2)},${o(U+W/2)}) rotate(-90)">${i(V,0,0,``)}</g>`),$+=i(Se,K+q/2,b-_-Se.height/2,``);let et=``,tt=0;for(let e of pe)tt+=Math.max(ie,e.label.height+6);let nt=U+Math.max(0,(W-tt)/2),rt=Ve+ze+ae;for(let{index:e,label:t}of pe){let a=Math.max(ie,t.height+6);if(nt+a>b)break;let s=nt+a/2,c=n(e);et+=`<g class="pele-legend-item" data-id="${r(w[e].title)}">`+(w[e].type===`bar`?`<rect x="${o(rt)}" y="${o(s-D/2)}" width="${D}" height="${D}" rx="2" fill="${c}"/>`:`<path d="M${o(rt)},${o(s)}h${D}" stroke="${c}" stroke-width="2" stroke-linecap="round"/>`)+i(t,rt+D+8+t.width/2,s,``)+`</g>`,nt+=a}let it=i(A,y/2,_+A.height/2,` class="pele-title" font-weight="var(--_tw)"`)+(Ge?`<path class="pele-grid" d="${Ge}" stroke="var(--_a)"/>`:``)+`<g class="pele-plot">${Ye}${Xe}</g>`+(X?`<path class="pele-axis" d="${X}" fill="none" stroke="var(--_b)"/>`:``)+(Ke?`<g class="pele-axis-labels" font-size="${p}" fill="var(--_m)">${Ke}</g>`:``)+($?`<g class="pele-axis-titles" font-size="${p}">${$}</g>`:``)+(Ze?`<g class="pele-data-labels" font-size="${h}">${Ze}</g>`:``)+(Qe?`<g class="pele-point-labels" font-size="${h}">${Qe}</g>`:``)+(et?`<g class="pele-legend" font-size="${p}">${et}</g>`:``);return{svg:e(`xychart`,y,b,f,u,t,it),width:y,height:b,links:[]}}var A={type:`xychart`,section:`xyChart`,parse(e,t,n){let r=new g;return r.title=n,T(e,r),r},render:de};export{A as xychart};
@@ -0,0 +1,4 @@
1
+ import{_ as e,a as t,b as n,d as r,i,o as a,r as o,s,u as c,v as l,x as u}from"./E3FWOBN4-D5m5o2g0.js";import{a as d,o as f,t as p}from"./DKTLEL5E-DciMwFJ1.js";import{a as m,i as h,l as g,s as _}from"./CUVCMPQX-JTGMOfG2.js";import{n as v}from"./E65FQMJL-Bg5F0Zo8.js";import{n as y}from"./A255FCTW-woaH7Mj_.js";import{o as b,t as ee}from"./SPBWZ4VS-EqfCsJ5V.js";import{t as x}from"./G3MDBVQH-BZmnMkFw.js";import{t as S}from"./7WLXJQOR-D6QVYUu9.js";import{i as te,n as ne,r as re,t as ie}from"./DHKBVIA3-CVnlqiEq.js";import{i as ae,n as oe,r as se,t as C}from"./3JIRLDUO-C1CwW1Ha.js";import{_ as w,d as T,g as E,h as D,s as O,u as ce}from"./lazy-DaMZI1F7.js";function k(e){return e===`#`||e===`+`||e===`~`||e===`-`}var A=class{id=``;memberType;visibility=``;classifier=``;parameters=``;returnType=``;constructor(e,t){this.memberType=t,t===`method`&&this.parseMethod(e)||this.parseAttribute(e),this.id=this.id.startsWith(` `)?` `+this.id.trim():this.id.trim()}parseMethod(e){let t=e.length;for(let n=0;n<t;){let r=n;for(;r<t&&!w(e.charCodeAt(r));)r++;let i=r-1;for(;i>n&&e.charCodeAt(i)!==41;)i--;let a=i-1;for(;a>n&&e.charCodeAt(a)!==40;)a--;if(a>n){let r=e[n],o=k(r)&&a>n+1;o&&(this.visibility=r),this.id=e.slice(o?n+1:n,a),this.parameters=e.slice(a+1,i).trim();let s=i+1,c=``;if(s<t){let t=e[s];(t===`$`||t===`*`||t.trim()===``)&&(c=t.trim(),s++)}let l=s;for(;l<t&&!w(e.charCodeAt(l));)l++;if(this.returnType=e.slice(s,l).trim(),c===``){let e=this.returnType.slice(-1);(e===`$`||e===`*`)&&(c=e,this.returnType=this.returnType.slice(0,-1))}return this.classifier=c,!0}n=r+1}return this.memberType=`attribute`,!1}parseAttribute(e){let t=e.slice(0,1),n=e.slice(-1);k(t)&&(this.visibility=t),(n===`$`||n===`*`)&&(this.classifier=n),this.id=e.substring(this.visibility===``?0:1,this.classifier===``?e.length:e.length-1)}getDisplayDetails(){let e=this.visibility+x(this.id);return this.memberType===`method`&&(e+=`(${x(this.parameters.trim())})`,this.returnType&&(e+=` : `+x(this.returnType))),{displayText:e.trim(),cssStyle:this.parseClassifier()}}parseClassifier(){return this.classifier===`*`?`font-style:italic;`:this.classifier===`$`?`text-decoration:underline;`:``}},j={LINE:0,DOTTED_LINE:1},M={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},N=`classId-`;function P(e){let t=e.indexOf(`~`);if(t<=0)return{className:e,type:``};let n=e.indexOf(`~`,t+1);return{className:e.slice(0,t),type:e.slice(t+1,n===-1?e.length:n)}}function le(e){let t=e.charCodeAt(0);return P(t>=48&&t<=57?N+e:e).className}var F=class{type=`class`;lineType=j;relationType=M;direction=`TB`;classes=new Map;relations=[];notes=new Map;namespaces=new Map;interfaces=[];styleClasses=new Map;title;accTitle;accDescr;namespaceStack=[];withCssClass=new Map;addClass(e){let{className:t,type:n}=P(e);if(this.classes.has(t))return;let r={id:t,type:n,label:t,cssClasses:`default`,methods:[],members:[],annotations:[],styles:[]};this.classes.set(t,r),this.tag(r,`default`)}tag(e,t){let n=this.withCssClass.get(t);n?n.add(e):this.withCssClass.set(t,new Set([e]))}ensure(e){return this.addClass(e),this.classes.get(P(e).className)}setClassLabel(e,t){this.ensure(e).label=t}addRelation(e){let{type1:t,type2:n}=e.relation;t===M.LOLLIPOP&&n===`none`?(this.addClass(e.id2),e.id1=this.addInterface(e.id1,e.id2)):n===M.LOLLIPOP&&t===`none`?(this.addClass(e.id1),e.id2=this.addInterface(e.id2,e.id1)):(this.addClass(e.id1),this.addClass(e.id2)),e.id1=P(e.id1).className,e.id2=P(e.id2).className,e.relationTitle1=e.relationTitle1.trim(),e.relationTitle2=e.relationTitle2.trim(),this.relations.push(e)}addInterface(e,t){let n=`interface${this.interfaces.length}`;return this.interfaces.push({id:n,label:e,classId:t}),n}addAnnotation(e,t){this.ensure(e).annotations.push(t)}addMember(e,t){let n=this.ensure(e);if(typeof t!=`string`)return;let r=t.trim();if(r.startsWith(`<<`)&&r.endsWith(`>>`))n.annotations.push(r.substring(2,r.length-2));else if(r.indexOf(`)`)>0){let e=new A(r,`method`);(e.memberType===`method`?n.methods:n.members).push(e)}else r&&n.members.push(new A(r,`attribute`))}addMembers(e,t){if(Array.isArray(t)){t.reverse();for(let n of t)this.addMember(e,n)}}addNote(e,t){let n=this.notes.size,r=`note${n}`;return this.notes.set(r,{id:r,class:t,text:e,index:n}),r}cleanupLabel(e){return(e.startsWith(`:`)?e.substring(1):e).trim()}setCssClass(e,t){for(let n of e.split(`,`)){let e=this.classes.get(le(n));if(e!==void 0){e.cssClasses+=` `+t;for(let n of t.split(` `))this.tag(e,n)}}}defineClass(e,t){for(let n of e){let e=this.styleClasses.get(n);if(e===void 0&&(e={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,e)),!t)continue;for(let n of t)n.includes(`color`)&&e.textStyles.push(n.replace(`fill`,`bgFill`)),e.styles.push(n);let r=this.withCssClass.get(n);if(r===void 0)continue;let i=t.flatMap(e=>e.split(`,`));for(let e of r)for(let t of i)e.styles.push(t)}}setTooltip(e,t){if(t!==void 0)for(let n of e.split(`,`)){let e=this.classes.get(P(n).className);e&&(e.tooltip=t)}}setLink(e,t,n){let r=T(t).trim();for(let t of e.split(`,`)){let e=this.classes.get(le(t));e&&(e.link=r?b(r):void 0,e.linkTarget=typeof n==`string`?n:`_blank`)}this.setCssClass(e,`clickable`)}setClickEvent(e,t,n){for(let t of e.split(`,`)){let e=this.classes.get(P(t).className);e&&(e.haveCallback=!0)}this.setCssClass(e,`clickable`)}setDirection(e){this.direction=e}setAccTitle(e){this.accTitle=e.replace(/^\s+/g,``)}setAccDescription(e){this.accDescr=e.replace(/\n\s+/g,`
2
+ `)}addNamespace(e,t){let n=this.namespaceStack[this.namespaceStack.length-1],r=n?`${n}.${e}`:e;this.namespaceStack.push(r);let i=this.namespaces.get(r);if(i)return i.explicit=!0,t&&(i.label=t),r;let a=n||void 0,o=n?n.length+1:0;for(;;){let e=r.indexOf(`.`,o),n=e===-1,i=n?r:r.slice(0,e),s=this.namespaces.get(i);if(s===void 0){let c=r.slice(o,n?r.length:e);s={id:i,label:n&&t?t:c,classes:new Map,notes:new Map,children:new Map,parent:a,explicit:n},this.namespaces.set(i,s)}else n&&(s.explicit=!0);let c=a?this.namespaces.get(a):void 0;if(c&&(c.children.has(i)||c.children.set(i,s),s.parent??=a),n)return r;a=i,o=e+1}}popNamespace(){this.namespaceStack.pop()}addClassesToNamespace(e,t,n){let r=this.namespaces.get(e);if(r!==void 0){for(let n of t){let{className:t}=P(n),i=this.classes.get(t);i!==void 0&&(i.parent=e,r.classes.set(t,i))}for(let t of n){let n=this.notes.get(t);n!==void 0&&(n.parent=e,r.notes.set(t,n))}}}setCssStyle(e,t){let n=this.classes.get(e);if(t&&n)for(let e of t)for(let t of e.split(`,`))n.styles.push(t)}},ue=`$end.INVALID.CLASS_DIAGRAM.NEWLINE.EOF.SQS.STR.SQE.DOT.GENERICTYPE.LABEL.acc_title.acc_title_value.acc_descr.acc_descr_value.acc_descr_multiline_value.STRUCT_START.STRUCT_STOP.NAMESPACE.STYLE_SEPARATOR.ANNOTATION_START.ANNOTATION_END.CLASS.MEMBER.NOTE_FOR.NOTE.CLASSDEF.ALPHA.COMMA.direction_tb.direction_bt.direction_rl.direction_lr.AGGREGATION.EXTENSION.COMPOSITION.DEPENDENCY.LOLLIPOP.LINE.DOTTED_LINE.CALLBACK.LINK.LINK_TARGET.CLICK.CALLBACK_NAME.CALLBACK_ARGS.HREF.STYLE.CSSCLASS.COLON.BRKT.PCT.MINUS.UNICODE_TEXT.BQUOTE_STR.EDGE_STATE.EOF_IN_STRUCT.OPEN_IN_STRUCT.PLUS.EQUALS.PUNCTUATION`.split(`.`),de=[4,6,4,9,44,45,12,14,15,4,56,4,56],fe=[/.*direction\s+TB[^\n]*/y,/.*direction\s+BT[^\n]*/y,/.*direction\s+RL[^\n]*/y,/.*direction\s+LR[^\n]*/y],I=/[\n\r\u2028\u2029]/g;function L(e){let t=e.length,n=[],r=[],i=[],a=[],o=0,s=0,c=e.indexOf(`direction`),l=-1,u=0,d=(t,a,o)=>(n.push(t),r.push(e.slice(a,o)),i.push(a),s=o,!0),f=e=>{a.push(o),o=e},p=()=>{a.length>0&&(o=a.pop())},m=t=>e.startsWith(t,s)&&!E(e.charCodeAt(s+t.length)),h=n=>{for(;n<t&&D(e.charCodeAt(n));)n++;return n},g=n=>{let r=e.indexOf(n,s);return r===-1?t:r},_=n=>{let r=s,i=-1;for(let n=e.charCodeAt(r);r<t&&D(n);n=e.charCodeAt(++r))n===10&&(i=r);i<0?s=r:(n&&p(),d(3,s,i+1))},v=t=>{switch(t){case 99:if(m(`cssClass`))return d(48,s,s+8);if(m(`callback`))return d(40,s,s+8);if(m(`click`))return d(43,s,s+5);break;case 108:if(m(`link`))return d(41,s,s+4);break;case 110:if(m(`note for`))return d(24,s,s+8);if(m(`note`))return d(25,s,s+4);break;case 60:if(e.charCodeAt(s+1)===60)return d(20,s,s+2);break;case 62:if(e.charCodeAt(s+1)===62)return d(21,s,s+2);break;case 104:if(m(`href`))return d(46,s,s+4)}return!1},y=n=>{if(v(n))return!0;let r=e.charCodeAt(s+1);switch(n){case 34:return f(1),s++,!0;case 126:return f(3),s++,!0;case 96:return f(2),s++,!0;case 95:if(m(`_self`))return d(42,s,s+5);if(m(`_blank`))return d(42,s,s+6);if(m(`_parent`))return d(42,s,s+7);if(m(`_top`))return d(42,s,s+4);break;case 60:return r===124?d(34,s,s+2):d(36,s,s+1);case 124:return r===62&&d(34,s,s+2);case 62:return d(36,s,s+1);case 42:return d(35,s,s+1);case 111:if(!E(r))return d(33,s,s+1);break;case 40:return r===41&&d(37,s,s+2);case 45:return r===45?d(38,s,s+2):d(52,s,s+1);case 46:return r===46?d(39,s,s+2):d(8,s,s+1);case 58:{let n=s+1;for(;n<t;){let t=e.charCodeAt(n);if(t===58||t===10||t===59)break;n++}return n>s+1?d(10,s,n):r===58&&e.charCodeAt(s+2)===58&&d(19,s,s+3)}case 43:return d(58,s,s+1);case 37:return d(51,s,s+1);case 61:return d(59,s,s+1);case 91:return d(5,s,s+1);case 93:return d(7,s,s+1);case 33:case 35:case 36:case 38:case 39:case 44:case 63:case 92:case 47:return d(60,s,s+1)}if(E(n)){let t=s+1;for(;E(e.charCodeAt(t));)t++;return d(27,s,t)}return S(n)&&d(53,s,s+1)},b=()=>{if(c===-1||s<u||(c<s&&(c=e.indexOf(`direction`,s)),c===-1)||(l<s&&(I.lastIndex=s,l=I.test(e)?I.lastIndex-1:t),c>=l))return!1;for(let t=0;t<4;t++){let n=fe[t];if(n.lastIndex=s,n.test(e))return d(29+t,s,n.lastIndex)}return u=l,!1},ee=n=>{if(b())return!0;if(D(n))return _(!1),!0;switch(n){case 37:if(e.charCodeAt(s+1)===37){let n=g(`
3
+ `);for(;n<t&&(e.charCodeAt(n)===10||e.charCodeAt(n)===13);)n++;return s=n,!0}break;case 97:{let t=e.startsWith(`accTitle`,s);if(!t&&!e.startsWith(`accDescr`,s))break;let n=h(s+8),r=e.charCodeAt(n);if(r===58)return d(t?11:13,s,h(n+1)),f(t?6:7),!0;if(r===123&&!t)return s=h(n+1),f(8),!0;break}case 99:if(m(`classDiagram-v2`))return d(2,s,s+15);if(m(`classDiagram`))return d(2,s,s+12);if(e.startsWith(`call`,s)&&D(e.charCodeAt(s+4)))return s=h(s+4),f(4),!0;if(m(`classDef`))return d(26,s,s+8);if(m(`class`))return f(9),d(22,s,s+5);break;case 91:if(e.startsWith(`*]`,s+1))return d(55,s,s+3);break;case 115:if(m(`style`))return d(47,s,s+5);break;case 110:if(m(`namespace`))return f(11),d(18,s,s+9);break;case 44:return d(28,s,s+1);case 35:return d(50,s,s+1)}return y(n)||n===58&&d(49,s,s+1)};for(;;){if(s>=t){n.push(de[o]),r.push(``),i.push(t);break}let a=e.charCodeAt(s),c=!0;switch(o){case 0:c=ee(a);break;case 9:D(a)?_(!0):a===125?(p(),p(),d(17,s,s+1)):a===123?(f(10),d(16,s,s+1)):c=y(a);break;case 10:if(a===34)f(1),s++;else if(a===125)p(),d(17,s,s+1);else if(a===91&&e.startsWith(`*]`,s+1))d(55,s,s+3);else if(a===123)d(57,s,s+1);else if(a===10)s++;else{let n=s+1;for(;n<t;){let t=e.charCodeAt(n);if(t===123||t===125||t===10)break;n++}d(23,s,n)}break;case 11:D(a)?_(!0):a===123?(f(12),d(16,s,s+1)):a===125?p():a===110&&m(`namespace`)?(f(11),d(18,s,s+9)):c=y(a);break;case 12:D(a)?_(!1):a===125?(p(),d(17,s,s+1)):a===110&&m(`namespace`)?(f(11),d(18,s,s+9)):a===91&&e.startsWith(`*]`,s+1)?d(55,s,s+3):a===99&&m(`class`)?(f(9),d(22,s,s+5)):c=y(a);break;case 1:a===34?(p(),s++):d(6,s,g(`"`));break;case 3:if(a===34)f(1),s++;else{if(v(a))break;a===126?(p(),s++):d(9,s,g(`~`))}break;case 2:if(a===34)f(1),s++;else{if(v(a))break;a===126?(f(3),s++):a===96?(p(),s++):d(54,s,g("`"))}break;case 4:if(a===40){let t=h(s+1);p(),e.charCodeAt(t)===41?s=t+1:(f(5),s++)}else d(44,s,g(`(`));break;case 5:a===41?(p(),s++):d(45,s,g(`)`));break;case 6:case 7:d(o===6?12:14,s,g(`
4
+ `)),p();break;case 8:a===125?(p(),s++):d(15,s,g(`}`))}if(!c)return n.push(1),r.push(``),i.push(s),{types:n,texts:r,starts:i}}return n.push(0),r.push(``),i.push(t),{types:n,texts:r,starts:i}}var R=61,z=new Uint8Array(R);for(let e of[53,27,52])z[e]=1;var pe=new Uint8Array(R);for(let e of[27,49,50,47,51,10])pe[e]=1;var B=new Uint8Array(R);B[33]=1,B[34]=2,B[35]=3,B[36]=4,B[37]=5;var V=`'UNICODE_TEXT', 'NUM', 'ALPHA', 'MINUS', 'BQUOTE_STR'`;function me(e,t){let{types:n,texts:r,starts:i}=L(e),a=0,o=t=>{let r=n[a];throw r===1?O(`class`,e,i[a],``,!0):O(`class`,e,i[a],`Expecting ${t}, got '${ue[r]}'`)},s=e=>(n[a]!==e&&o(`'${ue[e]}'`),r[a++]),c=()=>(z[n[a]]===0&&o(`'UNICODE_TEXT', 'NUM', 'ALPHA', 'MINUS'`),r[a++]),l=e=>{let t=``;for(;;){if(n[a]===54){t+=r[a++];break}z[n[a]]===0&&o(V),t+=r[a++];let e=n[a];if(e===8)t+=`.`,a++;else if(z[e]===0&&e!==54)break}return e&&n[a]===9&&(t+=`~`+r[a++]+`~`),t},u=()=>{a++;let e=s(6);return s(7),e},d=()=>{n[a]!==23&&o(`'STRUCT_STOP', 'MEMBER'`);let e=[];for(;n[a]===23;)e.push(r[a++]);return s(17),e.reverse()},f=()=>{a++;let e=l(!0);switch(t.addClass(e),n[a]===5&&t.setClassLabel(e,u()),n[a]){case 19:{a++;let r=c();t.setCssClass(e,r),n[a]===16&&(a++,t.addMembers(e,d()));break}case 16:a++,n[a]===17?a++:t.addMembers(e,d());break;case 20:{a++;let r=c();s(21),t.addAnnotation(e,r),n[a]===16&&(a++,n[a]===17?a++:t.addMembers(e,d()));break}}return e},p=()=>{if(n[a++]===25)return t.addNote(s(6));let e=l(!0);return t.addNote(s(6),e)},m=()=>{let e=[];for(;;){a++;let r=l(!1),i=n[a]===5?t.addNamespace(r,u()):t.addNamespace(r);s(16),n[a]===3&&a++,e.push({id:i,classes:[],notes:[]});let c=!0;for(;c;){let r=e[e.length-1],i=n[a];if(i===18)break;for(i===22?r.classes.push(f()):i===25||i===24?r.notes.push(p()):o(`'NAMESPACE', 'CLASS', 'NOTE_FOR', 'NOTE'`);;){if(n[a]===3){let e=n[a+1];if(e===18||e===22||e===25||e===24){a++;break}a++}s(17);let r=e.pop();if(t.addClassesToNamespace(r.id,r.classes,r.notes),t.popNamespace(),e.length===0){c=!1;break}}}if(e.length===0)return}},h=()=>{let e=B[n[a]];return e===0?`none`:(a++,e-1)},g=()=>{let e=l(!0),i=n[a];if(i===10){t.addMember(e,t.cleanupLabel(r[a++]));return}let s=`none`;if(i===6)s=r[a++],i=n[a];else if(B[i]===0&&i!==38&&i!==39)return;let c=h();i=n[a],i!==38&&i!==39&&o(`'AGGREGATION', 'EXTENSION', 'COMPOSITION', 'DEPENDENCY', 'LOLLIPOP', 'LINE', 'DOTTED_LINE'`),a++;let u=h(),d=n[a]===6?r[a++]:`none`,f={id1:e,id2:l(!0),relation:{type1:c,type2:u,lineType:i===38?0:1},relationTitle1:s,relationTitle2:d};n[a]===10&&(f.title=t.cleanupLabel(r[a++])),t.addRelation(f)},_=()=>{let e=[];for(;;){pe[n[a]]===0&&o(`'ALPHA', 'NUM', 'COLON', 'UNIT', 'SPACE', 'BRKT', 'STYLE', 'PCT', 'LABEL'`);let t=r[a++];for(;pe[n[a]]===1;)t+=r[a++];if(e.push(t),n[a]!==28)return e;a++}},v=e=>{n[a]===6&&t.setTooltip(e,r[a++])},y=e=>{let i=s(6),o=n[a]===6?r[a++]:void 0;n[a]===42?t.setLink(e,i,r[a++]):t.setLink(e,i),o!==void 0&&t.setTooltip(e,o)},b=()=>{let e=n[a];switch(e){case 53:case 27:case 52:case 54:g();return;case 18:m();return;case 22:f();return;case 23:a++;return;case 20:{a++;let e=c();s(21),t.addAnnotation(l(!0),e);return}case 40:{a++;let e=l(!0);t.setClickEvent(e,s(6)),v(e);return}case 41:a++,y(l(!0));return;case 43:{a++;let e=l(!0);if(n[a]===46){a++,y(e);return}let i=s(44);n[a]===45?t.setClickEvent(e,i,r[a++]):t.setClickEvent(e,i),v(e);return}case 47:{a++;let e=s(27);t.setCssStyle(e,_());return}case 48:{a++;let e=s(6);t.setCssClass(e,s(27));return}case 25:case 24:p();return;case 26:{a++;let e=[s(27)];for(;n[a]===28;)a++,e.push(s(27));t.defineClass(e,_());return}case 29:case 30:case 31:case 32:a++,t.setDirection(e===29?`TB`:e===30?`BT`:e===31?`RL`:`LR`);return;case 11:a++,t.setAccTitle(s(12).trim());return;case 13:a++,t.setAccDescription(s(14).trim());return;case 15:t.setAccDescription(r[a++].trim());return}o(`'acc_title', 'acc_descr', 'acc_descr_multiline_value', 'NAMESPACE', 'ANNOTATION_START', 'CLASS', 'MEMBER', 'NOTE_FOR', 'NOTE', 'CLASSDEF', 'direction_tb', 'CALLBACK', 'LINK', 'CLICK', 'STYLE', 'CSSCLASS', 'ALPHA', 'MINUS', 'BQUOTE_STR'`)},ee=n[a]===2;for(ee&&(a++,s(3));b(),!(n[a]!==3||(a++,n[a]===4||n[a]===0)););ee&&s(4),s(0)}function he(e,t,n,r){let i=Int32Array.from(e,(e,t)=>t),a=e=>{for(;i[e]!==e;)i[e]=i[i[e]],e=i[e];return e},o=(e,t)=>{i[a(e)]=a(t)};for(let t=0;t<e.length;t++)e[t].parent>=0&&o(t,e[t].parent);for(let e of t)o(e.src,e.dst);let s=new Map,c=(e,t,n,r=0,i=0)=>{e.left=Math.min(e.left,t-r/2),e.top=Math.min(e.top,n-i/2),e.right=Math.max(e.right,t+r/2),e.bottom=Math.max(e.bottom,n+i/2)};for(let t=0;t<e.length;t++){let n=a(t),r=s.get(n);r||(r={nodes:[],edges:[],left:1/0,top:1/0,right:-1/0,bottom:-1/0},s.set(n,r));let i=e[t];r.nodes.push(i),c(r,i.x,i.y,i.w,i.h)}if(s.size<2)return;for(let e of t){let t=s.get(a(e.src));t.edges.push(e);for(let n=0;n<e.route.length;n+=3)c(t,e.route[n],e.route[n+1]);e.labelW>0&&c(t,e.labelX,e.labelY,e.labelW,e.labelH)}let l=0,u=0,d=0,f=0,p=1/0,m=-1/0,h=[];for(let e of s.values()){let t=e.right-e.left,i=e.bottom-e.top;l>0&&l+t>n&&(u+=d+r,l=0,d=0),h.push(l-e.left,u-e.top),p=Math.min(p,e.left),m=Math.max(m,e.right),f=Math.max(f,l+t),d=Math.max(d,i),l+=t+r}if(f>=m-p)return;let g=0;for(let e of s.values())oe(e.nodes,e.edges,h[g++],h[g++]);return{width:f,height:u+d}}var H=[`aggregation`,`extension`,`composition`,`dependency`,`lollipop`];function U(e){return typeof e==`number`&&H[e]||`none`}function ge(e,t=!0){let n=[],r=[],i=new Map,a=new Map,o=new Map,s=new Map,c=n=>{if(t||n===void 0)return n;let r=[],i=n,a;for(;i;){if(s.has(i)){a=s.get(i);break}let t=e.namespaces.get(i);if(t===void 0)break;if(t.explicit){a=i;break}r.push(i),i=t.parent}for(let e of r)s.set(e,a);return a},l=e=>e===void 0?-1:i.get(e)??-1;for(let r of e.namespaces.values())!t&&!r.explicit||(i.set(r.id,n.length),n.push({id:r.id,label:t?r.label:r.id,isGroup:!0,shape:`rect`,parentId:t?r.parent:void 0,parent:-1}));for(let e of n)e.parent=l(e.parentId);let u=0;for(let t of e.classes.values()){let e=c(t.parent);a.set(t.id,n.length),n.push({id:t.id,label:t.label,isGroup:!1,shape:`classBox`,parentId:e,parent:l(e),classNode:t,colorIndex:u++})}for(let t of e.notes.values()){let e=c(t.parent),i=t.class===void 0?void 0:a.get(t.class);i!==void 0&&r.push({id:`edgeNote${t.index}`,start:t.id,end:n[i].id,source:n.length,target:i,label:void 0,arrowTypeStart:`none`,arrowTypeEnd:`none`,startLabelRight:``,endLabelLeft:``,pattern:`dotted`,classes:`relation`}),n.push({id:t.id,label:t.text,isGroup:!1,shape:`note`,parentId:e,parent:l(e)})}for(let t of e.interfaces){let e=a.get(t.classId);o.set(t.id,n.length),n.push({id:t.id,label:t.label,isGroup:!1,shape:`interface`,parentId:void 0,parent:e===void 0?-1:n[e].parent})}let d=0;for(let t of e.relations){d++;let{type1:e,type2:n}=t.relation,i=e===M.LOLLIPOP&&n===`none`?o:a,s=i===a&&n===M.LOLLIPOP&&e===`none`?o:a;r.push({id:`id_${t.id1}_${t.id2}_${d}`,start:t.id1,end:t.id2,source:i.get(t.id1)??-1,target:s.get(t.id2)??-1,label:t.title,arrowTypeStart:U(e),arrowTypeEnd:U(n),startLabelRight:t.relationTitle1===`none`?``:t.relationTitle1,endLabelLeft:t.relationTitle2===`none`?``:t.relationTitle2,pattern:t.relation.lineType===1?`dashed`:`solid`,classes:`relation`})}return{nodes:n,edges:r}}var W=12,G=16,K=6,q=5;function _e(e){switch(e){case`extension`:return W;case`composition`:case`aggregation`:return G;case`lollipop`:return 2*q;case`dependency`:return m(`arrow_point`)}return 0}function ve(e,t,n,r,i,a){let o=-i,s=r;switch(e){case`extension`:{let e=t-r*W,a=n-i*W;return`<path class="pele-marker" d="M${u(t)},${u(n)}L${u(e+o*K)},${u(a+s*K)}L${u(e-o*K)},${u(a-s*K)}Z" stroke-linejoin="round"/>`}case`composition`:case`aggregation`:{let c=t-r*G/2,l=n-i*G/2,d=K-1;return`<path class="pele-marker" d="M${u(t)},${u(n)}L${u(c+o*d)},${u(l+s*d)}L${u(t-r*G)},${u(n-i*G)}L${u(c-o*d)},${u(l-s*d)}Z" stroke-linejoin="round"${e===`composition`?` fill="${a}"`:``}/>`}case`lollipop`:return`<circle class="pele-marker" cx="${u(t-r*q)}" cy="${u(n-i*q)}" r="${q}"/>`;case`dependency`:return _(`arrow_point`,t,n,r,i,a)}return``}var ye=40,be=16,xe=56,J=20,Se=26,Ce=12,we=8,Te=6,Ee=10,De=64,Oe=8,ke=`var(--_l)`,Ae=new Set([`_self`,`_blank`,`_parent`,`_top`]);function je(e,t,n){let r=e[t];return typeof r==`number`&&r>0?Math.min(r,2e3):n}var Me=[],Ne=[];function Pe(e,t,n){let r=T(e.getDisplayDetails().displayText).trim();return{text:r,width:t.width(r,n,e.classifier===`*`?2:0),classifier:e.classifier}}function Fe(e,t,n){let r=r=>f(n,i=>Ie(e,t,n,r,i));return d(e.direction)?p(n,r):r(!1)}function Ie(d,f,p,m,_){let b=f.class??{},S=ge(d,b.hierarchicalNamespaces!==!1),oe=b.hideEmptyMembersBox===!0,w=p.fontSize??16,E=Math.round(w*.875),D=Math.round(w*.8),O=Math.round(D*1.4),k=p.measurer??ce(p.fontFamily,p.fontFamilyMono),A=p.padding??8,j=(e,t)=>{if(!e.includes(`$$`))return;let n=c(e,!1,k,t,4e3);return n.lines.some(l)?n:void 0},M=e=>e?j(e,D)?.width??k.width(T(e),D,0):0,N=m?`TB`:se(d.direction),P=new Map,le=new Map,F=new Map,ue=e=>{let t=P.get(e);if(t===void 0){let n=s([e]);t=n.shape===``&&n.text===``?``:e.slice(0,e.indexOf(`:`)).trim().toLowerCase(),P.set(e,t)}t!==``&&F.set(t,e)},de=e=>{F.clear();let t=le.get(e.cssClasses);if(t===void 0){for(let t of e.cssClasses.split(` `)){let e=d.styleClasses.get(t);if(e)for(let t of e.styles)for(let e of t.split(`,`))ue(e)}t=[...F],le.set(e.cssClasses,t)}else for(let[e,n]of t)F.set(e,n);for(let t of e.styles)ue(t);return s(F.size===0?Ne:[...F.values()])},fe=new Int32Array(S.nodes.length);for(let e of S.nodes)e.parent>=0&&fe[e.parent]++;let I=new Uint8Array(S.nodes.length);for(let e of S.edges){if(e.source<0||e.target<0)continue;let t=S.nodes[e.source].parent,n=S.nodes[e.target].parent;if(t!==n){for(let e=t;e>=0&&I[e]===0;e=S.nodes[e].parent)I[e]=1;for(let e=n;e>=0&&I[e]===0;e=S.nodes[e].parent)I[e]=1}}let L=[],R=[];S.nodes.forEach((e,t)=>{let n,r;if(e.isGroup){let i=c(e.label,!1,k,w,4e3);n=z(e,i,0,0,w),fe[t]>0?(r=C(0,0),r.isGroup=!0,r.padX=J,r.padTop=i.height>0?i.height+16:J,r.padBottom=J,r.minW=i.width+2*J-12+(I[t]===1&&!_?Math.min(i.width+24,240):0)):(n.w=Math.max(i.width+2*J,80),n.h=i.height+2*J,r=C(n.w,n.h))}else if(e.classNode)n=pe(e,e.classNode),r=C(n.w,n.h);else if(e.shape===`note`){let t=c(e.label,!0,k,E,260);n=z(e,t,Math.max(t.width+2*Ce,40),t.height+2*we,E),r=C(n.w,n.h)}else{let t=c(e.label,!1,k,E,200);n=z(e,t,Math.max(t.width,12)+4,Math.max(t.height,12),E),r=C(n.w,n.h)}r.parent=e.parent,r.seq=t,L.push(n),R.push(r)});function z(e,t,n,r,i){return{node:e,style:s(Ne),label:t,w:n,h:r,loops:0,annotations:Ne,attributes:Me,methods:Me,titleH:0,attributesH:0,fontSize:i}}function pe(e,t){let n=de(t),r=n.fontSize??w,i=Math.round(r*.875),a=Math.round(i*1.5),o=t.type?`&lt;`+x(t.type).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)+`&gt;`:``,s=c(t.label+o,!1,k,r,4e3,1|(n.italic?2:0)),l=t.annotations.length>0?t.annotations.map(e=>j(`«${e.trim()}»`,D)??`«${T(e).trim()}»`):Ne,u=t.members.length>0?t.members.map(e=>Pe(e,k,i)):Me,d=t.methods.length>0?t.methods.map(e=>Pe(e,k,i)):Me,f=s.width,p=0;for(let e of l)f=Math.max(f,typeof e==`string`?k.width(e,D,0):e.width),p+=typeof e==`string`?O:Math.max(O,e.height);for(let e of u)f=Math.max(f,e.width);for(let e of d)f=Math.max(f,e.width);let m=!(oe&&u.length===0&&d.length===0),h=e=>m?e>0?2*Te+e*a:Ee:0,g=2*we+p+Math.max(s.height,Math.round(r*1.5)),_=h(u.length);return{node:e,style:n,label:s,w:Math.max(f+2*Ce,De),h:g+_+h(d.length),loops:0,annotations:l,attributes:u,methods:d,titleH:g,attributesH:_,fontSize:r}}let B=[],V=[],me=[],H=[],U=[],W=new Float64Array(L.length*4),G=(e,t,n)=>{W[e*4+t]++,n>W[e*4+t+1]&&(W[e*4+t+1]=n)};for(let e of S.edges){if(e.source<0||e.target<0)continue;let t=c(e.label,!0,k,E,200),n=M(e.startLabelRight),r=M(e.endLabelLeft);e.source===e.target?(L[e.source].loops++,R[e.source].w+=2*(Se+(t.width>0?t.width+12:0))):(G(e.source,0,n),G(e.target,2,r)),H.push(n),U.push(r),V.push(e),me.push(t),B.push({src:e.source,dst:e.target,minlen:1,labelW:t.width>0?t.width+12:0,labelH:t.height>0?t.height+4:0,route:[],labelX:0,labelY:0})}if(N===`TB`||N===`BT`)for(let e=0;e<L.length;e++){if(!L[e].node.classNode)continue;let t=0;for(let n=0;n<4;n+=2){let r=W[e*4+n],i=W[e*4+n+1];r>1&&(t=Math.max(t,(r-1)*(i>0?i+24:14)+24))}t=Math.min(t,480),t>L[e].w&&(R[e].w+=t-L[e].w,L[e].w=t)}let K=!1;for(let e=0;e<V.length&&!K;e++)K=H[e]>0||U[e]>0;let q=0;if(N===`TB`||N===`BT`){let e=e=>e?Math.max(O,j(e,D)?.height??0):0;for(let t of V)q=Math.max(q,e(t.startLabelRight)+e(t.endLabelLeft)-2*O)}let Fe=ae(R,B,N,{nodeSep:je(b,`nodeSpacing`,ye),edgeSep:be,rankSep:je(b,`rankSpacing`,K?xe+16:xe)+q,portSep:20,apart:!0}),Ie=new Map,Y=[],Le=(e,t,n,r,i)=>{let a=e.route,o=R[n],s=y(a,t,o);if(s<0)return;let c=(o.w-L[n].w)/2;s===1?a[t]-=c:s===3&&(a[t]+=c);let l=s&1,u=a[(t===0?3:t-3)+l],d=u-a[t+l],f={route:a,at:t,toward:u,order:i,room:r,side:s,after:l?d>0:d>=0},p=n*4+s,m=Ie.get(p);return m?m.push(f):Ie.set(p,[f]),f},Re=[],ze=[];for(let e=0;e<B.length;e++){let t=B[e],n=t.src!==t.dst&&t.route.length>=6;Re.push(n?Le(t,0,t.src,H[e],e):void 0),ze.push(n?Le(t,t.route.length-3,t.dst,U[e],e):void 0)}let Be=(e,t,n)=>{for(let r=R[e].parent,i=0;r>=0&&i<1e4;r=R[r].parent,i++){let e=R[r],i=Math.abs(t-e.x),a=Math.abs(n-e.y);if(Math.abs(a-e.h/2)<.5&&i<=e.w/2+.5||Math.abs(i-e.w/2)<.5&&a<=e.h/2+.5)return!0}return!1},Ve=[];for(let[e,t]of Ie){if(t.length<2)continue;let n=e>>2,r=e&1,i=r?L[n].h:L[n].w;t.sort((e,t)=>e.toward-t.toward||e.order-t.order);let a=0;for(let e=0;e+1<t.length;e++){let n=t[e],i=t[e+1],o=r?20:24;n.room>0&&n.after&&(o+=r?O+6:n.room),i.room>0&&!i.after&&(o+=r?O+6:i.room),Ve[e]=o,a+=o}let o=Math.min(1,(i-24)/a);if(o<=0)continue;let s=(r?R[n].y:R[n].x)-a*o/2;for(let e=0;e<t.length;e++){let{route:i,at:a}=t[e],c=a===0?3:-3,l=a+c,u=-1;for(let e=l;e>=0&&e<i.length&&Math.abs(i[e+r]-i[l+r])<.5;e+=c)if(Be(n,i[e],i[e+1])){u=e;break}if(u>=0&&Math.abs(i[l+r]-s)<=24)for(let e=l;e!==u+c;e+=c)i[e+r]=s;i[a+r]=s,s+=Ve[e]*o}}let He=(e,t,n,r)=>{if(t===void 0||n<=0)return;let i=t.side&1,a=r?0:e.length-3,o=a+1-i,s=Math.abs(e[(r?3:a-3)+1-i]-e[o]),c=Math.min(i?n+10:O+6,s*.35);if(c<4)return;let l=[e[a],e[a+1],e[a+2]];l[1-i]+=(t.side===0||t.side===3?-1:1)*c,e.splice(r?3:a,0,l[0],l[1],l[2])};for(let e=0;e<B.length;e++)He(B[e].route,Re[e],H[e],!0),He(B[e].route,ze[e],U[e],!1);let X=0,Z=0,Ue=Fe.width,We=Fe.height,Ge=(e,t,n,r,i,a,o)=>{if(!t)return;let s=j(t,D),c=s?Math.max(O,s.height):O,l=r,u=i;a&1?(l+=(a===3?-1:1)*(5+n/2),u+=(o?1:-1)*(7+c/2)):(l+=(o?1:-1)*(9+n/2),u+=(a===0?-1:1)*(3+c/2)),Y.push({text:T(t),math:s,x:l,y:u,w:n,h:c,parent:e}),X=Math.min(X,l-n/2),Ue=Math.max(Ue,l+n/2),Z=Math.min(Z,u-c/2),We=Math.max(We,u+c/2)},Ke=new Map,qe=new Int32Array(B.length);for(let e=0;e<B.length;e++){let t=B[e],n=V[e],r=t.route;if(t.src===t.dst){let r=Ke.get(t.src)??0;Ke.set(t.src,r+1),qe[e]=r;let i=R[t.src],a=L[t.src],o=i.x+a.w/2,s=Math.min(a.h/2-4,8+r*6);Ge(t.src,n.startLabelRight,H[e],o,i.y-s,1,!1),Ge(t.dst,n.endLabelLeft,U[e],o,i.y+s,1,!0),t.labelX=i.x+a.w/2+Se+r*8+4+t.labelW/2,t.labelY=i.y}else if(r.length>=6){let i=r.length-3,a=Re[e],o=ze[e];Ge(t.src,n.startLabelRight,H[e],r[0],r[1],a?a.side:2,!a||a.after),Ge(t.dst,n.endLabelLeft,U[e],r[i],r[i+1],o?o.side:0,!o||o.after)}}let Je=p.maxWidth;if(Je!==void 0&&Je>0&&Ue-X+2*A>Je){let e=Y.map(e=>({...C(e.w,e.h,e.parent),x:e.x,y:e.y})),t=he(R.concat(e),B,Math.max(1,Je-2*A),je(b,`nodeSpacing`,ye));t&&(Y.forEach((t,n)=>{t.x=e[n].x,t.y=e[n].y}),X=Z=0,Ue=t.width,We=t.height)}let Q=A-X,$=A-Z,Ye=Math.ceil(Ue-X+2*A),Xe=Math.ceil(We-Z+2*A),Ze=[],Qe=new Map;if(S.nodes.length>0&&S.nodes[0].isGroup)for(let e of B)re(Qe,e.route);let $e=``,et=``,tt=``;for(let e=0;e<L.length;e++){let t=L[e],n=R[e],r=t.node,s=n.x+Q,c=n.y+$,l=i(r.id),d=n.isGroup?n.w:t.w,f=n.isGroup?n.h:t.h;if(r.isGroup){let r=n.isGroup?ne(n,t.label.width,Qe,J):n.x,i=c-f/2+8+t.label.height/2,p=` class="pele-cluster-label" fill="var(--_m)"`,m=n.isGroup&&te(n,t.label.width,r,Qe);m&&(et+=ie(t.label,r+Q,i,p,l,S.nodes,e)),$e+=`<g class="pele-cluster pele-namespace" data-id="${l}"><rect x="${u(s-d/2)}" y="${u(c-f/2)}" width="${u(d)}" height="${u(f)}" fill="var(--_a)" fill-opacity="0.5" stroke="var(--_b)"${o}/>`+(m?``:a(t.label,r+Q,i,p))+`</g>`;continue}let m=` transform="translate(${u(s)},${u(c)})"`;if(r.classNode)tt+=nt(t,r.classNode,l,m);else if(r.shape===`note`){let e=d/2,n=-f/2;tt+=`<g class="pele-node pele-note" data-id="${l}"${m}><path d="M${u(-e)},${u(n)}H${u(e-Oe)}L${u(e)},${u(n+Oe)}V${u(-n)}H${u(-e)}Z" fill="var(--_a)" stroke="var(--_b)" stroke-linejoin="round"/><path d="M${u(e-Oe)},${u(n)}V${u(n+Oe)}H${u(e)}" fill="none" stroke="var(--_b)" stroke-linejoin="round"/>`+a(t.label,0,0,` class="pele-label" font-size="${E}"`,p.icons)+`</g>`}else tt+=`<g class="pele-node pele-interface" data-id="${l}"${m}>`+a(t.label,0,0,` class="pele-label" font-size="${E}"`,p.icons)+`</g>`}function nt(e,o,s,c){let{w:l,h:d,style:f}=e,m=-l/2,h=-d/2,g=Math.round(e.fontSize*.875),_=Math.round(g*1.5),v=`<rect x="${u(m)}" y="${u(h)}" width="${u(l)}" height="${u(d)}" fill="var(--_s)" stroke="var(--_b)"${r(f.shape)}/>`,y=h+e.titleH,b=y+e.attributesH;if(d>e.titleH){let e=f.stroke?` style="stroke:${t(f.stroke)}"`:``;v+=`<path class="pele-divider" d="M${u(m)},${u(y)}H${u(-m)}M${u(m)},${u(b)}H${u(-m)}" fill="none" stroke="var(--_b)"${e}/>`}let x=h+we;for(let n of e.annotations)if(typeof n==`string`)v+=`<text class="pele-annotation" x="0" y="${u(x+O/2+D*.35)}" text-anchor="middle" font-size="${D}" fill="var(--_m)">${t(n)}</text>`,x+=O;else{let e=Math.max(O,n.height);v+=a(n,0,x+e/2,` class="pele-annotation" font-size="${D}" fill="var(--_m)"`,p.icons),x+=e}let S=e.fontSize===w?``:` font-size="${u(e.fontSize)}"`;v+=a(e.label,0,(x+y-we)/2,` class="pele-label"${S} font-weight="var(--_hw)"${f.text}`,p.icons);let te=(e,n,r)=>{let i=``,a=r+Te+_/2+g*.35;for(let r of e){let e=r.classifier===`$`?` pele-static"${f.text?f.text.slice(0,-1)+`text-decoration:underline"`:` style="text-decoration:underline"`}`:r.classifier===`*`?` pele-abstract" font-style="italic"${f.text}`:`"${f.text}`;i+=`<text class="pele-member pele-${n}${e} x="${u(m+Ce)}" y="${u(a)}">${t(r.text)}</text>`,a+=_}return i};return(e.attributes.length>0||e.methods.length>0)&&(v+=`<g class="pele-members" font-size="${g}">${te(e.attributes,`attribute`,y)}${te(e.methods,`method`,b)}</g>`),o.tooltip&&(v=`<title>${i(o.tooltip)}</title>`+v),o.link&&(v=ee(v,o.link,o.id,Ze,p,o.linkTarget&&Ae.has(o.linkTarget)?` target="${o.linkTarget}"`:``)),`<g class="pele-node pele-class${n(o.cssClasses.replace(/^default\s?/,``))}" data-id="${s}"${c}>${v}</g>`}let rt=``,it=``;for(let e=0;e<B.length;e++){let t=B[e],n=V[e],r=me[e],a=n.arrowTypeStart,o=n.arrowTypeEnd,s=_e(a),c=_e(o),l;if(t.src===t.dst){let n=R[t.src],r=L[t.src],i=qe[e],a=n.x+Q+r.w/2,o=n.y+$,d=Math.min(r.h/2-4,8+i*6),f=Se+i*8;l={d:`M${u(a+s)},${u(o-d)}C${u(a+f+s)},${u(o-d)} ${u(a+f+c)},${u(o+d)} ${u(a+c)},${u(o+d)}`,sx:a,sy:o-d,sdx:-1,sdy:0,ex:a,ey:o+d,edx:-1,edy:0}}else{let e=t.route;for(let t=0;t<e.length;t+=3)e[t]+=Q,e[t+1]+=$;l=g(e,void 0,s,c)}let d=n.pattern===`dashed`?` stroke-dasharray="6 4"`:n.pattern===`dotted`?` stroke-dasharray="2 4"`:``;if(rt+=`<g class="pele-edge${n.pattern===`dotted`?` pele-note-edge`:` pele-relation`}" data-id="${i(n.id)}"><path d="${l.d}"${d}/>`+ve(a,l.sx,l.sy,l.sdx,l.sdy,ke)+ve(o,l.ex,l.ey,l.edx,l.edy,ke)+`</g>`,r.width>0){let e=t.labelX+Q,i=t.labelY+$;it+=h(n.id,r,e,i,``,p.icons)}}let at=``;for(let e of Y)at+=e.math?a(e.math,e.x+Q,e.y+$,` class="pele-cardinality"`,p.icons):`<text class="pele-cardinality" x="${u(e.x+Q)}" y="${u(e.y+$+D*.35)}" text-anchor="middle">${t(e.text)}</text>`;let ot=v(d.title,k,w,A,Ye,Xe,($e?`<g class="pele-clusters">${$e}</g>`:``)+(rt?`<g class="pele-edges" fill="none" stroke="${ke}" stroke-linecap="round">${rt}</g>`:``)+(et?`<g class="pele-cluster-titles">${et}</g>`:``)+(it?`<g class="pele-edge-labels" font-size="${E}">${it}</g>`:``)+(at?`<g class="pele-cardinalities" font-size="${D}" fill="var(--_m)">${at}</g>`:``)+`<g class="pele-nodes">${tt}</g>`);return{svg:e(`class`,ot.width,ot.height,w,p,d,ot.content),width:ot.width,height:ot.height,links:Ze}}var Y={type:`class`,math:!0,parse(e,t,n){let r=new F;return n&&(r.title=n),me(e,r),r},render:Fe};export{Y as classDiagram};
@@ -0,0 +1,2 @@
1
+ import{_ as e,a as t,o as n,u as r,x as i}from"./E3FWOBN4-D5m5o2g0.js";import{r as a,t as o}from"./DKTLEL5E-DciMwFJ1.js";import{a as s,c,d as l,f as u,g as d,h as f,i as p,l as m,m as h,n as g,o as _,p as v,r as y,s as b,t as x,u as S}from"./C5HTQT3I-7U13x70S.js";import{t as C}from"./5THPTBWS-Ce_hS451.js";import{t as w}from"./DUZNPW7S-D3pifVNb.js";import{PeleError as T,d as E,u as D}from"./lazy-DaMZI1F7.js";var O=1e4;function k(e,t,n,r,i){let a=e.packet?.[t];return typeof a==`number`&&a>=r?Math.min(a,i):n}function A(e){return new T(e,`semantic`,{type:`packet`})}function j(e,t,n){let r=Math.floor(k(t,`bitsPerRow`,32,1,4096)),i=[],a=-1,o=[],s=1;for(let t of e.blocks){let{start:e,end:n,bits:c}=t;if(e!==void 0&&n!==void 0&&n<e)throw A(`Packet block ${e} - ${n} is invalid. End must be greater than start.`);if(e??=a+1,e!==a+1)throw A(`Packet block ${e} - ${n??e} is not contiguous. It should start from ${a+1}.`);if(c===0)throw A(`Packet block ${e} is invalid. Cannot have a zero bit field.`);for(n??=e+(c??1)-1,c??=n-e+1,a=n;o.length<=r+1&&i.length<O;){let a=s*r-1;if(n<=a){o.push({start:e,end:n,bits:c,label:t.label}),n===a&&(i.push(o),o=[],s++);break}o.push({start:e,end:a,bits:a-e,label:t.label}),i.push(o),o=[],s++,e=a+1,c=n-e}}return o.length>0&&i.push(o),{type:`packet`,title:e.title||n,accTitle:e.accTitle?e.accTitle.replace(/^\s+/g,``):void 0,accDescr:e.accDescr?e.accDescr.replace(/\n\s+/g,`
2
+ `):void 0,bitsPerRow:r,rows:i}}var M=[{name:`packet-beta`,pattern:`packet-beta`},p(`packet`),{name:`-`,pattern:`-`,longer:[y]},{name:`+`,pattern:`+`},{name:`:`,pattern:`:`},s,x,v,{name:`INT`,pattern:/0|[1-9][0-9]*(?!\.)/y},h,m,S,y,_,b];function N(e){let t=new f(g(e,M,`packet`),M,`packet`),n={$type:`Packet`,blocks:[]},r=()=>{if(t.kind!==-1)for(t.kind!==10&&t.fail(`a line break or the end of input`);t.kind===10;)t.i++};for(;t.kind===10;)t.i++;for(t.accept(0)||t.expect(1);t.kind!==-1;)switch(t.kind){case 10:t.i++;break;case 5:n.accDescr=c(t.take()),r();break;case 6:n.accTitle=d(t.take()),r();break;case 7:n.title=l(t.take()),r();break;case 8:case 3:{let e={$type:`PacketBlock`,label:``};t.accept(3)?e.bits=Number(t.expect(8)):(e.start=Number(t.take()),t.accept(2)&&(e.end=Number(t.expect(8)))),t.expect(4),e.label=u(t.expect(9)),n.blocks.push(e),r();break}default:t.fail(`a field, a title, or a line break`)}return n}function P(e,t,n){return o(n,r=>F(e,t,n,r))}function F(o,s,c,l){let u=c.fontSize??16,d=Math.round(u*.875),f=Math.round(u*.625),p=c.measurer??D(c.fontFamily,c.fontFamilyMono),m=c.padding??8,h=s.packet??{},g=k(s,`rowHeight`,32,1,400),_=k(s,`bitWidth`,32,1,400),v=k(s,`paddingX`,5,0,400),y=k(s,`paddingY`,5,0,400),b=h.showBits!==!1,x=h.bitOrder===`descending`,S=o.bitsPerRow,T=o.rows;if(l){let e=Math.max(1,Math.floor(((c.maxWidth??320)-2*m)/Math.min(_,18)));S=Math.min(S,Math.max(8,2**Math.floor(Math.log2(e))));let t=o.rows[o.rows.length-1],n=t?.[t.length-1]?.end??0;Math.ceil((n+1)/S)>1e4&&(S=o.bitsPerRow),_=Math.min(_,Math.max(18,((c.maxWidth??320)-2*m)/S));let r=e=>e.bits===e.end-e.start,i=[];for(let e of o.rows)for(let t of e){let e=i[i.length-1];e&&r(e)&&r(t)&&e.label===t.label&&t.start===e.end+1&&t.start%o.bitsPerRow===0?(e.end=t.end,e.bits=e.end-e.start):i.push({...t})}T=[];for(let e of i)for(let t=e.start;t<=e.end;){let n=Math.min(e.end,(Math.floor(t/S)+1)*S-1),r=Math.floor(t/S);(T[r]??(T[r]=[])).push({...e,start:t,end:n}),t=n+1}}let O=new Map;if(l)for(let e of T)for(let t of e){let e=Math.max(1,(t.end-t.start+1)*_-Math.min(v,_-1)-6),n=w(E(t.label).trim(),p,d,e);O.set(t,n)}let A=b?f+4:0,j=T.map(e=>{let t=g;if(l)for(let n of e)t=Math.max(t,O.get(n).height+10);return t}),M=[],N=0;for(let e of j)M.push(N),N+=A+e+y;T.length&&(N-=y);let P=Math.min(v,_-1),F=T.length>0?S*_-P:0,I=r(o.title,!1,p,u,l?a(c):4e3,1),L=I.height>0?I.height+(N>0?12:0):0,R=new Map,z=(e,t)=>{let n=R.get(e);return n||R.set(e,n=new Map),n.has(t)||n.set(t,C(E(e).trim(),t,d,Math.round(u*.5),p)),n.get(t)},B=m+Math.max(0,(I.width-F)/2),V=``,H=``;T.forEach((e,r)=>{let a=m+M[r]+A,o=j[r];for(let r of e){let e=r.end-r.start+1,s=r.start%S,c=B+(x?S-s-e:s)*_,u=e*_-P,f=l?void 0:z(r.label,u-6);if(V+=`<g class="pele-node" data-id="${r.start}-${r.end}"><rect x="${i(c)}" y="${i(a)}" width="${i(u)}" height="${i(o)}" fill="var(--_s)" stroke="var(--_b)" style="rx:var(--_r)"/>`+(l?n(O.get(r),c+u/2,a+o/2,``):f&&f.size<=o?`<text x="${i(c+u/2)}" y="${i(a+o/2+f.size*.35)}"${f.size===d?``:` font-size="${i(f.size)}"`}>${t(f.text)}</text>`:``)+`</g>`,!b)continue;let p=x?r.end:r.start,m=x?r.start:r.end;H+=e===1?`<text x="${i(c+u/2)}" y="${i(a-4)}" text-anchor="middle">${p}</text>`:`<text x="${i(c)}" y="${i(a-4)}">${p}</text><text x="${i(c+u)}" y="${i(a-4)}" text-anchor="end">${m}</text>`}});let U=Math.ceil(Math.max(F,I.width)+2*m),W=Math.ceil(N+L+2*m),G=(V?`<g class="pele-packet-fields" font-size="${d}" text-anchor="middle">${V}</g>`:``)+(H?`<g class="pele-packet-bits" font-size="${f}" fill="var(--_m)">${H}</g>`:``)+n(I,U/2,W-m-I.height/2,` class="pele-title" font-weight="var(--_tw)"`);return{svg:e(`packet`,U,W,u,c,o,G),width:U,height:W,links:[]}}var I={type:`packet`,parse:(e,t,n)=>j(N(e),t,n),render:P};export{I as packet};
@@ -0,0 +1,4 @@
1
+ import{s as e}from"./lazy-DaMZI1F7.js";var t=new WeakMap;function n(e){let n=e.map((e,t)=>t),r=[];for(let t=0;t<128;t++){let i=String.fromCharCode(t);r.push(n.filter(t=>{let{pattern:n,first:r}=e[t];return typeof n==`string`?n[0]===i:r===void 0||r.includes(i)}))}let i={starting:r,every:n,longer:e.map(t=>t.longer?.map(t=>e.indexOf(t)))};return t.set(e,i),i}function r(r,i,a){let o=[],s=[],c=[],l=new Uint8Array(i.length),{starting:u,every:d,longer:f}=t.get(i)??n(i),p=[],m=r.length,h=(e,t)=>{if(l[e])return-1;let n=i[e];if(n.match!==void 0)return n.match(r,t);if(n.scanner!==void 0)return(p[e]??=n.scanner())(r,t);let a=n.pattern;return typeof a==`string`?r.startsWith(a,t)?t+a.length:-1:(a.lastIndex=t,a.test(r)?a.lastIndex:(n.opener!==void 0&&(n.opener.lastIndex=t,n.opener.test(r)&&(l[e]=1)),-1))},g=0;n:for(;g<m;){let t=r.charCodeAt(g);for(let e of t<128?u[t]:d){let t=h(e,g);if(t<=g)continue;let n=e,r=f[e];if(r!==void 0)for(let e of r){let r=h(e,g);if(r>t){n=e,t=r;break}}i[n].hidden||(o.push(n),s.push(g),c.push(t)),g=t;continue n}throw e(a,r,g,``,!0)}return o.push(-1),s.push(m),c.push(m),{kinds:o,starts:s,ends:c,src:r}}var i={name:`ACC_DESCR`,pattern:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/y,first:` a`},a={name:`ACC_TITLE`,pattern:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/y,first:` a`},o={name:`TITLE`,pattern:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/y,first:` t`},s={name:`STRING`,pattern:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/y,first:`"'`},c={name:`NEWLINE`,pattern:/\r?\n/y,first:`\r
2
+ `},l={name:`WHITESPACE`,pattern:/[\t ]+/y,hidden:!0,first:` `},u={name:`YAML`,pattern:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/y,hidden:!0,opener:/---[\t ]*\r?\n/y,first:`-`},d={name:`DIRECTIVE`,pattern:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/y,hidden:!0,opener:/[\t ]*%%{/y,first:` %`},f={name:`SINGLE_LINE_COMMENT`,pattern:/[\t ]*%%[^\n\r]*/y,first:` %`,hidden:!0};function p(e){return{name:e,pattern:RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)+`(?:(?=%%)|(?!\\S))`,`y`),first:e[0]}}var m=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,h=/accTitle[\t ]*:([^\n\r]*)/,g=/title([\t ][^\n\r]*|)/;function _(e){return e.trim().replace(/[\t ]{2,}/gm,` `)}function v(e){return _(g.exec(e)[1])}function y(e){return _(h.exec(e)[1])}function b(e){let t=m.exec(e);return t[1]===void 0?t[2].replace(/^\s*/gm,``).replace(/\s+$/gm,``).replace(/[\t ]{2,}/gm,` `).replace(/[\n\r]{2,}/gm,`
3
+ `):_(t[1])}var x=new Map([[`b`,`\b`],[`f`,`\f`],[`n`,`
4
+ `],[`r`,`\r`],[`t`,` `],[`v`,`\v`],[`0`,`\0`]]);function S(e){if(!e.includes(`\\`))return e.slice(1,-1);let t=``;for(let n=1;n<e.length-1;n++){let r=e[n];if(r===`\\`){let r=e[++n];t+=x.get(r)??r}else t+=r}return t}var C=class{constructor(e,t,n){this.tokens=e,this.types=t,this.diagram=n,this.kinds=e.kinds}tokens;types;diagram;i=0;kinds;get kind(){return this.kinds[this.i]}text(e=this.i){return this.tokens.src.slice(this.tokens.starts[e],this.tokens.ends[e])}take(){return this.text(this.i++)}accept(e){return this.kinds[this.i]===e&&(this.i++,!0)}expect(e){return this.kinds[this.i]!==e&&this.fail(`token of type '${this.types[e].name}'`),this.take()}fail(t){let n=this.kind===-1?`end of input`:`\`${this.text()}\``;throw e(this.diagram,this.tokens.src,this.tokens.starts[this.i],`Expecting ${t} but found ${n}.`)}};export{i as a,b as c,v as d,S as f,y as g,C as h,p as i,c as l,s as m,r as n,d as o,o as p,u as r,f as s,a as t,l as u};