@logicflow/layout 1.2.0-alpha.16 → 2.0.1

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.
package/LICENSE ADDED
@@ -0,0 +1,206 @@
1
+ Apache License
2
+
3
+ Version 2.0, January 2004
4
+
5
+ http://www.apache.org/licenses/
6
+
7
+
8
+
9
+
10
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
11
+
12
+ 1. Definitions.
13
+
14
+ "License" shall mean the terms and conditions for use, reproduction,
15
+ and distribution as defined by Sections 1 through 9 of this document.
16
+
17
+ "Licensor" shall mean the copyright owner or entity authorized by
18
+ the copyright owner that is granting the License.
19
+
20
+ "Legal Entity" shall mean the union of the acting entity and all
21
+ other entities that control, are controlled by, or are under common
22
+ control with that entity. For the purposes of this definition,
23
+ "control" means (i) the power, direct or indirect, to cause the
24
+ direction or management of such entity, whether by contract or
25
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
26
+ outstanding shares, or (iii) beneficial ownership of such entity.
27
+
28
+ "You" (or "Your") shall mean an individual or Legal Entity
29
+ exercising permissions granted by this License.
30
+
31
+ "Source" form shall mean the preferred form for making modifications,
32
+ including but not limited to software source code, documentation
33
+ source, and configuration files.
34
+
35
+ "Object" form shall mean any form resulting from mechanical
36
+ transformation or translation of a Source form, including but
37
+ not limited to compiled object code, generated documentation,
38
+ and conversions to other media types.
39
+
40
+ "Work" shall mean the work of authorship, whether in Source or
41
+ Object form, made available under the License, as indicated by a
42
+ copyright notice that is included in or attached to the work
43
+ (an example is provided in the Appendix below).
44
+
45
+ "Derivative Works" shall mean any work, whether in Source or Object
46
+ form, that is based on (or derived from) the Work and for which the
47
+ editorial revisions, annotations, elaborations, or other modifications
48
+ represent, as a whole, an original work of authorship. For the purposes
49
+ of this License, Derivative Works shall not include works that remain
50
+ separable from, or merely link (or bind by name) to the interfaces of,
51
+ the Work and Derivative Works thereof.
52
+
53
+ "Contribution" shall mean any work of authorship, including
54
+ the original version of the Work and any modifications or additions
55
+ to that Work or Derivative Works thereof, that is intentionally
56
+ submitted to Licensor for inclusion in the Work by the copyright owner
57
+ or by an individual or Legal Entity authorized to submit on behalf of
58
+ the copyright owner. For the purposes of this definition, "submitted"
59
+ means any form of electronic, verbal, or written communication sent
60
+ to the Licensor or its representatives, including but not limited to
61
+ communication on electronic mailing lists, source code control systems,
62
+ and issue tracking systems that are managed by, or on behalf of, the
63
+ Licensor for the purpose of discussing and improving the Work, but
64
+ excluding communication that is conspicuously marked or otherwise
65
+ designated in writing by the copyright owner as "Not a Contribution."
66
+
67
+ "Contributor" shall mean Licensor and any individual or Legal Entity
68
+ on behalf of whom a Contribution has been received by Licensor and
69
+ subsequently incorporated within the Work.
70
+
71
+ 2. Grant of Copyright License. Subject to the terms and conditions of
72
+ this License, each Contributor hereby grants to You a perpetual,
73
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
74
+ copyright license to reproduce, prepare Derivative Works of,
75
+ publicly display, publicly perform, sublicense, and distribute the
76
+ Work and such Derivative Works in Source or Object form.
77
+
78
+ 3. Grant of Patent License. Subject to the terms and conditions of
79
+ this License, each Contributor hereby grants to You a perpetual,
80
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
81
+ (except as stated in this section) patent license to make, have made,
82
+ use, offer to sell, sell, import, and otherwise transfer the Work,
83
+ where such license applies only to those patent claims licensable
84
+ by such Contributor that are necessarily infringed by their
85
+ Contribution(s) alone or by combination of their Contribution(s)
86
+ with the Work to which such Contribution(s) was submitted. If You
87
+ institute patent litigation against any entity (including a
88
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
89
+ or a Contribution incorporated within the Work constitutes direct
90
+ or contributory patent infringement, then any patent licenses
91
+ granted to You under this License for that Work shall terminate
92
+ as of the date such litigation is filed.
93
+
94
+ 4. Redistribution. You may reproduce and distribute copies of the
95
+ Work or Derivative Works thereof in any medium, with or without
96
+ modifications, and in Source or Object form, provided that You
97
+ meet the following conditions:
98
+
99
+ (a) You must give any other recipients of the Work or
100
+ Derivative Works a copy of this License; and
101
+
102
+ (b) You must cause any modified files to carry prominent notices
103
+ stating that You changed the files; and
104
+
105
+ (c) You must retain, in the Source form of any Derivative Works
106
+ that You distribute, all copyright, patent, trademark, and
107
+ attribution notices from the Source form of the Work,
108
+ excluding those notices that do not pertain to any part of
109
+ the Derivative Works; and
110
+
111
+ (d) If the Work includes a "NOTICE" text file as part of its
112
+ distribution, then any Derivative Works that You distribute must
113
+ include a readable copy of the attribution notices contained
114
+ within such NOTICE file, excluding those notices that do not
115
+ pertain to any part of the Derivative Works, in at least one
116
+ of the following places: within a NOTICE text file distributed
117
+ as part of the Derivative Works; within the Source form or
118
+ documentation, if provided along with the Derivative Works; or,
119
+ within a display generated by the Derivative Works, if and
120
+ wherever such third-party notices normally appear. The contents
121
+ of the NOTICE file are for informational purposes only and
122
+ do not modify the License. You may add Your own attribution
123
+ notices within Derivative Works that You distribute, alongside
124
+ or as an addendum to the NOTICE text from the Work, provided
125
+ that such additional attribution notices cannot be construed
126
+ as modifying the License.
127
+
128
+ You may add Your own copyright statement to Your modifications and
129
+ may provide additional or different license terms and conditions
130
+ for use, reproduction, or distribution of Your modifications, or
131
+ for any such Derivative Works as a whole, provided Your use,
132
+ reproduction, and distribution of the Work otherwise complies with
133
+ the conditions stated in this License.
134
+
135
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
136
+ any Contribution intentionally submitted for inclusion in the Work
137
+ by You to the Licensor shall be under the terms and conditions of
138
+ this License, without any additional terms or conditions.
139
+ Notwithstanding the above, nothing herein shall supersede or modify
140
+ the terms of any separate license agreement you may have executed
141
+ with Licensor regarding such Contributions.
142
+
143
+ 6. Trademarks. This License does not grant permission to use the trade
144
+ names, trademarks, service marks, or product names of the Licensor,
145
+ except as required for reasonable and customary use in describing the
146
+ origin of the Work and reproducing the content of the NOTICE file.
147
+
148
+ 7. Disclaimer of Warranty. Unless required by applicable law or
149
+ agreed to in writing, Licensor provides the Work (and each
150
+ Contributor provides its Contributions) on an "AS IS" BASIS,
151
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
152
+ implied, including, without limitation, any warranties or conditions
153
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
154
+ PARTICULAR PURPOSE. You are solely responsible for determining the
155
+ appropriateness of using or redistributing the Work and assume any
156
+ risks associated with Your exercise of permissions under this License.
157
+
158
+ 8. Limitation of Liability. In no event and under no legal theory,
159
+ whether in tort (including negligence), contract, or otherwise,
160
+ unless required by applicable law (such as deliberate and grossly
161
+ negligent acts) or agreed to in writing, shall any Contributor be
162
+ liable to You for damages, including any direct, indirect, special,
163
+ incidental, or consequential damages of any character arising as a
164
+ result of this License or out of the use or inability to use the
165
+ Work (including but not limited to damages for loss of goodwill,
166
+ work stoppage, computer failure or malfunction, or any and all
167
+ other commercial damages or losses), even if such Contributor
168
+ has been advised of the possibility of such damages.
169
+
170
+ 9. Accepting Warranty or Additional Liability. While redistributing
171
+ the Work or Derivative Works thereof, You may choose to offer,
172
+ and charge a fee for, acceptance of support, warranty, indemnity,
173
+ or other liability obligations and/or rights consistent with this
174
+ License. However, in accepting such obligations, You may act only
175
+ on Your own behalf and on Your sole responsibility, not on behalf
176
+ of any other Contributor, and only if You agree to indemnify,
177
+ defend, and hold each Contributor harmless for any liability
178
+ incurred by, or claims asserted against, such Contributor by reason
179
+ of your accepting any such warranty or additional liability.
180
+
181
+ END OF TERMS AND CONDITIONS
182
+
183
+ APPENDIX: How to apply the Apache License to your work.
184
+
185
+ To apply the Apache License to your work, attach the following
186
+ boilerplate notice, with the fields enclosed by brackets "{}"
187
+ replaced with your own identifying information. (Don't include
188
+ the brackets!) The text should be enclosed in the appropriate
189
+ comment syntax for the file format. We also recommend that a
190
+ file or class name and description of purpose be included on the
191
+ same "printed page" as the copyright notice for easier
192
+ identification within third-party archives.
193
+
194
+ Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.
195
+
196
+ Licensed under the Apache License, Version 2.0 (the "License");
197
+ you may not use this file except in compliance with the License.
198
+ You may obtain a copy of the License at
199
+
200
+ http://www.apache.org/licenses/LICENSE-2.0
201
+
202
+ Unless required by applicable law or agreed to in writing, software
203
+ distributed under the License is distributed on an "AS IS" BASIS,
204
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
205
+ See the License for the specific language governing permissions and
206
+ limitations under the License.
package/README.md CHANGED
@@ -2,16 +2,79 @@
2
2
 
3
3
  layout 扩展包
4
4
 
5
+ ## 安装
6
+ ```shell
7
+ npm install @logicflow/layout
8
+ ```
9
+ or
10
+ ```shell
11
+ yarn add @logicflow/layout
12
+ ```
13
+ or
14
+ ```shell
15
+ pnpm add @logicflow/layout
16
+ ```
17
+
5
18
  ## 使用方式
6
19
 
7
20
  ```js
8
21
  import LogicFlow from '@logicflow/core';
9
- import { dagre } from '@logicflow/layout';
22
+ import { Dagre } from '@logicflow/layout';
10
23
 
11
24
  const lf = new LogicFlow({
12
25
  container: '#app',
13
- plugin: [dagre]
26
+ plugins: [Dagre]
14
27
  })
15
28
 
29
+ // 基本使用方式 - 无参数
16
30
  lf.extension.dagre.layout()
31
+
32
+ // 使用布局参数
33
+ lf.extension.dagre.layout({
34
+ rankdir: 'LR', // 从坐到右布局
35
+ ranksep: 100 // 层级间距
36
+ nodesep: 50, // 节点间距
37
+ })
38
+ ```
39
+
40
+ ## DagreOption 参数说明
41
+
42
+ | 参数名 | 类型 | 默认值 | 说明 |
43
+ |-------|-----|-------|------|
44
+ | rankdir | string | 'LR' | 布局方向,'LR'(左到右), 'TB'(上到下), 'BT'(下到上), 'RL'(右到左) |
45
+ | align | string | 'UL' | 节点对齐方式,'UL'(上左), 'UR'(上右), 'DL'(下左), 'DR'(下右) |
46
+ | nodesep | number | 100 | 节点间的水平间距(像素) |
47
+ | ranksep | number | 150 | 层级间的垂直间距(像素) |
48
+ | marginx | number | 120 | 图的水平边距(像素) |
49
+ | marginy | number | 120 | 图的垂直边距(像素) |
50
+ | ranker | string | 'tight-tree' | 排名算法,'network-simplex', 'tight-tree', 'longest-path' |
51
+ | edgesep | number | 10 | 边之间的水平间距(像素) |
52
+ | acyclicer | string | undefined | 如果设置为'greedy',使用贪心算法查找反馈弧集,用于使图变为无环图 |
53
+ | isDefaultAnchor | boolean | false | 是否是系统默认锚点(默认上下左右4个锚点),当为true时会自动调整连线的路径 |
54
+
55
+ ## 布局方向示例
56
+
57
+ ### 从左到右 (LR)
58
+
59
+ ```js
60
+ lf.extension.dagre.layout({
61
+ rankdir: 'LR' // 默认值
62
+ })
63
+ ```
64
+
65
+ ### 从上到下 (TB)
66
+
67
+ ```js
68
+ lf.extension.dagre.layout({
69
+ rankdir: 'TB'
70
+ })
71
+ ```
72
+
73
+ ### 默认锚点的话(默认上下左右4个锚点), 会自动调整连线的路径以及起终点位置
74
+
75
+ ```js
76
+ lf.extension.dagre.layout({
77
+ rankdir: 'TB',
78
+ isDefaultAnchor: true // 调整连线锚点
79
+ })
17
80
  ```
@@ -0,0 +1,2 @@
1
+ !function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((n="undefined"!=typeof globalThis?globalThis:n||self).Layout={})}(this,(function(n){"use strict";var r,t,e,i,o,u,a,f,c,s,d,h,v,l,p,g,y,b,m,w,_,E,x,j,k,N,O,I,L,A,C,M,P,S,T,R,F,z,D,B,U,G,V,$,q,Y,W,J,K,Q,Z,H,X,nn,rn,tn,en,on,un,an,fn,cn,sn,dn,hn,vn,ln,pn,gn,yn,bn,mn,wn,_n,En,xn,jn,kn,Nn,On,In,Ln,An,Cn,Mn,Pn,Sn,Tn,Rn,Fn,zn,Dn,Bn,Un,Gn,Vn,$n,qn,Yn,Wn,Jn,Kn,Qn,Zn,Hn,Xn,nr,rr,tr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function er(){if(i)return e;return i=1,e=function(n,r){return n===r||n!=n&&r!=r}}function ir(){if(u)return o;u=1;var n=er();return o=function(r,t){for(var e=r.length;e--;)if(n(r[e][0],t))return e;return-1}}function or(){if(g)return p;g=1;var n=t?r:(t=1,r=function(){this.__data__=[],this.size=0}),e=function(){if(f)return a;f=1;var n=ir(),r=Array.prototype.splice;return a=function(t){var e=this.__data__,i=n(e,t);return!(i<0||(i==e.length-1?e.pop():r.call(e,i,1),--this.size,0))}}(),i=function(){if(s)return c;s=1;var n=ir();return c=function(r){var t=this.__data__,e=n(t,r);return e<0?void 0:t[e][1]}}(),o=function(){if(h)return d;h=1;var n=ir();return d=function(r){return n(this.__data__,r)>-1}}(),u=function(){if(l)return v;l=1;var n=ir();return v=function(r,t){var e=this.__data__,i=n(e,r);return i<0?(++this.size,e.push([r,t])):e[i][1]=t,this}}();function y(n){var r=-1,t=null==n?0:n.length;for(this.clear();++r<t;){var e=n[r];this.set(e[0],e[1])}}return y.prototype.clear=n,y.prototype.delete=e,y.prototype.get=i,y.prototype.has=o,y.prototype.set=u,p=y}function ur(){if(N)return k;N=1;var n="object"==typeof tr&&tr&&tr.Object===Object&&tr;return k=n}function ar(){if(I)return O;I=1;var n=ur(),r="object"==typeof self&&self&&self.Object===Object&&self,t=n||r||Function("return this")();return O=t}function fr(){if(A)return L;A=1;var n=ar().Symbol;return L=n}function cr(){if(R)return T;R=1;var n=fr(),r=function(){if(M)return C;M=1;var n=fr(),r=Object.prototype,t=r.hasOwnProperty,e=r.toString,i=n?n.toStringTag:void 0;return C=function(n){var r=t.call(n,i),o=n[i];try{n[i]=void 0;var u=!0}catch(n){}var a=e.call(n);return u&&(r?n[i]=o:delete n[i]),a}}(),t=function(){if(S)return P;S=1;var n=Object.prototype.toString;return P=function(r){return n.call(r)}}(),e=n?n.toStringTag:void 0;return T=function(n){return null==n?void 0===n?"[object Undefined]":"[object Null]":e&&e in Object(n)?r(n):t(n)}}function sr(){if(z)return F;return z=1,F=function(n){var r=typeof n;return null!=n&&("object"==r||"function"==r)}}function dr(){if(B)return D;B=1;var n=cr(),r=sr();return D=function(t){if(!r(t))return!1;var e=n(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}}function hr(){if($)return V;$=1;var n,r=function(){if(G)return U;G=1;var n=ar()["__core-js_shared__"];return U=n}(),t=(n=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";return V=function(n){return!!t&&t in n}}function vr(){if(Y)return q;Y=1;var n=Function.prototype.toString;return q=function(r){if(null!=r){try{return n.call(r)}catch(n){}try{return r+""}catch(n){}}return""}}function lr(){if(H)return Z;H=1;var n=function(){if(J)return W;J=1;var n=dr(),r=hr(),t=sr(),e=vr(),i=/^\[object .+?Constructor\]$/,o=Function.prototype,u=Object.prototype,a=o.toString,f=u.hasOwnProperty,c=RegExp("^"+a.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return W=function(o){return!(!t(o)||r(o))&&(n(o)?c:i).test(e(o))}}(),r=Q?K:(Q=1,K=function(n,r){return null==n?void 0:n[r]});return Z=function(t,e){var i=r(t,e);return n(i)?i:void 0}}function pr(){if(nn)return X;nn=1;var n=lr()(ar(),"Map");return X=n}function gr(){if(tn)return rn;tn=1;var n=lr()(Object,"create");return rn=n}function yr(){if(pn)return ln;pn=1;var n=function(){if(on)return en;on=1;var n=gr();return en=function(){this.__data__=n?n(null):{},this.size=0}}(),r=an?un:(an=1,un=function(n){var r=this.has(n)&&delete this.__data__[n];return this.size-=r?1:0,r}),t=function(){if(cn)return fn;cn=1;var n=gr(),r=Object.prototype.hasOwnProperty;return fn=function(t){var e=this.__data__;if(n){var i=e[t];return"__lodash_hash_undefined__"===i?void 0:i}return r.call(e,t)?e[t]:void 0}}(),e=function(){if(dn)return sn;dn=1;var n=gr(),r=Object.prototype.hasOwnProperty;return sn=function(t){var e=this.__data__;return n?void 0!==e[t]:r.call(e,t)}}(),i=function(){if(vn)return hn;vn=1;var n=gr();return hn=function(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=n&&void 0===t?"__lodash_hash_undefined__":t,this}}();function o(n){var r=-1,t=null==n?0:n.length;for(this.clear();++r<t;){var e=n[r];this.set(e[0],e[1])}}return o.prototype.clear=n,o.prototype.delete=r,o.prototype.get=t,o.prototype.has=e,o.prototype.set=i,ln=o}function br(){if(_n)return wn;_n=1;var n=mn?bn:(mn=1,bn=function(n){var r=typeof n;return"string"==r||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n});return wn=function(r,t){var e=r.__data__;return n(t)?e["string"==typeof t?"string":"hash"]:e.map}}function mr(){if(Cn)return An;Cn=1;var n=function(){if(yn)return gn;yn=1;var n=yr(),r=or(),t=pr();return gn=function(){this.size=0,this.__data__={hash:new n,map:new(t||r),string:new n}}}(),r=function(){if(xn)return En;xn=1;var n=br();return En=function(r){var t=n(this,r).delete(r);return this.size-=t?1:0,t}}(),t=function(){if(kn)return jn;kn=1;var n=br();return jn=function(r){return n(this,r).get(r)}}(),e=function(){if(On)return Nn;On=1;var n=br();return Nn=function(r){return n(this,r).has(r)}}(),i=function(){if(Ln)return In;Ln=1;var n=br();return In=function(r,t){var e=n(this,r),i=e.size;return e.set(r,t),this.size+=e.size==i?0:1,this}}();function o(n){var r=-1,t=null==n?0:n.length;for(this.clear();++r<t;){var e=n[r];this.set(e[0],e[1])}}return o.prototype.clear=n,o.prototype.delete=r,o.prototype.get=t,o.prototype.has=e,o.prototype.set=i,An=o}function wr(){if(Tn)return Sn;Tn=1;var n=or(),r=function(){if(b)return y;b=1;var n=or();return y=function(){this.__data__=new n,this.size=0}}(),t=w?m:(w=1,m=function(n){var r=this.__data__,t=r.delete(n);return this.size=r.size,t}),e=E?_:(E=1,_=function(n){return this.__data__.get(n)}),i=j?x:(j=1,x=function(n){return this.__data__.has(n)}),o=function(){if(Pn)return Mn;Pn=1;var n=or(),r=pr(),t=mr();return Mn=function(e,i){var o=this.__data__;if(o instanceof n){var u=o.__data__;if(!r||u.length<199)return u.push([e,i]),this.size=++o.size,this;o=this.__data__=new t(u)}return o.set(e,i),this.size=o.size,this}}();function u(r){var t=this.__data__=new n(r);this.size=t.size}return u.prototype.clear=r,u.prototype.delete=t,u.prototype.get=e,u.prototype.has=i,u.prototype.set=o,Sn=u}function _r(){if(Fn)return Rn;return Fn=1,Rn=function(n,r){for(var t=-1,e=null==n?0:n.length;++t<e&&!1!==r(n[t],t,n););return n}}function Er(){if(Dn)return zn;Dn=1;var n=lr(),r=function(){try{var r=n(Object,"defineProperty");return r({},"",{}),r}catch(n){}}();return zn=r}function xr(){if(Un)return Bn;Un=1;var n=Er();return Bn=function(r,t,e){"__proto__"==t&&n?n(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):r[t]=e}}function jr(){if(Vn)return Gn;Vn=1;var n=xr(),r=er(),t=Object.prototype.hasOwnProperty;return Gn=function(e,i,o){var u=e[i];t.call(e,i)&&r(u,o)&&(void 0!==o||i in e)||n(e,i,o)}}function kr(){if(qn)return $n;qn=1;var n=jr(),r=xr();return $n=function(t,e,i,o){var u=!i;i||(i={});for(var a=-1,f=e.length;++a<f;){var c=e[a],s=o?o(i[c],t[c],c,i,t):void 0;void 0===s&&(s=t[c]),u?r(i,c,s):n(i,c,s)}return i}}function Nr(){if(Kn)return Jn;return Kn=1,Jn=function(n){return null!=n&&"object"==typeof n}}function Or(){if(Xn)return Hn;Xn=1;var n=function(){if(Zn)return Qn;Zn=1;var n=cr(),r=Nr();return Qn=function(t){return r(t)&&"[object Arguments]"==n(t)}}(),r=Nr(),t=Object.prototype,e=t.hasOwnProperty,i=t.propertyIsEnumerable,o=n(function(){return arguments}())?n:function(n){return r(n)&&e.call(n,"callee")&&!i.call(n,"callee")};return Hn=o}function Ir(){if(rr)return nr;rr=1;var n=Array.isArray;return nr=n}var Lr,Ar,Cr,Mr,Pr,Sr,Tr,Rr,Fr,zr,Dr,Br={},Ur={get exports(){return Br},set exports(n){Br=n}};function Gr(){return Cr||(Cr=1,function(n,r){var t=ar(),e=Ar?Lr:(Ar=1,Lr=function(){return!1}),i=r&&!r.nodeType&&r,o=i&&n&&!n.nodeType&&n,u=o&&o.exports===i?t.Buffer:void 0,a=(u?u.isBuffer:void 0)||e;n.exports=a}(Ur,Br)),Br}function Vr(){if(Pr)return Mr;Pr=1;var n=/^(?:0|[1-9]\d*)$/;return Mr=function(r,t){var e=typeof r;return!!(t=null==t?9007199254740991:t)&&("number"==e||"symbol"!=e&&n.test(r))&&r>-1&&r%1==0&&r<t}}function $r(){if(Tr)return Sr;Tr=1;return Sr=function(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=9007199254740991}}function qr(){if(Dr)return zr;return Dr=1,zr=function(n){return function(r){return n(r)}}}var Yr,Wr,Jr,Kr,Qr,Zr,Hr,Xr,nt,rt,tt,et,it,ot,ut,at,ft,ct,st,dt,ht,vt,lt,pt,gt,yt,bt,mt={},wt={get exports(){return mt},set exports(n){mt=n}};function _t(){return Yr||(Yr=1,function(n,r){var t=ur(),e=r&&!r.nodeType&&r,i=e&&n&&!n.nodeType&&n,o=i&&i.exports===e&&t.process,u=function(){try{var n=i&&i.require&&i.require("util").types;return n||o&&o.binding&&o.binding("util")}catch(n){}}();n.exports=u}(wt,mt)),mt}function Et(){if(Jr)return Wr;Jr=1;var n=function(){if(Fr)return Rr;Fr=1;var n=cr(),r=$r(),t=Nr(),e={};return e["[object Float32Array]"]=e["[object Float64Array]"]=e["[object Int8Array]"]=e["[object Int16Array]"]=e["[object Int32Array]"]=e["[object Uint8Array]"]=e["[object Uint8ClampedArray]"]=e["[object Uint16Array]"]=e["[object Uint32Array]"]=!0,e["[object Arguments]"]=e["[object Array]"]=e["[object ArrayBuffer]"]=e["[object Boolean]"]=e["[object DataView]"]=e["[object Date]"]=e["[object Error]"]=e["[object Function]"]=e["[object Map]"]=e["[object Number]"]=e["[object Object]"]=e["[object RegExp]"]=e["[object Set]"]=e["[object String]"]=e["[object WeakMap]"]=!1,Rr=function(i){return t(i)&&r(i.length)&&!!e[n(i)]}}(),r=qr(),t=_t(),e=t&&t.isTypedArray,i=e?r(e):n;return Wr=i}function xt(){if(Qr)return Kr;Qr=1;var n=Wn?Yn:(Wn=1,Yn=function(n,r){for(var t=-1,e=Array(n);++t<n;)e[t]=r(t);return e}),r=Or(),t=Ir(),e=Gr(),i=Vr(),o=Et(),u=Object.prototype.hasOwnProperty;return Kr=function(a,f){var c=t(a),s=!c&&r(a),d=!c&&!s&&e(a),h=!c&&!s&&!d&&o(a),v=c||s||d||h,l=v?n(a.length,String):[],p=l.length;for(var g in a)!f&&!u.call(a,g)||v&&("length"==g||d&&("offset"==g||"parent"==g)||h&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||i(g,p))||l.push(g);return l}}function jt(){if(Hr)return Zr;Hr=1;var n=Object.prototype;return Zr=function(r){var t=r&&r.constructor;return r===("function"==typeof t&&t.prototype||n)}}function kt(){if(nt)return Xr;return nt=1,Xr=function(n,r){return function(t){return n(r(t))}}}function Nt(){if(it)return et;it=1;var n=jt(),r=function(){if(tt)return rt;tt=1;var n=kt()(Object.keys,Object);return rt=n}(),t=Object.prototype.hasOwnProperty;return et=function(e){if(!n(e))return r(e);var i=[];for(var o in Object(e))t.call(e,o)&&"constructor"!=o&&i.push(o);return i}}function Ot(){if(ut)return ot;ut=1;var n=dr(),r=$r();return ot=function(t){return null!=t&&r(t.length)&&!n(t)}}function It(){if(ft)return at;ft=1;var n=xt(),r=Nt(),t=Ot();return at=function(e){return t(e)?n(e):r(e)}}function Lt(){if(lt)return vt;lt=1;var n=sr(),r=jt(),t=ht?dt:(ht=1,dt=function(n){var r=[];if(null!=n)for(var t in Object(n))r.push(t);return r}),e=Object.prototype.hasOwnProperty;return vt=function(i){if(!n(i))return t(i);var o=r(i),u=[];for(var a in i)("constructor"!=a||!o&&e.call(i,a))&&u.push(a);return u}}function At(){if(gt)return pt;gt=1;var n=xt(),r=Lt(),t=Ot();return pt=function(e){return t(e)?n(e,!0):r(e)}}var Ct,Mt,Pt,St,Tt,Rt,Ft,zt,Dt,Bt,Ut,Gt,Vt,$t,qt,Yt,Wt,Jt,Kt,Qt,Zt,Ht,Xt,ne,re,te,ee,ie,oe,ue,ae,fe,ce,se,de,he,ve,le,pe,ge,ye,be,me,we,_e,Ee,xe,je,ke,Ne,Oe,Ie,Le,Ae,Ce,Me,Pe,Se,Te,Re,Fe,ze,De,Be,Ue,Ge,Ve,$e,qe,Ye={},We={get exports(){return Ye},set exports(n){Ye=n}};function Je(){return Ct||(Ct=1,function(n,r){var t=ar(),e=r&&!r.nodeType&&r,i=e&&n&&!n.nodeType&&n,o=i&&i.exports===e?t.Buffer:void 0,u=o?o.allocUnsafe:void 0;n.exports=function(n,r){if(r)return n.slice();var t=n.length,e=u?u(t):new n.constructor(t);return n.copy(e),e}}(We,Ye)),Ye}function Ke(){if(Pt)return Mt;return Pt=1,Mt=function(n,r){var t=-1,e=n.length;for(r||(r=Array(e));++t<e;)r[t]=n[t];return r}}function Qe(){if(Tt)return St;return Tt=1,St=function(n,r){for(var t=-1,e=null==n?0:n.length,i=0,o=[];++t<e;){var u=n[t];r(u,t,n)&&(o[i++]=u)}return o}}function Ze(){if(Ft)return Rt;return Ft=1,Rt=function(){return[]}}function He(){if(Dt)return zt;Dt=1;var n=Qe(),r=Ze(),t=Object.prototype.propertyIsEnumerable,e=Object.getOwnPropertySymbols;return zt=e?function(r){return null==r?[]:(r=Object(r),n(e(r),(function(n){return t.call(r,n)})))}:r}function Xe(){if(Vt)return Gt;return Vt=1,Gt=function(n,r){for(var t=-1,e=r.length,i=n.length;++t<e;)n[i+t]=r[t];return n}}function ni(){if(qt)return $t;qt=1;var n=kt()(Object.getPrototypeOf,Object);return $t=n}function ri(){if(Wt)return Yt;Wt=1;var n=Xe(),r=ni(),t=He(),e=Ze(),i=Object.getOwnPropertySymbols;return Yt=i?function(e){for(var i=[];e;)n(i,t(e)),e=r(e);return i}:e}function ti(){if(Zt)return Qt;Zt=1;var n=Xe(),r=Ir();return Qt=function(t,e,i){var o=e(t);return r(t)?o:n(o,i(t))}}function ei(){if(Xt)return Ht;Xt=1;var n=ti(),r=He(),t=It();return Ht=function(e){return n(e,t,r)}}function ii(){if(ae)return ue;ae=1;var n=lr()(ar(),"Set");return ue=n}function oi(){if(de)return se;de=1;var n=function(){if(ee)return te;ee=1;var n=lr()(ar(),"DataView");return te=n}(),r=pr(),t=function(){if(oe)return ie;oe=1;var n=lr()(ar(),"Promise");return ie=n}(),e=ii(),i=function(){if(ce)return fe;ce=1;var n=lr()(ar(),"WeakMap");return fe=n}(),o=cr(),u=vr(),a="[object Map]",f="[object Promise]",c="[object Set]",s="[object WeakMap]",d="[object DataView]",h=u(n),v=u(r),l=u(t),p=u(e),g=u(i),y=o;return(n&&y(new n(new ArrayBuffer(1)))!=d||r&&y(new r)!=a||t&&y(t.resolve())!=f||e&&y(new e)!=c||i&&y(new i)!=s)&&(y=function(n){var r=o(n),t="[object Object]"==r?n.constructor:void 0,e=t?u(t):"";if(e)switch(e){case h:return d;case v:return a;case l:return f;case p:return c;case g:return s}return r}),se=y}function ui(){if(pe)return le;pe=1;var n=ar().Uint8Array;return le=n}function ai(){if(ye)return ge;ye=1;var n=ui();return ge=function(r){var t=new r.constructor(r.byteLength);return new n(t).set(new n(r)),t}}function fi(){if(ke)return je;ke=1;var n=ai();return je=function(r,t){var e=t?n(r.buffer):r.buffer;return new r.constructor(e,r.byteOffset,r.length)}}function ci(){if(Oe)return Ne;Oe=1;var n=ai(),r=function(){if(me)return be;me=1;var n=ai();return be=function(r,t){var e=t?n(r.buffer):r.buffer;return new r.constructor(e,r.byteOffset,r.byteLength)}}(),t=function(){if(_e)return we;_e=1;var n=/\w*$/;return we=function(r){var t=new r.constructor(r.source,n.exec(r));return t.lastIndex=r.lastIndex,t}}(),e=function(){if(xe)return Ee;xe=1;var n=fr(),r=n?n.prototype:void 0,t=r?r.valueOf:void 0;return Ee=function(n){return t?Object(t.call(n)):{}}}(),i=fi();return Ne=function(o,u,a){var f=o.constructor;switch(u){case"[object ArrayBuffer]":return n(o);case"[object Boolean]":case"[object Date]":return new f(+o);case"[object DataView]":return r(o,a);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return i(o,a);case"[object Map]":case"[object Set]":return new f;case"[object Number]":case"[object String]":return new f(o);case"[object RegExp]":return t(o);case"[object Symbol]":return e(o)}}}function si(){if(Le)return Ie;Le=1;var n=sr(),r=Object.create,t=function(){function t(){}return function(e){if(!n(e))return{};if(r)return r(e);t.prototype=e;var i=new t;return t.prototype=void 0,i}}();return Ie=t}function di(){if(Ce)return Ae;Ce=1;var n=si(),r=ni(),t=jt();return Ae=function(e){return"function"!=typeof e.constructor||t(e)?{}:n(r(e))}}function hi(){if(Te)return Se;Te=1;var n=function(){if(Pe)return Me;Pe=1;var n=oi(),r=Nr();return Me=function(t){return r(t)&&"[object Map]"==n(t)}}(),r=qr(),t=_t(),e=t&&t.isMap,i=e?r(e):n;return Se=i}function vi(){if(De)return ze;De=1;var n=function(){if(Fe)return Re;Fe=1;var n=oi(),r=Nr();return Re=function(t){return r(t)&&"[object Set]"==n(t)}}(),r=qr(),t=_t(),e=t&&t.isSet,i=e?r(e):n;return ze=i}function li(){if(Ue)return Be;Ue=1;var n=wr(),r=_r(),t=jr(),e=function(){if(st)return ct;st=1;var n=kr(),r=It();return ct=function(t,e){return t&&n(e,r(e),t)}}(),i=function(){if(bt)return yt;bt=1;var n=kr(),r=At();return yt=function(t,e){return t&&n(e,r(e),t)}}(),o=Je(),u=Ke(),a=function(){if(Ut)return Bt;Ut=1;var n=kr(),r=He();return Bt=function(t,e){return n(t,r(t),e)}}(),f=function(){if(Kt)return Jt;Kt=1;var n=kr(),r=ri();return Jt=function(t,e){return n(t,r(t),e)}}(),c=ei(),s=function(){if(re)return ne;re=1;var n=ti(),r=ri(),t=At();return ne=function(e){return n(e,t,r)}}(),d=oi(),h=function(){if(ve)return he;ve=1;var n=Object.prototype.hasOwnProperty;return he=function(r){var t=r.length,e=new r.constructor(t);return t&&"string"==typeof r[0]&&n.call(r,"index")&&(e.index=r.index,e.input=r.input),e}}(),v=ci(),l=di(),p=Ir(),g=Gr(),y=hi(),b=sr(),m=vi(),w=It(),_=At(),E="[object Arguments]",x="[object Function]",j="[object Object]",k={};return k[E]=k["[object Array]"]=k["[object ArrayBuffer]"]=k["[object DataView]"]=k["[object Boolean]"]=k["[object Date]"]=k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Map]"]=k["[object Number]"]=k[j]=k["[object RegExp]"]=k["[object Set]"]=k["[object String]"]=k["[object Symbol]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k["[object Error]"]=k[x]=k["[object WeakMap]"]=!1,Be=function N(O,I,L,A,C,M){var P,S=1&I,T=2&I,R=4&I;if(L&&(P=C?L(O,A,C,M):L(O)),void 0!==P)return P;if(!b(O))return O;var F=p(O);if(F){if(P=h(O),!S)return u(O,P)}else{var z=d(O),D=z==x||"[object GeneratorFunction]"==z;if(g(O))return o(O,S);if(z==j||z==E||D&&!C){if(P=T||D?{}:l(O),!S)return T?f(O,i(P,O)):a(O,e(P,O))}else{if(!k[z])return C?O:{};P=v(O,z,S)}}M||(M=new n);var B=M.get(O);if(B)return B;M.set(O,P),m(O)?O.forEach((function(n){P.add(N(n,I,L,n,O,M))})):y(O)&&O.forEach((function(n,r){P.set(r,N(n,I,L,r,O,M))}));var U=F?void 0:(R?T?s:c:T?_:w)(O);return r(U||O,(function(n,r){U&&(n=O[r=n]),t(P,r,N(n,I,L,r,O,M))})),P},Be}function pi(){if(Ve)return Ge;Ve=1;var n=li();return Ge=function(r){return n(r,4)}}function gi(){if(qe)return $e;return qe=1,$e=function(n){return function(){return n}}}var yi,bi,mi,wi,_i,Ei,xi,ji,ki,Ni,Oi,Ii,Li,Ai,Ci,Mi,Pi,Si,Ti,Ri,Fi,zi,Di,Bi,Ui,Gi,Vi,$i,qi,Yi,Wi,Ji,Ki,Qi,Zi,Hi,Xi,no,ro,to,eo,io,oo,uo,ao,fo,co,so,ho,vo,lo,po,go,yo,bo,mo,wo,_o,Eo,xo,jo,ko,No,Oo,Io,Lo,Ao,Co,Mo,Po,So,To,Ro,Fo,zo,Do,Bo,Uo,Go,Vo,$o,qo,Yo,Wo,Jo,Ko,Qo,Zo,Ho,Xo,nu,ru,tu,eu,iu,ou,uu,au,fu,cu,su,du,hu,vu,lu,pu,gu,yu,bu,mu,wu,_u,Eu,xu,ju,ku,Nu,Ou,Iu,Lu,Au,Cu,Mu,Pu,Su,Tu,Ru,Fu,zu,Du,Bu,Uu,Gu,Vu,$u,qu,Yu,Wu,Ju,Ku,Qu,Zu,Hu,Xu,na,ra,ta,ea,ia,oa,ua,aa,fa,ca,sa,da,ha,va,la,pa,ga,ya,ba,ma,wa,_a,Ea,xa,ja,ka,Na,Oa,Ia,La,Aa,Ca,Ma,Pa,Sa,Ta,Ra,Fa,za,Da,Ba,Ua,Ga,Va,$a,qa,Ya,Wa,Ja,Ka,Qa,Za,Ha,Xa,nf,rf,tf,ef,of,uf,af,ff,cf,sf,df,hf,vf={},lf={get exports(){return vf},set exports(n){vf=n}};function pf(){if(wi)return mi;wi=1;var n=(bi?yi:(bi=1,yi=function(n){return function(r,t,e){for(var i=-1,o=Object(r),u=e(r),a=u.length;a--;){var f=u[n?a:++i];if(!1===t(o[f],f,o))break}return r}}))();return mi=n}function gf(){if(Ei)return _i;Ei=1;var n=pf(),r=It();return _i=function(t,e){return t&&n(t,e,r)}}function yf(){if(Ni)return ki;Ni=1;var n=gf(),r=function(){if(ji)return xi;ji=1;var n=Ot();return xi=function(r,t){return function(e,i){if(null==e)return e;if(!n(e))return r(e,i);for(var o=e.length,u=t?o:-1,a=Object(e);(t?u--:++u<o)&&!1!==i(a[u],u,a););return e}}}()(n);return ki=r}function bf(){if(Ii)return Oi;return Ii=1,Oi=function(n){return n}}function mf(){if(Ai)return Li;Ai=1;var n=bf();return Li=function(r){return"function"==typeof r?r:n}}function wf(){if(Mi)return Ci;Mi=1;var n=_r(),r=yf(),t=mf(),e=Ir();return Ci=function(i,o){return(e(i)?n:r)(i,t(o))}}function _f(){return Pi||(Pi=1,function(n){n.exports=wf()}(lf)),vf}function Ef(){if(Ui)return Bi;Ui=1;var n=mr(),r=Fi?Ri:(Fi=1,Ri=function(n){return this.__data__.set(n,"__lodash_hash_undefined__"),this}),t=Di?zi:(Di=1,zi=function(n){return this.__data__.has(n)});function e(r){var t=-1,e=null==r?0:r.length;for(this.__data__=new n;++t<e;)this.add(r[t])}return e.prototype.add=e.prototype.push=r,e.prototype.has=t,Bi=e}function xf(){if(qi)return $i;return qi=1,$i=function(n,r){return n.has(r)}}function jf(){if(Wi)return Yi;Wi=1;var n=Ef(),r=Vi?Gi:(Vi=1,Gi=function(n,r){for(var t=-1,e=null==n?0:n.length;++t<e;)if(r(n[t],t,n))return!0;return!1}),t=xf();return Yi=function(e,i,o,u,a,f){var c=1&o,s=e.length,d=i.length;if(s!=d&&!(c&&d>s))return!1;var h=f.get(e),v=f.get(i);if(h&&v)return h==i&&v==e;var l=-1,p=!0,g=2&o?new n:void 0;for(f.set(e,i),f.set(i,e);++l<s;){var y=e[l],b=i[l];if(u)var m=c?u(b,y,l,i,e,f):u(y,b,l,e,i,f);if(void 0!==m){if(m)continue;p=!1;break}if(g){if(!r(i,(function(n,r){if(!t(g,r)&&(y===n||a(y,n,o,u,f)))return g.push(r)}))){p=!1;break}}else if(y!==b&&!a(y,b,o,u,f)){p=!1;break}}return f.delete(e),f.delete(i),p}}function kf(){if(Zi)return Qi;return Zi=1,Qi=function(n){var r=-1,t=Array(n.size);return n.forEach((function(n){t[++r]=n})),t}}function Nf(){if(Xi)return Hi;Xi=1;var n=fr(),r=ui(),t=er(),e=jf(),i=Ki?Ji:(Ki=1,Ji=function(n){var r=-1,t=Array(n.size);return n.forEach((function(n,e){t[++r]=[e,n]})),t}),o=kf(),u=n?n.prototype:void 0,a=u?u.valueOf:void 0;return Hi=function(n,u,f,c,s,d,h){switch(f){case"[object DataView]":if(n.byteLength!=u.byteLength||n.byteOffset!=u.byteOffset)return!1;n=n.buffer,u=u.buffer;case"[object ArrayBuffer]":return!(n.byteLength!=u.byteLength||!d(new r(n),new r(u)));case"[object Boolean]":case"[object Date]":case"[object Number]":return t(+n,+u);case"[object Error]":return n.name==u.name&&n.message==u.message;case"[object RegExp]":case"[object String]":return n==u+"";case"[object Map]":var v=i;case"[object Set]":var l=1&c;if(v||(v=o),n.size!=u.size&&!l)return!1;var p=h.get(n);if(p)return p==u;c|=2,h.set(n,u);var g=e(v(n),v(u),c,s,d,h);return h.delete(n),g;case"[object Symbol]":if(a)return a.call(n)==a.call(u)}return!1}}function Of(){if(eo)return to;eo=1;var n=wr(),r=jf(),t=Nf(),e=function(){if(ro)return no;ro=1;var n=ei(),r=Object.prototype.hasOwnProperty;return no=function(t,e,i,o,u,a){var f=1&i,c=n(t),s=c.length;if(s!=n(e).length&&!f)return!1;for(var d=s;d--;){var h=c[d];if(!(f?h in e:r.call(e,h)))return!1}var v=a.get(t),l=a.get(e);if(v&&l)return v==e&&l==t;var p=!0;a.set(t,e),a.set(e,t);for(var g=f;++d<s;){var y=t[h=c[d]],b=e[h];if(o)var m=f?o(b,y,h,e,t,a):o(y,b,h,t,e,a);if(!(void 0===m?y===b||u(y,b,i,o,a):m)){p=!1;break}g||(g="constructor"==h)}if(p&&!g){var w=t.constructor,_=e.constructor;w==_||!("constructor"in t)||!("constructor"in e)||"function"==typeof w&&w instanceof w&&"function"==typeof _&&_ instanceof _||(p=!1)}return a.delete(t),a.delete(e),p}}(),i=oi(),o=Ir(),u=Gr(),a=Et(),f="[object Arguments]",c="[object Array]",s="[object Object]",d=Object.prototype.hasOwnProperty;return to=function(h,v,l,p,g,y){var b=o(h),m=o(v),w=b?c:i(h),_=m?c:i(v),E=(w=w==f?s:w)==s,x=(_=_==f?s:_)==s,j=w==_;if(j&&u(h)){if(!u(v))return!1;b=!0,E=!1}if(j&&!E)return y||(y=new n),b||a(h)?r(h,v,l,p,g,y):t(h,v,w,l,p,g,y);if(!(1&l)){var k=E&&d.call(h,"__wrapped__"),N=x&&d.call(v,"__wrapped__");if(k||N){var O=k?h.value():h,I=N?v.value():v;return y||(y=new n),g(O,I,l,p,y)}}return!!j&&(y||(y=new n),e(h,v,l,p,g,y))}}function If(){if(oo)return io;oo=1;var n=Of(),r=Nr();return io=function t(e,i,o,u,a){return e===i||(null==e||null==i||!r(e)&&!r(i)?e!=e&&i!=i:n(e,i,o,u,t,a))},io}function Lf(){if(co)return fo;co=1;var n=sr();return fo=function(r){return r==r&&!n(r)}}function Af(){if(lo)return vo;return lo=1,vo=function(n,r){return function(t){return null!=t&&(t[n]===r&&(void 0!==r||n in Object(t)))}}}function Cf(){if(go)return po;go=1;var n=function(){if(ao)return uo;ao=1;var n=wr(),r=If();return uo=function(t,e,i,o){var u=i.length,a=u,f=!o;if(null==t)return!a;for(t=Object(t);u--;){var c=i[u];if(f&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++u<a;){var s=(c=i[u])[0],d=t[s],h=c[1];if(f&&c[2]){if(void 0===d&&!(s in t))return!1}else{var v=new n;if(o)var l=o(d,h,s,t,e,v);if(!(void 0===l?r(h,d,3,o,v):l))return!1}}return!0}}(),r=function(){if(ho)return so;ho=1;var n=Lf(),r=It();return so=function(t){for(var e=r(t),i=e.length;i--;){var o=e[i],u=t[o];e[i]=[o,u,n(u)]}return e}}(),t=Af();return po=function(e){var i=r(e);return 1==i.length&&i[0][2]?t(i[0][0],i[0][1]):function(r){return r===e||n(r,e,i)}}}function Mf(){if(bo)return yo;bo=1;var n=cr(),r=Nr();return yo=function(t){return"symbol"==typeof t||r(t)&&"[object Symbol]"==n(t)}}function Pf(){if(wo)return mo;wo=1;var n=Ir(),r=Mf(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,e=/^\w*$/;return mo=function(i,o){if(n(i))return!1;var u=typeof i;return!("number"!=u&&"symbol"!=u&&"boolean"!=u&&null!=i&&!r(i))||(e.test(i)||!t.test(i)||null!=o&&i in Object(o))}}function Sf(){if(jo)return xo;jo=1;var n=function(){if(Eo)return _o;Eo=1;var n=mr();function r(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var i=function(){var n=arguments,r=e?e.apply(this,n):n[0],o=i.cache;if(o.has(r))return o.get(r);var u=t.apply(this,n);return i.cache=o.set(r,u)||o,u};return i.cache=new(r.Cache||n),i}return r.Cache=n,_o=r}();return xo=function(r){var t=n(r,(function(n){return 500===e.size&&e.clear(),n})),e=t.cache;return t}}function Tf(){if(Io)return Oo;return Io=1,Oo=function(n,r){for(var t=-1,e=null==n?0:n.length,i=Array(e);++t<e;)i[t]=r(n[t],t,n);return i}}function Rf(){if(Mo)return Co;Mo=1;var n=function(){if(Ao)return Lo;Ao=1;var n=fr(),r=Tf(),t=Ir(),e=Mf(),i=n?n.prototype:void 0,o=i?i.toString:void 0;return Lo=function n(i){if("string"==typeof i)return i;if(t(i))return r(i,n)+"";if(e(i))return o?o.call(i):"";var u=i+"";return"0"==u&&1/i==-1/0?"-0":u},Lo}();return Co=function(r){return null==r?"":n(r)}}function Ff(){if(So)return Po;So=1;var n=Ir(),r=Pf(),t=function(){if(No)return ko;No=1;var n=Sf(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,e=n((function(n){var e=[];return 46===n.charCodeAt(0)&&e.push(""),n.replace(r,(function(n,r,i,o){e.push(i?o.replace(t,"$1"):r||n)})),e}));return ko=e}(),e=Rf();return Po=function(i,o){return n(i)?i:r(i,o)?[i]:t(e(i))}}function zf(){if(Ro)return To;Ro=1;var n=Mf();return To=function(r){if("string"==typeof r||n(r))return r;var t=r+"";return"0"==t&&1/r==-1/0?"-0":t}}function Df(){if(zo)return Fo;zo=1;var n=Ff(),r=zf();return Fo=function(t,e){for(var i=0,o=(e=n(e,t)).length;null!=t&&i<o;)t=t[r(e[i++])];return i&&i==o?t:void 0}}function Bf(){if($o)return Vo;$o=1;var n=Ff(),r=Or(),t=Ir(),e=Vr(),i=$r(),o=zf();return Vo=function(u,a,f){for(var c=-1,s=(a=n(a,u)).length,d=!1;++c<s;){var h=o(a[c]);if(!(d=null!=u&&f(u,h)))break;u=u[h]}return d||++c!=s?d:!!(s=null==u?0:u.length)&&i(s)&&e(h,s)&&(t(u)||r(u))}}function Uf(){if(Yo)return qo;Yo=1;var n=Go?Uo:(Go=1,Uo=function(n,r){return null!=n&&r in Object(n)}),r=Bf();return qo=function(t,e){return null!=t&&r(t,e,n)}}function Gf(){if(Jo)return Wo;Jo=1;var n=If(),r=function(){if(Bo)return Do;Bo=1;var n=Df();return Do=function(r,t,e){var i=null==r?void 0:n(r,t);return void 0===i?e:i}}(),t=Uf(),e=Pf(),i=Lf(),o=Af(),u=zf();return Wo=function(a,f){return e(a)&&i(f)?o(u(a),f):function(e){var i=r(e,a);return void 0===i&&i===f?t(e,a):n(f,i,3)}}}function Vf(){if(Qo)return Ko;return Qo=1,Ko=function(n){return function(r){return null==r?void 0:r[n]}}}function $f(){if(nu)return Xo;nu=1;var n=Vf(),r=function(){if(Ho)return Zo;Ho=1;var n=Df();return Zo=function(r){return function(t){return n(t,r)}}}(),t=Pf(),e=zf();return Xo=function(i){return t(i)?n(e(i)):r(i)}}function qf(){if(tu)return ru;tu=1;var n=Cf(),r=Gf(),t=bf(),e=Ir(),i=$f();return ru=function(o){return"function"==typeof o?o:null==o?t:"object"==typeof o?e(o)?r(o[0],o[1]):n(o):i(o)}}function Yf(){if(iu)return eu;iu=1;var n=Qe(),r=function(){if(Ti)return Si;Ti=1;var n=yf();return Si=function(r,t){var e=[];return n(r,(function(n,r,i){t(n,r,i)&&e.push(n)})),e}}(),t=qf(),e=Ir();return eu=function(i,o){return(e(i)?n:r)(i,t(o,3))}}function Wf(){if(fu)return au;fu=1;var n=function(){if(uu)return ou;uu=1;var n=Object.prototype.hasOwnProperty;return ou=function(r,t){return null!=r&&n.call(r,t)}}(),r=Bf();return au=function(t,e){return null!=t&&r(t,e,n)}}function Jf(){if(su)return cu;su=1;var n=Nt(),r=oi(),t=Or(),e=Ir(),i=Ot(),o=Gr(),u=jt(),a=Et(),f=Object.prototype.hasOwnProperty;return cu=function(c){if(null==c)return!0;if(i(c)&&(e(c)||"string"==typeof c||"function"==typeof c.splice||o(c)||a(c)||t(c)))return!c.length;var s=r(c);if("[object Map]"==s||"[object Set]"==s)return!c.size;if(u(c))return!n(c).length;for(var d in c)if(f.call(c,d))return!1;return!0}}function Kf(){if(hu)return du;return hu=1,du=function(n){return void 0===n}}function Qf(){if(lu)return vu;lu=1;var n=yf(),r=Ot();return vu=function(t,e){var i=-1,o=r(t)?Array(t.length):[];return n(t,(function(n,r,t){o[++i]=e(n,r,t)})),o}}function Zf(){if(gu)return pu;gu=1;var n=Tf(),r=qf(),t=Qf(),e=Ir();return pu=function(i,o){return(e(i)?n:t)(i,r(o,3))}}function Hf(){if(Eu)return _u;Eu=1;var n=bu?yu:(bu=1,yu=function(n,r,t,e){var i=-1,o=null==n?0:n.length;for(e&&o&&(t=n[++i]);++i<o;)t=r(t,n[i],i,n);return t}),r=yf(),t=qf(),e=wu?mu:(wu=1,mu=function(n,r,t,e,i){return i(n,(function(n,i,o){t=e?(e=!1,n):r(t,n,i,o)})),t}),i=Ir();return _u=function(o,u,a){var f=i(o)?n:e,c=arguments.length<3;return f(o,t(u,4),a,c,r)},_u}function Xf(){if(Mu)return Cu;Mu=1;var n=function(){if(Nu)return ku;Nu=1;var n=Vf()("length");return ku=n}(),r=function(){if(Iu)return Ou;Iu=1;var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");return Ou=function(r){return n.test(r)}}(),t=function(){if(Au)return Lu;Au=1;var n="\\ud800-\\udfff",r="["+n+"]",t="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",e="\\ud83c[\\udffb-\\udfff]",i="[^"+n+"]",o="(?:\\ud83c[\\udde6-\\uddff]){2}",u="[\\ud800-\\udbff][\\udc00-\\udfff]",a="(?:"+t+"|"+e+")?",f="[\\ufe0e\\ufe0f]?",c=f+a+"(?:\\u200d(?:"+[i,o,u].join("|")+")"+f+a+")*",s="(?:"+[i+t+"?",t,o,u,r].join("|")+")",d=RegExp(e+"(?="+e+")|"+s+c,"g");return Lu=function(n){for(var r=d.lastIndex=0;d.test(n);)++r;return r}}();return Cu=function(e){return r(e)?t(e):n(e)}}function nc(){if(Su)return Pu;Su=1;var n=Nt(),r=oi(),t=Ot(),e=function(){if(ju)return xu;ju=1;var n=cr(),r=Ir(),t=Nr();return xu=function(e){return"string"==typeof e||!r(e)&&t(e)&&"[object String]"==n(e)}}(),i=Xf();return Pu=function(o){if(null==o)return 0;if(t(o))return e(o)?i(o):o.length;var u=r(o);return"[object Map]"==u||"[object Set]"==u?o.size:n(o).length}}function rc(){if(Ru)return Tu;Ru=1;var n=_r(),r=si(),t=gf(),e=qf(),i=ni(),o=Ir(),u=Gr(),a=dr(),f=sr(),c=Et();return Tu=function(s,d,h){var v=o(s),l=v||u(s)||c(s);if(d=e(d,4),null==h){var p=s&&s.constructor;h=l?v?new p:[]:f(s)&&a(p)?r(i(s)):{}}return(l?n:t)(s,(function(n,r,t){return d(h,n,r,t)})),h}}function tc(){if(Bu)return Du;Bu=1;var n=Xe(),r=function(){if(zu)return Fu;zu=1;var n=fr(),r=Or(),t=Ir(),e=n?n.isConcatSpreadable:void 0;return Fu=function(n){return t(n)||r(n)||!!(e&&n&&n[e])}}();return Du=function t(e,i,o,u,a){var f=-1,c=e.length;for(o||(o=r),a||(a=[]);++f<c;){var s=e[f];i>0&&o(s)?i>1?t(s,i-1,o,u,a):n(a,s):u||(a[a.length]=s)}return a},Du}function ec(){if($u)return Vu;$u=1;var n=Gu?Uu:(Gu=1,Uu=function(n,r,t){switch(t.length){case 0:return n.call(r);case 1:return n.call(r,t[0]);case 2:return n.call(r,t[0],t[1]);case 3:return n.call(r,t[0],t[1],t[2])}return n.apply(r,t)}),r=Math.max;return Vu=function(t,e,i){return e=r(void 0===e?t.length-1:e,0),function(){for(var o=arguments,u=-1,a=r(o.length-e,0),f=Array(a);++u<a;)f[u]=o[e+u];u=-1;for(var c=Array(e+1);++u<e;)c[u]=o[u];return c[e]=i(f),n(t,this,c)}},Vu}function ic(){if(Qu)return Ku;Qu=1;var n=function(){if(Yu)return qu;Yu=1;var n=gi(),r=Er(),t=bf();return qu=r?function(t,e){return r(t,"toString",{configurable:!0,enumerable:!1,value:n(e),writable:!0})}:t}(),r=function(){if(Ju)return Wu;Ju=1;var n=Date.now;return Wu=function(r){var t=0,e=0;return function(){var i=n(),o=16-(i-e);if(e=i,o>0){if(++t>=800)return arguments[0]}else t=0;return r.apply(void 0,arguments)}},Wu}(),t=r(n);return Ku=t}function oc(){if(Hu)return Zu;Hu=1;var n=bf(),r=ec(),t=ic();return Zu=function(e,i){return t(r(e,i,n),e+"")}}function uc(){if(na)return Xu;return na=1,Xu=function(n,r,t,e){for(var i=n.length,o=t+(e?1:-1);e?o--:++o<i;)if(r(n[o],o,n))return o;return-1}}function ac(){if(ua)return oa;ua=1;var n=uc(),r=ta?ra:(ta=1,ra=function(n){return n!=n}),t=ia?ea:(ia=1,ea=function(n,r,t){for(var e=t-1,i=n.length;++e<i;)if(n[e]===r)return e;return-1});return oa=function(e,i,o){return i==i?t(e,i,o):n(e,r,o)}}function fc(){if(la)return va;la=1;var n=ii(),r=ha?da:(ha=1,da=function(){}),t=kf(),e=n&&1/t(new n([,-0]))[1]==1/0?function(r){return new n(r)}:r;return va=e}function cc(){if(ga)return pa;ga=1;var n=Ef(),r=function(){if(fa)return aa;fa=1;var n=ac();return aa=function(r,t){return!(null==r||!r.length)&&n(r,t,0)>-1}}(),t=sa?ca:(sa=1,ca=function(n,r,t){for(var e=-1,i=null==n?0:n.length;++e<i;)if(t(r,n[e]))return!0;return!1}),e=xf(),i=fc(),o=kf();return pa=function(u,a,f){var c=-1,s=r,d=u.length,h=!0,v=[],l=v;if(f)h=!1,s=t;else if(d>=200){var p=a?null:i(u);if(p)return o(p);h=!1,s=e,l=new n}else l=a?[]:v;n:for(;++c<d;){var g=u[c],y=a?a(g):g;if(g=f||0!==g?g:0,h&&y==y){for(var b=l.length;b--;)if(l[b]===y)continue n;a&&l.push(y),v.push(g)}else s(l,y,f)||(l!==v&&l.push(y),v.push(g))}return v}}function sc(){if(ba)return ya;ba=1;var n=Ot(),r=Nr();return ya=function(t){return r(t)&&n(t)}}function dc(){if(wa)return ma;wa=1;var n=tc(),r=oc(),t=cc(),e=sc(),i=r((function(r){return t(n(r,1,e,!0))}));return ma=i}function hc(){if(ja)return xa;ja=1;var n=function(){if(Ea)return _a;Ea=1;var n=Tf();return _a=function(r,t){return n(t,(function(n){return r[n]}))}}(),r=It();return xa=function(t){return null==t?[]:n(t,r(t))}}function vc(){if(Na)return ka;var n;Na=1;try{n={clone:pi(),constant:gi(),each:_f(),filter:Yf(),has:Wf(),isArray:Ir(),isEmpty:Jf(),isFunction:dr(),isUndefined:Kf(),keys:It(),map:Zf(),reduce:Hf(),size:nc(),transform:rc(),union:dc(),values:hc()}}catch(n){}return n||(n=window._),ka=n}function lc(){if(Ia)return Oa;Ia=1;var n=vc();Oa=i;var r="\0",t="\0",e="";function i(r){this._isDirected=!n.has(r,"directed")||r.directed,this._isMultigraph=!!n.has(r,"multigraph")&&r.multigraph,this._isCompound=!!n.has(r,"compound")&&r.compound,this._label=void 0,this._defaultNodeLabelFn=n.constant(void 0),this._defaultEdgeLabelFn=n.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[t]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function o(n,r){n[r]?n[r]++:n[r]=1}function u(n,r){--n[r]||delete n[r]}function a(t,i,o,u){var a=""+i,f=""+o;if(!t&&a>f){var c=a;a=f,f=c}return a+e+f+e+(n.isUndefined(u)?r:u)}function f(n,r){return a(n,r.v,r.w,r.name)}return i.prototype._nodeCount=0,i.prototype._edgeCount=0,i.prototype.isDirected=function(){return this._isDirected},i.prototype.isMultigraph=function(){return this._isMultigraph},i.prototype.isCompound=function(){return this._isCompound},i.prototype.setGraph=function(n){return this._label=n,this},i.prototype.graph=function(){return this._label},i.prototype.setDefaultNodeLabel=function(r){return n.isFunction(r)||(r=n.constant(r)),this._defaultNodeLabelFn=r,this},i.prototype.nodeCount=function(){return this._nodeCount},i.prototype.nodes=function(){return n.keys(this._nodes)},i.prototype.sources=function(){var r=this;return n.filter(this.nodes(),(function(t){return n.isEmpty(r._in[t])}))},i.prototype.sinks=function(){var r=this;return n.filter(this.nodes(),(function(t){return n.isEmpty(r._out[t])}))},i.prototype.setNodes=function(r,t){var e=arguments,i=this;return n.each(r,(function(n){e.length>1?i.setNode(n,t):i.setNode(n)})),this},i.prototype.setNode=function(r,e){return n.has(this._nodes,r)?(arguments.length>1&&(this._nodes[r]=e),this):(this._nodes[r]=arguments.length>1?e:this._defaultNodeLabelFn(r),this._isCompound&&(this._parent[r]=t,this._children[r]={},this._children[t][r]=!0),this._in[r]={},this._preds[r]={},this._out[r]={},this._sucs[r]={},++this._nodeCount,this)},i.prototype.node=function(n){return this._nodes[n]},i.prototype.hasNode=function(r){return n.has(this._nodes,r)},i.prototype.removeNode=function(r){var t=this;if(n.has(this._nodes,r)){var e=function(n){t.removeEdge(t._edgeObjs[n])};delete this._nodes[r],this._isCompound&&(this._removeFromParentsChildList(r),delete this._parent[r],n.each(this.children(r),(function(n){t.setParent(n)})),delete this._children[r]),n.each(n.keys(this._in[r]),e),delete this._in[r],delete this._preds[r],n.each(n.keys(this._out[r]),e),delete this._out[r],delete this._sucs[r],--this._nodeCount}return this},i.prototype.setParent=function(r,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(n.isUndefined(e))e=t;else{for(var i=e+="";!n.isUndefined(i);i=this.parent(i))if(i===r)throw new Error("Setting "+e+" as parent of "+r+" would create a cycle");this.setNode(e)}return this.setNode(r),this._removeFromParentsChildList(r),this._parent[r]=e,this._children[e][r]=!0,this},i.prototype._removeFromParentsChildList=function(n){delete this._children[this._parent[n]][n]},i.prototype.parent=function(n){if(this._isCompound){var r=this._parent[n];if(r!==t)return r}},i.prototype.children=function(r){if(n.isUndefined(r)&&(r=t),this._isCompound){var e=this._children[r];if(e)return n.keys(e)}else{if(r===t)return this.nodes();if(this.hasNode(r))return[]}},i.prototype.predecessors=function(r){var t=this._preds[r];if(t)return n.keys(t)},i.prototype.successors=function(r){var t=this._sucs[r];if(t)return n.keys(t)},i.prototype.neighbors=function(r){var t=this.predecessors(r);if(t)return n.union(t,this.successors(r))},i.prototype.isLeaf=function(n){return 0===(this.isDirected()?this.successors(n):this.neighbors(n)).length},i.prototype.filterNodes=function(r){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var e=this;n.each(this._nodes,(function(n,e){r(e)&&t.setNode(e,n)})),n.each(this._edgeObjs,(function(n){t.hasNode(n.v)&&t.hasNode(n.w)&&t.setEdge(n,e.edge(n))}));var i={};function o(n){var r=e.parent(n);return void 0===r||t.hasNode(r)?(i[n]=r,r):r in i?i[r]:o(r)}return this._isCompound&&n.each(t.nodes(),(function(n){t.setParent(n,o(n))})),t},i.prototype.setDefaultEdgeLabel=function(r){return n.isFunction(r)||(r=n.constant(r)),this._defaultEdgeLabelFn=r,this},i.prototype.edgeCount=function(){return this._edgeCount},i.prototype.edges=function(){return n.values(this._edgeObjs)},i.prototype.setPath=function(r,t){var e=this,i=arguments;return n.reduce(r,(function(n,r){return i.length>1?e.setEdge(n,r,t):e.setEdge(n,r),r})),this},i.prototype.setEdge=function(){var r,t,e,i,u=!1,f=arguments[0];"object"==typeof f&&null!==f&&"v"in f?(r=f.v,t=f.w,e=f.name,2===arguments.length&&(i=arguments[1],u=!0)):(r=f,t=arguments[1],e=arguments[3],arguments.length>2&&(i=arguments[2],u=!0)),r=""+r,t=""+t,n.isUndefined(e)||(e=""+e);var c=a(this._isDirected,r,t,e);if(n.has(this._edgeLabels,c))return u&&(this._edgeLabels[c]=i),this;if(!n.isUndefined(e)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(r),this.setNode(t),this._edgeLabels[c]=u?i:this._defaultEdgeLabelFn(r,t,e);var s=function(n,r,t,e){var i=""+r,o=""+t;if(!n&&i>o){var u=i;i=o,o=u}var a={v:i,w:o};e&&(a.name=e);return a}(this._isDirected,r,t,e);return r=s.v,t=s.w,Object.freeze(s),this._edgeObjs[c]=s,o(this._preds[t],r),o(this._sucs[r],t),this._in[t][c]=s,this._out[r][c]=s,this._edgeCount++,this},i.prototype.edge=function(n,r,t){var e=1===arguments.length?f(this._isDirected,arguments[0]):a(this._isDirected,n,r,t);return this._edgeLabels[e]},i.prototype.hasEdge=function(r,t,e){var i=1===arguments.length?f(this._isDirected,arguments[0]):a(this._isDirected,r,t,e);return n.has(this._edgeLabels,i)},i.prototype.removeEdge=function(n,r,t){var e=1===arguments.length?f(this._isDirected,arguments[0]):a(this._isDirected,n,r,t),i=this._edgeObjs[e];return i&&(n=i.v,r=i.w,delete this._edgeLabels[e],delete this._edgeObjs[e],u(this._preds[r],n),u(this._sucs[n],r),delete this._in[r][e],delete this._out[n][e],this._edgeCount--),this},i.prototype.inEdges=function(r,t){var e=this._in[r];if(e){var i=n.values(e);return t?n.filter(i,(function(n){return n.v===t})):i}},i.prototype.outEdges=function(r,t){var e=this._out[r];if(e){var i=n.values(e);return t?n.filter(i,(function(n){return n.w===t})):i}},i.prototype.nodeEdges=function(n,r){var t=this.inEdges(n,r);if(t)return t.concat(this.outEdges(n,r))},Oa}function pc(){return Ma?Ca:(Ma=1,Ca={Graph:lc(),version:Aa?La:(Aa=1,La="2.1.8")})}function gc(){if(Sa)return Pa;Sa=1;var n=vc(),r=lc();function t(r){return n.map(r.nodes(),(function(t){var e=r.node(t),i=r.parent(t),o={v:t};return n.isUndefined(e)||(o.value=e),n.isUndefined(i)||(o.parent=i),o}))}function e(r){return n.map(r.edges(),(function(t){var e=r.edge(t),i={v:t.v,w:t.w};return n.isUndefined(t.name)||(i.name=t.name),n.isUndefined(e)||(i.value=e),i}))}return Pa={write:function(r){var i={options:{directed:r.isDirected(),multigraph:r.isMultigraph(),compound:r.isCompound()},nodes:t(r),edges:e(r)};n.isUndefined(r.graph())||(i.value=n.clone(r.graph()));return i},read:function(t){var e=new r(t.options).setGraph(t.value);return n.each(t.nodes,(function(n){e.setNode(n.v,n.value),n.parent&&e.setParent(n.v,n.parent)})),n.each(t.edges,(function(n){e.setEdge({v:n.v,w:n.w,name:n.name},n.value)})),e}}}function yc(){if(Ra)return Ta;Ra=1;var n=vc();return Ta=function(r){var t,e={},i=[];function o(i){n.has(e,i)||(e[i]=!0,t.push(i),n.each(r.successors(i),o),n.each(r.predecessors(i),o))}return n.each(r.nodes(),(function(n){t=[],o(n),t.length&&i.push(t)})),i},Ta}function bc(){if(za)return Fa;za=1;var n=vc();function r(){this._arr=[],this._keyIndices={}}return Fa=r,r.prototype.size=function(){return this._arr.length},r.prototype.keys=function(){return this._arr.map((function(n){return n.key}))},r.prototype.has=function(r){return n.has(this._keyIndices,r)},r.prototype.priority=function(n){var r=this._keyIndices[n];if(void 0!==r)return this._arr[r].priority},r.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},r.prototype.add=function(r,t){var e=this._keyIndices;if(r=String(r),!n.has(e,r)){var i=this._arr,o=i.length;return e[r]=o,i.push({key:r,priority:t}),this._decrease(o),!0}return!1},r.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key},r.prototype.decrease=function(n,r){var t=this._keyIndices[n];if(r>this._arr[t].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[t].priority+" New: "+r);this._arr[t].priority=r,this._decrease(t)},r.prototype._heapify=function(n){var r=this._arr,t=2*n,e=t+1,i=n;t<r.length&&(i=r[t].priority<r[i].priority?t:i,e<r.length&&(i=r[e].priority<r[i].priority?e:i),i!==n&&(this._swap(n,i),this._heapify(i)))},r.prototype._decrease=function(n){for(var r,t=this._arr,e=t[n].priority;0!==n&&!(t[r=n>>1].priority<e);)this._swap(n,r),n=r},r.prototype._swap=function(n,r){var t=this._arr,e=this._keyIndices,i=t[n],o=t[r];t[n]=o,t[r]=i,e[o.key]=n,e[i.key]=r},Fa}function mc(){if(Ba)return Da;Ba=1;var n=vc(),r=bc();Da=function(n,e,i,o){return function(n,t,e,i){var o,u,a={},f=new r,c=function(n){var r=n.v!==o?n.v:n.w,t=a[r],i=e(n),c=u.distance+i;if(i<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+n+" Weight: "+i);c<t.distance&&(t.distance=c,t.predecessor=o,f.decrease(r,c))};n.nodes().forEach((function(n){var r=n===t?0:Number.POSITIVE_INFINITY;a[n]={distance:r},f.add(n,r)}));for(;f.size()>0&&(o=f.removeMin(),(u=a[o]).distance!==Number.POSITIVE_INFINITY);)i(o).forEach(c);return a}(n,String(e),i||t,o||function(r){return n.outEdges(r)})};var t=n.constant(1);return Da}function wc(){if(Ga)return Ua;Ga=1;var n=mc(),r=vc();return Ua=function(t,e,i){return r.transform(t.nodes(),(function(r,o){r[o]=n(t,o,e,i)}),{})}}function _c(){if($a)return Va;$a=1;var n=vc();return Va=function(r){var t=0,e=[],i={},o=[];function u(a){var f=i[a]={onStack:!0,lowlink:t,index:t++};if(e.push(a),r.successors(a).forEach((function(r){n.has(i,r)?i[r].onStack&&(f.lowlink=Math.min(f.lowlink,i[r].index)):(u(r),f.lowlink=Math.min(f.lowlink,i[r].lowlink))})),f.lowlink===f.index){var c,s=[];do{c=e.pop(),i[c].onStack=!1,s.push(c)}while(a!==c);o.push(s)}}return r.nodes().forEach((function(r){n.has(i,r)||u(r)})),o},Va}function Ec(){if(Ya)return qa;Ya=1;var n=vc(),r=_c();return qa=function(t){return n.filter(r(t),(function(n){return n.length>1||1===n.length&&t.hasEdge(n[0],n[0])}))}}function xc(){if(Ja)return Wa;Ja=1;var n=vc();Wa=function(n,t,e){return function(n,r,t){var e={},i=n.nodes();return i.forEach((function(n){e[n]={},e[n][n]={distance:0},i.forEach((function(r){n!==r&&(e[n][r]={distance:Number.POSITIVE_INFINITY})})),t(n).forEach((function(t){var i=t.v===n?t.w:t.v,o=r(t);e[n][i]={distance:o,predecessor:n}}))})),i.forEach((function(n){var r=e[n];i.forEach((function(t){var o=e[t];i.forEach((function(t){var e=o[n],i=r[t],u=o[t],a=e.distance+i.distance;a<u.distance&&(u.distance=a,u.predecessor=i.predecessor)}))}))})),e}(n,t||r,e||function(r){return n.outEdges(r)})};var r=n.constant(1);return Wa}function jc(){if(Qa)return Ka;Qa=1;var n=vc();function r(r){var e={},i={},o=[];if(n.each(r.sinks(),(function u(a){if(n.has(i,a))throw new t;n.has(e,a)||(i[a]=!0,e[a]=!0,n.each(r.predecessors(a),u),delete i[a],o.push(a))})),n.size(e)!==r.nodeCount())throw new t;return o}function t(){}return Ka=r,r.CycleException=t,t.prototype=new Error,Ka}function kc(){if(Ha)return Za;Ha=1;var n=jc();return Za=function(r){try{n(r)}catch(r){if(r instanceof n.CycleException)return!1;throw r}return!0}}function Nc(){if(nf)return Xa;nf=1;var n=vc();function r(t,e,i,o,u,a){n.has(o,e)||(o[e]=!0,i||a.push(e),n.each(u(e),(function(n){r(t,n,i,o,u,a)})),i&&a.push(e))}return Xa=function(t,e,i){n.isArray(e)||(e=[e]);var o=(t.isDirected()?t.successors:t.neighbors).bind(t),u=[],a={};return n.each(e,(function(n){if(!t.hasNode(n))throw new Error("Graph does not have node: "+n);r(t,n,"post"===i,a,o,u)})),u},Xa}function Oc(){if(tf)return rf;tf=1;var n=Nc();return rf=function(r,t){return n(r,t,"post")}}function Ic(){if(of)return ef;of=1;var n=Nc();return ef=function(r,t){return n(r,t,"pre")}}function Lc(){if(af)return uf;af=1;var n=vc(),r=lc(),t=bc();return uf=function(e,i){var o,u=new r,a={},f=new t;function c(n){var r=n.v===o?n.w:n.v,t=f.priority(r);if(void 0!==t){var e=i(n);e<t&&(a[r]=o,f.decrease(r,e))}}if(0===e.nodeCount())return u;n.each(e.nodes(),(function(n){f.add(n,Number.POSITIVE_INFINITY),u.setNode(n)})),f.decrease(e.nodes()[0],0);var s=!1;for(;f.size()>0;){if(o=f.removeMin(),n.has(a,o))u.setEdge(o,a[o]);else{if(s)throw new Error("Input graph is not connected: "+e);s=!0}e.nodeEdges(o).forEach(c)}return u}}try{hf=function(){if(df)return sf;df=1;var n=pc();return sf={Graph:n.Graph,json:gc(),alg:cf?ff:(cf=1,ff={components:yc(),dijkstra:mc(),dijkstraAll:wc(),findCycles:Ec(),floydWarshall:xc(),isAcyclic:kc(),postorder:Oc(),preorder:Ic(),prim:Lc(),tarjan:_c(),topsort:jc()}),version:n.version}}()}catch(n){}hf||(hf=window.graphlib);var Ac,Cc,Mc,Pc,Sc,Tc,Rc,Fc,zc,Dc,Bc,Uc,Gc,Vc,$c,qc,Yc,Wc,Jc,Kc,Qc,Zc,Hc,Xc,ns,rs,ts,es,is,os,us,as,fs,cs,ss,ds,hs,vs,ls,ps,gs,ys,bs,ms,ws,_s,Es,xs,js,ks,Ns,Os,Is,Ls,As,Cs,Ms,Ps,Ss,Ts,Rs,Fs,zs,Ds,Bs,Us,Gs,Vs,$s,qs,Ys,Ws,Js,Ks,Qs,Zs,Hs,Xs,nd,rd,td,ed,id,od,ud,ad,fd,cd,sd,dd,hd,vd,ld,pd=hf;function gd(){if(Pc)return Mc;Pc=1;var n=er(),r=Ot(),t=Vr(),e=sr();return Mc=function(i,o,u){if(!e(u))return!1;var a=typeof o;return!!("number"==a?r(u)&&t(o,u.length):"string"==a&&o in u)&&n(u[o],i)}}function yd(){if(Uc)return Bc;Uc=1;var n=function(){if(Dc)return zc;Dc=1;var n=/\s/;return zc=function(r){for(var t=r.length;t--&&n.test(r.charAt(t)););return t}}(),r=/^\s+/;return Bc=function(t){return t?t.slice(0,n(t)+1).replace(r,""):t}}function bd(){if(qc)return $c;qc=1;var n=function(){if(Vc)return Gc;Vc=1;var n=yd(),r=sr(),t=Mf(),e=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,u=parseInt;return Gc=function(a){if("number"==typeof a)return a;if(t(a))return NaN;if(r(a)){var f="function"==typeof a.valueOf?a.valueOf():a;a=r(f)?f+"":f}if("string"!=typeof a)return 0===a?a:+a;a=n(a);var c=i.test(a);return c||o.test(a)?u(a.slice(2),c?2:8):e.test(a)?NaN:+a}}(),r=1/0;return $c=function(t){return t?(t=n(t))===r||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}}function md(){if(Kc)return Jc;Kc=1;var n=uc(),r=qf(),t=function(){if(Wc)return Yc;Wc=1;var n=bd();return Yc=function(r){var t=n(r),e=t%1;return t==t?e?t-e:t:0}}(),e=Math.max;return Jc=function(i,o,u){var a=null==i?0:i.length;if(!a)return-1;var f=null==u?0:t(u);return f<0&&(f=e(a+f,0)),n(i,r(o,3),f)}}function wd(){if(Xc)return Hc;Xc=1;var n=tc();return Hc=function(r){return(null==r?0:r.length)?n(r,1):[]}}function _d(){if(as)return us;as=1;var n=Mf();return us=function(r,t,e){for(var i=-1,o=r.length;++i<o;){var u=r[i],a=t(u);if(null!=a&&(void 0===f?a==a&&!n(a):e(a,f)))var f=a,c=u}return c}}function Ed(){if(vs)return hs;vs=1;var n=xr(),r=er();return hs=function(t,e,i){(void 0!==i&&!r(t[e],i)||void 0===i&&!(e in t))&&n(t,e,i)}}function xd(){if(ys)return gs;return ys=1,gs=function(n,r){if(("constructor"!==r||"function"!=typeof n[r])&&"__proto__"!=r)return n[r]}}function jd(){if(_s)return ws;_s=1;var n=Ed(),r=Je(),t=fi(),e=Ke(),i=di(),o=Or(),u=Ir(),a=sc(),f=Gr(),c=dr(),s=sr(),d=function(){if(ps)return ls;ps=1;var n=cr(),r=ni(),t=Nr(),e=Function.prototype,i=Object.prototype,o=e.toString,u=i.hasOwnProperty,a=o.call(Object);return ls=function(e){if(!t(e)||"[object Object]"!=n(e))return!1;var i=r(e);if(null===i)return!0;var f=u.call(i,"constructor")&&i.constructor;return"function"==typeof f&&f instanceof f&&o.call(f)==a}}(),h=Et(),v=xd(),l=function(){if(ms)return bs;ms=1;var n=kr(),r=At();return bs=function(t){return n(t,r(t))}}();return ws=function(p,g,y,b,m,w,_){var E=v(p,y),x=v(g,y),j=_.get(x);if(j)n(p,y,j);else{var k=w?w(E,x,y+"",p,g,_):void 0,N=void 0===k;if(N){var O=u(x),I=!O&&f(x),L=!O&&!I&&h(x);k=x,O||I||L?u(E)?k=E:a(E)?k=e(E):I?(N=!1,k=r(x,!0)):L?(N=!1,k=t(x,!0)):k=[]:d(x)||o(x)?(k=E,o(E)?k=l(E):s(E)&&!c(E)||(k=i(x))):N=!1}N&&(_.set(x,k),m(k,x,b,w,_),_.delete(x)),n(p,y,k)}}}function kd(){if(Ls)return Is;return Ls=1,Is=function(n,r){return n<r}}function Nd(){if(Ds)return zs;Ds=1;var n=Df(),r=function(){if(Fs)return Rs;Fs=1;var n=jr(),r=Ff(),t=Vr(),e=sr(),i=zf();return Rs=function(o,u,a,f){if(!e(o))return o;for(var c=-1,s=(u=r(u,o)).length,d=s-1,h=o;null!=h&&++c<s;){var v=i(u[c]),l=a;if("__proto__"===v||"constructor"===v||"prototype"===v)return o;if(c!=d){var p=h[v];void 0===(l=f?f(p,v,h):void 0)&&(l=e(p)?p:t(u[c+1])?[]:{})}n(h,v,l),h=h[v]}return o}}(),t=Ff();return zs=function(e,i,o){for(var u=-1,a=i.length,f={};++u<a;){var c=i[u],s=n(e,c);o(s,c)&&r(f,t(c,e),s)}return f}}function Od(){if(Ks)return Js;Ks=1;var n=function(){if(Ws)return Ys;Ws=1;var n=Math.ceil,r=Math.max;return Ys=function(t,e,i,o){for(var u=-1,a=r(n((e-t)/(i||1)),0),f=Array(a);a--;)f[o?a:++u]=t,t+=i;return f}}(),r=gd(),t=bd();return Js=function(e){return function(i,o,u){return u&&"number"!=typeof u&&r(i,o,u)&&(o=u=void 0),i=t(i),void 0===o?(o=i,i=0):o=t(o),u=void 0===u?i<o?1:-1:t(u),n(i,o,u,e)}}}function Id(){if(ed)return td;ed=1;var n=function(){if(rd)return nd;rd=1;var n=Mf();return nd=function(r,t){if(r!==t){var e=void 0!==r,i=null===r,o=r==r,u=n(r),a=void 0!==t,f=null===t,c=t==t,s=n(t);if(!f&&!s&&!u&&r>t||u&&a&&c&&!f&&!s||i&&a&&c||!e&&c||!o)return 1;if(!i&&!u&&!s&&r<t||s&&e&&o&&!i&&!u||f&&e&&o||!a&&o||!c)return-1}return 0}}();return td=function(r,t,e){for(var i=-1,o=r.criteria,u=t.criteria,a=o.length,f=e.length;++i<a;){var c=n(o[i],u[i]);if(c)return i>=f?c:c*("desc"==e[i]?-1:1)}return r.index-t.index}}function Ld(){if(od)return id;od=1;var n=Tf(),r=Df(),t=qf(),e=Qf(),i=Xs?Hs:(Xs=1,Hs=function(n,r){var t=n.length;for(n.sort(r);t--;)n[t]=n[t].value;return n}),o=qr(),u=Id(),a=bf(),f=Ir();return id=function(c,s,d){s=s.length?n(s,(function(n){return f(n)?function(t){return r(t,1===n.length?n[0]:n)}:n})):[a];var h=-1;s=n(s,o(t));var v=e(c,(function(r,t,e){return{criteria:n(s,(function(n){return n(r)})),index:++h,value:r}}));return i(v,(function(n,r){return u(n,r,d)}))}}try{ld={cloneDeep:function(){if(Cc)return Ac;Cc=1;var n=li();return Ac=function(r){return n(r,5)}}(),constant:gi(),defaults:function(){if(Tc)return Sc;Tc=1;var n=oc(),r=er(),t=gd(),e=At(),i=Object.prototype,o=i.hasOwnProperty,u=n((function(n,u){n=Object(n);var a=-1,f=u.length,c=f>2?u[2]:void 0;for(c&&t(u[0],u[1],c)&&(f=1);++a<f;)for(var s=u[a],d=e(s),h=-1,v=d.length;++h<v;){var l=d[h],p=n[l];(void 0===p||r(p,i[l])&&!o.call(n,l))&&(n[l]=s[l])}return n}));return Sc=u}(),each:_f(),filter:Yf(),find:function(){if(Zc)return Qc;Zc=1;var n=function(){if(Fc)return Rc;Fc=1;var n=qf(),r=Ot(),t=It();return Rc=function(e){return function(i,o,u){var a=Object(i);if(!r(i)){var f=n(o,3);i=t(i),o=function(n){return f(a[n],n,a)}}var c=e(i,o,u);return c>-1?a[f?i[c]:c]:void 0}}}()(md());return Qc=n}(),flatten:wd(),forEach:wf(),forIn:function(){if(rs)return ns;rs=1;var n=pf(),r=mf(),t=At();return ns=function(e,i){return null==e?e:n(e,r(i),t)}}(),has:Wf(),isUndefined:Kf(),last:es?ts:(es=1,ts=function(n){var r=null==n?0:n.length;return r?n[r-1]:void 0}),map:Zf(),mapValues:function(){if(os)return is;os=1;var n=xr(),r=gf(),t=qf();return is=function(e,i){var o={};return i=t(i,3),r(e,(function(r,t,e){n(o,t,i(r,t,e))})),o}}(),max:function(){if(ds)return ss;ds=1;var n=_d(),r=cs?fs:(cs=1,fs=function(n,r){return n>r}),t=bf();return ss=function(e){return e&&e.length?n(e,t,r):void 0}}(),merge:function(){if(Os)return Ns;Os=1;var n=function(){if(xs)return Es;xs=1;var n=wr(),r=Ed(),t=pf(),e=jd(),i=sr(),o=At(),u=xd();return Es=function a(f,c,s,d,h){f!==c&&t(c,(function(t,o){if(h||(h=new n),i(t))e(f,c,o,s,a,d,h);else{var v=d?d(u(f,o),t,o+"",f,c,h):void 0;void 0===v&&(v=t),r(f,o,v)}}),o)},Es}(),r=function(){if(ks)return js;ks=1;var n=oc(),r=gd();return js=function(t){return n((function(n,e){var i=-1,o=e.length,u=o>1?e[o-1]:void 0,a=o>2?e[2]:void 0;for(u=t.length>3&&"function"==typeof u?(o--,u):void 0,a&&r(e[0],e[1],a)&&(u=o<3?void 0:u,o=1),n=Object(n);++i<o;){var f=e[i];f&&t(n,f,i,u)}return n}))}}()((function(r,t,e){n(r,t,e)}));return Ns=r}(),min:function(){if(Cs)return As;Cs=1;var n=_d(),r=kd(),t=bf();return As=function(e){return e&&e.length?n(e,t,r):void 0}}(),minBy:function(){if(Ps)return Ms;Ps=1;var n=_d(),r=qf(),t=kd();return Ms=function(e,i){return e&&e.length?n(e,r(i,2),t):void 0}}(),now:function(){if(Ts)return Ss;Ts=1;var n=ar();return Ss=function(){return n.Date.now()}}(),pick:function(){if(qs)return $s;qs=1;var n=function(){if(Us)return Bs;Us=1;var n=Nd(),r=Uf();return Bs=function(t,e){return n(t,e,(function(n,e){return r(t,e)}))}}(),r=function(){if(Vs)return Gs;Vs=1;var n=wd(),r=ec(),t=ic();return Gs=function(e){return t(r(e,void 0,n),e+"")}}()((function(r,t){return null==r?{}:n(r,t)}));return $s=r}(),range:function(){if(Zs)return Qs;Zs=1;var n=Od()();return Qs=n}(),reduce:Hf(),sortBy:function(){if(ad)return ud;ad=1;var n=tc(),r=Ld(),t=oc(),e=gd(),i=t((function(t,i){if(null==t)return[];var o=i.length;return o>1&&e(t,i[0],i[1])?i=[]:o>2&&e(i[0],i[1],i[2])&&(i=[i[0]]),r(t,n(i,1),[])}));return ud=i}(),uniqueId:function(){if(cd)return fd;cd=1;var n=Rf(),r=0;return fd=function(t){var e=++r;return n(t)+e}}(),values:hc(),zipObject:function(){if(vd)return hd;vd=1;var n=jr(),r=dd?sd:(dd=1,sd=function(n,r,t){for(var e=-1,i=n.length,o=r.length,u={};++e<i;){var a=e<o?r[e]:void 0;t(u,n[e],a)}return u});return hd=function(t,e){return r(t||[],e||[],n)}}()}}catch(n){}ld||(ld=window._);var Ad=ld,Cd=Md;function Md(){var n={};n._next=n._prev=n,this._sentinel=n}function Pd(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function Sd(n,r){if("_next"!==n&&"_prev"!==n)return r}Md.prototype.dequeue=function(){var n=this._sentinel,r=n._prev;if(r!==n)return Pd(r),r},Md.prototype.enqueue=function(n){var r=this._sentinel;n._prev&&n._next&&Pd(n),n._next=r._next,r._next._prev=n,r._next=n,n._prev=r},Md.prototype.toString=function(){for(var n=[],r=this._sentinel,t=r._prev;t!==r;)n.push(JSON.stringify(t,Sd)),t=t._prev;return"["+n.join(", ")+"]"};var Td=Ad,Rd=pd.Graph,Fd=Cd,zd=function(n,r){if(n.nodeCount()<=1)return[];var t=function(n,r){var t=new Rd,e=0,i=0;Td.forEach(n.nodes(),(function(n){t.setNode(n,{v:n,in:0,out:0})})),Td.forEach(n.edges(),(function(n){var o=t.edge(n.v,n.w)||0,u=r(n),a=o+u;t.setEdge(n.v,n.w,a),i=Math.max(i,t.node(n.v).out+=u),e=Math.max(e,t.node(n.w).in+=u)}));var o=Td.range(i+e+3).map((function(){return new Fd})),u=e+1;return Td.forEach(t.nodes(),(function(n){Ud(o,u,t.node(n))})),{graph:t,buckets:o,zeroIdx:u}}(n,r||Dd),e=function(n,r,t){var e,i=[],o=r[r.length-1],u=r[0];for(;n.nodeCount();){for(;e=u.dequeue();)Bd(n,r,t,e);for(;e=o.dequeue();)Bd(n,r,t,e);if(n.nodeCount())for(var a=r.length-2;a>0;--a)if(e=r[a].dequeue()){i=i.concat(Bd(n,r,t,e,!0));break}}return i}(t.graph,t.buckets,t.zeroIdx);return Td.flatten(Td.map(e,(function(r){return n.outEdges(r.v,r.w)})),!0)},Dd=Td.constant(1);function Bd(n,r,t,e,i){var o=i?[]:void 0;return Td.forEach(n.inEdges(e.v),(function(e){var u=n.edge(e),a=n.node(e.v);i&&o.push({v:e.v,w:e.w}),a.out-=u,Ud(r,t,a)})),Td.forEach(n.outEdges(e.v),(function(e){var i=n.edge(e),o=e.w,u=n.node(o);u.in-=i,Ud(r,t,u)})),n.removeNode(e.v),o}function Ud(n,r,t){t.out?t.in?n[t.out-t.in+r].enqueue(t):n[n.length-1].enqueue(t):n[0].enqueue(t)}var Gd=Ad,Vd=zd,$d={run:function(n){var r="greedy"===n.graph().acyclicer?Vd(n,function(n){return function(r){return n.edge(r).weight}}(n)):function(n){var r=[],t={},e={};function i(o){Gd.has(e,o)||(e[o]=!0,t[o]=!0,Gd.forEach(n.outEdges(o),(function(n){Gd.has(t,n.w)?r.push(n):i(n.w)})),delete t[o])}return Gd.forEach(n.nodes(),i),r}(n);Gd.forEach(r,(function(r){var t=n.edge(r);n.removeEdge(r),t.forwardName=r.name,t.reversed=!0,n.setEdge(r.w,r.v,t,Gd.uniqueId("rev"))}))},undo:function(n){Gd.forEach(n.edges(),(function(r){var t=n.edge(r);if(t.reversed){n.removeEdge(r);var e=t.forwardName;delete t.reversed,delete t.forwardName,n.setEdge(r.w,r.v,t,e)}}))}};var qd=Ad,Yd=pd.Graph,Wd={addDummyNode:Jd,simplify:function(n){var r=(new Yd).setGraph(n.graph());return qd.forEach(n.nodes(),(function(t){r.setNode(t,n.node(t))})),qd.forEach(n.edges(),(function(t){var e=r.edge(t.v,t.w)||{weight:0,minlen:1},i=n.edge(t);r.setEdge(t.v,t.w,{weight:e.weight+i.weight,minlen:Math.max(e.minlen,i.minlen)})})),r},asNonCompoundGraph:function(n){var r=new Yd({multigraph:n.isMultigraph()}).setGraph(n.graph());return qd.forEach(n.nodes(),(function(t){n.children(t).length||r.setNode(t,n.node(t))})),qd.forEach(n.edges(),(function(t){r.setEdge(t,n.edge(t))})),r},successorWeights:function(n){var r=qd.map(n.nodes(),(function(r){var t={};return qd.forEach(n.outEdges(r),(function(r){t[r.w]=(t[r.w]||0)+n.edge(r).weight})),t}));return qd.zipObject(n.nodes(),r)},predecessorWeights:function(n){var r=qd.map(n.nodes(),(function(r){var t={};return qd.forEach(n.inEdges(r),(function(r){t[r.v]=(t[r.v]||0)+n.edge(r).weight})),t}));return qd.zipObject(n.nodes(),r)},intersectRect:function(n,r){var t,e,i=n.x,o=n.y,u=r.x-i,a=r.y-o,f=n.width/2,c=n.height/2;if(!u&&!a)throw new Error("Not possible to find intersection inside of the rectangle");Math.abs(a)*f>Math.abs(u)*c?(a<0&&(c=-c),t=c*u/a,e=c):(u<0&&(f=-f),t=f,e=f*a/u);return{x:i+t,y:o+e}},buildLayerMatrix:function(n){var r=qd.map(qd.range(Kd(n)+1),(function(){return[]}));return qd.forEach(n.nodes(),(function(t){var e=n.node(t),i=e.rank;qd.isUndefined(i)||(r[i][e.order]=t)})),r},normalizeRanks:function(n){var r=qd.min(qd.map(n.nodes(),(function(r){return n.node(r).rank})));qd.forEach(n.nodes(),(function(t){var e=n.node(t);qd.has(e,"rank")&&(e.rank-=r)}))},removeEmptyRanks:function(n){var r=qd.min(qd.map(n.nodes(),(function(r){return n.node(r).rank}))),t=[];qd.forEach(n.nodes(),(function(e){var i=n.node(e).rank-r;t[i]||(t[i]=[]),t[i].push(e)}));var e=0,i=n.graph().nodeRankFactor;qd.forEach(t,(function(r,t){qd.isUndefined(r)&&t%i!=0?--e:e&&qd.forEach(r,(function(r){n.node(r).rank+=e}))}))},addBorderNode:function(n,r,t,e){var i={width:0,height:0};arguments.length>=4&&(i.rank=t,i.order=e);return Jd(n,"border",i,r)},maxRank:Kd,partition:function(n,r){var t={lhs:[],rhs:[]};return qd.forEach(n,(function(n){r(n)?t.lhs.push(n):t.rhs.push(n)})),t},time:function(n,r){qd.now();try{return r()}finally{}},notime:function(n,r){return r()}};function Jd(n,r,t,e){var i;do{i=qd.uniqueId(e)}while(n.hasNode(i));return t.dummy=r,n.setNode(i,t),i}function Kd(n){return qd.max(qd.map(n.nodes(),(function(r){var t=n.node(r).rank;if(!qd.isUndefined(t))return t})))}var Qd=Ad,Zd=Wd,Hd={run:function(n){n.graph().dummyChains=[],Qd.forEach(n.edges(),(function(r){!function(n,r){var t,e,i,o=r.v,u=n.node(o).rank,a=r.w,f=n.node(a).rank,c=r.name,s=n.edge(r),d=s.labelRank;if(f===u+1)return;for(n.removeEdge(r),i=0,++u;u<f;++i,++u)s.points=[],e={width:0,height:0,edgeLabel:s,edgeObj:r,rank:u},t=Zd.addDummyNode(n,"edge",e,"_d"),u===d&&(e.width=s.width,e.height=s.height,e.dummy="edge-label",e.labelpos=s.labelpos),n.setEdge(o,t,{weight:s.weight},c),0===i&&n.graph().dummyChains.push(t),o=t;n.setEdge(o,a,{weight:s.weight},c)}(n,r)}))},undo:function(n){Qd.forEach(n.graph().dummyChains,(function(r){var t,e=n.node(r),i=e.edgeLabel;for(n.setEdge(e.edgeObj,i);e.dummy;)t=n.successors(r)[0],n.removeNode(r),i.points.push({x:e.x,y:e.y}),"edge-label"===e.dummy&&(i.x=e.x,i.y=e.y,i.width=e.width,i.height=e.height),r=t,e=n.node(r)}))}};var Xd=Ad,nh={longestPath:function(n){var r={};Xd.forEach(n.sources(),(function t(e){var i=n.node(e);if(Xd.has(r,e))return i.rank;r[e]=!0;var o=Xd.min(Xd.map(n.outEdges(e),(function(r){return t(r.w)-n.edge(r).minlen})));return o!==Number.POSITIVE_INFINITY&&null!=o||(o=0),i.rank=o}))},slack:function(n,r){return n.node(r.w).rank-n.node(r.v).rank-n.edge(r).minlen}};var rh=Ad,th=pd.Graph,eh=nh.slack,ih=function(n){var r,t,e=new th({directed:!1}),i=n.nodes()[0],o=n.nodeCount();e.setNode(i,{});for(;oh(e,n)<o;)r=uh(e,n),t=e.hasNode(r.v)?eh(n,r):-eh(n,r),ah(e,n,t);return e};function oh(n,r){return rh.forEach(n.nodes(),(function t(e){rh.forEach(r.nodeEdges(e),(function(i){var o=i.v,u=e===o?i.w:o;n.hasNode(u)||eh(r,i)||(n.setNode(u,{}),n.setEdge(e,u,{}),t(u))}))})),n.nodeCount()}function uh(n,r){return rh.minBy(r.edges(),(function(t){if(n.hasNode(t.v)!==n.hasNode(t.w))return eh(r,t)}))}function ah(n,r,t){rh.forEach(n.nodes(),(function(n){r.node(n).rank+=t}))}var fh=Ad,ch=ih,sh=nh.slack,dh=nh.longestPath,hh=pd.alg.preorder,vh=pd.alg.postorder,lh=Wd.simplify,ph=gh;function gh(n){n=lh(n),dh(n);var r,t=ch(n);for(mh(t),yh(t,n);r=_h(t);)xh(t,n,r,Eh(t,n,r))}function yh(n,r){var t=vh(n,n.nodes());t=t.slice(0,t.length-1),fh.forEach(t,(function(t){!function(n,r,t){var e=n.node(t),i=e.parent;n.edge(t,i).cutvalue=bh(n,r,t)}(n,r,t)}))}function bh(n,r,t){var e=n.node(t).parent,i=!0,o=r.edge(t,e),u=0;return o||(i=!1,o=r.edge(e,t)),u=o.weight,fh.forEach(r.nodeEdges(t),(function(o){var a,f,c=o.v===t,s=c?o.w:o.v;if(s!==e){var d=c===i,h=r.edge(o).weight;if(u+=d?h:-h,a=t,f=s,n.hasEdge(a,f)){var v=n.edge(t,s).cutvalue;u+=d?-v:v}}})),u}function mh(n,r){arguments.length<2&&(r=n.nodes()[0]),wh(n,{},1,r)}function wh(n,r,t,e,i){var o=t,u=n.node(e);return r[e]=!0,fh.forEach(n.neighbors(e),(function(i){fh.has(r,i)||(t=wh(n,r,t,i,e))})),u.low=o,u.lim=t++,i?u.parent=i:delete u.parent,t}function _h(n){return fh.find(n.edges(),(function(r){return n.edge(r).cutvalue<0}))}function Eh(n,r,t){var e=t.v,i=t.w;r.hasEdge(e,i)||(e=t.w,i=t.v);var o=n.node(e),u=n.node(i),a=o,f=!1;o.lim>u.lim&&(a=u,f=!0);var c=fh.filter(r.edges(),(function(r){return f===jh(n,n.node(r.v),a)&&f!==jh(n,n.node(r.w),a)}));return fh.minBy(c,(function(n){return sh(r,n)}))}function xh(n,r,t,e){var i=t.v,o=t.w;n.removeEdge(i,o),n.setEdge(e.v,e.w,{}),mh(n),yh(n,r),function(n,r){var t=fh.find(n.nodes(),(function(n){return!r.node(n).parent})),e=hh(n,t);e=e.slice(1),fh.forEach(e,(function(t){var e=n.node(t).parent,i=r.edge(t,e),o=!1;i||(i=r.edge(e,t),o=!0),r.node(t).rank=r.node(e).rank+(o?i.minlen:-i.minlen)}))}(n,r)}function jh(n,r,t){return t.low<=r.lim&&r.lim<=t.lim}gh.initLowLimValues=mh,gh.initCutValues=yh,gh.calcCutValue=bh,gh.leaveEdge=_h,gh.enterEdge=Eh,gh.exchangeEdges=xh;var kh=nh.longestPath,Nh=ih,Oh=ph,Ih=function(n){switch(n.graph().ranker){case"network-simplex":default:Ah(n);break;case"tight-tree":!function(n){kh(n),Nh(n)}(n);break;case"longest-path":Lh(n)}};var Lh=kh;function Ah(n){Oh(n)}var Ch=Ad,Mh=function(n){var r=function(n){var r={},t=0;function e(i){var o=t;Ch.forEach(n.children(i),e),r[i]={low:o,lim:t++}}return Ch.forEach(n.children(),e),r}(n);Ch.forEach(n.graph().dummyChains,(function(t){for(var e=n.node(t),i=e.edgeObj,o=function(n,r,t,e){var i,o,u=[],a=[],f=Math.min(r[t].low,r[e].low),c=Math.max(r[t].lim,r[e].lim);i=t;do{i=n.parent(i),u.push(i)}while(i&&(r[i].low>f||c>r[i].lim));o=i,i=e;for(;(i=n.parent(i))!==o;)a.push(i);return{path:u.concat(a.reverse()),lca:o}}(n,r,i.v,i.w),u=o.path,a=o.lca,f=0,c=u[f],s=!0;t!==i.w;){if(e=n.node(t),s){for(;(c=u[f])!==a&&n.node(c).maxRank<e.rank;)f++;c===a&&(s=!1)}if(!s){for(;f<u.length-1&&n.node(c=u[f+1]).minRank<=e.rank;)f++;c=u[f]}n.setParent(t,c),t=n.successors(t)[0]}}))};var Ph=Ad,Sh=Wd,Th={run:function(n){var r=Sh.addDummyNode(n,"root",{},"_root"),t=function(n){var r={};function t(e,i){var o=n.children(e);o&&o.length&&Ph.forEach(o,(function(n){t(n,i+1)})),r[e]=i}return Ph.forEach(n.children(),(function(n){t(n,1)})),r}(n),e=Ph.max(Ph.values(t))-1,i=2*e+1;n.graph().nestingRoot=r,Ph.forEach(n.edges(),(function(r){n.edge(r).minlen*=i}));var o=function(n){return Ph.reduce(n.edges(),(function(r,t){return r+n.edge(t).weight}),0)}(n)+1;Ph.forEach(n.children(),(function(u){Rh(n,r,i,o,e,t,u)})),n.graph().nodeRankFactor=i},cleanup:function(n){var r=n.graph();n.removeNode(r.nestingRoot),delete r.nestingRoot,Ph.forEach(n.edges(),(function(r){n.edge(r).nestingEdge&&n.removeEdge(r)}))}};function Rh(n,r,t,e,i,o,u){var a=n.children(u);if(a.length){var f=Sh.addBorderNode(n,"_bt"),c=Sh.addBorderNode(n,"_bb"),s=n.node(u);n.setParent(f,u),s.borderTop=f,n.setParent(c,u),s.borderBottom=c,Ph.forEach(a,(function(a){Rh(n,r,t,e,i,o,a);var s=n.node(a),d=s.borderTop?s.borderTop:a,h=s.borderBottom?s.borderBottom:a,v=s.borderTop?e:2*e,l=d!==h?1:i-o[u]+1;n.setEdge(f,d,{weight:v,minlen:l,nestingEdge:!0}),n.setEdge(h,c,{weight:v,minlen:l,nestingEdge:!0})})),n.parent(u)||n.setEdge(r,f,{weight:0,minlen:i+o[u]})}else u!==r&&n.setEdge(r,u,{weight:0,minlen:t})}var Fh=Ad,zh=Wd,Dh=function(n){Fh.forEach(n.children(),(function r(t){var e=n.children(t),i=n.node(t);if(e.length&&Fh.forEach(e,r),Fh.has(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var o=i.minRank,u=i.maxRank+1;o<u;++o)Bh(n,"borderLeft","_bl",t,i,o),Bh(n,"borderRight","_br",t,i,o)}}))};function Bh(n,r,t,e,i,o){var u={width:0,height:0,rank:o,borderType:r},a=i[r][o-1],f=zh.addDummyNode(n,"border",u,t);i[r][o]=f,n.setParent(f,e),a&&n.setEdge(a,f,{weight:1})}var Uh=Ad,Gh={adjust:function(n){var r=n.graph().rankdir.toLowerCase();"lr"!==r&&"rl"!==r||Vh(n)},undo:function(n){var r=n.graph().rankdir.toLowerCase();"bt"!==r&&"rl"!==r||function(n){Uh.forEach(n.nodes(),(function(r){qh(n.node(r))})),Uh.forEach(n.edges(),(function(r){var t=n.edge(r);Uh.forEach(t.points,qh),Uh.has(t,"y")&&qh(t)}))}(n);"lr"!==r&&"rl"!==r||(!function(n){Uh.forEach(n.nodes(),(function(r){Yh(n.node(r))})),Uh.forEach(n.edges(),(function(r){var t=n.edge(r);Uh.forEach(t.points,Yh),Uh.has(t,"x")&&Yh(t)}))}(n),Vh(n))}};function Vh(n){Uh.forEach(n.nodes(),(function(r){$h(n.node(r))})),Uh.forEach(n.edges(),(function(r){$h(n.edge(r))}))}function $h(n){var r=n.width;n.width=n.height,n.height=r}function qh(n){n.y=-n.y}function Yh(n){var r=n.x;n.x=n.y,n.y=r}var Wh=Ad,Jh=function(n){var r={},t=Wh.filter(n.nodes(),(function(r){return!n.children(r).length})),e=Wh.max(Wh.map(t,(function(r){return n.node(r).rank}))),i=Wh.map(Wh.range(e+1),(function(){return[]}));function o(t){if(!Wh.has(r,t)){r[t]=!0;var e=n.node(t);i[e.rank].push(t),Wh.forEach(n.successors(t),o)}}var u=Wh.sortBy(t,(function(r){return n.node(r).rank}));return Wh.forEach(u,o),i};var Kh=Ad,Qh=function(n,r){for(var t=0,e=1;e<r.length;++e)t+=Zh(n,r[e-1],r[e]);return t};function Zh(n,r,t){for(var e=Kh.zipObject(t,Kh.map(t,(function(n,r){return r}))),i=Kh.flatten(Kh.map(r,(function(r){return Kh.sortBy(Kh.map(n.outEdges(r),(function(r){return{pos:e[r.w],weight:n.edge(r).weight}})),"pos")})),!0),o=1;o<t.length;)o<<=1;var u=2*o-1;o-=1;var a=Kh.map(new Array(u),(function(){return 0})),f=0;return Kh.forEach(i.forEach((function(n){var r=n.pos+o;a[r]+=n.weight;for(var t=0;r>0;)r%2&&(t+=a[r+1]),a[r=r-1>>1]+=n.weight;f+=n.weight*t}))),f}var Hh=Ad;var Xh=Ad;var nv=Ad,rv=Wd;function tv(n,r,t){for(var e;r.length&&(e=nv.last(r)).i<=t;)r.pop(),n.push(e.vs),t++;return t}var ev=Ad,iv=function(n,r){return Hh.map(r,(function(r){var t=n.inEdges(r);if(t.length){var e=Hh.reduce(t,(function(r,t){var e=n.edge(t),i=n.node(t.v);return{sum:r.sum+e.weight*i.order,weight:r.weight+e.weight}}),{sum:0,weight:0});return{v:r,barycenter:e.sum/e.weight,weight:e.weight}}return{v:r}}))},ov=function(n,r){var t={};return Xh.forEach(n,(function(n,r){var e=t[n.v]={indegree:0,in:[],out:[],vs:[n.v],i:r};Xh.isUndefined(n.barycenter)||(e.barycenter=n.barycenter,e.weight=n.weight)})),Xh.forEach(r.edges(),(function(n){var r=t[n.v],e=t[n.w];Xh.isUndefined(r)||Xh.isUndefined(e)||(e.indegree++,r.out.push(t[n.w]))})),function(n){var r=[];function t(n){return function(r){r.merged||(Xh.isUndefined(r.barycenter)||Xh.isUndefined(n.barycenter)||r.barycenter>=n.barycenter)&&function(n,r){var t=0,e=0;n.weight&&(t+=n.barycenter*n.weight,e+=n.weight);r.weight&&(t+=r.barycenter*r.weight,e+=r.weight);n.vs=r.vs.concat(n.vs),n.barycenter=t/e,n.weight=e,n.i=Math.min(r.i,n.i),r.merged=!0}(n,r)}}function e(r){return function(t){t.in.push(r),0==--t.indegree&&n.push(t)}}for(;n.length;){var i=n.pop();r.push(i),Xh.forEach(i.in.reverse(),t(i)),Xh.forEach(i.out,e(i))}return Xh.map(Xh.filter(r,(function(n){return!n.merged})),(function(n){return Xh.pick(n,["vs","i","barycenter","weight"])}))}(Xh.filter(t,(function(n){return!n.indegree})))},uv=function(n,r){var t=rv.partition(n,(function(n){return nv.has(n,"barycenter")})),e=t.lhs,i=nv.sortBy(t.rhs,(function(n){return-n.i})),o=[],u=0,a=0,f=0;e.sort((c=!!r,function(n,r){return n.barycenter<r.barycenter?-1:n.barycenter>r.barycenter?1:c?r.i-n.i:n.i-r.i})),f=tv(o,i,f),nv.forEach(e,(function(n){f+=n.vs.length,o.push(n.vs),u+=n.barycenter*n.weight,a+=n.weight,f=tv(o,i,f)}));var c;var s={vs:nv.flatten(o,!0)};a&&(s.barycenter=u/a,s.weight=a);return s},av=function n(r,t,e,i){var o=r.children(t),u=r.node(t),a=u?u.borderLeft:void 0,f=u?u.borderRight:void 0,c={};a&&(o=ev.filter(o,(function(n){return n!==a&&n!==f})));var s=iv(r,o);ev.forEach(s,(function(t){if(r.children(t.v).length){var o=n(r,t.v,e,i);c[t.v]=o,ev.has(o,"barycenter")&&(u=t,a=o,ev.isUndefined(u.barycenter)?(u.barycenter=a.barycenter,u.weight=a.weight):(u.barycenter=(u.barycenter*u.weight+a.barycenter*a.weight)/(u.weight+a.weight),u.weight+=a.weight))}var u,a}));var d=ov(s,e);!function(n,r){ev.forEach(n,(function(n){n.vs=ev.flatten(n.vs.map((function(n){return r[n]?r[n].vs:n})),!0)}))}(d,c);var h=uv(d,i);if(a&&(h.vs=ev.flatten([a,h.vs,f],!0),r.predecessors(a).length)){var v=r.node(r.predecessors(a)[0]),l=r.node(r.predecessors(f)[0]);ev.has(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+v.order+l.order)/(h.weight+2),h.weight+=2}return h};var fv=Ad,cv=pd.Graph,sv=function(n,r,t){var e=function(n){var r;for(;n.hasNode(r=fv.uniqueId("_root")););return r}(n),i=new cv({compound:!0}).setGraph({root:e}).setDefaultNodeLabel((function(r){return n.node(r)}));return fv.forEach(n.nodes(),(function(o){var u=n.node(o),a=n.parent(o);(u.rank===r||u.minRank<=r&&r<=u.maxRank)&&(i.setNode(o),i.setParent(o,a||e),fv.forEach(n[t](o),(function(r){var t=r.v===o?r.w:r.v,e=i.edge(t,o),u=fv.isUndefined(e)?0:e.weight;i.setEdge(t,o,{weight:n.edge(r).weight+u})})),fv.has(u,"minRank")&&i.setNode(o,{borderLeft:u.borderLeft[r],borderRight:u.borderRight[r]}))})),i};var dv=Ad;var hv=Ad,vv=Jh,lv=Qh,pv=av,gv=sv,yv=function(n,r,t){var e,i={};dv.forEach(t,(function(t){for(var o,u,a=n.parent(t);a;){if((o=n.parent(a))?(u=i[o],i[o]=a):(u=e,e=a),u&&u!==a)return void r.setEdge(u,a);a=o}}))},bv=pd.Graph,mv=Wd,wv=function(n){var r=mv.maxRank(n),t=_v(n,hv.range(1,r+1),"inEdges"),e=_v(n,hv.range(r-1,-1,-1),"outEdges"),i=vv(n);xv(n,i);for(var o,u=Number.POSITIVE_INFINITY,a=0,f=0;f<4;++a,++f){Ev(a%2?t:e,a%4>=2),i=mv.buildLayerMatrix(n);var c=lv(n,i);c<u&&(f=0,o=hv.cloneDeep(i),u=c)}xv(n,o)};function _v(n,r,t){return hv.map(r,(function(r){return gv(n,r,t)}))}function Ev(n,r){var t=new bv;hv.forEach(n,(function(n){var e=n.graph().root,i=pv(n,e,t,r);hv.forEach(i.vs,(function(r,t){n.node(r).order=t})),yv(n,t,i.vs)}))}function xv(n,r){hv.forEach(r,(function(r){hv.forEach(r,(function(r,t){n.node(r).order=t}))}))}var jv=Ad,kv=pd.Graph,Nv=Wd,Ov=function(n){var r,t=Nv.buildLayerMatrix(n),e=jv.merge(Iv(n,t),Lv(n,t)),i={};jv.forEach(["u","d"],(function(o){r="u"===o?t:jv.values(t).reverse(),jv.forEach(["l","r"],(function(t){"r"===t&&(r=jv.map(r,(function(n){return jv.values(n).reverse()})));var u=("u"===o?n.predecessors:n.successors).bind(n),a=Mv(n,r,e,u),f=Pv(n,r,a.root,a.align,"r"===t);"r"===t&&(f=jv.mapValues(f,(function(n){return-n}))),i[o+t]=f}))}));var o=Sv(n,i);return Tv(i,o),Rv(i,n.graph().align)};function Iv(n,r){var t={};return jv.reduce(r,(function(r,e){var i=0,o=0,u=r.length,a=jv.last(e);return jv.forEach(e,(function(r,f){var c=function(n,r){if(n.node(r).dummy)return jv.find(n.predecessors(r),(function(r){return n.node(r).dummy}))}(n,r),s=c?n.node(c).order:u;(c||r===a)&&(jv.forEach(e.slice(o,f+1),(function(r){jv.forEach(n.predecessors(r),(function(e){var o=n.node(e),u=o.order;!(u<i||s<u)||o.dummy&&n.node(r).dummy||Av(t,e,r)}))})),o=f+1,i=s)})),e})),t}function Lv(n,r){var t={};function e(r,e,i,o,u){var a;jv.forEach(jv.range(e,i),(function(e){a=r[e],n.node(a).dummy&&jv.forEach(n.predecessors(a),(function(r){var e=n.node(r);e.dummy&&(e.order<o||e.order>u)&&Av(t,r,a)}))}))}return jv.reduce(r,(function(r,t){var i,o=-1,u=0;return jv.forEach(t,(function(a,f){if("border"===n.node(a).dummy){var c=n.predecessors(a);c.length&&(i=n.node(c[0]).order,e(t,u,f,o,i),u=f,o=i)}e(t,u,t.length,i,r.length)})),t})),t}function Av(n,r,t){if(r>t){var e=r;r=t,t=e}var i=n[r];i||(n[r]=i={}),i[t]=!0}function Cv(n,r,t){if(r>t){var e=r;r=t,t=e}return jv.has(n[r],t)}function Mv(n,r,t,e){var i={},o={},u={};return jv.forEach(r,(function(n){jv.forEach(n,(function(n,r){i[n]=n,o[n]=n,u[n]=r}))})),jv.forEach(r,(function(n){var r=-1;jv.forEach(n,(function(n){var a=e(n);if(a.length){a=jv.sortBy(a,(function(n){return u[n]}));for(var f=(a.length-1)/2,c=Math.floor(f),s=Math.ceil(f);c<=s;++c){var d=a[c];o[n]===n&&r<u[d]&&!Cv(t,n,d)&&(o[d]=n,o[n]=i[n]=i[d],r=u[d])}}}))})),{root:i,align:o}}function Pv(n,r,t,e,i){var o={},u=function(n,r,t,e){var i=new kv,o=n.graph(),u=function(n,r,t){return function(e,i,o){var u,a=e.node(i),f=e.node(o),c=0;if(c+=a.width/2,jv.has(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":u=-a.width/2;break;case"r":u=a.width/2}if(u&&(c+=t?u:-u),u=0,c+=(a.dummy?r:n)/2,c+=(f.dummy?r:n)/2,c+=f.width/2,jv.has(f,"labelpos"))switch(f.labelpos.toLowerCase()){case"l":u=f.width/2;break;case"r":u=-f.width/2}return u&&(c+=t?u:-u),u=0,c}}(o.nodesep,o.edgesep,e);return jv.forEach(r,(function(r){var e;jv.forEach(r,(function(r){var o=t[r];if(i.setNode(o),e){var a=t[e],f=i.edge(a,o);i.setEdge(a,o,Math.max(u(n,r,e),f||0))}e=r}))})),i}(n,r,t,i),a=i?"borderLeft":"borderRight";function f(n,r){for(var t=u.nodes(),e=t.pop(),i={};e;)i[e]?n(e):(i[e]=!0,t.push(e),t=t.concat(r(e))),e=t.pop()}return f((function(n){o[n]=u.inEdges(n).reduce((function(n,r){return Math.max(n,o[r.v]+u.edge(r))}),0)}),u.predecessors.bind(u)),f((function(r){var t=u.outEdges(r).reduce((function(n,r){return Math.min(n,o[r.w]-u.edge(r))}),Number.POSITIVE_INFINITY),e=n.node(r);t!==Number.POSITIVE_INFINITY&&e.borderType!==a&&(o[r]=Math.max(o[r],t))}),u.successors.bind(u)),jv.forEach(e,(function(n){o[n]=o[t[n]]})),o}function Sv(n,r){return jv.minBy(jv.values(r),(function(r){var t=Number.NEGATIVE_INFINITY,e=Number.POSITIVE_INFINITY;return jv.forIn(r,(function(r,i){var o=function(n,r){return n.node(r).width}(n,i)/2;t=Math.max(r+o,t),e=Math.min(r-o,e)})),t-e}))}function Tv(n,r){var t=jv.values(r),e=jv.min(t),i=jv.max(t);jv.forEach(["u","d"],(function(t){jv.forEach(["l","r"],(function(o){var u,a=t+o,f=n[a];if(f!==r){var c=jv.values(f);(u="l"===o?e-jv.min(c):i-jv.max(c))&&(n[a]=jv.mapValues(f,(function(n){return n+u})))}}))}))}function Rv(n,r){return jv.mapValues(n.ul,(function(t,e){if(r)return n[r.toLowerCase()][e];var i=jv.sortBy(jv.map(n,e));return(i[1]+i[2])/2}))}var Fv=Ad,zv=Wd,Dv=Ov;var Bv=Ad,Uv=$d,Gv=Hd,Vv=Ih,$v=Wd.normalizeRanks,qv=Mh,Yv=Wd.removeEmptyRanks,Wv=Th,Jv=Dh,Kv=Gh,Qv=wv,Zv=function(n){(function(n){var r=zv.buildLayerMatrix(n),t=n.graph().ranksep,e=0;Fv.forEach(r,(function(r){var i=Fv.max(Fv.map(r,(function(r){return n.node(r).height})));Fv.forEach(r,(function(r){n.node(r).y=e+i/2})),e+=i+t}))})(n=zv.asNonCompoundGraph(n)),Fv.forEach(Dv(n),(function(r,t){n.node(t).x=r}))},Hv=Wd,Xv=pd.Graph,nl=function(n,r){var t=r&&r.debugTiming?Hv.time:Hv.notime;t("layout",(function(){var r=t(" buildLayoutGraph",(function(){return function(n){var r=new Xv({multigraph:!0,compound:!0}),t=sl(n.graph());return r.setGraph(Bv.merge({},tl,cl(t,rl),Bv.pick(t,el))),Bv.forEach(n.nodes(),(function(t){var e=sl(n.node(t));r.setNode(t,Bv.defaults(cl(e,il),ol)),r.setParent(t,n.parent(t))})),Bv.forEach(n.edges(),(function(t){var e=sl(n.edge(t));r.setEdge(t,Bv.merge({},al,cl(e,ul),Bv.pick(e,fl)))})),r}(n)}));t(" runLayout",(function(){!function(n,r){r(" makeSpaceForEdgeLabels",(function(){!function(n){var r=n.graph();r.ranksep/=2,Bv.forEach(n.edges(),(function(t){var e=n.edge(t);e.minlen*=2,"c"!==e.labelpos.toLowerCase()&&("TB"===r.rankdir||"BT"===r.rankdir?e.width+=e.labeloffset:e.height+=e.labeloffset)}))}(n)})),r(" removeSelfEdges",(function(){!function(n){Bv.forEach(n.edges(),(function(r){if(r.v===r.w){var t=n.node(r.v);t.selfEdges||(t.selfEdges=[]),t.selfEdges.push({e:r,label:n.edge(r)}),n.removeEdge(r)}}))}(n)})),r(" acyclic",(function(){Uv.run(n)})),r(" nestingGraph.run",(function(){Wv.run(n)})),r(" rank",(function(){Vv(Hv.asNonCompoundGraph(n))})),r(" injectEdgeLabelProxies",(function(){!function(n){Bv.forEach(n.edges(),(function(r){var t=n.edge(r);if(t.width&&t.height){var e=n.node(r.v),i={rank:(n.node(r.w).rank-e.rank)/2+e.rank,e:r};Hv.addDummyNode(n,"edge-proxy",i,"_ep")}}))}(n)})),r(" removeEmptyRanks",(function(){Yv(n)})),r(" nestingGraph.cleanup",(function(){Wv.cleanup(n)})),r(" normalizeRanks",(function(){$v(n)})),r(" assignRankMinMax",(function(){!function(n){var r=0;Bv.forEach(n.nodes(),(function(t){var e=n.node(t);e.borderTop&&(e.minRank=n.node(e.borderTop).rank,e.maxRank=n.node(e.borderBottom).rank,r=Bv.max(r,e.maxRank))})),n.graph().maxRank=r}(n)})),r(" removeEdgeLabelProxies",(function(){!function(n){Bv.forEach(n.nodes(),(function(r){var t=n.node(r);"edge-proxy"===t.dummy&&(n.edge(t.e).labelRank=t.rank,n.removeNode(r))}))}(n)})),r(" normalize.run",(function(){Gv.run(n)})),r(" parentDummyChains",(function(){qv(n)})),r(" addBorderSegments",(function(){Jv(n)})),r(" order",(function(){Qv(n)})),r(" insertSelfEdges",(function(){!function(n){var r=Hv.buildLayerMatrix(n);Bv.forEach(r,(function(r){var t=0;Bv.forEach(r,(function(r,e){var i=n.node(r);i.order=e+t,Bv.forEach(i.selfEdges,(function(r){Hv.addDummyNode(n,"selfedge",{width:r.label.width,height:r.label.height,rank:i.rank,order:e+ ++t,e:r.e,label:r.label},"_se")})),delete i.selfEdges}))}))}(n)})),r(" adjustCoordinateSystem",(function(){Kv.adjust(n)})),r(" position",(function(){Zv(n)})),r(" positionSelfEdges",(function(){!function(n){Bv.forEach(n.nodes(),(function(r){var t=n.node(r);if("selfedge"===t.dummy){var e=n.node(t.e.v),i=e.x+e.width/2,o=e.y,u=t.x-i,a=e.height/2;n.setEdge(t.e,t.label),n.removeNode(r),t.label.points=[{x:i+2*u/3,y:o-a},{x:i+5*u/6,y:o-a},{x:i+u,y:o},{x:i+5*u/6,y:o+a},{x:i+2*u/3,y:o+a}],t.label.x=t.x,t.label.y=t.y}}))}(n)})),r(" removeBorderNodes",(function(){!function(n){Bv.forEach(n.nodes(),(function(r){if(n.children(r).length){var t=n.node(r),e=n.node(t.borderTop),i=n.node(t.borderBottom),o=n.node(Bv.last(t.borderLeft)),u=n.node(Bv.last(t.borderRight));t.width=Math.abs(u.x-o.x),t.height=Math.abs(i.y-e.y),t.x=o.x+t.width/2,t.y=e.y+t.height/2}})),Bv.forEach(n.nodes(),(function(r){"border"===n.node(r).dummy&&n.removeNode(r)}))}(n)})),r(" normalize.undo",(function(){Gv.undo(n)})),r(" fixupEdgeLabelCoords",(function(){!function(n){Bv.forEach(n.edges(),(function(r){var t=n.edge(r);if(Bv.has(t,"x"))switch("l"!==t.labelpos&&"r"!==t.labelpos||(t.width-=t.labeloffset),t.labelpos){case"l":t.x-=t.width/2+t.labeloffset;break;case"r":t.x+=t.width/2+t.labeloffset}}))}(n)})),r(" undoCoordinateSystem",(function(){Kv.undo(n)})),r(" translateGraph",(function(){!function(n){var r=Number.POSITIVE_INFINITY,t=0,e=Number.POSITIVE_INFINITY,i=0,o=n.graph(),u=o.marginx||0,a=o.marginy||0;function f(n){var o=n.x,u=n.y,a=n.width,f=n.height;r=Math.min(r,o-a/2),t=Math.max(t,o+a/2),e=Math.min(e,u-f/2),i=Math.max(i,u+f/2)}Bv.forEach(n.nodes(),(function(r){f(n.node(r))})),Bv.forEach(n.edges(),(function(r){var t=n.edge(r);Bv.has(t,"x")&&f(t)})),r-=u,e-=a,Bv.forEach(n.nodes(),(function(t){var i=n.node(t);i.x-=r,i.y-=e})),Bv.forEach(n.edges(),(function(t){var i=n.edge(t);Bv.forEach(i.points,(function(n){n.x-=r,n.y-=e})),Bv.has(i,"x")&&(i.x-=r),Bv.has(i,"y")&&(i.y-=e)})),o.width=t-r+u,o.height=i-e+a}(n)})),r(" assignNodeIntersects",(function(){!function(n){Bv.forEach(n.edges(),(function(r){var t,e,i=n.edge(r),o=n.node(r.v),u=n.node(r.w);i.points?(t=i.points[0],e=i.points[i.points.length-1]):(i.points=[],t=u,e=o),i.points.unshift(Hv.intersectRect(o,t)),i.points.push(Hv.intersectRect(u,e))}))}(n)})),r(" reversePoints",(function(){!function(n){Bv.forEach(n.edges(),(function(r){var t=n.edge(r);t.reversed&&t.points.reverse()}))}(n)})),r(" acyclic.undo",(function(){Uv.undo(n)}))}(r,t)})),t(" updateInputGraph",(function(){!function(n,r){Bv.forEach(n.nodes(),(function(t){var e=n.node(t),i=r.node(t);e&&(e.x=i.x,e.y=i.y,r.children(t).length&&(e.width=i.width,e.height=i.height))})),Bv.forEach(n.edges(),(function(t){var e=n.edge(t),i=r.edge(t);e.points=i.points,Bv.has(i,"x")&&(e.x=i.x,e.y=i.y)})),n.graph().width=r.graph().width,n.graph().height=r.graph().height}(n,r)}))}))};var rl=["nodesep","edgesep","ranksep","marginx","marginy"],tl={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},el=["acyclicer","ranker","rankdir","align"],il=["width","height"],ol={width:0,height:0},ul=["minlen","weight","width","height","labeloffset"],al={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},fl=["labelpos"];function cl(n,r){return Bv.mapValues(Bv.pick(n,r),Number)}function sl(n){var r={};return Bv.forEach(n,(function(n,t){r[t.toLowerCase()]=n})),r}var dl=Ad,hl=Wd,vl=pd.Graph;var ll={graphlib:pd,layout:nl,debug:{debugOrdering:function(n){var r=hl.buildLayerMatrix(n),t=new vl({compound:!0,multigraph:!0}).setGraph({});return dl.forEach(n.nodes(),(function(r){t.setNode(r,{label:r}),t.setParent(r,"layer"+n.node(r).rank)})),dl.forEach(n.edges(),(function(n){t.setEdge(n.v,n.w,{},n.name)})),dl.forEach(r,(function(n,r){var e="layer"+r;t.setNode(e,{rank:"same"}),dl.reduce(n,(function(n,r){return t.setEdge(n,r,{style:"invis"}),r}))})),t}},util:{time:Wd.time,notime:Wd.notime},version:"0.8.5"};class pl{render(n){this.lf=n}layout(n={}){const{nodes:r,edges:t,gridSize:e}=this.lf.graphModel;let i=100,o=150;e>20&&(i=2*e,o=2*e),this.option=Object.assign({rankdir:"LR",align:"UL",ranker:"tight-tree",ranksep:o,nodesep:i,marginx:120,marginy:120},n);const u=new ll.graphlib.Graph;u.setGraph(this.option),u.setDefaultEdgeLabel((()=>({}))),r.forEach((n=>{u.setNode(n.id,{width:n.width||150,height:n.height||50,id:n.id})})),t.forEach((n=>{u.setEdge(n.sourceNodeId,n.targetNodeId,{id:n.id})})),ll.layout(u);const a=[],f=[];r.forEach((n=>{var r;const{x:t,y:e}=u.node(n.id),i=n.getData();if(!i)throw new Error(`布局错误:找不到ID为 ${n.id} 的节点`);i.x=t,i.y=e,(null===(r=null==i?void 0:i.text)||void 0===r?void 0:r.x)&&(i.text.x=t,i.text.y=e),a.push(i)})),t.forEach((r=>{const t=r.getData();if(t){if(n.isDefaultAnchor){delete t.pointsList,delete t.startPoint,delete t.endPoint,delete t.sourceAnchorId,delete t.targetAnchorId;const n=this.lf.getEdgeModelById(r.id);if(n&&(t.pointsList=this.calcPointsList(n,a)),t.pointsList){const n=t.pointsList[0],r=t.pointsList[t.pointsList.length-1];t.startPoint={x:n.x,y:n.y},t.endPoint={x:r.x,y:r.y},t.text&&t.text.value&&(t.text={x:r.x-6*this.getBytesLength(t.text.value)-10,y:r.y,value:t.text.value})}else t.text&&t.text.value&&(t.text=t.text.value)}else delete t.pointsList,delete t.startPoint,delete t.endPoint;f.push(t)}})),this.lf.renderRawData({nodes:a,edges:f})}getBytesLength(n){if(!n)return 0;let r=0;for(let t=0;t<n.length;t++){const e=n.charCodeAt(t);n.match(/[A-Z]/)?r+=1.5:r+=e>=1&&e<=126||e>=65376&&e<=65439?1:2}return r}pointFilter(n){const r=[...n];let t=1;for(;t<r.length-1;){const n=r[t-1],e=r[t],i=r[t+1];n.x===e.x&&e.x===i.x||n.y===e.y&&e.y===i.y?r.splice(t,1):t++}return r}calcPointsList(n,r){const t=[],e=this.lf.getNodeModelById(n.sourceNodeId),i=this.lf.getNodeModelById(n.targetNodeId),o=r.find((r=>r.id===n.sourceNodeId)),u=r.find((r=>r.id===n.targetNodeId));if(!(e&&i&&o&&u))return;const a=Number(n.offset)||50;if("LR"===this.option.rankdir&&"polyline-edge"===n.modelType){if(o.x<u.x)return t.push({x:o.x+e.width/2,y:o.y}),t.push({x:o.x+e.width/2+a,y:o.y}),t.push({x:o.x+e.width/2+a,y:u.y}),t.push({x:u.x-i.width/2,y:u.y}),this.pointFilter(t);if(o.x>u.x)return o.y>=u.y?(t.push({x:o.x,y:o.y+e.height/2}),t.push({x:o.x,y:o.y+e.height/2+a}),t.push({x:u.x,y:o.y+e.height/2+a}),t.push({x:u.x,y:u.y+i.height/2})):(t.push({x:o.x,y:o.y-e.height/2}),t.push({x:o.x,y:o.y-e.height/2-a}),t.push({x:u.x,y:o.y-e.height/2-a}),t.push({x:u.x,y:u.y-i.height/2})),this.pointFilter(t)}if("TB"===this.option.rankdir&&"polyline-edge"===n.modelType){if(o.y<u.y)return t.push({x:o.x,y:o.y+e.height/2}),t.push({x:o.x,y:o.y+e.height/2+a}),t.push({x:u.x,y:o.y+e.height/2+a}),t.push({x:u.x,y:u.y-i.height/2}),this.pointFilter(t);if(o.y>u.y)return o.x>=u.x?(t.push({x:o.x+e.width/2,y:o.y}),t.push({x:o.x+e.width/2+a,y:o.y}),t.push({x:o.x+e.width/2+a,y:u.y}),t.push({x:u.x+i.width/2,y:u.y})):(t.push({x:o.x-e.width/2,y:o.y}),t.push({x:o.x-e.width/2-a,y:o.y}),t.push({x:o.x-e.width/2-a,y:u.y}),t.push({x:u.x-i.width/2,y:u.y})),this.pointFilter(t)}}}pl.pluginName="dagre",n.Dagre=pl}));
2
+ //# sourceMappingURL=index.min.js.map