@orangelogic/design-system 2.161.0 → 2.163.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (271) hide show
  1. package/library/chunks/{AxisLabelRadial.lE2gKah-.js → AxisLabelRadial.fe7zjixN.js} +1 -1
  2. package/library/chunks/{BaseColumnSeries.B57B3iHh.js → BaseColumnSeries.8Mpxz385.js} +1 -1
  3. package/library/chunks/{CandlestickSeries.CmmI426l.js → CandlestickSeries.DuadaOTa.js} +19 -19
  4. package/library/chunks/{Circle.DAhHYhrc.js → Circle.6LomW0ej.js} +1 -1
  5. package/library/chunks/{ColumnSeries.DBgXk-b4.js → ColumnSeries.D1NLfRh5.js} +2 -2
  6. package/library/chunks/{EditableAxisLabel.C6H99qiS.js → EditableAxisLabel.Bi9vxLDV.js} +2 -2
  7. package/library/chunks/{EditableLabel.B7HB7Cu4.js → EditableLabel.CMR3O9E-.js} +1 -1
  8. package/library/chunks/{Gradient.DHhBnhFd.js → Gradient.CquE8_a4.js} +1 -1
  9. package/library/chunks/{LinearGradient.CGx00O8B.js → LinearGradient.CVN1VJp-.js} +9 -9
  10. package/library/chunks/{Picture.DYltTVSo.js → Picture.BYTZ_I8g.js} +1 -1
  11. package/library/chunks/{Polygon.BCrxKagx.js → Polygon.CU2sMltE.js} +1 -1
  12. package/library/chunks/{ProgressPie.CXksPJFv.js → ProgressPie.Dd74dbmm.js} +6 -6
  13. package/library/chunks/{RadialLabel.BYH69FGU.js → RadialLabel.7ka6ND-t.js} +1 -1
  14. package/library/chunks/{Scrollbar.DEv50o4R.js → Scrollbar.DqUnZReo.js} +1 -1
  15. package/library/chunks/Slice.BVI8rfHI.js +34 -0
  16. package/library/chunks/{Slider.BX8g2iGv.js → Slider.DtjYaJOw.js} +1 -1
  17. package/library/chunks/{SpriteResizer.CfIBMSp3.js → SpriteResizer.Ci2Wt2YJ.js} +11 -11
  18. package/library/chunks/{Triangle.CNY8-QfL.js → Triangle.C75emy3D.js} +1 -1
  19. package/library/chunks/{ZoomTools.6jZrzA7x.js → ZoomTools.CA9mtHI8.js} +2 -2
  20. package/library/chunks/_arrayEach.DU4X1H_a.js +8 -0
  21. package/library/chunks/_baseClone.BHNjfIdS.js +215 -0
  22. package/library/chunks/_baseEach.DQk0As2f.js +32 -0
  23. package/library/chunks/{_baseIteratee.BdKyHJ5i.js → _baseIteratee.sC2wLi2m.js} +3 -2
  24. package/library/chunks/{_baseUniq.je-HWbb3.js → _baseUniq.lwMgmtt2.js} +16 -15
  25. package/library/chunks/_baseXor.DixEm6JQ.js +35 -0
  26. package/library/chunks/_flatRest.D3ZVApI5.js +30 -0
  27. package/library/chunks/abnfDiagram-VRR7QNED.DKqYa5p7.js +89 -0
  28. package/library/chunks/{am-chart.CqdmTS0P.js → am-chart.Cr-vMjcY.js} +1577 -1727
  29. package/library/chunks/{animation.S74lUDDc.js → animation.BD-1xugN.js} +1 -1
  30. package/library/chunks/arc.xqNd6x9S.js +84 -0
  31. package/library/chunks/architectureDiagram-ZJ3FMSHR.CBIOk9Kp.js +4757 -0
  32. package/library/chunks/{asset-link-format.CUPqX8XL.js → asset-link-format.BdB6fQA_.js} +194 -194
  33. package/library/chunks/blockDiagram-677ZJIJ3.CeQxLPwj.js +2428 -0
  34. package/library/chunks/{button.8syoJXYs.js → button.DGyqdBou.js} +2 -2
  35. package/library/chunks/c4Diagram-LMCZKHZV.B73xdpNh.js +1580 -0
  36. package/library/chunks/{capitalize.BTYI3NfM.js → capitalize.CIBKBL10.js} +1 -1
  37. package/library/chunks/{cardinal.BCA_LB0u.js → cardinal.BXTAeOLk.js} +1 -0
  38. package/library/chunks/cardinalClosed.Mdce1x5M.js +59 -0
  39. package/library/chunks/channel.s_XjcUYI.js +5 -0
  40. package/library/chunks/chunk-2Q5K7J3B.Dy1Z-bMH.js +15 -0
  41. package/library/chunks/chunk-32BRIVSS.BbIrVi3j.js +71 -0
  42. package/library/chunks/chunk-5VM5RSS4.D0-lddDM.js +19 -0
  43. package/library/chunks/chunk-EX3LRPZG.L693y8d4.js +1412 -0
  44. package/library/chunks/chunk-JWPE2WC7.BV0i4LDu.js +8 -0
  45. package/library/chunks/chunk-MOJQB5TN.BZstBMYC.js +664 -0
  46. package/library/chunks/chunk-RYQCIY6F.BMsuG7ya.js +314 -0
  47. package/library/chunks/chunk-V7JOEXUC.DcJlyQO0.js +1537 -0
  48. package/library/chunks/chunk-VR4S4FIN.BpryBs7q.js +19 -0
  49. package/library/chunks/chunk-XXDRQBXY.CSOjab1V.js +11 -0
  50. package/library/chunks/classDiagram-OUVF2IWQ.Dvz7CNwe.js +18 -0
  51. package/library/chunks/classDiagram-v2-EOCWNBFH.Dvz7CNwe.js +18 -0
  52. package/library/chunks/cloneDeep.B-5z5SI3.js +51 -0
  53. package/library/chunks/{color-swatch-group.Dg5avknJ.js → color-swatch-group.w5DMzNco.js} +2433 -2647
  54. package/library/chunks/{color-swatch.DsWP2fd-.js → color-swatch.QsHoy_K1.js} +1 -1
  55. package/library/chunks/{colorPicker.GYgA76kc.js → colorPicker.Cg6Zxf8f.js} +5 -5
  56. package/library/chunks/{confirm-popover.C-eHPJaU.js → confirm-popover.D8mdy6KG.js} +2 -2
  57. package/library/chunks/constant.BQ4UJ-kW.js +12 -0
  58. package/library/chunks/{content-builder.BU8X7I6V.js → content-builder.BX4pHujE.js} +1 -1
  59. package/library/chunks/cose-bilkent-JH36ORCC.cfzS2XsK.js +2612 -0
  60. package/library/chunks/cynefin-VYW2F7L2.c7H5z9nQ.js +23790 -0
  61. package/library/chunks/cynefinDiagram-TSTJHNR4.C8SgNXWI.js +299 -0
  62. package/library/chunks/cytoscape.esm.Cbrwqewp.js +18786 -0
  63. package/library/chunks/dagre-VKFMJZFB.D5B1cAri.js +343 -0
  64. package/library/chunks/debounce.Bv1rtE8D.js +55 -0
  65. package/library/chunks/defaultLocale.CPy_WVtp.js +171 -0
  66. package/library/chunks/descending.AD5n-tFs.js +10 -0
  67. package/library/chunks/diagram-FQU43EPY.DJukDcLl.js +466 -0
  68. package/library/chunks/diagram-G47NLZAW.BBOvcbcR.js +316 -0
  69. package/library/chunks/diagram-NH7WQ7WH.DOpRwmC2.js +142 -0
  70. package/library/chunks/diagram-OA4YK3LP.Dm5WJs91.js +350 -0
  71. package/library/chunks/diagram-WEI45ONY.COuzdmSR.js +217 -0
  72. package/library/chunks/{dialog.Bzf4-IgH.js → dialog.05FgdLBZ.js} +2 -2
  73. package/library/chunks/{document-viewer.CGyOG1yw.js → document-viewer.gyH0NGM5.js} +7 -7
  74. package/library/chunks/{dot-pagination.BdZc-K0r.js → dot-pagination.Pg9O0nIh.js} +1 -1
  75. package/library/chunks/ebnfDiagram-CCIWWBDH.Dz-QBH6Y.js +111 -0
  76. package/library/chunks/erDiagram-Q63AITRT.sSw_w-2B.js +913 -0
  77. package/library/chunks/{exporting.DQhKH1BX.js → exporting.Djsoh75g.js} +11 -11
  78. package/library/chunks/flow.aZRVH3p1.js +1304 -0
  79. package/library/chunks/flowDiagram-23GEKE2U.CMMbuUHf.js +1642 -0
  80. package/library/chunks/{folder-select.BKAuh4GE.js → folder-select.Dh4SX0eU.js} +5 -5
  81. package/library/chunks/{gantt.tu-w6fQ5.js → gantt.Bv6_3H9y.js} +22 -22
  82. package/library/chunks/ganttDiagram-NO4QXBWP.DZdwd0O4.js +2715 -0
  83. package/library/chunks/gitGraphDiagram-IHSO6WYX.F6mwS3uS.js +818 -0
  84. package/library/chunks/graph.XHMI5hta.js +653 -0
  85. package/library/chunks/{header.e1FLwywx.js → header.DDI0MfJA.js} +1 -1
  86. package/library/chunks/{hierarchy.CTnBzzmQ.js → hierarchy.C4LxmFxx.js} +836 -904
  87. package/library/chunks/{hub-connection.CA_wS_wh.js → hub-connection.BtevPWYb.js} +1 -1
  88. package/library/chunks/{icon-button.DbVIFgu7.js → icon-button.BwmMJ0bI.js} +1 -1
  89. package/library/chunks/{icon.mxNZ85k0.js → icon.D5iM9wXS.js} +1 -1
  90. package/library/chunks/{iframe.DcHjOcLG.js → iframe.Cc-xZIm_.js} +1 -1
  91. package/library/chunks/{image.5mhGPvMN.js → image.BgODrAzQ.js} +2 -2
  92. package/library/chunks/{image.QVlPFadX.js → image.Y5c_hFx8.js} +1 -1
  93. package/library/chunks/{index.BVDhdCk-.js → index.2SOQHTpX.js} +23 -23
  94. package/library/chunks/index.BDn1QW8J.js +167 -0
  95. package/library/chunks/{index.DcjJFMlq.js → index.CrhRU5m8.js} +284 -273
  96. package/library/chunks/index.thKLME8E.js +77 -0
  97. package/library/chunks/infoDiagram-FWYZ7A6U.BnktKL7i.js +24 -0
  98. package/library/chunks/init.DjUOC4st.js +16 -0
  99. package/library/chunks/{input.BcyLZUmv.js → input.DOorVTYZ.js} +2 -2
  100. package/library/chunks/isArrayLikeObject.D7afXo-f.js +86 -0
  101. package/library/chunks/isEmpty.DtTJTUcf.js +27 -0
  102. package/library/chunks/ishikawaDiagram-FXEZZL3T.CFp-9Kes.js +621 -0
  103. package/library/chunks/journeyDiagram-5HDEW3XC.BxO1aPu_.js +837 -0
  104. package/library/chunks/{json.D7WeFaJm.js → json.Dz5QFEi5.js} +3 -3
  105. package/library/chunks/kanban-definition-HUTT4EX6.Bk8vmLFK.js +724 -0
  106. package/library/chunks/katex.DoRnZ_sp.js +11682 -0
  107. package/library/chunks/layout.DZcMFKol.js +1446 -0
  108. package/library/chunks/line.DP-iSN_J.js +157 -0
  109. package/library/chunks/linear.TNHhsH1m.js +215 -0
  110. package/library/chunks/{map.BjtxEozr.js → map.CBcV0WVq.js} +100 -105
  111. package/library/chunks/map.DJnohTgl.js +18 -0
  112. package/library/chunks/markdown.I1AJG75v.js +4180 -0
  113. package/library/chunks/math.D2lKC7md.js +22 -0
  114. package/library/chunks/mermaid.core.Dspbw7Ig.js +13598 -0
  115. package/library/chunks/mindmap-definition-LN4V7U3C.DuCBBYwE.js +808 -0
  116. package/library/chunks/{number.CtCaI0T_.js → number.Cx2ncfJJ.js} +2 -2
  117. package/library/chunks/{option.qN3aaqVI.js → option.DyNR1vzy.js} +2 -2
  118. package/library/chunks/ordinal.bqVaUip-.js +61 -0
  119. package/library/chunks/{pagination.Cupa46TN.js → pagination.qFmncShC.js} +5 -5
  120. package/library/chunks/pegDiagram-2B236MQR.DQrkEdJr.js +97 -0
  121. package/library/chunks/{percent.D_CkaRGb.js → percent.D8mkiJ2G.js} +17 -17
  122. package/library/chunks/pieDiagram-ENE6RG2P.B6nPW8Pj.js +212 -0
  123. package/library/chunks/quadrantDiagram-ABIIQ3AL.BFy9moxz.js +1026 -0
  124. package/library/chunks/{radar.BMKaNvJH.js → radar.B3p5bRix.js} +78 -129
  125. package/library/chunks/railroadDiagram-RFXS5EU6.CSao8YZX.js +79 -0
  126. package/library/chunks/range.DdOGybNB.js +9 -0
  127. package/library/chunks/requirementDiagram-TGXJPOKE.CjpliZnF.js +882 -0
  128. package/library/chunks/sankey.BR94A-8L.js +294 -0
  129. package/library/chunks/sankeyDiagram-HTMAVEWB.D8aAxVGe.js +564 -0
  130. package/library/chunks/select.C6_sM3Pr.js +7 -0
  131. package/library/chunks/sequenceDiagram-DBY2YBRQ.Cu9MV3h-.js +2891 -0
  132. package/library/chunks/sizeCapture-X5ZJPWSS.BDByEFcW.js +46 -0
  133. package/library/chunks/{sliceGrouper.C-t5ZRrz.js → sliceGrouper.CcRqQhZX.js} +1 -1
  134. package/library/chunks/stateDiagram-2N3HPSRC.DvrAW9Ck.js +267 -0
  135. package/library/chunks/stateDiagram-v2-6OUMAXLB.CFfuaFM1.js +18 -0
  136. package/library/chunks/step.almIqwJ6.js +51 -0
  137. package/library/chunks/{stock.vF_pji1F.js → stock.CQbn6zW4.js} +9 -9
  138. package/library/chunks/swimlanes-5IMT3BWC.AtMD47q7.js +5332 -0
  139. package/library/chunks/swimlanesDiagram-G3AALYLV.26A1eX7s.js +15 -0
  140. package/library/chunks/{tab-group.kSg5_10g.js → tab-group.1Y71_aN8.js} +3 -3
  141. package/library/chunks/{time.DWfbnPnM.js → time.DYWuX2id.js} +1 -1
  142. package/library/chunks/timeline-definition-FHXFAJF6.CYSh6xl5.js +1058 -0
  143. package/library/chunks/{timeline.gWu0up6r.js → timeline.Czz_uBEd.js} +33 -32
  144. package/library/chunks/toNumber.MuDz8DgU.js +31 -0
  145. package/library/chunks/{toString.Dcbz5jVT.js → toString.B1zKIiZc.js} +1 -1
  146. package/library/chunks/{toast.TDU3wVhq.js → toast.C5Ir5yKA.js} +1 -1
  147. package/library/chunks/transformation.D1alV_s4.js +189 -0
  148. package/library/chunks/{tree.C2dPd6gt.js → tree.Dvnw_4vz.js} +3 -3
  149. package/library/chunks/value.BXEGBVFV.js +44 -0
  150. package/library/chunks/{venn.BVBe-JXs.js → venn.B5Jl-c4i.js} +2 -2
  151. package/library/chunks/vennDiagram-L72KCM5P.CSk1WWlu.js +1581 -0
  152. package/library/chunks/wardleyDiagram-EHGQE667.C7UzXYG7.js +675 -0
  153. package/library/chunks/{watch.DOt4Mabe.js → watch.DJF5K-8U.js} +27 -27
  154. package/library/chunks/{wc.DTNpfIc1.js → wc.B2THb2Kk.js} +18 -18
  155. package/library/chunks/xy.BO6U5QrZ.js +294 -0
  156. package/library/chunks/xychartDiagram-FW5EYKEG.idiZWvYS.js +1383 -0
  157. package/library/components/alert.js +2 -2
  158. package/library/components/am-chart.js +3 -3
  159. package/library/components/animated-image.js +2 -2
  160. package/library/components/animation.js +2 -2
  161. package/library/components/array-line-clamp.js +1 -1
  162. package/library/components/asset-link-format.js +5 -5
  163. package/library/components/atoms.js +29 -29
  164. package/library/components/audio.js +3 -3
  165. package/library/components/avatar.js +2 -2
  166. package/library/components/border-input-group.js +1 -1
  167. package/library/components/breadcrumb-item.js +1 -1
  168. package/library/components/breadcrumb.js +1 -1
  169. package/library/components/button.js +3 -3
  170. package/library/components/checkbox.js +195 -18
  171. package/library/components/color-picker.js +4 -4
  172. package/library/components/color-swatch-group.js +5 -5
  173. package/library/components/color-swatch.js +2 -2
  174. package/library/components/confirm-popover.js +3 -3
  175. package/library/components/copy-button.js +2 -2
  176. package/library/components/corner-position-input-group.js +2 -2
  177. package/library/components/cropper.js +3 -3
  178. package/library/components/date-calendar.js +1 -1
  179. package/library/components/details.js +2 -2
  180. package/library/components/dialog.js +3 -3
  181. package/library/components/diff.js +1 -1
  182. package/library/components/divider.js +1 -1
  183. package/library/components/document-viewer.js +3 -3
  184. package/library/components/dot-pagination.js +2 -2
  185. package/library/components/drawer.js +3 -3
  186. package/library/components/dropdown.js +2 -2
  187. package/library/components/dynamic-select.js +6 -6
  188. package/library/components/e-chart.js +1 -1
  189. package/library/components/element-clamp.js +2 -2
  190. package/library/components/file-on-demand.js +350 -374
  191. package/library/components/folder-select.js +5 -5
  192. package/library/components/format-time.js +2 -2
  193. package/library/components/grid-item.js +1 -1
  194. package/library/components/header.js +2 -2
  195. package/library/components/hub-connection.js +2 -2
  196. package/library/components/icon-button.js +2 -2
  197. package/library/components/icon.js +2 -2
  198. package/library/components/iframe.js +2 -2
  199. package/library/components/image-comparer.js +2 -2
  200. package/library/components/image.js +3 -3
  201. package/library/components/include.js +1 -1
  202. package/library/components/input.js +3 -3
  203. package/library/components/line-clamp.js +1 -1
  204. package/library/components/markdown.js +11 -2704
  205. package/library/components/masonry.js +3 -3
  206. package/library/components/menu-item.js +2 -2
  207. package/library/components/molecules.js +3 -3
  208. package/library/components/mutation-observer.js +1 -1
  209. package/library/components/option.js +3 -3
  210. package/library/components/organisms.js +2 -2
  211. package/library/components/padding-input-group.js +1 -1
  212. package/library/components/pagination.js +6 -6
  213. package/library/components/qr-code.js +1 -1
  214. package/library/components/radio-button.js +1 -1
  215. package/library/components/radio-card.js +1 -1
  216. package/library/components/radio-group.js +1 -1
  217. package/library/components/radio.js +2 -2
  218. package/library/components/range.js +1 -1
  219. package/library/components/rating.js +2 -2
  220. package/library/components/resize-observer.js +1 -1
  221. package/library/components/select.js +3 -3
  222. package/library/components/shadow-input-group.js +1 -1
  223. package/library/components/share-option-list.js +2 -2
  224. package/library/components/sidebar.js +3 -3
  225. package/library/components/size-input-group.js +3 -3
  226. package/library/components/split-panel.js +1 -1
  227. package/library/components/step.js +1 -1
  228. package/library/components/stepper-wizard.js +1 -1
  229. package/library/components/stepper.js +1 -1
  230. package/library/components/switch.js +1 -1
  231. package/library/components/tab-group.js +4 -4
  232. package/library/components/tab-panel.js +1 -1
  233. package/library/components/tab.js +2 -2
  234. package/library/components/tag.js +1 -1
  235. package/library/components/textarea.js +1 -1
  236. package/library/components/timecode.js +1 -1
  237. package/library/components/tooltip.js +1 -1
  238. package/library/components/tree-item.js +4 -4
  239. package/library/components/tree.js +2 -2
  240. package/library/components/typeface.js +2 -2
  241. package/library/components/types.js +122526 -120875
  242. package/library/components/video.js +2 -2
  243. package/library/package.json +2 -1
  244. package/library/packages/atoms/src/components/markdown/markdown.d.ts +41 -1
  245. package/library/packages/atoms/src/components/markdown/parser.d.ts +18 -3
  246. package/library/packages/atoms/src/components/markdown/styles.d.ts +17 -0
  247. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/Page/Page.d.ts +6 -0
  248. package/library/packages/hybrid/table-core/src/tabulator-tables/modules/Validate/Validate.d.ts +6 -0
  249. package/library/packages/molecules/src/index.d.ts +1 -0
  250. package/library/packages/molecules/src/markdown-viewer/markdown-viewer.d.ts +124 -0
  251. package/library/packages/molecules/src/markdown-viewer/markdown-viewer.styles.d.ts +6 -0
  252. package/library/packages/molecules/src/pdf-viewer-toolbar/pdf-viewer-toolbar.d.ts +1 -0
  253. package/library/packages/tools/src/tiptap/utils/md/editor-controller.d.ts +57 -0
  254. package/library/packages/tools/src/tiptap/utils/md/from-markdown.d.ts +11 -0
  255. package/library/packages/tools/src/tiptap/utils/md/input-rules.d.ts +15 -0
  256. package/library/packages/tools/src/tiptap/utils/md/schema.d.ts +13 -0
  257. package/library/packages/tools/src/tiptap/utils/md/to-markdown.d.ts +14 -0
  258. package/library/packages/types/src/markdown-viewer.d.ts +12 -0
  259. package/library/packages/types/src/pdf-viewer-toolbar.d.ts +4 -3
  260. package/library/packages/utils/src/transformation/transformation.d.ts +8 -0
  261. package/library/react-web-component.d.ts +72 -6
  262. package/library/utils.js +9 -8
  263. package/package.json +2 -1
  264. package/library/chunks/Slice.C5lVu2g_.js +0 -120
  265. package/library/chunks/_baseXor.VohG8cOH.js +0 -116
  266. package/library/chunks/checkbox.3i2j3PHc.js +0 -198
  267. package/library/chunks/debounce.C_J-9zJi.js +0 -82
  268. package/library/chunks/flow.hz0UDjCb.js +0 -1594
  269. package/library/chunks/index.DU0XUO4k.js +0 -176
  270. package/library/chunks/transformation.BDmd3kER.js +0 -163
  271. package/library/chunks/xy.BNgyrwGD.js +0 -333
@@ -0,0 +1,1581 @@
1
+ import { aR as Wt, _ as w, s as Kt, g as Ht, o as Yt, n as Xt, a as Zt, b as Jt, y as wt, E as Qt, a4 as $t, R as te, S as ee, T as ne, d as se, p as ie, A as oe, B as re } from "./mermaid.core.Dspbw7Ig.js";
2
+ import "./index.CrhRU5m8.js";
3
+ import "./transform.BuqENXeT.js";
4
+ import { s as ot } from "./select.C6_sM3Pr.js";
5
+ const kt = (t, n) => Wt(t, "a", -n), _t = 1e-10;
6
+ function st(t, n) {
7
+ const s = le(t), e = s.filter((l) => ae(l, t));
8
+ let i = 0, o = 0;
9
+ const r = [];
10
+ if (e.length > 1) {
11
+ const l = Et(e);
12
+ for (let u = 0; u < e.length; ++u) {
13
+ const a = e[u];
14
+ a.angle = Math.atan2(a.x - l.x, a.y - l.y);
15
+ }
16
+ e.sort((u, a) => a.angle - u.angle);
17
+ let f = e[e.length - 1];
18
+ for (let u = 0; u < e.length; ++u) {
19
+ const a = e[u];
20
+ o += (f.x + a.x) * (a.y - f.y);
21
+ const y = { x: (a.x + f.x) / 2, y: (a.y + f.y) / 2 };
22
+ let h = null;
23
+ for (let b = 0; b < a.parentIndex.length; ++b)
24
+ if (f.parentIndex.includes(a.parentIndex[b])) {
25
+ const p = t[a.parentIndex[b]], M = Math.atan2(a.x - p.x, a.y - p.y), E = Math.atan2(f.x - p.x, f.y - p.y);
26
+ let _ = E - M;
27
+ _ < 0 && (_ += 2 * Math.PI);
28
+ const S = E - _ / 2;
29
+ let g = q(y, {
30
+ x: p.x + p.radius * Math.sin(S),
31
+ y: p.y + p.radius * Math.cos(S)
32
+ });
33
+ g > p.radius * 2 && (g = p.radius * 2), (h == null || h.width > g) && (h = { circle: p, width: g, p1: a, p2: f, large: g > p.radius, sweep: !0 });
34
+ }
35
+ h != null && (r.push(h), i += lt(h.circle.radius, h.width), f = a);
36
+ }
37
+ } else {
38
+ let l = t[0];
39
+ for (let u = 1; u < t.length; ++u)
40
+ t[u].radius < l.radius && (l = t[u]);
41
+ let f = !1;
42
+ for (let u = 0; u < t.length; ++u)
43
+ if (q(t[u], l) > Math.abs(l.radius - t[u].radius)) {
44
+ f = !0;
45
+ break;
46
+ }
47
+ f ? i = o = 0 : (i = l.radius * l.radius * Math.PI, r.push({
48
+ circle: l,
49
+ p1: { x: l.x, y: l.y + l.radius },
50
+ p2: { x: l.x - _t, y: l.y + l.radius },
51
+ width: l.radius * 2,
52
+ large: !0,
53
+ sweep: !0
54
+ }));
55
+ }
56
+ return o /= 2, n && (n.area = i + o, n.arcArea = i, n.polygonArea = o, n.arcs = r, n.innerPoints = e, n.intersectionPoints = s), i + o;
57
+ }
58
+ function ae(t, n) {
59
+ return n.every((s) => q(t, s) < s.radius + _t);
60
+ }
61
+ function le(t) {
62
+ const n = [];
63
+ for (let s = 0; s < t.length; ++s)
64
+ for (let e = s + 1; e < t.length; ++e) {
65
+ const i = Tt(t[s], t[e]);
66
+ for (const o of i)
67
+ o.parentIndex = [s, e], n.push(o);
68
+ }
69
+ return n;
70
+ }
71
+ function lt(t, n) {
72
+ return t * t * Math.acos(1 - n / t) - (t - n) * Math.sqrt(n * (2 * t - n));
73
+ }
74
+ function q(t, n) {
75
+ return Math.sqrt((t.x - n.x) * (t.x - n.x) + (t.y - n.y) * (t.y - n.y));
76
+ }
77
+ function xt(t, n, s) {
78
+ if (s >= t + n)
79
+ return 0;
80
+ if (s <= Math.abs(t - n))
81
+ return Math.PI * Math.min(t, n) * Math.min(t, n);
82
+ const e = t - (s * s - n * n + t * t) / (2 * s), i = n - (s * s - t * t + n * n) / (2 * s);
83
+ return lt(t, e) + lt(n, i);
84
+ }
85
+ function Tt(t, n) {
86
+ const s = q(t, n), e = t.radius, i = n.radius;
87
+ if (s >= e + i || s <= Math.abs(e - i))
88
+ return [];
89
+ const o = (e * e - i * i + s * s) / (2 * s), r = Math.sqrt(e * e - o * o), l = t.x + o * (n.x - t.x) / s, f = t.y + o * (n.y - t.y) / s, u = -(n.y - t.y) * (r / s), a = -(n.x - t.x) * (r / s);
90
+ return [
91
+ { x: l + u, y: f - a },
92
+ { x: l - u, y: f + a }
93
+ ];
94
+ }
95
+ function Et(t) {
96
+ const n = { x: 0, y: 0 };
97
+ for (const s of t)
98
+ n.x += s.x, n.y += s.y;
99
+ return n.x /= t.length, n.y /= t.length, n;
100
+ }
101
+ function ce(t, n, s, e) {
102
+ e = e || {};
103
+ const i = e.maxIterations || 100, o = e.tolerance || 1e-10, r = t(n), l = t(s);
104
+ let f = s - n;
105
+ if (r * l > 0)
106
+ throw "Initial bisect points must have opposite signs";
107
+ if (r === 0) return n;
108
+ if (l === 0) return s;
109
+ for (let u = 0; u < i; ++u) {
110
+ f /= 2;
111
+ const a = n + f, y = t(a);
112
+ if (y * r >= 0 && (n = a), Math.abs(f) < o || y === 0)
113
+ return a;
114
+ }
115
+ return n + f;
116
+ }
117
+ function ct(t) {
118
+ const n = new Array(t);
119
+ for (let s = 0; s < t; ++s)
120
+ n[s] = 0;
121
+ return n;
122
+ }
123
+ function Mt(t, n) {
124
+ return ct(t).map(() => ct(n));
125
+ }
126
+ function $(t, n) {
127
+ let s = 0;
128
+ for (let e = 0; e < t.length; ++e)
129
+ s += t[e] * n[e];
130
+ return s;
131
+ }
132
+ function ut(t) {
133
+ return Math.sqrt($(t, t));
134
+ }
135
+ function ft(t, n, s) {
136
+ for (let e = 0; e < n.length; ++e)
137
+ t[e] = n[e] * s;
138
+ }
139
+ function J(t, n, s, e, i) {
140
+ for (let o = 0; o < t.length; ++o)
141
+ t[o] = n * s[o] + e * i[o];
142
+ }
143
+ function zt(t, n, s) {
144
+ s = s || {};
145
+ const e = s.maxIterations || n.length * 200, i = s.nonZeroDelta || 1.05, o = s.zeroDelta || 1e-3, r = s.minErrorDelta || 1e-6, l = s.minErrorDelta || 1e-5, f = s.rho !== void 0 ? s.rho : 1, u = s.chi !== void 0 ? s.chi : 2, a = s.psi !== void 0 ? s.psi : -0.5, y = s.sigma !== void 0 ? s.sigma : 0.5;
146
+ let h;
147
+ const b = n.length, p = new Array(b + 1);
148
+ p[0] = n, p[0].fx = t(n), p[0].id = 0;
149
+ for (let v = 0; v < b; ++v) {
150
+ const c = n.slice();
151
+ c[v] = c[v] ? c[v] * i : o, p[v + 1] = c, p[v + 1].fx = t(c), p[v + 1].id = v + 1;
152
+ }
153
+ function M(v) {
154
+ for (let c = 0; c < v.length; c++)
155
+ p[b][c] = v[c];
156
+ p[b].fx = v.fx;
157
+ }
158
+ const E = (v, c) => v.fx - c.fx, _ = n.slice(), S = n.slice(), g = n.slice(), m = n.slice();
159
+ for (let v = 0; v < e; ++v) {
160
+ if (p.sort(E), s.history) {
161
+ const x = p.map((d) => {
162
+ const C = d.slice();
163
+ return C.fx = d.fx, C.id = d.id, C;
164
+ });
165
+ x.sort((d, C) => d.id - C.id), s.history.push({
166
+ x: p[0].slice(),
167
+ fx: p[0].fx,
168
+ simplex: x
169
+ });
170
+ }
171
+ h = 0;
172
+ for (let x = 0; x < b; ++x)
173
+ h = Math.max(h, Math.abs(p[0][x] - p[1][x]));
174
+ if (Math.abs(p[0].fx - p[b].fx) < r && h < l)
175
+ break;
176
+ for (let x = 0; x < b; ++x) {
177
+ _[x] = 0;
178
+ for (let d = 0; d < b; ++d)
179
+ _[x] += p[d][x];
180
+ _[x] /= b;
181
+ }
182
+ const c = p[b];
183
+ if (J(S, 1 + f, _, -f, c), S.fx = t(S), S.fx < p[0].fx)
184
+ J(m, 1 + u, _, -u, c), m.fx = t(m), m.fx < S.fx ? M(m) : M(S);
185
+ else if (S.fx >= p[b - 1].fx) {
186
+ let x = !1;
187
+ if (S.fx > c.fx ? (J(g, 1 + a, _, -a, c), g.fx = t(g), g.fx < c.fx ? M(g) : x = !0) : (J(g, 1 - a * f, _, a * f, c), g.fx = t(g), g.fx < S.fx ? M(g) : x = !0), x) {
188
+ if (y >= 1) break;
189
+ for (let d = 1; d < p.length; ++d)
190
+ J(p[d], 1 - y, p[0], y, p[d]), p[d].fx = t(p[d]);
191
+ }
192
+ } else
193
+ M(S);
194
+ }
195
+ return p.sort(E), { fx: p[0].fx, x: p[0] };
196
+ }
197
+ function ue(t, n, s, e, i, o, r) {
198
+ const l = s.fx, f = $(s.fxprime, n);
199
+ let u = l, a = l, y = f, h = 0;
200
+ i = i || 1, o = o || 1e-6, r = r || 0.1;
201
+ function b(p, M, E) {
202
+ for (let _ = 0; _ < 16; ++_)
203
+ if (i = (p + M) / 2, J(e.x, 1, s.x, i, n), u = e.fx = t(e.x, e.fxprime), y = $(e.fxprime, n), u > l + o * i * f || u >= E)
204
+ M = i;
205
+ else {
206
+ if (Math.abs(y) <= -r * f)
207
+ return i;
208
+ y * (M - p) >= 0 && (M = p), p = i, E = u;
209
+ }
210
+ return 0;
211
+ }
212
+ for (let p = 0; p < 10; ++p) {
213
+ if (J(e.x, 1, s.x, i, n), u = e.fx = t(e.x, e.fxprime), y = $(e.fxprime, n), u > l + o * i * f || p && u >= a)
214
+ return b(h, i, a);
215
+ if (Math.abs(y) <= -r * f)
216
+ return i;
217
+ if (y >= 0)
218
+ return b(i, h, u);
219
+ a = u, h = i, i *= 2;
220
+ }
221
+ return i;
222
+ }
223
+ function fe(t, n, s) {
224
+ let e = { x: n.slice(), fx: 0, fxprime: n.slice() }, i = { x: n.slice(), fx: 0, fxprime: n.slice() };
225
+ const o = n.slice();
226
+ let r, l, f = 1, u;
227
+ s = s || {}, u = s.maxIterations || n.length * 20, e.fx = t(e.x, e.fxprime), r = e.fxprime.slice(), ft(r, e.fxprime, -1);
228
+ for (let a = 0; a < u; ++a) {
229
+ if (f = ue(t, r, e, i, f), s.history && s.history.push({
230
+ x: e.x.slice(),
231
+ fx: e.fx,
232
+ fxprime: e.fxprime.slice(),
233
+ alpha: f
234
+ }), !f)
235
+ ft(r, e.fxprime, -1);
236
+ else {
237
+ J(o, 1, i.fxprime, -1, e.fxprime);
238
+ const y = $(e.fxprime, e.fxprime), h = Math.max(0, $(o, i.fxprime) / y);
239
+ J(r, h, r, -1, i.fxprime), l = e, e = i, i = l;
240
+ }
241
+ if (ut(e.fxprime) <= 1e-5)
242
+ break;
243
+ }
244
+ return s.history && s.history.push({
245
+ x: e.x.slice(),
246
+ fx: e.fx,
247
+ fxprime: e.fxprime.slice(),
248
+ alpha: f
249
+ }), e;
250
+ }
251
+ function At(t, n = {}) {
252
+ n.maxIterations = n.maxIterations || 500;
253
+ const s = n.initialLayout || xe, e = n.lossFunction || tt, i = he(t, n), o = s(i, n), r = Object.keys(o), l = [];
254
+ for (const a of r)
255
+ l.push(o[a].x), l.push(o[a].y);
256
+ const u = zt(
257
+ (a) => {
258
+ const y = {};
259
+ for (let h = 0; h < r.length; ++h) {
260
+ const b = r[h];
261
+ y[b] = {
262
+ x: a[2 * h],
263
+ y: a[2 * h + 1],
264
+ radius: o[b].radius
265
+ // size : circles[setid].size
266
+ };
267
+ }
268
+ return e(y, i);
269
+ },
270
+ l,
271
+ n
272
+ ).x;
273
+ for (let a = 0; a < r.length; ++a) {
274
+ const y = r[a];
275
+ o[y].x = u[2 * a], o[y].y = u[2 * a + 1];
276
+ }
277
+ return o;
278
+ }
279
+ const Rt = 1e-10;
280
+ function ht(t, n, s) {
281
+ return Math.min(t, n) * Math.min(t, n) * Math.PI <= s + Rt ? Math.abs(t - n) : ce((e) => xt(t, n, e) - s, 0, t + n);
282
+ }
283
+ function he(t, n = {}) {
284
+ const s = n.distinct, e = t.map((l) => Object.assign({}, l));
285
+ function i(l) {
286
+ return l.join(";");
287
+ }
288
+ if (s) {
289
+ const l = /* @__PURE__ */ new Map();
290
+ for (const f of e)
291
+ for (let u = 0; u < f.sets.length; u++) {
292
+ const a = String(f.sets[u]);
293
+ l.set(a, f.size + (l.get(a) || 0));
294
+ for (let y = u + 1; y < f.sets.length; y++) {
295
+ const h = String(f.sets[y]), b = `${a};${h}`, p = `${h};${a}`;
296
+ l.set(b, f.size + (l.get(b) || 0)), l.set(p, f.size + (l.get(p) || 0));
297
+ }
298
+ }
299
+ for (const f of e)
300
+ f.sets.length < 3 && (f.size = l.get(i(f.sets)));
301
+ }
302
+ const o = [], r = /* @__PURE__ */ new Set();
303
+ for (const l of e)
304
+ if (l.sets.length === 1)
305
+ o.push(l.sets[0]);
306
+ else if (l.sets.length === 2) {
307
+ const f = l.sets[0], u = l.sets[1];
308
+ r.add(i(l.sets)), r.add(i([u, f]));
309
+ }
310
+ o.sort((l, f) => l === f ? 0 : l < f ? -1 : 1);
311
+ for (let l = 0; l < o.length; ++l) {
312
+ const f = o[l];
313
+ for (let u = l + 1; u < o.length; ++u) {
314
+ const a = o[u];
315
+ r.has(i([f, a])) || e.push({ sets: [f, a], size: 0 });
316
+ }
317
+ }
318
+ return e;
319
+ }
320
+ function de(t, n, s) {
321
+ const e = Mt(n.length, n.length), i = Mt(n.length, n.length);
322
+ return t.filter((o) => o.sets.length === 2).forEach((o) => {
323
+ const r = s[o.sets[0]], l = s[o.sets[1]], f = Math.sqrt(n[r].size / Math.PI), u = Math.sqrt(n[l].size / Math.PI), a = ht(f, u, o.size);
324
+ e[r][l] = e[l][r] = a;
325
+ let y = 0;
326
+ o.size + 1e-10 >= Math.min(n[r].size, n[l].size) ? y = 1 : o.size <= 1e-10 && (y = -1), i[r][l] = i[l][r] = y;
327
+ }), { distances: e, constraints: i };
328
+ }
329
+ function ge(t, n, s, e) {
330
+ for (let o = 0; o < n.length; ++o)
331
+ n[o] = 0;
332
+ let i = 0;
333
+ for (let o = 0; o < s.length; ++o) {
334
+ const r = t[2 * o], l = t[2 * o + 1];
335
+ for (let f = o + 1; f < s.length; ++f) {
336
+ const u = t[2 * f], a = t[2 * f + 1], y = s[o][f], h = e[o][f], b = (u - r) * (u - r) + (a - l) * (a - l), p = Math.sqrt(b), M = b - y * y;
337
+ h > 0 && p <= y || h < 0 && p >= y || (i += 2 * M * M, n[2 * o] += 4 * M * (r - u), n[2 * o + 1] += 4 * M * (l - a), n[2 * f] += 4 * M * (u - r), n[2 * f + 1] += 4 * M * (a - l));
338
+ }
339
+ }
340
+ return i;
341
+ }
342
+ function xe(t, n = {}) {
343
+ let s = pe(t, n);
344
+ const e = n.lossFunction || tt;
345
+ if (t.length >= 8) {
346
+ const i = ye(t, n), o = e(i, t), r = e(s, t);
347
+ o + 1e-8 < r && (s = i);
348
+ }
349
+ return s;
350
+ }
351
+ function ye(t, n = {}) {
352
+ const s = n.restarts || 10, e = [], i = {};
353
+ for (const h of t)
354
+ h.sets.length === 1 && (i[h.sets[0]] = e.length, e.push(h));
355
+ let { distances: o, constraints: r } = de(t, e, i);
356
+ const l = ut(o.map(ut)) / o.length;
357
+ o = o.map((h) => h.map((b) => b / l));
358
+ const f = (h, b) => ge(h, b, o, r);
359
+ let u = null;
360
+ for (let h = 0; h < s; ++h) {
361
+ const b = ct(o.length * 2).map(Math.random), p = fe(f, b, n);
362
+ (!u || p.fx < u.fx) && (u = p);
363
+ }
364
+ const a = u.x, y = {};
365
+ for (let h = 0; h < e.length; ++h) {
366
+ const b = e[h];
367
+ y[b.sets[0]] = {
368
+ x: a[2 * h] * l,
369
+ y: a[2 * h + 1] * l,
370
+ radius: Math.sqrt(b.size / Math.PI)
371
+ };
372
+ }
373
+ if (n.history)
374
+ for (const h of n.history)
375
+ ft(h.x, l);
376
+ return y;
377
+ }
378
+ function pe(t, n) {
379
+ const s = n && n.lossFunction ? n.lossFunction : tt, e = {}, i = {};
380
+ for (const y of t)
381
+ if (y.sets.length === 1) {
382
+ const h = y.sets[0];
383
+ e[h] = {
384
+ x: 1e10,
385
+ y: 1e10,
386
+ rowid: e.length,
387
+ size: y.size,
388
+ radius: Math.sqrt(y.size / Math.PI)
389
+ }, i[h] = [];
390
+ }
391
+ t = t.filter((y) => y.sets.length === 2);
392
+ for (const y of t) {
393
+ let h = y.weight != null ? y.weight : 1;
394
+ const b = y.sets[0], p = y.sets[1];
395
+ y.size + Rt >= Math.min(e[b].size, e[p].size) && (h = 0), i[b].push({ set: p, size: y.size, weight: h }), i[p].push({ set: b, size: y.size, weight: h });
396
+ }
397
+ const o = [];
398
+ Object.keys(i).forEach((y) => {
399
+ let h = 0;
400
+ for (let b = 0; b < i[y].length; ++b)
401
+ h += i[y][b].size * i[y][b].weight;
402
+ o.push({ set: y, size: h });
403
+ });
404
+ function r(y, h) {
405
+ return h.size - y.size;
406
+ }
407
+ o.sort(r);
408
+ const l = {};
409
+ function f(y) {
410
+ return y.set in l;
411
+ }
412
+ function u(y, h) {
413
+ e[h].x = y.x, e[h].y = y.y, l[h] = !0;
414
+ }
415
+ u({ x: 0, y: 0 }, o[0].set);
416
+ for (let y = 1; y < o.length; ++y) {
417
+ const h = o[y].set, b = i[h].filter(f), p = e[h];
418
+ if (b.sort(r), b.length === 0)
419
+ throw "ERROR: missing pairwise overlap information";
420
+ const M = [];
421
+ for (var a = 0; a < b.length; ++a) {
422
+ const S = e[b[a].set], g = ht(p.radius, S.radius, b[a].size);
423
+ M.push({ x: S.x + g, y: S.y }), M.push({ x: S.x - g, y: S.y }), M.push({ y: S.y + g, x: S.x }), M.push({ y: S.y - g, x: S.x });
424
+ for (let m = a + 1; m < b.length; ++m) {
425
+ const v = e[b[m].set], c = ht(p.radius, v.radius, b[m].size), x = Tt(
426
+ { x: S.x, y: S.y, radius: g },
427
+ { x: v.x, y: v.y, radius: c }
428
+ );
429
+ M.push(...x);
430
+ }
431
+ }
432
+ let E = 1e50, _ = M[0];
433
+ for (const S of M) {
434
+ e[h].x = S.x, e[h].y = S.y;
435
+ const g = s(e, t);
436
+ g < E && (E = g, _ = S);
437
+ }
438
+ u(_, h);
439
+ }
440
+ return e;
441
+ }
442
+ function tt(t, n) {
443
+ let s = 0;
444
+ for (const e of n) {
445
+ if (e.sets.length === 1)
446
+ continue;
447
+ let i;
448
+ if (e.sets.length === 2) {
449
+ const r = t[e.sets[0]], l = t[e.sets[1]];
450
+ i = xt(r.radius, l.radius, q(r, l));
451
+ } else
452
+ i = st(e.sets.map((r) => t[r]));
453
+ const o = e.weight != null ? e.weight : 1;
454
+ s += o * (i - e.size) * (i - e.size);
455
+ }
456
+ return s;
457
+ }
458
+ function Ct(t, n) {
459
+ let s = 0;
460
+ for (const e of n) {
461
+ if (e.sets.length === 1)
462
+ continue;
463
+ let i;
464
+ if (e.sets.length === 2) {
465
+ const l = t[e.sets[0]], f = t[e.sets[1]];
466
+ i = xt(l.radius, f.radius, q(l, f));
467
+ } else
468
+ i = st(e.sets.map((l) => t[l]));
469
+ const o = e.weight != null ? e.weight : 1, r = Math.log((i + 1) / (e.size + 1));
470
+ s += o * r * r;
471
+ }
472
+ return s;
473
+ }
474
+ function me(t, n, s) {
475
+ if (s == null ? t.sort((i, o) => o.radius - i.radius) : t.sort(s), t.length > 0) {
476
+ const i = t[0].x, o = t[0].y;
477
+ for (const r of t)
478
+ r.x -= i, r.y -= o;
479
+ }
480
+ if (t.length === 2 && q(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) {
481
+ const i = Math.atan2(t[1].x, t[1].y) - n, o = Math.cos(i), r = Math.sin(i);
482
+ for (const l of t) {
483
+ const f = l.x, u = l.y;
484
+ l.x = o * f - r * u, l.y = r * f + o * u;
485
+ }
486
+ }
487
+ if (t.length > 2) {
488
+ let i = Math.atan2(t[2].x, t[2].y) - n;
489
+ for (; i < 0; )
490
+ i += 2 * Math.PI;
491
+ for (; i > 2 * Math.PI; )
492
+ i -= 2 * Math.PI;
493
+ if (i > Math.PI) {
494
+ const o = t[1].y / (1e-10 + t[1].x);
495
+ for (const r of t) {
496
+ var e = (r.x + o * r.y) / (1 + o * o);
497
+ r.x = 2 * e - r.x, r.y = 2 * e * o - r.y;
498
+ }
499
+ }
500
+ }
501
+ }
502
+ function be(t) {
503
+ t.forEach((i) => {
504
+ i.parent = i;
505
+ });
506
+ function n(i) {
507
+ return i.parent !== i && (i.parent = n(i.parent)), i.parent;
508
+ }
509
+ function s(i, o) {
510
+ const r = n(i), l = n(o);
511
+ r.parent = l;
512
+ }
513
+ for (let i = 0; i < t.length; ++i)
514
+ for (let o = i + 1; o < t.length; ++o) {
515
+ const r = t[i].radius + t[o].radius;
516
+ q(t[i], t[o]) + 1e-10 < r && s(t[o], t[i]);
517
+ }
518
+ const e = /* @__PURE__ */ new Map();
519
+ for (let i = 0; i < t.length; ++i) {
520
+ const o = n(t[i]).parent.setid;
521
+ e.has(o) || e.set(o, []), e.get(o).push(t[i]);
522
+ }
523
+ return t.forEach((i) => {
524
+ delete i.parent;
525
+ }), Array.from(e.values());
526
+ }
527
+ function dt(t) {
528
+ const n = (s) => {
529
+ const e = t.reduce((o, r) => Math.max(o, r[s] + r.radius), Number.NEGATIVE_INFINITY), i = t.reduce((o, r) => Math.min(o, r[s] - r.radius), Number.POSITIVE_INFINITY);
530
+ return { max: e, min: i };
531
+ };
532
+ return { xRange: n("x"), yRange: n("y") };
533
+ }
534
+ function Dt(t, n, s) {
535
+ n == null && (n = Math.PI / 2);
536
+ let e = Ft(t).map((u) => Object.assign({}, u));
537
+ const i = be(e);
538
+ for (const u of i) {
539
+ me(u, n, s);
540
+ const a = dt(u);
541
+ u.size = (a.xRange.max - a.xRange.min) * (a.yRange.max - a.yRange.min), u.bounds = a;
542
+ }
543
+ i.sort((u, a) => a.size - u.size), e = i[0];
544
+ let o = e.bounds;
545
+ const r = (o.xRange.max - o.xRange.min) / 50;
546
+ function l(u, a, y) {
547
+ if (!u)
548
+ return;
549
+ const h = u.bounds;
550
+ let b, p;
551
+ if (a)
552
+ b = o.xRange.max - h.xRange.min + r;
553
+ else {
554
+ b = o.xRange.max - h.xRange.max;
555
+ const M = (h.xRange.max - h.xRange.min) / 2 - (o.xRange.max - o.xRange.min) / 2;
556
+ M < 0 && (b += M);
557
+ }
558
+ if (y)
559
+ p = o.yRange.max - h.yRange.min + r;
560
+ else {
561
+ p = o.yRange.max - h.yRange.max;
562
+ const M = (h.yRange.max - h.yRange.min) / 2 - (o.yRange.max - o.yRange.min) / 2;
563
+ M < 0 && (p += M);
564
+ }
565
+ for (const M of u)
566
+ M.x += b, M.y += p, e.push(M);
567
+ }
568
+ let f = 1;
569
+ for (; f < i.length; )
570
+ l(i[f], !0, !1), l(i[f + 1], !1, !0), l(i[f + 2], !0, !0), f += 3, o = dt(e);
571
+ return Ot(e);
572
+ }
573
+ function Nt(t, n, s, e, i) {
574
+ const o = Ft(t);
575
+ n -= 2 * e, s -= 2 * e;
576
+ const { xRange: r, yRange: l } = dt(o);
577
+ if (r.max === r.min || l.max === l.min)
578
+ return console.log("not scaling solution: zero size detected"), t;
579
+ let f, u;
580
+ if (i) {
581
+ const b = Math.sqrt(i / Math.PI) * 2;
582
+ f = n / b, u = s / b;
583
+ } else
584
+ f = n / (r.max - r.min), u = s / (l.max - l.min);
585
+ const a = Math.min(u, f), y = (n - (r.max - r.min) * a) / 2, h = (s - (l.max - l.min) * a) / 2;
586
+ return Ot(
587
+ o.map((b) => ({
588
+ radius: a * b.radius,
589
+ x: e + y + (b.x - r.min) * a,
590
+ y: e + h + (b.y - l.min) * a,
591
+ setid: b.setid
592
+ }))
593
+ );
594
+ }
595
+ function Ot(t) {
596
+ const n = {};
597
+ for (const s of t)
598
+ n[s.setid] = s;
599
+ return n;
600
+ }
601
+ function Ft(t) {
602
+ return Object.keys(t).map((s) => Object.assign(t[s], { setid: s }));
603
+ }
604
+ function ve(t = {}) {
605
+ let n = !1, s = 600, e = 350, i = 15, o = 1e3, r = Math.PI / 2, l = !0, f = null, u = !0, a = !0, y = null, h = null, b = !1, p = null, M = t && t.symmetricalTextCentre ? t.symmetricalTextCentre : !1, E = {}, _ = t && t.colourScheme ? t.colourScheme : t && t.colorScheme ? t.colorScheme : [
606
+ "#1f77b4",
607
+ "#ff7f0e",
608
+ "#2ca02c",
609
+ "#d62728",
610
+ "#9467bd",
611
+ "#8c564b",
612
+ "#e377c2",
613
+ "#7f7f7f",
614
+ "#bcbd22",
615
+ "#17becf"
616
+ ], S = 0, g = function(x) {
617
+ if (x in E)
618
+ return E[x];
619
+ var d = E[x] = _[S];
620
+ return S += 1, S >= _.length && (S = 0), d;
621
+ }, m = At, v = tt;
622
+ function c(x) {
623
+ let d = x.datum();
624
+ const C = /* @__PURE__ */ new Set();
625
+ d.forEach((k) => {
626
+ k.size == 0 && k.sets.length == 1 && C.add(k.sets[0]);
627
+ }), d = d.filter((k) => !k.sets.some((F) => C.has(F)));
628
+ let I = {}, D = {};
629
+ if (d.length > 0) {
630
+ let k = m(d, { lossFunction: v, distinct: b });
631
+ l && (k = Dt(k, r, h)), I = Nt(k, s, e, i, f), D = Lt(I, d, M);
632
+ }
633
+ const U = {};
634
+ d.forEach((k) => {
635
+ k.label && (U[k.sets] = k.label);
636
+ });
637
+ function V(k) {
638
+ if (k.sets in U)
639
+ return U[k.sets];
640
+ if (k.sets.length == 1)
641
+ return "" + k.sets[0];
642
+ }
643
+ x.selectAll("svg").data([I]).enter().append("svg");
644
+ const O = x.select("svg");
645
+ n ? O.attr("viewBox", `0 0 ${s} ${e}`) : O.attr("width", s).attr("height", e);
646
+ const R = {};
647
+ let T = !1;
648
+ O.selectAll(".venn-area path").each(function(k) {
649
+ const F = this.getAttribute("d");
650
+ k.sets.length == 1 && F && !b && (T = !0, R[k.sets[0]] = Me(F));
651
+ });
652
+ function A(k) {
653
+ return (F) => {
654
+ const H = k.sets.map((et) => {
655
+ let Y = R[et], Z = I[et];
656
+ return Y || (Y = { x: s / 2, y: e / 2, radius: 1 }), Z || (Z = { x: s / 2, y: e / 2, radius: 1 }), {
657
+ x: Y.x * (1 - F) + Z.x * F,
658
+ y: Y.y * (1 - F) + Z.y * F,
659
+ radius: Y.radius * (1 - F) + Z.radius * F
660
+ };
661
+ });
662
+ return St(H, p);
663
+ };
664
+ }
665
+ const G = O.selectAll(".venn-area").data(d, (k) => k.sets), P = G.enter().append("g").attr(
666
+ "class",
667
+ (k) => `venn-area venn-${k.sets.length == 1 ? "circle" : "intersection"}${k.colour || k.color ? " venn-coloured" : ""}`
668
+ ).attr("data-venn-sets", (k) => k.sets.join("_")), B = P.append("path"), L = P.append("text").attr("class", "label").text((k) => V(k)).attr("text-anchor", "middle").attr("dy", ".35em").attr("x", s / 2).attr("y", e / 2);
669
+ a && (B.style("fill-opacity", "0").filter((k) => k.sets.length == 1).style("fill", (k) => k.colour ? k.colour : k.color ? k.color : g(k.sets)).style("fill-opacity", ".25"), L.style("fill", (k) => k.colour || k.color ? "#FFF" : t.textFill ? t.textFill : k.sets.length == 1 ? g(k.sets) : "#444"));
670
+ function K(k) {
671
+ return typeof k.transition == "function" ? k.transition("venn").duration(o) : k;
672
+ }
673
+ let z = x;
674
+ T && typeof z.transition == "function" ? (z = K(x), z.selectAll("path").attrTween("d", A)) : z.selectAll("path").attr("d", (k) => St(k.sets.map((F) => I[F])), p);
675
+ const N = z.selectAll("text").filter((k) => k.sets in D).text((k) => V(k)).attr("x", (k) => Math.floor(D[k.sets].x)).attr("y", (k) => Math.floor(D[k.sets].y));
676
+ u && (T ? "on" in N ? N.on("end", rt(I, V)) : N.each("end", rt(I, V)) : N.each(rt(I, V)));
677
+ const j = K(G.exit()).remove();
678
+ typeof G.transition == "function" && j.selectAll("path").attrTween("d", A);
679
+ const X = j.selectAll("text").attr("x", s / 2).attr("y", e / 2);
680
+ return y !== null && (L.style("font-size", "0px"), N.style("font-size", y), X.style("font-size", "0px")), { circles: I, textCentres: D, nodes: G, enter: P, update: z, exit: j };
681
+ }
682
+ return c.wrap = function(x) {
683
+ return arguments.length ? (u = x, c) : u;
684
+ }, c.useViewBox = function() {
685
+ return n = !0, c;
686
+ }, c.width = function(x) {
687
+ return arguments.length ? (s = x, c) : s;
688
+ }, c.height = function(x) {
689
+ return arguments.length ? (e = x, c) : e;
690
+ }, c.padding = function(x) {
691
+ return arguments.length ? (i = x, c) : i;
692
+ }, c.distinct = function(x) {
693
+ return arguments.length ? (b = x, c) : b;
694
+ }, c.colours = function(x) {
695
+ return arguments.length ? (g = x, c) : g;
696
+ }, c.colors = function(x) {
697
+ return arguments.length ? (g = x, c) : g;
698
+ }, c.fontSize = function(x) {
699
+ return arguments.length ? (y = x, c) : y;
700
+ }, c.round = function(x) {
701
+ return arguments.length ? (p = x, c) : p;
702
+ }, c.duration = function(x) {
703
+ return arguments.length ? (o = x, c) : o;
704
+ }, c.layoutFunction = function(x) {
705
+ return arguments.length ? (m = x, c) : m;
706
+ }, c.normalize = function(x) {
707
+ return arguments.length ? (l = x, c) : l;
708
+ }, c.scaleToFit = function(x) {
709
+ return arguments.length ? (f = x, c) : f;
710
+ }, c.styled = function(x) {
711
+ return arguments.length ? (a = x, c) : a;
712
+ }, c.orientation = function(x) {
713
+ return arguments.length ? (r = x, c) : r;
714
+ }, c.orientationOrder = function(x) {
715
+ return arguments.length ? (h = x, c) : h;
716
+ }, c.lossFunction = function(x) {
717
+ return arguments.length ? (v = x === "default" ? tt : x === "logRatio" ? Ct : x, c) : v;
718
+ }, c;
719
+ }
720
+ function rt(t, n) {
721
+ return function(s) {
722
+ const e = this, i = t[s.sets[0]].radius || 50, o = n(s) || "", r = o.split(/\s+/).reverse(), f = (o.length + r.length) / 3;
723
+ let u = r.pop(), a = [u], y = 0;
724
+ const h = 1.1;
725
+ e.textContent = null;
726
+ const b = [];
727
+ function p(g) {
728
+ const m = e.ownerDocument.createElementNS(e.namespaceURI, "tspan");
729
+ return m.textContent = g, b.push(m), e.append(m), m;
730
+ }
731
+ let M = p(u);
732
+ for (; u = r.pop(), !!u; ) {
733
+ a.push(u);
734
+ const g = a.join(" ");
735
+ M.textContent = g, g.length > f && M.getComputedTextLength() > i && (a.pop(), M.textContent = a.join(" "), a = [u], M = p(u), y++);
736
+ }
737
+ const E = 0.35 - y * h / 2, _ = e.getAttribute("x"), S = e.getAttribute("y");
738
+ b.forEach((g, m) => {
739
+ g.setAttribute("x", _), g.setAttribute("y", S), g.setAttribute("dy", `${E + m * h}em`);
740
+ });
741
+ };
742
+ }
743
+ function at(t, n, s) {
744
+ let e = n[0].radius - q(n[0], t);
745
+ for (let i = 1; i < n.length; ++i) {
746
+ const o = n[i].radius - q(n[i], t);
747
+ o <= e && (e = o);
748
+ }
749
+ for (let i = 0; i < s.length; ++i) {
750
+ const o = q(s[i], t) - s[i].radius;
751
+ o <= e && (e = o);
752
+ }
753
+ return e;
754
+ }
755
+ function jt(t, n, s) {
756
+ const e = [];
757
+ for (const a of t)
758
+ e.push({ x: a.x, y: a.y }), e.push({ x: a.x + a.radius / 2, y: a.y }), e.push({ x: a.x - a.radius / 2, y: a.y }), e.push({ x: a.x, y: a.y + a.radius / 2 }), e.push({ x: a.x, y: a.y - a.radius / 2 });
759
+ let i = e[0], o = at(e[0], t, n);
760
+ for (let a = 1; a < e.length; ++a) {
761
+ const y = at(e[a], t, n);
762
+ y >= o && (i = e[a], o = y);
763
+ }
764
+ const r = zt(
765
+ (a) => -1 * at({ x: a[0], y: a[1] }, t, n),
766
+ [i.x, i.y],
767
+ { maxIterations: 500, minErrorDelta: 1e-10 }
768
+ ).x, l = { x: s ? 0 : r[0], y: r[1] };
769
+ let f = !0;
770
+ for (const a of t)
771
+ if (q(l, a) > a.radius) {
772
+ f = !1;
773
+ break;
774
+ }
775
+ for (const a of n)
776
+ if (q(l, a) < a.radius) {
777
+ f = !1;
778
+ break;
779
+ }
780
+ if (f)
781
+ return l;
782
+ if (t.length == 1)
783
+ return { x: t[0].x, y: t[0].y };
784
+ const u = {};
785
+ return st(t, u), u.arcs.length === 0 ? { x: 0, y: -1e3, disjoint: !0 } : u.arcs.length == 1 ? { x: u.arcs[0].circle.x, y: u.arcs[0].circle.y } : n.length ? jt(t, []) : Et(u.arcs.map((a) => a.p1));
786
+ }
787
+ function Ie(t) {
788
+ const n = {}, s = Object.keys(t);
789
+ for (const e of s)
790
+ n[e] = [];
791
+ for (let e = 0; e < s.length; e++) {
792
+ const i = s[e], o = t[i];
793
+ for (let r = e + 1; r < s.length; ++r) {
794
+ const l = s[r], f = t[l], u = q(o, f);
795
+ u + f.radius <= o.radius + 1e-10 ? n[l].push(i) : u + o.radius <= f.radius + 1e-10 && n[i].push(l);
796
+ }
797
+ }
798
+ return n;
799
+ }
800
+ function Lt(t, n, s) {
801
+ const e = {}, i = Ie(t);
802
+ for (let o = 0; o < n.length; ++o) {
803
+ const r = n[o].sets, l = {}, f = {};
804
+ for (let h = 0; h < r.length; ++h) {
805
+ l[r[h]] = !0;
806
+ const b = i[r[h]];
807
+ for (let p = 0; p < b.length; ++p)
808
+ f[b[p]] = !0;
809
+ }
810
+ const u = [], a = [];
811
+ for (let h in t)
812
+ h in l ? u.push(t[h]) : h in f || a.push(t[h]);
813
+ const y = jt(u, a, s);
814
+ e[r] = y, y.disjoint && n[o].size > 0 && console.log("WARNING: area " + r + " not represented on screen");
815
+ }
816
+ return e;
817
+ }
818
+ function ke(t, n, s) {
819
+ const e = [];
820
+ return e.push(`
821
+ M`, t, n), e.push(`
822
+ m`, -s, 0), e.push(`
823
+ a`, s, s, 0, 1, 0, s * 2, 0), e.push(`
824
+ a`, s, s, 0, 1, 0, -s * 2, 0), e.join(" ");
825
+ }
826
+ function Me(t) {
827
+ const n = t.split(" ");
828
+ return { x: Number.parseFloat(n[1]), y: Number.parseFloat(n[2]), radius: -Number.parseFloat(n[4]) };
829
+ }
830
+ function Pt(t) {
831
+ if (t.length === 0)
832
+ return [];
833
+ const n = {};
834
+ return st(t, n), n.arcs;
835
+ }
836
+ function Bt(t, n) {
837
+ if (t.length === 0)
838
+ return "M 0 0";
839
+ const s = Math.pow(10, n || 0), e = n != null ? (o) => Math.round(o * s) / s : (o) => o;
840
+ if (t.length == 1) {
841
+ const o = t[0].circle;
842
+ return ke(e(o.x), e(o.y), e(o.radius));
843
+ }
844
+ const i = [`
845
+ M`, e(t[0].p2.x), e(t[0].p2.y)];
846
+ for (const o of t) {
847
+ const r = e(o.circle.radius);
848
+ i.push(`
849
+ A`, r, r, 0, o.large ? 1 : 0, o.sweep ? 1 : 0, e(o.p1.x), e(o.p1.y));
850
+ }
851
+ return i.join(" ");
852
+ }
853
+ function St(t, n) {
854
+ return Bt(Pt(t), n);
855
+ }
856
+ function Se(t, n = {}) {
857
+ const {
858
+ lossFunction: s,
859
+ layoutFunction: e = At,
860
+ normalize: i = !0,
861
+ orientation: o = Math.PI / 2,
862
+ orientationOrder: r,
863
+ width: l = 600,
864
+ height: f = 350,
865
+ padding: u = 15,
866
+ scaleToFit: a = !1,
867
+ symmetricalTextCentre: y = !1,
868
+ distinct: h,
869
+ round: b = 2
870
+ } = n;
871
+ let p = e(t, {
872
+ lossFunction: s === "default" || !s ? tt : s === "logRatio" ? Ct : s,
873
+ distinct: h
874
+ });
875
+ i && (p = Dt(p, o, r));
876
+ const M = Nt(p, l, f, u, a), E = Lt(M, t, y), _ = new Map(
877
+ Object.keys(M).map((m) => [
878
+ m,
879
+ {
880
+ set: m,
881
+ x: M[m].x,
882
+ y: M[m].y,
883
+ radius: M[m].radius
884
+ }
885
+ ])
886
+ ), S = t.map((m) => {
887
+ const v = m.sets.map((d) => _.get(d)), c = Pt(v), x = Bt(c, b);
888
+ return { circles: v, arcs: c, path: x, area: m, has: new Set(m.sets) };
889
+ });
890
+ function g(m) {
891
+ let v = "";
892
+ for (const c of S)
893
+ c.has.size > m.length && m.every((x) => c.has.has(x)) && (v += " " + c.path);
894
+ return v;
895
+ }
896
+ return S.map(({ circles: m, arcs: v, path: c, area: x }) => ({
897
+ data: x,
898
+ text: E[x.sets],
899
+ circles: m,
900
+ arcs: v,
901
+ path: c,
902
+ distinctPath: c + g(x.sets)
903
+ }));
904
+ }
905
+ var gt = function() {
906
+ var t = /* @__PURE__ */ w(function(S, g, m, v) {
907
+ for (m = m || {}, v = S.length; v--; m[S[v]] = g) ;
908
+ return m;
909
+ }, "o"), n = [5, 8], s = [7, 8, 11, 12, 17, 19, 22, 24], e = [1, 17], i = [1, 18], o = [7, 8, 11, 12, 14, 15, 16, 17, 19, 20, 21, 22, 24, 27], r = [1, 31], l = [1, 39], f = [7, 8, 11, 12, 17, 19, 22, 24, 27], u = [1, 57], a = [1, 56], y = [1, 58], h = [1, 59], b = [1, 60], p = [7, 8, 11, 12, 16, 17, 19, 20, 22, 24, 27, 31, 32, 33], M = {
910
+ trace: /* @__PURE__ */ w(function() {
911
+ }, "trace"),
912
+ yy: {},
913
+ 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 },
914
+ 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" },
915
+ 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]],
916
+ performAction: /* @__PURE__ */ w(function(g, m, v, c, x, d, C) {
917
+ var I = d.length - 1;
918
+ switch (x) {
919
+ case 1:
920
+ return d[I - 1];
921
+ case 2:
922
+ case 3:
923
+ case 4:
924
+ this.$ = [];
925
+ break;
926
+ case 5:
927
+ d[I - 1].push(d[I]), this.$ = d[I - 1];
928
+ break;
929
+ case 6:
930
+ this.$ = [];
931
+ break;
932
+ case 7:
933
+ case 22:
934
+ case 32:
935
+ case 36:
936
+ case 37:
937
+ case 38:
938
+ case 39:
939
+ case 40:
940
+ this.$ = d[I];
941
+ break;
942
+ case 8:
943
+ c.setDiagramTitle(d[I].substr(6)), this.$ = d[I].substr(6);
944
+ break;
945
+ case 9:
946
+ c.addSubsetData([d[I]], void 0, void 0), c.setIndentMode && c.setIndentMode(!0);
947
+ break;
948
+ case 10:
949
+ c.addSubsetData([d[I - 1]], d[I], void 0), c.setIndentMode && c.setIndentMode(!0);
950
+ break;
951
+ case 11:
952
+ c.addSubsetData([d[I - 2]], void 0, parseFloat(d[I])), c.setIndentMode && c.setIndentMode(!0);
953
+ break;
954
+ case 12:
955
+ c.addSubsetData([d[I - 3]], d[I - 2], parseFloat(d[I])), c.setIndentMode && c.setIndentMode(!0);
956
+ break;
957
+ case 13:
958
+ if (d[I].length < 2)
959
+ throw new Error("union requires multiple identifiers");
960
+ c.validateUnionIdentifiers && c.validateUnionIdentifiers(d[I]), c.addSubsetData(d[I], void 0, void 0), c.setIndentMode && c.setIndentMode(!0);
961
+ break;
962
+ case 14:
963
+ if (d[I - 1].length < 2)
964
+ throw new Error("union requires multiple identifiers");
965
+ c.validateUnionIdentifiers && c.validateUnionIdentifiers(d[I - 1]), c.addSubsetData(d[I - 1], d[I], void 0), c.setIndentMode && c.setIndentMode(!0);
966
+ break;
967
+ case 15:
968
+ if (d[I - 2].length < 2)
969
+ throw new Error("union requires multiple identifiers");
970
+ c.validateUnionIdentifiers && c.validateUnionIdentifiers(d[I - 2]), c.addSubsetData(d[I - 2], void 0, parseFloat(d[I])), c.setIndentMode && c.setIndentMode(!0);
971
+ break;
972
+ case 16:
973
+ if (d[I - 3].length < 2)
974
+ throw new Error("union requires multiple identifiers");
975
+ c.validateUnionIdentifiers && c.validateUnionIdentifiers(d[I - 3]), c.addSubsetData(d[I - 3], d[I - 2], parseFloat(d[I])), c.setIndentMode && c.setIndentMode(!0);
976
+ break;
977
+ case 17:
978
+ case 18:
979
+ case 19:
980
+ c.addTextData(d[I - 1], d[I], void 0);
981
+ break;
982
+ case 20:
983
+ case 21:
984
+ c.addTextData(d[I - 2], d[I - 1], d[I]);
985
+ break;
986
+ case 23:
987
+ c.addStyleData(d[I - 1], d[I]);
988
+ break;
989
+ case 24:
990
+ case 25:
991
+ case 26:
992
+ var D = c.getCurrentSets();
993
+ if (!D) throw new Error("text requires set");
994
+ c.addTextData(D, d[I], void 0);
995
+ break;
996
+ case 27:
997
+ case 28:
998
+ var D = c.getCurrentSets();
999
+ if (!D) throw new Error("text requires set");
1000
+ c.addTextData(D, d[I - 1], d[I]);
1001
+ break;
1002
+ case 29:
1003
+ case 41:
1004
+ this.$ = [d[I]];
1005
+ break;
1006
+ case 30:
1007
+ case 42:
1008
+ this.$ = [...d[I - 2], d[I]];
1009
+ break;
1010
+ case 31:
1011
+ this.$ = [d[I - 2], d[I]];
1012
+ break;
1013
+ case 33:
1014
+ this.$ = d[I].join(" ");
1015
+ break;
1016
+ case 34:
1017
+ this.$ = [d[I]];
1018
+ break;
1019
+ case 35:
1020
+ d[I - 1].push(d[I]), this.$ = d[I - 1];
1021
+ break;
1022
+ case 43:
1023
+ case 44:
1024
+ this.$ = d[I];
1025
+ break;
1026
+ }
1027
+ }, "anonymous"),
1028
+ 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: e, 21: i }, { 13: 20, 18: 19, 20: e, 21: i }, { 13: 20, 18: 21, 20: e, 21: i }, { 16: [1, 25], 20: [1, 23], 21: [1, 24], 23: 22 }, { 13: 20, 18: 26, 20: e, 21: i }, 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: r }), t(o, [2, 41]), { 16: [1, 34], 20: [1, 32], 21: [1, 33], 27: r }, 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: r }, t(s, [2, 10], { 15: [1, 40] }), { 16: [1, 41] }, t(s, [2, 14], { 15: [1, 42] }), { 16: [1, 43] }, { 13: 44, 20: e, 21: i }, 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(f, [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: u, 20: a, 21: [1, 53], 28: 52, 29: 54, 30: 55, 31: y, 32: h, 33: b }, t(s, [2, 12]), t(s, [2, 16]), t(f, [2, 30]), t(f, [2, 31]), t(f, [2, 32]), t(f, [2, 33], { 30: 61, 16: u, 20: a, 31: y, 32: h, 33: b }), t(p, [2, 34]), t(p, [2, 36]), t(p, [2, 37]), t(p, [2, 38]), t(p, [2, 39]), t(p, [2, 40]), t(p, [2, 35])],
1029
+ defaultActions: { 6: [2, 1] },
1030
+ parseError: /* @__PURE__ */ w(function(g, m) {
1031
+ if (m.recoverable)
1032
+ this.trace(g);
1033
+ else {
1034
+ var v = new Error(g);
1035
+ throw v.hash = m, v;
1036
+ }
1037
+ }, "parseError"),
1038
+ parse: /* @__PURE__ */ w(function(g) {
1039
+ var m = this, v = [0], c = [], x = [null], d = [], C = this.table, I = "", D = 0, U = 0, V = 2, O = 1, R = d.slice.call(arguments, 1), T = Object.create(this.lexer), A = { yy: {} };
1040
+ for (var G in this.yy)
1041
+ Object.prototype.hasOwnProperty.call(this.yy, G) && (A.yy[G] = this.yy[G]);
1042
+ T.setInput(g, A.yy), A.yy.lexer = T, A.yy.parser = this, typeof T.yylloc > "u" && (T.yylloc = {});
1043
+ var P = T.yylloc;
1044
+ d.push(P);
1045
+ var B = T.options && T.options.ranges;
1046
+ typeof A.yy.parseError == "function" ? this.parseError = A.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
1047
+ function L(W) {
1048
+ v.length = v.length - 2 * W, x.length = x.length - W, d.length = d.length - W;
1049
+ }
1050
+ w(L, "popStack");
1051
+ function K() {
1052
+ var W;
1053
+ return W = c.pop() || T.lex() || O, typeof W != "number" && (W instanceof Array && (c = W, W = c.pop()), W = m.symbols_[W] || W), W;
1054
+ }
1055
+ w(K, "lex");
1056
+ for (var z, N, j, X, k = {}, F, H, et, Y; ; ) {
1057
+ if (N = v[v.length - 1], this.defaultActions[N] ? j = this.defaultActions[N] : ((z === null || typeof z > "u") && (z = K()), j = C[N] && C[N][z]), typeof j > "u" || !j.length || !j[0]) {
1058
+ var Z = "";
1059
+ Y = [];
1060
+ for (F in C[N])
1061
+ this.terminals_[F] && F > V && Y.push("'" + this.terminals_[F] + "'");
1062
+ T.showPosition ? Z = "Parse error on line " + (D + 1) + `:
1063
+ ` + T.showPosition() + `
1064
+ Expecting ` + Y.join(", ") + ", got '" + (this.terminals_[z] || z) + "'" : Z = "Parse error on line " + (D + 1) + ": Unexpected " + (z == O ? "end of input" : "'" + (this.terminals_[z] || z) + "'"), this.parseError(Z, {
1065
+ text: T.match,
1066
+ token: this.terminals_[z] || z,
1067
+ line: T.yylineno,
1068
+ loc: P,
1069
+ expected: Y
1070
+ });
1071
+ }
1072
+ if (j[0] instanceof Array && j.length > 1)
1073
+ throw new Error("Parse Error: multiple actions possible at state: " + N + ", token: " + z);
1074
+ switch (j[0]) {
1075
+ case 1:
1076
+ v.push(z), x.push(T.yytext), d.push(T.yylloc), v.push(j[1]), z = null, U = T.yyleng, I = T.yytext, D = T.yylineno, P = T.yylloc;
1077
+ break;
1078
+ case 2:
1079
+ if (H = this.productions_[j[1]][1], k.$ = x[x.length - H], k._$ = {
1080
+ first_line: d[d.length - (H || 1)].first_line,
1081
+ last_line: d[d.length - 1].last_line,
1082
+ first_column: d[d.length - (H || 1)].first_column,
1083
+ last_column: d[d.length - 1].last_column
1084
+ }, B && (k._$.range = [
1085
+ d[d.length - (H || 1)].range[0],
1086
+ d[d.length - 1].range[1]
1087
+ ]), X = this.performAction.apply(k, [
1088
+ I,
1089
+ U,
1090
+ D,
1091
+ A.yy,
1092
+ j[1],
1093
+ x,
1094
+ d
1095
+ ].concat(R)), typeof X < "u")
1096
+ return X;
1097
+ H && (v = v.slice(0, -1 * H * 2), x = x.slice(0, -1 * H), d = d.slice(0, -1 * H)), v.push(this.productions_[j[1]][0]), x.push(k.$), d.push(k._$), et = C[v[v.length - 2]][v[v.length - 1]], v.push(et);
1098
+ break;
1099
+ case 3:
1100
+ return !0;
1101
+ }
1102
+ }
1103
+ return !0;
1104
+ }, "parse")
1105
+ }, E = /* @__PURE__ */ function() {
1106
+ var S = {
1107
+ EOF: 1,
1108
+ parseError: /* @__PURE__ */ w(function(m, v) {
1109
+ if (this.yy.parser)
1110
+ this.yy.parser.parseError(m, v);
1111
+ else
1112
+ throw new Error(m);
1113
+ }, "parseError"),
1114
+ // resets the lexer, sets new input
1115
+ setInput: /* @__PURE__ */ w(function(g, m) {
1116
+ return this.yy = m || this.yy || {}, this._input = g, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
1117
+ first_line: 1,
1118
+ first_column: 0,
1119
+ last_line: 1,
1120
+ last_column: 0
1121
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
1122
+ }, "setInput"),
1123
+ // consumes and returns one char from the input
1124
+ input: /* @__PURE__ */ w(function() {
1125
+ var g = this._input[0];
1126
+ this.yytext += g, this.yyleng++, this.offset++, this.match += g, this.matched += g;
1127
+ var m = g.match(/(?:\r\n?|\n).*/g);
1128
+ return m ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), g;
1129
+ }, "input"),
1130
+ // unshifts one char (or a string) into the input
1131
+ unput: /* @__PURE__ */ w(function(g) {
1132
+ var m = g.length, v = g.split(/(?:\r\n?|\n)/g);
1133
+ this._input = g + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - m), this.offset -= m;
1134
+ var c = this.match.split(/(?:\r\n?|\n)/g);
1135
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), v.length - 1 && (this.yylineno -= v.length - 1);
1136
+ var x = this.yylloc.range;
1137
+ return this.yylloc = {
1138
+ first_line: this.yylloc.first_line,
1139
+ last_line: this.yylineno + 1,
1140
+ first_column: this.yylloc.first_column,
1141
+ last_column: v ? (v.length === c.length ? this.yylloc.first_column : 0) + c[c.length - v.length].length - v[0].length : this.yylloc.first_column - m
1142
+ }, this.options.ranges && (this.yylloc.range = [x[0], x[0] + this.yyleng - m]), this.yyleng = this.yytext.length, this;
1143
+ }, "unput"),
1144
+ // When called from action, caches matched text and appends it on next action
1145
+ more: /* @__PURE__ */ w(function() {
1146
+ return this._more = !0, this;
1147
+ }, "more"),
1148
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
1149
+ reject: /* @__PURE__ */ w(function() {
1150
+ if (this.options.backtrack_lexer)
1151
+ this._backtrack = !0;
1152
+ else
1153
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
1154
+ ` + this.showPosition(), {
1155
+ text: "",
1156
+ token: null,
1157
+ line: this.yylineno
1158
+ });
1159
+ return this;
1160
+ }, "reject"),
1161
+ // retain first n characters of the match
1162
+ less: /* @__PURE__ */ w(function(g) {
1163
+ this.unput(this.match.slice(g));
1164
+ }, "less"),
1165
+ // displays already matched input, i.e. for error messages
1166
+ pastInput: /* @__PURE__ */ w(function() {
1167
+ var g = this.matched.substr(0, this.matched.length - this.match.length);
1168
+ return (g.length > 20 ? "..." : "") + g.substr(-20).replace(/\n/g, "");
1169
+ }, "pastInput"),
1170
+ // displays upcoming input, i.e. for error messages
1171
+ upcomingInput: /* @__PURE__ */ w(function() {
1172
+ var g = this.match;
1173
+ return g.length < 20 && (g += this._input.substr(0, 20 - g.length)), (g.substr(0, 20) + (g.length > 20 ? "..." : "")).replace(/\n/g, "");
1174
+ }, "upcomingInput"),
1175
+ // displays the character position where the lexing error occurred, i.e. for error messages
1176
+ showPosition: /* @__PURE__ */ w(function() {
1177
+ var g = this.pastInput(), m = new Array(g.length + 1).join("-");
1178
+ return g + this.upcomingInput() + `
1179
+ ` + m + "^";
1180
+ }, "showPosition"),
1181
+ // test the lexed token: return FALSE when not a match, otherwise return token
1182
+ test_match: /* @__PURE__ */ w(function(g, m) {
1183
+ var v, c, x;
1184
+ if (this.options.backtrack_lexer && (x = {
1185
+ yylineno: this.yylineno,
1186
+ yylloc: {
1187
+ first_line: this.yylloc.first_line,
1188
+ last_line: this.last_line,
1189
+ first_column: this.yylloc.first_column,
1190
+ last_column: this.yylloc.last_column
1191
+ },
1192
+ yytext: this.yytext,
1193
+ match: this.match,
1194
+ matches: this.matches,
1195
+ matched: this.matched,
1196
+ yyleng: this.yyleng,
1197
+ offset: this.offset,
1198
+ _more: this._more,
1199
+ _input: this._input,
1200
+ yy: this.yy,
1201
+ conditionStack: this.conditionStack.slice(0),
1202
+ done: this.done
1203
+ }, this.options.ranges && (x.yylloc.range = this.yylloc.range.slice(0))), c = g[0].match(/(?:\r\n?|\n).*/g), c && (this.yylineno += c.length), this.yylloc = {
1204
+ first_line: this.yylloc.last_line,
1205
+ last_line: this.yylineno + 1,
1206
+ first_column: this.yylloc.last_column,
1207
+ last_column: c ? c[c.length - 1].length - c[c.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + g[0].length
1208
+ }, this.yytext += g[0], this.match += g[0], this.matches = g, 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(g[0].length), this.matched += g[0], v = this.performAction.call(this, this.yy, this, m, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), v)
1209
+ return v;
1210
+ if (this._backtrack) {
1211
+ for (var d in x)
1212
+ this[d] = x[d];
1213
+ return !1;
1214
+ }
1215
+ return !1;
1216
+ }, "test_match"),
1217
+ // return next match in input
1218
+ next: /* @__PURE__ */ w(function() {
1219
+ if (this.done)
1220
+ return this.EOF;
1221
+ this._input || (this.done = !0);
1222
+ var g, m, v, c;
1223
+ this._more || (this.yytext = "", this.match = "");
1224
+ for (var x = this._currentRules(), d = 0; d < x.length; d++)
1225
+ if (v = this._input.match(this.rules[x[d]]), v && (!m || v[0].length > m[0].length)) {
1226
+ if (m = v, c = d, this.options.backtrack_lexer) {
1227
+ if (g = this.test_match(v, x[d]), g !== !1)
1228
+ return g;
1229
+ if (this._backtrack) {
1230
+ m = !1;
1231
+ continue;
1232
+ } else
1233
+ return !1;
1234
+ } else if (!this.options.flex)
1235
+ break;
1236
+ }
1237
+ return m ? (g = this.test_match(m, x[c]), g !== !1 ? g : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
1238
+ ` + this.showPosition(), {
1239
+ text: "",
1240
+ token: null,
1241
+ line: this.yylineno
1242
+ });
1243
+ }, "next"),
1244
+ // return next match that has a token
1245
+ lex: /* @__PURE__ */ w(function() {
1246
+ var m = this.next();
1247
+ return m || this.lex();
1248
+ }, "lex"),
1249
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
1250
+ begin: /* @__PURE__ */ w(function(m) {
1251
+ this.conditionStack.push(m);
1252
+ }, "begin"),
1253
+ // pop the previously active lexer condition state off the condition stack
1254
+ popState: /* @__PURE__ */ w(function() {
1255
+ var m = this.conditionStack.length - 1;
1256
+ return m > 0 ? this.conditionStack.pop() : this.conditionStack[0];
1257
+ }, "popState"),
1258
+ // produce the lexer rule set which is active for the currently active lexer condition state
1259
+ _currentRules: /* @__PURE__ */ w(function() {
1260
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
1261
+ }, "_currentRules"),
1262
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
1263
+ topState: /* @__PURE__ */ w(function(m) {
1264
+ return m = this.conditionStack.length - 1 - Math.abs(m || 0), m >= 0 ? this.conditionStack[m] : "INITIAL";
1265
+ }, "topState"),
1266
+ // alias for begin(condition)
1267
+ pushState: /* @__PURE__ */ w(function(m) {
1268
+ this.begin(m);
1269
+ }, "pushState"),
1270
+ // return the number of states currently on the stack
1271
+ stateStackSize: /* @__PURE__ */ w(function() {
1272
+ return this.conditionStack.length;
1273
+ }, "stateStackSize"),
1274
+ options: { "case-insensitive": !0 },
1275
+ performAction: /* @__PURE__ */ w(function(m, v, c, x) {
1276
+ switch (c) {
1277
+ case 0:
1278
+ break;
1279
+ case 1:
1280
+ break;
1281
+ case 2:
1282
+ break;
1283
+ case 3:
1284
+ if (m.getIndentMode && m.getIndentMode())
1285
+ return m.consumeIndentText = !0, this.begin("INITIAL"), 22;
1286
+ break;
1287
+ case 4:
1288
+ break;
1289
+ case 5:
1290
+ m.setIndentMode && m.setIndentMode(!1), this.begin("INITIAL"), this.unput(v.yytext);
1291
+ break;
1292
+ case 6:
1293
+ return this.begin("bol"), 8;
1294
+ case 7:
1295
+ break;
1296
+ case 8:
1297
+ break;
1298
+ case 9:
1299
+ return 7;
1300
+ case 10:
1301
+ return 11;
1302
+ case 11:
1303
+ return 5;
1304
+ case 12:
1305
+ return 12;
1306
+ case 13:
1307
+ return 17;
1308
+ case 14:
1309
+ if (m.consumeIndentText)
1310
+ m.consumeIndentText = !1;
1311
+ else
1312
+ return 19;
1313
+ break;
1314
+ case 15:
1315
+ return 24;
1316
+ case 16:
1317
+ return v.yytext = v.yytext.slice(2, -2), 14;
1318
+ case 17:
1319
+ return v.yytext = v.yytext.slice(1, -1).trim(), 14;
1320
+ case 18:
1321
+ return 16;
1322
+ case 19:
1323
+ return 31;
1324
+ case 20:
1325
+ return 33;
1326
+ case 21:
1327
+ return 32;
1328
+ case 22:
1329
+ return 20;
1330
+ case 23:
1331
+ return 21;
1332
+ case 24:
1333
+ return 27;
1334
+ case 25:
1335
+ return 15;
1336
+ }
1337
+ }, "anonymous"),
1338
+ 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],
1339
+ 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 } }
1340
+ };
1341
+ return S;
1342
+ }();
1343
+ M.lexer = E;
1344
+ function _() {
1345
+ this.yy = {};
1346
+ }
1347
+ return w(_, "Parser"), _.prototype = M, M.Parser = _, new _();
1348
+ }();
1349
+ gt.parser = gt;
1350
+ var we = gt, yt = [], pt = [], mt = [], bt = /* @__PURE__ */ new Set(), vt, It = !1, _e = /* @__PURE__ */ w((t, n, s) => {
1351
+ const e = it(t).sort(), i = s ?? 10 / Math.pow(t.length, 2);
1352
+ vt = e, e.length === 1 && bt.add(e[0]), yt.push({
1353
+ sets: e,
1354
+ size: i,
1355
+ label: n ? nt(n) : void 0
1356
+ });
1357
+ }, "addSubsetData"), Te = /* @__PURE__ */ w(() => yt, "getSubsetData"), nt = /* @__PURE__ */ w((t) => {
1358
+ const n = t.trim();
1359
+ return n.length >= 2 && n.startsWith('"') && n.endsWith('"') ? n.slice(1, -1) : n;
1360
+ }, "normalizeText"), Ee = /* @__PURE__ */ w((t) => t && nt(t), "normalizeStyleValue"), ze = /* @__PURE__ */ w((t, n, s) => {
1361
+ const e = nt(n);
1362
+ pt.push({
1363
+ sets: it(t).sort(),
1364
+ id: e,
1365
+ label: s ? nt(s) : void 0
1366
+ });
1367
+ }, "addTextData"), Ae = /* @__PURE__ */ w((t, n) => {
1368
+ const s = it(t).sort(), e = {};
1369
+ for (const [i, o] of n)
1370
+ e[i] = Ee(o) ?? o;
1371
+ mt.push({ targets: s, styles: e });
1372
+ }, "addStyleData"), Re = /* @__PURE__ */ w(() => mt, "getStyleData"), it = /* @__PURE__ */ w((t) => t.map((n) => nt(n)), "normalizeIdentifierList"), Ce = /* @__PURE__ */ w((t) => {
1373
+ const s = it(t).filter((e) => !bt.has(e));
1374
+ if (s.length > 0)
1375
+ throw new Error(`unknown set identifier: ${s.join(", ")}`);
1376
+ }, "validateUnionIdentifiers"), De = /* @__PURE__ */ w(() => pt, "getTextData"), Ne = /* @__PURE__ */ w(() => vt, "getCurrentSets"), Oe = /* @__PURE__ */ w(() => It, "getIndentMode"), Fe = /* @__PURE__ */ w((t) => {
1377
+ It = t;
1378
+ }, "setIndentMode"), je = re.venn;
1379
+ function Vt() {
1380
+ return oe(je, wt().venn);
1381
+ }
1382
+ w(Vt, "getConfig");
1383
+ var Le = /* @__PURE__ */ w(() => {
1384
+ ie(), yt.length = 0, pt.length = 0, mt.length = 0, bt.clear(), vt = void 0, It = !1;
1385
+ }, "customClear"), Pe = {
1386
+ getConfig: Vt,
1387
+ clear: Le,
1388
+ setAccTitle: Jt,
1389
+ getAccTitle: Zt,
1390
+ setDiagramTitle: Xt,
1391
+ getDiagramTitle: Yt,
1392
+ getAccDescription: Ht,
1393
+ setAccDescription: Kt,
1394
+ addSubsetData: _e,
1395
+ getSubsetData: Te,
1396
+ addTextData: ze,
1397
+ addStyleData: Ae,
1398
+ validateUnionIdentifiers: Ce,
1399
+ getTextData: De,
1400
+ getStyleData: Re,
1401
+ getCurrentSets: Ne,
1402
+ getIndentMode: Oe,
1403
+ setIndentMode: Fe
1404
+ }, Be = /* @__PURE__ */ w((t) => `
1405
+ .venn-title {
1406
+ font-size: 32px;
1407
+ fill: ${t.vennTitleTextColor};
1408
+ font-family: ${t.fontFamily};
1409
+ }
1410
+
1411
+ .venn-circle text {
1412
+ font-size: 48px;
1413
+ font-family: ${t.fontFamily};
1414
+ }
1415
+
1416
+ .venn-intersection text {
1417
+ font-size: 48px;
1418
+ fill: ${t.vennSetTextColor};
1419
+ font-family: ${t.fontFamily};
1420
+ }
1421
+
1422
+ .venn-text-node {
1423
+ font-family: ${t.fontFamily};
1424
+ color: ${t.vennSetTextColor};
1425
+ }
1426
+ `, "getStyles"), Ve = Be;
1427
+ function qt(t) {
1428
+ const n = /* @__PURE__ */ new Map();
1429
+ for (const s of t) {
1430
+ const e = s.targets.join("|"), i = n.get(e);
1431
+ i ? Object.assign(i, s.styles) : n.set(e, { ...s.styles });
1432
+ }
1433
+ return n;
1434
+ }
1435
+ w(qt, "buildStyleByKey");
1436
+ var qe = /* @__PURE__ */ w((t, n, s, e) => {
1437
+ const i = e.db, o = i.getConfig?.(), { themeVariables: r, look: l, handDrawnSeed: f } = wt(), u = l === "handDrawn", a = [
1438
+ r.venn1,
1439
+ r.venn2,
1440
+ r.venn3,
1441
+ r.venn4,
1442
+ r.venn5,
1443
+ r.venn6,
1444
+ r.venn7,
1445
+ r.venn8
1446
+ ].filter(Boolean), y = i.getDiagramTitle?.(), h = i.getSubsetData(), b = i.getTextData(), p = qt(i.getStyleData()), M = Gt(h), E = o?.width ?? 800, _ = o?.height ?? 450, g = E / 1600, m = y ? 48 * g : 0, v = r.primaryTextColor ?? r.textColor, c = Qt(n);
1447
+ c.attr("viewBox", `0 0 ${E} ${_}`), y && c.append("text").text(y).attr("class", "venn-title").attr("font-size", `${32 * g}px`).attr("text-anchor", "middle").attr("dominant-baseline", "middle").attr("x", "50%").attr("y", 32 * g).style("fill", r.vennTitleTextColor || r.titleColor);
1448
+ const x = ot(document.createElement("div")), d = ve().width(E).height(_ - m);
1449
+ x.datum(M).call(d);
1450
+ const C = u ? $t.svg(x.select("svg").node()) : void 0, I = Se(M, {
1451
+ width: E,
1452
+ height: _ - m,
1453
+ padding: o?.padding ?? 15
1454
+ }), D = /* @__PURE__ */ new Map();
1455
+ for (const R of I) {
1456
+ const T = Q([...R.data.sets].sort());
1457
+ D.set(T, R);
1458
+ }
1459
+ b.length > 0 && Ut(o, D, x, b, g, p);
1460
+ const U = te(r.background || "#f4f4f4");
1461
+ x.selectAll(".venn-circle").each(function(R, T) {
1462
+ const A = ot(this), P = Q([...R.sets].sort()), B = p.get(P), L = B?.fill || a[T % a.length] || r.primaryColor;
1463
+ A.classed(`venn-set-${T % 8}`, !0);
1464
+ const K = B?.["fill-opacity"] ?? 0.1, z = B?.stroke || L, N = B?.["stroke-width"] || `${5 * g}`;
1465
+ if (u && C) {
1466
+ const X = D.get(P);
1467
+ if (X && X.circles.length > 0) {
1468
+ const k = X.circles[0], F = C.circle(k.x, k.y, k.radius * 2, {
1469
+ roughness: 0.7,
1470
+ seed: f,
1471
+ fill: kt(L, 0.7),
1472
+ fillStyle: "hachure",
1473
+ fillWeight: 2,
1474
+ hachureGap: 8,
1475
+ hachureAngle: -41 + T * 60,
1476
+ stroke: z,
1477
+ strokeWidth: parseFloat(String(N))
1478
+ });
1479
+ A.select("path").remove(), A.node()?.insertBefore(F, A.select("text").node());
1480
+ }
1481
+ } else
1482
+ A.select("path").style("fill", L).style("fill-opacity", K).style("stroke", z).style("stroke-width", N).style("stroke-opacity", 0.95);
1483
+ const j = B?.color || (U ? ee(L, 30) : ne(L, 30));
1484
+ A.select("text").style("font-size", `${48 * g}px`).style("fill", j);
1485
+ }), u && C ? x.selectAll(".venn-intersection").each(function(R) {
1486
+ const T = ot(this), G = Q([...R.sets].sort()), P = p.get(G), B = P?.fill;
1487
+ if (B) {
1488
+ const L = T.select("path"), K = L.attr("d");
1489
+ if (K) {
1490
+ const z = C.path(K, {
1491
+ roughness: 0.7,
1492
+ seed: f,
1493
+ fill: kt(B, 0.3),
1494
+ fillStyle: "cross-hatch",
1495
+ fillWeight: 2,
1496
+ hachureGap: 6,
1497
+ hachureAngle: 60,
1498
+ stroke: "none"
1499
+ }), N = L.node();
1500
+ N?.parentNode?.insertBefore(z, N), L.remove();
1501
+ }
1502
+ } else
1503
+ T.select("path").style("fill-opacity", 0);
1504
+ T.select("text").style("font-size", `${48 * g}px`).style("fill", P?.color ?? r.vennSetTextColor ?? v);
1505
+ }) : (x.selectAll(".venn-intersection text").style("font-size", `${48 * g}px`).style("fill", (R) => {
1506
+ const A = Q([...R.sets].sort());
1507
+ return p.get(A)?.color ?? r.vennSetTextColor ?? v;
1508
+ }), x.selectAll(".venn-intersection path").style("fill-opacity", (R) => {
1509
+ const A = Q([...R.sets].sort());
1510
+ return p.get(A)?.fill ? 1 : 0;
1511
+ }).style("fill", (R) => {
1512
+ const A = Q([...R.sets].sort());
1513
+ return p.get(A)?.fill ?? "transparent";
1514
+ }));
1515
+ const V = c.append("g").attr("transform", `translate(0, ${m})`), O = x.select("svg").node();
1516
+ if (O && "childNodes" in O)
1517
+ for (const R of [...O.childNodes])
1518
+ V.node()?.appendChild(R);
1519
+ se(c, _, E, o?.useMaxWidth ?? !0);
1520
+ }, "draw");
1521
+ function Q(t) {
1522
+ return t.join("|");
1523
+ }
1524
+ w(Q, "stableSetsKey");
1525
+ function Ut(t, n, s, e, i, o) {
1526
+ const r = t?.useDebugLayout ?? !1, f = s.select("svg").append("g").attr("class", "venn-text-nodes"), u = /* @__PURE__ */ new Map();
1527
+ for (const a of e) {
1528
+ const y = Q(a.sets), h = u.get(y);
1529
+ h ? h.push(a) : u.set(y, [a]);
1530
+ }
1531
+ for (const [a, y] of u.entries()) {
1532
+ const h = n.get(a);
1533
+ if (!h?.text)
1534
+ continue;
1535
+ const b = h.text.x, p = h.text.y, M = Math.min(...h.circles.map((O) => O.radius)), E = Math.min(
1536
+ ...h.circles.map((O) => O.radius - Math.hypot(b - O.x, p - O.y))
1537
+ );
1538
+ let _ = Number.isFinite(E) ? Math.max(0, E) : 0;
1539
+ _ === 0 && Number.isFinite(M) && (_ = M * 0.6);
1540
+ const S = f.append("g").attr("class", "venn-text-area").attr("font-size", `${40 * i}px`);
1541
+ r && S.append("circle").attr("class", "venn-text-debug-circle").attr("cx", b).attr("cy", p).attr("r", _).attr("fill", "none").attr("stroke", "purple").attr("stroke-width", 1.5 * i).attr("stroke-dasharray", `${6 * i} ${4 * i}`);
1542
+ const g = Math.max(80 * i, _ * 2 * 0.95), m = Math.max(60 * i, _ * 2 * 0.95), x = (h.data.label && h.data.label.length > 0 ? Math.min(32 * i, _ * 0.25) : 0) + (y.length <= 2 ? 30 * i : 0), d = b - g / 2, C = p - m / 2 + x, I = Math.max(1, Math.ceil(Math.sqrt(y.length))), D = Math.max(1, Math.ceil(y.length / I)), U = g / I, V = m / D;
1543
+ for (const [O, R] of y.entries()) {
1544
+ const T = O % I, A = Math.floor(O / I), G = d + U * (T + 0.5), P = C + V * (A + 0.5);
1545
+ r && S.append("rect").attr("class", "venn-text-debug-cell").attr("x", d + U * T).attr("y", C + V * A).attr("width", U).attr("height", V).attr("fill", "none").attr("stroke", "teal").attr("stroke-width", 1 * i).attr("stroke-dasharray", `${4 * i} ${3 * i}`);
1546
+ const B = U * 0.9, L = V * 0.9, K = S.append("foreignObject").attr("class", "venn-text-node-fo").attr("width", B).attr("height", L).attr("x", G - B / 2).attr("y", P - L / 2).attr("overflow", "visible"), z = o.get(R.id)?.color, N = K.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(R.label ?? R.id);
1547
+ z && N.style("color", z);
1548
+ }
1549
+ }
1550
+ }
1551
+ w(Ut, "renderTextNodes");
1552
+ function Gt(t) {
1553
+ const n = new Set(t.map((i) => [...i.sets].sort().join("|"))), s = new Map(
1554
+ t.filter((i) => i.sets.length === 1 && i.size !== void 0).map((i) => [i.sets[0], i.size])
1555
+ ), e = [];
1556
+ for (const i of t) {
1557
+ if (i.sets.length < 3)
1558
+ continue;
1559
+ const o = [...i.sets].sort();
1560
+ for (let r = 0; r < o.length - 1; r++)
1561
+ for (let l = r + 1; l < o.length; l++) {
1562
+ const f = [o[r], o[l]], u = f.join("|");
1563
+ if (!n.has(u)) {
1564
+ n.add(u);
1565
+ const a = s.get(f[0]), y = s.get(f[1]), h = a !== void 0 && y !== void 0 ? Math.min(a, y) / 4 : 2.5;
1566
+ e.push({ sets: f, size: h, label: "" });
1567
+ }
1568
+ }
1569
+ }
1570
+ return e.length > 0 ? [...t, ...e] : t;
1571
+ }
1572
+ w(Gt, "ensurePairwiseSubsets");
1573
+ var Ue = { draw: qe }, Ye = {
1574
+ parser: we,
1575
+ db: Pe,
1576
+ renderer: Ue,
1577
+ styles: Ve
1578
+ };
1579
+ export {
1580
+ Ye as diagram
1581
+ };