@juki-team/base-ui 1.5.22 → 1.5.24

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 (90) hide show
  1. package/dist/esm/{BarChart-iS9A5dpq.js → BarChart-rnKCGMQd.js} +1 -1
  2. package/dist/esm/{CartesianChart-DRkVAUTl.js → CartesianChart-Dvjpj90J.js} +1 -1
  3. package/dist/esm/{ChangePasswordModal-DWcV41bD.js → ChangePasswordModal-Bh9Sghzd.js} +1 -1
  4. package/dist/esm/{CodeEditor-BIbu4VxL.js → CodeEditor-Duw5SfUT.js} +1 -1
  5. package/dist/esm/{CodeViewer-BUV-dalv.js → CodeViewer-3L1yBCiq.js} +1 -1
  6. package/dist/esm/{Collapse-paq7oWgG.js → Collapse--_LykD9C.js} +1 -1
  7. package/dist/esm/{DataViewer-CMI27AMZ.js → DataViewer-D1dHtA0t.js} +1 -1
  8. package/dist/esm/{DrawerView-WQzHX5l-.js → DrawerView-CwWfnWLi.js} +1 -1
  9. package/dist/esm/{ExcalidrawButton-Dkt-wFZK.js → ExcalidrawButton-C_0b7G1W.js} +1 -1
  10. package/dist/esm/{GraphvizViewer-CYGvah6j.js → GraphvizViewer-BfMacqRe.js} +1 -1
  11. package/dist/esm/{ImageLoaderCropper-DIEHTOiU.js → ImageLoaderCropper-DTUW7gfc.js} +1 -1
  12. package/dist/esm/{InputCellPhoneNumber-DgviNp4t.js → InputCellPhoneNumber-Clg8uE_f.js} +1 -1
  13. package/dist/esm/{InputColor-BSBlv1oE.js → InputColor-R-WCu1j6.js} +1 -1
  14. package/dist/esm/{LineChart-BdYnYefg.js → LineChart-Cis4BCPT.js} +1 -1
  15. package/dist/esm/{MdMath-KE8c-hVy.js → MdMath-DLeak1_N.js} +1 -1
  16. package/dist/esm/{MdMathEditor-DbH_jI7Y.js → MdMathEditor-BG6rI0DT.js} +1 -1
  17. package/dist/esm/{Popover-BLy0OI8L.js → Popover-CpOKnJkx.js} +1 -1
  18. package/dist/esm/{SlideDeck-o1krblz8.js → SlideDeck-uAy3WDbv.js} +1 -1
  19. package/dist/esm/{TableOfContents-DPsfG1VD.js → TableOfContents-C6yZSaSD.js} +1 -1
  20. package/dist/esm/{Tooltip-BI0Xe-XW.js → Tooltip-8kM3mqHL.js} +1 -1
  21. package/dist/esm/{UserCodeEditor-CcaAG5g_.js → UserCodeEditor-BhYAs-Az.js} +2 -2
  22. package/dist/esm/{VirtualizedRowsFixed-VrMhZ4XD.js → VirtualizedRowsFixed-DTqKnPfn.js} +1 -1
  23. package/dist/esm/{WorksheetAsSlides-kPK5Z2vF.js → WorksheetAsSlides-Cf2VDzyg.js} +1 -1
  24. package/dist/esm/{WorksheetBodies-CxDz0Rxa.js → WorksheetBodies-CwL6I1LR.js} +1 -1
  25. package/dist/esm/{WorksheetContents-Dxo5Xc3Y.js → WorksheetContents-AqcyoA6-.js} +1 -1
  26. package/dist/esm/{WorksheetEditor-CvFYzeZC.js → WorksheetEditor-BF8EQVw5.js} +1 -1
  27. package/dist/esm/{WorksheetNode-DgQD3PMR.js → WorksheetNode-vLI23gI5.js} +1 -1
  28. package/dist/esm/{WorksheetViewer-DR45PXUH.js → WorksheetViewer-Dj7ffrAT.js} +1 -1
  29. package/dist/esm/{abnfDiagram-WEYOIA3C-2vvvjt5F.js → abnfDiagram-WEYOIA3C-ZoMqWR68.js} +1 -1
  30. package/dist/esm/{arc-C-pwTbE4.js → arc-D1qQo7Rq.js} +1 -1
  31. package/dist/esm/{architectureDiagram-ZHVYKT53-Njrg16Bb.js → architectureDiagram-ZHVYKT53-DyQfRK7X.js} +1 -1
  32. package/dist/esm/{blockDiagram-RJAE7QA3-OuYPx21T.js → blockDiagram-RJAE7QA3-25yUZ_JH.js} +1 -1
  33. package/dist/esm/{c4Diagram-XDPPPE54-C4-sgPqw.js → c4Diagram-XDPPPE54-Tds8Ecy5.js} +1 -1
  34. package/dist/esm/channel-DYeSxlgx.js +1 -0
  35. package/dist/esm/{chunk-2E7WHVMD-BeozrAac.js → chunk-2E7WHVMD-CrEKxARX.js} +1 -1
  36. package/dist/esm/{chunk-2Q5K7J3B-4_3njuk_.js → chunk-2Q5K7J3B-xxqB63pM.js} +1 -1
  37. package/dist/esm/{chunk-4EMNKR2T-DwE6V67-.js → chunk-4EMNKR2T-DpATbGaG.js} +1 -1
  38. package/dist/esm/{chunk-55XCU76K-CpG64yyk.js → chunk-55XCU76K-B8gXqG-k.js} +1 -1
  39. package/dist/esm/{chunk-5VM5RSS4-CkeQhgn7.js → chunk-5VM5RSS4-ChaTLA5E.js} +1 -1
  40. package/dist/esm/{chunk-JWPE2WC7-CVtFylX6.js → chunk-JWPE2WC7-D8efNL_z.js} +1 -1
  41. package/dist/esm/{chunk-NQOKRVIF-CYlkwWmJ.js → chunk-NQOKRVIF-gVbLpTMV.js} +1 -1
  42. package/dist/esm/{chunk-VQ5W62QI-Be8I4VMn.js → chunk-VQ5W62QI-YnIRgGsh.js} +1 -1
  43. package/dist/esm/{chunk-XXDRQBXY-0jU-YNFU.js → chunk-XXDRQBXY-DyBSx2uJ.js} +1 -1
  44. package/dist/esm/{chunk-ZCHMQSOR-Cwl9AHIQ.js → chunk-ZCHMQSOR-UYQbyi-v.js} +1 -1
  45. package/dist/esm/{classDiagram-v2-4MYWR3UA-CgLXcYDZ.js → classDiagram-v2-4MYWR3UA-PaDxy7Bb.js} +1 -1
  46. package/dist/esm/{cose-bilkent-JH36ORCC-BUYPdwFO.js → cose-bilkent-JH36ORCC-BCLUFgmF.js} +1 -1
  47. package/dist/esm/{cynefinDiagram-WF24UDRP-DFlv0vTF.js → cynefinDiagram-WF24UDRP-Dw54Invm.js} +1 -1
  48. package/dist/esm/{dagre-NK4GIZVX-D3hfxWjC.js → dagre-NK4GIZVX-DszaMPSv.js} +1 -1
  49. package/dist/esm/{diagram-CBK3MWTC-Dz3S8vtv.js → diagram-CBK3MWTC-D3i6P0ln.js} +1 -1
  50. package/dist/esm/{diagram-I5XIIV2D-CWQZNyHk.js → diagram-I5XIIV2D-DEUcJjIJ.js} +1 -1
  51. package/dist/esm/{diagram-ODIL2UCW-RwcoAn2X.js → diagram-ODIL2UCW-DxLnEJOT.js} +1 -1
  52. package/dist/esm/{diagram-PFBEJUXE-BQ65i8Sl.js → diagram-PFBEJUXE-ByMV092C.js} +1 -1
  53. package/dist/esm/{diagram-RJA3I4VV-D3wAXEKx.js → diagram-RJA3I4VV-C84l8Azx.js} +1 -1
  54. package/dist/esm/{diagram-TYUNFSNR-CQpNNmke.js → diagram-TYUNFSNR-BtCvPXJ2.js} +1 -1
  55. package/dist/esm/{ebnfDiagram-V4P3TTPT-x6yeSo0p.js → ebnfDiagram-V4P3TTPT-C2vtqr71.js} +1 -1
  56. package/dist/esm/{elk-QONTBCTQ-BKyCSI5O.js → elk-QONTBCTQ-CJiLNhJN.js} +1 -1
  57. package/dist/esm/{erDiagram-KYQIGQAA-C9n_JA_w.js → erDiagram-KYQIGQAA-COiQX-A9.js} +1 -1
  58. package/dist/esm/{flowDiagram-IUGLLWBU-BS8vlVHT.js → flowDiagram-IUGLLWBU-Bboof2sT.js} +1 -1
  59. package/dist/esm/{ganttDiagram-R7GPNTJY-CKebGhU7.js → ganttDiagram-R7GPNTJY-DplmDkby.js} +1 -1
  60. package/dist/esm/{gitGraphDiagram-PDYL7XHY-Bvp1UcgM.js → gitGraphDiagram-PDYL7XHY-DTPYXyjC.js} +1 -1
  61. package/dist/esm/{index-C2_E6s4y.js → index-BdXh2wq-.js} +1 -1
  62. package/dist/esm/{index-BwpxQGdp.js → index-DjHFXv3v.js} +1 -1
  63. package/dist/esm/{infoDiagram-MVDRKAX5-DrROCapb.js → infoDiagram-MVDRKAX5-B4R01JSI.js} +1 -1
  64. package/dist/esm/{ishikawaDiagram-HPEHV2GE-BGSVKWhg.js → ishikawaDiagram-HPEHV2GE-Dv9Qg5NY.js} +1 -1
  65. package/dist/esm/{journeyDiagram-BOSHW7O7-ogVQbHp2.js → journeyDiagram-BOSHW7O7-Co3cxhxL.js} +1 -1
  66. package/dist/esm/{kanban-definition-FNSA4HC5-lQM4fHQE.js → kanban-definition-FNSA4HC5-q3pjKpqB.js} +1 -1
  67. package/dist/esm/main.js +1 -1
  68. package/dist/esm/{mermaid.core-CvFWfSA0.js → mermaid.core-DErPnTKR.js} +2 -2
  69. package/dist/esm/{mindmap-definition-6OY57UG3-D8l0C3RA.js → mindmap-definition-6OY57UG3-B_LUFop9.js} +1 -1
  70. package/dist/esm/{pegDiagram-ECIUJNBX-D8xo2dyF.js → pegDiagram-ECIUJNBX-DlVeoxxt.js} +1 -1
  71. package/dist/esm/{pieDiagram-GNMPY74T-gHG-R83G.js → pieDiagram-GNMPY74T-BOP-ezbh.js} +1 -1
  72. package/dist/esm/{quadrantDiagram-D57K4MC3-DDHGqMWG.js → quadrantDiagram-D57K4MC3-DMyyReF0.js} +1 -1
  73. package/dist/esm/{railroadDiagram-Y72NRBL7-BNcAWVzf.js → railroadDiagram-Y72NRBL7-Dtk4Z37c.js} +1 -1
  74. package/dist/esm/{requirementDiagram-EQYSW5RA-D0TQZTve.js → requirementDiagram-EQYSW5RA-CiUa5IeO.js} +1 -1
  75. package/dist/esm/{sankeyDiagram-SY24JHO5-BgXxfdaz.js → sankeyDiagram-SY24JHO5-CuTPSkWV.js} +1 -1
  76. package/dist/esm/{sequenceDiagram-BLEHNHQU-BoejQXUR.js → sequenceDiagram-BLEHNHQU-Do3-nvhd.js} +1 -1
  77. package/dist/esm/{sizeCapture-INFHLROL-sNhkxZSt.js → sizeCapture-INFHLROL-C423dcz5.js} +1 -1
  78. package/dist/esm/{stateDiagram-v2-A6IESKWZ-sy3VIzCQ.js → stateDiagram-v2-A6IESKWZ-c4ZBvhhc.js} +1 -1
  79. package/dist/esm/{swimlanes-B3ENRKFQ-BMvTnJVa.js → swimlanes-B3ENRKFQ-zszd6wqm.js} +1 -1
  80. package/dist/esm/{swimlanesDiagram-AYQRV4AK-CBA7l1Zm.js → swimlanesDiagram-AYQRV4AK-BlMvbjy2.js} +1 -1
  81. package/dist/esm/{timeline-definition-JXYKGLGB-B9uS-p90.js → timeline-definition-JXYKGLGB-C0ru0xk2.js} +1 -1
  82. package/dist/esm/{types-CdWZmDRI.js → types-Cb2rrWcY.js} +1 -1
  83. package/dist/esm/{usecaseDiagram-WPOLBNNX-55ERmenj.js → usecaseDiagram-WPOLBNNX-BgdkDQLR.js} +1 -1
  84. package/dist/esm/{vennDiagram-Q3Y3IDCW-M46hCRun.js → vennDiagram-Q3Y3IDCW-BqrOHtxN.js} +1 -1
  85. package/dist/esm/{wardleyDiagram-IVAIDKWA-DiF93Bmd.js → wardleyDiagram-IVAIDKWA-Ci0p6FBo.js} +1 -1
  86. package/dist/esm/{xychartDiagram-4URNHDU4-epgUCY99.js → xychartDiagram-4URNHDU4-zz1Z-rVz.js} +1 -1
  87. package/package.json +1 -1
  88. package/src/styles/components/atoms/_button.scss +6 -1
  89. package/src/styles/components/atoms/_menu.scss +6 -2
  90. package/dist/esm/channel-3HQcLN5a.js +0 -1
@@ -1 +1 @@
1
- import{v as t,x as n,s as e,g as i,b as r,a as s,_ as o,c as a,D as l,k as c,ak as h,C as u,m as f}from"./mermaid.core-CvFWfSA0.js";import{o as y}from"./ordinal-zwWoQKz9.js";import"./index-BwpxQGdp.js";import"react/jsx-runtime";import"react";import"./enums.js";import"./commons-C-9EFvh4.js";import"./settings-DzQM72QE.js";import"./index-Zvckkvpn.js";import"./LoaderLayer-CWElgcGs.js";import"./websocket-KESFarc3.js";import"./index-DpobNvg5.js";import"motion/react";import"react-dom";import"swr";import"@ably/spaces";import"@ably/spaces/react";import"ably";import"ably/liveobjects";import"@ably/spaces/dist/mjs/react";import"./string-DPJhNSkw.js";import"./init-DLRA0X12.js";var d=function(t){for(var n=t.length/6|0,e=new Array(n),i=0;i<n;)e[i]="#"+t.slice(6*i,6*++i);return e}("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function p(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e<n||void 0===e&&n>=n)&&(e=n);else{let i=-1;for(let r of t)null!=(r=n(r,++i,t))&&(e<r||void 0===e&&r>=r)&&(e=r)}return e}function g(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e>n||void 0===e&&n>=n)&&(e=n);else{let i=-1;for(let r of t)null!=(r=n(r,++i,t))&&(e>r||void 0===e&&r>=r)&&(e=r)}return e}function _(t,n){let e=0;if(void 0===n)for(let n of t)(n=+n)&&(e+=n);else{let i=-1;for(let r of t)(r=+n(r,++i,t))&&(e+=r)}return e}function m(t){return t.target.depth}function x(t,n){return t.sourceLinks.length?t.depth:n-1}function k(t){return function(){return t}}function b(t,n){return w(t.source,n.source)||t.index-n.index}function v(t,n){return w(t.target,n.target)||t.index-n.index}function w(t,n){return t.y0-n.y0}function L(t){return t.value}function S(t){return t.index}function E(t){return t.nodes}function A(t){return t.links}function M(t,n){const e=t.get(n);if(!e)throw new Error("missing: "+n);return e}function j({nodes:t}){for(const n of t){let t=n.y0,e=t;for(const e of n.sourceLinks)e.y0=t+e.width/2,t+=e.width;for(const t of n.targetLinks)t.y1=e+t.width/2,e+=t.width}}function I(){let t,n,e,i=0,r=0,s=1,o=1,a=24,l=8,c=S,h=x,u=E,f=A,y=6;function d(){const d={nodes:u.apply(null,arguments),links:f.apply(null,arguments)};return function({nodes:t,links:n}){for(const[n,e]of t.entries())e.index=n,e.sourceLinks=[],e.targetLinks=[];const i=new Map(t.map((n,e)=>[c(n,e,t),n]));for(const[t,e]of n.entries()){e.index=t;let{source:n,target:r}=e;"object"!=typeof n&&(n=e.source=M(i,n)),"object"!=typeof r&&(r=e.target=M(i,r)),n.sourceLinks.push(e),r.targetLinks.push(e)}if(null!=e)for(const{sourceLinks:n,targetLinks:i}of t)n.sort(e),i.sort(e)}(d),function({nodes:t}){for(const n of t)n.value=void 0===n.fixedValue?Math.max(_(n.sourceLinks,L),_(n.targetLinks,L)):n.fixedValue}(d),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,r=0;for(;e.size;){for(const t of e){t.depth=r;for(const{target:n}of t.sourceLinks)i.add(n)}if(++r>n)throw new Error("circular link");e=i,i=new Set}}(d),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,r=0;for(;e.size;){for(const t of e){t.height=r;for(const{source:n}of t.targetLinks)i.add(n)}if(++r>n)throw new Error("circular link");e=i,i=new Set}}(d),function(e){const c=function({nodes:t}){const e=p(t,t=>t.depth)+1,r=(s-i-a)/(e-1),o=new Array(e);for(const n of t){const t=Math.max(0,Math.min(e-1,Math.floor(h.call(null,n,e))));n.layer=t,n.x0=i+t*r,n.x1=n.x0+a,o[t]?o[t].push(n):o[t]=[n]}if(n)for(const t of o)t.sort(n);return o}(e);t=Math.min(l,(o-r)/(p(c,t=>t.length)-1)),function(n){const e=g(n,n=>(o-r-(n.length-1)*t)/_(n,L));for(const i of n){let n=r;for(const r of i){r.y0=n,r.y1=n+r.value*e,n=r.y1+t;for(const t of r.sourceLinks)t.width=t.value*e}n=(o-n+t)/(i.length+1);for(let t=0;t<i.length;++t){const e=i[t];e.y0+=n*(t+1),e.y1+=n*(t+1)}$(i)}}(c);for(let t=0;t<y;++t){const n=Math.pow(.99,t),e=Math.max(1-n,(t+1)/y);I(c,n,e),m(c,n,e)}}(d),j(d),d}function m(t,e,i){for(let r=1,s=t.length;r<s;++r){const s=t[r];for(const t of s){let n=0,i=0;for(const{source:e,value:r}of t.targetLinks){let s=r*(t.layer-e.layer);n+=O(e,t)*s,i+=s}if(!(i>0))continue;let r=(n/i-t.y0)*e;t.y0+=r,t.y1+=r,N(t)}void 0===n&&s.sort(w),T(s,i)}}function I(t,e,i){for(let r=t.length-2;r>=0;--r){const s=t[r];for(const t of s){let n=0,i=0;for(const{target:e,value:r}of t.sourceLinks){let s=r*(e.layer-t.layer);n+=D(t,e)*s,i+=s}if(!(i>0))continue;let r=(n/i-t.y0)*e;t.y0+=r,t.y1+=r,N(t)}void 0===n&&s.sort(w),T(s,i)}}function T(n,e){const i=n.length>>1,s=n[i];P(n,s.y0-t,i-1,e),C(n,s.y1+t,i+1,e),P(n,o,n.length-1,e),C(n,r,0,e)}function C(n,e,i,r){for(;i<n.length;++i){const s=n[i],o=(e-s.y0)*r;o>1e-6&&(s.y0+=o,s.y1+=o),e=s.y1+t}}function P(n,e,i,r){for(;i>=0;--i){const s=n[i],o=(s.y1-e)*r;o>1e-6&&(s.y0-=o,s.y1-=o),e=s.y0-t}}function N({sourceLinks:t,targetLinks:n}){if(void 0===e){for(const{source:{sourceLinks:t}}of n)t.sort(v);for(const{target:{targetLinks:n}}of t)n.sort(b)}}function $(t){if(void 0===e)for(const{sourceLinks:n,targetLinks:e}of t)n.sort(v),e.sort(b)}function O(n,e){let i=n.y0-(n.sourceLinks.length-1)*t/2;for(const{target:r,width:s}of n.sourceLinks){if(r===e)break;i+=s+t}for(const{source:t,width:r}of e.targetLinks){if(t===n)break;i-=r}return i}function D(n,e){let i=e.y0-(e.targetLinks.length-1)*t/2;for(const{source:r,width:s}of e.targetLinks){if(r===n)break;i+=s+t}for(const{target:t,width:r}of n.sourceLinks){if(t===e)break;i-=r}return i}return d.update=function(t){return j(t),t},d.nodeId=function(t){return arguments.length?(c="function"==typeof t?t:k(t),d):c},d.nodeAlign=function(t){return arguments.length?(h="function"==typeof t?t:k(t),d):h},d.nodeSort=function(t){return arguments.length?(n=t,d):n},d.nodeWidth=function(t){return arguments.length?(a=+t,d):a},d.nodePadding=function(n){return arguments.length?(l=t=+n,d):l},d.nodes=function(t){return arguments.length?(u="function"==typeof t?t:k(t),d):u},d.links=function(t){return arguments.length?(f="function"==typeof t?t:k(t),d):f},d.linkSort=function(t){return arguments.length?(e=t,d):e},d.size=function(t){return arguments.length?(i=r=0,s=+t[0],o=+t[1],d):[s-i,o-r]},d.extent=function(t){return arguments.length?(i=+t[0][0],s=+t[1][0],r=+t[0][1],o=+t[1][1],d):[[i,r],[s,o]]},d.iterations=function(t){return arguments.length?(y=+t,d):y},d}var T=Math.PI,C=2*T,P=1e-6,N=C-P;function $(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function O(){return new $}function D(t){return function(){return t}}function z(t){return t[0]}function F(t){return t[1]}$.prototype=O.prototype={constructor:$,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,e,i){this._+="Q"+ +t+","+ +n+","+(this._x1=+e)+","+(this._y1=+i)},bezierCurveTo:function(t,n,e,i,r,s){this._+="C"+ +t+","+ +n+","+ +e+","+ +i+","+(this._x1=+r)+","+(this._y1=+s)},arcTo:function(t,n,e,i,r){t=+t,n=+n,e=+e,i=+i,r=+r;var s=this._x1,o=this._y1,a=e-t,l=i-n,c=s-t,h=o-n,u=c*c+h*h;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(u>P)if(Math.abs(h*a-l*c)>P&&r){var f=e-s,y=i-o,d=a*a+l*l,p=f*f+y*y,g=Math.sqrt(d),_=Math.sqrt(u),m=r*Math.tan((T-Math.acos((d+u-p)/(2*g*_)))/2),x=m/_,k=m/g;Math.abs(x-1)>P&&(this._+="L"+(t+x*c)+","+(n+x*h)),this._+="A"+r+","+r+",0,0,"+ +(h*f>c*y)+","+(this._x1=t+k*a)+","+(this._y1=n+k*l)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,i,r,s){t=+t,n=+n,s=!!s;var o=(e=+e)*Math.cos(i),a=e*Math.sin(i),l=t+o,c=n+a,h=1^s,u=s?i-r:r-i;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>P||Math.abs(this._y1-c)>P)&&(this._+="L"+l+","+c),e&&(u<0&&(u=u%C+C),u>N?this._+="A"+e+","+e+",0,1,"+h+","+(t-o)+","+(n-a)+"A"+e+","+e+",0,1,"+h+","+(this._x1=l)+","+(this._y1=c):u>P&&(this._+="A"+e+","+e+",0,"+ +(u>=T)+","+h+","+(this._x1=t+e*Math.cos(r))+","+(this._y1=n+e*Math.sin(r))))},rect:function(t,n,e,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +i+"h"+-e+"Z"},toString:function(){return this._}};var W=Array.prototype.slice;function U(t){return t.source}function G(t){return t.target}function V(t,n,e,i,r){t.moveTo(n,e),t.bezierCurveTo(n=(n+i)/2,e,n,r,i,r)}function X(){return function(t){var n=U,e=G,i=z,r=F,s=null;function o(){var o,a=W.call(arguments),l=n.apply(this,a),c=e.apply(this,a);if(s||(s=o=O()),t(s,+i.apply(this,(a[0]=l,a)),+r.apply(this,a),+i.apply(this,(a[0]=c,a)),+r.apply(this,a)),o)return s=null,o+""||null}return o.source=function(t){return arguments.length?(n=t,o):n},o.target=function(t){return arguments.length?(e=t,o):e},o.x=function(t){return arguments.length?(i="function"==typeof t?t:D(+t),o):i},o.y=function(t){return arguments.length?(r="function"==typeof t?t:D(+t),o):r},o.context=function(t){return arguments.length?(s=null==t?null:t,o):s},o}(V)}function q(t){return[t.source.x1,t.y0]}function B(t){return[t.target.x0,t.y1]}var Q=function(){var t=o(function(t,n,e,i){for(e=e||{},i=t.length;i--;e[t[i]]=n);return e},"o"),n=[1,9],e=[1,10],i=[1,5,10,12],r={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:o(function(t,n,e,i,r,s,o){var a=s.length-1;switch(r){case 7:const t=i.findOrCreateNode(s[a-4].trim().replaceAll('""','"')),n=i.findOrCreateNode(s[a-2].trim().replaceAll('""','"')),e=parseFloat(s[a].trim());i.addLink(t,n,e);break;case 8:case 9:case 11:this.$=s[a];break;case 10:this.$=s[a-1]}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:e},{1:[2,6],7:11,10:[1,12]},t(e,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(i,[2,8]),t(i,[2,9]),{19:[1,16]},t(i,[2,11]),{1:[2,1]},{1:[2,5]},t(e,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:e},{15:18,16:7,17:8,18:n,20:e},{18:[1,19]},t(e,[2,3]),{12:[1,20]},t(i,[2,10]),{15:21,16:7,17:8,18:n,20:e},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:o(function(t,n){if(!n.recoverable){var e=new Error(t);throw e.hash=n,e}this.trace(t)},"parseError"),parse:o(function(t){var n=this,e=[0],i=[],r=[null],s=[],a=this.table,l="",c=0,h=0,u=s.slice.call(arguments,1),f=Object.create(this.lexer),y={yy:{}};for(var d in this.yy)Object.prototype.hasOwnProperty.call(this.yy,d)&&(y.yy[d]=this.yy[d]);f.setInput(t,y.yy),y.yy.lexer=f,y.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var p=f.yylloc;s.push(p);var g=f.options&&f.options.ranges;function _(){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 y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(function(t){e.length=e.length-2*t,r.length=r.length-t,s.length=s.length-t},"popStack"),o(_,"lex");for(var m,x,k,b,v,w,L,S,E={};;){if(x=e[e.length-1],this.defaultActions[x]?k=this.defaultActions[x]:(null==m&&(m=_()),k=a[x]&&a[x][m]),void 0===k||!k.length||!k[0]){var A="";for(v in S=[],a[x])this.terminals_[v]&&v>2&&S.push("'"+this.terminals_[v]+"'");A=f.showPosition?"Parse error on line "+(c+1)+":\n"+f.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(A,{text:f.match,token:this.terminals_[m]||m,line:f.yylineno,loc:p,expected:S})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+m);switch(k[0]){case 1:e.push(m),r.push(f.yytext),s.push(f.yylloc),e.push(k[1]),m=null,h=f.yyleng,l=f.yytext,c=f.yylineno,p=f.yylloc;break;case 2:if(w=this.productions_[k[1]][1],E.$=r[r.length-w],E._$={first_line:s[s.length-(w||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(w||1)].first_column,last_column:s[s.length-1].last_column},g&&(E._$.range=[s[s.length-(w||1)].range[0],s[s.length-1].range[1]]),void 0!==(b=this.performAction.apply(E,[l,h,c,y.yy,k[1],r,s].concat(u))))return b;w&&(e=e.slice(0,-1*w*2),r=r.slice(0,-1*w),s=s.slice(0,-1*w)),e.push(this.productions_[k[1]][0]),r.push(E.$),s.push(E._$),L=a[e[e.length-2]][e[e.length-1]],e.push(L);break;case 3:return!0}}return!0},"parse")},s=function(){return{EOF:1,parseError:o(function(t,n){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,n)},"parseError"),setInput:o(function(t,n){return this.yy=n||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];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:o(function(t){var n=t.length,e=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;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),e.length-1&&(this.yylineno-=e.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:e?(e.length===i.length?this.yylloc.first_column:0)+i[i.length-e.length].length-e[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(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:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),n=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+n+"^"},"showPosition"),test_match:o(function(t,n){var e,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],e=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;var t,n,e,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((e=this._input.match(this.rules[r[s]]))&&(!n||e[0].length>n[0].length)){if(n=e,i=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(e,r[s])))return t;if(this._backtrack){n=!1;continue}return!1}if(!this.options.flex)break}return n?!1!==(t=this.test_match(n,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:o(function(){var t=this.next();return t||this.lex()},"lex"),begin:o(function(t){this.conditionStack.push(t)},"begin"),popState:o(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(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:o(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:o(function(t){this.begin(t)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(t,n,e,i){switch(e){case 0:case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}}}();function a(){this.yy={}}return r.lexer=s,o(a,"Parser"),a.prototype=r,r.Parser=a,new a}();Q.parser=Q;var R=Q,Y=[],K=[],Z=new Map,H=o(()=>{Y=[],K=[],Z=new Map,u()},"clear"),J=class{constructor(t,n,e=0){this.source=t,this.target=n,this.value=e}static{o(this,"SankeyLink")}},tt=o((t,n,e)=>{Y.push(new J(t,n,e))},"addLink"),nt=class{constructor(t){this.ID=t}static{o(this,"SankeyNode")}},et=o(t=>{t=f.sanitizeText(t,a());let n=Z.get(t);return void 0===n&&(n=new nt(t),Z.set(t,n),K.push(n)),n},"findOrCreateNode"),it=o(()=>K,"getNodes"),rt=o(()=>Y,"getLinks"),st=o(()=>({nodes:K.map(t=>({id:t.ID})),links:Y.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),ot={nodesMap:Z,getConfig:o(()=>a().sankey,"getConfig"),getNodes:it,getLinks:rt,getGraph:st,addLink:tt,findOrCreateNode:et,getAccTitle:s,setAccTitle:r,getAccDescription:i,setAccDescription:e,getDiagramTitle:n,setDiagramTitle:t,clear:H},at=class t{static{o(this,"Uid")}static{this.count=0}static next(n){return new t(n+ ++t.count)}constructor(t){this.id=t,this.href=`#${t}`}toString(){return"url("+this.href+")"}},lt={left:function(t){return t.depth},right:function(t,n){return n-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?g(t.sourceLinks,m)-1:0},justify:x},ct=o(t=>{let n=0,e=0;for(const i of t){const t=i.value??0;t>n&&(n=t,e=i.layer??0)}return e},"findCentralNodeLayer"),ht=o(function(t,n,e,i){const{securityLevel:r,sankey:s}=a(),u=l.sankey;let f;"sandbox"===r&&(f=c("#i"+n));const p=c("sandbox"===r?f.nodes()[0].contentDocument.body:"body"),g="sandbox"===r?p.select(`[id="${n}"]`):c(`[id="${n}"]`),_=s?.width??u.width,m=s?.height??u.width,x=s?.useMaxWidth??u.useMaxWidth,k=s?.nodeAlignment??u.nodeAlignment,b=s?.prefix??u.prefix,v=s?.suffix??u.suffix,w=s?.showValues??u.showValues,L=s?.nodeWidth??u.nodeWidth??10,S=s?.nodePadding??u.nodePadding??12,E=s?.labelStyle??u.labelStyle??"legacy",A=s?.nodeColors??{},M=i.db.getGraph(),j=lt[k];I().nodeId(t=>t.id).nodeWidth(L).nodePadding(S+(w?15:0)).nodeAlign(j).extent([[0,0],[_,m]])(M);const T=ct(M.nodes),C=y(d),P=o(t=>A[t]??C(t),"getNodeColor");g.append("g").attr("class","nodes").selectAll(".node").data(M.nodes).join("g").attr("class","node").attr("id",t=>(t.uid=at.next("node-")).id).attr("transform",function(t){return"translate("+t.x0+","+t.y0+")"}).attr("x",t=>t.x0).attr("y",t=>t.y0).append("rect").attr("height",t=>t.y1-t.y0).attr("width",t=>t.x1-t.x0).attr("fill",t=>P(t.id));const N=o(({id:t,value:n})=>w?`${t}\n${b}${Math.round(100*n)/100}${v}`:t,"getText"),$=o(t=>{if("outlined"===E){return(t.layer??0)<T?{x:t.x0-6,anchor:"end"}:{x:t.x1+6,anchor:"start"}}return t.x0<_/2?{x:t.x1+6,anchor:"start"}:{x:t.x0-6,anchor:"end"}},"getLabelPosition"),O=g.append("g").attr("class","node-labels").attr("font-size",14),D=o(t=>O.selectAll(t?`.${t}`:"text").data(M.nodes).join("text").attr("class",t??null).attr("x",t=>$(t).x).attr("y",t=>(t.y1+t.y0)/2).attr("dy",(w?"0":"0.35")+"em").attr("text-anchor",t=>$(t).anchor).text(N),"appendLabel");"outlined"===E?(D("sankey-label-bg"),D("sankey-label-fg")):D();const z=g.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(M.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),F=s?.linkColor??"gradient";if("gradient"===F){const t=z.append("linearGradient").attr("id",t=>(t.uid=at.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",t=>t.source.x1).attr("x2",t=>t.target.x0);t.append("stop").attr("offset","0%").attr("stop-color",t=>P(t.source.id)),t.append("stop").attr("offset","100%").attr("stop-color",t=>P(t.target.id))}let W;switch(F){case"gradient":W=o(t=>t.uid,"coloring");break;case"source":W=o(t=>P(t.source.id),"coloring");break;case"target":W=o(t=>P(t.target.id),"coloring");break;default:W=F}z.append("path").attr("d",X().source(q).target(B)).attr("stroke",W).attr("stroke-width",t=>Math.max(1,t.width)),h(void 0,g,0,x)},"draw"),ut={draw:ht},ft=o(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,"\n").trim(),"prepareTextForParsing"),yt=o(t=>`.label {\n font-family: ${t.fontFamily};\n }\n\n .node-labels {\n font-family: ${t.fontFamily};\n }\n\n /* Outlined label style - background stroke for better readability */\n .sankey-label-bg {\n stroke: ${t.mainBkg||t.background||"#fff"};\n stroke-width: 4px;\n stroke-linejoin: round;\n paint-order: stroke;\n }\n\n /* Foreground label text */\n .sankey-label-fg {\n fill: ${t.textColor};\n }\n\n /* Node styling */\n .node rect {\n shape-rendering: crispEdges;\n }\n\n /* Link styling */\n .link {\n fill: none;\n stroke-opacity: 0.5;\n mix-blend-mode: multiply;\n }\n`,"getStyles"),dt=R.parse.bind(R);R.parse=t=>dt(ft(t));var pt={styles:yt,parser:R,db:ot,renderer:ut};export{pt as diagram};
1
+ import{v as t,x as n,s as e,g as i,b as r,a as s,_ as o,c as a,D as l,k as c,ak as h,C as u,m as f}from"./mermaid.core-DErPnTKR.js";import{o as y}from"./ordinal-zwWoQKz9.js";import"./index-DjHFXv3v.js";import"react/jsx-runtime";import"react";import"./enums.js";import"./commons-C-9EFvh4.js";import"./settings-DzQM72QE.js";import"./index-Zvckkvpn.js";import"./LoaderLayer-CWElgcGs.js";import"./websocket-KESFarc3.js";import"./index-DpobNvg5.js";import"motion/react";import"react-dom";import"swr";import"@ably/spaces";import"@ably/spaces/react";import"ably";import"ably/liveobjects";import"@ably/spaces/dist/mjs/react";import"./string-DPJhNSkw.js";import"./init-DLRA0X12.js";var d=function(t){for(var n=t.length/6|0,e=new Array(n),i=0;i<n;)e[i]="#"+t.slice(6*i,6*++i);return e}("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function p(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e<n||void 0===e&&n>=n)&&(e=n);else{let i=-1;for(let r of t)null!=(r=n(r,++i,t))&&(e<r||void 0===e&&r>=r)&&(e=r)}return e}function g(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e>n||void 0===e&&n>=n)&&(e=n);else{let i=-1;for(let r of t)null!=(r=n(r,++i,t))&&(e>r||void 0===e&&r>=r)&&(e=r)}return e}function _(t,n){let e=0;if(void 0===n)for(let n of t)(n=+n)&&(e+=n);else{let i=-1;for(let r of t)(r=+n(r,++i,t))&&(e+=r)}return e}function m(t){return t.target.depth}function x(t,n){return t.sourceLinks.length?t.depth:n-1}function k(t){return function(){return t}}function b(t,n){return w(t.source,n.source)||t.index-n.index}function v(t,n){return w(t.target,n.target)||t.index-n.index}function w(t,n){return t.y0-n.y0}function L(t){return t.value}function S(t){return t.index}function E(t){return t.nodes}function A(t){return t.links}function M(t,n){const e=t.get(n);if(!e)throw new Error("missing: "+n);return e}function j({nodes:t}){for(const n of t){let t=n.y0,e=t;for(const e of n.sourceLinks)e.y0=t+e.width/2,t+=e.width;for(const t of n.targetLinks)t.y1=e+t.width/2,e+=t.width}}function I(){let t,n,e,i=0,r=0,s=1,o=1,a=24,l=8,c=S,h=x,u=E,f=A,y=6;function d(){const d={nodes:u.apply(null,arguments),links:f.apply(null,arguments)};return function({nodes:t,links:n}){for(const[n,e]of t.entries())e.index=n,e.sourceLinks=[],e.targetLinks=[];const i=new Map(t.map((n,e)=>[c(n,e,t),n]));for(const[t,e]of n.entries()){e.index=t;let{source:n,target:r}=e;"object"!=typeof n&&(n=e.source=M(i,n)),"object"!=typeof r&&(r=e.target=M(i,r)),n.sourceLinks.push(e),r.targetLinks.push(e)}if(null!=e)for(const{sourceLinks:n,targetLinks:i}of t)n.sort(e),i.sort(e)}(d),function({nodes:t}){for(const n of t)n.value=void 0===n.fixedValue?Math.max(_(n.sourceLinks,L),_(n.targetLinks,L)):n.fixedValue}(d),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,r=0;for(;e.size;){for(const t of e){t.depth=r;for(const{target:n}of t.sourceLinks)i.add(n)}if(++r>n)throw new Error("circular link");e=i,i=new Set}}(d),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,r=0;for(;e.size;){for(const t of e){t.height=r;for(const{source:n}of t.targetLinks)i.add(n)}if(++r>n)throw new Error("circular link");e=i,i=new Set}}(d),function(e){const c=function({nodes:t}){const e=p(t,t=>t.depth)+1,r=(s-i-a)/(e-1),o=new Array(e);for(const n of t){const t=Math.max(0,Math.min(e-1,Math.floor(h.call(null,n,e))));n.layer=t,n.x0=i+t*r,n.x1=n.x0+a,o[t]?o[t].push(n):o[t]=[n]}if(n)for(const t of o)t.sort(n);return o}(e);t=Math.min(l,(o-r)/(p(c,t=>t.length)-1)),function(n){const e=g(n,n=>(o-r-(n.length-1)*t)/_(n,L));for(const i of n){let n=r;for(const r of i){r.y0=n,r.y1=n+r.value*e,n=r.y1+t;for(const t of r.sourceLinks)t.width=t.value*e}n=(o-n+t)/(i.length+1);for(let t=0;t<i.length;++t){const e=i[t];e.y0+=n*(t+1),e.y1+=n*(t+1)}$(i)}}(c);for(let t=0;t<y;++t){const n=Math.pow(.99,t),e=Math.max(1-n,(t+1)/y);I(c,n,e),m(c,n,e)}}(d),j(d),d}function m(t,e,i){for(let r=1,s=t.length;r<s;++r){const s=t[r];for(const t of s){let n=0,i=0;for(const{source:e,value:r}of t.targetLinks){let s=r*(t.layer-e.layer);n+=O(e,t)*s,i+=s}if(!(i>0))continue;let r=(n/i-t.y0)*e;t.y0+=r,t.y1+=r,N(t)}void 0===n&&s.sort(w),T(s,i)}}function I(t,e,i){for(let r=t.length-2;r>=0;--r){const s=t[r];for(const t of s){let n=0,i=0;for(const{target:e,value:r}of t.sourceLinks){let s=r*(e.layer-t.layer);n+=D(t,e)*s,i+=s}if(!(i>0))continue;let r=(n/i-t.y0)*e;t.y0+=r,t.y1+=r,N(t)}void 0===n&&s.sort(w),T(s,i)}}function T(n,e){const i=n.length>>1,s=n[i];P(n,s.y0-t,i-1,e),C(n,s.y1+t,i+1,e),P(n,o,n.length-1,e),C(n,r,0,e)}function C(n,e,i,r){for(;i<n.length;++i){const s=n[i],o=(e-s.y0)*r;o>1e-6&&(s.y0+=o,s.y1+=o),e=s.y1+t}}function P(n,e,i,r){for(;i>=0;--i){const s=n[i],o=(s.y1-e)*r;o>1e-6&&(s.y0-=o,s.y1-=o),e=s.y0-t}}function N({sourceLinks:t,targetLinks:n}){if(void 0===e){for(const{source:{sourceLinks:t}}of n)t.sort(v);for(const{target:{targetLinks:n}}of t)n.sort(b)}}function $(t){if(void 0===e)for(const{sourceLinks:n,targetLinks:e}of t)n.sort(v),e.sort(b)}function O(n,e){let i=n.y0-(n.sourceLinks.length-1)*t/2;for(const{target:r,width:s}of n.sourceLinks){if(r===e)break;i+=s+t}for(const{source:t,width:r}of e.targetLinks){if(t===n)break;i-=r}return i}function D(n,e){let i=e.y0-(e.targetLinks.length-1)*t/2;for(const{source:r,width:s}of e.targetLinks){if(r===n)break;i+=s+t}for(const{target:t,width:r}of n.sourceLinks){if(t===e)break;i-=r}return i}return d.update=function(t){return j(t),t},d.nodeId=function(t){return arguments.length?(c="function"==typeof t?t:k(t),d):c},d.nodeAlign=function(t){return arguments.length?(h="function"==typeof t?t:k(t),d):h},d.nodeSort=function(t){return arguments.length?(n=t,d):n},d.nodeWidth=function(t){return arguments.length?(a=+t,d):a},d.nodePadding=function(n){return arguments.length?(l=t=+n,d):l},d.nodes=function(t){return arguments.length?(u="function"==typeof t?t:k(t),d):u},d.links=function(t){return arguments.length?(f="function"==typeof t?t:k(t),d):f},d.linkSort=function(t){return arguments.length?(e=t,d):e},d.size=function(t){return arguments.length?(i=r=0,s=+t[0],o=+t[1],d):[s-i,o-r]},d.extent=function(t){return arguments.length?(i=+t[0][0],s=+t[1][0],r=+t[0][1],o=+t[1][1],d):[[i,r],[s,o]]},d.iterations=function(t){return arguments.length?(y=+t,d):y},d}var T=Math.PI,C=2*T,P=1e-6,N=C-P;function $(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function O(){return new $}function D(t){return function(){return t}}function z(t){return t[0]}function F(t){return t[1]}$.prototype=O.prototype={constructor:$,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,e,i){this._+="Q"+ +t+","+ +n+","+(this._x1=+e)+","+(this._y1=+i)},bezierCurveTo:function(t,n,e,i,r,s){this._+="C"+ +t+","+ +n+","+ +e+","+ +i+","+(this._x1=+r)+","+(this._y1=+s)},arcTo:function(t,n,e,i,r){t=+t,n=+n,e=+e,i=+i,r=+r;var s=this._x1,o=this._y1,a=e-t,l=i-n,c=s-t,h=o-n,u=c*c+h*h;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(u>P)if(Math.abs(h*a-l*c)>P&&r){var f=e-s,y=i-o,d=a*a+l*l,p=f*f+y*y,g=Math.sqrt(d),_=Math.sqrt(u),m=r*Math.tan((T-Math.acos((d+u-p)/(2*g*_)))/2),x=m/_,k=m/g;Math.abs(x-1)>P&&(this._+="L"+(t+x*c)+","+(n+x*h)),this._+="A"+r+","+r+",0,0,"+ +(h*f>c*y)+","+(this._x1=t+k*a)+","+(this._y1=n+k*l)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,i,r,s){t=+t,n=+n,s=!!s;var o=(e=+e)*Math.cos(i),a=e*Math.sin(i),l=t+o,c=n+a,h=1^s,u=s?i-r:r-i;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>P||Math.abs(this._y1-c)>P)&&(this._+="L"+l+","+c),e&&(u<0&&(u=u%C+C),u>N?this._+="A"+e+","+e+",0,1,"+h+","+(t-o)+","+(n-a)+"A"+e+","+e+",0,1,"+h+","+(this._x1=l)+","+(this._y1=c):u>P&&(this._+="A"+e+","+e+",0,"+ +(u>=T)+","+h+","+(this._x1=t+e*Math.cos(r))+","+(this._y1=n+e*Math.sin(r))))},rect:function(t,n,e,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +i+"h"+-e+"Z"},toString:function(){return this._}};var W=Array.prototype.slice;function U(t){return t.source}function G(t){return t.target}function V(t,n,e,i,r){t.moveTo(n,e),t.bezierCurveTo(n=(n+i)/2,e,n,r,i,r)}function X(){return function(t){var n=U,e=G,i=z,r=F,s=null;function o(){var o,a=W.call(arguments),l=n.apply(this,a),c=e.apply(this,a);if(s||(s=o=O()),t(s,+i.apply(this,(a[0]=l,a)),+r.apply(this,a),+i.apply(this,(a[0]=c,a)),+r.apply(this,a)),o)return s=null,o+""||null}return o.source=function(t){return arguments.length?(n=t,o):n},o.target=function(t){return arguments.length?(e=t,o):e},o.x=function(t){return arguments.length?(i="function"==typeof t?t:D(+t),o):i},o.y=function(t){return arguments.length?(r="function"==typeof t?t:D(+t),o):r},o.context=function(t){return arguments.length?(s=null==t?null:t,o):s},o}(V)}function q(t){return[t.source.x1,t.y0]}function B(t){return[t.target.x0,t.y1]}var Q=function(){var t=o(function(t,n,e,i){for(e=e||{},i=t.length;i--;e[t[i]]=n);return e},"o"),n=[1,9],e=[1,10],i=[1,5,10,12],r={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:o(function(t,n,e,i,r,s,o){var a=s.length-1;switch(r){case 7:const t=i.findOrCreateNode(s[a-4].trim().replaceAll('""','"')),n=i.findOrCreateNode(s[a-2].trim().replaceAll('""','"')),e=parseFloat(s[a].trim());i.addLink(t,n,e);break;case 8:case 9:case 11:this.$=s[a];break;case 10:this.$=s[a-1]}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:e},{1:[2,6],7:11,10:[1,12]},t(e,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(i,[2,8]),t(i,[2,9]),{19:[1,16]},t(i,[2,11]),{1:[2,1]},{1:[2,5]},t(e,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:e},{15:18,16:7,17:8,18:n,20:e},{18:[1,19]},t(e,[2,3]),{12:[1,20]},t(i,[2,10]),{15:21,16:7,17:8,18:n,20:e},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:o(function(t,n){if(!n.recoverable){var e=new Error(t);throw e.hash=n,e}this.trace(t)},"parseError"),parse:o(function(t){var n=this,e=[0],i=[],r=[null],s=[],a=this.table,l="",c=0,h=0,u=s.slice.call(arguments,1),f=Object.create(this.lexer),y={yy:{}};for(var d in this.yy)Object.prototype.hasOwnProperty.call(this.yy,d)&&(y.yy[d]=this.yy[d]);f.setInput(t,y.yy),y.yy.lexer=f,y.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var p=f.yylloc;s.push(p);var g=f.options&&f.options.ranges;function _(){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 y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(function(t){e.length=e.length-2*t,r.length=r.length-t,s.length=s.length-t},"popStack"),o(_,"lex");for(var m,x,k,b,v,w,L,S,E={};;){if(x=e[e.length-1],this.defaultActions[x]?k=this.defaultActions[x]:(null==m&&(m=_()),k=a[x]&&a[x][m]),void 0===k||!k.length||!k[0]){var A="";for(v in S=[],a[x])this.terminals_[v]&&v>2&&S.push("'"+this.terminals_[v]+"'");A=f.showPosition?"Parse error on line "+(c+1)+":\n"+f.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(A,{text:f.match,token:this.terminals_[m]||m,line:f.yylineno,loc:p,expected:S})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+m);switch(k[0]){case 1:e.push(m),r.push(f.yytext),s.push(f.yylloc),e.push(k[1]),m=null,h=f.yyleng,l=f.yytext,c=f.yylineno,p=f.yylloc;break;case 2:if(w=this.productions_[k[1]][1],E.$=r[r.length-w],E._$={first_line:s[s.length-(w||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(w||1)].first_column,last_column:s[s.length-1].last_column},g&&(E._$.range=[s[s.length-(w||1)].range[0],s[s.length-1].range[1]]),void 0!==(b=this.performAction.apply(E,[l,h,c,y.yy,k[1],r,s].concat(u))))return b;w&&(e=e.slice(0,-1*w*2),r=r.slice(0,-1*w),s=s.slice(0,-1*w)),e.push(this.productions_[k[1]][0]),r.push(E.$),s.push(E._$),L=a[e[e.length-2]][e[e.length-1]],e.push(L);break;case 3:return!0}}return!0},"parse")},s=function(){return{EOF:1,parseError:o(function(t,n){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,n)},"parseError"),setInput:o(function(t,n){return this.yy=n||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];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:o(function(t){var n=t.length,e=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;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),e.length-1&&(this.yylineno-=e.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:e?(e.length===i.length?this.yylloc.first_column:0)+i[i.length-e.length].length-e[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(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:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),n=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+n+"^"},"showPosition"),test_match:o(function(t,n){var e,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],e=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;var t,n,e,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((e=this._input.match(this.rules[r[s]]))&&(!n||e[0].length>n[0].length)){if(n=e,i=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(e,r[s])))return t;if(this._backtrack){n=!1;continue}return!1}if(!this.options.flex)break}return n?!1!==(t=this.test_match(n,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:o(function(){var t=this.next();return t||this.lex()},"lex"),begin:o(function(t){this.conditionStack.push(t)},"begin"),popState:o(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(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:o(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:o(function(t){this.begin(t)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(t,n,e,i){switch(e){case 0:case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}}}();function a(){this.yy={}}return r.lexer=s,o(a,"Parser"),a.prototype=r,r.Parser=a,new a}();Q.parser=Q;var R=Q,Y=[],K=[],Z=new Map,H=o(()=>{Y=[],K=[],Z=new Map,u()},"clear"),J=class{constructor(t,n,e=0){this.source=t,this.target=n,this.value=e}static{o(this,"SankeyLink")}},tt=o((t,n,e)=>{Y.push(new J(t,n,e))},"addLink"),nt=class{constructor(t){this.ID=t}static{o(this,"SankeyNode")}},et=o(t=>{t=f.sanitizeText(t,a());let n=Z.get(t);return void 0===n&&(n=new nt(t),Z.set(t,n),K.push(n)),n},"findOrCreateNode"),it=o(()=>K,"getNodes"),rt=o(()=>Y,"getLinks"),st=o(()=>({nodes:K.map(t=>({id:t.ID})),links:Y.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),ot={nodesMap:Z,getConfig:o(()=>a().sankey,"getConfig"),getNodes:it,getLinks:rt,getGraph:st,addLink:tt,findOrCreateNode:et,getAccTitle:s,setAccTitle:r,getAccDescription:i,setAccDescription:e,getDiagramTitle:n,setDiagramTitle:t,clear:H},at=class t{static{o(this,"Uid")}static{this.count=0}static next(n){return new t(n+ ++t.count)}constructor(t){this.id=t,this.href=`#${t}`}toString(){return"url("+this.href+")"}},lt={left:function(t){return t.depth},right:function(t,n){return n-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?g(t.sourceLinks,m)-1:0},justify:x},ct=o(t=>{let n=0,e=0;for(const i of t){const t=i.value??0;t>n&&(n=t,e=i.layer??0)}return e},"findCentralNodeLayer"),ht=o(function(t,n,e,i){const{securityLevel:r,sankey:s}=a(),u=l.sankey;let f;"sandbox"===r&&(f=c("#i"+n));const p=c("sandbox"===r?f.nodes()[0].contentDocument.body:"body"),g="sandbox"===r?p.select(`[id="${n}"]`):c(`[id="${n}"]`),_=s?.width??u.width,m=s?.height??u.width,x=s?.useMaxWidth??u.useMaxWidth,k=s?.nodeAlignment??u.nodeAlignment,b=s?.prefix??u.prefix,v=s?.suffix??u.suffix,w=s?.showValues??u.showValues,L=s?.nodeWidth??u.nodeWidth??10,S=s?.nodePadding??u.nodePadding??12,E=s?.labelStyle??u.labelStyle??"legacy",A=s?.nodeColors??{},M=i.db.getGraph(),j=lt[k];I().nodeId(t=>t.id).nodeWidth(L).nodePadding(S+(w?15:0)).nodeAlign(j).extent([[0,0],[_,m]])(M);const T=ct(M.nodes),C=y(d),P=o(t=>A[t]??C(t),"getNodeColor");g.append("g").attr("class","nodes").selectAll(".node").data(M.nodes).join("g").attr("class","node").attr("id",t=>(t.uid=at.next("node-")).id).attr("transform",function(t){return"translate("+t.x0+","+t.y0+")"}).attr("x",t=>t.x0).attr("y",t=>t.y0).append("rect").attr("height",t=>t.y1-t.y0).attr("width",t=>t.x1-t.x0).attr("fill",t=>P(t.id));const N=o(({id:t,value:n})=>w?`${t}\n${b}${Math.round(100*n)/100}${v}`:t,"getText"),$=o(t=>{if("outlined"===E){return(t.layer??0)<T?{x:t.x0-6,anchor:"end"}:{x:t.x1+6,anchor:"start"}}return t.x0<_/2?{x:t.x1+6,anchor:"start"}:{x:t.x0-6,anchor:"end"}},"getLabelPosition"),O=g.append("g").attr("class","node-labels").attr("font-size",14),D=o(t=>O.selectAll(t?`.${t}`:"text").data(M.nodes).join("text").attr("class",t??null).attr("x",t=>$(t).x).attr("y",t=>(t.y1+t.y0)/2).attr("dy",(w?"0":"0.35")+"em").attr("text-anchor",t=>$(t).anchor).text(N),"appendLabel");"outlined"===E?(D("sankey-label-bg"),D("sankey-label-fg")):D();const z=g.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(M.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),F=s?.linkColor??"gradient";if("gradient"===F){const t=z.append("linearGradient").attr("id",t=>(t.uid=at.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",t=>t.source.x1).attr("x2",t=>t.target.x0);t.append("stop").attr("offset","0%").attr("stop-color",t=>P(t.source.id)),t.append("stop").attr("offset","100%").attr("stop-color",t=>P(t.target.id))}let W;switch(F){case"gradient":W=o(t=>t.uid,"coloring");break;case"source":W=o(t=>P(t.source.id),"coloring");break;case"target":W=o(t=>P(t.target.id),"coloring");break;default:W=F}z.append("path").attr("d",X().source(q).target(B)).attr("stroke",W).attr("stroke-width",t=>Math.max(1,t.width)),h(void 0,g,0,x)},"draw"),ut={draw:ht},ft=o(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,"\n").trim(),"prepareTextForParsing"),yt=o(t=>`.label {\n font-family: ${t.fontFamily};\n }\n\n .node-labels {\n font-family: ${t.fontFamily};\n }\n\n /* Outlined label style - background stroke for better readability */\n .sankey-label-bg {\n stroke: ${t.mainBkg||t.background||"#fff"};\n stroke-width: 4px;\n stroke-linejoin: round;\n paint-order: stroke;\n }\n\n /* Foreground label text */\n .sankey-label-fg {\n fill: ${t.textColor};\n }\n\n /* Node styling */\n .node rect {\n shape-rendering: crispEdges;\n }\n\n /* Link styling */\n .link {\n fill: none;\n stroke-opacity: 0.5;\n mix-blend-mode: multiply;\n }\n`,"getStyles"),dt=R.parse.bind(R);R.parse=t=>dt(ft(t));var pt={styles:yt,parser:R,db:ot,renderer:ut};export{pt as diagram};