vibelet 1.2.237 → 1.2.238

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 (106) hide show
  1. package/README.md +35 -0
  2. package/dist/index.cjs +1 -1
  3. package/dist/inventory-scan-worker.cjs +1 -1
  4. package/dist/runtime-version.cjs +1 -1
  5. package/dist/vibelet.mjs +357 -244
  6. package/dist/web/assets/App-C21-MM7L.js +2 -0
  7. package/dist/web/assets/App-CbEM8WX0.css +1 -0
  8. package/dist/web/assets/BrowserControlPanel-CkKIuEsj.js +1 -0
  9. package/dist/web/assets/{ChipGroup-DCvI-4nb.js → ChipGroup-YMpjYR9P.js} +1 -1
  10. package/dist/web/assets/FilesControlPanel-CwbB5lm2.js +1 -0
  11. package/dist/web/assets/GlobalPendingDialog-DqEBvP53.js +1 -0
  12. package/dist/web/assets/{ImageViewer-ChfsVDQe.js → ImageViewer-CK5ZHIVv.js} +1 -1
  13. package/dist/web/assets/{LanguageSettingsPanel-P7H9JLtq.js → LanguageSettingsPanel-BXx4BvyU.js} +1 -1
  14. package/dist/web/assets/{MarkdownModePanel-B4zGnWRC.js → MarkdownModePanel-VRQHdCgq.js} +1 -1
  15. package/dist/web/assets/NewSessionDialog-CuL1-FFv.js +1 -0
  16. package/dist/web/assets/{NotificationSettingsPanel-BAcpsROS.js → NotificationSettingsPanel-D78c9Tv6.js} +1 -1
  17. package/dist/web/assets/{RemoteLifeOSBlock-C46RjZWn.js → RemoteLifeOSBlock-BjYrjRa2.js} +2 -2
  18. package/dist/web/assets/RemoteWorkspaceSettings-7jz8oX59.css +1 -0
  19. package/dist/web/assets/RemoteWorkspaceSettings-B9yBCaSU.js +1 -0
  20. package/dist/web/assets/{SessionTerminalPanel-pCQpIA-I.js → SessionTerminalPanel-D_XqGjcx.js} +1 -1
  21. package/dist/web/assets/{ThemeSettingsPanel-JUF7qFiS.js → ThemeSettingsPanel-BAHOGS0L.js} +1 -1
  22. package/dist/web/assets/{abnfDiagram-VRR7QNED-BUn7dXdz.js → abnfDiagram-VRR7QNED-C_g14JDy.js} +1 -1
  23. package/dist/web/assets/arc-Dlh78dPq.js +1 -0
  24. package/dist/web/assets/{architectureDiagram-ZJ3FMSHR-QlFDuk3c.js → architectureDiagram-ZJ3FMSHR-r6osYFBK.js} +1 -1
  25. package/dist/web/assets/{arrow-right-BkDm1nz1.js → arrow-right-BtC2L5Xy.js} +1 -1
  26. package/dist/web/assets/{blockDiagram-677ZJIJ3-Di1jkO8N.js → blockDiagram-677ZJIJ3-Dt1NkFp6.js} +1 -1
  27. package/dist/web/assets/{c4Diagram-LMCZKHZV-BIE5S3xC.js → c4Diagram-LMCZKHZV-DgzJiNGp.js} +1 -1
  28. package/dist/web/assets/channel-CoeVE6la.js +1 -0
  29. package/dist/web/assets/{chunk-2Q5K7J3B-BZdVpYMm.js → chunk-2Q5K7J3B-CuStQQP5.js} +1 -1
  30. package/dist/web/assets/{chunk-32BRIVSS-DniTjuKD.js → chunk-32BRIVSS-CqcvfQyF.js} +1 -1
  31. package/dist/web/assets/{chunk-5VM5RSS4-zU4WGQUt.js → chunk-5VM5RSS4-ClfzIwi_.js} +1 -1
  32. package/dist/web/assets/{chunk-EX3LRPZG-B_EGZWf3.js → chunk-EX3LRPZG-km8mrFBg.js} +1 -1
  33. package/dist/web/assets/{chunk-JWPE2WC7-8R4xqfzd.js → chunk-JWPE2WC7-CwqQJZta.js} +1 -1
  34. package/dist/web/assets/{chunk-MOJQB5TN-CmpQblce.js → chunk-MOJQB5TN-D6HJ3YLS.js} +1 -1
  35. package/dist/web/assets/{chunk-RYQCIY6F-DrT9S-SZ.js → chunk-RYQCIY6F-DzxL_I7L.js} +1 -1
  36. package/dist/web/assets/{chunk-V7JOEXUC-CEP012wY.js → chunk-V7JOEXUC-Cx4-zn7N.js} +1 -1
  37. package/dist/web/assets/{chunk-VR4S4FIN-DcSau3fK.js → chunk-VR4S4FIN-uFIJLxCS.js} +1 -1
  38. package/dist/web/assets/{chunk-XXDRQBXY-BoXCe4yS.js → chunk-XXDRQBXY-Cg2Q6HPU.js} +1 -1
  39. package/dist/web/assets/classDiagram-OUVF2IWQ-UcfsFNaj.js +1 -0
  40. package/dist/web/assets/classDiagram-v2-EOCWNBFH-UcfsFNaj.js +1 -0
  41. package/dist/web/assets/{clsx-DNJkZJoV.js → clsx-dhsJw0G5.js} +1 -1
  42. package/dist/web/assets/{collectMessageImages-CUMbRGiF.js → collectMessageImages-ZyOAE6id.js} +1 -1
  43. package/dist/web/assets/{cose-bilkent-JH36ORCC-DKrqebqO.js → cose-bilkent-JH36ORCC-CcjvJAJB.js} +1 -1
  44. package/dist/web/assets/{cynefin-VYW2F7L2-bQLn5vS2.js → cynefin-VYW2F7L2-fGkbWpUF.js} +1 -1
  45. package/dist/web/assets/{cynefinDiagram-TSTJHNR4-ezXQFC9o.js → cynefinDiagram-TSTJHNR4-Cvuw_uxU.js} +1 -1
  46. package/dist/web/assets/{dagre-VKFMJZFB-CDV8r_Bq.js → dagre-VKFMJZFB-D07owLRU.js} +1 -1
  47. package/dist/web/assets/{diagram-FQU43EPY-BICapB67.js → diagram-FQU43EPY-C8yKetrQ.js} +1 -1
  48. package/dist/web/assets/{diagram-G47NLZAW-TuVLjwN6.js → diagram-G47NLZAW-CM7slttO.js} +1 -1
  49. package/dist/web/assets/{diagram-NH7WQ7WH-B3dBWl3F.js → diagram-NH7WQ7WH-CAqIaHvI.js} +1 -1
  50. package/dist/web/assets/{diagram-OA4YK3LP-DeIQlN-6.js → diagram-OA4YK3LP-s_8LmV3Y.js} +1 -1
  51. package/dist/web/assets/{diagram-WEI45ONY-DZcwYcod.js → diagram-WEI45ONY-DcL-hbJN.js} +1 -1
  52. package/dist/web/assets/{ebnfDiagram-CCIWWBDH-4KcDP5Zj.js → ebnfDiagram-CCIWWBDH-BiY1-WEY.js} +1 -1
  53. package/dist/web/assets/{erDiagram-Q63AITRT-D4KIuggo.js → erDiagram-Q63AITRT-iIeyBkVv.js} +1 -1
  54. package/dist/web/assets/{file-editor-FileCodeEditor-Dn3f5PUl.js → file-editor-FileCodeEditor-Cc7o0SoW.js} +2 -2
  55. package/dist/web/assets/{file-editor-ObsidianCodeEditor-BgXz3c5Z.js → file-editor-ObsidianCodeEditor-DKHh91wx.js} +2 -2
  56. package/dist/web/assets/{file-editor-ObsidianFileEditor-CM9ucogo.js → file-editor-ObsidianFileEditor-D4DiY_3P.js} +2 -2
  57. package/dist/web/assets/{file-editor-index-C7QHkk3U.js → file-editor-index-BrEnI_H0.js} +1 -1
  58. package/dist/web/assets/{file-editor-index-DIH2DQ5-.js → file-editor-index-DdTlNUV4.js} +1 -1
  59. package/dist/web/assets/{flowDiagram-23GEKE2U-BeHvede_.js → flowDiagram-23GEKE2U-CTWUxjYj.js} +1 -1
  60. package/dist/web/assets/{folder-plus-BVS_Q2fe.js → folder-plus-Cud2L2F4.js} +1 -1
  61. package/dist/web/assets/{ganttDiagram-NO4QXBWP-DrwEUqQX.js → ganttDiagram-NO4QXBWP-wo784lYB.js} +1 -1
  62. package/dist/web/assets/{gitGraphDiagram-IHSO6WYX-Cm7T6TME.js → gitGraphDiagram-IHSO6WYX-BY6lbwzB.js} +1 -1
  63. package/dist/web/assets/{highlighted-body-TPN3WLV5-DJAPujEc.js → highlighted-body-TPN3WLV5-CDeMvzq_.js} +1 -1
  64. package/dist/web/assets/{index-CapF4a8Y.js → index-BTavN9lk.js} +1 -1
  65. package/dist/web/assets/{index-CX8KV6EH.js → index-Dx_1eu1W.js} +2 -2
  66. package/dist/web/assets/{infoDiagram-FWYZ7A6U-CgeulgC-.js → infoDiagram-FWYZ7A6U-CfoivPz9.js} +1 -1
  67. package/dist/web/assets/{ishikawaDiagram-FXEZZL3T-x4glLaWe.js → ishikawaDiagram-FXEZZL3T-Bt6xBkx3.js} +1 -1
  68. package/dist/web/assets/{journeyDiagram-5HDEW3XC-DHGcWBDR.js → journeyDiagram-5HDEW3XC-D_lKOA6h.js} +1 -1
  69. package/dist/web/assets/{kanban-definition-HUTT4EX6-CqYivdRn.js → kanban-definition-HUTT4EX6-Ce_DMiiq.js} +1 -1
  70. package/dist/web/assets/key-round-BgAVbd3A.js +1 -0
  71. package/dist/web/assets/{linear-BKnAjtJN.js → linear-DmQK5Nk3.js} +1 -1
  72. package/dist/web/assets/{mermaid-O7DHMXV3-B3e3pugB.js → mermaid-O7DHMXV3-DKlyhw3K.js} +2 -2
  73. package/dist/web/assets/{mermaid.core-CTf8qcol.js → mermaid.core-jR_k1I8D.js} +2 -2
  74. package/dist/web/assets/{mindmap-definition-LN4V7U3C-NQnwG7IB.js → mindmap-definition-LN4V7U3C-4KSBnEFJ.js} +1 -1
  75. package/dist/web/assets/{pegDiagram-2B236MQR-jfLjzzsG.js → pegDiagram-2B236MQR-rZKZ-HjO.js} +1 -1
  76. package/dist/web/assets/{pieDiagram-ENE6RG2P-CgxRYPCf.js → pieDiagram-ENE6RG2P-Fz-HbF4X.js} +1 -1
  77. package/dist/web/assets/{quadrantDiagram-ABIIQ3AL-0zHgV223.js → quadrantDiagram-ABIIQ3AL-G8TsEkFM.js} +1 -1
  78. package/dist/web/assets/{railroadDiagram-RFXS5EU6-CQqf55Rk.js → railroadDiagram-RFXS5EU6-ztb7MjCm.js} +1 -1
  79. package/dist/web/assets/{requirementDiagram-TGXJPOKE-Dm9cKzLN.js → requirementDiagram-TGXJPOKE-4Y2Rvrbc.js} +1 -1
  80. package/dist/web/assets/{sankeyDiagram-HTMAVEWB-BRBxR71X.js → sankeyDiagram-HTMAVEWB-BfX7WEmV.js} +1 -1
  81. package/dist/web/assets/{sequenceDiagram-DBY2YBRQ-DxVBmbfg.js → sequenceDiagram-DBY2YBRQ-BMavjnNv.js} +1 -1
  82. package/dist/web/assets/{sizeCapture-X5ZJPWSS-DNNwG-Sh.js → sizeCapture-X5ZJPWSS-DGkFWUNW.js} +1 -1
  83. package/dist/web/assets/{stateDiagram-2N3HPSRC-C8KGcqhJ.js → stateDiagram-2N3HPSRC-Bu42YWoA.js} +1 -1
  84. package/dist/web/assets/stateDiagram-v2-6OUMAXLB-BwgU75NJ.js +1 -0
  85. package/dist/web/assets/{swimlanes-5IMT3BWC-CRe3WzWn.js → swimlanes-5IMT3BWC-BGb3og3u.js} +2 -2
  86. package/dist/web/assets/swimlanesDiagram-G3AALYLV-D2gngEsl.js +1 -0
  87. package/dist/web/assets/{timeline-definition-FHXFAJF6-CQqiFe9j.js → timeline-definition-FHXFAJF6-Bvzb38qw.js} +1 -1
  88. package/dist/web/assets/{ts-tags-Chlpw95x.js → ts-tags-DAT_GLYZ.js} +1 -1
  89. package/dist/web/assets/{vennDiagram-L72KCM5P-C_5c80TB.js → vennDiagram-L72KCM5P-n0xgqOqd.js} +1 -1
  90. package/dist/web/assets/{wardleyDiagram-EHGQE667-DJ2RRwLP.js → wardleyDiagram-EHGQE667-CwAxqpRk.js} +1 -1
  91. package/dist/web/assets/{xychartDiagram-FW5EYKEG-MgVCQknE.js → xychartDiagram-FW5EYKEG-B6f2c1Rw.js} +1 -1
  92. package/dist/web/index.html +1 -1
  93. package/dist/web/obsidian-editor-assets.json +1 -1
  94. package/package.json +1 -1
  95. package/dist/web/assets/App-BY3qcVsa.css +0 -1
  96. package/dist/web/assets/App-CLTYkSvy.js +0 -2
  97. package/dist/web/assets/BrowserControlPanel-DJHj2vwI.js +0 -1
  98. package/dist/web/assets/FilesControlPanel-B-pqZWgH.js +0 -1
  99. package/dist/web/assets/GlobalPendingDialog-M2Dbntba.js +0 -1
  100. package/dist/web/assets/NewSessionDialog-Cw6WvtMR.js +0 -1
  101. package/dist/web/assets/arc-BW2CYTF6.js +0 -1
  102. package/dist/web/assets/channel-CgLW9Jd5.js +0 -1
  103. package/dist/web/assets/classDiagram-OUVF2IWQ-BTbMtdvt.js +0 -1
  104. package/dist/web/assets/classDiagram-v2-EOCWNBFH-BTbMtdvt.js +0 -1
  105. package/dist/web/assets/stateDiagram-v2-6OUMAXLB-Bk6KXy8V.js +0 -1
  106. package/dist/web/assets/swimlanesDiagram-G3AALYLV-DsL6VYKg.js +0 -1
@@ -0,0 +1 @@
1
+ import{c as r,s as t}from"./flowDiagram-23GEKE2U-CTWUxjYj.js";import{_ as e}from"./mermaid.core-jR_k1I8D.js";import"./RemoteLifeOSBlock-BjYrjRa2.js";import"./chunk-5VM5RSS4-ClfzIwi_.js";import"./chunk-XXDRQBXY-Cg2Q6HPU.js";import"./chunk-VR4S4FIN-uFIJLxCS.js";import"./chunk-32BRIVSS-CqcvfQyF.js";import"./purify.es-BNLkGfTg.js";import"./channel-CoeVE6la.js";import"./index-Dx_1eu1W.js";import"./marked.esm-BBjA1da9.js";import"./App-C21-MM7L.js";import"./index-BTavN9lk.js";import"./file-editor-index-C6CU7Fik.js";var o=r({defaultLayout:"swimlane",styles:e(r=>`${t(r)}\n .swimlane.cluster rect {\n stroke: ${r.clusterBorder} !important;\n }\n [data-look="neo"].cluster rect {\n filter: none;\n }\n`,"getStyles")});export{o as diagram};
@@ -1 +1 @@
1
- import{_ as t,z as e,a9 as n,aa as i,ab as r,c as a,l as s,F as o,a1 as c,ac as l,d as h,u as d,ad as p,q as u}from"./mermaid.core-CTf8qcol.js";import{d as g}from"./arc-BW2CYTF6.js";import"./index-CX8KV6EH.js";import"./RemoteLifeOSBlock-C46RjZWn.js";import"./App-CLTYkSvy.js";import"./index-CapF4a8Y.js";import"./file-editor-index-C6CU7Fik.js";import"./purify.es-BNLkGfTg.js";import"./marked.esm-BBjA1da9.js";var y=function(){var e=t(function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},"o"),n=[6,11,13,14,15,17,19,20,23,24],i=[1,12],r=[1,13],a=[1,14],s=[1,15],o=[1,16],c=[1,19],l=[1,20],h={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:t(function(t,e,n,i,r,a,s){var o=a.length-1;switch(r){case 1:return a[o-1];case 3:i.setDirection("LR");break;case 4:i.setDirection("TD");break;case 5:case 9:case 10:this.$=[];break;case 6:a[o-1].push(a[o]),this.$=a[o-1];break;case 7:case 8:this.$=a[o];break;case 11:i.getCommonDb().setDiagramTitle(a[o].substr(6)),this.$=a[o].substr(6);break;case 12:this.$=a[o].trim(),i.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=a[o].trim(),i.getCommonDb().setAccDescription(this.$);break;case 15:i.addSection(a[o].substr(8)),this.$=a[o].substr(8);break;case 18:i.addTask(a[o],0,""),this.$=a[o];break;case 19:i.addEvent(a[o].substr(2)),this.$=a[o]}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(n,[2,5],{5:6}),e(n,[2,2]),e(n,[2,3]),e(n,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:i,15:r,17:a,19:s,20:o,21:17,22:18,23:c,24:l},e(n,[2,10],{1:[2,1]}),e(n,[2,6]),{12:21,14:i,15:r,17:a,19:s,20:o,21:17,22:18,23:c,24:l},e(n,[2,8]),e(n,[2,9]),e(n,[2,11]),{16:[1,22]},{18:[1,23]},e(n,[2,14]),e(n,[2,15]),e(n,[2,16]),e(n,[2,17]),e(n,[2,18]),e(n,[2,19]),e(n,[2,7]),e(n,[2,12]),e(n,[2,13])],defaultActions:{},parseError:t(function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},"parseError"),parse:t(function(e){var n=this,i=[0],r=[],a=[null],s=[],o=this.table,c="",l=0,h=0,d=s.slice.call(arguments,1),p=Object.create(this.lexer),u={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(u.yy[g]=this.yy[g]);p.setInput(e,u.yy),u.yy.lexer=p,u.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var y=p.yylloc;s.push(y);var f=p.options&&p.options.ranges;function m(){var t;return"number"!=typeof(t=r.pop()||p.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,t(function(t){i.length=i.length-2*t,a.length=a.length-t,s.length=s.length-t},"popStack"),t(m,"lex");for(var x,b,k,w,_,$,v,S,E={};;){if(b=i[i.length-1],this.defaultActions[b]?k=this.defaultActions[b]:(null==x&&(x=m()),k=o[b]&&o[b][x]),void 0===k||!k.length||!k[0]){var T;for(_ in S=[],o[b])this.terminals_[_]&&_>2&&S.push("'"+this.terminals_[_]+"'");T=p.showPosition?"Parse error on line "+(l+1)+":\n"+p.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[x]||x)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==x?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(T,{text:p.match,token:this.terminals_[x]||x,line:p.yylineno,loc:y,expected:S})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+x);switch(k[0]){case 1:i.push(x),a.push(p.yytext),s.push(p.yylloc),i.push(k[1]),x=null,h=p.yyleng,c=p.yytext,l=p.yylineno,y=p.yylloc;break;case 2:if($=this.productions_[k[1]][1],E.$=a[a.length-$],E._$={first_line:s[s.length-($||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-($||1)].first_column,last_column:s[s.length-1].last_column},f&&(E._$.range=[s[s.length-($||1)].range[0],s[s.length-1].range[1]]),void 0!==(w=this.performAction.apply(E,[c,h,l,u.yy,k[1],a,s].concat(d))))return w;$&&(i=i.slice(0,-1*$*2),a=a.slice(0,-1*$),s=s.slice(0,-1*$)),i.push(this.productions_[k[1]][0]),a.push(E.$),s.push(E._$),v=o[i[i.length-2]][i[i.length-1]],i.push(v);break;case 3:return!0}}return!0},"parse")},d=function(){return{EOF:1,parseError:t(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:t(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:t(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:t(function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:t(function(t){this.unput(this.match.slice(t))},"less"),pastInput:t(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:t(function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in r)this[a]=r[a];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),a=0;a<r.length;a++)if((n=this._input.match(this.rules[r[a]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){return this.next()||this.lex()},"lex"),begin:t(function(t){this.conditionStack.push(t)},"begin"),popState:t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:t(function(t){this.begin(t)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(t,e,n,i){switch(n){case 0:case 1:case 3:case 4:break;case 2:return 13;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}}}();function p(){this.yy={}}return h.lexer=d,t(p,"Parser"),p.prototype=h,h.Parser=p,new p}();y.parser=y;var f=y,m={};d(m,{addEvent:()=>C,addSection:()=>I,addTask:()=>L,addTaskOrg:()=>N,clear:()=>S,default:()=>O,getCommonDb:()=>v,getDirection:()=>T,getSections:()=>M,getTasks:()=>H,setDirection:()=>E});var x="",b=0,k="LR",w=[],_=[],$=[],v=t(()=>p,"getCommonDb"),S=t(function(){w.length=0,_.length=0,x="",$.length=0,k="LR",u()},"clear"),E=t(function(t){k=t},"setDirection"),T=t(function(){return k},"getDirection"),I=t(function(t){x=t,w.push(t)},"addSection"),M=t(function(){return w},"getSections"),H=t(function(){let t=D(),e=0;for(;!t&&e<100;)t=D(),e++;return _.push(...$),_},"getTasks"),L=t(function(t,e,n){const i={id:b++,section:x,type:x,task:t,score:e||0,events:n?[n]:[]};$.push(i)},"addTask"),C=t(function(t){$.find(t=>t.id===b-1).events.push(t)},"addEvent"),N=t(function(t){const e={section:x,type:x,description:t,task:t,classes:[]};_.push(e)},"addTaskOrg"),D=t(function(){const e=t(function(t){return $[t].processed},"compileTask");let n=!0;for(const[t,i]of $.entries())e(t),n=n&&i.processed;return n},"compileTasks"),O={clear:S,getCommonDb:v,getDirection:T,setDirection:E,addSection:I,getSections:M,getTasks:H,addTask:L,addTaskOrg:N,addEvent:C},A=0,j=t(function(t,e){const n=t.append("rect");return n.attr("x",e.x),n.attr("y",e.y),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("width",e.width),n.attr("height",e.height),n.attr("rx",e.rx),n.attr("ry",e.ry),void 0!==e.class&&n.attr("class",e.class),n},"drawRect"),B=t(function(e,n){const i=e.append("circle").attr("cx",n.cx).attr("cy",n.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),r=e.append("g");function a(t){const e=g().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(15/2.2);t.append("path").attr("class","mouth").attr("d",e).attr("transform","translate("+n.cx+","+(n.cy+2)+")")}function s(t){const e=g().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(15/2.2);t.append("path").attr("class","mouth").attr("d",e).attr("transform","translate("+n.cx+","+(n.cy+7)+")")}function o(t){t.append("line").attr("class","mouth").attr("stroke",2).attr("x1",n.cx-5).attr("y1",n.cy+7).attr("x2",n.cx+5).attr("y2",n.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return r.append("circle").attr("cx",n.cx-5).attr("cy",n.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),r.append("circle").attr("cx",n.cx+5).attr("cy",n.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),t(a,"smile"),t(s,"sad"),t(o,"ambivalent"),n.score>3?a(r):n.score<3?s(r):o(r),i},"drawFace"),R=t(function(t,e){const n=t.append("circle");return n.attr("cx",e.cx),n.attr("cy",e.cy),n.attr("class","actor-"+e.pos),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("r",e.r),void 0!==n.class&&n.attr("class",n.class),void 0!==e.title&&n.append("title").text(e.title),n},"drawCircle"),P=t(function(t,e){const n=e.text.replace(/<br\s*\/?>/gi," "),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.attr("class","legend"),i.style("text-anchor",e.anchor),void 0!==e.class&&i.attr("class",e.class);const r=i.append("tspan");return r.attr("x",e.x+2*e.textMargin),r.text(n),i},"drawText"),F=t(function(e,n){function i(t,e,n,i,r){return t+","+e+" "+(t+n)+","+e+" "+(t+n)+","+(e+i-r)+" "+(t+n-1.2*r)+","+(e+i)+" "+t+","+(e+i)}t(i,"genPoints");const r=e.append("polygon");r.attr("points",i(n.x,n.y,50,20,7)),r.attr("class","labelBox"),n.y=n.y+n.labelMargin,n.x=n.x+.5*n.labelMargin,P(e,n)},"drawLabel"),W=t(function(t,e,n){const i=t.append("g"),r=q();r.x=e.x,r.y=e.y,r.fill=e.fill,r.width=n.width,r.height=n.height,r.class="journey-section section-type-"+e.num,r.rx=3,r.ry=3,j(i,r),Z(n)(e.text,i,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+e.num},n,e.colour)},"drawSection"),z=-1,V=t(function(t,e,n,i){const r=e.x+n.width/2,a=t.append("g");z++,a.append("line").attr("id",i+"-task"+z).attr("x1",r).attr("y1",e.y).attr("x2",r).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),B(a,{cx:r,cy:300+30*(5-e.score),score:e.score});const s=q();s.x=e.x,s.y=e.y,s.fill=e.fill,s.width=n.width,s.height=n.height,s.class="task task-type-"+e.num,s.rx=3,s.ry=3,j(a,s),Z(n)(e.task,a,s.x,s.y,s.width,s.height,{class:"task"},n,e.colour)},"drawTask"),G=t(function(t,e){j(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),U=t(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),q=t(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Z=function(){function e(t,e,n,i,a,s,o,c){r(e.append("text").attr("x",n+a/2).attr("y",i+s/2+5).style("font-color",c).style("text-anchor","middle").text(t),o)}function n(t,e,n,i,a,s,o,c,l){const{taskFontSize:h,taskFontFamily:d}=c,p=t.split(/<br\s*\/?>/gi);for(let u=0;u<p.length;u++){const t=u*h-h*(p.length-1)/2,c=e.append("text").attr("x",n+a/2).attr("y",i).attr("fill",l).style("text-anchor","middle").style("font-size",h).style("font-family",d);c.append("tspan").attr("x",n+a/2).attr("dy",t).text(p[u]),c.attr("y",i+s/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),r(c,o)}}function i(t,e,i,a,s,o,c,l){const h=e.append("switch"),d=h.append("foreignObject").attr("x",i).attr("y",a).attr("width",s).attr("height",o).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");d.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),n(t,h,i,a,s,o,c,l),r(d,c)}function r(t,e){for(const n in e)n in e&&t.attr(n,e[n])}return t(e,"byText"),t(n,"byTspan"),t(i,"byFo"),t(r,"_setTextAttrs"),function(t){return"fo"===t.textPlacement?i:"old"===t.textPlacement?e:n}}(),Y=t(function(t,e){A=0,z=-1,t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function X(t,e){t.each(function(){var t,n=h(this),i=n.text().split(/(\s+|<br>)/).reverse(),r=[],a=n.attr("y"),s=parseFloat(n.attr("dy")),o=n.text(null).append("tspan").attr("x",0).attr("y",a).attr("dy",s+"em");for(let c=0;c<i.length;c++)t=i[i.length-1-c],r.push(t),o.text(r.join(" ").trim()),(o.node().getComputedTextLength()>e||"<br>"===t)&&(r.pop(),o.text(r.join(" ").trim()),r="<br>"===t?[""]:[t],o=n.append("tspan").attr("x",0).attr("y",a).attr("dy","1.1em").text(t))})}t(X,"wrap");var J=t(function(t,e,n,i,r,a=!1){const{theme:s,look:o}=i,c=s?.includes("redux"),l=n%(i?.themeVariables?.THEME_COLOR_LIMIT??12)-1,d=t.append("g");e.section=l,d.attr("class",(e.class?e.class+" ":"")+"timeline-node section-"+l);const p=d.append("g"),u=d.append("g"),g=u.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(X,e.width).node().getBBox(),y=i.fontSize?.replace?i.fontSize.replace("px",""):i.fontSize;if(e.height=g.height+1.1*y*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,u.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),c&&u.attr("transform",`translate(${e.width/2}, ${a?e.padding/2+3:e.padding})`),Q(p,e,l,r,i),"neo"===o&&(d.attr("data-look","neo"),c)){const e=s.includes("dark"),n=t.node()?.ownerSVGElement??t.node(),i=h(n),r=i.attr("id")??"",a=r?`${r}-drop-shadow`:"drop-shadow";if(i.select(`#${a}`).empty()){const t=i.select("defs");(t.empty()?i.append("defs"):t).append("filter").attr("id",a).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",e?"0.2":"0.06").attr("flood-color",e?"#FFFFFF":"#000000")}}return e},"drawNode"),K=t(function(t,e,n){const i=t.append("g"),r=i.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(X,e.width).node().getBBox(),a=n.fontSize?.replace?n.fontSize.replace("px",""):n.fontSize;return i.remove(),r.height+1.1*a*.5+e.padding},"getVirtualNodeHeight"),Q=t(function(t,e,n,i,r){const{theme:a}=r,s=a?.includes("redux")?0:5,o=s>0?`M0 ${e.height-5} v${10-e.height} q0,-${s},${s},-${s} h${e.width-10} q${s},0,${s},${s} v${e.height-5} H0 Z`:`M0 ${e.height-5} v${-(e.height-5)} h${e.width} v${e.height} H0 Z`;t.append("path").attr("id",i+"-node-"+A++).attr("class","node-bkg node-"+e.type).attr("d",o),a?.includes("redux")||t.append("line").attr("class","node-line-"+n).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},"defaultBkg"),tt={drawRect:j,drawCircle:R,drawSection:W,drawText:P,drawLabel:F,drawTask:V,drawBackgroundRect:G,getTextObj:U,getNoteRect:q,initGraphics:Y,drawNode:J,getVirtualNodeHeight:K},et=t(function(t,e,n,i){const r=a(),{look:o,theme:c,themeVariables:d}=r,{useGradient:p,gradientStart:u,gradientStop:g}=d,y=r.timeline?.leftMargin??50;s.debug("timeline",i.db);const f=r.securityLevel;let m;"sandbox"===f&&(m=h("#i"+e));const x=h("sandbox"===f?m.nodes()[0].contentDocument.body:"body").select("#"+e);x.append("g");const b=i.db.getTasks(),k=i.db.getCommonDb().getDiagramTitle();s.debug("task",b),tt.initGraphics(x,e);const w=i.db.getSections();s.debug("sections",w);let _=0,$=0,v=0,S=0,E=50+y,T=50;S=50;let I=0,M=!0;w.forEach(function(t){const e={number:I,descr:t,section:I,width:150,padding:20,maxHeight:_},n=tt.getVirtualNodeHeight(x,e,r);s.debug("sectionHeight before draw",n),_=Math.max(_,n+20)});let H=0,L=0;s.debug("tasks.length",b.length);for(const[a,l]of b.entries()){const t={number:a,descr:l,section:l.section,width:150,padding:20,maxHeight:$},e=tt.getVirtualNodeHeight(x,t,r);s.debug("taskHeight before draw",e),$=Math.max($,e+20),H=Math.max(H,l.events.length);let n=0;for(const i of l.events){const t={descr:i,section:l.section,number:l.section,width:150,padding:20,maxHeight:50};n+=tt.getVirtualNodeHeight(x,t,r)}l.events.length>0&&(n+=10*(l.events.length-1)),L=Math.max(L,n)}s.debug("maxSectionHeight before draw",_),s.debug("maxTaskHeight before draw",$),w&&w.length>0?w.forEach(t=>{const n=b.filter(e=>e.section===t),i={number:I,descr:t,section:I,width:200*Math.max(n.length,1)-50,padding:20,maxHeight:_};s.debug("sectionNode",i);const a=x.append("g"),o=tt.drawNode(a,i,I,r,e);s.debug("sectionNode output",o),a.attr("transform",`translate(${E}, 50)`),T+=_+50,n.length>0&&nt(x,n,I,E,T,$,r,H,L,_,!1,e),E+=200*Math.max(n.length,1),T=50,I++}):(M=!1,nt(x,b,I,E,T,$,r,H,L,_,!0,e));const C=x.node().getBBox();if(s.debug("bounds",C),k&&x.append("text").text(k).attr("x","neo"===o?2*C.x+y:C.width/2-y).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),v=M?_+$+150:$+100,x.append("g").attr("class","lineWrapper").append("line").attr("x1",y).attr("y1",v).attr("x2",C.width+3*y).attr("y2",v).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${e}-arrowhead)`),"neo"===o&&p&&"neutral"!==c){const t=x.select("defs"),e=(t.empty()?x.append("defs"):t).append("linearGradient").attr("id",x.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");e.append("stop").attr("offset","0%").attr("stop-color",u).attr("stop-opacity",1),e.append("stop").attr("offset","100%").attr("stop-color",g).attr("stop-opacity",1)}l(void 0,x,r.timeline?.padding??50,r.timeline?.useMaxWidth??!1)},"draw"),nt=t(function(t,e,n,i,r,a,o,c,l,h,d,p){for(const u of e){const e={descr:u.task,section:n,number:n,width:150,padding:20,maxHeight:a};s.debug("taskNode",e);const c=t.append("g").attr("class","taskWrapper"),h=tt.drawNode(c,e,n,o,p).height;if(s.debug("taskHeight after draw",h),c.attr("transform",`translate(${i}, ${r})`),a=Math.max(a,h),u.events){const e=t.append("g").attr("class","lineWrapper");let s=a;r+=100,s+=it(t,u.events,n,i,r,o,p),r-=100,e.append("line").attr("x1",i+95).attr("y1",r+a).attr("x2",i+95).attr("y2",r+a+100+l+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${p}-arrowhead)`).attr("stroke-dasharray","5,5")}i+=200,d&&!o.timeline?.disableMulticolor&&n++}r-=10},"drawTasks"),it=t(function(t,e,n,i,r,a,o){let c=0;const l=r;r+=100;for(const h of e){const e={descr:h,section:n,number:n,width:150,padding:20,maxHeight:50};s.debug("eventNode",e);const l=t.append("g").attr("class","eventWrapper"),d=tt.drawNode(l,e,n,a,o,!0).height;c+=d,l.attr("transform",`translate(${i}, ${r})`),r=r+10+d}return r=l,c},"drawEvents"),rt={setConf:t(()=>{},"setConf"),draw:et},at=t(function(t,e,n,i){const r=a(),h=r.timeline?.leftMargin??50;s.debug("timeline",i.db);const d=o(e);d.append("g");const p=i.db.getTasks(),u=i.db.getCommonDb().getDiagramTitle();s.debug("task",p),tt.initGraphics(d);const g=i.db.getSections();s.debug("sections",g);let y=0,f=0;const m=50+h;let x=50;const b=x,k=m+230;let w=0;const _=g&&g.length>0,$=_?k:m+230,v=Math.max(50,580);g.forEach(function(t){const e={number:w,descr:t,section:w,width:v,padding:5,maxHeight:y},n=tt.getVirtualNodeHeight(d,e,r);s.debug("sectionHeight before draw",n),y=Math.max(y,n)});let S=0;s.debug("tasks.length",p.length);for(const[a,o]of p.entries()){const t={number:a,descr:o,section:o.section,width:200,padding:5,maxHeight:f},e=tt.getVirtualNodeHeight(d,t,r);s.debug("taskHeight before draw",e),f=Math.max(f,e);let n=0;for(const i of o.events){const t={descr:i,section:o.section,number:o.section,width:300,padding:5,maxHeight:50};n+=tt.getVirtualNodeHeight(d,t,r)}o.events.length>0&&(n+=10*(o.events.length-1)),S=Math.max(S,n)+0}s.debug("maxSectionHeight before draw",y),s.debug("maxTaskHeight before draw",f);const E=Math.max(f,S)+30;_?g.forEach(t=>{const e=p.filter(e=>e.section===t),n={number:w,descr:t,section:w,width:v,padding:5,maxHeight:y};s.debug("sectionNode",n);const i=d.append("g"),a=tt.drawNode(i,n,w,r);s.debug("sectionNode output",a);const o=$-230;i.attr("transform",`translate(${o}, ${x})`);const c=x+a.height+20;e.length>0&&st(d,e,w,$,c,f,r,E,!1);const l=e.length,h=a.height+20+E*Math.max(l,1)-(l>0?60:0);x+=h,w++}):st(d,p,w,$,x,f,r,E,!0);let T=d.node()?.getBBox();if(!T)throw new Error("bbox not found");if(s.debug("bounds",T),u){if(d.append("text").text(u).attr("x",T.width/2-h).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),T=d.node()?.getBBox(),!T)throw new Error("bbox not found");s.debug("bounds after title",T)}const[I]=c(r.fontSize),M=2*(I??16),H=.5*(I??16)+20,L=d.append("g").attr("class","lineWrapper");L.append("line").attr("x1",$).attr("y1",b-M).attr("x2",$).attr("y2",T.y+T.height+H).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),L.lower(),l(void 0,d,r.timeline?.padding??50,r.timeline?.useMaxWidth??!1)},"draw"),st=t(function(t,e,n,i,r,a,o,c,l){for(const h of e){const e={descr:h.task,section:n,number:n,width:200,padding:5,maxHeight:a};s.debug("taskNode",e);const d=t.append("g").attr("class","taskWrapper"),p=tt.drawNode(d,e,n,o),u=p.height;s.debug("taskHeight after draw",u);const g=i-20-p.width;if(d.attr("transform",`translate(${g}, ${r})`),a=Math.max(a,u),h.events&&h.events.length>0){const e=r,a=i+50;ot(t,h.events,n,i,a,e,o)}r+=c,l&&!o.timeline?.disableMulticolor&&n++}},"drawTasks"),ot=t(function(t,e,n,i,r,a,o){let c=a;for(const l of e){const e={descr:l,section:n,number:n,width:300,padding:5,maxHeight:0};s.debug("eventNode",e);const a=t.append("g").attr("class","eventWrapper"),h=tt.drawNode(a,e,n,o).height;a.attr("transform",`translate(${r}, ${c})`);const d=c+h/2;t.append("g").attr("class","lineWrapper").append("line").attr("x1",i).attr("y1",d).attr("x2",r).attr("y2",d).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),c=c+h+10}return c-a},"drawEvents"),ct={setConf:t(()=>{},"setConf"),draw:at},lt=t(t=>{const{theme:n}=e(),i=n?.includes("dark"),r=n?.includes("color"),a=t.svgId?.replace(/^#/,"")??"",s=a?`url(#${a}-drop-shadow)`:t.dropShadow??"none";let o="";for(let e=0;e<t.THEME_COLOR_LIMIT;e++){const n=""+(17-3*e),a=r?t.borderColorArray[e]:t.mainBkg,c=r?t.borderColorArray[e]:t.nodeBorder;o+=`\n .section-${e-1} rect,\n .section-${e-1} path,\n .section-${e-1} circle {\n fill: ${i&&r?t.mainBkg:a};\n stroke: ${c};\n stroke-width: ${t.strokeWidth};\n filter: ${s};\n }\n\n .section-${e-1} text {\n fill: ${t.nodeBorder};\n font-weight: ${t.fontWeight}\n }\n\n .node-icon-${e-1} {\n font-size: 40px;\n color: ${t["cScaleLabel"+e]};\n }\n\n .section-edge-${e-1} {\n stroke: ${t["cScale"+e]};\n }\n\n .edge-depth-${e-1} {\n stroke-width: ${n};\n }\n\n .section-${e-1} line {\n stroke: ${t["cScaleInv"+e]};\n stroke-width: 3;\n }\n\n .lineWrapper line {\n stroke: ${t.nodeBorder};\n stroke-width:${t.strokeWidth}\n }\n\n .disabled,\n .disabled circle,\n .disabled text {\n fill: ${t.tertiaryColor??"lightgray"};\n }\n\n .disabled text {\n fill: ${t.clusterBorder??"#efefef"};\n }\n `}return o},"genReduxSections"),ht=t(t=>{let e="";for(let a=0;a<t.THEME_COLOR_LIMIT;a++)t["lineColor"+a]=t["lineColor"+a]||t["cScaleInv"+a],n(t["lineColor"+a])?t["lineColor"+a]=i(t["lineColor"+a],20):t["lineColor"+a]=r(t["lineColor"+a],20);for(let n=0;n<t.THEME_COLOR_LIMIT;n++){const i=""+(17-3*n);e+=`\n .section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} path {\n fill: ${t["cScale"+n]};\n }\n .section-${n-1} text {\n fill: ${t["cScaleLabel"+n]};\n }\n .node-icon-${n-1} {\n font-size: 40px;\n color: ${t["cScaleLabel"+n]};\n }\n .section-edge-${n-1}{\n stroke: ${t["cScale"+n]};\n }\n .edge-depth-${n-1}{\n stroke-width: ${i};\n }\n .section-${n-1} line {\n stroke: ${t["cScaleInv"+n]} ;\n stroke-width: 3;\n }\n\n .lineWrapper line{\n stroke: ${t["cScaleLabel"+n]} ;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: ${t.tertiaryColor??"lightgray"};\n }\n .disabled text {\n fill: ${t.clusterBorder??"#efefef"};\n }\n `}return e},"genSections"),dt=t(t=>{const{theme:n}=e(),i=n?.includes("redux"),r="neutral"===n,a=t.svgId?.replace(/^#/,"")??"";let s="";if(t.useGradient&&a&&t.THEME_COLOR_LIMIT&&!r)for(let e=0;e<t.THEME_COLOR_LIMIT;e++)s+=`\n .section-${e-1}[data-look="neo"] rect,\n .section-${e-1}[data-look="neo"] path,\n .section-${e-1}[data-look="neo"] circle {\n fill: ${t.mainBkg};\n stroke: url(#${a}-gradient);\n stroke-width: 2;\n }\n .section-${e-1}[data-look="neo"] line {\n stroke: url(#${a}-gradient);\n stroke-width: 2;\n }`;return`\n .edge {\n stroke-width: 3;\n }\n ${i?lt(t):ht(t)}\n ${s}\n .section-root rect, .section-root path, .section-root circle {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .eventWrapper {\n filter: brightness(120%);\n }\n`},"getStyles"),pt={db:m,renderer:{setConf:t(()=>{},"setConf"),draw:t((t,e,n,i)=>"TD"===(i?.db?.getDirection?.()??"LR")?ct.draw(t,e,n,i):rt.draw(t,e,n,i),"draw")},parser:f,styles:dt};export{pt as diagram};
1
+ import{_ as t,z as e,a9 as n,aa as i,ab as r,c as a,l as s,F as o,a1 as c,ac as l,d as h,u as d,ad as p,q as u}from"./mermaid.core-jR_k1I8D.js";import{d as g}from"./arc-Dlh78dPq.js";import"./index-Dx_1eu1W.js";import"./RemoteLifeOSBlock-BjYrjRa2.js";import"./App-C21-MM7L.js";import"./index-BTavN9lk.js";import"./file-editor-index-C6CU7Fik.js";import"./purify.es-BNLkGfTg.js";import"./marked.esm-BBjA1da9.js";var y=function(){var e=t(function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},"o"),n=[6,11,13,14,15,17,19,20,23,24],i=[1,12],r=[1,13],a=[1,14],s=[1,15],o=[1,16],c=[1,19],l=[1,20],h={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:t(function(t,e,n,i,r,a,s){var o=a.length-1;switch(r){case 1:return a[o-1];case 3:i.setDirection("LR");break;case 4:i.setDirection("TD");break;case 5:case 9:case 10:this.$=[];break;case 6:a[o-1].push(a[o]),this.$=a[o-1];break;case 7:case 8:this.$=a[o];break;case 11:i.getCommonDb().setDiagramTitle(a[o].substr(6)),this.$=a[o].substr(6);break;case 12:this.$=a[o].trim(),i.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=a[o].trim(),i.getCommonDb().setAccDescription(this.$);break;case 15:i.addSection(a[o].substr(8)),this.$=a[o].substr(8);break;case 18:i.addTask(a[o],0,""),this.$=a[o];break;case 19:i.addEvent(a[o].substr(2)),this.$=a[o]}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(n,[2,5],{5:6}),e(n,[2,2]),e(n,[2,3]),e(n,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:i,15:r,17:a,19:s,20:o,21:17,22:18,23:c,24:l},e(n,[2,10],{1:[2,1]}),e(n,[2,6]),{12:21,14:i,15:r,17:a,19:s,20:o,21:17,22:18,23:c,24:l},e(n,[2,8]),e(n,[2,9]),e(n,[2,11]),{16:[1,22]},{18:[1,23]},e(n,[2,14]),e(n,[2,15]),e(n,[2,16]),e(n,[2,17]),e(n,[2,18]),e(n,[2,19]),e(n,[2,7]),e(n,[2,12]),e(n,[2,13])],defaultActions:{},parseError:t(function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},"parseError"),parse:t(function(e){var n=this,i=[0],r=[],a=[null],s=[],o=this.table,c="",l=0,h=0,d=s.slice.call(arguments,1),p=Object.create(this.lexer),u={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(u.yy[g]=this.yy[g]);p.setInput(e,u.yy),u.yy.lexer=p,u.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var y=p.yylloc;s.push(y);var f=p.options&&p.options.ranges;function m(){var t;return"number"!=typeof(t=r.pop()||p.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,t(function(t){i.length=i.length-2*t,a.length=a.length-t,s.length=s.length-t},"popStack"),t(m,"lex");for(var x,b,k,w,_,$,v,S,E={};;){if(b=i[i.length-1],this.defaultActions[b]?k=this.defaultActions[b]:(null==x&&(x=m()),k=o[b]&&o[b][x]),void 0===k||!k.length||!k[0]){var T;for(_ in S=[],o[b])this.terminals_[_]&&_>2&&S.push("'"+this.terminals_[_]+"'");T=p.showPosition?"Parse error on line "+(l+1)+":\n"+p.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[x]||x)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==x?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(T,{text:p.match,token:this.terminals_[x]||x,line:p.yylineno,loc:y,expected:S})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+x);switch(k[0]){case 1:i.push(x),a.push(p.yytext),s.push(p.yylloc),i.push(k[1]),x=null,h=p.yyleng,c=p.yytext,l=p.yylineno,y=p.yylloc;break;case 2:if($=this.productions_[k[1]][1],E.$=a[a.length-$],E._$={first_line:s[s.length-($||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-($||1)].first_column,last_column:s[s.length-1].last_column},f&&(E._$.range=[s[s.length-($||1)].range[0],s[s.length-1].range[1]]),void 0!==(w=this.performAction.apply(E,[c,h,l,u.yy,k[1],a,s].concat(d))))return w;$&&(i=i.slice(0,-1*$*2),a=a.slice(0,-1*$),s=s.slice(0,-1*$)),i.push(this.productions_[k[1]][0]),a.push(E.$),s.push(E._$),v=o[i[i.length-2]][i[i.length-1]],i.push(v);break;case 3:return!0}}return!0},"parse")},d=function(){return{EOF:1,parseError:t(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:t(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:t(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:t(function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:t(function(t){this.unput(this.match.slice(t))},"less"),pastInput:t(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:t(function(t,e){var n,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in r)this[a]=r[a];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),a=0;a<r.length;a++)if((n=this._input.match(this.rules[r[a]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){return this.next()||this.lex()},"lex"),begin:t(function(t){this.conditionStack.push(t)},"begin"),popState:t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:t(function(t){this.begin(t)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(t,e,n,i){switch(n){case 0:case 1:case 3:case 4:break;case 2:return 13;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}}}();function p(){this.yy={}}return h.lexer=d,t(p,"Parser"),p.prototype=h,h.Parser=p,new p}();y.parser=y;var f=y,m={};d(m,{addEvent:()=>C,addSection:()=>I,addTask:()=>L,addTaskOrg:()=>N,clear:()=>S,default:()=>O,getCommonDb:()=>v,getDirection:()=>T,getSections:()=>M,getTasks:()=>H,setDirection:()=>E});var x="",b=0,k="LR",w=[],_=[],$=[],v=t(()=>p,"getCommonDb"),S=t(function(){w.length=0,_.length=0,x="",$.length=0,k="LR",u()},"clear"),E=t(function(t){k=t},"setDirection"),T=t(function(){return k},"getDirection"),I=t(function(t){x=t,w.push(t)},"addSection"),M=t(function(){return w},"getSections"),H=t(function(){let t=D(),e=0;for(;!t&&e<100;)t=D(),e++;return _.push(...$),_},"getTasks"),L=t(function(t,e,n){const i={id:b++,section:x,type:x,task:t,score:e||0,events:n?[n]:[]};$.push(i)},"addTask"),C=t(function(t){$.find(t=>t.id===b-1).events.push(t)},"addEvent"),N=t(function(t){const e={section:x,type:x,description:t,task:t,classes:[]};_.push(e)},"addTaskOrg"),D=t(function(){const e=t(function(t){return $[t].processed},"compileTask");let n=!0;for(const[t,i]of $.entries())e(t),n=n&&i.processed;return n},"compileTasks"),O={clear:S,getCommonDb:v,getDirection:T,setDirection:E,addSection:I,getSections:M,getTasks:H,addTask:L,addTaskOrg:N,addEvent:C},A=0,j=t(function(t,e){const n=t.append("rect");return n.attr("x",e.x),n.attr("y",e.y),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("width",e.width),n.attr("height",e.height),n.attr("rx",e.rx),n.attr("ry",e.ry),void 0!==e.class&&n.attr("class",e.class),n},"drawRect"),B=t(function(e,n){const i=e.append("circle").attr("cx",n.cx).attr("cy",n.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),r=e.append("g");function a(t){const e=g().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(15/2.2);t.append("path").attr("class","mouth").attr("d",e).attr("transform","translate("+n.cx+","+(n.cy+2)+")")}function s(t){const e=g().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(15/2.2);t.append("path").attr("class","mouth").attr("d",e).attr("transform","translate("+n.cx+","+(n.cy+7)+")")}function o(t){t.append("line").attr("class","mouth").attr("stroke",2).attr("x1",n.cx-5).attr("y1",n.cy+7).attr("x2",n.cx+5).attr("y2",n.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return r.append("circle").attr("cx",n.cx-5).attr("cy",n.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),r.append("circle").attr("cx",n.cx+5).attr("cy",n.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),t(a,"smile"),t(s,"sad"),t(o,"ambivalent"),n.score>3?a(r):n.score<3?s(r):o(r),i},"drawFace"),R=t(function(t,e){const n=t.append("circle");return n.attr("cx",e.cx),n.attr("cy",e.cy),n.attr("class","actor-"+e.pos),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("r",e.r),void 0!==n.class&&n.attr("class",n.class),void 0!==e.title&&n.append("title").text(e.title),n},"drawCircle"),P=t(function(t,e){const n=e.text.replace(/<br\s*\/?>/gi," "),i=t.append("text");i.attr("x",e.x),i.attr("y",e.y),i.attr("class","legend"),i.style("text-anchor",e.anchor),void 0!==e.class&&i.attr("class",e.class);const r=i.append("tspan");return r.attr("x",e.x+2*e.textMargin),r.text(n),i},"drawText"),W=t(function(e,n){function i(t,e,n,i,r){return t+","+e+" "+(t+n)+","+e+" "+(t+n)+","+(e+i-r)+" "+(t+n-1.2*r)+","+(e+i)+" "+t+","+(e+i)}t(i,"genPoints");const r=e.append("polygon");r.attr("points",i(n.x,n.y,50,20,7)),r.attr("class","labelBox"),n.y=n.y+n.labelMargin,n.x=n.x+.5*n.labelMargin,P(e,n)},"drawLabel"),F=t(function(t,e,n){const i=t.append("g"),r=U();r.x=e.x,r.y=e.y,r.fill=e.fill,r.width=n.width,r.height=n.height,r.class="journey-section section-type-"+e.num,r.rx=3,r.ry=3,j(i,r),Z(n)(e.text,i,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+e.num},n,e.colour)},"drawSection"),z=-1,V=t(function(t,e,n,i){const r=e.x+n.width/2,a=t.append("g");z++,a.append("line").attr("id",i+"-task"+z).attr("x1",r).attr("y1",e.y).attr("x2",r).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),B(a,{cx:r,cy:300+30*(5-e.score),score:e.score});const s=U();s.x=e.x,s.y=e.y,s.fill=e.fill,s.width=n.width,s.height=n.height,s.class="task task-type-"+e.num,s.rx=3,s.ry=3,j(a,s),Z(n)(e.task,a,s.x,s.y,s.width,s.height,{class:"task"},n,e.colour)},"drawTask"),G=t(function(t,e){j(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),q=t(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),U=t(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Z=function(){function e(t,e,n,i,a,s,o,c){r(e.append("text").attr("x",n+a/2).attr("y",i+s/2+5).style("font-color",c).style("text-anchor","middle").text(t),o)}function n(t,e,n,i,a,s,o,c,l){const{taskFontSize:h,taskFontFamily:d}=c,p=t.split(/<br\s*\/?>/gi);for(let u=0;u<p.length;u++){const t=u*h-h*(p.length-1)/2,c=e.append("text").attr("x",n+a/2).attr("y",i).attr("fill",l).style("text-anchor","middle").style("font-size",h).style("font-family",d);c.append("tspan").attr("x",n+a/2).attr("dy",t).text(p[u]),c.attr("y",i+s/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),r(c,o)}}function i(t,e,i,a,s,o,c,l){const h=e.append("switch"),d=h.append("foreignObject").attr("x",i).attr("y",a).attr("width",s).attr("height",o).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");d.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),n(t,h,i,a,s,o,c,l),r(d,c)}function r(t,e){for(const n in e)n in e&&t.attr(n,e[n])}return t(e,"byText"),t(n,"byTspan"),t(i,"byFo"),t(r,"_setTextAttrs"),function(t){return"fo"===t.textPlacement?i:"old"===t.textPlacement?e:n}}(),Y=t(function(t,e){A=0,z=-1,t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function X(t,e){t.each(function(){var t,n=h(this),i=n.text().split(/(\s+|<br>)/).reverse(),r=[],a=n.attr("y"),s=parseFloat(n.attr("dy")),o=n.text(null).append("tspan").attr("x",0).attr("y",a).attr("dy",s+"em");for(let c=0;c<i.length;c++)t=i[i.length-1-c],r.push(t),o.text(r.join(" ").trim()),(o.node().getComputedTextLength()>e||"<br>"===t)&&(r.pop(),o.text(r.join(" ").trim()),r="<br>"===t?[""]:[t],o=n.append("tspan").attr("x",0).attr("y",a).attr("dy","1.1em").text(t))})}t(X,"wrap");var J=t(function(t,e,n,i,r,a=!1){const{theme:s,look:o}=i,c=s?.includes("redux"),l=n%(i?.themeVariables?.THEME_COLOR_LIMIT??12)-1,d=t.append("g");e.section=l,d.attr("class",(e.class?e.class+" ":"")+"timeline-node section-"+l);const p=d.append("g"),u=d.append("g"),g=u.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(X,e.width).node().getBBox(),y=i.fontSize?.replace?i.fontSize.replace("px",""):i.fontSize;if(e.height=g.height+1.1*y*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,u.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),c&&u.attr("transform",`translate(${e.width/2}, ${a?e.padding/2+3:e.padding})`),Q(p,e,l,r,i),"neo"===o&&(d.attr("data-look","neo"),c)){const e=s.includes("dark"),n=t.node()?.ownerSVGElement??t.node(),i=h(n),r=i.attr("id")??"",a=r?`${r}-drop-shadow`:"drop-shadow";if(i.select(`#${a}`).empty()){const t=i.select("defs");(t.empty()?i.append("defs"):t).append("filter").attr("id",a).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",e?"0.2":"0.06").attr("flood-color",e?"#FFFFFF":"#000000")}}return e},"drawNode"),K=t(function(t,e,n){const i=t.append("g"),r=i.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(X,e.width).node().getBBox(),a=n.fontSize?.replace?n.fontSize.replace("px",""):n.fontSize;return i.remove(),r.height+1.1*a*.5+e.padding},"getVirtualNodeHeight"),Q=t(function(t,e,n,i,r){const{theme:a}=r,s=a?.includes("redux")?0:5,o=s>0?`M0 ${e.height-5} v${10-e.height} q0,-${s},${s},-${s} h${e.width-10} q${s},0,${s},${s} v${e.height-5} H0 Z`:`M0 ${e.height-5} v${-(e.height-5)} h${e.width} v${e.height} H0 Z`;t.append("path").attr("id",i+"-node-"+A++).attr("class","node-bkg node-"+e.type).attr("d",o),a?.includes("redux")||t.append("line").attr("class","node-line-"+n).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},"defaultBkg"),tt={drawRect:j,drawCircle:R,drawSection:F,drawText:P,drawLabel:W,drawTask:V,drawBackgroundRect:G,getTextObj:q,getNoteRect:U,initGraphics:Y,drawNode:J,getVirtualNodeHeight:K},et=t(function(t,e,n,i){const r=a(),{look:o,theme:c,themeVariables:d}=r,{useGradient:p,gradientStart:u,gradientStop:g}=d,y=r.timeline?.leftMargin??50;s.debug("timeline",i.db);const f=r.securityLevel;let m;"sandbox"===f&&(m=h("#i"+e));const x=h("sandbox"===f?m.nodes()[0].contentDocument.body:"body").select("#"+e);x.append("g");const b=i.db.getTasks(),k=i.db.getCommonDb().getDiagramTitle();s.debug("task",b),tt.initGraphics(x,e);const w=i.db.getSections();s.debug("sections",w);let _=0,$=0,v=0,S=0,E=50+y,T=50;S=50;let I=0,M=!0;w.forEach(function(t){const e={number:I,descr:t,section:I,width:150,padding:20,maxHeight:_},n=tt.getVirtualNodeHeight(x,e,r);s.debug("sectionHeight before draw",n),_=Math.max(_,n+20)});let H=0,L=0;s.debug("tasks.length",b.length);for(const[a,l]of b.entries()){const t={number:a,descr:l,section:l.section,width:150,padding:20,maxHeight:$},e=tt.getVirtualNodeHeight(x,t,r);s.debug("taskHeight before draw",e),$=Math.max($,e+20),H=Math.max(H,l.events.length);let n=0;for(const i of l.events){const t={descr:i,section:l.section,number:l.section,width:150,padding:20,maxHeight:50};n+=tt.getVirtualNodeHeight(x,t,r)}l.events.length>0&&(n+=10*(l.events.length-1)),L=Math.max(L,n)}s.debug("maxSectionHeight before draw",_),s.debug("maxTaskHeight before draw",$),w&&w.length>0?w.forEach(t=>{const n=b.filter(e=>e.section===t),i={number:I,descr:t,section:I,width:200*Math.max(n.length,1)-50,padding:20,maxHeight:_};s.debug("sectionNode",i);const a=x.append("g"),o=tt.drawNode(a,i,I,r,e);s.debug("sectionNode output",o),a.attr("transform",`translate(${E}, 50)`),T+=_+50,n.length>0&&nt(x,n,I,E,T,$,r,H,L,_,!1,e),E+=200*Math.max(n.length,1),T=50,I++}):(M=!1,nt(x,b,I,E,T,$,r,H,L,_,!0,e));const C=x.node().getBBox();if(s.debug("bounds",C),k&&x.append("text").text(k).attr("x","neo"===o?2*C.x+y:C.width/2-y).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),v=M?_+$+150:$+100,x.append("g").attr("class","lineWrapper").append("line").attr("x1",y).attr("y1",v).attr("x2",C.width+3*y).attr("y2",v).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${e}-arrowhead)`),"neo"===o&&p&&"neutral"!==c){const t=x.select("defs"),e=(t.empty()?x.append("defs"):t).append("linearGradient").attr("id",x.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");e.append("stop").attr("offset","0%").attr("stop-color",u).attr("stop-opacity",1),e.append("stop").attr("offset","100%").attr("stop-color",g).attr("stop-opacity",1)}l(void 0,x,r.timeline?.padding??50,r.timeline?.useMaxWidth??!1)},"draw"),nt=t(function(t,e,n,i,r,a,o,c,l,h,d,p){for(const u of e){const e={descr:u.task,section:n,number:n,width:150,padding:20,maxHeight:a};s.debug("taskNode",e);const c=t.append("g").attr("class","taskWrapper"),h=tt.drawNode(c,e,n,o,p).height;if(s.debug("taskHeight after draw",h),c.attr("transform",`translate(${i}, ${r})`),a=Math.max(a,h),u.events){const e=t.append("g").attr("class","lineWrapper");let s=a;r+=100,s+=it(t,u.events,n,i,r,o,p),r-=100,e.append("line").attr("x1",i+95).attr("y1",r+a).attr("x2",i+95).attr("y2",r+a+100+l+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${p}-arrowhead)`).attr("stroke-dasharray","5,5")}i+=200,d&&!o.timeline?.disableMulticolor&&n++}r-=10},"drawTasks"),it=t(function(t,e,n,i,r,a,o){let c=0;const l=r;r+=100;for(const h of e){const e={descr:h,section:n,number:n,width:150,padding:20,maxHeight:50};s.debug("eventNode",e);const l=t.append("g").attr("class","eventWrapper"),d=tt.drawNode(l,e,n,a,o,!0).height;c+=d,l.attr("transform",`translate(${i}, ${r})`),r=r+10+d}return r=l,c},"drawEvents"),rt={setConf:t(()=>{},"setConf"),draw:et},at=t(function(t,e,n,i){const r=a(),h=r.timeline?.leftMargin??50;s.debug("timeline",i.db);const d=o(e);d.append("g");const p=i.db.getTasks(),u=i.db.getCommonDb().getDiagramTitle();s.debug("task",p),tt.initGraphics(d);const g=i.db.getSections();s.debug("sections",g);let y=0,f=0;const m=50+h;let x=50;const b=x,k=m+230;let w=0;const _=g&&g.length>0,$=_?k:m+230,v=Math.max(50,580);g.forEach(function(t){const e={number:w,descr:t,section:w,width:v,padding:5,maxHeight:y},n=tt.getVirtualNodeHeight(d,e,r);s.debug("sectionHeight before draw",n),y=Math.max(y,n)});let S=0;s.debug("tasks.length",p.length);for(const[a,o]of p.entries()){const t={number:a,descr:o,section:o.section,width:200,padding:5,maxHeight:f},e=tt.getVirtualNodeHeight(d,t,r);s.debug("taskHeight before draw",e),f=Math.max(f,e);let n=0;for(const i of o.events){const t={descr:i,section:o.section,number:o.section,width:300,padding:5,maxHeight:50};n+=tt.getVirtualNodeHeight(d,t,r)}o.events.length>0&&(n+=10*(o.events.length-1)),S=Math.max(S,n)+0}s.debug("maxSectionHeight before draw",y),s.debug("maxTaskHeight before draw",f);const E=Math.max(f,S)+30;_?g.forEach(t=>{const e=p.filter(e=>e.section===t),n={number:w,descr:t,section:w,width:v,padding:5,maxHeight:y};s.debug("sectionNode",n);const i=d.append("g"),a=tt.drawNode(i,n,w,r);s.debug("sectionNode output",a);const o=$-230;i.attr("transform",`translate(${o}, ${x})`);const c=x+a.height+20;e.length>0&&st(d,e,w,$,c,f,r,E,!1);const l=e.length,h=a.height+20+E*Math.max(l,1)-(l>0?60:0);x+=h,w++}):st(d,p,w,$,x,f,r,E,!0);let T=d.node()?.getBBox();if(!T)throw new Error("bbox not found");if(s.debug("bounds",T),u){if(d.append("text").text(u).attr("x",T.width/2-h).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),T=d.node()?.getBBox(),!T)throw new Error("bbox not found");s.debug("bounds after title",T)}const[I]=c(r.fontSize),M=2*(I??16),H=.5*(I??16)+20,L=d.append("g").attr("class","lineWrapper");L.append("line").attr("x1",$).attr("y1",b-M).attr("x2",$).attr("y2",T.y+T.height+H).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),L.lower(),l(void 0,d,r.timeline?.padding??50,r.timeline?.useMaxWidth??!1)},"draw"),st=t(function(t,e,n,i,r,a,o,c,l){for(const h of e){const e={descr:h.task,section:n,number:n,width:200,padding:5,maxHeight:a};s.debug("taskNode",e);const d=t.append("g").attr("class","taskWrapper"),p=tt.drawNode(d,e,n,o),u=p.height;s.debug("taskHeight after draw",u);const g=i-20-p.width;if(d.attr("transform",`translate(${g}, ${r})`),a=Math.max(a,u),h.events&&h.events.length>0){const e=r,a=i+50;ot(t,h.events,n,i,a,e,o)}r+=c,l&&!o.timeline?.disableMulticolor&&n++}},"drawTasks"),ot=t(function(t,e,n,i,r,a,o){let c=a;for(const l of e){const e={descr:l,section:n,number:n,width:300,padding:5,maxHeight:0};s.debug("eventNode",e);const a=t.append("g").attr("class","eventWrapper"),h=tt.drawNode(a,e,n,o).height;a.attr("transform",`translate(${r}, ${c})`);const d=c+h/2;t.append("g").attr("class","lineWrapper").append("line").attr("x1",i).attr("y1",d).attr("x2",r).attr("y2",d).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),c=c+h+10}return c-a},"drawEvents"),ct={setConf:t(()=>{},"setConf"),draw:at},lt=t(t=>{const{theme:n}=e(),i=n?.includes("dark"),r=n?.includes("color"),a=t.svgId?.replace(/^#/,"")??"",s=a?`url(#${a}-drop-shadow)`:t.dropShadow??"none";let o="";for(let e=0;e<t.THEME_COLOR_LIMIT;e++){const n=""+(17-3*e),a=r?t.borderColorArray[e]:t.mainBkg,c=r?t.borderColorArray[e]:t.nodeBorder;o+=`\n .section-${e-1} rect,\n .section-${e-1} path,\n .section-${e-1} circle {\n fill: ${i&&r?t.mainBkg:a};\n stroke: ${c};\n stroke-width: ${t.strokeWidth};\n filter: ${s};\n }\n\n .section-${e-1} text {\n fill: ${t.nodeBorder};\n font-weight: ${t.fontWeight}\n }\n\n .node-icon-${e-1} {\n font-size: 40px;\n color: ${t["cScaleLabel"+e]};\n }\n\n .section-edge-${e-1} {\n stroke: ${t["cScale"+e]};\n }\n\n .edge-depth-${e-1} {\n stroke-width: ${n};\n }\n\n .section-${e-1} line {\n stroke: ${t["cScaleInv"+e]};\n stroke-width: 3;\n }\n\n .lineWrapper line {\n stroke: ${t.nodeBorder};\n stroke-width:${t.strokeWidth}\n }\n\n .disabled,\n .disabled circle,\n .disabled text {\n fill: ${t.tertiaryColor??"lightgray"};\n }\n\n .disabled text {\n fill: ${t.clusterBorder??"#efefef"};\n }\n `}return o},"genReduxSections"),ht=t(t=>{let e="";for(let a=0;a<t.THEME_COLOR_LIMIT;a++)t["lineColor"+a]=t["lineColor"+a]||t["cScaleInv"+a],n(t["lineColor"+a])?t["lineColor"+a]=i(t["lineColor"+a],20):t["lineColor"+a]=r(t["lineColor"+a],20);for(let n=0;n<t.THEME_COLOR_LIMIT;n++){const i=""+(17-3*n);e+=`\n .section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} path {\n fill: ${t["cScale"+n]};\n }\n .section-${n-1} text {\n fill: ${t["cScaleLabel"+n]};\n }\n .node-icon-${n-1} {\n font-size: 40px;\n color: ${t["cScaleLabel"+n]};\n }\n .section-edge-${n-1}{\n stroke: ${t["cScale"+n]};\n }\n .edge-depth-${n-1}{\n stroke-width: ${i};\n }\n .section-${n-1} line {\n stroke: ${t["cScaleInv"+n]} ;\n stroke-width: 3;\n }\n\n .lineWrapper line{\n stroke: ${t["cScaleLabel"+n]} ;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: ${t.tertiaryColor??"lightgray"};\n }\n .disabled text {\n fill: ${t.clusterBorder??"#efefef"};\n }\n `}return e},"genSections"),dt=t(t=>{const{theme:n}=e(),i=n?.includes("redux"),r="neutral"===n,a=t.svgId?.replace(/^#/,"")??"";let s="";if(t.useGradient&&a&&t.THEME_COLOR_LIMIT&&!r)for(let e=0;e<t.THEME_COLOR_LIMIT;e++)s+=`\n .section-${e-1}[data-look="neo"] rect,\n .section-${e-1}[data-look="neo"] path,\n .section-${e-1}[data-look="neo"] circle {\n fill: ${t.mainBkg};\n stroke: url(#${a}-gradient);\n stroke-width: 2;\n }\n .section-${e-1}[data-look="neo"] line {\n stroke: url(#${a}-gradient);\n stroke-width: 2;\n }`;return`\n .edge {\n stroke-width: 3;\n }\n ${i?lt(t):ht(t)}\n ${s}\n .section-root rect, .section-root path, .section-root circle {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .eventWrapper {\n filter: brightness(120%);\n }\n`},"getStyles"),pt={db:m,renderer:{setConf:t(()=>{},"setConf"),draw:t((t,e,n,i)=>"TD"===(i?.db?.getDirection?.()??"LR")?ct.draw(t,e,n,i):rt.draw(t,e,n,i),"draw")},parser:f,styles:dt};export{pt as diagram};
@@ -1 +1 @@
1
- import e from"./typescript-DI7mmMRd.js";import t from"./css-l46fsARh.js";import s from"./javascript-DFyEbC5y.js";import n from"./glsl-BDbjGBhJ.js";import i from"./html-Z-jPWkqI.js";import c from"./sql-BhJCBb_s.js";import m from"./xml-BsgRw6d1.js";import"./c-BmJt9k-y.js";import"./java-DtRXFtDl.js";const l=Object.freeze(JSON.parse('{"fileTypes":["js","jsx","ts","tsx","html","vue","svelte","php","res"],"injectTo":["source.ts","source.js"],"injectionSelector":"L:source.js -comment -string, L:source.js -comment -string, L:source.jsx -comment -string, L:source.js.jsx -comment -string, L:source.ts -comment -string, L:source.tsx -comment -string, L:source.rescript -comment -string, L:source.vue -comment -string, L:source.svelte -comment -string, L:source.php -comment -string, L:source.rescript -comment -string","injections":{"L:source":{"patterns":[{"match":"<","name":"invalid.illegal.bad-angle-bracket.html"}]}},"name":"es-tag-css","patterns":[{"begin":"(?i)(\\\\s?/\\\\*\\\\s?((?:|inline-)css)\\\\s?\\\\*/\\\\s?)(`)","beginCaptures":{"1":{"name":"comment.block"}},"end":"(`)","patterns":[{"include":"source.ts#template-substitution-element"},{"include":"source.css"},{"include":"inline.es6-htmlx#template"}]},{"begin":"(?i)(\\\\s*((?:|inline-)css))(`)","beginCaptures":{"1":{"name":"comment.block"}},"end":"(`)","patterns":[{"include":"source.ts#template-substitution-element"},{"include":"source.css"},{"include":"inline.es6-htmlx#template"},{"include":"string.quoted.other.template.js"}]},{"begin":"(?i)(?<=[(,:=\\\\s]|\\\\$\\\\()\\\\s*(((/\\\\*)|(//))\\\\s?((?:|inline-)css) {0,1000}\\\\*?/?) {0,1000}$","beginCaptures":{"1":{"name":"comment.line"}},"end":"(`).*","patterns":[{"begin":"\\\\G()","end":"(`)"},{"include":"source.ts#template-substitution-element"},{"include":"source.css"}]},{"begin":"(\\\\$\\\\{)","beginCaptures":{"1":{"name":"entity.name.tag"}},"end":"(})","endCaptures":{"1":{"name":"entity.name.tag"}},"patterns":[{"include":"source.ts#template-substitution-element"},{"include":"source.js"}]}],"scopeName":"inline.es6-css","embeddedLangs":["typescript","css","javascript"]}')),r=[...e,...t,...s,l],a=Object.freeze(JSON.parse('{"fileTypes":["js","jsx","ts","tsx","html","vue","svelte","php","res"],"injectTo":["source.ts","source.js"],"injectionSelector":"L:source.js -comment -string, L:source.js -comment -string, L:source.jsx -comment -string, L:source.js.jsx -comment -string, L:source.ts -comment -string, L:source.tsx -comment -string, L:source.rescript -comment -string","injections":{"L:source":{"patterns":[{"match":"<","name":"invalid.illegal.bad-angle-bracket.html"}]}},"name":"es-tag-glsl","patterns":[{"begin":"(?i)(\\\\s?/\\\\*\\\\s?((?:|inline-)glsl)\\\\s?\\\\*/\\\\s?)(`)","beginCaptures":{"1":{"name":"comment.block"}},"end":"(`)","patterns":[{"include":"source.ts#template-substitution-element"},{"include":"source.glsl"},{"include":"inline.es6-htmlx#template"}]},{"begin":"(?i)(\\\\s*((?:|inline-)glsl))(`)","beginCaptures":{"1":{"name":"comment.block"}},"end":"(`)","patterns":[{"include":"source.ts#template-substitution-element"},{"include":"source.glsl"},{"include":"inline.es6-htmlx#template"},{"include":"string.quoted.other.template.js"}]},{"begin":"(?i)(?<=[(,:=\\\\s]|\\\\$\\\\()\\\\s*(((/\\\\*)|(//))\\\\s?((?:|inline-)glsl) {0,1000}\\\\*?/?) {0,1000}$","beginCaptures":{"1":{"name":"comment.line"}},"end":"(`).*","patterns":[{"begin":"\\\\G()","end":"(`)"},{"include":"source.ts#template-substitution-element"},{"include":"source.glsl"}]},{"begin":"(\\\\$\\\\{)","beginCaptures":{"1":{"name":"entity.name.tag"}},"end":"(})","endCaptures":{"1":{"name":"entity.name.tag"}},"patterns":[{"include":"source.ts#template-substitution-element"},{"include":"source.js"}]}],"scopeName":"inline.es6-glsl","embeddedLangs":["typescript","glsl","javascript"]}')),o=[...e,...n,...s,a],u=Object.freeze(JSON.parse('{"fileTypes":["js","jsx","ts","tsx","html","vue","svelte","php","res"],"injectTo":["source.ts","source.js"],"injectionSelector":"L:source.js -comment -string, L:source.js -comment -string, L:source.jsx -comment -string, L:source.js.jsx -comment -string, L:source.ts -comment -string, L:source.tsx -comment -string, L:source.rescript -comment -string","injections":{"L:source":{"patterns":[{"match":"<","name":"invalid.illegal.bad-angle-bracket.html"}]}},"name":"es-tag-html","patterns":[{"begin":"(?i)(\\\\s?/\\\\*\\\\s?(html|template|inline-html|inline-template)\\\\s?\\\\*/\\\\s?)(`)","beginCaptures":{"1":{"name":"comment.block"}},"end":"(`)","patterns":[{"include":"source.ts#template-substitution-element"},{"include":"text.html.basic"},{"include":"inline.es6-htmlx#template"}]},{"begin":"(?i)(\\\\s*(html|template|inline-html|inline-template))(`)","beginCaptures":{"1":{"name":"comment.block"}},"end":"(`)","patterns":[{"include":"source.ts#template-substitution-element"},{"include":"text.html.basic"},{"include":"inline.es6-htmlx#template"},{"include":"string.quoted.other.template.js"}]},{"begin":"(?i)(?<=[(,:=\\\\s]|\\\\$\\\\()\\\\s*(((/\\\\*)|(//))\\\\s?(html|template|inline-html|inline-template) {0,1000}\\\\*?/?) {0,1000}$","beginCaptures":{"1":{"name":"comment.line"}},"end":"(`).*","patterns":[{"begin":"\\\\G()","end":"(`)"},{"include":"source.ts#template-substitution-element"},{"include":"text.html.basic"}]},{"begin":"(\\\\$\\\\{)","beginCaptures":{"1":{"name":"entity.name.tag"}},"end":"(})","endCaptures":{"1":{"name":"entity.name.tag"}},"patterns":[{"include":"source.ts#template-substitution-element"},{"include":"source.js"}]},{"begin":"(\\\\$\\\\(`)","beginCaptures":{"1":{"name":"entity.name.tag"}},"end":"(`\\\\))","endCaptures":{"1":{"name":"entity.name.tag"}},"patterns":[{"include":"source.ts#template-substitution-element"},{"include":"source.js"}]}],"scopeName":"inline.es6-html","embeddedLangs":["typescript","html","javascript"]}')),p=[...e,...i,...s,u],g=Object.freeze(JSON.parse('{"fileTypes":["js","jsx","ts","tsx","html","vue","svelte","php","res"],"injectTo":["source.ts","source.js"],"injectionSelector":"L:source.js -comment -string, L:source.jsx -comment -string, L:source.js.jsx -comment -string, L:source.ts -comment -string, L:source.tsx -comment -string, L:source.rescript -comment -string","injections":{"L:source":{"patterns":[{"match":"<","name":"invalid.illegal.bad-angle-bracket.html"}]}},"name":"es-tag-sql","patterns":[{"begin":"(?i)\\\\b(\\\\w+\\\\.sql)\\\\s*(`)","beginCaptures":{"1":{"name":"variable.parameter"}},"end":"(`)","patterns":[{"include":"source.ts#template-substitution-element"},{"include":"source.ts#string-character-escape"},{"include":"source.sql"},{"include":"source.plpgsql.postgres"},{"match":"."}]},{"begin":"(?i)(\\\\s?/?\\\\*?\\\\s?((?:|inline-)sql)\\\\s?\\\\*?/?\\\\s?)(`)","beginCaptures":{"1":{"name":"comment.block"}},"end":"(`)","patterns":[{"include":"source.ts#template-substitution-element"},{"include":"source.ts#string-character-escape"},{"include":"source.sql"},{"include":"source.plpgsql.postgres"},{"match":"."}]},{"begin":"(?i)(?<=[(,:=\\\\s]|\\\\$\\\\()\\\\s*(((/\\\\*)|(//))\\\\s?((?:|inline-)sql) {0,1000}\\\\*?/?) {0,1000}$","beginCaptures":{"1":{"name":"comment.line"}},"end":"(`)","patterns":[{"begin":"\\\\G()","end":"(`)"},{"include":"source.ts#template-substitution-element"},{"include":"source.ts#string-character-escape"},{"include":"source.sql"},{"include":"source.plpgsql.postgres"},{"match":"."}]}],"scopeName":"inline.es6-sql","embeddedLangs":["typescript","sql"]}')),d=[...e,...c,g],b=[...m,Object.freeze(JSON.parse('{"fileTypes":["js","jsx","ts","tsx","html","vue","svelte","php","res"],"injectTo":["source.ts","source.js"],"injectionSelector":"L:source.js -comment -string, L:source.js -comment -string, L:source.jsx -comment -string, L:source.js.jsx -comment -string, L:source.ts -comment -string, L:source.tsx -comment -string, L:source.rescript -comment -string","injections":{"L:source":{"patterns":[{"match":"<","name":"invalid.illegal.bad-angle-bracket.html"}]}},"name":"es-tag-xml","patterns":[{"begin":"(?i)(\\\\s?/\\\\*\\\\s?(xml|svg|inline-svg|inline-xml)\\\\s?\\\\*/\\\\s?)(`)","beginCaptures":{"1":{"name":"comment.block"}},"end":"(`)","patterns":[{"include":"text.xml"}]},{"begin":"(?i)(\\\\s*((?:|inline-)xml))(`)","beginCaptures":{"1":{"name":"comment.block"}},"end":"(`)","patterns":[{"include":"text.xml"}]},{"begin":"(?i)(?<=[(,:=\\\\s]|\\\\$\\\\()\\\\s*(((/\\\\*)|(//))\\\\s?(xml|svg|inline-svg|inline-xml) {0,1000}\\\\*?/?) {0,1000}$","beginCaptures":{"1":{"name":"comment.line"}},"end":"(`).*","patterns":[{"begin":"\\\\G()","end":"(`)"},{"include":"text.xml"}]}],"scopeName":"inline.es6-xml","embeddedLangs":["xml"]}'))],j=Object.freeze(JSON.parse('{"displayName":"TypeScript with Tags","name":"ts-tags","patterns":[{"include":"source.ts"}],"scopeName":"source.ts.tags","embeddedLangs":["typescript","es-tag-css","es-tag-glsl","es-tag-html","es-tag-sql","es-tag-xml"],"aliases":["lit"]}')),x=[...e,...r,...o,...p,...d,...b,j];export{x as default};
1
+ import e from"./typescript-DI7mmMRd.js";import t from"./css-l46fsARh.js";import s from"./javascript-DFyEbC5y.js";import n from"./glsl-BDbjGBhJ.js";import i from"./html-Z-jPWkqI.js";import c from"./sql-BhJCBb_s.js";import m from"./xml-BsgRw6d1.js";import"./c-BmJt9k-y.js";import"./java-DtRXFtDl.js";const l=Object.freeze(JSON.parse('{"fileTypes":["js","jsx","ts","tsx","html","vue","svelte","php","res"],"injectTo":["source.ts","source.js"],"injectionSelector":"L:source.js -comment -string, L:source.js -comment -string, L:source.jsx -comment -string, L:source.js.jsx -comment -string, L:source.ts -comment -string, L:source.tsx -comment -string, L:source.rescript -comment -string, L:source.vue -comment -string, L:source.svelte -comment -string, L:source.php -comment -string, L:source.rescript -comment -string","injections":{"L:source":{"patterns":[{"match":"<","name":"invalid.illegal.bad-angle-bracket.html"}]}},"name":"es-tag-css","patterns":[{"begin":"(?i)(\\\\s?/\\\\*\\\\s?((?:|inline-)css)\\\\s?\\\\*/\\\\s?)(`)","beginCaptures":{"1":{"name":"comment.block"}},"end":"(`)","patterns":[{"include":"source.ts#template-substitution-element"},{"include":"source.css"},{"include":"inline.es6-htmlx#template"}]},{"begin":"(?i)(\\\\s*((?:|inline-)css))(`)","beginCaptures":{"1":{"name":"comment.block"}},"end":"(`)","patterns":[{"include":"source.ts#template-substitution-element"},{"include":"source.css"},{"include":"inline.es6-htmlx#template"},{"include":"string.quoted.other.template.js"}]},{"begin":"(?i)(?<=[(,:=\\\\s]|\\\\$\\\\()\\\\s*(((/\\\\*)|(//))\\\\s?((?:|inline-)css) {0,1000}\\\\*?/?) {0,1000}$","beginCaptures":{"1":{"name":"comment.line"}},"end":"(`).*","patterns":[{"begin":"\\\\G()","end":"(`)"},{"include":"source.ts#template-substitution-element"},{"include":"source.css"}]},{"begin":"(\\\\$\\\\{)","beginCaptures":{"1":{"name":"entity.name.tag"}},"end":"(})","endCaptures":{"1":{"name":"entity.name.tag"}},"patterns":[{"include":"source.ts#template-substitution-element"},{"include":"source.js"}]}],"scopeName":"inline.es6-css","embeddedLangs":["typescript","css","javascript"]}')),r=[...e,...t,...s,l],a=Object.freeze(JSON.parse('{"fileTypes":["js","jsx","ts","tsx","html","vue","svelte","php","res"],"injectTo":["source.ts","source.js"],"injectionSelector":"L:source.js -comment -string, L:source.js -comment -string, L:source.jsx -comment -string, L:source.js.jsx -comment -string, L:source.ts -comment -string, L:source.tsx -comment -string, L:source.rescript -comment -string","injections":{"L:source":{"patterns":[{"match":"<","name":"invalid.illegal.bad-angle-bracket.html"}]}},"name":"es-tag-glsl","patterns":[{"begin":"(?i)(\\\\s?/\\\\*\\\\s?((?:|inline-)glsl)\\\\s?\\\\*/\\\\s?)(`)","beginCaptures":{"1":{"name":"comment.block"}},"end":"(`)","patterns":[{"include":"source.ts#template-substitution-element"},{"include":"source.glsl"},{"include":"inline.es6-htmlx#template"}]},{"begin":"(?i)(\\\\s*((?:|inline-)glsl))(`)","beginCaptures":{"1":{"name":"comment.block"}},"end":"(`)","patterns":[{"include":"source.ts#template-substitution-element"},{"include":"source.glsl"},{"include":"inline.es6-htmlx#template"},{"include":"string.quoted.other.template.js"}]},{"begin":"(?i)(?<=[(,:=\\\\s]|\\\\$\\\\()\\\\s*(((/\\\\*)|(//))\\\\s?((?:|inline-)glsl) {0,1000}\\\\*?/?) {0,1000}$","beginCaptures":{"1":{"name":"comment.line"}},"end":"(`).*","patterns":[{"begin":"\\\\G()","end":"(`)"},{"include":"source.ts#template-substitution-element"},{"include":"source.glsl"}]},{"begin":"(\\\\$\\\\{)","beginCaptures":{"1":{"name":"entity.name.tag"}},"end":"(})","endCaptures":{"1":{"name":"entity.name.tag"}},"patterns":[{"include":"source.ts#template-substitution-element"},{"include":"source.js"}]}],"scopeName":"inline.es6-glsl","embeddedLangs":["typescript","glsl","javascript"]}')),o=[...e,...n,...s,a],u=Object.freeze(JSON.parse('{"fileTypes":["js","jsx","ts","tsx","html","vue","svelte","php","res"],"injectTo":["source.ts","source.js"],"injectionSelector":"L:source.js -comment -string, L:source.js -comment -string, L:source.jsx -comment -string, L:source.js.jsx -comment -string, L:source.ts -comment -string, L:source.tsx -comment -string, L:source.rescript -comment -string","injections":{"L:source":{"patterns":[{"match":"<","name":"invalid.illegal.bad-angle-bracket.html"}]}},"name":"es-tag-html","patterns":[{"begin":"(?i)(\\\\s?/\\\\*\\\\s?(html|template|inline-html|inline-template)\\\\s?\\\\*/\\\\s?)(`)","beginCaptures":{"1":{"name":"comment.block"}},"end":"(`)","patterns":[{"include":"source.ts#template-substitution-element"},{"include":"text.html.basic"},{"include":"inline.es6-htmlx#template"}]},{"begin":"(?i)(\\\\s*(html|template|inline-html|inline-template))(`)","beginCaptures":{"1":{"name":"comment.block"}},"end":"(`)","patterns":[{"include":"source.ts#template-substitution-element"},{"include":"text.html.basic"},{"include":"inline.es6-htmlx#template"},{"include":"string.quoted.other.template.js"}]},{"begin":"(?i)(?<=[(,:=\\\\s]|\\\\$\\\\()\\\\s*(((/\\\\*)|(//))\\\\s?(html|template|inline-html|inline-template) {0,1000}\\\\*?/?) {0,1000}$","beginCaptures":{"1":{"name":"comment.line"}},"end":"(`).*","patterns":[{"begin":"\\\\G()","end":"(`)"},{"include":"source.ts#template-substitution-element"},{"include":"text.html.basic"}]},{"begin":"(\\\\$\\\\{)","beginCaptures":{"1":{"name":"entity.name.tag"}},"end":"(})","endCaptures":{"1":{"name":"entity.name.tag"}},"patterns":[{"include":"source.ts#template-substitution-element"},{"include":"source.js"}]},{"begin":"(\\\\$\\\\(`)","beginCaptures":{"1":{"name":"entity.name.tag"}},"end":"(`\\\\))","endCaptures":{"1":{"name":"entity.name.tag"}},"patterns":[{"include":"source.ts#template-substitution-element"},{"include":"source.js"}]}],"scopeName":"inline.es6-html","embeddedLangs":["typescript","html","javascript"]}')),p=[...e,...i,...s,u],g=Object.freeze(JSON.parse('{"fileTypes":["js","jsx","ts","tsx","html","vue","svelte","php","res"],"injectTo":["source.ts","source.js"],"injectionSelector":"L:source.js -comment -string, L:source.jsx -comment -string, L:source.js.jsx -comment -string, L:source.ts -comment -string, L:source.tsx -comment -string, L:source.rescript -comment -string","injections":{"L:source":{"patterns":[{"match":"<","name":"invalid.illegal.bad-angle-bracket.html"}]}},"name":"es-tag-sql","patterns":[{"begin":"(?i)\\\\b(\\\\w+\\\\.sql)\\\\s*(`)","beginCaptures":{"1":{"name":"variable.parameter"}},"end":"(`)","patterns":[{"include":"source.ts#template-substitution-element"},{"include":"source.ts#string-character-escape"},{"include":"source.sql"},{"include":"source.plpgsql.postgres"},{"match":"."}]},{"begin":"(?i)(\\\\s?/?\\\\*?\\\\s?((?:|inline-)sql)\\\\s?\\\\*?/?\\\\s?)(`)","beginCaptures":{"1":{"name":"comment.block"}},"end":"(`)","patterns":[{"include":"source.ts#template-substitution-element"},{"include":"source.ts#string-character-escape"},{"include":"source.sql"},{"include":"source.plpgsql.postgres"},{"match":"."}]},{"begin":"(?i)(?<=[(,:=\\\\s]|\\\\$\\\\()\\\\s*(((/\\\\*)|(//))\\\\s?((?:|inline-)sql) {0,1000}\\\\*?/?) {0,1000}$","beginCaptures":{"1":{"name":"comment.line"}},"end":"(`)","patterns":[{"begin":"\\\\G()","end":"(`)"},{"include":"source.ts#template-substitution-element"},{"include":"source.ts#string-character-escape"},{"include":"source.sql"},{"include":"source.plpgsql.postgres"},{"match":"."}]}],"scopeName":"inline.es6-sql","embeddedLangs":["typescript","sql"]}')),d=[...e,...c,g],b=[...m,Object.freeze(JSON.parse('{"fileTypes":["js","jsx","ts","tsx","html","vue","svelte","php","res"],"injectTo":["source.ts","source.js"],"injectionSelector":"L:source.js -comment -string, L:source.js -comment -string, L:source.jsx -comment -string, L:source.js.jsx -comment -string, L:source.ts -comment -string, L:source.tsx -comment -string, L:source.rescript -comment -string","injections":{"L:source":{"patterns":[{"match":"<","name":"invalid.illegal.bad-angle-bracket.html"}]}},"name":"es-tag-xml","patterns":[{"begin":"(?i)(\\\\s?/\\\\*\\\\s?(xml|svg|inline-svg|inline-xml)\\\\s?\\\\*/\\\\s?)(`)","beginCaptures":{"1":{"name":"comment.block"}},"end":"(`)","patterns":[{"include":"text.xml"}]},{"begin":"(?i)(\\\\s*((?:|inline-)xml))(`)","beginCaptures":{"1":{"name":"comment.block"}},"end":"(`)","patterns":[{"include":"text.xml"}]},{"begin":"(?i)(?<=[(,:=\\\\s]|\\\\$\\\\()\\\\s*(((/\\\\*)|(//))\\\\s?(xml|svg|inline-svg|inline-xml) {0,1000}\\\\*?/?) {0,1000}$","beginCaptures":{"1":{"name":"comment.line"}},"end":"(`).*","patterns":[{"begin":"\\\\G()","end":"(`)"},{"include":"text.xml"}]}],"scopeName":"inline.es6-xml","embeddedLangs":["xml"]}'))],j=Object.freeze(JSON.parse('{"displayName":"TypeScript with Tags","name":"ts-tags","patterns":[{"include":"source.ts"}],"scopeName":"source.ts.tags","embeddedLangs":["typescript","es-tag-css","es-tag-glsl","es-tag-html","es-tag-sql","es-tag-xml"],"aliases":["lit"]}')),h=[...e,...r,...o,...p,...d,...b,j];export{h as default};
@@ -1 +1 @@
1
- import{b3 as t,_ as e,s as n,g as s,p as i,o as r,a as o,b as a,z as l,F as c,d as h,ak as u,a9 as f,aa as d,ab as y,e as g,q as x,B as p,D as m}from"./mermaid.core-CTf8qcol.js";import"./RemoteLifeOSBlock-C46RjZWn.js";import"./index-CX8KV6EH.js";import"./purify.es-BNLkGfTg.js";import"./marked.esm-BBjA1da9.js";import"./App-CLTYkSvy.js";import"./index-CapF4a8Y.js";import"./file-editor-index-C6CU7Fik.js";const b=(e,n)=>t(e,"a",-n);function v(t,e){const n=function(t){const e=[];for(let n=0;n<t.length;++n)for(let s=n+1;s<t.length;++s){const i=w(t[n],t[s]);for(const t of i)t.parentIndex=[n,s],e.push(t)}return e}(t),s=n.filter(e=>function(t,e){return e.every(e=>M(t,e)<e.radius+1e-10)}(e,t));let i=0,r=0;const o=[];if(s.length>1){const e=_(s);for(let t=0;t<s.length;++t){const n=s[t];n.angle=Math.atan2(n.x-e.x,n.y-e.y)}s.sort((t,e)=>e.angle-t.angle);let n=s[s.length-1];for(let a=0;a<s.length;++a){const e=s[a];r+=(n.x+e.x)*(e.y-n.y);const l={x:(e.x+n.x)/2,y:(e.y+n.y)/2};let c=null;for(let s=0;s<e.parentIndex.length;++s)if(n.parentIndex.includes(e.parentIndex[s])){const i=t[e.parentIndex[s]],r=Math.atan2(e.x-i.x,e.y-i.y),o=Math.atan2(n.x-i.x,n.y-i.y);let a=o-r;a<0&&(a+=2*Math.PI);const h=o-a/2;let u=M(l,{x:i.x+i.radius*Math.sin(h),y:i.y+i.radius*Math.cos(h)});u>2*i.radius&&(u=2*i.radius),(null==c||c.width>u)&&(c={circle:i,width:u,p1:e,p2:n,large:u>i.radius,sweep:!0})}null!=c&&(o.push(c),i+=I(c.circle.radius,c.width),n=e)}}else{let e=t[0];for(let s=1;s<t.length;++s)t[s].radius<e.radius&&(e=t[s]);let n=!1;for(let s=0;s<t.length;++s)if(M(t[s],e)>Math.abs(e.radius-t[s].radius)){n=!0;break}n?i=r=0:(i=e.radius*e.radius*Math.PI,o.push({circle:e,p1:{x:e.x,y:e.y+e.radius},p2:{x:e.x-1e-10,y:e.y+e.radius},width:2*e.radius,large:!0,sweep:!0}))}return r/=2,e&&(e.area=i+r,e.arcArea=i,e.polygonArea=r,e.arcs=o,e.innerPoints=s,e.intersectionPoints=n),i+r}function I(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function M(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function k(t,e,n){if(n>=t+e)return 0;if(n<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const s=e-(n*n-t*t+e*e)/(2*n);return I(t,t-(n*n-e*e+t*t)/(2*n))+I(e,s)}function w(t,e){const n=M(t,e),s=t.radius,i=e.radius;if(n>=s+i||n<=Math.abs(s-i))return[];const r=(s*s-i*i+n*n)/(2*n),o=Math.sqrt(s*s-r*r),a=t.x+r*(e.x-t.x)/n,l=t.y+r*(e.y-t.y)/n,c=-(e.y-t.y)*(o/n),h=-(e.x-t.x)*(o/n);return[{x:a+c,y:l-h},{x:a-c,y:l+h}]}function _(t){const e={x:0,y:0};for(const n of t)e.x+=n.x,e.y+=n.y;return e.x/=t.length,e.y/=t.length,e}function S(t){const e=new Array(t);for(let n=0;n<t;++n)e[n]=0;return e}function E(t,e){return S(t).map(()=>S(e))}function T(t,e){let n=0;for(let s=0;s<t.length;++s)n+=t[s]*e[s];return n}function z(t){return Math.sqrt(T(t,t))}function A(t,e,n){for(let s=0;s<e.length;++s)t[s]=e[s]*n}function R(t,e,n,s,i){for(let r=0;r<t.length;++r)t[r]=e*n[r]+s*i[r]}function N(t,e,n){const s=(n=n||{}).maxIterations||200*e.length,i=n.nonZeroDelta||1.05,r=n.zeroDelta||.001,o=n.minErrorDelta||1e-6,a=n.minErrorDelta||1e-5,l=void 0!==n.rho?n.rho:1,c=void 0!==n.chi?n.chi:2,h=void 0!==n.psi?n.psi:-.5,u=void 0!==n.sigma?n.sigma:.5;let f;const d=e.length,y=new Array(d+1);y[0]=e,y[0].fx=t(e),y[0].id=0;for(let I=0;I<d;++I){const n=e.slice();n[I]=n[I]?n[I]*i:r,y[I+1]=n,y[I+1].fx=t(n),y[I+1].id=I+1}function g(t){for(let e=0;e<t.length;e++)y[d][e]=t[e];y[d].fx=t.fx}const x=(t,e)=>t.fx-e.fx,p=e.slice(),m=e.slice(),b=e.slice(),v=e.slice();for(let I=0;I<s;++I){if(y.sort(x),n.history){const t=y.map(t=>{const e=t.slice();return e.fx=t.fx,e.id=t.id,e});t.sort((t,e)=>t.id-e.id),n.history.push({x:y[0].slice(),fx:y[0].fx,simplex:t})}f=0;for(let t=0;t<d;++t)f=Math.max(f,Math.abs(y[0][t]-y[1][t]));if(Math.abs(y[0].fx-y[d].fx)<o&&f<a)break;for(let t=0;t<d;++t){p[t]=0;for(let e=0;e<d;++e)p[t]+=y[e][t];p[t]/=d}const e=y[d];if(R(m,1+l,p,-l,e),m.fx=t(m),m.fx<y[0].fx)R(v,1+c,p,-c,e),v.fx=t(v),v.fx<m.fx?g(v):g(m);else if(m.fx>=y[d-1].fx){let n=!1;if(m.fx>e.fx?(R(b,1+h,p,-h,e),b.fx=t(b),b.fx<e.fx?g(b):n=!0):(R(b,1-h*l,p,h*l,e),b.fx=t(b),b.fx<m.fx?g(b):n=!0),n){if(u>=1)break;for(let e=1;e<y.length;++e)R(y[e],1-u,y[0],u,y[e]),y[e].fx=t(y[e])}}else g(m)}return y.sort(x),{fx:y[0].fx,x:y[0]}}function D(t,e,n,s,i,r,o){const a=n.fx,l=T(n.fxprime,e);let c=a,h=a,u=l,f=0;function d(h,f,d){for(let y=0;y<16;++y)if(i=(h+f)/2,R(s.x,1,n.x,i,e),c=s.fx=t(s.x,s.fxprime),u=T(s.fxprime,e),c>a+r*i*l||c>=d)f=i;else{if(Math.abs(u)<=-o*l)return i;u*(f-h)>=0&&(f=h),h=i,d=c}return 0}i=i||1,r=r||1e-6,o=o||.1;for(let y=0;y<10;++y){if(R(s.x,1,n.x,i,e),c=s.fx=t(s.x,s.fxprime),u=T(s.fxprime,e),c>a+r*i*l||y&&c>=h)return d(f,i,h);if(Math.abs(u)<=-o*l)return i;if(u>=0)return d(i,f,c);h=c,f=i,i*=2}return i}function O(t,e,n){let s={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()};const r=e.slice();let o,a,l,c=1;l=(n=n||{}).maxIterations||20*e.length,s.fx=t(s.x,s.fxprime),o=s.fxprime.slice(),A(o,s.fxprime,-1);for(let h=0;h<l;++h){if(c=D(t,o,s,i,c),n.history&&n.history.push({x:s.x.slice(),fx:s.fx,fxprime:s.fxprime.slice(),alpha:c}),c){R(r,1,i.fxprime,-1,s.fxprime);const t=T(s.fxprime,s.fxprime);R(o,Math.max(0,T(r,i.fxprime)/t),o,-1,i.fxprime),a=s,s=i,i=a}else A(o,s.fxprime,-1);if(z(s.fxprime)<=1e-5)break}return n.history&&n.history.push({x:s.x.slice(),fx:s.fx,fxprime:s.fxprime.slice(),alpha:c}),s}function F(t,e={}){e.maxIterations=e.maxIterations||500;const n=e.initialLayout||$,s=e.lossFunction||P,i=function(t,e={}){const n=e.distinct,s=t.map(t=>Object.assign({},t));function i(t){return t.join(";")}if(n){const t=new Map;for(const e of s)for(let n=0;n<e.sets.length;n++){const s=String(e.sets[n]);t.set(s,e.size+(t.get(s)||0));for(let i=n+1;i<e.sets.length;i++){const n=String(e.sets[i]),r=`${s};${n}`,o=`${n};${s}`;t.set(r,e.size+(t.get(r)||0)),t.set(o,e.size+(t.get(o)||0))}}for(const e of s)e.sets.length<3&&(e.size=t.get(i(e.sets)))}const r=[],o=new Set;for(const a of s)if(1===a.sets.length)r.push(a.sets[0]);else if(2===a.sets.length){const t=a.sets[0],e=a.sets[1];o.add(i(a.sets)),o.add(i([e,t]))}r.sort((t,e)=>t===e?0:t<e?-1:1);for(let a=0;a<r.length;++a){const t=r[a];for(let e=a+1;e<r.length;++e){const n=r[e];o.has(i([t,n]))||s.push({sets:[t,n],size:0})}}return s}(t,e),r=n(i,e),o=Object.keys(r),a=[];for(const c of o)a.push(r[c].x),a.push(r[c].y);const l=N(t=>{const e={};for(let n=0;n<o.length;++n){const s=o[n];e[s]={x:t[2*n],y:t[2*n+1],radius:r[s].radius}}return s(e,i)},a,e).x;for(let c=0;c<o.length;++c){const t=o[c];r[t].x=l[2*c],r[t].y=l[2*c+1]}return r}const C=1e-10;function j(t,e,n){return Math.min(t,e)*Math.min(t,e)*Math.PI<=n+C?Math.abs(t-e):function(t,e,n,s){const i=(s=s||{}).maxIterations||100,r=s.tolerance||1e-10,o=t(e),a=t(n);let l=n-e;if(o*a>0)throw"Initial bisect points must have opposite signs";if(0===o)return e;if(0===a)return n;for(let c=0;c<i;++c){l/=2;const n=e+l,s=t(n);if(s*o>=0&&(e=n),Math.abs(l)<r||0===s)return n}return e+l}(s=>k(t,e,s)-n,0,t+e)}function $(t,e={}){let n=function(t,e){const n=e&&e.lossFunction?e.lossFunction:P,s={},i={};for(const u of t)if(1===u.sets.length){const t=u.sets[0];s[t]={x:1e10,y:1e10,rowid:s.length,size:u.size,radius:Math.sqrt(u.size/Math.PI)},i[t]=[]}t=t.filter(t=>2===t.sets.length);for(const u of t){let t=null!=u.weight?u.weight:1;const e=u.sets[0],n=u.sets[1];u.size+C>=Math.min(s[e].size,s[n].size)&&(t=0),i[e].push({set:n,size:u.size,weight:t}),i[n].push({set:e,size:u.size,weight:t})}const r=[];function o(t,e){return e.size-t.size}Object.keys(i).forEach(t=>{let e=0;for(let n=0;n<i[t].length;++n)e+=i[t][n].size*i[t][n].weight;r.push({set:t,size:e})}),r.sort(o);const a={};function l(t){return t.set in a}function c(t,e){s[e].x=t.x,s[e].y=t.y,a[e]=!0}c({x:0,y:0},r[0].set);for(let u=1;u<r.length;++u){const e=r[u].set,a=i[e].filter(l),f=s[e];if(a.sort(o),0===a.length)throw"ERROR: missing pairwise overlap information";const d=[];for(var h=0;h<a.length;++h){const t=s[a[h].set],e=j(f.radius,t.radius,a[h].size);d.push({x:t.x+e,y:t.y}),d.push({x:t.x-e,y:t.y}),d.push({y:t.y+e,x:t.x}),d.push({y:t.y-e,x:t.x});for(let n=h+1;n<a.length;++n){const i=s[a[n].set],r=j(f.radius,i.radius,a[n].size),o=w({x:t.x,y:t.y,radius:e},{x:i.x,y:i.y,radius:r});d.push(...o)}}let y=1e50,g=d[0];for(const i of d){s[e].x=i.x,s[e].y=i.y;const r=n(s,t);r<y&&(y=r,g=i)}c(g,e)}return s}(t,e);const s=e.lossFunction||P;if(t.length>=8){const i=function(t,e={}){const n=e.restarts||10,s=[],i={};for(const f of t)1===f.sets.length&&(i[f.sets[0]]=s.length,s.push(f));let{distances:r,constraints:o}=function(t,e,n){const s=E(e.length,e.length),i=E(e.length,e.length);return t.filter(t=>2===t.sets.length).forEach(t=>{const r=n[t.sets[0]],o=n[t.sets[1]],a=j(Math.sqrt(e[r].size/Math.PI),Math.sqrt(e[o].size/Math.PI),t.size);s[r][o]=s[o][r]=a;let l=0;t.size+1e-10>=Math.min(e[r].size,e[o].size)?l=1:t.size<=1e-10&&(l=-1),i[r][o]=i[o][r]=l}),{distances:s,constraints:i}}(t,s,i);const a=z(r.map(z))/r.length;r=r.map(t=>t.map(t=>t/a));const l=(t,e)=>function(t,e,n,s){for(let r=0;r<e.length;++r)e[r]=0;let i=0;for(let r=0;r<n.length;++r){const o=t[2*r],a=t[2*r+1];for(let l=r+1;l<n.length;++l){const c=t[2*l],h=t[2*l+1],u=n[r][l],f=s[r][l],d=(c-o)*(c-o)+(h-a)*(h-a),y=Math.sqrt(d),g=d-u*u;f>0&&y<=u||f<0&&y>=u||(i+=2*g*g,e[2*r]+=4*g*(o-c),e[2*r+1]+=4*g*(a-h),e[2*l]+=4*g*(c-o),e[2*l+1]+=4*g*(h-a))}}return i}(t,e,r,o);let c=null;for(let f=0;f<n;++f){const t=O(l,S(2*r.length).map(Math.random),e);(!c||t.fx<c.fx)&&(c=t)}const h=c.x,u={};for(let f=0;f<s.length;++f){const t=s[f];u[t.sets[0]]={x:h[2*f]*a,y:h[2*f+1]*a,radius:Math.sqrt(t.size/Math.PI)}}if(e.history)for(const f of e.history)A(f.x,a);return u}(t,e);s(i,t)+1e-8<s(n,t)&&(n=i)}return n}function P(t,e){let n=0;for(const s of e){if(1===s.sets.length)continue;let e;if(2===s.sets.length){const n=t[s.sets[0]],i=t[s.sets[1]];e=k(n.radius,i.radius,M(n,i))}else e=v(s.sets.map(e=>t[e]));n+=(null!=s.weight?s.weight:1)*(e-s.size)*(e-s.size)}return n}function L(t,e){let n=0;for(const s of e){if(1===s.sets.length)continue;let e;if(2===s.sets.length){const n=t[s.sets[0]],i=t[s.sets[1]];e=k(n.radius,i.radius,M(n,i))}else e=v(s.sets.map(e=>t[e]));const i=null!=s.weight?s.weight:1,r=Math.log((e+1)/(s.size+1));n+=i*r*r}return n}function q(t,e,n){if(null==n?t.sort((t,e)=>e.radius-t.radius):t.sort(n),t.length>0){const e=t[0].x,n=t[0].y;for(const s of t)s.x-=e,s.y-=n}if(2===t.length&&M(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const n=Math.atan2(t[1].x,t[1].y)-e,s=Math.cos(n),i=Math.sin(n);for(const e of t){const t=e.x,n=e.y;e.x=s*t-i*n,e.y=i*t+s*n}}if(t.length>2){let n=Math.atan2(t[2].x,t[2].y)-e;for(;n<0;)n+=2*Math.PI;for(;n>2*Math.PI;)n-=2*Math.PI;if(n>Math.PI){const e=t[1].y/(1e-10+t[1].x);for(const n of t){var s=(n.x+e*n.y)/(1+e*e);n.x=2*s-n.x,n.y=2*s*e-n.y}}}}function B(t){const e=e=>({max:t.reduce((t,n)=>Math.max(t,n[e]+n.radius),Number.NEGATIVE_INFINITY),min:t.reduce((t,n)=>Math.min(t,n[e]-n.radius),Number.POSITIVE_INFINITY)});return{xRange:e("x"),yRange:e("y")}}function U(t,e,n){null==e&&(e=Math.PI/2);let s=V(t).map(t=>Object.assign({},t));const i=function(t){function e(t){return t.parent!==t&&(t.parent=e(t.parent)),t.parent}function n(t,n){const s=e(t),i=e(n);s.parent=i}t.forEach(t=>{t.parent=t});for(let i=0;i<t.length;++i)for(let e=i+1;e<t.length;++e){const s=t[i].radius+t[e].radius;M(t[i],t[e])+1e-10<s&&n(t[e],t[i])}const s=new Map;for(let i=0;i<t.length;++i){const n=e(t[i]).parent.setid;s.has(n)||s.set(n,[]),s.get(n).push(t[i])}return t.forEach(t=>{delete t.parent}),Array.from(s.values())}(s);for(const c of i){q(c,e,n);const t=B(c);c.size=(t.xRange.max-t.xRange.min)*(t.yRange.max-t.yRange.min),c.bounds=t}i.sort((t,e)=>e.size-t.size),s=i[0];let r=s.bounds;const o=(r.xRange.max-r.xRange.min)/50;function a(t,e,n){if(!t)return;const i=t.bounds;let a,l;if(e)a=r.xRange.max-i.xRange.min+o;else{a=r.xRange.max-i.xRange.max;const t=(i.xRange.max-i.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;t<0&&(a+=t)}if(n)l=r.yRange.max-i.yRange.min+o;else{l=r.yRange.max-i.yRange.max;const t=(i.yRange.max-i.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;t<0&&(l+=t)}for(const r of t)r.x+=a,r.y+=l,s.push(r)}let l=1;for(;l<i.length;)a(i[l],!0,!1),a(i[l+1],!1,!0),a(i[l+2],!0,!0),l+=3,r=B(s);return W(s)}function G(t,e,n,s,i){const r=V(t);e-=2*s,n-=2*s;const{xRange:o,yRange:a}=B(r);if(o.max===o.min||a.max===a.min)return console.log("not scaling solution: zero size detected"),t;let l,c;if(i){const t=2*Math.sqrt(i/Math.PI);l=e/t,c=n/t}else l=e/(o.max-o.min),c=n/(a.max-a.min);const h=Math.min(c,l),u=(e-(o.max-o.min)*h)/2,f=(n-(a.max-a.min)*h)/2;return W(r.map(t=>({radius:h*t.radius,x:s+u+(t.x-o.min)*h,y:s+f+(t.y-a.min)*h,setid:t.setid})))}function W(t){const e={};for(const n of t)e[n.setid]=n;return e}function V(t){return Object.keys(t).map(e=>Object.assign(t[e],{setid:e}))}function X(t,e){return function(n){const s=this,i=t[n.sets[0]].radius||50,r=e(n)||"",o=r.split(/\s+/).reverse(),a=(r.length+o.length)/3;let l=o.pop(),c=[l],h=0;s.textContent=null;const u=[];function f(t){const e=s.ownerDocument.createElementNS(s.namespaceURI,"tspan");return e.textContent=t,u.push(e),s.append(e),e}let d=f(l);for(;l=o.pop(),l;){c.push(l);const t=c.join(" ");d.textContent=t,t.length>a&&d.getComputedTextLength()>i&&(c.pop(),d.textContent=c.join(" "),c=[l],d=f(l),h++)}const y=.35-1.1*h/2,g=s.getAttribute("x"),x=s.getAttribute("y");u.forEach((t,e)=>{t.setAttribute("x",g),t.setAttribute("y",x),t.setAttribute("dy",`${y+1.1*e}em`)})}}function Y(t,e,n){let s=e[0].radius-M(e[0],t);for(let i=1;i<e.length;++i){const n=e[i].radius-M(e[i],t);n<=s&&(s=n)}for(let i=0;i<n.length;++i){const e=M(n[i],t)-n[i].radius;e<=s&&(s=e)}return s}function K(t,e,n){const s=[];for(const h of t)s.push({x:h.x,y:h.y}),s.push({x:h.x+h.radius/2,y:h.y}),s.push({x:h.x-h.radius/2,y:h.y}),s.push({x:h.x,y:h.y+h.radius/2}),s.push({x:h.x,y:h.y-h.radius/2});let i=s[0],r=Y(s[0],t,e);for(let h=1;h<s.length;++h){const n=Y(s[h],t,e);n>=r&&(i=s[h],r=n)}const o=N(n=>-1*Y({x:n[0],y:n[1]},t,e),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,a={x:n?0:o[0],y:o[1]};let l=!0;for(const h of t)if(M(a,h)>h.radius){l=!1;break}for(const h of e)if(M(a,h)<h.radius){l=!1;break}if(l)return a;if(1==t.length)return{x:t[0].x,y:t[0].y};const c={};return v(t,c),0===c.arcs.length?{x:0,y:-1e3,disjoint:!0}:1==c.arcs.length?{x:c.arcs[0].circle.x,y:c.arcs[0].circle.y}:e.length?K(t,[]):_(c.arcs.map(t=>t.p1))}function Z(t,e,n){const s={},i=function(t){const e={},n=Object.keys(t);for(const s of n)e[s]=[];for(let s=0;s<n.length;s++){const i=n[s],r=t[i];for(let o=s+1;o<n.length;++o){const s=n[o],a=t[s],l=M(r,a);l+a.radius<=r.radius+1e-10?e[s].push(i):l+r.radius<=a.radius+1e-10&&e[i].push(s)}}return e}(t);for(let r=0;r<e.length;++r){const o=e[r].sets,a={},l={};for(let t=0;t<o.length;++t){a[o[t]]=!0;const e=i[o[t]];for(let t=0;t<e.length;++t)l[e[t]]=!0}const c=[],h=[];for(let e in t)e in a?c.push(t[e]):e in l||h.push(t[e]);const u=K(c,h,n);s[o]=u,u.disjoint&&e[r].size>0&&console.log("WARNING: area "+o+" not represented on screen")}return s}function H(t){if(0===t.length)return[];const e={};return v(t,e),e.arcs}function J(t,e){if(0===t.length)return"M 0 0";const n=Math.pow(10,e||0),s=null!=e?t=>Math.round(t*n)/n:t=>t;if(1==t.length){const e=t[0].circle;return function(t,e,n){const s=[];return s.push("\nM",t,e),s.push("\nm",-n,0),s.push("\na",n,n,0,1,0,2*n,0),s.push("\na",n,n,0,1,0,2*-n,0),s.join(" ")}(s(e.x),s(e.y),s(e.radius))}const i=["\nM",s(t[0].p2.x),s(t[0].p2.y)];for(const r of t){const t=s(r.circle.radius);i.push("\nA",t,t,0,r.large?1:0,r.sweep?1:0,s(r.p1.x),s(r.p1.y))}return i.join(" ")}function Q(t,e){return J(H(t),e)}var tt=function(){var t=e(function(t,e,n,s){for(n=n||{},s=t.length;s--;n[t[s]]=e);return n},"o"),n=[5,8],s=[7,8,11,12,17,19,22,24],i=[1,17],r=[1,18],o=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],a=[1,31],l=[1,39],c=[7,8,11,12,17,19,22,24,27],h=[1,57],u=[1,56],f=[1,58],d=[1,59],y=[1,60],g=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],x={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:e(function(t,e,n,s,i,r,o){var a=r.length-1;switch(i){case 1:return r[a-1];case 2:case 3:case 4:case 6:this.$=[];break;case 5:case 35:r[a-1].push(r[a]),this.$=r[a-1];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:case 43:case 44:this.$=r[a];break;case 8:s.setDiagramTitle(r[a].substr(6)),this.$=r[a].substr(6);break;case 9:s.addSubsetData([r[a]],void 0,void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 10:s.addSubsetData([r[a-1]],r[a],void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 11:s.addSubsetData([r[a-2]],void 0,parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 12:s.addSubsetData([r[a-3]],r[a-2],parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 13:if(r[a].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a]),s.addSubsetData(r[a],void 0,void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 14:if(r[a-1].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a-1]),s.addSubsetData(r[a-1],r[a],void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 15:if(r[a-2].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a-2]),s.addSubsetData(r[a-2],void 0,parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 16:if(r[a-3].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a-3]),s.addSubsetData(r[a-3],r[a-2],parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 17:case 18:case 19:s.addTextData(r[a-1],r[a],void 0);break;case 20:case 21:s.addTextData(r[a-2],r[a-1],r[a]);break;case 23:s.addStyleData(r[a-1],r[a]);break;case 24:case 25:case 26:if(!(l=s.getCurrentSets()))throw new Error("text requires set");s.addTextData(l,r[a],void 0);break;case 27:case 28:var l;if(!(l=s.getCurrentSets()))throw new Error("text requires set");s.addTextData(l,r[a-1],r[a]);break;case 29:case 41:case 34:this.$=[r[a]];break;case 30:case 42:this.$=[...r[a-2],r[a]];break;case 31:this.$=[r[a-2],r[a]];break;case 33:this.$=r[a].join(" ")}},"anonymous"),table:[t(n,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(s,[2,4],{6:5}),t(n,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(s,[2,5]),t(s,[2,6]),t(s,[2,7]),t(s,[2,8]),{13:16,20:i,21:r},{13:20,18:19,20:i,21:r},{13:20,18:21,20:i,21:r},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:i,21:r},t(s,[2,9],{14:[1,27],15:[1,28]}),t(o,[2,43]),t(o,[2,44]),t(s,[2,13],{14:[1,29],15:[1,30],27:a}),t(o,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:a},t(s,[2,22]),t(s,[2,24],{14:[1,35]}),t(s,[2,25],{14:[1,36]}),t(s,[2,26]),{20:l,25:37,26:38,27:a},t(s,[2,10],{15:[1,40]}),{16:[1,41]},t(s,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:i,21:r},t(s,[2,17],{14:[1,45]}),t(s,[2,18],{14:[1,46]}),t(s,[2,19]),t(s,[2,27]),t(s,[2,28]),t(s,[2,23],{27:[1,47]}),t(c,[2,29]),{15:[1,48]},{16:[1,49]},t(s,[2,11]),{16:[1,50]},t(s,[2,15]),t(o,[2,42]),t(s,[2,20]),t(s,[2,21]),{20:l,26:51},{16:h,20:u,21:[1,53],28:52,29:54,30:55,31:f,32:d,33:y},t(s,[2,12]),t(s,[2,16]),t(c,[2,30]),t(c,[2,31]),t(c,[2,32]),t(c,[2,33],{30:61,16:h,20:u,31:f,32:d,33:y}),t(g,[2,34]),t(g,[2,36]),t(g,[2,37]),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,35])],defaultActions:{6:[2,1]},parseError:e(function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},"parseError"),parse:e(function(t){var n=this,s=[0],i=[],r=[null],o=[],a=this.table,l="",c=0,h=0,u=o.slice.call(arguments,1),f=Object.create(this.lexer),d={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(d.yy[y]=this.yy[y]);f.setInput(t,d.yy),d.yy.lexer=f,d.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var g=f.yylloc;o.push(g);var x=f.options&&f.options.ranges;function p(){var t;return"number"!=typeof(t=i.pop()||f.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,e(function(t){s.length=s.length-2*t,r.length=r.length-t,o.length=o.length-t},"popStack"),e(p,"lex");for(var m,b,v,I,M,k,w,_,S={};;){if(b=s[s.length-1],this.defaultActions[b]?v=this.defaultActions[b]:(null==m&&(m=p()),v=a[b]&&a[b][m]),void 0===v||!v.length||!v[0]){var E;for(M in _=[],a[b])this.terminals_[M]&&M>2&&_.push("'"+this.terminals_[M]+"'");E=f.showPosition?"Parse error on line "+(c+1)+":\n"+f.showPosition()+"\nExpecting "+_.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(E,{text:f.match,token:this.terminals_[m]||m,line:f.yylineno,loc:g,expected:_})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+m);switch(v[0]){case 1:s.push(m),r.push(f.yytext),o.push(f.yylloc),s.push(v[1]),m=null,h=f.yyleng,l=f.yytext,c=f.yylineno,g=f.yylloc;break;case 2:if(k=this.productions_[v[1]][1],S.$=r[r.length-k],S._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},x&&(S._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),void 0!==(I=this.performAction.apply(S,[l,h,c,d.yy,v[1],r,o].concat(u))))return I;k&&(s=s.slice(0,-1*k*2),r=r.slice(0,-1*k),o=o.slice(0,-1*k)),s.push(this.productions_[v[1]][0]),r.push(S.$),o.push(S._$),w=a[s[s.length-2]][s[s.length-1]],s.push(w);break;case 3:return!0}}return!0},"parse")},p=function(){return{EOF:1,parseError:e(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:e(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:e(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:e(function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===s.length?this.yylloc.first_column:0)+s[s.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:e(function(t){this.unput(this.match.slice(t))},"less"),pastInput:e(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:e(function(t,e){var n,s,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in i)this[r]=i[r];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;var t,e,n,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),r=0;r<i.length;r++)if((n=this._input.match(this.rules[i[r]]))&&(!e||n[0].length>e[0].length)){if(e=n,s=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[s]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){return this.next()||this.lex()},"lex"),begin:e(function(t){this.conditionStack.push(t)},"begin"),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:e(function(t){this.begin(t)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(t,e,n,s){switch(n){case 0:case 1:case 2:case 4:case 7:case 8:break;case 3:if(t.getIndentMode&&t.getIndentMode())return t.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 5:t.setIndentMode&&t.setIndentMode(!1),this.begin("INITIAL"),this.unput(e.yytext);break;case 6:return this.begin("bol"),8;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(!t.consumeIndentText)return 19;t.consumeIndentText=!1;break;case 15:return 24;case 16:return e.yytext=e.yytext.slice(2,-2),14;case 17:return e.yytext=e.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}}}();function m(){this.yy={}}return x.lexer=p,e(m,"Parser"),m.prototype=x,x.Parser=m,new m}();tt.parser=tt;var et,nt=tt,st=[],it=[],rt=[],ot=new Set,at=!1,lt=e((t,e,n)=>{const s=gt(t).sort(),i=n??10/Math.pow(t.length,2);et=s,1===s.length&&ot.add(s[0]),st.push({sets:s,size:i,label:e?ht(e):void 0})},"addSubsetData"),ct=e(()=>st,"getSubsetData"),ht=e(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),ut=e(t=>t?ht(t):t,"normalizeStyleValue"),ft=e((t,e,n)=>{const s=ht(e);it.push({sets:gt(t).sort(),id:s,label:n?ht(n):void 0})},"addTextData"),dt=e((t,e)=>{const n=gt(t).sort(),s={};for(const[i,r]of e)s[i]=ut(r)??r;rt.push({targets:n,styles:s})},"addStyleData"),yt=e(()=>rt,"getStyleData"),gt=e(t=>t.map(t=>ht(t)),"normalizeIdentifierList"),xt=e(t=>{const e=gt(t).filter(t=>!ot.has(t));if(e.length>0)throw new Error(`unknown set identifier: ${e.join(", ")}`)},"validateUnionIdentifiers"),pt=e(()=>it,"getTextData"),mt=e(()=>et,"getCurrentSets"),bt=e(()=>at,"getIndentMode"),vt=e(t=>{at=t},"setIndentMode"),It=m.venn;function Mt(){return p(It,l().venn)}e(Mt,"getConfig");var kt={getConfig:Mt,clear:e(()=>{x(),st.length=0,it.length=0,rt.length=0,ot.clear(),et=void 0,at=!1},"customClear"),setAccTitle:a,getAccTitle:o,setDiagramTitle:r,getDiagramTitle:i,getAccDescription:s,setAccDescription:n,addSubsetData:lt,getSubsetData:ct,addTextData:ft,addStyleData:dt,validateUnionIdentifiers:xt,getTextData:pt,getStyleData:yt,getCurrentSets:mt,getIndentMode:bt,setIndentMode:vt},wt=e(t=>`\n .venn-title {\n font-size: 32px;\n fill: ${t.vennTitleTextColor};\n font-family: ${t.fontFamily};\n }\n\n .venn-circle text {\n font-size: 48px;\n font-family: ${t.fontFamily};\n }\n\n .venn-intersection text {\n font-size: 48px;\n fill: ${t.vennSetTextColor};\n font-family: ${t.fontFamily};\n }\n\n .venn-text-node {\n font-family: ${t.fontFamily};\n color: ${t.vennSetTextColor};\n }\n`,"getStyles");function _t(t){const e=new Map;for(const n of t){const t=n.targets.join("|"),s=e.get(t);s?Object.assign(s,n.styles):e.set(t,{...n.styles})}return e}e(_t,"buildStyleByKey");var St=e((t,e,n,s)=>{const i=s.db,r=i.getConfig?.(),{themeVariables:o,look:a,handDrawnSeed:x}=l(),p="handDrawn"===a,m=[o.venn1,o.venn2,o.venn3,o.venn4,o.venn5,o.venn6,o.venn7,o.venn8].filter(Boolean),v=i.getDiagramTitle?.(),I=i.getSubsetData(),M=i.getTextData(),k=_t(i.getStyleData()),w=zt(I),_=r?.width??800,S=r?.height??450,E=_/1600,T=v?48*E:0,z=o.primaryTextColor??o.textColor,A=c(e);A.attr("viewBox",`0 0 ${_} ${S}`),v&&A.append("text").text(v).attr("class","venn-title").attr("font-size",32*E+"px").attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*E).style("fill",o.vennTitleTextColor||o.titleColor);const R=h(document.createElement("div")),N=function(t={}){let e=!1,n=600,s=350,i=15,r=1e3,o=Math.PI/2,a=!0,l=null,c=!0,h=!0,u=null,f=null,d=!1,y=null,g=!(!t||!t.symmetricalTextCentre)&&t.symmetricalTextCentre,x={},p=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],m=0,b=function(t){if(t in x)return x[t];var e=x[t]=p[m];return m+=1,m>=p.length&&(m=0),e},v=F,I=P;function M(x){let p=x.datum();const m=new Set;p.forEach(t=>{0==t.size&&1==t.sets.length&&m.add(t.sets[0])}),p=p.filter(t=>!t.sets.some(t=>m.has(t)));let M={},k={};if(p.length>0){let t=v(p,{lossFunction:I,distinct:d});a&&(t=U(t,o,f)),M=G(t,n,s,i,l),k=Z(M,p,g)}const w={};function _(t){return t.sets in w?w[t.sets]:1==t.sets.length?""+t.sets[0]:void 0}p.forEach(t=>{t.label&&(w[t.sets]=t.label)}),x.selectAll("svg").data([M]).enter().append("svg");const S=x.select("svg");e?S.attr("viewBox",`0 0 ${n} ${s}`):S.attr("width",n).attr("height",s);const E={};let T=!1;function z(t){return e=>Q(t.sets.map(t=>{let i=E[t],r=M[t];return i||(i={x:n/2,y:s/2,radius:1}),r||(r={x:n/2,y:s/2,radius:1}),{x:i.x*(1-e)+r.x*e,y:i.y*(1-e)+r.y*e,radius:i.radius*(1-e)+r.radius*e}}),y)}S.selectAll(".venn-area path").each(function(t){const e=this.getAttribute("d");1==t.sets.length&&e&&!d&&(T=!0,E[t.sets[0]]=function(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}(e))});const A=S.selectAll(".venn-area").data(p,t=>t.sets),R=A.enter().append("g").attr("class",t=>`venn-area venn-${1==t.sets.length?"circle":"intersection"}${t.colour||t.color?" venn-coloured":""}`).attr("data-venn-sets",t=>t.sets.join("_")),N=R.append("path"),D=R.append("text").attr("class","label").text(t=>_(t)).attr("text-anchor","middle").attr("dy",".35em").attr("x",n/2).attr("y",s/2);function O(t){return"function"==typeof t.transition?t.transition("venn").duration(r):t}h&&(N.style("fill-opacity","0").filter(t=>1==t.sets.length).style("fill",t=>t.colour?t.colour:t.color?t.color:b(t.sets)).style("fill-opacity",".25"),D.style("fill",e=>e.colour||e.color?"#FFF":t.textFill?t.textFill:1==e.sets.length?b(e.sets):"#444"));let F=x;T&&"function"==typeof F.transition?(F=O(x),F.selectAll("path").attrTween("d",z)):F.selectAll("path").attr("d",t=>Q(t.sets.map(t=>M[t])),y);const C=F.selectAll("text").filter(t=>t.sets in k).text(t=>_(t)).attr("x",t=>Math.floor(k[t.sets].x)).attr("y",t=>Math.floor(k[t.sets].y));c&&(T?"on"in C?C.on("end",X(M,_)):C.each("end",X(M,_)):C.each(X(M,_)));const j=O(A.exit()).remove();"function"==typeof A.transition&&j.selectAll("path").attrTween("d",z);const $=j.selectAll("text").attr("x",n/2).attr("y",s/2);return null!==u&&(D.style("font-size","0px"),C.style("font-size",u),$.style("font-size","0px")),{circles:M,textCentres:k,nodes:A,enter:R,update:F,exit:j}}return M.wrap=function(t){return arguments.length?(c=t,M):c},M.useViewBox=function(){return e=!0,M},M.width=function(t){return arguments.length?(n=t,M):n},M.height=function(t){return arguments.length?(s=t,M):s},M.padding=function(t){return arguments.length?(i=t,M):i},M.distinct=function(t){return arguments.length?(d=t,M):d},M.colours=function(t){return arguments.length?(b=t,M):b},M.colors=function(t){return arguments.length?(b=t,M):b},M.fontSize=function(t){return arguments.length?(u=t,M):u},M.round=function(t){return arguments.length?(y=t,M):y},M.duration=function(t){return arguments.length?(r=t,M):r},M.layoutFunction=function(t){return arguments.length?(v=t,M):v},M.normalize=function(t){return arguments.length?(a=t,M):a},M.scaleToFit=function(t){return arguments.length?(l=t,M):l},M.styled=function(t){return arguments.length?(h=t,M):h},M.orientation=function(t){return arguments.length?(o=t,M):o},M.orientationOrder=function(t){return arguments.length?(f=t,M):f},M.lossFunction=function(t){return arguments.length?(I="default"===t?P:"logRatio"===t?L:t,M):I},M}().width(_).height(S-T);R.datum(w).call(N);const D=p?u.svg(R.select("svg").node()):void 0,O=function(t,e={}){const{lossFunction:n,layoutFunction:s=F,normalize:i=!0,orientation:r=Math.PI/2,orientationOrder:o,width:a=600,height:l=350,padding:c=15,scaleToFit:h=!1,symmetricalTextCentre:u=!1,distinct:f,round:d=2}=e;let y=s(t,{lossFunction:"default"!==n&&n?"logRatio"===n?L:n:P,distinct:f});i&&(y=U(y,r,o));const g=G(y,a,l,c,h),x=Z(g,t,u),p=new Map(Object.keys(g).map(t=>[t,{set:t,x:g[t].x,y:g[t].y,radius:g[t].radius}])),m=t.map(t=>{const e=t.sets.map(t=>p.get(t)),n=H(e);return{circles:e,arcs:n,path:J(n,d),area:t,has:new Set(t.sets)}});function b(t){let e="";for(const n of m)n.has.size>t.length&&t.every(t=>n.has.has(t))&&(e+=" "+n.path);return e}return m.map(({circles:t,arcs:e,path:n,area:s})=>({data:s,text:x[s.sets],circles:t,arcs:e,path:n,distinctPath:n+b(s.sets)}))}(w,{width:_,height:S-T,padding:r?.padding??15}),C=new Map;for(const l of O){const t=Et([...l.data.sets].sort());C.set(t,l)}M.length>0&&Tt(r,C,R,M,E,k);const j=f(o.background||"#f4f4f4");R.selectAll(".venn-circle").each(function(t,e){const n=h(this),s=Et([...t.sets].sort()),i=k.get(s),r=i?.fill||m[e%m.length]||o.primaryColor;n.classed("venn-set-"+e%8,!0);const a=i?.["fill-opacity"]??.1,l=i?.stroke||r,c=i?.["stroke-width"]||""+5*E;if(p&&D){const t=C.get(s);if(t&&t.circles.length>0){const s=t.circles[0],i=D.circle(s.x,s.y,2*s.radius,{roughness:.7,seed:x,fill:b(r,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:60*e-41,stroke:l,strokeWidth:parseFloat(String(c))});n.select("path").remove(),n.node()?.insertBefore(i,n.select("text").node())}}else n.select("path").style("fill",r).style("fill-opacity",a).style("stroke",l).style("stroke-width",c).style("stroke-opacity",.95);const u=i?.color||(j?d(r,30):y(r,30));n.select("text").style("font-size",48*E+"px").style("fill",u)}),p&&D?R.selectAll(".venn-intersection").each(function(t){const e=h(this),n=Et([...t.sets].sort()),s=k.get(n),i=s?.fill;if(i){const t=e.select("path"),n=t.attr("d");if(n){const e=D.path(n,{roughness:.7,seed:x,fill:b(i,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),s=t.node();s?.parentNode?.insertBefore(e,s),t.remove()}}else e.select("path").style("fill-opacity",0);e.select("text").style("font-size",48*E+"px").style("fill",s?.color??o.vennSetTextColor??z)}):(R.selectAll(".venn-intersection text").style("font-size",48*E+"px").style("fill",t=>{const e=Et([...t.sets].sort());return k.get(e)?.color??o.vennSetTextColor??z}),R.selectAll(".venn-intersection path").style("fill-opacity",t=>{const e=Et([...t.sets].sort());return k.get(e)?.fill?1:0}).style("fill",t=>{const e=Et([...t.sets].sort());return k.get(e)?.fill??"transparent"}));const $=A.append("g").attr("transform",`translate(0, ${T})`),q=R.select("svg").node();if(q&&"childNodes"in q)for(const l of[...q.childNodes])$.node()?.appendChild(l);g(A,S,_,r?.useMaxWidth??!0)},"draw");function Et(t){return t.join("|")}function Tt(t,e,n,s,i,r){const o=t?.useDebugLayout??!1,a=n.select("svg").append("g").attr("class","venn-text-nodes"),l=new Map;for(const c of s){const t=Et(c.sets),e=l.get(t);e?e.push(c):l.set(t,[c])}for(const[c,h]of l.entries()){const t=e.get(c);if(!t?.text)continue;const n=t.text.x,s=t.text.y,l=Math.min(...t.circles.map(t=>t.radius)),u=Math.min(...t.circles.map(t=>t.radius-Math.hypot(n-t.x,s-t.y)));let f=Number.isFinite(u)?Math.max(0,u):0;0===f&&Number.isFinite(l)&&(f=.6*l);const d=a.append("g").attr("class","venn-text-area").attr("font-size",40*i+"px");o&&d.append("circle").attr("class","venn-text-debug-circle").attr("cx",n).attr("cy",s).attr("r",f).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const y=Math.max(80*i,2*f*.95),g=Math.max(60*i,2*f*.95),x=(t.data.label&&t.data.label.length>0?Math.min(32*i,.25*f):0)+(h.length<=2?30*i:0),p=n-y/2,m=s-g/2+x,b=Math.max(1,Math.ceil(Math.sqrt(h.length))),v=y/b,I=g/Math.max(1,Math.ceil(h.length/b));for(const[e,a]of h.entries()){const t=e%b,n=Math.floor(e/b),s=p+v*(t+.5),l=m+I*(n+.5);o&&d.append("rect").attr("class","venn-text-debug-cell").attr("x",p+v*t).attr("y",m+I*n).attr("width",v).attr("height",I).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const c=.9*v,h=.9*I,u=d.append("foreignObject").attr("class","venn-text-node-fo").attr("width",c).attr("height",h).attr("x",s-c/2).attr("y",l-h/2).attr("overflow","visible"),f=r.get(a.id)?.color,y=u.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(a.label??a.id);f&&y.style("color",f)}}}function zt(t){const e=new Set(t.map(t=>[...t.sets].sort().join("|"))),n=new Map(t.filter(t=>1===t.sets.length&&void 0!==t.size).map(t=>[t.sets[0],t.size])),s=[];for(const i of t){if(i.sets.length<3)continue;const t=[...i.sets].sort();for(let i=0;i<t.length-1;i++)for(let r=i+1;r<t.length;r++){const o=[t[i],t[r]],a=o.join("|");if(!e.has(a)){e.add(a);const t=n.get(o[0]),i=n.get(o[1]),r=void 0!==t&&void 0!==i?Math.min(t,i)/4:2.5;s.push({sets:o,size:r,label:""})}}}return s.length>0?[...t,...s]:t}e(Et,"stableSetsKey"),e(Tt,"renderTextNodes"),e(zt,"ensurePairwiseSubsets");var At={parser:nt,db:kt,renderer:{draw:St},styles:wt};export{At as diagram};
1
+ import{b3 as t,_ as e,s as n,g as s,p as i,o as r,a as o,b as a,z as l,F as c,d as h,ak as u,a9 as f,aa as d,ab as y,e as g,q as x,B as p,D as m}from"./mermaid.core-jR_k1I8D.js";import"./RemoteLifeOSBlock-BjYrjRa2.js";import"./index-Dx_1eu1W.js";import"./purify.es-BNLkGfTg.js";import"./marked.esm-BBjA1da9.js";import"./App-C21-MM7L.js";import"./index-BTavN9lk.js";import"./file-editor-index-C6CU7Fik.js";const b=(e,n)=>t(e,"a",-n);function v(t,e){const n=function(t){const e=[];for(let n=0;n<t.length;++n)for(let s=n+1;s<t.length;++s){const i=w(t[n],t[s]);for(const t of i)t.parentIndex=[n,s],e.push(t)}return e}(t),s=n.filter(e=>function(t,e){return e.every(e=>M(t,e)<e.radius+1e-10)}(e,t));let i=0,r=0;const o=[];if(s.length>1){const e=_(s);for(let t=0;t<s.length;++t){const n=s[t];n.angle=Math.atan2(n.x-e.x,n.y-e.y)}s.sort((t,e)=>e.angle-t.angle);let n=s[s.length-1];for(let a=0;a<s.length;++a){const e=s[a];r+=(n.x+e.x)*(e.y-n.y);const l={x:(e.x+n.x)/2,y:(e.y+n.y)/2};let c=null;for(let s=0;s<e.parentIndex.length;++s)if(n.parentIndex.includes(e.parentIndex[s])){const i=t[e.parentIndex[s]],r=Math.atan2(e.x-i.x,e.y-i.y),o=Math.atan2(n.x-i.x,n.y-i.y);let a=o-r;a<0&&(a+=2*Math.PI);const h=o-a/2;let u=M(l,{x:i.x+i.radius*Math.sin(h),y:i.y+i.radius*Math.cos(h)});u>2*i.radius&&(u=2*i.radius),(null==c||c.width>u)&&(c={circle:i,width:u,p1:e,p2:n,large:u>i.radius,sweep:!0})}null!=c&&(o.push(c),i+=I(c.circle.radius,c.width),n=e)}}else{let e=t[0];for(let s=1;s<t.length;++s)t[s].radius<e.radius&&(e=t[s]);let n=!1;for(let s=0;s<t.length;++s)if(M(t[s],e)>Math.abs(e.radius-t[s].radius)){n=!0;break}n?i=r=0:(i=e.radius*e.radius*Math.PI,o.push({circle:e,p1:{x:e.x,y:e.y+e.radius},p2:{x:e.x-1e-10,y:e.y+e.radius},width:2*e.radius,large:!0,sweep:!0}))}return r/=2,e&&(e.area=i+r,e.arcArea=i,e.polygonArea=r,e.arcs=o,e.innerPoints=s,e.intersectionPoints=n),i+r}function I(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function M(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function k(t,e,n){if(n>=t+e)return 0;if(n<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const s=e-(n*n-t*t+e*e)/(2*n);return I(t,t-(n*n-e*e+t*t)/(2*n))+I(e,s)}function w(t,e){const n=M(t,e),s=t.radius,i=e.radius;if(n>=s+i||n<=Math.abs(s-i))return[];const r=(s*s-i*i+n*n)/(2*n),o=Math.sqrt(s*s-r*r),a=t.x+r*(e.x-t.x)/n,l=t.y+r*(e.y-t.y)/n,c=-(e.y-t.y)*(o/n),h=-(e.x-t.x)*(o/n);return[{x:a+c,y:l-h},{x:a-c,y:l+h}]}function _(t){const e={x:0,y:0};for(const n of t)e.x+=n.x,e.y+=n.y;return e.x/=t.length,e.y/=t.length,e}function S(t){const e=new Array(t);for(let n=0;n<t;++n)e[n]=0;return e}function E(t,e){return S(t).map(()=>S(e))}function T(t,e){let n=0;for(let s=0;s<t.length;++s)n+=t[s]*e[s];return n}function z(t){return Math.sqrt(T(t,t))}function A(t,e,n){for(let s=0;s<e.length;++s)t[s]=e[s]*n}function R(t,e,n,s,i){for(let r=0;r<t.length;++r)t[r]=e*n[r]+s*i[r]}function N(t,e,n){const s=(n=n||{}).maxIterations||200*e.length,i=n.nonZeroDelta||1.05,r=n.zeroDelta||.001,o=n.minErrorDelta||1e-6,a=n.minErrorDelta||1e-5,l=void 0!==n.rho?n.rho:1,c=void 0!==n.chi?n.chi:2,h=void 0!==n.psi?n.psi:-.5,u=void 0!==n.sigma?n.sigma:.5;let f;const d=e.length,y=new Array(d+1);y[0]=e,y[0].fx=t(e),y[0].id=0;for(let I=0;I<d;++I){const n=e.slice();n[I]=n[I]?n[I]*i:r,y[I+1]=n,y[I+1].fx=t(n),y[I+1].id=I+1}function g(t){for(let e=0;e<t.length;e++)y[d][e]=t[e];y[d].fx=t.fx}const x=(t,e)=>t.fx-e.fx,p=e.slice(),m=e.slice(),b=e.slice(),v=e.slice();for(let I=0;I<s;++I){if(y.sort(x),n.history){const t=y.map(t=>{const e=t.slice();return e.fx=t.fx,e.id=t.id,e});t.sort((t,e)=>t.id-e.id),n.history.push({x:y[0].slice(),fx:y[0].fx,simplex:t})}f=0;for(let t=0;t<d;++t)f=Math.max(f,Math.abs(y[0][t]-y[1][t]));if(Math.abs(y[0].fx-y[d].fx)<o&&f<a)break;for(let t=0;t<d;++t){p[t]=0;for(let e=0;e<d;++e)p[t]+=y[e][t];p[t]/=d}const e=y[d];if(R(m,1+l,p,-l,e),m.fx=t(m),m.fx<y[0].fx)R(v,1+c,p,-c,e),v.fx=t(v),v.fx<m.fx?g(v):g(m);else if(m.fx>=y[d-1].fx){let n=!1;if(m.fx>e.fx?(R(b,1+h,p,-h,e),b.fx=t(b),b.fx<e.fx?g(b):n=!0):(R(b,1-h*l,p,h*l,e),b.fx=t(b),b.fx<m.fx?g(b):n=!0),n){if(u>=1)break;for(let e=1;e<y.length;++e)R(y[e],1-u,y[0],u,y[e]),y[e].fx=t(y[e])}}else g(m)}return y.sort(x),{fx:y[0].fx,x:y[0]}}function D(t,e,n,s,i,r,o){const a=n.fx,l=T(n.fxprime,e);let c=a,h=a,u=l,f=0;function d(h,f,d){for(let y=0;y<16;++y)if(i=(h+f)/2,R(s.x,1,n.x,i,e),c=s.fx=t(s.x,s.fxprime),u=T(s.fxprime,e),c>a+r*i*l||c>=d)f=i;else{if(Math.abs(u)<=-o*l)return i;u*(f-h)>=0&&(f=h),h=i,d=c}return 0}i=i||1,r=r||1e-6,o=o||.1;for(let y=0;y<10;++y){if(R(s.x,1,n.x,i,e),c=s.fx=t(s.x,s.fxprime),u=T(s.fxprime,e),c>a+r*i*l||y&&c>=h)return d(f,i,h);if(Math.abs(u)<=-o*l)return i;if(u>=0)return d(i,f,c);h=c,f=i,i*=2}return i}function O(t,e,n){let s={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()};const r=e.slice();let o,a,l,c=1;l=(n=n||{}).maxIterations||20*e.length,s.fx=t(s.x,s.fxprime),o=s.fxprime.slice(),A(o,s.fxprime,-1);for(let h=0;h<l;++h){if(c=D(t,o,s,i,c),n.history&&n.history.push({x:s.x.slice(),fx:s.fx,fxprime:s.fxprime.slice(),alpha:c}),c){R(r,1,i.fxprime,-1,s.fxprime);const t=T(s.fxprime,s.fxprime);R(o,Math.max(0,T(r,i.fxprime)/t),o,-1,i.fxprime),a=s,s=i,i=a}else A(o,s.fxprime,-1);if(z(s.fxprime)<=1e-5)break}return n.history&&n.history.push({x:s.x.slice(),fx:s.fx,fxprime:s.fxprime.slice(),alpha:c}),s}function F(t,e={}){e.maxIterations=e.maxIterations||500;const n=e.initialLayout||$,s=e.lossFunction||P,i=function(t,e={}){const n=e.distinct,s=t.map(t=>Object.assign({},t));function i(t){return t.join(";")}if(n){const t=new Map;for(const e of s)for(let n=0;n<e.sets.length;n++){const s=String(e.sets[n]);t.set(s,e.size+(t.get(s)||0));for(let i=n+1;i<e.sets.length;i++){const n=String(e.sets[i]),r=`${s};${n}`,o=`${n};${s}`;t.set(r,e.size+(t.get(r)||0)),t.set(o,e.size+(t.get(o)||0))}}for(const e of s)e.sets.length<3&&(e.size=t.get(i(e.sets)))}const r=[],o=new Set;for(const a of s)if(1===a.sets.length)r.push(a.sets[0]);else if(2===a.sets.length){const t=a.sets[0],e=a.sets[1];o.add(i(a.sets)),o.add(i([e,t]))}r.sort((t,e)=>t===e?0:t<e?-1:1);for(let a=0;a<r.length;++a){const t=r[a];for(let e=a+1;e<r.length;++e){const n=r[e];o.has(i([t,n]))||s.push({sets:[t,n],size:0})}}return s}(t,e),r=n(i,e),o=Object.keys(r),a=[];for(const c of o)a.push(r[c].x),a.push(r[c].y);const l=N(t=>{const e={};for(let n=0;n<o.length;++n){const s=o[n];e[s]={x:t[2*n],y:t[2*n+1],radius:r[s].radius}}return s(e,i)},a,e).x;for(let c=0;c<o.length;++c){const t=o[c];r[t].x=l[2*c],r[t].y=l[2*c+1]}return r}const C=1e-10;function j(t,e,n){return Math.min(t,e)*Math.min(t,e)*Math.PI<=n+C?Math.abs(t-e):function(t,e,n,s){const i=(s=s||{}).maxIterations||100,r=s.tolerance||1e-10,o=t(e),a=t(n);let l=n-e;if(o*a>0)throw"Initial bisect points must have opposite signs";if(0===o)return e;if(0===a)return n;for(let c=0;c<i;++c){l/=2;const n=e+l,s=t(n);if(s*o>=0&&(e=n),Math.abs(l)<r||0===s)return n}return e+l}(s=>k(t,e,s)-n,0,t+e)}function $(t,e={}){let n=function(t,e){const n=e&&e.lossFunction?e.lossFunction:P,s={},i={};for(const u of t)if(1===u.sets.length){const t=u.sets[0];s[t]={x:1e10,y:1e10,rowid:s.length,size:u.size,radius:Math.sqrt(u.size/Math.PI)},i[t]=[]}t=t.filter(t=>2===t.sets.length);for(const u of t){let t=null!=u.weight?u.weight:1;const e=u.sets[0],n=u.sets[1];u.size+C>=Math.min(s[e].size,s[n].size)&&(t=0),i[e].push({set:n,size:u.size,weight:t}),i[n].push({set:e,size:u.size,weight:t})}const r=[];function o(t,e){return e.size-t.size}Object.keys(i).forEach(t=>{let e=0;for(let n=0;n<i[t].length;++n)e+=i[t][n].size*i[t][n].weight;r.push({set:t,size:e})}),r.sort(o);const a={};function l(t){return t.set in a}function c(t,e){s[e].x=t.x,s[e].y=t.y,a[e]=!0}c({x:0,y:0},r[0].set);for(let u=1;u<r.length;++u){const e=r[u].set,a=i[e].filter(l),f=s[e];if(a.sort(o),0===a.length)throw"ERROR: missing pairwise overlap information";const d=[];for(var h=0;h<a.length;++h){const t=s[a[h].set],e=j(f.radius,t.radius,a[h].size);d.push({x:t.x+e,y:t.y}),d.push({x:t.x-e,y:t.y}),d.push({y:t.y+e,x:t.x}),d.push({y:t.y-e,x:t.x});for(let n=h+1;n<a.length;++n){const i=s[a[n].set],r=j(f.radius,i.radius,a[n].size),o=w({x:t.x,y:t.y,radius:e},{x:i.x,y:i.y,radius:r});d.push(...o)}}let y=1e50,g=d[0];for(const i of d){s[e].x=i.x,s[e].y=i.y;const r=n(s,t);r<y&&(y=r,g=i)}c(g,e)}return s}(t,e);const s=e.lossFunction||P;if(t.length>=8){const i=function(t,e={}){const n=e.restarts||10,s=[],i={};for(const f of t)1===f.sets.length&&(i[f.sets[0]]=s.length,s.push(f));let{distances:r,constraints:o}=function(t,e,n){const s=E(e.length,e.length),i=E(e.length,e.length);return t.filter(t=>2===t.sets.length).forEach(t=>{const r=n[t.sets[0]],o=n[t.sets[1]],a=j(Math.sqrt(e[r].size/Math.PI),Math.sqrt(e[o].size/Math.PI),t.size);s[r][o]=s[o][r]=a;let l=0;t.size+1e-10>=Math.min(e[r].size,e[o].size)?l=1:t.size<=1e-10&&(l=-1),i[r][o]=i[o][r]=l}),{distances:s,constraints:i}}(t,s,i);const a=z(r.map(z))/r.length;r=r.map(t=>t.map(t=>t/a));const l=(t,e)=>function(t,e,n,s){for(let r=0;r<e.length;++r)e[r]=0;let i=0;for(let r=0;r<n.length;++r){const o=t[2*r],a=t[2*r+1];for(let l=r+1;l<n.length;++l){const c=t[2*l],h=t[2*l+1],u=n[r][l],f=s[r][l],d=(c-o)*(c-o)+(h-a)*(h-a),y=Math.sqrt(d),g=d-u*u;f>0&&y<=u||f<0&&y>=u||(i+=2*g*g,e[2*r]+=4*g*(o-c),e[2*r+1]+=4*g*(a-h),e[2*l]+=4*g*(c-o),e[2*l+1]+=4*g*(h-a))}}return i}(t,e,r,o);let c=null;for(let f=0;f<n;++f){const t=O(l,S(2*r.length).map(Math.random),e);(!c||t.fx<c.fx)&&(c=t)}const h=c.x,u={};for(let f=0;f<s.length;++f){const t=s[f];u[t.sets[0]]={x:h[2*f]*a,y:h[2*f+1]*a,radius:Math.sqrt(t.size/Math.PI)}}if(e.history)for(const f of e.history)A(f.x,a);return u}(t,e);s(i,t)+1e-8<s(n,t)&&(n=i)}return n}function P(t,e){let n=0;for(const s of e){if(1===s.sets.length)continue;let e;if(2===s.sets.length){const n=t[s.sets[0]],i=t[s.sets[1]];e=k(n.radius,i.radius,M(n,i))}else e=v(s.sets.map(e=>t[e]));n+=(null!=s.weight?s.weight:1)*(e-s.size)*(e-s.size)}return n}function L(t,e){let n=0;for(const s of e){if(1===s.sets.length)continue;let e;if(2===s.sets.length){const n=t[s.sets[0]],i=t[s.sets[1]];e=k(n.radius,i.radius,M(n,i))}else e=v(s.sets.map(e=>t[e]));const i=null!=s.weight?s.weight:1,r=Math.log((e+1)/(s.size+1));n+=i*r*r}return n}function q(t,e,n){if(null==n?t.sort((t,e)=>e.radius-t.radius):t.sort(n),t.length>0){const e=t[0].x,n=t[0].y;for(const s of t)s.x-=e,s.y-=n}if(2===t.length&&M(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const n=Math.atan2(t[1].x,t[1].y)-e,s=Math.cos(n),i=Math.sin(n);for(const e of t){const t=e.x,n=e.y;e.x=s*t-i*n,e.y=i*t+s*n}}if(t.length>2){let n=Math.atan2(t[2].x,t[2].y)-e;for(;n<0;)n+=2*Math.PI;for(;n>2*Math.PI;)n-=2*Math.PI;if(n>Math.PI){const e=t[1].y/(1e-10+t[1].x);for(const n of t){var s=(n.x+e*n.y)/(1+e*e);n.x=2*s-n.x,n.y=2*s*e-n.y}}}}function B(t){const e=e=>({max:t.reduce((t,n)=>Math.max(t,n[e]+n.radius),Number.NEGATIVE_INFINITY),min:t.reduce((t,n)=>Math.min(t,n[e]-n.radius),Number.POSITIVE_INFINITY)});return{xRange:e("x"),yRange:e("y")}}function U(t,e,n){null==e&&(e=Math.PI/2);let s=V(t).map(t=>Object.assign({},t));const i=function(t){function e(t){return t.parent!==t&&(t.parent=e(t.parent)),t.parent}function n(t,n){const s=e(t),i=e(n);s.parent=i}t.forEach(t=>{t.parent=t});for(let i=0;i<t.length;++i)for(let e=i+1;e<t.length;++e){const s=t[i].radius+t[e].radius;M(t[i],t[e])+1e-10<s&&n(t[e],t[i])}const s=new Map;for(let i=0;i<t.length;++i){const n=e(t[i]).parent.setid;s.has(n)||s.set(n,[]),s.get(n).push(t[i])}return t.forEach(t=>{delete t.parent}),Array.from(s.values())}(s);for(const c of i){q(c,e,n);const t=B(c);c.size=(t.xRange.max-t.xRange.min)*(t.yRange.max-t.yRange.min),c.bounds=t}i.sort((t,e)=>e.size-t.size),s=i[0];let r=s.bounds;const o=(r.xRange.max-r.xRange.min)/50;function a(t,e,n){if(!t)return;const i=t.bounds;let a,l;if(e)a=r.xRange.max-i.xRange.min+o;else{a=r.xRange.max-i.xRange.max;const t=(i.xRange.max-i.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;t<0&&(a+=t)}if(n)l=r.yRange.max-i.yRange.min+o;else{l=r.yRange.max-i.yRange.max;const t=(i.yRange.max-i.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;t<0&&(l+=t)}for(const r of t)r.x+=a,r.y+=l,s.push(r)}let l=1;for(;l<i.length;)a(i[l],!0,!1),a(i[l+1],!1,!0),a(i[l+2],!0,!0),l+=3,r=B(s);return W(s)}function G(t,e,n,s,i){const r=V(t);e-=2*s,n-=2*s;const{xRange:o,yRange:a}=B(r);if(o.max===o.min||a.max===a.min)return console.log("not scaling solution: zero size detected"),t;let l,c;if(i){const t=2*Math.sqrt(i/Math.PI);l=e/t,c=n/t}else l=e/(o.max-o.min),c=n/(a.max-a.min);const h=Math.min(c,l),u=(e-(o.max-o.min)*h)/2,f=(n-(a.max-a.min)*h)/2;return W(r.map(t=>({radius:h*t.radius,x:s+u+(t.x-o.min)*h,y:s+f+(t.y-a.min)*h,setid:t.setid})))}function W(t){const e={};for(const n of t)e[n.setid]=n;return e}function V(t){return Object.keys(t).map(e=>Object.assign(t[e],{setid:e}))}function X(t,e){return function(n){const s=this,i=t[n.sets[0]].radius||50,r=e(n)||"",o=r.split(/\s+/).reverse(),a=(r.length+o.length)/3;let l=o.pop(),c=[l],h=0;s.textContent=null;const u=[];function f(t){const e=s.ownerDocument.createElementNS(s.namespaceURI,"tspan");return e.textContent=t,u.push(e),s.append(e),e}let d=f(l);for(;l=o.pop(),l;){c.push(l);const t=c.join(" ");d.textContent=t,t.length>a&&d.getComputedTextLength()>i&&(c.pop(),d.textContent=c.join(" "),c=[l],d=f(l),h++)}const y=.35-1.1*h/2,g=s.getAttribute("x"),x=s.getAttribute("y");u.forEach((t,e)=>{t.setAttribute("x",g),t.setAttribute("y",x),t.setAttribute("dy",`${y+1.1*e}em`)})}}function Y(t,e,n){let s=e[0].radius-M(e[0],t);for(let i=1;i<e.length;++i){const n=e[i].radius-M(e[i],t);n<=s&&(s=n)}for(let i=0;i<n.length;++i){const e=M(n[i],t)-n[i].radius;e<=s&&(s=e)}return s}function K(t,e,n){const s=[];for(const h of t)s.push({x:h.x,y:h.y}),s.push({x:h.x+h.radius/2,y:h.y}),s.push({x:h.x-h.radius/2,y:h.y}),s.push({x:h.x,y:h.y+h.radius/2}),s.push({x:h.x,y:h.y-h.radius/2});let i=s[0],r=Y(s[0],t,e);for(let h=1;h<s.length;++h){const n=Y(s[h],t,e);n>=r&&(i=s[h],r=n)}const o=N(n=>-1*Y({x:n[0],y:n[1]},t,e),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,a={x:n?0:o[0],y:o[1]};let l=!0;for(const h of t)if(M(a,h)>h.radius){l=!1;break}for(const h of e)if(M(a,h)<h.radius){l=!1;break}if(l)return a;if(1==t.length)return{x:t[0].x,y:t[0].y};const c={};return v(t,c),0===c.arcs.length?{x:0,y:-1e3,disjoint:!0}:1==c.arcs.length?{x:c.arcs[0].circle.x,y:c.arcs[0].circle.y}:e.length?K(t,[]):_(c.arcs.map(t=>t.p1))}function H(t,e,n){const s={},i=function(t){const e={},n=Object.keys(t);for(const s of n)e[s]=[];for(let s=0;s<n.length;s++){const i=n[s],r=t[i];for(let o=s+1;o<n.length;++o){const s=n[o],a=t[s],l=M(r,a);l+a.radius<=r.radius+1e-10?e[s].push(i):l+r.radius<=a.radius+1e-10&&e[i].push(s)}}return e}(t);for(let r=0;r<e.length;++r){const o=e[r].sets,a={},l={};for(let t=0;t<o.length;++t){a[o[t]]=!0;const e=i[o[t]];for(let t=0;t<e.length;++t)l[e[t]]=!0}const c=[],h=[];for(let e in t)e in a?c.push(t[e]):e in l||h.push(t[e]);const u=K(c,h,n);s[o]=u,u.disjoint&&e[r].size>0&&console.log("WARNING: area "+o+" not represented on screen")}return s}function Z(t){if(0===t.length)return[];const e={};return v(t,e),e.arcs}function J(t,e){if(0===t.length)return"M 0 0";const n=Math.pow(10,e||0),s=null!=e?t=>Math.round(t*n)/n:t=>t;if(1==t.length){const e=t[0].circle;return function(t,e,n){const s=[];return s.push("\nM",t,e),s.push("\nm",-n,0),s.push("\na",n,n,0,1,0,2*n,0),s.push("\na",n,n,0,1,0,2*-n,0),s.join(" ")}(s(e.x),s(e.y),s(e.radius))}const i=["\nM",s(t[0].p2.x),s(t[0].p2.y)];for(const r of t){const t=s(r.circle.radius);i.push("\nA",t,t,0,r.large?1:0,r.sweep?1:0,s(r.p1.x),s(r.p1.y))}return i.join(" ")}function Q(t,e){return J(Z(t),e)}var tt=function(){var t=e(function(t,e,n,s){for(n=n||{},s=t.length;s--;n[t[s]]=e);return n},"o"),n=[5,8],s=[7,8,11,12,17,19,22,24],i=[1,17],r=[1,18],o=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],a=[1,31],l=[1,39],c=[7,8,11,12,17,19,22,24,27],h=[1,57],u=[1,56],f=[1,58],d=[1,59],y=[1,60],g=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],x={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:e(function(t,e,n,s,i,r,o){var a=r.length-1;switch(i){case 1:return r[a-1];case 2:case 3:case 4:case 6:this.$=[];break;case 5:case 35:r[a-1].push(r[a]),this.$=r[a-1];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:case 43:case 44:this.$=r[a];break;case 8:s.setDiagramTitle(r[a].substr(6)),this.$=r[a].substr(6);break;case 9:s.addSubsetData([r[a]],void 0,void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 10:s.addSubsetData([r[a-1]],r[a],void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 11:s.addSubsetData([r[a-2]],void 0,parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 12:s.addSubsetData([r[a-3]],r[a-2],parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 13:if(r[a].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a]),s.addSubsetData(r[a],void 0,void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 14:if(r[a-1].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a-1]),s.addSubsetData(r[a-1],r[a],void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 15:if(r[a-2].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a-2]),s.addSubsetData(r[a-2],void 0,parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 16:if(r[a-3].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a-3]),s.addSubsetData(r[a-3],r[a-2],parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 17:case 18:case 19:s.addTextData(r[a-1],r[a],void 0);break;case 20:case 21:s.addTextData(r[a-2],r[a-1],r[a]);break;case 23:s.addStyleData(r[a-1],r[a]);break;case 24:case 25:case 26:if(!(l=s.getCurrentSets()))throw new Error("text requires set");s.addTextData(l,r[a],void 0);break;case 27:case 28:var l;if(!(l=s.getCurrentSets()))throw new Error("text requires set");s.addTextData(l,r[a-1],r[a]);break;case 29:case 41:case 34:this.$=[r[a]];break;case 30:case 42:this.$=[...r[a-2],r[a]];break;case 31:this.$=[r[a-2],r[a]];break;case 33:this.$=r[a].join(" ")}},"anonymous"),table:[t(n,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(s,[2,4],{6:5}),t(n,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(s,[2,5]),t(s,[2,6]),t(s,[2,7]),t(s,[2,8]),{13:16,20:i,21:r},{13:20,18:19,20:i,21:r},{13:20,18:21,20:i,21:r},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:i,21:r},t(s,[2,9],{14:[1,27],15:[1,28]}),t(o,[2,43]),t(o,[2,44]),t(s,[2,13],{14:[1,29],15:[1,30],27:a}),t(o,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:a},t(s,[2,22]),t(s,[2,24],{14:[1,35]}),t(s,[2,25],{14:[1,36]}),t(s,[2,26]),{20:l,25:37,26:38,27:a},t(s,[2,10],{15:[1,40]}),{16:[1,41]},t(s,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:i,21:r},t(s,[2,17],{14:[1,45]}),t(s,[2,18],{14:[1,46]}),t(s,[2,19]),t(s,[2,27]),t(s,[2,28]),t(s,[2,23],{27:[1,47]}),t(c,[2,29]),{15:[1,48]},{16:[1,49]},t(s,[2,11]),{16:[1,50]},t(s,[2,15]),t(o,[2,42]),t(s,[2,20]),t(s,[2,21]),{20:l,26:51},{16:h,20:u,21:[1,53],28:52,29:54,30:55,31:f,32:d,33:y},t(s,[2,12]),t(s,[2,16]),t(c,[2,30]),t(c,[2,31]),t(c,[2,32]),t(c,[2,33],{30:61,16:h,20:u,31:f,32:d,33:y}),t(g,[2,34]),t(g,[2,36]),t(g,[2,37]),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,35])],defaultActions:{6:[2,1]},parseError:e(function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},"parseError"),parse:e(function(t){var n=this,s=[0],i=[],r=[null],o=[],a=this.table,l="",c=0,h=0,u=o.slice.call(arguments,1),f=Object.create(this.lexer),d={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(d.yy[y]=this.yy[y]);f.setInput(t,d.yy),d.yy.lexer=f,d.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var g=f.yylloc;o.push(g);var x=f.options&&f.options.ranges;function p(){var t;return"number"!=typeof(t=i.pop()||f.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,e(function(t){s.length=s.length-2*t,r.length=r.length-t,o.length=o.length-t},"popStack"),e(p,"lex");for(var m,b,v,I,M,k,w,_,S={};;){if(b=s[s.length-1],this.defaultActions[b]?v=this.defaultActions[b]:(null==m&&(m=p()),v=a[b]&&a[b][m]),void 0===v||!v.length||!v[0]){var E;for(M in _=[],a[b])this.terminals_[M]&&M>2&&_.push("'"+this.terminals_[M]+"'");E=f.showPosition?"Parse error on line "+(c+1)+":\n"+f.showPosition()+"\nExpecting "+_.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(E,{text:f.match,token:this.terminals_[m]||m,line:f.yylineno,loc:g,expected:_})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+m);switch(v[0]){case 1:s.push(m),r.push(f.yytext),o.push(f.yylloc),s.push(v[1]),m=null,h=f.yyleng,l=f.yytext,c=f.yylineno,g=f.yylloc;break;case 2:if(k=this.productions_[v[1]][1],S.$=r[r.length-k],S._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},x&&(S._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),void 0!==(I=this.performAction.apply(S,[l,h,c,d.yy,v[1],r,o].concat(u))))return I;k&&(s=s.slice(0,-1*k*2),r=r.slice(0,-1*k),o=o.slice(0,-1*k)),s.push(this.productions_[v[1]][0]),r.push(S.$),o.push(S._$),w=a[s[s.length-2]][s[s.length-1]],s.push(w);break;case 3:return!0}}return!0},"parse")},p=function(){return{EOF:1,parseError:e(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:e(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:e(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:e(function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===s.length?this.yylloc.first_column:0)+s[s.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:e(function(t){this.unput(this.match.slice(t))},"less"),pastInput:e(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:e(function(t,e){var n,s,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in i)this[r]=i[r];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;var t,e,n,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),r=0;r<i.length;r++)if((n=this._input.match(this.rules[i[r]]))&&(!e||n[0].length>e[0].length)){if(e=n,s=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[s]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){return this.next()||this.lex()},"lex"),begin:e(function(t){this.conditionStack.push(t)},"begin"),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:e(function(t){this.begin(t)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(t,e,n,s){switch(n){case 0:case 1:case 2:case 4:case 7:case 8:break;case 3:if(t.getIndentMode&&t.getIndentMode())return t.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 5:t.setIndentMode&&t.setIndentMode(!1),this.begin("INITIAL"),this.unput(e.yytext);break;case 6:return this.begin("bol"),8;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(!t.consumeIndentText)return 19;t.consumeIndentText=!1;break;case 15:return 24;case 16:return e.yytext=e.yytext.slice(2,-2),14;case 17:return e.yytext=e.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}}}();function m(){this.yy={}}return x.lexer=p,e(m,"Parser"),m.prototype=x,x.Parser=m,new m}();tt.parser=tt;var et,nt=tt,st=[],it=[],rt=[],ot=new Set,at=!1,lt=e((t,e,n)=>{const s=gt(t).sort(),i=n??10/Math.pow(t.length,2);et=s,1===s.length&&ot.add(s[0]),st.push({sets:s,size:i,label:e?ht(e):void 0})},"addSubsetData"),ct=e(()=>st,"getSubsetData"),ht=e(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),ut=e(t=>t?ht(t):t,"normalizeStyleValue"),ft=e((t,e,n)=>{const s=ht(e);it.push({sets:gt(t).sort(),id:s,label:n?ht(n):void 0})},"addTextData"),dt=e((t,e)=>{const n=gt(t).sort(),s={};for(const[i,r]of e)s[i]=ut(r)??r;rt.push({targets:n,styles:s})},"addStyleData"),yt=e(()=>rt,"getStyleData"),gt=e(t=>t.map(t=>ht(t)),"normalizeIdentifierList"),xt=e(t=>{const e=gt(t).filter(t=>!ot.has(t));if(e.length>0)throw new Error(`unknown set identifier: ${e.join(", ")}`)},"validateUnionIdentifiers"),pt=e(()=>it,"getTextData"),mt=e(()=>et,"getCurrentSets"),bt=e(()=>at,"getIndentMode"),vt=e(t=>{at=t},"setIndentMode"),It=m.venn;function Mt(){return p(It,l().venn)}e(Mt,"getConfig");var kt={getConfig:Mt,clear:e(()=>{x(),st.length=0,it.length=0,rt.length=0,ot.clear(),et=void 0,at=!1},"customClear"),setAccTitle:a,getAccTitle:o,setDiagramTitle:r,getDiagramTitle:i,getAccDescription:s,setAccDescription:n,addSubsetData:lt,getSubsetData:ct,addTextData:ft,addStyleData:dt,validateUnionIdentifiers:xt,getTextData:pt,getStyleData:yt,getCurrentSets:mt,getIndentMode:bt,setIndentMode:vt},wt=e(t=>`\n .venn-title {\n font-size: 32px;\n fill: ${t.vennTitleTextColor};\n font-family: ${t.fontFamily};\n }\n\n .venn-circle text {\n font-size: 48px;\n font-family: ${t.fontFamily};\n }\n\n .venn-intersection text {\n font-size: 48px;\n fill: ${t.vennSetTextColor};\n font-family: ${t.fontFamily};\n }\n\n .venn-text-node {\n font-family: ${t.fontFamily};\n color: ${t.vennSetTextColor};\n }\n`,"getStyles");function _t(t){const e=new Map;for(const n of t){const t=n.targets.join("|"),s=e.get(t);s?Object.assign(s,n.styles):e.set(t,{...n.styles})}return e}e(_t,"buildStyleByKey");var St=e((t,e,n,s)=>{const i=s.db,r=i.getConfig?.(),{themeVariables:o,look:a,handDrawnSeed:x}=l(),p="handDrawn"===a,m=[o.venn1,o.venn2,o.venn3,o.venn4,o.venn5,o.venn6,o.venn7,o.venn8].filter(Boolean),v=i.getDiagramTitle?.(),I=i.getSubsetData(),M=i.getTextData(),k=_t(i.getStyleData()),w=zt(I),_=r?.width??800,S=r?.height??450,E=_/1600,T=v?48*E:0,z=o.primaryTextColor??o.textColor,A=c(e);A.attr("viewBox",`0 0 ${_} ${S}`),v&&A.append("text").text(v).attr("class","venn-title").attr("font-size",32*E+"px").attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*E).style("fill",o.vennTitleTextColor||o.titleColor);const R=h(document.createElement("div")),N=function(t={}){let e=!1,n=600,s=350,i=15,r=1e3,o=Math.PI/2,a=!0,l=null,c=!0,h=!0,u=null,f=null,d=!1,y=null,g=!(!t||!t.symmetricalTextCentre)&&t.symmetricalTextCentre,x={},p=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],m=0,b=function(t){if(t in x)return x[t];var e=x[t]=p[m];return m+=1,m>=p.length&&(m=0),e},v=F,I=P;function M(x){let p=x.datum();const m=new Set;p.forEach(t=>{0==t.size&&1==t.sets.length&&m.add(t.sets[0])}),p=p.filter(t=>!t.sets.some(t=>m.has(t)));let M={},k={};if(p.length>0){let t=v(p,{lossFunction:I,distinct:d});a&&(t=U(t,o,f)),M=G(t,n,s,i,l),k=H(M,p,g)}const w={};function _(t){return t.sets in w?w[t.sets]:1==t.sets.length?""+t.sets[0]:void 0}p.forEach(t=>{t.label&&(w[t.sets]=t.label)}),x.selectAll("svg").data([M]).enter().append("svg");const S=x.select("svg");e?S.attr("viewBox",`0 0 ${n} ${s}`):S.attr("width",n).attr("height",s);const E={};let T=!1;function z(t){return e=>Q(t.sets.map(t=>{let i=E[t],r=M[t];return i||(i={x:n/2,y:s/2,radius:1}),r||(r={x:n/2,y:s/2,radius:1}),{x:i.x*(1-e)+r.x*e,y:i.y*(1-e)+r.y*e,radius:i.radius*(1-e)+r.radius*e}}),y)}S.selectAll(".venn-area path").each(function(t){const e=this.getAttribute("d");1==t.sets.length&&e&&!d&&(T=!0,E[t.sets[0]]=function(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}(e))});const A=S.selectAll(".venn-area").data(p,t=>t.sets),R=A.enter().append("g").attr("class",t=>`venn-area venn-${1==t.sets.length?"circle":"intersection"}${t.colour||t.color?" venn-coloured":""}`).attr("data-venn-sets",t=>t.sets.join("_")),N=R.append("path"),D=R.append("text").attr("class","label").text(t=>_(t)).attr("text-anchor","middle").attr("dy",".35em").attr("x",n/2).attr("y",s/2);function O(t){return"function"==typeof t.transition?t.transition("venn").duration(r):t}h&&(N.style("fill-opacity","0").filter(t=>1==t.sets.length).style("fill",t=>t.colour?t.colour:t.color?t.color:b(t.sets)).style("fill-opacity",".25"),D.style("fill",e=>e.colour||e.color?"#FFF":t.textFill?t.textFill:1==e.sets.length?b(e.sets):"#444"));let F=x;T&&"function"==typeof F.transition?(F=O(x),F.selectAll("path").attrTween("d",z)):F.selectAll("path").attr("d",t=>Q(t.sets.map(t=>M[t])),y);const C=F.selectAll("text").filter(t=>t.sets in k).text(t=>_(t)).attr("x",t=>Math.floor(k[t.sets].x)).attr("y",t=>Math.floor(k[t.sets].y));c&&(T?"on"in C?C.on("end",X(M,_)):C.each("end",X(M,_)):C.each(X(M,_)));const j=O(A.exit()).remove();"function"==typeof A.transition&&j.selectAll("path").attrTween("d",z);const $=j.selectAll("text").attr("x",n/2).attr("y",s/2);return null!==u&&(D.style("font-size","0px"),C.style("font-size",u),$.style("font-size","0px")),{circles:M,textCentres:k,nodes:A,enter:R,update:F,exit:j}}return M.wrap=function(t){return arguments.length?(c=t,M):c},M.useViewBox=function(){return e=!0,M},M.width=function(t){return arguments.length?(n=t,M):n},M.height=function(t){return arguments.length?(s=t,M):s},M.padding=function(t){return arguments.length?(i=t,M):i},M.distinct=function(t){return arguments.length?(d=t,M):d},M.colours=function(t){return arguments.length?(b=t,M):b},M.colors=function(t){return arguments.length?(b=t,M):b},M.fontSize=function(t){return arguments.length?(u=t,M):u},M.round=function(t){return arguments.length?(y=t,M):y},M.duration=function(t){return arguments.length?(r=t,M):r},M.layoutFunction=function(t){return arguments.length?(v=t,M):v},M.normalize=function(t){return arguments.length?(a=t,M):a},M.scaleToFit=function(t){return arguments.length?(l=t,M):l},M.styled=function(t){return arguments.length?(h=t,M):h},M.orientation=function(t){return arguments.length?(o=t,M):o},M.orientationOrder=function(t){return arguments.length?(f=t,M):f},M.lossFunction=function(t){return arguments.length?(I="default"===t?P:"logRatio"===t?L:t,M):I},M}().width(_).height(S-T);R.datum(w).call(N);const D=p?u.svg(R.select("svg").node()):void 0,O=function(t,e={}){const{lossFunction:n,layoutFunction:s=F,normalize:i=!0,orientation:r=Math.PI/2,orientationOrder:o,width:a=600,height:l=350,padding:c=15,scaleToFit:h=!1,symmetricalTextCentre:u=!1,distinct:f,round:d=2}=e;let y=s(t,{lossFunction:"default"!==n&&n?"logRatio"===n?L:n:P,distinct:f});i&&(y=U(y,r,o));const g=G(y,a,l,c,h),x=H(g,t,u),p=new Map(Object.keys(g).map(t=>[t,{set:t,x:g[t].x,y:g[t].y,radius:g[t].radius}])),m=t.map(t=>{const e=t.sets.map(t=>p.get(t)),n=Z(e);return{circles:e,arcs:n,path:J(n,d),area:t,has:new Set(t.sets)}});function b(t){let e="";for(const n of m)n.has.size>t.length&&t.every(t=>n.has.has(t))&&(e+=" "+n.path);return e}return m.map(({circles:t,arcs:e,path:n,area:s})=>({data:s,text:x[s.sets],circles:t,arcs:e,path:n,distinctPath:n+b(s.sets)}))}(w,{width:_,height:S-T,padding:r?.padding??15}),C=new Map;for(const l of O){const t=Et([...l.data.sets].sort());C.set(t,l)}M.length>0&&Tt(r,C,R,M,E,k);const j=f(o.background||"#f4f4f4");R.selectAll(".venn-circle").each(function(t,e){const n=h(this),s=Et([...t.sets].sort()),i=k.get(s),r=i?.fill||m[e%m.length]||o.primaryColor;n.classed("venn-set-"+e%8,!0);const a=i?.["fill-opacity"]??.1,l=i?.stroke||r,c=i?.["stroke-width"]||""+5*E;if(p&&D){const t=C.get(s);if(t&&t.circles.length>0){const s=t.circles[0],i=D.circle(s.x,s.y,2*s.radius,{roughness:.7,seed:x,fill:b(r,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:60*e-41,stroke:l,strokeWidth:parseFloat(String(c))});n.select("path").remove(),n.node()?.insertBefore(i,n.select("text").node())}}else n.select("path").style("fill",r).style("fill-opacity",a).style("stroke",l).style("stroke-width",c).style("stroke-opacity",.95);const u=i?.color||(j?d(r,30):y(r,30));n.select("text").style("font-size",48*E+"px").style("fill",u)}),p&&D?R.selectAll(".venn-intersection").each(function(t){const e=h(this),n=Et([...t.sets].sort()),s=k.get(n),i=s?.fill;if(i){const t=e.select("path"),n=t.attr("d");if(n){const e=D.path(n,{roughness:.7,seed:x,fill:b(i,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),s=t.node();s?.parentNode?.insertBefore(e,s),t.remove()}}else e.select("path").style("fill-opacity",0);e.select("text").style("font-size",48*E+"px").style("fill",s?.color??o.vennSetTextColor??z)}):(R.selectAll(".venn-intersection text").style("font-size",48*E+"px").style("fill",t=>{const e=Et([...t.sets].sort());return k.get(e)?.color??o.vennSetTextColor??z}),R.selectAll(".venn-intersection path").style("fill-opacity",t=>{const e=Et([...t.sets].sort());return k.get(e)?.fill?1:0}).style("fill",t=>{const e=Et([...t.sets].sort());return k.get(e)?.fill??"transparent"}));const $=A.append("g").attr("transform",`translate(0, ${T})`),q=R.select("svg").node();if(q&&"childNodes"in q)for(const l of[...q.childNodes])$.node()?.appendChild(l);g(A,S,_,r?.useMaxWidth??!0)},"draw");function Et(t){return t.join("|")}function Tt(t,e,n,s,i,r){const o=t?.useDebugLayout??!1,a=n.select("svg").append("g").attr("class","venn-text-nodes"),l=new Map;for(const c of s){const t=Et(c.sets),e=l.get(t);e?e.push(c):l.set(t,[c])}for(const[c,h]of l.entries()){const t=e.get(c);if(!t?.text)continue;const n=t.text.x,s=t.text.y,l=Math.min(...t.circles.map(t=>t.radius)),u=Math.min(...t.circles.map(t=>t.radius-Math.hypot(n-t.x,s-t.y)));let f=Number.isFinite(u)?Math.max(0,u):0;0===f&&Number.isFinite(l)&&(f=.6*l);const d=a.append("g").attr("class","venn-text-area").attr("font-size",40*i+"px");o&&d.append("circle").attr("class","venn-text-debug-circle").attr("cx",n).attr("cy",s).attr("r",f).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const y=Math.max(80*i,2*f*.95),g=Math.max(60*i,2*f*.95),x=(t.data.label&&t.data.label.length>0?Math.min(32*i,.25*f):0)+(h.length<=2?30*i:0),p=n-y/2,m=s-g/2+x,b=Math.max(1,Math.ceil(Math.sqrt(h.length))),v=y/b,I=g/Math.max(1,Math.ceil(h.length/b));for(const[e,a]of h.entries()){const t=e%b,n=Math.floor(e/b),s=p+v*(t+.5),l=m+I*(n+.5);o&&d.append("rect").attr("class","venn-text-debug-cell").attr("x",p+v*t).attr("y",m+I*n).attr("width",v).attr("height",I).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const c=.9*v,h=.9*I,u=d.append("foreignObject").attr("class","venn-text-node-fo").attr("width",c).attr("height",h).attr("x",s-c/2).attr("y",l-h/2).attr("overflow","visible"),f=r.get(a.id)?.color,y=u.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(a.label??a.id);f&&y.style("color",f)}}}function zt(t){const e=new Set(t.map(t=>[...t.sets].sort().join("|"))),n=new Map(t.filter(t=>1===t.sets.length&&void 0!==t.size).map(t=>[t.sets[0],t.size])),s=[];for(const i of t){if(i.sets.length<3)continue;const t=[...i.sets].sort();for(let i=0;i<t.length-1;i++)for(let r=i+1;r<t.length;r++){const o=[t[i],t[r]],a=o.join("|");if(!e.has(a)){e.add(a);const t=n.get(o[0]),i=n.get(o[1]),r=void 0!==t&&void 0!==i?Math.min(t,i)/4:2.5;s.push({sets:o,size:r,label:""})}}}return s.length>0?[...t,...s]:t}e(Et,"stableSetsKey"),e(Tt,"renderTextNodes"),e(zt,"ensurePairwiseSubsets");var At={parser:nt,db:kt,renderer:{draw:St},styles:wt};export{At as diagram};