apextree 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +7 -0
- package/.eslintignore +2 -0
- package/.eslintrc +9 -0
- package/.prettierrc +5 -0
- package/.vscode/settings.json +5 -0
- package/LICENSE +80 -0
- package/README.md +2 -0
- package/apextree.es.min.js +15673 -1530
- package/apextree.min.js +1 -1
- package/demo/bottom_to_top_view.html +3 -3
- package/demo/custom_font_options.html +2 -2
- package/demo/dynamic_view_change.html +2 -2
- package/demo/expand_collapse_nodes.html +1 -1
- package/demo/group_leaf_nodes.html +118 -0
- package/demo/left_to_right_view.html +3 -3
- package/demo/per_node_options.html +7 -5
- package/demo/right_to_left_view.html +1 -2
- package/demo/top_to_bottom_view.html +1 -2
- package/globals.d.ts +4 -0
- package/lib/ApexTree.d.ts +4 -3
- package/lib/models/DagreGraph.d.ts +30 -0
- package/lib/models/Graph.d.ts +10 -24
- package/lib/models/GraphNode.d.ts +20 -0
- package/lib/models/GraphPoint.d.ts +4 -0
- package/lib/models/Paper.d.ts +22 -22
- package/lib/models/TreeNode.d.ts +15 -0
- package/lib/models/index.d.ts +3 -2
- package/lib/settings/DirectionConfig.d.ts +22 -30
- package/lib/settings/Options.d.ts +36 -26
- package/lib/utils/EdgeUtils.d.ts +3 -2
- package/lib/utils/GraphUtils.d.ts +4 -7
- package/package.json +14 -11
- package/tsconfig.json +28 -0
- package/webpack.common.ts +68 -0
- package/webpack.config.ts +7 -0
- package/webpack.dev.ts +12 -0
- package/webpack.prod.ts +9 -0
package/apextree.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).ApexTree=e()}(this,(function(){"use strict";function t(t){var e=0,n=t.children,i=n&&n.length;if(i)for(;--i>=0;)e+=n[i].value;else e=1;t.value=e}function e(t,e){var i,o,h,a,l,u=new s(t),c=+t.value&&(u.value=t.value),d=[u];for(null==e&&(e=n);i=d.pop();)if(c&&(i.value=+i.data.value),(h=e(i.data))&&(l=h.length))for(i.children=new Array(l),a=l-1;a>=0;--a)d.push(o=i.children[a]=new s(h[a])),o.parent=i,o.depth=i.depth+1;return u.eachBefore(r)}function n(t){return t.children}function i(t){t.data=t.data.data}function r(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function s(t){this.data=t,this.depth=this.height=0,this.parent=null}s.prototype=e.prototype={constructor:s,count:function(){return this.eachAfter(t)},each:function(t){var e,n,i,r,s=this,o=[s];do{for(e=o.reverse(),o=[];s=e.pop();)if(t(s),n=s.children)for(i=0,r=n.length;i<r;++i)o.push(n[i])}while(o.length);return this},eachAfter:function(t){for(var e,n,i,r=this,s=[r],o=[];r=s.pop();)if(o.push(r),e=r.children)for(n=0,i=e.length;n<i;++n)s.push(e[n]);for(;r=o.pop();)t(r);return this},eachBefore:function(t){for(var e,n,i=this,r=[i];i=r.pop();)if(t(i),e=i.children)for(n=e.length-1;n>=0;--n)r.push(e[n]);return this},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,i=e.children,r=i&&i.length;--r>=0;)n+=i[r].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;t=n.pop(),e=i.pop();for(;t===e;)r=t,t=n.pop(),e=i.pop();return r}(e,t),i=[e];e!==n;)e=e.parent,i.push(e);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each((function(e){t.push(e)})),t},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return e(this).eachBefore(i)}};const o={name:"d3-flextree",version:"2.1.2",main:"build/d3-flextree.js",module:"index","jsnext:main":"index",author:{name:"Chris Maloney",url:"http://chrismaloney.org"},description:"Flexible tree layout algorithm that allows for variable node sizes.",keywords:["d3","d3-module","layout","tree","hierarchy","d3-hierarchy","plugin","d3-plugin","infovis","visualization","2d"],homepage:"https://github.com/klortho/d3-flextree",license:"WTFPL",repository:{type:"git",url:"https://github.com/klortho/d3-flextree.git"},scripts:{clean:"rm -rf build demo test","build:demo":"rollup -c --environment BUILD:demo","build:dev":"rollup -c --environment BUILD:dev","build:prod":"rollup -c --environment BUILD:prod","build:test":"rollup -c --environment BUILD:test",build:"rollup -c",lint:"eslint index.js src","test:main":"node test/bundle.js","test:browser":"node test/browser-tests.js",test:"npm-run-all test:*",prepare:"npm-run-all clean build lint test"},dependencies:{"d3-hierarchy":"^1.1.5"},devDependencies:{"babel-plugin-external-helpers":"^6.22.0","babel-preset-es2015-rollup":"^3.0.0",d3:"^4.13.0","d3-selection-multi":"^1.0.1",eslint:"^4.19.1",jsdom:"^11.6.2","npm-run-all":"^4.1.2",rollup:"^0.55.3","rollup-plugin-babel":"^2.7.1","rollup-plugin-commonjs":"^8.0.2","rollup-plugin-copy":"^0.2.3","rollup-plugin-json":"^2.3.0","rollup-plugin-node-resolve":"^3.0.2","rollup-plugin-uglify":"^3.0.0","uglify-es":"^3.3.9"}},{version:h}=o,a=Object.freeze({children:t=>t.children,nodeSize:t=>t.data.size,spacing:0});function l(t){const n=Object.assign({},a,t);function i(t){const e=n[t];return"function"==typeof e?e:()=>e}function r(t){const e=o(function(){const t=s(),e=i("nodeSize"),n=i("spacing");return class extends t{constructor(t){super(t),Object.assign(this,{x:0,y:0,relX:0,prelim:0,shift:0,change:0,lExt:this,lExtRelX:0,lThr:null,rExt:this,rExtRelX:0,rThr:null})}get size(){return e(this.data)}spacing(t){return n(this.data,t.data)}get x(){return this.data.x}set x(t){this.data.x=t}get y(){return this.data.y}set y(t){this.data.y=t}update(){return u(this),c(this),this}}}(),t,(t=>t.children));return e.update(),e.data}function s(){const t=i("nodeSize"),n=i("spacing");return class i extends e.prototype.constructor{constructor(t){super(t)}copy(){const t=o(this.constructor,this,(t=>t.children));return t.each((t=>t.data=t.data.data)),t}get size(){return t(this)}spacing(t){return n(this,t)}get nodes(){return this.descendants()}get xSize(){return this.size[0]}get ySize(){return this.size[1]}get top(){return this.y}get bottom(){return this.y+this.ySize}get left(){return this.x-this.xSize/2}get right(){return this.x+this.xSize/2}get root(){const t=this.ancestors();return t[t.length-1]}get numChildren(){return this.hasChildren?this.children.length:0}get hasChildren(){return!this.noChildren}get noChildren(){return null===this.children}get firstChild(){return this.hasChildren?this.children[0]:null}get lastChild(){return this.hasChildren?this.children[this.numChildren-1]:null}get extents(){return(this.children||[]).reduce(((t,e)=>i.maxExtents(t,e.extents)),this.nodeExtents)}get nodeExtents(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}static maxExtents(t,e){return{top:Math.min(t.top,e.top),bottom:Math.max(t.bottom,e.bottom),left:Math.min(t.left,e.left),right:Math.max(t.right,e.right)}}}}function o(t,e,n){const i=(e,r)=>{const s=new t(e);Object.assign(s,{parent:r,depth:null===r?0:r.depth+1,height:0,length:1});const o=n(e)||[];return s.children=0===o.length?null:o.map((t=>i(t,s))),s.children&&Object.assign(s,s.children.reduce(((t,e)=>({height:Math.max(t.height,e.height+1),length:t.length+e.length})),s)),s};return i(e,null)}return Object.assign(r,{nodeSize(t){return arguments.length?(n.nodeSize=t,r):n.nodeSize},spacing(t){return arguments.length?(n.spacing=t,r):n.spacing},children(t){return arguments.length?(n.children=t,r):n.children},hierarchy(t,e){const i=void 0===e?n.children:e;return o(s(),t,i)},dump(t){const e=i("nodeSize"),n=t=>i=>{const r=t+" ",s=t+" ",{x:o,y:h}=i,a=e(i),l=i.children||[],u=0===l.length?" ":`,${r}children: [${s}${l.map(n(s)).join(s)}${r}],${t}`;return`{ size: [${a.join(", ")}],${r}x: ${o}, y: ${h}${u}},`};return n("\n")(t)}}),r}l.version=h;const u=(t,e=0)=>(t.y=e,(t.children||[]).reduce(((e,n)=>{const[i,r]=e;u(n,t.y+t.ySize);const s=(0===i?n.lExt:n.rExt).bottom;0!==i&&p(t,i,r);return[i+1,_(s,i,r)]}),[0,null]),d(t),b(t),t),c=(t,e,n)=>{void 0===e&&(e=-t.relX-t.prelim,n=0);const i=e+t.relX;return t.relX=i+t.prelim-n,t.prelim=0,t.x=n+t.relX,(t.children||[]).forEach((e=>c(e,i,t.x))),t},d=t=>{(t.children||[]).reduce(((t,e)=>{const[n,i]=t,r=n+e.shift,s=i+r+e.change;return e.relX+=s,[r,s]}),[0,0])},p=(t,e,n)=>{const i=t.children[e-1],r=t.children[e];let s=i,o=i.relX,h=r,a=r.relX,l=!0;for(;s&&h;){s.bottom>n.lowY&&(n=n.next);const i=o+s.prelim-(a+h.prelim)+s.xSize/2+h.xSize/2+s.spacing(h);(i>0||i<0&&l)&&(a+=i,f(r,i),m(t,e,n.index,i)),l=!1;const u=s.bottom,c=h.bottom;u<=c&&(s=y(s),s&&(o+=s.relX)),u>=c&&(h=g(h),h&&(a+=h.relX))}!s&&h?x(t,e,h,a):s&&!h&&w(t,e,s,o)},f=(t,e)=>{t.relX+=e,t.lExtRelX+=e,t.rExtRelX+=e},m=(t,e,n,i)=>{const r=t.children[e],s=e-n;if(s>1){const e=i/s;t.children[n+1].shift+=e,r.shift-=e,r.change-=i-e}},g=t=>t.hasChildren?t.firstChild:t.lThr,y=t=>t.hasChildren?t.lastChild:t.rThr,x=(t,e,n,i)=>{const r=t.firstChild,s=r.lExt,o=t.children[e];s.lThr=n;const h=i-n.relX-r.lExtRelX;s.relX+=h,s.prelim-=h,r.lExt=o.lExt,r.lExtRelX=o.lExtRelX},w=(t,e,n,i)=>{const r=t.children[e],s=r.rExt,o=t.children[e-1];s.rThr=n;const h=i-n.relX-r.rExtRelX;s.relX+=h,s.prelim-=h,r.rExt=o.rExt,r.rExtRelX=o.rExtRelX},b=t=>{if(t.hasChildren){const e=t.firstChild,n=t.lastChild,i=(e.prelim+e.relX-e.xSize/2+n.relX+n.prelim+n.xSize/2)/2;Object.assign(t,{prelim:i,lExt:e.lExt,lExtRelX:e.lExtRelX,rExt:n.rExt,rExtRelX:n.rExtRelX})}},_=(t,e,n)=>{for(;null!==n&&t>=n.lowY;)n=n.next;return{lowY:t,index:e,next:n}},v=(t,e,n)=>{const i=t.x,r=t.y,s=e.x,o=e.y,h=(null==n?void 0:n.x)??i,a=(null==n?void 0:n.y)??r,l=s-i<0?-1:1,u=o-r<0?-1:1;let c=Math.abs(s-i)/2<35?Math.abs(s-i)/2:35;c=Math.abs(o-r)/2<c?Math.abs(o-r)/2:c;const d=Math.abs(s-i)/2-c;return[`M ${h} ${a}`,`L ${h} ${r}`,`L ${i} ${r}`,`L ${i+d*l} ${r}`,`C ${i+d*l+c*l} ${r} ${i+d*l+c*l} ${r} ${i+d*l+c*l} ${r+c*u}`,`L ${i+d*l+c*l} ${o-c*u}`,`C ${i+d*l+c*l} ${o} ${i+d*l+c*l} ${o} ${s-d*l} ${o}`,`L ${s} ${o}`].join(" ")},M=(t,e,n,i={sy:0})=>{const r=t.x;let s=t.y;const o=e.x,h=e.y,a=(null==n?void 0:n.x)??r,l=(null==n?void 0:n.y)??s,u=o-r<0?-1:1,c=h-s<0?-1:1;s+=i.sy;let d=Math.abs(o-r)/2<35?Math.abs(o-r)/2:35;d=Math.abs(h-s)/2<d?Math.abs(h-s)/2:d;const p=Math.abs(h-s)/2-d;return[`M ${a} ${l}`,`L ${r} ${l}`,`L ${r} ${s}`,`L ${r} ${s+p*c}`,`C ${r} ${s+p*c+d*c} ${r} ${s+p*c+d*c} ${r+d*u} ${s+p*c+d*c}`,`L ${r+(Math.abs(o-r)-2*d)*u+d*u} ${s+p*c+d*c}`,`C ${o} ${s+p*c+d*c} ${o} ${s+p*c+d*c} ${o} ${h-p*c}`,`L ${o} ${h}`].join(" ")},S={top:{containerX:({width:t})=>t/2,containerY:()=>0,edgeX:({node:t,nodeWidth:e})=>t.x+e/2,edgeY:({node:t})=>t.y,edgeMidX:({node:t,nodeWidth:e})=>t.x+e/2,edgeMidY:({node:t})=>t.y,edgeParentX:({parent:t,nodeWidth:e})=>t.x+e/2,edgeParentY:({parent:t,nodeHeight:e})=>t.y+e,nodeFlexSize:({nodeWidth:t,nodeHeight:e,siblingSpacing:n,childrenSpacing:i})=>[t+n,e+i],calculateEdge:M,swap:t=>({x:t.left,y:t.top}),viewBoxDimensions:({rootNode:t,childrenSpacing:e,siblingSpacing:n})=>{if(!t)return{x:0,y:0,width:0,height:0};const{left:i,top:r,right:s,bottom:o}=t.extents,h=Math.abs(i)+Math.abs(s),a=Math.abs(r)+Math.abs(o);return{x:-(Math.abs(i)+n/2),y:-((t.ySize-e)/2),width:h,height:a}}},bottom:{containerX:({width:t})=>t/2,containerY:({height:t,nodeHeight:e})=>t-e-10,edgeX:({node:t,nodeWidth:e})=>t.x+e/2,edgeY:({node:t,nodeHeight:e})=>t.y+e,edgeMidX:({node:t,nodeWidth:e})=>t.x+e/2,edgeMidY:({node:t,nodeHeight:e})=>t.y+e,edgeParentX:({parent:t,nodeWidth:e})=>t.x+e/2,edgeParentY:({parent:t})=>t.y,nodeFlexSize:({nodeWidth:t,nodeHeight:e,siblingSpacing:n,childrenSpacing:i})=>[t+n,e+i],calculateEdge:M,swap:t=>({...t,y:-t.y}),viewBoxDimensions:({rootNode:t,childrenSpacing:e,siblingSpacing:n})=>{if(!t)return{x:0,y:0,width:0,height:0};const{left:i,top:r,right:s,bottom:o}=t.extents,h=Math.abs(i)+Math.abs(s),a=Math.abs(r)+Math.abs(o);return{x:-(Math.abs(i)-(t.xSize-n)/2),y:-(a-t.ySize+e/2),width:h,height:a}}},left:{containerX:()=>10,containerY:({height:t})=>t/2,edgeX:({node:t})=>t.x,edgeY:({node:t,nodeHeight:e})=>t.y+e/2,edgeMidX:({node:t})=>t.x,edgeMidY:({node:t,nodeHeight:e})=>t.y+e/2,edgeParentX:({parent:t,nodeWidth:e})=>t.x+e,edgeParentY:({parent:t,nodeHeight:e})=>t.y+e/2,nodeFlexSize:({nodeWidth:t,nodeHeight:e,siblingSpacing:n,childrenSpacing:i})=>[e+n,t+i],calculateEdge:v,swap:t=>({...t,x:t.y,y:t.x}),viewBoxDimensions:({rootNode:t,childrenSpacing:e,siblingSpacing:n})=>{if(!t)return{x:0,y:0,width:0,height:0};const{left:i,top:r,right:s,bottom:o}=t.extents,h=Math.abs(r)+Math.abs(o),a=Math.abs(i)+Math.abs(s);return{x:-(Math.abs(r)+e/2),y:-(Math.abs(i)-n),width:h,height:a}}},right:{containerX:({width:t,nodeWidth:e})=>t-e-10,containerY:({height:t})=>t/2,edgeX:({node:t,nodeWidth:e})=>t.x+e,edgeY:({node:t,nodeHeight:e})=>t.y+e/2,edgeMidX:({node:t,nodeWidth:e})=>t.x+e,edgeMidY:({node:t,nodeHeight:e})=>t.y+e/2,edgeParentX:({parent:t})=>t.x,edgeParentY:({parent:t,nodeHeight:e})=>t.y+e/2,nodeFlexSize:({nodeWidth:t,nodeHeight:e,siblingSpacing:n,childrenSpacing:i})=>[e+n,t+i],calculateEdge:v,swap:t=>({...t,x:-t.y,y:t.x}),viewBoxDimensions:({rootNode:t,siblingSpacing:e,childrenSpacing:n})=>{if(!t)return{x:0,y:0,width:0,height:0};const{left:i,top:r,right:s,bottom:o}=t.extents,h=Math.abs(r)+Math.abs(o),a=Math.abs(i)+Math.abs(s);return{x:-(h-t.ySize+n/2),y:-(Math.abs(i)-e),width:h,height:a}}}},C=(t,e={})=>{for(const n in e)null==t||t.setAttribute(n,e[n])},E=(t,e,n,i)=>{var r;const s=null==e?void 0:e.data.options,o=(null==s?void 0:s.borderWidth)||i.borderWidth;let h=(null==s?void 0:s.borderColor)||i.borderColor,a=(null==s?void 0:s.nodeBGColor)||i.nodeBGColor;n&&(h=(null==s?void 0:s.borderColorHover)||i.borderColorHover,a=(null==s?void 0:s.nodeBGColorHover)||i.nodeBGColorHover);const l=document.querySelector(`[data-self='${e.data.id}'] foreignObject div`);if(l&&(l.style.borderWidth=`${o}px`,l.style.borderColor=h,l.style.backgroundColor=a),e.parent){const s=document.getElementById(`${e.data.id}-${null==(r=e.parent)?void 0:r.data.id}`);C(s,n?{"stroke-width":i.edgeWidth+1,stroke:i.edgeColorHover}:{"stroke-width":i.edgeWidth,stroke:i.edgeColor}),e.parent&&E(t,e.parent,n,i)}},A=(t={})=>{const e=[];for(const n in t){const i=`${O(n)}: ${t[n]};`;e.push(i)}return e.join(" ")},T=(t="",e,n="")=>{const i=document.getElementById(t);e?null==i||i.setAttribute("style",e):null==i||i.removeAttribute("style"),(null==i?void 0:i.innerHTML.replaceAll("'",'"'))!==n.replaceAll("'",'"')&&i&&(i.innerHTML=n)},O=t=>t.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((t,e)=>(e?"-":"")+t.toLowerCase())),k={},R=[];function N(t,e){if(Array.isArray(t))for(const n of t)N(n,e);else if("object"!=typeof t)X(Object.getOwnPropertyNames(e)),k[t]=Object.assign(k[t]||{},e);else for(const n in t)N(n,t[n])}function z(t){return k[t]||{}}function X(t){R.push(...t)}function I(t,e){let n;const i=t.length,r=[];for(n=0;n<i;n++)r.push(e(t[n]));return r}function j(t){return t%360*Math.PI/180}function P(t){return t.charAt(0).toUpperCase()+t.slice(1)}function $(t,e,n,i){return null!=e&&null!=n||(i=i||t.bbox(),null==e?e=i.width/i.height*n:null==n&&(n=i.height/i.width*e)),{width:e,height:n}}function L(t,e){const n=t.origin;let i=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",r=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([i,r]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const s="string"==typeof i,o="string"==typeof r;if(s||o){const{height:t,width:n,x:h,y:a}=e.bbox();s&&(i=i.includes("left")?h:i.includes("right")?h+n:h+n/2),o&&(r=r.includes("top")?a:r.includes("bottom")?a+t:a+t/2)}return[i,r]}const D=new Set(["desc","metadata","title"]),Y=t=>D.has(t.nodeName),F=(t,e,n={})=>{const i={...e};for(const r in i)i[r].valueOf()===n[r]&&delete i[r];Object.keys(i).length?t.node.setAttribute("data-svgjs",JSON.stringify(i)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))},B="http://www.w3.org/2000/svg",V="http://www.w3.org/2000/xmlns/",H="http://www.w3.org/1999/xlink",G={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class W{}const q={},Z="___SYMBOL___ROOT___";function U(t,e=B){return G.document.createElementNS(e,t)}function Q(t,e=!1){if(t instanceof W)return t;if("object"==typeof t)return tt(t);if(null==t)return new q[Z];if("string"==typeof t&&"<"!==t.charAt(0))return tt(G.document.querySelector(t));const n=e?G.document.createElement("div"):U("svg");return n.innerHTML=t,t=tt(n.firstChild),n.removeChild(n.firstChild),t}function J(t,e){return e&&(e instanceof G.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:U(t)}function K(t){if(!t)return null;if(t.instance instanceof W)return t.instance;if("#document-fragment"===t.nodeName)return new q.Fragment(t);let e=P(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":q[e]||(e="Dom"),new q[e](t)}let tt=K;function et(t,e=t.name,n=!1){return q[e]=t,n&&(q[Z]=t),X(Object.getOwnPropertyNames(t.prototype)),t}let nt=1e3;function it(t){return"Svgjs"+P(t)+nt++}function rt(t){for(let e=t.children.length-1;e>=0;e--)rt(t.children[e]);return t.id?(t.id=it(t.nodeName),t):t}function st(t,e){let n,i;for(i=(t=Array.isArray(t)?t:[t]).length-1;i>=0;i--)for(n in e)t[i].prototype[n]=e[n]}function ot(t){return function(...e){const n=e[e.length-1];return!n||n.constructor!==Object||n instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(n)}}N("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=Q(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=Q(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=Q(t)).before(this),this},insertAfter:function(t){return(t=Q(t)).after(this),this}});const ht=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,at=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,lt=/rgb\((\d+),(\d+),(\d+)\)/,ut=/(#[a-z_][a-z0-9\-_]*)/i,ct=/\)\s*,?\s*/,dt=/\s/g,pt=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,ft=/^rgb\(/,mt=/^(\s+)?$/,gt=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,yt=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,xt=/[\s,]+/,wt=/[MLHVCSQTAZ]/i;function bt(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function _t(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function vt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}N("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(xt)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),N("Dom",{css:function(t,e){const n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);n[e[0]]=e[1]})),n;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=e;n[e]=this.node.style.getPropertyValue(t)}return n}if("string"==typeof t)return this.node.style.getPropertyValue(t);if("object"==typeof t)for(const e in t)this.node.style.setProperty(e,null==t[e]||mt.test(t[e])?"":t[e])}return 2===arguments.length&&this.node.style.setProperty(t,null==e||mt.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),N("Dom",{data:function(t,e,n){if(null==t)return this.data(I(function(t,e){let n;const i=t.length,r=[];for(n=0;n<i;n++)e(t[n])&&r.push(t[n]);return r}(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const n of t)e[n]=this.data(n);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(i){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===n||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),N("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const n in t)this.remember(n,t[n]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class Mt{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof Mt||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e){const{random:n,round:i,sin:r,PI:s}=Math;if("vibrant"===t){const t=24*n()+57,e=38*n()+45,i=360*n();return new Mt(t,e,i,"lch")}if("sine"===t){const t=i(80*r(2*s*(e=null==e?n():e)/.5+.01)+150),o=i(50*r(2*s*e/.5+4.6)+200),h=i(100*r(2*s*e/.5+2.3)+150);return new Mt(t,o,h)}if("pastel"===t){const t=8*n()+86,e=17*n()+9,i=360*n();return new Mt(t,e,i,"lch")}if("dark"===t){const t=10+10*n(),e=50*n()+86,i=360*n();return new Mt(t,e,i,"lch")}if("rgb"===t){const t=255*n(),e=255*n(),i=255*n();return new Mt(t,e,i)}if("lab"===t){const t=100*n(),e=256*n()-128,i=256*n()-128;return new Mt(t,e,i,"lab")}if("grey"===t){const t=255*n();return new Mt(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(pt.test(t)||ft.test(t))}cmyk(){const{_a:t,_b:e,_c:n}=this.rgb(),[i,r,s]=[t,e,n].map((t=>t/255)),o=Math.min(1-i,1-r,1-s);if(1===o)return new Mt(0,0,0,1,"cmyk");return new Mt((1-i-o)/(1-o),(1-r-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:n}=this.rgb(),[i,r,s]=[t,e,n].map((t=>t/255)),o=Math.max(i,r,s),h=Math.min(i,r,s),a=(o+h)/2,l=o===h,u=o-h;return new Mt(360*(l?0:o===i?((r-s)/u+(r<s?6:0))/6:o===r?((s-i)/u+2)/6:o===s?((i-r)/u+4)/6:0),100*(l?0:a>.5?u/(2-o-h):u/(o+h)),100*a,"hsl")}init(t=0,e=0,n=0,i=0,r="rgb"){if(t=t||0,this.space)for(const c in this.space)delete this[this.space[c]];if("number"==typeof t)r="string"==typeof i?i:r,i="string"==typeof i?0:i,Object.assign(this,{_a:t,_b:e,_c:n,_d:i,space:r});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const n=function(t,e){const n=_t(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:_t(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:_t(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:_t(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:_t(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:_t(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return n.space=e||n.space,n}(t,e);Object.assign(this,n)}else if("string"==typeof t)if(ft.test(t)){const e=t.replace(dt,""),[n,i,r]=lt.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:i,_c:r,_d:0,space:"rgb"})}else{if(!pt.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,i,r]=at.exec((s=t,4===s.length?["#",s.substring(1,2),s.substring(1,2),s.substring(2,3),s.substring(2,3),s.substring(3,4),s.substring(3,4)].join(""):s)).map(e);Object.assign(this,{_a:n,_b:i,_c:r,_d:0,space:"rgb"})}}var s;const{_a:o,_b:h,_c:a,_d:l}=this,u="rgb"===this.space?{r:o,g:h,b:a}:"xyz"===this.space?{x:o,y:h,z:a}:"hsl"===this.space?{h:o,s:h,l:a}:"lab"===this.space?{l:o,a:h,b:a}:"lch"===this.space?{l:o,c:h,h:a}:"cmyk"===this.space?{c:o,m:h,y:a,k:l}:{};Object.assign(this,u)}lab(){const{x:t,y:e,z:n}=this.xyz();return new Mt(116*e-16,500*(t-e),200*(e-n),"lab")}lch(){const{l:t,a:e,b:n}=this.lab(),i=Math.sqrt(e**2+n**2);let r=180*Math.atan2(n,e)/Math.PI;r<0&&(r*=-1,r=360-r);return new Mt(t,i,r,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:n}=this;if("lab"===this.space||"lch"===this.space){let{l:i,a:r,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;r=t*Math.cos(n*e),s=t*Math.sin(n*e)}const o=(i+16)/116,h=r/500+o,a=o-s/200,l=16/116,u=.008856,c=7.787;t=.95047*(h**3>u?h**3:(h-l)/c),e=1*(o**3>u?o**3:(o-l)/c),n=1.08883*(a**3>u?a**3:(a-l)/c)}const i=3.2406*t+-1.5372*e+-.4986*n,r=-.9689*t+1.8758*e+.0415*n,s=.0557*t+-.204*e+1.057*n,o=Math.pow,h=.0031308,a=i>h?1.055*o(i,1/2.4)-.055:12.92*i,l=r>h?1.055*o(r,1/2.4)-.055:12.92*r,u=s>h?1.055*o(s,1/2.4)-.055:12.92*s;return new Mt(255*a,255*l,255*u)}if("hsl"===this.space){let{h:t,s:e,l:n}=this;if(t/=360,e/=100,n/=100,0===e){n*=255;return new Mt(n,n,n)}const i=n<.5?n*(1+e):n+e-n*e,r=2*n-i,s=255*vt(r,i,t+1/3),o=255*vt(r,i,t),h=255*vt(r,i,t-1/3);return new Mt(s,o,h)}if("cmyk"===this.space){const{c:t,m:e,y:n,k:i}=this,r=255*(1-Math.min(1,t*(1-i)+i)),s=255*(1-Math.min(1,e*(1-i)+i)),o=255*(1-Math.min(1,n*(1-i)+i));return new Mt(r,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:n,_d:i,space:r}=this;return[t,e,n,i,r]}toHex(){const[t,e,n]=this._clamped().map(bt);return`#${t}${e}${n}`}toRgb(){const[t,e,n]=this._clamped();return`rgb(${t},${e},${n})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:n}=this.rgb(),[i,r,s]=[t,e,n].map((t=>t/255)),o=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,h=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,a=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,l=(.4124*o+.3576*h+.1805*a)/.95047,u=(.2126*o+.7152*h+.0722*a)/1,c=(.0193*o+.1192*h+.9505*a)/1.08883,d=l>.008856?Math.pow(l,1/3):7.787*l+16/116,p=u>.008856?Math.pow(u,1/3):7.787*u+16/116,f=c>.008856?Math.pow(c,1/3):7.787*c+16/116;return new Mt(d,p,f,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:i,min:r,round:s}=Math;return[t,e,n].map((t=>i(0,r(s(t),255))))}}class St{constructor(...t){this.init(...t)}clone(){return new St(this)}init(t,e){const n=0,i=0,r=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==r.x?n:r.x,this.y=null==r.y?i:r.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){Et.isMatrixLike(t)||(t=new Et(t));const{x:e,y:n}=this;return this.x=t.a*e+t.c*n+t.e,this.y=t.b*e+t.d*n+t.f,this}}function Ct(t,e,n){return Math.abs(e-t)<1e-6}class Et{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,n=t.flip&&(e||"x"===t.flip)?-1:1,i=t.flip&&(e||"y"===t.flip)?-1:1,r=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleX)?t.scaleX*n:n,h=t.scale&&t.scale.length?t.scale[1]*i:isFinite(t.scale)?t.scale*i:isFinite(t.scaleY)?t.scaleY*i:i,a=t.shear||0,l=t.rotate||t.theta||0,u=new St(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=u.x,d=u.y,p=new St(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),f=p.x,m=p.y,g=new St(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,x=g.y,w=new St(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:h,skewX:r,skewY:s,shear:a,theta:l,rx:w.x,ry:w.y,tx:y,ty:x,ox:c,oy:d,px:f,py:m}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,n){const i=t.a*e.a+t.c*e.b,r=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,h=t.e+t.a*e.e+t.c*e.f,a=t.f+t.b*e.e+t.d*e.f;return n.a=i,n.b=r,n.c=s,n.d=o,n.e=h,n.f=a,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const i=t||0,r=e||0;return this.translateO(-i,-r).lmultiplyO(n).translateO(i,r)}clone(){return new Et(this)}decompose(t=0,e=0){const n=this.a,i=this.b,r=this.c,s=this.d,o=this.e,h=this.f,a=n*s-i*r,l=a>0?1:-1,u=l*Math.sqrt(n*n+i*i),c=Math.atan2(l*i,l*n),d=180/Math.PI*c,p=Math.cos(c),f=Math.sin(c),m=(n*r+i*s)/a,g=r*u/(m*n-i)||s*u/(m*i+n);return{scaleX:u,scaleY:g,shear:m,rotate:d,translateX:o-t+t*p*u+e*(m*p*u-f*g),translateY:h-e+t*f*u+e*(m*f*u+p*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new Et(t);return Ct(this.a,e.a)&&Ct(this.b,e.b)&&Ct(this.c,e.c)&&Ct(this.d,e.d)&&Ct(this.e,e.e)&&Ct(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=Et.fromArray([1,0,0,1,0,0]);return t=t instanceof Qt?t.matrixify():"string"==typeof t?Et.fromArray(t.split(xt).map(parseFloat)):Array.isArray(t)?Et.fromArray(t):"object"==typeof t&&Et.isMatrixLike(t)?t:"object"==typeof t?(new Et).transform(t):6===arguments.length?Et.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,n=this.c,i=this.d,r=this.e,s=this.f,o=t*i-e*n;if(!o)throw new Error("Cannot invert "+this);const h=i/o,a=-e/o,l=-n/o,u=t/o,c=-(h*r+l*s),d=-(a*r+u*s);return this.a=h,this.b=a,this.c=l,this.d=u,this.e=c,this.f=d,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof Et?t:new Et(t);return Et.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof Et?t:new Et(t);return Et.matrixMultiply(this,e,this)}rotate(t,e,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=j(t);const i=Math.cos(t),r=Math.sin(t),{a:s,b:o,c:h,d:a,e:l,f:u}=this;return this.a=s*i-o*r,this.b=o*i+s*r,this.c=h*i-a*r,this.d=a*i+h*r,this.e=l*i-u*r+n*r-e*i+e,this.f=u*i+l*r-e*r-n*i+n,this}scale(){return this.clone().scaleO(...arguments)}scaleO(t,e=t,n=0,i=0){3===arguments.length&&(i=n,n=e,e=t);const{a:r,b:s,c:o,d:h,e:a,f:l}=this;return this.a=r*t,this.b=s*e,this.c=o*t,this.d=h*e,this.e=a*t-n*t+n,this.f=l*e-i*e+i,this}shear(t,e,n){return this.clone().shearO(t,e,n)}shearO(t,e=0,n=0){const{a:i,b:r,c:s,d:o,e:h,f:a}=this;return this.a=i+r*t,this.c=s+o*t,this.e=h+a*t-n*t,this}skew(){return this.clone().skewO(...arguments)}skewO(t,e=t,n=0,i=0){3===arguments.length&&(i=n,n=e,e=t),t=j(t),e=j(e);const r=Math.tan(t),s=Math.tan(e),{a:o,b:h,c:a,d:l,e:u,f:c}=this;return this.a=o+h*r,this.b=h+o*s,this.c=a+l*r,this.d=l+a*s,this.e=u+c*r-i*r,this.f=c+u*s-n*s,this}skewX(t,e,n){return this.skew(t,0,e,n)}skewY(t,e,n){return this.skew(0,t,e,n)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(Et.isMatrixLike(t)){return new Et(t).multiplyO(this)}const e=Et.formatTransforms(t),{x:n,y:i}=new St(e.ox,e.oy).transform(this),r=(new Et).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-n,-i).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(n,i);if(isFinite(e.px)||isFinite(e.py)){const t=new St(n,i).transform(r),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;r.translateO(s,o)}return r.translateO(e.tx,e.ty),r}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function At(){if(!At.nodes){const t=Q().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;At.nodes={svg:t,path:e}}if(!At.nodes.svg.node.parentNode){const t=G.document.body||G.document.documentElement;At.nodes.svg.addTo(t)}return At.nodes}function Tt(t){return!(t.width||t.height||t.x||t.y)}et(Et,"Matrix");class Ot{constructor(...t){this.init(...t)}addOffset(){return this.x+=G.window.pageXOffset,this.y+=G.window.pageYOffset,new Ot(this)}init(t){return t="string"==typeof t?t.split(xt).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return Tt(this)}merge(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),i=Math.max(this.x+this.width,t.x+t.width)-e,r=Math.max(this.y+this.height,t.y+t.height)-n;return new Ot(e,n,i,r)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof Et||(t=new Et(t));let e=1/0,n=-1/0,i=1/0,r=-1/0;return[new St(this.x,this.y),new St(this.x2,this.y),new St(this.x,this.y2),new St(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),n=Math.max(n,s.x),i=Math.min(i,s.y),r=Math.max(r,s.y)})),new Ot(e,i,n-e,r-i)}}function kt(t,e,n){let i;try{if(i=e(t.node),Tt(i)&&((r=t.node)!==G.document&&!(G.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===G.document}).call(G.document.documentElement,r)))throw new Error("Element not in the dom")}catch(s){i=n(t)}var r;return i}N({viewbox:{viewbox(t,e,n,i){return null==t?new Ot(this.attr("viewBox")):this.attr("viewBox",new Ot(t,e,n,i))},zoom(t,e){let{width:n,height:i}=this.attr(["width","height"]);if((n||i)&&"string"!=typeof n&&"string"!=typeof i||(n=this.node.clientWidth,i=this.node.clientHeight),!n||!i)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const r=this.viewbox(),s=n/r.width,o=i/r.height,h=Math.min(s,o);if(null==t)return h;let a=h/t;a===1/0&&(a=Number.MAX_SAFE_INTEGER/100),e=e||new St(n/2/s+r.x,i/2/o+r.y);const l=new Ot(r).transform(new Et({scale:a,origin:e}));return this.viewbox(l)}}}),et(Ot,"Box");class Rt extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}st([Rt],{each(t,...e){return"function"==typeof t?this.map(((e,n,i)=>t.call(e,e,n,i))):this.map((n=>n[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const Nt=["toArray","constructor","each"];function zt(t,e){return new Rt(I((e||G.document).querySelectorAll(t),(function(t){return K(t)})))}Rt.extend=function(t){t=t.reduce(((t,e)=>(Nt.includes(e)||"_"===e[0]||(e in Array.prototype&&(t["$"+e]=Array.prototype[e]),t[e]=function(...t){return this.each(e,...t)}),t)),{}),st([Rt],t)};let Xt=0;const It={};function jt(t){let e=t.getEventHolder();return e===G.window&&(e=It),e.events||(e.events={}),e.events}function Pt(t){return t.getEventTarget()}function $t(t,e,n,i,r){const s=n.bind(i||t),o=Q(t),h=jt(o),a=Pt(o);e=Array.isArray(e)?e:e.split(xt),n._svgjsListenerId||(n._svgjsListenerId=++Xt),e.forEach((function(t){const e=t.split(".")[0],i=t.split(".")[1]||"*";h[e]=h[e]||{},h[e][i]=h[e][i]||{},h[e][i][n._svgjsListenerId]=s,a.addEventListener(e,s,r||!1)}))}function Lt(t,e,n,i){const r=Q(t),s=jt(r),o=Pt(r);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(xt)).forEach((function(t){const e=t&&t.split(".")[0],h=t&&t.split(".")[1];let a,l;if(n)s[e]&&s[e][h||"*"]&&(o.removeEventListener(e,s[e][h||"*"][n],i||!1),delete s[e][h||"*"][n]);else if(e&&h){if(s[e]&&s[e][h]){for(l in s[e][h])Lt(o,[e,h].join("."),l);delete s[e][h]}}else if(h)for(t in s)for(a in s[t])h===a&&Lt(o,[t,h].join("."));else if(e){if(s[e]){for(a in s[e])Lt(o,[e,a].join("."));delete s[e]}}else{for(t in s)Lt(o,t);!function(t){let e=t.getEventHolder();e===G.window&&(e=It),e.events&&(e.events={})}(r)}}))}class Dt extends W{addEventListener(){}dispatch(t,e,n){return function(t,e,n,i){const r=Pt(t);return e instanceof G.window.Event||(e=new G.window.CustomEvent(e,{detail:n,cancelable:!0,...i})),r.dispatchEvent(e),e}(this,t,e,n)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const n=e[t.type];for(const i in n)for(const e in n[i])n[i][e](t);return!t.defaultPrevented}fire(t,e,n){return this.dispatch(t,e,n),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,n){return Lt(this,t,e,n),this}on(t,e,n,i){return $t(this,t,e,n,i),this}removeEventListener(){}}function Yt(){}et(Dt,"EventTarget");const Ft=400,Bt=">",Vt=0,Ht={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};class Gt extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(xt).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class Wt{constructor(...t){this.init(...t)}convert(t){return new Wt(this.value,t)}divide(t){return t=new Wt(t),new Wt(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(ht))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof Wt&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new Wt(t),new Wt(this-t,this.unit||t.unit)}plus(t){return t=new Wt(t),new Wt(this+t,this.unit||t.unit)}times(t){return t=new Wt(t),new Wt(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const qt=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),Zt=[];class Ut extends Dt{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=Q(t)).removeNamespace&&this.node instanceof G.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return Q(t).put(this,e)}children(){return new Rt(I(this.node.children,(function(t){return K(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let n=this.node.cloneNode(t);return e&&(n=rt(n)),new this.constructor(n)}each(t,e){const n=this.children();let i,r;for(i=0,r=n.length;i<r;i++)t.apply(n[i],[i,n]),e&&n[i].each(t,e);return this}element(t,e){return this.put(new Ut(U(t),e))}first(){return K(this.node.firstChild)}get(t){return K(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}html(t,e){return this.xml(t,e,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=it(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return K(this.node.lastChild)}matches(t){const e=this.node,n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=K(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=K(e.node.parentNode));return e}put(t,e){return t=Q(t),this.add(t,e),t}putIn(t,e){return Q(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=Q(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const n=10**t,i=this.attr(e);for(const r in i)"number"==typeof i[r]&&(i[r]=Math.round(i[r]*n)/n);return this.attr(i),this}svg(t,e){return this.xml(t,e,B)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const n=e.index(this);return e.put(t,n).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let n=this;if(null!=t){if(n=K(n.node.cloneNode(!0)),e){const e=t(n);if(n=e||n,!1===e)return""}n.each((function(){const e=t(this),n=e||this;!1===e?this.remove():e&&this!==n&&this.replace(n)}),!0)}return e?n.node.outerHTML:n.node.innerHTML}e=null!=e&&e;const i=U("wrapper",n),r=G.document.createDocumentFragment();i.innerHTML=t;for(let o=i.children.length;o--;)r.appendChild(i.firstElementChild);const s=this.parent();return e?this.replace(r)&&s:this.add(r)}}st(Ut,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=gt.test(n.nodeValue)?parseFloat(n.nodeValue):n.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?Ht[t]:gt.test(e)?parseFloat(e):e;"number"==typeof(e=Zt.reduce(((e,n)=>n(t,e,this)),e))?e=new Wt(e):qt.has(t)&&Mt.isColor(e)?e=new Mt(e):e.constructor===Array&&(e=new Gt(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof n?this.node.setAttributeNS(n,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return zt(t,this.node)},findOne:function(t){return K(this.node.querySelector(t))}}),et(Ut,"Dom");class Qt extends Ut{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,(t.hasAttribute("data-svgjs")||t.hasAttribute("svgjs:data"))&&this.setData(JSON.parse(t.getAttribute("data-svgjs"))??JSON.parse(t.getAttribute("svgjs:data"))??{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new Wt(t).plus(this.x()))}dy(t=0){return this.y(new Wt(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){const e="string"==typeof t;e||(t=Q(t));const n=new Rt;let i=this;for(;(i=i.parent())&&i.node!==G.document&&"#document-fragment"!==i.nodeName&&(n.push(i),e||i.node!==t.node)&&(!e||!i.matches(t));)if(i.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(ut);return e?Q(e[1]):null}root(){const t=this.parent(q[Z]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=$(this,t,e);return this.width(new Wt(n.width)).height(new Wt(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return F(this,this.dom),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}st(Qt,{bbox:function(){const t=kt(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(At().svg).show(),n=e.node.getBBox();return e.remove(),n}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new Ot(t)},rbox:function(t){const e=kt(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new Ot(e);return t?n.transform(t.screenCTM().inverseO()):n.addOffset()},inside:function(t,e){const n=this.bbox();return t>n.x&&e>n.y&&t<n.x+n.width&&e<n.y+n.height},point:function(t,e){return new St(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new Et(this.node.getCTM())},screenCTM:function(){try{if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new Et(e)}return new Et(this.node.getScreenCTM())}catch(t){return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new Et}}}),et(Qt,"Element");const Jt={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let n;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof Mt||Mt.isRgb(e)||e instanceof Qt)this.attr(t,e);else for(n=Jt[t].length-1;n>=0;n--)null!=e[Jt[t][n]]&&this.attr(Jt.prefix(t,Jt[t][n]),e[Jt[t][n]]);return this},N(["Element","Runner"],e)})),N(["Element","Runner"],{matrix:function(t,e,n,i,r,s){return null==t?new Et(this):this.attr("transform",new Et(t,e,n,i,r,s))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,i){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:i},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,i){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:i},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),N("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new Wt(t)):this.rx(t).ry(e)}}),N("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new St(this.node.getPointAtLength(t))}}),N(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}});N("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),N("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(ct).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(xt).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(Et.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new Et)},toParent:function(t,e){if(this===t)return this;if(Y(this.node))return this.addTo(t,e);const n=this.screenCTM(),i=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(i.multiply(n)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new Et(this).decompose();return null==t?e:e[t]}Et.isMatrixLike(t)||(t={...t,origin:L(t,this)});const n=new Et(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});class Kt extends Qt{flatten(){return this.each((function(){if(this instanceof Kt)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(n,i){return i[i.length-n-1].toParent(t,e)})),this.remove()}}et(Kt,"Container");class te extends Kt{constructor(t,e=t){super(J("defs",t),e)}flatten(){return this}ungroup(){return this}}et(te,"Defs");class ee extends Qt{}function ne(t){return this.attr("rx",t)}function ie(t){return this.attr("ry",t)}function re(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function se(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function oe(t){return this.attr("cx",t)}function he(t){return this.attr("cy",t)}function ae(t){return null==t?2*this.rx():this.rx(new Wt(t).divide(2))}function le(t){return null==t?2*this.ry():this.ry(new Wt(t).divide(2))}et(ee,"Shape");const ue=Object.freeze(Object.defineProperty({__proto__:null,cx:oe,cy:he,height:le,rx:ne,ry:ie,width:ae,x:re,y:se},Symbol.toStringTag,{value:"Module"}));class ce extends ee{constructor(t,e=t){super(J("ellipse",t),e)}size(t,e){const n=$(this,t,e);return this.rx(new Wt(n.width).divide(2)).ry(new Wt(n.height).divide(2))}}st(ce,ue),N("Container",{ellipse:ot((function(t=0,e=t){return this.put(new ce).size(t,e).move(0,0)}))}),et(ce,"Ellipse");class de extends Ut{constructor(t=G.document.createDocumentFragment()){super(t)}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){const t=new Ut(U("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}}function pe(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new Wt(t),fy:new Wt(e)}):this.attr({x1:new Wt(t),y1:new Wt(e)})}function fe(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new Wt(t),cy:new Wt(e)}):this.attr({x2:new Wt(t),y2:new Wt(e)})}et(de,"Fragment");const me=Object.freeze(Object.defineProperty({__proto__:null,from:pe,to:fe},Symbol.toStringTag,{value:"Module"}));class ge extends Kt{constructor(t,e){super(J(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,n){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,n)}bbox(){return new Ot}targets(){return zt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}st(ge,me),N({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:ot((function(t,e){return this.put(new ge(t)).update(e)}))}}),et(ge,"Gradient");class ye extends Kt{constructor(t,e=t){super(J("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new Ot}targets(){return zt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}N({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:ot((function(t,e,n){return this.put(new ye).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),et(ye,"Pattern");let xe=class extends ee{constructor(t,e=t){super(J("image",t),e)}load(t,e){if(!t)return this;const n=new G.window.Image;return $t(n,"load",(function(t){const i=this.parent(ye);0===this.width()&&0===this.height()&&this.size(n.width,n.height),i instanceof ye&&0===i.width()&&0===i.height()&&i.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),$t(n,"load error",(function(){Lt(n)})),this.attr("href",n.src=t,H)}};var we;we=function(t,e,n){return"fill"!==t&&"stroke"!==t||yt.test(e)&&(e=n.root().defs().image(e)),e instanceof xe&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},Zt.push(we),N({Container:{image:ot((function(t,e){return this.put(new xe).size(0,0).load(t,e)}))}}),et(xe,"Image");class be extends Gt{bbox(){let t=-1/0,e=-1/0,n=1/0,i=1/0;return this.forEach((function(r){t=Math.max(r[0],t),e=Math.max(r[1],e),n=Math.min(r[0],n),i=Math.min(r[1],i)})),new Ot(n,i,t-n,e-i)}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let i=this.length-1;i>=0;i--)this[i]=[this[i][0]+t,this[i][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(xt).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,i=t.length;n<i;n+=2)e.push([t[n],t[n+1]]);return e}size(t,e){let n;const i=this.bbox();for(n=this.length-1;n>=0;n--)i.width&&(this[n][0]=(this[n][0]-i.x)*t/i.width+i.x),i.height&&(this[n][1]=(this[n][1]-i.y)*e/i.height+i.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,n=this.length;e<n;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){Et.isMatrixLike(t)||(t=new Et(t));for(let e=this.length;e--;){const[n,i]=this[e];this[e][0]=t.a*n+t.c*i+t.e,this[e][1]=t.b*n+t.d*i+t.f}return this}}const _e=be;const ve=Object.freeze(Object.defineProperty({__proto__:null,MorphArray:_e,height:function(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)},width:function(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)},x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}},Symbol.toStringTag,{value:"Module"}));class Me extends ee{constructor(t,e=t){super(J("line",t),e)}array(){return new be([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,n,i){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:i}:new be(t).toLine(),this.attr(t))}size(t,e){const n=$(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}}st(Me,ve),N({Container:{line:ot((function(...t){return Me.prototype.plot.apply(this.put(new Me),null!=t[0]?t:[0,0,0,0])}))}}),et(Me,"Line");class Se extends Kt{constructor(t,e=t){super(J("marker",t),e)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}}function Ce(t,e){return function(n){return null==n?this[t]:(this[t]=n,e&&e.call(this),this)}}N({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:ot((function(t,e,n){return this.put(new Se).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}))},marker:{marker(t,e,n,i){let r=["marker"];return"all"!==t&&r.push(t),r=r.join("-"),t=arguments[1]instanceof Se?arguments[1]:this.defs().marker(e,n,i),this.attr(r,t)}}}),et(Se,"Marker");const Ee={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,n,i){return function(r){return r<0?t>0?e/t*r:n>0?i/n*r:0:r>1?n<1?(1-i)/(1-n)*r+(i-n)/(1-n):t<1?(1-e)/(1-t)*r+(e-t)/(1-t):1:3*r*(1-r)**2*e+3*r**2*(1-r)*i+r**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(i,r=!1)=>{let s=Math.floor(i*t);const o=i*s%1==0;return"start"!==e&&"both"!==e||++s,r&&o&&--s,i>=0&&s<0&&(s=0),i<=1&&s>n&&(s=n),s/n}}};class Ae{done(){return!1}}class Te extends Ae{constructor(t=Bt){super(),this.ease=Ee[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}class Oe extends Ae{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,i){return this.stepper(t,e,n,i)}}function ke(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,i=Math.log(e/100+1e-10),r=-i/Math.sqrt(n*n+i*i),s=3.9/(r*t);this.d=2*r*s,this.k=s*s}st(class extends Oe{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,n,i){if("string"==typeof t)return t;if(i.done=n===1/0,n===1/0)return e;if(0===n)return t;n>100&&(n=16),n/=1e3;const r=i.velocity||0,s=-this.d*r-this.k*(t-e),o=t+r*n+s*n*n/2;return i.velocity=r+s*n,i.done=Math.abs(e-o)+Math.abs(r)<.002,i.done?e:o}},{duration:Ce("_duration",ke),overshoot:Ce("_overshoot",ke)});st(class extends Oe{constructor(t=.1,e=.01,n=0,i=1e3){super(),this.p(t).i(e).d(n).windup(i)}step(t,e,n,i){if("string"==typeof t)return t;if(i.done=n===1/0,n===1/0)return e;if(0===n)return t;const r=e-t;let s=(i.integral||0)+r*n;const o=(r-(i.error||0))/n,h=this._windup;return!1!==h&&(s=Math.max(-h,Math.min(s,h))),i.error=r,i.integral=s,i.done=Math.abs(r)<.001,i.done?e:t+(this.P*r+this.I*s+this.D*o)}},{windup:Ce("_windup"),p:Ce("P"),i:Ce("I"),d:Ce("D")});const Re={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Ne={M:function(t,e,n){return e.x=n.x=t[0],e.y=n.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,n){return e.x=n.x,e.y=n.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},ze="mlhvqtcsaz".split("");for(let jn=0,Pn=ze.length;jn<Pn;++jn)Ne[ze[jn]]=function(t){return function(e,n,i){if("H"===t)e[0]=e[0]+n.x;else if("V"===t)e[0]=e[0]+n.y;else if("A"===t)e[5]=e[5]+n.x,e[6]=e[6]+n.y;else for(let t=0,r=e.length;t<r;++t)e[t]=e[t]+(t%2?n.y:n.x);return Ne[t](e,n,i)}}(ze[jn].toUpperCase());function Xe(t){return t.segment.length&&t.segment.length-1===Re[t.segment[0].toUpperCase()]}function Ie(t,e){t.inNumber&&je(t,!1);const n=wt.test(e);if(n)t.segment=[e];else{const e=t.lastCommand,n=e.toLowerCase(),i=e===n;t.segment=["m"===n?i?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],n}function je(t,e){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=e,t.number="",t.pointSeen=!1,t.hasExponent=!1,Xe(t)&&Pe(t)}function Pe(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return Ne[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function $e(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),n=t.segment.length;return e&&(4===n||5===n)}function Le(t){return"E"===t.lastToken.toUpperCase()}const De=new Set([" ",",","\t","\n","\r","\f"]);class Ye extends Gt{bbox(){return At().path.setAttribute("d",this.toString()),new Ot(At.nodes.path.getBBox())}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let i,r=this.length-1;r>=0;r--)i=this[r][0],"M"===i||"L"===i||"T"===i?(this[r][1]+=t,this[r][2]+=e):"H"===i?this[r][1]+=t:"V"===i?this[r][1]+=e:"C"===i||"S"===i||"Q"===i?(this[r][1]+=t,this[r][2]+=e,this[r][3]+=t,this[r][4]+=e,"C"===i&&(this[r][5]+=t,this[r][6]+=e)):"A"===i&&(this[r][6]+=t,this[r][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let n=0,i="";const r={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new St,p:new St};for(;r.lastToken=i,i=t.charAt(n++);)if(r.inSegment||!Ie(r,i))if("."!==i)if(isNaN(parseInt(i)))if(De.has(i))r.inNumber&&je(r,!1);else if("-"!==i&&"+"!==i)if("E"!==i.toUpperCase()){if(wt.test(i)){if(r.inNumber)je(r,!1);else{if(!Xe(r))throw new Error("parser Error");Pe(r)}--n}}else r.number+=i,r.hasExponent=!0;else{if(r.inNumber&&!Le(r)){je(r,!1),--n;continue}r.number+=i,r.inNumber=!0}else{if("0"===r.number||$e(r)){r.inNumber=!0,r.number=i,je(r,!0);continue}r.inNumber=!0,r.number+=i}else{if(r.pointSeen||r.hasExponent){je(r,!1),--n;continue}r.inNumber=!0,r.pointSeen=!0,r.number+=i}return r.inNumber&&je(r,!1),r.inSegment&&Xe(r)&&Pe(r),r.segments}(t)}size(t,e){const n=this.bbox();let i,r;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,i=this.length-1;i>=0;i--)r=this[i][0],"M"===r||"L"===r||"T"===r?(this[i][1]=(this[i][1]-n.x)*t/n.width+n.x,this[i][2]=(this[i][2]-n.y)*e/n.height+n.y):"H"===r?this[i][1]=(this[i][1]-n.x)*t/n.width+n.x:"V"===r?this[i][1]=(this[i][1]-n.y)*e/n.height+n.y:"C"===r||"S"===r||"Q"===r?(this[i][1]=(this[i][1]-n.x)*t/n.width+n.x,this[i][2]=(this[i][2]-n.y)*e/n.height+n.y,this[i][3]=(this[i][3]-n.x)*t/n.width+n.x,this[i][4]=(this[i][4]-n.y)*e/n.height+n.y,"C"===r&&(this[i][5]=(this[i][5]-n.x)*t/n.width+n.x,this[i][6]=(this[i][6]-n.y)*e/n.height+n.y)):"A"===r&&(this[i][1]=this[i][1]*t/n.width,this[i][2]=this[i][2]*e/n.height,this[i][6]=(this[i][6]-n.x)*t/n.width+n.x,this[i][7]=(this[i][7]-n.y)*e/n.height+n.y);return this}toString(){return function(t){let e="";for(let n=0,i=t.length;n<i;n++)e+=t[n][0],null!=t[n][1]&&(e+=t[n][1],null!=t[n][2]&&(e+=" ",e+=t[n][2],null!=t[n][3]&&(e+=" ",e+=t[n][3],e+=" ",e+=t[n][4],null!=t[n][5]&&(e+=" ",e+=t[n][5],e+=" ",e+=t[n][6],null!=t[n][7]&&(e+=" ",e+=t[n][7])))));return e+" "}(this)}}const Fe=t=>{const e=typeof t;return"number"===e?Wt:"string"===e?Mt.isColor(t)?Mt:xt.test(t)?wt.test(t)?Ye:Gt:ht.test(t)?Wt:Ve:qe.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?Gt:"object"===e?We:Ve};class Be{constructor(t){this._stepper=t||new Te("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(Fe(t));let e=new this._type(t);return this._type===Mt&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===We&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class Ve{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class He{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,He.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}He.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const Ge=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class We{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,i=e.length;n<i;++n){if(e[n+1]===t[n+1]){if(e[n+1]===Mt&&t[n+7]!==e[n+7]){const e=t[n+7],i=new Mt(this.values.splice(n+3,5))[e]().toArray();this.values.splice(n+3,0,...i)}n+=e[n+2]+2;continue}if(!t[n+1])return this;const i=(new t[n+1]).toArray(),r=e[n+2]+3;e.splice(n,r,t[n],t[n+1],t[n+2],...i),n+=e[n+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const n in t){const i=Fe(t[n]),r=new i(t[n]).toArray();e.push([n,i,r.length,...r])}return e.sort(Ge),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const n=e.shift(),i=e.shift(),r=e.shift(),s=e.splice(0,r);t[n]=new i(s)}return t}}const qe=[Ve,He,We];class Ze extends ee{constructor(t,e=t){super(J("path",t),e)}array(){return this._array||(this._array=new Ye(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new Ye(t))}size(t,e){const n=$(this,t,e);return this.attr("d",this.array().size(n.width,n.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}Ze.prototype.MorphArray=Ye,N({Container:{path:ot((function(t){return this.put(new Ze).plot(t||new Ye)}))}}),et(Ze,"Path");const Ue=Object.freeze(Object.defineProperty({__proto__:null,array:function(){return this._array||(this._array=new be(this.attr("points")))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new be(t))},size:function(t,e){const n=$(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}},Symbol.toStringTag,{value:"Module"}));class Qe extends ee{constructor(t,e=t){super(J("polygon",t),e)}}N({Container:{polygon:ot((function(t){return this.put(new Qe).plot(t||new be)}))}}),st(Qe,ve),st(Qe,Ue),et(Qe,"Polygon");class Je extends ee{constructor(t,e=t){super(J("polyline",t),e)}}N({Container:{polyline:ot((function(t){return this.put(new Je).plot(t||new be)}))}}),st(Je,ve),st(Je,Ue),et(Je,"Polyline");class Ke extends ee{constructor(t,e=t){super(J("rect",t),e)}}st(Ke,{rx:ne,ry:ie}),N({Container:{rect:ot((function(t,e){return this.put(new Ke).size(t,e)}))}}),et(Ke,"Rect");class tn{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const en={nextDraw:null,frames:new tn,timeouts:new tn,immediates:new tn,timer:()=>G.window.performance||G.window.Date,transforms:[],frame(t){const e=en.frames.push({run:t});return null===en.nextDraw&&(en.nextDraw=G.window.requestAnimationFrame(en._draw)),e},timeout(t,e){e=e||0;const n=en.timer().now()+e,i=en.timeouts.push({run:t,time:n});return null===en.nextDraw&&(en.nextDraw=G.window.requestAnimationFrame(en._draw)),i},immediate(t){const e=en.immediates.push(t);return null===en.nextDraw&&(en.nextDraw=G.window.requestAnimationFrame(en._draw)),e},cancelFrame(t){null!=t&&en.frames.remove(t)},clearTimeout(t){null!=t&&en.timeouts.remove(t)},cancelImmediate(t){null!=t&&en.immediates.remove(t)},_draw(t){let e=null;const n=en.timeouts.last();for(;(e=en.timeouts.shift())&&(t>=e.time?e.run():en.timeouts.push(e),e!==n););let i=null;const r=en.frames.last();for(;i!==r&&(i=en.frames.shift());)i.run(t);let s=null;for(;s=en.immediates.shift();)s();en.nextDraw=en.timeouts.first()||en.frames.first()?G.window.requestAnimationFrame(en._draw):null}},nn=function(t){const e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},rn=function(){const t=G.window;return(t.performance||t.Date).now()};class sn extends Dt{constructor(t=rn){super(),this._timeSource=t,this.terminate()}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const n=Math.abs(e);return this.speed(t?-n:n)}schedule(t,e,n){if(null==t)return this._runners.map(nn);let i=0;const r=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)i=r;else if("absolute"===n||"start"===n)i=e,e=0;else if("now"===n)i=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(i=n.start+e,e=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();i=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:i+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return en.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=en.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let n=e-this._lastSourceTime;t&&(n=0);const i=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=i,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let s=this._runners.length;s--;){const t=this._runners[s],e=t.runner;this._time-t.start<=0&&e.reset()}let r=!1;for(let s=0,o=this._runners.length;s<o;s++){const t=this._runners[s],e=t.runner;let n=i;const h=this._time-t.start;if(h<=0){r=!0;continue}if(h<n&&(n=h),!e.active())continue;if(e.step(n).done){if(!0!==t.persist){e.duration()-e.time()+this._time+t.persist<this._time&&(e.unschedule(),--s,--o)}}else r=!0}return r&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}terminate(){this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}}N({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new sn,this._timeline):(this._timeline=t,this)}}});class on extends Dt{constructor(t){super(),this.id=on.id++,t="function"==typeof(t=null==t?Ft:t)?new Oe(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof Oe,this._stepper=this._isDeclarative?t:new Te,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new Et,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,n){let i=1,r=!1,s=0;return e=e??Vt,n=n||"last","object"!=typeof(t=t??Ft)||t instanceof Ae||(e=t.delay??e,n=t.when??n,r=t.swing||r,i=t.times??i,s=t.wait??s,t=t.duration??Ft),{duration:t,delay:e,swing:r,times:i,wait:s,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,n){const i=on.sanitise(t,e,n),r=new on(i.duration);return this._timeline&&r.timeline(this._timeline),this._element&&r.element(this._element),r.loop(i).schedule(i.delay,i.when)}clearTransform(){return this.transforms=new Et,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new Te(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,n){return"object"==typeof t&&(e=t.swing,n=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=n||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),n=(this._time-t*e)/this._duration;return Math.min(t+n,this._times)}const n=t%1,i=e*Math.floor(t)+this._duration*n;return this.time(i)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,n=this._duration,i=this._wait,r=this._times,s=this._swing,o=this._reverse;let h;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(i+n))/(i+n)),r=e&&!o||!e&&o,h=Math.pow(-1,r)*(t%(i+n))/n+r;return Math.max(Math.min(h,1),0)},a=r*(i+n)-i;return h=e<=0?Math.round(t(1e-5)):e<a?t(e):Math.round(t(a-1e-5)),h}const a=Math.floor(this.loops()),l=s&&a%2==0;return h=a+(l&&!o||o&&l?t:1-t),this.loops(h)}progress(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}queue(t,e,n,i){this._queue.push({initialiser:t||Yt,runner:e||Yt,retarget:n,isTransform:i,initialised:!1,finished:!1});return this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,n){if(t instanceof sn||(n=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,n),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),n=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const i=this.duration(),r=this._lastTime<=0&&this._time>0,s=this._lastTime<i&&this._time>=i;this._lastTime=this._time,r&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=i,this._reseted=!1;let h=!1;return(n||o)&&(this._initialise(n),this.transforms=new Et,h=this._run(o?t:e),this.fire("step",this)),this.done=this.done||h&&o,s&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,n=this._queue.length;e<n;++e){const n=this._queue[e],i=this._isDeclarative||!n.initialised&&t;t=!n.finished,i&&t&&(n.initialiser.call(this),n.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let n=0,i=this._queue.length;n<i;++n){const i=this._queue[n],r=i.runner.call(this,t);i.finished=i.finished||!0===r,e=e&&i.finished}return e}_tryRetarget(t,e,n){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,n):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const i=this.timeline();return i&&i.play(),!0}return!1}}on.id=0;class hn{constructor(t=new Et,e=-1,n=!0){this.transforms=t,this.id=e,this.done=n}clearTransformsFromQueue(){}}st([on,hn],{mergeWith(t){return new hn(t.transforms.lmultiply(this.transforms),t.id)}});const an=(t,e)=>t.lmultiplyO(e),ln=t=>t.transforms;function un(){const t=this._transformationRunners.runners.map(ln).reduce(an,new Et);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class cn{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new hn).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const n=this.ids.indexOf(t+1);return this.ids.splice(n,1,t+1),this.runners.splice(n,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;e<this.runners.length;++e){const n=this.runners[e];if(t&&n.done&&t.done&&(!n._timeline||!n._timeline._runnerIds.includes(n.id))&&(!t._timeline||!t._timeline._runnerIds.includes(t.id))){this.remove(n.id);const i=n.mergeWith(t);this.edit(t.id,i),t=i,--e}else t=n}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}}N({Element:{animate(t,e,n){const i=on.sanitise(t,e,n),r=this.timeline();return new on(i.duration).loop(i).element(this).timeline(r.play()).schedule(i.delay,i.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map(ln).reduce(an,new Et)},_addRunner(t){this._transformationRunners.add(t),en.cancelImmediate(this._frameId),this._frameId=en.immediate(un.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new cn).add(new hn(new Et(this))))}}});st(on,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,n){if("string"==typeof e)return this.styleAttr(t,{[e]:n});let i=e;if(this._tryRetarget(t,i))return this;let r=new Be(this._stepper).to(i),s=Object.keys(i);return this.queue((function(){r=r.from(this.element()[t](s))}),(function(e){return this.element()[t](r.at(e).valueOf()),r.done()}),(function(e){const n=Object.keys(e),o=(h=s,n.filter((t=>!h.includes(t))));var h;if(o.length){const e=this.element()[t](o),n=new We(r.from()).valueOf();Object.assign(n,e),r.from(n)}const a=new We(r.to()).valueOf();Object.assign(a,e),r.to(a),s=n,i=e})),this._rememberMorpher(t,r),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new Be(this._stepper).to(new Wt(t));return this.queue((function(){n=n.from(this.element().zoom())}),(function(t){return this.element().zoom(n.at(t),e),n.done()}),(function(t,i){e=i,n.to(t)})),this._rememberMorpher("zoom",n),this},transform(t,e,n){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const i=Et.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!i;const r=new Be(this._stepper).type(n?He:Et);let s,o,h,a,l;return this.queue((function(){o=o||this.element(),s=s||L(t,o),l=new Et(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(u){e||this.clearTransform();const{x:c,y:d}=new St(s).transform(o._currentTransform(this));let p=new Et({...t,origin:[c,d]}),f=this._isDeclarative&&h?h:l;if(n){p=p.decompose(c,d),f=f.decompose(c,d);const t=p.rotate,e=f.rotate,n=[t-360,t,t+360],i=n.map((t=>Math.abs(t-e))),r=Math.min(...i),s=i.indexOf(r);p.rotate=n[s]}e&&(i||(p.rotate=t.rotate||0),this._isDeclarative&&a&&(f.rotate=a)),r.from(f),r.to(p);const m=r.at(u);return a=m.rotate,h=new Et(m),this.addTransform(h),o._addRunner(this),r.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=L(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",r),this},x(t){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},ax(t){return this._queueNumber("ax",t)},ay(t){return this._queueNumber("ay",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new Wt(e),this._tryRetarget(t,e))return this;const n=new Be(this._stepper).to(e);let i=null;return this.queue((function(){i=this.element()[t](),n.from(i),n.to(i+e)}),(function(e){return this.element()[t](n.at(e)),n.done()}),(function(t){n.to(i+new Wt(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new Be(this._stepper).to(e);return this.queue((function(){n.from(this.element()[t]())}),(function(e){return this.element()[t](n.at(e)),n.done()})),this._rememberMorpher(t,n),this},_queueNumber(t,e){return this._queueObject(t,new Wt(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},amove(t,e){return this.ax(t).ay(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let n;return t&&e||(n=this._element.bbox()),t||(t=n.width/n.height*e),e||(e=n.height/n.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,n,i){if(4===arguments.length)return this.plot([t,e,n,i]);if(this._tryRetarget("plot",t))return this;const r=new Be(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){r.from(this._element.array())}),(function(t){return this._element.plot(r.at(t)),r.done()})),this._rememberMorpher("plot",r),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,i){return this._queueObject("viewbox",new Ot(t,e,n,i))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),st(on,{rx:ne,ry:ie,from:pe,to:fe}),et(on,"Runner");class dn extends Kt{constructor(t,e=t){super(J("svg",t),e),this.namespace()}defs(){return this.isRoot()?K(this.node.querySelector("defs"))||this.put(new te):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof G.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:B,version:"1.1"}).attr("xmlns:xlink",H,V):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,V).attr("xmlns:svgjs",null,V)}root(){return this.isRoot()?this:super.root()}}N({Container:{nested:ot((function(){return this.put(new dn)}))}}),et(dn,"Svg",!0);let pn=class extends Kt{constructor(t,e=t){super(J("symbol",t),e)}};N({Container:{symbol:ot((function(){return this.put(new pn)}))}}),et(pn,"Symbol");const fn=Object.freeze(Object.defineProperty({__proto__:null,amove:function(t,e){return this.ax(t).ay(e)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},build:function(t){return this._build=!!t,this},center:function(t,e,n=this.bbox()){return this.cx(t,n).cy(e,n)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)},length:function(){return this.node.getComputedTextLength()},move:function(t,e,n=this.bbox()){return this.x(t,n).y(e,n)},plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(G.document.createTextNode(t)),this},x:function(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)}},Symbol.toStringTag,{value:"Module"}));class mn extends ee{constructor(t,e=t){super(J("text",t),e),this.dom.leading=this.dom.leading??new Wt(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new Wt(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const n=this.dom.leading;this.each((function(i){if(Y(this.node))return;const r=G.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=n*new Wt(r);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",i?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new Wt(t.leading||1.3),this}writeDataToDom(){return F(this,this.dom,{leading:1.3}),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let i=0,r=e.length;i<r;++i)"textPath"===e[i].nodeName||Y(e[i])?0===i&&(n=i+1):(i!==n&&3!==e[i].nodeType&&!0===K(e[i]).dom.newLined&&(t+="\n"),t+=e[i].textContent);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,n=(t=(t+"").split("\n")).length;e<n;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}st(mn,fn),N({Container:{text:ot((function(t=""){return this.put(new mn).text(t)})),plain:ot((function(t=""){return this.put(new mn).plain(t)}))}}),et(mn,"Text");class gn extends ee{constructor(t,e=t){super(J("tspan",t),e),this._build=!1}dx(t){return this.attr("dx",t)}dy(t){return this.attr("dy",t)}newLine(){this.dom.newLined=!0;const t=this.parent();if(!(t instanceof mn))return this;const e=t.index(this),n=G.window.getComputedStyle(this.node).getPropertyValue("font-size"),i=t.dom.leading*new Wt(n);return this.dy(e?i:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}}st(gn,fn),N({Tspan:{tspan:ot((function(t=""){const e=new gn;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),et(gn,"Tspan");class yn extends ee{constructor(t,e=t){super(J("circle",t),e)}radius(t){return this.attr("r",t)}rx(t){return this.attr("r",t)}ry(t){return this.rx(t)}size(t){return this.radius(new Wt(t).divide(2))}}st(yn,{x:re,y:se,cx:oe,cy:he,width:ae,height:le}),N({Container:{circle:ot((function(t=0){return this.put(new yn).size(t).move(0,0)}))}}),et(yn,"Circle");class xn extends Kt{constructor(t,e=t){super(J("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return zt("svg [clip-path*="+this.id()+"]")}}N({Container:{clip:ot((function(){return this.defs().put(new xn)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof xn?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),et(xn,"ClipPath");class wn extends Qt{constructor(t,e=t){super(J("foreignObject",t),e)}}N({Container:{foreignObject:ot((function(t,e){return this.put(new wn).size(t,e)}))}}),et(wn,"ForeignObject");const bn=Object.freeze(Object.defineProperty({__proto__:null,dmove:function(t,e){return this.children().forEach((n=>{let i;try{i=n.node instanceof G.window.SVGSVGElement?new Ot(n.attr(["x","y","width","height"])):n.bbox()}catch(h){return}const r=new Et(n),s=r.translate(t,e).transform(r.inverse()),o=new St(i.x,i.y).transform(s);n.move(o.x,o.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,n=this.bbox()){const i=t-n.x,r=e-n.y;return this.dmove(i,r)},size:function(t,e,n=this.bbox()){const i=$(this,t,e,n),r=i.width/n.width,s=i.height/n.height;return this.children().forEach((t=>{const e=new St(n).transform(new Et(t).inverse());t.scale(r,s,e.x,e.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}},Symbol.toStringTag,{value:"Module"}));class _n extends Kt{constructor(t,e=t){super(J("g",t),e)}}st(_n,bn),N({Container:{group:ot((function(){return this.put(new _n)}))}}),et(_n,"G");class vn extends Kt{constructor(t,e=t){super(J("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,H)}}st(vn,bn),N({Container:{link:ot((function(t){return this.put(new vn).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const n=e.index(t);return e.add(this,n),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new vn,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),et(vn,"A");class Mn extends Kt{constructor(t,e=t){super(J("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return zt("svg [mask*="+this.id()+"]")}}N({Container:{mask:ot((function(){return this.defs().put(new Mn)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof Mn?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),et(Mn,"Mask");class Sn extends Qt{constructor(t,e=t){super(J("stop",t),e)}update(t){return("number"==typeof t||t instanceof Wt)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new Wt(t.offset)),this}}N({Gradient:{stop:function(t,e,n){return this.put(new Sn).update(t,e,n)}}}),et(Sn,"Stop");class Cn extends Qt{constructor(t,e=t){super(J("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,n={}){return this.rule("@font-face",{fontFamily:t,src:e,...n})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let n=t+"{";for(const i in e)n+=i.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[i]+";";return n+="}",n}(t,e))}}N("Dom",{style(t,e){return this.put(new Cn).rule(t,e)},fontface(t,e,n){return this.put(new Cn).font(t,e,n)}}),et(Cn,"Style");class En extends mn{constructor(t,e=t){super(J("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let n=null;return e&&(n=e.plot(t)),null==t?n:this}track(){return this.reference("href")}}N({Container:{textPath:ot((function(t,e){return t instanceof mn||(t=this.text(t)),t.path(e)}))},Text:{path:ot((function(t,e=!0){const n=new En;let i;if(t instanceof Ze||(t=this.defs().path(t)),n.attr("href","#"+t,H),e)for(;i=this.node.firstChild;)n.node.appendChild(i);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:ot((function(t){return t instanceof mn||(t=(new mn).addTo(this.parent()).text(t)),t.path(this)})),targets(){return zt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),En.prototype.MorphArray=Ye,et(En,"TextPath");class An extends ee{constructor(t,e=t){super(J("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,H)}}N({Container:{use:ot((function(t,e){return this.put(new An).use(t,e)}))}}),et(An,"Use");const Tn=Q;st([dn,pn,xe,ye,Se],z("viewbox")),st([Me,Je,Qe,Ze],z("marker")),st(mn,z("Text")),st(Ze,z("Path")),st(te,z("Defs")),st([mn,gn],z("Tspan")),st([Ke,ce,ge,on],z("radius")),st(Dt,z("EventTarget")),st(Ut,z("Dom")),st(Qt,z("Element")),st(ee,z("Shape")),st([Kt,de],z("Container")),st(ge,z("Gradient")),st(on,z("Runner")),Rt.extend([...new Set(R)]),function(t=[]){qe.push(...[].concat(t))}([Wt,Mt,Ot,Et,Gt,be,Ye,St]),st(qe,{to(t){return(new Be).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,n,i,r){return this.fromArray(t.map((function(t,s){return i.step(t,e[s],n,r[s],r)})))}});const On={width:400,height:400,contentKey:"name",nodeWidth:50,nodeHeight:30,nodeTemplate:t=>`<div style='display: flex;justify-content: center;align-items: center; text-align: center; height: 100%;'>${t}</div>`,nodeBGColor:"#FFFFFF",nodeBGColorHover:"#FFFFFF",nodeStyle:"",nodeClassName:"apextree-node",borderWidth:1,borderStyle:"solid",borderRadius:"5px",borderColor:"#BCBCBC",borderColorHover:"#5C6BC0",enableExpandCollapse:!1,siblingSpacing:50,childrenSpacing:50,direction:"top",highlightOnHover:!0,containerClassName:"root",enableTooltip:!1,tooltipId:"apextree-tooltip-container",tooltipMaxWidth:100,tooltipBorderColor:"#BCBCBC",tooltipBGColor:"#FFFFFF",fontSize:"14px",fontFamily:"",fontWeight:400,fontColor:"#000000",canvasStyle:"",enableToolbar:!1,edgeWidth:1,edgeColor:"#BCBCBC",edgeColorHover:"#5C6BC0"};var kn=function(t){return t.touches||[{clientX:t.clientX,clientY:t.clientY}]};st(dn,{panZoom:function(t){var e,n,i,r,s,o,h,a,l,u,c,d,p=this;if(this.off(".panZoom"),!1===t)return this;var f,m,g=null!=(n=(t=null!=(e=t)?e:{}).zoomFactor)?n:2,y=null!=(i=t.zoomMin)?i:Number.MIN_VALUE,x=null!=(r=t.zoomMax)?r:Number.MAX_VALUE,w=null==(s=t.wheelZoom)||s,b=null==(o=t.pinchZoom)||o,_=null==(h=t.panning)||h,v=null!=(a=t.panButton)?a:0,M=null!=(l=t.oneFingerPan)&&l,S=null!=(u=t.margins)&&u,C=null!=(c=t.wheelZoomDeltaModeLinePixels)?c:17,E=null!=(d=t.wheelZoomDeltaModeScreenPixels)?d:53,A=!1,T=this.viewbox(),O=function(t){if(!S)return t;var e=S.top,n=S.left,i=S.bottom,r=S.right,s=p.attr(["width","height"]),o=s.width,h=s.height,a=p.node.preserveAspectRatio.baseVal,l=0,u=0,c=0,d=0;if(a.align!==a.SVG_PRESERVEASPECTRATIO_NONE){var f=o/h,m=T.width/T.height;if(m!==f){var g=a.meetOrSlice!==a.SVG_MEETORSLICE_SLICE,y=f>m?"width":"height",x="width"===y,w=g&&x||!g&&!x,b=w?f/m:m/f,_=t[y]-t[y]*b;w?a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMIN||a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMID||a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMAX?(l=_/2,u=-_/2):a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMIN||a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMID||a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMAX?u=-_:a.align!==a.SVG_PRESERVEASPECTRATIO_XMAXYMIN&&a.align!==a.SVG_PRESERVEASPECTRATIO_XMAXYMID&&a.align!==a.SVG_PRESERVEASPECTRATIO_XMAXYMAX||(l=_):a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMID||a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMID||a.align===a.SVG_PRESERVEASPECTRATIO_XMAXYMID?(c=_/2,d=-_/2):a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMIN||a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMIN||a.align===a.SVG_PRESERVEASPECTRATIO_XMAXYMIN?d=-_:a.align!==a.SVG_PRESERVEASPECTRATIO_XMINYMAX&&a.align!==a.SVG_PRESERVEASPECTRATIO_XMIDYMAX&&a.align!==a.SVG_PRESERVEASPECTRATIO_XMAXYMAX||(c=_)}}var v=T.width+T.x-n-l,M=T.x+r-t.width-u,C=T.height+T.y-e-c,E=T.y+i-t.height-d;return t.x=Math.min(v,Math.max(M,t.x)),t.y=Math.min(C,Math.max(E,t.y)),t},k=function t(e){(m=kn(e)).length<2?_&&M&&z.call(this,e):(_&&M&&X.call(this,e),e.preventDefault(),this.dispatch("pinchZoomStart",{event:e}).defaultPrevented||(this.off("touchstart.panZoom",t),A=!0,$t(document,"touchmove.panZoom",N,this,{passive:!1}),$t(document,"touchend.panZoom",R,this,{passive:!1})))},R=function t(e){e.preventDefault();var n=kn(e);n.length>1||(A=!1,this.dispatch("pinchZoomEnd",{event:e}),Lt(document,"touchmove.panZoom",N),Lt(document,"touchend.panZoom",t),this.on("touchstart.panZoom",k),n.length&&_&&M&&z.call(this,e))},N=function(t){t.preventDefault();var e=kn(t),n=this.zoom(),i=Math.sqrt(Math.pow(m[0].clientX-m[1].clientX,2)+Math.pow(m[0].clientY-m[1].clientY,2))/Math.sqrt(Math.pow(e[0].clientX-e[1].clientX,2)+Math.pow(e[0].clientY-e[1].clientY,2));(n<y&&i>1||n>x&&i<1)&&(i=1);var r={x:e[0].clientX+.5*(e[1].clientX-e[0].clientX),y:e[0].clientY+.5*(e[1].clientY-e[0].clientY)},s=m[0].clientX+.5*(m[1].clientX-m[0].clientX),o=m[0].clientY+.5*(m[1].clientY-m[0].clientY),h=this.point(r.x,r.y),a=this.point(2*r.x-s,2*r.y-o),l=new Ot(this.viewbox()).transform((new Et).translate(-a.x,-a.y).scale(i,0,0).translate(h.x,h.y));O(l),this.viewbox(l),m=e,this.dispatch("zoom",{box:l,focus:a})},z=function t(e){e.type.indexOf("mouse")>-1&&e.button!==v&&e.which!==v+1||(e.preventDefault(),this.off("mousedown.panZoom",t),m=kn(e),A||(this.dispatch("panStart",{event:e}),f={x:m[0].clientX,y:m[0].clientY},$t(document,"touchmove.panZoom mousemove.panZoom",I,this,{passive:!1}),$t(document,"touchend.panZoom mouseup.panZoom",X,this,{passive:!1})))},X=function t(e){e.preventDefault(),Lt(document,"touchmove.panZoom mousemove.panZoom",I),Lt(document,"touchend.panZoom mouseup.panZoom",t),this.on("mousedown.panZoom",z),this.dispatch("panEnd",{event:e})},I=function(t){t.preventDefault();var e=kn(t),n={x:e[0].clientX,y:e[0].clientY},i=this.point(n.x,n.y),r=this.point(f.x,f.y),s=[r.x-i.x,r.y-i.y];if(s[0]||s[1]){var o=new Ot(this.viewbox()).transform((new Et).translate(s[0],s[1]));f=n,O(o),this.dispatch("panning",{box:o,event:t}).defaultPrevented||this.viewbox(o)}};return w&&this.on("wheel.panZoom",(function(t){var e;switch(t.preventDefault(),t.deltaMode){case 1:e=t.deltaY*C;break;case 2:e=t.deltaY*E;break;default:e=t.deltaY}var n=Math.pow(1+g,-1*e/100)*this.zoom(),i=this.point(t.clientX,t.clientY);if(n>x&&(n=x),n<y&&(n=y),this.dispatch("zoom",{level:n,focus:i}).defaultPrevented)return this;if(this.zoom(n,i),S){var r=O(this.viewbox());this.viewbox(r)}}),this,{passive:!1}),b&&this.on("touchstart.panZoom",k,this,{passive:!1}),_&&this.on("mousedown.panZoom",z,this,{passive:!1}),this}});class Rn{constructor(t,e,n,i){this.width=e,this.height=n,this.canvas=Tn().addTo(t).size(e,n).viewbox(`0 0 ${e} ${n}`).panZoom({zoomFactor:.2,zoomMin:.1}).attr({style:i})}add(t){this.canvas.add(t)}resetViewBox(){this.canvas.viewbox(`0 0 ${this.width} ${this.height}`)}updateViewBox(t,e,n,i){this.canvas.viewbox(`${t} ${e} ${n} ${i}`)}zoom(t){const e=this.canvas.zoom()+t;e>=.1&&this.canvas.zoom(e)}clear(){this.canvas.clear().viewbox(`0 0 ${this.width} ${this.height}`)}static drawRect({x1:t,y1:e,width:n=0,height:i=0,radius:r=0,color:s="#fefefe",opacity:o=1}={}){const h=new Ke;return h.attr({x:t??void 0,y:e??void 0,width:n,height:i,rx:r,ry:r,opacity:o}),h.fill(s),h}static drawCircle(t={}){const e=new yn;return e.attr(t),e}static drawText(t="",{x:e,y:n,dx:i,dy:r}){const s=new mn;return s.font({fill:"#f06"}),s.tspan(t),void 0!==e&&void 0!==n&&s.move(e,n),void 0!==i&&void 0!==r&&s.attr({dx:i,dy:r}),s}static drawTemplate(t,{nodeWidth:e,nodeHeight:n}={}){const i=new wn({width:e,height:n}),r=document.createElement("div");return r.innerHTML=t,r.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),i.add(r),i}static drawGroup(t=0,e=0,n,i){const r=new _n;return r.attr({transform:`translate(${t}, ${e})`,"data-self":n,"data-parent":i}),r}static drawPath(t,{id:e="",borderColor:n=On.borderColor}={}){const i=new Ze({d:t});return i.id(e),i.fill("none").stroke({color:n,width:1}),i}}class Nn extends Rn{constructor(t,e){super(t,e.width,e.height,e.canvasStyle),this.element=t,this.options=e}construct(t){const{nodeWidth:e,nodeHeight:n,siblingSpacing:i,childrenSpacing:r}=this.options,s=l({nodeSize:()=>S[this.options.direction].nodeFlexSize({nodeWidth:e,nodeHeight:n,siblingSpacing:i,childrenSpacing:r}),spacing:0}),o=s.hierarchy(t);this.rootNode=s(o)}renderNode(t,e){var n,i;const r=this.options,{nodeWidth:s,nodeHeight:o,nodeTemplate:h,highlightOnHover:a,borderRadius:l,enableTooltip:u,tooltipTemplate:c,enableExpandCollapse:d}=r,{tooltipId:p,tooltipMaxWidth:f,tooltipBGColor:m,tooltipBorderColor:g,fontSize:y,fontWeight:x,fontFamily:w,fontColor:b,borderWidth:_,borderStyle:v,borderColor:M,nodeBGColor:C,nodeStyle:O,nodeClassName:k}={...r,...t.data.options},{x:R,y:N}=S[r.direction].swap(t),z=this,X=Rn.drawGroup(R,N,t.data.id,null==(n=t.parent)?void 0:n.data.id),I=h(t.data[r.contentKey]),j=Rn.drawTemplate(I,{nodeWidth:s,nodeHeight:o}),P=A({fontSize:y,fontWeight:x,fontFamily:w,color:b}),$=A({borderColor:M,borderStyle:v,borderWidth:`${_}px`,borderRadius:l,backgroundColor:C,height:"100%",boxSizing:"border-box"});j.first().attr("style",$.concat(O)),j.attr("class",k),X.attr("style",P),X.add(j);const L=(null==(i=this.rootNode)?void 0:i.nodes)||[];if(a&&(X.on("mouseover",(function(){const t=this.node.dataset.self,e=L.find((e=>e.data.id===t));e&&E(L,e,!0,r)})),X.on("mouseout",(function(){const t=this.node.dataset.self,e=L.find((e=>e.data.id===t));e&&E(L,e,!1,r)}))),u){const e=c?c(t.data[this.options.contentKey]):I;X.on("mousemove",(function(t){const n=((t,e,n,i,r,s)=>{const o=["position: absolute;",`left: ${t+20}px;`,`top: ${e+20}px;`,`border: 1px solid ${i};`,"border-radius: 5px;",`max-width: ${n}px;`,`background-color: ${r};`];return s&&o.push("padding: 10px;"),o})(t.pageX,t.pageY,f,g,m,!c);T(p,n.join(" "),e)})),X.on("mouseout",(function(t){"svg"===t.relatedTarget.tagName&&T(p)}))}if(e.add(X),(t.children||t.hiddenChildren)&&d){const n=7,i=Rn.drawGroup(R+s/2-n,N+o-n,t.data.id),r=Rn.drawCircle({cx:n,cy:n,r:n,style:"fill: #FFF; cursor: pointer;"});i.data("expanded",!1),i.add(r),t.hiddenChildren?i.add('<svg height="14" viewBox="0 0 24 24" width="14" xmlns="http://www.w3.org/2000/svg">\n <path d="m12 0a12 12 0 1 0 12 12 12.013 12.013 0 0 0 -12-12zm0 22a10 10 0 1 1 10-10 10.011 10.011 0 0 1 -10 10zm5-10a1 1 0 0 1 -1 1h-3v3a1 1 0 0 1 -2 0v-3h-3a1 1 0 0 1 0-2h3v-3a1 1 0 0 1 2 0v3h3a1 1 0 0 1 1 1z"/>\n</svg>'):i.add('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="14" height="14">\n <path d="m12,0C5.383,0,0,5.383,0,12s5.383,12,12,12,12-5.383,12-12S18.617,0,12,0Zm0,22c-5.514,0-10-4.486-10-10S6.486,2,12,2s10,4.486,10,10-4.486,10-10,10Zm5-10c0,.552-.448,1-1,1h-8c-.552,0-1-.448-1-1s.448-1,1-1h8c.552,0,1,.448,1,1Z"/>\n</svg>\n'),i.on("click",(function(){t.hiddenChildren?z.expand(this.node.dataset.self):z.collapse(this.node.dataset.self)})),e.add(i)}}renderEdge(t,e){var n;const{nodeWidth:i,nodeHeight:r}=this.options,s=((t,e,n,i)=>{if(!t||!t.parent)return null;const{edgeX:r,edgeY:s,edgeParentX:o,edgeParentY:h,edgeMidX:a,edgeMidY:l,calculateEdge:u,swap:c}=S[i],d=c(t),p=c(t.parent);return u({x:r({node:d,nodeWidth:e,nodeHeight:n}),y:s({node:d,nodeWidth:e,nodeHeight:n})},{x:o({parent:p,nodeWidth:e,nodeHeight:n}),y:h({parent:p,nodeWidth:e,nodeHeight:n})},{x:a({node:d,nodeWidth:e,nodeHeight:n}),y:l({node:d,nodeWidth:e,nodeHeight:n})},{sy:0})})(t,i,r,this.options.direction);if(!s)return;const o=Rn.drawPath(s,{id:`${t.data.id}-${null==(n=t.parent)?void 0:n.data.id}`});t.edge=o,e.add(o)}collapse(t){var e;const n=((null==(e=this.rootNode)?void 0:e.descendants())||[]).find((e=>e.data.id===t));(null==n?void 0:n.children)&&(n.hiddenChildren=n.children,n.hiddenChildren.forEach((t=>this.collapse(t))),n.children=void 0,this.render({keepOldPosition:!0}))}expand(t){var e;const n=((null==(e=this.rootNode)?void 0:e.descendants())||[]).find((e=>e.data.id===t));(null==n?void 0:n.hiddenChildren)&&(n.children=n.hiddenChildren,n.children.forEach((t=>this.expand(t))),n.hiddenChildren=void 0,this.render({keepOldPosition:!0}))}changeLayout(t="top"){this.options={...this.options,direction:t},this.render({keepOldPosition:!1})}fitScreen(){const{childrenSpacing:t,siblingSpacing:e}=this.options,{viewBoxDimensions:n}=S[this.options.direction],{x:i,y:r,width:s,height:o}=n({rootNode:this.rootNode,childrenSpacing:t,siblingSpacing:e});this.updateViewBox(i,r,s,o)}render({keepOldPosition:t=!1}={}){var e;const n=this.canvas.viewbox();this.clear();const{containerClassName:i,enableTooltip:r,tooltipId:s,fontSize:o,fontWeight:h,fontFamily:a,fontColor:l}=this.options,u=A({fontSize:o,fontWeight:h,fontFamily:a,color:l}),c=Rn.drawGroup(0,0,i);c.attr("style",u),c.id(i);const d=(null==(e=this.rootNode)?void 0:e.nodes)||[];if(d.forEach((t=>{this.renderEdge(t,c)})),d.forEach((t=>{this.renderNode(t,c)})),this.add(c),this.fitScreen(),t&&this.updateViewBox(n.x,n.y,n.width,n.height),r){const t=((t="apextree-tooltip-container")=>{const e=document.getElementById(t)||document.createElement("div");return e.id=t,e})(s);(document.body||document.getElementsByTagName("body")[0]).append(t)}}}class zn{constructor(t){this.graph=t}getSvgString(){return this.graph.canvas.svg().replace(/(<img [\w\W]+?)(>)/g,"$1 />").replace(/(<br)(>)/g,"$1 />").replace(/(<hr)(>)/g,"$1 />")}svgUrl(){const t=this.getSvgString(),e=new Blob([t],{type:"image/svg+xml;charset=utf-8"});return URL.createObjectURL(e)}triggerDownload(t,e){const n=document.createElement("a");n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}exportToSVG(){this.triggerDownload(this.svgUrl(),`apex-tree-${(new Date).getTime()}.svg`)}}const Xn={"zoom-in":"data:image/svg+xml,%3csvg%20width='20px'%20height='20px'%20viewBox='0%200%2032%2032'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xmlns:sketch='http://www.bohemiancoding.com/sketch/ns'%3e%3cg%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20transform='translate(-308.000000,%20-1139.000000)'%20fill='%23000000'%3e%3cpath%20d='M321.46,1163.45%20C315.17,1163.45%20310.07,1158.44%20310.07,1152.25%20C310.07,1146.06%20315.17,1141.04%20321.46,1141.04%20C327.75,1141.04%20332.85,1146.06%20332.85,1152.25%20C332.85,1158.44%20327.75,1163.45%20321.46,1163.45%20L321.46,1163.45%20Z%20M339.688,1169.25%20L331.429,1161.12%20C333.592,1158.77%20334.92,1155.67%20334.92,1152.25%20C334.92,1144.93%20328.894,1139%20321.46,1139%20C314.026,1139%20308,1144.93%20308,1152.25%20C308,1159.56%20314.026,1165.49%20321.46,1165.49%20C324.672,1165.49%20327.618,1164.38%20329.932,1162.53%20L338.225,1170.69%20C338.629,1171.09%20339.284,1171.09%20339.688,1170.69%20C340.093,1170.3%20340.093,1169.65%20339.688,1169.25%20L339.688,1169.25%20Z%20M326.519,1151.41%20L322.522,1151.41%20L322.522,1147.41%20C322.522,1146.85%20322.075,1146.41%20321.523,1146.41%20C320.972,1146.41%20320.524,1146.85%20320.524,1147.41%20L320.524,1151.41%20L316.529,1151.41%20C315.978,1151.41%20315.53,1151.59%20315.53,1152.14%20C315.53,1152.7%20315.978,1153.41%20316.529,1153.41%20L320.524,1153.41%20L320.524,1157.41%20C320.524,1157.97%20320.972,1158.41%20321.523,1158.41%20C322.075,1158.41%20322.522,1157.97%20322.522,1157.41%20L322.522,1153.41%20L326.519,1153.41%20C327.07,1153.41%20327.518,1152.96%20327.518,1152.41%20C327.518,1151.86%20327.07,1151.41%20326.519,1151.41%20L326.519,1151.41%20Z'%20/%3e%3c/g%3e%3c/g%3e%3c/svg%3e","zoom-out":"data:image/svg+xml,%3csvg%20width='20px'%20height='20px'%20viewBox='0%200%2032%2032'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%20%3e%3cg%20transform='translate(-360.000000,%20-1139.000000)'%20fill='%23000000'%3e%3cpath%20d='M373.46,1163.45%20C367.17,1163.45%20362.071,1158.44%20362.071,1152.25%20C362.071,1146.06%20367.17,1141.04%20373.46,1141.04%20C379.75,1141.04%20384.85,1146.06%20384.85,1152.25%20C384.85,1158.44%20379.75,1163.45%20373.46,1163.45%20L373.46,1163.45%20Z%20M391.688,1169.25%20L383.429,1161.12%20C385.592,1158.77%20386.92,1155.67%20386.92,1152.25%20C386.92,1144.93%20380.894,1139%20373.46,1139%20C366.026,1139%20360,1144.93%20360,1152.25%20C360,1159.56%20366.026,1165.49%20373.46,1165.49%20C376.672,1165.49%20379.618,1164.38%20381.932,1162.53%20L390.225,1170.69%20C390.629,1171.09%20391.284,1171.09%20391.688,1170.69%20C392.093,1170.3%20392.093,1169.65%20391.688,1169.25%20L391.688,1169.25%20Z%20M378.689,1151.41%20L368.643,1151.41%20C368.102,1151.41%20367.663,1151.84%20367.663,1152.37%20C367.663,1152.9%20368.102,1153.33%20368.643,1153.33%20L378.689,1153.33%20C379.23,1153.33%20379.669,1152.9%20379.669,1152.37%20C379.669,1151.84%20379.23,1151.41%20378.689,1151.41%20L378.689,1151.41%20Z'%20/%3e%3c/g%3e%3c/g%3e%3c/svg%3e","fit-screen":"data:image/svg+xml,%3csvg%20width='20px'%20height='20px'%20viewBox='0%200%2032%2032'%20id='icon'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpolygon%20points='8%202%202%202%202%208%204%208%204%204%208%204%208%202'/%3e%3cpolygon%20points='24%202%2030%202%2030%208%2028%208%2028%204%2024%204%2024%202'/%3e%3cpolygon%20points='8%2030%202%2030%202%2024%204%2024%204%2028%208%2028%208%2030'/%3e%3cpolygon%20points='24%2030%2030%2030%2030%2024%2028%2024%2028%2028%2024%2028%2024%2030'/%3e%3cpath%20d='M24,24H8a2.0023,2.0023,0,0,1-2-2V10A2.0023,2.0023,0,0,1,8,8H24a2.0023,2.0023,0,0,1,2,2V22A2.0023,2.0023,0,0,1,24,24ZM8,10V22H24V10Z'/%3e%3crect%20fill='none'%20width='32'%20height='32'/%3e%3c/svg%3e",export:"data:image/svg+xml,%3csvg%20fill='%23000000'%20width='20px'%20height='20px'%20viewBox='0%200%2024%2024'%20id='export-2'%20xmlns='http://www.w3.org/2000/svg'%20class='icon%20line'%3e%3cpolyline%20id='primary'%20points='15%203%2021%203%2021%209'%20style='fill:%20none;%20stroke:%20rgb(0,%200,%200);%20stroke-linecap:%20round;%20stroke-linejoin:%20round;%20stroke-width:%201.5;'%3e%3c/polyline%3e%3cpath%20id='primary-2'%20data-name='primary'%20d='M21,13v7a1,1,0,0,1-1,1H4a1,1,0,0,1-1-1V4A1,1,0,0,1,4,3h7'%20style='fill:%20none;%20stroke:%20rgb(0,%200,%200);%20stroke-linecap:%20round;%20stroke-linejoin:%20round;%20stroke-width:%201.5;'%3e%3c/path%3e%3cline%20id='primary-3'%20data-name='primary'%20x1='11'%20y1='13'%20x2='21'%20y2='3'%20style='fill:%20none;%20stroke:%20rgb(0,%200,%200);%20stroke-linecap:%20round;%20stroke-linejoin:%20round;%20stroke-width:%201.5;'%3e%3c/line%3e%3c/svg%3e"};class In{constructor(t,e){this.element=t,this.graph=e,this.export=new zn(e)}render(){var t;const e=document.createElement("div");e.id="toolbar";const n=A({display:"flex",gap:"5px",position:"absolute",right:"20px",top:"20px"});e.setAttribute("style",n);const i=this.createToolbarItem("zoom-in",Xn["zoom-in"]),r=this.createToolbarItem("zoom-out",Xn["zoom-out"]),s=this.createToolbarItem("fit-screen",Xn["fit-screen"]),o=this.createToolbarItem("export",Xn.export);i.addEventListener("click",(()=>{this.graph.zoom(.1)})),r.addEventListener("click",(()=>{this.graph.zoom(-.1)})),s.addEventListener("click",(()=>{this.graph.fitScreen()})),o.addEventListener("click",(()=>{this.export.exportToSVG()})),e.append(i,r,s,o),null==(t=this.element)||t.append(e)}createToolbarItem(t,e){const n=document.createElement("div"),i=new Image;i.src=e,n.id=t,n.append(i);const r=A({width:"30px",height:"30px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid #BCBCBC",backgroundColor:"#FFFFFF",cursor:"pointer"});return n.setAttribute("style",r),n}}return class{constructor(t,e){this.element=t,this.options={...On,...e};const n=document.createElement("div");n.id="apexTreeWrapper",n.style.position="relative",this.graph=new Nn(n,this.options),this.element.append(n)}render(t){if(!this.element)throw new Error("Element not found");if(this.graph.construct(t),this.graph.render(),this.options.enableToolbar){new In(document.getElementById("apexTreeWrapper"),this.graph).render()}return this.graph}}}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).ApexTree=e()}(this,(function(){"use strict";var t=Object.defineProperty,e=(e,n,r)=>(((e,n,r)=>{n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r})(e,"symbol"!=typeof n?n+"":n,r),r);var n,r=(n={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},function(t){return null==n?void 0:n[t]}),i="object"==typeof global&&global&&global.Object===Object&&global,s="object"==typeof self&&self&&self.Object===Object&&self,o=(i||s||Function("return this")()).Symbol;var u=Array.isArray,a=Object.prototype,h=a.hasOwnProperty,l=a.toString,c=o?o.toStringTag:void 0;var f=Object.prototype.toString;var d="[object Null]",p="[object Undefined]",m=o?o.toStringTag:void 0;function g(t){return null==t?void 0===t?p:d:m&&m in Object(t)?function(t){var e=h.call(t,c),n=t[c];try{t[c]=void 0;var r=!0}catch(s){}var i=l.call(t);return r&&(e?t[c]=n:delete t[c]),i}(t):function(t){return f.call(t)}(t)}var y="[object Symbol]";var _=1/0,v=o?o.prototype:void 0,w=v?v.toString:void 0;function b(t){if("string"==typeof t)return t;if(u(t))return function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}(t,b)+"";if(function(t){return"symbol"==typeof t||function(t){return null!=t&&"object"==typeof t}(t)&&g(t)==y}(t))return w?w.call(t):"";var e=t+"";return"0"==e&&1/t==-_?"-0":e}function x(t){return null==t?"":b(t)}var E=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,O=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var M=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var k=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var C="\\ud800-\\udfff",A="\\u2700-\\u27bf",S="a-z\\xdf-\\xf6\\xf8-\\xff",N="A-Z\\xc0-\\xd6\\xd8-\\xde",j="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",T="["+j+"]",I="\\d+",R="["+A+"]",L="["+S+"]",z="[^"+C+j+I+A+S+N+"]",P="(?:\\ud83c[\\udde6-\\uddff]){2}",D="[\\ud800-\\udbff][\\udc00-\\udfff]",F="["+N+"]",$="(?:"+L+"|"+z+")",Y="(?:"+F+"|"+z+")",G="(?:['’](?:d|ll|m|re|s|t|ve))?",X="(?:['’](?:D|LL|M|RE|S|T|VE))?",B="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",q="[\\ufe0e\\ufe0f]?",V=q+B+("(?:\\u200d(?:"+["[^"+C+"]",P,D].join("|")+")"+q+B+")*"),W="(?:"+[R,P,D].join("|")+")"+V,H=RegExp([F+"?"+L+"+"+G+"(?="+[T,F,"$"].join("|")+")",Y+"+"+X+"(?="+[T,F+$,"$"].join("|")+")",F+"?"+$+"+"+G,F+"+"+X,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",I,W].join("|"),"g");function U(t,e,n){return t=x(t),void 0===e?function(t){return k.test(t)}(t)?function(t){return t.match(H)||[]}(t):function(t){return t.match(M)||[]}(t):t.match(e)||[]}var Z=RegExp("['’]","g");var Q,J=(Q=function(t,e,n){return t+(n?"-":"")+e.toLowerCase()},function(t){return function(t,e,n,r){for(var i=-1,s=null==t?0:t.length;++i<s;)n=e(n,t[i],i,t);return n}(U(function(t){return(t=x(t))&&t.replace(E,r).replace(O,"")}(t).replace(Z,"")),Q,"")});const K=(t="",e,n="")=>{const r=document.getElementById(t);e?null==r||r.setAttribute("style",e):null==r||r.removeAttribute("style"),(null==r?void 0:r.innerHTML.replaceAll("'",'"'))!==n.replaceAll("'",'"')&&r&&(r.innerHTML=n)},tt=({bgColor:t,borderColor:e,fontColor:n,fontFamily:r,fontSize:i,fontWeight:s,maxWidth:o,offset:u=20,padding:a,x:h,y:l})=>{const c=["position: absolute;",`left: ${h+u}px;`,`top: ${l+u}px;`,`border: 1px solid ${e};`,"border-radius: 5px;","z-index: 1000;"];return n&&c.push(`color: ${n};`),r&&c.push(`font-family: ${r};`),s&&c.push(`font-weight: ${s};`),i&&c.push(`font-size: ${i};`),t&&c.push(`background-color: ${t};`),o&&c.push(`max-width: ${o}px`),void 0!==a&&c.push(`padding: ${a}px`),c.join(" ")},et=(t={})=>{const e=[];for(const n in t){const r=`${J(n)}: ${t[n]};`;e.push(r)}return e.join(" ")};class nt{constructor(t,e="apex"){this.canvas=t,this.prefix=e}getSvgString(){return this.canvas.svg().replace(/(<img [\w\W]+?)(>)/g,"$1 />").replace(/(<br)(>)/g,"$1 />").replace(/(<hr)(>)/g,"$1 />")}svgUrl(){const t=this.getSvgString(),e=new Blob([t],{type:"image/svg+xml;charset=utf-8"});return URL.createObjectURL(e)}triggerDownload(t,e){const n=document.createElement("a");n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}exportToSVG(){this.triggerDownload(this.svgUrl(),`${this.prefix}-${(new Date).getTime()}.svg`)}}var rt,it,st="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ot={exports:{}};rt=ot,it=ot.exports,function(){var t,e="Expected a function",n="__lodash_hash_undefined__",r="__lodash_placeholder__",i=16,s=32,o=64,u=128,a=256,h=1/0,l=9007199254740991,c=NaN,f=4294967295,d=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",i],["flip",512],["partial",s],["partialRight",o],["rearg",a]],p="[object Arguments]",m="[object Array]",g="[object Boolean]",y="[object Date]",_="[object Error]",v="[object Function]",w="[object GeneratorFunction]",b="[object Map]",x="[object Number]",E="[object Object]",O="[object Promise]",M="[object RegExp]",k="[object Set]",C="[object String]",A="[object Symbol]",S="[object WeakMap]",N="[object ArrayBuffer]",j="[object DataView]",T="[object Float32Array]",I="[object Float64Array]",R="[object Int8Array]",L="[object Int16Array]",z="[object Int32Array]",P="[object Uint8Array]",D="[object Uint8ClampedArray]",F="[object Uint16Array]",$="[object Uint32Array]",Y=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,X=/(__e\(.*?\)|\b__t\)) \+\n'';/g,B=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,V=RegExp(B.source),W=RegExp(q.source),H=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,K=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tt=/[\\^$.*+?()[\]{}|]/g,et=RegExp(tt.source),nt=/^\s+/,ot=/\s/,ut=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,at=/\{\n\/\* \[wrapped with (.+)\] \*/,ht=/,? & /,lt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ct=/[()=,{}\[\]\/\s]/,ft=/\\(\\)?/g,dt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pt=/\w*$/,mt=/^[-+]0x[0-9a-f]+$/i,gt=/^0b[01]+$/i,yt=/^\[object .+?Constructor\]$/,_t=/^0o[0-7]+$/i,vt=/^(?:0|[1-9]\d*)$/,wt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bt=/($^)/,xt=/['\n\r\u2028\u2029\\]/g,Et="\\ud800-\\udfff",Ot="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Mt="\\u2700-\\u27bf",kt="a-z\\xdf-\\xf6\\xf8-\\xff",Ct="A-Z\\xc0-\\xd6\\xd8-\\xde",At="\\ufe0e\\ufe0f",St="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Nt="['’]",jt="["+Et+"]",Tt="["+St+"]",It="["+Ot+"]",Rt="\\d+",Lt="["+Mt+"]",zt="["+kt+"]",Pt="[^"+Et+St+Rt+Mt+kt+Ct+"]",Dt="\\ud83c[\\udffb-\\udfff]",Ft="[^"+Et+"]",$t="(?:\\ud83c[\\udde6-\\uddff]){2}",Yt="[\\ud800-\\udbff][\\udc00-\\udfff]",Gt="["+Ct+"]",Xt="\\u200d",Bt="(?:"+zt+"|"+Pt+")",qt="(?:"+Gt+"|"+Pt+")",Vt="(?:['’](?:d|ll|m|re|s|t|ve))?",Wt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ht="(?:"+It+"|"+Dt+")?",Ut="["+At+"]?",Zt=Ut+Ht+"(?:"+Xt+"(?:"+[Ft,$t,Yt].join("|")+")"+Ut+Ht+")*",Qt="(?:"+[Lt,$t,Yt].join("|")+")"+Zt,Jt="(?:"+[Ft+It+"?",It,$t,Yt,jt].join("|")+")",Kt=RegExp(Nt,"g"),te=RegExp(It,"g"),ee=RegExp(Dt+"(?="+Dt+")|"+Jt+Zt,"g"),ne=RegExp([Gt+"?"+zt+"+"+Vt+"(?="+[Tt,Gt,"$"].join("|")+")",qt+"+"+Wt+"(?="+[Tt,Gt+Bt,"$"].join("|")+")",Gt+"?"+Bt+"+"+Vt,Gt+"+"+Wt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Rt,Qt].join("|"),"g"),re=RegExp("["+Xt+Et+Ot+At+"]"),ie=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,se=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],oe=-1,ue={};ue[T]=ue[I]=ue[R]=ue[L]=ue[z]=ue[P]=ue[D]=ue[F]=ue[$]=!0,ue[p]=ue[m]=ue[N]=ue[g]=ue[j]=ue[y]=ue[_]=ue[v]=ue[b]=ue[x]=ue[E]=ue[M]=ue[k]=ue[C]=ue[S]=!1;var ae={};ae[p]=ae[m]=ae[N]=ae[j]=ae[g]=ae[y]=ae[T]=ae[I]=ae[R]=ae[L]=ae[z]=ae[b]=ae[x]=ae[E]=ae[M]=ae[k]=ae[C]=ae[A]=ae[P]=ae[D]=ae[F]=ae[$]=!0,ae[_]=ae[v]=ae[S]=!1;var he={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},le=parseFloat,ce=parseInt,fe="object"==typeof st&&st&&st.Object===Object&&st,de="object"==typeof self&&self&&self.Object===Object&&self,pe=fe||de||Function("return this")(),me=it&&!it.nodeType&&it,ge=me&&rt&&!rt.nodeType&&rt,ye=ge&&ge.exports===me,_e=ye&&fe.process,ve=function(){try{var t=ge&&ge.require&&ge.require("util").types;return t||_e&&_e.binding&&_e.binding("util")}catch(e){}}(),we=ve&&ve.isArrayBuffer,be=ve&&ve.isDate,xe=ve&&ve.isMap,Ee=ve&&ve.isRegExp,Oe=ve&&ve.isSet,Me=ve&&ve.isTypedArray;function ke(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ce(t,e,n,r){for(var i=-1,s=null==t?0:t.length;++i<s;){var o=t[i];e(r,o,n(o),t)}return r}function Ae(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Se(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Ne(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function je(t,e){for(var n=-1,r=null==t?0:t.length,i=0,s=[];++n<r;){var o=t[n];e(o,n,t)&&(s[i++]=o)}return s}function Te(t,e){return!(null==t||!t.length)&&Ge(t,e,0)>-1}function Ie(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function Re(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function Le(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function ze(t,e,n,r){var i=-1,s=null==t?0:t.length;for(r&&s&&(n=t[++i]);++i<s;)n=e(n,t[i],i,t);return n}function Pe(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function De(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Fe=Ve("length");function $e(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}function Ye(t,e,n,r){for(var i=t.length,s=n+(r?1:-1);r?s--:++s<i;)if(e(t[s],s,t))return s;return-1}function Ge(t,e,n){return e==e?function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):Ye(t,Be,n)}function Xe(t,e,n,r){for(var i=n-1,s=t.length;++i<s;)if(r(t[i],e))return i;return-1}function Be(t){return t!=t}function qe(t,e){var n=null==t?0:t.length;return n?Ue(t,e)/n:c}function Ve(e){return function(n){return null==n?t:n[e]}}function We(e){return function(n){return null==e?t:e[n]}}function He(t,e,n,r,i){return i(t,(function(t,i,s){n=r?(r=!1,t):e(n,t,i,s)})),n}function Ue(e,n){for(var r,i=-1,s=e.length;++i<s;){var o=n(e[i]);o!==t&&(r=r===t?o:r+o)}return r}function Ze(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Qe(t){return t?t.slice(0,pn(t)+1).replace(nt,""):t}function Je(t){return function(e){return t(e)}}function Ke(t,e){return Re(e,(function(e){return t[e]}))}function tn(t,e){return t.has(e)}function en(t,e){for(var n=-1,r=t.length;++n<r&&Ge(e,t[n],0)>-1;);return n}function nn(t,e){for(var n=t.length;n--&&Ge(e,t[n],0)>-1;);return n}var rn=We({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),sn=We({"&":"&","<":"<",">":">",'"':""","'":"'"});function on(t){return"\\"+he[t]}function un(t){return re.test(t)}function an(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function hn(t,e){return function(n){return t(e(n))}}function ln(t,e){for(var n=-1,i=t.length,s=0,o=[];++n<i;){var u=t[n];u!==e&&u!==r||(t[n]=r,o[s++]=n)}return o}function cn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function fn(t){return un(t)?function(t){for(var e=ee.lastIndex=0;ee.test(t);)++e;return e}(t):Fe(t)}function dn(t){return un(t)?function(t){return t.match(ee)||[]}(t):function(t){return t.split("")}(t)}function pn(t){for(var e=t.length;e--&&ot.test(t.charAt(e)););return e}var mn=We({"&":"&","<":"<",">":">",""":'"',"'":"'"}),gn=function rt(it){var st,ot=(it=null==it?pe:gn.defaults(pe.Object(),it,gn.pick(pe,se))).Array,Et=it.Date,Ot=it.Error,Mt=it.Function,kt=it.Math,Ct=it.Object,At=it.RegExp,St=it.String,Nt=it.TypeError,jt=ot.prototype,Tt=Mt.prototype,It=Ct.prototype,Rt=it["__core-js_shared__"],Lt=Tt.toString,zt=It.hasOwnProperty,Pt=0,Dt=(st=/[^.]+$/.exec(Rt&&Rt.keys&&Rt.keys.IE_PROTO||""))?"Symbol(src)_1."+st:"",Ft=It.toString,$t=Lt.call(Ct),Yt=pe._,Gt=At("^"+Lt.call(zt).replace(tt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Xt=ye?it.Buffer:t,Bt=it.Symbol,qt=it.Uint8Array,Vt=Xt?Xt.allocUnsafe:t,Wt=hn(Ct.getPrototypeOf,Ct),Ht=Ct.create,Ut=It.propertyIsEnumerable,Zt=jt.splice,Qt=Bt?Bt.isConcatSpreadable:t,Jt=Bt?Bt.iterator:t,ee=Bt?Bt.toStringTag:t,re=function(){try{var t=cs(Ct,"defineProperty");return t({},"",{}),t}catch(e){}}(),he=it.clearTimeout!==pe.clearTimeout&&it.clearTimeout,fe=Et&&Et.now!==pe.Date.now&&Et.now,de=it.setTimeout!==pe.setTimeout&&it.setTimeout,me=kt.ceil,ge=kt.floor,_e=Ct.getOwnPropertySymbols,ve=Xt?Xt.isBuffer:t,Fe=it.isFinite,We=jt.join,yn=hn(Ct.keys,Ct),_n=kt.max,vn=kt.min,wn=Et.now,bn=it.parseInt,xn=kt.random,En=jt.reverse,On=cs(it,"DataView"),Mn=cs(it,"Map"),kn=cs(it,"Promise"),Cn=cs(it,"Set"),An=cs(it,"WeakMap"),Sn=cs(Ct,"create"),Nn=An&&new An,jn={},Tn=$s(On),In=$s(Mn),Rn=$s(kn),Ln=$s(Cn),zn=$s(An),Pn=Bt?Bt.prototype:t,Dn=Pn?Pn.valueOf:t,Fn=Pn?Pn.toString:t;function $n(t){if(iu(t)&&!Wo(t)&&!(t instanceof Bn)){if(t instanceof Xn)return t;if(zt.call(t,"__wrapped__"))return Ys(t)}return new Xn(t)}var Yn=function(){function e(){}return function(n){if(!ru(n))return{};if(Ht)return Ht(n);e.prototype=n;var r=new e;return e.prototype=t,r}}();function Gn(){}function Xn(e,n){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=t}function Bn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function qn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Vn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Wn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Hn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Wn;++e<n;)this.add(t[e])}function Un(t){var e=this.__data__=new Vn(t);this.size=e.size}function Zn(t,e){var n=Wo(t),r=!n&&Vo(t),i=!n&&!r&&Qo(t),s=!n&&!r&&!i&&fu(t),o=n||r||i||s,u=o?Ze(t.length,St):[],a=u.length;for(var h in t)!e&&!zt.call(t,h)||o&&("length"==h||i&&("offset"==h||"parent"==h)||s&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||_s(h,a))||u.push(h);return u}function Qn(e){var n=e.length;return n?e[Hr(0,n-1)]:t}function Jn(t,e){return Rs(Si(t),ur(e,0,t.length))}function Kn(t){return Rs(Si(t))}function tr(e,n,r){(r!==t&&!Xo(e[n],r)||r===t&&!(n in e))&&sr(e,n,r)}function er(e,n,r){var i=e[n];zt.call(e,n)&&Xo(i,r)&&(r!==t||n in e)||sr(e,n,r)}function nr(t,e){for(var n=t.length;n--;)if(Xo(t[n][0],e))return n;return-1}function rr(t,e,n,r){return fr(t,(function(t,i,s){e(r,t,n(t),s)})),r}function ir(t,e){return t&&Ni(e,Ru(e),t)}function sr(t,e,n){"__proto__"==e&&re?re(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function or(e,n){for(var r=-1,i=n.length,s=ot(i),o=null==e;++r<i;)s[r]=o?t:Su(e,n[r]);return s}function ur(e,n,r){return e==e&&(r!==t&&(e=e<=r?e:r),n!==t&&(e=e>=n?e:n)),e}function ar(e,n,r,i,s,o){var u,a=1&n,h=2&n,l=4&n;if(r&&(u=s?r(e,i,s,o):r(e)),u!==t)return u;if(!ru(e))return e;var c=Wo(e);if(c){if(u=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&zt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(e),!a)return Si(e,u)}else{var f=ps(e),d=f==v||f==w;if(Qo(e))return Ei(e,a);if(f==E||f==p||d&&!s){if(u=h||d?{}:gs(e),!a)return h?function(t,e){return Ni(t,ds(t),e)}(e,function(t,e){return t&&Ni(e,Lu(e),t)}(u,e)):function(t,e){return Ni(t,fs(t),e)}(e,ir(u,e))}else{if(!ae[f])return s?e:{};u=function(t,e,n){var r,i=t.constructor;switch(e){case N:return Oi(t);case g:case y:return new i(+t);case j:return function(t,e){var n=e?Oi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case T:case I:case R:case L:case z:case P:case D:case F:case $:return Mi(t,n);case b:return new i;case x:case C:return new i(t);case M:return function(t){var e=new t.constructor(t.source,pt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case k:return new i;case A:return r=t,Dn?Ct(Dn.call(r)):{}}}(e,f,a)}}o||(o=new Un);var m=o.get(e);if(m)return m;o.set(e,u),hu(e)?e.forEach((function(t){u.add(ar(t,n,r,t,e,o))})):su(e)&&e.forEach((function(t,i){u.set(i,ar(t,n,r,i,e,o))}));var _=c?t:(l?h?is:rs:h?Lu:Ru)(e);return Ae(_||e,(function(t,i){_&&(t=e[i=t]),er(u,i,ar(t,n,r,i,e,o))})),u}function hr(e,n,r){var i=r.length;if(null==e)return!i;for(e=Ct(e);i--;){var s=r[i],o=n[s],u=e[s];if(u===t&&!(s in e)||!o(u))return!1}return!0}function lr(n,r,i){if("function"!=typeof n)throw new Nt(e);return Ns((function(){n.apply(t,i)}),r)}function cr(t,e,n,r){var i=-1,s=Te,o=!0,u=t.length,a=[],h=e.length;if(!u)return a;n&&(e=Re(e,Je(n))),r?(s=Ie,o=!1):e.length>=200&&(s=tn,o=!1,e=new Hn(e));t:for(;++i<u;){var l=t[i],c=null==n?l:n(l);if(l=r||0!==l?l:0,o&&c==c){for(var f=h;f--;)if(e[f]===c)continue t;a.push(l)}else s(e,c,r)||a.push(l)}return a}$n.templateSettings={escape:H,evaluate:U,interpolate:Z,variable:"",imports:{_:$n}},$n.prototype=Gn.prototype,$n.prototype.constructor=$n,Xn.prototype=Yn(Gn.prototype),Xn.prototype.constructor=Xn,Bn.prototype=Yn(Gn.prototype),Bn.prototype.constructor=Bn,qn.prototype.clear=function(){this.__data__=Sn?Sn(null):{},this.size=0},qn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},qn.prototype.get=function(e){var r=this.__data__;if(Sn){var i=r[e];return i===n?t:i}return zt.call(r,e)?r[e]:t},qn.prototype.has=function(e){var n=this.__data__;return Sn?n[e]!==t:zt.call(n,e)},qn.prototype.set=function(e,r){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=Sn&&r===t?n:r,this},Vn.prototype.clear=function(){this.__data__=[],this.size=0},Vn.prototype.delete=function(t){var e=this.__data__,n=nr(e,t);return!(n<0||(n==e.length-1?e.pop():Zt.call(e,n,1),--this.size,0))},Vn.prototype.get=function(e){var n=this.__data__,r=nr(n,e);return r<0?t:n[r][1]},Vn.prototype.has=function(t){return nr(this.__data__,t)>-1},Vn.prototype.set=function(t,e){var n=this.__data__,r=nr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Wn.prototype.clear=function(){this.size=0,this.__data__={hash:new qn,map:new(Mn||Vn),string:new qn}},Wn.prototype.delete=function(t){var e=hs(this,t).delete(t);return this.size-=e?1:0,e},Wn.prototype.get=function(t){return hs(this,t).get(t)},Wn.prototype.has=function(t){return hs(this,t).has(t)},Wn.prototype.set=function(t,e){var n=hs(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Hn.prototype.add=Hn.prototype.push=function(t){return this.__data__.set(t,n),this},Hn.prototype.has=function(t){return this.__data__.has(t)},Un.prototype.clear=function(){this.__data__=new Vn,this.size=0},Un.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Un.prototype.get=function(t){return this.__data__.get(t)},Un.prototype.has=function(t){return this.__data__.has(t)},Un.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Vn){var r=n.__data__;if(!Mn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Wn(r)}return n.set(t,e),this.size=n.size,this};var fr=Ii(wr),dr=Ii(br,!0);function pr(t,e){var n=!0;return fr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function mr(e,n,r){for(var i=-1,s=e.length;++i<s;){var o=e[i],u=n(o);if(null!=u&&(a===t?u==u&&!cu(u):r(u,a)))var a=u,h=o}return h}function gr(t,e){var n=[];return fr(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function yr(t,e,n,r,i){var s=-1,o=t.length;for(n||(n=ys),i||(i=[]);++s<o;){var u=t[s];e>0&&n(u)?e>1?yr(u,e-1,n,r,i):Le(i,u):r||(i[i.length]=u)}return i}var _r=Ri(),vr=Ri(!0);function wr(t,e){return t&&_r(t,e,Ru)}function br(t,e){return t&&vr(t,e,Ru)}function xr(t,e){return je(e,(function(e){return tu(t[e])}))}function Er(e,n){for(var r=0,i=(n=vi(n,e)).length;null!=e&&r<i;)e=e[Fs(n[r++])];return r&&r==i?e:t}function Or(t,e,n){var r=e(t);return Wo(t)?r:Le(r,n(t))}function Mr(e){return null==e?e===t?"[object Undefined]":"[object Null]":ee&&ee in Ct(e)?function(e){var n=zt.call(e,ee),r=e[ee];try{e[ee]=t;var i=!0}catch(o){}var s=Ft.call(e);return i&&(n?e[ee]=r:delete e[ee]),s}(e):function(t){return Ft.call(t)}(e)}function kr(t,e){return t>e}function Cr(t,e){return null!=t&&zt.call(t,e)}function Ar(t,e){return null!=t&&e in Ct(t)}function Sr(e,n,r){for(var i=r?Ie:Te,s=e[0].length,o=e.length,u=o,a=ot(o),h=1/0,l=[];u--;){var c=e[u];u&&n&&(c=Re(c,Je(n))),h=vn(c.length,h),a[u]=!r&&(n||s>=120&&c.length>=120)?new Hn(u&&c):t}c=e[0];var f=-1,d=a[0];t:for(;++f<s&&l.length<h;){var p=c[f],m=n?n(p):p;if(p=r||0!==p?p:0,!(d?tn(d,m):i(l,m,r))){for(u=o;--u;){var g=a[u];if(!(g?tn(g,m):i(e[u],m,r)))continue t}d&&d.push(m),l.push(p)}}return l}function Nr(e,n,r){var i=null==(e=Cs(e,n=vi(n,e)))?e:e[Fs(Js(n))];return null==i?t:ke(i,e,r)}function jr(t){return iu(t)&&Mr(t)==p}function Tr(e,n,r,i,s){return e===n||(null==e||null==n||!iu(e)&&!iu(n)?e!=e&&n!=n:function(e,n,r,i,s,o){var u=Wo(e),a=Wo(n),h=u?m:ps(e),l=a?m:ps(n),c=(h=h==p?E:h)==E,f=(l=l==p?E:l)==E,d=h==l;if(d&&Qo(e)){if(!Qo(n))return!1;u=!0,c=!1}if(d&&!c)return o||(o=new Un),u||fu(e)?es(e,n,r,i,s,o):function(t,e,n,r,i,s,o){switch(n){case j:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case N:return!(t.byteLength!=e.byteLength||!s(new qt(t),new qt(e)));case g:case y:case x:return Xo(+t,+e);case _:return t.name==e.name&&t.message==e.message;case M:case C:return t==e+"";case b:var u=an;case k:var a=1&r;if(u||(u=cn),t.size!=e.size&&!a)return!1;var h=o.get(t);if(h)return h==e;r|=2,o.set(t,e);var l=es(u(t),u(e),r,i,s,o);return o.delete(t),l;case A:if(Dn)return Dn.call(t)==Dn.call(e)}return!1}(e,n,h,r,i,s,o);if(!(1&r)){var v=c&&zt.call(e,"__wrapped__"),w=f&&zt.call(n,"__wrapped__");if(v||w){var O=v?e.value():e,S=w?n.value():n;return o||(o=new Un),s(O,S,r,i,o)}}return!!d&&(o||(o=new Un),function(e,n,r,i,s,o){var u=1&r,a=rs(e),h=a.length,l=rs(n),c=l.length;if(h!=c&&!u)return!1;for(var f=h;f--;){var d=a[f];if(!(u?d in n:zt.call(n,d)))return!1}var p=o.get(e),m=o.get(n);if(p&&m)return p==n&&m==e;var g=!0;o.set(e,n),o.set(n,e);for(var y=u;++f<h;){var _=e[d=a[f]],v=n[d];if(i)var w=u?i(v,_,d,n,e,o):i(_,v,d,e,n,o);if(!(w===t?_===v||s(_,v,r,i,o):w)){g=!1;break}y||(y="constructor"==d)}if(g&&!y){var b=e.constructor,x=n.constructor;b==x||!("constructor"in e)||!("constructor"in n)||"function"==typeof b&&b instanceof b&&"function"==typeof x&&x instanceof x||(g=!1)}return o.delete(e),o.delete(n),g}(e,n,r,i,s,o))}(e,n,r,i,Tr,s))}function Ir(e,n,r,i){var s=r.length,o=s,u=!i;if(null==e)return!o;for(e=Ct(e);s--;){var a=r[s];if(u&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++s<o;){var h=(a=r[s])[0],l=e[h],c=a[1];if(u&&a[2]){if(l===t&&!(h in e))return!1}else{var f=new Un;if(i)var d=i(l,c,h,e,n,f);if(!(d===t?Tr(c,l,3,i,f):d))return!1}}return!0}function Rr(t){return!(!ru(t)||(e=t,Dt&&Dt in e))&&(tu(t)?Gt:yt).test($s(t));var e}function Lr(t){return"function"==typeof t?t:null==t?oa:"object"==typeof t?Wo(t)?Yr(t[0],t[1]):$r(t):ma(t)}function zr(t){if(!Es(t))return yn(t);var e=[];for(var n in Ct(t))zt.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Pr(t){if(!ru(t))return function(t){var e=[];if(null!=t)for(var n in Ct(t))e.push(n);return e}(t);var e=Es(t),n=[];for(var r in t)("constructor"!=r||!e&&zt.call(t,r))&&n.push(r);return n}function Dr(t,e){return t<e}function Fr(t,e){var n=-1,r=Uo(t)?ot(t.length):[];return fr(t,(function(t,i,s){r[++n]=e(t,i,s)})),r}function $r(t){var e=ls(t);return 1==e.length&&e[0][2]?Ms(e[0][0],e[0][1]):function(n){return n===t||Ir(n,t,e)}}function Yr(e,n){return ws(e)&&Os(n)?Ms(Fs(e),n):function(r){var i=Su(r,e);return i===t&&i===n?Nu(r,e):Tr(n,i,3)}}function Gr(e,n,r,i,s){e!==n&&_r(n,(function(o,u){if(s||(s=new Un),ru(o))!function(e,n,r,i,s,o,u){var a=As(e,r),h=As(n,r),l=u.get(h);if(l)tr(e,r,l);else{var c=o?o(a,h,r+"",e,n,u):t,f=c===t;if(f){var d=Wo(h),p=!d&&Qo(h),m=!d&&!p&&fu(h);c=h,d||p||m?Wo(a)?c=a:Zo(a)?c=Si(a):p?(f=!1,c=Ei(h,!0)):m?(f=!1,c=Mi(h,!0)):c=[]:uu(h)||Vo(h)?(c=a,Vo(a)?c=wu(a):ru(a)&&!tu(a)||(c=gs(h))):f=!1}f&&(u.set(h,c),s(c,h,i,o,u),u.delete(h)),tr(e,r,c)}}(e,n,u,r,Gr,i,s);else{var a=i?i(As(e,u),o,u+"",e,n,s):t;a===t&&(a=o),tr(e,u,a)}}),Lu)}function Xr(e,n){var r=e.length;if(r)return _s(n+=n<0?r:0,r)?e[n]:t}function Br(t,e,n){e=e.length?Re(e,(function(t){return Wo(t)?function(e){return Er(e,1===t.length?t[0]:t)}:t})):[oa];var r=-1;return e=Re(e,Je(as())),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(Fr(t,(function(t,n,i){return{criteria:Re(e,(function(e){return e(t)})),index:++r,value:t}})),(function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,s=e.criteria,o=i.length,u=n.length;++r<o;){var a=ki(i[r],s[r]);if(a)return r>=u?a:a*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function qr(t,e,n){for(var r=-1,i=e.length,s={};++r<i;){var o=e[r],u=Er(t,o);n(u,o)&&Kr(s,vi(o,t),u)}return s}function Vr(t,e,n,r){var i=r?Xe:Ge,s=-1,o=e.length,u=t;for(t===e&&(e=Si(e)),n&&(u=Re(t,Je(n)));++s<o;)for(var a=0,h=e[s],l=n?n(h):h;(a=i(u,l,a,r))>-1;)u!==t&&Zt.call(u,a,1),Zt.call(t,a,1);return t}function Wr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==s){var s=i;_s(i)?Zt.call(t,i,1):ci(t,i)}}return t}function Hr(t,e){return t+ge(xn()*(e-t+1))}function Ur(t,e){var n="";if(!t||e<1||e>l)return n;do{e%2&&(n+=t),(e=ge(e/2))&&(t+=t)}while(e);return n}function Zr(t,e){return js(ks(t,e,oa),t+"")}function Qr(t){return Qn(Xu(t))}function Jr(t,e){var n=Xu(t);return Rs(n,ur(e,0,n.length))}function Kr(e,n,r,i){if(!ru(e))return e;for(var s=-1,o=(n=vi(n,e)).length,u=o-1,a=e;null!=a&&++s<o;){var h=Fs(n[s]),l=r;if("__proto__"===h||"constructor"===h||"prototype"===h)return e;if(s!=u){var c=a[h];(l=i?i(c,h,a):t)===t&&(l=ru(c)?c:_s(n[s+1])?[]:{})}er(a,h,l),a=a[h]}return e}var ti=Nn?function(t,e){return Nn.set(t,e),t}:oa,ei=re?function(t,e){return re(t,"toString",{configurable:!0,enumerable:!1,value:ra(e),writable:!0})}:oa;function ni(t){return Rs(Xu(t))}function ri(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=ot(i);++r<i;)s[r]=t[r+e];return s}function ii(t,e){var n;return fr(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function si(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var s=r+i>>>1,o=t[s];null!==o&&!cu(o)&&(n?o<=e:o<e)?r=s+1:i=s}return i}return oi(t,e,oa,n)}function oi(e,n,r,i){var s=0,o=null==e?0:e.length;if(0===o)return 0;for(var u=(n=r(n))!=n,a=null===n,h=cu(n),l=n===t;s<o;){var c=ge((s+o)/2),f=r(e[c]),d=f!==t,p=null===f,m=f==f,g=cu(f);if(u)var y=i||m;else y=l?m&&(i||d):a?m&&d&&(i||!p):h?m&&d&&!p&&(i||!g):!p&&!g&&(i?f<=n:f<n);y?s=c+1:o=c}return vn(o,4294967294)}function ui(t,e){for(var n=-1,r=t.length,i=0,s=[];++n<r;){var o=t[n],u=e?e(o):o;if(!n||!Xo(u,a)){var a=u;s[i++]=0===o?0:o}}return s}function ai(t){return"number"==typeof t?t:cu(t)?c:+t}function hi(t){if("string"==typeof t)return t;if(Wo(t))return Re(t,hi)+"";if(cu(t))return Fn?Fn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function li(t,e,n){var r=-1,i=Te,s=t.length,o=!0,u=[],a=u;if(n)o=!1,i=Ie;else if(s>=200){var h=e?null:Ui(t);if(h)return cn(h);o=!1,i=tn,a=new Hn}else a=e?[]:u;t:for(;++r<s;){var l=t[r],c=e?e(l):l;if(l=n||0!==l?l:0,o&&c==c){for(var f=a.length;f--;)if(a[f]===c)continue t;e&&a.push(c),u.push(l)}else i(a,c,n)||(a!==u&&a.push(c),u.push(l))}return u}function ci(t,e){return null==(t=Cs(t,e=vi(e,t)))||delete t[Fs(Js(e))]}function fi(t,e,n,r){return Kr(t,e,n(Er(t,e)),r)}function di(t,e,n,r){for(var i=t.length,s=r?i:-1;(r?s--:++s<i)&&e(t[s],s,t););return n?ri(t,r?0:s,r?s+1:i):ri(t,r?s+1:0,r?i:s)}function pi(t,e){var n=t;return n instanceof Bn&&(n=n.value()),ze(e,(function(t,e){return e.func.apply(e.thisArg,Le([t],e.args))}),n)}function mi(t,e,n){var r=t.length;if(r<2)return r?li(t[0]):[];for(var i=-1,s=ot(r);++i<r;)for(var o=t[i],u=-1;++u<r;)u!=i&&(s[i]=cr(s[i]||o,t[u],e,n));return li(yr(s,1),e,n)}function gi(e,n,r){for(var i=-1,s=e.length,o=n.length,u={};++i<s;){var a=i<o?n[i]:t;r(u,e[i],a)}return u}function yi(t){return Zo(t)?t:[]}function _i(t){return"function"==typeof t?t:oa}function vi(t,e){return Wo(t)?t:ws(t,e)?[t]:Ds(bu(t))}var wi=Zr;function bi(e,n,r){var i=e.length;return r=r===t?i:r,!n&&r>=i?e:ri(e,n,r)}var xi=he||function(t){return pe.clearTimeout(t)};function Ei(t,e){if(e)return t.slice();var n=t.length,r=Vt?Vt(n):new t.constructor(n);return t.copy(r),r}function Oi(t){var e=new t.constructor(t.byteLength);return new qt(e).set(new qt(t)),e}function Mi(t,e){var n=e?Oi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function ki(e,n){if(e!==n){var r=e!==t,i=null===e,s=e==e,o=cu(e),u=n!==t,a=null===n,h=n==n,l=cu(n);if(!a&&!l&&!o&&e>n||o&&u&&h&&!a&&!l||i&&u&&h||!r&&h||!s)return 1;if(!i&&!o&&!l&&e<n||l&&r&&s&&!i&&!o||a&&r&&s||!u&&s||!h)return-1}return 0}function Ci(t,e,n,r){for(var i=-1,s=t.length,o=n.length,u=-1,a=e.length,h=_n(s-o,0),l=ot(a+h),c=!r;++u<a;)l[u]=e[u];for(;++i<o;)(c||i<s)&&(l[n[i]]=t[i]);for(;h--;)l[u++]=t[i++];return l}function Ai(t,e,n,r){for(var i=-1,s=t.length,o=-1,u=n.length,a=-1,h=e.length,l=_n(s-u,0),c=ot(l+h),f=!r;++i<l;)c[i]=t[i];for(var d=i;++a<h;)c[d+a]=e[a];for(;++o<u;)(f||i<s)&&(c[d+n[o]]=t[i++]);return c}function Si(t,e){var n=-1,r=t.length;for(e||(e=ot(r));++n<r;)e[n]=t[n];return e}function Ni(e,n,r,i){var s=!r;r||(r={});for(var o=-1,u=n.length;++o<u;){var a=n[o],h=i?i(r[a],e[a],a,r,e):t;h===t&&(h=e[a]),s?sr(r,a,h):er(r,a,h)}return r}function ji(t,e){return function(n,r){var i=Wo(n)?Ce:rr,s=e?e():{};return i(n,t,as(r,2),s)}}function Ti(e){return Zr((function(n,r){var i=-1,s=r.length,o=s>1?r[s-1]:t,u=s>2?r[2]:t;for(o=e.length>3&&"function"==typeof o?(s--,o):t,u&&vs(r[0],r[1],u)&&(o=s<3?t:o,s=1),n=Ct(n);++i<s;){var a=r[i];a&&e(n,a,i,o)}return n}))}function Ii(t,e){return function(n,r){if(null==n)return n;if(!Uo(n))return t(n,r);for(var i=n.length,s=e?i:-1,o=Ct(n);(e?s--:++s<i)&&!1!==r(o[s],s,o););return n}}function Ri(t){return function(e,n,r){for(var i=-1,s=Ct(e),o=r(e),u=o.length;u--;){var a=o[t?u:++i];if(!1===n(s[a],a,s))break}return e}}function Li(e){return function(n){var r=un(n=bu(n))?dn(n):t,i=r?r[0]:n.charAt(0),s=r?bi(r,1).join(""):n.slice(1);return i[e]()+s}}function zi(t){return function(e){return ze(ta(Vu(e).replace(Kt,"")),t,"")}}function Pi(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Yn(t.prototype),r=t.apply(n,e);return ru(r)?r:n}}function Di(e){return function(n,r,i){var s=Ct(n);if(!Uo(n)){var o=as(r,3);n=Ru(n),r=function(t){return o(s[t],t,s)}}var u=e(n,r,i);return u>-1?s[o?n[u]:u]:t}}function Fi(n){return ns((function(r){var i=r.length,s=i,o=Xn.prototype.thru;for(n&&r.reverse();s--;){var u=r[s];if("function"!=typeof u)throw new Nt(e);if(o&&!a&&"wrapper"==os(u))var a=new Xn([],!0)}for(s=a?s:i;++s<i;){var h=os(u=r[s]),l="wrapper"==h?ss(u):t;a=l&&bs(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?a[os(l[0])].apply(a,l[3]):1==u.length&&bs(u)?a[h]():a.thru(u)}return function(){var t=arguments,e=t[0];if(a&&1==t.length&&Wo(e))return a.plant(e).value();for(var n=0,s=i?r[n].apply(this,t):e;++n<i;)s=r[n].call(this,s);return s}}))}function $i(e,n,r,i,s,o,a,h,l,c){var f=n&u,d=1&n,p=2&n,m=24&n,g=512&n,y=p?t:Pi(e);return function u(){for(var _=arguments.length,v=ot(_),w=_;w--;)v[w]=arguments[w];if(m)var b=us(u),x=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(v,b);if(i&&(v=Ci(v,i,s,m)),o&&(v=Ai(v,o,a,m)),_-=x,m&&_<c){var E=ln(v,b);return Wi(e,n,$i,u.placeholder,r,v,E,h,l,c-_)}var O=d?r:this,M=p?O[e]:e;return _=v.length,h?v=function(e,n){for(var r=e.length,i=vn(n.length,r),s=Si(e);i--;){var o=n[i];e[i]=_s(o,r)?s[o]:t}return e}(v,h):g&&_>1&&v.reverse(),f&&l<_&&(v.length=l),this&&this!==pe&&this instanceof u&&(M=y||Pi(M)),M.apply(O,v)}}function Yi(t,e){return function(n,r){return function(t,e,n,r){return wr(t,(function(t,i,s){e(r,n(t),i,s)})),r}(n,t,e(r),{})}}function Gi(e,n){return function(r,i){var s;if(r===t&&i===t)return n;if(r!==t&&(s=r),i!==t){if(s===t)return i;"string"==typeof r||"string"==typeof i?(r=hi(r),i=hi(i)):(r=ai(r),i=ai(i)),s=e(r,i)}return s}}function Xi(t){return ns((function(e){return e=Re(e,Je(as())),Zr((function(n){var r=this;return t(e,(function(t){return ke(t,r,n)}))}))}))}function Bi(e,n){var r=(n=n===t?" ":hi(n)).length;if(r<2)return r?Ur(n,e):n;var i=Ur(n,me(e/fn(n)));return un(n)?bi(dn(i),0,e).join(""):i.slice(0,e)}function qi(e){return function(n,r,i){return i&&"number"!=typeof i&&vs(n,r,i)&&(r=i=t),n=gu(n),r===t?(r=n,n=0):r=gu(r),function(t,e,n,r){for(var i=-1,s=_n(me((e-t)/(n||1)),0),o=ot(s);s--;)o[r?s:++i]=t,t+=n;return o}(n,r,i=i===t?n<r?1:-1:gu(i),e)}}function Vi(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=vu(e),n=vu(n)),t(e,n)}}function Wi(e,n,r,i,u,a,h,l,c,f){var d=8&n;n|=d?s:o,4&(n&=~(d?o:s))||(n&=-4);var p=[e,n,u,d?a:t,d?h:t,d?t:a,d?t:h,l,c,f],m=r.apply(t,p);return bs(e)&&Ss(m,p),m.placeholder=i,Ts(m,e,n)}function Hi(t){var e=kt[t];return function(t,n){if(t=vu(t),(n=null==n?0:vn(yu(n),292))&&Fe(t)){var r=(bu(t)+"e").split("e");return+((r=(bu(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Ui=Cn&&1/cn(new Cn([,-0]))[1]==h?function(t){return new Cn(t)}:ca;function Zi(t){return function(e){var n=ps(e);return n==b?an(e):n==k?function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}(e):function(t,e){return Re(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Qi(n,h,l,c,f,d,p,m){var g=2&h;if(!g&&"function"!=typeof n)throw new Nt(e);var y=c?c.length:0;if(y||(h&=-97,c=f=t),p=p===t?p:_n(yu(p),0),m=m===t?m:yu(m),y-=f?f.length:0,h&o){var _=c,v=f;c=f=t}var w=g?t:ss(n),b=[n,h,l,c,f,_,v,d,p,m];if(w&&function(t,e){var n=t[1],i=e[1],s=n|i,o=s<131,h=i==u&&8==n||i==u&&n==a&&t[7].length<=e[8]||384==i&&e[7].length<=e[8]&&8==n;if(!o&&!h)return t;1&i&&(t[2]=e[2],s|=1&n?0:4);var l=e[3];if(l){var c=t[3];t[3]=c?Ci(c,l,e[4]):l,t[4]=c?ln(t[3],r):e[4]}(l=e[5])&&(c=t[5],t[5]=c?Ai(c,l,e[6]):l,t[6]=c?ln(t[5],r):e[6]),(l=e[7])&&(t[7]=l),i&u&&(t[8]=null==t[8]?e[8]:vn(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=s}(b,w),n=b[0],h=b[1],l=b[2],c=b[3],f=b[4],!(m=b[9]=b[9]===t?g?0:n.length:_n(b[9]-y,0))&&24&h&&(h&=-25),h&&1!=h)x=8==h||h==i?function(e,n,r){var i=Pi(e);return function s(){for(var o=arguments.length,u=ot(o),a=o,h=us(s);a--;)u[a]=arguments[a];var l=o<3&&u[0]!==h&&u[o-1]!==h?[]:ln(u,h);return(o-=l.length)<r?Wi(e,n,$i,s.placeholder,t,u,l,t,t,r-o):ke(this&&this!==pe&&this instanceof s?i:e,this,u)}}(n,h,m):h!=s&&33!=h||f.length?$i.apply(t,b):function(t,e,n,r){var i=1&e,s=Pi(t);return function e(){for(var o=-1,u=arguments.length,a=-1,h=r.length,l=ot(h+u),c=this&&this!==pe&&this instanceof e?s:t;++a<h;)l[a]=r[a];for(;u--;)l[a++]=arguments[++o];return ke(c,i?n:this,l)}}(n,h,l,c);else var x=function(t,e,n){var r=1&e,i=Pi(t);return function e(){return(this&&this!==pe&&this instanceof e?i:t).apply(r?n:this,arguments)}}(n,h,l);return Ts((w?ti:Ss)(x,b),n,h)}function Ji(e,n,r,i){return e===t||Xo(e,It[r])&&!zt.call(i,r)?n:e}function Ki(e,n,r,i,s,o){return ru(e)&&ru(n)&&(o.set(n,e),Gr(e,n,t,Ki,o),o.delete(n)),e}function ts(e){return uu(e)?t:e}function es(e,n,r,i,s,o){var u=1&r,a=e.length,h=n.length;if(a!=h&&!(u&&h>a))return!1;var l=o.get(e),c=o.get(n);if(l&&c)return l==n&&c==e;var f=-1,d=!0,p=2&r?new Hn:t;for(o.set(e,n),o.set(n,e);++f<a;){var m=e[f],g=n[f];if(i)var y=u?i(g,m,f,n,e,o):i(m,g,f,e,n,o);if(y!==t){if(y)continue;d=!1;break}if(p){if(!De(n,(function(t,e){if(!tn(p,e)&&(m===t||s(m,t,r,i,o)))return p.push(e)}))){d=!1;break}}else if(m!==g&&!s(m,g,r,i,o)){d=!1;break}}return o.delete(e),o.delete(n),d}function ns(e){return js(ks(e,t,Ws),e+"")}function rs(t){return Or(t,Ru,fs)}function is(t){return Or(t,Lu,ds)}var ss=Nn?function(t){return Nn.get(t)}:ca;function os(t){for(var e=t.name+"",n=jn[e],r=zt.call(jn,e)?n.length:0;r--;){var i=n[r],s=i.func;if(null==s||s==t)return i.name}return e}function us(t){return(zt.call($n,"placeholder")?$n:t).placeholder}function as(){var t=$n.iteratee||ua;return t=t===ua?Lr:t,arguments.length?t(arguments[0],arguments[1]):t}function hs(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function ls(t){for(var e=Ru(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,Os(i)]}return e}function cs(e,n){var r=function(e,n){return null==e?t:e[n]}(e,n);return Rr(r)?r:t}var fs=_e?function(t){return null==t?[]:(t=Ct(t),je(_e(t),(function(e){return Ut.call(t,e)})))}:_a,ds=_e?function(t){for(var e=[];t;)Le(e,fs(t)),t=Wt(t);return e}:_a,ps=Mr;function ms(t,e,n){for(var r=-1,i=(e=vi(e,t)).length,s=!1;++r<i;){var o=Fs(e[r]);if(!(s=null!=t&&n(t,o)))break;t=t[o]}return s||++r!=i?s:!!(i=null==t?0:t.length)&&nu(i)&&_s(o,i)&&(Wo(t)||Vo(t))}function gs(t){return"function"!=typeof t.constructor||Es(t)?{}:Yn(Wt(t))}function ys(t){return Wo(t)||Vo(t)||!!(Qt&&t&&t[Qt])}function _s(t,e){var n=typeof t;return!!(e=null==e?l:e)&&("number"==n||"symbol"!=n&&vt.test(t))&&t>-1&&t%1==0&&t<e}function vs(t,e,n){if(!ru(n))return!1;var r=typeof e;return!!("number"==r?Uo(n)&&_s(e,n.length):"string"==r&&e in n)&&Xo(n[e],t)}function ws(t,e){if(Wo(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!cu(t))||J.test(t)||!Q.test(t)||null!=e&&t in Ct(e)}function bs(t){var e=os(t),n=$n[e];if("function"!=typeof n||!(e in Bn.prototype))return!1;if(t===n)return!0;var r=ss(n);return!!r&&t===r[0]}(On&&ps(new On(new ArrayBuffer(1)))!=j||Mn&&ps(new Mn)!=b||kn&&ps(kn.resolve())!=O||Cn&&ps(new Cn)!=k||An&&ps(new An)!=S)&&(ps=function(e){var n=Mr(e),r=n==E?e.constructor:t,i=r?$s(r):"";if(i)switch(i){case Tn:return j;case In:return b;case Rn:return O;case Ln:return k;case zn:return S}return n});var xs=Rt?tu:va;function Es(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||It)}function Os(t){return t==t&&!ru(t)}function Ms(e,n){return function(r){return null!=r&&r[e]===n&&(n!==t||e in Ct(r))}}function ks(e,n,r){return n=_n(n===t?e.length-1:n,0),function(){for(var t=arguments,i=-1,s=_n(t.length-n,0),o=ot(s);++i<s;)o[i]=t[n+i];i=-1;for(var u=ot(n+1);++i<n;)u[i]=t[i];return u[n]=r(o),ke(e,this,u)}}function Cs(t,e){return e.length<2?t:Er(t,ri(e,0,-1))}function As(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Ss=Is(ti),Ns=de||function(t,e){return pe.setTimeout(t,e)},js=Is(ei);function Ts(t,e,n){var r=e+"";return js(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(ut,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Ae(d,(function(n){var r="_."+n[0];e&n[1]&&!Te(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(at);return e?e[1].split(ht):[]}(r),n)))}function Is(e){var n=0,r=0;return function(){var i=wn(),s=16-(i-r);if(r=i,s>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(t,arguments)}}function Rs(e,n){var r=-1,i=e.length,s=i-1;for(n=n===t?i:n;++r<n;){var o=Hr(r,s),u=e[o];e[o]=e[r],e[r]=u}return e.length=n,e}var Ls,zs,Ps,Ds=(Ls=function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(K,(function(t,n,r,i){e.push(r?i.replace(ft,"$1"):n||t)})),e},zs=Po(Ls,(function(t){return 500===Ps.size&&Ps.clear(),t})),Ps=zs.cache,zs);function Fs(t){if("string"==typeof t||cu(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function $s(t){if(null!=t){try{return Lt.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Ys(t){if(t instanceof Bn)return t.clone();var e=new Xn(t.__wrapped__,t.__chain__);return e.__actions__=Si(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Gs=Zr((function(t,e){return Zo(t)?cr(t,yr(e,1,Zo,!0)):[]})),Xs=Zr((function(e,n){var r=Js(n);return Zo(r)&&(r=t),Zo(e)?cr(e,yr(n,1,Zo,!0),as(r,2)):[]})),Bs=Zr((function(e,n){var r=Js(n);return Zo(r)&&(r=t),Zo(e)?cr(e,yr(n,1,Zo,!0),t,r):[]}));function qs(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:yu(n);return i<0&&(i=_n(r+i,0)),Ye(t,as(e,3),i)}function Vs(e,n,r){var i=null==e?0:e.length;if(!i)return-1;var s=i-1;return r!==t&&(s=yu(r),s=r<0?_n(i+s,0):vn(s,i-1)),Ye(e,as(n,3),s,!0)}function Ws(t){return null!=t&&t.length?yr(t,1):[]}function Hs(e){return e&&e.length?e[0]:t}var Us=Zr((function(t){var e=Re(t,yi);return e.length&&e[0]===t[0]?Sr(e):[]})),Zs=Zr((function(e){var n=Js(e),r=Re(e,yi);return n===Js(r)?n=t:r.pop(),r.length&&r[0]===e[0]?Sr(r,as(n,2)):[]})),Qs=Zr((function(e){var n=Js(e),r=Re(e,yi);return(n="function"==typeof n?n:t)&&r.pop(),r.length&&r[0]===e[0]?Sr(r,t,n):[]}));function Js(e){var n=null==e?0:e.length;return n?e[n-1]:t}var Ks=Zr(to);function to(t,e){return t&&t.length&&e&&e.length?Vr(t,e):t}var eo=ns((function(t,e){var n=null==t?0:t.length,r=or(t,e);return Wr(t,Re(e,(function(t){return _s(t,n)?+t:t})).sort(ki)),r}));function no(t){return null==t?t:En.call(t)}var ro=Zr((function(t){return li(yr(t,1,Zo,!0))})),io=Zr((function(e){var n=Js(e);return Zo(n)&&(n=t),li(yr(e,1,Zo,!0),as(n,2))})),so=Zr((function(e){var n=Js(e);return n="function"==typeof n?n:t,li(yr(e,1,Zo,!0),t,n)}));function oo(t){if(!t||!t.length)return[];var e=0;return t=je(t,(function(t){if(Zo(t))return e=_n(t.length,e),!0})),Ze(e,(function(e){return Re(t,Ve(e))}))}function uo(e,n){if(!e||!e.length)return[];var r=oo(e);return null==n?r:Re(r,(function(e){return ke(n,t,e)}))}var ao=Zr((function(t,e){return Zo(t)?cr(t,e):[]})),ho=Zr((function(t){return mi(je(t,Zo))})),lo=Zr((function(e){var n=Js(e);return Zo(n)&&(n=t),mi(je(e,Zo),as(n,2))})),co=Zr((function(e){var n=Js(e);return n="function"==typeof n?n:t,mi(je(e,Zo),t,n)})),fo=Zr(oo),po=Zr((function(e){var n=e.length,r=n>1?e[n-1]:t;return r="function"==typeof r?(e.pop(),r):t,uo(e,r)}));function mo(t){var e=$n(t);return e.__chain__=!0,e}function go(t,e){return e(t)}var yo=ns((function(e){var n=e.length,r=n?e[0]:0,i=this.__wrapped__,s=function(t){return or(t,e)};return!(n>1||this.__actions__.length)&&i instanceof Bn&&_s(r)?((i=i.slice(r,+r+(n?1:0))).__actions__.push({func:go,args:[s],thisArg:t}),new Xn(i,this.__chain__).thru((function(e){return n&&!e.length&&e.push(t),e}))):this.thru(s)})),_o=ji((function(t,e,n){zt.call(t,n)?++t[n]:sr(t,n,1)})),vo=Di(qs),wo=Di(Vs);function bo(t,e){return(Wo(t)?Ae:fr)(t,as(e,3))}function xo(t,e){return(Wo(t)?Se:dr)(t,as(e,3))}var Eo=ji((function(t,e,n){zt.call(t,n)?t[n].push(e):sr(t,n,[e])})),Oo=Zr((function(t,e,n){var r=-1,i="function"==typeof e,s=Uo(t)?ot(t.length):[];return fr(t,(function(t){s[++r]=i?ke(e,t,n):Nr(t,e,n)})),s})),Mo=ji((function(t,e,n){sr(t,n,e)}));function ko(t,e){return(Wo(t)?Re:Fr)(t,as(e,3))}var Co=ji((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),Ao=Zr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&vs(t,e[0],e[1])?e=[]:n>2&&vs(e[0],e[1],e[2])&&(e=[e[0]]),Br(t,yr(e,1),[])})),So=fe||function(){return pe.Date.now()};function No(e,n,r){return n=r?t:n,n=e&&null==n?e.length:n,Qi(e,u,t,t,t,t,n)}function jo(n,r){var i;if("function"!=typeof r)throw new Nt(e);return n=yu(n),function(){return--n>0&&(i=r.apply(this,arguments)),n<=1&&(r=t),i}}var To=Zr((function(t,e,n){var r=1;if(n.length){var i=ln(n,us(To));r|=s}return Qi(t,r,e,n,i)})),Io=Zr((function(t,e,n){var r=3;if(n.length){var i=ln(n,us(Io));r|=s}return Qi(e,r,t,n,i)}));function Ro(n,r,i){var s,o,u,a,h,l,c=0,f=!1,d=!1,p=!0;if("function"!=typeof n)throw new Nt(e);function m(e){var r=s,i=o;return s=o=t,c=e,a=n.apply(i,r)}function g(e){var n=e-l;return l===t||n>=r||n<0||d&&e-c>=u}function y(){var t=So();if(g(t))return _(t);h=Ns(y,function(t){var e=r-(t-l);return d?vn(e,u-(t-c)):e}(t))}function _(e){return h=t,p&&s?m(e):(s=o=t,a)}function v(){var e=So(),n=g(e);if(s=arguments,o=this,l=e,n){if(h===t)return function(t){return c=t,h=Ns(y,r),f?m(t):a}(l);if(d)return xi(h),h=Ns(y,r),m(l)}return h===t&&(h=Ns(y,r)),a}return r=vu(r)||0,ru(i)&&(f=!!i.leading,u=(d="maxWait"in i)?_n(vu(i.maxWait)||0,r):u,p="trailing"in i?!!i.trailing:p),v.cancel=function(){h!==t&&xi(h),c=0,s=l=o=h=t},v.flush=function(){return h===t?a:_(So())},v}var Lo=Zr((function(t,e){return lr(t,1,e)})),zo=Zr((function(t,e,n){return lr(t,vu(e)||0,n)}));function Po(t,n){if("function"!=typeof t||null!=n&&"function"!=typeof n)throw new Nt(e);var r=function(){var e=arguments,i=n?n.apply(this,e):e[0],s=r.cache;if(s.has(i))return s.get(i);var o=t.apply(this,e);return r.cache=s.set(i,o)||s,o};return r.cache=new(Po.Cache||Wn),r}function Do(t){if("function"!=typeof t)throw new Nt(e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Po.Cache=Wn;var Fo=wi((function(t,e){var n=(e=1==e.length&&Wo(e[0])?Re(e[0],Je(as())):Re(yr(e,1),Je(as()))).length;return Zr((function(r){for(var i=-1,s=vn(r.length,n);++i<s;)r[i]=e[i].call(this,r[i]);return ke(t,this,r)}))})),$o=Zr((function(e,n){var r=ln(n,us($o));return Qi(e,s,t,n,r)})),Yo=Zr((function(e,n){var r=ln(n,us(Yo));return Qi(e,o,t,n,r)})),Go=ns((function(e,n){return Qi(e,a,t,t,t,n)}));function Xo(t,e){return t===e||t!=t&&e!=e}var Bo=Vi(kr),qo=Vi((function(t,e){return t>=e})),Vo=jr(function(){return arguments}())?jr:function(t){return iu(t)&&zt.call(t,"callee")&&!Ut.call(t,"callee")},Wo=ot.isArray,Ho=we?Je(we):function(t){return iu(t)&&Mr(t)==N};function Uo(t){return null!=t&&nu(t.length)&&!tu(t)}function Zo(t){return iu(t)&&Uo(t)}var Qo=ve||va,Jo=be?Je(be):function(t){return iu(t)&&Mr(t)==y};function Ko(t){if(!iu(t))return!1;var e=Mr(t);return e==_||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!uu(t)}function tu(t){if(!ru(t))return!1;var e=Mr(t);return e==v||e==w||"[object AsyncFunction]"==e||"[object Proxy]"==e}function eu(t){return"number"==typeof t&&t==yu(t)}function nu(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=l}function ru(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function iu(t){return null!=t&&"object"==typeof t}var su=xe?Je(xe):function(t){return iu(t)&&ps(t)==b};function ou(t){return"number"==typeof t||iu(t)&&Mr(t)==x}function uu(t){if(!iu(t)||Mr(t)!=E)return!1;var e=Wt(t);if(null===e)return!0;var n=zt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Lt.call(n)==$t}var au=Ee?Je(Ee):function(t){return iu(t)&&Mr(t)==M},hu=Oe?Je(Oe):function(t){return iu(t)&&ps(t)==k};function lu(t){return"string"==typeof t||!Wo(t)&&iu(t)&&Mr(t)==C}function cu(t){return"symbol"==typeof t||iu(t)&&Mr(t)==A}var fu=Me?Je(Me):function(t){return iu(t)&&nu(t.length)&&!!ue[Mr(t)]},du=Vi(Dr),pu=Vi((function(t,e){return t<=e}));function mu(t){if(!t)return[];if(Uo(t))return lu(t)?dn(t):Si(t);if(Jt&&t[Jt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Jt]());var e=ps(t);return(e==b?an:e==k?cn:Xu)(t)}function gu(t){return t?(t=vu(t))===h||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function yu(t){var e=gu(t),n=e%1;return e==e?n?e-n:e:0}function _u(t){return t?ur(yu(t),0,f):0}function vu(t){if("number"==typeof t)return t;if(cu(t))return c;if(ru(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ru(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Qe(t);var n=gt.test(t);return n||_t.test(t)?ce(t.slice(2),n?2:8):mt.test(t)?c:+t}function wu(t){return Ni(t,Lu(t))}function bu(t){return null==t?"":hi(t)}var xu=Ti((function(t,e){if(Es(e)||Uo(e))Ni(e,Ru(e),t);else for(var n in e)zt.call(e,n)&&er(t,n,e[n])})),Eu=Ti((function(t,e){Ni(e,Lu(e),t)})),Ou=Ti((function(t,e,n,r){Ni(e,Lu(e),t,r)})),Mu=Ti((function(t,e,n,r){Ni(e,Ru(e),t,r)})),ku=ns(or),Cu=Zr((function(e,n){e=Ct(e);var r=-1,i=n.length,s=i>2?n[2]:t;for(s&&vs(n[0],n[1],s)&&(i=1);++r<i;)for(var o=n[r],u=Lu(o),a=-1,h=u.length;++a<h;){var l=u[a],c=e[l];(c===t||Xo(c,It[l])&&!zt.call(e,l))&&(e[l]=o[l])}return e})),Au=Zr((function(e){return e.push(t,Ki),ke(Pu,t,e)}));function Su(e,n,r){var i=null==e?t:Er(e,n);return i===t?r:i}function Nu(t,e){return null!=t&&ms(t,e,Ar)}var ju=Yi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Ft.call(e)),t[e]=n}),ra(oa)),Tu=Yi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Ft.call(e)),zt.call(t,e)?t[e].push(n):t[e]=[n]}),as),Iu=Zr(Nr);function Ru(t){return Uo(t)?Zn(t):zr(t)}function Lu(t){return Uo(t)?Zn(t,!0):Pr(t)}var zu=Ti((function(t,e,n){Gr(t,e,n)})),Pu=Ti((function(t,e,n,r){Gr(t,e,n,r)})),Du=ns((function(t,e){var n={};if(null==t)return n;var r=!1;e=Re(e,(function(e){return e=vi(e,t),r||(r=e.length>1),e})),Ni(t,is(t),n),r&&(n=ar(n,7,ts));for(var i=e.length;i--;)ci(n,e[i]);return n})),Fu=ns((function(t,e){return null==t?{}:function(t,e){return qr(t,e,(function(e,n){return Nu(t,n)}))}(t,e)}));function $u(t,e){if(null==t)return{};var n=Re(is(t),(function(t){return[t]}));return e=as(e),qr(t,n,(function(t,n){return e(t,n[0])}))}var Yu=Zi(Ru),Gu=Zi(Lu);function Xu(t){return null==t?[]:Ke(t,Ru(t))}var Bu=zi((function(t,e,n){return e=e.toLowerCase(),t+(n?qu(e):e)}));function qu(t){return Ku(bu(t).toLowerCase())}function Vu(t){return(t=bu(t))&&t.replace(wt,rn).replace(te,"")}var Wu=zi((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Hu=zi((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Uu=Li("toLowerCase"),Zu=zi((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Qu=zi((function(t,e,n){return t+(n?" ":"")+Ku(e)})),Ju=zi((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Ku=Li("toUpperCase");function ta(e,n,r){return e=bu(e),(n=r?t:n)===t?function(t){return ie.test(t)}(e)?function(t){return t.match(ne)||[]}(e):function(t){return t.match(lt)||[]}(e):e.match(n)||[]}var ea=Zr((function(e,n){try{return ke(e,t,n)}catch(r){return Ko(r)?r:new Ot(r)}})),na=ns((function(t,e){return Ae(e,(function(e){e=Fs(e),sr(t,e,To(t[e],t))})),t}));function ra(t){return function(){return t}}var ia=Fi(),sa=Fi(!0);function oa(t){return t}function ua(t){return Lr("function"==typeof t?t:ar(t,1))}var aa=Zr((function(t,e){return function(n){return Nr(n,t,e)}})),ha=Zr((function(t,e){return function(n){return Nr(t,n,e)}}));function la(t,e,n){var r=Ru(e),i=xr(e,r);null!=n||ru(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=xr(e,Ru(e)));var s=!(ru(n)&&"chain"in n&&!n.chain),o=tu(t);return Ae(i,(function(n){var r=e[n];t[n]=r,o&&(t.prototype[n]=function(){var e=this.__chain__;if(s||e){var n=t(this.__wrapped__);return(n.__actions__=Si(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Le([this.value()],arguments))})})),t}function ca(){}var fa=Xi(Re),da=Xi(Ne),pa=Xi(De);function ma(t){return ws(t)?Ve(Fs(t)):function(t){return function(e){return Er(e,t)}}(t)}var ga=qi(),ya=qi(!0);function _a(){return[]}function va(){return!1}var wa,ba=Gi((function(t,e){return t+e}),0),xa=Hi("ceil"),Ea=Gi((function(t,e){return t/e}),1),Oa=Hi("floor"),Ma=Gi((function(t,e){return t*e}),1),ka=Hi("round"),Ca=Gi((function(t,e){return t-e}),0);return $n.after=function(t,n){if("function"!=typeof n)throw new Nt(e);return t=yu(t),function(){if(--t<1)return n.apply(this,arguments)}},$n.ary=No,$n.assign=xu,$n.assignIn=Eu,$n.assignInWith=Ou,$n.assignWith=Mu,$n.at=ku,$n.before=jo,$n.bind=To,$n.bindAll=na,$n.bindKey=Io,$n.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Wo(t)?t:[t]},$n.chain=mo,$n.chunk=function(e,n,r){n=(r?vs(e,n,r):n===t)?1:_n(yu(n),0);var i=null==e?0:e.length;if(!i||n<1)return[];for(var s=0,o=0,u=ot(me(i/n));s<i;)u[o++]=ri(e,s,s+=n);return u},$n.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var s=t[e];s&&(i[r++]=s)}return i},$n.concat=function(){var t=arguments.length;if(!t)return[];for(var e=ot(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return Le(Wo(n)?Si(n):[n],yr(e,1))},$n.cond=function(t){var n=null==t?0:t.length,r=as();return t=n?Re(t,(function(t){if("function"!=typeof t[1])throw new Nt(e);return[r(t[0]),t[1]]})):[],Zr((function(e){for(var r=-1;++r<n;){var i=t[r];if(ke(i[0],this,e))return ke(i[1],this,e)}}))},$n.conforms=function(t){return function(t){var e=Ru(t);return function(n){return hr(n,t,e)}}(ar(t,1))},$n.constant=ra,$n.countBy=_o,$n.create=function(t,e){var n=Yn(t);return null==e?n:ir(n,e)},$n.curry=function e(n,r,i){var s=Qi(n,8,t,t,t,t,t,r=i?t:r);return s.placeholder=e.placeholder,s},$n.curryRight=function e(n,r,s){var o=Qi(n,i,t,t,t,t,t,r=s?t:r);return o.placeholder=e.placeholder,o},$n.debounce=Ro,$n.defaults=Cu,$n.defaultsDeep=Au,$n.defer=Lo,$n.delay=zo,$n.difference=Gs,$n.differenceBy=Xs,$n.differenceWith=Bs,$n.drop=function(e,n,r){var i=null==e?0:e.length;return i?ri(e,(n=r||n===t?1:yu(n))<0?0:n,i):[]},$n.dropRight=function(e,n,r){var i=null==e?0:e.length;return i?ri(e,0,(n=i-(n=r||n===t?1:yu(n)))<0?0:n):[]},$n.dropRightWhile=function(t,e){return t&&t.length?di(t,as(e,3),!0,!0):[]},$n.dropWhile=function(t,e){return t&&t.length?di(t,as(e,3),!0):[]},$n.fill=function(e,n,r,i){var s=null==e?0:e.length;return s?(r&&"number"!=typeof r&&vs(e,n,r)&&(r=0,i=s),function(e,n,r,i){var s=e.length;for((r=yu(r))<0&&(r=-r>s?0:s+r),(i=i===t||i>s?s:yu(i))<0&&(i+=s),i=r>i?0:_u(i);r<i;)e[r++]=n;return e}(e,n,r,i)):[]},$n.filter=function(t,e){return(Wo(t)?je:gr)(t,as(e,3))},$n.flatMap=function(t,e){return yr(ko(t,e),1)},$n.flatMapDeep=function(t,e){return yr(ko(t,e),h)},$n.flatMapDepth=function(e,n,r){return r=r===t?1:yu(r),yr(ko(e,n),r)},$n.flatten=Ws,$n.flattenDeep=function(t){return null!=t&&t.length?yr(t,h):[]},$n.flattenDepth=function(e,n){return null!=e&&e.length?yr(e,n=n===t?1:yu(n)):[]},$n.flip=function(t){return Qi(t,512)},$n.flow=ia,$n.flowRight=sa,$n.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},$n.functions=function(t){return null==t?[]:xr(t,Ru(t))},$n.functionsIn=function(t){return null==t?[]:xr(t,Lu(t))},$n.groupBy=Eo,$n.initial=function(t){return null!=t&&t.length?ri(t,0,-1):[]},$n.intersection=Us,$n.intersectionBy=Zs,$n.intersectionWith=Qs,$n.invert=ju,$n.invertBy=Tu,$n.invokeMap=Oo,$n.iteratee=ua,$n.keyBy=Mo,$n.keys=Ru,$n.keysIn=Lu,$n.map=ko,$n.mapKeys=function(t,e){var n={};return e=as(e,3),wr(t,(function(t,r,i){sr(n,e(t,r,i),t)})),n},$n.mapValues=function(t,e){var n={};return e=as(e,3),wr(t,(function(t,r,i){sr(n,r,e(t,r,i))})),n},$n.matches=function(t){return $r(ar(t,1))},$n.matchesProperty=function(t,e){return Yr(t,ar(e,1))},$n.memoize=Po,$n.merge=zu,$n.mergeWith=Pu,$n.method=aa,$n.methodOf=ha,$n.mixin=la,$n.negate=Do,$n.nthArg=function(t){return t=yu(t),Zr((function(e){return Xr(e,t)}))},$n.omit=Du,$n.omitBy=function(t,e){return $u(t,Do(as(e)))},$n.once=function(t){return jo(2,t)},$n.orderBy=function(e,n,r,i){return null==e?[]:(Wo(n)||(n=null==n?[]:[n]),Wo(r=i?t:r)||(r=null==r?[]:[r]),Br(e,n,r))},$n.over=fa,$n.overArgs=Fo,$n.overEvery=da,$n.overSome=pa,$n.partial=$o,$n.partialRight=Yo,$n.partition=Co,$n.pick=Fu,$n.pickBy=$u,$n.property=ma,$n.propertyOf=function(e){return function(n){return null==e?t:Er(e,n)}},$n.pull=Ks,$n.pullAll=to,$n.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Vr(t,e,as(n,2)):t},$n.pullAllWith=function(e,n,r){return e&&e.length&&n&&n.length?Vr(e,n,t,r):e},$n.pullAt=eo,$n.range=ga,$n.rangeRight=ya,$n.rearg=Go,$n.reject=function(t,e){return(Wo(t)?je:gr)(t,Do(as(e,3)))},$n.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],s=t.length;for(e=as(e,3);++r<s;){var o=t[r];e(o,r,t)&&(n.push(o),i.push(r))}return Wr(t,i),n},$n.rest=function(n,r){if("function"!=typeof n)throw new Nt(e);return Zr(n,r=r===t?r:yu(r))},$n.reverse=no,$n.sampleSize=function(e,n,r){return n=(r?vs(e,n,r):n===t)?1:yu(n),(Wo(e)?Jn:Jr)(e,n)},$n.set=function(t,e,n){return null==t?t:Kr(t,e,n)},$n.setWith=function(e,n,r,i){return i="function"==typeof i?i:t,null==e?e:Kr(e,n,r,i)},$n.shuffle=function(t){return(Wo(t)?Kn:ni)(t)},$n.slice=function(e,n,r){var i=null==e?0:e.length;return i?(r&&"number"!=typeof r&&vs(e,n,r)?(n=0,r=i):(n=null==n?0:yu(n),r=r===t?i:yu(r)),ri(e,n,r)):[]},$n.sortBy=Ao,$n.sortedUniq=function(t){return t&&t.length?ui(t):[]},$n.sortedUniqBy=function(t,e){return t&&t.length?ui(t,as(e,2)):[]},$n.split=function(e,n,r){return r&&"number"!=typeof r&&vs(e,n,r)&&(n=r=t),(r=r===t?f:r>>>0)?(e=bu(e))&&("string"==typeof n||null!=n&&!au(n))&&!(n=hi(n))&&un(e)?bi(dn(e),0,r):e.split(n,r):[]},$n.spread=function(t,n){if("function"!=typeof t)throw new Nt(e);return n=null==n?0:_n(yu(n),0),Zr((function(e){var r=e[n],i=bi(e,0,n);return r&&Le(i,r),ke(t,this,i)}))},$n.tail=function(t){var e=null==t?0:t.length;return e?ri(t,1,e):[]},$n.take=function(e,n,r){return e&&e.length?ri(e,0,(n=r||n===t?1:yu(n))<0?0:n):[]},$n.takeRight=function(e,n,r){var i=null==e?0:e.length;return i?ri(e,(n=i-(n=r||n===t?1:yu(n)))<0?0:n,i):[]},$n.takeRightWhile=function(t,e){return t&&t.length?di(t,as(e,3),!1,!0):[]},$n.takeWhile=function(t,e){return t&&t.length?di(t,as(e,3)):[]},$n.tap=function(t,e){return e(t),t},$n.throttle=function(t,n,r){var i=!0,s=!0;if("function"!=typeof t)throw new Nt(e);return ru(r)&&(i="leading"in r?!!r.leading:i,s="trailing"in r?!!r.trailing:s),Ro(t,n,{leading:i,maxWait:n,trailing:s})},$n.thru=go,$n.toArray=mu,$n.toPairs=Yu,$n.toPairsIn=Gu,$n.toPath=function(t){return Wo(t)?Re(t,Fs):cu(t)?[t]:Si(Ds(bu(t)))},$n.toPlainObject=wu,$n.transform=function(t,e,n){var r=Wo(t),i=r||Qo(t)||fu(t);if(e=as(e,4),null==n){var s=t&&t.constructor;n=i?r?new s:[]:ru(t)&&tu(s)?Yn(Wt(t)):{}}return(i?Ae:wr)(t,(function(t,r,i){return e(n,t,r,i)})),n},$n.unary=function(t){return No(t,1)},$n.union=ro,$n.unionBy=io,$n.unionWith=so,$n.uniq=function(t){return t&&t.length?li(t):[]},$n.uniqBy=function(t,e){return t&&t.length?li(t,as(e,2)):[]},$n.uniqWith=function(e,n){return n="function"==typeof n?n:t,e&&e.length?li(e,t,n):[]},$n.unset=function(t,e){return null==t||ci(t,e)},$n.unzip=oo,$n.unzipWith=uo,$n.update=function(t,e,n){return null==t?t:fi(t,e,_i(n))},$n.updateWith=function(e,n,r,i){return i="function"==typeof i?i:t,null==e?e:fi(e,n,_i(r),i)},$n.values=Xu,$n.valuesIn=function(t){return null==t?[]:Ke(t,Lu(t))},$n.without=ao,$n.words=ta,$n.wrap=function(t,e){return $o(_i(e),t)},$n.xor=ho,$n.xorBy=lo,$n.xorWith=co,$n.zip=fo,$n.zipObject=function(t,e){return gi(t||[],e||[],er)},$n.zipObjectDeep=function(t,e){return gi(t||[],e||[],Kr)},$n.zipWith=po,$n.entries=Yu,$n.entriesIn=Gu,$n.extend=Eu,$n.extendWith=Ou,la($n,$n),$n.add=ba,$n.attempt=ea,$n.camelCase=Bu,$n.capitalize=qu,$n.ceil=xa,$n.clamp=function(e,n,r){return r===t&&(r=n,n=t),r!==t&&(r=(r=vu(r))==r?r:0),n!==t&&(n=(n=vu(n))==n?n:0),ur(vu(e),n,r)},$n.clone=function(t){return ar(t,4)},$n.cloneDeep=function(t){return ar(t,5)},$n.cloneDeepWith=function(e,n){return ar(e,5,n="function"==typeof n?n:t)},$n.cloneWith=function(e,n){return ar(e,4,n="function"==typeof n?n:t)},$n.conformsTo=function(t,e){return null==e||hr(t,e,Ru(e))},$n.deburr=Vu,$n.defaultTo=function(t,e){return null==t||t!=t?e:t},$n.divide=Ea,$n.endsWith=function(e,n,r){e=bu(e),n=hi(n);var i=e.length,s=r=r===t?i:ur(yu(r),0,i);return(r-=n.length)>=0&&e.slice(r,s)==n},$n.eq=Xo,$n.escape=function(t){return(t=bu(t))&&W.test(t)?t.replace(q,sn):t},$n.escapeRegExp=function(t){return(t=bu(t))&&et.test(t)?t.replace(tt,"\\$&"):t},$n.every=function(e,n,r){var i=Wo(e)?Ne:pr;return r&&vs(e,n,r)&&(n=t),i(e,as(n,3))},$n.find=vo,$n.findIndex=qs,$n.findKey=function(t,e){return $e(t,as(e,3),wr)},$n.findLast=wo,$n.findLastIndex=Vs,$n.findLastKey=function(t,e){return $e(t,as(e,3),br)},$n.floor=Oa,$n.forEach=bo,$n.forEachRight=xo,$n.forIn=function(t,e){return null==t?t:_r(t,as(e,3),Lu)},$n.forInRight=function(t,e){return null==t?t:vr(t,as(e,3),Lu)},$n.forOwn=function(t,e){return t&&wr(t,as(e,3))},$n.forOwnRight=function(t,e){return t&&br(t,as(e,3))},$n.get=Su,$n.gt=Bo,$n.gte=qo,$n.has=function(t,e){return null!=t&&ms(t,e,Cr)},$n.hasIn=Nu,$n.head=Hs,$n.identity=oa,$n.includes=function(t,e,n,r){t=Uo(t)?t:Xu(t),n=n&&!r?yu(n):0;var i=t.length;return n<0&&(n=_n(i+n,0)),lu(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Ge(t,e,n)>-1},$n.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:yu(n);return i<0&&(i=_n(r+i,0)),Ge(t,e,i)},$n.inRange=function(e,n,r){return n=gu(n),r===t?(r=n,n=0):r=gu(r),function(t,e,n){return t>=vn(e,n)&&t<_n(e,n)}(e=vu(e),n,r)},$n.invoke=Iu,$n.isArguments=Vo,$n.isArray=Wo,$n.isArrayBuffer=Ho,$n.isArrayLike=Uo,$n.isArrayLikeObject=Zo,$n.isBoolean=function(t){return!0===t||!1===t||iu(t)&&Mr(t)==g},$n.isBuffer=Qo,$n.isDate=Jo,$n.isElement=function(t){return iu(t)&&1===t.nodeType&&!uu(t)},$n.isEmpty=function(t){if(null==t)return!0;if(Uo(t)&&(Wo(t)||"string"==typeof t||"function"==typeof t.splice||Qo(t)||fu(t)||Vo(t)))return!t.length;var e=ps(t);if(e==b||e==k)return!t.size;if(Es(t))return!zr(t).length;for(var n in t)if(zt.call(t,n))return!1;return!0},$n.isEqual=function(t,e){return Tr(t,e)},$n.isEqualWith=function(e,n,r){var i=(r="function"==typeof r?r:t)?r(e,n):t;return i===t?Tr(e,n,t,r):!!i},$n.isError=Ko,$n.isFinite=function(t){return"number"==typeof t&&Fe(t)},$n.isFunction=tu,$n.isInteger=eu,$n.isLength=nu,$n.isMap=su,$n.isMatch=function(t,e){return t===e||Ir(t,e,ls(e))},$n.isMatchWith=function(e,n,r){return r="function"==typeof r?r:t,Ir(e,n,ls(n),r)},$n.isNaN=function(t){return ou(t)&&t!=+t},$n.isNative=function(t){if(xs(t))throw new Ot("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Rr(t)},$n.isNil=function(t){return null==t},$n.isNull=function(t){return null===t},$n.isNumber=ou,$n.isObject=ru,$n.isObjectLike=iu,$n.isPlainObject=uu,$n.isRegExp=au,$n.isSafeInteger=function(t){return eu(t)&&t>=-9007199254740991&&t<=l},$n.isSet=hu,$n.isString=lu,$n.isSymbol=cu,$n.isTypedArray=fu,$n.isUndefined=function(e){return e===t},$n.isWeakMap=function(t){return iu(t)&&ps(t)==S},$n.isWeakSet=function(t){return iu(t)&&"[object WeakSet]"==Mr(t)},$n.join=function(t,e){return null==t?"":We.call(t,e)},$n.kebabCase=Wu,$n.last=Js,$n.lastIndexOf=function(e,n,r){var i=null==e?0:e.length;if(!i)return-1;var s=i;return r!==t&&(s=(s=yu(r))<0?_n(i+s,0):vn(s,i-1)),n==n?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(e,n,s):Ye(e,Be,s,!0)},$n.lowerCase=Hu,$n.lowerFirst=Uu,$n.lt=du,$n.lte=pu,$n.max=function(e){return e&&e.length?mr(e,oa,kr):t},$n.maxBy=function(e,n){return e&&e.length?mr(e,as(n,2),kr):t},$n.mean=function(t){return qe(t,oa)},$n.meanBy=function(t,e){return qe(t,as(e,2))},$n.min=function(e){return e&&e.length?mr(e,oa,Dr):t},$n.minBy=function(e,n){return e&&e.length?mr(e,as(n,2),Dr):t},$n.stubArray=_a,$n.stubFalse=va,$n.stubObject=function(){return{}},$n.stubString=function(){return""},$n.stubTrue=function(){return!0},$n.multiply=Ma,$n.nth=function(e,n){return e&&e.length?Xr(e,yu(n)):t},$n.noConflict=function(){return pe._===this&&(pe._=Yt),this},$n.noop=ca,$n.now=So,$n.pad=function(t,e,n){t=bu(t);var r=(e=yu(e))?fn(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Bi(ge(i),n)+t+Bi(me(i),n)},$n.padEnd=function(t,e,n){t=bu(t);var r=(e=yu(e))?fn(t):0;return e&&r<e?t+Bi(e-r,n):t},$n.padStart=function(t,e,n){t=bu(t);var r=(e=yu(e))?fn(t):0;return e&&r<e?Bi(e-r,n)+t:t},$n.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),bn(bu(t).replace(nt,""),e||0)},$n.random=function(e,n,r){if(r&&"boolean"!=typeof r&&vs(e,n,r)&&(n=r=t),r===t&&("boolean"==typeof n?(r=n,n=t):"boolean"==typeof e&&(r=e,e=t)),e===t&&n===t?(e=0,n=1):(e=gu(e),n===t?(n=e,e=0):n=gu(n)),e>n){var i=e;e=n,n=i}if(r||e%1||n%1){var s=xn();return vn(e+s*(n-e+le("1e-"+((s+"").length-1))),n)}return Hr(e,n)},$n.reduce=function(t,e,n){var r=Wo(t)?ze:He,i=arguments.length<3;return r(t,as(e,4),n,i,fr)},$n.reduceRight=function(t,e,n){var r=Wo(t)?Pe:He,i=arguments.length<3;return r(t,as(e,4),n,i,dr)},$n.repeat=function(e,n,r){return n=(r?vs(e,n,r):n===t)?1:yu(n),Ur(bu(e),n)},$n.replace=function(){var t=arguments,e=bu(t[0]);return t.length<3?e:e.replace(t[1],t[2])},$n.result=function(e,n,r){var i=-1,s=(n=vi(n,e)).length;for(s||(s=1,e=t);++i<s;){var o=null==e?t:e[Fs(n[i])];o===t&&(i=s,o=r),e=tu(o)?o.call(e):o}return e},$n.round=ka,$n.runInContext=rt,$n.sample=function(t){return(Wo(t)?Qn:Qr)(t)},$n.size=function(t){if(null==t)return 0;if(Uo(t))return lu(t)?fn(t):t.length;var e=ps(t);return e==b||e==k?t.size:zr(t).length},$n.snakeCase=Zu,$n.some=function(e,n,r){var i=Wo(e)?De:ii;return r&&vs(e,n,r)&&(n=t),i(e,as(n,3))},$n.sortedIndex=function(t,e){return si(t,e)},$n.sortedIndexBy=function(t,e,n){return oi(t,e,as(n,2))},$n.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=si(t,e);if(r<n&&Xo(t[r],e))return r}return-1},$n.sortedLastIndex=function(t,e){return si(t,e,!0)},$n.sortedLastIndexBy=function(t,e,n){return oi(t,e,as(n,2),!0)},$n.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=si(t,e,!0)-1;if(Xo(t[n],e))return n}return-1},$n.startCase=Qu,$n.startsWith=function(t,e,n){return t=bu(t),n=null==n?0:ur(yu(n),0,t.length),e=hi(e),t.slice(n,n+e.length)==e},$n.subtract=Ca,$n.sum=function(t){return t&&t.length?Ue(t,oa):0},$n.sumBy=function(t,e){return t&&t.length?Ue(t,as(e,2)):0},$n.template=function(e,n,r){var i=$n.templateSettings;r&&vs(e,n,r)&&(n=t),e=bu(e),n=Ou({},n,i,Ji);var s,o,u=Ou({},n.imports,i.imports,Ji),a=Ru(u),h=Ke(u,a),l=0,c=n.interpolate||bt,f="__p += '",d=At((n.escape||bt).source+"|"+c.source+"|"+(c===Z?dt:bt).source+"|"+(n.evaluate||bt).source+"|$","g"),p="//# sourceURL="+(zt.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++oe+"]")+"\n";e.replace(d,(function(t,n,r,i,u,a){return r||(r=i),f+=e.slice(l,a).replace(xt,on),n&&(s=!0,f+="' +\n__e("+n+") +\n'"),u&&(o=!0,f+="';\n"+u+";\n__p += '"),r&&(f+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=a+t.length,t})),f+="';\n";var m=zt.call(n,"variable")&&n.variable;if(m){if(ct.test(m))throw new Ot("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(o?f.replace(Y,""):f).replace(G,"$1").replace(X,"$1;"),f="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var g=ea((function(){return Mt(a,p+"return "+f).apply(t,h)}));if(g.source=f,Ko(g))throw g;return g},$n.times=function(t,e){if((t=yu(t))<1||t>l)return[];var n=f,r=vn(t,f);e=as(e),t-=f;for(var i=Ze(r,e);++n<t;)e(n);return i},$n.toFinite=gu,$n.toInteger=yu,$n.toLength=_u,$n.toLower=function(t){return bu(t).toLowerCase()},$n.toNumber=vu,$n.toSafeInteger=function(t){return t?ur(yu(t),-9007199254740991,l):0===t?t:0},$n.toString=bu,$n.toUpper=function(t){return bu(t).toUpperCase()},$n.trim=function(e,n,r){if((e=bu(e))&&(r||n===t))return Qe(e);if(!e||!(n=hi(n)))return e;var i=dn(e),s=dn(n);return bi(i,en(i,s),nn(i,s)+1).join("")},$n.trimEnd=function(e,n,r){if((e=bu(e))&&(r||n===t))return e.slice(0,pn(e)+1);if(!e||!(n=hi(n)))return e;var i=dn(e);return bi(i,0,nn(i,dn(n))+1).join("")},$n.trimStart=function(e,n,r){if((e=bu(e))&&(r||n===t))return e.replace(nt,"");if(!e||!(n=hi(n)))return e;var i=dn(e);return bi(i,en(i,dn(n))).join("")},$n.truncate=function(e,n){var r=30,i="...";if(ru(n)){var s="separator"in n?n.separator:s;r="length"in n?yu(n.length):r,i="omission"in n?hi(n.omission):i}var o=(e=bu(e)).length;if(un(e)){var u=dn(e);o=u.length}if(r>=o)return e;var a=r-fn(i);if(a<1)return i;var h=u?bi(u,0,a).join(""):e.slice(0,a);if(s===t)return h+i;if(u&&(a+=h.length-a),au(s)){if(e.slice(a).search(s)){var l,c=h;for(s.global||(s=At(s.source,bu(pt.exec(s))+"g")),s.lastIndex=0;l=s.exec(c);)var f=l.index;h=h.slice(0,f===t?a:f)}}else if(e.indexOf(hi(s),a)!=a){var d=h.lastIndexOf(s);d>-1&&(h=h.slice(0,d))}return h+i},$n.unescape=function(t){return(t=bu(t))&&V.test(t)?t.replace(B,mn):t},$n.uniqueId=function(t){var e=++Pt;return bu(t)+e},$n.upperCase=Ju,$n.upperFirst=Ku,$n.each=bo,$n.eachRight=xo,$n.first=Hs,la($n,(wa={},wr($n,(function(t,e){zt.call($n.prototype,e)||(wa[e]=t)})),wa),{chain:!1}),$n.VERSION="4.17.21",Ae(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){$n[t].placeholder=$n})),Ae(["drop","take"],(function(e,n){Bn.prototype[e]=function(r){r=r===t?1:_n(yu(r),0);var i=this.__filtered__&&!n?new Bn(this):this.clone();return i.__filtered__?i.__takeCount__=vn(r,i.__takeCount__):i.__views__.push({size:vn(r,f),type:e+(i.__dir__<0?"Right":"")}),i},Bn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Ae(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Bn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:as(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),Ae(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Bn.prototype[t]=function(){return this[n](1).value()[0]}})),Ae(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Bn.prototype[t]=function(){return this.__filtered__?new Bn(this):this[n](1)}})),Bn.prototype.compact=function(){return this.filter(oa)},Bn.prototype.find=function(t){return this.filter(t).head()},Bn.prototype.findLast=function(t){return this.reverse().find(t)},Bn.prototype.invokeMap=Zr((function(t,e){return"function"==typeof t?new Bn(this):this.map((function(n){return Nr(n,t,e)}))})),Bn.prototype.reject=function(t){return this.filter(Do(as(t)))},Bn.prototype.slice=function(e,n){e=yu(e);var r=this;return r.__filtered__&&(e>0||n<0)?new Bn(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),n!==t&&(r=(n=yu(n))<0?r.dropRight(-n):r.take(n-e)),r)},Bn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Bn.prototype.toArray=function(){return this.take(f)},wr(Bn.prototype,(function(e,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),i=/^(?:head|last)$/.test(n),s=$n[i?"take"+("last"==n?"Right":""):n],o=i||/^find/.test(n);s&&($n.prototype[n]=function(){var n=this.__wrapped__,u=i?[1]:arguments,a=n instanceof Bn,h=u[0],l=a||Wo(n),c=function(t){var e=s.apply($n,Le([t],u));return i&&f?e[0]:e};l&&r&&"function"==typeof h&&1!=h.length&&(a=l=!1);var f=this.__chain__,d=!!this.__actions__.length,p=o&&!f,m=a&&!d;if(!o&&l){n=m?n:new Bn(this);var g=e.apply(n,u);return g.__actions__.push({func:go,args:[c],thisArg:t}),new Xn(g,f)}return p&&m?e.apply(this,u):(g=this.thru(c),p?i?g.value()[0]:g.value():g)})})),Ae(["pop","push","shift","sort","splice","unshift"],(function(t){var e=jt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);$n.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Wo(i)?i:[],t)}return this[n]((function(n){return e.apply(Wo(n)?n:[],t)}))}})),wr(Bn.prototype,(function(t,e){var n=$n[e];if(n){var r=n.name+"";zt.call(jn,r)||(jn[r]=[]),jn[r].push({name:e,func:n})}})),jn[$i(t,2).name]=[{name:"wrapper",func:t}],Bn.prototype.clone=function(){var t=new Bn(this.__wrapped__);return t.__actions__=Si(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Si(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Si(this.__views__),t},Bn.prototype.reverse=function(){if(this.__filtered__){var t=new Bn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Bn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Wo(t),r=e<0,i=n?t.length:0,s=function(t,e,n){for(var r=-1,i=n.length;++r<i;){var s=n[r],o=s.size;switch(s.type){case"drop":t+=o;break;case"dropRight":e-=o;break;case"take":e=vn(e,t+o);break;case"takeRight":t=_n(t,e-o)}}return{start:t,end:e}}(0,i,this.__views__),o=s.start,u=s.end,a=u-o,h=r?u:o-1,l=this.__iteratees__,c=l.length,f=0,d=vn(a,this.__takeCount__);if(!n||!r&&i==a&&d==a)return pi(t,this.__actions__);var p=[];t:for(;a--&&f<d;){for(var m=-1,g=t[h+=e];++m<c;){var y=l[m],_=y.iteratee,v=y.type,w=_(g);if(2==v)g=w;else if(!w){if(1==v)continue t;break t}}p[f++]=g}return p},$n.prototype.at=yo,$n.prototype.chain=function(){return mo(this)},$n.prototype.commit=function(){return new Xn(this.value(),this.__chain__)},$n.prototype.next=function(){this.__values__===t&&(this.__values__=mu(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?t:this.__values__[this.__index__++]}},$n.prototype.plant=function(e){for(var n,r=this;r instanceof Gn;){var i=Ys(r);i.__index__=0,i.__values__=t,n?s.__wrapped__=i:n=i;var s=i;r=r.__wrapped__}return s.__wrapped__=e,n},$n.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Bn){var n=e;return this.__actions__.length&&(n=new Bn(this)),(n=n.reverse()).__actions__.push({func:go,args:[no],thisArg:t}),new Xn(n,this.__chain__)}return this.thru(no)},$n.prototype.toJSON=$n.prototype.valueOf=$n.prototype.value=function(){return pi(this.__wrapped__,this.__actions__)},$n.prototype.first=$n.prototype.head,Jt&&($n.prototype[Jt]=function(){return this}),$n}();ge?((ge.exports=gn)._=gn,me._=gn):pe._=gn}.call(st);const ut={},at=[];function ht(t,e){if(Array.isArray(t))for(const n of t)ht(n,e);else if("object"!=typeof t)ct(Object.getOwnPropertyNames(e)),ut[t]=Object.assign(ut[t]||{},e);else for(const n in t)ht(n,t[n])}function lt(t){return ut[t]||{}}function ct(t){at.push(...t)}function ft(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)i.push(e(t[n]));return i}function dt(t){return t%360*Math.PI/180}function pt(t){return t.charAt(0).toUpperCase()+t.slice(1)}function mt(t,e,n,r){return null!=e&&null!=n||(r=r||t.bbox(),null==e?e=r.width/r.height*n:null==n&&(n=r.height/r.width*e)),{width:e,height:n}}function gt(t,e){const n=t.origin;let r=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([r,i]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const s="string"==typeof r,o="string"==typeof i;if(s||o){const{height:t,width:n,x:u,y:a}=e.bbox();s&&(r=r.includes("left")?u:r.includes("right")?u+n:u+n/2),o&&(i=i.includes("top")?a:i.includes("bottom")?a+t:a+t/2)}return[r,i]}const yt=new Set(["desc","metadata","title"]),_t=t=>yt.has(t.nodeName),vt=(t,e,n={})=>{const r={...e};for(const i in r)r[i].valueOf()===n[i]&&delete r[i];Object.keys(r).length?t.node.setAttribute("data-svgjs",JSON.stringify(r)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))},wt="http://www.w3.org/2000/svg",bt="http://www.w3.org/2000/xmlns/",xt="http://www.w3.org/1999/xlink",Et={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};let Ot=class{};const Mt={},kt="___SYMBOL___ROOT___";function Ct(t,e=wt){return Et.document.createElementNS(e,t)}function At(t,e=!1){if(t instanceof Ot)return t;if("object"==typeof t)return jt(t);if(null==t)return new Mt[kt];if("string"==typeof t&&"<"!==t.charAt(0))return jt(Et.document.querySelector(t));const n=e?Et.document.createElement("div"):Ct("svg");return n.innerHTML=t,t=jt(n.firstChild),n.removeChild(n.firstChild),t}function St(t,e){return e&&(e instanceof Et.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:Ct(t)}function Nt(t){if(!t)return null;if(t.instance instanceof Ot)return t.instance;if("#document-fragment"===t.nodeName)return new Mt.Fragment(t);let e=pt(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":Mt[e]||(e="Dom"),new Mt[e](t)}let jt=Nt;function Tt(t,e=t.name,n=!1){return Mt[e]=t,n&&(Mt[kt]=t),ct(Object.getOwnPropertyNames(t.prototype)),t}let It=1e3;function Rt(t){return"Svgjs"+pt(t)+It++}function Lt(t){for(let e=t.children.length-1;e>=0;e--)Lt(t.children[e]);return t.id?(t.id=Rt(t.nodeName),t):t}function zt(t,e){let n,r;for(r=(t=Array.isArray(t)?t:[t]).length-1;r>=0;r--)for(n in e)t[r].prototype[n]=e[n]}function Pt(t){return function(...e){const n=e[e.length-1];return!n||n.constructor!==Object||n instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(n)}}ht("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=At(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=At(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=At(t)).before(this),this},insertAfter:function(t){return(t=At(t)).after(this),this}});const Dt=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,Ft=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,$t=/rgb\((\d+),(\d+),(\d+)\)/,Yt=/(#[a-z_][a-z0-9\-_]*)/i,Gt=/\)\s*,?\s*/,Xt=/\s/g,Bt=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,qt=/^rgb\(/,Vt=/^(\s+)?$/,Wt=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ht=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,Ut=/[\s,]+/,Zt=/[MLHVCSQTAZ]/i;function Qt(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function Jt(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function Kt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}ht("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(Ut)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),ht("Dom",{css:function(t,e){const n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);n[e[0]]=e[1]})),n;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=e;n[e]=this.node.style.getPropertyValue(t)}return n}if("string"==typeof t)return this.node.style.getPropertyValue(t);if("object"==typeof t)for(const e in t)this.node.style.setProperty(e,null==t[e]||Vt.test(t[e])?"":t[e])}return 2===arguments.length&&this.node.style.setProperty(t,null==e||Vt.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),ht("Dom",{data:function(t,e,n){if(null==t)return this.data(ft(function(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)e(t[n])&&i.push(t[n]);return i}(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const n of t)e[n]=this.data(n);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(r){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===n||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),ht("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const n in t)this.remember(n,t[n]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});let te=class t{constructor(...t){this.init(...t)}static isColor(e){return e&&(e instanceof t||this.isRgb(e)||this.test(e))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(e="vibrant",n){const{random:r,round:i,sin:s,PI:o}=Math;if("vibrant"===e){const e=24*r()+57,n=38*r()+45,i=360*r();return new t(e,n,i,"lch")}if("sine"===e){const e=i(80*s(2*o*(n=null==n?r():n)/.5+.01)+150),u=i(50*s(2*o*n/.5+4.6)+200),a=i(100*s(2*o*n/.5+2.3)+150);return new t(e,u,a)}if("pastel"===e){const e=8*r()+86,n=17*r()+9,i=360*r();return new t(e,n,i,"lch")}if("dark"===e){const e=10+10*r(),n=50*r()+86,i=360*r();return new t(e,n,i,"lch")}if("rgb"===e){const e=255*r(),n=255*r(),i=255*r();return new t(e,n,i)}if("lab"===e){const e=100*r(),n=256*r()-128,i=256*r()-128;return new t(e,n,i,"lab")}if("grey"===e){const e=255*r();return new t(e,e,e)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(Bt.test(t)||qt.test(t))}cmyk(){const{_a:e,_b:n,_c:r}=this.rgb(),[i,s,o]=[e,n,r].map((t=>t/255)),u=Math.min(1-i,1-s,1-o);if(1===u)return new t(0,0,0,1,"cmyk");return new t((1-i-u)/(1-u),(1-s-u)/(1-u),(1-o-u)/(1-u),u,"cmyk")}hsl(){const{_a:e,_b:n,_c:r}=this.rgb(),[i,s,o]=[e,n,r].map((t=>t/255)),u=Math.max(i,s,o),a=Math.min(i,s,o),h=(u+a)/2,l=u===a,c=u-a;return new t(360*(l?0:u===i?((s-o)/c+(s<o?6:0))/6:u===s?((o-i)/c+2)/6:u===o?((i-s)/c+4)/6:0),100*(l?0:h>.5?c/(2-u-a):c/(u+a)),100*h,"hsl")}init(t=0,e=0,n=0,r=0,i="rgb"){if(t=t||0,this.space)for(const c in this.space)delete this[this.space[c]];if("number"==typeof t)i="string"==typeof r?r:i,r="string"==typeof r?0:r,Object.assign(this,{_a:t,_b:e,_c:n,_d:r,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const n=function(t,e){const n=Jt(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:Jt(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:Jt(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:Jt(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:Jt(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:Jt(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return n.space=e||n.space,n}(t,e);Object.assign(this,n)}else if("string"==typeof t)if(qt.test(t)){const e=t.replace(Xt,""),[n,r,i]=$t.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}else{if(!Bt.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,r,i]=Ft.exec((s=t,4===s.length?["#",s.substring(1,2),s.substring(1,2),s.substring(2,3),s.substring(2,3),s.substring(3,4),s.substring(3,4)].join(""):s)).map(e);Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}}var s;const{_a:o,_b:u,_c:a,_d:h}=this,l="rgb"===this.space?{r:o,g:u,b:a}:"xyz"===this.space?{x:o,y:u,z:a}:"hsl"===this.space?{h:o,s:u,l:a}:"lab"===this.space?{l:o,a:u,b:a}:"lch"===this.space?{l:o,c:u,h:a}:"cmyk"===this.space?{c:o,m:u,y:a,k:h}:{};Object.assign(this,l)}lab(){const{x:e,y:n,z:r}=this.xyz();return new t(116*n-16,500*(e-n),200*(n-r),"lab")}lch(){const{l:e,a:n,b:r}=this.lab(),i=Math.sqrt(n**2+r**2);let s=180*Math.atan2(r,n)/Math.PI;s<0&&(s*=-1,s=360-s);return new t(e,i,s,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(e=this.space)||"xyz"===e||"lch"===e){let{x:e,y:n,z:r}=this;if("lab"===this.space||"lch"===this.space){let{l:t,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;i=t*Math.cos(n*e),s=t*Math.sin(n*e)}const o=(t+16)/116,u=i/500+o,a=o-s/200,h=16/116,l=.008856,c=7.787;e=.95047*(u**3>l?u**3:(u-h)/c),n=1*(o**3>l?o**3:(o-h)/c),r=1.08883*(a**3>l?a**3:(a-h)/c)}const i=3.2406*e+-1.5372*n+-.4986*r,s=-.9689*e+1.8758*n+.0415*r,o=.0557*e+-.204*n+1.057*r,u=Math.pow,a=.0031308,h=i>a?1.055*u(i,1/2.4)-.055:12.92*i,l=s>a?1.055*u(s,1/2.4)-.055:12.92*s,c=o>a?1.055*u(o,1/2.4)-.055:12.92*o;return new t(255*h,255*l,255*c)}if("hsl"===this.space){let{h:e,s:n,l:r}=this;if(e/=360,n/=100,r/=100,0===n){r*=255;return new t(r,r,r)}const i=r<.5?r*(1+n):r+n-r*n,s=2*r-i,o=255*Kt(s,i,e+1/3),u=255*Kt(s,i,e),a=255*Kt(s,i,e-1/3);return new t(o,u,a)}if("cmyk"===this.space){const{c:e,m:n,y:r,k:i}=this,s=255*(1-Math.min(1,e*(1-i)+i)),o=255*(1-Math.min(1,n*(1-i)+i)),u=255*(1-Math.min(1,r*(1-i)+i));return new t(s,o,u)}return this;var e}toArray(){const{_a:t,_b:e,_c:n,_d:r,space:i}=this;return[t,e,n,r,i]}toHex(){const[t,e,n]=this._clamped().map(Qt);return`#${t}${e}${n}`}toRgb(){const[t,e,n]=this._clamped();return`rgb(${t},${e},${n})`}toString(){return this.toHex()}xyz(){const{_a:e,_b:n,_c:r}=this.rgb(),[i,s,o]=[e,n,r].map((t=>t/255)),u=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,a=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,h=o>.04045?Math.pow((o+.055)/1.055,2.4):o/12.92,l=(.4124*u+.3576*a+.1805*h)/.95047,c=(.2126*u+.7152*a+.0722*h)/1,f=(.0193*u+.1192*a+.9505*h)/1.08883,d=l>.008856?Math.pow(l,1/3):7.787*l+16/116,p=c>.008856?Math.pow(c,1/3):7.787*c+16/116,m=f>.008856?Math.pow(f,1/3):7.787*f+16/116;return new t(d,p,m,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:r,min:i,round:s}=Math;return[t,e,n].map((t=>r(0,i(s(t),255))))}},ee=class t{constructor(...t){this.init(...t)}clone(){return new t(this)}init(t,e){const n=0,r=0,i=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==i.x?n:i.x,this.y=null==i.y?r:i.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){re.isMatrixLike(t)||(t=new re(t));const{x:e,y:n}=this;return this.x=t.a*e+t.c*n+t.e,this.y=t.b*e+t.d*n+t.f,this}};function ne(t,e,n){return Math.abs(e-t)<1e-6}let re=class t{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,n=t.flip&&(e||"x"===t.flip)?-1:1,r=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleX)?t.scaleX*n:n,u=t.scale&&t.scale.length?t.scale[1]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleY)?t.scaleY*r:r,a=t.shear||0,h=t.rotate||t.theta||0,l=new ee(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=l.x,f=l.y,d=new ee(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=d.x,m=d.y,g=new ee(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,_=g.y,v=new ee(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:u,skewX:i,skewY:s,shear:a,theta:h,rx:v.x,ry:v.y,tx:y,ty:_,ox:c,oy:f,px:p,py:m}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,n){const r=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,u=t.e+t.a*e.e+t.c*e.f,a=t.f+t.b*e.e+t.d*e.f;return n.a=r,n.b=i,n.c=s,n.d=o,n.e=u,n.f=a,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const r=t||0,i=e||0;return this.translateO(-r,-i).lmultiplyO(n).translateO(r,i)}clone(){return new t(this)}decompose(t=0,e=0){const n=this.a,r=this.b,i=this.c,s=this.d,o=this.e,u=this.f,a=n*s-r*i,h=a>0?1:-1,l=h*Math.sqrt(n*n+r*r),c=Math.atan2(h*r,h*n),f=180/Math.PI*c,d=Math.cos(c),p=Math.sin(c),m=(n*i+r*s)/a,g=i*l/(m*n-r)||s*l/(m*r+n);return{scaleX:l,scaleY:g,shear:m,rotate:f,translateX:o-t+t*d*l+e*(m*d*l-p*g),translateY:u-e+t*p*l+e*(m*p*l+d*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(e){if(e===this)return!0;const n=new t(e);return ne(this.a,n.a)&&ne(this.b,n.b)&&ne(this.c,n.c)&&ne(this.d,n.d)&&ne(this.e,n.e)&&ne(this.f,n.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(e){const n=t.fromArray([1,0,0,1,0,0]);return e=e instanceof Ae?e.matrixify():"string"==typeof e?t.fromArray(e.split(Ut).map(parseFloat)):Array.isArray(e)?t.fromArray(e):"object"==typeof e&&t.isMatrixLike(e)?e:"object"==typeof e?(new t).transform(e):6===arguments.length?t.fromArray([].slice.call(arguments)):n,this.a=null!=e.a?e.a:n.a,this.b=null!=e.b?e.b:n.b,this.c=null!=e.c?e.c:n.c,this.d=null!=e.d?e.d:n.d,this.e=null!=e.e?e.e:n.e,this.f=null!=e.f?e.f:n.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,n=this.c,r=this.d,i=this.e,s=this.f,o=t*r-e*n;if(!o)throw new Error("Cannot invert "+this);const u=r/o,a=-e/o,h=-n/o,l=t/o,c=-(u*i+h*s),f=-(a*i+l*s);return this.a=u,this.b=a,this.c=h,this.d=l,this.e=c,this.f=f,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(e){const n=e instanceof t?e:new t(e);return t.matrixMultiply(n,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(e){const n=e instanceof t?e:new t(e);return t.matrixMultiply(this,n,this)}rotate(t,e,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=dt(t);const r=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:u,d:a,e:h,f:l}=this;return this.a=s*r-o*i,this.b=o*r+s*i,this.c=u*r-a*i,this.d=a*r+u*i,this.e=h*r-l*i+n*i-e*r+e,this.f=l*r+h*i-e*i-n*r+n,this}scale(){return this.clone().scaleO(...arguments)}scaleO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t);const{a:i,b:s,c:o,d:u,e:a,f:h}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=u*e,this.e=a*t-n*t+n,this.f=h*e-r*e+r,this}shear(t,e,n){return this.clone().shearO(t,e,n)}shearO(t,e=0,n=0){const{a:r,b:i,c:s,d:o,e:u,f:a}=this;return this.a=r+i*t,this.c=s+o*t,this.e=u+a*t-n*t,this}skew(){return this.clone().skewO(...arguments)}skewO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t),t=dt(t),e=dt(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:u,c:a,d:h,e:l,f:c}=this;return this.a=o+u*i,this.b=u+o*s,this.c=a+h*i,this.d=h+a*s,this.e=l+c*i-r*i,this.f=c+l*s-n*s,this}skewX(t,e,n){return this.skew(t,0,e,n)}skewY(t,e,n){return this.skew(0,t,e,n)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(e){if(t.isMatrixLike(e)){return new t(e).multiplyO(this)}const n=t.formatTransforms(e),{x:r,y:i}=new ee(n.ox,n.oy).transform(this),s=(new t).translateO(n.rx,n.ry).lmultiplyO(this).translateO(-r,-i).scaleO(n.scaleX,n.scaleY).skewO(n.skewX,n.skewY).shearO(n.shear).rotateO(n.theta).translateO(r,i);if(isFinite(n.px)||isFinite(n.py)){const t=new ee(r,i).transform(s),e=isFinite(n.px)?n.px-t.x:0,o=isFinite(n.py)?n.py-t.y:0;s.translateO(e,o)}return s.translateO(n.tx,n.ty),s}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}};function ie(){if(!ie.nodes){const t=At().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;ie.nodes={svg:t,path:e}}if(!ie.nodes.svg.node.parentNode){const t=Et.document.body||Et.document.documentElement;ie.nodes.svg.addTo(t)}return ie.nodes}function se(t){return!(t.width||t.height||t.x||t.y)}Tt(re,"Matrix");let oe=class t{constructor(...t){this.init(...t)}addOffset(){return this.x+=Et.window.pageXOffset,this.y+=Et.window.pageYOffset,new t(this)}init(t){return t="string"==typeof t?t.split(Ut).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return se(this)}merge(e){const n=Math.min(this.x,e.x),r=Math.min(this.y,e.y),i=Math.max(this.x+this.width,e.x+e.width)-n,s=Math.max(this.y+this.height,e.y+e.height)-r;return new t(n,r,i,s)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(e){e instanceof re||(e=new re(e));let n=1/0,r=-1/0,i=1/0,s=-1/0;return[new ee(this.x,this.y),new ee(this.x2,this.y),new ee(this.x,this.y2),new ee(this.x2,this.y2)].forEach((function(t){t=t.transform(e),n=Math.min(n,t.x),r=Math.max(r,t.x),i=Math.min(i,t.y),s=Math.max(s,t.y)})),new t(n,i,r-n,s-i)}};function ue(t,e,n){let r;try{if(r=e(t.node),se(r)&&((i=t.node)!==Et.document&&!(Et.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===Et.document}).call(Et.document.documentElement,i)))throw new Error("Element not in the dom")}catch(s){r=n(t)}var i;return r}ht({viewbox:{viewbox(t,e,n,r){return null==t?new oe(this.attr("viewBox")):this.attr("viewBox",new oe(t,e,n,r))},zoom(t,e){let{width:n,height:r}=this.attr(["width","height"]);if((n||r)&&"string"!=typeof n&&"string"!=typeof r||(n=this.node.clientWidth,r=this.node.clientHeight),!n||!r)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=n/i.width,o=r/i.height,u=Math.min(s,o);if(null==t)return u;let a=u/t;a===1/0&&(a=Number.MAX_SAFE_INTEGER/100),e=e||new ee(n/2/s+i.x,r/2/o+i.y);const h=new oe(i).transform(new re({scale:a,origin:e}));return this.viewbox(h)}}}),Tt(oe,"Box");let ae=class extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}};zt([ae],{each(t,...e){return"function"==typeof t?this.map(((e,n,r)=>t.call(e,e,n,r))):this.map((n=>n[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const he=["toArray","constructor","each"];function le(t,e){return new ae(ft((e||Et.document).querySelectorAll(t),(function(t){return Nt(t)})))}ae.extend=function(t){t=t.reduce(((t,e)=>(he.includes(e)||"_"===e[0]||(e in Array.prototype&&(t["$"+e]=Array.prototype[e]),t[e]=function(...t){return this.each(e,...t)}),t)),{}),zt([ae],t)};let ce=0;const fe={};function de(t){let e=t.getEventHolder();return e===Et.window&&(e=fe),e.events||(e.events={}),e.events}function pe(t){return t.getEventTarget()}function me(t,e,n,r,i){const s=n.bind(r||t),o=At(t),u=de(o),a=pe(o);e=Array.isArray(e)?e:e.split(Ut),n._svgjsListenerId||(n._svgjsListenerId=++ce),e.forEach((function(t){const e=t.split(".")[0],r=t.split(".")[1]||"*";u[e]=u[e]||{},u[e][r]=u[e][r]||{},u[e][r][n._svgjsListenerId]=s,a.addEventListener(e,s,i||!1)}))}function ge(t,e,n,r){const i=At(t),s=de(i),o=pe(i);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(Ut)).forEach((function(t){const e=t&&t.split(".")[0],u=t&&t.split(".")[1];let a,h;if(n)s[e]&&s[e][u||"*"]&&(o.removeEventListener(e,s[e][u||"*"][n],r||!1),delete s[e][u||"*"][n]);else if(e&&u){if(s[e]&&s[e][u]){for(h in s[e][u])ge(o,[e,u].join("."),h);delete s[e][u]}}else if(u)for(t in s)for(a in s[t])u===a&&ge(o,[t,u].join("."));else if(e){if(s[e]){for(a in s[e])ge(o,[e,a].join("."));delete s[e]}}else{for(t in s)ge(o,t);!function(t){let e=t.getEventHolder();e===Et.window&&(e=fe),e.events&&(e.events={})}(i)}}))}let ye=class extends Ot{addEventListener(){}dispatch(t,e,n){return function(t,e,n,r){const i=pe(t);return e instanceof Et.window.Event||(e=new Et.window.CustomEvent(e,{detail:n,cancelable:!0,...r})),i.dispatchEvent(e),e}(this,t,e,n)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const n=e[t.type];for(const r in n)for(const e in n[r])n[r][e](t);return!t.defaultPrevented}fire(t,e,n){return this.dispatch(t,e,n),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,n){return ge(this,t,e,n),this}on(t,e,n,r){return me(this,t,e,n,r),this}removeEventListener(){}};function _e(){}Tt(ye,"EventTarget");const ve=400,we=">",be=0,xe={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};let Ee=class extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(Ut).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}},Oe=class t{constructor(...t){this.init(...t)}convert(e){return new t(this.value,e)}divide(e){return e=new t(e),new t(this/e,this.unit||e.unit)}init(e,n){return n=Array.isArray(e)?e[1]:n,e=Array.isArray(e)?e[0]:e,this.value=0,this.unit=n||"","number"==typeof e?this.value=isNaN(e)?0:isFinite(e)?e:e<0?-34e37:34e37:"string"==typeof e?(n=e.match(Dt))&&(this.value=parseFloat(n[1]),"%"===n[5]?this.value/=100:"s"===n[5]&&(this.value*=1e3),this.unit=n[5]):e instanceof t&&(this.value=e.valueOf(),this.unit=e.unit),this}minus(e){return e=new t(e),new t(this-e,this.unit||e.unit)}plus(e){return e=new t(e),new t(this+e,this.unit||e.unit)}times(e){return e=new t(e),new t(this*e,this.unit||e.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}};const Me=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),ke=[];let Ce=class t extends ye{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=At(t)).removeNamespace&&this.node instanceof Et.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return At(t).put(this,e)}children(){return new ae(ft(this.node.children,(function(t){return Nt(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let n=this.node.cloneNode(t);return e&&(n=Lt(n)),new this.constructor(n)}each(t,e){const n=this.children();let r,i;for(r=0,i=n.length;r<i;r++)t.apply(n[r],[r,n]),e&&n[r].each(t,e);return this}element(e,n){return this.put(new t(Ct(e),n))}first(){return Nt(this.node.firstChild)}get(t){return Nt(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}html(t,e){return this.xml(t,e,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=Rt(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return Nt(this.node.lastChild)}matches(t){const e=this.node,n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=Nt(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=Nt(e.node.parentNode));return e}put(t,e){return t=At(t),this.add(t,e),t}putIn(t,e){return At(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=At(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const n=10**t,r=this.attr(e);for(const i in r)"number"==typeof r[i]&&(r[i]=Math.round(r[i]*n)/n);return this.attr(r),this}svg(t,e){return this.xml(t,e,wt)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const n=e.index(this);return e.put(t,n).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let n=this;if(null!=t){if(n=Nt(n.node.cloneNode(!0)),e){const e=t(n);if(n=e||n,!1===e)return""}n.each((function(){const e=t(this),n=e||this;!1===e?this.remove():e&&this!==n&&this.replace(n)}),!0)}return e?n.node.outerHTML:n.node.innerHTML}e=null!=e&&e;const r=Ct("wrapper",n),i=Et.document.createDocumentFragment();r.innerHTML=t;for(let o=r.children.length;o--;)i.appendChild(r.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}};zt(Ce,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=Wt.test(n.nodeValue)?parseFloat(n.nodeValue):n.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?xe[t]:Wt.test(e)?parseFloat(e):e;"number"==typeof(e=ke.reduce(((e,n)=>n(t,e,this)),e))?e=new Oe(e):Me.has(t)&&te.isColor(e)?e=new te(e):e.constructor===Array&&(e=new Ee(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof n?this.node.setAttributeNS(n,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return le(t,this.node)},findOne:function(t){return Nt(this.node.querySelector(t))}}),Tt(Ce,"Dom");let Ae=class extends Ce{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,(t.hasAttribute("data-svgjs")||t.hasAttribute("svgjs:data"))&&this.setData(JSON.parse(t.getAttribute("data-svgjs"))??JSON.parse(t.getAttribute("svgjs:data"))??{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new Oe(t).plus(this.x()))}dy(t=0){return this.y(new Oe(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){const e="string"==typeof t;e||(t=At(t));const n=new ae;let r=this;for(;(r=r.parent())&&r.node!==Et.document&&"#document-fragment"!==r.nodeName&&(n.push(r),e||r.node!==t.node)&&(!e||!r.matches(t));)if(r.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(Yt);return e?At(e[1]):null}root(){const t=this.parent(Mt[kt]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=mt(this,t,e);return this.width(new Oe(n.width)).height(new Oe(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return vt(this,this.dom),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}};zt(Ae,{bbox:function(){const t=ue(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(ie().svg).show(),n=e.node.getBBox();return e.remove(),n}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new oe(t)},rbox:function(t){const e=ue(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new oe(e);return t?n.transform(t.screenCTM().inverseO()):n.addOffset()},inside:function(t,e){const n=this.bbox();return t>n.x&&e>n.y&&t<n.x+n.width&&e<n.y+n.height},point:function(t,e){return new ee(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new re(this.node.getCTM())},screenCTM:function(){try{if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new re(e)}return new re(this.node.getScreenCTM())}catch(t){return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new re}}}),Tt(Ae,"Element");const Se={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let n;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof te||te.isRgb(e)||e instanceof Ae)this.attr(t,e);else for(n=Se[t].length-1;n>=0;n--)null!=e[Se[t][n]]&&this.attr(Se.prefix(t,Se[t][n]),e[Se[t][n]]);return this},ht(["Element","Runner"],e)})),ht(["Element","Runner"],{matrix:function(t,e,n,r,i,s){return null==t?new re(this):this.attr("transform",new re(t,e,n,r,i,s))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:r},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:r},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),ht("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new Oe(t)):this.rx(t).ry(e)}}),ht("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new ee(this.node.getPointAtLength(t))}}),ht(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}});ht("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),ht("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(Gt).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(Ut).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(re.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new re)},toParent:function(t,e){if(this===t)return this;if(_t(this.node))return this.addTo(t,e);const n=this.screenCTM(),r=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(r.multiply(n)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new re(this).decompose();return null==t?e:e[t]}re.isMatrixLike(t)||(t={...t,origin:gt(t,this)});const n=new re(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});let Ne=class t extends Ae{flatten(){return this.each((function(){if(this instanceof t)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(n,r){return r[r.length-n-1].toParent(t,e)})),this.remove()}};Tt(Ne,"Container");let je=class extends Ne{constructor(t,e=t){super(St("defs",t),e)}flatten(){return this}ungroup(){return this}};Tt(je,"Defs");let Te=class extends Ae{};function Ie(t){return this.attr("rx",t)}function Re(t){return this.attr("ry",t)}function Le(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function ze(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Pe(t){return this.attr("cx",t)}function De(t){return this.attr("cy",t)}function Fe(t){return null==t?2*this.rx():this.rx(new Oe(t).divide(2))}function $e(t){return null==t?2*this.ry():this.ry(new Oe(t).divide(2))}Tt(Te,"Shape");const Ye=Object.freeze(Object.defineProperty({__proto__:null,cx:Pe,cy:De,height:$e,rx:Ie,ry:Re,width:Fe,x:Le,y:ze},Symbol.toStringTag,{value:"Module"}));let Ge=class extends Te{constructor(t,e=t){super(St("ellipse",t),e)}size(t,e){const n=mt(this,t,e);return this.rx(new Oe(n.width).divide(2)).ry(new Oe(n.height).divide(2))}};zt(Ge,Ye),ht("Container",{ellipse:Pt((function(t=0,e=t){return this.put(new Ge).size(t,e).move(0,0)}))}),Tt(Ge,"Ellipse");let Xe=class extends Ce{constructor(t=Et.document.createDocumentFragment()){super(t)}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){const t=new Ce(Ct("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}};function Be(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new Oe(t),fy:new Oe(e)}):this.attr({x1:new Oe(t),y1:new Oe(e)})}function qe(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new Oe(t),cy:new Oe(e)}):this.attr({x2:new Oe(t),y2:new Oe(e)})}Tt(Xe,"Fragment");const Ve=Object.freeze(Object.defineProperty({__proto__:null,from:Be,to:qe},Symbol.toStringTag,{value:"Module"}));let We=class extends Ne{constructor(t,e){super(St(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,n){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,n)}bbox(){return new oe}targets(){return le("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}};zt(We,Ve),ht({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:Pt((function(t,e){return this.put(new We(t)).update(e)}))}}),Tt(We,"Gradient");let He=class extends Ne{constructor(t,e=t){super(St("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new oe}targets(){return le("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}};ht({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:Pt((function(t,e,n){return this.put(new He).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),Tt(He,"Pattern");let Ue=class extends Te{constructor(t,e=t){super(St("image",t),e)}load(t,e){if(!t)return this;const n=new Et.window.Image;return me(n,"load",(function(t){const r=this.parent(He);0===this.width()&&0===this.height()&&this.size(n.width,n.height),r instanceof He&&0===r.width()&&0===r.height()&&r.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),me(n,"load error",(function(){ge(n)})),this.attr("href",n.src=t,xt)}};var Ze;Ze=function(t,e,n){return"fill"!==t&&"stroke"!==t||Ht.test(e)&&(e=n.root().defs().image(e)),e instanceof Ue&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},ke.push(Ze),ht({Container:{image:Pt((function(t,e){return this.put(new Ue).size(0,0).load(t,e)}))}}),Tt(Ue,"Image");let Qe=class extends Ee{bbox(){let t=-1/0,e=-1/0,n=1/0,r=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),n=Math.min(i[0],n),r=Math.min(i[1],r)})),new oe(n,r,t-n,e-r)}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(Ut).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,r=t.length;n<r;n+=2)e.push([t[n],t[n+1]]);return e}size(t,e){let n;const r=this.bbox();for(n=this.length-1;n>=0;n--)r.width&&(this[n][0]=(this[n][0]-r.x)*t/r.width+r.x),r.height&&(this[n][1]=(this[n][1]-r.y)*e/r.height+r.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,n=this.length;e<n;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){re.isMatrixLike(t)||(t=new re(t));for(let e=this.length;e--;){const[n,r]=this[e];this[e][0]=t.a*n+t.c*r+t.e,this[e][1]=t.b*n+t.d*r+t.f}return this}};const Je=Qe;const Ke=Object.freeze(Object.defineProperty({__proto__:null,MorphArray:Je,height:function(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)},width:function(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)},x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}},Symbol.toStringTag,{value:"Module"}));let tn=class extends Te{constructor(t,e=t){super(St("line",t),e)}array(){return new Qe([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,n,r){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:r}:new Qe(t).toLine(),this.attr(t))}size(t,e){const n=mt(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}};zt(tn,Ke),ht({Container:{line:Pt((function(...t){return tn.prototype.plot.apply(this.put(new tn),null!=t[0]?t:[0,0,0,0])}))}}),Tt(tn,"Line");let en=class extends Ne{constructor(t,e=t){super(St("marker",t),e)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}};function nn(t,e){return function(n){return null==n?this[t]:(this[t]=n,e&&e.call(this),this)}}ht({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:Pt((function(t,e,n){return this.put(new en).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}))},marker:{marker(t,e,n,r){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof en?arguments[1]:this.defs().marker(e,n,r),this.attr(i,t)}}}),Tt(en,"Marker");const rn={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,n,r){return function(i){return i<0?t>0?e/t*i:n>0?r/n*i:0:i>1?n<1?(1-r)/(1-n)*i+(r-n)/(1-n):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*r+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(r,i=!1)=>{let s=Math.floor(r*t);const o=r*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,r>=0&&s<0&&(s=0),r<=1&&s>n&&(s=n),s/n}}};let sn=class{done(){return!1}},on=class extends sn{constructor(t=we){super(),this.ease=rn[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}},un=class extends sn{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,r){return this.stepper(t,e,n,r)}};function an(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,r=Math.log(e/100+1e-10),i=-r/Math.sqrt(n*n+r*r),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}zt(class extends un{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;n>100&&(n=16),n/=1e3;const i=r.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*n+s*n*n/2;return r.velocity=i+s*n,r.done=Math.abs(e-o)+Math.abs(i)<.002,r.done?e:o}},{duration:nn("_duration",an),overshoot:nn("_overshoot",an)});zt(class extends un{constructor(t=.1,e=.01,n=0,r=1e3){super(),this.p(t).i(e).d(n).windup(r)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;const i=e-t;let s=(r.integral||0)+i*n;const o=(i-(r.error||0))/n,u=this._windup;return!1!==u&&(s=Math.max(-u,Math.min(s,u))),r.error=i,r.integral=s,r.done=Math.abs(i)<.001,r.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:nn("_windup"),p:nn("P"),i:nn("I"),d:nn("D")});const hn={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},ln={M:function(t,e,n){return e.x=n.x=t[0],e.y=n.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,n){return e.x=n.x,e.y=n.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},cn="mlhvqtcsaz".split("");for(let wh=0,bh=cn.length;wh<bh;++wh)ln[cn[wh]]=function(t){return function(e,n,r){if("H"===t)e[0]=e[0]+n.x;else if("V"===t)e[0]=e[0]+n.y;else if("A"===t)e[5]=e[5]+n.x,e[6]=e[6]+n.y;else for(let t=0,i=e.length;t<i;++t)e[t]=e[t]+(t%2?n.y:n.x);return ln[t](e,n,r)}}(cn[wh].toUpperCase());function fn(t){return t.segment.length&&t.segment.length-1===hn[t.segment[0].toUpperCase()]}function dn(t,e){t.inNumber&&pn(t,!1);const n=Zt.test(e);if(n)t.segment=[e];else{const e=t.lastCommand,n=e.toLowerCase(),r=e===n;t.segment=["m"===n?r?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],n}function pn(t,e){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=e,t.number="",t.pointSeen=!1,t.hasExponent=!1,fn(t)&&mn(t)}function mn(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return ln[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function gn(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),n=t.segment.length;return e&&(4===n||5===n)}function yn(t){return"E"===t.lastToken.toUpperCase()}const _n=new Set([" ",",","\t","\n","\r","\f"]);let vn=class extends Ee{bbox(){return ie().path.setAttribute("d",this.toString()),new oe(ie.nodes.path.getBBox())}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let r,i=this.length-1;i>=0;i--)r=this[i][0],"M"===r||"L"===r||"T"===r?(this[i][1]+=t,this[i][2]+=e):"H"===r?this[i][1]+=t:"V"===r?this[i][1]+=e:"C"===r||"S"===r||"Q"===r?(this[i][1]+=t,this[i][2]+=e,this[i][3]+=t,this[i][4]+=e,"C"===r&&(this[i][5]+=t,this[i][6]+=e)):"A"===r&&(this[i][6]+=t,this[i][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let n=0,r="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new ee,p:new ee};for(;i.lastToken=r,r=t.charAt(n++);)if(i.inSegment||!dn(i,r))if("."!==r)if(isNaN(parseInt(r)))if(_n.has(r))i.inNumber&&pn(i,!1);else if("-"!==r&&"+"!==r)if("E"!==r.toUpperCase()){if(Zt.test(r)){if(i.inNumber)pn(i,!1);else{if(!fn(i))throw new Error("parser Error");mn(i)}--n}}else i.number+=r,i.hasExponent=!0;else{if(i.inNumber&&!yn(i)){pn(i,!1),--n;continue}i.number+=r,i.inNumber=!0}else{if("0"===i.number||gn(i)){i.inNumber=!0,i.number=r,pn(i,!0);continue}i.inNumber=!0,i.number+=r}else{if(i.pointSeen||i.hasExponent){pn(i,!1),--n;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=r}return i.inNumber&&pn(i,!1),i.inSegment&&fn(i)&&mn(i),i.segments}(t)}size(t,e){const n=this.bbox();let r,i;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,r=this.length-1;r>=0;r--)i=this[r][0],"M"===i||"L"===i||"T"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y):"H"===i?this[r][1]=(this[r][1]-n.x)*t/n.width+n.x:"V"===i?this[r][1]=(this[r][1]-n.y)*e/n.height+n.y:"C"===i||"S"===i||"Q"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y,this[r][3]=(this[r][3]-n.x)*t/n.width+n.x,this[r][4]=(this[r][4]-n.y)*e/n.height+n.y,"C"===i&&(this[r][5]=(this[r][5]-n.x)*t/n.width+n.x,this[r][6]=(this[r][6]-n.y)*e/n.height+n.y)):"A"===i&&(this[r][1]=this[r][1]*t/n.width,this[r][2]=this[r][2]*e/n.height,this[r][6]=(this[r][6]-n.x)*t/n.width+n.x,this[r][7]=(this[r][7]-n.y)*e/n.height+n.y);return this}toString(){return function(t){let e="";for(let n=0,r=t.length;n<r;n++)e+=t[n][0],null!=t[n][1]&&(e+=t[n][1],null!=t[n][2]&&(e+=" ",e+=t[n][2],null!=t[n][3]&&(e+=" ",e+=t[n][3],e+=" ",e+=t[n][4],null!=t[n][5]&&(e+=" ",e+=t[n][5],e+=" ",e+=t[n][6],null!=t[n][7]&&(e+=" ",e+=t[n][7])))));return e+" "}(this)}};const wn=t=>{const e=typeof t;return"number"===e?Oe:"string"===e?te.isColor(t)?te:Ut.test(t)?Zt.test(t)?vn:Ee:Dt.test(t)?Oe:xn:kn.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?Ee:"object"===e?Mn:xn};let bn=class{constructor(t){this._stepper=t||new on("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(wn(t));let e=new this._type(t);return this._type===te&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===Mn&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}},xn=class{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}},En=class t{constructor(...t){this.init(...t)}init(e){return Array.isArray(e)&&(e={scaleX:e[0],scaleY:e[1],shear:e[2],rotate:e[3],translateX:e[4],translateY:e[5],originX:e[6],originY:e[7]}),Object.assign(this,t.defaults,e),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}};En.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const On=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;let Mn=class{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,r=e.length;n<r;++n){if(e[n+1]===t[n+1]){if(e[n+1]===te&&t[n+7]!==e[n+7]){const e=t[n+7],r=new te(this.values.splice(n+3,5))[e]().toArray();this.values.splice(n+3,0,...r)}n+=e[n+2]+2;continue}if(!t[n+1])return this;const r=(new t[n+1]).toArray(),i=e[n+2]+3;e.splice(n,i,t[n],t[n+1],t[n+2],...r),n+=e[n+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const n in t){const r=wn(t[n]),i=new r(t[n]).toArray();e.push([n,r,i.length,...i])}return e.sort(On),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const n=e.shift(),r=e.shift(),i=e.shift(),s=e.splice(0,i);t[n]=new r(s)}return t}};const kn=[xn,En,Mn];let Cn=class extends Te{constructor(t,e=t){super(St("path",t),e)}array(){return this._array||(this._array=new vn(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new vn(t))}size(t,e){const n=mt(this,t,e);return this.attr("d",this.array().size(n.width,n.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}};Cn.prototype.MorphArray=vn,ht({Container:{path:Pt((function(t){return this.put(new Cn).plot(t||new vn)}))}}),Tt(Cn,"Path");const An=Object.freeze(Object.defineProperty({__proto__:null,array:function(){return this._array||(this._array=new Qe(this.attr("points")))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new Qe(t))},size:function(t,e){const n=mt(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}},Symbol.toStringTag,{value:"Module"}));let Sn=class extends Te{constructor(t,e=t){super(St("polygon",t),e)}};ht({Container:{polygon:Pt((function(t){return this.put(new Sn).plot(t||new Qe)}))}}),zt(Sn,Ke),zt(Sn,An),Tt(Sn,"Polygon");let Nn=class extends Te{constructor(t,e=t){super(St("polyline",t),e)}};ht({Container:{polyline:Pt((function(t){return this.put(new Nn).plot(t||new Qe)}))}}),zt(Nn,Ke),zt(Nn,An),Tt(Nn,"Polyline");let jn=class extends Te{constructor(t,e=t){super(St("rect",t),e)}};zt(jn,{rx:Ie,ry:Re}),ht({Container:{rect:Pt((function(t,e){return this.put(new jn).size(t,e)}))}}),Tt(jn,"Rect");let Tn=class{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}};const In={nextDraw:null,frames:new Tn,timeouts:new Tn,immediates:new Tn,timer:()=>Et.window.performance||Et.window.Date,transforms:[],frame(t){const e=In.frames.push({run:t});return null===In.nextDraw&&(In.nextDraw=Et.window.requestAnimationFrame(In._draw)),e},timeout(t,e){e=e||0;const n=In.timer().now()+e,r=In.timeouts.push({run:t,time:n});return null===In.nextDraw&&(In.nextDraw=Et.window.requestAnimationFrame(In._draw)),r},immediate(t){const e=In.immediates.push(t);return null===In.nextDraw&&(In.nextDraw=Et.window.requestAnimationFrame(In._draw)),e},cancelFrame(t){null!=t&&In.frames.remove(t)},clearTimeout(t){null!=t&&In.timeouts.remove(t)},cancelImmediate(t){null!=t&&In.immediates.remove(t)},_draw(t){let e=null;const n=In.timeouts.last();for(;(e=In.timeouts.shift())&&(t>=e.time?e.run():In.timeouts.push(e),e!==n););let r=null;const i=In.frames.last();for(;r!==i&&(r=In.frames.shift());)r.run(t);let s=null;for(;s=In.immediates.shift();)s();In.nextDraw=In.timeouts.first()||In.frames.first()?Et.window.requestAnimationFrame(In._draw):null}},Rn=function(t){const e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},Ln=function(){const t=Et.window;return(t.performance||t.Date).now()};let zn=class extends ye{constructor(t=Ln){super(),this._timeSource=t,this.terminate()}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const n=Math.abs(e);return this.speed(t?-n:n)}schedule(t,e,n){if(null==t)return this._runners.map(Rn);let r=0;const i=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)r=i;else if("absolute"===n||"start"===n)r=e,e=0;else if("now"===n)r=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(r=n.start+e,e=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();r=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:r+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return In.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=In.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let n=e-this._lastSourceTime;t&&(n=0);const r=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=r,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let s=this._runners.length;s--;){const t=this._runners[s],e=t.runner;this._time-t.start<=0&&e.reset()}let i=!1;for(let s=0,o=this._runners.length;s<o;s++){const t=this._runners[s],e=t.runner;let n=r;const u=this._time-t.start;if(u<=0){i=!0;continue}if(u<n&&(n=u),!e.active())continue;if(e.step(n).done){if(!0!==t.persist){e.duration()-e.time()+this._time+t.persist<this._time&&(e.unschedule(),--s,--o)}}else i=!0}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}terminate(){this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}};ht({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new zn,this._timeline):(this._timeline=t,this)}}});let Pn=class t extends ye{constructor(e){super(),this.id=t.id++,e="function"==typeof(e=null==e?ve:e)?new un(e):e,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof e&&e,this._isDeclarative=e instanceof un,this._stepper=this._isDeclarative?e:new on,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new re,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,n){let r=1,i=!1,s=0;return e=e??be,n=n||"last","object"!=typeof(t=t??ve)||t instanceof sn||(e=t.delay??e,n=t.when??n,i=t.swing||i,r=t.times??r,s=t.wait??s,t=t.duration??ve),{duration:t,delay:e,swing:i,times:r,wait:s,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(e,n,r){const i=t.sanitise(e,n,r),s=new t(i.duration);return this._timeline&&s.timeline(this._timeline),this._element&&s.element(this._element),s.loop(i).schedule(i.delay,i.when)}clearTransform(){return this.transforms=new re,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new on(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,n){return"object"==typeof t&&(e=t.swing,n=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=n||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),n=(this._time-t*e)/this._duration;return Math.min(t+n,this._times)}const n=t%1,r=e*Math.floor(t)+this._duration*n;return this.time(r)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,n=this._duration,r=this._wait,i=this._times,s=this._swing,o=this._reverse;let u;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(r+n))/(r+n)),i=e&&!o||!e&&o,u=Math.pow(-1,i)*(t%(r+n))/n+i;return Math.max(Math.min(u,1),0)},a=i*(r+n)-r;return u=e<=0?Math.round(t(1e-5)):e<a?t(e):Math.round(t(a-1e-5)),u}const a=Math.floor(this.loops()),h=s&&a%2==0;return u=a+(h&&!o||o&&h?t:1-t),this.loops(u)}progress(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}queue(t,e,n,r){this._queue.push({initialiser:t||_e,runner:e||_e,retarget:n,isTransform:r,initialised:!1,finished:!1});return this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,n){if(t instanceof zn||(n=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,n),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),n=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const r=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<r&&this._time>=r;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=r,this._reseted=!1;let u=!1;return(n||o)&&(this._initialise(n),this.transforms=new re,u=this._run(o?t:e),this.fire("step",this)),this.done=this.done||u&&o,s&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,n=this._queue.length;e<n;++e){const n=this._queue[e],r=this._isDeclarative||!n.initialised&&t;t=!n.finished,r&&t&&(n.initialiser.call(this),n.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let n=0,r=this._queue.length;n<r;++n){const r=this._queue[n],i=r.runner.call(this,t);r.finished=r.finished||!0===i,e=e&&r.finished}return e}_tryRetarget(t,e,n){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,n):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const r=this.timeline();return r&&r.play(),!0}return!1}};Pn.id=0;let Dn=class{constructor(t=new re,e=-1,n=!0){this.transforms=t,this.id=e,this.done=n}clearTransformsFromQueue(){}};zt([Pn,Dn],{mergeWith(t){return new Dn(t.transforms.lmultiply(this.transforms),t.id)}});const Fn=(t,e)=>t.lmultiplyO(e),$n=t=>t.transforms;function Yn(){const t=this._transformationRunners.runners.map($n).reduce(Fn,new re);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}let Gn=class{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Dn).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const n=this.ids.indexOf(t+1);return this.ids.splice(n,1,t+1),this.runners.splice(n,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;e<this.runners.length;++e){const n=this.runners[e];if(t&&n.done&&t.done&&(!n._timeline||!n._timeline._runnerIds.includes(n.id))&&(!t._timeline||!t._timeline._runnerIds.includes(t.id))){this.remove(n.id);const r=n.mergeWith(t);this.edit(t.id,r),t=r,--e}else t=n}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}};ht({Element:{animate(t,e,n){const r=Pn.sanitise(t,e,n),i=this.timeline();return new Pn(r.duration).loop(r).element(this).timeline(i.play()).schedule(r.delay,r.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map($n).reduce(Fn,new re)},_addRunner(t){this._transformationRunners.add(t),In.cancelImmediate(this._frameId),this._frameId=In.immediate(Yn.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Gn).add(new Dn(new re(this))))}}});zt(Pn,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,n){if("string"==typeof e)return this.styleAttr(t,{[e]:n});let r=e;if(this._tryRetarget(t,r))return this;let i=new bn(this._stepper).to(r),s=Object.keys(r);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const n=Object.keys(e),o=(u=s,n.filter((t=>!u.includes(t))));var u;if(o.length){const e=this.element()[t](o),n=new Mn(i.from()).valueOf();Object.assign(n,e),i.from(n)}const a=new Mn(i.to()).valueOf();Object.assign(a,e),i.to(a),s=n,r=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new bn(this._stepper).to(new Oe(t));return this.queue((function(){n=n.from(this.element().zoom())}),(function(t){return this.element().zoom(n.at(t),e),n.done()}),(function(t,r){e=r,n.to(t)})),this._rememberMorpher("zoom",n),this},transform(t,e,n){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const r=re.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!r;const i=new bn(this._stepper).type(n?En:re);let s,o,u,a,h;return this.queue((function(){o=o||this.element(),s=s||gt(t,o),h=new re(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(l){e||this.clearTransform();const{x:c,y:f}=new ee(s).transform(o._currentTransform(this));let d=new re({...t,origin:[c,f]}),p=this._isDeclarative&&u?u:h;if(n){d=d.decompose(c,f),p=p.decompose(c,f);const t=d.rotate,e=p.rotate,n=[t-360,t,t+360],r=n.map((t=>Math.abs(t-e))),i=Math.min(...r),s=r.indexOf(i);d.rotate=n[s]}e&&(r||(d.rotate=t.rotate||0),this._isDeclarative&&a&&(p.rotate=a)),i.from(p),i.to(d);const m=i.at(l);return a=m.rotate,u=new re(m),this.addTransform(u),o._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=gt(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},ax(t){return this._queueNumber("ax",t)},ay(t){return this._queueNumber("ay",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new Oe(e),this._tryRetarget(t,e))return this;const n=new bn(this._stepper).to(e);let r=null;return this.queue((function(){r=this.element()[t](),n.from(r),n.to(r+e)}),(function(e){return this.element()[t](n.at(e)),n.done()}),(function(t){n.to(r+new Oe(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new bn(this._stepper).to(e);return this.queue((function(){n.from(this.element()[t]())}),(function(e){return this.element()[t](n.at(e)),n.done()})),this._rememberMorpher(t,n),this},_queueNumber(t,e){return this._queueObject(t,new Oe(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},amove(t,e){return this.ax(t).ay(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let n;return t&&e||(n=this._element.bbox()),t||(t=n.width/n.height*e),e||(e=n.height/n.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,n,r){if(4===arguments.length)return this.plot([t,e,n,r]);if(this._tryRetarget("plot",t))return this;const i=new bn(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,r){return this._queueObject("viewbox",new oe(t,e,n,r))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),zt(Pn,{rx:Ie,ry:Re,from:Be,to:qe}),Tt(Pn,"Runner");let Xn=class extends Ne{constructor(t,e=t){super(St("svg",t),e),this.namespace()}defs(){return this.isRoot()?Nt(this.node.querySelector("defs"))||this.put(new je):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof Et.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:wt,version:"1.1"}).attr("xmlns:xlink",xt,bt):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,bt).attr("xmlns:svgjs",null,bt)}root(){return this.isRoot()?this:super.root()}};ht({Container:{nested:Pt((function(){return this.put(new Xn)}))}}),Tt(Xn,"Svg",!0);let Bn=class extends Ne{constructor(t,e=t){super(St("symbol",t),e)}};ht({Container:{symbol:Pt((function(){return this.put(new Bn)}))}}),Tt(Bn,"Symbol");const qn=Object.freeze(Object.defineProperty({__proto__:null,amove:function(t,e){return this.ax(t).ay(e)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},build:function(t){return this._build=!!t,this},center:function(t,e,n=this.bbox()){return this.cx(t,n).cy(e,n)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)},length:function(){return this.node.getComputedTextLength()},move:function(t,e,n=this.bbox()){return this.x(t,n).y(e,n)},plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(Et.document.createTextNode(t)),this},x:function(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)}},Symbol.toStringTag,{value:"Module"}));let Vn=class extends Te{constructor(t,e=t){super(St("text",t),e),this.dom.leading=this.dom.leading??new Oe(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new Oe(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const n=this.dom.leading;this.each((function(r){if(_t(this.node))return;const i=Et.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=n*new Oe(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",r?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new Oe(t.leading||1.3),this}writeDataToDom(){return vt(this,this.dom,{leading:1.3}),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let r=0,i=e.length;r<i;++r)"textPath"===e[r].nodeName||_t(e[r])?0===r&&(n=r+1):(r!==n&&3!==e[r].nodeType&&!0===Nt(e[r]).dom.newLined&&(t+="\n"),t+=e[r].textContent);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,n=(t=(t+"").split("\n")).length;e<n;e++)this.newLine(t[e]);return this.build(!1).rebuild()}};zt(Vn,qn),ht({Container:{text:Pt((function(t=""){return this.put(new Vn).text(t)})),plain:Pt((function(t=""){return this.put(new Vn).plain(t)}))}}),Tt(Vn,"Text");let Wn=class extends Te{constructor(t,e=t){super(St("tspan",t),e),this._build=!1}dx(t){return this.attr("dx",t)}dy(t){return this.attr("dy",t)}newLine(){this.dom.newLined=!0;const t=this.parent();if(!(t instanceof Vn))return this;const e=t.index(this),n=Et.window.getComputedStyle(this.node).getPropertyValue("font-size"),r=t.dom.leading*new Oe(n);return this.dy(e?r:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}};zt(Wn,qn),ht({Tspan:{tspan:Pt((function(t=""){const e=new Wn;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),Tt(Wn,"Tspan");let Hn=class extends Te{constructor(t,e=t){super(St("circle",t),e)}radius(t){return this.attr("r",t)}rx(t){return this.attr("r",t)}ry(t){return this.rx(t)}size(t){return this.radius(new Oe(t).divide(2))}};zt(Hn,{x:Le,y:ze,cx:Pe,cy:De,width:Fe,height:$e}),ht({Container:{circle:Pt((function(t=0){return this.put(new Hn).size(t).move(0,0)}))}}),Tt(Hn,"Circle");let Un=class extends Ne{constructor(t,e=t){super(St("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return le("svg [clip-path*="+this.id()+"]")}};ht({Container:{clip:Pt((function(){return this.defs().put(new Un)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof Un?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),Tt(Un,"ClipPath");let Zn=class extends Ae{constructor(t,e=t){super(St("foreignObject",t),e)}};ht({Container:{foreignObject:Pt((function(t,e){return this.put(new Zn).size(t,e)}))}}),Tt(Zn,"ForeignObject");const Qn=Object.freeze(Object.defineProperty({__proto__:null,dmove:function(t,e){return this.children().forEach((n=>{let r;try{r=n.node instanceof Et.window.SVGSVGElement?new oe(n.attr(["x","y","width","height"])):n.bbox()}catch(u){return}const i=new re(n),s=i.translate(t,e).transform(i.inverse()),o=new ee(r.x,r.y).transform(s);n.move(o.x,o.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,n=this.bbox()){const r=t-n.x,i=e-n.y;return this.dmove(r,i)},size:function(t,e,n=this.bbox()){const r=mt(this,t,e,n),i=r.width/n.width,s=r.height/n.height;return this.children().forEach((t=>{const e=new ee(n).transform(new re(t).inverse());t.scale(i,s,e.x,e.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}},Symbol.toStringTag,{value:"Module"}));let Jn=class extends Ne{constructor(t,e=t){super(St("g",t),e)}};zt(Jn,Qn),ht({Container:{group:Pt((function(){return this.put(new Jn)}))}}),Tt(Jn,"G");let Kn=class extends Ne{constructor(t,e=t){super(St("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,xt)}};zt(Kn,Qn),ht({Container:{link:Pt((function(t){return this.put(new Kn).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const n=e.index(t);return e.add(this,n),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new Kn,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),Tt(Kn,"A");let tr=class extends Ne{constructor(t,e=t){super(St("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return le("svg [mask*="+this.id()+"]")}};ht({Container:{mask:Pt((function(){return this.defs().put(new tr)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof tr?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),Tt(tr,"Mask");let er=class extends Ae{constructor(t,e=t){super(St("stop",t),e)}update(t){return("number"==typeof t||t instanceof Oe)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new Oe(t.offset)),this}};ht({Gradient:{stop:function(t,e,n){return this.put(new er).update(t,e,n)}}}),Tt(er,"Stop");let nr=class extends Ae{constructor(t,e=t){super(St("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,n={}){return this.rule("@font-face",{fontFamily:t,src:e,...n})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let n=t+"{";for(const r in e)n+=r.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[r]+";";return n+="}",n}(t,e))}};ht("Dom",{style(t,e){return this.put(new nr).rule(t,e)},fontface(t,e,n){return this.put(new nr).font(t,e,n)}}),Tt(nr,"Style");let rr=class extends Vn{constructor(t,e=t){super(St("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let n=null;return e&&(n=e.plot(t)),null==t?n:this}track(){return this.reference("href")}};ht({Container:{textPath:Pt((function(t,e){return t instanceof Vn||(t=this.text(t)),t.path(e)}))},Text:{path:Pt((function(t,e=!0){const n=new rr;let r;if(t instanceof Cn||(t=this.defs().path(t)),n.attr("href","#"+t,xt),e)for(;r=this.node.firstChild;)n.node.appendChild(r);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:Pt((function(t){return t instanceof Vn||(t=(new Vn).addTo(this.parent()).text(t)),t.path(this)})),targets(){return le("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),rr.prototype.MorphArray=vn,Tt(rr,"TextPath");let ir=class extends Te{constructor(t,e=t){super(St("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,xt)}};function sr(){}ht({Container:{use:Pt((function(t,e){return this.put(new ir).use(t,e)}))}}),Tt(ir,"Use"),zt([Xn,Bn,Ue,He,en],lt("viewbox")),zt([tn,Nn,Sn,Cn],lt("marker")),zt(Vn,lt("Text")),zt(Cn,lt("Path")),zt(je,lt("Defs")),zt([Vn,Wn],lt("Tspan")),zt([jn,Ge,We,Pn],lt("radius")),zt(ye,lt("EventTarget")),zt(Ce,lt("Dom")),zt(Ae,lt("Element")),zt(Te,lt("Shape")),zt([Ne,Xe],lt("Container")),zt(We,lt("Gradient")),zt(Pn,lt("Runner")),ae.extend([...new Set(at)]),function(t=[]){kn.push(...[].concat(t))}([Oe,te,oe,re,Ee,Qe,vn,ee]),zt(kn,{to(t){return(new bn).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,n,r,i){return this.fromArray(t.map((function(t,s){return r.step(t,e[s],n,i[s],i)})))}});const or={export:"data:image/svg+xml,%3csvg%20fill='%23000000'%20width='20px'%20height='20px'%20viewBox='0%200%2024%2024'%20id='export-2'%20xmlns='http://www.w3.org/2000/svg'%20class='icon%20line'%3e%3cpolyline%20id='primary'%20points='15%203%2021%203%2021%209'%20style='fill:%20none;%20stroke:%20rgb(0,%200,%200);%20stroke-linecap:%20round;%20stroke-linejoin:%20round;%20stroke-width:%201.5;'%3e%3c/polyline%3e%3cpath%20id='primary-2'%20data-name='primary'%20d='M21,13v7a1,1,0,0,1-1,1H4a1,1,0,0,1-1-1V4A1,1,0,0,1,4,3h7'%20style='fill:%20none;%20stroke:%20rgb(0,%200,%200);%20stroke-linecap:%20round;%20stroke-linejoin:%20round;%20stroke-width:%201.5;'%3e%3c/path%3e%3cline%20id='primary-3'%20data-name='primary'%20x1='11'%20y1='13'%20x2='21'%20y2='3'%20style='fill:%20none;%20stroke:%20rgb(0,%200,%200);%20stroke-linecap:%20round;%20stroke-linejoin:%20round;%20stroke-width:%201.5;'%3e%3c/line%3e%3c/svg%3e","fit-screen":"data:image/svg+xml,%3csvg%20width='20px'%20height='20px'%20viewBox='0%200%2032%2032'%20id='icon'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpolygon%20points='8%202%202%202%202%208%204%208%204%204%208%204%208%202'/%3e%3cpolygon%20points='24%202%2030%202%2030%208%2028%208%2028%204%2024%204%2024%202'/%3e%3cpolygon%20points='8%2030%202%2030%202%2024%204%2024%204%2028%208%2028%208%2030'/%3e%3cpolygon%20points='24%2030%2030%2030%2030%2024%2028%2024%2028%2028%2024%2028%2024%2030'/%3e%3cpath%20d='M24,24H8a2.0023,2.0023,0,0,1-2-2V10A2.0023,2.0023,0,0,1,8,8H24a2.0023,2.0023,0,0,1,2,2V22A2.0023,2.0023,0,0,1,24,24ZM8,10V22H24V10Z'/%3e%3crect%20fill='none'%20width='32'%20height='32'/%3e%3c/svg%3e","zoom-in":"data:image/svg+xml,%3csvg%20width='20px'%20height='20px'%20viewBox='0%200%2032%2032'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xmlns:sketch='http://www.bohemiancoding.com/sketch/ns'%3e%3cg%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20transform='translate(-308.000000,%20-1139.000000)'%20fill='%23000000'%3e%3cpath%20d='M321.46,1163.45%20C315.17,1163.45%20310.07,1158.44%20310.07,1152.25%20C310.07,1146.06%20315.17,1141.04%20321.46,1141.04%20C327.75,1141.04%20332.85,1146.06%20332.85,1152.25%20C332.85,1158.44%20327.75,1163.45%20321.46,1163.45%20L321.46,1163.45%20Z%20M339.688,1169.25%20L331.429,1161.12%20C333.592,1158.77%20334.92,1155.67%20334.92,1152.25%20C334.92,1144.93%20328.894,1139%20321.46,1139%20C314.026,1139%20308,1144.93%20308,1152.25%20C308,1159.56%20314.026,1165.49%20321.46,1165.49%20C324.672,1165.49%20327.618,1164.38%20329.932,1162.53%20L338.225,1170.69%20C338.629,1171.09%20339.284,1171.09%20339.688,1170.69%20C340.093,1170.3%20340.093,1169.65%20339.688,1169.25%20L339.688,1169.25%20Z%20M326.519,1151.41%20L322.522,1151.41%20L322.522,1147.41%20C322.522,1146.85%20322.075,1146.41%20321.523,1146.41%20C320.972,1146.41%20320.524,1146.85%20320.524,1147.41%20L320.524,1151.41%20L316.529,1151.41%20C315.978,1151.41%20315.53,1151.59%20315.53,1152.14%20C315.53,1152.7%20315.978,1153.41%20316.529,1153.41%20L320.524,1153.41%20L320.524,1157.41%20C320.524,1157.97%20320.972,1158.41%20321.523,1158.41%20C322.075,1158.41%20322.522,1157.97%20322.522,1157.41%20L322.522,1153.41%20L326.519,1153.41%20C327.07,1153.41%20327.518,1152.96%20327.518,1152.41%20C327.518,1151.86%20327.07,1151.41%20326.519,1151.41%20L326.519,1151.41%20Z'%20/%3e%3c/g%3e%3c/g%3e%3c/svg%3e","zoom-out":"data:image/svg+xml,%3csvg%20width='20px'%20height='20px'%20viewBox='0%200%2032%2032'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%20%3e%3cg%20transform='translate(-360.000000,%20-1139.000000)'%20fill='%23000000'%3e%3cpath%20d='M373.46,1163.45%20C367.17,1163.45%20362.071,1158.44%20362.071,1152.25%20C362.071,1146.06%20367.17,1141.04%20373.46,1141.04%20C379.75,1141.04%20384.85,1146.06%20384.85,1152.25%20C384.85,1158.44%20379.75,1163.45%20373.46,1163.45%20L373.46,1163.45%20Z%20M391.688,1169.25%20L383.429,1161.12%20C385.592,1158.77%20386.92,1155.67%20386.92,1152.25%20C386.92,1144.93%20380.894,1139%20373.46,1139%20C366.026,1139%20360,1144.93%20360,1152.25%20C360,1159.56%20366.026,1165.49%20373.46,1165.49%20C376.672,1165.49%20379.618,1164.38%20381.932,1162.53%20L390.225,1170.69%20C390.629,1171.09%20391.284,1171.09%20391.688,1170.69%20C392.093,1170.3%20392.093,1169.65%20391.688,1169.25%20L391.688,1169.25%20Z%20M378.689,1151.41%20L368.643,1151.41%20C368.102,1151.41%20367.663,1151.84%20367.663,1152.37%20C367.663,1152.9%20368.102,1153.33%20368.643,1153.33%20L378.689,1153.33%20C379.23,1153.33%20379.669,1152.9%20379.669,1152.37%20C379.669,1151.84%20379.23,1151.41%20378.689,1151.41%20L378.689,1151.41%20Z'%20/%3e%3c/g%3e%3c/g%3e%3c/svg%3e"};class ur{constructor(t){this.element=t}createToolbarItem(t,e){const n=document.createElement("div"),r=new Image;r.src=e,n.id=t,n.append(r);const i=et({alignItems:"center",backgroundColor:"#FFFFFF",border:"1px solid #BCBCBC",cursor:"pointer",display:"flex",height:"30px",justifyContent:"center",width:"30px"});return n.setAttribute("style",i),n}render({enableExport:t=!1,enableFitscreen:e=!1,enableZoom:n=!1,onExport:r=sr,onFitscreen:i=sr,onZoom:s=sr}){var o;const u=document.createElement("div");u.id="toolbar";const a=et({display:"flex",gap:"5px",position:"absolute",right:"10px",top:"10px"});if(u.setAttribute("style",a),t){const t=this.createToolbarItem("export",or.export);t.addEventListener("click",(()=>{r()})),u.append(t)}if(n){const t=this.createToolbarItem("zoom-in",or["zoom-in"]),e=this.createToolbarItem("zoom-out",or["zoom-out"]);t.addEventListener("click",(()=>{s(.1)})),e.addEventListener("click",(()=>{s(-.1)})),u.append(t,e)}if(e){const t=this.createToolbarItem("fit-screen",or["fit-screen"]);t.addEventListener("click",(()=>{i()})),u.append(t)}null==(o=this.element)||o.append(u)}}var ar="\0",hr="\0",lr="";function cr(t,e){t[e]?t[e]++:t[e]=1}function fr(t,e){--t[e]||delete t[e]}function dr(t,e,n,r){var i=""+e,s=""+n;if(!t&&i>s){var o=i;i=s,s=o}return i+lr+s+lr+(void 0===r?ar:r)}function pr(t,e){return dr(t,e.v,e.w,e.name)}var mr=class{constructor(t){e(this,"_isDirected",!0),e(this,"_isMultigraph",!1),e(this,"_isCompound",!1),e(this,"_label"),e(this,"_defaultNodeLabelFn",(()=>{})),e(this,"_defaultEdgeLabelFn",(()=>{})),e(this,"_nodes",{}),e(this,"_in",{}),e(this,"_preds",{}),e(this,"_out",{}),e(this,"_sucs",{}),e(this,"_edgeObjs",{}),e(this,"_edgeLabels",{}),e(this,"_nodeCount",0),e(this,"_edgeCount",0),e(this,"_parent"),e(this,"_children"),t&&(this._isDirected=!Object.hasOwn(t,"directed")||t.directed,this._isMultigraph=!!Object.hasOwn(t,"multigraph")&&t.multigraph,this._isCompound=!!Object.hasOwn(t,"compound")&&t.compound),this._isCompound&&(this._parent={},this._children={},this._children[hr]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return this._defaultNodeLabelFn=t,"function"!=typeof t&&(this._defaultNodeLabelFn=()=>t),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var t=this;return this.nodes().filter((e=>0===Object.keys(t._in[e]).length))}sinks(){var t=this;return this.nodes().filter((e=>0===Object.keys(t._out[e]).length))}setNodes(t,e){var n=arguments,r=this;return t.forEach((function(t){n.length>1?r.setNode(t,e):r.setNode(t)})),this}setNode(t,e){return Object.hasOwn(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=hr,this._children[t]={},this._children[hr][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.hasOwn(this._nodes,t)}removeNode(t){var e=this;if(Object.hasOwn(this._nodes,t)){var n=t=>e.removeEdge(e._edgeObjs[t]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],this.children(t).forEach((function(t){e.setParent(t)})),delete this._children[t]),Object.keys(this._in[t]).forEach(n),delete this._in[t],delete this._preds[t],Object.keys(this._out[t]).forEach(n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(void 0===e)e=hr;else{for(var n=e+="";void 0!==n;n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var e=this._parent[t];if(e!==hr)return e}}children(t=hr){if(this._isCompound){var e=this._children[t];if(e)return Object.keys(e)}else{if(t===hr)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var e=this._preds[t];if(e)return Object.keys(e)}successors(t){var e=this._sucs[t];if(e)return Object.keys(e)}neighbors(t){var e=this.predecessors(t);if(e){const r=new Set(e);for(var n of this.successors(t))r.add(n);return Array.from(r.values())}}isLeaf(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length}filterNodes(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;Object.entries(this._nodes).forEach((function([n,r]){t(n)&&e.setNode(n,r)})),Object.values(this._edgeObjs).forEach((function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,n.edge(t))}));var r={};function i(t){var s=n.parent(t);return void 0===s||e.hasNode(s)?(r[t]=s,s):s in r?r[s]:i(s)}return this._isCompound&&e.nodes().forEach((t=>e.setParent(t,i(t)))),e}setDefaultEdgeLabel(t){return this._defaultEdgeLabelFn=t,"function"!=typeof t&&(this._defaultEdgeLabelFn=()=>t),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(t,e){var n=this,r=arguments;return t.reduce((function(t,i){return r.length>1?n.setEdge(t,i,e):n.setEdge(t,i),i})),this}setEdge(){var t,e,n,r,i=!1,s=arguments[0];"object"==typeof s&&null!==s&&"v"in s?(t=s.v,e=s.w,n=s.name,2===arguments.length&&(r=arguments[1],i=!0)):(t=s,e=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],i=!0)),t=""+t,e=""+e,void 0!==n&&(n=""+n);var o=dr(this._isDirected,t,e,n);if(Object.hasOwn(this._edgeLabels,o))return i&&(this._edgeLabels[o]=r),this;if(void 0!==n&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[o]=i?r:this._defaultEdgeLabelFn(t,e,n);var u=function(t,e,n,r){var i=""+e,s=""+n;if(!t&&i>s){var o=i;i=s,s=o}var u={v:i,w:s};r&&(u.name=r);return u}(this._isDirected,t,e,n);return t=u.v,e=u.w,Object.freeze(u),this._edgeObjs[o]=u,cr(this._preds[e],t),cr(this._sucs[t],e),this._in[e][o]=u,this._out[t][o]=u,this._edgeCount++,this}edge(t,e,n){var r=1===arguments.length?pr(this._isDirected,arguments[0]):dr(this._isDirected,t,e,n);return this._edgeLabels[r]}edgeAsObj(){const t=this.edge(...arguments);return"object"!=typeof t?{label:t}:t}hasEdge(t,e,n){var r=1===arguments.length?pr(this._isDirected,arguments[0]):dr(this._isDirected,t,e,n);return Object.hasOwn(this._edgeLabels,r)}removeEdge(t,e,n){var r=1===arguments.length?pr(this._isDirected,arguments[0]):dr(this._isDirected,t,e,n),i=this._edgeObjs[r];return i&&(t=i.v,e=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],fr(this._preds[e],t),fr(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this}inEdges(t,e){var n=this._in[t];if(n){var r=Object.values(n);return e?r.filter((t=>t.v===e)):r}}outEdges(t,e){var n=this._out[t];if(n){var r=Object.values(n);return e?r.filter((t=>t.w===e)):r}}nodeEdges(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))}},gr={Graph:mr,version:"2.2.4"},yr=mr,_r={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:vr(t),edges:wr(t)};void 0!==t.graph()&&(e.value=structuredClone(t.graph()));return e},read:function(t){var e=new yr(t.options).setGraph(t.value);return t.nodes.forEach((function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)})),t.edges.forEach((function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)})),e}};function vr(t){return t.nodes().map((function(e){var n=t.node(e),r=t.parent(e),i={v:e};return void 0!==n&&(i.value=n),void 0!==r&&(i.parent=r),i}))}function wr(t){return t.edges().map((function(e){var n=t.edge(e),r={v:e.v,w:e.w};return void 0!==e.name&&(r.name=e.name),void 0!==n&&(r.value=n),r}))}var br=function(t){var e,n={},r=[];function i(r){Object.hasOwn(n,r)||(n[r]=!0,e.push(r),t.successors(r).forEach(i),t.predecessors(r).forEach(i))}return t.nodes().forEach((function(t){e=[],i(t),e.length&&r.push(e)})),r};var xr=class{constructor(){e(this,"_arr",[]),e(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map((function(t){return t.key}))}has(t){return Object.hasOwn(this._keyIndices,t)}priority(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority}min(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key}add(t,e){var n=this._keyIndices;if(t=String(t),!Object.hasOwn(n,t)){var r=this._arr,i=r.length;return n[t]=i,r.push({key:t,priority:e}),this._decrease(i),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key}decrease(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)}_heapify(t){var e=this._arr,n=2*t,r=n+1,i=t;n<e.length&&(i=e[n].priority<e[i].priority?n:i,r<e.length&&(i=e[r].priority<e[i].priority?r:i),i!==t&&(this._swap(t,i),this._heapify(i)))}_decrease(t){for(var e,n=this._arr,r=n[t].priority;0!==t&&!(n[e=t>>1].priority<r);)this._swap(t,e),t=e}_swap(t,e){var n=this._arr,r=this._keyIndices,i=n[t],s=n[e];n[t]=s,n[e]=i,r[s.key]=t,r[i.key]=e}},Er=xr,Or=function(t,e,n,r){return function(t,e,n,r){var i,s,o={},u=new Er,a=function(t){var e=t.v!==i?t.v:t.w,r=o[e],a=n(t),h=s.distance+a;if(a<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+a);h<r.distance&&(r.distance=h,r.predecessor=i,u.decrease(e,h))};t.nodes().forEach((function(t){var n=t===e?0:Number.POSITIVE_INFINITY;o[t]={distance:n},u.add(t,n)}));for(;u.size()>0&&(i=u.removeMin(),(s=o[i]).distance!==Number.POSITIVE_INFINITY);)r(i).forEach(a);return o}(t,String(e),n||Mr,r||function(e){return t.outEdges(e)})},Mr=()=>1;var kr=Or,Cr=function(t,e,n){return t.nodes().reduce((function(r,i){return r[i]=kr(t,i,e,n),r}),{})};var Ar=function(t){var e=0,n=[],r={},i=[];function s(o){var u=r[o]={onStack:!0,lowlink:e,index:e++};if(n.push(o),t.successors(o).forEach((function(t){Object.hasOwn(r,t)?r[t].onStack&&(u.lowlink=Math.min(u.lowlink,r[t].index)):(s(t),u.lowlink=Math.min(u.lowlink,r[t].lowlink))})),u.lowlink===u.index){var a,h=[];do{a=n.pop(),r[a].onStack=!1,h.push(a)}while(o!==a);i.push(h)}}return t.nodes().forEach((function(t){Object.hasOwn(r,t)||s(t)})),i};var Sr=Ar,Nr=function(t){return Sr(t).filter((function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))};var jr=function(t,e,n){return function(t,e,n){var r={},i=t.nodes();return i.forEach((function(t){r[t]={},r[t][t]={distance:0},i.forEach((function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})})),n(t).forEach((function(n){var i=n.v===t?n.w:n.v,s=e(n);r[t][i]={distance:s,predecessor:t}}))})),i.forEach((function(t){var e=r[t];i.forEach((function(n){var s=r[n];i.forEach((function(n){var r=s[t],i=e[n],o=s[n],u=r.distance+i.distance;u<o.distance&&(o.distance=u,o.predecessor=i.predecessor)}))}))})),r}(t,e||Tr,n||function(e){return t.outEdges(e)})},Tr=()=>1;function Ir(t){var e={},n={},r=[];if(t.sinks().forEach((function i(s){if(Object.hasOwn(n,s))throw new Rr;Object.hasOwn(e,s)||(n[s]=!0,e[s]=!0,t.predecessors(s).forEach(i),delete n[s],r.push(s))})),Object.keys(e).length!==t.nodeCount())throw new Rr;return r}class Rr extends Error{constructor(){super(...arguments)}}var Lr=Ir;Ir.CycleException=Rr;var zr=Lr;var Pr=function(t,e,n){Array.isArray(e)||(e=[e]);var r=t.isDirected()?e=>t.successors(e):e=>t.neighbors(e),i="post"===n?Dr:Fr,s=[],o={};return e.forEach((e=>{if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);i(e,r,o,s)})),s};function Dr(t,e,n,r){for(var i=[[t,!1]];i.length>0;){var s=i.pop();s[1]?r.push(s[0]):Object.hasOwn(n,s[0])||(n[s[0]]=!0,i.push([s[0],!0]),$r(e(s[0]),(t=>i.push([t,!1]))))}}function Fr(t,e,n,r){for(var i=[t];i.length>0;){var s=i.pop();Object.hasOwn(n,s)||(n[s]=!0,r.push(s),$r(e(s),(t=>i.push(t))))}}function $r(t,e){for(var n=t.length;n--;)e(t[n],n,t);return t}var Yr=Pr;var Gr=Pr;var Xr=mr,Br=xr;var qr={Graph:gr.Graph,json:_r,alg:{components:br,dijkstra:Or,dijkstraAll:Cr,findCycles:Nr,floydWarshall:jr,isAcyclic:function(t){try{zr(t)}catch(e){if(e instanceof zr.CycleException)return!1;throw e}return!0},postorder:function(t,e){return Yr(t,e,"post")},preorder:function(t,e){return Gr(t,e,"pre")},prim:function(t,e){var n,r=new Xr,i={},s=new Br;function o(t){var r=t.v===n?t.w:t.v,o=s.priority(r);if(void 0!==o){var u=e(t);u<o&&(i[r]=n,s.decrease(r,u))}}if(0===t.nodeCount())return r;t.nodes().forEach((function(t){s.add(t,Number.POSITIVE_INFINITY),r.setNode(t)})),s.decrease(t.nodes()[0],0);var u=!1;for(;s.size()>0;){if(n=s.removeMin(),Object.hasOwn(i,n))r.setEdge(n,i[n]);else{if(u)throw new Error("Input graph is not connected: "+t);u=!0}t.nodeEdges(n).forEach(o)}return r},tarjan:Ar,topsort:Lr},version:gr.version};function Vr(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function Wr(t,e){if("_next"!==t&&"_prev"!==t)return e}let Hr=qr.Graph,Ur=class{constructor(){let t={};t._next=t._prev=t,this._sentinel=t}dequeue(){let t=this._sentinel,e=t._prev;if(e!==t)return Vr(e),e}enqueue(t){let e=this._sentinel;t._prev&&t._next&&Vr(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e}toString(){let t=[],e=this._sentinel,n=e._prev;for(;n!==e;)t.push(JSON.stringify(n,Wr)),n=n._prev;return"["+t.join(", ")+"]"}};var Zr=function(t,e){if(t.nodeCount()<=1)return[];let n=function(t,e){let n=new Hr,r=0,i=0;t.nodes().forEach((t=>{n.setNode(t,{v:t,in:0,out:0})})),t.edges().forEach((t=>{let s=n.edge(t.v,t.w)||0,o=e(t),u=s+o;n.setEdge(t.v,t.w,u),i=Math.max(i,n.node(t.v).out+=o),r=Math.max(r,n.node(t.w).in+=o)}));let s=function(t){const e=[];for(let n=0;n<t;n++)e.push(n);return e}(i+r+3).map((()=>new Ur)),o=r+1;return n.nodes().forEach((t=>{Kr(s,o,n.node(t))})),{graph:n,buckets:s,zeroIdx:o}}(t,e||Qr);return function(t,e,n){let r,i=[],s=e[e.length-1],o=e[0];for(;t.nodeCount();){for(;r=o.dequeue();)Jr(t,e,n,r);for(;r=s.dequeue();)Jr(t,e,n,r);if(t.nodeCount())for(let s=e.length-2;s>0;--s)if(r=e[s].dequeue(),r){i=i.concat(Jr(t,e,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx).flatMap((e=>t.outEdges(e.v,e.w)))};let Qr=()=>1;function Jr(t,e,n,r,i){let s=i?[]:void 0;return t.inEdges(r.v).forEach((r=>{let o=t.edge(r),u=t.node(r.v);i&&s.push({v:r.v,w:r.w}),u.out-=o,Kr(e,n,u)})),t.outEdges(r.v).forEach((r=>{let i=t.edge(r),s=r.w,o=t.node(s);o.in-=i,Kr(e,n,o)})),t.removeNode(r.v),s}function Kr(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}let ti=qr.Graph;var ei={addBorderNode:function(t,e,n,r){let i={width:0,height:0};arguments.length>=4&&(i.rank=n,i.order=r);return ni(t,"border",i,e)},addDummyNode:ni,applyWithChunking:ii,asNonCompoundGraph:function(t){let e=new ti({multigraph:t.isMultigraph()}).setGraph(t.graph());return t.nodes().forEach((n=>{t.children(n).length||e.setNode(n,t.node(n))})),t.edges().forEach((n=>{e.setEdge(n,t.edge(n))})),e},buildLayerMatrix:function(t){let e=ai(si(t)+1).map((()=>[]));return t.nodes().forEach((n=>{let r=t.node(n),i=r.rank;void 0!==i&&(e[i][r.order]=n)})),e},intersectRect:function(t,e){let n,r,i=t.x,s=t.y,o=e.x-i,u=e.y-s,a=t.width/2,h=t.height/2;if(!o&&!u)throw new Error("Not possible to find intersection inside of the rectangle");Math.abs(u)*a>Math.abs(o)*h?(u<0&&(h=-h),n=h*o/u,r=h):(o<0&&(a=-a),n=a,r=a*u/o);return{x:i+n,y:s+r}},mapValues:function(t,e){let n=e;"string"==typeof e&&(n=t=>t[e]);return Object.entries(t).reduce(((t,[e,r])=>(t[e]=n(r,e),t)),{})},maxRank:si,normalizeRanks:function(t){let e=t.nodes().map((e=>{let n=t.node(e).rank;return void 0===n?Number.MAX_VALUE:n})),n=ii(Math.min,e);t.nodes().forEach((e=>{let r=t.node(e);Object.hasOwn(r,"rank")&&(r.rank-=n)}))},notime:function(t,e){return e()},partition:function(t,e){let n={lhs:[],rhs:[]};return t.forEach((t=>{e(t)?n.lhs.push(t):n.rhs.push(t)})),n},pick:function(t,e){const n={};for(const r of e)void 0!==t[r]&&(n[r]=t[r]);return n},predecessorWeights:function(t){let e=t.nodes().map((e=>{let n={};return t.inEdges(e).forEach((e=>{n[e.v]=(n[e.v]||0)+t.edge(e).weight})),n}));return hi(t.nodes(),e)},range:ai,removeEmptyRanks:function(t){let e=t.nodes().map((e=>t.node(e).rank)),n=ii(Math.min,e),r=[];t.nodes().forEach((e=>{let i=t.node(e).rank-n;r[i]||(r[i]=[]),r[i].push(e)}));let i=0,s=t.graph().nodeRankFactor;Array.from(r).forEach(((e,n)=>{void 0===e&&n%s!=0?--i:void 0!==e&&i&&e.forEach((e=>t.node(e).rank+=i))}))},simplify:function(t){let e=(new ti).setGraph(t.graph());return t.nodes().forEach((n=>e.setNode(n,t.node(n)))),t.edges().forEach((n=>{let r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),e},successorWeights:function(t){let e=t.nodes().map((e=>{let n={};return t.outEdges(e).forEach((e=>{n[e.w]=(n[e.w]||0)+t.edge(e).weight})),n}));return hi(t.nodes(),e)},time:function(t,e){let n=Date.now();try{return e()}finally{console.log(t+" time: "+(Date.now()-n)+"ms")}},uniqueId:ui,zipObject:hi};function ni(t,e,n,r){let i;do{i=ui(r)}while(t.hasNode(i));return n.dummy=e,t.setNode(i,n),i}const ri=65535;function ii(t,e){if(e.length>ri){const n=function(t,e=ri){const n=[];for(let r=0;r<t.length;r+=e){const i=t.slice(r,r+e);n.push(i)}return n}(e);return t.apply(null,n.map((e=>t.apply(null,e))))}return t.apply(null,e)}function si(t){const e=t.nodes().map((e=>{let n=t.node(e).rank;return void 0===n?Number.MIN_VALUE:n}));return ii(Math.max,e)}let oi=0;function ui(t){var e=++oi;return toString(t)+e}function ai(t,e,n=1){null==e&&(e=t,t=0);let r=t=>t<e;n<0&&(r=t=>e<t);const i=[];for(let s=t;r(s);s+=n)i.push(s);return i}function hi(t,e){return t.reduce(((t,n,r)=>(t[n]=e[r],t)),{})}let li=Zr,ci=ei.uniqueId;var fi={run:function(t){("greedy"===t.graph().acyclicer?li(t,(e=t,t=>e.edge(t).weight)):function(t){let e=[],n={},r={};function i(s){Object.hasOwn(r,s)||(r[s]=!0,n[s]=!0,t.outEdges(s).forEach((t=>{Object.hasOwn(n,t.w)?e.push(t):i(t.w)})),delete n[s])}return t.nodes().forEach(i),e}(t)).forEach((e=>{let n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,ci("rev"))}));var e},undo:function(t){t.edges().forEach((e=>{let n=t.edge(e);if(n.reversed){t.removeEdge(e);let r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}}))}};let di=ei;var pi={run:function(t){t.graph().dummyChains=[],t.edges().forEach((e=>function(t,e){let n,r,i,s=e.v,o=t.node(s).rank,u=e.w,a=t.node(u).rank,h=e.name,l=t.edge(e),c=l.labelRank;if(a===o+1)return;for(t.removeEdge(e),i=0,++o;o<a;++i,++o)l.points=[],r={width:0,height:0,edgeLabel:l,edgeObj:e,rank:o},n=di.addDummyNode(t,"edge",r,"_d"),o===c&&(r.width=l.width,r.height=l.height,r.dummy="edge-label",r.labelpos=l.labelpos),t.setEdge(s,n,{weight:l.weight},h),0===i&&t.graph().dummyChains.push(n),s=n;t.setEdge(s,u,{weight:l.weight},h)}(t,e)))},undo:function(t){t.graph().dummyChains.forEach((e=>{let n,r=t.node(e),i=r.edgeLabel;for(t.setEdge(r.edgeObj,i);r.dummy;)n=t.successors(e)[0],t.removeNode(e),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),e=n,r=t.node(e)}))}};const{applyWithChunking:mi}=ei;var gi={longestPath:function(t){var e={};t.sources().forEach((function n(r){var i=t.node(r);if(Object.hasOwn(e,r))return i.rank;e[r]=!0;let s=t.outEdges(r).map((e=>null==e?Number.POSITIVE_INFINITY:n(e.w)-t.edge(e).minlen));var o=mi(Math.min,s);return o===Number.POSITIVE_INFINITY&&(o=0),i.rank=o}))},slack:function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}};var yi=qr.Graph,_i=gi.slack,vi=function(t){var e,n,r=new yi({directed:!1}),i=t.nodes()[0],s=t.nodeCount();r.setNode(i,{});for(;wi(r,t)<s;)e=bi(r,t),n=r.hasNode(e.v)?_i(t,e):-_i(t,e),xi(r,t,n);return r};function wi(t,e){return t.nodes().forEach((function n(r){e.nodeEdges(r).forEach((i=>{var s=i.v,o=r===s?i.w:s;t.hasNode(o)||_i(e,i)||(t.setNode(o,{}),t.setEdge(r,o,{}),n(o))}))})),t.nodeCount()}function bi(t,e){return e.edges().reduce(((n,r)=>{let i=Number.POSITIVE_INFINITY;return t.hasNode(r.v)!==t.hasNode(r.w)&&(i=_i(e,r)),i<n[0]?[i,r]:n}),[Number.POSITIVE_INFINITY,null])[1]}function xi(t,e,n){t.nodes().forEach((t=>e.node(t).rank+=n))}var Ei=vi,Oi=gi.slack,Mi=gi.longestPath,ki=qr.alg.preorder,Ci=qr.alg.postorder,Ai=ei.simplify,Si=Ni;function Ni(t){t=Ai(t),Mi(t);var e,n=Ei(t);for(Ii(n),ji(n,t);e=Li(n);)Pi(n,t,e,zi(n,t,e))}function ji(t,e){var n=Ci(t,t.nodes());(n=n.slice(0,n.length-1)).forEach((n=>function(t,e,n){var r=t.node(n),i=r.parent;t.edge(n,i).cutvalue=Ti(t,e,n)}(t,e,n)))}function Ti(t,e,n){var r=t.node(n).parent,i=!0,s=e.edge(n,r),o=0;return s||(i=!1,s=e.edge(r,n)),o=s.weight,e.nodeEdges(n).forEach((s=>{var u,a,h=s.v===n,l=h?s.w:s.v;if(l!==r){var c=h===i,f=e.edge(s).weight;if(o+=c?f:-f,u=n,a=l,t.hasEdge(u,a)){var d=t.edge(n,l).cutvalue;o+=c?-d:d}}})),o}function Ii(t,e){arguments.length<2&&(e=t.nodes()[0]),Ri(t,{},1,e)}function Ri(t,e,n,r,i){var s=n,o=t.node(r);return e[r]=!0,t.neighbors(r).forEach((i=>{Object.hasOwn(e,i)||(n=Ri(t,e,n,i,r))})),o.low=s,o.lim=n++,i?o.parent=i:delete o.parent,n}function Li(t){return t.edges().find((e=>t.edge(e).cutvalue<0))}function zi(t,e,n){var r=n.v,i=n.w;e.hasEdge(r,i)||(r=n.w,i=n.v);var s=t.node(r),o=t.node(i),u=s,a=!1;return s.lim>o.lim&&(u=o,a=!0),e.edges().filter((e=>a===Di(t,t.node(e.v),u)&&a!==Di(t,t.node(e.w),u))).reduce(((t,n)=>Oi(e,n)<Oi(e,t)?n:t))}function Pi(t,e,n,r){var i=n.v,s=n.w;t.removeEdge(i,s),t.setEdge(r.v,r.w,{}),Ii(t),ji(t,e),function(t,e){var n=t.nodes().find((t=>!e.node(t).parent)),r=ki(t,n);(r=r.slice(1)).forEach((n=>{var r=t.node(n).parent,i=e.edge(n,r),s=!1;i||(i=e.edge(r,n),s=!0),e.node(n).rank=e.node(r).rank+(s?i.minlen:-i.minlen)}))}(t,e)}function Di(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}Ni.initLowLimValues=Ii,Ni.initCutValues=ji,Ni.calcCutValue=Ti,Ni.leaveEdge=Li,Ni.enterEdge=zi,Ni.exchangeEdges=Pi;var Fi=gi.longestPath,$i=vi,Yi=Si,Gi=function(t){switch(t.graph().ranker){case"network-simplex":default:Bi(t);break;case"tight-tree":!function(t){Fi(t),$i(t)}(t);break;case"longest-path":Xi(t)}};var Xi=Fi;function Bi(t){Yi(t)}let qi=ei;function Vi(t,e,n,r,i,s,o){let u=t.children(o);if(!u.length)return void(o!==e&&t.setEdge(e,o,{weight:0,minlen:n}));let a=qi.addBorderNode(t,"_bt"),h=qi.addBorderNode(t,"_bb"),l=t.node(o);t.setParent(a,o),l.borderTop=a,t.setParent(h,o),l.borderBottom=h,u.forEach((u=>{Vi(t,e,n,r,i,s,u);let l=t.node(u),c=l.borderTop?l.borderTop:u,f=l.borderBottom?l.borderBottom:u,d=l.borderTop?r:2*r,p=c!==f?1:i-s[o]+1;t.setEdge(a,c,{weight:d,minlen:p,nestingEdge:!0}),t.setEdge(f,h,{weight:d,minlen:p,nestingEdge:!0})})),t.parent(o)||t.setEdge(e,a,{weight:0,minlen:i+s[o]})}let Wi=ei;function Hi(t,e,n,r,i,s){let o={width:0,height:0,rank:s,borderType:e},u=i[e][s-1],a=Wi.addDummyNode(t,"border",o,n);i[e][s]=a,t.setParent(a,r),u&&t.setEdge(u,a,{weight:1})}function Ui(t){t.nodes().forEach((e=>Zi(t.node(e)))),t.edges().forEach((e=>Zi(t.edge(e))))}function Zi(t){let e=t.width;t.width=t.height,t.height=e}function Qi(t){t.y=-t.y}function Ji(t){let e=t.x;t.x=t.y,t.y=e}let Ki=ei;let ts=ei.zipObject;function es(t,e,n){let r=ts(n,n.map(((t,e)=>e))),i=e.flatMap((e=>t.outEdges(e).map((e=>({pos:r[e.w],weight:t.edge(e).weight}))).sort(((t,e)=>t.pos-e.pos)))),s=1;for(;s<n.length;)s<<=1;let o=2*s-1;s-=1;let u=new Array(o).fill(0),a=0;return i.forEach((t=>{let e=t.pos+s;u[e]+=t.weight;let n=0;for(;e>0;)e%2&&(n+=u[e+1]),e=e-1>>1,u[e]+=t.weight;a+=t.weight*n})),a}let ns=ei;let rs=ei;function is(t,e,n){let r;for(;e.length&&(r=e[e.length-1]).i<=n;)e.pop(),t.push(r.vs),n++;return n}let ss=function(t,e=[]){return e.map((e=>{let n=t.inEdges(e);if(n.length){let r=n.reduce(((e,n)=>{let r=t.edge(n),i=t.node(n.v);return{sum:e.sum+r.weight*i.order,weight:e.weight+r.weight}}),{sum:0,weight:0});return{v:e,barycenter:r.sum/r.weight,weight:r.weight}}return{v:e}}))},os=function(t,e){let n={};return t.forEach(((t,e)=>{let r=n[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};void 0!==t.barycenter&&(r.barycenter=t.barycenter,r.weight=t.weight)})),e.edges().forEach((t=>{let e=n[t.v],r=n[t.w];void 0!==e&&void 0!==r&&(r.indegree++,e.out.push(n[t.w]))})),function(t){let e=[];function n(t){return e=>{e.merged||(void 0===e.barycenter||void 0===t.barycenter||e.barycenter>=t.barycenter)&&function(t,e){let n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight);e.weight&&(n+=e.barycenter*e.weight,r+=e.weight);t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}function r(e){return n=>{n.in.push(e),0==--n.indegree&&t.push(n)}}for(;t.length;){let i=t.pop();e.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return e.filter((t=>!t.merged)).map((t=>ns.pick(t,["vs","i","barycenter","weight"])))}(Object.values(n).filter((t=>!t.indegree)))},us=function(t,e){let n=rs.partition(t,(t=>Object.hasOwn(t,"barycenter"))),r=n.lhs,i=n.rhs.sort(((t,e)=>e.i-t.i)),s=[],o=0,u=0,a=0;r.sort((h=!!e,(t,e)=>t.barycenter<e.barycenter?-1:t.barycenter>e.barycenter?1:h?e.i-t.i:t.i-e.i)),a=is(s,i,a),r.forEach((t=>{a+=t.vs.length,s.push(t.vs),o+=t.barycenter*t.weight,u+=t.weight,a=is(s,i,a)}));var h;let l={vs:s.flat(!0)};u&&(l.barycenter=o/u,l.weight=u);return l};var as=function t(e,n,r,i){let s=e.children(n),o=e.node(n),u=o?o.borderLeft:void 0,a=o?o.borderRight:void 0,h={};u&&(s=s.filter((t=>t!==u&&t!==a)));let l=ss(e,s);l.forEach((n=>{if(e.children(n.v).length){let u=t(e,n.v,r,i);h[n.v]=u,Object.hasOwn(u,"barycenter")&&(o=u,void 0!==(s=n).barycenter?(s.barycenter=(s.barycenter*s.weight+o.barycenter*o.weight)/(s.weight+o.weight),s.weight+=o.weight):(s.barycenter=o.barycenter,s.weight=o.weight))}var s,o}));let c=os(l,r);!function(t,e){t.forEach((t=>{t.vs=t.vs.flatMap((t=>e[t]?e[t].vs:t))}))}(c,h);let f=us(c,i);if(u&&(f.vs=[u,f.vs,a].flat(!0),e.predecessors(u).length)){let t=e.node(e.predecessors(u)[0]),n=e.node(e.predecessors(a)[0]);Object.hasOwn(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+t.order+n.order)/(f.weight+2),f.weight+=2}return f};let hs=qr.Graph,ls=ei;let cs=function(t){let e={},n=t.nodes().filter((e=>!t.children(e).length)),r=n.map((e=>t.node(e).rank)),i=Ki.applyWithChunking(Math.max,r),s=Ki.range(i+1).map((()=>[]));return n.sort(((e,n)=>t.node(e).rank-t.node(n).rank)).forEach((function n(r){if(e[r])return;e[r]=!0;let i=t.node(r);s[i.rank].push(r),t.successors(r).forEach(n)})),s},fs=function(t,e){let n=0;for(let r=1;r<e.length;++r)n+=es(t,e[r-1],e[r]);return n},ds=as,ps=function(t,e,n){let r=function(t){var e;for(;t.hasNode(e=ls.uniqueId("_root")););return e}(t),i=new hs({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((e=>t.node(e)));return t.nodes().forEach((s=>{let o=t.node(s),u=t.parent(s);(o.rank===e||o.minRank<=e&&e<=o.maxRank)&&(i.setNode(s),i.setParent(s,u||r),t[n](s).forEach((e=>{let n=e.v===s?e.w:e.v,r=i.edge(n,s),o=void 0!==r?r.weight:0;i.setEdge(n,s,{weight:t.edge(e).weight+o})})),Object.hasOwn(o,"minRank")&&i.setNode(s,{borderLeft:o.borderLeft[e],borderRight:o.borderRight[e]}))})),i},ms=function(t,e,n){let r,i={};n.forEach((n=>{let s,o,u=t.parent(n);for(;u;){if(s=t.parent(u),s?(o=i[s],i[s]=u):(o=r,r=u),o&&o!==u)return void e.setEdge(o,u);u=s}}))},gs=qr.Graph,ys=ei;var _s=function t(e,n){if(n&&"function"==typeof n.customOrder)return void n.customOrder(e,t);let r=ys.maxRank(e),i=vs(e,ys.range(1,r+1),"inEdges"),s=vs(e,ys.range(r-1,-1,-1),"outEdges"),o=cs(e);if(bs(e,o),n&&n.disableOptimalOrderHeuristic)return;let u,a=Number.POSITIVE_INFINITY;for(let h=0,l=0;l<4;++h,++l){ws(h%2?i:s,h%4>=2),o=ys.buildLayerMatrix(e);let t=fs(e,o);t<a&&(l=0,u=Object.assign({},o),a=t)}bs(e,u)};function vs(t,e,n){return e.map((function(e){return ps(t,e,n)}))}function ws(t,e){let n=new gs;t.forEach((function(t){let r=t.graph().root,i=ds(t,r,n,e);i.vs.forEach(((e,n)=>t.node(e).order=n)),ms(t,n,i.vs)}))}function bs(t,e){Object.values(e).forEach((e=>e.forEach(((e,n)=>t.node(e).order=n))))}let xs=qr.Graph,Es=ei;var Os=function(t){let e,n=Es.buildLayerMatrix(t),r=Object.assign(Ms(t,n),ks(t,n)),i={};["u","d"].forEach((s=>{e="u"===s?n:Object.values(n).reverse(),["l","r"].forEach((n=>{"r"===n&&(e=e.map((t=>Object.values(t).reverse())));let o=("u"===s?t.predecessors:t.successors).bind(t),u=Ss(t,e,r,o),a=Ns(t,e,u.root,u.align,"r"===n);"r"===n&&(a=Es.mapValues(a,(t=>-t))),i[s+n]=a}))}));let s=js(t,i);return Ts(i,s),Is(i,t.graph().align)};function Ms(t,e){let n={};return e.length&&e.reduce((function(e,r){let i=0,s=0,o=e.length,u=r[r.length-1];return r.forEach(((e,a)=>{let h=function(t,e){if(t.node(e).dummy)return t.predecessors(e).find((e=>t.node(e).dummy))}(t,e),l=h?t.node(h).order:o;(h||e===u)&&(r.slice(s,a+1).forEach((e=>{t.predecessors(e).forEach((r=>{let s=t.node(r),o=s.order;!(o<i||l<o)||s.dummy&&t.node(e).dummy||Cs(n,r,e)}))})),s=a+1,i=l)})),r})),n}function ks(t,e){let n={};function r(e,r,i,s,o){let u;Es.range(r,i).forEach((r=>{u=e[r],t.node(u).dummy&&t.predecessors(u).forEach((e=>{let r=t.node(e);r.dummy&&(r.order<s||r.order>o)&&Cs(n,e,u)}))}))}return e.length&&e.reduce((function(e,n){let i,s=-1,o=0;return n.forEach(((u,a)=>{if("border"===t.node(u).dummy){let e=t.predecessors(u);e.length&&(i=t.node(e[0]).order,r(n,o,a,s,i),o=a,s=i)}r(n,o,n.length,i,e.length)})),n})),n}function Cs(t,e,n){if(e>n){let t=e;e=n,n=t}let r=t[e];r||(t[e]=r={}),r[n]=!0}function As(t,e,n){if(e>n){let t=e;e=n,n=t}return!!t[e]&&Object.hasOwn(t[e],n)}function Ss(t,e,n,r){let i={},s={},o={};return e.forEach((t=>{t.forEach(((t,e)=>{i[t]=t,s[t]=t,o[t]=e}))})),e.forEach((t=>{let e=-1;t.forEach((t=>{let u=r(t);if(u.length){u=u.sort(((t,e)=>o[t]-o[e]));let r=(u.length-1)/2;for(let a=Math.floor(r),h=Math.ceil(r);a<=h;++a){let r=u[a];s[t]===t&&e<o[r]&&!As(n,t,r)&&(s[r]=t,s[t]=i[t]=i[r],e=o[r])}}}))})),{root:i,align:s}}function Ns(t,e,n,r,i){let s={},o=function(t,e,n,r){let i=new xs,s=t.graph(),o=function(t,e,n){return(r,i,s)=>{let o,u=r.node(i),a=r.node(s),h=0;if(h+=u.width/2,Object.hasOwn(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":o=-u.width/2;break;case"r":o=u.width/2}if(o&&(h+=n?o:-o),o=0,h+=(u.dummy?e:t)/2,h+=(a.dummy?e:t)/2,h+=a.width/2,Object.hasOwn(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":o=a.width/2;break;case"r":o=-a.width/2}return o&&(h+=n?o:-o),o=0,h}}(s.nodesep,s.edgesep,r);return e.forEach((e=>{let r;e.forEach((e=>{let s=n[e];if(i.setNode(s),r){var u=n[r],a=i.edge(u,s);i.setEdge(u,s,Math.max(o(t,e,r),a||0))}r=e}))})),i}(t,e,n,i),u=i?"borderLeft":"borderRight";function a(t,e){let n=o.nodes(),r=n.pop(),i={};for(;r;)i[r]?t(r):(i[r]=!0,n.push(r),n=n.concat(e(r))),r=n.pop()}return a((function(t){s[t]=o.inEdges(t).reduce(((t,e)=>Math.max(t,s[e.v]+o.edge(e))),0)}),o.predecessors.bind(o)),a((function(e){let n=o.outEdges(e).reduce(((t,e)=>Math.min(t,s[e.w]-o.edge(e))),Number.POSITIVE_INFINITY),r=t.node(e);n!==Number.POSITIVE_INFINITY&&r.borderType!==u&&(s[e]=Math.max(s[e],n))}),o.successors.bind(o)),Object.keys(r).forEach((t=>s[t]=s[n[t]])),s}function js(t,e){return Object.values(e).reduce(((e,n)=>{let r=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;Object.entries(n).forEach((([e,n])=>{let s=function(t,e){return t.node(e).width}(t,e)/2;r=Math.max(n+s,r),i=Math.min(n-s,i)}));const s=r-i;return s<e[0]&&(e=[s,n]),e}),[Number.POSITIVE_INFINITY,null])[1]}function Ts(t,e){let n=Object.values(e),r=Es.applyWithChunking(Math.min,n),i=Es.applyWithChunking(Math.max,n);["u","d"].forEach((n=>{["l","r"].forEach((s=>{let o=n+s,u=t[o];if(u===e)return;let a=Object.values(u),h=r-Es.applyWithChunking(Math.min,a);"l"!==s&&(h=i-Es.applyWithChunking(Math.max,a)),h&&(t[o]=Es.mapValues(u,(t=>t+h)))}))}))}function Is(t,e){return Es.mapValues(t.ul,((n,r)=>{if(e)return t[e.toLowerCase()][r];{let e=Object.values(t).map((t=>t[r])).sort(((t,e)=>t-e));return(e[1]+e[2])/2}}))}let Rs=ei,Ls=Os;let zs=fi,Ps=pi,Ds=Gi,Fs=ei.normalizeRanks,$s=function(t){let e=function(t){let e={},n=0;function r(i){let s=n;t.children(i).forEach(r),e[i]={low:s,lim:n++}}return t.children().forEach(r),e}(t);t.graph().dummyChains.forEach((n=>{let r=t.node(n),i=r.edgeObj,s=function(t,e,n,r){let i,s,o=[],u=[],a=Math.min(e[n].low,e[r].low),h=Math.max(e[n].lim,e[r].lim);i=n;do{i=t.parent(i),o.push(i)}while(i&&(e[i].low>a||h>e[i].lim));s=i,i=r;for(;(i=t.parent(i))!==s;)u.push(i);return{path:o.concat(u.reverse()),lca:s}}(t,e,i.v,i.w),o=s.path,u=s.lca,a=0,h=o[a],l=!0;for(;n!==i.w;){if(r=t.node(n),l){for(;(h=o[a])!==u&&t.node(h).maxRank<r.rank;)a++;h===u&&(l=!1)}if(!l){for(;a<o.length-1&&t.node(h=o[a+1]).minRank<=r.rank;)a++;h=o[a]}t.setParent(n,h),n=t.successors(n)[0]}}))},Ys=ei.removeEmptyRanks,Gs={run:function(t){let e=qi.addDummyNode(t,"root",{},"_root"),n=function(t){var e={};function n(r,i){var s=t.children(r);s&&s.length&&s.forEach((t=>n(t,i+1))),e[r]=i}return t.children().forEach((t=>n(t,1))),e}(t),r=Object.values(n),i=qi.applyWithChunking(Math.max,r)-1,s=2*i+1;t.graph().nestingRoot=e,t.edges().forEach((e=>t.edge(e).minlen*=s));let o=function(t){return t.edges().reduce(((e,n)=>e+t.edge(n).weight),0)}(t)+1;t.children().forEach((r=>Vi(t,e,s,o,i,n,r))),t.graph().nodeRankFactor=s},cleanup:function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,t.edges().forEach((e=>{t.edge(e).nestingEdge&&t.removeEdge(e)}))}},Xs=function(t){t.children().forEach((function e(n){let r=t.children(n),i=t.node(n);if(r.length&&r.forEach(e),Object.hasOwn(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(let e=i.minRank,r=i.maxRank+1;e<r;++e)Hi(t,"borderLeft","_bl",n,i,e),Hi(t,"borderRight","_br",n,i,e)}}))},Bs={adjust:function(t){let e=t.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||Ui(t)},undo:function(t){let e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(t){t.nodes().forEach((e=>Qi(t.node(e)))),t.edges().forEach((e=>{let n=t.edge(e);n.points.forEach(Qi),Object.hasOwn(n,"y")&&Qi(n)}))}(t);"lr"!==e&&"rl"!==e||(!function(t){t.nodes().forEach((e=>Ji(t.node(e)))),t.edges().forEach((e=>{let n=t.edge(e);n.points.forEach(Ji),Object.hasOwn(n,"x")&&Ji(n)}))}(t),Ui(t))}},qs=_s,Vs=function(t){(function(t){let e=Rs.buildLayerMatrix(t),n=t.graph().ranksep,r=0;e.forEach((e=>{const i=e.reduce(((e,n)=>{const r=t.node(n).height;return e>r?e:r}),0);e.forEach((e=>t.node(e).y=r+i/2)),r+=i+n}))})(t=Rs.asNonCompoundGraph(t)),Object.entries(Ls(t)).forEach((([e,n])=>t.node(e).x=n))},Ws=ei,Hs=qr.Graph;var Us=function(t,e){let n=e&&e.debugTiming?Ws.time:Ws.notime;n("layout",(()=>{let r=n(" buildLayoutGraph",(()=>function(t){let e=new Hs({multigraph:!0,compound:!0}),n=so(t.graph());return e.setGraph(Object.assign({},Qs,io(n,Zs),Ws.pick(n,Js))),t.nodes().forEach((n=>{const r=io(so(t.node(n)),Ks);Object.keys(to).forEach((t=>{void 0===r[t]&&(r[t]=to[t])})),e.setNode(n,r),e.setParent(n,t.parent(n))})),t.edges().forEach((n=>{let r=so(t.edge(n));e.setEdge(n,Object.assign({},no,io(r,eo),Ws.pick(r,ro)))})),e}(t)));n(" runLayout",(()=>function(t,e,n){e(" makeSpaceForEdgeLabels",(()=>function(t){let e=t.graph();e.ranksep/=2,t.edges().forEach((n=>{let r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(t))),e(" removeSelfEdges",(()=>function(t){t.edges().forEach((e=>{if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}}))}(t))),e(" acyclic",(()=>zs.run(t))),e(" nestingGraph.run",(()=>Gs.run(t))),e(" rank",(()=>Ds(Ws.asNonCompoundGraph(t)))),e(" injectEdgeLabelProxies",(()=>function(t){t.edges().forEach((e=>{let n=t.edge(e);if(n.width&&n.height){let n=t.node(e.v),r={rank:(t.node(e.w).rank-n.rank)/2+n.rank,e:e};Ws.addDummyNode(t,"edge-proxy",r,"_ep")}}))}(t))),e(" removeEmptyRanks",(()=>Ys(t))),e(" nestingGraph.cleanup",(()=>Gs.cleanup(t))),e(" normalizeRanks",(()=>Fs(t))),e(" assignRankMinMax",(()=>function(t){let e=0;t.nodes().forEach((n=>{let r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=Math.max(e,r.maxRank))})),t.graph().maxRank=e}(t))),e(" removeEdgeLabelProxies",(()=>function(t){t.nodes().forEach((e=>{let n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))}(t))),e(" normalize.run",(()=>Ps.run(t))),e(" parentDummyChains",(()=>$s(t))),e(" addBorderSegments",(()=>Xs(t))),e(" order",(()=>qs(t,n))),e(" insertSelfEdges",(()=>function(t){var e=Ws.buildLayerMatrix(t);e.forEach((e=>{var n=0;e.forEach(((e,r)=>{var i=t.node(e);i.order=r+n,(i.selfEdges||[]).forEach((e=>{Ws.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:r+ ++n,e:e.e,label:e.label},"_se")})),delete i.selfEdges}))}))}(t))),e(" adjustCoordinateSystem",(()=>Bs.adjust(t))),e(" position",(()=>Vs(t))),e(" positionSelfEdges",(()=>function(t){t.nodes().forEach((e=>{var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,s=r.y,o=n.x-i,u=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*o/3,y:s-u},{x:i+5*o/6,y:s-u},{x:i+o,y:s},{x:i+5*o/6,y:s+u},{x:i+2*o/3,y:s+u}],n.label.x=n.x,n.label.y=n.y}}))}(t))),e(" removeBorderNodes",(()=>function(t){t.nodes().forEach((e=>{if(t.children(e).length){let n=t.node(e),r=t.node(n.borderTop),i=t.node(n.borderBottom),s=t.node(n.borderLeft[n.borderLeft.length-1]),o=t.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-s.x),n.height=Math.abs(i.y-r.y),n.x=s.x+n.width/2,n.y=r.y+n.height/2}})),t.nodes().forEach((e=>{"border"===t.node(e).dummy&&t.removeNode(e)}))}(t))),e(" normalize.undo",(()=>Ps.undo(t))),e(" fixupEdgeLabelCoords",(()=>function(t){t.edges().forEach((e=>{let n=t.edge(e);if(Object.hasOwn(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(t))),e(" undoCoordinateSystem",(()=>Bs.undo(t))),e(" translateGraph",(()=>function(t){let e=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,i=0,s=t.graph(),o=s.marginx||0,u=s.marginy||0;function a(t){let s=t.x,o=t.y,u=t.width,a=t.height;e=Math.min(e,s-u/2),n=Math.max(n,s+u/2),r=Math.min(r,o-a/2),i=Math.max(i,o+a/2)}t.nodes().forEach((e=>a(t.node(e)))),t.edges().forEach((e=>{let n=t.edge(e);Object.hasOwn(n,"x")&&a(n)})),e-=o,r-=u,t.nodes().forEach((n=>{let i=t.node(n);i.x-=e,i.y-=r})),t.edges().forEach((n=>{let i=t.edge(n);i.points.forEach((t=>{t.x-=e,t.y-=r})),Object.hasOwn(i,"x")&&(i.x-=e),Object.hasOwn(i,"y")&&(i.y-=r)})),s.width=n-e+o,s.height=i-r+u}(t))),e(" assignNodeIntersects",(()=>function(t){t.edges().forEach((e=>{let n,r,i=t.edge(e),s=t.node(e.v),o=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=o,r=s),i.points.unshift(Ws.intersectRect(s,n)),i.points.push(Ws.intersectRect(o,r))}))}(t))),e(" reversePoints",(()=>function(t){t.edges().forEach((e=>{let n=t.edge(e);n.reversed&&n.points.reverse()}))}(t))),e(" acyclic.undo",(()=>zs.undo(t)))}(r,n,e))),n(" updateInputGraph",(()=>function(t,e){t.nodes().forEach((n=>{let r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,r.rank=i.rank,e.children(n).length&&(r.width=i.width,r.height=i.height))})),t.edges().forEach((n=>{let r=t.edge(n),i=e.edge(n);r.points=i.points,Object.hasOwn(i,"x")&&(r.x=i.x,r.y=i.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,r)))}))};let Zs=["nodesep","edgesep","ranksep","marginx","marginy"],Qs={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Js=["acyclicer","ranker","rankdir","align"],Ks=["width","height"],to={width:0,height:0},eo=["minlen","weight","width","height","labeloffset"],no={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},ro=["labelpos"];function io(t,e){return Ws.mapValues(Ws.pick(t,e),Number)}function so(t){var e={};return t&&Object.entries(t).forEach((([t,n])=>{"string"==typeof t&&(t=t.toLowerCase()),e[t]=n})),e}let oo=ei,uo=qr.Graph;var ao={graphlib:qr,layout:Us,debug:{debugOrdering:function(t){let e=oo.buildLayerMatrix(t),n=new uo({compound:!0,multigraph:!0}).setGraph({});return t.nodes().forEach((e=>{n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank)})),t.edges().forEach((t=>n.setEdge(t.v,t.w,{},t.name))),e.forEach(((t,e)=>{let r="layer"+e;n.setNode(r,{rank:"same"}),t.reduce(((t,e)=>(n.setEdge(t,e,{style:"invis"}),e)))})),n}},util:{time:ei.time,notime:ei.notime},version:"1.1.4"};const ho=(t,e,n)=>{const{x:r,y:i}=t,s=e.x,o=e.y,u=(null==n?void 0:n.x)??r,a=(null==n?void 0:n.y)??i,h=s-r<0?-1:1,l=o-i<0?-1:1;let c=Math.abs(s-r)/2<35?Math.abs(s-r)/2:35;c=Math.abs(o-i)/2<c?Math.abs(o-i)/2:c;const f=Math.abs(s-r)/2-c;return[`M ${u} ${a}`,`L ${u} ${i}`,`L ${r} ${i}`,`L ${r+f*h} ${i}`,`C ${r+f*h+c*h} ${i} ${r+f*h+c*h} ${i} ${r+f*h+c*h} ${i+c*l}`,`L ${r+f*h+c*h} ${o-c*l}`,`C ${r+f*h+c*h} ${o} ${r+f*h+c*h} ${o} ${s-f*h} ${o}`,`L ${s} ${o}`].join(" ")},lo=(t,e,n,r={sy:0})=>{const{x:i}=t;let{y:s}=t;const o=e.x,u=e.y,a=(null==n?void 0:n.x)??i,h=(null==n?void 0:n.y)??s,l=o-i<0?-1:1,c=u-s<0?-1:1;s+=r.sy;let f=Math.abs(o-i)/2<35?Math.abs(o-i)/2:35;f=Math.abs(u-s)/2<f?Math.abs(u-s)/2:f;const d=Math.abs(u-s)/2-f;return[`M ${a} ${h}`,`L ${i} ${h}`,`L ${i} ${s}`,`L ${i} ${s+d*c}`,`C ${i} ${s+d*c+f*c} ${i} ${s+d*c+f*c} ${i+f*l} ${s+d*c+f*c}`,`L ${i+(Math.abs(o-i)-2*f)*l+f*l} ${s+d*c+f*c}`,`C ${o} ${s+d*c+f*c} ${o} ${s+d*c+f*c} ${o} ${u-d*c}`,`L ${o} ${u}`].join(" ")},co={bottom:{calculateEdge:lo,edgeMidX:({node:t})=>t.x,edgeMidY:({node:t})=>t.y+t.height/2,edgeParentX:({parent:t})=>t.x,edgeParentY:({parent:t})=>t.y-t.height/2,edgeX:({node:t})=>t.x,edgeY:({node:t})=>t.y+t.height/2,leafGroupX:({node:t})=>t.x-t.width/2,leafGroupY:({node:t})=>t.y,leafHeight:({childLength:t,childrenSpacing:e,nodeHeight:n})=>(n+e)*t,leafWidth:({nodeWidth:t})=>t,leafX:()=>0,leafY:({childrenSpacing:t,index:e,nodeHeight:n})=>(n+t)*-e},left:{calculateEdge:ho,edgeMidX:({node:t})=>t.x-t.width/2,edgeMidY:({node:t})=>t.y,edgeParentX:({parent:t})=>t.x+t.width/2,edgeParentY:({parent:t})=>t.y,edgeX:({node:t})=>t.x-t.width/2,edgeY:({node:t})=>t.y,leafGroupX:({node:t})=>t.x-t.width/2,leafGroupY:({node:t})=>t.y-t.height/2,leafHeight:({nodeHeight:t})=>t,leafWidth:({childLength:t,nodeWidth:e})=>e*t,leafX:({childrenSpacing:t,index:e,nodeWidth:n})=>(n+t)*e,leafY:()=>0},right:{calculateEdge:ho,edgeMidX:({node:t})=>t.x+t.width/2,edgeMidY:({node:t})=>t.y,edgeParentX:({parent:t})=>t.x-t.width/2,edgeParentY:({parent:t})=>t.y,edgeX:({node:t})=>t.x+t.width/2,edgeY:({node:t})=>t.y,leafGroupX:({node:t})=>t.x,leafGroupY:({node:t})=>t.y-t.height/2,leafHeight:({nodeHeight:t})=>t,leafWidth:({childLength:t,nodeWidth:e})=>e*t,leafX:({childrenSpacing:t,index:e,nodeWidth:n})=>(n+t)*-e,leafY:()=>0},top:{calculateEdge:lo,edgeMidX:({node:t})=>t.x,edgeMidY:({node:t})=>t.y-t.height/2,edgeParentX:({parent:t})=>t.x,edgeParentY:({parent:t})=>t.y+t.height/2,edgeX:({node:t})=>t.x,edgeY:({node:t})=>t.y-t.height/2,leafGroupX:({node:t})=>t.x-t.width/2,leafGroupY:({node:t})=>t.y-t.height/2,leafHeight:({childLength:t,childrenSpacing:e,nodeHeight:n})=>(n+e)*t,leafWidth:({nodeWidth:t})=>t,leafX:()=>0,leafY:({childrenSpacing:t,index:e,nodeHeight:n})=>(n+t)*e}},fo={bottom:"BT",left:"LR",right:"RL",top:"TB"},po={borderColor:"#BCBCBC",borderColorHover:"#5C6BC0",borderRadius:"5px",borderStyle:"solid",borderWidth:1,canvasStyle:"",childrenSpacing:50,containerClassName:"root",contentKey:"name",direction:"top",edgeColor:"#BCBCBC",edgeColorHover:"#5C6BC0",edgeWidth:1,enableExpandCollapse:!1,enableToolbar:!1,enableTooltip:!1,fontColor:"#000000",fontFamily:"",fontSize:"14px",fontWeight:"400",groupLeafNodes:!1,groupLeafNodesSpacing:10,height:"auto",highlightOnHover:!0,nodeBGColor:"#FFFFFF",nodeBGColorHover:"#FFFFFF",nodeClassName:"apextree-node",nodeHeight:30,nodeStyle:"",nodeTemplate:t=>`<div style='display: flex;justify-content: center;align-items: center; text-align: center; height: 100%;'>${t}</div>`,nodeWidth:50,siblingSpacing:50,tooltipBGColor:"#FFFFFF",tooltipBorderColor:"#BCBCBC",tooltipId:"apextree-tooltip-container",tooltipMaxWidth:100,viewPortHeight:600,viewPortWidth:800,width:"100%"},mo=(t,e={})=>{for(const n in e)null==t||t.setAttribute(n,e[n])},go=(t,e,n,r)=>{const i=null==t?void 0:t.options,s=(null==i?void 0:i.borderWidth)||r.borderWidth;let o=(null==i?void 0:i.borderColor)||r.borderColor,u=(null==i?void 0:i.nodeBGColor)||r.nodeBGColor;n&&(o=(null==i?void 0:i.borderColorHover)||r.borderColorHover,u=(null==i?void 0:i.nodeBGColorHover)||r.nodeBGColorHover);const a=document.querySelector(`[data-self='${t.id}'] foreignObject div`);if(a&&!t.id.endsWith("_leafs")&&(a.style.borderWidth=`${s}px`,a.style.borderColor=o,a.style.backgroundColor=u),t.parent){const i=document.getElementById(`${t.parent}-${t.id}`);mo(i,n?{stroke:r.edgeColorHover,"stroke-width":r.edgeWidth+1}:{stroke:r.edgeColor,"stroke-width":r.edgeWidth}),t.parent&&go(e[t.parent],e,n,r)}};function yo(t,e,n){const{children:r,...i}=t,s={...i,children:r?r.map((t=>t.id)):[],parent:e?e.id:void 0};if(n[s.id]=s,null==r?void 0:r.length)for(const o of r)yo(o,s,n)}function _o(t){const e={};return yo(t,void 0,e),e}const vo={},wo=[];function bo(t,e){if(Array.isArray(t))for(const n of t)bo(n,e);else if("object"!=typeof t)Eo(Object.getOwnPropertyNames(e)),vo[t]=Object.assign(vo[t]||{},e);else for(const n in t)bo(n,t[n])}function xo(t){return vo[t]||{}}function Eo(t){wo.push(...t)}function Oo(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)i.push(e(t[n]));return i}function Mo(t){return t%360*Math.PI/180}function ko(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Co(t,e,n,r){return null!=e&&null!=n||(r=r||t.bbox(),null==e?e=r.width/r.height*n:null==n&&(n=r.height/r.width*e)),{width:e,height:n}}function Ao(t,e){const n=t.origin;let r=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([r,i]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const s="string"==typeof r,o="string"==typeof i;if(s||o){const{height:t,width:n,x:u,y:a}=e.bbox();s&&(r=r.includes("left")?u:r.includes("right")?u+n:u+n/2),o&&(i=i.includes("top")?a:i.includes("bottom")?a+t:a+t/2)}return[r,i]}const So=new Set(["desc","metadata","title"]),No=t=>So.has(t.nodeName),jo=(t,e,n={})=>{const r={...e};for(const i in r)r[i].valueOf()===n[i]&&delete r[i];Object.keys(r).length?t.node.setAttribute("data-svgjs",JSON.stringify(r)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))},To="http://www.w3.org/2000/svg",Io="http://www.w3.org/2000/xmlns/",Ro="http://www.w3.org/1999/xlink",Lo={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class zo{}const Po={},Do="___SYMBOL___ROOT___";function Fo(t,e=To){return Lo.document.createElementNS(e,t)}function $o(t,e=!1){if(t instanceof zo)return t;if("object"==typeof t)return Xo(t);if(null==t)return new Po[Do];if("string"==typeof t&&"<"!==t.charAt(0))return Xo(Lo.document.querySelector(t));const n=e?Lo.document.createElement("div"):Fo("svg");return n.innerHTML=t,t=Xo(n.firstChild),n.removeChild(n.firstChild),t}function Yo(t,e){return e&&(e instanceof Lo.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:Fo(t)}function Go(t){if(!t)return null;if(t.instance instanceof zo)return t.instance;if("#document-fragment"===t.nodeName)return new Po.Fragment(t);let e=ko(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":Po[e]||(e="Dom"),new Po[e](t)}let Xo=Go;function Bo(t,e=t.name,n=!1){return Po[e]=t,n&&(Po[Do]=t),Eo(Object.getOwnPropertyNames(t.prototype)),t}let qo=1e3;function Vo(t){return"Svgjs"+ko(t)+qo++}function Wo(t){for(let e=t.children.length-1;e>=0;e--)Wo(t.children[e]);return t.id?(t.id=Vo(t.nodeName),t):t}function Ho(t,e){let n,r;for(r=(t=Array.isArray(t)?t:[t]).length-1;r>=0;r--)for(n in e)t[r].prototype[n]=e[n]}function Uo(t){return function(...e){const n=e[e.length-1];return!n||n.constructor!==Object||n instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(n)}}bo("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=$o(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=$o(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=$o(t)).before(this),this},insertAfter:function(t){return(t=$o(t)).after(this),this}});const Zo=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,Qo=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Jo=/rgb\((\d+),(\d+),(\d+)\)/,Ko=/(#[a-z_][a-z0-9\-_]*)/i,tu=/\)\s*,?\s*/,eu=/\s/g,nu=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,ru=/^rgb\(/,iu=/^(\s+)?$/,su=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ou=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,uu=/[\s,]+/,au=/[MLHVCSQTAZ]/i;function hu(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function lu(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function cu(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}bo("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(uu)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),bo("Dom",{css:function(t,e){const n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);n[e[0]]=e[1]})),n;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=e;n[e]=this.node.style.getPropertyValue(t)}return n}if("string"==typeof t)return this.node.style.getPropertyValue(t);if("object"==typeof t)for(const e in t)this.node.style.setProperty(e,null==t[e]||iu.test(t[e])?"":t[e])}return 2===arguments.length&&this.node.style.setProperty(t,null==e||iu.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),bo("Dom",{data:function(t,e,n){if(null==t)return this.data(Oo(function(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)e(t[n])&&i.push(t[n]);return i}(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const n of t)e[n]=this.data(n);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(r){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===n||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),bo("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const n in t)this.remember(n,t[n]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class fu{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof fu||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e){const{random:n,round:r,sin:i,PI:s}=Math;if("vibrant"===t){const t=24*n()+57,e=38*n()+45,r=360*n();return new fu(t,e,r,"lch")}if("sine"===t){const t=r(80*i(2*s*(e=null==e?n():e)/.5+.01)+150),o=r(50*i(2*s*e/.5+4.6)+200),u=r(100*i(2*s*e/.5+2.3)+150);return new fu(t,o,u)}if("pastel"===t){const t=8*n()+86,e=17*n()+9,r=360*n();return new fu(t,e,r,"lch")}if("dark"===t){const t=10+10*n(),e=50*n()+86,r=360*n();return new fu(t,e,r,"lch")}if("rgb"===t){const t=255*n(),e=255*n(),r=255*n();return new fu(t,e,r)}if("lab"===t){const t=100*n(),e=256*n()-128,r=256*n()-128;return new fu(t,e,r,"lab")}if("grey"===t){const t=255*n();return new fu(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(nu.test(t)||ru.test(t))}cmyk(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.min(1-r,1-i,1-s);if(1===o)return new fu(0,0,0,1,"cmyk");return new fu((1-r-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.max(r,i,s),u=Math.min(r,i,s),a=(o+u)/2,h=o===u,l=o-u;return new fu(360*(h?0:o===r?((i-s)/l+(i<s?6:0))/6:o===i?((s-r)/l+2)/6:o===s?((r-i)/l+4)/6:0),100*(h?0:a>.5?l/(2-o-u):l/(o+u)),100*a,"hsl")}init(t=0,e=0,n=0,r=0,i="rgb"){if(t=t||0,this.space)for(const c in this.space)delete this[this.space[c]];if("number"==typeof t)i="string"==typeof r?r:i,r="string"==typeof r?0:r,Object.assign(this,{_a:t,_b:e,_c:n,_d:r,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const n=function(t,e){const n=lu(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:lu(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:lu(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:lu(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:lu(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:lu(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return n.space=e||n.space,n}(t,e);Object.assign(this,n)}else if("string"==typeof t)if(ru.test(t)){const e=t.replace(eu,""),[n,r,i]=Jo.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}else{if(!nu.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,r,i]=Qo.exec((s=t,4===s.length?["#",s.substring(1,2),s.substring(1,2),s.substring(2,3),s.substring(2,3),s.substring(3,4),s.substring(3,4)].join(""):s)).map(e);Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}}var s;const{_a:o,_b:u,_c:a,_d:h}=this,l="rgb"===this.space?{r:o,g:u,b:a}:"xyz"===this.space?{x:o,y:u,z:a}:"hsl"===this.space?{h:o,s:u,l:a}:"lab"===this.space?{l:o,a:u,b:a}:"lch"===this.space?{l:o,c:u,h:a}:"cmyk"===this.space?{c:o,m:u,y:a,k:h}:{};Object.assign(this,l)}lab(){const{x:t,y:e,z:n}=this.xyz();return new fu(116*e-16,500*(t-e),200*(e-n),"lab")}lch(){const{l:t,a:e,b:n}=this.lab(),r=Math.sqrt(e**2+n**2);let i=180*Math.atan2(n,e)/Math.PI;i<0&&(i*=-1,i=360-i);return new fu(t,r,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:n}=this;if("lab"===this.space||"lch"===this.space){let{l:r,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;i=t*Math.cos(n*e),s=t*Math.sin(n*e)}const o=(r+16)/116,u=i/500+o,a=o-s/200,h=16/116,l=.008856,c=7.787;t=.95047*(u**3>l?u**3:(u-h)/c),e=1*(o**3>l?o**3:(o-h)/c),n=1.08883*(a**3>l?a**3:(a-h)/c)}const r=3.2406*t+-1.5372*e+-.4986*n,i=-.9689*t+1.8758*e+.0415*n,s=.0557*t+-.204*e+1.057*n,o=Math.pow,u=.0031308,a=r>u?1.055*o(r,1/2.4)-.055:12.92*r,h=i>u?1.055*o(i,1/2.4)-.055:12.92*i,l=s>u?1.055*o(s,1/2.4)-.055:12.92*s;return new fu(255*a,255*h,255*l)}if("hsl"===this.space){let{h:t,s:e,l:n}=this;if(t/=360,e/=100,n/=100,0===e){n*=255;return new fu(n,n,n)}const r=n<.5?n*(1+e):n+e-n*e,i=2*n-r,s=255*cu(i,r,t+1/3),o=255*cu(i,r,t),u=255*cu(i,r,t-1/3);return new fu(s,o,u)}if("cmyk"===this.space){const{c:t,m:e,y:n,k:r}=this,i=255*(1-Math.min(1,t*(1-r)+r)),s=255*(1-Math.min(1,e*(1-r)+r)),o=255*(1-Math.min(1,n*(1-r)+r));return new fu(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:n,_d:r,space:i}=this;return[t,e,n,r,i]}toHex(){const[t,e,n]=this._clamped().map(hu);return`#${t}${e}${n}`}toRgb(){const[t,e,n]=this._clamped();return`rgb(${t},${e},${n})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,u=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,a=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,h=(.4124*o+.3576*u+.1805*a)/.95047,l=(.2126*o+.7152*u+.0722*a)/1,c=(.0193*o+.1192*u+.9505*a)/1.08883,f=h>.008856?Math.pow(h,1/3):7.787*h+16/116,d=l>.008856?Math.pow(l,1/3):7.787*l+16/116,p=c>.008856?Math.pow(c,1/3):7.787*c+16/116;return new fu(f,d,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:r,min:i,round:s}=Math;return[t,e,n].map((t=>r(0,i(s(t),255))))}}class du{constructor(...t){this.init(...t)}clone(){return new du(this)}init(t,e){const n=0,r=0,i=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==i.x?n:i.x,this.y=null==i.y?r:i.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){mu.isMatrixLike(t)||(t=new mu(t));const{x:e,y:n}=this;return this.x=t.a*e+t.c*n+t.e,this.y=t.b*e+t.d*n+t.f,this}}function pu(t,e,n){return Math.abs(e-t)<1e-6}class mu{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,n=t.flip&&(e||"x"===t.flip)?-1:1,r=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleX)?t.scaleX*n:n,u=t.scale&&t.scale.length?t.scale[1]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleY)?t.scaleY*r:r,a=t.shear||0,h=t.rotate||t.theta||0,l=new du(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=l.x,f=l.y,d=new du(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=d.x,m=d.y,g=new du(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,_=g.y,v=new du(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:u,skewX:i,skewY:s,shear:a,theta:h,rx:v.x,ry:v.y,tx:y,ty:_,ox:c,oy:f,px:p,py:m}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,n){const r=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,u=t.e+t.a*e.e+t.c*e.f,a=t.f+t.b*e.e+t.d*e.f;return n.a=r,n.b=i,n.c=s,n.d=o,n.e=u,n.f=a,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const r=t||0,i=e||0;return this.translateO(-r,-i).lmultiplyO(n).translateO(r,i)}clone(){return new mu(this)}decompose(t=0,e=0){const n=this.a,r=this.b,i=this.c,s=this.d,o=this.e,u=this.f,a=n*s-r*i,h=a>0?1:-1,l=h*Math.sqrt(n*n+r*r),c=Math.atan2(h*r,h*n),f=180/Math.PI*c,d=Math.cos(c),p=Math.sin(c),m=(n*i+r*s)/a,g=i*l/(m*n-r)||s*l/(m*r+n);return{scaleX:l,scaleY:g,shear:m,rotate:f,translateX:o-t+t*d*l+e*(m*d*l-p*g),translateY:u-e+t*p*l+e*(m*p*l+d*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new mu(t);return pu(this.a,e.a)&&pu(this.b,e.b)&&pu(this.c,e.c)&&pu(this.d,e.d)&&pu(this.e,e.e)&&pu(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=mu.fromArray([1,0,0,1,0,0]);return t=t instanceof $u?t.matrixify():"string"==typeof t?mu.fromArray(t.split(uu).map(parseFloat)):Array.isArray(t)?mu.fromArray(t):"object"==typeof t&&mu.isMatrixLike(t)?t:"object"==typeof t?(new mu).transform(t):6===arguments.length?mu.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,n=this.c,r=this.d,i=this.e,s=this.f,o=t*r-e*n;if(!o)throw new Error("Cannot invert "+this);const u=r/o,a=-e/o,h=-n/o,l=t/o,c=-(u*i+h*s),f=-(a*i+l*s);return this.a=u,this.b=a,this.c=h,this.d=l,this.e=c,this.f=f,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof mu?t:new mu(t);return mu.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof mu?t:new mu(t);return mu.matrixMultiply(this,e,this)}rotate(t,e,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=Mo(t);const r=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:u,d:a,e:h,f:l}=this;return this.a=s*r-o*i,this.b=o*r+s*i,this.c=u*r-a*i,this.d=a*r+u*i,this.e=h*r-l*i+n*i-e*r+e,this.f=l*r+h*i-e*i-n*r+n,this}scale(){return this.clone().scaleO(...arguments)}scaleO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t);const{a:i,b:s,c:o,d:u,e:a,f:h}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=u*e,this.e=a*t-n*t+n,this.f=h*e-r*e+r,this}shear(t,e,n){return this.clone().shearO(t,e,n)}shearO(t,e=0,n=0){const{a:r,b:i,c:s,d:o,e:u,f:a}=this;return this.a=r+i*t,this.c=s+o*t,this.e=u+a*t-n*t,this}skew(){return this.clone().skewO(...arguments)}skewO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t),t=Mo(t),e=Mo(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:u,c:a,d:h,e:l,f:c}=this;return this.a=o+u*i,this.b=u+o*s,this.c=a+h*i,this.d=h+a*s,this.e=l+c*i-r*i,this.f=c+l*s-n*s,this}skewX(t,e,n){return this.skew(t,0,e,n)}skewY(t,e,n){return this.skew(0,t,e,n)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(mu.isMatrixLike(t)){return new mu(t).multiplyO(this)}const e=mu.formatTransforms(t),{x:n,y:r}=new du(e.ox,e.oy).transform(this),i=(new mu).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-n,-r).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(n,r);if(isFinite(e.px)||isFinite(e.py)){const t=new du(n,r).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function gu(){if(!gu.nodes){const t=$o().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;gu.nodes={svg:t,path:e}}if(!gu.nodes.svg.node.parentNode){const t=Lo.document.body||Lo.document.documentElement;gu.nodes.svg.addTo(t)}return gu.nodes}function yu(t){return!(t.width||t.height||t.x||t.y)}Bo(mu,"Matrix");class _u{constructor(...t){this.init(...t)}addOffset(){return this.x+=Lo.window.pageXOffset,this.y+=Lo.window.pageYOffset,new _u(this)}init(t){return t="string"==typeof t?t.split(uu).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return yu(this)}merge(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),r=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-n;return new _u(e,n,r,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof mu||(t=new mu(t));let e=1/0,n=-1/0,r=1/0,i=-1/0;return[new du(this.x,this.y),new du(this.x2,this.y),new du(this.x,this.y2),new du(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),n=Math.max(n,s.x),r=Math.min(r,s.y),i=Math.max(i,s.y)})),new _u(e,r,n-e,i-r)}}function vu(t,e,n){let r;try{if(r=e(t.node),yu(r)&&((i=t.node)!==Lo.document&&!(Lo.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===Lo.document}).call(Lo.document.documentElement,i)))throw new Error("Element not in the dom")}catch(s){r=n(t)}var i;return r}bo({viewbox:{viewbox(t,e,n,r){return null==t?new _u(this.attr("viewBox")):this.attr("viewBox",new _u(t,e,n,r))},zoom(t,e){let{width:n,height:r}=this.attr(["width","height"]);if((n||r)&&"string"!=typeof n&&"string"!=typeof r||(n=this.node.clientWidth,r=this.node.clientHeight),!n||!r)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=n/i.width,o=r/i.height,u=Math.min(s,o);if(null==t)return u;let a=u/t;a===1/0&&(a=Number.MAX_SAFE_INTEGER/100),e=e||new du(n/2/s+i.x,r/2/o+i.y);const h=new _u(i).transform(new mu({scale:a,origin:e}));return this.viewbox(h)}}}),Bo(_u,"Box");class wu extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}Ho([wu],{each(t,...e){return"function"==typeof t?this.map(((e,n,r)=>t.call(e,e,n,r))):this.map((n=>n[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const bu=["toArray","constructor","each"];function xu(t,e){return new wu(Oo((e||Lo.document).querySelectorAll(t),(function(t){return Go(t)})))}wu.extend=function(t){t=t.reduce(((t,e)=>(bu.includes(e)||"_"===e[0]||(e in Array.prototype&&(t["$"+e]=Array.prototype[e]),t[e]=function(...t){return this.each(e,...t)}),t)),{}),Ho([wu],t)};let Eu=0;const Ou={};function Mu(t){let e=t.getEventHolder();return e===Lo.window&&(e=Ou),e.events||(e.events={}),e.events}function ku(t){return t.getEventTarget()}function Cu(t,e,n,r,i){const s=n.bind(r||t),o=$o(t),u=Mu(o),a=ku(o);e=Array.isArray(e)?e:e.split(uu),n._svgjsListenerId||(n._svgjsListenerId=++Eu),e.forEach((function(t){const e=t.split(".")[0],r=t.split(".")[1]||"*";u[e]=u[e]||{},u[e][r]=u[e][r]||{},u[e][r][n._svgjsListenerId]=s,a.addEventListener(e,s,i||!1)}))}function Au(t,e,n,r){const i=$o(t),s=Mu(i),o=ku(i);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(uu)).forEach((function(t){const e=t&&t.split(".")[0],u=t&&t.split(".")[1];let a,h;if(n)s[e]&&s[e][u||"*"]&&(o.removeEventListener(e,s[e][u||"*"][n],r||!1),delete s[e][u||"*"][n]);else if(e&&u){if(s[e]&&s[e][u]){for(h in s[e][u])Au(o,[e,u].join("."),h);delete s[e][u]}}else if(u)for(t in s)for(a in s[t])u===a&&Au(o,[t,u].join("."));else if(e){if(s[e]){for(a in s[e])Au(o,[e,a].join("."));delete s[e]}}else{for(t in s)Au(o,t);!function(t){let e=t.getEventHolder();e===Lo.window&&(e=Ou),e.events&&(e.events={})}(i)}}))}class Su extends zo{addEventListener(){}dispatch(t,e,n){return function(t,e,n,r){const i=ku(t);return e instanceof Lo.window.Event||(e=new Lo.window.CustomEvent(e,{detail:n,cancelable:!0,...r})),i.dispatchEvent(e),e}(this,t,e,n)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const n=e[t.type];for(const r in n)for(const e in n[r])n[r][e](t);return!t.defaultPrevented}fire(t,e,n){return this.dispatch(t,e,n),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,n){return Au(this,t,e,n),this}on(t,e,n,r){return Cu(this,t,e,n,r),this}removeEventListener(){}}function Nu(){}Bo(Su,"EventTarget");const ju=400,Tu=">",Iu=0,Ru={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};class Lu extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(uu).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class zu{constructor(...t){this.init(...t)}convert(t){return new zu(this.value,t)}divide(t){return t=new zu(t),new zu(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(Zo))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof zu&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new zu(t),new zu(this-t,this.unit||t.unit)}plus(t){return t=new zu(t),new zu(this+t,this.unit||t.unit)}times(t){return t=new zu(t),new zu(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const Pu=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),Du=[];class Fu extends Su{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=$o(t)).removeNamespace&&this.node instanceof Lo.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return $o(t).put(this,e)}children(){return new wu(Oo(this.node.children,(function(t){return Go(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let n=this.node.cloneNode(t);return e&&(n=Wo(n)),new this.constructor(n)}each(t,e){const n=this.children();let r,i;for(r=0,i=n.length;r<i;r++)t.apply(n[r],[r,n]),e&&n[r].each(t,e);return this}element(t,e){return this.put(new Fu(Fo(t),e))}first(){return Go(this.node.firstChild)}get(t){return Go(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}html(t,e){return this.xml(t,e,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=Vo(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return Go(this.node.lastChild)}matches(t){const e=this.node,n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=Go(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=Go(e.node.parentNode));return e}put(t,e){return t=$o(t),this.add(t,e),t}putIn(t,e){return $o(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=$o(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const n=10**t,r=this.attr(e);for(const i in r)"number"==typeof r[i]&&(r[i]=Math.round(r[i]*n)/n);return this.attr(r),this}svg(t,e){return this.xml(t,e,To)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const n=e.index(this);return e.put(t,n).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let n=this;if(null!=t){if(n=Go(n.node.cloneNode(!0)),e){const e=t(n);if(n=e||n,!1===e)return""}n.each((function(){const e=t(this),n=e||this;!1===e?this.remove():e&&this!==n&&this.replace(n)}),!0)}return e?n.node.outerHTML:n.node.innerHTML}e=null!=e&&e;const r=Fo("wrapper",n),i=Lo.document.createDocumentFragment();r.innerHTML=t;for(let o=r.children.length;o--;)i.appendChild(r.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}Ho(Fu,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=su.test(n.nodeValue)?parseFloat(n.nodeValue):n.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?Ru[t]:su.test(e)?parseFloat(e):e;"number"==typeof(e=Du.reduce(((e,n)=>n(t,e,this)),e))?e=new zu(e):Pu.has(t)&&fu.isColor(e)?e=new fu(e):e.constructor===Array&&(e=new Lu(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof n?this.node.setAttributeNS(n,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return xu(t,this.node)},findOne:function(t){return Go(this.node.querySelector(t))}}),Bo(Fu,"Dom");class $u extends Fu{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,(t.hasAttribute("data-svgjs")||t.hasAttribute("svgjs:data"))&&this.setData(JSON.parse(t.getAttribute("data-svgjs"))??JSON.parse(t.getAttribute("svgjs:data"))??{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new zu(t).plus(this.x()))}dy(t=0){return this.y(new zu(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){const e="string"==typeof t;e||(t=$o(t));const n=new wu;let r=this;for(;(r=r.parent())&&r.node!==Lo.document&&"#document-fragment"!==r.nodeName&&(n.push(r),e||r.node!==t.node)&&(!e||!r.matches(t));)if(r.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(Ko);return e?$o(e[1]):null}root(){const t=this.parent(Po[Do]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=Co(this,t,e);return this.width(new zu(n.width)).height(new zu(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return jo(this,this.dom),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}Ho($u,{bbox:function(){const t=vu(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(gu().svg).show(),n=e.node.getBBox();return e.remove(),n}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new _u(t)},rbox:function(t){const e=vu(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new _u(e);return t?n.transform(t.screenCTM().inverseO()):n.addOffset()},inside:function(t,e){const n=this.bbox();return t>n.x&&e>n.y&&t<n.x+n.width&&e<n.y+n.height},point:function(t,e){return new du(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new mu(this.node.getCTM())},screenCTM:function(){try{if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new mu(e)}return new mu(this.node.getScreenCTM())}catch(t){return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new mu}}}),Bo($u,"Element");const Yu={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let n;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof fu||fu.isRgb(e)||e instanceof $u)this.attr(t,e);else for(n=Yu[t].length-1;n>=0;n--)null!=e[Yu[t][n]]&&this.attr(Yu.prefix(t,Yu[t][n]),e[Yu[t][n]]);return this},bo(["Element","Runner"],e)})),bo(["Element","Runner"],{matrix:function(t,e,n,r,i,s){return null==t?new mu(this):this.attr("transform",new mu(t,e,n,r,i,s))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:r},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:r},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),bo("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new zu(t)):this.rx(t).ry(e)}}),bo("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new du(this.node.getPointAtLength(t))}}),bo(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}});bo("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),bo("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(tu).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(uu).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(mu.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new mu)},toParent:function(t,e){if(this===t)return this;if(No(this.node))return this.addTo(t,e);const n=this.screenCTM(),r=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(r.multiply(n)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new mu(this).decompose();return null==t?e:e[t]}mu.isMatrixLike(t)||(t={...t,origin:Ao(t,this)});const n=new mu(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});class Gu extends $u{flatten(){return this.each((function(){if(this instanceof Gu)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(n,r){return r[r.length-n-1].toParent(t,e)})),this.remove()}}Bo(Gu,"Container");class Xu extends Gu{constructor(t,e=t){super(Yo("defs",t),e)}flatten(){return this}ungroup(){return this}}Bo(Xu,"Defs");class Bu extends $u{}function qu(t){return this.attr("rx",t)}function Vu(t){return this.attr("ry",t)}function Wu(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Hu(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Uu(t){return this.attr("cx",t)}function Zu(t){return this.attr("cy",t)}function Qu(t){return null==t?2*this.rx():this.rx(new zu(t).divide(2))}function Ju(t){return null==t?2*this.ry():this.ry(new zu(t).divide(2))}Bo(Bu,"Shape");const Ku=Object.freeze(Object.defineProperty({__proto__:null,cx:Uu,cy:Zu,height:Ju,rx:qu,ry:Vu,width:Qu,x:Wu,y:Hu},Symbol.toStringTag,{value:"Module"}));class ta extends Bu{constructor(t,e=t){super(Yo("ellipse",t),e)}size(t,e){const n=Co(this,t,e);return this.rx(new zu(n.width).divide(2)).ry(new zu(n.height).divide(2))}}Ho(ta,Ku),bo("Container",{ellipse:Uo((function(t=0,e=t){return this.put(new ta).size(t,e).move(0,0)}))}),Bo(ta,"Ellipse");class ea extends Fu{constructor(t=Lo.document.createDocumentFragment()){super(t)}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){const t=new Fu(Fo("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}}function na(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new zu(t),fy:new zu(e)}):this.attr({x1:new zu(t),y1:new zu(e)})}function ra(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new zu(t),cy:new zu(e)}):this.attr({x2:new zu(t),y2:new zu(e)})}Bo(ea,"Fragment");const ia=Object.freeze(Object.defineProperty({__proto__:null,from:na,to:ra},Symbol.toStringTag,{value:"Module"}));class sa extends Gu{constructor(t,e){super(Yo(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,n){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,n)}bbox(){return new _u}targets(){return xu("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}Ho(sa,ia),bo({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:Uo((function(t,e){return this.put(new sa(t)).update(e)}))}}),Bo(sa,"Gradient");class oa extends Gu{constructor(t,e=t){super(Yo("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new _u}targets(){return xu("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}bo({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:Uo((function(t,e,n){return this.put(new oa).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),Bo(oa,"Pattern");let ua=class extends Bu{constructor(t,e=t){super(Yo("image",t),e)}load(t,e){if(!t)return this;const n=new Lo.window.Image;return Cu(n,"load",(function(t){const r=this.parent(oa);0===this.width()&&0===this.height()&&this.size(n.width,n.height),r instanceof oa&&0===r.width()&&0===r.height()&&r.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),Cu(n,"load error",(function(){Au(n)})),this.attr("href",n.src=t,Ro)}};!function(t){Du.push(t)}((function(t,e,n){return"fill"!==t&&"stroke"!==t||ou.test(e)&&(e=n.root().defs().image(e)),e instanceof ua&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e})),bo({Container:{image:Uo((function(t,e){return this.put(new ua).size(0,0).load(t,e)}))}}),Bo(ua,"Image");class aa extends Lu{bbox(){let t=-1/0,e=-1/0,n=1/0,r=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),n=Math.min(i[0],n),r=Math.min(i[1],r)})),new _u(n,r,t-n,e-r)}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(uu).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,r=t.length;n<r;n+=2)e.push([t[n],t[n+1]]);return e}size(t,e){let n;const r=this.bbox();for(n=this.length-1;n>=0;n--)r.width&&(this[n][0]=(this[n][0]-r.x)*t/r.width+r.x),r.height&&(this[n][1]=(this[n][1]-r.y)*e/r.height+r.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,n=this.length;e<n;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){mu.isMatrixLike(t)||(t=new mu(t));for(let e=this.length;e--;){const[n,r]=this[e];this[e][0]=t.a*n+t.c*r+t.e,this[e][1]=t.b*n+t.d*r+t.f}return this}}const ha=aa;const la=Object.freeze(Object.defineProperty({__proto__:null,MorphArray:ha,height:function(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)},width:function(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)},x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}},Symbol.toStringTag,{value:"Module"}));class ca extends Bu{constructor(t,e=t){super(Yo("line",t),e)}array(){return new aa([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,n,r){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:r}:new aa(t).toLine(),this.attr(t))}size(t,e){const n=Co(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}}Ho(ca,la),bo({Container:{line:Uo((function(...t){return ca.prototype.plot.apply(this.put(new ca),null!=t[0]?t:[0,0,0,0])}))}}),Bo(ca,"Line");class fa extends Gu{constructor(t,e=t){super(Yo("marker",t),e)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}}function da(t,e){return function(n){return null==n?this[t]:(this[t]=n,e&&e.call(this),this)}}bo({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:Uo((function(t,e,n){return this.put(new fa).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}))},marker:{marker(t,e,n,r){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof fa?arguments[1]:this.defs().marker(e,n,r),this.attr(i,t)}}}),Bo(fa,"Marker");const pa={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,n,r){return function(i){return i<0?t>0?e/t*i:n>0?r/n*i:0:i>1?n<1?(1-r)/(1-n)*i+(r-n)/(1-n):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*r+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(r,i=!1)=>{let s=Math.floor(r*t);const o=r*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,r>=0&&s<0&&(s=0),r<=1&&s>n&&(s=n),s/n}}};class ma{done(){return!1}}class ga extends ma{constructor(t=Tu){super(),this.ease=pa[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}class ya extends ma{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,r){return this.stepper(t,e,n,r)}}function _a(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,r=Math.log(e/100+1e-10),i=-r/Math.sqrt(n*n+r*r),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}Ho(class extends ya{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;n>100&&(n=16),n/=1e3;const i=r.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*n+s*n*n/2;return r.velocity=i+s*n,r.done=Math.abs(e-o)+Math.abs(i)<.002,r.done?e:o}},{duration:da("_duration",_a),overshoot:da("_overshoot",_a)});Ho(class extends ya{constructor(t=.1,e=.01,n=0,r=1e3){super(),this.p(t).i(e).d(n).windup(r)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;const i=e-t;let s=(r.integral||0)+i*n;const o=(i-(r.error||0))/n,u=this._windup;return!1!==u&&(s=Math.max(-u,Math.min(s,u))),r.error=i,r.integral=s,r.done=Math.abs(i)<.001,r.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:da("_windup"),p:da("P"),i:da("I"),d:da("D")});const va={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},wa={M:function(t,e,n){return e.x=n.x=t[0],e.y=n.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,n){return e.x=n.x,e.y=n.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},ba="mlhvqtcsaz".split("");for(let wh=0,bh=ba.length;wh<bh;++wh)wa[ba[wh]]=function(t){return function(e,n,r){if("H"===t)e[0]=e[0]+n.x;else if("V"===t)e[0]=e[0]+n.y;else if("A"===t)e[5]=e[5]+n.x,e[6]=e[6]+n.y;else for(let t=0,i=e.length;t<i;++t)e[t]=e[t]+(t%2?n.y:n.x);return wa[t](e,n,r)}}(ba[wh].toUpperCase());function xa(t){return t.segment.length&&t.segment.length-1===va[t.segment[0].toUpperCase()]}function Ea(t,e){t.inNumber&&Oa(t,!1);const n=au.test(e);if(n)t.segment=[e];else{const e=t.lastCommand,n=e.toLowerCase(),r=e===n;t.segment=["m"===n?r?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],n}function Oa(t,e){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=e,t.number="",t.pointSeen=!1,t.hasExponent=!1,xa(t)&&Ma(t)}function Ma(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return wa[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function ka(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),n=t.segment.length;return e&&(4===n||5===n)}function Ca(t){return"E"===t.lastToken.toUpperCase()}const Aa=new Set([" ",",","\t","\n","\r","\f"]);class Sa extends Lu{bbox(){return gu().path.setAttribute("d",this.toString()),new _u(gu.nodes.path.getBBox())}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let r,i=this.length-1;i>=0;i--)r=this[i][0],"M"===r||"L"===r||"T"===r?(this[i][1]+=t,this[i][2]+=e):"H"===r?this[i][1]+=t:"V"===r?this[i][1]+=e:"C"===r||"S"===r||"Q"===r?(this[i][1]+=t,this[i][2]+=e,this[i][3]+=t,this[i][4]+=e,"C"===r&&(this[i][5]+=t,this[i][6]+=e)):"A"===r&&(this[i][6]+=t,this[i][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let n=0,r="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new du,p:new du};for(;i.lastToken=r,r=t.charAt(n++);)if(i.inSegment||!Ea(i,r))if("."!==r)if(isNaN(parseInt(r)))if(Aa.has(r))i.inNumber&&Oa(i,!1);else if("-"!==r&&"+"!==r)if("E"!==r.toUpperCase()){if(au.test(r)){if(i.inNumber)Oa(i,!1);else{if(!xa(i))throw new Error("parser Error");Ma(i)}--n}}else i.number+=r,i.hasExponent=!0;else{if(i.inNumber&&!Ca(i)){Oa(i,!1),--n;continue}i.number+=r,i.inNumber=!0}else{if("0"===i.number||ka(i)){i.inNumber=!0,i.number=r,Oa(i,!0);continue}i.inNumber=!0,i.number+=r}else{if(i.pointSeen||i.hasExponent){Oa(i,!1),--n;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=r}return i.inNumber&&Oa(i,!1),i.inSegment&&xa(i)&&Ma(i),i.segments}(t)}size(t,e){const n=this.bbox();let r,i;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,r=this.length-1;r>=0;r--)i=this[r][0],"M"===i||"L"===i||"T"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y):"H"===i?this[r][1]=(this[r][1]-n.x)*t/n.width+n.x:"V"===i?this[r][1]=(this[r][1]-n.y)*e/n.height+n.y:"C"===i||"S"===i||"Q"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y,this[r][3]=(this[r][3]-n.x)*t/n.width+n.x,this[r][4]=(this[r][4]-n.y)*e/n.height+n.y,"C"===i&&(this[r][5]=(this[r][5]-n.x)*t/n.width+n.x,this[r][6]=(this[r][6]-n.y)*e/n.height+n.y)):"A"===i&&(this[r][1]=this[r][1]*t/n.width,this[r][2]=this[r][2]*e/n.height,this[r][6]=(this[r][6]-n.x)*t/n.width+n.x,this[r][7]=(this[r][7]-n.y)*e/n.height+n.y);return this}toString(){return function(t){let e="";for(let n=0,r=t.length;n<r;n++)e+=t[n][0],null!=t[n][1]&&(e+=t[n][1],null!=t[n][2]&&(e+=" ",e+=t[n][2],null!=t[n][3]&&(e+=" ",e+=t[n][3],e+=" ",e+=t[n][4],null!=t[n][5]&&(e+=" ",e+=t[n][5],e+=" ",e+=t[n][6],null!=t[n][7]&&(e+=" ",e+=t[n][7])))));return e+" "}(this)}}const Na=t=>{const e=typeof t;return"number"===e?zu:"string"===e?fu.isColor(t)?fu:uu.test(t)?au.test(t)?Sa:Lu:Zo.test(t)?zu:Ta:za.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?Lu:"object"===e?La:Ta};class ja{constructor(t){this._stepper=t||new ga("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(Na(t));let e=new this._type(t);return this._type===fu&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===La&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class Ta{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class Ia{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,Ia.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}Ia.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const Ra=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class La{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,r=e.length;n<r;++n){if(e[n+1]===t[n+1]){if(e[n+1]===fu&&t[n+7]!==e[n+7]){const e=t[n+7],r=new fu(this.values.splice(n+3,5))[e]().toArray();this.values.splice(n+3,0,...r)}n+=e[n+2]+2;continue}if(!t[n+1])return this;const r=(new t[n+1]).toArray(),i=e[n+2]+3;e.splice(n,i,t[n],t[n+1],t[n+2],...r),n+=e[n+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const n in t){const r=Na(t[n]),i=new r(t[n]).toArray();e.push([n,r,i.length,...i])}return e.sort(Ra),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const n=e.shift(),r=e.shift(),i=e.shift(),s=e.splice(0,i);t[n]=new r(s)}return t}}const za=[Ta,Ia,La];class Pa extends Bu{constructor(t,e=t){super(Yo("path",t),e)}array(){return this._array||(this._array=new Sa(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new Sa(t))}size(t,e){const n=Co(this,t,e);return this.attr("d",this.array().size(n.width,n.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}Pa.prototype.MorphArray=Sa,bo({Container:{path:Uo((function(t){return this.put(new Pa).plot(t||new Sa)}))}}),Bo(Pa,"Path");const Da=Object.freeze(Object.defineProperty({__proto__:null,array:function(){return this._array||(this._array=new aa(this.attr("points")))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new aa(t))},size:function(t,e){const n=Co(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}},Symbol.toStringTag,{value:"Module"}));class Fa extends Bu{constructor(t,e=t){super(Yo("polygon",t),e)}}bo({Container:{polygon:Uo((function(t){return this.put(new Fa).plot(t||new aa)}))}}),Ho(Fa,la),Ho(Fa,Da),Bo(Fa,"Polygon");class $a extends Bu{constructor(t,e=t){super(Yo("polyline",t),e)}}bo({Container:{polyline:Uo((function(t){return this.put(new $a).plot(t||new aa)}))}}),Ho($a,la),Ho($a,Da),Bo($a,"Polyline");class Ya extends Bu{constructor(t,e=t){super(Yo("rect",t),e)}}Ho(Ya,{rx:qu,ry:Vu}),bo({Container:{rect:Uo((function(t,e){return this.put(new Ya).size(t,e)}))}}),Bo(Ya,"Rect");class Ga{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const Xa={nextDraw:null,frames:new Ga,timeouts:new Ga,immediates:new Ga,timer:()=>Lo.window.performance||Lo.window.Date,transforms:[],frame(t){const e=Xa.frames.push({run:t});return null===Xa.nextDraw&&(Xa.nextDraw=Lo.window.requestAnimationFrame(Xa._draw)),e},timeout(t,e){e=e||0;const n=Xa.timer().now()+e,r=Xa.timeouts.push({run:t,time:n});return null===Xa.nextDraw&&(Xa.nextDraw=Lo.window.requestAnimationFrame(Xa._draw)),r},immediate(t){const e=Xa.immediates.push(t);return null===Xa.nextDraw&&(Xa.nextDraw=Lo.window.requestAnimationFrame(Xa._draw)),e},cancelFrame(t){null!=t&&Xa.frames.remove(t)},clearTimeout(t){null!=t&&Xa.timeouts.remove(t)},cancelImmediate(t){null!=t&&Xa.immediates.remove(t)},_draw(t){let e=null;const n=Xa.timeouts.last();for(;(e=Xa.timeouts.shift())&&(t>=e.time?e.run():Xa.timeouts.push(e),e!==n););let r=null;const i=Xa.frames.last();for(;r!==i&&(r=Xa.frames.shift());)r.run(t);let s=null;for(;s=Xa.immediates.shift();)s();Xa.nextDraw=Xa.timeouts.first()||Xa.frames.first()?Lo.window.requestAnimationFrame(Xa._draw):null}},Ba=function(t){const e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},qa=function(){const t=Lo.window;return(t.performance||t.Date).now()};class Va extends Su{constructor(t=qa){super(),this._timeSource=t,this.terminate()}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const n=Math.abs(e);return this.speed(t?-n:n)}schedule(t,e,n){if(null==t)return this._runners.map(Ba);let r=0;const i=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)r=i;else if("absolute"===n||"start"===n)r=e,e=0;else if("now"===n)r=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(r=n.start+e,e=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();r=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:r+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return Xa.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Xa.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let n=e-this._lastSourceTime;t&&(n=0);const r=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=r,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let s=this._runners.length;s--;){const t=this._runners[s],e=t.runner;this._time-t.start<=0&&e.reset()}let i=!1;for(let s=0,o=this._runners.length;s<o;s++){const t=this._runners[s],e=t.runner;let n=r;const u=this._time-t.start;if(u<=0){i=!0;continue}if(u<n&&(n=u),!e.active())continue;if(e.step(n).done){if(!0!==t.persist){e.duration()-e.time()+this._time+t.persist<this._time&&(e.unschedule(),--s,--o)}}else i=!0}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}terminate(){this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}}bo({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Va,this._timeline):(this._timeline=t,this)}}});class Wa extends Su{constructor(t){super(),this.id=Wa.id++,t="function"==typeof(t=null==t?ju:t)?new ya(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof ya,this._stepper=this._isDeclarative?t:new ga,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new mu,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,n){let r=1,i=!1,s=0;return e=e??Iu,n=n||"last","object"!=typeof(t=t??ju)||t instanceof ma||(e=t.delay??e,n=t.when??n,i=t.swing||i,r=t.times??r,s=t.wait??s,t=t.duration??ju),{duration:t,delay:e,swing:i,times:r,wait:s,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,n){const r=Wa.sanitise(t,e,n),i=new Wa(r.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(r).schedule(r.delay,r.when)}clearTransform(){return this.transforms=new mu,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new ga(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,n){return"object"==typeof t&&(e=t.swing,n=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=n||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),n=(this._time-t*e)/this._duration;return Math.min(t+n,this._times)}const n=t%1,r=e*Math.floor(t)+this._duration*n;return this.time(r)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,n=this._duration,r=this._wait,i=this._times,s=this._swing,o=this._reverse;let u;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(r+n))/(r+n)),i=e&&!o||!e&&o,u=Math.pow(-1,i)*(t%(r+n))/n+i;return Math.max(Math.min(u,1),0)},a=i*(r+n)-r;return u=e<=0?Math.round(t(1e-5)):e<a?t(e):Math.round(t(a-1e-5)),u}const a=Math.floor(this.loops()),h=s&&a%2==0;return u=a+(h&&!o||o&&h?t:1-t),this.loops(u)}progress(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}queue(t,e,n,r){this._queue.push({initialiser:t||Nu,runner:e||Nu,retarget:n,isTransform:r,initialised:!1,finished:!1});return this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,n){if(t instanceof Va||(n=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,n),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),n=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const r=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<r&&this._time>=r;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=r,this._reseted=!1;let u=!1;return(n||o)&&(this._initialise(n),this.transforms=new mu,u=this._run(o?t:e),this.fire("step",this)),this.done=this.done||u&&o,s&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,n=this._queue.length;e<n;++e){const n=this._queue[e],r=this._isDeclarative||!n.initialised&&t;t=!n.finished,r&&t&&(n.initialiser.call(this),n.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let n=0,r=this._queue.length;n<r;++n){const r=this._queue[n],i=r.runner.call(this,t);r.finished=r.finished||!0===i,e=e&&r.finished}return e}_tryRetarget(t,e,n){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,n):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const r=this.timeline();return r&&r.play(),!0}return!1}}Wa.id=0;class Ha{constructor(t=new mu,e=-1,n=!0){this.transforms=t,this.id=e,this.done=n}clearTransformsFromQueue(){}}Ho([Wa,Ha],{mergeWith(t){return new Ha(t.transforms.lmultiply(this.transforms),t.id)}});const Ua=(t,e)=>t.lmultiplyO(e),Za=t=>t.transforms;function Qa(){const t=this._transformationRunners.runners.map(Za).reduce(Ua,new mu);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Ja{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Ha).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const n=this.ids.indexOf(t+1);return this.ids.splice(n,1,t+1),this.runners.splice(n,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;e<this.runners.length;++e){const n=this.runners[e];if(t&&n.done&&t.done&&(!n._timeline||!n._timeline._runnerIds.includes(n.id))&&(!t._timeline||!t._timeline._runnerIds.includes(t.id))){this.remove(n.id);const r=n.mergeWith(t);this.edit(t.id,r),t=r,--e}else t=n}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}}bo({Element:{animate(t,e,n){const r=Wa.sanitise(t,e,n),i=this.timeline();return new Wa(r.duration).loop(r).element(this).timeline(i.play()).schedule(r.delay,r.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map(Za).reduce(Ua,new mu)},_addRunner(t){this._transformationRunners.add(t),Xa.cancelImmediate(this._frameId),this._frameId=Xa.immediate(Qa.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Ja).add(new Ha(new mu(this))))}}});Ho(Wa,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,n){if("string"==typeof e)return this.styleAttr(t,{[e]:n});let r=e;if(this._tryRetarget(t,r))return this;let i=new ja(this._stepper).to(r),s=Object.keys(r);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const n=Object.keys(e),o=(u=s,n.filter((t=>!u.includes(t))));var u;if(o.length){const e=this.element()[t](o),n=new La(i.from()).valueOf();Object.assign(n,e),i.from(n)}const a=new La(i.to()).valueOf();Object.assign(a,e),i.to(a),s=n,r=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new ja(this._stepper).to(new zu(t));return this.queue((function(){n=n.from(this.element().zoom())}),(function(t){return this.element().zoom(n.at(t),e),n.done()}),(function(t,r){e=r,n.to(t)})),this._rememberMorpher("zoom",n),this},transform(t,e,n){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const r=mu.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!r;const i=new ja(this._stepper).type(n?Ia:mu);let s,o,u,a,h;return this.queue((function(){o=o||this.element(),s=s||Ao(t,o),h=new mu(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(l){e||this.clearTransform();const{x:c,y:f}=new du(s).transform(o._currentTransform(this));let d=new mu({...t,origin:[c,f]}),p=this._isDeclarative&&u?u:h;if(n){d=d.decompose(c,f),p=p.decompose(c,f);const t=d.rotate,e=p.rotate,n=[t-360,t,t+360],r=n.map((t=>Math.abs(t-e))),i=Math.min(...r),s=r.indexOf(i);d.rotate=n[s]}e&&(r||(d.rotate=t.rotate||0),this._isDeclarative&&a&&(p.rotate=a)),i.from(p),i.to(d);const m=i.at(l);return a=m.rotate,u=new mu(m),this.addTransform(u),o._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=Ao(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},ax(t){return this._queueNumber("ax",t)},ay(t){return this._queueNumber("ay",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new zu(e),this._tryRetarget(t,e))return this;const n=new ja(this._stepper).to(e);let r=null;return this.queue((function(){r=this.element()[t](),n.from(r),n.to(r+e)}),(function(e){return this.element()[t](n.at(e)),n.done()}),(function(t){n.to(r+new zu(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new ja(this._stepper).to(e);return this.queue((function(){n.from(this.element()[t]())}),(function(e){return this.element()[t](n.at(e)),n.done()})),this._rememberMorpher(t,n),this},_queueNumber(t,e){return this._queueObject(t,new zu(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},amove(t,e){return this.ax(t).ay(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let n;return t&&e||(n=this._element.bbox()),t||(t=n.width/n.height*e),e||(e=n.height/n.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,n,r){if(4===arguments.length)return this.plot([t,e,n,r]);if(this._tryRetarget("plot",t))return this;const i=new ja(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,r){return this._queueObject("viewbox",new _u(t,e,n,r))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),Ho(Wa,{rx:qu,ry:Vu,from:na,to:ra}),Bo(Wa,"Runner");class Ka extends Gu{constructor(t,e=t){super(Yo("svg",t),e),this.namespace()}defs(){return this.isRoot()?Go(this.node.querySelector("defs"))||this.put(new Xu):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof Lo.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:To,version:"1.1"}).attr("xmlns:xlink",Ro,Io):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,Io).attr("xmlns:svgjs",null,Io)}root(){return this.isRoot()?this:super.root()}}bo({Container:{nested:Uo((function(){return this.put(new Ka)}))}}),Bo(Ka,"Svg",!0);let th=class extends Gu{constructor(t,e=t){super(Yo("symbol",t),e)}};bo({Container:{symbol:Uo((function(){return this.put(new th)}))}}),Bo(th,"Symbol");const eh=Object.freeze(Object.defineProperty({__proto__:null,amove:function(t,e){return this.ax(t).ay(e)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},build:function(t){return this._build=!!t,this},center:function(t,e,n=this.bbox()){return this.cx(t,n).cy(e,n)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)},length:function(){return this.node.getComputedTextLength()},move:function(t,e,n=this.bbox()){return this.x(t,n).y(e,n)},plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(Lo.document.createTextNode(t)),this},x:function(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)}},Symbol.toStringTag,{value:"Module"}));class nh extends Bu{constructor(t,e=t){super(Yo("text",t),e),this.dom.leading=this.dom.leading??new zu(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new zu(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const n=this.dom.leading;this.each((function(r){if(No(this.node))return;const i=Lo.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=n*new zu(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",r?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new zu(t.leading||1.3),this}writeDataToDom(){return jo(this,this.dom,{leading:1.3}),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let r=0,i=e.length;r<i;++r)"textPath"===e[r].nodeName||No(e[r])?0===r&&(n=r+1):(r!==n&&3!==e[r].nodeType&&!0===Go(e[r]).dom.newLined&&(t+="\n"),t+=e[r].textContent);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,n=(t=(t+"").split("\n")).length;e<n;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}Ho(nh,eh),bo({Container:{text:Uo((function(t=""){return this.put(new nh).text(t)})),plain:Uo((function(t=""){return this.put(new nh).plain(t)}))}}),Bo(nh,"Text");class rh extends Bu{constructor(t,e=t){super(Yo("tspan",t),e),this._build=!1}dx(t){return this.attr("dx",t)}dy(t){return this.attr("dy",t)}newLine(){this.dom.newLined=!0;const t=this.parent();if(!(t instanceof nh))return this;const e=t.index(this),n=Lo.window.getComputedStyle(this.node).getPropertyValue("font-size"),r=t.dom.leading*new zu(n);return this.dy(e?r:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}}Ho(rh,eh),bo({Tspan:{tspan:Uo((function(t=""){const e=new rh;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),Bo(rh,"Tspan");class ih extends Bu{constructor(t,e=t){super(Yo("circle",t),e)}radius(t){return this.attr("r",t)}rx(t){return this.attr("r",t)}ry(t){return this.rx(t)}size(t){return this.radius(new zu(t).divide(2))}}Ho(ih,{x:Wu,y:Hu,cx:Uu,cy:Zu,width:Qu,height:Ju}),bo({Container:{circle:Uo((function(t=0){return this.put(new ih).size(t).move(0,0)}))}}),Bo(ih,"Circle");class sh extends Gu{constructor(t,e=t){super(Yo("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return xu("svg [clip-path*="+this.id()+"]")}}bo({Container:{clip:Uo((function(){return this.defs().put(new sh)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof sh?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),Bo(sh,"ClipPath");class oh extends $u{constructor(t,e=t){super(Yo("foreignObject",t),e)}}bo({Container:{foreignObject:Uo((function(t,e){return this.put(new oh).size(t,e)}))}}),Bo(oh,"ForeignObject");const uh=Object.freeze(Object.defineProperty({__proto__:null,dmove:function(t,e){return this.children().forEach((n=>{let r;try{r=n.node instanceof Lo.window.SVGSVGElement?new _u(n.attr(["x","y","width","height"])):n.bbox()}catch(u){return}const i=new mu(n),s=i.translate(t,e).transform(i.inverse()),o=new du(r.x,r.y).transform(s);n.move(o.x,o.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,n=this.bbox()){const r=t-n.x,i=e-n.y;return this.dmove(r,i)},size:function(t,e,n=this.bbox()){const r=Co(this,t,e,n),i=r.width/n.width,s=r.height/n.height;return this.children().forEach((t=>{const e=new du(n).transform(new mu(t).inverse());t.scale(i,s,e.x,e.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}},Symbol.toStringTag,{value:"Module"}));class ah extends Gu{constructor(t,e=t){super(Yo("g",t),e)}}Ho(ah,uh),bo({Container:{group:Uo((function(){return this.put(new ah)}))}}),Bo(ah,"G");class hh extends Gu{constructor(t,e=t){super(Yo("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,Ro)}}Ho(hh,uh),bo({Container:{link:Uo((function(t){return this.put(new hh).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const n=e.index(t);return e.add(this,n),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new hh,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),Bo(hh,"A");class lh extends Gu{constructor(t,e=t){super(Yo("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return xu("svg [mask*="+this.id()+"]")}}bo({Container:{mask:Uo((function(){return this.defs().put(new lh)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof lh?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),Bo(lh,"Mask");class ch extends $u{constructor(t,e=t){super(Yo("stop",t),e)}update(t){return("number"==typeof t||t instanceof zu)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new zu(t.offset)),this}}bo({Gradient:{stop:function(t,e,n){return this.put(new ch).update(t,e,n)}}}),Bo(ch,"Stop");class fh extends $u{constructor(t,e=t){super(Yo("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,n={}){return this.rule("@font-face",{fontFamily:t,src:e,...n})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let n=t+"{";for(const r in e)n+=r.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[r]+";";return n+="}",n}(t,e))}}bo("Dom",{style(t,e){return this.put(new fh).rule(t,e)},fontface(t,e,n){return this.put(new fh).font(t,e,n)}}),Bo(fh,"Style");class dh extends nh{constructor(t,e=t){super(Yo("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let n=null;return e&&(n=e.plot(t)),null==t?n:this}track(){return this.reference("href")}}bo({Container:{textPath:Uo((function(t,e){return t instanceof nh||(t=this.text(t)),t.path(e)}))},Text:{path:Uo((function(t,e=!0){const n=new dh;let r;if(t instanceof Pa||(t=this.defs().path(t)),n.attr("href","#"+t,Ro),e)for(;r=this.node.firstChild;)n.node.appendChild(r);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:Uo((function(t){return t instanceof nh||(t=(new nh).addTo(this.parent()).text(t)),t.path(this)})),targets(){return xu("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),dh.prototype.MorphArray=Sa,Bo(dh,"TextPath");class ph extends Bu{constructor(t,e=t){super(Yo("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,Ro)}}bo({Container:{use:Uo((function(t,e){return this.put(new ph).use(t,e)}))}}),Bo(ph,"Use");const mh=$o;Ho([Ka,th,ua,oa,fa],xo("viewbox")),Ho([ca,$a,Fa,Pa],xo("marker")),Ho(nh,xo("Text")),Ho(Pa,xo("Path")),Ho(Xu,xo("Defs")),Ho([nh,rh],xo("Tspan")),Ho([Ya,ta,sa,Wa],xo("radius")),Ho(Su,xo("EventTarget")),Ho(Fu,xo("Dom")),Ho($u,xo("Element")),Ho(Bu,xo("Shape")),Ho([Gu,ea],xo("Container")),Ho(sa,xo("Gradient")),Ho(Wa,xo("Runner")),wu.extend([...new Set(wo)]),function(t=[]){za.push(...[].concat(t))}([zu,fu,_u,mu,Lu,aa,Sa,du]),Ho(za,{to(t){return(new ja).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,n,r,i){return this.fromArray(t.map((function(t,s){return r.step(t,e[s],n,i[s],i)})))}});var gh=function(t){return t.touches||[{clientX:t.clientX,clientY:t.clientY}]};Ho(Ka,{panZoom:function(t){var e,n,r,i,s,o,u,a,h,l,c,f,d=this;if(this.off(".panZoom"),!1===t)return this;var p,m,g=null!=(n=(t=null!=(e=t)?e:{}).zoomFactor)?n:2,y=null!=(r=t.zoomMin)?r:Number.MIN_VALUE,_=null!=(i=t.zoomMax)?i:Number.MAX_VALUE,v=null==(s=t.wheelZoom)||s,w=null==(o=t.pinchZoom)||o,b=null==(u=t.panning)||u,x=null!=(a=t.panButton)?a:0,E=null!=(h=t.oneFingerPan)&&h,O=null!=(l=t.margins)&&l,M=null!=(c=t.wheelZoomDeltaModeLinePixels)?c:17,k=null!=(f=t.wheelZoomDeltaModeScreenPixels)?f:53,C=!1,A=this.viewbox(),S=function(t){if(!O)return t;var e=O.top,n=O.left,r=O.bottom,i=O.right,s=d.attr(["width","height"]),o=s.width,u=s.height,a=d.node.preserveAspectRatio.baseVal,h=0,l=0,c=0,f=0;if(a.align!==a.SVG_PRESERVEASPECTRATIO_NONE){var p=o/u,m=A.width/A.height;if(m!==p){var g=a.meetOrSlice!==a.SVG_MEETORSLICE_SLICE,y=p>m?"width":"height",_="width"===y,v=g&&_||!g&&!_,w=v?p/m:m/p,b=t[y]-t[y]*w;v?a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMIN||a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMID||a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMAX?(h=b/2,l=-b/2):a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMIN||a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMID||a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMAX?l=-b:a.align!==a.SVG_PRESERVEASPECTRATIO_XMAXYMIN&&a.align!==a.SVG_PRESERVEASPECTRATIO_XMAXYMID&&a.align!==a.SVG_PRESERVEASPECTRATIO_XMAXYMAX||(h=b):a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMID||a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMID||a.align===a.SVG_PRESERVEASPECTRATIO_XMAXYMID?(c=b/2,f=-b/2):a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMIN||a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMIN||a.align===a.SVG_PRESERVEASPECTRATIO_XMAXYMIN?f=-b:a.align!==a.SVG_PRESERVEASPECTRATIO_XMINYMAX&&a.align!==a.SVG_PRESERVEASPECTRATIO_XMIDYMAX&&a.align!==a.SVG_PRESERVEASPECTRATIO_XMAXYMAX||(c=b)}}var x=A.width+A.x-n-h,E=A.x+i-t.width-l,M=A.height+A.y-e-c,k=A.y+r-t.height-f;return t.x=Math.min(x,Math.max(E,t.x)),t.y=Math.min(M,Math.max(k,t.y)),t},N=function t(e){(m=gh(e)).length<2?b&&E&&I.call(this,e):(b&&E&&R.call(this,e),e.preventDefault(),this.dispatch("pinchZoomStart",{event:e}).defaultPrevented||(this.off("touchstart.panZoom",t),C=!0,Cu(document,"touchmove.panZoom",T,this,{passive:!1}),Cu(document,"touchend.panZoom",j,this,{passive:!1})))},j=function t(e){e.preventDefault();var n=gh(e);n.length>1||(C=!1,this.dispatch("pinchZoomEnd",{event:e}),Au(document,"touchmove.panZoom",T),Au(document,"touchend.panZoom",t),this.on("touchstart.panZoom",N),n.length&&b&&E&&I.call(this,e))},T=function(t){t.preventDefault();var e=gh(t),n=this.zoom(),r=Math.sqrt(Math.pow(m[0].clientX-m[1].clientX,2)+Math.pow(m[0].clientY-m[1].clientY,2))/Math.sqrt(Math.pow(e[0].clientX-e[1].clientX,2)+Math.pow(e[0].clientY-e[1].clientY,2));(n<y&&r>1||n>_&&r<1)&&(r=1);var i={x:e[0].clientX+.5*(e[1].clientX-e[0].clientX),y:e[0].clientY+.5*(e[1].clientY-e[0].clientY)},s=m[0].clientX+.5*(m[1].clientX-m[0].clientX),o=m[0].clientY+.5*(m[1].clientY-m[0].clientY),u=this.point(i.x,i.y),a=this.point(2*i.x-s,2*i.y-o),h=new _u(this.viewbox()).transform((new mu).translate(-a.x,-a.y).scale(r,0,0).translate(u.x,u.y));S(h),this.viewbox(h),m=e,this.dispatch("zoom",{box:h,focus:a})},I=function t(e){e.type.indexOf("mouse")>-1&&e.button!==x&&e.which!==x+1||(e.preventDefault(),this.off("mousedown.panZoom",t),m=gh(e),C||(this.dispatch("panStart",{event:e}),p={x:m[0].clientX,y:m[0].clientY},Cu(document,"touchmove.panZoom mousemove.panZoom",L,this,{passive:!1}),Cu(document,"touchend.panZoom mouseup.panZoom",R,this,{passive:!1})))},R=function t(e){e.preventDefault(),Au(document,"touchmove.panZoom mousemove.panZoom",L),Au(document,"touchend.panZoom mouseup.panZoom",t),this.on("mousedown.panZoom",I),this.dispatch("panEnd",{event:e})},L=function(t){t.preventDefault();var e=gh(t),n={x:e[0].clientX,y:e[0].clientY},r=this.point(n.x,n.y),i=this.point(p.x,p.y),s=[i.x-r.x,i.y-r.y];if(s[0]||s[1]){var o=new _u(this.viewbox()).transform((new mu).translate(s[0],s[1]));p=n,S(o),this.dispatch("panning",{box:o,event:t}).defaultPrevented||this.viewbox(o)}};return v&&this.on("wheel.panZoom",(function(t){var e;switch(t.preventDefault(),t.deltaMode){case 1:e=t.deltaY*M;break;case 2:e=t.deltaY*k;break;default:e=t.deltaY}var n=Math.pow(1+g,-1*e/100)*this.zoom(),r=this.point(t.clientX,t.clientY);if(n>_&&(n=_),n<y&&(n=y),this.dispatch("zoom",{level:n,focus:r}).defaultPrevented)return this;if(this.zoom(n,r),O){var i=S(this.viewbox());this.viewbox(i)}}),this,{passive:!1}),w&&this.on("touchstart.panZoom",N,this,{passive:!1}),b&&this.on("mousedown.panZoom",I,this,{passive:!1}),this}});class yh{constructor(t,e,n,r){this.width=e,this.height=n,this.canvas=mh().addTo(t).size("100%","100%").viewbox(`0 0 ${e} ${n}`).panZoom({zoomFactor:.2,zoomMin:.1}).attr({style:r})}static drawCircle(t={}){const e=new ih;return e.attr(t),e}static drawGroup(t=0,e=0,n,r){const i=new ah;return i.attr({"data-parent":r,"data-self":n,transform:`translate(${t}, ${e})`}),i}static drawPath(t,{borderColor:e=po.borderColor,id:n=""}={}){const r=new Pa({d:t});return r.id(n),r.fill("none").stroke({color:e,width:1}),r}static drawRect({color:t="#fefefe",height:e=0,opacity:n=1,radius:r=0,width:i=0,x1:s,y1:o}={}){const u=new Ya;return u.attr({height:e,opacity:n,rx:r,ry:r,width:i,x:s??void 0,y:o??void 0}),u.fill(t),u}static drawTemplate(t,{nodeHeight:e,nodeWidth:n}={}){const r=new oh({height:e,width:n}),i=document.createElement("div");return i.innerHTML=t,i.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),r.add(i),r}static drawText(t="",{dx:e,dy:n,x:r,y:i}){const s=new nh;return s.font({fill:"#f06"}),s.tspan(t),void 0!==r&&void 0!==i&&s.move(r,i),void 0!==e&&void 0!==n&&s.attr({dx:e,dy:n}),s}add(t){this.canvas.add(t)}clear(){this.canvas.clear().viewbox(`0 0 ${this.width} ${this.height}`)}exportToSvg(){new nt(this.canvas,"apextree").exportToSVG()}resetViewBox(){this.canvas.viewbox(`0 0 ${this.width} ${this.height}`)}updateViewBox(t,e,n,r){this.canvas.viewbox(`${t} ${e} ${n} ${r}`)}zoom(t){const e=this.canvas.zoom()+t;e>=.1&&this.canvas.zoom(e)}}const _h={marginx:100,marginy:100,rankdir:"TB"};class vh extends yh{constructor(t,e){super(t,e.viewPortWidth,e.viewPortHeight,e.canvasStyle),this.element=t,this.options=e}calculateLayout(){const{childrenSpacing:t,siblingSpacing:e}=this.options,n=fo[this.options.direction];this.graph.setGraph({..._h,nodesep:e,rankdir:n,ranksep:t}),ao.layout(this.graph)}resetGraph(){this.graph=new ao.graphlib.Graph,this.graph.setDefaultEdgeLabel((function(){return{}}))}setGraphNodesAndEdges(t){this.resetGraph(),this.setNodesRecursively(t)}setNodesRecursively(t,e){var n;const{direction:r,groupLeafNodesSpacing:i,nodeHeight:s,nodeWidth:o}=this.options,u=this.nodeMap[t],a={...u,parent:e||void 0};if(this.graph.setNode(t,{...a,height:s,width:o}),e&&this.graph.setEdge(e,t),u.onlyLeafNodes){const e=co[r].leafWidth({childLength:u.children.length,childrenSpacing:i,nodeWidth:o}),n=co[r].leafHeight({childLength:u.children.length,childrenSpacing:i,nodeHeight:s});this.graph.setNode(`${t}_leafs`,{...a,height:n,id:`${t}_leafs`,parent:t,width:e}),this.graph.setEdge(t,`${t}_leafs`)}else if(null==(n=u.children)?void 0:n.length)for(const h of u.children)this.setNodesRecursively(h,t)}changeLayout(t="top"){this.options={...this.options,direction:t},this.setGraphNodesAndEdges(this.data.id),this.render({keepOldPosition:!1})}collapse(t){const e=this.nodeMap[t];(null==e?void 0:e.children)&&(this.nodeMap[t]={...e,children:void 0,hiddenChildren:e.children},this.setGraphNodesAndEdges(this.data.id),this.render({keepOldPosition:!0}))}construct(t){if(this.nodeMap=_o(t),this.data=t,this.options.groupLeafNodes){(function(t){const e=[];function n(t){return!t.children||0===t.children.length}return function t(r){if(r.children&&0!==r.children.length){r.children.every(n)&&e.push(r);for(const e of r.children)t(e)}}(t),e})(t).forEach((t=>{this.nodeMap[t.id]={...this.nodeMap[t.id],onlyLeafNodes:!0},this.nodeMap[`${t.id}_leafs`]={...this.nodeMap[t.id],id:`${t.id}_leafs`,onlyLeafNodes:!0,parent:t.id},this.nodeMap[t.id].children.forEach((e=>{this.nodeMap[e]={...this.nodeMap[e],parent:`${t.id}_leafs`}}))}))}this.setGraphNodesAndEdges(t.id)}expand(t){const e=this.nodeMap[t];(null==e?void 0:e.hiddenChildren)&&(this.nodeMap[t]={...e,children:e.hiddenChildren,hiddenChildren:void 0},this.setGraphNodesAndEdges(this.data.id),this.render({keepOldPosition:!0}))}fitScreen(){const{height:t,width:e}=this.graph.graph();this.updateViewBox(0,0,e,t)}render({keepOldPosition:t=!1}={}){const e=this.canvas.viewbox();this.clear(),this.calculateLayout();const{containerClassName:n,enableTooltip:r,fontColor:i,fontFamily:s,fontSize:o,fontWeight:u,tooltipId:a}=this.options,h=et({color:i,fontFamily:s,fontSize:o,fontWeight:u}),l=yh.drawGroup(0,0,n);l.attr("style",h),l.id(n),console.log("graph",this.graph);const c=this.graph.nodes();if(this.graph.edges().forEach((t=>{this.renderEdge(t,l)})),c.forEach((t=>{t.endsWith("_leafs")?this.renderGroupedLeafNodes(t,l):this.renderNode(t,l)})),this.add(l),this.fitScreen(),t&&this.updateViewBox(e.x,e.y,e.width,e.height),r){const t=((t="apex-tooltip-container")=>{const e=document.getElementById(t)||document.createElement("div");return e.id=t,e})(a);(document.body||document.getElementsByTagName("body")[0]).append(t)}}renderEdge(t,e){const n=this.graph.node(t.w),r=this.graph.node(t.v),{nodeHeight:i,nodeWidth:s}=this.options,o=((t,e,n,r,i)=>{if(!(null==t?void 0:t.parent))return null;const{calculateEdge:s,edgeMidX:o,edgeMidY:u,edgeParentX:a,edgeParentY:h,edgeX:l,edgeY:c}=co[i];return s({x:l({node:t,nodeHeight:r,nodeWidth:n}),y:c({node:t,nodeHeight:r,nodeWidth:n})},{x:a({nodeHeight:r,nodeWidth:n,parent:e}),y:h({nodeHeight:r,nodeWidth:n,parent:e})},{x:o({node:t,nodeHeight:r,nodeWidth:n}),y:u({node:t,nodeHeight:r,nodeWidth:n})},{sy:0})})(n,r,s,i,this.options.direction);if(!o)return;const u=yh.drawPath(o,{id:`${t.v}-${t.w}`});e.add(u)}renderGroupedLeafNodes(t,e){const n=this.graph.node(t),{options:r}=this,{direction:i}=r,s=co[i].leafGroupX({node:n}),o=co[i].leafGroupY({node:n}),u=yh.drawGroup(s,o,n.id,n.parent);n.children.forEach(((t,e)=>{this.renderLeafNode(t,u,e)})),e.add(u)}renderLeafNode(t,e,n){const r=this.nodeMap[t],{options:i}=this,{borderRadius:s,direction:o,enableTooltip:u,groupLeafNodesSpacing:a,highlightOnHover:h,nodeTemplate:l,tooltipTemplate:c}=i,{borderColor:f,borderStyle:d,borderWidth:p,fontColor:m,fontFamily:g,fontSize:y,fontWeight:_,nodeBGColor:v,nodeClassName:w,nodeHeight:b,nodeStyle:x,nodeWidth:E,tooltipBGColor:O,tooltipBorderColor:M,tooltipId:k,tooltipMaxWidth:C}={...i,...r.options},A=this,S=co[o].leafX({childrenSpacing:a,index:n,nodeHeight:b,nodeWidth:E}),N=co[o].leafY({childrenSpacing:a,index:n,nodeHeight:b,nodeWidth:E}),j=yh.drawGroup(S,N,r.id,r.parent),T=l(r[i.contentKey]),I=yh.drawTemplate(T,{nodeHeight:b,nodeWidth:E}),R=et({color:m,fontFamily:g,fontSize:y,fontWeight:_}),L=et({backgroundColor:v,borderColor:f,borderRadius:s,borderStyle:d,borderWidth:`${p}px`,boxSizing:"border-box",height:"100%"});if(I.first().attr("style",L.concat(x)),I.attr("class",w),j.attr("style",R),j.add(I),h&&(j.on("mouseover",(function(){const{self:t}=this.node.dataset,e=A.nodeMap[t];e&&go(e,A.nodeMap,!0,i)})),j.on("mouseout",(function(){const{self:t}=this.node.dataset,e=A.nodeMap[t];e&&go(e,A.nodeMap,!1,i)}))),u){const t=c?c(r[this.options.contentKey]):T;j.on("mousemove",(e=>{const n=tt({bgColor:O,borderColor:M,maxWidth:C,padding:c?0:10,x:e.pageX,y:e.pageY});K(k,n,t)})),j.on("mouseout",(t=>{"svg"===t.relatedTarget.tagName&&K(k)}))}e.add(j)}renderNode(t,e){var n,r;const i=this.graph.node(t),{options:s}=this,{borderRadius:o,enableExpandCollapse:u,enableTooltip:a,highlightOnHover:h,nodeHeight:l,nodeTemplate:c,nodeWidth:f,tooltipTemplate:d}=s,{borderColor:p,borderStyle:m,borderWidth:g,fontColor:y,fontFamily:_,fontSize:v,fontWeight:w,nodeBGColor:b,nodeClassName:x,nodeStyle:E,tooltipBGColor:O,tooltipBorderColor:M,tooltipId:k,tooltipMaxWidth:C}={...s,...i.options},{height:A,width:S,x:N,y:j}=i,T=this,I=yh.drawGroup(N-f/2,j-l/2,i.id,i.parent),R=c(i[s.contentKey]),L=yh.drawTemplate(R,{nodeHeight:A,nodeWidth:S}),z=et({color:y,fontFamily:_,fontSize:v,fontWeight:w}),P=et({backgroundColor:b,borderColor:p,borderRadius:o,borderStyle:m,borderWidth:`${g}px`,boxSizing:"border-box",height:"100%"});if(L.first().attr("style",P.concat(E)),L.attr("class",x),I.attr("style",z),I.add(L),h&&(I.on("mouseover",(function(){const{self:t}=this.node.dataset,e=T.nodeMap[t];e&&go(e,T.nodeMap,!0,s)})),I.on("mouseout",(function(){const{self:t}=this.node.dataset,e=T.nodeMap[t];e&&go(e,T.nodeMap,!1,s)}))),a){const t=d?d(i[this.options.contentKey]):R;I.on("mousemove",(e=>{const n=tt({bgColor:O,borderColor:M,maxWidth:C,padding:d?0:10,x:e.pageX,y:e.pageY});K(k,n,t)})),I.on("mouseout",(t=>{"svg"===t.relatedTarget.tagName&&K(k)}))}if(e.add(I),(i.children||i.hiddenChildren)&&u&&((null==(n=i.children)?void 0:n.length)||(null==(r=i.hiddenChildren)?void 0:r.length))){const t=7,n=yh.drawGroup(N+f/2-t,j+l-t,i.id),r=yh.drawCircle({cx:t,cy:t,r:t,style:"fill: #FFF; cursor: pointer;"});n.data("expanded",!1),n.add(r),i.hiddenChildren?n.add('<svg height="14" viewBox="0 0 24 24" width="14" xmlns="http://www.w3.org/2000/svg">\n <path d="m12 0a12 12 0 1 0 12 12 12.013 12.013 0 0 0 -12-12zm0 22a10 10 0 1 1 10-10 10.011 10.011 0 0 1 -10 10zm5-10a1 1 0 0 1 -1 1h-3v3a1 1 0 0 1 -2 0v-3h-3a1 1 0 0 1 0-2h3v-3a1 1 0 0 1 2 0v3h3a1 1 0 0 1 1 1z"/>\n</svg>'):n.add('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="14" height="14">\n <path d="m12,0C5.383,0,0,5.383,0,12s5.383,12,12,12,12-5.383,12-12S18.617,0,12,0Zm0,22c-5.514,0-10-4.486-10-10S6.486,2,12,2s10,4.486,10,10-4.486,10-10,10Zm5-10c0,.552-.448,1-1,1h-8c-.552,0-1-.448-1-1s.448-1,1-1h8c.552,0,1,.448,1,1Z"/>\n</svg>\n'),n.on("click",(function(){i.hiddenChildren?T.expand(this.node.dataset.self):T.collapse(this.node.dataset.self)})),e.add(n)}}}return class{constructor(t,e){this.element=t,this.options={...po,...e};const{height:n,width:r}=this.options;this.graph=new vh(this.element,this.options);let i=!1,s=0;"string"==typeof r&&/^\d+(\.\d+)?%$/.test(r)?(s=Number(r.substring(0,r.length-1)),i=!0):s=Number(r);const o="auto"===n?s/1.6:n;this.element.style.width=`${s}${i?"%":"px"}`,this.element.style.height=`${o}${i?"%":"px"}`,this.element.style.position="relative"}render(t){if(!this.element)throw new Error("Element not found");if(this.graph.construct(t),this.graph.render(),this.options.enableToolbar){new ur(this.element).render({enableExport:!0,enableFitscreen:!0,enableZoom:!0,onExport:this.graph.exportToSvg.bind(this.graph),onFitscreen:this.graph.fitScreen.bind(this.graph),onZoom:this.graph.zoom.bind(this.graph)})}return this.graph}}}));
|