@hienlh/ppm 0.9.6 → 0.9.7

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 (108) hide show
  1. package/.claude.bak/agent-memory/tester/MEMORY.md +3 -0
  2. package/.claude.bak/agent-memory/tester/project-ppm-test-conventions.md +32 -0
  3. package/CHANGELOG.md +12 -0
  4. package/bun.lock +129 -7
  5. package/dist/web/assets/{architectureDiagram-2XIMDMQ5-Z-4eN4za.js → architectureDiagram-2XIMDMQ5-DWBCPMLF.js} +1 -1
  6. package/dist/web/assets/{blockDiagram-WCTKOSBZ-BCLqzhuZ.js → blockDiagram-WCTKOSBZ-TEF8Ally.js} +1 -1
  7. package/dist/web/assets/browser-tab-ZjPyWngv.js +1 -0
  8. package/dist/web/assets/{c4Diagram-IC4MRINW-0Vp0Jeas.js → c4Diagram-IC4MRINW-dV22iAsY.js} +1 -1
  9. package/dist/web/assets/channel-wrd-NHWf.js +1 -0
  10. package/dist/web/assets/chat-tab-DPFg4Mec.js +8 -0
  11. package/dist/web/assets/{chunk-7R4GIKGN-Dv-4cAYn.js → chunk-7R4GIKGN-BbIFzsIv.js} +1 -1
  12. package/dist/web/assets/{chunk-GEFDOKGD-D-pKjlVd.js → chunk-GEFDOKGD-BbQkJu8C.js} +1 -1
  13. package/dist/web/assets/{chunk-GLR3WWYH-DKikpoJM.js → chunk-GLR3WWYH-CzYx4w-r.js} +2 -2
  14. package/dist/web/assets/{chunk-HHEYEP7N-C7vxA5i9.js → chunk-HHEYEP7N-HRhYy3kG.js} +1 -1
  15. package/dist/web/assets/{chunk-JSJVCQXG-99JzIdPr.js → chunk-JSJVCQXG-23tyvw8k.js} +1 -1
  16. package/dist/web/assets/{chunk-KX2RTZJC-CRq1OBZv.js → chunk-KX2RTZJC-sQ0o-39C.js} +1 -1
  17. package/dist/web/assets/{chunk-KYZI473N-Bb0MCaIO.js → chunk-KYZI473N-BcUZNnwd.js} +1 -1
  18. package/dist/web/assets/{chunk-NQ4KR5QH-z_blpjxi.js → chunk-NQ4KR5QH-wMgTlP7f.js} +1 -1
  19. package/dist/web/assets/{chunk-O4XLMI2P-nDhi_cVu.js → chunk-O4XLMI2P-JC6EGoUz.js} +1 -1
  20. package/dist/web/assets/{chunk-PQ6SQG4A-TF58UVMU.js → chunk-PQ6SQG4A-D6BTbCQw.js} +1 -1
  21. package/dist/web/assets/{chunk-PU5JKC2W-ek7k4QVB.js → chunk-PU5JKC2W-Dw8ClWch.js} +1 -1
  22. package/dist/web/assets/{chunk-WL4C6EOR-ByUrSRin.js → chunk-WL4C6EOR-DfofndiH.js} +1 -1
  23. package/dist/web/assets/{chunk-YBOYWFTD-rQG3QH5s.js → chunk-YBOYWFTD-CeU4Q-xC.js} +1 -1
  24. package/dist/web/assets/classDiagram-VBA2DB6C-lse8oZoJ.js +1 -0
  25. package/dist/web/assets/classDiagram-v2-RAHNMMFH-CxkwuInd.js +1 -0
  26. package/dist/web/assets/code-editor-B1T1uAc_.js +2 -0
  27. package/dist/web/assets/{csv-preview-ncSOnJSC.js → csv-preview-Doo6XsK0.js} +1 -1
  28. package/dist/web/assets/{dagre-DHq9bhnd.js → dagre-Dbb5k38K.js} +1 -1
  29. package/dist/web/assets/{dagre-KLK3FWXG-BdJr7Byp.js → dagre-KLK3FWXG-BH7aWGRP.js} +1 -1
  30. package/dist/web/assets/database-viewer-ChNK7Hv_.js +1 -0
  31. package/dist/web/assets/{diagram-E7M64L7V-_db4pBVA.js → diagram-E7M64L7V-B1Qz70Do.js} +1 -1
  32. package/dist/web/assets/{diagram-IFDJBPK2-xKoeuiJx.js → diagram-IFDJBPK2-k55eVqVU.js} +1 -1
  33. package/dist/web/assets/{diagram-P4PSJMXO-C8tjJsev.js → diagram-P4PSJMXO-BkfNRc9U.js} +1 -1
  34. package/dist/web/assets/{diff-viewer-BdeL1mp2.js → diff-viewer-B1YHbfur.js} +1 -1
  35. package/dist/web/assets/dist-C4urk5JP.js +41 -0
  36. package/dist/web/assets/{dist-ovWkrgO-.js → dist-wVfsYfHS.js} +1 -1
  37. package/dist/web/assets/{erDiagram-INFDFZHY-BSh2z9Df.js → erDiagram-INFDFZHY-CKzVujYI.js} +1 -1
  38. package/dist/web/assets/{extension-webview-BAClIyub.js → extension-webview-7d3Q0aIg.js} +1 -1
  39. package/dist/web/assets/{flowDiagram-PKNHOUZH-oYaovqyp.js → flowDiagram-PKNHOUZH-DIqcTrDV.js} +1 -1
  40. package/dist/web/assets/{ganttDiagram-A5KZAMGK-DmL26q2P.js → ganttDiagram-A5KZAMGK-D4v7ZbVE.js} +1 -1
  41. package/dist/web/assets/git-graph-NaHViGO2.js +1 -0
  42. package/dist/web/assets/{gitGraphDiagram-K3NZZRJ6-CMoukSrY.js → gitGraphDiagram-K3NZZRJ6-BTXo57mF.js} +1 -1
  43. package/dist/web/assets/index-WGGO0qq9.js +37 -0
  44. package/dist/web/assets/{infoDiagram-LFFYTUFH-DWwumDkq.js → infoDiagram-LFFYTUFH-B1CX0pbC.js} +1 -1
  45. package/dist/web/assets/{ishikawaDiagram-PHBUUO56-D05_LyL7.js → ishikawaDiagram-PHBUUO56-BOyvKMmB.js} +1 -1
  46. package/dist/web/assets/{journeyDiagram-4ABVD52K-B_L20qMe.js → journeyDiagram-4ABVD52K-ufoasAy6.js} +1 -1
  47. package/dist/web/assets/{kanban-definition-K7BYSVSG-CZ535BbZ.js → kanban-definition-K7BYSVSG-Bi0UTUeN.js} +1 -1
  48. package/dist/web/assets/keybindings-store-Bus-WOTq.js +1 -0
  49. package/dist/web/assets/{line-CVvo3dRu.js → line-B78g-52T.js} +1 -1
  50. package/dist/web/assets/{markdown-renderer-COndDkRD.js → markdown-renderer-CWeCayPE.js} +5 -5
  51. package/dist/web/assets/{mermaid-parser.core-C7UwoIh6.js → mermaid-parser.core-DMIWdgEW.js} +1 -1
  52. package/dist/web/assets/{mindmap-definition-YRQLILUH-x0MTutJp.js → mindmap-definition-YRQLILUH-BsfWvIoO.js} +1 -1
  53. package/dist/web/assets/{pieDiagram-SKSYHLDU-C1Gjrtzy.js → pieDiagram-SKSYHLDU-WP0XXw51.js} +1 -1
  54. package/dist/web/assets/postgres-viewer-O_X63FPB.js +1 -0
  55. package/dist/web/assets/{quadrantDiagram-337W2JSQ-C8bzJCjQ.js → quadrantDiagram-337W2JSQ-FHMogtsh.js} +1 -1
  56. package/dist/web/assets/{requirementDiagram-Z7DCOOCP-pQyah6WB.js → requirementDiagram-Z7DCOOCP-BatTxyWb.js} +1 -1
  57. package/dist/web/assets/{sankeyDiagram-WA2Y5GQK-T6RgG-N8.js → sankeyDiagram-WA2Y5GQK-ClJuW3Hv.js} +1 -1
  58. package/dist/web/assets/{sequenceDiagram-2WXFIKYE-BQDJ4CVs.js → sequenceDiagram-2WXFIKYE-ByxQqGgs.js} +1 -1
  59. package/dist/web/assets/{settings-tab-CiDK6Jf2.js → settings-tab-CQ5fOx4Z.js} +1 -1
  60. package/dist/web/assets/sqlite-viewer-BDw7xrqT.js +1 -0
  61. package/dist/web/assets/{stateDiagram-RAJIS63D-66vhiIuk.js → stateDiagram-RAJIS63D-f8opcZNY.js} +1 -1
  62. package/dist/web/assets/stateDiagram-v2-FVOUBMTO-DrxVDY9q.js +1 -0
  63. package/dist/web/assets/{tab-store-BOgTrqRr.js → tab-store-CeOacjuH.js} +1 -1
  64. package/dist/web/assets/{terminal-tab-BvExlsRm.js → terminal-tab-DHqCtUKE.js} +1 -1
  65. package/dist/web/assets/{timeline-definition-YZTLITO2-DwZqB3nn.js → timeline-definition-YZTLITO2-58BlOSf9.js} +1 -1
  66. package/dist/web/assets/{use-monaco-theme-BsMRP0ci.js → use-monaco-theme-C52E96dj.js} +1 -1
  67. package/dist/web/assets/{vennDiagram-LZ73GAT5-s9Z71fz-.js → vennDiagram-LZ73GAT5-BOSy9ma9.js} +1 -1
  68. package/dist/web/assets/{xychartDiagram-JWTSCODW-DRa_TH4B.js → xychartDiagram-JWTSCODW-z5MVJauZ.js} +1 -1
  69. package/dist/web/index.html +7 -7
  70. package/dist/web/sw.js +1 -1
  71. package/docs/project-changelog.md +31 -1
  72. package/docs/project-roadmap.md +4 -1
  73. package/package.json +3 -1
  74. package/src/server/helpers/error-status.ts +10 -0
  75. package/src/server/middleware/auth.ts +17 -6
  76. package/src/server/routes/file-download.ts +63 -0
  77. package/src/server/routes/files.ts +8 -17
  78. package/src/server/routes/project-scoped.ts +2 -0
  79. package/src/services/download-token.service.ts +37 -0
  80. package/src/web/components/chat/chat-history-bar.tsx +26 -36
  81. package/src/web/components/chat/chat-tab.tsx +0 -1
  82. package/src/web/components/editor/code-editor.tsx +2 -0
  83. package/src/web/components/editor/editor-toolbar.tsx +14 -1
  84. package/src/web/components/explorer/file-tree.tsx +15 -0
  85. package/src/web/lib/file-download.ts +27 -0
  86. package/dist/web/assets/browser-tab-DOcEOjEa.js +0 -1
  87. package/dist/web/assets/channel-By7bn0Yq.js +0 -1
  88. package/dist/web/assets/chat-tab-Ck-DKBcT.js +0 -8
  89. package/dist/web/assets/classDiagram-VBA2DB6C-BA8Nj-_C.js +0 -1
  90. package/dist/web/assets/classDiagram-v2-RAHNMMFH-DjYu-6mn.js +0 -1
  91. package/dist/web/assets/code-editor-pu7p8kxA.js +0 -2
  92. package/dist/web/assets/database-viewer-Byj9izvr.js +0 -1
  93. package/dist/web/assets/dist-DIV6WgAG.js +0 -41
  94. package/dist/web/assets/git-graph-DnXGjims.js +0 -1
  95. package/dist/web/assets/index-C6uPEeqG.js +0 -37
  96. package/dist/web/assets/keybindings-store-DclBEjd4.js +0 -1
  97. package/dist/web/assets/postgres-viewer-CQODrSyu.js +0 -1
  98. package/dist/web/assets/sqlite-viewer-kMmzSn7j.js +0 -1
  99. package/dist/web/assets/stateDiagram-v2-FVOUBMTO-BGVqj_g9.js +0 -1
  100. package/docs/streaming-input-guide.md +0 -267
  101. package/snapshot-state.md +0 -1526
  102. package/test-session-ops.mjs +0 -444
  103. package/test-tokens.mjs +0 -212
  104. /package/dist/web/assets/{jsx-runtime-kMwlnEGE.js → jsx-runtime-O3jQaKZd.js} +0 -0
  105. /package/dist/web/assets/{preload-helper-Bf_JiD2A.js → preload-helper-uTix4PVD.js} +0 -0
  106. /package/dist/web/assets/{react-SKk5z-bm.js → react-ER-4DN55.js} +0 -0
  107. /package/dist/web/assets/{table-DFevCOMd.js → table-CWv1Oy39.js} +0 -0
  108. /package/dist/web/assets/{tag-CXMT0QB6.js → tag-CFrhsWuM.js} +0 -0
@@ -1 +1 @@
1
- import{C as e,D as t,E as n,G as r,N as i,P as a,V as o,j as s,k as c,n as l,p as u,v as d,w as f,z as p}from"./isArrayLikeObject-B_v2FtYn.js";import{C as m,E as ee,M as h,N as te,S as ne,a as g,c as re,d as ie,f as _,i as v,m as ae,n as y,p as oe,r as b,s as x,y as se}from"./_baseUniq-BT4Ow4Kk.js";import{a as ce,c as le,d as ue,f as S,i as de,l as C,m as w,n as T,o as fe,r as pe,s as E,t as me,u as D}from"./_basePickBy-5PGDJbfF.js";import{i as he,n as ge}from"./isEmpty-bnrF3Qbc.js";import{k as O}from"./chunk-GEFDOKGD-D-pKjlVd.js";import{t as k}from"./graphlib-BcsNnGcW.js";function _e(e){return i(t(e,void 0,S),e+``)}var ve=RegExp(`[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]`);function ye(e){return ve.test(e)}var be=1,xe=4;function Se(e){return se(e,be|xe)}var Ce=function(){return r.Date.now()};function we(e,t){return e==null?e:l(e,re(t),u)}function Te(e,t){return e&&ie(e,re(t))}function Ee(e,t){return e>t}function A(e,t){var n={};return t=_(t,3),ie(e,function(e,r,i){s(n,r,t(e,r,i))}),n}function j(e){return e&&e.length?pe(e,p,Ee):void 0}function M(e,t){return e&&e.length?pe(e,_(t,2),de):void 0}function De(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function Oe(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=te(e),o=t!==void 0,s=t===null,c=t===t,l=te(t);if(!s&&!l&&!a&&e>t||a&&o&&c&&!s&&!l||r&&o&&c||!n&&c||!i)return 1;if(!r&&!a&&!l&&e<t||l&&n&&i&&!r&&!a||s&&n&&i||!o&&i||!c)return-1}return 0}function ke(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=Oe(i[r],a[r]);if(c)return r>=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function Ae(e,t,n){t=t.length?h(t,function(e){return o(e)?function(t){return m(t,e.length===1?e[0]:e)}:e}):[p];var r=-1;return t=h(t,d(_)),De(le(e,function(e,n,i){return{criteria:h(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return ke(e,t,n)})}var je=oe(`length`),Me=`\\ud800-\\udfff`,Ne=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,Pe=`\\ufe0e\\ufe0f`,Fe=`[`+Me+`]`,N=`[`+Ne+`]`,P=`\\ud83c[\\udffb-\\udfff]`,Ie=`(?:`+N+`|`+P+`)`,Le=`[^`+Me+`]`,Re=`(?:\\ud83c[\\udde6-\\uddff]){2}`,ze=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Be=`\\u200d`,Ve=Ie+`?`,He=`[`+Pe+`]?`,Ue=`(?:`+Be+`(?:`+[Le,Re,ze].join(`|`)+`)`+He+Ve+`)*`,We=He+Ve+Ue,Ge=`(?:`+[Le+N+`?`,N,Re,ze,Fe].join(`|`)+`)`,Ke=RegExp(P+`(?=`+P+`)|`+Ge+We,`g`);function qe(e){for(var t=Ke.lastIndex=0;Ke.test(e);)++t;return t}function Je(e){return ye(e)?qe(e):je(e)}function Ye(e,t){return me(e,t,function(t,n){return ae(e,n)})}var F=_e(function(e,t){return e==null?{}:Ye(e,t)}),Xe=Math.ceil,Ze=Math.max;function Qe(e,t,n,r){for(var i=-1,a=Ze(Xe((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}function $e(t){return function(n,r,i){return i&&typeof i!=`number`&&e(n,r,i)&&(r=i=void 0),n=w(n),r===void 0?(r=n,n=0):r=w(r),i=i===void 0?n<r?1:-1:w(i),Qe(n,r,i,t)}}var I=$e(),et=`[object Map]`,tt=`[object Set]`;function nt(e){if(e==null)return 0;if(f(e))return ce(e)?Je(e):e.length;var t=ge(e);return t==et||t==tt?e.size:he(e).length}var L=n(function(t,n){if(t==null)return[];var r=n.length;return r>1&&e(t,n[0],n[1])?n=[]:r>2&&e(n[0],n[1],n[2])&&(n=[n[0]]),Ae(t,ne(n,1),[])}),rt=0;function R(e){var t=++rt;return ee(e)+t}function it(e,t,n){for(var r=-1,i=e.length,a=t.length,o={};++r<i;){var s=r<a?t[r]:void 0;n(o,e[r],s)}return o}function at(e,t){return it(e||[],t||[],c)}var ot=class{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,t=e._prev;if(t!==e)return st(t),t}enqueue(e){var t=this._sentinel;e._prev&&e._next&&st(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,ct)),n=n._prev;return`[`+e.join(`, `)+`]`}};function st(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function ct(e,t){if(e!==`_next`&&e!==`_prev`)return t}var lt=a(1);function ut(e,t){if(e.nodeCount()<=1)return[];var n=ft(e,t||lt);return S(E(dt(n.graph,n.buckets,n.zeroIdx),function(t){return e.outEdges(t.v,t.w)}))}function dt(e,t,n){for(var r=[],i=t[t.length-1],a=t[0],o;e.nodeCount();){for(;o=a.dequeue();)z(e,t,n,o);for(;o=i.dequeue();)z(e,t,n,o);if(e.nodeCount()){for(var s=t.length-2;s>0;--s)if(o=t[s].dequeue(),o){r=r.concat(z(e,t,n,o,!0));break}}}return r}function z(e,t,n,r,i){var a=i?[]:void 0;return x(e.inEdges(r.v),function(r){var o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,B(t,n,s)}),x(e.outEdges(r.v),function(r){var i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,B(t,n,o)}),e.removeNode(r.v),a}function ft(e,t){var n=new k,r=0,i=0;x(e.nodes(),function(e){n.setNode(e,{v:e,in:0,out:0})}),x(e.edges(),function(e){var a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s),i=Math.max(i,n.node(e.v).out+=o),r=Math.max(r,n.node(e.w).in+=o)});var a=I(i+r+3).map(function(){return new ot}),o=r+1;return x(n.nodes(),function(e){B(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function B(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function pt(e){x(e.graph().acyclicer===`greedy`?ut(e,t(e)):mt(e),function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,R(`rev`))});function t(e){return function(t){return e.edge(t).weight}}}function mt(e){var t=[],n={},r={};function i(a){Object.prototype.hasOwnProperty.call(r,a)||(r[a]=!0,n[a]=!0,x(e.outEdges(a),function(e){Object.prototype.hasOwnProperty.call(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return x(e.nodes(),i),t}function ht(e){x(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function V(e,t,n,r){var i;do i=R(r);while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function gt(e){var t=new k().setGraph(e.graph());return x(e.nodes(),function(n){t.setNode(n,e.node(n))}),x(e.edges(),function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function _t(e){var t=new k({multigraph:e.isMultigraph()}).setGraph(e.graph());return x(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),x(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t}function vt(e,t){var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);var c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function H(e){var t=E(I(St(e)+1),function(){return[]});return x(e.nodes(),function(n){var r=e.node(n),i=r.rank;b(i)||(t[i][r.order]=n)}),t}function yt(e){var t=T(E(e.nodes(),function(t){return e.node(t).rank}));x(e.nodes(),function(n){var r=e.node(n);fe(r,`rank`)&&(r.rank-=t)})}function bt(e){var t=T(E(e.nodes(),function(t){return e.node(t).rank})),n=[];x(e.nodes(),function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=e.graph().nodeRankFactor;x(n,function(t,n){b(t)&&n%i!==0?--r:r&&x(t,function(t){e.node(t).rank+=r})})}function xt(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),V(e,`border`,i,t)}function St(e){return j(E(e.nodes(),function(t){var n=e.node(t).rank;if(!b(n))return n}))}function Ct(e,t){var n={lhs:[],rhs:[]};return x(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function wt(e,t){var n=Ce();try{return t()}finally{console.log(e+` time: `+(Ce()-n)+`ms`)}}function Tt(e,t){return t()}function Et(e){function t(n){var r=e.children(n),i=e.node(n);if(r.length&&x(r,t),Object.prototype.hasOwnProperty.call(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;a<o;++a)Dt(e,`borderLeft`,`_bl`,n,i,a),Dt(e,`borderRight`,`_br`,n,i,a)}}x(e.children(),t)}function Dt(e,t,n,r,i,a){var o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=V(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function Ot(e){var t=e.graph().rankdir.toLowerCase();(t===`lr`||t===`rl`)&&At(e)}function kt(e){var t=e.graph().rankdir.toLowerCase();(t===`bt`||t===`rl`)&&jt(e),(t===`lr`||t===`rl`)&&(Mt(e),At(e))}function At(e){x(e.nodes(),function(t){U(e.node(t))}),x(e.edges(),function(t){U(e.edge(t))})}function U(e){var t=e.width;e.width=e.height,e.height=t}function jt(e){x(e.nodes(),function(t){W(e.node(t))}),x(e.edges(),function(t){var n=e.edge(t);x(n.points,W),Object.prototype.hasOwnProperty.call(n,`y`)&&W(n)})}function W(e){e.y=-e.y}function Mt(e){x(e.nodes(),function(t){G(e.node(t))}),x(e.edges(),function(t){var n=e.edge(t);x(n.points,G),Object.prototype.hasOwnProperty.call(n,`x`)&&G(n)})}function G(e){var t=e.x;e.x=e.y,e.y=t}function Nt(e){e.graph().dummyChains=[],x(e.edges(),function(t){Pt(e,t)})}function Pt(e,t){var n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a!==r+1){e.removeEdge(t);var l=void 0,u,d;for(d=0,++r;r<a;++d,++r)s.points=[],l={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},u=V(e,`edge`,l,`_d`),r===c&&(l.width=s.width,l.height=s.height,l.dummy=`edge-label`,l.labelpos=s.labelpos),e.setEdge(n,u,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(u),n=u;e.setEdge(n,i,{weight:s.weight},o)}}function Ft(e){x(e.graph().dummyChains,function(t){var n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function K(e){var t={};function n(r){var i=e.node(r);if(Object.prototype.hasOwnProperty.call(t,r))return i.rank;t[r]=!0;var a=T(E(e.outEdges(r),function(t){return n(t.w)-e.edge(t).minlen}));return(a===1/0||a==null)&&(a=0),i.rank=a}x(e.sources(),n)}function q(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}function It(e){var t=new k({directed:!1}),n=e.nodes()[0],r=e.nodeCount();t.setNode(n,{});for(var i,a;Lt(t,e)<r;)i=Rt(t,e),a=t.hasNode(i.v)?q(e,i):-q(e,i),zt(t,e,a);return t}function Lt(e,t){function n(r){x(t.nodeEdges(r),function(i){var a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!q(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return x(e.nodes(),n),e.nodeCount()}function Rt(e,t){return M(t.edges(),function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return q(t,n)})}function zt(e,t,n){x(e.nodes(),function(e){t.node(e).rank+=n})}a(1),a(1),Bt.CycleException=J;function Bt(e){var t={},n={},r=[];function i(a){if(Object.prototype.hasOwnProperty.call(n,a))throw new J;Object.prototype.hasOwnProperty.call(t,a)||(n[a]=!0,t[a]=!0,x(e.predecessors(a),i),delete n[a],r.push(a))}if(x(e.sinks(),i),nt(t)!==e.nodeCount())throw new J;return r}function J(){}J.prototype=Error();function Vt(e,t,n){o(t)||(t=[t]);var r=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],a={};return x(t,function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);Ht(e,t,n===`post`,a,r,i)}),i}function Ht(e,t,n,r,i,a){Object.prototype.hasOwnProperty.call(r,t)||(r[t]=!0,n||a.push(t),x(i(t),function(t){Ht(e,t,n,r,i,a)}),n&&a.push(t))}function Ut(e,t){return Vt(e,t,`post`)}function Wt(e,t){return Vt(e,t,`pre`)}Y.initLowLimValues=Z,Y.initCutValues=X,Y.calcCutValue=Kt,Y.leaveEdge=Jt,Y.enterEdge=Yt,Y.exchangeEdges=Xt;function Y(e){e=gt(e),K(e);var t=It(e);Z(t),X(t,e);for(var n,r;n=Jt(t);)r=Yt(t,e,n),Xt(t,e,n,r)}function X(e,t){var n=Ut(e,e.nodes());n=n.slice(0,n.length-1),x(n,function(n){Gt(e,t,n)})}function Gt(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=Kt(e,t,n)}function Kt(e,t,n){var r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;return a||=(i=!1,t.edge(r,n)),o=a.weight,x(t.nodeEdges(n),function(a){var s=a.v===n,c=s?a.w:a.v;if(c!==r){var l=s===i,u=t.edge(a).weight;if(o+=l?u:-u,Qt(e,n,c)){var d=e.edge(n,c).cutvalue;o+=l?-d:d}}}),o}function Z(e,t){arguments.length<2&&(t=e.nodes()[0]),qt(e,{},1,t)}function qt(e,t,n,r,i){var a=n,o=e.node(r);return t[r]=!0,x(e.neighbors(r),function(i){Object.prototype.hasOwnProperty.call(t,i)||(n=qt(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function Jt(e){return C(e.edges(),function(t){return e.edge(t).cutvalue<0})}function Yt(e,t,n){var r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);var a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),M(g(t.edges(),function(t){return c===$t(e,e.node(t.v),s)&&c!==$t(e,e.node(t.w),s)}),function(e){return q(t,e)})}function Xt(e,t,n,r){var i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),Z(e),X(e,t),Zt(e,t)}function Zt(e,t){var n=Wt(e,C(e.nodes(),function(e){return!t.node(e).parent}));n=n.slice(1),x(n,function(n){var r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function Qt(e,t,n){return e.hasEdge(t,n)}function $t(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}function en(e){switch(e.graph().ranker){case`network-simplex`:rn(e);break;case`tight-tree`:nn(e);break;case`longest-path`:tn(e);break;default:rn(e)}}var tn=K;function nn(e){K(e),It(e)}function rn(e){Y(e)}function an(e){var t=V(e,`root`,{},`_root`),n=sn(e),r=j(v(n))-1,i=2*r+1;e.graph().nestingRoot=t,x(e.edges(),function(t){e.edge(t).minlen*=i});var a=cn(e)+1;x(e.children(),function(o){on(e,t,i,a,r,n,o)}),e.graph().nodeRankFactor=i}function on(e,t,n,r,i,a,o){var s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}var c=xt(e,`_bt`),l=xt(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,x(s,function(s){on(e,t,n,r,i,a,s);var u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-a[o]+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+a[o]})}function sn(e){var t={};function n(r,i){var a=e.children(r);a&&a.length&&x(a,function(e){n(e,i+1)}),t[r]=i}return x(e.children(),function(e){n(e,1)}),t}function cn(e){return y(e.edges(),function(t,n){return t+e.edge(n).weight},0)}function ln(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,x(e.edges(),function(t){e.edge(t).nestingEdge&&e.removeEdge(t)})}function un(e,t,n){var r={},i;x(n,function(n){for(var a=e.parent(n),o,s;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function dn(e,t,n){var r=fn(e),i=new k({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(t){return e.node(t)});return x(e.nodes(),function(a){var o=e.node(a),s=e.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||r),x(e[n](a),function(t){var n=t.v===a?t.w:t.v,r=i.edge(n,a),o=b(r)?0:r.weight;i.setEdge(n,a,{weight:e.edge(t).weight+o})}),Object.prototype.hasOwnProperty.call(o,`minRank`)&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function fn(e){for(var t;e.hasNode(t=R(`_root`)););return t}function pn(e,t){for(var n=0,r=1;r<t.length;++r)n+=mn(e,t[r-1],t[r]);return n}function mn(e,t,n){for(var r=at(n,E(n,function(e,t){return t})),i=S(E(t,function(t){return L(E(e.outEdges(t),function(t){return{pos:r[t.w],weight:e.edge(t).weight}}),`pos`)})),a=1;a<n.length;)a<<=1;var o=2*a-1;--a;var s=E(Array(o),function(){return 0}),c=0;return x(i.forEach(function(e){var t=e.pos+a;s[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n})),c}function hn(e){var t={},n=g(e.nodes(),function(t){return!e.children(t).length}),r=E(I(j(E(n,function(t){return e.node(t).rank}))+1),function(){return[]});function i(n){fe(t,n)||(t[n]=!0,r[e.node(n).rank].push(n),x(e.successors(n),i))}return x(L(n,function(t){return e.node(t).rank}),i),r}function gn(e,t){return E(t,function(t){var n=e.inEdges(t);if(n.length){var r=y(n,function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}else return{v:t}})}function _n(e,t){var n={};return x(e,function(e,t){var r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};b(e.barycenter)||(r.barycenter=e.barycenter,r.weight=e.weight)}),x(t.edges(),function(e){var t=n[e.v],r=n[e.w];!b(t)&&!b(r)&&(r.indegree++,t.out.push(n[e.w]))}),vn(g(n,function(e){return!e.indegree}))}function vn(e){var t=[];function n(e){return function(t){t.merged||(b(t.barycenter)||b(e.barycenter)||t.barycenter>=e.barycenter)&&yn(e,t)}}function r(t){return function(n){n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){var i=e.pop();t.push(i),x(i.in.reverse(),n(i)),x(i.out,r(i))}return E(g(t,function(e){return!e.merged}),function(e){return F(e,[`vs`,`i`,`barycenter`,`weight`])})}function yn(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function bn(e,t){var n=Ct(e,function(e){return Object.prototype.hasOwnProperty.call(e,`barycenter`)}),r=n.lhs,i=L(n.rhs,function(e){return-e.i}),a=[],o=0,s=0,c=0;r.sort(Sn(!!t)),c=xn(a,i,c),x(r,function(e){c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=xn(a,i,c)});var l={vs:S(a)};return s&&(l.barycenter=o/s,l.weight=s),l}function xn(e,t,n){for(var r;t.length&&(r=D(t)).i<=n;)t.pop(),e.push(r.vs),n++;return n}function Sn(e){return function(t,n){return t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}}function Cn(e,t,n,r){var i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};o&&(i=g(i,function(e){return e!==o&&e!==s}));var l=gn(e,i);x(l,function(t){if(e.children(t.v).length){var i=Cn(e,t.v,n,r);c[t.v]=i,Object.prototype.hasOwnProperty.call(i,`barycenter`)&&Tn(t,i)}});var u=_n(l,n);wn(u,c);var d=bn(u,r);if(o&&(d.vs=S([o,d.vs,s]),e.predecessors(o).length)){var f=e.node(e.predecessors(o)[0]),p=e.node(e.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(d,`barycenter`)||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function wn(e,t){x(e,function(e){e.vs=S(e.vs.map(function(e){return t[e]?t[e].vs:e}))})}function Tn(e,t){b(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function En(e){var t=St(e),n=Dn(e,I(1,t+1),`inEdges`),r=Dn(e,I(t-1,-1,-1),`outEdges`),i=hn(e);kn(e,i);for(var a=1/0,o,s=0,c=0;c<4;++s,++c){On(s%2?n:r,s%4>=2),i=H(e);var l=pn(e,i);l<a&&(c=0,o=Se(i),a=l)}kn(e,o)}function Dn(e,t,n){return E(t,function(t){return dn(e,t,n)})}function On(e,t){var n=new k;x(e,function(e){var r=e.graph().root,i=Cn(e,r,n,t);x(i.vs,function(t,n){e.node(t).order=n}),un(e,n,i.vs)})}function kn(e,t){x(t,function(t){x(t,function(t,n){e.node(t).order=n})})}function An(e){var t=Mn(e);x(e.graph().dummyChains,function(n){for(var r=e.node(n),i=r.edgeObj,a=jn(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(l=o[c+1]).minRank<=r.rank;)c++;l=o[c]}e.setParent(n,l),n=e.successors(n)[0]}})}function jn(e,t,n,r){var i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c=n,l;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));for(l=c,c=r;(c=e.parent(c))!==l;)a.push(c);return{path:i.concat(a.reverse()),lca:l}}function Mn(e){var t={},n=0;function r(i){var a=n;x(e.children(i),r),t[i]={low:a,lim:n++}}return x(e.children(),r),t}function Nn(e,t){var n={};function r(t,r){var i=0,a=0,o=t.length,s=D(r);return x(r,function(t,c){var l=Fn(e,t),u=l?e.node(l).order:o;(l||t===s)&&(x(r.slice(a,c+1),function(t){x(e.predecessors(t),function(r){var a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&In(n,r,t)})}),a=c+1,i=u)}),r}return y(t,r),n}function Pn(e,t){var n={};function r(t,r,i,a,o){var s;x(I(r,i),function(r){s=t[r],e.node(s).dummy&&x(e.predecessors(s),function(t){var r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&In(n,t,s)})})}function i(t,n){var i=-1,a,o=0;return x(n,function(s,c){if(e.node(s).dummy===`border`){var l=e.predecessors(s);l.length&&(a=e.node(l[0]).order,r(n,o,c,i,a),o=c,i=a)}r(n,o,n.length,a,t.length)}),n}return y(t,i),n}function Fn(e,t){if(e.node(t).dummy)return C(e.predecessors(t),function(t){return e.node(t).dummy})}function In(e,t,n){if(t>n){var r=t;t=n,n=r}Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[t];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Ln(e,t,n){if(t>n){var r=t;t=n,n=r}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],n)}function Rn(e,t,n,r){var i={},a={},o={};return x(t,function(e){x(e,function(e,t){i[e]=e,a[e]=e,o[e]=t})}),x(t,function(e){var t=-1;x(e,function(e){var s=r(e);if(s.length){s=L(s,function(e){return o[e]});for(var c=(s.length-1)/2,l=Math.floor(c),u=Math.ceil(c);l<=u;++l){var d=s[l];a[e]===e&&t<o[d]&&!Ln(n,e,d)&&(a[d]=e,a[e]=i[e]=i[d],t=o[d])}}})}),{root:i,align:a}}function zn(e,t,n,r,i){var a={},o=Bn(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){for(var n=o.nodes(),r=n.pop(),i={};r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}function l(e){a[e]=o.inEdges(e).reduce(function(e,t){return Math.max(e,a[t.v]+o.edge(t))},0)}function u(t){var n=o.outEdges(t).reduce(function(e,t){return Math.min(e,a[t.w]-o.edge(t))},1/0),r=e.node(t);n!==1/0&&r.borderType!==s&&(a[t]=Math.max(a[t],n))}return c(l,o.predecessors.bind(o)),c(u,o.successors.bind(o)),x(r,function(e){a[e]=a[n[e]]}),a}function Bn(e,t,n,r){var i=new k,a=e.graph(),o=Gn(a.nodesep,a.edgesep,r);return x(t,function(t){var r;x(t,function(t){var a=n[t];if(i.setNode(a),r){var s=n[r],c=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),c||0))}r=t})}),i}function Vn(e,t){return M(v(t),function(t){var n=-1/0,r=1/0;return we(t,function(t,i){var a=Kn(e,i)/2;n=Math.max(t+a,n),r=Math.min(t-a,r)}),n-r})}function Hn(e,t){var n=v(t),r=T(n),i=j(n);x([`u`,`d`],function(n){x([`l`,`r`],function(a){var o=n+a,s=e[o],c;if(s!==t){var l=v(s);c=a===`l`?r-T(l):i-j(l),c&&(e[o]=A(s,function(e){return e+c}))}})})}function Un(e,t){return A(e.ul,function(n,r){if(t)return e[t.toLowerCase()][r];var i=L(E(e,r));return(i[1]+i[2])/2})}function Wn(e){var t=H(e),n=O(Nn(e,t),Pn(e,t)),r={},i;return x([`u`,`d`],function(a){i=a===`u`?t:v(t).reverse(),x([`l`,`r`],function(t){t===`r`&&(i=E(i,function(e){return v(e).reverse()}));var o=(a===`u`?e.predecessors:e.successors).bind(e),s=Rn(e,i,n,o),c=zn(e,i,s.root,s.align,t===`r`);t===`r`&&(c=A(c,function(e){return-e})),r[a+t]=c})}),Hn(r,Vn(e,r)),Un(r,e.graph().align)}function Gn(e,t,n){return function(r,i,a){var o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.prototype.hasOwnProperty.call(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2;break}if(l&&(c+=n?l:-l),l=0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.prototype.hasOwnProperty.call(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2;break}return l&&(c+=n?l:-l),l=0,c}}function Kn(e,t){return e.node(t).width}function qn(e){e=_t(e),Jn(e),Te(Wn(e),function(t,n){e.node(n).x=t})}function Jn(e){var t=H(e),n=e.graph().ranksep,r=0;x(t,function(t){var i=j(E(t,function(t){return e.node(t).height}));x(t,function(t){e.node(t).y=r+i/2}),r+=i+n})}function Yn(e,t){var n=t&&t.debugTiming?wt:Tt;n(`layout`,()=>{var t=n(` buildLayoutGraph`,()=>or(e));n(` runLayout`,()=>Xn(t,n)),n(` updateInputGraph`,()=>Zn(e,t))})}function Xn(e,t){t(` makeSpaceForEdgeLabels`,()=>sr(e)),t(` removeSelfEdges`,()=>gr(e)),t(` acyclic`,()=>pt(e)),t(` nestingGraph.run`,()=>an(e)),t(` rank`,()=>en(_t(e))),t(` injectEdgeLabelProxies`,()=>cr(e)),t(` removeEmptyRanks`,()=>bt(e)),t(` nestingGraph.cleanup`,()=>ln(e)),t(` normalizeRanks`,()=>yt(e)),t(` assignRankMinMax`,()=>lr(e)),t(` removeEdgeLabelProxies`,()=>ur(e)),t(` normalize.run`,()=>Nt(e)),t(` parentDummyChains`,()=>An(e)),t(` addBorderSegments`,()=>Et(e)),t(` order`,()=>En(e)),t(` insertSelfEdges`,()=>_r(e)),t(` adjustCoordinateSystem`,()=>Ot(e)),t(` position`,()=>qn(e)),t(` positionSelfEdges`,()=>vr(e)),t(` removeBorderNodes`,()=>hr(e)),t(` normalize.undo`,()=>Ft(e)),t(` fixupEdgeLabelCoords`,()=>pr(e)),t(` undoCoordinateSystem`,()=>kt(e)),t(` translateGraph`,()=>dr(e)),t(` assignNodeIntersects`,()=>fr(e)),t(` reversePoints`,()=>mr(e)),t(` acyclic.undo`,()=>ht(e))}function Zn(e,t){x(e.nodes(),function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))}),x(e.edges(),function(n){var r=e.edge(n),i=t.edge(n);r.points=i.points,Object.prototype.hasOwnProperty.call(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var Qn=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],$n={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},er=[`acyclicer`,`ranker`,`rankdir`,`align`],tr=[`width`,`height`],nr={width:0,height:0},rr=[`minlen`,`weight`,`width`,`height`,`labeloffset`],ir={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},ar=[`labelpos`];function or(e){var t=new k({multigraph:!0,compound:!0}),n=$(e.graph());return t.setGraph(O({},$n,Q(n,Qn),F(n,er))),x(e.nodes(),function(n){var r=$(e.node(n));t.setNode(n,ue(Q(r,tr),nr)),t.setParent(n,e.parent(n))}),x(e.edges(),function(n){var r=$(e.edge(n));t.setEdge(n,O({},ir,Q(r,rr),F(r,ar)))}),t}function sr(e){var t=e.graph();t.ranksep/=2,x(e.edges(),function(n){var r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function cr(e){x(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v);V(e,`edge-proxy`,{rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t},`_ep`)}})}function lr(e){var t=0;x(e.nodes(),function(n){var r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=j(t,r.maxRank))}),e.graph().maxRank=t}function ur(e){x(e.nodes(),function(t){var n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function dr(e){var t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){var a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}x(e.nodes(),function(t){c(e.node(t))}),x(e.edges(),function(t){var n=e.edge(t);Object.prototype.hasOwnProperty.call(n,`x`)&&c(n)}),t-=o,r-=s,x(e.nodes(),function(n){var i=e.node(n);i.x-=t,i.y-=r}),x(e.edges(),function(n){var i=e.edge(n);x(i.points,function(e){e.x-=t,e.y-=r}),Object.prototype.hasOwnProperty.call(i,`x`)&&(i.x-=t),Object.prototype.hasOwnProperty.call(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function fr(e){x(e.edges(),function(t){var n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(vt(r,a)),n.points.push(vt(i,o))})}function pr(e){x(e.edges(),function(t){var n=e.edge(t);if(Object.prototype.hasOwnProperty.call(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset;break}})}function mr(e){x(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}function hr(e){x(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(D(n.borderLeft)),o=e.node(D(n.borderRight));n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),x(e.nodes(),function(t){e.node(t).dummy===`border`&&e.removeNode(t)})}function gr(e){x(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function _r(e){x(H(e),function(t){var n=0;x(t,function(t,r){var i=e.node(t);i.order=r+n,x(i.selfEdges,function(t){V(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function vr(e){x(e.nodes(),function(t){var n=e.node(t);if(n.dummy===`selfedge`){var r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function Q(e,t){return A(F(e,t),Number)}function $(e){var t={};return x(e,function(e,n){t[n.toLowerCase()]=e}),t}export{Yn as t};
1
+ import{C as e,D as t,E as n,G as r,N as i,P as a,V as o,j as s,k as c,n as l,p as u,v as d,w as f,z as p}from"./isArrayLikeObject-B_v2FtYn.js";import{C as m,E as ee,M as h,N as te,S as ne,a as g,c as re,d as ie,f as _,i as v,m as ae,n as y,p as oe,r as b,s as x,y as se}from"./_baseUniq-BT4Ow4Kk.js";import{a as ce,c as le,d as ue,f as S,i as de,l as C,m as w,n as T,o as fe,r as pe,s as E,t as me,u as D}from"./_basePickBy-5PGDJbfF.js";import{i as he,n as ge}from"./isEmpty-bnrF3Qbc.js";import{k as O}from"./chunk-GEFDOKGD-BbQkJu8C.js";import{t as k}from"./graphlib-BcsNnGcW.js";function _e(e){return i(t(e,void 0,S),e+``)}var ve=RegExp(`[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]`);function ye(e){return ve.test(e)}var be=1,xe=4;function Se(e){return se(e,be|xe)}var Ce=function(){return r.Date.now()};function we(e,t){return e==null?e:l(e,re(t),u)}function Te(e,t){return e&&ie(e,re(t))}function Ee(e,t){return e>t}function A(e,t){var n={};return t=_(t,3),ie(e,function(e,r,i){s(n,r,t(e,r,i))}),n}function j(e){return e&&e.length?pe(e,p,Ee):void 0}function M(e,t){return e&&e.length?pe(e,_(t,2),de):void 0}function De(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function Oe(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=te(e),o=t!==void 0,s=t===null,c=t===t,l=te(t);if(!s&&!l&&!a&&e>t||a&&o&&c&&!s&&!l||r&&o&&c||!n&&c||!i)return 1;if(!r&&!a&&!l&&e<t||l&&n&&i&&!r&&!a||s&&n&&i||!o&&i||!c)return-1}return 0}function ke(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=Oe(i[r],a[r]);if(c)return r>=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function Ae(e,t,n){t=t.length?h(t,function(e){return o(e)?function(t){return m(t,e.length===1?e[0]:e)}:e}):[p];var r=-1;return t=h(t,d(_)),De(le(e,function(e,n,i){return{criteria:h(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return ke(e,t,n)})}var je=oe(`length`),Me=`\\ud800-\\udfff`,Ne=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,Pe=`\\ufe0e\\ufe0f`,Fe=`[`+Me+`]`,N=`[`+Ne+`]`,P=`\\ud83c[\\udffb-\\udfff]`,Ie=`(?:`+N+`|`+P+`)`,Le=`[^`+Me+`]`,Re=`(?:\\ud83c[\\udde6-\\uddff]){2}`,ze=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Be=`\\u200d`,Ve=Ie+`?`,He=`[`+Pe+`]?`,Ue=`(?:`+Be+`(?:`+[Le,Re,ze].join(`|`)+`)`+He+Ve+`)*`,We=He+Ve+Ue,Ge=`(?:`+[Le+N+`?`,N,Re,ze,Fe].join(`|`)+`)`,Ke=RegExp(P+`(?=`+P+`)|`+Ge+We,`g`);function qe(e){for(var t=Ke.lastIndex=0;Ke.test(e);)++t;return t}function Je(e){return ye(e)?qe(e):je(e)}function Ye(e,t){return me(e,t,function(t,n){return ae(e,n)})}var F=_e(function(e,t){return e==null?{}:Ye(e,t)}),Xe=Math.ceil,Ze=Math.max;function Qe(e,t,n,r){for(var i=-1,a=Ze(Xe((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}function $e(t){return function(n,r,i){return i&&typeof i!=`number`&&e(n,r,i)&&(r=i=void 0),n=w(n),r===void 0?(r=n,n=0):r=w(r),i=i===void 0?n<r?1:-1:w(i),Qe(n,r,i,t)}}var I=$e(),et=`[object Map]`,tt=`[object Set]`;function nt(e){if(e==null)return 0;if(f(e))return ce(e)?Je(e):e.length;var t=ge(e);return t==et||t==tt?e.size:he(e).length}var L=n(function(t,n){if(t==null)return[];var r=n.length;return r>1&&e(t,n[0],n[1])?n=[]:r>2&&e(n[0],n[1],n[2])&&(n=[n[0]]),Ae(t,ne(n,1),[])}),rt=0;function R(e){var t=++rt;return ee(e)+t}function it(e,t,n){for(var r=-1,i=e.length,a=t.length,o={};++r<i;){var s=r<a?t[r]:void 0;n(o,e[r],s)}return o}function at(e,t){return it(e||[],t||[],c)}var ot=class{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,t=e._prev;if(t!==e)return st(t),t}enqueue(e){var t=this._sentinel;e._prev&&e._next&&st(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,ct)),n=n._prev;return`[`+e.join(`, `)+`]`}};function st(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function ct(e,t){if(e!==`_next`&&e!==`_prev`)return t}var lt=a(1);function ut(e,t){if(e.nodeCount()<=1)return[];var n=ft(e,t||lt);return S(E(dt(n.graph,n.buckets,n.zeroIdx),function(t){return e.outEdges(t.v,t.w)}))}function dt(e,t,n){for(var r=[],i=t[t.length-1],a=t[0],o;e.nodeCount();){for(;o=a.dequeue();)z(e,t,n,o);for(;o=i.dequeue();)z(e,t,n,o);if(e.nodeCount()){for(var s=t.length-2;s>0;--s)if(o=t[s].dequeue(),o){r=r.concat(z(e,t,n,o,!0));break}}}return r}function z(e,t,n,r,i){var a=i?[]:void 0;return x(e.inEdges(r.v),function(r){var o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,B(t,n,s)}),x(e.outEdges(r.v),function(r){var i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,B(t,n,o)}),e.removeNode(r.v),a}function ft(e,t){var n=new k,r=0,i=0;x(e.nodes(),function(e){n.setNode(e,{v:e,in:0,out:0})}),x(e.edges(),function(e){var a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s),i=Math.max(i,n.node(e.v).out+=o),r=Math.max(r,n.node(e.w).in+=o)});var a=I(i+r+3).map(function(){return new ot}),o=r+1;return x(n.nodes(),function(e){B(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function B(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function pt(e){x(e.graph().acyclicer===`greedy`?ut(e,t(e)):mt(e),function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,R(`rev`))});function t(e){return function(t){return e.edge(t).weight}}}function mt(e){var t=[],n={},r={};function i(a){Object.prototype.hasOwnProperty.call(r,a)||(r[a]=!0,n[a]=!0,x(e.outEdges(a),function(e){Object.prototype.hasOwnProperty.call(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return x(e.nodes(),i),t}function ht(e){x(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function V(e,t,n,r){var i;do i=R(r);while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function gt(e){var t=new k().setGraph(e.graph());return x(e.nodes(),function(n){t.setNode(n,e.node(n))}),x(e.edges(),function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function _t(e){var t=new k({multigraph:e.isMultigraph()}).setGraph(e.graph());return x(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),x(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t}function vt(e,t){var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);var c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function H(e){var t=E(I(St(e)+1),function(){return[]});return x(e.nodes(),function(n){var r=e.node(n),i=r.rank;b(i)||(t[i][r.order]=n)}),t}function yt(e){var t=T(E(e.nodes(),function(t){return e.node(t).rank}));x(e.nodes(),function(n){var r=e.node(n);fe(r,`rank`)&&(r.rank-=t)})}function bt(e){var t=T(E(e.nodes(),function(t){return e.node(t).rank})),n=[];x(e.nodes(),function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=e.graph().nodeRankFactor;x(n,function(t,n){b(t)&&n%i!==0?--r:r&&x(t,function(t){e.node(t).rank+=r})})}function xt(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),V(e,`border`,i,t)}function St(e){return j(E(e.nodes(),function(t){var n=e.node(t).rank;if(!b(n))return n}))}function Ct(e,t){var n={lhs:[],rhs:[]};return x(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function wt(e,t){var n=Ce();try{return t()}finally{console.log(e+` time: `+(Ce()-n)+`ms`)}}function Tt(e,t){return t()}function Et(e){function t(n){var r=e.children(n),i=e.node(n);if(r.length&&x(r,t),Object.prototype.hasOwnProperty.call(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;a<o;++a)Dt(e,`borderLeft`,`_bl`,n,i,a),Dt(e,`borderRight`,`_br`,n,i,a)}}x(e.children(),t)}function Dt(e,t,n,r,i,a){var o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=V(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function Ot(e){var t=e.graph().rankdir.toLowerCase();(t===`lr`||t===`rl`)&&At(e)}function kt(e){var t=e.graph().rankdir.toLowerCase();(t===`bt`||t===`rl`)&&jt(e),(t===`lr`||t===`rl`)&&(Mt(e),At(e))}function At(e){x(e.nodes(),function(t){U(e.node(t))}),x(e.edges(),function(t){U(e.edge(t))})}function U(e){var t=e.width;e.width=e.height,e.height=t}function jt(e){x(e.nodes(),function(t){W(e.node(t))}),x(e.edges(),function(t){var n=e.edge(t);x(n.points,W),Object.prototype.hasOwnProperty.call(n,`y`)&&W(n)})}function W(e){e.y=-e.y}function Mt(e){x(e.nodes(),function(t){G(e.node(t))}),x(e.edges(),function(t){var n=e.edge(t);x(n.points,G),Object.prototype.hasOwnProperty.call(n,`x`)&&G(n)})}function G(e){var t=e.x;e.x=e.y,e.y=t}function Nt(e){e.graph().dummyChains=[],x(e.edges(),function(t){Pt(e,t)})}function Pt(e,t){var n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a!==r+1){e.removeEdge(t);var l=void 0,u,d;for(d=0,++r;r<a;++d,++r)s.points=[],l={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},u=V(e,`edge`,l,`_d`),r===c&&(l.width=s.width,l.height=s.height,l.dummy=`edge-label`,l.labelpos=s.labelpos),e.setEdge(n,u,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(u),n=u;e.setEdge(n,i,{weight:s.weight},o)}}function Ft(e){x(e.graph().dummyChains,function(t){var n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function K(e){var t={};function n(r){var i=e.node(r);if(Object.prototype.hasOwnProperty.call(t,r))return i.rank;t[r]=!0;var a=T(E(e.outEdges(r),function(t){return n(t.w)-e.edge(t).minlen}));return(a===1/0||a==null)&&(a=0),i.rank=a}x(e.sources(),n)}function q(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}function It(e){var t=new k({directed:!1}),n=e.nodes()[0],r=e.nodeCount();t.setNode(n,{});for(var i,a;Lt(t,e)<r;)i=Rt(t,e),a=t.hasNode(i.v)?q(e,i):-q(e,i),zt(t,e,a);return t}function Lt(e,t){function n(r){x(t.nodeEdges(r),function(i){var a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!q(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return x(e.nodes(),n),e.nodeCount()}function Rt(e,t){return M(t.edges(),function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return q(t,n)})}function zt(e,t,n){x(e.nodes(),function(e){t.node(e).rank+=n})}a(1),a(1),Bt.CycleException=J;function Bt(e){var t={},n={},r=[];function i(a){if(Object.prototype.hasOwnProperty.call(n,a))throw new J;Object.prototype.hasOwnProperty.call(t,a)||(n[a]=!0,t[a]=!0,x(e.predecessors(a),i),delete n[a],r.push(a))}if(x(e.sinks(),i),nt(t)!==e.nodeCount())throw new J;return r}function J(){}J.prototype=Error();function Vt(e,t,n){o(t)||(t=[t]);var r=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],a={};return x(t,function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);Ht(e,t,n===`post`,a,r,i)}),i}function Ht(e,t,n,r,i,a){Object.prototype.hasOwnProperty.call(r,t)||(r[t]=!0,n||a.push(t),x(i(t),function(t){Ht(e,t,n,r,i,a)}),n&&a.push(t))}function Ut(e,t){return Vt(e,t,`post`)}function Wt(e,t){return Vt(e,t,`pre`)}Y.initLowLimValues=Z,Y.initCutValues=X,Y.calcCutValue=Kt,Y.leaveEdge=Jt,Y.enterEdge=Yt,Y.exchangeEdges=Xt;function Y(e){e=gt(e),K(e);var t=It(e);Z(t),X(t,e);for(var n,r;n=Jt(t);)r=Yt(t,e,n),Xt(t,e,n,r)}function X(e,t){var n=Ut(e,e.nodes());n=n.slice(0,n.length-1),x(n,function(n){Gt(e,t,n)})}function Gt(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=Kt(e,t,n)}function Kt(e,t,n){var r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;return a||=(i=!1,t.edge(r,n)),o=a.weight,x(t.nodeEdges(n),function(a){var s=a.v===n,c=s?a.w:a.v;if(c!==r){var l=s===i,u=t.edge(a).weight;if(o+=l?u:-u,Qt(e,n,c)){var d=e.edge(n,c).cutvalue;o+=l?-d:d}}}),o}function Z(e,t){arguments.length<2&&(t=e.nodes()[0]),qt(e,{},1,t)}function qt(e,t,n,r,i){var a=n,o=e.node(r);return t[r]=!0,x(e.neighbors(r),function(i){Object.prototype.hasOwnProperty.call(t,i)||(n=qt(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function Jt(e){return C(e.edges(),function(t){return e.edge(t).cutvalue<0})}function Yt(e,t,n){var r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);var a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),M(g(t.edges(),function(t){return c===$t(e,e.node(t.v),s)&&c!==$t(e,e.node(t.w),s)}),function(e){return q(t,e)})}function Xt(e,t,n,r){var i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),Z(e),X(e,t),Zt(e,t)}function Zt(e,t){var n=Wt(e,C(e.nodes(),function(e){return!t.node(e).parent}));n=n.slice(1),x(n,function(n){var r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function Qt(e,t,n){return e.hasEdge(t,n)}function $t(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}function en(e){switch(e.graph().ranker){case`network-simplex`:rn(e);break;case`tight-tree`:nn(e);break;case`longest-path`:tn(e);break;default:rn(e)}}var tn=K;function nn(e){K(e),It(e)}function rn(e){Y(e)}function an(e){var t=V(e,`root`,{},`_root`),n=sn(e),r=j(v(n))-1,i=2*r+1;e.graph().nestingRoot=t,x(e.edges(),function(t){e.edge(t).minlen*=i});var a=cn(e)+1;x(e.children(),function(o){on(e,t,i,a,r,n,o)}),e.graph().nodeRankFactor=i}function on(e,t,n,r,i,a,o){var s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}var c=xt(e,`_bt`),l=xt(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,x(s,function(s){on(e,t,n,r,i,a,s);var u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-a[o]+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+a[o]})}function sn(e){var t={};function n(r,i){var a=e.children(r);a&&a.length&&x(a,function(e){n(e,i+1)}),t[r]=i}return x(e.children(),function(e){n(e,1)}),t}function cn(e){return y(e.edges(),function(t,n){return t+e.edge(n).weight},0)}function ln(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,x(e.edges(),function(t){e.edge(t).nestingEdge&&e.removeEdge(t)})}function un(e,t,n){var r={},i;x(n,function(n){for(var a=e.parent(n),o,s;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function dn(e,t,n){var r=fn(e),i=new k({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(t){return e.node(t)});return x(e.nodes(),function(a){var o=e.node(a),s=e.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||r),x(e[n](a),function(t){var n=t.v===a?t.w:t.v,r=i.edge(n,a),o=b(r)?0:r.weight;i.setEdge(n,a,{weight:e.edge(t).weight+o})}),Object.prototype.hasOwnProperty.call(o,`minRank`)&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function fn(e){for(var t;e.hasNode(t=R(`_root`)););return t}function pn(e,t){for(var n=0,r=1;r<t.length;++r)n+=mn(e,t[r-1],t[r]);return n}function mn(e,t,n){for(var r=at(n,E(n,function(e,t){return t})),i=S(E(t,function(t){return L(E(e.outEdges(t),function(t){return{pos:r[t.w],weight:e.edge(t).weight}}),`pos`)})),a=1;a<n.length;)a<<=1;var o=2*a-1;--a;var s=E(Array(o),function(){return 0}),c=0;return x(i.forEach(function(e){var t=e.pos+a;s[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n})),c}function hn(e){var t={},n=g(e.nodes(),function(t){return!e.children(t).length}),r=E(I(j(E(n,function(t){return e.node(t).rank}))+1),function(){return[]});function i(n){fe(t,n)||(t[n]=!0,r[e.node(n).rank].push(n),x(e.successors(n),i))}return x(L(n,function(t){return e.node(t).rank}),i),r}function gn(e,t){return E(t,function(t){var n=e.inEdges(t);if(n.length){var r=y(n,function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}else return{v:t}})}function _n(e,t){var n={};return x(e,function(e,t){var r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};b(e.barycenter)||(r.barycenter=e.barycenter,r.weight=e.weight)}),x(t.edges(),function(e){var t=n[e.v],r=n[e.w];!b(t)&&!b(r)&&(r.indegree++,t.out.push(n[e.w]))}),vn(g(n,function(e){return!e.indegree}))}function vn(e){var t=[];function n(e){return function(t){t.merged||(b(t.barycenter)||b(e.barycenter)||t.barycenter>=e.barycenter)&&yn(e,t)}}function r(t){return function(n){n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){var i=e.pop();t.push(i),x(i.in.reverse(),n(i)),x(i.out,r(i))}return E(g(t,function(e){return!e.merged}),function(e){return F(e,[`vs`,`i`,`barycenter`,`weight`])})}function yn(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function bn(e,t){var n=Ct(e,function(e){return Object.prototype.hasOwnProperty.call(e,`barycenter`)}),r=n.lhs,i=L(n.rhs,function(e){return-e.i}),a=[],o=0,s=0,c=0;r.sort(Sn(!!t)),c=xn(a,i,c),x(r,function(e){c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=xn(a,i,c)});var l={vs:S(a)};return s&&(l.barycenter=o/s,l.weight=s),l}function xn(e,t,n){for(var r;t.length&&(r=D(t)).i<=n;)t.pop(),e.push(r.vs),n++;return n}function Sn(e){return function(t,n){return t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}}function Cn(e,t,n,r){var i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};o&&(i=g(i,function(e){return e!==o&&e!==s}));var l=gn(e,i);x(l,function(t){if(e.children(t.v).length){var i=Cn(e,t.v,n,r);c[t.v]=i,Object.prototype.hasOwnProperty.call(i,`barycenter`)&&Tn(t,i)}});var u=_n(l,n);wn(u,c);var d=bn(u,r);if(o&&(d.vs=S([o,d.vs,s]),e.predecessors(o).length)){var f=e.node(e.predecessors(o)[0]),p=e.node(e.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(d,`barycenter`)||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function wn(e,t){x(e,function(e){e.vs=S(e.vs.map(function(e){return t[e]?t[e].vs:e}))})}function Tn(e,t){b(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function En(e){var t=St(e),n=Dn(e,I(1,t+1),`inEdges`),r=Dn(e,I(t-1,-1,-1),`outEdges`),i=hn(e);kn(e,i);for(var a=1/0,o,s=0,c=0;c<4;++s,++c){On(s%2?n:r,s%4>=2),i=H(e);var l=pn(e,i);l<a&&(c=0,o=Se(i),a=l)}kn(e,o)}function Dn(e,t,n){return E(t,function(t){return dn(e,t,n)})}function On(e,t){var n=new k;x(e,function(e){var r=e.graph().root,i=Cn(e,r,n,t);x(i.vs,function(t,n){e.node(t).order=n}),un(e,n,i.vs)})}function kn(e,t){x(t,function(t){x(t,function(t,n){e.node(t).order=n})})}function An(e){var t=Mn(e);x(e.graph().dummyChains,function(n){for(var r=e.node(n),i=r.edgeObj,a=jn(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(l=o[c+1]).minRank<=r.rank;)c++;l=o[c]}e.setParent(n,l),n=e.successors(n)[0]}})}function jn(e,t,n,r){var i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c=n,l;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));for(l=c,c=r;(c=e.parent(c))!==l;)a.push(c);return{path:i.concat(a.reverse()),lca:l}}function Mn(e){var t={},n=0;function r(i){var a=n;x(e.children(i),r),t[i]={low:a,lim:n++}}return x(e.children(),r),t}function Nn(e,t){var n={};function r(t,r){var i=0,a=0,o=t.length,s=D(r);return x(r,function(t,c){var l=Fn(e,t),u=l?e.node(l).order:o;(l||t===s)&&(x(r.slice(a,c+1),function(t){x(e.predecessors(t),function(r){var a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&In(n,r,t)})}),a=c+1,i=u)}),r}return y(t,r),n}function Pn(e,t){var n={};function r(t,r,i,a,o){var s;x(I(r,i),function(r){s=t[r],e.node(s).dummy&&x(e.predecessors(s),function(t){var r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&In(n,t,s)})})}function i(t,n){var i=-1,a,o=0;return x(n,function(s,c){if(e.node(s).dummy===`border`){var l=e.predecessors(s);l.length&&(a=e.node(l[0]).order,r(n,o,c,i,a),o=c,i=a)}r(n,o,n.length,a,t.length)}),n}return y(t,i),n}function Fn(e,t){if(e.node(t).dummy)return C(e.predecessors(t),function(t){return e.node(t).dummy})}function In(e,t,n){if(t>n){var r=t;t=n,n=r}Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[t];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Ln(e,t,n){if(t>n){var r=t;t=n,n=r}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],n)}function Rn(e,t,n,r){var i={},a={},o={};return x(t,function(e){x(e,function(e,t){i[e]=e,a[e]=e,o[e]=t})}),x(t,function(e){var t=-1;x(e,function(e){var s=r(e);if(s.length){s=L(s,function(e){return o[e]});for(var c=(s.length-1)/2,l=Math.floor(c),u=Math.ceil(c);l<=u;++l){var d=s[l];a[e]===e&&t<o[d]&&!Ln(n,e,d)&&(a[d]=e,a[e]=i[e]=i[d],t=o[d])}}})}),{root:i,align:a}}function zn(e,t,n,r,i){var a={},o=Bn(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){for(var n=o.nodes(),r=n.pop(),i={};r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}function l(e){a[e]=o.inEdges(e).reduce(function(e,t){return Math.max(e,a[t.v]+o.edge(t))},0)}function u(t){var n=o.outEdges(t).reduce(function(e,t){return Math.min(e,a[t.w]-o.edge(t))},1/0),r=e.node(t);n!==1/0&&r.borderType!==s&&(a[t]=Math.max(a[t],n))}return c(l,o.predecessors.bind(o)),c(u,o.successors.bind(o)),x(r,function(e){a[e]=a[n[e]]}),a}function Bn(e,t,n,r){var i=new k,a=e.graph(),o=Gn(a.nodesep,a.edgesep,r);return x(t,function(t){var r;x(t,function(t){var a=n[t];if(i.setNode(a),r){var s=n[r],c=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),c||0))}r=t})}),i}function Vn(e,t){return M(v(t),function(t){var n=-1/0,r=1/0;return we(t,function(t,i){var a=Kn(e,i)/2;n=Math.max(t+a,n),r=Math.min(t-a,r)}),n-r})}function Hn(e,t){var n=v(t),r=T(n),i=j(n);x([`u`,`d`],function(n){x([`l`,`r`],function(a){var o=n+a,s=e[o],c;if(s!==t){var l=v(s);c=a===`l`?r-T(l):i-j(l),c&&(e[o]=A(s,function(e){return e+c}))}})})}function Un(e,t){return A(e.ul,function(n,r){if(t)return e[t.toLowerCase()][r];var i=L(E(e,r));return(i[1]+i[2])/2})}function Wn(e){var t=H(e),n=O(Nn(e,t),Pn(e,t)),r={},i;return x([`u`,`d`],function(a){i=a===`u`?t:v(t).reverse(),x([`l`,`r`],function(t){t===`r`&&(i=E(i,function(e){return v(e).reverse()}));var o=(a===`u`?e.predecessors:e.successors).bind(e),s=Rn(e,i,n,o),c=zn(e,i,s.root,s.align,t===`r`);t===`r`&&(c=A(c,function(e){return-e})),r[a+t]=c})}),Hn(r,Vn(e,r)),Un(r,e.graph().align)}function Gn(e,t,n){return function(r,i,a){var o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.prototype.hasOwnProperty.call(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2;break}if(l&&(c+=n?l:-l),l=0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.prototype.hasOwnProperty.call(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2;break}return l&&(c+=n?l:-l),l=0,c}}function Kn(e,t){return e.node(t).width}function qn(e){e=_t(e),Jn(e),Te(Wn(e),function(t,n){e.node(n).x=t})}function Jn(e){var t=H(e),n=e.graph().ranksep,r=0;x(t,function(t){var i=j(E(t,function(t){return e.node(t).height}));x(t,function(t){e.node(t).y=r+i/2}),r+=i+n})}function Yn(e,t){var n=t&&t.debugTiming?wt:Tt;n(`layout`,()=>{var t=n(` buildLayoutGraph`,()=>or(e));n(` runLayout`,()=>Xn(t,n)),n(` updateInputGraph`,()=>Zn(e,t))})}function Xn(e,t){t(` makeSpaceForEdgeLabels`,()=>sr(e)),t(` removeSelfEdges`,()=>gr(e)),t(` acyclic`,()=>pt(e)),t(` nestingGraph.run`,()=>an(e)),t(` rank`,()=>en(_t(e))),t(` injectEdgeLabelProxies`,()=>cr(e)),t(` removeEmptyRanks`,()=>bt(e)),t(` nestingGraph.cleanup`,()=>ln(e)),t(` normalizeRanks`,()=>yt(e)),t(` assignRankMinMax`,()=>lr(e)),t(` removeEdgeLabelProxies`,()=>ur(e)),t(` normalize.run`,()=>Nt(e)),t(` parentDummyChains`,()=>An(e)),t(` addBorderSegments`,()=>Et(e)),t(` order`,()=>En(e)),t(` insertSelfEdges`,()=>_r(e)),t(` adjustCoordinateSystem`,()=>Ot(e)),t(` position`,()=>qn(e)),t(` positionSelfEdges`,()=>vr(e)),t(` removeBorderNodes`,()=>hr(e)),t(` normalize.undo`,()=>Ft(e)),t(` fixupEdgeLabelCoords`,()=>pr(e)),t(` undoCoordinateSystem`,()=>kt(e)),t(` translateGraph`,()=>dr(e)),t(` assignNodeIntersects`,()=>fr(e)),t(` reversePoints`,()=>mr(e)),t(` acyclic.undo`,()=>ht(e))}function Zn(e,t){x(e.nodes(),function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))}),x(e.edges(),function(n){var r=e.edge(n),i=t.edge(n);r.points=i.points,Object.prototype.hasOwnProperty.call(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var Qn=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],$n={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},er=[`acyclicer`,`ranker`,`rankdir`,`align`],tr=[`width`,`height`],nr={width:0,height:0},rr=[`minlen`,`weight`,`width`,`height`,`labeloffset`],ir={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},ar=[`labelpos`];function or(e){var t=new k({multigraph:!0,compound:!0}),n=$(e.graph());return t.setGraph(O({},$n,Q(n,Qn),F(n,er))),x(e.nodes(),function(n){var r=$(e.node(n));t.setNode(n,ue(Q(r,tr),nr)),t.setParent(n,e.parent(n))}),x(e.edges(),function(n){var r=$(e.edge(n));t.setEdge(n,O({},ir,Q(r,rr),F(r,ar)))}),t}function sr(e){var t=e.graph();t.ranksep/=2,x(e.edges(),function(n){var r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function cr(e){x(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v);V(e,`edge-proxy`,{rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t},`_ep`)}})}function lr(e){var t=0;x(e.nodes(),function(n){var r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=j(t,r.maxRank))}),e.graph().maxRank=t}function ur(e){x(e.nodes(),function(t){var n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function dr(e){var t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){var a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}x(e.nodes(),function(t){c(e.node(t))}),x(e.edges(),function(t){var n=e.edge(t);Object.prototype.hasOwnProperty.call(n,`x`)&&c(n)}),t-=o,r-=s,x(e.nodes(),function(n){var i=e.node(n);i.x-=t,i.y-=r}),x(e.edges(),function(n){var i=e.edge(n);x(i.points,function(e){e.x-=t,e.y-=r}),Object.prototype.hasOwnProperty.call(i,`x`)&&(i.x-=t),Object.prototype.hasOwnProperty.call(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function fr(e){x(e.edges(),function(t){var n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(vt(r,a)),n.points.push(vt(i,o))})}function pr(e){x(e.edges(),function(t){var n=e.edge(t);if(Object.prototype.hasOwnProperty.call(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset;break}})}function mr(e){x(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}function hr(e){x(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(D(n.borderLeft)),o=e.node(D(n.borderRight));n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),x(e.nodes(),function(t){e.node(t).dummy===`border`&&e.removeNode(t)})}function gr(e){x(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function _r(e){x(H(e),function(t){var n=0;x(t,function(t,r){var i=e.node(t);i.order=r+n,x(i.selfEdges,function(t){V(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function vr(e){x(e.nodes(),function(t){var n=e.node(t);if(n.dummy===`selfedge`){var r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function Q(e,t){return A(F(e,t),Number)}function $(e){var t={};return x(e,function(e,n){t[n.toLowerCase()]=e}),t}export{Yn as t};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./_baseUniq-BT4Ow4Kk.js";import{s as t}from"./_basePickBy-5PGDJbfF.js";import{t as n}from"./dagre-DHq9bhnd.js";import"./chunk-GEFDOKGD-D-pKjlVd.js";import{t as r}from"./clone-LRxlvnMj.js";import{t as i}from"./graphlib-BcsNnGcW.js";import{g as a,h as o}from"./src-BqX54PbV.js";import{b as s}from"./chunk-7R4GIKGN-Dv-4cAYn.js";import"./dist-CSJdAyA9.js";import"./chunk-PU5JKC2W-ek7k4QVB.js";import"./chunk-MX3YWQON-BpS_PtKp.js";import{n as c}from"./chunk-YBOYWFTD-rQG3QH5s.js";import"./chunk-PQ6SQG4A-TF58UVMU.js";import{a as l,c as u,i as d,l as f,n as p,t as m,u as h}from"./chunk-KYZI473N-Bb0MCaIO.js";import{a as g,i as _,n as v,r as y,t as b}from"./chunk-O4XLMI2P-nDhi_cVu.js";function x(t){var n={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:S(t),edges:C(t)};return e(t.graph())||(n.value=r(t.graph())),n}function S(n){return t(n.nodes(),function(t){var r=n.node(t),i=n.parent(t),a={v:t};return e(r)||(a.value=r),e(i)||(a.parent=i),a})}function C(n){return t(n.edges(),function(t){var r=n.edge(t),i={v:t.v,w:t.w};return e(t.name)||(i.name=t.name),e(r)||(i.value=r),i})}var w=new Map,T=new Map,E=new Map,D=o(()=>{T.clear(),E.clear(),w.clear()},`clear`),O=o((e,t)=>{let n=T.get(t)||[];return a.trace(`In isDescendant`,t,` `,e,` = `,n.includes(e)),n.includes(e)},`isDescendant`),k=o((e,t)=>{let n=T.get(t)||[];return a.info(`Descendants of `,t,` is `,n),a.info(`Edge is `,e),e.v===t||e.w===t?!1:n?n.includes(e.v)||O(e.v,t)||O(e.w,t)||n.includes(e.w):(a.debug(`Tilt, `,t,`,not in descendants`),!1)},`edgeInCluster`),A=o((e,t,n,r)=>{a.warn(`Copying children of `,e,`root`,r,`data`,t.node(e),r);let i=t.children(e)||[];e!==r&&i.push(e),a.warn(`Copying (nodes) clusterId`,e,`nodes`,i),i.forEach(i=>{if(t.children(i).length>0)A(i,t,n,r);else{let o=t.node(i);a.info(`cp `,i,` to `,r,` with parent `,e),n.setNode(i,o),r!==t.parent(i)&&(a.warn(`Setting parent`,i,t.parent(i)),n.setParent(i,t.parent(i))),e!==r&&i!==e?(a.debug(`Setting parent`,i,e),n.setParent(i,e)):(a.info(`In copy `,e,`root`,r,`data`,t.node(e),r),a.debug(`Not Setting parent for node=`,i,`cluster!==rootId`,e!==r,`node!==clusterId`,i!==e));let s=t.edges(i);a.debug(`Copying Edges`,s),s.forEach(i=>{a.info(`Edge`,i);let o=t.edge(i.v,i.w,i.name);a.info(`Edge data`,o,r);try{k(i,r)?(a.info(`Copying as `,i.v,i.w,o,i.name),n.setEdge(i.v,i.w,o,i.name),a.info(`newGraph edges `,n.edges(),n.edge(n.edges()[0]))):a.info(`Skipping copy of edge `,i.v,`-->`,i.w,` rootId: `,r,` clusterId:`,e)}catch(e){a.error(e)}})}a.debug(`Removing node`,i),t.removeNode(i)})},`copy`),j=o((e,t)=>{let n=t.children(e),r=[...n];for(let i of n)E.set(i,e),r=[...r,...j(i,t)];return r},`extractDescendants`),M=o((e,t,n)=>{let r=e.edges().filter(e=>e.v===t||e.w===t),i=e.edges().filter(e=>e.v===n||e.w===n),a=r.map(e=>({v:e.v===t?n:e.v,w:e.w===t?t:e.w})),o=i.map(e=>({v:e.v,w:e.w}));return a.filter(e=>o.some(t=>e.v===t.v&&e.w===t.w))},`findCommonEdges`),N=o((e,t,n)=>{let r=t.children(e);if(a.trace(`Searching children of id `,e,r),r.length<1)return e;let i;for(let e of r){let r=N(e,t,n),a=M(t,n,r);if(r)if(a.length>0)i=r;else return r}return i},`findNonClusterChild`),P=o(e=>!w.has(e)||!w.get(e).externalConnections?e:w.has(e)?w.get(e).id:e,`getAnchorId`),F=o((e,t)=>{if(!e||t>10){a.debug(`Opting out, no graph `);return}else a.debug(`Opting in, graph `);e.nodes().forEach(function(t){e.children(t).length>0&&(a.warn(`Cluster identified`,t,` Replacement id in edges: `,N(t,e,t)),T.set(t,j(t,e)),w.set(t,{id:N(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){let n=e.children(t),r=e.edges();n.length>0?(a.debug(`Cluster identified`,t,T),r.forEach(e=>{O(e.v,t)^O(e.w,t)&&(a.warn(`Edge: `,e,` leaves cluster `,t),a.warn(`Descendants of XXX `,t,`: `,T.get(t)),w.get(t).externalConnections=!0)})):a.debug(`Not a cluster `,t,T)});for(let t of w.keys()){let n=w.get(t).id,r=e.parent(n);r!==t&&w.has(r)&&!w.get(r).externalConnections&&(w.get(t).id=r)}e.edges().forEach(function(t){let n=e.edge(t);a.warn(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(t)),a.warn(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(e.edge(t)));let r=t.v,i=t.w;if(a.warn(`Fix XXX`,w,`ids:`,t.v,t.w,`Translating: `,w.get(t.v),` --- `,w.get(t.w)),w.get(t.v)||w.get(t.w)){if(a.warn(`Fixing and trying - removing XXX`,t.v,t.w,t.name),r=P(t.v),i=P(t.w),e.removeEdge(t.v,t.w,t.name),r!==t.v){let i=e.parent(r);w.get(i).externalConnections=!0,n.fromCluster=t.v}if(i!==t.w){let r=e.parent(i);w.get(r).externalConnections=!0,n.toCluster=t.w}a.warn(`Fix Replacing with XXX`,r,i,t.name),e.setEdge(r,i,n,t.name)}}),a.warn(`Adjusted Graph`,x(e)),I(e,0),a.trace(w)},`adjustClustersAndEdges`),I=o((e,t)=>{if(a.warn(`extractor - `,t,x(e),e.children(`D`)),t>10){a.error(`Bailing out`);return}let n=e.nodes(),r=!1;for(let t of n){let n=e.children(t);r||=n.length>0}if(!r){a.debug(`Done, no node has children`,e.nodes());return}a.debug(`Nodes = `,n,t);for(let r of n)if(a.debug(`Extracting node`,r,w,w.has(r)&&!w.get(r).externalConnections,!e.parent(r),e.node(r),e.children(`D`),` Depth `,t),!w.has(r))a.debug(`Not a cluster`,r,t);else if(!w.get(r).externalConnections&&e.children(r)&&e.children(r).length>0){a.warn(`Cluster without external connections, without a parent and with children`,r,t);let n=e.graph().rankdir===`TB`?`LR`:`TB`;w.get(r)?.clusterData?.dir&&(n=w.get(r).clusterData.dir,a.warn(`Fixing dir`,w.get(r).clusterData.dir,n));let o=new i({multigraph:!0,compound:!0}).setGraph({rankdir:n,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});a.warn(`Old graph before copy`,x(e)),A(r,e,o,r),e.setNode(r,{clusterNode:!0,id:r,clusterData:w.get(r).clusterData,label:w.get(r).label,graph:o}),a.warn(`New graph after copy node: (`,r,`)`,x(o)),a.debug(`Old graph after copy`,x(e))}else a.warn(`Cluster ** `,r,` **not meeting the criteria !externalConnections:`,!w.get(r).externalConnections,` no parent: `,!e.parent(r),` children `,e.children(r)&&e.children(r).length>0,e.children(`D`),t),a.debug(w);n=e.nodes(),a.warn(`New list of nodes`,n);for(let r of n){let n=e.node(r);a.warn(` Now next level`,r,n),n?.clusterNode&&I(n.graph,t+1)}},`extractor`),L=o((e,t)=>{if(t.length===0)return[];let n=Object.assign([],t);return t.forEach(t=>{let r=L(e,e.children(t));n=[...n,...r]}),n},`sorter`),R=o(e=>L(e,e.children()),`sortNodesByHierarchy`),z=o(async(e,t,r,i,s,p)=>{a.warn(`Graph in recursive render:XAX`,x(t),s);let m=t.graph().rankdir;a.trace(`Dir in recursive render - dir:`,m);let _=e.insert(`g`).attr(`class`,`root`);t.nodes()?a.info(`Recursive render XXX`,t.nodes()):a.info(`No nodes found for`,t),t.edges().length>0&&a.info(`Recursive edges`,t.edge(t.edges()[0]));let b=_.insert(`g`).attr(`class`,`clusters`),S=_.insert(`g`).attr(`class`,`edgePaths`),C=_.insert(`g`).attr(`class`,`edgeLabels`),T=_.insert(`g`).attr(`class`,`nodes`);await Promise.all(t.nodes().map(async function(e){let n=t.node(e);if(s!==void 0){let n=JSON.parse(JSON.stringify(s.clusterData));a.trace(`Setting data for parent cluster XXX
1
+ import{r as e}from"./_baseUniq-BT4Ow4Kk.js";import{s as t}from"./_basePickBy-5PGDJbfF.js";import{t as n}from"./dagre-Dbb5k38K.js";import"./chunk-GEFDOKGD-BbQkJu8C.js";import{t as r}from"./clone-LRxlvnMj.js";import{t as i}from"./graphlib-BcsNnGcW.js";import{g as a,h as o}from"./src-BqX54PbV.js";import{b as s}from"./chunk-7R4GIKGN-BbIFzsIv.js";import"./dist-CSJdAyA9.js";import"./chunk-PU5JKC2W-Dw8ClWch.js";import"./chunk-MX3YWQON-BpS_PtKp.js";import{n as c}from"./chunk-YBOYWFTD-CeU4Q-xC.js";import"./chunk-PQ6SQG4A-D6BTbCQw.js";import{a as l,c as u,i as d,l as f,n as p,t as m,u as h}from"./chunk-KYZI473N-BcUZNnwd.js";import{a as g,i as _,n as v,r as y,t as b}from"./chunk-O4XLMI2P-JC6EGoUz.js";function x(t){var n={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:S(t),edges:C(t)};return e(t.graph())||(n.value=r(t.graph())),n}function S(n){return t(n.nodes(),function(t){var r=n.node(t),i=n.parent(t),a={v:t};return e(r)||(a.value=r),e(i)||(a.parent=i),a})}function C(n){return t(n.edges(),function(t){var r=n.edge(t),i={v:t.v,w:t.w};return e(t.name)||(i.name=t.name),e(r)||(i.value=r),i})}var w=new Map,T=new Map,E=new Map,D=o(()=>{T.clear(),E.clear(),w.clear()},`clear`),O=o((e,t)=>{let n=T.get(t)||[];return a.trace(`In isDescendant`,t,` `,e,` = `,n.includes(e)),n.includes(e)},`isDescendant`),k=o((e,t)=>{let n=T.get(t)||[];return a.info(`Descendants of `,t,` is `,n),a.info(`Edge is `,e),e.v===t||e.w===t?!1:n?n.includes(e.v)||O(e.v,t)||O(e.w,t)||n.includes(e.w):(a.debug(`Tilt, `,t,`,not in descendants`),!1)},`edgeInCluster`),A=o((e,t,n,r)=>{a.warn(`Copying children of `,e,`root`,r,`data`,t.node(e),r);let i=t.children(e)||[];e!==r&&i.push(e),a.warn(`Copying (nodes) clusterId`,e,`nodes`,i),i.forEach(i=>{if(t.children(i).length>0)A(i,t,n,r);else{let o=t.node(i);a.info(`cp `,i,` to `,r,` with parent `,e),n.setNode(i,o),r!==t.parent(i)&&(a.warn(`Setting parent`,i,t.parent(i)),n.setParent(i,t.parent(i))),e!==r&&i!==e?(a.debug(`Setting parent`,i,e),n.setParent(i,e)):(a.info(`In copy `,e,`root`,r,`data`,t.node(e),r),a.debug(`Not Setting parent for node=`,i,`cluster!==rootId`,e!==r,`node!==clusterId`,i!==e));let s=t.edges(i);a.debug(`Copying Edges`,s),s.forEach(i=>{a.info(`Edge`,i);let o=t.edge(i.v,i.w,i.name);a.info(`Edge data`,o,r);try{k(i,r)?(a.info(`Copying as `,i.v,i.w,o,i.name),n.setEdge(i.v,i.w,o,i.name),a.info(`newGraph edges `,n.edges(),n.edge(n.edges()[0]))):a.info(`Skipping copy of edge `,i.v,`-->`,i.w,` rootId: `,r,` clusterId:`,e)}catch(e){a.error(e)}})}a.debug(`Removing node`,i),t.removeNode(i)})},`copy`),j=o((e,t)=>{let n=t.children(e),r=[...n];for(let i of n)E.set(i,e),r=[...r,...j(i,t)];return r},`extractDescendants`),M=o((e,t,n)=>{let r=e.edges().filter(e=>e.v===t||e.w===t),i=e.edges().filter(e=>e.v===n||e.w===n),a=r.map(e=>({v:e.v===t?n:e.v,w:e.w===t?t:e.w})),o=i.map(e=>({v:e.v,w:e.w}));return a.filter(e=>o.some(t=>e.v===t.v&&e.w===t.w))},`findCommonEdges`),N=o((e,t,n)=>{let r=t.children(e);if(a.trace(`Searching children of id `,e,r),r.length<1)return e;let i;for(let e of r){let r=N(e,t,n),a=M(t,n,r);if(r)if(a.length>0)i=r;else return r}return i},`findNonClusterChild`),P=o(e=>!w.has(e)||!w.get(e).externalConnections?e:w.has(e)?w.get(e).id:e,`getAnchorId`),F=o((e,t)=>{if(!e||t>10){a.debug(`Opting out, no graph `);return}else a.debug(`Opting in, graph `);e.nodes().forEach(function(t){e.children(t).length>0&&(a.warn(`Cluster identified`,t,` Replacement id in edges: `,N(t,e,t)),T.set(t,j(t,e)),w.set(t,{id:N(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){let n=e.children(t),r=e.edges();n.length>0?(a.debug(`Cluster identified`,t,T),r.forEach(e=>{O(e.v,t)^O(e.w,t)&&(a.warn(`Edge: `,e,` leaves cluster `,t),a.warn(`Descendants of XXX `,t,`: `,T.get(t)),w.get(t).externalConnections=!0)})):a.debug(`Not a cluster `,t,T)});for(let t of w.keys()){let n=w.get(t).id,r=e.parent(n);r!==t&&w.has(r)&&!w.get(r).externalConnections&&(w.get(t).id=r)}e.edges().forEach(function(t){let n=e.edge(t);a.warn(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(t)),a.warn(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(e.edge(t)));let r=t.v,i=t.w;if(a.warn(`Fix XXX`,w,`ids:`,t.v,t.w,`Translating: `,w.get(t.v),` --- `,w.get(t.w)),w.get(t.v)||w.get(t.w)){if(a.warn(`Fixing and trying - removing XXX`,t.v,t.w,t.name),r=P(t.v),i=P(t.w),e.removeEdge(t.v,t.w,t.name),r!==t.v){let i=e.parent(r);w.get(i).externalConnections=!0,n.fromCluster=t.v}if(i!==t.w){let r=e.parent(i);w.get(r).externalConnections=!0,n.toCluster=t.w}a.warn(`Fix Replacing with XXX`,r,i,t.name),e.setEdge(r,i,n,t.name)}}),a.warn(`Adjusted Graph`,x(e)),I(e,0),a.trace(w)},`adjustClustersAndEdges`),I=o((e,t)=>{if(a.warn(`extractor - `,t,x(e),e.children(`D`)),t>10){a.error(`Bailing out`);return}let n=e.nodes(),r=!1;for(let t of n){let n=e.children(t);r||=n.length>0}if(!r){a.debug(`Done, no node has children`,e.nodes());return}a.debug(`Nodes = `,n,t);for(let r of n)if(a.debug(`Extracting node`,r,w,w.has(r)&&!w.get(r).externalConnections,!e.parent(r),e.node(r),e.children(`D`),` Depth `,t),!w.has(r))a.debug(`Not a cluster`,r,t);else if(!w.get(r).externalConnections&&e.children(r)&&e.children(r).length>0){a.warn(`Cluster without external connections, without a parent and with children`,r,t);let n=e.graph().rankdir===`TB`?`LR`:`TB`;w.get(r)?.clusterData?.dir&&(n=w.get(r).clusterData.dir,a.warn(`Fixing dir`,w.get(r).clusterData.dir,n));let o=new i({multigraph:!0,compound:!0}).setGraph({rankdir:n,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});a.warn(`Old graph before copy`,x(e)),A(r,e,o,r),e.setNode(r,{clusterNode:!0,id:r,clusterData:w.get(r).clusterData,label:w.get(r).label,graph:o}),a.warn(`New graph after copy node: (`,r,`)`,x(o)),a.debug(`Old graph after copy`,x(e))}else a.warn(`Cluster ** `,r,` **not meeting the criteria !externalConnections:`,!w.get(r).externalConnections,` no parent: `,!e.parent(r),` children `,e.children(r)&&e.children(r).length>0,e.children(`D`),t),a.debug(w);n=e.nodes(),a.warn(`New list of nodes`,n);for(let r of n){let n=e.node(r);a.warn(` Now next level`,r,n),n?.clusterNode&&I(n.graph,t+1)}},`extractor`),L=o((e,t)=>{if(t.length===0)return[];let n=Object.assign([],t);return t.forEach(t=>{let r=L(e,e.children(t));n=[...n,...r]}),n},`sorter`),R=o(e=>L(e,e.children()),`sortNodesByHierarchy`),z=o(async(e,t,r,i,s,p)=>{a.warn(`Graph in recursive render:XAX`,x(t),s);let m=t.graph().rankdir;a.trace(`Dir in recursive render - dir:`,m);let _=e.insert(`g`).attr(`class`,`root`);t.nodes()?a.info(`Recursive render XXX`,t.nodes()):a.info(`No nodes found for`,t),t.edges().length>0&&a.info(`Recursive edges`,t.edge(t.edges()[0]));let b=_.insert(`g`).attr(`class`,`clusters`),S=_.insert(`g`).attr(`class`,`edgePaths`),C=_.insert(`g`).attr(`class`,`edgeLabels`),T=_.insert(`g`).attr(`class`,`nodes`);await Promise.all(t.nodes().map(async function(e){let n=t.node(e);if(s!==void 0){let n=JSON.parse(JSON.stringify(s.clusterData));a.trace(`Setting data for parent cluster XXX
2
2
  Node.id = `,e,`
3
3
  data=`,n.height,`
4
4
  Parent cluster`,s.height),t.setNode(s.id,n),t.parent(e)||(a.trace(`Setting parent`,e,s.id),t.setParent(e,s.id,n))}if(a.info(`(Insert) Node XXX`+e+`: `+JSON.stringify(t.node(e))),n?.clusterNode){a.info(`Cluster identified XBX`,e,n.width,t.node(e));let{ranksep:o,nodesep:s}=t.graph();n.graph.setGraph({...n.graph.graph(),ranksep:o+25,nodesep:s});let c=await z(T,n.graph,r,i,t.node(e),p),l=c.elem;h(n,l),n.diff=c.diff||0,a.info(`New compound node after recursive render XAX`,e,`width`,n.width,`height`,n.height),f(l,n)}else t.children(e).length>0?(a.trace(`Cluster - the non recursive path XBX`,e,n.id,n,n.width,`Graph:`,t),a.trace(N(n.id,t)),w.set(n.id,{id:N(n.id,t),node:n})):(a.trace(`Node - the non recursive path XAX`,e,T,t.node(e),m),await l(T,t.node(e),{config:p,dir:m}))})),await o(async()=>{let e=t.edges().map(async function(e){let n=t.edge(e.v,e.w,e.name);a.info(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(e)),a.info(`Edge `+e.v+` -> `+e.w+`: `,e,` `,JSON.stringify(t.edge(e))),a.info(`Fix`,w,`ids:`,e.v,e.w,`Translating: `,w.get(e.v),w.get(e.w)),await y(C,n)});await Promise.all(e)},`processEdges`)(),a.info(`Graph before layout:`,JSON.stringify(x(t))),a.info(`############################################# XXX`),a.info(`### Layout ### XXX`),a.info(`############################################# XXX`),n(t),a.info(`Graph after layout:`,JSON.stringify(x(t)));let E=0,{subGraphTitleTotalMargin:D}=c(p);return await Promise.all(R(t).map(async function(e){let n=t.node(e);if(a.info(`Position XBX => `+e+`: (`+n.x,`,`+n.y,`) width: `,n.width,` height: `,n.height),n?.clusterNode)n.y+=D,a.info(`A tainted cluster node XBX1`,e,n.id,n.width,n.height,n.x,n.y,t.parent(e)),w.get(n.id).node=n,u(n);else if(t.children(e).length>0){a.info(`A pure cluster node XBX1`,e,n.id,n.x,n.y,n.width,n.height,t.parent(e)),n.height+=D,t.node(n.parentId);let r=n?.padding/2||0,i=n?.labelBBox?.height||0,o=i-r||0;a.debug(`OffsetY`,o,`labelHeight`,i,`halfPadding`,r),await d(b,n),w.get(n.id).node=n}else{let e=t.node(n.parentId);n.y+=D/2,a.info(`A regular node XBX1 - using the padding`,n.id,`parent`,n.parentId,n.width,n.height,n.x,n.y,`offsetY`,n.offsetY,`parent`,e,e?.offsetY,n),u(n)}})),t.edges().forEach(function(e){let n=t.edge(e);a.info(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(n),n),n.points.forEach(e=>e.y+=D/2),g(n,v(S,n,w,r,t.node(e.v),t.node(e.w),i))}),t.nodes().forEach(function(e){let n=t.node(e);a.info(e,n.type,n.diff),n.isGroup&&(E=n.diff)}),a.warn(`Returning from recursive render XAX`,_,E),{elem:_,diff:E}},`recursiveRender`),B=o(async(e,t)=>{let n=new i({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.config?.flowchart?.nodeSpacing||e.nodeSpacing,ranksep:e.config?.rankSpacing||e.config?.flowchart?.rankSpacing||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),r=t.select(`g`);_(r,e.markers,e.type,e.diagramId),p(),b(),m(),D(),e.nodes.forEach(e=>{n.setNode(e.id,{...e}),e.parentId&&n.setParent(e.id,e.parentId)}),a.debug(`Edges:`,e.edges),e.edges.forEach(e=>{if(e.start===e.end){let t=e.start,r=t+`---`+t+`---1`,i=t+`---`+t+`---2`,a=n.node(t);n.setNode(r,{domId:r,id:r,parentId:a.parentId,labelStyle:``,label:``,padding:0,shape:`labelRect`,style:``,width:10,height:10}),n.setParent(r,a.parentId),n.setNode(i,{domId:i,id:i,parentId:a.parentId,labelStyle:``,padding:0,shape:`labelRect`,label:``,style:``,width:10,height:10}),n.setParent(i,a.parentId);let o=structuredClone(e),s=structuredClone(e),c=structuredClone(e);o.label=``,o.arrowTypeEnd=`none`,o.id=t+`-cyclic-special-1`,s.arrowTypeStart=`none`,s.arrowTypeEnd=`none`,s.id=t+`-cyclic-special-mid`,c.label=``,a.isGroup&&(o.fromCluster=t,c.toCluster=t),c.id=t+`-cyclic-special-2`,c.arrowTypeStart=`none`,n.setEdge(t,r,o,t+`-cyclic-special-0`),n.setEdge(r,i,s,t+`-cyclic-special-1`),n.setEdge(i,t,c,t+`-cyc<lic-special-2`)}else n.setEdge(e.start,e.end,{...e},e.id)}),a.warn(`Graph at first:`,JSON.stringify(x(n))),F(n),a.warn(`Graph after XAX:`,JSON.stringify(x(n)));let o=s();await z(r,n,e.type,e.diagramId,void 0,o)},`render`);export{B as render};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-CFjPhJqf.js";import{t}from"./react-nm2Ru1Pt.js";import{t as n}from"./chevron-right-5HgK6l7K.js";import{a as r,i,n as a,r as o,t as s}from"./dist-wVfsYfHS.js";import{t as c}from"./jsx-runtime-O3jQaKZd.js";import{t as l}from"./api-client-BfBM3I7n.js";import{Et as u,et as d,lt as f,yt as p}from"./index-WGGO0qq9.js";import{n as m,r as h,t as g}from"./lib-BQ34Db2e.js";var _=e(t(),1);function v(e,t,n,r){return`ppm-db-${e}-${n}.${t}-p${r}`}function y(e,t,n,r){try{let i=sessionStorage.getItem(v(e,t,n,r));return i?JSON.parse(i):null}catch{return null}}function b(e,t,n,r,i,a){try{sessionStorage.setItem(v(e,t,n,r),JSON.stringify({data:i,cols:a}))}catch{}}function x(e){let t=`/api/db/connections/${e}`,[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(`public`),[o,s]=(0,_.useState)(null),[c,u]=(0,_.useState)([]),[d,f]=(0,_.useState)(!0),[p,m]=(0,_.useState)(null),[h,g]=(0,_.useState)(1),[v,x]=(0,_.useState)(null),[S,C]=(0,_.useState)(null),[w,T]=(0,_.useState)(!1),E=(0,_.useCallback)(async(r,a,o)=>{let c=r??n,d=a??i;if(c){f(!0);try{let[n,r]=await Promise.all([l.get(`${t}/data?table=${encodeURIComponent(c)}&schema=${d}&page=${o??h}&limit=100`),l.get(`${t}/schema?table=${encodeURIComponent(c)}&schema=${d}`)]);s(n),u(r),b(e,c,d,o??h,n,r)}catch(e){m(e.message)}finally{f(!1)}}},[t,e,n,i,h]);return{selectedTable:n,selectTable:(0,_.useCallback)((t,n=`public`)=>{r(t),a(n),g(1),x(null);let i=y(e,t,n,1);i?(s(i.data),u(i.cols),f(!1),E(t,n,1)):E(t,n,1)},[e,E]),tableData:o,schema:c,loading:d,error:p,page:h,setPage:(0,_.useCallback)(e=>{g(e),E(void 0,void 0,e)},[E]),queryResult:v,queryError:S,queryLoading:w,executeQuery:(0,_.useCallback)(async e=>{T(!0),C(null);try{let r=await l.post(`${t}/query`,{sql:e});x(r),r.changeType===`modify`&&E(n??void 0,i)}catch(e){C(e.message)}finally{T(!1)}},[t,n,i,E]),updateCell:(0,_.useCallback)(async(e,r,a,o)=>{if(!n)return;let s=n,c=i;try{await l.put(`${t}/cell`,{table:s,schema:c,pkColumn:e,pkValue:r,column:a,value:o}),E(s,c)}catch(e){m(e.message)}},[t,n,i,E]),refreshData:E}}var S=c(),C={postgres:s,sqlite:a};function w({metadata:e}){let t=e?.connectionId,n=e?.connectionName,r=e?.dbType??`postgres`,i=e?.tableName,a=e?.schemaName??`public`,o=x(t),[c,l]=(0,_.useState)(!1),u=(0,_.useRef)(!1);return(0,_.useEffect)(()=>{!i||u.current||(u.current=!0,o.selectTable(i,a))},[i,a]),(0,S.jsx)(`div`,{className:`flex h-full w-full overflow-hidden`,children:(0,S.jsxs)(`div`,{className:`flex-1 flex flex-col overflow-hidden`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 border-b border-border bg-background shrink-0`,children:[(0,S.jsx)(p,{className:`size-3.5 text-muted-foreground`}),(0,S.jsx)(`span`,{className:`text-xs text-muted-foreground truncate`,children:n??`Database`}),o.selectedTable&&(0,S.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`/ `,o.selectedTable]}),(0,S.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[(0,S.jsx)(`button`,{type:`button`,onClick:()=>o.refreshData(),title:`Reload data`,className:`p-1 rounded text-muted-foreground hover:text-foreground transition-colors`,children:(0,S.jsx)(d,{className:`size-3 ${o.loading?`animate-spin`:``}`})}),(0,S.jsx)(`button`,{type:`button`,onClick:()=>l(e=>!e),className:`px-2 py-1 rounded text-xs transition-colors ${c?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`}`,children:`SQL`})]})]}),(0,S.jsx)(`div`,{className:`flex-1 overflow-hidden ${c?`max-h-[60%]`:``}`,children:(0,S.jsx)(T,{tableData:o.tableData,schema:o.schema,loading:o.loading,page:o.page,onPageChange:o.setPage,onCellUpdate:o.updateCell})}),c&&(0,S.jsx)(`div`,{className:`border-t border-border h-[40%] shrink-0`,children:(0,S.jsx)(E,{dialect:C[r]??s,onExecute:o.executeQuery,result:o.queryResult,error:o.queryError,loading:o.queryLoading})})]})})}function T({tableData:e,schema:t,loading:r,page:i,onPageChange:a,onCellUpdate:o}){let[s,c]=(0,_.useState)(null),[l,d]=(0,_.useState)(``),p=(0,_.useMemo)(()=>t.find(e=>e.pk)?.name??null,[t]),v=(0,_.useCallback)((e,t,n)=>{c({rowIdx:e,col:t}),d(n==null?``:String(n))},[]),y=(0,_.useCallback)(()=>{if(!s||!e||!p)return;let t=e.rows[s.rowIdx];if(!t)return;let n=t[s.col];String(n??``)!==l&&o(p,t[p],s.col,l===``?null:l),c(null)},[s,l,e,p,o]),b=(0,_.useCallback)(()=>c(null),[]),x=(0,_.useMemo)(()=>(e?.columns??[]).map(e=>({id:e,accessorFn:t=>t[e],header:()=>(0,S.jsx)(`span`,{className:t.find(t=>t.name===e)?.pk?`font-bold`:``,children:e}),cell:({row:t,getValue:n})=>{let r=s?.rowIdx===t.index&&s?.col===e,i=n();return r?(0,S.jsx)(`input`,{autoFocus:!0,className:`w-full bg-transparent border border-primary/50 rounded px-1 py-0 text-xs outline-none`,value:l,onChange:e=>d(e.target.value),onBlur:y,onKeyDown:e=>{e.key===`Enter`&&y(),e.key===`Escape`&&b()}}):(0,S.jsx)(`span`,{className:`cursor-pointer truncate block ${i==null?`text-muted-foreground/40 italic`:``}`,onDoubleClick:()=>p&&v(t.index,e,i),title:i==null?`NULL`:String(i),children:i==null?`NULL`:String(i)})}})),[e?.columns,t,s,l,y,b,v,p]),C=m({data:e?.rows??[],columns:x,getCoreRowModel:h()});if(!e)return(0,S.jsx)(`div`,{className:`flex items-center justify-center h-full text-xs text-muted-foreground`,children:r?(0,S.jsx)(f,{className:`size-4 animate-spin`}):`Select a table`});let w=Math.ceil(e.total/e.limit)||1;return(0,S.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden`,children:[(0,S.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,S.jsxs)(`table`,{className:`w-full text-xs border-collapse`,children:[(0,S.jsx)(`thead`,{className:`sticky top-0 z-10 bg-muted`,children:C.getHeaderGroups().map(e=>(0,S.jsx)(`tr`,{children:e.headers.map(e=>(0,S.jsx)(`th`,{className:`px-2 py-1.5 text-left font-medium text-muted-foreground border-b border-border whitespace-nowrap`,children:g(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,S.jsxs)(`tbody`,{children:[C.getRowModel().rows.map(e=>(0,S.jsx)(`tr`,{className:`hover:bg-muted/30 border-b border-border/50`,children:e.getVisibleCells().map(e=>(0,S.jsx)(`td`,{className:`px-2 py-1 max-w-[300px]`,children:g(e.column.columnDef.cell,e.getContext())},e.id))},e.id)),e.rows.length===0&&(0,S.jsx)(`tr`,{children:(0,S.jsx)(`td`,{colSpan:e.columns.length,className:`px-2 py-8 text-center text-muted-foreground`,children:`No data`})})]})]})}),(0,S.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-1.5 border-t border-border bg-background shrink-0 text-xs text-muted-foreground`,children:[(0,S.jsxs)(`span`,{children:[e.total.toLocaleString(),` rows`]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(`button`,{type:`button`,disabled:i<=1,onClick:()=>a(i-1),className:`p-0.5 rounded hover:bg-muted disabled:opacity-30`,children:(0,S.jsx)(u,{className:`size-3.5`})}),(0,S.jsxs)(`span`,{children:[i,` / `,w]}),(0,S.jsx)(`button`,{type:`button`,disabled:i>=w,onClick:()=>a(i+1),className:`p-0.5 rounded hover:bg-muted disabled:opacity-30`,children:(0,S.jsx)(n,{className:`size-3.5`})})]})]})]})}function E({dialect:e,onExecute:t,result:n,error:a,loading:s}){let[c,l]=(0,_.useState)(`SELECT * FROM `),u=(0,_.useCallback)(()=>{let e=c.trim();e&&t(e)},[c,t]);return(0,S.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden`,children:[(0,S.jsxs)(`div`,{className:`flex items-start gap-1 border-b border-border bg-background`,onKeyDown:(0,_.useCallback)(e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),u())},[u]),children:[(0,S.jsx)(`div`,{className:`flex-1 max-h-[120px] overflow-auto`,children:(0,S.jsx)(i,{value:c,onChange:l,extensions:[o({dialect:e})],basicSetup:{lineNumbers:!1,foldGutter:!1,highlightActiveLine:!1},className:`text-xs [&_.cm-editor]:!outline-none [&_.cm-scroller]:!overflow-auto`})}),(0,S.jsx)(`button`,{type:`button`,onClick:u,disabled:s,title:`Execute (Cmd+Enter)`,className:`shrink-0 m-1 p-1.5 rounded bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 transition-colors`,children:s?(0,S.jsx)(f,{className:`size-3.5 animate-spin`}):(0,S.jsx)(r,{className:`size-3.5`})})]}),(0,S.jsxs)(`div`,{className:`flex-1 overflow-auto text-xs`,children:[a&&(0,S.jsx)(`div`,{className:`px-3 py-2 text-destructive bg-destructive/5`,children:a}),n?.changeType===`modify`&&(0,S.jsxs)(`div`,{className:`px-3 py-2 text-green-500`,children:[`Query executed. `,n.rowsAffected,` row(s) affected.`]}),n?.changeType===`select`&&n.rows.length>0&&(0,S.jsxs)(`table`,{className:`w-full border-collapse`,children:[(0,S.jsx)(`thead`,{className:`sticky top-0 bg-muted`,children:(0,S.jsx)(`tr`,{children:n.columns.map(e=>(0,S.jsx)(`th`,{className:`px-2 py-1 text-left font-medium text-muted-foreground border-b border-border whitespace-nowrap`,children:e},e))})}),(0,S.jsx)(`tbody`,{children:n.rows.map((e,t)=>(0,S.jsx)(`tr`,{className:`hover:bg-muted/30 border-b border-border/50`,children:n.columns.map(t=>(0,S.jsx)(`td`,{className:`px-2 py-1 max-w-[300px] truncate`,title:e[t]==null?`NULL`:String(e[t]),children:e[t]==null?(0,S.jsx)(`span`,{className:`text-muted-foreground/40 italic`,children:`NULL`}):String(e[t])},t))},t))})]}),n?.changeType===`select`&&n.rows.length===0&&(0,S.jsx)(`div`,{className:`px-3 py-2 text-muted-foreground`,children:`No results`})]})]})}export{w as DatabaseViewer};
@@ -1,4 +1,4 @@
1
- import"./chunk-XZSTWKYB-DxAOx4hG.js";import{r as e}from"./chunk-GEFDOKGD-D-pKjlVd.js";import"./chunk-R5LLSJPH-CFwSJijQ.js";import"./chunk-7E7YKBS2-CiyUJxNI.js";import"./chunk-EGIJ26TM-DzqmU2Z7.js";import"./chunk-C72U2L5F-D21mS_6G.js";import"./chunk-XIRO2GV7-Djlmrely.js";import"./chunk-L3YUKLVL-C7qGJrfV.js";import"./chunk-OZEHJAEY-BXhYx3nO.js";import{g as t,h as n,p as r}from"./src-BqX54PbV.js";import{B as i,C as a,V as o,W as s,_ as c,a as l,c as u,d,v as f,y as p}from"./chunk-7R4GIKGN-Dv-4cAYn.js";import{t as m}from"./ordinal-_K3x1fkz.js";import{t as h}from"./defaultLocale-5eAKkKJC.js";import{t as g}from"./chunk-HHEYEP7N-C7vxA5i9.js";import"./dist-CSJdAyA9.js";import{t as _}from"./chunk-4BX2VUAB-D4tOov49.js";import{t as v}from"./mermaid-parser.core-C7UwoIh6.js";import{t as y}from"./chunk-KX2RTZJC-CRq1OBZv.js";import{i as b,n as x}from"./chunk-PQ6SQG4A-TF58UVMU.js";function S(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function C(){return this.eachAfter(S)}function w(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function T(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function E(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o<s;++o)r.push(a[o]);for(;n=i.pop();)e.call(t,n,++c,this);return this}function D(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function O(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function k(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function A(e){for(var t=this,n=j(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function j(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function M(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function N(){return Array.from(this)}function P(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function F(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*I(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}function L(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=B)):t===void 0&&(t=z);for(var n=new U(e),r,i=[n],a,o,s,c;r=i.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)i.push(a=o[s]=new U(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(H)}function R(){return L(this).eachBefore(V)}function z(e){return e.children}function B(e){return Array.isArray(e)?e[1]:null}function V(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function H(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function U(e){this.data=e,this.depth=this.height=0,this.parent=null}U.prototype=L.prototype={constructor:U,count:C,each:w,eachAfter:E,eachBefore:T,find:D,sum:O,sort:k,path:A,ancestors:M,descendants:N,leaves:P,links:F,copy:R,[Symbol.iterator]:I};function W(e){if(typeof e!=`function`)throw Error();return e}function G(){return 0}function K(e){return function(){return e}}function q(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function J(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(r-t)/e.value;++s<c;)o=a[s],o.y0=n,o.y1=i,o.x0=t,o.x1=t+=o.value*l}function ee(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(i-n)/e.value;++s<c;)o=a[s],o.x0=t,o.x1=r,o.y0=n,o.y1=n+=o.value*l}var te=(1+Math.sqrt(5))/2;function ne(e,t,n,r,i,a){for(var o=[],s=t.children,c,l,u=0,d=0,f=s.length,p,m,h=t.value,g,_,v,y,b,x,S;u<f;){p=i-n,m=a-r;do g=s[d++].value;while(!g&&d<f);for(_=v=g,x=Math.max(m/p,p/m)/(h*e),S=g*g*x,b=Math.max(v/S,S/_);d<f;++d){if(g+=l=s[d].value,l<_&&(_=l),l>v&&(v=l),S=g*g*x,y=Math.max(v/S,S/_),y>b){g-=l;break}b=y}o.push(c={value:g,dice:p<m,children:s.slice(u,d)}),c.dice?J(c,n,r,i,h?r+=m*g/h:a):ee(c,n,r,h?n+=p*g/h:i,a),h-=g,u=d}return o}var re=(function e(t){function n(e,n,r,i,a){ne(t,e,n,r,i,a)}return n.ratio=function(t){return e((t=+t)>1?t:1)},n})(te);function ie(){var e=re,t=!1,n=1,r=1,i=[0],a=G,o=G,s=G,c=G,l=G;function u(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(d),i=[0],t&&e.eachBefore(q),e}function d(t){var n=i[t.depth],r=t.x0+n,u=t.y0+n,d=t.x1-n,f=t.y1-n;d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),t.x0=r,t.y0=u,t.x1=d,t.y1=f,t.children&&(n=i[t.depth+1]=a(t)/2,r+=l(t)-n,u+=o(t)-n,d-=s(t)-n,f-=c(t)-n,d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),e(t,r,u,d,f))}return u.round=function(e){return arguments.length?(t=!!e,u):t},u.size=function(e){return arguments.length?(n=+e[0],r=+e[1],u):[n,r]},u.tile=function(t){return arguments.length?(e=W(t),u):e},u.padding=function(e){return arguments.length?u.paddingInner(e).paddingOuter(e):u.paddingInner()},u.paddingInner=function(e){return arguments.length?(a=typeof e==`function`?e:K(+e),u):a},u.paddingOuter=function(e){return arguments.length?u.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e):u.paddingTop()},u.paddingTop=function(e){return arguments.length?(o=typeof e==`function`?e:K(+e),u):o},u.paddingRight=function(e){return arguments.length?(s=typeof e==`function`?e:K(+e),u):s},u.paddingBottom=function(e){return arguments.length?(c=typeof e==`function`?e:K(+e),u):c},u.paddingLeft=function(e){return arguments.length?(l=typeof e==`function`?e:K(+e),u):l},u}var Y=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=o,this.getAccTitle=f,this.setDiagramTitle=s,this.getDiagramTitle=a,this.getAccDescription=c,this.setAccDescription=i}static{n(this,`TreeMapDB`)}getNodes(){return this.nodes}getConfig(){let t=d,n=p();return e({...t.treemap,...n.treemap??{}})}addNode(e,t){this.nodes.push(e),this.levels.set(e,t),t===0&&(this.outerNodes.push(e),this.root??=e)}getRoot(){return{name:``,children:this.outerNodes}}addClass(e,t){let n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},r=t.replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`).split(`;`);r&&r.forEach(e=>{x(e)&&(n?.textStyles?n.textStyles.push(e):n.textStyles=[e]),n?.styles?n.styles.push(e):n.styles=[e]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){l(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function X(e){if(!e.length)return[];let t=[],n=[];return e.forEach(e=>{let r={name:e.name,children:e.type===`Leaf`?void 0:[]};for(r.classSelector=e?.classSelector,e?.cssCompiledStyles&&(r.cssCompiledStyles=e.cssCompiledStyles),e.type===`Leaf`&&e.value!==void 0&&(r.value=e.value);n.length>0&&n[n.length-1].level>=e.level;)n.pop();if(n.length===0)t.push(r);else{let e=n[n.length-1].node;e.children?e.children.push(r):e.children=[r]}e.type!==`Leaf`&&n.push({node:r,level:e.level})}),t}n(X,`buildHierarchy`);var ae=n((e,t)=>{_(e,t);let r=[];for(let n of e.TreemapRows??[])n.$type===`ClassDefStatement`&&t.addClass(n.className??``,n.styleText??``);for(let n of e.TreemapRows??[]){let e=n.item;if(!e)continue;let i=n.indent?parseInt(n.indent):0,a=oe(e),o=e.classSelector?t.getStylesForClass(e.classSelector):[],s=o.length>0?o:void 0,c={level:i,name:a,type:e.$type,value:e.value,classSelector:e.classSelector,cssCompiledStyles:s};r.push(c)}let i=X(r),a=n((e,n)=>{for(let r of e)t.addNode(r,n),r.children&&r.children.length>0&&a(r.children,n+1)},`addNodesRecursively`);a(i,0)},`populate`),oe=n(e=>e.name?String(e.name):``,`getItemName`),Z={parser:{yy:void 0},parse:n(async e=>{try{let n=await v(`treemap`,e);t.debug(`Treemap AST:`,n);let r=Z.parser?.yy;if(!(r instanceof Y))throw Error(`parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);ae(n,r)}catch(e){throw t.error(`Error parsing treemap:`,e),e}},`parse`)},se=10,Q=10,$=25,ce={draw:n((e,i,a,o)=>{let s=o.db,c=s.getConfig(),l=c.padding??se,d=s.getDiagramTitle(),f=s.getRoot(),{themeVariables:_}=p();if(!f)return;let v=d?30:0,x=g(i),S=c.nodeWidth?c.nodeWidth*Q:960,C=c.nodeHeight?c.nodeHeight*Q:500,w=S,T=C+v;x.attr(`viewBox`,`0 0 ${w} ${T}`),u(x,T,w,c.useMaxWidth);let E;try{let e=c.valueFormat||`,`;if(e===`$0,0`)E=n(e=>`$`+h(`,`)(e),`valueFormat`);else if(e.startsWith(`$`)&&e.includes(`,`)){let t=/\.\d+/.exec(e),r=t?t[0]:``;E=n(e=>`$`+h(`,`+r)(e),`valueFormat`)}else if(e.startsWith(`$`)){let t=e.substring(1);E=n(e=>`$`+h(t||``)(e),`valueFormat`)}else E=h(e)}catch(e){t.error(`Error creating format function:`,e),E=h(`,`)}let D=m().range([`transparent`,_.cScale0,_.cScale1,_.cScale2,_.cScale3,_.cScale4,_.cScale5,_.cScale6,_.cScale7,_.cScale8,_.cScale9,_.cScale10,_.cScale11]),O=m().range([`transparent`,_.cScalePeer0,_.cScalePeer1,_.cScalePeer2,_.cScalePeer3,_.cScalePeer4,_.cScalePeer5,_.cScalePeer6,_.cScalePeer7,_.cScalePeer8,_.cScalePeer9,_.cScalePeer10,_.cScalePeer11]),k=m().range([_.cScaleLabel0,_.cScaleLabel1,_.cScaleLabel2,_.cScaleLabel3,_.cScaleLabel4,_.cScaleLabel5,_.cScaleLabel6,_.cScaleLabel7,_.cScaleLabel8,_.cScaleLabel9,_.cScaleLabel10,_.cScaleLabel11]);d&&x.append(`text`).attr(`x`,w/2).attr(`y`,v/2).attr(`class`,`treemapTitle`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(d);let A=x.append(`g`).attr(`transform`,`translate(0, ${v})`).attr(`class`,`treemapContainer`),j=L(f).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),M=ie().size([S,C]).paddingTop(e=>e.children&&e.children.length>0?$+Q:0).paddingInner(l).paddingLeft(e=>e.children&&e.children.length>0?Q:0).paddingRight(e=>e.children&&e.children.length>0?Q:0).paddingBottom(e=>e.children&&e.children.length>0?Q:0).round(!0)(j),N=M.descendants().filter(e=>e.children&&e.children.length>0),P=A.selectAll(`.treemapSection`).data(N).enter().append(`g`).attr(`class`,`treemapSection`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,$).attr(`class`,`treemapSectionHeader`).attr(`fill`,`none`).attr(`fill-opacity`,.6).attr(`stroke-width`,.6).attr(`style`,e=>e.depth===0?`display: none;`:``),P.append(`clipPath`).attr(`id`,(e,t)=>`clip-section-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-12)).attr(`height`,$),P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,(e,t)=>`treemapSection section${t}`).attr(`fill`,e=>D(e.data.name)).attr(`fill-opacity`,.6).attr(`stroke`,e=>O(e.data.name)).attr(`stroke-width`,2).attr(`stroke-opacity`,.4).attr(`style`,e=>{if(e.depth===0)return`display: none;`;let t=b({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+`;`+t.borderStyles.join(`;`)}),P.append(`text`).attr(`class`,`treemapSectionLabel`).attr(`x`,6).attr(`y`,$/2).attr(`dominant-baseline`,`middle`).text(e=>e.depth===0?``:e.data.name).attr(`font-weight`,`bold`).attr(`style`,e=>e.depth===0?`display: none;`:`dominant-baseline: middle; font-size: 12px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+b({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).each(function(e){if(e.depth===0)return;let t=r(this),n=e.data.name;t.text(n);let i=e.x1-e.x0,a;a=c.showValues!==!1&&e.value?i-10-30-10-6:i-6-6;let o=Math.max(15,a),s=t.node();if(s.getComputedTextLength()>o){let e=n;for(;e.length>0;){if(e=n.substring(0,e.length-1),e.length===0){t.text(`...`),s.getComputedTextLength()>o&&t.text(``);break}if(t.text(e+`...`),s.getComputedTextLength()<=o)break}}}),c.showValues!==!1&&P.append(`text`).attr(`class`,`treemapSectionValue`).attr(`x`,e=>e.x1-e.x0-10).attr(`y`,$/2).attr(`text-anchor`,`end`).attr(`dominant-baseline`,`middle`).text(e=>e.value?E(e.value):``).attr(`font-style`,`italic`).attr(`style`,e=>e.depth===0?`display: none;`:`text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+b({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`));let F=M.leaves(),I=A.selectAll(`.treemapLeafGroup`).data(F).enter().append(`g`).attr(`class`,(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:``}x`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);I.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,`treemapLeaf`).attr(`fill`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`style`,e=>b({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr(`fill-opacity`,.3).attr(`stroke`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`stroke-width`,3),I.append(`clipPath`).attr(`id`,(e,t)=>`clip-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-4)).attr(`height`,e=>Math.max(0,e.y1-e.y0-4)),I.append(`text`).attr(`class`,`treemapLabel`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,e=>(e.y1-e.y0)/2).attr(`style`,e=>`text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:`+k(e.data.name)+`;`+b({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.data.name).each(function(e){let t=r(this),n=e.x1-e.x0,i=e.y1-e.y0,a=t.node(),o=n-8,s=i-8;if(o<10||s<10){t.style(`display`,`none`);return}let c=parseInt(t.style(`font-size`),10),l=.6;for(;a.getComputedTextLength()>o&&c>8;)c--,t.style(`font-size`,`${c}px`);let u=Math.max(6,Math.min(28,Math.round(c*l))),d=c+2+u;for(;d>s&&c>8&&(c--,u=Math.max(6,Math.min(28,Math.round(c*l))),!(u<6&&c===8));)t.style(`font-size`,`${c}px`),d=c+2+u;t.style(`font-size`,`${c}px`),(a.getComputedTextLength()>o||c<8||s<c)&&t.style(`display`,`none`)}),c.showValues!==!1&&I.append(`text`).attr(`class`,`treemapValue`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,function(e){return(e.y1-e.y0)/2}).attr(`style`,e=>`text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:`+k(e.data.name)+`;`+b({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.value?E(e.value):``).each(function(e){let t=r(this),n=this.parentNode;if(!n){t.style(`display`,`none`);return}let i=r(n).select(`.treemapLabel`);if(i.empty()||i.style(`display`)===`none`){t.style(`display`,`none`);return}let a=parseFloat(i.style(`font-size`)),o=Math.max(6,Math.min(28,Math.round(a*.6)));t.style(`font-size`,`${o}px`);let s=(e.y1-e.y0)/2+a/2+2;t.attr(`y`,s);let c=e.x1-e.x0,l=e.y1-e.y0-4,u=c-8;t.node().getComputedTextLength()>u||s+o>l||o<6?t.style(`display`,`none`):t.style(`display`,null)}),y(x,c.diagramPadding??8,`flowchart`,c?.useMaxWidth||!1)},`draw`),getClasses:n(function(e,t){return t.db.getClasses()},`getClasses`)},le={sectionStrokeColor:`black`,sectionStrokeWidth:`1`,sectionFillColor:`#efefef`,leafStrokeColor:`black`,leafStrokeWidth:`1`,leafFillColor:`#efefef`,labelColor:`black`,labelFontSize:`12px`,valueFontSize:`10px`,valueColor:`black`,titleColor:`black`,titleFontSize:`14px`},ue={parser:Z,get db(){return new Y},renderer:ce,styles:n(({treemap:t}={})=>{let n=e(le,t);return`
1
+ import"./chunk-XZSTWKYB-DxAOx4hG.js";import{r as e}from"./chunk-GEFDOKGD-BbQkJu8C.js";import"./chunk-R5LLSJPH-CFwSJijQ.js";import"./chunk-7E7YKBS2-CiyUJxNI.js";import"./chunk-EGIJ26TM-DzqmU2Z7.js";import"./chunk-C72U2L5F-D21mS_6G.js";import"./chunk-XIRO2GV7-Djlmrely.js";import"./chunk-L3YUKLVL-C7qGJrfV.js";import"./chunk-OZEHJAEY-BXhYx3nO.js";import{g as t,h as n,p as r}from"./src-BqX54PbV.js";import{B as i,C as a,V as o,W as s,_ as c,a as l,c as u,d,v as f,y as p}from"./chunk-7R4GIKGN-BbIFzsIv.js";import{t as m}from"./ordinal-_K3x1fkz.js";import{t as h}from"./defaultLocale-5eAKkKJC.js";import{t as g}from"./chunk-HHEYEP7N-HRhYy3kG.js";import"./dist-CSJdAyA9.js";import{t as _}from"./chunk-4BX2VUAB-D4tOov49.js";import{t as v}from"./mermaid-parser.core-DMIWdgEW.js";import{t as y}from"./chunk-KX2RTZJC-sQ0o-39C.js";import{i as b,n as x}from"./chunk-PQ6SQG4A-D6BTbCQw.js";function S(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function C(){return this.eachAfter(S)}function w(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function T(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function E(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o<s;++o)r.push(a[o]);for(;n=i.pop();)e.call(t,n,++c,this);return this}function D(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function O(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function k(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function A(e){for(var t=this,n=j(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function j(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function M(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function N(){return Array.from(this)}function P(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function F(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*I(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}function L(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=B)):t===void 0&&(t=z);for(var n=new U(e),r,i=[n],a,o,s,c;r=i.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)i.push(a=o[s]=new U(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(H)}function R(){return L(this).eachBefore(V)}function z(e){return e.children}function B(e){return Array.isArray(e)?e[1]:null}function V(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function H(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function U(e){this.data=e,this.depth=this.height=0,this.parent=null}U.prototype=L.prototype={constructor:U,count:C,each:w,eachAfter:E,eachBefore:T,find:D,sum:O,sort:k,path:A,ancestors:M,descendants:N,leaves:P,links:F,copy:R,[Symbol.iterator]:I};function W(e){if(typeof e!=`function`)throw Error();return e}function G(){return 0}function K(e){return function(){return e}}function q(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function J(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(r-t)/e.value;++s<c;)o=a[s],o.y0=n,o.y1=i,o.x0=t,o.x1=t+=o.value*l}function ee(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(i-n)/e.value;++s<c;)o=a[s],o.x0=t,o.x1=r,o.y0=n,o.y1=n+=o.value*l}var te=(1+Math.sqrt(5))/2;function ne(e,t,n,r,i,a){for(var o=[],s=t.children,c,l,u=0,d=0,f=s.length,p,m,h=t.value,g,_,v,y,b,x,S;u<f;){p=i-n,m=a-r;do g=s[d++].value;while(!g&&d<f);for(_=v=g,x=Math.max(m/p,p/m)/(h*e),S=g*g*x,b=Math.max(v/S,S/_);d<f;++d){if(g+=l=s[d].value,l<_&&(_=l),l>v&&(v=l),S=g*g*x,y=Math.max(v/S,S/_),y>b){g-=l;break}b=y}o.push(c={value:g,dice:p<m,children:s.slice(u,d)}),c.dice?J(c,n,r,i,h?r+=m*g/h:a):ee(c,n,r,h?n+=p*g/h:i,a),h-=g,u=d}return o}var re=(function e(t){function n(e,n,r,i,a){ne(t,e,n,r,i,a)}return n.ratio=function(t){return e((t=+t)>1?t:1)},n})(te);function ie(){var e=re,t=!1,n=1,r=1,i=[0],a=G,o=G,s=G,c=G,l=G;function u(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(d),i=[0],t&&e.eachBefore(q),e}function d(t){var n=i[t.depth],r=t.x0+n,u=t.y0+n,d=t.x1-n,f=t.y1-n;d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),t.x0=r,t.y0=u,t.x1=d,t.y1=f,t.children&&(n=i[t.depth+1]=a(t)/2,r+=l(t)-n,u+=o(t)-n,d-=s(t)-n,f-=c(t)-n,d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),e(t,r,u,d,f))}return u.round=function(e){return arguments.length?(t=!!e,u):t},u.size=function(e){return arguments.length?(n=+e[0],r=+e[1],u):[n,r]},u.tile=function(t){return arguments.length?(e=W(t),u):e},u.padding=function(e){return arguments.length?u.paddingInner(e).paddingOuter(e):u.paddingInner()},u.paddingInner=function(e){return arguments.length?(a=typeof e==`function`?e:K(+e),u):a},u.paddingOuter=function(e){return arguments.length?u.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e):u.paddingTop()},u.paddingTop=function(e){return arguments.length?(o=typeof e==`function`?e:K(+e),u):o},u.paddingRight=function(e){return arguments.length?(s=typeof e==`function`?e:K(+e),u):s},u.paddingBottom=function(e){return arguments.length?(c=typeof e==`function`?e:K(+e),u):c},u.paddingLeft=function(e){return arguments.length?(l=typeof e==`function`?e:K(+e),u):l},u}var Y=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=o,this.getAccTitle=f,this.setDiagramTitle=s,this.getDiagramTitle=a,this.getAccDescription=c,this.setAccDescription=i}static{n(this,`TreeMapDB`)}getNodes(){return this.nodes}getConfig(){let t=d,n=p();return e({...t.treemap,...n.treemap??{}})}addNode(e,t){this.nodes.push(e),this.levels.set(e,t),t===0&&(this.outerNodes.push(e),this.root??=e)}getRoot(){return{name:``,children:this.outerNodes}}addClass(e,t){let n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},r=t.replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`).split(`;`);r&&r.forEach(e=>{x(e)&&(n?.textStyles?n.textStyles.push(e):n.textStyles=[e]),n?.styles?n.styles.push(e):n.styles=[e]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){l(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function X(e){if(!e.length)return[];let t=[],n=[];return e.forEach(e=>{let r={name:e.name,children:e.type===`Leaf`?void 0:[]};for(r.classSelector=e?.classSelector,e?.cssCompiledStyles&&(r.cssCompiledStyles=e.cssCompiledStyles),e.type===`Leaf`&&e.value!==void 0&&(r.value=e.value);n.length>0&&n[n.length-1].level>=e.level;)n.pop();if(n.length===0)t.push(r);else{let e=n[n.length-1].node;e.children?e.children.push(r):e.children=[r]}e.type!==`Leaf`&&n.push({node:r,level:e.level})}),t}n(X,`buildHierarchy`);var ae=n((e,t)=>{_(e,t);let r=[];for(let n of e.TreemapRows??[])n.$type===`ClassDefStatement`&&t.addClass(n.className??``,n.styleText??``);for(let n of e.TreemapRows??[]){let e=n.item;if(!e)continue;let i=n.indent?parseInt(n.indent):0,a=oe(e),o=e.classSelector?t.getStylesForClass(e.classSelector):[],s=o.length>0?o:void 0,c={level:i,name:a,type:e.$type,value:e.value,classSelector:e.classSelector,cssCompiledStyles:s};r.push(c)}let i=X(r),a=n((e,n)=>{for(let r of e)t.addNode(r,n),r.children&&r.children.length>0&&a(r.children,n+1)},`addNodesRecursively`);a(i,0)},`populate`),oe=n(e=>e.name?String(e.name):``,`getItemName`),Z={parser:{yy:void 0},parse:n(async e=>{try{let n=await v(`treemap`,e);t.debug(`Treemap AST:`,n);let r=Z.parser?.yy;if(!(r instanceof Y))throw Error(`parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);ae(n,r)}catch(e){throw t.error(`Error parsing treemap:`,e),e}},`parse`)},se=10,Q=10,$=25,ce={draw:n((e,i,a,o)=>{let s=o.db,c=s.getConfig(),l=c.padding??se,d=s.getDiagramTitle(),f=s.getRoot(),{themeVariables:_}=p();if(!f)return;let v=d?30:0,x=g(i),S=c.nodeWidth?c.nodeWidth*Q:960,C=c.nodeHeight?c.nodeHeight*Q:500,w=S,T=C+v;x.attr(`viewBox`,`0 0 ${w} ${T}`),u(x,T,w,c.useMaxWidth);let E;try{let e=c.valueFormat||`,`;if(e===`$0,0`)E=n(e=>`$`+h(`,`)(e),`valueFormat`);else if(e.startsWith(`$`)&&e.includes(`,`)){let t=/\.\d+/.exec(e),r=t?t[0]:``;E=n(e=>`$`+h(`,`+r)(e),`valueFormat`)}else if(e.startsWith(`$`)){let t=e.substring(1);E=n(e=>`$`+h(t||``)(e),`valueFormat`)}else E=h(e)}catch(e){t.error(`Error creating format function:`,e),E=h(`,`)}let D=m().range([`transparent`,_.cScale0,_.cScale1,_.cScale2,_.cScale3,_.cScale4,_.cScale5,_.cScale6,_.cScale7,_.cScale8,_.cScale9,_.cScale10,_.cScale11]),O=m().range([`transparent`,_.cScalePeer0,_.cScalePeer1,_.cScalePeer2,_.cScalePeer3,_.cScalePeer4,_.cScalePeer5,_.cScalePeer6,_.cScalePeer7,_.cScalePeer8,_.cScalePeer9,_.cScalePeer10,_.cScalePeer11]),k=m().range([_.cScaleLabel0,_.cScaleLabel1,_.cScaleLabel2,_.cScaleLabel3,_.cScaleLabel4,_.cScaleLabel5,_.cScaleLabel6,_.cScaleLabel7,_.cScaleLabel8,_.cScaleLabel9,_.cScaleLabel10,_.cScaleLabel11]);d&&x.append(`text`).attr(`x`,w/2).attr(`y`,v/2).attr(`class`,`treemapTitle`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(d);let A=x.append(`g`).attr(`transform`,`translate(0, ${v})`).attr(`class`,`treemapContainer`),j=L(f).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),M=ie().size([S,C]).paddingTop(e=>e.children&&e.children.length>0?$+Q:0).paddingInner(l).paddingLeft(e=>e.children&&e.children.length>0?Q:0).paddingRight(e=>e.children&&e.children.length>0?Q:0).paddingBottom(e=>e.children&&e.children.length>0?Q:0).round(!0)(j),N=M.descendants().filter(e=>e.children&&e.children.length>0),P=A.selectAll(`.treemapSection`).data(N).enter().append(`g`).attr(`class`,`treemapSection`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,$).attr(`class`,`treemapSectionHeader`).attr(`fill`,`none`).attr(`fill-opacity`,.6).attr(`stroke-width`,.6).attr(`style`,e=>e.depth===0?`display: none;`:``),P.append(`clipPath`).attr(`id`,(e,t)=>`clip-section-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-12)).attr(`height`,$),P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,(e,t)=>`treemapSection section${t}`).attr(`fill`,e=>D(e.data.name)).attr(`fill-opacity`,.6).attr(`stroke`,e=>O(e.data.name)).attr(`stroke-width`,2).attr(`stroke-opacity`,.4).attr(`style`,e=>{if(e.depth===0)return`display: none;`;let t=b({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+`;`+t.borderStyles.join(`;`)}),P.append(`text`).attr(`class`,`treemapSectionLabel`).attr(`x`,6).attr(`y`,$/2).attr(`dominant-baseline`,`middle`).text(e=>e.depth===0?``:e.data.name).attr(`font-weight`,`bold`).attr(`style`,e=>e.depth===0?`display: none;`:`dominant-baseline: middle; font-size: 12px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+b({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).each(function(e){if(e.depth===0)return;let t=r(this),n=e.data.name;t.text(n);let i=e.x1-e.x0,a;a=c.showValues!==!1&&e.value?i-10-30-10-6:i-6-6;let o=Math.max(15,a),s=t.node();if(s.getComputedTextLength()>o){let e=n;for(;e.length>0;){if(e=n.substring(0,e.length-1),e.length===0){t.text(`...`),s.getComputedTextLength()>o&&t.text(``);break}if(t.text(e+`...`),s.getComputedTextLength()<=o)break}}}),c.showValues!==!1&&P.append(`text`).attr(`class`,`treemapSectionValue`).attr(`x`,e=>e.x1-e.x0-10).attr(`y`,$/2).attr(`text-anchor`,`end`).attr(`dominant-baseline`,`middle`).text(e=>e.value?E(e.value):``).attr(`font-style`,`italic`).attr(`style`,e=>e.depth===0?`display: none;`:`text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+b({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`));let F=M.leaves(),I=A.selectAll(`.treemapLeafGroup`).data(F).enter().append(`g`).attr(`class`,(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:``}x`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);I.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,`treemapLeaf`).attr(`fill`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`style`,e=>b({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr(`fill-opacity`,.3).attr(`stroke`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`stroke-width`,3),I.append(`clipPath`).attr(`id`,(e,t)=>`clip-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-4)).attr(`height`,e=>Math.max(0,e.y1-e.y0-4)),I.append(`text`).attr(`class`,`treemapLabel`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,e=>(e.y1-e.y0)/2).attr(`style`,e=>`text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:`+k(e.data.name)+`;`+b({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.data.name).each(function(e){let t=r(this),n=e.x1-e.x0,i=e.y1-e.y0,a=t.node(),o=n-8,s=i-8;if(o<10||s<10){t.style(`display`,`none`);return}let c=parseInt(t.style(`font-size`),10),l=.6;for(;a.getComputedTextLength()>o&&c>8;)c--,t.style(`font-size`,`${c}px`);let u=Math.max(6,Math.min(28,Math.round(c*l))),d=c+2+u;for(;d>s&&c>8&&(c--,u=Math.max(6,Math.min(28,Math.round(c*l))),!(u<6&&c===8));)t.style(`font-size`,`${c}px`),d=c+2+u;t.style(`font-size`,`${c}px`),(a.getComputedTextLength()>o||c<8||s<c)&&t.style(`display`,`none`)}),c.showValues!==!1&&I.append(`text`).attr(`class`,`treemapValue`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,function(e){return(e.y1-e.y0)/2}).attr(`style`,e=>`text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:`+k(e.data.name)+`;`+b({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.value?E(e.value):``).each(function(e){let t=r(this),n=this.parentNode;if(!n){t.style(`display`,`none`);return}let i=r(n).select(`.treemapLabel`);if(i.empty()||i.style(`display`)===`none`){t.style(`display`,`none`);return}let a=parseFloat(i.style(`font-size`)),o=Math.max(6,Math.min(28,Math.round(a*.6)));t.style(`font-size`,`${o}px`);let s=(e.y1-e.y0)/2+a/2+2;t.attr(`y`,s);let c=e.x1-e.x0,l=e.y1-e.y0-4,u=c-8;t.node().getComputedTextLength()>u||s+o>l||o<6?t.style(`display`,`none`):t.style(`display`,null)}),y(x,c.diagramPadding??8,`flowchart`,c?.useMaxWidth||!1)},`draw`),getClasses:n(function(e,t){return t.db.getClasses()},`getClasses`)},le={sectionStrokeColor:`black`,sectionStrokeWidth:`1`,sectionFillColor:`#efefef`,leafStrokeColor:`black`,leafStrokeWidth:`1`,leafFillColor:`#efefef`,labelColor:`black`,labelFontSize:`12px`,valueFontSize:`10px`,valueColor:`black`,titleColor:`black`,titleFontSize:`14px`},ue={parser:Z,get db(){return new Y},renderer:ce,styles:n(({treemap:t}={})=>{let n=e(le,t);return`
2
2
  .treemapNode.section {
3
3
  stroke: ${n.sectionStrokeColor};
4
4
  stroke-width: ${n.sectionStrokeWidth};
@@ -1,4 +1,4 @@
1
- import"./chunk-XZSTWKYB-DxAOx4hG.js";import{r as e}from"./chunk-GEFDOKGD-D-pKjlVd.js";import"./chunk-R5LLSJPH-CFwSJijQ.js";import"./chunk-7E7YKBS2-CiyUJxNI.js";import"./chunk-EGIJ26TM-DzqmU2Z7.js";import"./chunk-C72U2L5F-D21mS_6G.js";import"./chunk-XIRO2GV7-Djlmrely.js";import"./chunk-L3YUKLVL-C7qGJrfV.js";import"./chunk-OZEHJAEY-BXhYx3nO.js";import{g as t,h as n}from"./src-BqX54PbV.js";import{B as r,C as i,E as a,V as o,W as s,_ as c,a as l,c as u,d,v as f,y as p}from"./chunk-7R4GIKGN-Dv-4cAYn.js";import{t as m}from"./chunk-HHEYEP7N-C7vxA5i9.js";import"./dist-CSJdAyA9.js";import{t as h}from"./chunk-4BX2VUAB-D4tOov49.js";import{t as g}from"./mermaid-parser.core-C7UwoIh6.js";var _={showLegend:!0,ticks:5,max:null,min:0,graticule:`circle`},v={axes:[],curves:[],options:_},y=structuredClone(v),b=d.radar,x=n(()=>e({...b,...p().radar}),`getConfig`),S=n(()=>y.axes,`getAxes`),C=n(()=>y.curves,`getCurves`),w=n(()=>y.options,`getOptions`),T=n(e=>{y.axes=e.map(e=>({name:e.name,label:e.label??e.name}))},`setAxes`),E=n(e=>{y.curves=e.map(e=>({name:e.name,label:e.label??e.name,entries:D(e.entries)}))},`setCurves`),D=n(e=>{if(e[0].axis==null)return e.map(e=>e.value);let t=S();if(t.length===0)throw Error(`Axes must be populated before curves for reference entries`);return t.map(t=>{let n=e.find(e=>e.axis?.$refText===t.name);if(n===void 0)throw Error(`Missing entry for axis `+t.label);return n.value})},`computeCurveEntries`),O={getAxes:S,getCurves:C,getOptions:w,setAxes:T,setCurves:E,setOptions:n(e=>{let t=e.reduce((e,t)=>(e[t.name]=t,e),{});y.options={showLegend:t.showLegend?.value??_.showLegend,ticks:t.ticks?.value??_.ticks,max:t.max?.value??_.max,min:t.min?.value??_.min,graticule:t.graticule?.value??_.graticule}},`setOptions`),getConfig:x,clear:n(()=>{l(),y=structuredClone(v)},`clear`),setAccTitle:o,getAccTitle:f,setDiagramTitle:s,getDiagramTitle:i,getAccDescription:c,setAccDescription:r},k=n(e=>{h(e,O);let{axes:t,curves:n,options:r}=e;O.setAxes(t),O.setCurves(n),O.setOptions(r)},`populate`),A={parse:n(async e=>{let n=await g(`radar`,e);t.debug(n),k(n)},`parse`)},j=n((e,t,n,r)=>{let i=r.db,a=i.getAxes(),o=i.getCurves(),s=i.getOptions(),c=i.getConfig(),l=i.getDiagramTitle(),u=M(m(t),c),d=s.max??Math.max(...o.map(e=>Math.max(...e.entries))),f=s.min,p=Math.min(c.width,c.height)/2;N(u,a,p,s.ticks,s.graticule),P(u,a,p,c),F(u,a,o,f,d,s.graticule,c),R(u,o,s.showLegend,c),u.append(`text`).attr(`class`,`radarTitle`).text(l).attr(`x`,0).attr(`y`,-c.height/2-c.marginTop)},`draw`),M=n((e,t)=>{let n=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,i={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return u(e,r,n,t.useMaxWidth??!0),e.attr(`viewBox`,`0 0 ${n} ${r}`),e.append(`g`).attr(`transform`,`translate(${i.x}, ${i.y})`)},`drawFrame`),N=n((e,t,n,r,i)=>{if(i===`circle`)for(let t=0;t<r;t++){let i=n*(t+1)/r;e.append(`circle`).attr(`r`,i).attr(`class`,`radarGraticule`)}else if(i===`polygon`){let i=t.length;for(let a=0;a<r;a++){let o=n*(a+1)/r,s=t.map((e,t)=>{let n=2*t*Math.PI/i-Math.PI/2;return`${o*Math.cos(n)},${o*Math.sin(n)}`}).join(` `);e.append(`polygon`).attr(`points`,s).attr(`class`,`radarGraticule`)}}},`drawGraticule`),P=n((e,t,n,r)=>{let i=t.length;for(let a=0;a<i;a++){let o=t[a].label,s=2*a*Math.PI/i-Math.PI/2;e.append(`line`).attr(`x1`,0).attr(`y1`,0).attr(`x2`,n*r.axisScaleFactor*Math.cos(s)).attr(`y2`,n*r.axisScaleFactor*Math.sin(s)).attr(`class`,`radarAxisLine`),e.append(`text`).text(o).attr(`x`,n*r.axisLabelFactor*Math.cos(s)).attr(`y`,n*r.axisLabelFactor*Math.sin(s)).attr(`class`,`radarAxisLabel`)}},`drawAxes`);function F(e,t,n,r,i,a,o){let s=t.length,c=Math.min(o.width,o.height)/2;n.forEach((t,n)=>{if(t.entries.length!==s)return;let l=t.entries.map((e,t)=>{let n=2*Math.PI*t/s-Math.PI/2,a=I(e,r,i,c);return{x:a*Math.cos(n),y:a*Math.sin(n)}});a===`circle`?e.append(`path`).attr(`d`,L(l,o.curveTension)).attr(`class`,`radarCurve-${n}`):a===`polygon`&&e.append(`polygon`).attr(`points`,l.map(e=>`${e.x},${e.y}`).join(` `)).attr(`class`,`radarCurve-${n}`)})}n(F,`drawCurves`);function I(e,t,n,r){return r*(Math.min(Math.max(e,t),n)-t)/(n-t)}n(I,`relativeRadius`);function L(e,t){let n=e.length,r=`M${e[0].x},${e[0].y}`;for(let i=0;i<n;i++){let a=e[(i-1+n)%n],o=e[i],s=e[(i+1)%n],c=e[(i+2)%n],l={x:o.x+(s.x-a.x)*t,y:o.y+(s.y-a.y)*t},u={x:s.x-(c.x-o.x)*t,y:s.y-(c.y-o.y)*t};r+=` C${l.x},${l.y} ${u.x},${u.y} ${s.x},${s.y}`}return`${r} Z`}n(L,`closedRoundCurve`);function R(e,t,n,r){if(!n)return;let i=(r.width/2+r.marginRight)*3/4,a=-(r.height/2+r.marginTop)*3/4;t.forEach((t,n)=>{let r=e.append(`g`).attr(`transform`,`translate(${i}, ${a+n*20})`);r.append(`rect`).attr(`width`,12).attr(`height`,12).attr(`class`,`radarLegendBox-${n}`),r.append(`text`).attr(`x`,16).attr(`y`,0).attr(`class`,`radarLegendText`).text(t.label)})}n(R,`drawLegend`);var z={draw:j},B=n((e,t)=>{let n=``;for(let r=0;r<e.THEME_COLOR_LIMIT;r++){let i=e[`cScale${r}`];n+=`
1
+ import"./chunk-XZSTWKYB-DxAOx4hG.js";import{r as e}from"./chunk-GEFDOKGD-BbQkJu8C.js";import"./chunk-R5LLSJPH-CFwSJijQ.js";import"./chunk-7E7YKBS2-CiyUJxNI.js";import"./chunk-EGIJ26TM-DzqmU2Z7.js";import"./chunk-C72U2L5F-D21mS_6G.js";import"./chunk-XIRO2GV7-Djlmrely.js";import"./chunk-L3YUKLVL-C7qGJrfV.js";import"./chunk-OZEHJAEY-BXhYx3nO.js";import{g as t,h as n}from"./src-BqX54PbV.js";import{B as r,C as i,E as a,V as o,W as s,_ as c,a as l,c as u,d,v as f,y as p}from"./chunk-7R4GIKGN-BbIFzsIv.js";import{t as m}from"./chunk-HHEYEP7N-HRhYy3kG.js";import"./dist-CSJdAyA9.js";import{t as h}from"./chunk-4BX2VUAB-D4tOov49.js";import{t as g}from"./mermaid-parser.core-DMIWdgEW.js";var _={showLegend:!0,ticks:5,max:null,min:0,graticule:`circle`},v={axes:[],curves:[],options:_},y=structuredClone(v),b=d.radar,x=n(()=>e({...b,...p().radar}),`getConfig`),S=n(()=>y.axes,`getAxes`),C=n(()=>y.curves,`getCurves`),w=n(()=>y.options,`getOptions`),T=n(e=>{y.axes=e.map(e=>({name:e.name,label:e.label??e.name}))},`setAxes`),E=n(e=>{y.curves=e.map(e=>({name:e.name,label:e.label??e.name,entries:D(e.entries)}))},`setCurves`),D=n(e=>{if(e[0].axis==null)return e.map(e=>e.value);let t=S();if(t.length===0)throw Error(`Axes must be populated before curves for reference entries`);return t.map(t=>{let n=e.find(e=>e.axis?.$refText===t.name);if(n===void 0)throw Error(`Missing entry for axis `+t.label);return n.value})},`computeCurveEntries`),O={getAxes:S,getCurves:C,getOptions:w,setAxes:T,setCurves:E,setOptions:n(e=>{let t=e.reduce((e,t)=>(e[t.name]=t,e),{});y.options={showLegend:t.showLegend?.value??_.showLegend,ticks:t.ticks?.value??_.ticks,max:t.max?.value??_.max,min:t.min?.value??_.min,graticule:t.graticule?.value??_.graticule}},`setOptions`),getConfig:x,clear:n(()=>{l(),y=structuredClone(v)},`clear`),setAccTitle:o,getAccTitle:f,setDiagramTitle:s,getDiagramTitle:i,getAccDescription:c,setAccDescription:r},k=n(e=>{h(e,O);let{axes:t,curves:n,options:r}=e;O.setAxes(t),O.setCurves(n),O.setOptions(r)},`populate`),A={parse:n(async e=>{let n=await g(`radar`,e);t.debug(n),k(n)},`parse`)},j=n((e,t,n,r)=>{let i=r.db,a=i.getAxes(),o=i.getCurves(),s=i.getOptions(),c=i.getConfig(),l=i.getDiagramTitle(),u=M(m(t),c),d=s.max??Math.max(...o.map(e=>Math.max(...e.entries))),f=s.min,p=Math.min(c.width,c.height)/2;N(u,a,p,s.ticks,s.graticule),P(u,a,p,c),F(u,a,o,f,d,s.graticule,c),R(u,o,s.showLegend,c),u.append(`text`).attr(`class`,`radarTitle`).text(l).attr(`x`,0).attr(`y`,-c.height/2-c.marginTop)},`draw`),M=n((e,t)=>{let n=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,i={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return u(e,r,n,t.useMaxWidth??!0),e.attr(`viewBox`,`0 0 ${n} ${r}`),e.append(`g`).attr(`transform`,`translate(${i.x}, ${i.y})`)},`drawFrame`),N=n((e,t,n,r,i)=>{if(i===`circle`)for(let t=0;t<r;t++){let i=n*(t+1)/r;e.append(`circle`).attr(`r`,i).attr(`class`,`radarGraticule`)}else if(i===`polygon`){let i=t.length;for(let a=0;a<r;a++){let o=n*(a+1)/r,s=t.map((e,t)=>{let n=2*t*Math.PI/i-Math.PI/2;return`${o*Math.cos(n)},${o*Math.sin(n)}`}).join(` `);e.append(`polygon`).attr(`points`,s).attr(`class`,`radarGraticule`)}}},`drawGraticule`),P=n((e,t,n,r)=>{let i=t.length;for(let a=0;a<i;a++){let o=t[a].label,s=2*a*Math.PI/i-Math.PI/2;e.append(`line`).attr(`x1`,0).attr(`y1`,0).attr(`x2`,n*r.axisScaleFactor*Math.cos(s)).attr(`y2`,n*r.axisScaleFactor*Math.sin(s)).attr(`class`,`radarAxisLine`),e.append(`text`).text(o).attr(`x`,n*r.axisLabelFactor*Math.cos(s)).attr(`y`,n*r.axisLabelFactor*Math.sin(s)).attr(`class`,`radarAxisLabel`)}},`drawAxes`);function F(e,t,n,r,i,a,o){let s=t.length,c=Math.min(o.width,o.height)/2;n.forEach((t,n)=>{if(t.entries.length!==s)return;let l=t.entries.map((e,t)=>{let n=2*Math.PI*t/s-Math.PI/2,a=I(e,r,i,c);return{x:a*Math.cos(n),y:a*Math.sin(n)}});a===`circle`?e.append(`path`).attr(`d`,L(l,o.curveTension)).attr(`class`,`radarCurve-${n}`):a===`polygon`&&e.append(`polygon`).attr(`points`,l.map(e=>`${e.x},${e.y}`).join(` `)).attr(`class`,`radarCurve-${n}`)})}n(F,`drawCurves`);function I(e,t,n,r){return r*(Math.min(Math.max(e,t),n)-t)/(n-t)}n(I,`relativeRadius`);function L(e,t){let n=e.length,r=`M${e[0].x},${e[0].y}`;for(let i=0;i<n;i++){let a=e[(i-1+n)%n],o=e[i],s=e[(i+1)%n],c=e[(i+2)%n],l={x:o.x+(s.x-a.x)*t,y:o.y+(s.y-a.y)*t},u={x:s.x-(c.x-o.x)*t,y:s.y-(c.y-o.y)*t};r+=` C${l.x},${l.y} ${u.x},${u.y} ${s.x},${s.y}`}return`${r} Z`}n(L,`closedRoundCurve`);function R(e,t,n,r){if(!n)return;let i=(r.width/2+r.marginRight)*3/4,a=-(r.height/2+r.marginTop)*3/4;t.forEach((t,n)=>{let r=e.append(`g`).attr(`transform`,`translate(${i}, ${a+n*20})`);r.append(`rect`).attr(`width`,12).attr(`height`,12).attr(`class`,`radarLegendBox-${n}`),r.append(`text`).attr(`x`,16).attr(`y`,0).attr(`class`,`radarLegendText`).text(t.label)})}n(R,`drawLegend`);var z={draw:j},B=n((e,t)=>{let n=``;for(let r=0;r<e.THEME_COLOR_LIMIT;r++){let i=e[`cScale${r}`];n+=`
2
2
  .radarCurve-${r} {
3
3
  color: ${i};
4
4
  fill: ${i};
@@ -1,4 +1,4 @@
1
- import"./chunk-XZSTWKYB-DxAOx4hG.js";import{r as e}from"./chunk-GEFDOKGD-D-pKjlVd.js";import"./chunk-R5LLSJPH-CFwSJijQ.js";import"./chunk-7E7YKBS2-CiyUJxNI.js";import"./chunk-EGIJ26TM-DzqmU2Z7.js";import"./chunk-C72U2L5F-D21mS_6G.js";import"./chunk-XIRO2GV7-Djlmrely.js";import"./chunk-L3YUKLVL-C7qGJrfV.js";import"./chunk-OZEHJAEY-BXhYx3nO.js";import{g as t,h as n}from"./src-BqX54PbV.js";import{B as r,C as i,V as a,W as o,_ as s,a as c,c as l,d as u,v as d,y as f}from"./chunk-7R4GIKGN-Dv-4cAYn.js";import{t as p}from"./chunk-HHEYEP7N-C7vxA5i9.js";import"./dist-CSJdAyA9.js";import{t as m}from"./chunk-4BX2VUAB-D4tOov49.js";import{t as h}from"./mermaid-parser.core-C7UwoIh6.js";var g=u.packet,_=class{constructor(){this.packet=[],this.setAccTitle=a,this.getAccTitle=d,this.setDiagramTitle=o,this.getDiagramTitle=i,this.getAccDescription=s,this.setAccDescription=r}static{n(this,`PacketDB`)}getConfig(){let t=e({...g,...f().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){c(),this.packet=[]}},v=1e4,y=n((e,n)=>{m(e,n);let r=-1,i=[],a=1,{bitsPerRow:o}=n.getConfig();for(let{start:s,end:c,bits:l,label:u}of e.blocks){if(s!==void 0&&c!==void 0&&c<s)throw Error(`Packet block ${s} - ${c} is invalid. End must be greater than start.`);if(s??=r+1,s!==r+1)throw Error(`Packet block ${s} - ${c??s} is not contiguous. It should start from ${r+1}.`);if(l===0)throw Error(`Packet block ${s} is invalid. Cannot have a zero bit field.`);for(c??=s+(l??1)-1,l??=c-s+1,r=c,t.debug(`Packet block ${s} - ${r} with label ${u}`);i.length<=o+1&&n.getPacket().length<v;){let[e,t]=b({start:s,end:c,bits:l,label:u},a,o);if(i.push(e),e.end+1===a*o&&(n.pushWord(i),i=[],a++),!t)break;({start:s,end:c,bits:l,label:u}=t)}}n.pushWord(i)},`populate`),b=n((e,t,n)=>{if(e.start===void 0)throw Error(`start should have been set during first phase`);if(e.end===void 0)throw Error(`end should have been set during first phase`);if(e.start>e.end)throw Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*n)return[e,void 0];let r=t*n-1,i=t*n;return[{start:e.start,end:r,label:e.label,bits:r-e.start},{start:i,end:e.end,label:e.label,bits:e.end-i}]},`getNextFittingBlock`),x={parser:{yy:void 0},parse:n(async e=>{let n=await h(`packet`,e),r=x.parser?.yy;if(!(r instanceof _))throw Error(`parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);t.debug(n),y(n,r)},`parse`)},S=n((e,t,n,r)=>{let i=r.db,a=i.getConfig(),{rowHeight:o,paddingY:s,bitWidth:c,bitsPerRow:u}=a,d=i.getPacket(),f=i.getDiagramTitle(),m=o+s,h=m*(d.length+1)-(f?0:o),g=c*u+2,_=p(t);_.attr(`viewBox`,`0 0 ${g} ${h}`),l(_,h,g,a.useMaxWidth);for(let[e,t]of d.entries())C(_,t,e,a);_.append(`text`).text(f).attr(`x`,g/2).attr(`y`,h-m/2).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).attr(`class`,`packetTitle`)},`draw`),C=n((e,t,n,{rowHeight:r,paddingX:i,paddingY:a,bitWidth:o,bitsPerRow:s,showBits:c})=>{let l=e.append(`g`),u=n*(r+a)+a;for(let e of t){let t=e.start%s*o+1,n=(e.end-e.start+1)*o-i;if(l.append(`rect`).attr(`x`,t).attr(`y`,u).attr(`width`,n).attr(`height`,r).attr(`class`,`packetBlock`),l.append(`text`).attr(`x`,t+n/2).attr(`y`,u+r/2).attr(`class`,`packetLabel`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).text(e.label),!c)continue;let a=e.end===e.start,d=u-2;l.append(`text`).attr(`x`,t+(a?n/2:0)).attr(`y`,d).attr(`class`,`packetByte start`).attr(`dominant-baseline`,`auto`).attr(`text-anchor`,a?`middle`:`start`).text(e.start),a||l.append(`text`).attr(`x`,t+n).attr(`y`,d).attr(`class`,`packetByte end`).attr(`dominant-baseline`,`auto`).attr(`text-anchor`,`end`).text(e.end)}},`drawWord`),w={draw:S},T={byteFontSize:`10px`,startByteColor:`black`,endByteColor:`black`,labelColor:`black`,labelFontSize:`12px`,titleColor:`black`,titleFontSize:`14px`,blockStrokeColor:`black`,blockStrokeWidth:`1`,blockFillColor:`#efefef`},E={parser:x,get db(){return new _},renderer:w,styles:n(({packet:t}={})=>{let n=e(T,t);return`
1
+ import"./chunk-XZSTWKYB-DxAOx4hG.js";import{r as e}from"./chunk-GEFDOKGD-BbQkJu8C.js";import"./chunk-R5LLSJPH-CFwSJijQ.js";import"./chunk-7E7YKBS2-CiyUJxNI.js";import"./chunk-EGIJ26TM-DzqmU2Z7.js";import"./chunk-C72U2L5F-D21mS_6G.js";import"./chunk-XIRO2GV7-Djlmrely.js";import"./chunk-L3YUKLVL-C7qGJrfV.js";import"./chunk-OZEHJAEY-BXhYx3nO.js";import{g as t,h as n}from"./src-BqX54PbV.js";import{B as r,C as i,V as a,W as o,_ as s,a as c,c as l,d as u,v as d,y as f}from"./chunk-7R4GIKGN-BbIFzsIv.js";import{t as p}from"./chunk-HHEYEP7N-HRhYy3kG.js";import"./dist-CSJdAyA9.js";import{t as m}from"./chunk-4BX2VUAB-D4tOov49.js";import{t as h}from"./mermaid-parser.core-DMIWdgEW.js";var g=u.packet,_=class{constructor(){this.packet=[],this.setAccTitle=a,this.getAccTitle=d,this.setDiagramTitle=o,this.getDiagramTitle=i,this.getAccDescription=s,this.setAccDescription=r}static{n(this,`PacketDB`)}getConfig(){let t=e({...g,...f().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){c(),this.packet=[]}},v=1e4,y=n((e,n)=>{m(e,n);let r=-1,i=[],a=1,{bitsPerRow:o}=n.getConfig();for(let{start:s,end:c,bits:l,label:u}of e.blocks){if(s!==void 0&&c!==void 0&&c<s)throw Error(`Packet block ${s} - ${c} is invalid. End must be greater than start.`);if(s??=r+1,s!==r+1)throw Error(`Packet block ${s} - ${c??s} is not contiguous. It should start from ${r+1}.`);if(l===0)throw Error(`Packet block ${s} is invalid. Cannot have a zero bit field.`);for(c??=s+(l??1)-1,l??=c-s+1,r=c,t.debug(`Packet block ${s} - ${r} with label ${u}`);i.length<=o+1&&n.getPacket().length<v;){let[e,t]=b({start:s,end:c,bits:l,label:u},a,o);if(i.push(e),e.end+1===a*o&&(n.pushWord(i),i=[],a++),!t)break;({start:s,end:c,bits:l,label:u}=t)}}n.pushWord(i)},`populate`),b=n((e,t,n)=>{if(e.start===void 0)throw Error(`start should have been set during first phase`);if(e.end===void 0)throw Error(`end should have been set during first phase`);if(e.start>e.end)throw Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*n)return[e,void 0];let r=t*n-1,i=t*n;return[{start:e.start,end:r,label:e.label,bits:r-e.start},{start:i,end:e.end,label:e.label,bits:e.end-i}]},`getNextFittingBlock`),x={parser:{yy:void 0},parse:n(async e=>{let n=await h(`packet`,e),r=x.parser?.yy;if(!(r instanceof _))throw Error(`parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);t.debug(n),y(n,r)},`parse`)},S=n((e,t,n,r)=>{let i=r.db,a=i.getConfig(),{rowHeight:o,paddingY:s,bitWidth:c,bitsPerRow:u}=a,d=i.getPacket(),f=i.getDiagramTitle(),m=o+s,h=m*(d.length+1)-(f?0:o),g=c*u+2,_=p(t);_.attr(`viewBox`,`0 0 ${g} ${h}`),l(_,h,g,a.useMaxWidth);for(let[e,t]of d.entries())C(_,t,e,a);_.append(`text`).text(f).attr(`x`,g/2).attr(`y`,h-m/2).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).attr(`class`,`packetTitle`)},`draw`),C=n((e,t,n,{rowHeight:r,paddingX:i,paddingY:a,bitWidth:o,bitsPerRow:s,showBits:c})=>{let l=e.append(`g`),u=n*(r+a)+a;for(let e of t){let t=e.start%s*o+1,n=(e.end-e.start+1)*o-i;if(l.append(`rect`).attr(`x`,t).attr(`y`,u).attr(`width`,n).attr(`height`,r).attr(`class`,`packetBlock`),l.append(`text`).attr(`x`,t+n/2).attr(`y`,u+r/2).attr(`class`,`packetLabel`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).text(e.label),!c)continue;let a=e.end===e.start,d=u-2;l.append(`text`).attr(`x`,t+(a?n/2:0)).attr(`y`,d).attr(`class`,`packetByte start`).attr(`dominant-baseline`,`auto`).attr(`text-anchor`,a?`middle`:`start`).text(e.start),a||l.append(`text`).attr(`x`,t+n).attr(`y`,d).attr(`class`,`packetByte end`).attr(`dominant-baseline`,`auto`).attr(`text-anchor`,`end`).text(e.end)}},`drawWord`),w={draw:S},T={byteFontSize:`10px`,startByteColor:`black`,endByteColor:`black`,labelColor:`black`,labelFontSize:`12px`,titleColor:`black`,titleFontSize:`14px`,blockStrokeColor:`black`,blockStrokeWidth:`1`,blockFillColor:`#efefef`},E={parser:x,get db(){return new _},renderer:w,styles:n(({packet:t}={})=>{let n=e(T,t);return`
2
2
  .packetByte {
3
3
  font-size: ${n.byteFontSize};
4
4
  }
@@ -1,4 +1,4 @@
1
- import{o as e}from"./chunk-CFjPhJqf.js";import{t}from"./react-nm2Ru1Pt.js";import{t as n}from"./createLucideIcon-PuMiQgHl.js";import{t as r}from"./columns-2-cEVJHYd7.js";import{i,r as a,t as o}from"./use-monaco-theme-BsMRP0ci.js";import{t as s}from"./jsx-runtime-kMwlnEGE.js";import{i as c,t as l}from"./api-client-BfBM3I7n.js";import{G as u,ct as d,ht as f,it as p}from"./index-C6uPEeqG.js";var m=n(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),h=e(t(),1),g=s();function _(e){return{js:`javascript`,jsx:`javascript`,ts:`typescript`,tsx:`typescript`,py:`python`,html:`html`,css:`css`,scss:`scss`,json:`json`,md:`markdown`,mdx:`markdown`,yaml:`yaml`,yml:`yaml`,sh:`shell`,bash:`shell`}[e.split(`.`).pop()?.toLowerCase()??``]??`plaintext`}function v({metadata:e}){let t=e?.filePath,n=e?.projectName,s=e?.ref1,v=e?.ref2,b=e?.file1,x=e?.file2,S=e?.original,C=e?.modified,w=S!=null||C!=null,T=!!(b&&x),[E,D]=(0,h.useState)(null),[O,k]=(0,h.useState)(null),[A,j]=(0,h.useState)(!w),[M,N]=(0,h.useState)(null),[P,F]=(0,h.useState)(`both`),{wordWrap:I,toggleWordWrap:L}=u(),R=o(),z=(0,h.useRef)(null),[B,V]=(0,h.useState)();(0,h.useEffect)(()=>{let e=z.current;if(!e)return;let t=new ResizeObserver(([e])=>{e&&V(Math.floor(e.contentRect.height))});return t.observe(e),()=>t.disconnect()},[A,M]),(0,h.useEffect)(()=>{if(w||!n)return;if(j(!0),N(null),b&&x){let e=new URLSearchParams({file1:b,file2:x});l.get(`${c(n)}/files/compare?${e}`).then(e=>{k(e),j(!1)}).catch(e=>{N(e instanceof Error?e.message:`Failed to compare files`),j(!1)});return}let e;if(t){let r=new URLSearchParams({file:t});s&&r.set(`ref`,s),e=`${c(n)}/git/file-diff?${r}`}else if(s||v){let t=new URLSearchParams;s&&t.set(`ref1`,s),v&&t.set(`ref2`,v),e=`${c(n)}/git/diff?${t}`}else e=`${c(n)}/git/diff`;l.get(e).then(e=>{D(e.diff),j(!1)}).catch(e=>{N(e instanceof Error?e.message:`Failed to load diff`),j(!1)})},[t,n,s,v,b,x,w]);let{original:H,modified:U}=(0,h.useMemo)(()=>w?{original:S??``,modified:C??``}:T&&O?O:E?y(E):{original:``,modified:``},[E,w,S,C,T,O]),W=(0,h.useMemo)(()=>{let e=t??x??b;return e?_(e):`plaintext`},[t,b,x]),G=typeof window<`u`&&window.innerWidth<768,K=!G&&P===`both`;return!n&&!w?(0,g.jsx)(`div`,{className:`flex items-center justify-center h-full text-muted-foreground text-sm`,children:`No project selected.`}):A?(0,g.jsxs)(`div`,{className:`flex items-center justify-center h-full gap-2 text-muted-foreground`,children:[(0,g.jsx)(d,{className:`size-5 animate-spin`}),(0,g.jsx)(`span`,{className:`text-sm`,children:`Loading diff...`})]}):M?(0,g.jsx)(`div`,{className:`flex items-center justify-center h-full text-destructive text-sm`,children:M}):!w&&!T&&!H&&!U?(0,g.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-2 text-muted-foreground`,children:[(0,g.jsx)(f,{className:`size-8`}),(0,g.jsx)(`p`,{className:`text-sm`,children:`No content changes`}),t&&(0,g.jsx)(`p`,{className:`text-xs font-mono`,children:t})]}):(0,g.jsxs)(`div`,{className:`flex flex-col h-full`,children:[!G&&(0,g.jsxs)(`div`,{className:`flex items-center justify-end gap-0.5 px-2 py-0.5 border-b border-border shrink-0`,children:[(0,g.jsx)(`button`,{type:`button`,onClick:()=>F(P===`left`?`both`:`left`),className:`p-1 rounded hover:bg-muted transition-colors ${P===`left`?`bg-muted text-foreground`:``}`,title:`Expand original`,children:(0,g.jsx)(p,{className:`size-3.5`})}),(0,g.jsx)(`button`,{type:`button`,onClick:()=>F(`both`),className:`p-1 rounded hover:bg-muted transition-colors ${P===`both`?`bg-muted text-foreground`:``}`,title:`Side by side`,children:(0,g.jsx)(r,{className:`size-3.5`})}),(0,g.jsx)(`button`,{type:`button`,onClick:()=>F(P===`right`?`both`:`right`),className:`p-1 rounded hover:bg-muted transition-colors ${P===`right`?`bg-muted text-foreground`:``}`,title:`Expand modified`,children:(0,g.jsx)(m,{className:`size-3.5`})}),(0,g.jsx)(`div`,{className:`w-px h-3.5 bg-border mx-0.5 shrink-0`}),(0,g.jsx)(`button`,{type:`button`,onClick:L,title:`Toggle word wrap`,className:`p-1 rounded hover:bg-muted transition-colors ${I?`bg-muted text-foreground`:``}`,children:(0,g.jsx)(i,{className:`size-3.5`})})]}),(0,g.jsx)(`div`,{ref:z,className:`flex-1 overflow-hidden`,children:B&&B>0?(0,g.jsx)(a,{height:B,language:W,original:H,modified:U,theme:R,options:{fontSize:G?11:13,fontFamily:`Menlo, Monaco, Consolas, monospace`,wordWrap:G||I?`on`:`off`,renderSideBySide:K,readOnly:!0,automaticLayout:!0,scrollBeyondLastLine:!1},loading:(0,g.jsx)(d,{className:`size-5 animate-spin text-muted-foreground`})}):(0,g.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,g.jsx)(d,{className:`size-5 animate-spin text-muted-foreground`})})})]})}function y(e){let t=e.split(`
1
+ import{o as e}from"./chunk-CFjPhJqf.js";import{t}from"./react-nm2Ru1Pt.js";import{t as n}from"./createLucideIcon-PuMiQgHl.js";import{t as r}from"./columns-2-cEVJHYd7.js";import{i,r as a,t as o}from"./use-monaco-theme-C52E96dj.js";import{t as s}from"./jsx-runtime-O3jQaKZd.js";import{i as c,t as l}from"./api-client-BfBM3I7n.js";import{K as u,at as d,gt as f,lt as p}from"./index-WGGO0qq9.js";var m=n(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),h=e(t(),1),g=s();function _(e){return{js:`javascript`,jsx:`javascript`,ts:`typescript`,tsx:`typescript`,py:`python`,html:`html`,css:`css`,scss:`scss`,json:`json`,md:`markdown`,mdx:`markdown`,yaml:`yaml`,yml:`yaml`,sh:`shell`,bash:`shell`}[e.split(`.`).pop()?.toLowerCase()??``]??`plaintext`}function v({metadata:e}){let t=e?.filePath,n=e?.projectName,s=e?.ref1,v=e?.ref2,b=e?.file1,x=e?.file2,S=e?.original,C=e?.modified,w=S!=null||C!=null,T=!!(b&&x),[E,D]=(0,h.useState)(null),[O,k]=(0,h.useState)(null),[A,j]=(0,h.useState)(!w),[M,N]=(0,h.useState)(null),[P,F]=(0,h.useState)(`both`),{wordWrap:I,toggleWordWrap:L}=u(),R=o(),z=(0,h.useRef)(null),[B,V]=(0,h.useState)();(0,h.useEffect)(()=>{let e=z.current;if(!e)return;let t=new ResizeObserver(([e])=>{e&&V(Math.floor(e.contentRect.height))});return t.observe(e),()=>t.disconnect()},[A,M]),(0,h.useEffect)(()=>{if(w||!n)return;if(j(!0),N(null),b&&x){let e=new URLSearchParams({file1:b,file2:x});l.get(`${c(n)}/files/compare?${e}`).then(e=>{k(e),j(!1)}).catch(e=>{N(e instanceof Error?e.message:`Failed to compare files`),j(!1)});return}let e;if(t){let r=new URLSearchParams({file:t});s&&r.set(`ref`,s),e=`${c(n)}/git/file-diff?${r}`}else if(s||v){let t=new URLSearchParams;s&&t.set(`ref1`,s),v&&t.set(`ref2`,v),e=`${c(n)}/git/diff?${t}`}else e=`${c(n)}/git/diff`;l.get(e).then(e=>{D(e.diff),j(!1)}).catch(e=>{N(e instanceof Error?e.message:`Failed to load diff`),j(!1)})},[t,n,s,v,b,x,w]);let{original:H,modified:U}=(0,h.useMemo)(()=>w?{original:S??``,modified:C??``}:T&&O?O:E?y(E):{original:``,modified:``},[E,w,S,C,T,O]),W=(0,h.useMemo)(()=>{let e=t??x??b;return e?_(e):`plaintext`},[t,b,x]),G=typeof window<`u`&&window.innerWidth<768,K=!G&&P===`both`;return!n&&!w?(0,g.jsx)(`div`,{className:`flex items-center justify-center h-full text-muted-foreground text-sm`,children:`No project selected.`}):A?(0,g.jsxs)(`div`,{className:`flex items-center justify-center h-full gap-2 text-muted-foreground`,children:[(0,g.jsx)(p,{className:`size-5 animate-spin`}),(0,g.jsx)(`span`,{className:`text-sm`,children:`Loading diff...`})]}):M?(0,g.jsx)(`div`,{className:`flex items-center justify-center h-full text-destructive text-sm`,children:M}):!w&&!T&&!H&&!U?(0,g.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-2 text-muted-foreground`,children:[(0,g.jsx)(f,{className:`size-8`}),(0,g.jsx)(`p`,{className:`text-sm`,children:`No content changes`}),t&&(0,g.jsx)(`p`,{className:`text-xs font-mono`,children:t})]}):(0,g.jsxs)(`div`,{className:`flex flex-col h-full`,children:[!G&&(0,g.jsxs)(`div`,{className:`flex items-center justify-end gap-0.5 px-2 py-0.5 border-b border-border shrink-0`,children:[(0,g.jsx)(`button`,{type:`button`,onClick:()=>F(P===`left`?`both`:`left`),className:`p-1 rounded hover:bg-muted transition-colors ${P===`left`?`bg-muted text-foreground`:``}`,title:`Expand original`,children:(0,g.jsx)(d,{className:`size-3.5`})}),(0,g.jsx)(`button`,{type:`button`,onClick:()=>F(`both`),className:`p-1 rounded hover:bg-muted transition-colors ${P===`both`?`bg-muted text-foreground`:``}`,title:`Side by side`,children:(0,g.jsx)(r,{className:`size-3.5`})}),(0,g.jsx)(`button`,{type:`button`,onClick:()=>F(P===`right`?`both`:`right`),className:`p-1 rounded hover:bg-muted transition-colors ${P===`right`?`bg-muted text-foreground`:``}`,title:`Expand modified`,children:(0,g.jsx)(m,{className:`size-3.5`})}),(0,g.jsx)(`div`,{className:`w-px h-3.5 bg-border mx-0.5 shrink-0`}),(0,g.jsx)(`button`,{type:`button`,onClick:L,title:`Toggle word wrap`,className:`p-1 rounded hover:bg-muted transition-colors ${I?`bg-muted text-foreground`:``}`,children:(0,g.jsx)(i,{className:`size-3.5`})})]}),(0,g.jsx)(`div`,{ref:z,className:`flex-1 overflow-hidden`,children:B&&B>0?(0,g.jsx)(a,{height:B,language:W,original:H,modified:U,theme:R,options:{fontSize:G?11:13,fontFamily:`Menlo, Monaco, Consolas, monospace`,wordWrap:G||I?`on`:`off`,renderSideBySide:K,readOnly:!0,automaticLayout:!0,scrollBeyondLastLine:!1},loading:(0,g.jsx)(p,{className:`size-5 animate-spin text-muted-foreground`})}):(0,g.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,g.jsx)(p,{className:`size-5 animate-spin text-muted-foreground`})})})]})}function y(e){let t=e.split(`
2
2
  `),n=[],r=[],i=!1;for(let e of t)if(!(e.startsWith(`diff --git`)||e.startsWith(`diff --no-index`)||e.startsWith(`index `)||e.startsWith(`new file`)||e.startsWith(`deleted file`)||e.startsWith(`old mode`)||e.startsWith(`new mode`)||e.startsWith(`---`)||e.startsWith(`+++`)||e.startsWith(`Binary files`)||e.startsWith(`\\ No newline`))){if(e.startsWith(`@@`)){i=!0;continue}if(i)if(e.startsWith(`-`))n.push(e.slice(1));else if(e.startsWith(`+`))r.push(e.slice(1));else{let t=e.startsWith(` `)?e.slice(1):e;n.push(t),r.push(t)}}return{original:n.join(`
3
3
  `),modified:r.join(`
4
4
  `)}}export{v as DiffViewer};
@@ -0,0 +1,41 @@
1
+ import{o as e}from"./chunk-CFjPhJqf.js";import{t}from"./react-nm2Ru1Pt.js";import{t as n}from"./react-dom-Bpkvzu3U.js";import{t as r}from"./createLucideIcon-PuMiQgHl.js";import{t as i}from"./jsx-runtime-O3jQaKZd.js";var a=r(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),o=e(t(),1);function s(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function c(...e){return t=>{let n=!1,r=e.map(e=>{let r=s(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():s(e[t],null)}}}}function l(...e){return o.useCallback(c(...e),e)}var u=i();function d(e){let t=p(e),n=o.forwardRef((e,n)=>{let{children:r,...i}=e,a=o.Children.toArray(r),s=a.find(g);if(s){let e=s.props.children,r=a.map(t=>t===s?o.Children.count(e)>1?o.Children.only(null):o.isValidElement(e)?e.props.children:null:t);return(0,u.jsx)(t,{...i,ref:n,children:o.isValidElement(e)?o.cloneElement(e,void 0,r):null})}return(0,u.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var f=d(`Slot`);function p(e){let t=o.forwardRef((e,t)=>{let{children:n,...r}=e;if(o.isValidElement(n)){let e=v(n),i=_(r,n.props);return n.type!==o.Fragment&&(i.ref=t?c(t,e):e),o.cloneElement(n,i)}return o.Children.count(n)>1?o.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var m=Symbol(`radix.slottable`);function h(e){let t=({children:e})=>(0,u.jsx)(u.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=m,t}function g(e){return o.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===m}function _(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function v(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var y=e(n(),1),b=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=d(`Primitive.${t}`),r=o.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,u.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function x(e,t){e&&y.flushSync(()=>e.dispatchEvent(t))}function S(e,t){let n=o.createContext(t),r=e=>{let{children:t,...r}=e,i=o.useMemo(()=>r,Object.values(r));return(0,u.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=o.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function C(e,t=[]){let n=[];function r(t,r){let i=o.createContext(r),a=n.length;n=[...n,r];let s=t=>{let{scope:n,children:r,...s}=t,c=n?.[e]?.[a]||i,l=o.useMemo(()=>s,Object.values(s));return(0,u.jsx)(c.Provider,{value:l,children:r})};s.displayName=t+`Provider`;function c(n,s){let c=s?.[e]?.[a]||i,l=o.useContext(c);if(l)return l;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[s,c]}let i=()=>{let t=n.map(e=>o.createContext(e));return function(n){let r=n?.[e]||t;return o.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,w(i,...t)]}function w(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return o.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function T(e){let t=e+`CollectionProvider`,[n,r]=C(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=e=>{let{scope:t,children:n}=e,r=o.useRef(null),a=o.useRef(new Map).current;return(0,u.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};s.displayName=t;let c=e+`CollectionSlot`,f=d(c),p=o.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,u.jsx)(f,{ref:l(t,a(c,n).collectionRef),children:r})});p.displayName=c;let m=e+`CollectionItemSlot`,h=`data-radix-collection-item`,g=d(m),_=o.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,s=o.useRef(null),c=l(t,s),d=a(m,n);return o.useEffect(()=>(d.itemMap.set(s,{ref:s,...i}),()=>void d.itemMap.delete(s))),(0,u.jsx)(g,{[h]:``,ref:c,children:r})});_.displayName=m;function v(t){let n=a(e+`CollectionConsumer`,t);return o.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${h}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:s,Slot:p,ItemSlot:_},v,r]}typeof window<`u`&&window.document&&window.document.createElement;function E(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var D=globalThis?.document?o.useLayoutEffect:()=>{},O=o.useInsertionEffect||D;function k({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,s]=A({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:i;{let t=o.useRef(e!==void 0);o.useEffect(()=>{let e=t.current;if(e!==c){let t=e?`controlled`:`uncontrolled`,n=c?`controlled`:`uncontrolled`;console.warn(`${r} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=c},[c,r])}return[l,o.useCallback(t=>{if(c){let n=j(t)?t(e):t;n!==e&&s.current?.(n)}else a(t)},[c,e,a,s])]}function A({defaultProp:e,onChange:t}){let[n,r]=o.useState(e),i=o.useRef(n),a=o.useRef(t);return O(()=>{a.current=t},[t]),o.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function j(e){return typeof e==`function`}function M(e,t){return o.useReducer((e,n)=>t[e][n]??e,e)}var N=e=>{let{present:t,children:n}=e,r=P(t),i=typeof n==`function`?n({present:r.isPresent}):o.Children.only(n),a=l(r.ref,ee(i));return typeof n==`function`||r.isPresent?o.cloneElement(i,{ref:a}):null};N.displayName=`Presence`;function P(e){let[t,n]=o.useState(),r=o.useRef(null),i=o.useRef(e),a=o.useRef(`none`),[s,c]=M(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return o.useEffect(()=>{let e=F(r.current);a.current=s===`mounted`?e:`none`},[s]),D(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=F(t);e?c(`MOUNT`):o===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),D(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=F(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=F(r.current))};return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:o.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function F(e){return e?.animationName||`none`}function ee(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var te=o.useId||(()=>void 0),ne=0;function I(e){let[t,n]=o.useState(te());return D(()=>{e||n(e=>e??String(ne++))},[e]),e||(t?`radix-${t}`:``)}var re=o.createContext(void 0);function ie(e){let t=o.useContext(re);return e||t||`ltr`}function L(e){let t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>(...e)=>t.current?.(...e),[])}function ae(e,t=globalThis?.document){let n=L(e);o.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var oe=`DismissableLayer`,se=`dismissableLayer.update`,ce=`dismissableLayer.pointerDownOutside`,le=`dismissableLayer.focusOutside`,ue,de=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),fe=o.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:c,...d}=e,f=o.useContext(de),[p,m]=o.useState(null),h=p?.ownerDocument??globalThis?.document,[,g]=o.useState({}),_=l(t,e=>m(e)),v=Array.from(f.layers),[y]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),x=v.indexOf(y),S=p?v.indexOf(p):-1,C=f.layersWithOutsidePointerEventsDisabled.size>0,w=S>=x,T=he(e=>{let t=e.target,n=[...f.branches].some(e=>e.contains(t));!w||n||(i?.(e),s?.(e),e.defaultPrevented||c?.())},h),D=ge(e=>{let t=e.target;[...f.branches].some(e=>e.contains(t))||(a?.(e),s?.(e),e.defaultPrevented||c?.())},h);return ae(e=>{S===f.layers.size-1&&(r?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},h),o.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(ue=h.body.style.pointerEvents,h.body.style.pointerEvents=`none`),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),_e(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=ue)}},[p,h,n,f]),o.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),_e())},[p,f]),o.useEffect(()=>{let e=()=>g({});return document.addEventListener(se,e),()=>document.removeEventListener(se,e)},[]),(0,u.jsx)(b.div,{...d,ref:_,style:{pointerEvents:C?w?`auto`:`none`:void 0,...e.style},onFocusCapture:E(e.onFocusCapture,D.onFocusCapture),onBlurCapture:E(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:E(e.onPointerDownCapture,T.onPointerDownCapture)})});fe.displayName=oe;var pe=`DismissableLayerBranch`,me=o.forwardRef((e,t)=>{let n=o.useContext(de),r=o.useRef(null),i=l(t,r);return o.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,u.jsx)(b.div,{...e,ref:i})});me.displayName=pe;function he(e,t=globalThis?.document){let n=L(e),r=o.useRef(!1),i=o.useRef(()=>{});return o.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){ve(ce,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function ge(e,t=globalThis?.document){let n=L(e),r=o.useRef(!1);return o.useEffect(()=>{let e=e=>{e.target&&!r.current&&ve(le,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function _e(){let e=new CustomEvent(se);document.dispatchEvent(e)}function ve(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?x(i,a):i.dispatchEvent(a)}var ye=`focusScope.autoFocusOnMount`,be=`focusScope.autoFocusOnUnmount`,xe={bubbles:!1,cancelable:!0},Se=`FocusScope`,Ce=o.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...s}=e,[c,d]=o.useState(null),f=L(i),p=L(a),m=o.useRef(null),h=l(t,e=>d(e)),g=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(r){let e=function(e){if(g.paused||!c)return;let t=e.target;c.contains(t)?m.current=t:R(m.current,{select:!0})},t=function(e){if(g.paused||!c)return;let t=e.relatedTarget;t!==null&&(c.contains(t)||R(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&R(c)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,g.paused]),o.useEffect(()=>{if(c){Ae.add(g);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(ye,xe);c.addEventListener(ye,f),c.dispatchEvent(t),t.defaultPrevented||(we(Ne(Ee(c)),{select:!0}),document.activeElement===e&&R(c))}return()=>{c.removeEventListener(ye,f),setTimeout(()=>{let t=new CustomEvent(be,xe);c.addEventListener(be,p),c.dispatchEvent(t),t.defaultPrevented||R(e??document.body,{select:!0}),c.removeEventListener(be,p),Ae.remove(g)},0)}}},[c,f,p,g]);let _=o.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Te(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&R(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&R(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,u.jsx)(b.div,{tabIndex:-1,...s,ref:h,onKeyDown:_})});Ce.displayName=Se;function we(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(R(r,{select:t}),document.activeElement!==n)return}function Te(e){let t=Ee(e);return[De(t,e),De(t.reverse(),e)]}function Ee(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function De(e,t){for(let n of e)if(!Oe(n,{upTo:t}))return n}function Oe(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function ke(e){return e instanceof HTMLInputElement&&`select`in e}function R(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ke(e)&&t&&e.select()}}var Ae=je();function je(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Me(e,t),e.unshift(t)},remove(t){e=Me(e,t),e[0]?.resume()}}}function Me(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ne(e){return e.filter(e=>e.tagName!==`A`)}var Pe=`Portal`,Fe=o.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=o.useState(!1);D(()=>a(!0),[]);let s=n||i&&globalThis?.document?.body;return s?y.createPortal((0,u.jsx)(b.div,{...r,ref:t}),s):null});Fe.displayName=Pe;var Ie=0;function Le(){o.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Re()),document.body.insertAdjacentElement(`beforeend`,e[1]??Re()),Ie++,()=>{Ie===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),Ie--}},[])}function Re(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var z=function(){return z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},z.apply(this,arguments)};function ze(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Be(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Ve=`right-scroll-bar-position`,He=`width-before-scroll-bar`,Ue=`with-scroll-bars-hidden`,We=`--removed-body-scroll-bar-size`;function Ge(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ke(e,t){var n=(0,o.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var qe=typeof window<`u`?o.useLayoutEffect:o.useEffect,Je=new WeakMap;function Ye(e,t){var n=Ke(t||null,function(t){return e.forEach(function(e){return Ge(e,t)})});return qe(function(){var t=Je.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Ge(e,null)}),i.forEach(function(e){r.has(e)||Ge(e,a)})}Je.set(n,e)},[e]),n}function Xe(e){return e}function Ze(e,t){t===void 0&&(t=Xe);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Qe(e){e===void 0&&(e={});var t=Ze(null);return t.options=z({async:!0,ssr:!1},e),t}var $e=function(e){var t=e.sideCar,n=ze(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return o.createElement(r,z({},n))};$e.isSideCarExport=!0;function et(e,t){return e.useMedium(t),$e}var tt=Qe(),nt=function(){},rt=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:nt,onWheelCapture:nt,onTouchMoveCapture:nt}),i=r[0],a=r[1],s=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=ze(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Ye([n,t]),w=z(z({},x),i);return o.createElement(o.Fragment,null,d&&o.createElement(S,{sideCar:tt,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),s?o.cloneElement(o.Children.only(c),z(z({},w),{ref:C})):o.createElement(y,z({},w,{className:l,ref:C}),c))});rt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},rt.classNames={fullWidth:He,zeroRight:Ve};var it,at=function(){if(it)return it;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function ot(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=at();return t&&e.setAttribute(`nonce`,t),e}function st(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ct(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var lt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ot())&&(st(t,n),ct(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ut=function(){var e=lt();return function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},dt=function(){var e=ut();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},ft={left:0,top:0,right:0,gap:0},pt=function(e){return parseInt(e||``,10)||0},mt=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[pt(n),pt(r),pt(i)]},ht=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return ft;var t=mt(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},gt=dt(),_t=`data-scroll-locked`,vt=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
+ .${Ue} {
3
+ overflow: hidden ${r};
4
+ padding-right: ${s}px ${r};
5
+ }
6
+ body[${_t}] {
7
+ overflow: hidden ${r};
8
+ overscroll-behavior: contain;
9
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
10
+ padding-left: ${i}px;
11
+ padding-top: ${a}px;
12
+ padding-right: ${o}px;
13
+ margin-left:0;
14
+ margin-top:0;
15
+ margin-right: ${s}px ${r};
16
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
17
+ }
18
+
19
+ .${Ve} {
20
+ right: ${s}px ${r};
21
+ }
22
+
23
+ .${He} {
24
+ margin-right: ${s}px ${r};
25
+ }
26
+
27
+ .${Ve} .${Ve} {
28
+ right: 0 ${r};
29
+ }
30
+
31
+ .${He} .${He} {
32
+ margin-right: 0 ${r};
33
+ }
34
+
35
+ body[${_t}] {
36
+ ${We}: ${s}px;
37
+ }
38
+ `},yt=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},bt=function(){o.useEffect(function(){return document.body.setAttribute(_t,(yt()+1).toString()),function(){var e=yt()-1;e<=0?document.body.removeAttribute(_t):document.body.setAttribute(_t,e.toString())}},[])},xt=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;bt();var a=o.useMemo(function(){return ht(i)},[i]);return o.createElement(gt,{styles:vt(a,!t,i,n?``:`!important`)})},St=!1;if(typeof window<`u`)try{var Ct=Object.defineProperty({},`passive`,{get:function(){return St=!0,!0}});window.addEventListener(`test`,Ct,Ct),window.removeEventListener(`test`,Ct,Ct)}catch{St=!1}var wt=St?{passive:!1}:!1,Tt=function(e){return e.tagName===`TEXTAREA`},Et=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Tt(e)&&n[t]===`visible`)},Dt=function(e){return Et(e,`overflowY`)},Ot=function(e){return Et(e,`overflowX`)},kt=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Mt(e,r)){var i=Nt(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},At=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},jt=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Mt=function(e,t){return e===`v`?Dt(t):Ot(t)},Nt=function(e,t){return e===`v`?At(t):jt(t)},Pt=function(e,t){return e===`h`&&t===`rtl`?-1:1},Ft=function(e,t,n,r,i){var a=Pt(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Nt(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Mt(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},It=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Lt=function(e){return[e.deltaX,e.deltaY]},Rt=function(e){return e&&`current`in e?e.current:e},zt=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Bt=function(e){return`
39
+ .block-interactivity-${e} {pointer-events: none;}
40
+ .allow-interactivity-${e} {pointer-events: all;}
41
+ `},Vt=0,Ht=[];function Ut(e){var t=o.useRef([]),n=o.useRef([0,0]),r=o.useRef(),i=o.useState(Vt++)[0],a=o.useState(dt)[0],s=o.useRef(e);o.useEffect(function(){s.current=e},[e]),o.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Be([e.lockRef.current],(e.shards||[]).map(Rt),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var c=o.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!s.current.allowPinchZoom;var i=It(e),a=n.current,o=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(o)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=kt(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=kt(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(o||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Ft(h,t,e,h===`h`?o:c,!0)},[]),l=o.useCallback(function(e){var n=e;if(!(!Ht.length||Ht[Ht.length-1]!==a)){var r=`deltaY`in n?Lt(n):It(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&zt(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var o=(s.current.shards||[]).map(Rt).filter(Boolean).filter(function(e){return e.contains(n.target)});(o.length>0?c(n,o[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=o.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Wt(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=o.useCallback(function(e){n.current=It(e),r.current=void 0},[]),f=o.useCallback(function(t){u(t.type,Lt(t),t.target,c(t,e.lockRef.current))},[]),p=o.useCallback(function(t){u(t.type,It(t),t.target,c(t,e.lockRef.current))},[]);o.useEffect(function(){return Ht.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,l,wt),document.addEventListener(`touchmove`,l,wt),document.addEventListener(`touchstart`,d,wt),function(){Ht=Ht.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,l,wt),document.removeEventListener(`touchmove`,l,wt),document.removeEventListener(`touchstart`,d,wt)}},[]);var m=e.removeScrollBar,h=e.inert;return o.createElement(o.Fragment,null,h?o.createElement(a,{styles:Bt(i)}):null,m?o.createElement(xt,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Wt(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Gt=et(tt,Ut),Kt=o.forwardRef(function(e,t){return o.createElement(rt,z({},e,{ref:t,sideCar:Gt}))});Kt.classNames=rt.classNames;var qt=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Jt=new WeakMap,Yt=new WeakMap,Xt={},Zt=0,Qt=function(e){return e&&(e.host||Qt(e.parentNode))},$t=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Qt(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},en=function(e,t,n,r){var i=$t(t,Array.isArray(e)?e:[e]);Xt[n]||(Xt[n]=new WeakMap);var a=Xt[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Jt.get(e)||0)+1,l=(a.get(e)||0)+1;Jt.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Yt.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Zt++,function(){o.forEach(function(e){var t=Jt.get(e)-1,i=a.get(e)-1;Jt.set(e,t),a.set(e,i),t||(Yt.has(e)||e.removeAttribute(r),Yt.delete(e)),i||e.removeAttribute(n)}),Zt--,Zt||(Jt=new WeakMap,Jt=new WeakMap,Yt=new WeakMap,Xt={})}},tn=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||qt(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),en(r,i,n,`aria-hidden`)):function(){return null}};function nn(e){let[t,n]=o.useState(void 0);return D(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var rn=[`top`,`right`,`bottom`,`left`],B=Math.min,V=Math.max,an=Math.round,on=Math.floor,H=e=>({x:e,y:e}),sn={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function cn(e,t,n){return V(e,B(t,n))}function U(e,t){return typeof e==`function`?e(t):e}function W(e){return e.split(`-`)[0]}function ln(e){return e.split(`-`)[1]}function un(e){return e===`x`?`y`:`x`}function dn(e){return e===`y`?`height`:`width`}function G(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function fn(e){return un(G(e))}function pn(e,t,n){n===void 0&&(n=!1);let r=ln(e),i=fn(e),a=dn(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Sn(o)),[o,Sn(o)]}function mn(e){let t=Sn(e);return[hn(e),t,hn(t)]}function hn(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var gn=[`left`,`right`],_n=[`right`,`left`],vn=[`top`,`bottom`],yn=[`bottom`,`top`];function bn(e,t,n){switch(e){case`top`:case`bottom`:return n?t?_n:gn:t?gn:_n;case`left`:case`right`:return t?vn:yn;default:return[]}}function xn(e,t,n,r){let i=ln(e),a=bn(W(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(hn)))),a}function Sn(e){let t=W(e);return sn[t]+e.slice(t.length)}function Cn(e){return{top:0,right:0,bottom:0,left:0,...e}}function wn(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Cn(e)}function Tn(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function En(e,t,n){let{reference:r,floating:i}=e,a=G(t),o=fn(t),s=dn(o),c=W(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(ln(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Dn(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=U(t,e),p=wn(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Tn(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Tn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var On=50,kn=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Dn},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=En(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<On&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=En(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},An=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=U(e,t)||{};if(l==null)return{};let d=wn(u),f={x:n,y:r},p=fn(i),m=dn(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=B(d[_],T),D=B(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=cn(O,A,k),M=!c.arrow&&ln(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),jn=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=U(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=W(r),_=G(o),v=W(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Sn(o)]:mn(o)),x=p!==`none`;!d&&x&&b.push(...xn(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=pn(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==G(t))||T.every(e=>G(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=G(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Mn(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Nn(e){return rn.some(t=>e[t]>=0)}var Pn=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=U(e,t);switch(i){case`referenceHidden`:{let e=Mn(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Nn(e)}}}case`escaped`:{let e=Mn(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Nn(e)}}}default:return{}}}}},Fn=new Set([`left`,`top`]);async function In(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=W(n),s=ln(n),c=G(n)===`y`,l=Fn.has(o)?-1:1,u=a&&c?-1:1,d=U(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Ln=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await In(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Rn=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=U(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=G(W(i)),p=un(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=cn(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=cn(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},zn=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=U(e,t),u={x:n,y:r},d=G(i),f=un(d),p=u[f],m=u[d],h=U(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Fn.has(W(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Bn=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=U(e,t),u=await o.detectOverflow(t,l),d=W(i),f=ln(i),p=G(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=B(h-u[g],v),x=B(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=V(u.left,0),t=V(u.right,0),n=V(u.top,0),r=V(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:V(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:V(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Vn(){return typeof window<`u`}function Hn(e){return Un(e)?(e.nodeName||``).toLowerCase():`#document`}function K(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function q(e){return((Un(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Un(e){return Vn()?e instanceof Node||e instanceof K(e).Node:!1}function J(e){return Vn()?e instanceof Element||e instanceof K(e).Element:!1}function Y(e){return Vn()?e instanceof HTMLElement||e instanceof K(e).HTMLElement:!1}function Wn(e){return!Vn()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof K(e).ShadowRoot}function Gn(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Z(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Kn(e){return/^(table|td|th)$/.test(Hn(e))}function qn(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Jn=/transform|translate|scale|rotate|perspective|filter/,Yn=/paint|layout|strict|content/,X=e=>!!e&&e!==`none`,Xn;function Zn(e){let t=J(e)?Z(e):e;return X(t.transform)||X(t.translate)||X(t.scale)||X(t.rotate)||X(t.perspective)||!$n()&&(X(t.backdropFilter)||X(t.filter))||Jn.test(t.willChange||``)||Yn.test(t.contain||``)}function Qn(e){let t=Q(e);for(;Y(t)&&!er(t);){if(Zn(t))return t;if(qn(t))return null;t=Q(t)}return null}function $n(){return Xn??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Xn}function er(e){return/^(html|body|#document)$/.test(Hn(e))}function Z(e){return K(e).getComputedStyle(e)}function tr(e){return J(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Q(e){if(Hn(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Wn(e)&&e.host||q(e);return Wn(t)?t.host:t}function nr(e){let t=Q(e);return er(t)?e.ownerDocument?e.ownerDocument.body:e.body:Y(t)&&Gn(t)?t:nr(t)}function rr(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=nr(e),i=r===e.ownerDocument?.body,a=K(r);if(i){let e=ir(a);return t.concat(a,a.visualViewport||[],Gn(r)?r:[],e&&n?rr(e):[])}else return t.concat(r,rr(r,[],n))}function ir(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ar(e){let t=Z(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Y(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=an(n)!==a||an(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function or(e){return J(e)?e:e.contextElement}function sr(e){let t=or(e);if(!Y(t))return H(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ar(t),o=(a?an(n.width):n.width)/r,s=(a?an(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var cr=H(0);function lr(e){let t=K(e);return!$n()||!t.visualViewport?cr:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ur(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==K(e)?!1:t}function $(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=or(e),o=H(1);t&&(r?J(r)&&(o=sr(r)):o=sr(e));let s=ur(a,n,r)?lr(a):H(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=K(a),t=r&&J(r)?K(r):r,n=e,i=ir(n);for(;i&&r&&t!==n;){let e=sr(i),t=i.getBoundingClientRect(),r=Z(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=K(i),i=ir(n)}}return Tn({width:u,height:d,x:c,y:l})}function dr(e,t){let n=tr(e).scrollLeft;return t?t.left+n:$(q(e)).left+n}function fr(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-dr(e,n),y:n.top+t.scrollTop}}function pr(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=q(r),s=t?qn(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=H(1),u=H(0),d=Y(r);if((d||!d&&!a)&&((Hn(r)!==`body`||Gn(o))&&(c=tr(r)),d)){let e=$(r);l=sr(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?fr(o,c):H(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function mr(e){return Array.from(e.getClientRects())}function hr(e){let t=q(e),n=tr(e),r=e.ownerDocument.body,i=V(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=V(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+dr(e),s=-n.scrollTop;return Z(r).direction===`rtl`&&(o+=V(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var gr=25;function _r(e,t){let n=K(e),r=q(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=$n();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=dr(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=gr&&(a-=o)}else l<=gr&&(a+=l);return{width:a,height:o,x:s,y:c}}function vr(e,t){let n=$(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Y(e)?sr(e):H(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function yr(e,t,n){let r;if(t===`viewport`)r=_r(e,n);else if(t===`document`)r=hr(q(e));else if(J(t))r=vr(t,n);else{let n=lr(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Tn(r)}function br(e,t){let n=Q(e);return n===t||!J(n)||er(n)?!1:Z(n).position===`fixed`||br(n,t)}function xr(e,t){let n=t.get(e);if(n)return n;let r=rr(e,[],!1).filter(e=>J(e)&&Hn(e)!==`body`),i=null,a=Z(e).position===`fixed`,o=a?Q(e):e;for(;J(o)&&!er(o);){let t=Z(o),n=Zn(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Gn(o)&&!n&&br(e,o))?r=r.filter(e=>e!==o):i=t,o=Q(o)}return t.set(e,r),r}function Sr(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?qn(t)?[]:xr(t,this._c):[].concat(n),r],o=yr(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=yr(t,a[e],i);s=V(n.top,s),c=B(n.right,c),l=B(n.bottom,l),u=V(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Cr(e){let{width:t,height:n}=ar(e);return{width:t,height:n}}function wr(e,t,n){let r=Y(t),i=q(t),a=n===`fixed`,o=$(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=H(0);function l(){c.x=dr(i)}if(r||!r&&!a)if((Hn(t)!==`body`||Gn(i))&&(s=tr(t)),r){let e=$(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?fr(i,s):H(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Tr(e){return Z(e).position===`static`}function Er(e,t){if(!Y(e)||Z(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return q(e)===n&&(n=n.ownerDocument.body),n}function Dr(e,t){let n=K(e);if(qn(e))return n;if(!Y(e)){let t=Q(e);for(;t&&!er(t);){if(J(t)&&!Tr(t))return t;t=Q(t)}return n}let r=Er(e,t);for(;r&&Kn(r)&&Tr(r);)r=Er(r,t);return r&&er(r)&&Tr(r)&&!Zn(r)?n:r||Qn(e)||n}var Or=async function(e){let t=this.getOffsetParent||Dr,n=this.getDimensions,r=await n(e.floating);return{reference:wr(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function kr(e){return Z(e).direction===`rtl`}var Ar={convertOffsetParentRelativeRectToViewportRelativeRect:pr,getDocumentElement:q,getClippingRect:Sr,getOffsetParent:Dr,getElementRects:Or,getClientRects:mr,getDimensions:Cr,getScale:sr,isElement:J,isRTL:kr};function jr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Mr(e,t){let n=null,r,i=q(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=on(d),h=on(i.clientWidth-(u+f)),g=on(i.clientHeight-(d+p)),_=on(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:V(0,B(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!jr(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Nr(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=or(e),u=i||a?[...l?rr(l):[],...t?rr(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Mr(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?$(e):null;c&&g();function g(){let t=$(e);h&&!jr(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Pr=Ln,Fr=Rn,Ir=jn,Lr=Bn,Rr=Pn,zr=An,Br=zn,Vr=(e,t,n)=>{let r=new Map,i={platform:Ar,...n},a={...i.platform,_c:r};return kn(e,t,{...i,platform:a})},Hr=typeof document<`u`?o.useLayoutEffect:function(){};function Ur(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ur(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Ur(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Wr(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Gr(e,t){let n=Wr(e);return Math.round(t*n)/n}function Kr(e){let t=o.useRef(e);return Hr(()=>{t.current=e}),t}function qr(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:s}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[d,f]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=o.useState(r);Ur(p,r)||m(r);let[h,g]=o.useState(null),[_,v]=o.useState(null),b=o.useCallback(e=>{e!==w.current&&(w.current=e,g(e))},[]),x=o.useCallback(e=>{e!==T.current&&(T.current=e,v(e))},[]),S=a||h,C=s||_,w=o.useRef(null),T=o.useRef(null),E=o.useRef(d),D=l!=null,O=Kr(l),k=Kr(i),A=Kr(u),j=o.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:p};k.current&&(e.platform=k.current),Vr(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Ur(E.current,t)&&(E.current=t,y.flushSync(()=>{f(t)}))})},[p,t,n,k,A]);Hr(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let M=o.useRef(!1);Hr(()=>(M.current=!0,()=>{M.current=!1}),[]),Hr(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=o.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),P=o.useMemo(()=>({reference:S,floating:C}),[S,C]),F=o.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Gr(P.floating,d.x),r=Gr(P.floating,d.y);return c?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Wr(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,c,P.floating,d.x,d.y]);return o.useMemo(()=>({...d,update:j,refs:N,elements:P,floatingStyles:F}),[d,j,N,P,F])}var Jr=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:zr({element:r.current,padding:i}).fn(n):r?zr({element:r,padding:i}).fn(n):{}}}},Yr=(e,t)=>{let n=Pr(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xr=(e,t)=>{let n=Fr(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zr=(e,t)=>({fn:Br(e).fn,options:[e,t]}),Qr=(e,t)=>{let n=Ir(e);return{name:n.name,fn:n.fn,options:[e,t]}},$r=(e,t)=>{let n=Lr(e);return{name:n.name,fn:n.fn,options:[e,t]}},ei=(e,t)=>{let n=Rr(e);return{name:n.name,fn:n.fn,options:[e,t]}},ti=(e,t)=>{let n=Jr(e);return{name:n.name,fn:n.fn,options:[e,t]}},ni=`Arrow`,ri=o.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,u.jsx)(b.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,u.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});ri.displayName=ni;var ii=ri,ai=`Popper`,[oi,si]=C(ai),[ci,li]=oi(ai),ui=e=>{let{__scopePopper:t,children:n}=e,[r,i]=o.useState(null);return(0,u.jsx)(ci,{scope:t,anchor:r,onAnchorChange:i,children:n})};ui.displayName=ai;var di=`PopperAnchor`,fi=o.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=li(di,n),s=o.useRef(null),c=l(t,s),d=o.useRef(null);return o.useEffect(()=>{let e=d.current;d.current=r?.current||s.current,e!==d.current&&a.onAnchorChange(d.current)}),r?null:(0,u.jsx)(b.div,{...i,ref:c})});fi.displayName=di;var pi=`PopperContent`,[mi,hi]=oi(pi),gi=o.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:s=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:m=`partial`,hideWhenDetached:h=!1,updatePositionStrategy:g=`optimized`,onPlaced:_,...v}=e,y=li(pi,n),[x,S]=o.useState(null),C=l(t,e=>S(e)),[w,T]=o.useState(null),E=nn(w),O=E?.width??0,k=E?.height??0,A=r+(a===`center`?``:`-`+a),j=typeof p==`number`?p:{top:0,right:0,bottom:0,left:0,...p},M=Array.isArray(f)?f:[f],N=M.length>0,P={padding:j,boundary:M.filter(bi),altBoundary:N},{refs:F,floatingStyles:ee,placement:te,isPositioned:ne,middlewareData:I}=qr({strategy:`fixed`,placement:A,whileElementsMounted:(...e)=>Nr(...e,{animationFrame:g===`always`}),elements:{reference:y.anchor},middleware:[Yr({mainAxis:i+k,alignmentAxis:s}),d&&Xr({mainAxis:!0,crossAxis:!1,limiter:m===`partial`?Zr():void 0,...P}),d&&Qr({...P}),$r({...P,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),w&&ti({element:w,padding:c}),xi({arrowWidth:O,arrowHeight:k}),h&&ei({strategy:`referenceHidden`,...P})]}),[re,ie]=Si(te),ae=L(_);D(()=>{ne&&ae?.()},[ne,ae]);let oe=I.arrow?.x,se=I.arrow?.y,ce=I.arrow?.centerOffset!==0,[le,ue]=o.useState();return D(()=>{x&&ue(window.getComputedStyle(x).zIndex)},[x]),(0,u.jsx)(`div`,{ref:F.setFloating,"data-radix-popper-content-wrapper":``,style:{...ee,transform:ne?ee.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:le,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(` `),...I.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,u.jsx)(mi,{scope:n,placedSide:re,onArrowChange:T,arrowX:oe,arrowY:se,shouldHideArrow:ce,children:(0,u.jsx)(b.div,{"data-side":re,"data-align":ie,...v,ref:C,style:{...v.style,animation:ne?void 0:`none`}})})})});gi.displayName=pi;var _i=`PopperArrow`,vi={top:`bottom`,right:`left`,bottom:`top`,left:`right`},yi=o.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=hi(_i,n),a=vi[i.placedSide];return(0,u.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,u.jsx)(ii,{...r,ref:t,style:{...r.style,display:`block`}})})});yi.displayName=_i;function bi(e){return e!==null}var xi=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Si(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Si(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Ci=ui,wi=fi,Ti=gi,Ei=yi;export{a as A,b as C,h as D,d as E,c as O,C as S,f as T,k as _,si as a,T as b,Kt as c,Ce as d,fe as f,N as g,I as h,Ci as i,l as k,Le as l,ie as m,Ei as n,nn as o,L as p,Ti as r,tn as s,wi as t,Fe as u,D as v,x as w,S as x,E as y};